Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
[css-align] Add use counter for the 'legacy' alignment
Browse files Browse the repository at this point in the history
The CSS WG resolved in May 2017 to replace the 'auto' keyword by
'legacy' in the CSS syntax of the justify-items property.

w3c/csswg-drafts#1318

According to the spec, the 'auto' (now 'legacy') value applied to the
justify-items property should be resolved, during the style resolution
phase before layout, with its inherited value if this includes the
'legacy' keyword (plus 'left', 'right', or 'center').

There is no behavior change in the affected property due to this syntax
change.

Since 'auto' (now 'legacy') is the default value of the justify-items
property, this change has a relative big impact. However, we are only
interested on evaluate the use of the 'legacy' alignment, which has to
be explicitly set in the parent element.

Change-Id: Id2ae6735fb28ac44062aaec79828ce97d7edd5d6
Reviewed-on: https://chromium-review.googlesource.com/886365
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/master@{#532380}
  • Loading branch information
javifernandez authored and Commit Bot committed Jan 29, 2018
1 parent 44b8740 commit d1fe575
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Expand Up @@ -627,8 +627,11 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state,
// 'auto' computes to the the inherited value. Otherwise, 'auto' computes to
// 'normal'.
if (style.JustifyItemsPosition() == ItemPosition::kAuto) {
if (parent_style.JustifyItemsPositionType() == ItemPositionType::kLegacy)
if (parent_style.JustifyItemsPositionType() == ItemPositionType::kLegacy) {
UseCounter::Count(element->GetDocument(),
WebFeature::kCSSLegacyAlignment);
style.SetJustifyItems(parent_style.JustifyItems());
}
}

AdjustEffectiveTouchAction(style, parent_style, element, is_svg_root);
Expand Down
1 change: 1 addition & 0 deletions third_party/WebKit/public/platform/web_feature.mojom
Expand Up @@ -1861,6 +1861,7 @@ enum WebFeature {
kImageDecodeAPI = 2348,
kV8HTMLElement_Autocapitalize_AttributeGetter = 2349,
kV8HTMLElement_Autocapitalize_AttributeSetter = 2350,
kCSSLegacyAlignment = 2351,

// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
Expand Down
1 change: 1 addition & 0 deletions tools/metrics/histograms/enums.xml
Expand Up @@ -17701,6 +17701,7 @@ Called by update_net_error_codes.py.-->
<int value="2348" label="ImageDecodeAPI"/>
<int value="2349" label="V8HTMLElement_Autocapitalize_AttributeGetter"/>
<int value="2350" label="V8HTMLElement_Autocapitalize_AttributeSetter"/>
<int value="2351" label="CSSLegacyAlignment"/>
</enum>

<enum name="FeedbackSource">
Expand Down

0 comments on commit d1fe575

Please sign in to comment.