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

Issue 12138043: Recognize media queries on @import, <link media=...>, and <style media=...> (Closed)

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

Description

This changes html-emitter and sanitizeStylesheet to recognize media queries, and sanitize them appropriately. Previously, there was a bug that caused far too many stylesheets to be generated -- the style element would have multiple text nodes, each a prefix of later ones. This CL inlines @imports where they occur in the stylesheet. Tests for corner cases like nested media <style media="only all and (color)"> @import "bar.css" only all and (hover) </style> are in es53-test-css-imports ---- Submitted @ r5517

Patch Set 1 #

Patch Set 2 : Recognize media queries on @import, <link media=...>, and <style media=...> #

Patch Set 3 : Recognize media queries on @import, <link media=...>, and <style media=...> #

Patch Set 4 : Recognize media queries on @import, <link media=...>, and <style media=...> #

Patch Set 5 : Recognize media queries on @import, <link media=...>, and <style media=...> #

Patch Set 6 : Recognize media queries on @import, <link media=...>, and <style media=...> #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -58 lines) Patch
M src/com/google/caja/plugin/html-emitter.js View 1 2 3 4 5 9 chunks +37 lines, -21 lines 0 comments Download
M src/com/google/caja/plugin/sanitizecss.js View 1 2 3 4 5 4 chunks +50 lines, -24 lines 0 comments Download
MM tests/com/google/caja/plugin/es53-test-css-imports-guest.html View 1 2 3 4 5 4 chunks +44 lines, -11 lines 1 comment Download
A tests/com/google/caja/plugin/media-test-1-black-bg.css View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A tests/com/google/caja/plugin/media-test-2-black-bg.css View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A tests/com/google/caja/plugin/media-test-3-black-bg.css View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/sanitizecss_test.js View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 11
MikeSamuel
12 years, 7 months ago (2013-07-31 01:54:31 UTC) #1
MikeSamuel
This changes html-emitter and sanitizeStylesheet to recognize media queries, and sanitize them appropriately. Previously, there ...
12 years, 7 months ago (2013-07-31 05:09:27 UTC) #2
MikeSamuel
This changes html-emitter and sanitizeStylesheet to recognize media queries, and sanitize them appropriately. Previously, there ...
12 years, 7 months ago (2013-07-31 07:18:37 UTC) #3
felix8a
On 2013/07/31 07:18:37, MikeSamuel wrote: > STILL PENDING: tests for corner cases like nested media ...
12 years, 7 months ago (2013-07-31 19:18:25 UTC) #4
MikeSamuel
This changes html-emitter and sanitizeStylesheet to recognize media queries, and sanitize them appropriately. Previously, there ...
12 years, 7 months ago (2013-07-31 23:58:45 UTC) #5
MikeSamuel
This changes html-emitter and sanitizeStylesheet to recognize media queries, and sanitize them appropriately. Previously, there ...
12 years, 7 months ago (2013-07-31 23:59:29 UTC) #6
MikeSamuel
On 2013/07/31 19:18:25, felix8a wrote: > yeah, es53-test-css-imports seems like an ok place to test ...
12 years, 7 months ago (2013-08-01 00:00:26 UTC) #7
MikeSamuel
This changes html-emitter and sanitizeStylesheet to recognize media queries, and sanitize them appropriately. Previously, there ...
12 years, 7 months ago (2013-08-01 15:40:13 UTC) #8
MikeSamuel
snapshotted
12 years, 7 months ago (2013-08-01 15:40:43 UTC) #9
felix8a
lgtm https://codereview.appspot.com/12138043/diff/17001/tests/com/google/caja/plugin/es53-test-css-imports-guest.html File tests/com/google/caja/plugin/es53-test-css-imports-guest.html (right): https://codereview.appspot.com/12138043/diff/17001/tests/com/google/caja/plugin/es53-test-css-imports-guest.html#newcode34 tests/com/google/caja/plugin/es53-test-css-imports-guest.html:34: media="all and (color) and (color: 0)"> maybe omit ...
12 years, 7 months ago (2013-08-02 05:03:49 UTC) #10
MikeSamuel
12 years, 7 months ago (2013-08-02 06:20:18 UTC) #11
Message was sent while issue was closed.
On 2013/08/02 05:03:49, felix8a wrote:
> lgtm
> 
>
https://codereview.appspot.com/12138043/diff/17001/tests/com/google/caja/plug...
> File tests/com/google/caja/plugin/es53-test-css-imports-guest.html (right):
> 
>
https://codereview.appspot.com/12138043/diff/17001/tests/com/google/caja/plug...
> tests/com/google/caja/plugin/es53-test-css-imports-guest.html:34: media="all
and
> (color) and (color: 0)">
> maybe omit "all and" to verify that implied all works. most html/css in the
wild
> will probably omit "all and".

Done
Sign in to reply to this message.

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