Commit 0668e4e6 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] DETAILS/SUMMARY may override display type.

We cannot safely assume, based on display type, that a DETAILS or
SUMMARY element is going to establish a new formatting context, since
they may ignore the display type and just create a regular block
container (which doesn't necessarily establish a new formatting
context).

Bug: 969619
Change-Id: Ie59fe7301f8706cd4d39b3312fe6748c4ffb17e6
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1640410Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665532}
parent 8eeef9c1
......@@ -267,8 +267,14 @@ bool DefinitelyNewFormattingContext(const Node& node,
return false;
// The only block-container display types that potentially don't establish a
// new formatting context, are 'block' and 'list-item'.
if (display != EDisplay::kBlock && display != EDisplay::kListItem)
if (display != EDisplay::kBlock && display != EDisplay::kListItem) {
// DETAILS and SUMMARY elements partially or completely ignore the display
// type, though, and may end up disregarding the display type and just
// create block containers. And those don't necessarily create a formatting
// context.
if (!IsHTMLDetailsElement(node) && !IsHTMLSummaryElement(node))
return true;
}
if (!style.IsOverflowVisible())
return node.GetDocument().ViewportDefiningElement() != &node;
if (style.HasOutOfFlowPosition() || style.IsFloating() ||
......
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=969619">
<details open="open" style="display:table;"><rt></rt></details>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> { }, "No crash");
</script>
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=969619">
<summary style="display:table;"><rt></rt></summary>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> { }, "No crash");
</script>
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