Bug 64567

Summary: Attribute selectors don't handle glob namespaces (e.g. *|E)
Product: WebKit Reporter: Sam Weinig <sam>
Component: CSSAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test case
none
WIP Patch
none
Patch andersca: review+

Description Sam Weinig 2011-07-14 15:59:31 PDT
Created attachment 100882 [details]
Test case

We don't seem to support glob namespaces for attributes selectors as specified in Selectors Level 3 (http://www.w3.org/TR/css3-selectors/#attrnmsp). We should, Firefox does.
Comment 1 Sam Weinig 2011-07-14 15:59:45 PDT
<rdar://problem/9777548>
Comment 2 Sam Weinig 2011-07-14 16:30:00 PDT
It seems like the issue stems from call to Element::getAttribute() in CSSStyleSelector::SelectorChecker::checkOneSelector not taking into account the *.  We probably need a version of Element::getAttribute that does this using the semantics we want.
Comment 3 Sam Weinig 2011-07-14 19:58:33 PDT
Created attachment 100919 [details]
WIP Patch

Attaching a WIP patch which fixes the test case (and a few test cases @ http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/ in xhtml mode).  I may want to check that suite in before landing this, or, maybe I will just write some more dedicated tests including testing querySelectorAll.
Comment 4 WebKit Review Bot 2011-07-14 20:01:22 PDT
Attachment 100919 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/css/CSSStyleSelector.cpp']" exit_code: 1

Source/WebCore/css/CSSStyleSelector.cpp:2416:  Non-label code inside switch statements should be indented.  [whitespace/indent] [4]
Source/WebCore/css/CSSStyleSelector.cpp:2426:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 2 in 1 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Sam Weinig 2011-07-15 14:28:46 PDT
I decided to land the selectors test suite after all (see https://bugs.webkit.org/show_bug.cgi?id=64610) so that provides a good test bed.
Comment 6 Sam Weinig 2011-07-15 14:48:59 PDT
Created attachment 101047 [details]
Patch
Comment 7 Sam Weinig 2011-07-16 12:07:26 PDT
Committed r91151: <http://trac.webkit.org/changeset/91151>