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.
Created attachment 67186 [details] [PATCH] Suggested solution
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?
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?
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.
Created attachment 67404 [details] [PATCH] Comments addressed
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)
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.
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
Comment on attachment 67405 [details] [PATCH] Alternative approach Clearing r? from the patch that has landed.