RESOLVED FIXED 182588
Web Inspector: Styles: Typing value and quickly moving focus away may display outdated value in UI
https://bugs.webkit.org/show_bug.cgi?id=182588
Summary Web Inspector: Styles: Typing value and quickly moving focus away may display...
Nikita Vasilyev
Reported 2018-02-07 16:26:18 PST
Created attachment 333332 [details] [Animated GIF] Bug Steps: 1. Add a new property "border". 2. Press Tab. 3. Quickly type "10px solid" and press Tab. Expected: Styles sidebar shows "border: 10px solid". Actual: Styles sidebar may show "border: ;". Notes: To make this bug easier to reproduce, change `WI.SpreadsheetStyleProperty.CommitCoalesceDelay = 250` to `1000`. This is what I did in the attached animated GIF.
Attachments
[Animated GIF] Bug (130.00 KB, image/gif)
2018-02-07 16:26 PST, Nikita Vasilyev
no flags
Patch (2.10 KB, patch)
2018-02-07 17:57 PST, Nikita Vasilyev
no flags
[Animated GIF] With patch applied (74.81 KB, image/gif)
2018-02-07 18:06 PST, Nikita Vasilyev
no flags
Radar WebKit Bug Importer
Comment 1 2018-02-07 16:29:12 PST
Nikita Vasilyev
Comment 2 2018-02-07 16:32:06 PST
spreadsheetTextFieldDidChange(textField) { if (textField === this._valueTextField) this.debounce(WI.SpreadsheetStyleProperty.CommitCoalesceDelay)._handleValueChange(); Because of the debounce function, values may get saved after losing the focus. When repaint happens, it displays old values. We may get away by simply not using the debounce for values.
Nikita Vasilyev
Comment 3 2018-02-07 17:57:05 PST
Nikita Vasilyev
Comment 4 2018-02-07 18:04:26 PST
Updates appear faster without the debounce, it feels better UX overall. If we do have to throttle, it should be front-end to back-end payload (CSSAgent.setStyleText), not view to model.
Nikita Vasilyev
Comment 5 2018-02-07 18:06:01 PST
Created attachment 333346 [details] [Animated GIF] With patch applied
Matt Baker
Comment 6 2018-02-08 14:54:47 PST
Comment on attachment 333345 [details] Patch r=me
WebKit Commit Bot
Comment 7 2018-02-08 15:18:33 PST
Comment on attachment 333345 [details] Patch Clearing flags on attachment: 333345 Committed r228296: <https://trac.webkit.org/changeset/228296>
WebKit Commit Bot
Comment 8 2018-02-08 15:18:34 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.