New issue
Advanced search Search tips

Issue 702104 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Appending more than one element not fire repaint for previous :last-child element

Reported by nikolay....@ewave.com, Mar 16 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce the problem:
1. Set :last-child style
2. Append more than one element at once

What is the expected behavior?
Previous :last-child element repaint

What went wrong?
Previous :last-child element doesn't repaint

Did this work before? N/A 

Chrome version: 56.0.2924.87  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 25.0 r0

https://jsfiddle.net/jLxyq811/

Not actual for :last-of-type
 
Screenshot_7.png
107 KB View Download
Components: Blink>DOM
Labels: -Type-Bug -Pri-2 M-59 OS-Linux OS-Mac Pri-1 Type-Bug-Regression
Owner: tkent@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce the issue on Windows 10, mac 10.12.3 and Ubuntu 14.04 using chrome reported version #56.0.2924.87 and latest canary #59.0.3043.0.

Bisect Information:
=====================
Good build: 55.0.2853.0      Revision(416812)

Bad Build : 55.0.2855.0      Revision(417475)

Change Log URL: 
https://chromium.googlesource.com/chromium/src/+log/30d9858f1399f7f7bba8260c80c4d032da35eba9..e15391d9a56a210cf5faee97c24bfad856225ea9

From the above change log suspecting below change

Review url: https://codereview.chromium.org/2306323002

tkent@ - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Thanks...!!
Components: -Blink

Comment 3 by tkent@chromium.org, Mar 22 2017

Status: Started (was: Assigned)
It seems the change of childrenChange() in the CL caused this issue.

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 23 2017

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

commit e89e9ca08e4abca7bf13d7424434b301caf5b4a5
Author: tkent <tkent@chromium.org>
Date: Thu Mar 23 08:08:16 2017

CSS Selector: Fix a regression of :first-child and :last-child invalidation

https://codereview.chromium.org/2306323002 caused a regression of :first-child and
:last-child invalidation because the timing of ContainerNode::childrenChanged was
slightly changed for multiple nodes insertion.
 Before: childrenChanged was called on every node insertion
 After: childrenChanged was called after inserting all nodes

This CL changes the definition of ChildrenChanged::siblingBeforeChange and
siblingAfterChange so that they always point existing nodes before insertion
operations. It fixes the behavior of ContainerNode::checkForSiblingStyleChanges,
which is called from Element::childrenChanged and ShadowRoot::childrenChanged.
siblingBeforeChange and siblingAfterChange are used only by
checkForSiblingStyleChanges.  So this definition change is safe.

BUG= 702104 

Review-Url: https://codereview.chromium.org/2772463004
Cr-Commit-Position: refs/heads/master@{#459023}

[add] https://crrev.com/e89e9ca08e4abca7bf13d7424434b301caf5b4a5/third_party/WebKit/LayoutTests/fast/css/invalidation/firstchild-lastchild-for-multiple-node-insertion.html
[modify] https://crrev.com/e89e9ca08e4abca7bf13d7424434b301caf5b4a5/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/e89e9ca08e4abca7bf13d7424434b301caf5b4a5/third_party/WebKit/Source/core/dom/ContainerNode.h

Comment 5 by tkent@chromium.org, Mar 24 2017

Labels: -M-59 Merge-Request-58 M-58
Status: Fixed (was: Started)
Project Member

Comment 6 by sheriffbot@chromium.org, Mar 24 2017

Labels: -Merge-Request-58 Hotlist-Merge-Approved Merge-Approved-58
Your change meets the bar and is auto-approved for M58. Please go ahead and merge the CL to branch 3029 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), bhthompson@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 24 2017

Labels: -merge-approved-58 merge-merged-3029
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/404689093a8d2aeb6345635948f614e35d0fdf3a

commit 404689093a8d2aeb6345635948f614e35d0fdf3a
Author: Kent Tamura <tkent@chromium.org>
Date: Fri Mar 24 08:20:24 2017

Merge "CSS Selector: Fix a regression of :first-child and :last-child invalidation" to M58.

https://codereview.chromium.org/2306323002 caused a regression of :first-child and
:last-child invalidation because the timing of ContainerNode::childrenChanged was
slightly changed for multiple nodes insertion.
 Before: childrenChanged was called on every node insertion
 After: childrenChanged was called after inserting all nodes

This CL changes the definition of ChildrenChanged::siblingBeforeChange and
siblingAfterChange so that they always point existing nodes before insertion
operations. It fixes the behavior of ContainerNode::checkForSiblingStyleChanges,
which is called from Element::childrenChanged and ShadowRoot::childrenChanged.
siblingBeforeChange and siblingAfterChange are used only by
checkForSiblingStyleChanges.  So this definition change is safe.

BUG= 702104 

Review-Url: https://codereview.chromium.org/2772463004
Cr-Commit-Position: refs/heads/master@{#459023}
(cherry picked from commit e89e9ca08e4abca7bf13d7424434b301caf5b4a5)

Review-Url: https://codereview.chromium.org/2774753003 .
Cr-Commit-Position: refs/branch-heads/3029@{#405}
Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471}

[add] https://crrev.com/404689093a8d2aeb6345635948f614e35d0fdf3a/third_party/WebKit/LayoutTests/fast/css/invalidation/firstchild-lastchild-for-multiple-node-insertion.html
[modify] https://crrev.com/404689093a8d2aeb6345635948f614e35d0fdf3a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/404689093a8d2aeb6345635948f614e35d0fdf3a/third_party/WebKit/Source/core/dom/ContainerNode.h

Labels: TE-Verified-M58 TE-Verified-58.0.3029.41
Verified this issue on Ubuntu 14.04, Mac OS 10.12 and Windows-10 using chrome latest Beta M58-58.0.3029.41. By opening the test case provided in the original comment observed the last child element get repainted as expected. Hence adding TE-Verified label.


702104.png
295 KB View Download

Sign in to add a comment