Bug 64567 - Attribute selectors don't handle glob namespaces (e.g. *|E)
Summary: Attribute selectors don't handle glob namespaces (e.g. *|E)
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
Keywords: InRadar
Depends on:
Reported: 2011-07-14 15:59 PDT by Sam Weinig
Modified: 2011-07-16 12:07 PDT (History)
2 users (show)

See Also:

Test case (656 bytes, application/xhtml+xml)
2011-07-14 15:59 PDT, Sam Weinig
no flags Details
WIP Patch (7.43 KB, patch)
2011-07-14 19:58 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (1.82 MB, patch)
2011-07-15 14:48 PDT, Sam Weinig
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
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]
Comment 7 Sam Weinig 2011-07-16 12:07:26 PDT
Committed r91151: <http://trac.webkit.org/changeset/91151>