<20071105020708.5231C5F70A@stu.w3.org>
Current votes: None.
ISSUE-3 (style-attribute): conformance of element level style attributes =
[HTML 5 spec]
http://www.w3.org/html/wg/tracker/issues/
Raised by: Shawn Medero
On product: HTML 5 spec
Originally posted by Dannii Willis on the ESW HTML Issues wiki: http://es=
w.w3.org/topic/HTML/StyleAttribute
## Research
### Use Cases
#### WYSIWYG editors
WYSIWYG editors need to save the styles the user decided to choose, witho=
ut any information about the intentions for such styling.
#### Non-WYSIWYG editors
Non-WYSIWYG editors (forums, blogs and wikis) offer only a limited set of=
HTML features to users. But often users want to use arbitrary styles, th=
at can't be predefined by application.
#### Computer-generated HTML versions of other document formats
Programs that convert documents in other formats to HTML often don't have=
the semantical information about the meaning of styles in the convertabl=
e document. While <style scoped> support *should* work for these applicat=
ions, it would generate a lot of additional and unecessary markup compare=
d to element level style attributes.
#### Styling of external material (e.g. advertisements)
External content providers need to ensure, that the styles will remain th=
e same in the context of any other page.
#### Very specific small adjustments to a page
If you only want to adjust one single place in one single page, adding st=
yle element and new class or id is too complicated.
#### Serialization of DOM
When serializing DOM the dynamically set styles need also to be serialize=
d.
#### HTML embedded to other applications
Transmission of fragments of HTML with their styles preserved.
#### Debugging & Rapid Prototyping
There is a need for a standards-based way of settings styles for individu=
al elements.
#### Graphs and diagrams
In dynamically created graphs and diagrams many elements need really vary=
ing styling.
### Misc
According to the Google Web Authoring Stats the style attribute is used o=
n ~ 13.5% of <a> elements, 10.9% of <p> elements and 10.6% of <img> eleme=
nts. (http://code.google.com/webstats/)
## Proposals
(SPM: Where possible I've tried match the pros and cons of each proposal =
to a corresponding HTML Design Principle.)
### The style attribute
Pros:
")
vior")
Cons:
### Style attribute with extended syntax
Pros:
")
Cons:
### <font style=3D""> with WYSIWYG signature
Pros:
Cons:
re are width=3D and height=3D attributes already) or non-inherited style =
properties (e.g. borders)=20
void Needless Complexity")
e impact on source readability?)=20
nsidering the WYSIWYG signature) ("Media Independence")
Real Problems")
f DOM, embedded HTML, Debugging, Graphs and diagrams. (Assuming, that WYS=
IWYG signature applies to wider range of applications, not just WYSIWYG e=
ditors.)
### <style scoped>
Pros:
Cons:
ity")
### <localstyle> element
Pros:
Cons:
ity")
and/or CDATA marks (when in XML serialization)
### <style> in <head> + selectors
Pros:
Cons:
ebugging.
### Individual presentation-oriented attributes
Pros:
f a specific element
Cons:
ncerns")
CSS properties as they are introduced without updating HTML ("Separation =
of Concerns")
increases bandwith ("Avoid Needless Complexity")
## Email, IRC, other Links
(Emails highlighted have come straight from the wiki and I didn't take th=
e time to extract any other discussions. The ones cited on the wiki gave =
an acceptable entry point to many views surroudning this topic and I've d=
ecided to stick with them.)
ussed this summer but the current HTML 5 draft suggest that the entire se=
ction will be dropped - http://www.whatwg.org/specs/web-apps/current-work=
/multipage/section-presentational.html#presentational
007 - http://krijnhoetmer.nl/irc-logs/html-wg/20070330#l-991
ttp://www.w3.org/TR/2002/WD-css-style-attr-20020515
tach the stigma of <font> to style=3D"" - http://krijnhoetmer.nl/irc-logs=
/whatwg/20070503#l-494
c/public-html/2007Jun/0616.html
* Re: http://lists.w3.org/Archives/Public/public-html/2007Jun/0624.html
* Re: http://lists.w3.org/Archives/Public/public-html/2007Jun/0774.html
* Re: http://lists.w3.org/Archives/Public/public-html/2007Jun/0753.html =
=09
* Re: http://lists.w3.org/Archives/Public/public-html/2007Jun/0816.html
chives/Public/public-html/2007Jun/1043.html
* re: http://lists.w3.org/Archives/Public/public-html/2007Jun/1062.html
* re: http://lists.w3.org/Archives/Public/public-html/2007Jun/1078.ht=
ml
org/Archives/Public/public-html/2007Jul/0232.html
l/whatwg-whatwg.org/2007-May/011181.html
<link> do not set media-scoped styles. @media rules are rare, and <link =
rel=3D"stylesheet"> rarely specifies a media attribute. Given this, there=
is little evidence that authors will be more likely to scope their style=
s to particular media just because they have a mechanism that allows it. =
And indeed, for many styles, doing so is not needed to achieve media-inde=
pendent styling. For instance, property definitions like "font-weight: bo=
ld" or "font-size: 2em" don't really need to be set differently between d=
ifferent visual media and are irrelevant to non-visual media. Including b=
oth style=3D"" and <style scoped> would allow a convenient way to set loc=
al styles that degrades gracefully, as well as a less backwards compatibl=
e but more powerful mechanism that allows media selection and full rules =
with selectors. - Maciej Stachowiak, Mon, 2 Jul 2007 - http://esw.w3.org/=
topic/HTML/StyleAttribute#discuss-style-attribute-has-no-media