Changeset 96290 in webkit


Ignore:
Timestamp:
Sep 28, 2011 7:49:45 PM (13 years ago)
Author:
tkent@chromium.org
Message:

REGRESSION(r93858): Can't type anything into input elements when maxlength is greater than 231
https://bugs.webkit.org/show_bug.cgi?id=68981

Reviewed by Darin Adler.

Source/WebCore:

  • html/parser/HTMLParserIdioms.cpp:

(WebCore::parseHTMLInteger):
Check the failure of charactersToIntStrict().
(WebCore::parseHTMLNonNegativeInteger):
Check the failure of charactersToUIntStrict().

LayoutTests:

  • fast/forms/input-text-paste-maxlength-expected.txt:
  • fast/forms/input-text-paste-maxlength.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96285 r96290  
     12011-09-28  Kent Tamura  <tkent@chromium.org>
     2
     3        REGRESSION(r93858): Can't type anything into input elements when maxlength is greater than 2^31
     4        https://bugs.webkit.org/show_bug.cgi?id=68981
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/forms/input-text-paste-maxlength-expected.txt:
     9        * fast/forms/input-text-paste-maxlength.html:
     10
    1112011-09-28  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt

    r93858 r96290  
    3535PASS domValueOf('n') is '12' + fancyX + '45'
    3636PASS visibleValueOf('n') is '12' + fancyX + '45'
     37PASS domValueOf('huge') is '12' + fancyX + '45'
     38PASS visibleValueOf('huge') is '12' + fancyX + '45'
    3739PASS successfullyParsed is true
    3840
    3941TEST COMPLETE
    40            
     42
  • trunk/LayoutTests/fast/forms/input-text-paste-maxlength.html

    r93858 r96290  
    99<div id="console"></div>
    1010
     11<div id=container>
    1112<input type="text" id="f" size="5" maxlength="4">
    1213<input type="text" id="e" size="5" maxlength="4">
     
    2122<input type="text" id="m" size="5" maxlength="">
    2223<input type="text" id="n" size="5" maxlength="invalid">
     24<input type="text" id="huge" size="5" maxlength="9999999999">
     25</div>
    2326
    2427<script>
     
    114117shouldBe("domValueOf('n')", "'12' + fancyX + '45'");
    115118shouldBe("visibleValueOf('n')", "'12' + fancyX + '45'");
     119document.getElementById("huge").focus();
     120document.execCommand("InsertHTML", false, "12x&#x305;&#x332;45");
     121shouldBe("domValueOf('huge')", "'12' + fancyX + '45'");
     122shouldBe("visibleValueOf('huge')", "'12' + fancyX + '45'");
    116123
     124document.getElementById('container').innerHTML = '';
    117125var successfullyParsed = true;
    118126</script>
  • trunk/Source/WebCore/ChangeLog

    r96283 r96290  
     12011-09-28  Kent Tamura  <tkent@chromium.org>
     2
     3        REGRESSION(r93858): Can't type anything into input elements when maxlength is greater than 2^31
     4        https://bugs.webkit.org/show_bug.cgi?id=68981
     5
     6        Reviewed by Darin Adler.
     7
     8        * html/parser/HTMLParserIdioms.cpp:
     9        (WebCore::parseHTMLInteger):
     10        Check the failure of charactersToIntStrict().
     11        (WebCore::parseHTMLNonNegativeInteger):
     12        Check the failure of charactersToUIntStrict().
     13
    1142011-09-28  Antoine Labour  <piman@chromium.org>
    215
  • trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp

    r94640 r96290  
    216216
    217217    // Step 9
    218     value = sign * charactersToIntStrict(digits.characters(), digits.length());
    219     return true;
     218    bool ok;
     219    value = sign * charactersToIntStrict(digits.characters(), digits.length(), &ok);
     220    return ok;
    220221}
    221222
     
    262263
    263264    // Step 9
    264     value = charactersToUIntStrict(digits.characters(), digits.length());
    265     return true;
    266 }
    267 
    268 }
     265    bool ok;
     266    value = charactersToUIntStrict(digits.characters(), digits.length(), &ok);
     267    return ok;
     268}
     269
     270}
Note: See TracChangeset for help on using the changeset viewer.