<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>10348</bug_id>
          
          <creation_ts>2010-08-12 04:11:13 +0000</creation_ts>
          <short_desc>style scoped attribute</short_desc>
          <delta_ts>2015-08-23 07:07:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML Checker</product>
          <component>General</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="John Spaetzel">knowhalo</reporter>
          <assigned_to name="Michael[tm] Smith">mike</assigned_to>
          <cc>Rob.Simpson</cc>
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>37367</commentid>
    <comment_count>0</comment_count>
    <who name="John Spaetzel">knowhalo</who>
    <bug_when>2010-08-12 04:11:13 +0000</bug_when>
    <thetext>The scoped attribute for &lt;style&gt; is a Boolean. In order for it to be used as false. It should not be included in &lt;style&gt;

However... &lt;style&gt; requires type,media, and scoped to be defined.

Therefore making it impossible to validate a false scoped attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42444</commentid>
    <comment_count>1</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2010-11-11 18:16:01 +0000</bug_when>
    <thetext>please provide a test case that demonstrates the problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42449</commentid>
    <comment_count>2</comment_count>
    <who name="John Spaetzel">knowhalo</who>
    <bug_when>2010-11-11 19:24:25 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; please provide a test case that demonstrates the problem

&lt;style type=&quot;text/css&quot; media=&quot;screen&quot; scoped=&quot;true&quot;&gt;  Valid
&lt;style type=&quot;text/css&quot; media=&quot;screen&quot; scoped=&quot;false&quot;&gt; Invalid
&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;                Invalid 

There is no way to validate a false scoped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42700</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Simpson">Rob.Simpson</who>
    <bug_when>2010-11-22 18:27:45 +0000</bug_when>
    <thetext>Bug #11362 pointed me here, but since I had already validated pages with &quot;false&quot; scoped styles this issue wasn&apos;t quite clear to me. I created a more extensive use case for &lt;style&gt; elements (excluding their use in &lt;noscript&gt;), which can be validated here:

http://validator.W3.org/check?uri=http%3A%2F%2Fwww.ExampleOnly.com%2Fhtml-5%2Fstyle-scoped.html;ss=1

&gt;&gt; There is no way to validate a false scoped.
&gt;&gt; &lt;style type=&quot;text/css&quot; media=&quot;screen&quot; scoped=&quot;true&quot;&gt;  Valid
&gt;&gt; &lt;style type=&quot;text/css&quot; media=&quot;screen&quot; scoped=&quot;false&quot;&gt; Invalid
&gt;&gt; &lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;                Invalid 
Since it appears that all three of these cases are for a &lt;style&gt; in the body section, those are the expected results, and also the actual results that I got.

So it appears that now (November 22, 2010) the &quot;false&quot; scoped does validate without error as expected:

Line #6 - &lt;style&gt; with no scoped attribute
     Actual and Expected Results - no error

There is only one case where the actual results differ from the expected results, where a &lt;style&gt; with a scoped attribute validates as if it were set to &quot;false&quot; internally.

Line #44 - &lt;style&gt; with empty string as value of scoped attribute
     Expected Results - Bad value &quot;&quot; for attribute scoped on XHTML element style.
     Actual Results   - no error!

This may be due to XPath treating an empty string as &quot;false&quot; (Quote: &quot;Avoid using a minimized form for boolean attributes, such as selected, or values with an empty string, such as in selected=&quot;&quot;, which XPath treats as false rather than true.&quot; - http://www.HTML-5.com/tutorials/converting-to-html-5.html) - this would need to be validated as &quot;style[@scoped=&apos;scoped&apos;]&quot; rather than simply &quot;style[@scoped]&quot; (at least when reading it as xHTML - i.e. the XHTML serialization of HTML 5)

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42704</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Simpson">Rob.Simpson</who>
    <bug_when>2010-11-22 18:57:33 +0000</bug_when>
    <thetext>Correction:

The results, both expected and actual, for the earlier use case are (the first two lines here replace the first line in previous comment):

&lt;style type=&quot;text/css&quot; media=&quot;screen&quot; scoped=&quot;scoped&quot;&gt; Valid - line 39
&lt;style type=&quot;text/css&quot; media=&quot;screen&quot; scoped=&quot;true&quot;&gt;   Invalid - line 49
&lt;style type=&quot;text/css&quot; media=&quot;screen&quot; scoped=&quot;false&quot;&gt;  Invalid - line 54
&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;                 Invalid - line 34

The scoped attribute _is_ in fact a boolean attribute, and it&apos;s possible the original author may have assumed that the values &quot;true&quot; and &quot;false&quot; were appropriate for boolean attributes when they are not. (But then either he should have expected &quot;Valid&quot; for his scoped=&quot;false&quot; use case, if those were the expected results in the 2010-11-11 use cases, or got &quot;Invalid&quot; for his scoped=&quot;true&quot; use case, if those were the actual results and this had been reported as an issue with the &quot;true&quot; case rather than the &quot;false&quot; one, since &quot;The values &apos;true&apos; and &apos;false&apos; are not allowed on boolean attributes&quot;.)

Quote (from http://www.HTML-5.com/tutorials/converting-to-html-5.html):

&gt;&gt; Note that the HTML 5 specifications explicitly state that:
&gt;&gt;
&gt;&gt;    The values &quot;true&quot; and &quot;false&quot; are not allowed on boolean attributes.
&gt;&gt;
&gt;&gt; This is because browsers that look at the coded value for boolean attributes
&gt;&gt; would treat the string &quot;false&quot; as false while browsers that only look for the
&gt;&gt; presence or absence of the attribute would treat that code as true, resulting
&gt;&gt; in very inconsistent behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89908</commentid>
    <comment_count>5</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-06-26 17:53:13 +0000</bug_when>
    <thetext>Yeah, the only valid values for the scoped attribute are &quot;scoped&quot; or the empty string. The spec is clear about that. There&apos;s no such thing as a &quot;false scoped attribute&quot;. There&apos;s no need for one; a style element without a scoped attribute is the same as what a &quot;false scoped attribute&quot; would mean, as far as I can see.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>