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

Issue 768357 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Update CSS counters after style recalc and only when necessary

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

Issue description

We currently call UpdateCounters() for every layout as long as we have at least one LayoutCounter. Also, a change in computed counter directives triggers a full layout and repaint, which is not necessary.

We should only need to update counters when computed counter directives change and when we add/remove LayoutCounter objects.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 26 2017

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

commit da85874e0ca9635522b92bdb13efe57947c1a317
Author: Rune Lillesveen <rune@opera.com>
Date: Tue Sep 26 08:07:36 2017

Update counters after style recalc, not layout.

We used to update counters on every layout as long as there was at
least on LayoutCounter in the rendered document. Also, the update was
triggered by marking the changed element for layout.

We need to update counters when we add/remove LayoutCounter, or when
computed counter directives change on rendered elements during style
recalc. We update counters immediately after style recalc and layout
tree rebuild in Document::UpdateStyle().

Bug:  768357 
Change-Id: I32693fefaa7bdb74cf959ef5ead4256d2ec2d0da
Reviewed-on: https://chromium-review.googlesource.com/678676
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504310}
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/frame/LocalFrameView.h
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/layout/LayoutCounter.cpp
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/layout/LayoutObject.cpp
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/layout/LayoutObject.h
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/layout/LayoutView.cpp
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/layout/LayoutView.h
[add] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/layout/LayoutViewTest.cpp
[modify] https://crrev.com/da85874e0ca9635522b92bdb13efe57947c1a317/third_party/WebKit/Source/core/layout/api/LayoutViewItem.h

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

Status: Fixed (was: Started)

Sign in to add a comment