RESOLVED FIXED 45530
Web Inspector: Implement on-demand reporting of empty CSS rules matched for a node by WebCore
https://bugs.webkit.org/show_bug.cgi?id=45530
Summary Web Inspector: Implement on-demand reporting of empty CSS rules matched for a...
Alexander Pavlov (apavlov)
Reported 2010-09-10 03:59:12 PDT
Currently, rules containing no properties are left out of the result (CSSStyleSelector::matchRulesForList()), while this is necessary for correct reporting of rules which have all their properties disabled. However this should not affect the normal rule matching workflow in the absence of Web Inspector.
Attachments
[PATCH] Suggested solution (14.17 KB, patch)
2010-09-10 08:16 PDT, Alexander Pavlov (apavlov)
no flags
[PATCH] Comments addressed (14.12 KB, patch)
2010-09-13 06:38 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
[PATCH] Alternative approach (10.67 KB, patch)
2010-09-13 06:40 PDT, Alexander Pavlov (apavlov)
no flags
Alexander Pavlov (apavlov)
Comment 1 2010-09-10 08:16:32 PDT
Created attachment 67186 [details] [PATCH] Suggested solution
Ilya Tikhonovsky
Comment 2 2010-09-10 08:57:36 PDT
Comment on attachment 67186 [details] [PATCH] Suggested solution View in context: https://bugs.webkit.org/attachment.cgi?id=67186&action=prettypatch > WebCore/css/CSSStyleSelector.cpp:657 > +void CSSStyleSelector::matchRules(CSSRuleSet* rules, int& firstRuleIndex, int& lastRuleIndex, bool debugMode) what do you think about includeEmptyRules name instead of debugMode?
Alexander Pavlov (apavlov)
Comment 3 2010-09-10 09:05:06 PDT
The idea was that we might need results "relaxed" in ways other than the rule contents (and also in other places, not the class in question), so I want to keep the flag name consistent (it can even be a field in some class we instantiate under different circumstances) across the entire area. Or do you think it is too general?
Pavel Feldman
Comment 4 2010-09-13 05:46:02 PDT
Comment on attachment 67186 [details] [PATCH] Suggested solution > what do you think about includeEmptyRules name instead of debugMode? I second this. When we add more relaxed properties we figure the new name out. Rest looks good. r+ given rename takes place. Note that (pseudo)styleRulesForElement is called from within DOMWindow API (that was originally introduced for inspector) and from the markup. I wonder if they should operate in relaxed mode by default.
Alexander Pavlov (apavlov)
Comment 5 2010-09-13 06:38:28 PDT
Created attachment 67404 [details] [PATCH] Comments addressed
Alexander Pavlov (apavlov)
Comment 6 2010-09-13 06:40:39 PDT
Created attachment 67405 [details] [PATCH] Alternative approach This patch contains an alternative solution: styleRulesForElement() and pseudoStyleRulesForElement() will ALWAYS return empty rules (the two are non-trivially used only from markup.cpp)
Eric Seidel (no email)
Comment 7 2010-09-14 03:16:45 PDT
Comment on attachment 67186 [details] [PATCH] Suggested solution Cleared Pavel Feldman's review+ from obsolete attachment 67186 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Alexander Pavlov (apavlov)
Comment 8 2010-09-14 08:05:43 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog M LayoutTests/inspector/elements-panel-styles-expected.txt M LayoutTests/inspector/resources/elements-panel-styles.css M WebCore/ChangeLog M WebCore/css/CSSStyleSelector.cpp M WebCore/css/CSSStyleSelector.h M WebCore/inspector/InspectorDOMAgent.cpp Committed r67469
Pavel Feldman
Comment 9 2010-10-06 05:26:50 PDT
Comment on attachment 67405 [details] [PATCH] Alternative approach Clearing r? from the patch that has landed.
Note You need to log in before you can comment on or make changes to this bug.