Bug 21091

Summary: Regression: querySelector matches tag names case sensitively
Product: WebKit Reporter: David Smith <catfish.man>
Component: DOMAssignee: David Smith <catfish.man>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P1    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://dscoder.com/qsaidtest.html
Attachments:
Description Flags
Fix eric: review+

Description David Smith 2008-09-25 00:23:23 PDT
It should be case insensitive in HTML documents. Patch tomorrow; too tired to wait for the world to rebuild right now. This regressed in http://trac.webkit.org/changeset/35282 because parseSelector doesn't create the dummy stylesheet with a Document, so the CSSParser can't check whether the Document is an HTML one.
Comment 1 David Smith 2008-09-25 01:18:10 PDT
Created attachment 23784 [details]
Fix
Comment 2 Eric Seidel (no email) 2008-09-25 01:21:59 PDT
Comment on attachment 23784 [details]
Fix

The change looks fine.  I'd like to see an xhtml test as well (or maybe that's already covered?)  That could also be done in a follow-up patch.
Comment 3 David Smith 2008-09-25 01:57:59 PDT
Landed with an xhtml test in r36890
Comment 4 Darin Adler 2008-09-25 09:49:28 PDT
Comment on attachment 23784 [details]
Fix

+        std::auto_ptr<CSSSelector> parseSelector(const String&, Document* doc = 0);

The parameter should not be named here.

+std::auto_ptr<CSSSelector> CSSParser::parseSelector(const String& string, Document* doc)
+{    
+    RefPtr<CSSStyleSheet> dummyStyleSheet = CSSStyleSheet::create(doc);

I strongly prefer "document" over "doc", but that's just my personal taste.