Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser doesn't match spec for ID #51

Open
huyz opened this issue Aug 28, 2011 · 2 comments
Open

Parser doesn't match spec for ID #51

huyz opened this issue Aug 28, 2011 · 2 comments
Assignees
Milestone

Comments

@huyz
Copy link

huyz commented Aug 28, 2011

The CSS3 spec allows for multiple #id1#id2 but the parser only tracks 1.

                currentParsed.id = id.replace(reUnescape, '');

but

simple_selector_sequence
  : [ type_selector | universal ]
    [ HASH | class | attrib | pseudo | negation ]*
  | [ HASH | class | attrib | pseudo | negation ]+
  ;

This is a problem if we try to reconstitute an equivalent selector back from a parsed object: you lose data

@subtleGradient
Copy link
Member

I can't really think of a practical use-case, but that's no reason not to support it.

I will make it work.
Thanks for the report!

@ghost ghost assigned subtleGradient Sep 23, 2011
@huyz
Copy link
Author

huyz commented Sep 24, 2011

Yeah it seems hard to imagine.
But like I said, my goal is to reconstitute an equivalent selector back from a parsed object. And I don't want the reconstituted selector to have only one ID when the original selector had 2; this would clearly affect browser behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants