Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(19)

Issue 13146044: accept "inherit" for all css properties (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by felix8a
Modified:
12 years, 6 months ago
Reviewers:
MikeSamuel, kpreid2
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

The css standards are generally written to omit "inherit" from property specifications, but the standards also have a paragraph near the beginning that says "inherit" is valid for all properties despite being omitted from the property specifications. Our css whitelisting inconsistently allows "inherit" for some properties, not all. This change makes "inherit" always an acceptable value. There are a few quirks: - The client-side css sanitizer is looser than the server-side one, because the client-side sanitizer only checks tokens, not full expressions. This applies to all types of css values, but for "inherit" in particular, the client-side sanitizer accepts p { color: inherit inherit; } which the server-side sanitizer rejects. - The server-side sanitizer had some tests that accepted things like p { font: inherit "foo"; } which is not actually legal; browsers reject that rule. I deleted the tests. - The rule for "content" explicitly disallowed "inherit", from a concern that it could bring in values defined in a parent element. This is unlikely to be a problem, because "content" is almost always set on ::before and ::after pseudo-elements, which cannot have children.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -167 lines) Patch
M src/com/google/caja/lang/css/CssSchema.java View 1 chunk +1 line, -0 lines 0 comments Download
M src/com/google/caja/lang/css/css3-defs.json View 40 chunks +107 lines, -103 lines 0 comments Download
M src/com/google/caja/plugin/CssValidator.java View 2 chunks +17 lines, -0 lines 0 comments Download
M src/com/google/caja/plugin/sanitizecss.js View 1 chunk +4 lines, -0 lines 0 comments Download
M tests/com/google/caja/lang/css/CssPropertyPatternsTest.java View 1 chunk +1 line, -1 line 0 comments Download
M tests/com/google/caja/lang/css/CssSchemaTest.java View 1 chunk +1 line, -0 lines 0 comments Download
M tests/com/google/caja/plugin/CssValidatorTest.java View 4 chunks +19 lines, -63 lines 0 comments Download
M tests/com/google/caja/plugin/sanitizecss_test.js View 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 3
felix8a
12 years, 6 months ago (2013-08-24 08:14:07 UTC) #1
kpreid2
LGTM but I'm not fully aware of the context, so maybe wait for Mike to ...
12 years, 6 months ago (2013-08-26 18:37:16 UTC) #2
felix8a
12 years, 6 months ago (2013-08-28 18:26:04 UTC) #3
@r5584
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b