Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Issue 2766163002: Pass nextTextSibling to ::before layout rebuild. (Closed)

Created:
3 years, 9 months ago by rune
Modified:
3 years, 8 months ago
Reviewers:
nainar, esprehn
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof, webcomponents-bugzilla_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Pass nextTextSibling to ::before layout rebuild. Correct whitespace re-attachment relies on the next text node being tracked in order to re-attach when a previous sibling element changes display type. We did that just while traversing light tree siblings or slotted siblings. ::before pseudo element display type may affect following whitespace text node, so we need to pass on the next text sibling result from the descendant traversal. As we traverse siblings from right-to-left, we should also rebuild ::after before DOM siblings, and ::before after DOM siblings. This fixes the case where an element, whose left-most child, or shadow root child, is a whitespace text node, changes its ::before element's display type from block to inline. The pseudo element layout tree rebuild is renamed from reattach* to rebuild* to match the semantics of the rest of the methods. R=esprehn@chromium.org BUG=648951 Review-Url: https://codereview.chromium.org/2766163002 Cr-Commit-Position: refs/heads/master@{#460737} Committed: https://chromium.googlesource.com/chromium/src/+/06fa41652fb4ba0654a28453491c8347109d5620

Patch Set 1 #

Total comments: 10

Patch Set 2 : Fixed review issues. #

Total comments: 2

Patch Set 3 : Documentation fix. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -23 lines) Patch
A third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-before-pseudo.html View 1 chunk +29 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-before-pseudo-expected.html View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ContainerNode.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/ContainerNode.cpp View 1 2 chunks +5 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.h View 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 chunks +15 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp View 1 2 2 chunks +36 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (15 generated)
rune
This is fixing whitespace reattachment involving ::before. This is one instance of the issue where ...
3 years, 9 months ago (2017-03-22 14:11:52 UTC) #6
rune
ping
3 years, 9 months ago (2017-03-27 08:22:59 UTC) #7
nainar
lgtm
3 years, 8 months ago (2017-03-28 18:44:10 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2766163002/1
3 years, 8 months ago (2017-03-28 19:41:50 UTC) #10
esprehn
https://codereview.chromium.org/2766163002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/2766163002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode1331 third_party/WebKit/Source/core/dom/ContainerNode.cpp:1331: Text* ContainerNode::findNextTextSibling() const { This needs a better name, ...
3 years, 8 months ago (2017-03-28 20:56:51 UTC) #12
esprehn
I canceled the commit since ContainerNode::findNextTextSibling is a super generic name, and the function is ...
3 years, 8 months ago (2017-03-28 20:57:37 UTC) #13
rune
https://codereview.chromium.org/2766163002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/2766163002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode1331 third_party/WebKit/Source/core/dom/ContainerNode.cpp:1331: Text* ContainerNode::findNextTextSibling() const { On 2017/03/28 20:56:51, esprehn wrote: ...
3 years, 8 months ago (2017-03-29 10:39:47 UTC) #14
rune
esprehn@ ptal?
3 years, 8 months ago (2017-03-30 08:17:29 UTC) #19
esprehn
lgtm https://codereview.chromium.org/2766163002/diff/20001/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp File third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp (right): https://codereview.chromium.org/2766163002/diff/20001/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp#newcode179 third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp:179: // re-attachment. In that case, we find update ...
3 years, 8 months ago (2017-03-30 09:30:33 UTC) #20
rune
https://codereview.chromium.org/2766163002/diff/20001/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp File third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp (right): https://codereview.chromium.org/2766163002/diff/20001/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp#newcode179 third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp:179: // re-attachment. In that case, we find update nextTextSibling ...
3 years, 8 months ago (2017-03-30 09:49:48 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2766163002/40001
3 years, 8 months ago (2017-03-30 09:50:12 UTC) #24
commit-bot: I haz the power
3 years, 8 months ago (2017-03-30 13:01:34 UTC) #27
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/06fa41652fb4ba0654a28453491c...

Powered by Google App Engine
This is Rietveld 408576698