Bug 45530 - Web Inspector: Implement on-demand reporting of empty CSS rules matched for a node by WebCore
Summary: Web Inspector: Implement on-demand reporting of empty CSS rules matched for a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-10 03:59 PDT by Alexander Pavlov (apavlov)
Modified: 2010-10-06 05:26 PDT (History)
9 users (show)

See Also:


Attachments
[PATCH] Suggested solution (14.17 KB, patch)
2010-09-10 08:16 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
[PATCH] Comments addressed (14.12 KB, patch)
2010-09-13 06:38 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff
[PATCH] Alternative approach (10.67 KB, patch)
2010-09-13 06:40 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 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.
Comment 1 Alexander Pavlov (apavlov) 2010-09-10 08:16:32 PDT
Created attachment 67186 [details]
[PATCH] Suggested solution
Comment 2 Ilya Tikhonovsky 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?
Comment 3 Alexander Pavlov (apavlov) 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?
Comment 4 Pavel Feldman 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.
Comment 5 Alexander Pavlov (apavlov) 2010-09-13 06:38:28 PDT
Created attachment 67404 [details]
[PATCH] Comments addressed
Comment 6 Alexander Pavlov (apavlov) 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)
Comment 7 Eric Seidel (no email) 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.
Comment 8 Alexander Pavlov (apavlov) 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
Comment 9 Pavel Feldman 2010-10-06 05:26:50 PDT
Comment on attachment 67405 [details]
[PATCH] Alternative approach

Clearing r? from the patch that has landed.