Title: [281252] trunk
- Revision
- 281252
- Author
- [email protected]
- Date
- 2021-08-19 11:05:00 -0700 (Thu, 19 Aug 2021)
Log Message
Top layer: handle display: contents and non out-of-flow position values
https://bugs.webkit.org/show_bug.cgi?id=229093
Reviewed by Simon Fraser.
From: https://fullscreen.spec.whatwg.org/#new-stacking-layer
If its specified display property is contents, it computes to block.
If its specified position property is not absolute or fixed, it computes to absolute.
Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-display-contents.html
Source/WebCore:
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
(WebCore::Style::Adjuster::adjustDisplayContentsStyle const):
LayoutTests:
* TestExpectations:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (281251 => 281252)
--- trunk/LayoutTests/ChangeLog 2021-08-19 17:45:42 UTC (rev 281251)
+++ trunk/LayoutTests/ChangeLog 2021-08-19 18:05:00 UTC (rev 281252)
@@ -1,3 +1,18 @@
+2021-08-13 Tim Nguyen <[email protected]>
+
+ Top layer: handle display: contents and non out-of-flow position values
+ https://bugs.webkit.org/show_bug.cgi?id=229093
+
+ Reviewed by Simon Fraser.
+
+ From: https://fullscreen.spec.whatwg.org/#new-stacking-layer
+ If its specified display property is contents, it computes to block.
+ If its specified position property is not absolute or fixed, it computes to absolute.
+
+ Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-display-contents.html
+
+ * TestExpectations:
+
2021-08-19 Tim Nguyen <[email protected]>
Re-import html/semantics/interactive-elements/the-dialog-element WPT - August 19th 2021
Modified: trunk/LayoutTests/TestExpectations (281251 => 281252)
--- trunk/LayoutTests/TestExpectations 2021-08-19 17:45:42 UTC (rev 281251)
+++ trunk/LayoutTests/TestExpectations 2021-08-19 18:05:00 UTC (rev 281252)
@@ -2374,9 +2374,7 @@
fast/multicol/multicol-with-child-renderLayer-for-input.html [ ImageOnlyFailure ]
# Top layer tests
-webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/backdrop-in-flow.html [ ImageOnlyFailure ]
webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/backdrop-stacking-order.html [ ImageOnlyFailure ]
-webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dont-share-style-to-top-layer.html [ ImageOnlyFailure ]
webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-in-replaced-renderer.html [ ImageOnlyFailure ]
webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-in-table-column.html [ ImageOnlyFailure ]
webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/removed-element-is-removed-from-top-layer.html [ ImageOnlyFailure ]
@@ -2385,7 +2383,6 @@
webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-stacking-correct-order-remove-readd.html [ ImageOnlyFailure ]
webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-stacking-dynamic.html [ ImageOnlyFailure ]
webkit.org/b/84796 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-stacking.html [ ImageOnlyFailure ]
-webkit.org/b/229093 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-display-contents.html [ ImageOnlyFailure ]
# inert subtrees
webkit.org/b/110952 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-not-highlighted.html [ ImageOnlyFailure ]
Modified: trunk/Source/WebCore/ChangeLog (281251 => 281252)
--- trunk/Source/WebCore/ChangeLog 2021-08-19 17:45:42 UTC (rev 281251)
+++ trunk/Source/WebCore/ChangeLog 2021-08-19 18:05:00 UTC (rev 281252)
@@ -1,3 +1,20 @@
+2021-08-13 Tim Nguyen <[email protected]>
+
+ Top layer: handle display: contents and non out-of-flow position values
+ https://bugs.webkit.org/show_bug.cgi?id=229093
+
+ Reviewed by Simon Fraser.
+
+ From: https://fullscreen.spec.whatwg.org/#new-stacking-layer
+ If its specified display property is contents, it computes to block.
+ If its specified position property is not absolute or fixed, it computes to absolute.
+
+ Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-display-contents.html
+
+ * style/StyleAdjuster.cpp:
+ (WebCore::Style::Adjuster::adjust const):
+ (WebCore::Style::Adjuster::adjustDisplayContentsStyle const):
+
2021-08-19 Simon Fraser <[email protected]>
Rename EventHandler::sendScrollEvent() to scheduleScrollEvent() since the event is not sent synchronously
Modified: trunk/Source/WebCore/style/StyleAdjuster.cpp (281251 => 281252)
--- trunk/Source/WebCore/style/StyleAdjuster.cpp 2021-08-19 17:45:42 UTC (rev 281251)
+++ trunk/Source/WebCore/style/StyleAdjuster.cpp 2021-08-19 18:05:00 UTC (rev 281252)
@@ -313,6 +313,12 @@
style.setEffectiveDisplay(DisplayType::Block);
}
+ // Top layer elements are always position: absolute; unless the position is set to fixed.
+ // https://fullscreen.spec.whatwg.org/#new-stacking-layer
+ bool isInTopLayer = style.styleType() == PseudoId::Backdrop || (m_element && m_element->isInTopLayer());
+ if (style.position() != PositionType::Absolute && style.position() != PositionType::Fixed && isInTopLayer)
+ style.setPosition(PositionType::Absolute);
+
// Absolute/fixed positioned elements, floating elements and the document element need block-like outside display.
if (style.hasOutOfFlowPosition() || style.isFloating() || (m_element && m_document.documentElement() == m_element))
style.setEffectiveDisplay(equivalentBlockDisplay(style, m_document));
@@ -568,18 +574,18 @@
void Adjuster::adjustDisplayContentsStyle(RenderStyle& style) const
{
- if (!m_element) {
- if (style.styleType() != PseudoId::Before && style.styleType() != PseudoId::After)
- style.setEffectiveDisplay(DisplayType::None);
+ bool isInTopLayer = style.styleType() == PseudoId::Backdrop || (m_element && m_element->isInTopLayer());
+ if (isInTopLayer || m_document.documentElement() == m_element) {
+ style.setEffectiveDisplay(DisplayType::Block);
return;
}
- if (m_document.documentElement() == m_element) {
- style.setEffectiveDisplay(DisplayType::Block);
+ if (!m_element && style.styleType() != PseudoId::Before && style.styleType() != PseudoId::After) {
+ style.setEffectiveDisplay(DisplayType::None);
return;
}
- if (hasEffectiveDisplayNoneForDisplayContents(*m_element))
+ if (m_element && hasEffectiveDisplayNoneForDisplayContents(*m_element))
style.setEffectiveDisplay(DisplayType::None);
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes