@@ -109,6 +109,13 @@ <h2 class="no-num no-toc" id=toc>Table of Contents</h2>
109109 </ ul >
110110
111111 < li > < a href ="#selectors "> < span class =secno > 5. </ span > Selectors</ a >
112+ < ul class =toc >
113+ < li > < a href ="#parsing-selectors "> < span class =secno > 5.1. </ span > Parsing
114+ Selectors</ a >
115+
116+ < li > < a href ="#serializing-selectors "> < span class =secno > 5.2.
117+ </ span > Serializing Selectors</ a >
118+ </ ul >
112119
113120 < li > < a href ="#style-sheets "> < span class =secno > 6. </ span > Style Sheets</ a >
114121 < ul class =toc >
@@ -333,12 +340,6 @@ <h2 id=media-queries><span class=secno>4. </span>Media Queries</h2>
333340 < h3 id =parsing-media-queries > < span class =secno > 4.1. </ span > Parsing Media
334341 Queries</ h3 >
335342
336- < p > To < dfn id =parse-a-media-query > parse a media query</ dfn > for a given
337- string < var title =""> s</ var > means to follow the < a
338- href ="#parse-a-list-of-media-queries "> parse a list of media queries</ a >
339- steps and return null if more than one media query is returned or a media
340- query if a single media query is returned.
341-
342343 < p > To < dfn id =parse-a-list-of-media-queries > parse a list of media
343344 queries</ dfn > for a given string < var title =""> s</ var > into a list of
344345 media queries is defined in the Media Queries specification. Return the
@@ -348,9 +349,45 @@ <h3 id=parsing-media-queries><span class=secno>4.1. </span>Parsing Media
348349 < p class =note > If everything ends up being ignored the list will contain the
349350 media query "< code title =""> not all</ code > ".
350351
352+ < p > To < dfn id =parse-a-media-query > parse a media query</ dfn > for a given
353+ string < var title =""> s</ var > means to follow the < a
354+ href ="#parse-a-list-of-media-queries "> parse a list of media queries</ a >
355+ steps and return null if more than one media query is returned or a media
356+ query if a single media query is returned.
357+
351358 < h3 id =serializing-media-queries > < span class =secno > 4.2. </ span > Serializing
352359 Media Queries</ h3 >
353360
361+ < p > To < dfn id =serialize-a-list-of-media-queries > serialize a list of media
362+ queries</ dfn > run these steps:
363+
364+ < ol >
365+ < li >
366+ < p > Let < var title =""> s</ var > be the empty string.
367+
368+ < li >
369+ < p > If the list is empty return < var title =""> s</ var > and terminate this
370+ algorithm.
371+
372+ < li >
373+ < p > For each media query in the list:</ p >
374+
375+ < ol >
376+ < li >
377+ < p > Append the result of < a href ="#serialize-a-media-query "
378+ title ="serialize a media query "> serializing</ a > the media query to
379+ < var title =""> s</ var > .
380+
381+ < li >
382+ < p > If this is not the last media query in the list append a
383+ "< code > ,</ code > " (U+002C), followed by a space (U+0020) to < var
384+ title =""> s</ var > .
385+ </ ol >
386+
387+ < li >
388+ < p > Return < var title =""> s</ var > .
389+ </ ol >
390+
354391 < p > To < dfn id =serialize-a-media-query > serialize a media query</ dfn > run
355392 these steps:
356393
@@ -434,36 +471,6 @@ <h3 id=serializing-media-queries><span class=secno>4.2. </span>Serializing
434471 </ table >
435472 </ div >
436473
437- < p > To < dfn id =serialize-a-list-of-media-queries > serialize a list of media
438- queries</ dfn > run these steps:
439-
440- < ol >
441- < li >
442- < p > Let < var title =""> s</ var > be the empty string.
443-
444- < li >
445- < p > If the list is empty return < var title =""> s</ var > and terminate this
446- algorithm.
447-
448- < li >
449- < p > For each media query in the list:</ p >
450-
451- < ol >
452- < li >
453- < p > Append the result of < a href ="#serialize-a-media-query "
454- title ="serialize a media query "> serializing</ a > the media query to
455- < var title =""> s</ var > .
456-
457- < li >
458- < p > If this is not the last media query in the list append a
459- "< code > ,</ code > " (U+002C), followed by a space (U+0020) to < var
460- title =""> s</ var > .
461- </ ol >
462-
463- < li >
464- < p > Return < var title =""> s</ var > .
465- </ ol >
466-
467474 < h4 id =serializing-media-feature-values > < span class =secno > 4.2.1.
468475 </ span > Serializing Media Feature Values</ h4 >
469476
@@ -696,16 +703,74 @@ <h3 id=creating-a-medialist-object><span class=secno>4.5. </span>Creating a
696703 < h2 id =selectors > < span class =secno > 5. </ span > Selectors</ h2 >
697704
698705 < p > Selectors are defined in the Selectors specification. This section
699- defines how to serialize them.</ p >
706+ mainly defines how to serialize them.</ p >
700707 <!-- XXX ref -->
701708 <!-- XXX ref universal selector etc? some are in <span> some not -->
702709
710+ < h3 id =parsing-selectors > < span class =secno > 5.1. </ span > Parsing Selectors</ h3 >
711+
703712 < p > To < dfn id =parse-a-group-of-selectors > parse a group of selectors</ dfn >
704713 means to parse the value using the < code title =""> selectors_group</ code >
705714 production defined in the Selectors specification and return either a
706715 group of selectors if parsing did not fail or null if parsing did fail.</ p >
707716 <!-- XXX ref -->
708717
718+ < h3 id =serializing-selectors > < span class =secno > 5.2. </ span > Serializing
719+ Selectors</ h3 >
720+ <!-- http://dump.testsuite.org/2009/cssom/serializing-selectors.htm -->
721+
722+ < p > To < dfn id =serialize-a-group-of-selectors > serialize a group of
723+ selectors</ dfn > let < var title =""> s</ var > be the empty string, run the
724+ steps below for each selector in the group of selectors, and finally
725+ return < var title =""> s</ var > :
726+
727+ < ol >
728+ < li >
729+ < p > Append the result of < a href ="#serialize-a-selector " title ="serialize
730+ a selector "> serializing</ a > the selector to < var title =""> s</ var > .
731+
732+ < li >
733+ < p > If the selector is not the last selector in the group of selectors
734+ append "< code > ,</ code > " (U+002C), followed by a space (U+0020), to < var
735+ title =""> s</ var > .
736+ </ ol >
737+
738+ < p > To < dfn id =serialize-a-selector > serialize a selector</ dfn > let < var
739+ title =""> s</ var > be the empty string, run the steps below for each part of
740+ the chain of the selector, and finally return < var title =""> s</ var > :
741+
742+ < ol >
743+ < li >
744+ < p > If there is only one < span > simple selector</ span > in the
745+ < span > sequence of simple selectors</ span > which is a < span > universal
746+ selector</ span > , append the result of < a
747+ href ="#serialize-a-simple-selector " title ="serialize a simple
748+ selector "> serializing</ a > the < span > universal selector</ span > to < var
749+ title =""> s</ var > .
750+
751+ < li >
752+ < p > Otherwise, for each < span > simple selector</ span > in the < span > sequence
753+ of simple selectors</ span > that is not a universal selector of which the
754+ < span > namespace prefix</ span > maps to the null namespace (not in a
755+ namespace) or of which the < span > namespace prefix</ span > maps to a
756+ namespace that is not the < span > default namespace</ span > < a
757+ href ="#serialize-a-simple-selector " title ="serialize a simple
758+ selector "> serialize</ a > the < span > simple selector</ span > and append the
759+ result to < var title =""> s</ var > .
760+
761+ < li >
762+ < p > If this is not the last part of the chain of the selector append a
763+ space (U+0020), followed by the combinator "< code > > </ code > ",
764+ "< code > +</ code > ", or "< code > ~</ code > " as appropriate, followed by
765+ another space (U+0020) if the combinator was not whitespace, to < var
766+ title =""> s</ var > .
767+
768+ < li >
769+ < p > If this is the last part of the chain of the selector and there is a
770+ pseudo-element, append "< code > ::</ code > " followed by the name of the
771+ pseudo-class, to < var title =""> s</ var > .
772+ </ ol >
773+
709774 < p > To < dfn id =serialize-a-simple-selector > serialize a simple selector</ dfn >
710775 let < var title =""> s</ var > be the empty string, run the steps below, and
711776 finally return < var title =""> s</ var > :
@@ -874,59 +939,6 @@ <h2 id=selectors><span class=secno>5. </span>Selectors</h2>
874939 </ dl >
875940 </ dl >
876941
877- < p > To < dfn id =serialize-a-selector > serialize a selector</ dfn > let < var
878- title =""> s</ var > be the empty string, run the steps below for each part of
879- the chain of the selector, and finally return < var title =""> s</ var > :
880-
881- < ol >
882- < li >
883- < p > If there is only one < span > simple selector</ span > in the
884- < span > sequence of simple selectors</ span > which is a < span > universal
885- selector</ span > , append the result of < a
886- href ="#serialize-a-simple-selector " title ="serialize a simple
887- selector "> serializing</ a > the < span > universal selector</ span > to < var
888- title =""> s</ var > .
889-
890- < li >
891- < p > Otherwise, for each < span > simple selector</ span > in the < span > sequence
892- of simple selectors</ span > that is not a universal selector of which the
893- < span > namespace prefix</ span > maps to the null namespace (not in a
894- namespace) or of which the < span > namespace prefix</ span > maps to a
895- namespace that is not the < span > default namespace</ span > < a
896- href ="#serialize-a-simple-selector " title ="serialize a simple
897- selector "> serialize</ a > the < span > simple selector</ span > and append the
898- result to < var title =""> s</ var > .
899-
900- < li >
901- < p > If this is not the last part of the chain of the selector append a
902- space (U+0020), followed by the combinator "< code > > </ code > ",
903- "< code > +</ code > ", or "< code > ~</ code > " as appropriate, followed by
904- another space (U+0020) if the combinator was not whitespace, to < var
905- title =""> s</ var > .
906-
907- < li >
908- < p > If this is the last part of the chain of the selector and there is a
909- pseudo-element, append "< code > ::</ code > " followed by the name of the
910- pseudo-class, to < var title =""> s</ var > .
911- </ ol >
912-
913- < p > To < dfn id =serialize-a-group-of-selectors > serialize a group of
914- selectors</ dfn > let < var title =""> s</ var > be the empty string, run the
915- steps below for each selector in the group of selectors, and finally
916- return < var title =""> s</ var > :
917-
918- < ol >
919- < li >
920- < p > Append the result of < a href ="#serialize-a-selector " title ="serialize
921- a selector "> serializing</ a > the selector to < var title =""> s</ var > .
922-
923- < li >
924- < p > If the selector is not the last selector in the group of selectors
925- append "< code > ,</ code > " (U+002C), followed by a space (U+0020), to < var
926- title =""> s</ var > .
927- </ ol >
928- <!-- http://dump.testsuite.org/2009/cssom/serializing-selectors.htm -->
929-
930942 < h2 id =style-sheets > < span class =secno > 6. </ span > Style Sheets</ h2 >
931943
932944 < h3 id =style-sheet0 > < span class =secno > 6.1. </ span > Style Sheet</ h3 >
0 commit comments