Commit a7a5280e authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

Compile core/css/ with -Wshadow.

Bug: 294205
Change-Id: I66e357a12e290fa4717db6cb27ef746791d4a167
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2460889Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815220}
parent 92074bee
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
import("//third_party/blink/renderer/core/core.gni") import("//third_party/blink/renderer/core/core.gni")
blink_core_sources("css") { blink_core_sources("css") {
configs += [ "//build/config/compiler:noshadowing" ]
sources = [ sources = [
"abstract_property_set_css_style_declaration.cc", "abstract_property_set_css_style_declaration.cc",
"abstract_property_set_css_style_declaration.h", "abstract_property_set_css_style_declaration.h",
......
...@@ -97,8 +97,9 @@ StyleImage* CSSImageValue::CacheImage( ...@@ -97,8 +97,9 @@ StyleImage* CSSImageValue::CacheImage(
if (base::FeatureList::IsEnabled(blink::features::kSubresourceRedirect) && if (base::FeatureList::IsEnabled(blink::features::kSubresourceRedirect) &&
params.Url().ProtocolIsInHTTPFamily() && params.Url().ProtocolIsInHTTPFamily() &&
GetNetworkStateNotifier().SaveDataEnabled()) { GetNetworkStateNotifier().SaveDataEnabled()) {
auto& resource_request = params.MutableResourceRequest(); auto& subresource_request = params.MutableResourceRequest();
resource_request.SetPreviewsState(resource_request.GetPreviewsState() | subresource_request.SetPreviewsState(
subresource_request.GetPreviewsState() |
PreviewsTypes::kSubresourceRedirectOn); PreviewsTypes::kSubresourceRedirectOn);
} }
......
...@@ -49,7 +49,7 @@ void CachedMatchedProperties::Set( ...@@ -49,7 +49,7 @@ void CachedMatchedProperties::Set(
const ComputedStyle& style, const ComputedStyle& style,
const ComputedStyle& parent_style, const ComputedStyle& parent_style,
const MatchedPropertiesVector& properties, const MatchedPropertiesVector& properties,
const HashSet<CSSPropertyName>& dependencies) { const HashSet<CSSPropertyName>& new_dependencies) {
for (const auto& new_matched_properties : properties) { for (const auto& new_matched_properties : properties) {
matched_properties.push_back(new_matched_properties.properties); matched_properties.push_back(new_matched_properties.properties);
matched_properties_types.push_back(new_matched_properties.types_); matched_properties_types.push_back(new_matched_properties.types_);
...@@ -63,20 +63,20 @@ void CachedMatchedProperties::Set( ...@@ -63,20 +63,20 @@ void CachedMatchedProperties::Set(
DCHECK( DCHECK(
RuntimeEnabledFeatures::CSSMatchedPropertiesCacheDependenciesEnabled() || RuntimeEnabledFeatures::CSSMatchedPropertiesCacheDependenciesEnabled() ||
dependencies.IsEmpty()); new_dependencies.IsEmpty());
if (dependencies.size()) { if (new_dependencies.size()) {
DCHECK(dependencies.size() <= StyleResolverState::kMaxDependencies); DCHECK(new_dependencies.size() <= StyleResolverState::kMaxDependencies);
// Plus one for g_null_atom. // Plus one for g_null_atom.
this->dependencies = dependencies =
std::make_unique<AtomicString[]>(dependencies.size() + 1); std::make_unique<AtomicString[]>(new_dependencies.size() + 1);
size_t index = 0; size_t index = 0;
for (const CSSPropertyName& name : dependencies) { for (const CSSPropertyName& name : new_dependencies) {
DCHECK_LT(index, dependencies.size()); DCHECK_LT(index, new_dependencies.size());
this->dependencies[index++] = name.ToAtomicString(); dependencies[index++] = name.ToAtomicString();
} }
DCHECK_EQ(index, dependencies.size()); DCHECK_EQ(index, new_dependencies.size());
this->dependencies[index] = g_null_atom; dependencies[index] = g_null_atom;
} }
} }
......
...@@ -58,7 +58,7 @@ class CORE_EXPORT CachedMatchedProperties final ...@@ -58,7 +58,7 @@ class CORE_EXPORT CachedMatchedProperties final
void Set(const ComputedStyle&, void Set(const ComputedStyle&,
const ComputedStyle& parent_style, const ComputedStyle& parent_style,
const MatchedPropertiesVector&, const MatchedPropertiesVector&,
const HashSet<CSSPropertyName>& dependencies); const HashSet<CSSPropertyName>& new_dependencies);
void Clear(); void Clear();
// True if the computed value for each dependency is equal for the // True if the computed value for each dependency is equal for the
......
...@@ -520,8 +520,7 @@ FontSelectionValue StyleBuilderConverterBase::ConvertFontStyle( ...@@ -520,8 +520,7 @@ FontSelectionValue StyleBuilderConverterBase::ConvertFontStyle(
return FontSelectionValue( return FontSelectionValue(
To<CSSPrimitiveValue>(values->Item(0)).ComputeDegrees()); To<CSSPrimitiveValue>(values->Item(0)).ComputeDegrees());
} else { } else {
const CSSIdentifierValue* identifier_value = identifier_value = style_range_value->GetFontStyleValue();
style_range_value->GetFontStyleValue();
if (identifier_value->GetValueID() == CSSValueID::kNormal) if (identifier_value->GetValueID() == CSSValueID::kNormal)
return NormalSlopeValue(); return NormalSlopeValue();
if (identifier_value->GetValueID() == CSSValueID::kItalic || if (identifier_value->GetValueID() == CSSValueID::kItalic ||
...@@ -1007,14 +1006,15 @@ void StyleBuilderConverter::ConvertGridTrackList( ...@@ -1007,14 +1006,15 @@ void StyleBuilderConverter::ConvertGridTrackList(
DynamicTo<cssvalue::CSSGridIntegerRepeatValue>(curr_value.Get())) { DynamicTo<cssvalue::CSSGridIntegerRepeatValue>(curr_value.Get())) {
size_t repetitions = repeated_values->Repetitions(); size_t repetitions = repeated_values->Repetitions();
for (size_t i = 0; i < repetitions; ++i) { for (size_t i = 0; i < repetitions; ++i) {
for (auto curr_value : *repeated_values) for (auto curr_repeat_value : *repeated_values)
convert_line_name_or_track_size(*curr_value); convert_line_name_or_track_size(*curr_repeat_value);
} }
if (RuntimeEnabledFeatures::LayoutNGGridEnabled()) { if (RuntimeEnabledFeatures::LayoutNGGridEnabled()) {
Vector<GridTrackSize> repeater_sizes; Vector<GridTrackSize> repeater_sizes;
for (auto curr_value : *repeated_values) { for (auto curr_repeat_value : *repeated_values) {
if (!curr_value->IsGridLineNamesValue()) { if (!curr_repeat_value->IsGridLineNamesValue()) {
repeater_sizes.push_back(ConvertGridTrackSize(state, *curr_value)); repeater_sizes.push_back(
ConvertGridTrackSize(state, *curr_repeat_value));
} }
} }
track_sizes.NGTrackList().AddRepeater(repeater_sizes, repetitions); track_sizes.NGTrackList().AddRepeater(repeater_sizes, repetitions);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment