Commit d1fe575d authored by Javier Fernandez's avatar Javier Fernandez Committed by Commit Bot

[css-align] Add use counter for the 'legacy' alignment

The CSS WG resolved in May 2017 to replace the 'auto' keyword by
'legacy' in the CSS syntax of the justify-items property.

https://github.com/w3c/csswg-drafts/issues/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/886365Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/master@{#532380}
parent 44b8740c
......@@ -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);
......
......@@ -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.
......
......@@ -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">
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