<?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>154342</bug_id>
          
          <creation_ts>2016-02-17 10:40:14 -0800</creation_ts>
          <short_desc>Textarea does not count newlines properly against maxlength</short_desc>
          <delta_ts>2023-08-29 00:44:51 -0700</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>Mac</rep_platform>
          <op_sys>OS X 10.10</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>249916</dup_id>
          
          <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 name="Aaron Nance">aaron.nance</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>hi+webkit</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1165625</commentid>
    <comment_count>0</comment_count>
    <who name="Aaron Nance">aaron.nance</who>
    <bug_when>2016-02-17 10:40:14 -0800</bug_when>
    <thetext>Hard carriage returns are being counted as 2 characters against the maxlength attribute. For example, if you have a textarea with a maxlength=&quot;20&quot; and type &quot;0123&quot; and press enter, copy all, and paste as much as you can you&apos;d expect the field to contain:

0123(newline)
0123(newline)
0123(newline)
0123(newline)

But what you get is 

0123(newline)
0123(newline)
0123(newline)
01

I&apos;ve added the (newline) to clarify the newline characters. 

Each newline is being treated as a CR+LF instead of just a LF in the DOM.

This seems to be the same as ID 74686, which is marked as fixed, but still appears to be broken.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1785009</commentid>
    <comment_count>1</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-08-17 17:58:44 -0700</bug_when>
    <thetext>this recently came up in https://github.com/mdn/browser-compat-data/issues/11988

re bug 74686, as the last comment there shows, the spec here changed in 2016: https://github.com/whatwg/html/commit/163703186794c21daa92cc2718218afa44f26071

(no WPT tests for this, far as I can tell)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1974155</commentid>
    <comment_count>2</comment_count>
    <who name="mxdvl">hi+webkit</who>
    <bug_when>2023-08-29 00:24:20 -0700</bug_when>
    <thetext>This may be a duplicate of https://bugs.webkit.org/show_bug.cgi?id=249916 and may have been fixed by https://github.com/WebKit/WebKit/commit/2252898e2468994720be25176170e00bc7b26ca3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1974158</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-08-29 00:44:51 -0700</bug_when>
    <thetext>This is indeed addressed by the bug 249916.

*** This bug has been marked as a duplicate of bug 249916 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>