New issue
Advanced search Search tips

Issue 657706 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocking:
issue 641877



Sign in to add a comment

Registering a property can fail to invalidate custom paint

Project Member Reported by timloh@chromium.org, Oct 20 2016

Issue description

As described in the patch description on https://codereview.chromium.org/2426323003/

Property registration invalidates style, but generally will not cause paint invalidation. Custom paint invalidation checks whether any of the input properties have changed, but for custom properties it only looks at any explicitly set token stream value. This misses two cases:
- The property is not set, but is now assigned an initial value.
- The property is set and parses under the given syntax. The value from the FilteredComputedStylePropertyMap will use a parsed type instead of unparsed type.
 
Owner: ----
Status: Available (was: Assigned)
Labels: Update-Quarterly

Comment 3 by shend@chromium.org, Apr 11 2017

Labels: Type-Feature
Labels: -Type-Bug
Labels: -Update-Quarterly
Owner: andruud@chromium.org
Status: Started (was: Available)
Project Member

Comment 7 by bugdroid1@chromium.org, Nov 1

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

commit 24c885e661e8932b648f7cc534dbbadeb22bc2f5
Author: Anders Hartvoll Ruud <andruud@chromium.org>
Date: Thu Nov 01 16:16:48 2018

[css-properties-values-api] Invalidate paint worklet on registration.

Due to how initial values of registered custom properties used to be
handled, the style diff function for custom paint could not discover that
the computed value for some property changed due to a new property
registration.

This meant that, if you used the property '--x' in your paint worklet
(without applying '--x' on any element in the document), and _then_
registered the property '--x' (giving it an initial value), the worklet
would not repaint even though the computed value of --x changed from
"nothing" to the registered initial value.

Now that initial values are returned from ::GetRegisteredVariable, simply
compare those values when diffing for custom paint invalidation.

Note that the second test in this CL is already passing before this CL,
but I'm including it anyway since that case is also mentioned in the bug.

R=ikilpatrick@chromium.org

Bug:  657706 
Change-Id: I2b7707d48d73693a70b100fe1121bd7f977b4db1
Reviewed-on: https://chromium-review.googlesource.com/c/1309788
Commit-Queue: Anders Ruud <andruud@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604607}
[modify] https://crrev.com/24c885e661e8932b648f7cc534dbbadeb22bc2f5/third_party/WebKit/LayoutTests/external/wpt/common/worklet-reftest.js
[add] https://crrev.com/24c885e661e8932b648f7cc534dbbadeb22bc2f5/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/registered-property-invalidation-001.https.html
[add] https://crrev.com/24c885e661e8932b648f7cc534dbbadeb22bc2f5/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/registered-property-invalidation-002.https.html
[modify] https://crrev.com/24c885e661e8932b648f7cc534dbbadeb22bc2f5/third_party/blink/renderer/core/style/computed_style.cc
[modify] https://crrev.com/24c885e661e8932b648f7cc534dbbadeb22bc2f5/third_party/blink/renderer/core/style/computed_style.h
[modify] https://crrev.com/24c885e661e8932b648f7cc534dbbadeb22bc2f5/third_party/blink/renderer/core/style/style_initial_data.h

Status: Fixed (was: Started)

Sign in to add a comment