Bug 19919 - Add selectors' string parsing in CSSParser
Summary: Add selectors' string parsing in CSSParser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-06 15:10 PDT by Julien Chaffraix
Modified: 2008-07-21 18:44 PDT (History)
1 user (show)

See Also:


Attachments
First version (5.65 KB, patch)
2008-07-06 15:15 PDT, Julien Chaffraix
hyatt: review+
Details | Formatted Diff | Diff
Add CSSGrammar magic and switch querySelector to it (6.72 KB, patch)
2008-07-15 16:38 PDT, Julien Chaffraix
no flags Details | Formatted Diff | Diff
Same as the previous one, without the memory leak (8.83 KB, patch)
2008-07-15 18:20 PDT, Julien Chaffraix
sam: review-
Details | Formatted Diff | Diff
Updated patch: use auto_ptr (8.31 KB, patch)
2008-07-21 17:27 PDT, Julien Chaffraix
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Chaffraix 2008-07-06 15:10:50 PDT
For example, the element attribute (from the tag <binding>) takes a string that is a selector. Currently it is not possible to get the Selector represented by such a string.

Patch will follow.
Comment 1 Julien Chaffraix 2008-07-06 15:15:53 PDT
Created attachment 22121 [details]
First version
Comment 2 Eric Seidel (no email) 2008-07-06 19:12:41 PDT
Comment on attachment 22121 [details]
First version

I'm confused by this patch.  I'm not sure what @-webkit-selector is, or what @selector even is.

I've also CC'd hyatt, as he likely knows what's going on here (and can better comment if your patch is correct or not).
Comment 3 Dave Hyatt 2008-07-15 13:07:31 PDT
Comment on attachment 22121 [details]
First version

r=me, although remove the no-op change to QualifiedName.cpp.
Comment 4 Julien Chaffraix 2008-07-15 16:34:04 PDT
This patch is not required for XBL (querySelector will do the trick) but it would enhance querySelector.

Changing the bug name to match the new need.
Comment 5 Julien Chaffraix 2008-07-15 16:38:44 PDT
Created attachment 22294 [details]
Add CSSGrammar magic and switch querySelector to it
Comment 6 Julien Chaffraix 2008-07-15 18:20:19 PDT
Created attachment 22297 [details]
Same as the previous one, without the memory leak
Comment 7 Sam Weinig 2008-07-21 16:43:27 PDT
Comment on attachment 22297 [details]
Same as the previous one, without the memory leak

Sorry for leading you down a bad path, but I think a better and less invasive would to be just to return an auto_ptr and not turn CSSSelector into a RefCounted object.
Comment 8 Julien Chaffraix 2008-07-21 17:27:30 PDT
Created attachment 22416 [details]
Updated patch: use auto_ptr
Comment 9 Julien Chaffraix 2008-07-21 18:44:05 PDT
Landed in r35282.