NEW110055
Web Inspector: User Agent style stylesheet identifier keeps incrementing
https://bugs.webkit.org/show_bug.cgi?id=110055
Summary Web Inspector: User Agent style stylesheet identifier keeps incrementing
Timothy Hatcher
Reported 2013-02-17 09:01:06 PST
After calling CSSAgent.setRuleSelector for an author rule, the next time CSSAgent.getMatchedStylesForNode is called will cause all user agent styles to get a new stylesheet id, meaning a whole different CSSStyleId for those styles. All other styles and rules keep the same identifiers. I expect the identifiers to stay constant when possible, especially for the immutable user agent stylesheet. Repeated calls to getMatchedStylesForNode without calling setRuleSelector does not change the stylesheet id for user agent styles. I didn't test, but other stylesheet modification functions might also cause the user agent styles to change identifiers.
Attachments
Radar WebKit Bug Importer
Comment 1 2014-12-17 11:27:02 PST
Blaze Burg
Comment 2 2017-10-13 14:34:33 PDT
Does this have a user impact, or is it just refactoring?
Nikita Vasilyev
Comment 3 2020-08-31 09:09:39 PDT
Re-discovering this bug cost me over an hour of extra debugging of bug 202065 REGRESSION(r243264): Web Inspector: Style pane doesn't update after toggling CSS class :/ Brian, there's no user impact.
Qianlang Chen
Comment 4 2024-08-20 08:49:48 PDT
This is very likely the result of having to re-parse the entire style sheet's text after nearly every style edits from the frontend (except for editing specifically a style rule's header, as of today, which we sidestepped having to re-parse; see https://github.com/WebKit/WebKit/blob/6277bccb19de5ebd68797f369f8ff24fc4417f2e/Source/WebCore/inspector/InspectorStyleSheet.cpp#L1116-L1119; hopefully we can change that and bypass having to re-parse whenever we can.) There is actually quite a noticeable UI impact, except it's currently suppressed by skip marking changes in user agent style sheet IDs as significant changes. If we didn't do that then the style property currently being edited will lose focus after every keystroke due to the handling of significant changes, which is very bad UX. I discovered the same happening to imported rules. When a style sheet A imports style sheet B, every edit to style sheet A from the style details panel also results in style sheet B getting a new ID. Unfortunately we don't have the same bypass-significant-changes mechanism so the bad UX shows up there (https://bugs.webkit.org/show_bug.cgi?id=271403).
Note You need to log in before you can comment on or make changes to this bug.