I don't have in-depth knowledge about caja css parser and how its used in gadgets ...
15 years, 8 months ago
(2010-07-15 19:17:32 UTC)
#3
I don't have in-depth knowledge about caja css parser and how its used in
gadgets world, active shindig committers will know that better.
But seeing your change gives me a better understanding.
Sorry about looking when you had asked not to :)
http://codereview.appspot.com/1852041/diff/1/5
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java
(right):
http://codereview.appspot.com/1852041/diff/1/5#newcode171
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java:171:
((AbstractParseTreeNode) chain.getParentNode()).removeChild(chain.node);
The block corresponding to
if (extractImports) {
...} else {
dont remove @import url node.
}
is missing.
http://codereview.appspot.com/1852041/diff/1/2
File
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriterTest.java
(right):
http://codereview.appspot.com/1852041/diff/1/2#newcode28
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriterTest.java:28:
import org.apache.shindig.gadgets.parse.caja.CajaCssParser;
Please add @import "http://www.example.org" test case.
http://codereview.appspot.com/1852041/diff/1/4 File java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java (right): http://codereview.appspot.com/1852041/diff/1/4#newcode56 java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java:56: * TODO(jasvir): This ought to be set to the ...
15 years, 8 months ago
(2010-07-16 01:12:34 UTC)
#4
http://codereview.appspot.com/1852041/diff/1/4
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java
(right):
http://codereview.appspot.com/1852041/diff/1/4#newcode56
java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java:56:
* TODO(jasvir): This ought to be set to the real URI for accurate reporting
want to just do it in this CL? all calling contexts have the source Uri
available.
http://codereview.appspot.com/1852041/diff/1/5
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java
(right):
http://codereview.appspot.com/1852041/diff/1/5#newcode167
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java:167:
// Extract the import statment, add its URI to the returned list
nit: statement
http://codereview.appspot.com/1852041/diff/1/5#newcode171
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java:171:
((AbstractParseTreeNode) chain.getParentNode()).removeChild(chain.node);
Specifically, rewriting the Uri of the @import, when !extractImports AFAICT.
On 2010/07/15 19:17:32, gagan.goku wrote:
> The block corresponding to
> if (extractImports) {
> ...} else {
> dont remove @import url node.
> }
>
> is missing.
http://codereview.appspot.com/1852041/diff/1/4 File java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java (right): http://codereview.appspot.com/1852041/diff/1/4#newcode56 java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java:56: * TODO(jasvir): This ought to be set to the ...
15 years, 8 months ago
(2010-07-20 06:30:08 UTC)
#5
http://codereview.appspot.com/1852041/diff/1/4
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java
(right):
http://codereview.appspot.com/1852041/diff/1/4#newcode56
java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/caja/CajaCssParser.java:56:
* TODO(jasvir): This ought to be set to the real URI for accurate reporting
On 2010/07/16 01:12:34, johnfargo wrote:
> want to just do it in this CL? all calling contexts have the source Uri
> available.
I also changed the relative urls like "www.example.org/foo" into actual absolute
ones.
Done.
http://codereview.appspot.com/1852041/diff/1/5
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java
(right):
http://codereview.appspot.com/1852041/diff/1/5#newcode167
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java:167:
// Extract the import statment, add its URI to the returned list
On 2010/07/16 01:12:34, johnfargo wrote:
> nit: statement
Done.
http://codereview.appspot.com/1852041/diff/1/5#newcode171
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java:171:
((AbstractParseTreeNode) chain.getParentNode()).removeChild(chain.node);
On 2010/07/16 01:12:34, johnfargo wrote:
> Specifically, rewriting the Uri of the @import, when !extractImports AFAICT.
>
> On 2010/07/15 19:17:32, gagan.goku wrote:
> > The block corresponding to
> > if (extractImports) {
> > ...} else {
> > dont remove @import url node.
> > }
> >
> > is missing.
>
>
Done.
http://codereview.appspot.com/1852041/diff/1/5#newcode171
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriter.java:171:
((AbstractParseTreeNode) chain.getParentNode()).removeChild(chain.node);
On 2010/07/15 19:17:32, gagan.goku wrote:
> The block corresponding to
> if (extractImports) {
> ...} else {
> dont remove @import url node.
> }
>
> is missing.
Done.
http://codereview.appspot.com/1852041/diff/1/2
File
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriterTest.java
(right):
http://codereview.appspot.com/1852041/diff/1/2#newcode28
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/CssResponseRewriterTest.java:28:
import org.apache.shindig.gadgets.parse.caja.CajaCssParser;
On 2010/07/15 19:17:32, gagan.goku wrote:
> Please add @import "http://www.example.org" test case.
Done.
Thanks for the review. Sorry to hold off on submitting this. I synced to trunk ...
15 years, 8 months ago
(2010-07-23 07:11:59 UTC)
#8
Thanks for the review.
Sorry to hold off on submitting this. I synced to trunk only to realize it
breaks StyleTagProxyEmbeddedUrlsVisitorTest. I'll figure out why and sync.
StyleTagProxyEmbeddedUrlsVisitorTest.testImportsAndBackgroundUrlsInStyleTag() is incorrect. According the W3C CSS2 spec http://www.w3.org/TR/CSS2/syndata.html#at-rules: CSS 2.1 user agents must ignore ...
15 years, 8 months ago
(2010-07-26 03:51:27 UTC)
#9
StyleTagProxyEmbeddedUrlsVisitorTest.testImportsAndBackgroundUrlsInStyleTag() is
incorrect. According the W3C CSS2 spec
http://www.w3.org/TR/CSS2/syndata.html#at-rules: CSS 2.1 user agents must
ignore any '@import' rule that occurs inside a block or after any non-ignored
statement other than an @charset or an @import rule.
I've changed the test case to test what I assume was intended to be tested (an
unignored @import), synced and submitted.
(Incidentally the submission was made while at 10969m and traveling at the speed
of at 822km/h. Is this a contender for the Shindig patch made at the greatest
height and speed? :) )
On Mon, Jul 26, 2010 at 9:21 AM, <jasvir@gmail.com> wrote: > > StyleTagProxyEmbeddedUrlsVisitorTest.testImportsAndBackgroundUrlsInStyleTag() > is ...
15 years, 8 months ago
(2010-07-26 04:00:59 UTC)
#10
On Mon, Jul 26, 2010 at 9:21 AM, <jasvir@gmail.com> wrote:
>
> StyleTagProxyEmbeddedUrlsVisitorTest.testImportsAndBackgroundUrlsInStyleTag()
> is incorrect. According the W3C CSS2 spec
> http://www.w3.org/TR/CSS2/syndata.html#at-rules: CSS 2.1 user agents
> must ignore any '@import' rule that occurs inside a block or after any
> non-ignored statement other than an @charset or an @import rule.
> I've changed the test case to test what I assume was intended to be
> tested (an unignored @import), synced and submitted.
>
Makes sense. Out of curiosity, caja must be ignoring @import statement after
a non ignorable css statement [ which is probably why that test failed :) ]
If so, is there a flag asking it to not do so ? It could come in handy if
we find a user agent that does not ignore such statements and want to
emulate its behavior.
>
> (Incidentally the submission was made while at 10969m and traveling at
> the speed of at 822km/h. Is this a contender for the Shindig patch made
> at the greatest height and speed? :) )
Nice ! Travelling in first class eh :)
Definitely a solid contestant id say.
>
> http://codereview.appspot.com/1852041/show
>
On Sun, Jul 25, 2010 at 9:00 PM, Gagandeep Singh <gagan.goku@gmail.com>wrote: > > On Mon, ...
15 years, 8 months ago
(2010-07-26 16:59:27 UTC)
#11
On Sun, Jul 25, 2010 at 9:00 PM, Gagandeep Singh <gagan.goku@gmail.com>wrote:
>
> On Mon, Jul 26, 2010 at 9:21 AM, <jasvir@gmail.com> wrote:
>
>>
>> StyleTagProxyEmbeddedUrlsVisitorTest.testImportsAndBackgroundUrlsInStyleTag()
>> is incorrect. According the W3C CSS2 spec
>> http://www.w3.org/TR/CSS2/syndata.html#at-rules: CSS 2.1 user agents
>> must ignore any '@import' rule that occurs inside a block or after any
>> non-ignored statement other than an @charset or an @import rule.
>
>
>> I've changed the test case to test what I assume was intended to be
>> tested (an unignored @import), synced and submitted.
>>
> Makes sense. Out of curiosity, caja must be ignoring @import statement
> after a non ignorable css statement [ which is probably why that test failed
> :) ]
> If so, is there a flag asking it to not do so ? It could come in handy if
> we find a user agent that does not ignore such statements and want to
> emulate its behavior.
>
>
>>
>> (Incidentally the submission was made while at 10969m and traveling at
>> the speed of at 822km/h. Is this a contender for the Shindig patch made
>> at the greatest height and speed? :) )
>
>
> Nice ! Travelling in first class eh :)
> Definitely a solid contestant id say.
>
Contestant, yes. Winner: I regret to say no. I made a commit a few weeks ago
@37k ft and (tailwind assist) 590 mph :P
>
>
>>
>> http://codereview.appspot.com/1852041/show
>>
>
>
Issue 1852041: Remove unneeded @imports handling
(Closed)
Created 15 years, 8 months ago by Jasvir
Modified 15 years, 8 months ago
Reviewers: gagan.goku, johnfargo
Base URL: https://svn.apache.org/repos/asf/shindig/trunk/
Comments: 10