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

Reorganization of the code.

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.

Should we just start over completely with (X)HTML?

Most definitely!
3
60%
Yes, but it's too late now.
1
20%
Good idea. Bad timing.
1
20%
No, we might be able to make the current (X)HTML work.
0
No votes
No! (X)HTML is great as it is!
0
No votes
 
Total votes : 5

Reorganization of the code.

Postby bfrohs » Wed May 16, 2007 10:57 pm

What is the problem you are trying to solve?
Organize the code of the website more to help assistive technologies, search engines, and mobile devices.

What is the feature you are suggesting to help solve it?
Reorganization of the code. I will provide more information below.

What is the processing model for that feature, including error handling?
Information provided below.

Why do you think browsers would implement this feature?
It could add addition options for browsers. For example, the UA could provide internal links to the menu, content, and footer.

Why do you think authors would use this feature?
Many authors already use this feature, but with class or ID names and comments.

What evidence is there that this feature is desperately needed?
There is no set standard on the web as to how to classify the menu, content, and footer information. When I first began designing, when I saw that <head> and <body> were tags in HTML, I automatically assumed <footer> was another tag. As you all know, that is not true.


Although this would be a nice feature, many sites have menus on the side rather than the top, so predefined IDs or class names may be the only way to achieve what I'm aiming for.

Also, due to backward-compatibility that (X)HTML 5 is aiming for, this could not be able to be implemented for a few versions.

Note: The names aren't what I would consider final. In my mind, they make the most sense, but that is just my opinion.

Code: Select all
<html>
<presentation>
  <style>
   <link href="/style.css" type="text/css" media="screen">
  </style>
  <script>
   <link href="/script.js" type="text/javascript" media="screen">
  </script>
  <info>
   <link href="http://www.somesite.com/" type="author/designer">
   <link href="http://www.someothersite.com/" type="author/programmer">
  </info>
</presentation>
<structure>
  <head>

  </head>
  <menu>

  </menu>
  <body>

  </body>
  <footer>

  </footer>
</structure>
</html>


Presentation: This section would not be visible by the user. It would include all information now included in the <head>. Some information that may be included here would be any CSS, Javascript, or Meta information. This tag is required. Loading should cancel and fail if not present.

Presentation > Style: All styling information will be provided here via <link>. This tag is optional, but required if any <link type="text/css">[i] are present.

Presentation > Script: All scripting information will be provided here via [i]<link>
. This tag is optional, but required if any <link type="text/javascript">[i] are present.

Presentation > Info: All additional information will be provided here via [i]<link>
. This tag is optional, but required if any <link type="author/?">[i] are present.

Structure: Any and all structure information would go here (now provided in the [i]<body>
.This tag is required. Loading should cancel and fail if not present.

Structure > Head: This could be left empty and simply use CSS to declare a background image (a header image for example?). Another possibility would to have an image appear here, or a title. This would just be the place to put Information normally put into <div id="header"> and other such tags. It would be a block-level element and required by default and should fail if not present.

Structure > Menu: The <menu> could be placed in the <body>, <head>, between the <body> and <head>, or above the <head>. This tag would be optional, but recommended. Possibly use <nl> instead of <menu>. If a navigation list is provided, this tag must be used for it (main navigation only). It would be a block-level element by default.

Structure > Body: The main content of the page would appear here. This includes everything excluding the header, menu, and footer. It would be a block-level element and required by default and should fail if not present.

Structure > Footer: Copyright, author, privacy policy & ToS links, and other such footer information would be provided here. It would be a block-level element and required by default and should fail if not present.


I understand it would be impossible to enable anything like this now, but the purpose of this is to organize the web, so I believe it would be a good idea to have something to work towards. Going step-by-step is fine, but if there is no ending goal, then what are we going towards?
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby zcorpan » Wed May 16, 2007 11:24 pm

Hmm. If I understand your proposal correctly, this is already in the draft, it's just that the elements have different names (for compatibility with existing UAs and authoring practices). It would look like this:
Code: Select all
<html>
<head>
  <link rel="stylesheet" href="/style.css" type="text/css" media="screen">
  <script src="/script.js" type="text/javascript"></script>
  <link href="http://www.somesite.com/" rel="author" title="designer">
  <link href="http://www.someothersite.com/" type="author" title="programmer">
</head>
<body>
  <header>

  </header>
  <nav>

  </nav>
  <article>

  </article>
  <footer>

  </footer>
</body>
</html>
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby bfrohs » Wed May 16, 2007 11:31 pm

I guess that's what I get for not reading through the entire draft yet. There's only one thing I would suggest to change about this layout. That suggesiton would be to possibly group the stylesheets, scripts, and author links as shown in my first example, but possibly with a different name since those names are taken.

Code: Select all
<html>
<head>
  <headgroup title="styles">
   <link rel="stylesheet" href="/style.css" type="text/css" media="screen">
  </headgroup>
  <headgroup title="scripts">
   <script src="/script.js" type="text/javascript"></script>
  </headgroup>
  <headgroup title="author">
   <link href="http://www.somesite.com/" rel="author" title="designer">
   <link href="http://www.someothersite.com/" type="author" title="programmer">
  </headgroup>
</head>
<body>
  <header>

  </header>
  <nav>

  </nav>
  <article>

  </article>
  <footer>

  </footer>
</body>
</html>
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby zcorpan » Wed May 16, 2007 11:37 pm

What's the benefit of that?
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby bfrohs » Wed May 16, 2007 11:42 pm

It would offer no immediate benefits, but it could be used in the future to more-easily filter through the <head>. For example, a UA could disable scripts by blocking everything in the <headgroup title="scripts"> rather than searching through the entire <head> for <script>. Also, this would force designers to group styles, scripts, and author information together. I'm not positive, but in my opinion, this would speed up disabling of features such as scripts and styles and also make it simpler.
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby zcorpan » Thu May 17, 2007 12:03 am

Browsers can already disable styles and scripts. It's not really implemented by searching for <script> or <style> elements, but rather simply disabling scripting altogether or ignoring all author-level style sheets at the style processing level.

Also note that <script> and <style> elements can be in the body too, and SVG also has <script> and <style> elements, and scripts can occur in javascript: URIs, and links to stylesheets can also be in HTTP Link: headers or xml-stylesheet processing instructions, and you would want to disable those too if you disabled styling or scripting. So grouping the links that occur in the HEAD in HTML wouldn't really help anyway.

Oh, almost forgot, they can occur in style="" attributes and event handler attributes (e.g. onclick=""), too.
Last edited by zcorpan on Thu May 17, 2007 12:24 am, edited 1 time in total.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby bfrohs » Thu May 17, 2007 12:22 am

And this is where I go and read up on the entire draft. I'm still stuck on XHTML where styles were supposed to be in the <head> only, and they were attached to elements with class and ID.
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby Cerbera » Thu May 17, 2007 5:14 am

You can "attach" styles to elements which have neither class nor id attributes by using the element name. For example, to prevent all <h1> elements from using bold formatting:
Code: Select all
h1 {
font-weight: normal;
}
To do this for all headings:
Code: Select all
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
}
These are called type selectors. They are very neat (imho) and very widely supported.
Cerbera
<h4>
 
Posts: 34
Joined: Wed Feb 21, 2007 1:04 pm

Postby bfrohs » Thu May 17, 2007 7:04 am

I know about type selectors. The only reason I suggested using IDs or classes rather than tag selectors was because I was not sure if the tags (or at least the general layout) that I was looking for would be possible with the current draft.
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest