<?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>17812</bug_id>
          
          <creation_ts>2012-07-18 06:53:35 +0000</creation_ts>
          <short_desc>:read-write should always apply to input elements if @readonly doesn&apos;t apply</short_desc>
          <delta_ts>2016-04-20 05:33:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>Selectors</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>http://code.google.com/p/chromium/issues/detail?id=604154</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="fantasai">fantasai.bugs</assigned_to>
          <cc>fantasai.bugs</cc>
    
    <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>mounir</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>tantek</cc>
    
    <cc>w3bugs</cc>
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70094</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 06:53:35 +0000</bug_when>
    <thetext>This was was cloned from bug 15428 as part of operation convergence.
Originally filed: 2012-01-05 14:26:00 +0000
Original reporter: Mounir Lamouri &lt;mounir.lamouri@gmail.com&gt;

================================================================================
 #0   Mounir Lamouri                                  2012-01-05 14:26:21 +0000 
--------------------------------------------------------------------------------
Given that the reasons why bug 13390 isn&apos;t going to be fixed means the widgets can&apos;t be read only I guess it would make sense to have :read-write applying to them.
However, some of the input types for which @readonly doesn&apos;t apply shouldn&apos;t be considered :read-write like hidden, button, submit and reset. The ones that should be :read-write are: range, color, checkbox, radio and file.

I think the specs should add as a second item after: &quot;The :read-write pseudo-class must match any element falling into one of the following categories:&quot; (4.14.2, &quot;:read-write&quot;), the following case:
&quot;input elements to which the readonly attribute does not apply and with a value mode different from value.&quot;
If the value mode seems wrong, we could list the types for which it applies or the types for which it doesn&apos;t.
================================================================================
 #1   Ian &apos;Hixie&apos; Hickson                             2012-02-02 21:54:14 +0000 
--------------------------------------------------------------------------------
IMHO neither should really apply to them, but the way I read CSS3 UI every element should match one or the other.
================================================================================
 #2   Ms2ger                                          2012-02-03 09:33:42 +0000 
--------------------------------------------------------------------------------
Should we change CSS3UI?
================================================================================</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72655</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-23 21:53:04 +0000</bug_when>
    <thetext>So Selectors says &quot;An element whose contents are not user-alterable is :read-only&quot;. What does &quot;contents&quot; mean?

fantasai: any chance Selectors could either be updated to be clearer about what :read-only and :read-write are supposed to match, or be changed so it&apos;s clear that it&apos;s up to us to define whether an element matches it or not? Ideally IMHO it&apos;d be possible for elements to match neither, but if that&apos;s not possible, then how about just defining one as being :not(:the-other) and defining the former as defaulting to match/not-match except where otherwise specified? That would make things the simplest. Right now it&apos;s highly unclear what in Selectors is supposed to be normative and what is supposed to be descriptive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77627</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-11-01 00:30:42 +0000</bug_when>
    <thetext>Selectors is pretty clear now that they&apos;re opposites. :read-write matches anything &quot;user-alterable&quot;. Buttons and checkboxes aren&apos;t really &quot;user-alterable&quot; as far as I can tell. You can interact with them, but then you can interact with a readonly text field too, it still isn&apos;t &quot;user-alterable&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82377</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-01-30 23:52:24 +0000</bug_when>
    <thetext>mounir: Unless there&apos;s an objection to comment 2, I plan to close this without changes. But I don&apos;t think the arguments against change are very strong, so if there&apos;s a strong argument for change (e.g. a use case where using :read-write to match radio buttons would be useful) then let me know. I don&apos;t really know what the use cases are here one way or the other.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83321</commentid>
    <comment_count>4</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-02-19 14:01:29 +0000</bug_when>
    <thetext>It&apos;s not clear to me what &quot;content&quot; is. By clicking on a checkbox, a radio, interacting with a file picker or a slider, you change there values. I don&apos;t know if that&apos;s what the spec has in mind. I would oppose those elemens/cases to buttons or &lt;input type=&apos;hidden&apos;&gt;, &lt;input type=&apos;image&apos;&gt; where you can&apos;t modify the value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86055</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-12 18:50:45 +0000</bug_when>
    <thetext>Yeah, I dunno either.

Can someone from the CSSWG update the Selectors spec to be clearer here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86067</commentid>
    <comment_count>6</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-04-12 19:35:32 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; Yeah, I dunno either.
&gt; 
&gt; Can someone from the CSSWG update the Selectors spec to be clearer here?

The current text is *explicitly* designed to be generic, so the host language can decide what it means.  In other words, it&apos;s HTML&apos;s responsibility to define when different elements match :read-write; CSS can&apos;t possibly define it sufficiently for HTML while also being generic enough for other languages.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86174</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-14 08:00:41 +0000</bug_when>
    <thetext>Tab: Well we&apos;re not going to get conceptual interop between host languages if we don&apos;t have more advice from the Selectors spec. Is a radio button &quot;user-alterable&quot;? Is a push button &quot;user-alterable&quot;? Is a &lt;select&gt; &quot;user-alterable&quot;? An iframe that you can scroll? A read-only control you can scroll? A &lt;canvas&gt; where JavaScript has been hooked up to allow the user to draw on it? Some guidance in the Selectors spec would be much appreciated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86179</commentid>
    <comment_count>8</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-04-14 17:07:35 +0000</bug_when>
    <thetext>Sigh, okay, I&apos;ll work up some text.  Spoiler alert: it&apos;s meant to apply to form inputs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86649</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-24 00:35:45 +0000</bug_when>
    <thetext>I would assume it doesn&apos;t apply to radio buttons, since they&apos;re not alterable, just selectable, though, right? Or not? I&apos;m unclear on what the intent is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86710</commentid>
    <comment_count>10</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-04-24 19:55:32 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; I would assume it doesn&apos;t apply to radio buttons, since they&apos;re not
&gt; alterable, just selectable, though, right? Or not? I&apos;m unclear on what the
&gt; intent is.

After trying a bit, I can&apos;t get the text any clearer without just explicitly listing out the HTML elements it applies to.

So, here&apos;s our interpretation instead.  Feel free to just put it into HTML.

:read-write should match:
* &lt;select&gt;, &lt;textarea&gt;, and all &lt;input&gt; types except the ones that are buttons.  (unless readonly or disabled)
* Any element with [contenteditable].

:read-only should match:
* everything else</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86780</commentid>
    <comment_count>11</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-04-25 14:14:02 +0000</bug_when>
    <thetext>So that means that all &lt;input&gt; have :read-write applying unless they are readonly or they are type={button,reset,submit} ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86801</commentid>
    <comment_count>12</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-04-25 17:06:48 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; So that means that all &lt;input&gt; have :read-write applying unless they are
&gt; readonly or they are type={button,reset,submit} ?

