Skip to content

Commit e5353d0

Browse files
committed
[cssom] Remove API for alternative stylesheets
Remove Document#selectedStyleSheetSet, lastStyleSheetSet, preferredStyleSheetSet, styleSheetSets, enableStyleSheetsForSet(). Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=29471.
1 parent 0136c61 commit e5353d0

1 file changed

Lines changed: 5 additions & 179 deletions

File tree

cssom/Overview.bs

Lines changed: 5 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,11 +1156,6 @@ represented by the collection.
11561156
<pre class=idl>
11571157
partial interface Document {
11581158
[SameObject] readonly attribute StyleSheetList styleSheets;
1159-
attribute DOMString? selectedStyleSheetSet;
1160-
readonly attribute DOMString? lastStyleSheetSet;
1161-
readonly attribute DOMString? preferredStyleSheetSet;
1162-
readonly attribute FrozenArray&lt;DOMString> styleSheetSets;
1163-
void enableStyleSheetsForSet(DOMString? name);
11641159
};
11651160
</pre>
11661161

@@ -1169,180 +1164,6 @@ the <a>document CSS style sheets</a>.
11691164
Note: Because of historical IDL limitations the {{Document/styleSheets}} attribute
11701165
used to be on a separate interface, <code>DocumentStyle</code>.
11711166

