Closed Bug 387511 Opened 17 years ago Closed 17 years ago

CSS scanner causes parse error for URLs starting with a codepoint > 255

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sharparrow1, Assigned: sharparrow1)

Details

Attachments

(2 files, 1 obsolete file)

data:text/html;charset=utf-8,<div style="background: url(%E3%81%82.gif) blue">asdf

Expected results: the div is blue.

Actual results: the div has no background color.

The patch is quite straightforward; there's just a stray "if (ch < 256) {" in nsCSSScanner::NextURL.  Not sure how to write tests for this.
URL parsing is seriously broken in many other ways.  See bug 337287, which I never had a chance to finish.
Bleh, the whole thing is really confusing... the spec seems to say that url(/**/a.gif) actually refers "/**/a.gif", i.e. a.gif in the directory "**".  If that's not intended, the spec really needs to be made clearer.  (My reasoning: a URI is pretty clearly specified as just sweeping up everything between the parentheses, and comments are only allowed between tokens.)

In any case, that's a different issue... this is a very straightforward fix (which I haven't gotten around to posting because it conflicts with another patch in my tree.)
Attached patch Patch (obsolete) — Splinter Review
Straightforward fix; I'll also attach a diff -w to make this more reviewable.

I'll add a test for this with Bug 390399.
Attachment #275496 - Flags: review?(bzbarsky)
Attached patch Real patchSplinter Review
Sorry for the bugspam; I didn't mean to attach the previous.
Attachment #275496 - Attachment is obsolete: true
Attachment #275497 - Flags: review?(bzbarsky)
Attachment #275496 - Flags: review?(bzbarsky)
Attached patch diff -wSplinter Review
Comment on attachment 275497 [details] [diff] [review]
Real patch

Looks reasonable, but please check in a test for this.
Attachment #275497 - Flags: review?(bzbarsky) → review+
Attachment #275497 - Flags: superreview?(bzbarsky)
Attachment #275497 - Flags: superreview?(bzbarsky) → superreview+
Attachment #275497 - Flags: approval1.9?
Comment on attachment 275497 [details] [diff] [review]
Real patch

a1.9=dbaron, although this code has many other problems (see patches in bug 337287)
Attachment #275497 - Flags: approval1.9? → approval1.9+
Checked in with test.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: