New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 648951 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Re-attaching whitespace siblings broken for generated content

Reported by r...@opera.com, Sep 21 2016

Issue description

We are not reattaching whitespace-only text nodes when needed when reattaching ::before/::after. For more context, see also  issue 648931 .

 
before.html
380 bytes View Download

Comment 1 by suzyh@chromium.org, Sep 22 2016

Labels: Hotlist-Interop
Labels: Update-Quarterly
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/06fa41652fb4ba0654a28453491c8347109d5620

commit 06fa41652fb4ba0654a28453491c8347109d5620
Author: rune <rune@opera.com>
Date: Thu Mar 30 13:00:36 2017

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}

[add] https://crrev.com/06fa41652fb4ba0654a28453491c8347109d5620/third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-before-pseudo-expected.html
[add] https://crrev.com/06fa41652fb4ba0654a28453491c8347109d5620/third_party/WebKit/LayoutTests/fast/text/whitespace/reattach-before-pseudo.html
[modify] https://crrev.com/06fa41652fb4ba0654a28453491c8347109d5620/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/06fa41652fb4ba0654a28453491c8347109d5620/third_party/WebKit/Source/core/dom/ContainerNode.h
[modify] https://crrev.com/06fa41652fb4ba0654a28453491c8347109d5620/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/06fa41652fb4ba0654a28453491c8347109d5620/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/06fa41652fb4ba0654a28453491c8347109d5620/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
[modify] https://crrev.com/06fa41652fb4ba0654a28453491c8347109d5620/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h

Comment 4 by r...@opera.com, Mar 30 2017

Status: Fixed (was: Available)

Sign in to add a comment