New issue
Advanced search Search tips

Issue 883111 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Unnecessary layout when changing outline color sets "recompute_overflow" on StyleDifference

Project Member Reported by atotic@chromium.org, Sep 11

Issue description

Just changing outline color sets "recompute_overflow" flag on StyleDifference object.

LayoutObject::SetStyle uses this flag to invalidate layout:

LayoutObject::SetStyle 
 if (diff.NeedsRecomputeOverflow() && !NeedsLayout()) {
   SetNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::kStyleChange);

The code that determines whether overflow recomputation is needed is at:

ComputedStyle::UpdatePropertySpecificDifferences
   ComputedStyleBase::UpdatePropertySpecificDifferencesNeedsRecomputeOverflow
     if (!a.OutlineVisuallyEqual(b))
       return true;

Outlines can be visually different (color change), but not trigger overflow computation.

I think we need to separate OutlineVisuallyEqual into OutlineLayoutEqual, OutlinePaintEqual.

One should trigger overflow computation, and the other should not.

Overflow computation in LayoutNG triggers full layout for now.

 
Example. Hit any key to toggle color.
outline-containing-image-in-non-standard-mode.html
494 bytes View Download
Cc: futhark@chromium.org
Components: Blink>CSS
Owner: ----
Status: Available (was: Untriaged)
Any clues on where are the templates that generate this code?
Cc: kojii@chromium.org

Sign in to add a comment