Commit 1d064e77 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Keep previous_in_flow across shadow boundary.

For some reason we created a new AttachContext entering a ShadowRoot for
AttachLayoutTree. If the shadow host was display:contents we would lose
the previous_in_flow from the shadow tree checking the need for
whitespace LayoutObject for shadow host siblings.

Created a common space-separated words expectation for css.

Bug: 901323
Change-Id: Ib2fa54d55923c0497ff8e96c5010e68b01570881
Reviewed-on: https://chromium-review.googlesource.com/c/1314589Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604910}
parent d5a114b1
<!DOCTYPE html>
<meta charset="utf-8">
<title>Whitespace across display:contents shadow host</title>
<link rel="help" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-rules">
<link rel="match" href="../reference/pass_if_two_words.html">
<p>There should be a space between "two" and "words" below.</p>
<div id="host" style="display:contents"></div> <span>words</span>
<script>
host.attachShadow({mode:"open"}).innerHTML = "two";
</script>
......@@ -3,7 +3,7 @@
<title>CSS Flexbox Test: Flex item - contiguous text runs - node removal</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-items">
<link rel="match" href="anonymous-flex-item-ref.html">
<link rel="match" href="../reference/pass_if_two_words.html">
<p>There should be a space between "two" and "words" below.</p>
<div style="display:flex">two <span id="spanRemove"></span>words</div>
<script>
......
......@@ -3,6 +3,6 @@
<title>CSS Flexbox Test: Flex item - contiguous text runs - display:none</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-items">
<link rel="match" href="anonymous-flex-item-ref.html">
<link rel="match" href="../reference/pass_if_two_words.html">
<p>There should be a space between "two" and "words" below.</p>
<div style="display:flex">two <span style="display:none"></span>words</div>
......@@ -3,7 +3,7 @@
<title>CSS Flexbox Test: Flex item - contiguous text runs - display:none dynamic</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-items">
<link rel="match" href="anonymous-flex-item-ref.html">
<link rel="match" href="../reference/pass_if_two_words.html">
<p>There should be a space between "two" and "words" below.</p>
<div style="display:flex">two <span id="noneSpan"></span>words</div>
<script>
......
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-rules">
<link rel="match" href="reference/white-space-empty-text-sibling-ref.html">
<p>There should be a space between "Two" and "words".</p>
<link rel="match" href="../../reference/pass_if_two_words.html">
<p>There should be a space between "two" and "words" below.</p>
<div id="block"> <span>words</span></div>
<script>
block.insertBefore(document.createTextNode(""), block.firstChild);
block.insertBefore(document.createTextNode(""), block.firstChild);
block.offsetTop;
block.firstChild.data = "Two";
block.firstChild.data = "two";
</script>
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org">
<p>There should be a space between "two" and "words" below.</p>
two words
......@@ -164,11 +164,6 @@ void ShadowRoot::RebuildLayoutTree(WhitespaceAttacher& whitespace_attacher) {
ClearChildNeedsReattachLayoutTree();
}
void ShadowRoot::AttachLayoutTree(AttachContext& context) {
Node::AttachContext children_context(context);
DocumentFragment::AttachLayoutTree(children_context);
}
void ShadowRoot::DetachLayoutTree(const AttachContext& context) {
Node::AttachContext children_context(context);
children_context.clear_invalidation = true;
......
......@@ -105,7 +105,6 @@ class CORE_EXPORT ShadowRoot final : public DocumentFragment, public TreeScope {
}
bool IsUserAgent() const { return GetType() == ShadowRootType::kUserAgent; }
void AttachLayoutTree(AttachContext&) override;
void DetachLayoutTree(const AttachContext& = AttachContext()) override;
InsertionNotificationRequest InsertedInto(ContainerNode&) override;
......
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