Diff
Modified: branches/safari-537.78-branch/LayoutTests/ChangeLog (171268 => 171269)
--- branches/safari-537.78-branch/LayoutTests/ChangeLog 2014-07-19 22:56:54 UTC (rev 171268)
+++ branches/safari-537.78-branch/LayoutTests/ChangeLog 2014-07-19 23:00:00 UTC (rev 171269)
@@ -1,5 +1,21 @@
2014-07-19 Lucas Forschler <[email protected]>
+ Merge r169849
+
+ 2014-06-11 David Kilzer <[email protected]>
+
+ WindowFeatures arguments shoud ignore invalid characters in values
+ <http://webkit.org/b/133703>
+ <rdar://problem/17254118>
+
+ Reviewed by Andy Estes.
+
+ * fast/dom/Window/resources/window-property-invalid-characters-ignored.html: Added.
+ * fast/dom/Window/window-property-invalid-characters-ignored-expected.txt: Added.
+ * fast/dom/Window/window-property-invalid-characters-ignored.html: Added.
+
+2014-07-19 Lucas Forschler <[email protected]>
+
Merge r169848
2014-06-11 David Kilzer <[email protected]>
Copied: branches/safari-537.78-branch/LayoutTests/fast/dom/Window/resources/window-property-invalid-characters-ignored.html (from rev 169849, trunk/LayoutTests/fast/dom/Window/resources/window-property-invalid-characters-ignored.html) (0 => 171269)
--- branches/safari-537.78-branch/LayoutTests/fast/dom/Window/resources/window-property-invalid-characters-ignored.html (rev 0)
+++ branches/safari-537.78-branch/LayoutTests/fast/dom/Window/resources/window-property-invalid-characters-ignored.html 2014-07-19 23:00:00 UTC (rev 171269)
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<html><head></head><body _onload_="setTimeout('window.opener.finishTest()', 0)"></body></html>
Copied: branches/safari-537.78-branch/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored-expected.txt (from rev 169849, trunk/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored-expected.txt) (0 => 171269)
--- branches/safari-537.78-branch/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored-expected.txt (rev 0)
+++ branches/safari-537.78-branch/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored-expected.txt 2014-07-19 23:00:00 UTC (rev 171269)
@@ -0,0 +1,12 @@
+Tests that invalid characters are ignored after a window property value.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS w.document.width is 123
+PASS w.document.height is 123
+PASS w !== window is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: branches/safari-537.78-branch/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored.html (from rev 169849, trunk/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored.html) (0 => 171269)
--- branches/safari-537.78-branch/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored.html (rev 0)
+++ branches/safari-537.78-branch/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored.html 2014-07-19 23:00:00 UTC (rev 171269)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+jsTestIsAsync = true;
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.setCanOpenWindows();
+}
+
+description("Tests that invalid characters are ignored after a window property value.");
+
+var w = window.open("resources/window-property-invalid-characters-ignored.html", "blank", "width=123\u0130,height=123\u0130");
+
+function finishTest()
+{
+ shouldBe("w.document.width", "123");
+ shouldBe("w.document.height", "123");
+ shouldBeTrue("w !== window");
+ w.close();
+
+ finishJSTest();
+}
+
+successfullyParsed = true;
+</script>
+<script src=""
+</head>
+<body>
+<pre id="console"></pre>
+</body>
+</html>
Modified: branches/safari-537.78-branch/Source/WebCore/ChangeLog (171268 => 171269)
--- branches/safari-537.78-branch/Source/WebCore/ChangeLog 2014-07-19 22:56:54 UTC (rev 171268)
+++ branches/safari-537.78-branch/Source/WebCore/ChangeLog 2014-07-19 23:00:00 UTC (rev 171269)
@@ -1,5 +1,25 @@
2014-07-19 Lucas Forschler <[email protected]>
+ Merge r169849
+
+ 2014-06-11 David Kilzer <[email protected]>
+
+ WindowFeatures arguments shoud ignore invalid characters in values
+ <http://webkit.org/b/133703>
+ <rdar://problem/17254118>
+
+ Reviewed by Andy Estes.
+
+ Test: fast/dom/Window/window-property-invalid-characters-ignored.html
+
+ * page/WindowFeatures.cpp:
+ (WebCore::WindowFeatures::WindowFeatures): Set |length| based on
+ |buffer|, not |features|. Switch to using a for loop. Switch
+ to unsigned types since we are working with positive offsets
+ into a String.
+
+2014-07-19 Lucas Forschler <[email protected]>
+
Merge r169848
2014-06-11 David Kilzer <[email protected]>
Modified: branches/safari-537.78-branch/Source/WebCore/page/WindowFeatures.cpp (171268 => 171269)
--- branches/safari-537.78-branch/Source/WebCore/page/WindowFeatures.cpp 2014-07-19 22:56:54 UTC (rev 171268)
+++ branches/safari-537.78-branch/Source/WebCore/page/WindowFeatures.cpp 2014-07-19 23:00:00 UTC (rev 171269)
@@ -71,13 +71,12 @@
resizable = true;
// Tread lightly in this code -- it was specifically designed to mimic Win IE's parsing behavior.
- int keyBegin, keyEnd;
- int valueBegin, valueEnd;
+ unsigned keyBegin, keyEnd;
+ unsigned valueBegin, valueEnd;
- int i = 0;
- int length = features.length();
String buffer = features.lower();
- while (i < length) {
+ unsigned length = buffer.length();
+ for (unsigned i = 0; i < length; ) {
// skip to first non-separator, but don't skip past the end of the string
while (isWindowFeaturesSeparator(buffer[i])) {
if (i >= length)