Skip to content

Commit a3876ae

Browse files
author
Simon Pieters
committed
[cssom] Add specifiedStyle, defaultStyle, computedStyle, usedStyle, pseudo(), remove getDefaultComputedStyle().
--HG-- extra : rebase_source : fe04da5b1443a592874f24a70a388a291f25cb39
1 parent 033d9ad commit a3876ae

8 files changed

Lines changed: 171 additions & 42 deletions

File tree

cssom/Overview.html

Lines changed: 71 additions & 10 deletions
Large diffs are not rendered by default.

cssom/cssom-generate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@
609609
var s = '';
610610
s += eol;
611611
s += eltStart ( 'pre', [ newAttr ( 'class', 'idl' ) ], false );
612-
s += '[[TBD - IMPLEMENTS]]\n';
612+
s += def.target + ' ' + def.type + ' ' + def.implements + ';\n'; // [[TBD - IMPLEMENTS]] TODO: fix highlighting
613613
s += eltEnd ( 'pre', true );
614614
return s;
615615
}

cssom/cssom-source

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,27 @@
19371937

19381938
<!--{@idl(Window)}-->
19391939

1940+
<!-- ........................................................................................................................ -->
1941+
<!-- ........................................................................................................................ -->
1942+
1943+
<h3>The <code>GetStyleUtils</code> Interface</h3>
1944+
1945+
<!--{@idl(GetStyleUtils)}-->
1946+
1947+
<!-- ........................................................................................................................ -->
1948+
<!-- ........................................................................................................................ -->
1949+
1950+
<h3>Extensions to the <code>Element</code> Interface</h3>
1951+
1952+
<!--{@idl(Element)}-->
1953+
1954+
<!-- ........................................................................................................................ -->
1955+
<!-- ........................................................................................................................ -->
1956+
1957+
<h3>The <code>PseudoElement</code> Interface</h3>
1958+
1959+
<!--{@idl(PseudoElement)}-->
1960+
19401961
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
19411962

19421963
<h2>Resolved Values</h2>

cssom/cssom.idl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
#include "CSSStyleRule.idl"
1111
#include "CSSStyleSheet.idl"
1212
#include "Document.idl"
13+
#include "Element.idl"
1314
#include "ElementCSSInlineStyle.idl"
15+
#include "GetStyleUtils.idl"
1416
#include "LinkStyle.idl"
1517
#include "MediaList.idl"
1618
#include "ProcessingInstruction.idl"
19+
#include "PseudoElement.idl"
1720
#include "StyleSheet.idl"
1821
#include "StyleSheetList.idl"
1922
#include "Window.idl"

cssom/idl/Element.idl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
partial interface Element {
2+
3+
[Documentation=
4+
"<!--ATRISK--><p>The {@name} {@type} must run the following steps:\
5+
<ol>\
6+
<li><p>If <var>pseudoElt</var> is as an <span data-anolis-spec=dom>ASCII case-insensitive</span> match for either '<code>:before</code>' or\
7+
'<code>::before</code>' return the <code>PseudoElement</code> representing the '::before' pseudo-element of the <span data-anolis-spec=dom>context\
8+
object</span>.</p></li>\
9+
<li><p>If <var>pseudoElt</var> is as an <span data-anolis-spec=dom>ASCII case-insensitive</span> match for either '<code>:after</code>' or\
10+
'<code>::after</code>' return the <code>PseudoElement</code> representing the '::after' pseudo-element of the <span data-anolis-spec=dom>context\
11+
object</span>.</p></li>\
12+
<li><p>Return null.</p></li>\
13+
</ol>\
14+
<p>When invoked with an argument that returns a <code>PseudoElement</code> object representing a particular pseudo-element, the same object must be\
15+
returned as returned by an earlier call that represent the same pseudo-element.</p>"
16+
]
17+
PseudoElement? pseudo (DOMString pseudoElt);
18+
};
19+
20+
Element implements GetStyleUtils;

