<?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>11794</bug_id>
          
          <creation_ts>2011-01-18 20:52:52 +0000</creation_ts>
          <short_desc>Utility function to enable/disable all controls in a subtree</short_desc>
          <delta_ts>2014-09-26 21:06:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#barred-from-constraint-validation</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Needs Impl Interest</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>mounir</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>44449</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-01-18 20:52:52 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/complete.html
Section: http://www.whatwg.org/specs/web-apps/current-work/#barred-from-constraint-validation

Comment:
We should handle the case of a bunch of required controls all being hidden at
once — the author shouldn&apos;t have to also go in an remove the &apos;required&apos;
attribute on each one. Maybe make hidden=&quot;&quot; bar things from constraint
validation?

Posted from: 76.102.14.57 by ian@hixie.ch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44450</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-01-18 20:53:22 +0000</bug_when>
    <thetext>(ack nemo on #developers)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44451</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-01-18 21:09:05 +0000</bug_when>
    <thetext>zcorpan points out this was considered before (though without a use case, it seems):
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-August/027624.html

&lt;fieldset disabled&gt; is the main way we&apos;ve said to do this in the past, but the case that raised this this time had markup involving nested lists, where a fieldset would be a bit awkward.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44452</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-01-18 21:10:38 +0000</bug_when>
    <thetext>zcorpan also suggests maybe making disabled=&quot;&quot; a global attribute (or at least an attribute allowed on non-void &lt;body&gt; descendants).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44453</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-01-18 21:22:09 +0000</bug_when>
    <thetext>disabled seems to be a global attribute in IE which grays text, disables form controls and contenteditable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44454</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-01-18 21:42:16 +0000</bug_when>
    <thetext>The issue with overloading @hidden this way is that anytime it&apos;s used the browser would have to check for form controls that are descendants of the node whose @hidden is being changed.  This means either making @hidden changes slower in all cases, or optimizing for the case of no form descendants and maintaining state on ancestors of form controls (making form control insertion and/or removal slower).

For fieldset&apos;s @disabled what Gecko does is that fieldsets observe changes to the DOM under them, and when form controls are added add them to a list stored in the fieldset.  This makes @disabled changes fast, and only affects insertion/removal of nodes under fieldsets (and in a pretty minor way).  It costs a bit more memory per fieldset node, but those are rare.  This approach wouldn&apos;t work for arbitrary @hidden, because the extra memory cost per node for _all_ elements doesn&apos;t seem desirable...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44499</commentid>
    <comment_count>6</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2011-01-19 21:59:11 +0000</bug_when>
    <thetext>Couldn&apos;t we simply add &apos;novalidate&apos; attribute to form controls to make them barred from constraint validation?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44505</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-01-20 10:10:12 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Couldn&apos;t we simply add &apos;novalidate&apos; attribute to form controls to make them
&gt; barred from constraint validation?

That wouldn&apos;t address the problem this bug describes since it&apos;s equally annoying to add novalidate to all affected controls as it is to add disabled or remove required on them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44508</commentid>
    <comment_count>8</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2011-01-20 10:42:42 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; Couldn&apos;t we simply add &apos;novalidate&apos; attribute to form controls to make them
&gt; &gt; barred from constraint validation?
&gt; 
&gt; That wouldn&apos;t address the problem this bug describes since it&apos;s equally
&gt; annoying to add novalidate to all affected controls as it is to add disabled or
&gt; remove required on them.

Disabled would prevent the form control from being submitted. That wouldn&apos;t be the same as barring it from constraint validation.

And removing required is one use case. Having an attribute to bar the element from constraint validation would work easily in all situations.

Maybe we could also make novalidate set on a fieldset barring all fieldset descendants from constraint validation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44514</commentid>
    <comment_count>9</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-01-20 14:49:13 +0000</bug_when>
    <thetext>Right, that&apos;s the other questions.  When would one hide a bunch of unrelated controls?  And shouldn&apos;t related controls be in a fieldset?

I&apos;d be happy with making novalidate on fieldsets imply it for all controls in the fieldset.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45652</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-16 08:15:26 +0000</bug_when>
    <thetext>The use case in question is something like a list where each list item can be toggled between representing either nothing or a set of further fields nested within it. You want each nested field to be disabled when the parent list item is in the &quot;off&quot; state, and enabled otherwise, and you don&apos;t want to have to crawl the tree manually each time.

EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Partially Accepted
Change Description: none yet
Rationale: I&apos;m going to postpone this for now, since there are temporary (if awkward) workarounds in the use of &lt;fieldset&gt; or in the use of utility functions that crawl the tree marking elements as disabled, and since the use case isn&apos;t a huge use case, and since the proposed solutions have real problems and I don&apos;t have a better proposal at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54030</commentid>
    <comment_count>11</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:35:29 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82050</commentid>
    <comment_count>12</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-01-24 07:20:35 +0000</bug_when>
    <thetext>This bug was cloned to create HTML WG bug 19035.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84648</commentid>
    <comment_count>13</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-19 17:50:36 +0000</bug_when>
    <thetext>My guess is that this will end up WONTFIX, since it&apos;s easy enough to work around with a one-time utility function, and the use case is reasonably rare. But I&apos;ll look at this with the other forms-related feature requests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84649</commentid>
    <comment_count>14</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-19 17:50:59 +0000</bug_when>
    <thetext>(Of course if there&apos;s browser vendor interest in doing this, let me know.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94125</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-01 22:59:01 +0000</bug_when>
    <thetext>I&apos;m punting this pending browser interest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112308</commentid>
    <comment_count>16</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-26 21:06:19 +0000</bug_when>
    <thetext>Closing due to lack of vendor interest. It&apos;s easy to write a function to do this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>