New issue
Advanced search Search tips

Issue 606070 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

Some pseudo style changes are not properly handled for paint invalidation and layout

Project Member Reported by wangxianzhu@chromium.org, Apr 22 2016

Issue description

Open attached test case. The first line should be green.

The problem is that in Element::recalcOwnStyle():

        if (localChange != NoChange || pseudoStyleCacheIsInvalid(oldStyle.get(), newStyle.get()) || svgFilterNeedsLayerUpdate()) {

pseudoStyleCacheIsValid (which has side-effect to update pseudo style cache and invalidate for first-line style change) is called only if localChange == NoChange.


 
first-line-change-color-and-position-no-layout.html
473 bytes View Download
Cc: wangxianzhu@chromium.org
Owner: ----
Status: Available (was: Assigned)
Summary: Some pseudo style changes are not properly handled for paint invalidation and layout (was: First-line style change together with other style change may not update first line style)
Some questions:

1. diffPseudoStyles() in ComputedStyle.cpp:
  1.1 it returns NoChange if oldStyle doesn't have any public pseudo style. Should we check that newStyle has any new pseudo styles?
  1.2 it checks cachedPseudoStyle of oldStyle and newStyle. What if a pseudo style changed but has not been cached?

2. Element::pseudoStyleCacheIsInvalid() also just iterate cached pseudo styles of the oldStyle. What if a pseudo style changed but has not been cached?

Thought the issue were simple, but found that I'm too familiar with the area to fix the issues.
 Issue 563943  has been merged into this issue.
Copy the test case of  bug 563943  (by rune@opera.com) here.
selection.html
519 bytes View Download
Re: #1 s/too familiar/too unfamiliar/ :)
The pseudo cache code has always looked broken to me, but I could never produce a test to show it. I think we should stop storing styles embedded inside ComputedStyle fwiw and just use ElementRareData. We should treat resolving those styles as a totally separate pass independent of the main style.
Labels: Hotlist-Interop

Comment 7 by meade@chromium.org, Aug 18 2016

I looked at this in Chrome, Safari and Firefox using selection.html:

Chrome: Background is red on load, highlights green when using the mouse
Safari: Background is red on load, highlights green when using the mouse
Firefox: Background is blue on load, highlights blue when using the mouse

Comment 8 by r...@opera.com, Aug 18 2016

Firefox needs the ::-moz- prefix.

Interestingly, Gecko has the same issue with selection.html.


Labels: Update-Quarterly
Labels: Code-RecalcStyle

Comment 11 by shend@chromium.org, Oct 31 2017

Labels: ApproachableBug
On 64.0.3253.0, can't reproduce #c3 but can repro #c1.
Cc: -r...@opera.com futhark@chromium.org
Labels: -Update-Quarterly
Project Member

Comment 14 by sheriffbot@chromium.org, Dec 6

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
#c0 still reproduces.

Sign in to add a comment