You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then set <var>label</var> to the sequence of XX bytes, decoded per <code>windows-1252</code>.
277
+
then <i>get an encoding</i> for the sequence of XX bytes,
278
+
decoded per <code>windows-1252</code>,
279
+
and let <var>temp</var> be the return value.
270
280
271
281
<pclass='note'>
272
282
Note: Anything ASCII-compatible will do, so using <code>windows-1252</code> is fine.
273
-
274
-
<li>
275
-
If <var>label</var> is null,
276
-
set <var>label</var> to the value of charset attribute on the <code><link></code> element that caused the style sheet to be included, if any.
283
+
284
+
<p>
285
+
If <var>temp</var> is <code>utf-16</code> or <code>utf-16be</code>,
286
+
set <var>temp</var> to <code>utf-8</code>.
287
+
If <var>temp</var> is not failure,
288
+
set <var>encoding</var> to it
289
+
and jump to the last step.
290
+
291
+
<pclass='note'>
292
+
This mimics HTML <code><meta></code> behavior.
277
293
278
294
<li>
279
-
If <var>label</var> is null,
280
-
there is a referring style sheet or document,
281
-
and that referring sheet or document's encoding is not <code>utf-16</code> or <code>utf-16be</code>,
282
-
set <var>label</var> to that encoding.
295
+
<i>Get an encoding</i> for the value of the <code>charset</code> attribute on the <code><link></code> element or <code><?xml-stylesheet?></code> processing instruction that caused the style sheet to be included, if any.
296
+
If that does not return failure,
297
+
set <var>encoding</var> to the return value
298
+
and jump to the last step.
283
299
284
300
<li>
285
-
Let<var>encoding</var>be the result of <ahref="http://encoding.spec.whatwg.org/#concept-encoding-get">getting an encoding from <var>label</var></a>.
286
-
If <var>encoding</var> is <code>failure</code>, set it to <code>utf-8</code>.
301
+
Set<var>encoding</var>to the encoding of the referring style sheet or document,
302
+
if any.
287
303
288
304
<li>
289
-
<ahref="http://encoding.spec.whatwg.org/#decode">Decode the byte stream</a> using fallback encoding <var>encoding</var>.
305
+
<i>Decode</i> the byte stream using fallback encoding <var>encoding</var>.
306
+
307
+
<pclass='note'>
308
+
Note: the <i>decode</i> algorithm lets the byte order mark (BOM) take precedence,
309
+
hence the usage of the term "fallback" above.
290
310
</ol>
291
311
312
+
<pclass='issue'>
313
+
Anne says that steps 4/5 should be an input to this algorithm from the specs that define importing stylesheet,
314
+
to make the algorithm as a whole cleaner.
315
+
Perhaps abstract it into the concept of an "environment charset" or something?
0 commit comments