cssom/idl/GetStyleUtils.idl

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[NoInterfaceObject, Documentation=
2+
"<p>The <dfn>associated document</dfn> of an object <var>obj</var> is <var>obj</var>'s <span data-anolis-spec=dom title=concept-node-document>node\
3+
document</span> if <var>obj</var> is an <code>Element</code> object, or <var>obj</var>'s associated <code>Element</code> object's\
4+
<span data-anolis-spec=dom title=concept-node-document>node document</span> if <var>obj</var> is a <code>PseudoElement</code> object.</p>"
5+
]
6+
interface GetStyleUtils {
7+
8+
[Documentation=
9+
"<!--ATRISK--><p>The {@name} {@type} must return a <span>CSS declaration block</span> with the\
10+
<span>CSS declaration block readonly flag</span> set and the\
11+
<span>CSS declaration block declarations</span> set to all properties\
12+
the user agent supports with as value the <span>specified value</span>\
13+
computed for the <span data-anolis-spec=dom>context object</span> using the style rules associated\
14+
with the <span data-anolis-spec=dom>context object</span>'s <span>associated document</span>.</p>"
15+
]
16+
readonly attribute CSSStyleDeclaration specifiedStyle;
17+
18+
[Documentation=
19+
"<!--ATRISK--><p>The {@name} {@type} must return a <span>CSS declaration block</span> with the <span>CSS declaration block readonly flag</span> set and the\
20+
<span>CSS declaration block declarations</span> set to all properties the user agent supports with as value the <span>computed value</span> computed for\
21+
the <span data-anolis-spec=dom>context object</span> using the user agent-level style rules and user-level style rules associated with the\
22+
<span data-anolis-spec=dom>context object</span>'s <span>associated document</span>, ignoring transitions, animations, author-level style\
23+
rules, author-level presentational hints and override-level style rules.</p>"
24+
]
25+
readonly attribute CSSStyleDeclaration defaultStyle;
26+
27+
[Documentation=
28+
"<!--ATRISK--><p>The {@name} {@type} must return a <span>CSS declaration block</span> with the\
29+
<span>CSS declaration block readonly flag</span> set and the\
30+
<span>CSS declaration block declarations</span> set to all properties\
31+
the user agent supports with as value the <span>computed value</span>\
32+
computed for the <span data-anolis-spec=dom>context object</span> using the style rules associated\
33+
with the <span data-anolis-spec=dom>context object</span>'s <span>associated document</span>.</p>"
34+
]
35+
readonly attribute CSSStyleDeclaration computedStyle;
36+
37+
[Documentation=
38+
"<!--ATRISK--><p>The {@name} {@type} must return a <span>CSS declaration block</span> with the\
39+
<span>CSS declaration block readonly flag</span> set and the\
40+
<span>CSS declaration block declarations</span> set to all properties\
41+
the user agent supports with as value the <span>used value</span>\
42+
computed for the <span data-anolis-spec=dom>context object</span> using the style rules associated\
43+
with the <span data-anolis-spec=dom>context object</span>'s <span>associated document</span>.</p>"
44+
]
45+
readonly attribute CSSStyleDeclaration usedStyle;
46+
47+
};

cssom/idl/PseudoElement.idl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Documentation=
2+
"<!--ATRISK--><p>The {@name} {@type} is used for representing CSS pseudo-elements. A {@name} object is associated with an <code>Element</code> object.</p>"
3+
]
4+
5+
interface PseudoElement {
6+
};
7+
8+
PseudoElement implements GetStyleUtils;

cssom/idl/Window.idl

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,4 @@ partial interface Window {
3939
]
4040
CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString pseudoElt);
4141

42-
[Documentation=
43-
"<p>The {@name} {@type} must run these steps:</p>\
44-
<ol>\
45-
<li><p>Let <var>doc</var> be the\
46-
<code data-anolis-spec=dom>Document</code>\
47-
associated with the <code data-anolis-spec=html>Window</code> object on\
48-
which the method was invoked.</p></li>\
49-
<li><p>Let <var>obj</var> be <var>elt</var>.</p></li>\
50-
<li><p>If <var>pseudoElt</var> is as an\
51-
<span data-anolis-spec=dom>ASCII case-insensitive</span> match for\
52-
either '<code>:before</code>' or '<code>::before</code>' let\
53-
<var>obj</var> be the '::before' pseudo-element of\
54-
<var>elt</var>.</p></li>\
55-
<li><p>If <var>pseudoElt</var> is as an\
56-
<span data-anolis-spec=dom>ASCII case-insensitive</span> match for\
57-
either '<code>:after</code>' or '<code>::after</code>' let\
58-
<var>obj</var> be the '::after' pseudo-element of\
59-
<var>elt</var>.</p></li>\
60-
<li>\
61-
<p>Return a <span>CSS declaration block</span> with the\
62-
<span>CSS declaration block readonly flag</span> set and the\
63-
<span>CSS declaration block declarations</span> set to all properties\
64-
the user agent supports with as value the computed value\
65-
for <var>obj</var> using the user agent-level style rules and user-level style\
66-
rules associated with <var>doc</var>, ignoring transitions, animations,\
67-
author-level style rules, author-level presentational hints and override-level\
68-
style rules.</p>\
69-
</li>\
70-
</ol>"
71-
]
72-
CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt);
7342
};

0 commit comments

Comments
 (0)