https://bugzilla.wikimedia.org/show_bug.cgi?id=19576

           Summary: Remove the name attribute from header <a> tags
           Product: MediaWiki
           Version: unspecified
          Platform: All
               URL: http://en.wikipedia.org/wiki/Kevin_Pietersen
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: enhancement
          Priority: Normal
         Component: Page rendering
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=6305)
 --> (https://bugzilla.wikimedia.org/attachment.cgi?id=6305)
Removes the name attribute from the <a> of headers, the editing <textarea>, and
Monobook's <a id="top">

MediaWiki currently emits both name and id attributes for <a> tags used for
headers. I believe the name should be removed, because it measurably increases
the size of each article with headers for no good reason.

The name attribute used in this fashion appears to only be required for
compatibility with Netscape 4, which does not recognize the id attribute for
the purpose of jumping to a point in a page (based on the portion of the URL
following the # symbol).

Netscape 4 is no longer in common or uncommon usage. It was removed from
http://www.w3schools.com/browsers/browsers_stats.asp at the start of 2005 (when
IE5 still had 10% of the market). All modern browsers recognize the id
attribute for this function, as per the HTML 4.01 standard:
http://www.w3.org/TR/REC-html40/struct/links.html#anchors-with-id 

Removing the name attribute is easy. The savings are small but measurable -
even for larger articles with high proportions of body text to headings - and I
feel they outweigh the minor loss of functionality on an obsolete browser.

For example, the current featured article on the English Wikipedia,
http://en.wikipedia.org/wiki/Kevin_Pietersen has the following size (gzip in
parentheses):

With name attribute: 251,917 (48,002) bytes
Without name attribute: 251,061 (47,863) bytes
Reduction: 856 [0.3%] (139 [0.3%]) bytes

The relative savings are increased for languages which have long names/ids due
to restrictions on the characters present in ids, and for shorter pages with
several headings.

The name attribute on the editing textarea (<textarea name="wpTextbox1"
id="wpTextbox1">) and Monobook's top anchor (<a name="top" id="top">) might
also be removed, although the savings here will obviously be limited.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to