Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 35354
Status: rejected
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: glanchow [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: XHTML AND CSS not well implemented
It maybe a subject for the wishlist but i think that it's more important my @styles = ( { -src => 'styles/mystyle.css', -title => 'default'} ); print header(-type=>'application/xhtml+xml', -charset=>'utf-8'), start_html(-encoding => 'utf-8', -style=>\@styles, -declare_xml => 'true'); As it is documented, -declare_xml will outputs this: <?xml version="1.0" encoding="utf-8"?> and later, start_html outputs this <link rel="stylesheet" type="text/css" href="styles/mystyle.css" title="default"/> Then, my XHTML when loaded (i did test with firefox) doesn't load my CSS. Here is what it has to be: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="mystyle.css"?> Documentation: (http://www.w3schools.com/xml/xml_display.asp)
From: glanchow [...] gmail.com
(This is a manual copy mistake, the bug is real) <?xml-stylesheet type="text/css" href="mystyle.css"?> => <?xml-stylesheet type="text/css" href="styles/mystyle.css"?>
From: glanchow [...] gmail.com
It may be discussed, i think that both <?xml and <link declaration are necessary. See javascript documentation about setActiveStyleSheet() <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="mystyle.css"?> <link rel="stylesheet" type="text/css" href="styles/mystyle.css" title="default"/>
This will require a new API for setting the stylesheet so that both the header and the head are in sync. Can you suggest the call you would like to see? On Wed Apr 23 18:06:59 2008, glanchow wrote: Show quoted text
> It may be discussed, i think that both <?xml and <link declaration are > necessary. > See javascript documentation about setActiveStyleSheet() > > <?xml version="1.0" encoding="utf-8"?> > <?xml-stylesheet type="text/css" href="mystyle.css"?> > > <link rel="stylesheet" type="text/css" href="styles/mystyle.css" > title="default"/>
Subject: Re: [rt.cpan.org #35354] XHTML AND CSS not well implemented
Date: Fri, 23 May 2008 18:52:43 +0200
To: bug-CGI.pm [...] rt.cpan.org
From: "Guillaume Lan Chow Wing" <glanchow [...] gmail.com>
Hi, much thanks for replying :) I'll suggest you for the stylesheet thing soon, but i've passed the afternoon trying to understand something : I was experiencing a big mess while trying to receive form data with utf-8 Using CGI.pm Version 3.29 i had to do this Encode::encode("utf-8", param($key)) to get the received fields correctly and i said a big mess ! : i had really a strange behavior, after submiting 2 times a form with accentuated letters in a field, then every accentuated letters in the body document went in who knows which encoding, when i don't see the link beetween the form field itself and a h1 or p elsewhere. moreover i didn't notice the existence of -override and you'll understand that i didn't understand the strange symbols into textfields after the form submission. Then i read this http://rt.cpan.org/Public/Bug/Display.html?id=19913 and decided to upgrade CGI.pm to Version 3.37 and use pragmas -nosticky and -utf8, but !!! -nosticky does nothing, i still need to do override=>1 for each field ... and now, -utf8 pragma does exactly the problem of this morning !! well, only for form fields this time :) BUT if i don't use the -utf8 pragma with version 3.37, then i don't have any utf-8 problem anymore I won't complain because now the form works correctly with utf-8 ! But if i did understand your discussion (english), it wasn't supposed to work without -utf8 pragma, and this pragma wasn't suppose to introduce the problem that it was aimed to resolv :) So i just wanted to tell you all i did in case that it could help you understanding better utf-8 problems. If i had only one question : do i use correctly the -nosticky ? Regards. #!/usr/bin/perl # my CGI.pm Version is 3.37 # wget http://search.cpan.org/src/LDS/CGI.pm-3.37/CGI.pm # cp CGI.pm /usr/share/perl/5.10/CGI.pm #http://rt.cpan.org/Public/Bug/Display.html?id=19913 # Uncomment this and load the form and submit : # The ééé are converted into strange symbols #use CGI qw(-utf8 :standard); # Uncomment this and see that the behavior is unchanged #use CGI qw(-nosticky :standard); print header(-charset=>'utf-8'), start_html(-encoding => 'utf-8'), $CGI::VERSION, h1('Copy/paste and Submit!!'), start_form, textfield(-name=>'field', -value=>'ééé', -size=>50, -maxlength=>50), # textfield(-override=>'1', -name=>'field', -value=>'ééé', -size=>50, -maxlength=>50), submit(), end_form, end_html, ; On Fri, May 23, 2008 at 11:06 AM, Lincoln_D_Stein via RT < bug-CGI.pm@rt.cpan.org> wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=35354 > > > This will require a new API for setting the stylesheet so that both the > header and the head are in sync. Can you suggest the call you would like > to see? > > On Wed Apr 23 18:06:59 2008, glanchow wrote:
> > It may be discussed, i think that both <?xml and <link declaration are > > necessary. > > See javascript documentation about setActiveStyleSheet() > > > > <?xml version="1.0" encoding="utf-8"?> > > <?xml-stylesheet type="text/css" href="mystyle.css"?> > > > > <link rel="stylesheet" type="text/css" href="styles/mystyle.css" > > title="default"/>
> > > >
Any further thoughts on the suggested API here? And regarding the separate UTF-8 issue, please open a separate ticket if you feel there is a UTF-8 bug. On Fri May 23 05:05:56 2008, LDS wrote: Show quoted text
> This will require a new API for setting the stylesheet so that both the > header and the head are in sync. Can you suggest the call you would like > to see? > > On Wed Apr 23 18:06:59 2008, glanchow wrote:
> > It may be discussed, i think that both <?xml and <link declaration are > > necessary. > > See javascript documentation about setActiveStyleSheet() > > > > <?xml version="1.0" encoding="utf-8"?> > > <?xml-stylesheet type="text/css" href="mystyle.css"?> > > > > <link rel="stylesheet" type="text/css" href="styles/mystyle.css" > > title="default"/>
> >
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/54 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
Rejecting. I'm not accepting any feature requests, patches, or updates to the HTML generating functions of CGI.pm unless they are of a critical nature (i.e. fixing fundamentally broken HTML output).