[whatwg] style='' on every element

Le 2007-05-04 ? 5:53, Henri Sivonen a ?crit :

> Considering all the above, here's my concrete proposal for a solution:
>  1) Make style='' a global attribute. For the purposes of document  
> conformance, make it conforming on all documents regardless how  
> they came to being.
>  2) Include an informative paragraph about how media-dependent use  
> of style='' is bad.
>  3) I make the conformance checker emit a warning (at most one per  
> document) that paraphrases the informative paragraph when the  
> conformance checker sees a style='' attribute.
>  4) I make the WYSIWYG signature suppress the warning.

1, 2 good; 3, 4 bad, in my opinion. I don't think it's a good idea to  
create a WYSIWYG signature that changes the conformance checkers  
behaviour. It would create a lot of tricky cases for the WYSIWYG  
editor, like what to do when opening and editing a document with no  
signature (presumably previously edited by hand) or when editing half  
by hand, another half WYSIWYG, like in a split layout/code view. It's  
the same alike creating a Transitional version of HTML 5 reserved for  
WYSIWYG editors.

Beside that, I'd like to point out that I, and surely many others,  
learned HTML from such a WYSIWYG tool, first Netscape Composer then  
Golive CyberStudio (before it was bought by Adobe). Only then I  
slowly transitioned to writing HTML by hand. What if, like I did for  
a long time, I edit HTML from such an application but in source mode:

- How does the application decides what signature to put on the  
document?
- What "version" of HTML will I learn if I hand-code in source mode?
- Should the base document template be different (because of the  
signature) from the one of another non-WYSIWYG editor?

I think forbidding, or warning against *any* usage of style="" is  
approaching the problem the wrong way. There's no way to prevent  
people from using style="", and I'd say that there are some cases  
where style="" make sense. I think it should be conforming. The new  
embedded <style> element is great, but it isn't backward compatible  
and is more complicated to use; style="" is and is likely to be more  
useful for some time, despite its pitfalls.

Part 2 of the solution here is spot-on: explaining the rationale for  
when it is wrong to use style="" so that people can understand it and  
work around using style sheets. I think that's the way to go.


>  5) <font> is either made non-conforming or made a strictly inline  
> element with the attribute color (to avoid <span  
> style='color: ...'> cruft).

Why would we need so much to avoid using the style attribute for  
colors? Is the cruft so big in the first case? That's about 27  
characters instead of 33 for each block of text (depending on  
attribute quoting style and the color definition). The difference is  
not that big -- 6 characters for "color:". Is this use case really  
worth its own element?

     <span style=color:#000000></span>
     <font color=#000000></font>     |
              1         2      |  3  |      4
     1234567890123456789012345678901234567890

Personally, I'd be more inclined about allowing color="" on any  
element, ? la SVG, rather than having <font> used just for that.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/

Received on Friday, 4 May 2007 07:23:29 UTC