Closed
Bug 475216
Opened 16 years ago
Closed 7 years ago
CSS serialization doesn't escape characters that need escaping
Categories
(Core :: DOM: CSS Object Model, defect)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Unassigned)
References
Details
(Keywords: sec-low, testcase)
Attachments
(1 file)
234 bytes,
text/html
|
Details |
No description provided.
Reporter | ||
Updated•16 years ago
|
Blocks: jesse-css-grammar-fuzzer
Some of these are more than just escaping issues, like the IsPseudoElement function in nsCSSStyleRule.cpp, and perhaps bug 280443.
Bug 478160 and bug 481591 helped a few of the problems here, but there's still a good bit more to fix.
Depends on: 543428
QA Contact: general → style-system
Updated•13 years ago
|
Updated•13 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: mozilla13 → ---
Version: 15 Branch → Trunk
Reporter | ||
Comment 3•12 years ago
|
||
This can lead to security surprises for sites that sanitize user-generated CSS per spec and then use "elem.innerHTML += ...":
http://www.slideshare.net/x00mario/the-innerhtml-apocalypse
Keywords: sec-low
Comment 4•7 years ago
|
||
Current behavior across different browsers:
Firefox (Stylo & non-Stylo):
a\:b > \: { counter-increment: \d \\ 1; font-family: \;; }
Chrome:
a\:b > \: { counter-increment: \d \\ 1; font-family: ";"; }
Edge:
a:b > : { font-family: ;; }
I have no idea what the "correct" behavior is supposed to be here.
Updated•7 years ago
|
Has Regression Range: --- → irrelevant
Comment 5•7 years ago
|
||
All our escaping in the serialization in that test appears to be correct. (That Chrome turns the identifier list font-family name into a string isn't a huge deal, though I think our serialization is very slightly more defensible.)
The one thing that looks incorrect is the inclusion of the "1" in the counter-increment serialization. It looks like Firefox, Chrome and Safari all include the 1 but Edge doesn't. While 1 is the amount that the counter would increment by default when not specified, this shouldn't affect what the specified value actually serializes to.
Comment 6•7 years ago
|
||
Filed bug 1408257 for the counter-increment serialization issue. Since the escaping issues here are fixed, closing this bug.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•