@@ -765,17 +765,41 @@ <h2 id=at-document><span class=secno>7. </span>Document queries: the
765765 ‘< code class =css > @document</ code > ’ rule</ h2 >
766766
767767 < p > The < dfn id =document-rule > ‘< code class =css > @document</ code > ’
768- rule</ dfn > is a conditional group rule whose condition depends on the URL
769- of the document being styled. This allows style sheets, particularly user
770- style sheets, to have styles that only apply to a set of pages rather than
771- to all pages using the style sheet.
768+ rule</ dfn > is a conditional group rule whose condition depends on the < a
769+ href =" #url-of-doc " > URL of the document being styled</ a > . This allows style
770+ sheets, particularly user style sheets, to have styles that only apply to
771+ a set of pages rather than to all pages using the style sheet.
772772
773773 < p class =issue > Given that this @-rule is intended primarily for user style
774774 sheets, what should this specification say about its use in author style
775775 sheets? Should it be forbidden? Should use instead be discouraged? Or
776776 should this specification remain neutral on the topic, since there are
777777 valid uses in author style sheets?
778778
779+ < p id =url-of-doc > The < dfn id =url-of-the-document-being-styled > URL of the
780+ document being styled</ dfn > is the URI at which the document is located,
781+ excluding any fragment identifiers. (This means, for example, that HTTP
782+ redirects have been followed.) If the styles are being applied inside a
783+ complete document embedded into the presentation of another (e.g., < a
784+ href ="#HTML5 " rel =biblioentry > [HTML5]<!--{{HTML5}}--> </ a > 's < code
785+ class =html > iframe</ code > , < code class =html > object</ code > , or < code
786+ class =html > img</ code > elements), the relevant URI is that of the frame,
787+ not of its container. However, if content from other documents is mixed in
788+ via mechanisms that mix content from one document into another (e.g., < a
789+ href ="#SVG11 " rel =biblioentry > [SVG11]<!--{{SVG11}}--> </ a > 's
790+ < code > use</ code > element), then the address of the container document is
791+ used.
792+
793+ < p class =note > Note: In < a href ="#HTML5 "
794+ rel =biblioentry > [HTML5]<!--{{HTML5}}--> </ a > , this is the < a
795+ href ="http://dev.w3.org/html5/spec/dom.html#the-document-s-address "> document's
796+ address</ a > of a document in a < a
797+ href ="http://dev.w3.org/html5/spec/browsers.html#browsing-context "> browsing
798+ context</ a > .
799+
800+ < p class =issue > What form of normalization is done on URLs and domains
801+ before matching?
802+
779803 < p > The ‘< code class =css > @document</ code > ’ rule's condition is
780804 written as a comma-separated list of < dfn id =url-matching-functions > URL
781805 matching functions</ dfn > , and the condition evaluates to true whenever any
@@ -790,8 +814,8 @@ <h2 id=at-document><span class=secno>7. </span>Document queries: the
790814 < p > The ‘< a href ="#url-exact "> < code
791815 class =css > url()</ code > </ a > ’ function is the < dfn
792816 id =exact-url-matching-function > exact url matching function</ dfn > . It
793- evaluates to true whenever the URL of the document being styled is
794- exactly the URL given.</ p >
817+ evaluates to true whenever the < a href =" #url-of-doc " > URL of the document
818+ being styled </ a > is exactly the URL given.</ p >
795819
796820 < p class =Note > The ‘< a href ="#url-exact "> < code
797821 class =css > url()</ code > </ a > ’ function, since it is a core syntax
@@ -818,10 +842,10 @@ <h2 id=at-document><span class=secno>7. </span>Document queries: the
818842 < p > The ‘< a href ="#url-prefix "> < code
819843 class =css > url-prefix()</ code > </ a > ’ function is the < dfn
820844 id =url-prefix-matching-function > url prefix matching function</ dfn > . It
821- evaluates to true whenever the URL of the document being styled has the
822- argument to the function as an initial substring (which is true when the
823- two strings are equal). When the argument is the empty string, it
824- evaluates to true for all documents.</ p >
845+ evaluates to true whenever the < a href =" #url-of-doc " > URL of the document
846+ being styled </ a > has the argument to the function as an initial
847+ substring (which is true when the two strings are equal). When the
848+ argument is the empty string, it evaluates to true for all documents.</ p >
825849
826850 < div class =example >
827851 < p > For example, this rule:</ p >
@@ -844,13 +868,14 @@ <h2 id=at-document><span class=secno>7. </span>Document queries: the
844868 < p > The ‘< a href ="#url-domain "> < code
845869 class =css > domain()</ code > </ a > ’ function is the < dfn
846870 id =domain-matching-function > domain matching function</ dfn > . It evaluates
847- to true whenever the URL of the page has a host subcomponent (as defined
848- in < a href ="#URI " rel =biblioentry > [URI]<!--{{!URI}}--> </ a > ) and that
849- host subcomponent is exactly the argument to the ‘< a
850- href ="#url-domain "> < code class =css > domain()</ code > </ a > ’ function
851- or a final substring of the host component is a period (U+002E)
852- immediately followed by the argument to the ‘< a
853- href ="#url-domain "> < code class =css > domain()</ code > </ a > ’ function.</ p >
871+ to true whenever the < a href ="#url-of-doc "> URL of the document being
872+ styled</ a > has a host subcomponent (as defined in < a href ="#URI "
873+ rel =biblioentry > [URI]<!--{{!URI}}--> </ a > ) and that host subcomponent is
874+ exactly the argument to the ‘< a href ="#url-domain "> < code
875+ class =css > domain()</ code > </ a > ’ function or a final substring of
876+ the host component is a period (U+002E) immediately followed by the
877+ argument to the ‘< a href ="#url-domain "> < code
878+ class =css > domain()</ code > </ a > ’ function.</ p >
854879
855880 < div class =example >
856881 < p > For example, this rule:</ p >
@@ -883,7 +908,8 @@ <h2 id=at-document><span class=secno>7. </span>Document queries: the
883908 rel =biblioentry > [ECMA-262]<!--{{!ECMA-262}}--> </ a > Edition 5, sections
884909 15.10.7.2 through 15.10.7.4 < span class =issue > fix reference and cite 5.1
885910 when final</ span > ) compiles successfully and the resulting regular
886- expression matches the entirety of the URL of the page.</ p >
911+ expression matches the entirety of the < a href ="#url-of-doc "> URL of the
912+ document being styled</ a > .</ p >
887913
888914 < p class =note > Note that regular expression must match the entire URL, not
889915 just a part of it.</ p >
@@ -910,14 +936,6 @@ <h2 id=at-document><span class=secno>7. </span>Document queries: the
910936 </ div >
911937 </ dl >
912938
913- < p class =issue > What form of normalization is done on URLs and domains
914- before matching?
915-
916- < p class =issue > Need to define what URL we care about, perhaps in terms of
917- browsing context. It should apply to the URL of an
918- iframe/object/embed/img; it should probably not apply to the URL of an
919- svg:use.
920-
921939 < p > Implementations < strong > must</ strong > treat any unknown URL matching
922940 functions as a syntax error, and thus ignore the ‘< code
923941 class =css > @document</ code > ’ rule. < span class =issue > Should we
@@ -1233,6 +1251,16 @@ <h3 class=no-num id=other-references>Other references</h3>
12331251 href ="http://www.w3.org/TR/2011/WD-html5-20110525/ "> http://www.w3.org/TR/2011/WD-html5-20110525/</ a >
12341252 </ dd >
12351253 <!---->
1254+
1255+ < dt id =SVG11 > [SVG11]
1256+
1257+ < dd > Erik Dahlström; et al. < a
1258+ href ="http://www.w3.org/TR/2011/WD-SVG11-20110512/ "> < cite > Scalable Vector
1259+ Graphics (SVG) 1.1 (Second Edition).</ cite > </ a > 12 May 2011. W3C Working
1260+ Draft. (Work in progress.) URL: < a
1261+ href ="http://www.w3.org/TR/2011/WD-SVG11-20110512/ "> http://www.w3.org/TR/2011/WD-SVG11-20110512/</ a >
1262+ </ dd >
1263+ <!---->
12361264 </ dl >
12371265 <!--end-informative-->
12381266
@@ -1300,6 +1328,10 @@ <h2 class=no-num id=index>Index</h2>
13001328 functions, regular expression "> < strong > 7.</ strong > </ a >
13011329 </ ul >
13021330
1331+ < li > URL of the document being styled, < a
1332+ href ="#url-of-the-document-being-styled " title ="URL of the document being
1333+ styled "> < strong > 7.</ strong > </ a >
1334+
13031335 < li > url-prefix(), < a href ="#url-prefix "
13041336 title ="url-prefix() "> < strong > 7.</ strong > </ a >
13051337
0 commit comments