If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

CSS parser accepts "@namespace url(x" -- missing close paren at EOF

RESOLVED INVALID

Status

()

Core
CSS Parsing and Computation
--
minor
RESOLVED INVALID
9 years ago
9 years ago

People

(Reporter: Jesse Ruderman, Unassigned)

Tracking

({testcase})

Trunk
x86
Mac OS X
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

9 years ago
Created attachment 358679 [details]
testcase

Firefox's CSS parser doesn't mind the missing ")" as long as there's an EOF right there:

  @namespace url(x

is accepted and turned into

  @namespace url(x);

(I'm just guessing this is a bug.  Safari and Opera don't seem to support .cssRules for @namespace, so it's hard for me to tell what they do.)
(Reporter)

Comment 1

9 years ago
Created attachment 358680 [details]
testcase 2

Similarly, Firefox seems fine with an unclosed quote at the end of the file:

@namespace '
(Reporter)

Comment 2

9 years ago
I found this more through accident than through fuzzing.  If this is a bug, I can have the fuzzer test for some invariant like "adding \n at the end shouldn't affect the result of parsing" to look for more bugs like it.
We're supposed to be ok with these, I think, although it's a relatively recent change in the spec.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → INVALID
In particular, see http://www.w3.org/TR/CSS21/syndata.html#parsing-errors -- the parts about "Unexpected end of style sheet" and "Unexpected end of string".
You need to log in before you can comment on or make changes to this bug.