<?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>252900</bug_id>
          
          <creation_ts>2023-02-24 06:41:55 -0800</creation_ts>
          <short_desc>HTML maxlength attribute treats emoji of string length 11 as length 1</short_desc>
          <delta_ts>2023-02-27 23:51:37 -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>Safari 16</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>macOS 13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/38708</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Šime Vidas">sime.vidas</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>ap</cc>
    
    <cc>bramus</cc>
    
    <cc>cdumez</cc>
    
    <cc>darin</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>rniwa</cc>
    
    <cc>tahakhan.studio</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1936508</commentid>
    <comment_count>0</comment_count>
      <attachid>465151</attachid>
    <who name="Šime Vidas">sime.vidas</who>
    <bug_when>2023-02-24 06:41:55 -0800</bug_when>
    <thetext>Created attachment 465151
Test page

Steps to reproduce:

1. Open attached test page in Safari
2. Copy the rendered family emoji and paste it into the &lt;input maxlength=10&gt; field

What happened:

The emoji fully appears inside the input. You will be able to paste the emoji up to 10 times.

What should have happened:

The emoji should have been altered. In Chrome and Firefox, one of the children in the depicted family disappears. The full emoji has a string size of 11, so it shouldn’t fully fit into an &lt;input&gt; with a  maxlength of 10. 

It seems that Safari’s maxlength implementation treats all emoji as length 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1936509</commentid>
    <comment_count>1</comment_count>
      <attachid>465151</attachid>
    <who name="Šime Vidas">sime.vidas</who>
    <bug_when>2023-02-24 06:43:04 -0800</bug_when>
    <thetext>Comment on attachment 465151
Test page

&gt;&lt;!DOCTYPE html&gt;
&gt;
&gt;&lt;html&gt;
&gt;  &lt;head&gt;
&gt;    &lt;meta charset=&quot;utf-8&quot; /&gt;
&gt;    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot; /&gt;
&gt;    &lt;title&gt;emoji input maxlength test&lt;/title&gt;
&gt;    &lt;style&gt;
&gt;      * {
&gt;        font-size: 2rem;
&gt;        margin: 0.1em;
&gt;      }
&gt;    &lt;/style&gt;
&gt;  &lt;/head&gt;
&gt;  &lt;body&gt;
&gt;    &lt;p&gt;👨‍👩‍👧‍👦&lt;/p&gt;
&gt;    &lt;input maxlength=&quot;10&quot; /&gt;
&gt;  &lt;/body&gt;
&gt;&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1936619</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-02-24 12:46:49 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/10662</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1936742</commentid>
    <comment_count>3</comment_count>
    <who name="Lili Swan">tahakhan.studio</who>
    <bug_when>2023-02-25 03:54:13 -0800</bug_when>
    <thetext>This issue i am also having in safari but as far as now the issue is fixed and tested on https://yt2mp3.id/es/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1936775</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-02-25 10:13:42 -0800</bug_when>
    <thetext>Committed 260838@main (9743d10df7bc): &lt;https://commits.webkit.org/260838@main&gt;

Reviewed commits have been landed. Closing PR #10662 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1936776</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-02-25 10:14:19 -0800</bug_when>
    <thetext>&lt;rdar://problem/105926915&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1937172</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-02-27 13:23:31 -0800</bug_when>
    <thetext>The behavior that we chose was very intentional, and I don&apos;t see how it &quot;makes Web developers&apos; life more difficult than it needs to be.&quot;

The decision was made in bug 120030, and I don&apos;t see anything to have changed that would make us change our opinion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1937174</commentid>
    <comment_count>7</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-02-27 13:28:00 -0800</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #6)
&gt; The behavior that we chose was very intentional, and I don&apos;t see how it
&gt; &quot;makes Web developers&apos; life more difficult than it needs to be.&quot;
&gt; 
&gt; The decision was made in bug 120030, and I don&apos;t see anything to have
&gt; changed that would make us change our opinion.

Willfully ignoring the specification and not other aligning with every other major browser is harmful to the Web. This is a serious interoperability issue which has been reported several times over the years.

This was also discussed as a spec issue and they decided to keep the spec as is after discussing with other browser vendors, despite our feedback.

The ship for others to align with us here has sailed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1937307</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-02-27 23:51:37 -0800</bug_when>
    <thetext>While our choice may have been intentional for this ill-conceived feature, the reality of the situation is that other browser vendors are unwilling to change their behaviors, and we keep getting bug reports about this behavior difference. Given we can&apos;t rid of maxlength, the path of the least resistance is for WebKit to match other browsers.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>465151</attachid>
            <date>2023-02-24 06:41:55 -0800</date>
            <delta_ts>2023-02-24 06:41:55 -0800</delta_ts>
            <desc>Test page</desc>
            <filename>test-page.html</filename>
            <type>text/html</type>
            <size>360</size>
            <attacher name="Šime Vidas">sime.vidas</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+Cgo8aHRtbD4KICA8aGVhZD4KICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04
IiAvPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0
aCIgLz4KICAgIDx0aXRsZT5lbW9qaSBpbnB1dCBtYXhsZW5ndGggdGVzdDwvdGl0bGU+CiAgICA8
c3R5bGU+CiAgICAgICogewogICAgICAgIGZvbnQtc2l6ZTogMnJlbTsKICAgICAgICBtYXJnaW46
IDAuMWVtOwogICAgICB9CiAgICA8L3N0eWxlPgogIDwvaGVhZD4KICA8Ym9keT4KICAgIDxwPvCf
kajigI3wn5Gp4oCN8J+Rp+KAjfCfkaY8L3A+CiAgICA8aW5wdXQgbWF4bGVuZ3RoPSIxMCIgLz4K
ICA8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>