Or disabled, yes.  (Also, type=image I think?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86804</commentid>
    <comment_count>13</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-04-25 17:24:54 +0000</bug_when>
    <thetext>Yes, &apos;image&apos;. And maybe &apos;hidden&apos; too, right? Every input type with a value mode equal to &apos;default&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86814</commentid>
    <comment_count>14</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-25 20:27:24 +0000</bug_when>
    <thetext>Is a radio button a button?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86815</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-25 20:30:19 +0000</bug_when>
    <thetext>I don&apos;t see anything wrong with listing control types explicitly in the Selectors spec, for what it&apos;s worth. That may be the best way to get interop amongst different host languages. Obviously it would have to be an open-ended, &quot;define by example&quot;-style definition, but even that would be better than just &quot;user-alterable&quot;. (I don&apos;t think it makes sense to base the HTML spec on the description of intent given in a bug comment. That&apos;s not normative, and other languages aren&apos;t going to know about it.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86816</commentid>
    <comment_count>16</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-04-25 20:30:46 +0000</bug_when>
    <thetext>(In reply to comment #14)
&gt; Is a radio button a button?

No.  The list is what Mounir has said - type=button/reset/submit/image/hidden shouldn&apos;t be :read-write, because there&apos;s no state for the user to change.  Neither should any of the &lt;button&gt; types.  The rest of the form inputs should be, unless they&apos;re readonly or disabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86817</commentid>
    <comment_count>17</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2013-04-25 20:31:26 +0000</bug_when>
    <thetext>(In reply to comment #15)
&gt; I don&apos;t see anything wrong with listing control types explicitly in the
&gt; Selectors spec, for what it&apos;s worth. That may be the best way to get interop
&gt; amongst different host languages. Obviously it would have to be an
&gt; open-ended, &quot;define by example&quot;-style definition, but even that would be
&gt; better than just &quot;user-alterable&quot;. (I don&apos;t think it makes sense to base the
&gt; HTML spec on the description of intent given in a bug comment. That&apos;s not
&gt; normative, and other languages aren&apos;t going to know about it.)

Define the list of HTML elements that match it, and Selectors will link to HTML as an example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86823</commentid>
    <comment_count>18</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-25 22:20:06 +0000</bug_when>
    <thetext>We discussed this on IRC, and basically it seems none of us know what the use cases for these pseudo-classes (:read-only and :read-write) are. We should probably study how common it is for these pseudos to be used, and see how they are used, and work from there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86934</commentid>
    <comment_count>19</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-04-28 23:06:40 +0000</bug_when>
    <thetext>(In reply to comment #18)
&gt; We discussed this on IRC, and basically it seems none of us know what the
&gt; use cases for these pseudo-classes (:read-only and :read-write) are. We
&gt; should probably study how common it is for these pseudos to be used, and see
&gt; how they are used, and work from there.

Is it really used? Currently, there are three implementations of :read-write / :read-only: Gecko, Presto and Webkit. On Gecko, it is prefixed and Webkit and Presto have a different behaviour. Presto has a behaviour that seems similar to what this bug requests while Webkit seems to stick to what the HTML specification seems to request.

I&apos;ve put together a simple test case:
http://www.browserstack.com/screenshots/2841286b61558a924e8feb192cbd18200ef91646

We could add some telemetry checks in Gecko to see how much :-moz-read-write and :-moz-read-only are used but I doubt that would give us much interesting information because I doubt they are used widely.

Hixie, do you have any plan to check how those pseudo-classes are currently used?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87014</commentid>
    <comment_count>20</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-30 17:07:35 +0000</bug_when>
    <thetext>I am going to try, but I don&apos;t have a good way to study CSS usage.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88334</commentid>
    <comment_count>21</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-05-29 00:00:32 +0000</bug_when>
    <thetext>Looking just at HTML pages (not CSS files, so this only counts &lt;style&gt; elements and people talking about these in the page content itself, like this very bug), I found about 50k pages from a sample of billions that contain any of &apos;:read-only&apos;, &apos;:read-write&apos;, &apos;:-moz-read-only&apos;, or &apos;:-moz-read-write&apos;. From this set, the page with the highest prominence (according to some obscure internal Google metric) was the HTML spec on the WHATWG site... :-) Most of the rest were also pages about HTML or CSS, dev tutorials, etc.

Here&apos;s some of the ones I saw that weren&apos;t to do with the Web:

 http://room-parttime.blogspot.com/2013/02/part-time-kfc.html
 http://www.filmystudio.com/2013/01/bengali-movie-deewana-2013-cam-rip-full.html
   These mention it in the same minified JS and I doubt would be affected
   by us dropping this feature. (There&apos;s a lot of these, they all seem to be
   Blogger-related, maybe?)

 http://www.reform-tone.com/
 http://www.corolla-kagoshima.jp/
   These uses it as a hack to target specific browsers.

 http://www.recycleformerseyside.com/education/recycling-game/
   I can&apos;t find where the match came from on this page.

Anyway, my conclusion is that we can probably drop :read-only/:read-write.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88376</commentid>
    <comment_count>22</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-05-29 14:52:26 +0000</bug_when>
    <thetext>(In reply to comment #21)
&gt; Anyway, my conclusion is that we can probably drop :read-only/:read-write.

I would prefer to fix the specification instead of dropping them unless the CSS spec drops them too and all browsers implementing them drops their implementations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89184</commentid>
    <comment_count>23</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-06-12 17:54:34 +0000</bug_when>
    <thetext>Right, I meant drop them from CSS and other browsers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89524</commentid>
    <comment_count>24</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-06-18 23:37:12 +0000</bug_when>
    <thetext>Tab, fantasai: given the data in comment 21, would you object to just dropping the feature from Selectors?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90147</commentid>
    <comment_count>25</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-07-02 21:47:53 +0000</bug_when>
    <thetext>Reassigning to CSS for further processing; please reassign back to me if we can&apos;t drop these after all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125937</commentid>
    <comment_count>26</comment_count>
    <who name="Chris Rebert">w3bugs</who>
    <bug_when>2016-04-20 05:33:16 +0000</bug_when>
    <thetext>Relevant new www-style thread:
https://lists.w3.org/Archives/Public/www-style/2016Apr/0294.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>