Title: [220252] trunk
Revision
220252
Author
[email protected]
Date
2017-08-03 21:37:10 -0700 (Thu, 03 Aug 2017)

Log Message

Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
https://bugs.webkit.org/show_bug.cgi?id=175132

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Re-sync WPT tests from upstream c8bf1bbe9296. This extends test coverage.

* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents-expected.txt: Removed.
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html:
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document-expected.txt: Added.
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents.html.
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html: Added.
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/w3c-import.log:
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/w3c-import.log:

Source/WebCore:

Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.', without
a leading 0. This is as per https://github.com/whatwg/html/pull/2852.

The latest spec is at:
- https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh

Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTTPRefreshInternal):

LayoutTests:

* TestExpectations:
Mark as flaky tests that used to not run because they were missing a subresource. Now that I imported
this subresource, the tests run but are failing. When they fail, those tests are flaky due to the lines
they log.

* tests-options.json:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (220251 => 220252)


--- trunk/LayoutTests/ChangeLog	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/ChangeLog	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,5 +1,19 @@
 2017-08-03  Chris Dumez  <[email protected]>
 
+        Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
+        https://bugs.webkit.org/show_bug.cgi?id=175132
+
+        Reviewed by Darin Adler.
+
+        * TestExpectations:
+        Mark as flaky tests that used to not run because they were missing a subresource. Now that I imported
+        this subresource, the tests run but are failing. When they fail, those tests are flaky due to the lines
+        they log.
+
+        * tests-options.json:
+
+2017-08-03  Chris Dumez  <[email protected]>
+
         Multiple Layout tests from web-platform-tests/beacon/ are timing out.
         https://bugs.webkit.org/show_bug.cgi?id=175076
         <rdar://problem/33704752>

Modified: trunk/LayoutTests/TestExpectations (220251 => 220252)


--- trunk/LayoutTests/TestExpectations	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/TestExpectations	2017-08-04 04:37:10 UTC (rev 220252)
@@ -299,6 +299,10 @@
 imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key.html [ Pass Failure ]
 imported/w3c/web-platform-tests/fetch/dangling-markup-mitigation.tentative.html [ Pass Failure ]
 
+# Those WPT tests are flaky when failing.
+imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1.html [ Pass Failure ]
+imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2.html [ Pass Failure ]
+
 # css alignment tests
 webkit.org/b/172711 css3/parse-alignment-of-root-elements.html [ Failure ]
 

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,5 +1,25 @@
 2017-08-03  Chris Dumez  <[email protected]>
 
+        Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
+        https://bugs.webkit.org/show_bug.cgi?id=175132
+
+        Reviewed by Darin Adler.
+
+        Re-sync WPT tests from upstream c8bf1bbe9296. This extends test coverage.
+
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt:
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt:
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents-expected.txt: Removed.
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing-expected.txt:
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html:
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document-expected.txt: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents.html.
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html: Added.
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/w3c-import.log:
+        * web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/w3c-import.log:
+
+2017-08-03  Chris Dumez  <[email protected]>
+
         Multiple Layout tests from web-platform-tests/beacon/ are timing out.
         https://bugs.webkit.org/show_bug.cgi?id=175076
         <rdar://problem/33704752>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1-expected.txt	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 47: TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
+CONSOLE MESSAGE: line 2566: Error: assert_unreached: The iframe from which the meta came from must not refresh Reached unreachable code
 
-FAIL Meta refresh is blocked by the allow-scripts sandbox flag at its creation time, not when refresh comes due TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
+FAIL Meta refresh is blocked by the allow-scripts sandbox flag at its creation time, not when refresh comes due Error: assert_unreached: The iframe from which the meta came from must not refresh Reached unreachable code
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2-expected.txt	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: line 45: TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
 
-FAIL Meta refresh of the original iframe is not blocked if moved into a sandboxed iframe TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
+PASS Meta refresh of the original iframe is not blocked if moved into a sandboxed iframe 
 

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents-expected.txt (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents-expected.txt	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents-expected.txt	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,4 +0,0 @@
-CONSOLE MESSAGE: line 42: TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
-
-FAIL When moving between documents, must refresh the original document TypeError: Argument 1 ('node') to Node.appendChild must be an instance of Node
-

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents.html (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents.html	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents.html	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,51 +0,0 @@
-<!DOCTYPE html>
-<meta charset="utf-8">
-<title>When moving between documents, must refresh the original document</title>
-<script src=""
-<script src=""
-<link rel="help" href=""
-
-<div id="log"></div>
-
-<script>
-"use strict";
-
-const sourceIFrame = document.createElement("iframe");
-const destIFrame = document.createElement("iframe");
-let sourceLoadCount = 0;
-let destLoadCount = 0;
-
-sourceIFrame._onload_ = () => {
-  ++sourceLoadCount;
-
-  if (sourceLoadCount === 2) {
-    assert_equals(sourceIFrame.contentDocument.body.textContent.trim(), "foo");
-    done();
-  }
-
-  maybeStartTest();
-};
-
-destIFrame._onload_ = () => {
-  ++destLoadCount;
-
-  if (destLoadCount === 2) {
-    assert_unreached("The iframe into which the meta was moved must not refresh");
-  }
-
-  maybeStartTest();
-};
-
-function maybeStartTest() {
-  if (sourceLoadCount === 1 && destLoadCount === 1) {
-    const meta = sourceIFrame.contentDocument.querySelector("meta");
-    destIFrame.contentDocument.body.appendChild(meta);
-  }
-}
-
-sourceIFrame.src = "" + encodeURIComponent("1; url=""
-destIFrame.src = ""
-
-document.body.appendChild(sourceIFrame);
-document.body.appendChild(destIFrame);
-</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing-expected.txt (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing-expected.txt	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing-expected.txt	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,68 +1,75 @@
 
-Harness Error (TIMEOUT), message = null
+PASS "" 
+PASS "1" 
+PASS "1 " 
+PASS "1\t" 
+PASS "1\r" 
+PASS "1\n" 
+PASS "1\f" 
+PASS "1;" 
+PASS "1," 
+PASS "1; url="" 
+PASS "1, url="" 
+PASS "1 url="" 
+PASS "1;\turl=foo" 
+PASS "1,\turl=foo" 
+PASS "1\turl=foo" 
+PASS "1;\rurl=foo" 
+PASS "1,\rurl=foo" 
+PASS "1\rurl=foo" 
+PASS "1;\nurl=foo" 
+PASS "1,\nurl=foo" 
+PASS "1\nurl=foo" 
+PASS "1;\furl=foo" 
+PASS "1,\furl=foo" 
+PASS "1\furl=foo" 
+PASS "1url=foo" 
+PASS "1x;url="" 
+PASS "1 x;url="" 
+PASS "1;;url="" 
+PASS "  1  ;  url  =  "" 
+PASS "  1  ,  url  =  "" 
+PASS "  1  ;  foo" 
+PASS "  1  ,  foo" 
+PASS "  1  url  =  "" 
+PASS "1; url="" " 
+PASS "1; url="" 
+PASS "1; url="" 
+PASS "1; url=''bar" 
+PASS "1; url="" 
+PASS "1; url foo" 
+PASS "1; urlfoo" 
+PASS "1; urfoo" 
+PASS "1; ufoo" 
+PASS "1; \"foo\"bar" 
+PASS "; foo" 
+PASS ";foo" 
+PASS ", foo" 
+PASS ",foo" 
+PASS "foo" 
+PASS "+1; url="" 
+PASS "-1; url="" 
+PASS "+0; url="" 
+PASS "-0; url="" 
+PASS "0; url="" 
+PASS "+1; foo" 
+PASS "-1; foo" 
+PASS "+0; foo" 
+PASS "-0; foo" 
+PASS "0; foo" 
+PASS "+1" 
+PASS "-1" 
+PASS "+0" 
+PASS "-0" 
+PASS "0" 
+PASS "1.9; url="" 
+PASS "1.9..5.; url="" 
+PASS ".9; url="" 
+PASS "0.9; url="" 
+PASS "0...9; url="" 
+PASS "0...; url="" 
+PASS "1e0; url="" 
+PASS "1e1; url="" 
+PASS "10e-1; url="" 
+PASS "-0.1; url="" 
 
-FAIL "" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-TIMEOUT "1" Test timed out
-TIMEOUT "1 " Test timed out
-TIMEOUT "1\t" Test timed out
-TIMEOUT "1\r" Test timed out
-TIMEOUT "1\n" Test timed out
-TIMEOUT "1\f" Test timed out
-TIMEOUT "1;" Test timed out
-TIMEOUT "1," Test timed out
-TIMEOUT "1; url="" Test timed out
-TIMEOUT "1, url="" Test timed out
-TIMEOUT "1 url="" Test timed out
-TIMEOUT "1;\turl=foo" Test timed out
-TIMEOUT "1,\turl=foo" Test timed out
-TIMEOUT "1\turl=foo" Test timed out
-TIMEOUT "1;\rurl=foo" Test timed out
-TIMEOUT "1,\rurl=foo" Test timed out
-TIMEOUT "1\rurl=foo" Test timed out
-TIMEOUT "1;\nurl=foo" Test timed out
-TIMEOUT "1,\nurl=foo" Test timed out
-TIMEOUT "1\nurl=foo" Test timed out
-TIMEOUT "1;\furl=foo" Test timed out
-TIMEOUT "1,\furl=foo" Test timed out
-TIMEOUT "1\furl=foo" Test timed out
-FAIL "1url=foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "1x;url="" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-TIMEOUT "1 x;url="" Test timed out
-TIMEOUT "1;;url="" Test timed out
-TIMEOUT "  1  ;  url  =  "" Test timed out
-TIMEOUT "  1  ,  url  =  "" Test timed out
-TIMEOUT "  1  ;  foo" Test timed out
-TIMEOUT "  1  ,  foo" Test timed out
-TIMEOUT "  1  url  =  "" Test timed out
-TIMEOUT "1; url="" " Test timed out
-TIMEOUT "1; url="" Test timed out
-TIMEOUT "1; url="" Test timed out
-TIMEOUT "1; url=''bar" Test timed out
-TIMEOUT "1; url="" Test timed out
-TIMEOUT "1; url foo" Test timed out
-TIMEOUT "1; urlfoo" Test timed out
-TIMEOUT "1; urfoo" Test timed out
-TIMEOUT "1; ufoo" Test timed out
-TIMEOUT "1; \"foo\"bar" Test timed out
-FAIL "; foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL ", foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "+1; url="" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "-1; url="" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "+0; url="" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "-0; url="" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-TIMEOUT "0; url="" Test timed out
-FAIL "+1; foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "-1; foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "+0; foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "-0; foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-TIMEOUT "0; foo" Test timed out
-FAIL "+1" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "-1" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "+0" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "-0" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-TIMEOUT "0" Test timed out
-TIMEOUT "1.9; url="" Test timed out
-TIMEOUT "1.9..5.; url="" Test timed out
-FAIL ".9; url="" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,5 +1,6 @@
 <!doctype html>
 <meta charset=utf-8>
+<meta name=timeout content=long>
 <title>Parsing of meta refresh</title>
 <script src=""
 <script src=""
@@ -57,7 +58,9 @@
   {input: '1; ufoo', expected: [1, 'ufoo']},
   {input: '1; "foo"bar', expected: [1, 'foo']},
   {input: '; foo', expected: []},
+  {input: ';foo', expected: []},
   {input: ', foo', expected: []},
+  {input: ',foo', expected: []},
   {input: 'foo', expected: []},
   {input: '+1; url="" expected: []},
   {input: '-1; url="" expected: []},
@@ -76,7 +79,14 @@
   {input: '0', expected: [0, 'refresh.sub.html']},
   {input: '1.9; url="" expected: [1, 'foo']},
   {input: '1.9..5.; url="" expected: [1, 'foo']},
-  {input: '.9; url="" expected: []},
+  {input: '.9; url="" expected: [0, 'foo']},
+  {input: '0.9; url="" expected: [0, 'foo']},
+  {input: '0...9; url="" expected: [0, 'foo']},
+  {input: '0...; url="" expected: [0, 'foo']},
+  {input: '1e0; url="" expected: []},
+  {input: '1e1; url="" expected: []},
+  {input: '10e-1; url="" expected: []},
+  {input: '-0.1; url="" expected: []},
 ];
 
 tests_arr.forEach(function(test_obj) {

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document-expected.txt (0 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document-expected.txt	2017-08-04 04:37:10 UTC (rev 220252)
@@ -0,0 +1,3 @@
+
+PASS A meta must refresh the original document even if it was removed. 
+

Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document.html (from rev 220251, trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents.html) (0 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document.html	2017-08-04 04:37:10 UTC (rev 220252)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>A meta must refresh the original document even if it was removed.</title>
+<script src=""
+<script src=""
+<link rel="help" href=""
+
+<div id="log"></div>
+
+<script>
+"use strict";
+
+const sourceIFrame = document.createElement("iframe");
+let sourceLoadCount = 0;
+
+sourceIFrame._onload_ = () => {
+  ++sourceLoadCount;
+
+  if (sourceLoadCount === 2) {
+    assert_equals(sourceIFrame.contentDocument.body.textContent.trim(), "foo");
+    done();
+  }
+
+  maybeStartTest();
+};
+
+function maybeStartTest() {
+  if (sourceLoadCount === 1) {
+    sourceIFrame.contentDocument.querySelector("meta").remove();
+  }
+}
+
+sourceIFrame.src = "" + encodeURIComponent("1; url=""
+
+document.body.appendChild(sourceIFrame);
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html (0 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html	2017-08-04 04:37:10 UTC (rev 220252)
@@ -0,0 +1 @@
+<!doctype html><meta http-equiv=refresh content="{{GET[input]}}">refresh.sub.html

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/w3c-import.log (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/w3c-import.log	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/w3c-import.log	2017-08-04 04:37:10 UTC (rev 220252)
@@ -18,6 +18,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/__dir__.headers
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/foo'bar
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/ufoo
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/urfoo
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/url foo

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/w3c-import.log (220251 => 220252)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/w3c-import.log	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/w3c-import.log	2017-08-04 04:37:10 UTC (rev 220252)
@@ -17,6 +17,6 @@
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-2.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/dynamic-append.html
-/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/moving-documents.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/not-in-shadow-tree.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/remove-from-document.html

Modified: trunk/LayoutTests/tests-options.json (220251 => 220252)


--- trunk/LayoutTests/tests-options.json	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/LayoutTests/tests-options.json	2017-08-04 04:37:10 UTC (rev 220252)
@@ -764,6 +764,9 @@
     "imported/w3c/web-platform-tests/html/dom/reflection-text.html": [
         "slow"
     ],
+    "imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html": [
+        "slow"
+    ],
     "imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html": [
         "slow"
     ],

Modified: trunk/Source/WebCore/ChangeLog (220251 => 220252)


--- trunk/Source/WebCore/ChangeLog	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/Source/WebCore/ChangeLog	2017-08-04 04:37:10 UTC (rev 220252)
@@ -1,3 +1,21 @@
+2017-08-03  Chris Dumez  <[email protected]>
+
+        Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
+        https://bugs.webkit.org/show_bug.cgi?id=175132
+
+        Reviewed by Darin Adler.
+
+        Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.', without
+        a leading 0. This is as per https://github.com/whatwg/html/pull/2852.
+
+        The latest spec is at:
+        - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
+
+        Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
+
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::parseHTTPRefreshInternal):
+
 2017-08-03  Brian Burg  <[email protected]>
 
         Remove ENABLE(WEB_SOCKET) guards

Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (220251 => 220252)


--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp	2017-08-04 03:57:29 UTC (rev 220251)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp	2017-08-04 04:37:10 UTC (rev 220252)
@@ -360,19 +360,28 @@
     while (position < end && isHTMLSpace(*position))
         ++position;
 
+    unsigned time = 0;
+
     const CharacterType* numberStart = position;
     while (position < end && isASCIIDigit(*position))
         ++position;
 
-    auto optionalNumber = parseHTMLNonNegativeInteger(StringView(numberStart, position - numberStart));
-    if (!optionalNumber)
-        return false;
+    StringView timeString(numberStart, position - numberStart);
+    if (timeString.isEmpty()) {
+        if (position >= end || *position != '.')
+            return false;
+    } else {
+        auto optionalNumber = parseHTMLNonNegativeInteger(timeString);
+        if (!optionalNumber)
+            return false;
+        time = optionalNumber.value();
+    }
 
     while (position < end && (isASCIIDigit(*position) || *position == '.'))
         ++position;
 
     if (position == end) {
-        parsedDelay = optionalNumber.value();
+        parsedDelay = time;
         return true;
     }
 
@@ -379,7 +388,7 @@
     if (*position != ';' && *position != ',' && !isHTMLSpace(*position))
         return false;
 
-    parsedDelay = optionalNumber.value();
+    parsedDelay = time;
 
     while (position < end && isHTMLSpace(*position))
         ++position;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to