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 @@
import("//third_party/blink/renderer/core/core.gni")
blink_core_sources("css") {
configs += [ "//build/config/compiler:noshadowing" ]
sources = [
"abstract_property_set_css_style_declaration.cc",
"abstract_property_set_css_style_declaration.h",
......
......@@ -97,9 +97,10 @@ StyleImage* CSSImageValue::CacheImage(
if (base::FeatureList::IsEnabled(blink::features::kSubresourceRedirect) &&
params.Url().ProtocolIsInHTTPFamily() &&
GetNetworkStateNotifier().SaveDataEnabled()) {
auto& resource_request = params.MutableResourceRequest();
resource_request.SetPreviewsState(resource_request.GetPreviewsState() |
PreviewsTypes::kSubresourceRedirectOn);
auto& subresource_request = params.MutableResourceRequest();
subresource_request.SetPreviewsState(
subresource_request.GetPreviewsState() |
PreviewsTypes::kSubresourceRedirectOn);
}
if (origin_clean_ != OriginClean::kTrue)
......
......@@ -49,7 +49,7 @@ void CachedMatchedProperties::Set(
const ComputedStyle& style,
const ComputedStyle& parent_style,
const MatchedPropertiesVector& properties,
const HashSet<CSSPropertyName>& dependencies) {
const HashSet<CSSPropertyName>& new_dependencies) {
for (const auto& new_matched_properties : properties) {
matched_properties.push_back(new_matched_properties.properties);
matched_properties_types.push_back(new_matched_properties.types_);
......@@ -63,20 +63,20 @@ void CachedMatchedProperties::Set(
DCHECK(
RuntimeEnabledFeatures::CSSMatchedPropertiesCacheDependenciesEnabled() ||
dependencies.IsEmpty());
if (dependencies.size()) {
DCHECK(dependencies.size() <= StyleResolverState::kMaxDependencies);
new_dependencies.IsEmpty());
if (new_dependencies.size()) {
DCHECK(new_dependencies.size() <= StyleResolverState::kMaxDependencies);
// Plus one for g_null_atom.
this->dependencies =
std::make_unique<AtomicString[]>(dependencies.size() + 1);
dependencies =
std::make_unique<AtomicString[]>(new_dependencies.size() + 1);
size_t index = 0;
for (const CSSPropertyName& name : dependencies) {
DCHECK_LT(index, dependencies.size());
this->dependencies[index++] = name.ToAtomicString();
for (const CSSPropertyName& name : new_dependencies) {
DCHECK_LT(index, new_dependencies.size());
dependencies[index++] = name.ToAtomicString();
}
DCHECK_EQ(index, dependencies.size());
this->dependencies[index] = g_null_atom;
DCHECK_EQ(index, new_dependencies.size());
dependencies[index] = g_null_atom;
}
}
......
......@@ -58,7 +58,7 @@ class CORE_EXPORT CachedMatchedProperties final
void Set(const ComputedStyle&,
const ComputedStyle& parent_style,
const MatchedPropertiesVector&,
const HashSet<CSSPropertyName>& dependencies);
const HashSet<CSSPropertyName>& new_dependencies);
void Clear();
// True if the computed value for each dependency is equal for the
......
......@@ -520,8 +520,7 @@ FontSelectionValue StyleBuilderConverterBase::ConvertFontStyle(
return FontSelectionValue(
To<CSSPrimitiveValue>(values->Item(0)).ComputeDegrees());
} else {
const CSSIdentifierValue* identifier_value =
style_range_value->GetFontStyleValue();
identifier_value = style_range_value->GetFontStyleValue();
if (identifier_value->GetValueID() == CSSValueID::kNormal)
return NormalSlopeValue();
if (identifier_value->GetValueID() == CSSValueID::kItalic ||
......@@ -1007,14 +1006,15 @@ void StyleBuilderConverter::ConvertGridTrackList(
DynamicTo<cssvalue::CSSGridIntegerRepeatValue>(curr_value.Get())) {
size_t repetitions = repeated_values->Repetitions();
for (size_t i = 0; i < repetitions; ++i) {
for (auto curr_value : *repeated_values)
convert_line_name_or_track_size(*curr_value);
for (auto curr_repeat_value : *repeated_values)
convert_line_name_or_track_size(*curr_repeat_value);
}
if (RuntimeEnabledFeatures::LayoutNGGridEnabled()) {
Vector<GridTrackSize> repeater_sizes;
for (auto curr_value : *repeated_values) {
if (!curr_value->IsGridLineNamesValue()) {
repeater_sizes.push_back(ConvertGridTrackSize(state, *curr_value));
for (auto curr_repeat_value : *repeated_values) {
if (!curr_repeat_value->IsGridLineNamesValue()) {
repeater_sizes.push_back(
ConvertGridTrackSize(state, *curr_repeat_value));
}
}
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