1172-
The <dfn attribute for=Document>selectedStyleSheetSet</dfn> attribute, on getting, must run these steps:
1173-
<ol>
1174-
<li>If there is a single <a>enabled CSS style sheet set</a> and no
1175-
other <a>document CSS style sheets</a> with a
1176-
<a>title</a> that is not the empty string have the
1177-
<a>disabled flag</a> unset, return the
1178-
<a>CSS style sheet set name</a> of the
1179-
<a>enabled CSS style sheet set</a> and terminate these steps.
1180-
1181-
<li>Otherwise, if <a>CSS style sheets</a> from
1182-
different <a lt="CSS style sheet set">CSS style sheet sets</a> have
1183-
their <a>disabled flag</a> unset, return
1184-
null and terminate these steps.
1185-
1186-
<li>
1187-
Otherwise, return the empty string.
1188-
1189-
Note: At this point either all
1190-
<a>CSS style sheets</a> with a
1191-
<a>title</a> that is not the empty string have the
1192-
<a>disabled flag</a> set, or there are no such
1193-
<a>CSS style sheets</a>.
1194-
1195-
</ol>
1196-
1197-
On setting the
1198-
{{Document/selectedStyleSheetSet}}
1199-
attribute these steps must be run:
1200-
1201-
<ol>
1202-
<li>If the value is null terminate this set of steps.
1203-
<li>Otherwise, <a>select a CSS style sheet set</a> with the name being the
1204-
value passed.
1205-
</ol>
1206-
1207-
From the DOM's perspective, all views have the same
1208-
{{Document/selectedStyleSheetSet}}.
1209-
If a user agent supports multiple views with different selected
1210-
alternative style sheets, then this attribute (and the
1211-
{{StyleSheet}} interface's
1212-
{{StyleSheet/disabled}} attribute)
1213-
must return and set the value for the default
1214-
view.
1215-
1216-
The <dfn attribute for=Document>lastStyleSheetSet</dfn> attribute must return the <a>last CSS style sheet set name</a>.
1217-
Note: This attribute is initially null.
1218-
1219-
The <dfn attribute for=Document>preferredStyleSheetSet</dfn> attribute must return the <a>preferred CSS style sheet set
1220-
name</a>.
1221-
Note: Unlike {{Document/lastStyleSheetSet}},
1222-
this attribute is initially the empty string.
1223-
1224-
The <dfn attribute for=Document>styleSheetSets</dfn> attribute must return a frozen array of the
1225-
<a lt="CSS style sheet set name">CSS style sheet set names</a> of the <a lt="CSS style sheet set">CSS style sheet sets</a>, in order of the
1226-
<a>document CSS style sheets</a>. The array is live; if the <a>document CSS style sheets</a> change, the array must be updated as appropriate.
1227-
1228-
The <dfn method for=Document>enableStyleSheetsForSet(<var>name</var>)</dfn> method must, when invoked, run these
1229-
steps:
1230-
<ol>
1231-
<li>If <var>name</var> is null terminate these steps.
1232-
<li><a>enable a CSS style sheet set</a> with name <var>name</var>.
1233-
</ol>
1234-
Note: <a>CSS style sheets</a> with a
1235-
<a>title</a> that is the empty string are never affected by this method.
1236-
This method does not change the values of the
1237-
{{Document/lastStyleSheetSet}} or
1238-
{{Document/preferredStyleSheetSet}} attributes.
1239-
1240-
1241-
### Interaction with the User Interface ### {#interaction-with-the-user-interface}
1242-
1243-
The user interface of Web browsers that support style sheets
1244-
should list the style sheet titles given in the
1245-
<code lt="dom-Document-styleSheetSets">styleSheetSets</code> list,
1246-
showing the
1247-
<code lt="dom-Document-selectedStyleSheetSet">selectedStyleSheetSet</code>
1248-
as the selected style sheet set, leaving none selected if it is
1249-
null or the empty string, and selecting an extra option
1250-
"Basic Page Style" (or similar) if it is the empty string and the
1251-
<code lt="dom-Document-preferredStyleSheetSet">preferredStyleSheetSet</code>
1252-
is the empty string as well.
1253-
1254-
Selecting a style sheet from this list should
1255-
use the <a>select a CSS style sheet set</a> set of steps. This
1256-
(by definition) affects the
1257-
<code lt="dom-Document-lastStyleSheetSet">lastStyleSheetSet</code>
1258-
attribute.
1259-
1260-
#### Persisting the selected CSS style sheet set #### {#persisting-the-selected-css-style-sheet-set}
1261-
1262-
If a user agent persist the <a lt="select a CSS style sheet set">selected</a> <a>CSS style sheet set</a>, it should use
1263-
the value of the
1264-
<code lt="dom-Document-selectedStyleSheetSet">selectedStyleSheetSet</code>
1265-
attribute, or if that is null, the
1266-
<code lt="dom-Document-lastStyleSheetSet">lastStyleSheetSet</code>
1267-
attribute, when leaving the page (or at some other time) to determine the
1268-
set name to store. If that is null then the <a>CSS style sheet set</a> should not be
1269-
persisted.
1270-
1271-
When re-setting the <a>CSS style sheet set</a> to the persisted value (which can
1272-
happen at any time, typically at the first time the <a>CSS style sheets</a> are
1273-
needed for styling the document, after the <code>&lt;head&gt;</code> of
1274-
the document has been parsed, after any scripts that are not dependent on
1275-
computed style have executed), the <a>CSS style sheet set</a>
1276-
should be set by using the
1277-
<a>select a CSS style sheet set</a> set of steps as if the user had
1278-
selected the <a>CSS style sheet set</a> manually.
1279-
1280-
Note: This specification does not give any suggestions on
1281-
how user agents are to decide to persist the <a>CSS style sheet set</a> or whether or
1282-
how to persist the <a lt="select a CSS style sheet set">selected</a> <a>CSS style sheet set</a> across pages.
1283-
1284-
<!-- XXX this UI section suggests we may want to introduce a few more
1285-
idioms -->
1286-
1287-
1288-
### Examples ### {#css-style-sheet-collections-examples}
1289-
1290-
<div class="example">
1291-
Thus, in the following HTML snippet:
1292-
1293-
<pre>
1294-
&lt;link rel="alternate stylesheet" lt="foo" href="a"&gt;
1295-
&lt;link rel="alternate stylesheet" lt="bar" href="b"&gt;
1296-
&lt;script&gt;
1297-
document.selectedStyleSheetSet = 'foo';
1298-
document.styleSheets[1].disabled = false;
1299-
&lt;/script&gt;
1300-
&lt;link rel="alternate stylesheet" lt="foo" href="c"&gt;
1301-
&lt;link rel="alternate stylesheet" lt="bar" href="d"&gt;
1302-
</pre>
1303-
1304-
...the style sheets that end up enabled are style sheets "a", "b",
1305-
and "c", the
1306-
<code lt="dom-Document-selectedStyleSheetSet">selectedStyleSheetSet</code>
1307-
attribute would return null,
1308-
<code lt="dom-Document-lastStyleSheetSet">lastStyleSheetSet</code>
1309-
would return "foo", and
1310-
<code lt="dom-Document-preferredStyleSheetSet">preferredStyleSheetSet</code>
1311-
would return the empty string.
1312-
1313-
Similarly, in the following HTML snippet:
1314-
1315-
<pre>
1316-
&lt;link rel="alternate stylesheet" lt="foo" href="a"&gt;
1317-
&lt;link rel="alternate stylesheet" lt="bar" href="b"&gt;
1318-
&lt;script&gt;
1319-
var before = document.preferredStyleSheetSet;
1320-
document.styleSheets[1].disabled = false;
1321-
&lt;/script&gt;
1322-
&lt;link rel="stylesheet" lt="foo" href="c"&gt;
1323-
&lt;link rel="alternate stylesheet" lt="bar" href="d"&gt;
1324-
&lt;script&gt;
1325-
var after = document.preferredStyleSheetSet;
1326-
&lt;/script&gt;
1327-
</pre>
1328-
1329-
...the "before" variable will be equal to the empty string, the
1330-
"after" variable will be equal to "foo", and style sheets "a" and "c"
1331-
will be enabled. This is the case even though the first script block
1332-
sets style sheet "b" to be enabled, because upon parsing the
1333-
following <code>&lt;link&gt;</code> element, the
1334-
<code lt="dom-Document-preferredStyleSheetSet">preferredStyleSheetSet</code>
1335-
is set and the
1336-
<code lt="dom-Document-enableStyleSheetsForSet()">enableStyleSheetsForSet()</code>
1337-
method is called (since
1338-
<code lt="dom-Document-selectedStyleSheetSet">selectedStyleSheetSet</code>
1339-
was never set
1340-
explicitly, leaving
1341-
<code lt="dom-Document-lastStyleSheetSet">lastStyleSheetSet</code> at
1342-
null throughout), which changes which style sheets are enabled and which
1343-
are not.
1344-
</div>
1345-
13461167

13471168
Style Sheet Association {#style-sheet-association}
13481169
--------------------------------------------------
@@ -3081,6 +2902,11 @@ CSSCharsetRule is re-dropped.
30812902
GetStyleUtils is dropped.
30822903
Element#pseudo() is dropped.
30832904
PseudoElement is dropped.
2905+
Document#selectedStyleSheetSet is dropped.
2906+
Document#lastStyleSheetSet is dropped.
2907+
Document#preferredStyleSheetSet is dropped.
2908+
Document#styleSheetSets is dropped.
2909+
Document#enableStyleSheetsForSet() is dropped.
30842910

30852911
-->
30862912

0 commit comments

Comments
 (0)