Project

General

Profile

Actions

Bug #7110

closed

CGI: Add support for HTML5 <header> tag

Added by stomar (Marcus Stollsteimer) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-09-28 trunk 37049) [i686-linux]
Backport:
[ruby-core:47847]

Description

=begin
These patches add the tag to CGI's HTML generation methods, finalizing the support of HTML5, see #6637.

Note that the old CGI#header method is renamed to CGI#http_header. CGI#header now generates a HTML5 header element.
=end


Files

01_lib_cgi_rename_header_to_http_header.patch (10.2 KB) 01_lib_cgi_rename_header_to_http_header.patch rename CGI#header to CGI#http_header stomar (Marcus Stollsteimer), 10/05/2012 10:22 PM
02_lib_cgi_add_html5_header_tag.patch (1.16 KB) 02_lib_cgi_add_html5_header_tag.patch add <header> tag and some tests stomar (Marcus Stollsteimer), 10/05/2012 10:22 PM

Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #6637: Add HTML5 support to CGIClosedxibbar (Takeyuki FUJIOKA)06/24/2012Actions
Related to Ruby master - Bug #7286: CGI#header が 1.9.3 と異なる挙動となっているClosedxibbar (Takeyuki FUJIOKA)11/06/2012Actions

Updated by mame (Yusuke Endoh) over 11 years ago

  • Status changed from Open to Assigned

xibbar, are you willing to include this in 2.0.0?
If so, please commit it ASAP, before preview2 (planned at 1 Dec.) at the latest.

--
Yusuke Endoh

Updated by zzak (zzak _) over 11 years ago

I think CGI#header should stay the same, and this method to product html5 compatible headers should be CGI#html_header

Updated by mame (Yusuke Endoh) over 11 years ago

I recommend xibber to postpone this to next minor, if there is room to discuss anything about the spec of this feature (such as a method name).

--
Yusuke Endoh

Updated by mame (Yusuke Endoh) over 11 years ago

Sorry, xibber -> xibbar.

Updated by stomar (Marcus Stollsteimer) over 11 years ago

I really think for the proposed patch 2.0 would be the best place.

@zzak (zzak _):

I can not judge how big the impact of renaming CGI#header would be.

BUT: Your proposal would mean that the tag would have to be treated differently to all the other HTML tags (#h1, #form, #br, ...), which for the users of the tag maker would be a fairly unexpected behaviour.

Personally, I would prefer consistent behaviour for all tags.

In case the decision goes with introducing a special method for this single tag, I would suggest #header_element (maybe #header_tag) instead of #html_header, which to me rather signifies the doctype, html meta data, etc.

Updated by xibbar (Takeyuki FUJIOKA) over 11 years ago

I think this function should be included in 2.0.0

So, I will commit.

Sorry late.

Actions #7

Updated by xibbar (Takeyuki FUJIOKA) over 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37466.
Marcus, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


Sun Nov 4 20:41:28 2012 Takeyuki FUJIOKA

  • lib/cgi.rb, lib/cgi/*/rb: rename CGI#header to
    CGI#http_header,
    add and update HTML5 tag generater. [Bug #7110]
    Patch provided by Marcus Stollsteimer, thank you !

Updated by stomar (Marcus Stollsteimer) over 11 years ago

Perhaps a note should be added to NEWS, maybe something like

  • cgi
    • incompatible changes:
      • CGI#header has been renamed to CGI#http_header.
        CGI#header is now used by the HTML5 tag maker to
        create a element.

Updated by zzak (zzak _) over 11 years ago

In my opinion compatibility is more important than consistency, but
ultimately it is up to xibbar.

Other ruby-core share this sentiment, see ruby-core:48469

Updated by zzak (zzak _) over 11 years ago

In my opinion compatibility is more important than consistency, but
ultimately it is up to xibbar.

Other ruby-core share this sentiment, see ruby-core:48469

On Sun, Nov 4, 2012 at 9:15 AM, stomar (Marcus Stollsteimer)
wrote:

Issue #7110 has been updated by stomar (Marcus Stollsteimer).

Perhaps a note should be added to NEWS, maybe something like

  • cgi
    • incompatible changes:
      • CGI#header has been renamed to CGI#http_header.
        CGI#header is now used by the HTML5 tag maker to
        create a element.

Bug #7110: CGI: Add support for HTML5 tag
https://bugs.ruby-lang.org/issues/7110#change-32341

Author: stomar (Marcus Stollsteimer)
Status: Closed
Priority: Normal
Assignee: xibbar (Takeyuki Fujioka)
Category: lib
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-09-28 trunk 37049) [i686-linux]

=begin
These patches add the tag to CGI's HTML generation methods, finalizing the support of HTML5, see #6637.

Note that the old CGI#header method is renamed to CGI#http_header. CGI#header now generates a HTML5 header element.
=end

--
http://bugs.ruby-lang.org/

Updated by stomar (Marcus Stollsteimer) over 11 years ago

In my opinion compatibility is more important than consistency, but
ultimately it is up to xibbar.

Other ruby-core share this sentiment, see ruby-core:48469

I don't think a general rule can be derived from this single statement. Also, the circumstances are different. Here, it is more a question of avoiding inconsistent and unexpected behaviour than of adding some "would be nice to have" method.

(BTW, I prepared a slide for the developer meeting (7/21), see #6637, and apparently there haven't been objections, though I made sure to point out the incompatibility issue.)

But don't understand me wrong, I'm all for compatibility.

Maybe a point that would have to be considered is whether this change can be regarded as a mostly internal change of a method that is usually not called directly by the average user of the library, or not.

Updated by xibbar (Takeyuki FUJIOKA) over 11 years ago

stomar (Marcus Stollsteimer) wrote:

Perhaps a note should be added to NEWS, maybe something like

  • cgi
    • incompatible changes:
      • CGI#header has been renamed to CGI#http_header.
        CGI#header is now used by the HTML5 tag maker to
        create a element.

Thank you. I will add.

Updated by xibbar (Takeyuki FUJIOKA) over 11 years ago

I decide this change.
Because minor version up is is more important than consistency.
But 2.0 is major version up.
HTML5 will be gradually standard format.

Updated by zzak (zzak _) over 11 years ago

xibbar, it is your decision to make, and I support it.

Thank you.

Actions #15

Updated by xibbar (Takeyuki FUJIOKA) over 11 years ago

Curretly, some japanese programmer talk about compatibility. #7286
Many traditional web applications use cgi.rb .
This change give a impact to these applications.
Some committer said that cgi.rb 's importance is traditional code can run.
I agee them.

If you have better idea, please write here or #7286.

We are discussing in #7286 .

Updated by mame (Yusuke Endoh) over 11 years ago

Let me complement. xibbar suggested three options:

  1. Just delete the old header method (current)
  2. Change CGI#header only before HTML4 mode
  3. Change CGI#header only in HTML5 mode

(I don't know any merit of (2), I guess it is typo)

We are mainly considering (3).

puts CGI.new .header #=> "Content-Type: text/html" + deprecated warning
puts CGI.new("html4").header #=> "Content-Type: text/html" + deprecated warning
puts CGI.new("html5").header #=> " "

Knu suggested more delicate way:

  • CGI#header should emit a tag when a block is given, and
  • CGI#header should emit a tag when it is called in a block of other tag-generating methods.

--
Yusuke Endoh

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0