Bug 61070

Summary: Web Inspector: support for emulating element's pseudo class state in styleRulesForElement()
Product: WebKit Reporter: Alexander Udalov <udalov>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, dglazkov, hyatt, joepeck, keishi, loislo, pfeldman, pmuellr, rik, simon.fraser, timothy, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
pfeldman: review-
patch
none
patch
none
patch
none
patch
none
[PATCH] Suggested solution, dhyatt's comment addressed
webkit.review.bot: commit-queue-
[PATCH] Fix Chromium/Mac builds none

Description Alexander Udalov 2011-05-18 09:49:56 PDT
This logic (patch to follow) is supposed to help implement this:
http://code.google.com/p/chromium/issues/detail?id=67871
Comment 1 Alexander Udalov 2011-05-18 09:52:43 PDT
Created attachment 93928 [details]
Patch
Comment 2 Pavel Feldman 2011-05-18 09:59:08 PDT
Comment on attachment 93928 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=93928&action=review

> Source/WebCore/ChangeLog:8
> +        No new tests. (OOPS!)

Should be no OOPS here. I'll point you to the inspector tests offline so that it was covered.

> Source/WebCore/css/CSSStyleSelector.cpp:1994
> +PassRefPtr<CSSRuleList> CSSStyleSelector::styleRulesForElement(Element* e, bool authorOnly, bool includeEmptyRules, CSSRuleFilter filter, unsigned emulateElementPseudoClass)

emulatePseudoClassMask ?

> Source/WebCore/css/CSSStyleSelector.cpp:2803
> +                if (emulateElementPseudoClass != EmulateNone)

I'd suggest

if (emulatePseudoClassMask & EmulateFocus)
    return true;
Comment 3 Alexander Udalov 2011-05-18 10:52:55 PDT
Created attachment 93937 [details]
patch
Comment 4 WebKit Review Bot 2011-05-18 10:54:46 PDT
Attachment 93937 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/css/CSSStyleSelector.h:138:  The parameter name "filter" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/css/CSSStyleSelector.h:139:  The parameter name "filter" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Alexander Udalov 2011-05-18 11:02:23 PDT
Created attachment 93938 [details]
patch
Comment 6 Alexander Udalov 2011-05-24 03:54:53 PDT
Created attachment 94591 [details]
patch
Comment 7 Alexander Udalov 2011-05-25 07:56:58 PDT
Created attachment 94783 [details]
patch
Comment 8 Alexander Pavlov (apavlov) 2011-06-08 09:17:16 PDT
According to dhyatt, "looks ok although if possible might consider just doing a single check up front rather than adding code to the different cases".

I will take over the bug and put together an updated patch.
Comment 9 Alexander Pavlov (apavlov) 2011-06-16 02:44:37 PDT
Created attachment 97427 [details]
[PATCH] Suggested solution, dhyatt's comment addressed
Comment 10 WebKit Review Bot 2011-06-16 02:51:13 PDT
Comment on attachment 97427 [details]
[PATCH] Suggested solution, dhyatt's comment addressed

Attachment 97427 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/8883005
Comment 11 WebKit Review Bot 2011-06-16 02:57:13 PDT
Comment on attachment 97427 [details]
[PATCH] Suggested solution, dhyatt's comment addressed

Attachment 97427 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/8880142
Comment 12 Alexander Pavlov (apavlov) 2011-06-16 03:03:04 PDT
Created attachment 97429 [details]
[PATCH] Fix Chromium/Mac builds
Comment 13 Dave Hyatt 2011-06-16 10:02:20 PDT
Comment on attachment 97429 [details]
[PATCH] Fix Chromium/Mac builds

r=me
Comment 14 WebKit Review Bot 2011-06-17 03:14:04 PDT
Comment on attachment 97429 [details]
[PATCH] Fix Chromium/Mac builds

Clearing flags on attachment: 97429

Committed r89132: <http://trac.webkit.org/changeset/89132>
Comment 15 WebKit Review Bot 2011-06-17 03:14:10 PDT
All reviewed patches have been landed.  Closing bug.