- From: David Baron via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 14 Jun 2011 19:08:22 +0000
- To: public-css-commits@w3.org
Update of /sources/public/csswg/css3-conditional In directory hutz:/tmp/cvs-serv23791 Modified Files: Overview.html Overview.src.html Log Message: Define the URL of the document being styled. Index: Overview.html =================================================================== RCS file: /sources/public/csswg/css3-conditional/Overview.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Overview.html 14 Jun 2011 02:13:48 -0000 1.19 +++ Overview.html 14 Jun 2011 19:08:20 -0000 1.20 @@ -765,10 +765,10 @@ ‘<code class=css>@document</code>’ rule</h2> <p>The <dfn id=document-rule>‘<code class=css>@document</code>’ - rule</dfn> is a conditional group rule whose condition depends on the URL - of the document being styled. This allows style sheets, particularly user - style sheets, to have styles that only apply to a set of pages rather than - to all pages using the style sheet. + rule</dfn> is a conditional group rule whose condition depends on the <a + href="#url-of-doc">URL of the document being styled</a>. This allows style + sheets, particularly user style sheets, to have styles that only apply to + a set of pages rather than to all pages using the style sheet. <p class=issue>Given that this @-rule is intended primarily for user style sheets, what should this specification say about its use in author style @@ -776,6 +776,30 @@ should this specification remain neutral on the topic, since there are valid uses in author style sheets? + <p id=url-of-doc>The <dfn id=url-of-the-document-being-styled>URL of the + document being styled</dfn> is the URI at which the document is located, + excluding any fragment identifiers. (This means, for example, that HTTP + redirects have been followed.) If the styles are being applied inside a + complete document embedded into the presentation of another (e.g., <a + href="#HTML5" rel=biblioentry>[HTML5]<!--{{HTML5}}--></a>'s <code + class=html>iframe</code>, <code class=html>object</code>, or <code + class=html>img</code> elements), the relevant URI is that of the frame, + not of its container. However, if content from other documents is mixed in + via mechanisms that mix content from one document into another (e.g., <a + href="#SVG11" rel=biblioentry>[SVG11]<!--{{SVG11}}--></a>'s + <code>use</code> element), then the address of the container document is + used. + + <p class=note>Note: In <a href="#HTML5" + rel=biblioentry>[HTML5]<!--{{HTML5}}--></a>, this is the <a + href="http://dev.w3.org/html5/spec/dom.html#the-document-s-address">document's + address</a> of a document in a <a + href="http://dev.w3.org/html5/spec/browsers.html#browsing-context">browsing + context</a>. + + <p class=issue>What form of normalization is done on URLs and domains + before matching? + <p>The ‘<code class=css>@document</code>’ rule's condition is written as a comma-separated list of <dfn id=url-matching-functions>URL matching functions</dfn>, and the condition evaluates to true whenever any @@ -790,8 +814,8 @@ <p>The ‘<a href="#url-exact"><code class=css>url()</code></a>’ function is the <dfn id=exact-url-matching-function>exact url matching function</dfn>. It - evaluates to true whenever the URL of the document being styled is - exactly the URL given.</p> + evaluates to true whenever the <a href="#url-of-doc">URL of the document + being styled</a> is exactly the URL given.</p> <p class=Note>The ‘<a href="#url-exact"><code class=css>url()</code></a>’ function, since it is a core syntax @@ -818,10 +842,10 @@ <p>The ‘<a href="#url-prefix"><code class=css>url-prefix()</code></a>’ function is the <dfn id=url-prefix-matching-function>url prefix matching function</dfn>. It - evaluates to true whenever the URL of the document being styled has the - argument to the function as an initial substring (which is true when the - two strings are equal). When the argument is the empty string, it - evaluates to true for all documents.</p> + evaluates to true whenever the <a href="#url-of-doc">URL of the document + being styled</a> has the argument to the function as an initial + substring (which is true when the two strings are equal). When the + argument is the empty string, it evaluates to true for all documents.</p> <div class=example> <p>For example, this rule:</p> @@ -844,13 +868,14 @@ <p>The ‘<a href="#url-domain"><code class=css>domain()</code></a>’ function is the <dfn id=domain-matching-function>domain matching function</dfn>. It evaluates - to true whenever the URL of the page has a host subcomponent (as defined - in <a href="#URI" rel=biblioentry>[URI]<!--{{!URI}}--></a>) and that - host subcomponent is exactly the argument to the ‘<a - href="#url-domain"><code class=css>domain()</code></a>’ function - or a final substring of the host component is a period (U+002E) - immediately followed by the argument to the ‘<a - href="#url-domain"><code class=css>domain()</code></a>’ function.</p> + to true whenever the <a href="#url-of-doc">URL of the document being + styled</a> has a host subcomponent (as defined in <a href="#URI" + rel=biblioentry>[URI]<!--{{!URI}}--></a>) and that host subcomponent is + exactly the argument to the ‘<a href="#url-domain"><code + class=css>domain()</code></a>’ function or a final substring of + the host component is a period (U+002E) immediately followed by the + argument to the ‘<a href="#url-domain"><code + class=css>domain()</code></a>’ function.</p> <div class=example> <p>For example, this rule:</p> @@ -883,7 +908,8 @@ rel=biblioentry>[ECMA-262]<!--{{!ECMA-262}}--></a> Edition 5, sections 15.10.7.2 through 15.10.7.4 <span class=issue>fix reference and cite 5.1 when final</span>) compiles successfully and the resulting regular - expression matches the entirety of the URL of the page.</p> + expression matches the entirety of the <a href="#url-of-doc">URL of the + document being styled</a>.</p> <p class=note>Note that regular expression must match the entire URL, not just a part of it.</p> @@ -910,14 +936,6 @@ </div> </dl> - <p class=issue>What form of normalization is done on URLs and domains - before matching? - - <p class=issue>Need to define what URL we care about, perhaps in terms of - browsing context. It should apply to the URL of an - iframe/object/embed/img; it should probably not apply to the URL of an - svg:use. - <p>Implementations <strong>must</strong> treat any unknown URL matching functions as a syntax error, and thus ignore the ‘<code class=css>@document</code>’ rule. <span class=issue>Should we @@ -1233,6 +1251,16 @@ href="http://www.w3.org/TR/2011/WD-html5-20110525/">http://www.w3.org/TR/2011/WD-html5-20110525/</a> </dd> <!----> + + <dt id=SVG11>[SVG11] + + <dd>Erik Dahlström; et al. <a + href="http://www.w3.org/TR/2011/WD-SVG11-20110512/"><cite>Scalable Vector + Graphics (SVG) 1.1 (Second Edition).</cite></a> 12 May 2011. W3C Working + Draft. (Work in progress.) URL: <a + href="http://www.w3.org/TR/2011/WD-SVG11-20110512/">http://www.w3.org/TR/2011/WD-SVG11-20110512/</a> + </dd> + <!----> </dl> <!--end-informative--> @@ -1300,6 +1328,10 @@ functions, regular expression"><strong>7.</strong></a> </ul> + <li>URL of the document being styled, <a + href="#url-of-the-document-being-styled" title="URL of the document being + styled"><strong>7.</strong></a> + <li>url-prefix(), <a href="#url-prefix" title="url-prefix()"><strong>7.</strong></a> Index: Overview.src.html =================================================================== RCS file: /sources/public/csswg/css3-conditional/Overview.src.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Overview.src.html 14 Jun 2011 02:13:48 -0000 1.19 +++ Overview.src.html 14 Jun 2011 19:08:20 -0000 1.20 @@ -554,7 +554,8 @@ <h2 id="at-document">Document queries: the '@document' rule</h2> <p>The <dfn>'@document' rule</dfn> is a conditional group -rule whose condition depends on the URL of the document being styled. +rule whose condition depends on the +<a href="#url-of-doc">URL of the document being styled</a>. This allows style sheets, particularly user style sheets, to have styles that only apply to a set of pages rather than to all pages using the style sheet.</p> @@ -565,6 +566,27 @@ discouraged? Or should this specification remain neutral on the topic, since there are valid uses in author style sheets?</p> +<p id="url-of-doc">The <dfn>URL of the document being styled</dfn> is +the URI at which the document is located, excluding any fragment +identifiers. (This means, for example, that HTTP redirects have been +followed.) If the styles are being applied inside a complete document +embedded into the presentation of another (e.g., [[HTML5]]'s <code +class="html">iframe</code>, <code class="html">object</code>, or <code +class="html">img</code> elements), the relevant URI is that of the +frame, not of its container. However, if content from other documents +is mixed in via mechanisms that mix content from one document into +another (e.g., [[SVG11]]'s <code>use</code> element), then the +address of the container document is used.</p> + +<p class="note">Note: In [[HTML5]], this is the +<a href="http://dev.w3.org/html5/spec/dom.html#the-document-s-address">document's address</a> +of a document in a +<a href="http://dev.w3.org/html5/spec/browsers.html#browsing-context">browsing context</a>.</p> + +<p class="issue">What form of normalization is done on URLs and domains +before matching?</p> + + <p>The '@document' rule's condition is written as a comma-separated list of <dfn>URL matching functions</dfn>, and the condition evaluates to true whenever any one of those functions @@ -576,8 +598,9 @@ <dd> <p>The 'url()' function is the <dfn>exact url matching - function</dfn>. It evaluates to true whenever the URL of the - document being styled is exactly the URL given.</p> + function</dfn>. It evaluates to true whenever the <a + href="#url-of-doc">URL of the document being styled</a> is exactly + the URL given.</p> <p class="Note">The 'url()' function, since it is a core syntax element in CSS, is allowed (subject to different character @@ -600,8 +623,9 @@ <dd> <p>The 'url-prefix()' function is the <dfn>url prefix - matching function</dfn>. It evaluates to true whenever the URL of - the document being styled has the argument to the function as an + matching function</dfn>. It evaluates to true whenever the + <a href="#url-of-doc">URL of the document being styled</a> + has the argument to the function as an initial substring (which is true when the two strings are equal). When the argument is the empty string, it evaluates to true for all documents.</p> @@ -623,7 +647,8 @@ <dd> <p>The 'domain()' function is the <dfn>domain matching function</dfn>. It evaluates to true whenever - the URL of the page has a host subcomponent (as defined in [[!URI]]) + the <a href="#url-of-doc">URL of the document being styled</a> + has a host subcomponent (as defined in [[!URI]]) and that host subcomponent is exactly the argument to the 'domain()' function or a final substring of the host component is a period (U+002E) immediately followed by the argument @@ -657,7 +682,8 @@ (see [[!ECMA-262]] Edition 5, sections 15.10.7.2 through 15.10.7.4 <span class="issue">fix reference and cite 5.1 when final</span>) compiles successfully and the resulting regular expression matches - the entirety of the URL of the page.</p> + the entirety of the + <a href="#url-of-doc">URL of the document being styled</a>.</p> <p class="note">Note that regular expression must match the entire URL, not just a part of it.</p> @@ -682,14 +708,6 @@ </dl> -<p class="issue">What form of normalization is done on URLs and domains -before matching?</p> - -<p class="issue">Need to define what URL we care about, perhaps in terms -of browsing context. It should apply to the URL of an -iframe/object/embed/img; it should probably not apply to the URL of an -svg:use.</p> - <p>Implementations <strong>must</strong> treat any unknown URL matching functions as a syntax error, and thus ignore the '@document' rule. <span class="issue">Should we instead have more complicated error
Received on Tuesday, 14 June 2011 19:08:24 UTC