WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
ASSIGNED
207562
Web Inspector: Incline swatches for variables with colors should update when variable value changes
https://bugs.webkit.org/show_bug.cgi?id=207562
Summary
Web Inspector: Incline swatches for variables with colors should update when ...
Nikita Vasilyev
Reported
2020-02-11 10:27:45 PST
Color previews for variables with colors will be introduced in
bug 205482
. Color previews won't update when variable value changes: # STEPS TO REPRODUCE: 1. inspect any page 2. add `color: var(--DoesNotExistVariable);` to the inline style of any node => no swatch is shown next to `var(--DoesNotExistVariable)` 3. add `--DoesNotExistVariable: red;` to some _other_ CSS rule that is already being applied to the current node => still no swatch next to `var(--DoesNotExistVariable)` This issue is even more evident if the CSS variable _does_ exist. # STEPS TO REPRODUCE 1. inspect any page 2. add `--foo: red;` to the inline style of any node 3. add `color: var(--foo);` to the inline style of the same node as step #2 => red color swatch is shown next to `var(--foo)` 3. add `--foo: blue !important;` to some _other_ CSS rule that is already being applied to the current node => still a red color swatch next to `var(--foo)` which _should_ be blue
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-02-11 10:27:55 PST
<
rdar://problem/59353418
>
Nikita Vasilyev
Comment 2
2020-02-11 10:48:43 PST
Here's how I plan to resolve this. Editing a CSS variable value should cause full style editor layout. The full layout should happen when focus is moved from the value field (on spreadsheetTextFieldDidCommit). It should NOT happen on every key stroke. The tricky part here is to focus on the right CSS property or selector after the value is committed. SpreadsheetCSSStyleDeclarationEditor handles this currently. However, the full style editor layout removes all SpreadsheetCSSStyleDeclarationEditor instances and creates new ones. There are two general approaches of solving this: 1. Store what CSS rule, selector and property is pending focus at the higher level of the view hierarchy so it can be restored even after the full layout. 2. Don't update parts of the DOM that didn't change by comparing new data with the rendered data. One example of this approach is a virtual DOM.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug