@@ -521,33 +521,40 @@ <h3 id=cascade><span class=secno>4.2. </span> Cascading Declarations</h3>
521521 element</ dfn > and that element's descendants. For example, < a
522522 href ="#HTML5 " rel =biblioentry > [HTML5]<!--{{HTML5}}--> </ a > defines scoped
523523 < code > <style></ code > elements, whose style sheets are scoped to the
524- element's parent. If a declaration is < a
525- href ="#scoped "> < i > scoped</ i > </ a > , which element it is scoped to affects
526- the cascade. For the purpose of this step, declarations from style
527- attributes < a href ="#CSSSTYLEATTR "
528- rel =biblioentry > [CSSSTYLEATTR]<!--{{!CSSSTYLEATTR}}--> </ a > are considered
529- to be < a href ="#scoped "> < i > scoped</ i > </ a > to the element with the
530- attribute, and all unscoped declarations are considered to be < a
531- href ="#scoped "> < i > scoped</ i > </ a > to the root element.
524+ element's parent.
532525 < p > If the < a href ="#scoping-element "> < i > scoping elements</ i > </ a > of two
533526 declarations have an ancestor/descendant relationship, then for normal
534527 rules the declaration whose < a href ="#scoping-element "> < i > scoping
535528 element</ i > </ a > is the descendant wins, and for important rules the
536529 declaration whose < a href ="#scoping-element "> < i > scoping element</ i > </ a >
537- is the ancestor wins. If one declaration is from a style attribute on an
538- element and the other is from a ruleset otherwise < a
539- href ="#scoped "> < i > scoped</ i > </ a > to that element, the declaration in the
540- style attribute wins.
530+ is the ancestor wins.
531+
532+ < p > For the purpose of this step, all unscoped declarations are
533+ considered to be < a href ="#scoped "> < i > scoped</ i > </ a > to the root
534+ element. Normal declarations from style attributes are considered to be
535+ < a href ="#scoped "> < i > scoped</ i > </ a > to the element with the attribute,
536+ whereas important declarations from style attributes are considered to
537+ be < a href ="#scoped "> < i > scoped</ i > </ a > to the root element. < a
538+ href ="#CSSSTYLEATTR "
539+ rel =biblioentry > [CSSSTYLEATTR]<!--{{!CSSSTYLEATTR}}--> </ a >
540+
541+ < p class =note > This odd handling of < code > !important</ code > style
542+ attribute declarations is to match the behavior defined in CSS Levels 1
543+ and 2, where style attributes simply have higher specificity than any
544+ other author rules. < a href ="#CSS21 "
545+ rel =biblioentry > [CSS21]<!--{{CSS21}}--> </ a >
541546
542547 < dt id =cascade-step-specificity > Specificity
543548
544549 < dd > The < a href ="http://www.w3.org/TR/selectors/#specificity "> Selectors
545550 module</ a > < a href ="#SELECT "
546551 rel =biblioentry > [SELECT]<!--{{!SELECT}}--> </ a > describes how to compute
547552 the specificity of a selector. For the purpose of this step, a ruleset
548- without a selector (such as the contents of a style attribute) is
549- considered to have a selector with specificity 0. The declaration
550- belonging to a ruleset whose selector has the highest specificity wins.
553+ without a selector (such as the < a
554+ href ="http://www.w3.org/TR/css-style-attr/#interpret "> contents of a style
555+ attribute</ a > ) is considered to have a specificity higher than any
556+ selector. The declaration belonging to a ruleset whose selector has the
557+ highest specificity wins.
551558
552559 < dt id =cascade-step-order > Order of appearance.
553560
@@ -1160,6 +1167,16 @@ <h3 class=no-num id=other-references>Other references</h3>
11601167 < dt style ="display: none "> <!-- keeps the doc valid if the DL is empty -->
11611168 <!---->
11621169
1170+ < dt id =CSS21 > [CSS21]
1171+
1172+ < dd > Bert Bos; et al. < a
1173+ href ="http://www.w3.org/TR/2011/REC-CSS2-20110607/ "> < cite > Cascading Style
1174+ Sheets Level 2 Revision 1 (CSS 2.1) Specification.</ cite > </ a > 7 June
1175+ 2011. W3C Recommendation. URL: < a
1176+ href ="http://www.w3.org/TR/2011/REC-CSS2-20110607/ "> http://www.w3.org/TR/2011/REC-CSS2-20110607/</ a >
1177+ </ dd >
1178+ <!---->
1179+
11631180 < dt id =CSS3PAGE > [CSS3PAGE]
11641181
11651182 < dd > Håkon Wium Lie; Melinda Grant. < a
0 commit comments