Diff
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog 2020-02-26 10:57:34 UTC (rev 257448)
@@ -1,3 +1,19 @@
+2020-02-21 Carlos Alberto Lopez Perez <[email protected]>
+
+ Value sanitization for input[type=text] should not truncate a value at a control character
+ https://bugs.webkit.org/show_bug.cgi?id=207900
+
+ Reviewed by Darin Adler.
+
+ Update layout tests to reflect the new behaviour.
+
+ * fast/forms/input-value-sanitization-expected.txt:
+ * fast/forms/input-value-sanitization.html:
+ * fast/forms/paste-multiline-text-input.html:
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:
+ * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:
+ * platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:
+
2020-02-21 Jack Lee <[email protected]>
Nullptr crash in RenderStyle::isFlippedBlocksWritingMode when fragment flow gains a new in-flow descendant
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/input-value-sanitization-expected.txt (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/input-value-sanitization-expected.txt 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/input-value-sanitization-expected.txt 2020-02-26 10:57:34 UTC (rev 257448)
@@ -17,6 +17,11 @@
Text:
PASS input.value is " foo bar "
PASS document.getSelection().toString() is " foo bar "
+PASS input.value is "foo\u0000bar"
+PASS input.value is "foo\bbar"
+PASS input.value is "foo\tbar"
+PASS input.value is "foo\u000bbar"
+PASS input.value is "foo\fbar"
PASS successfullyParsed is true
TEST COMPLETE
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/input-value-sanitization.html (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/input-value-sanitization.html 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/input-value-sanitization.html 2020-02-26 10:57:34 UTC (rev 257448)
@@ -52,6 +52,21 @@
document.execCommand('SelectAll');
shouldBe('document.getSelection().toString()', '" foo bar "');
+input.value = 'foo\0bar';
+shouldBeEqualToString('input.value', 'foo\0bar');
+
+input.value = 'foo\bbar';
+shouldBeEqualToString('input.value', "foo\bbar");
+
+input.value = 'foo\tbar';
+shouldBeEqualToString('input.value', "foo\tbar");
+
+input.value = "foo\vbar";
+shouldBeEqualToString('input.value', "foo\vbar");
+
+input.value = "foo\fbar";
+shouldBeEqualToString('input.value', "foo\fbar");
+
// FIXME: Add more sanitization tests.
// https://bugs.webkit.org/show_bug.cgi?id=37024
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/paste-multiline-text-input.html (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/paste-multiline-text-input.html 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/fast/forms/paste-multiline-text-input.html 2020-02-26 10:57:34 UTC (rev 257448)
@@ -12,10 +12,8 @@
var DEFAULT_LINE_1 = "line\t(1 of 2)\r\nline\t(2 of 2)";
var EXPECTED_LINE_1 = "line\t(1 of 2) line\t(2 of 2)";
- // FIXME: Is this really expected behavior to truncate the string at a null byte?
- // It doesn't match Firefox 4 and common sense.
var DEFAULT_LINE_2 = "null\0char";
- var EXPECTED_LINE_2 = "null";
+ var EXPECTED_LINE_2 = "null\0char";
var DEFAULT_LINE_3 = "line with trailing newlines\r\n\r\n";
var EXPECTED_LINE_3 = "line with trailing newlines";
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/imported/w3c/ChangeLog (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/imported/w3c/ChangeLog 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/imported/w3c/ChangeLog 2020-02-26 10:57:34 UTC (rev 257448)
@@ -1,3 +1,31 @@
+2020-02-21 Carlos Alberto Lopez Perez <[email protected]>
+
+ Value sanitization for input[type=text] should not truncate a value at a control character
+ https://bugs.webkit.org/show_bug.cgi?id=207900
+
+ Reviewed by Darin Adler.
+
+ Rebaseline the tests. Below its a summary of the number of FAIL and PASS lines changed for each test:
+
+ * web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-csiso2022jp-expected.txt:
+ FAIL from 7312 to 374
+ PASS from 17 to 6955
+ * web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-errors-han-expected.txt:
+ FAIL from 21216 to 477
+ PASS from 53 to 20792
+ * web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-errors-hangul-expected.txt:
+ FAIL from 11155 to 0
+ PASS from 28 to 11183
+ * web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-errors-misc-expected.txt:
+ FAIL from 3422 to 46
+ PASS from 9 to 3385
+ * web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-expected.txt:
+ FAIL from 7375 to 374
+ PASS from 17 to 7018
+ * web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:
+ FAIL from 20 to 10
+ PASS from 22 to 32
+
2020-02-14 Antoine Quint <[email protected]>
[Web Animations] Style changes due to Web Animations should not trigger CSS Transitions
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt 2020-02-26 10:57:34 UTC (rev 257448)
@@ -13,28 +13,28 @@
PASS value IDL attribute of input type checkbox with value attribute
PASS value IDL attribute of input type radio without value attribute
PASS value IDL attribute of input type radio with value attribute
-FAIL value IDL attribute of input type text without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type text with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type search without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type search with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type tel without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type tel with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type url without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type url with value attribute assert_equals: expected "foo\0" but got "foo"
+PASS value IDL attribute of input type text without value attribute
+PASS value IDL attribute of input type text with value attribute
+PASS value IDL attribute of input type search without value attribute
+PASS value IDL attribute of input type search with value attribute
+PASS value IDL attribute of input type tel without value attribute
+PASS value IDL attribute of input type tel with value attribute
+PASS value IDL attribute of input type url without value attribute
+PASS value IDL attribute of input type url with value attribute
PASS value IDL attribute of input type email without value attribute
PASS value IDL attribute of input type email with value attribute
-FAIL value IDL attribute of input type password without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type password with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type datetime-local without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type datetime-local with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type date without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type date with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type month without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type month with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type week without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type week with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type time without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type time with value attribute assert_equals: expected "" but got "foo"
+PASS value IDL attribute of input type password without value attribute
+PASS value IDL attribute of input type password with value attribute
+FAIL value IDL attribute of input type datetime-local without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type datetime-local with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type date without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type date with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type month without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type month with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type week without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type week with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type time without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type time with value attribute assert_equals: expected "" but got "foo\0"
PASS value IDL attribute of input type number without value attribute
PASS value IDL attribute of input type number with value attribute
PASS value IDL attribute of input type range without value attribute
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt 2020-02-26 10:57:34 UTC (rev 257448)
@@ -13,18 +13,18 @@
PASS value IDL attribute of input type checkbox with value attribute
PASS value IDL attribute of input type radio without value attribute
PASS value IDL attribute of input type radio with value attribute
-FAIL value IDL attribute of input type text without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type text with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type search without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type search with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type tel without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type tel with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type url without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type url with value attribute assert_equals: expected "foo\0" but got "foo"
+PASS value IDL attribute of input type text without value attribute
+PASS value IDL attribute of input type text with value attribute
+PASS value IDL attribute of input type search without value attribute
+PASS value IDL attribute of input type search with value attribute
+PASS value IDL attribute of input type tel without value attribute
+PASS value IDL attribute of input type tel with value attribute
+PASS value IDL attribute of input type url without value attribute
+PASS value IDL attribute of input type url with value attribute
PASS value IDL attribute of input type email without value attribute
PASS value IDL attribute of input type email with value attribute
-FAIL value IDL attribute of input type password without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type password with value attribute assert_equals: expected "foo\0" but got "foo"
+PASS value IDL attribute of input type password without value attribute
+PASS value IDL attribute of input type password with value attribute
PASS value IDL attribute of input type datetime-local without value attribute
PASS value IDL attribute of input type datetime-local with value attribute
PASS value IDL attribute of input type date without value attribute
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt 2020-02-26 10:57:34 UTC (rev 257448)
@@ -13,32 +13,32 @@
PASS value IDL attribute of input type checkbox with value attribute
PASS value IDL attribute of input type radio without value attribute
PASS value IDL attribute of input type radio with value attribute
-FAIL value IDL attribute of input type text without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type text with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type search without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type search with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type tel without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type tel with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type url without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type url with value attribute assert_equals: expected "foo\0" but got "foo"
+PASS value IDL attribute of input type text without value attribute
+PASS value IDL attribute of input type text with value attribute
+PASS value IDL attribute of input type search without value attribute
+PASS value IDL attribute of input type search with value attribute
+PASS value IDL attribute of input type tel without value attribute
+PASS value IDL attribute of input type tel with value attribute
+PASS value IDL attribute of input type url without value attribute
+PASS value IDL attribute of input type url with value attribute
PASS value IDL attribute of input type email without value attribute
PASS value IDL attribute of input type email with value attribute
-FAIL value IDL attribute of input type password without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type password with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type datetime-local without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type datetime-local with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type date without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type date with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type month without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type month with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type week without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type week with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type time without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type time with value attribute assert_equals: expected "" but got "foo"
+PASS value IDL attribute of input type password without value attribute
+PASS value IDL attribute of input type password with value attribute
+FAIL value IDL attribute of input type datetime-local without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type datetime-local with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type date without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type date with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type month without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type month with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type week without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type week with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type time without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type time with value attribute assert_equals: expected "" but got "foo\0"
PASS value IDL attribute of input type number without value attribute
PASS value IDL attribute of input type number with value attribute
PASS value IDL attribute of input type range without value attribute
PASS value IDL attribute of input type range with value attribute
-FAIL value IDL attribute of input type color without value attribute assert_equals: expected "#000000" but got "foo"
-FAIL value IDL attribute of input type color with value attribute assert_equals: expected "#000000" but got "foo"
+FAIL value IDL attribute of input type color without value attribute assert_equals: expected "#000000" but got "foo\0"
+FAIL value IDL attribute of input type color with value attribute assert_equals: expected "#000000" but got "foo\0"
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt 2020-02-26 10:57:34 UTC (rev 257448)
@@ -13,28 +13,28 @@
PASS value IDL attribute of input type checkbox with value attribute
PASS value IDL attribute of input type radio without value attribute
PASS value IDL attribute of input type radio with value attribute
-FAIL value IDL attribute of input type text without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type text with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type search without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type search with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type tel without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type tel with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type url without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type url with value attribute assert_equals: expected "foo\0" but got "foo"
+PASS value IDL attribute of input type text without value attribute
+PASS value IDL attribute of input type text with value attribute
+PASS value IDL attribute of input type search without value attribute
+PASS value IDL attribute of input type search with value attribute
+PASS value IDL attribute of input type tel without value attribute
+PASS value IDL attribute of input type tel with value attribute
+PASS value IDL attribute of input type url without value attribute
+PASS value IDL attribute of input type url with value attribute
PASS value IDL attribute of input type email without value attribute
PASS value IDL attribute of input type email with value attribute
-FAIL value IDL attribute of input type password without value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type password with value attribute assert_equals: expected "foo\0" but got "foo"
-FAIL value IDL attribute of input type datetime-local without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type datetime-local with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type date without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type date with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type month without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type month with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type week without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type week with value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type time without value attribute assert_equals: expected "" but got "foo"
-FAIL value IDL attribute of input type time with value attribute assert_equals: expected "" but got "foo"
+PASS value IDL attribute of input type password without value attribute
+PASS value IDL attribute of input type password with value attribute
+FAIL value IDL attribute of input type datetime-local without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type datetime-local with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type date without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type date with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type month without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type month with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type week without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type week with value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type time without value attribute assert_equals: expected "" but got "foo\0"
+FAIL value IDL attribute of input type time with value attribute assert_equals: expected "" but got "foo\0"
PASS value IDL attribute of input type number without value attribute
PASS value IDL attribute of input type number with value attribute
PASS value IDL attribute of input type range without value attribute
Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog 2020-02-26 10:57:34 UTC (rev 257448)
@@ -1,3 +1,19 @@
+2020-02-21 Carlos Alberto Lopez Perez <[email protected]>
+
+ Value sanitization for input[type=text] should not truncate a value at a control character
+ https://bugs.webkit.org/show_bug.cgi?id=207900
+
+ Reviewed by Darin Adler.
+
+ Stop truncating value at a control character. The new behavior is compatible with Chrome and Firefox.
+ Inspired on Chromium patch https://codereview.chromium.org/189843008
+
+ Covered by existing tests: affected layout tests are modified to reflect the new behaviour.
+ This improves WPT pass-rate in around 49K new subtest passes for Japanesse encoding tests.
+
+ * html/TextFieldInputType.cpp:
+ (WebCore::limitLength):
+
2020-02-21 Jack Lee <[email protected]>
Nullptr crash in RenderStyle::isFlippedBlocksWritingMode when fragment flow gains a new in-flow descendant
Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/html/TextFieldInputType.cpp (257447 => 257448)
--- releases/WebKitGTK/webkit-2.28/Source/WebCore/html/TextFieldInputType.cpp 2020-02-26 10:57:20 UTC (rev 257447)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/html/TextFieldInputType.cpp 2020-02-26 10:57:34 UTC (rev 257448)
@@ -463,23 +463,14 @@
}
#endif
-// FIXME: The name of this function doesn't make clear the two jobs it does:
-// 1) Limits the string to a particular number of grapheme clusters.
-// 2) Truncates the string at the first character which is a control character other than tab.
-// FIXME: TextFieldInputType::sanitizeValue doesn't need a limit on grapheme clusters. A limit on code units would do.
-// FIXME: Where does the "truncate at first control character" rule come from?
static String limitLength(const String& string, unsigned maxNumGraphemeClusters)
{
StringView stringView { string };
- unsigned firstNonTabControlCharacterIndex = stringView.find([] (UChar character) {
- return character < ' ' && character != '\t';
- });
- unsigned limitedLength;
- if (stringView.is8Bit())
- limitedLength = std::min(firstNonTabControlCharacterIndex, maxNumGraphemeClusters);
- else
- limitedLength = numCodeUnitsInGraphemeClusters(stringView.substring(0, firstNonTabControlCharacterIndex), maxNumGraphemeClusters);
- return string.left(limitedLength);
+
+ if (!stringView.is8Bit())
+ maxNumGraphemeClusters = numCodeUnitsInGraphemeClusters(stringView, maxNumGraphemeClusters);
+
+ return string.left(maxNumGraphemeClusters);
}
static String autoFillButtonTypeToAccessibilityLabel(AutoFillButtonType autoFillButtonType)