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

Issue 762833 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 364817
issue 763291



Sign in to add a comment

DOM node removal does not re-attach whitespace siblings.

Reported by r...@opera.com, Sep 7 2017

Issue description

Consider the following case:

  <div><span></span> <div></div></div>

The span and the following white-space are wrapped in an anonymous block to only have block level siblings (due to the following div. However, if we remove the span from the DOM, the white-space text node is not detached keeping the anonymous block alive.

If we construct a layout tree with the span initially removed, we don't create a LayoutText for the whitespace and we don't get an anonymous block.

 

Comment 1 by r...@opera.com, Sep 7 2017

Summary: Single whitespace LayoutText incorrectly keeps anonymous block alive (was: Single whitespace LayoutText incorreclty keeps anonymous block alive)

Comment 2 by r...@opera.com, Sep 7 2017

Blocking: 364817

Comment 3 by r...@opera.com, Sep 7 2017

The general issue here, is that white-space nodes are not re-attached when sibling layout objects are detached when the node is removed from the DOM tree. If a layout object is detached from a node which is not removed from the DOM tree, the white-space node will be re-attached properly as part of the subsequent layout tree rebuild.

Labels: Update-Quarterly

Comment 5 by r...@opera.com, Sep 8 2017

Summary: DOM node removal does not re-attach whitespace siblings. (was: Single whitespace LayoutText incorrectly keeps anonymous block alive)

Comment 6 by r...@opera.com, Sep 8 2017

Blocking: 763291

Comment 7 by r...@opera.com, Sep 8 2017

Labels: -Pri-3 -Update-Quarterly Update-Weekly M-63 Pri-2
Changing priority because of blocked issue.

Comment 8 by r...@opera.com, Sep 11 2017

Attached a case which shows the issue when removing a block instead of an inline.
removeblock.html
187 bytes View Download

Comment 9 by r...@opera.com, Sep 11 2017

Status: Started (was: Assigned)
Project Member

Comment 10 by bugdroid1@chromium.org, Sep 19 2017

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

commit 3127493e35d5f602996741b808f60df624ea07e7
Author: Rune Lillesveen <rune@opera.com>
Date: Tue Sep 19 09:04:32 2017

Re-attach whitespace children when removing DOM nodes.

When the display type changes for an element in the DOM tree, the
WhitespaceAttacher would re-attach whitespace siblings appropriately
when traversing the re-attached element.

When a DOM node is removed from the tree, there will be no layout tree
rebuild. Or, at least, the removed node will not be encountered by the
traversal to trigger a re-attachment of any following whitespace nodes.

In order to fix that, introduce a hash set which contains elements
which had one of their layout tree children removed since the last
layout tree update. In the next UpdateStyle mark these elements for
layout tree rebuild and let the WhitespaceAttacher check if any of its
whitespace children needs to be re-attached.

Bug:  763291 ,  762833 ,  364817 
Change-Id: I4d1b3df10d07f549abfea17df0184beca0623ef7
Reviewed-on: https://chromium-review.googlesource.com/661957
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502803}
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/accessibility/spin-button-detach-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/editing/deleting/merge-paragraph-from-address-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/editing/deleting/merge-paragraph-from-listing-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/animation/request-animation-frame-detach-element-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/animation/request-animation-frame-detach-element2-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/css-generated-content/float-first-letter-siblings-convert-to-inline-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/css/sticky/remove-inline-sticky-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/dom/Window/timer-null-script-execution-context-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/dom/clientWidthAfterDocumentIsRemoved-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/events/content-changed-during-drop-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/events/event-targets-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/events/keypress-removed-node-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-delete-test-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/forms/form/document-deactivation-callback-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/forms/range/range-type-change-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/forms/text/textfield-focus-out-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/frames/detach-frame-during-focus-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/frames/detached-frame-property-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/frames/hover-timer-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/frames/iframe-reparenting-unique-name-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/frames/remove-frame-with-scrollbars-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/frames/unique-name-all-subframes-have-same-name-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/frames/unique-name-remove-add-child-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/frames/unique-name-set-same-name-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/media/lifetime-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/fast/replaced/frame-removed-during-resize-smaller-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/http/tests/appcache/deferred-events-delete-while-raising-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/http/tests/appcache/deferred-events-delete-while-raising-timer-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/http/tests/appcache/destroyed-frame-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/http/tests/appcache/detached-iframe-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/http/tests/cache/cached-main-resource-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/http/tests/cache/iframe-304-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/http/tests/misc/recreate-location-after-detach-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/http/tests/security/detached-sandboxed-frame-access-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/media/track/media-element-move-to-new-document-assert-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/linux/fast/frames/iframe-option-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/linux/html/details_summary/details-remove-child-2-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/remove-inline-after-layout-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/remove-inline-layer-after-layout-expected.txt
[add] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/devtools/sources/debugger-ui/source-frame-count-expected.txt
[add] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/devtools/sources/debugger-ui/source-frame-count-expected.txt
[add] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/mojo-loading/http/tests/devtools/sources/debugger-ui/source-frame-count-expected.txt
[add] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/devtools/sources/debugger-ui/source-frame-count-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac/fast/frames/iframe-option-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac/html/details_summary/details-remove-child-2-expected.txt
[rename] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/remove-inline-after-layout-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/remove-inline-layer-after-layout-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/remove-tspan-from-text-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win/fast/frames/iframe-option-crash-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win/html/details_summary/details-remove-child-2-expected.txt
[add] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win/http/tests/devtools/sources/debugger-ui/source-frame-count-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/compositing/remove-squashed-layer-plus-move-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/remove-inline-after-layout-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/remove-inline-layer-after-layout-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/remove-tspan-from-text-expected.txt
[add] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win7/http/tests/devtools/sources/debugger-ui/source-frame-count-expected.txt
[add] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/platform/win7/virtual/mojo-loading/http/tests/devtools/sources/debugger-ui/source-frame-count-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/plugins/empty-per-context-data-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/plugins/plugin-remove-readystatechange-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/svg/animations/discard-on-svg-crash-2-expected.txt
[add] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/LayoutTests/virtual/mojo-loading/http/tests/devtools/sources/debugger-ui/source-frame-count-expected.txt
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/Source/core/css/StyleEngine.cpp
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/Source/core/css/StyleEngine.h
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/Source/core/dom/WhitespaceAttacher.cpp
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/Source/core/dom/WhitespaceAttacher.h
[modify] https://crrev.com/3127493e35d5f602996741b808f60df624ea07e7/third_party/WebKit/Source/core/dom/WhitespaceAttacherTest.cpp

Comment 11 by r...@opera.com, Sep 19 2017

Status: Fixed (was: Started)

Sign in to add a comment