These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:06 pm Advanced search

<foot> for extra's not essential in body

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

<foot> for extra's not essential in body

Postby akademy » Mon May 24, 2010 4:03 pm

1. What is the problem you are trying to solve?
Improve load times of webpages that have many additional include files.

For instance many websites now include JavaScript libraries that are only included to enhance the interfaces but are not needed for the body portion to be presented. Other websites include a list of CSS files that can be switched too after the main one is loaded.


2. What is the feature you are suggesting to help solve it?
We could let authors choose which parts are not crucial to the main body, and can be saftely loaded / run after the page has been displayed.

This could be done by having at <foot> section, after the body section:
Code: Select all
<html>
<head><!-- Essential parts needed for page --></head>
<body><!-- Essential display parts --></body>
<foot>
<!-- Enhancements to display -->
</foot>
</html>


(It also has a pleasing symmetry about it...)


3. What is the processing model for that feature, including error handling?
<head> is read, <body> is read. Browser then deduces how to display the information. <foot> is read and interface changes accordingly.

I believe most older browsers would just append the foot section to the body's DOM, and therefore pages will still act the same as before.


4. Why do you think browsers would implement this feature?
Better speed for displaying of content, with minimal extra effort.


5. Why do you think authors would use this feature?
Better speed for displaying of content, and better control of when javascript (and the like) will be implemented by browsers.


6. What evidence is there that this feature is desparately needed?
Little, but the number of javascript includes is ever rising.

The eventual adoption of HTML5 by web designers and increasing use of the canvas element over such things as flash will obviously increase the use of javascript and their libraries (jQuery, prototype etc.)
akademy
<h6>
 
Posts: 2
Joined: Mon May 24, 2010 3:26 pm

Postby zcorpan » Tue May 25, 2010 8:38 am

How would a <foot> section gain speed compared to just putting the <script>s last in <body>? It seems to me it would be slightly slower since you have to transfer more bytes over the wire to include the <foot> tag and more processing to parse it.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby akademy » Tue May 25, 2010 10:53 am

Putting script at the end of a body section is useful, but is only a convention. It doesn't guarantee that anything will be displayed by a browser before the script is loaded / run.

By moving the script to another section outside of <body> we are effectively telling any browser that this is definitely not needed for display and can safety be delayed till after the main <body> has completed.

The page should display quicker (and therefore appear to load quicker) simply because it is only doing what it needs to. There shouldn't be any additional processing, just a re-ordering of what it would have done anyway.


(I think it's useful to think of the HTML document as having a pre-display section (<head>) and a post-display section (<foot>).)
akademy
<h6>
 
Posts: 2
Joined: Mon May 24, 2010 3:26 pm


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest