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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>289197</bug_id>
          
          <creation_ts>2025-03-05 15:04:05 -0800</creation_ts>
          <short_desc>Supporting HTMLInputElement&apos;s autocorrect attribute causes issues for Vue.js</short_desc>
          <delta_ts>2025-03-05 18:04:49 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>r.goyet</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>akeerthi</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>karlcow</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2100758</commentid>
    <comment_count>0</comment_count>
    <who name="">r.goyet</who>
    <bug_when>2025-03-05 15:04:05 -0800</bug_when>
    <thetext>In WebKit, the following snippet returns false. In Chrome and Firefox it returns true.

&quot;autocorrect&quot; in document.createElement(&quot;input&quot;)

I don&apos;t know what browser&apos;s right (nor that it&apos;s even in the spec), but this does create compatibility problems.

See this page to see how it impacts Vue.js apps:

https://tinyurl.com/4n2ksv2b

If you inspect the generated &lt;input&gt; element in the right panel, you&apos;ll see it will have an autocorrect attribute set to &quot;off&quot; as desired on Chrome and Firefox. But on Safari, it yields a autocorrect=&quot;on&quot; value, because of the aforementioned difference.

See also:
https://bugs.webkit.org/show_bug.cgi?id=239383
https://github.com/vuejs/core/issues/5705</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100761</commentid>
    <comment_count>1</comment_count>
    <who name="">r.goyet</who>
    <bug_when>2025-03-05 15:25:09 -0800</bug_when>
    <thetext>I would argue that WebKit is being inconsistent here and should be patched. Indeed, on Firefox and Chrome we have the following:

&quot;autocomplete&quot; in document.createElement(&quot;input&quot;) == true
&quot;autocorrect&quot; in document.createElement(&quot;input&quot;) == false

Since these two tests give a different outcome, it makes sense to use a different approach to set the corresponding attributes:

const a = document.createElement(&quot;input&quot;);a[&quot;autocomplete&quot;]=&quot;foobar&quot;;a.outerHTML == &apos;&lt;input autocomplete=&quot;foobar&quot;&gt;&apos;
const b = document.createElement(&quot;input&quot;);b.setAttribute(&quot;autocorrect&quot;, &quot;foobar&quot;);b.outerHTML == &apos;&lt;input autocorrect=&quot;foobar&quot;&gt;&apos;

However, on Safari, we have

&quot;autocomplete&quot; in document.createElement(&quot;input&quot;) == true
&quot;autocorrect&quot; in document.createElement(&quot;input&quot;) == true

Since these tests give the same outcome, it makes sense to always use the [] operator to set the attribute. However

const a = document.createElement(&quot;input&quot;);a[&quot;autocomplete&quot;]=&quot;foobar&quot;;a.outerHTML == &apos;&lt;input autocomplete=&quot;foobar&quot;&gt;&apos;

but

const c = document.createElement(&quot;input&quot;);c[&quot;autocorrect&quot;]=&quot;foobar&quot;;c.outerHTML

will yield

&apos;&lt;input autocorrect=&quot;on&quot;&gt;&apos;

instead of the expected

&apos;&lt;input autocorrect=&quot;foobar&quot;&gt;&apos;

 == &apos;&lt;input autocomplete=&quot;foobar&quot;&gt;&apos;



and 

&gt; const c = document.createElement(&quot;input&quot;);c[&quot;autocomplete&quot;]=&quot;dzpeodz&quot;;c
&lt; &lt;input autocomplete=&quot;dzpeodz&quot;&gt;
&gt; const d = document.createElement(&quot;input&quot;);d[&quot;autocorrect&quot;]=&quot;dzpeodz&quot;;d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100791</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2025-03-05 16:38:53 -0800</bug_when>
    <thetext>The autocorrect attribute is in the standard, and Firefox has added support for it yesterday (in version 136). So Chrome is just behind on HTML spec support.

The behavior inconsistencies that you note stem from lack of support for this attribute in Chrome and in old Firefox. Because it&apos;s not supported, it&apos;s just treated as an expando.

It&apos;s quite unfortunate that there is an actual incompatibility with Vue.js for us here, but seems like updating the framework is the path forward. I&apos;ll ping some other folks for thoughts though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100802</commentid>
    <comment_count>3</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2025-03-05 17:01:36 -0800</bug_when>
    <thetext>WebKit matches the standard (https://html.spec.whatwg.org/multipage/interaction.html#dom-autocorrect). It is specified as an enumerated attribute with only two states.

If you try your examples again in Firefox 136, you will get matching behavior to Safari.

I suspect Chrome will soon match this behavior, too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100833</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2025-03-05 18:04:49 -0800</bug_when>
    <thetext>https://wpt.fyi/results/html/editing/editing-0/autocorrection/autocorrection.html?label=master&amp;label=experimental&amp;aligned&amp;q=autocorrect</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100836</commentid>
    <comment_count>5</comment_count>
    <who name="">r.goyet</who>
    <bug_when>2025-03-05 18:19:47 -0800</bug_when>
    <thetext>Wow, thanks for the super quick answer guys! Feel free to close this bug report then!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100837</commentid>
    <comment_count>6</comment_count>
    <who name="">r.goyet</who>
    <bug_when>2025-03-05 18:20:52 -0800</bug_when>
    <thetext>Thanks for the super quick and insightful feedback!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>