Title: [217536] trunk
- Revision
- 217536
- Author
- [email protected]
- Date
- 2017-05-29 07:09:37 -0700 (Mon, 29 May 2017)
Log Message
Use the parent box style to adjust RenderStyle for alignment.
https://bugs.webkit.org/show_bug.cgi?id=172215
Patch by Emilio Cobos Álvarez <[email protected]> on 2017-05-29
Reviewed by Antti Koivisto.
Source/WebCore:
The css-flexbox spec defined align-self in terms of the parent
element, which is what this code did.
The css-align spec defines these properties in terms of the style of
the containing box instead, which means display: contents styles
should not be used for this adjustment, but the parent box style
instead.
For example, align-items is defined as:
> This property specifies the default align-self for all of the boxes
> (including anonymous boxes) participating in this box’s formatting
> context.
Note that the css-align spec was recently updated to align (no pun
intended) with Gecko, and make the |auto| value compute to itself.
This patch puts us in a more recent spec than before, but not totally
up-to-date.
Tests: imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-001.html
imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-002.html
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::adjustStyleForAlignment):
LayoutTests:
* TestExpectations:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (217535 => 217536)
--- trunk/LayoutTests/ChangeLog 2017-05-29 10:37:58 UTC (rev 217535)
+++ trunk/LayoutTests/ChangeLog 2017-05-29 14:09:37 UTC (rev 217536)
@@ -1,3 +1,12 @@
+2017-05-29 Emilio Cobos Álvarez <[email protected]>
+
+ Use the parent box style to adjust RenderStyle for alignment.
+ https://bugs.webkit.org/show_bug.cgi?id=172215
+
+ Reviewed by Antti Koivisto.
+
+ * TestExpectations:
+
2017-05-29 Per Arne Vollan <[email protected]>
Unreviewed Windows test gardening, update expected results after r217418.
Modified: trunk/LayoutTests/TestExpectations (217535 => 217536)
--- trunk/LayoutTests/TestExpectations 2017-05-29 10:37:58 UTC (rev 217535)
+++ trunk/LayoutTests/TestExpectations 2017-05-29 14:09:37 UTC (rev 217536)
@@ -1160,7 +1160,6 @@
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-before-after-001.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-table-002-none.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-flex-003.html [ ImageOnlyFailure ]
-webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-001.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-table-001.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-before-after-002.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-table-002.html [ ImageOnlyFailure ]
@@ -1169,7 +1168,6 @@
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-flex-002-none.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-flex-002.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-before-after-001.html [ ImageOnlyFailure ]
-webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-002.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-flow-root-001.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-inline-flex-001-inline.html [ ImageOnlyFailure ]
webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-flex-003-none.html [ ImageOnlyFailure ]
Modified: trunk/Source/WebCore/ChangeLog (217535 => 217536)
--- trunk/Source/WebCore/ChangeLog 2017-05-29 10:37:58 UTC (rev 217535)
+++ trunk/Source/WebCore/ChangeLog 2017-05-29 14:09:37 UTC (rev 217536)
@@ -1,3 +1,36 @@
+2017-05-29 Emilio Cobos Álvarez <[email protected]>
+
+ Use the parent box style to adjust RenderStyle for alignment.
+ https://bugs.webkit.org/show_bug.cgi?id=172215
+
+ Reviewed by Antti Koivisto.
+
+ The css-flexbox spec defined align-self in terms of the parent
+ element, which is what this code did.
+
+ The css-align spec defines these properties in terms of the style of
+ the containing box instead, which means display: contents styles
+ should not be used for this adjustment, but the parent box style
+ instead.
+
+ For example, align-items is defined as:
+
+ > This property specifies the default align-self for all of the boxes
+ > (including anonymous boxes) participating in this box’s formatting
+ > context.
+
+ Note that the css-align spec was recently updated to align (no pun
+ intended) with Gecko, and make the |auto| value compute to itself.
+ This patch puts us in a more recent spec than before, but not totally
+ up-to-date.
+
+ Tests: imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-001.html
+ imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-002.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::adjustRenderStyle):
+ (WebCore::StyleResolver::adjustStyleForAlignment):
+
2017-05-28 Dan Bernstein <[email protected]>
[Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (217535 => 217536)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2017-05-29 10:37:58 UTC (rev 217535)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2017-05-29 14:09:37 UTC (rev 217536)
@@ -1042,10 +1042,10 @@
style.setDisplay(BLOCK);
}
- adjustStyleForAlignment(style, parentStyle);
+ adjustStyleForAlignment(style, *parentBoxStyle);
}
-void StyleResolver::adjustStyleForAlignment(RenderStyle& style, const RenderStyle& parentStyle)
+void StyleResolver::adjustStyleForAlignment(RenderStyle& style, const RenderStyle& parentBoxStyle)
{
// To avoid needing to copy the StyleRareNonInheritedData, we repurpose the 'auto'
// flag to not just mean 'auto' prior to running adjustRenderStyle but also
@@ -1055,23 +1055,23 @@
// 'auto' computes to the the inherited value. Otherwise, 'auto' computes to
// 'normal'.
if (style.justifyItems().position() == ItemPositionAuto) {
- if (parentStyle.justifyItems().positionType() == LegacyPosition)
- style.setJustifyItems(parentStyle.justifyItems());
+ if (parentBoxStyle.justifyItems().positionType() == LegacyPosition)
+ style.setJustifyItems(parentBoxStyle.justifyItems());
}
// The 'auto' keyword computes the computed value of justify-items on the
// parent (minus any legacy keywords), or 'normal' if the box has no parent.
if (style.justifySelf().position() == ItemPositionAuto) {
- if (parentStyle.justifyItems().positionType() == LegacyPosition)
- style.setJustifySelfPosition(parentStyle.justifyItems().position());
- else if (parentStyle.justifyItems().position() != ItemPositionAuto)
- style.setJustifySelf(parentStyle.justifyItems());
+ if (parentBoxStyle.justifyItems().positionType() == LegacyPosition)
+ style.setJustifySelfPosition(parentBoxStyle.justifyItems().position());
+ else if (parentBoxStyle.justifyItems().position() != ItemPositionAuto)
+ style.setJustifySelf(parentBoxStyle.justifyItems());
}
// The 'auto' keyword computes the computed value of align-items on the parent
// or 'normal' if the box has no parent.
- if (style.alignSelf().position() == ItemPositionAuto && parentStyle.alignItems().position() != RenderStyle::initialDefaultAlignment().position())
- style.setAlignSelf(parentStyle.alignItems());
+ if (style.alignSelf().position() == ItemPositionAuto && parentBoxStyle.alignItems().position() != RenderStyle::initialDefaultAlignment().position())
+ style.setAlignSelf(parentBoxStyle.alignItems());
}
bool StyleResolver::checkRegionStyle(const Element* regionElement)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes