Re: stylesheet edit rendering problem on pier port to seaside 3.0

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: stylesheet edit rendering problem on pier port to seaside 3.0

Nick
Hi Lukas,

Apologies for repeating myself, but I'm still not sure how to solve this problem, or why you don't see it...

Reiterating; does this test assert on your machine?:

| stylesheetFile stylesheetContents rendererResult |
stylesheetContents := '/* a style sheet */'.
stylesheetFile := (PRFile named: 'defaultCss') filename: 'style.css'; mimetype: 'text/css'; contents: stylesheetContents.
rendererResult := WARenderCanvas builder render: [ :html |
html  render: stylesheetFile file contents].
self assert: rendererResult = stylesheetContents

To reproduce the problem with Pier, register a Pier instance with: 

PRPierFrame registerAsApplication: 'pier' kernel: (PRKernel new root: (PRPage new title: 'test title'; contents: 'Pier on Seaside 3.0'; name: 'testPage'); name: 'testKernel').

browse to: http://localhost:8080/pier/environment/style.css, results in:

#[47 42 32 98 108 117 101 112 114 105 110 ... 

Any more thoughts?

Nick


2010/1/12 Nick Ager <[hidden email]>
I've tried to encapsulate the problem in a test:

| stylesheetFile stylesheetContents rendererResult |
stylesheetContents := '/* a style sheet */'.
stylesheetFile := (PRFile named: 'defaultCss') filename: 'style.css'; mimetype: 'text/css'; contents: stylesheetContents.
rendererResult := WARenderCanvas builder render: [ :html |
html  render: stylesheetFile file contents].
self assert: rendererResult = stylesheetContents

In my image the assertion fails. If I change ByteArray>>greaseString to return self displayString the assertion succeeds.

Does that help?


2010/1/12 Julian Fitzell <[hidden email]>

I'm seeing the same as Nick, fwiw. Same if I try to edit the stylesheet.

Julian

On Tue, Jan 12, 2010 at 2:59 AM, Lukas Renggli <[hidden email]> wrote:
> #[100 101 98 117 103 103 105 110 103], but this method is never called
> when I browse Pier.
>
> Lukas
>
>
> 2010/1/12 Nick Ager <[hidden email]>:
>> Hi Lukas,
>> Don't think the browse cache is the problem. What do you get with:
>> #[100 101 98 117 103 103 105 110 103] greaseString
>> on my image the result:
>>  '#[100 101 98 117 103 103 105 110 103]'
>>
>> 2010/1/12 Lukas Renggli <[hidden email]>
>>>
>>> > Does your the implementation of
>>> > ByteArray>>greaseString match this:
>>> > ByteArray>>greaseString
>>> > "ByteArrays should not automatically be converted to Strings. You should
>>> > use
>>> > a GRCodec for this."
>>> > ^ self printString
>>>
>>> Yes.
>>>
>>> > or does your image have an implementation of ByteArray>>encodeOn?
>>>
>>> No.
>>>
>>> Maybe you should clear your browser caches?
>>>
>>> Lukas
>>>
>>> > 2010/1/11 Lukas Renggli <[hidden email]>
>>> >>
>>> >> Has this been fixed, because it works here?
>>> >>
>>> >> Lukas
>>> >>
>>> >> 2010/1/11 Julian Fitzell <[hidden email]>:
>>> >> > Maybe we need to implement #encodeOn: on ByteArray? Lukas?
>>> >> >
>>> >> > Julian
>>> >> >


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: stylesheet edit rendering problem on pier port to seaside 3.0

Lukas Renggli
> Apologies for repeating myself, but I'm still not sure how to solve this
> problem, or why you don't see it...

No problem.

> Reiterating; does this test assert on your machine?:
> | stylesheetFile stylesheetContents rendererResult |
> stylesheetContents := '/* a style sheet */'.
> stylesheetFile := (PRFile named: 'defaultCss') filename: 'style.css';
> mimetype: 'text/css'; contents: stylesheetContents.
> rendererResult := WARenderCanvas builder render: [ :html |
> html  render: stylesheetFile file contents].
> self assert: rendererResult = stylesheetContents

This test does not pass in my image either. I don't see where such
code would be used though? File (and thus CSS files) are certainly not
fed through a HTML canvas. If you download a Pier 2 image from my
build server <http://hudson.lukas-renggli.ch/job/Seaside%203.0/ws/pier2/*zip*/pier2.zip>
you see that the stylesheets are properly served, I don't see any
problems there.

> To reproduce the problem with Pier, register a Pier instance with:
> PRPierFrame registerAsApplication: 'pier' kernel: (PRKernel new root:
> (PRPage new title: 'test title'; contents: 'Pier on Seaside 3.0'; name:
> 'testPage'); name: 'testKernel').
> browse to: http://localhost:8080/pier/environment/style.css, results in:
> #[47 42 32 98 108 117 101 112 114 105 110 ...
> Any more thoughts?

Aha, that I can reproduce. I fixed it in the latest commit.

Note that #greaseString should probably not be used everywhere.
#asString is in the ANSI standard defined on Character, String,
ByteArray, and other sequenceable collections; so in some cases that
might be the appropriate choice.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: stylesheet edit rendering problem on pier port to seaside 3.0

Nick
Fantastic that we've finally got to the bottom of this one, also my test code no longer asserts when the code is changed to match your changes. So the rendering code becomes:

html  render: stylesheetFile contents

 
This test does not pass in my image either. I don't see where such
code would be used though? File (and thus CSS files) are certainly not
fed through a HTML canvas.

The test was my attempt at condensing the pertinent code relating to the problem. I'm fairly sure the code has a good correspondence with the code path used when you browse to:  http://localhost:8080/pier/environment/style.css, but as ever I might have missed something

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: stylesheet edit rendering problem on pier port to seaside 3.0

Lukas Renggli
>> This test does not pass in my image either. I don't see where such
>> code would be used though? File (and thus CSS files) are certainly not
>> fed through a HTML canvas.
>
> The test was my attempt at condensing the pertinent code relating to the
> problem. I'm fairly sure the code has a good correspondence with the code
> path used when you browse to:
>  http://localhost:8080/pier/environment/style.css, but as ever I might have
> missed something

It was a misunderstanding from my side. I was only checking how
Seaside served the file, not how the file is displayed in Pier in case
the structure is browsed or edited.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: stylesheet edit rendering problem on pier port to seaside 3.0

Julian Fitzell-2
In reply to this post by Lukas Renggli
On Fri, Jan 15, 2010 at 6:55 AM, Lukas Renggli <[hidden email]> wrote:
> Note that #greaseString should probably not be used everywhere.
> #asString is in the ANSI standard defined on Character, String,
> ByteArray, and other sequenceable collections; so in some cases that
> might be the appropriate choice.

Sure, though shouldn't we make sure that #greaseString calles
#asString for those classes? Seems more straightforward...

Julian
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki