[Seaside] [kustos@gmx.net: seaside xhtml output]

kustos kustos at gmx.net
Tue Nov 9 21:54:52 CET 2004


Ok, suprisingly I won't get any frieds by suggesting something that 
breaks IE ;-)
But I won't give up that easily.

What about that:
WAKom>>process: komRequest
    | request response komResponse isXhtmlOk isHtml |
    self log: komRequest.
    request := self convertRequest: komRequest.
    response := self handleRequest: request.
    komResponse := self convertResponse: response.
   
    isXhtmlOk := ((komRequest header at: 'accept') findBetweenSubStrs: ',')
                includes: 'application/xhtml+xml'.
    isHtml := komResponse contentType beginsWith: 'text/html'.
    (isXhtmlOk and: isHtml)
        ifTrue: [komResponse contentType: 'application/xhtml+xml; 
charset=utf-8'].
       
    response release.
   
    ^komResponse

Checks if the user agent accepts application/xhtml+xml if that is the 
case and the content type is text/html then we change it to 
application/xhtml+xml so we shouldn't break anything.
I tested it with IE6 and Firefox and it seems to work. IE6 gets html and 
Firefox gets xhtml.
It's still a hack and should be made at another point but at least it 
works. :-)

The W3C on XHTML media types.
http://www.w3.org/TR/2002/NOTE-xhtml-media-types-20020801/
You can actually make IE to accept application/xhtml+xml
http://www.peterprovost.org/archive/2004/10/22/2003.aspx

On a sidenote I noticed that the toolbar is not at the bottom of the 
page with IE like in mozilla.

Philippe

Avi Bryant wrote:

>
> On Nov 8, 2004, at 6:10 PM, Patrick Mauritz wrote:
>
>> On Mon, 8 Nov 2004 18:08:09 +0100, Avi Bryant <avi at beta4.com> wrote:
>>
>>> Which is, of course, exactly why Seaside behaves as it currently does -
>>> to cope with Microsoft's broken browser.
>>
>> how about using something like ie7 (http://dean.edwards.name/ie7)
>> then, instead of spoiling it for everybody (quirks modes in other
>> browser are usually.. well, quirky)
>
>
> I'm pretty sure we're not activating quirks mode in other browsers 
> (and if we are it's a bug) - we're claiming to be XHTML transitional, 
> and (should) validate against that.  That doesn't preclude serving as 
> text/html AFAIK.  Philippe did point out some minor issues that can 
> and should be fixed, but I'm not going to break support for IE at the 
> framework level.  As for IE7, it's cool, but it looks like something 
> that will mostly be useful for people that are doing specific things 
> at the application level that wouldn't work in IE, not something I 
> want every Seaside app to have to depend on.
>
> Avi
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>
>


More information about the Seaside mailing list