<?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>26703</bug_id>
          
          <creation_ts>2014-09-01 18:28:23 +0000</creation_ts>
          <short_desc>In case an algorithm applies conditionally, the conditions should be defined in some kind precondition step</short_desc>
          <delta_ts>2016-03-16 18:00:55 +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>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>blocked awaiting response from smaug to comment 1 (please remove this when replying)	</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Olli Pettay">bugs</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>110826</commentid>
    <comment_count>0</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-09-01 18:28:23 +0000</bug_when>
    <thetext>As an example, when one follows 
http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#processing-model-4
it gives no clues that the algorithm might not apply to some input element types.

In order to know that, one needs to look at the specific type, for example
http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#hidden-state-%28type=hidden%29
and see that &apos;autocomplete&apos; is listed as  &apos;do not apply&apos;.
Then one needs to find the definition for that 
http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#do-not-apply and from there to actually understand what
the whole thing means, 
http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#common-input-element-attributes

To get better readability, I suggest having a precondition step in each algorithm which applies conditionally.
So, before &quot;1. If the element has no autocomplete attribute, then jump to the step labeled default.&quot;
there would be something like
Precondition: abort this algorithm immediately if the following preconditions don&apos;t hold:
              &apos;autocomplete&apos; attribute &lt;a href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#common-input-element-attributes&quot;&gt;applies to&lt;/a&gt; the element

Precondition should be used consistently, so that whenever it isn&apos;t there, reader would know that there are no preconditions.

I can see how the current spec is easier for the spec author, but it certainly is rather hard for follow for the reader.
And as with code, specs should favor readers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111755</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-18 17:31:50 +0000</bug_when>
    <thetext>The specific section cited here now starts with an explicit statement that it&apos;s only for &lt;input type&gt;s that apply.

Are there any other cases that are confusing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125542</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-16 18:00:55 +0000</bug_when>
    <thetext>Olli, if you still find something confusing, please reopen or file an issue on GitHub. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>