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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220252
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-08-03 Chris Dumez <cdumez@apple.com>
+
+ 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 <cdumez@apple.com>
Multiple Layout tests from web-platform-tests/beacon/ are timing out.
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 ]
+2017-08-03 Chris Dumez <cdumez@apple.com>
+
+ 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 <cdumez@apple.com>
Multiple Layout tests from web-platform-tests/beacon/ are timing out.
-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
-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
+++ /dev/null
-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
-
-Harness Error (TIMEOUT), message = null
-
-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=foo" Test timed out
-TIMEOUT "1, url=foo" Test timed out
-TIMEOUT "1 url=foo" 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=foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-TIMEOUT "1 x;url=foo" Test timed out
-TIMEOUT "1;;url=foo" Test timed out
-TIMEOUT " 1 ; url = foo" Test timed out
-TIMEOUT " 1 , url = foo" Test timed out
-TIMEOUT " 1 ; foo" Test timed out
-TIMEOUT " 1 , foo" Test timed out
-TIMEOUT " 1 url = foo" Test timed out
-TIMEOUT "1; url=foo " Test timed out
-TIMEOUT "1; url=f\to\no" Test timed out
-TIMEOUT "1; url=\"foo\"bar" Test timed out
-TIMEOUT "1; url='foo'bar" Test timed out
-TIMEOUT "1; url=\"foo'bar" 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=foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "-1; url=foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "+0; url=foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-FAIL "-0; url=foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
-TIMEOUT "0; url=foo" 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=foo" Test timed out
-TIMEOUT "1.9..5.; url=foo" Test timed out
-FAIL ".9; url=foo" assert_equals: expected "refresh.sub.html" but got "{\"error\": {\"message\": \"\", \"code\": 404}}"
+PASS ""
+PASS "1"
+PASS "1 "
+PASS "1\t"
+PASS "1\r"
+PASS "1\n"
+PASS "1\f"
+PASS "1;"
+PASS "1,"
+PASS "1; url=foo"
+PASS "1, url=foo"
+PASS "1 url=foo"
+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=foo"
+PASS "1 x;url=foo"
+PASS "1;;url=foo"
+PASS " 1 ; url = foo"
+PASS " 1 , url = foo"
+PASS " 1 ; foo"
+PASS " 1 , foo"
+PASS " 1 url = foo"
+PASS "1; url=foo "
+PASS "1; url=f\to\no"
+PASS "1; url=\"foo\"bar"
+PASS "1; url='foo'bar"
+PASS "1; url=\"foo'bar"
+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=foo"
+PASS "-1; url=foo"
+PASS "+0; url=foo"
+PASS "-0; url=foo"
+PASS "0; url=foo"
+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=foo"
+PASS "1.9..5.; url=foo"
+PASS ".9; url=foo"
+PASS "0.9; url=foo"
+PASS "0...9; url=foo"
+PASS "0...; url=foo"
+PASS "1e0; url=foo"
+PASS "1e1; url=foo"
+PASS "10e-1; url=foo"
+PASS "-0.1; url=foo"
<!doctype html>
<meta charset=utf-8>
+<meta name=timeout content=long>
<title>Parsing of meta refresh</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
{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=foo', expected: []},
{input: '-1; url=foo', expected: []},
{input: '0', expected: [0, 'refresh.sub.html']},
{input: '1.9; url=foo', expected: [1, 'foo']},
{input: '1.9..5.; url=foo', expected: [1, 'foo']},
- {input: '.9; url=foo', expected: []},
+ {input: '.9; url=foo', expected: [0, 'foo']},
+ {input: '0.9; url=foo', expected: [0, 'foo']},
+ {input: '0...9; url=foo', expected: [0, 'foo']},
+ {input: '0...; url=foo', expected: [0, 'foo']},
+ {input: '1e0; url=foo', expected: []},
+ {input: '1e1; url=foo', expected: []},
+ {input: '10e-1; url=foo', expected: []},
+ {input: '-0.1; url=foo', expected: []},
];
tests_arr.forEach(function(test_obj) {
--- /dev/null
+
+PASS A meta must refresh the original document even if it was removed.
+
<!DOCTYPE html>
<meta charset="utf-8">
-<title>When moving between documents, must refresh the original document</title>
+<title>A meta must refresh the original document even if it was removed.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh">
"use strict";
const sourceIFrame = document.createElement("iframe");
-const destIFrame = document.createElement("iframe");
let sourceLoadCount = 0;
-let destLoadCount = 0;
sourceIFrame.onload = () => {
++sourceLoadCount;
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);
+ if (sourceLoadCount === 1) {
+ sourceIFrame.contentDocument.querySelector("meta").remove();
}
}
sourceIFrame.src = "support/refresh.sub.html?input=" + encodeURIComponent("1; url=foo");
-destIFrame.src = "support/ufoo";
document.body.appendChild(sourceIFrame);
-document.body.appendChild(destIFrame);
</script>
--- /dev/null
+<!doctype html><meta http-equiv=refresh content="{{GET[input]}}">refresh.sub.html
/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
/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
"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"
],
+2017-08-03 Chris Dumez <cdumez@apple.com>
+
+ 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 <bburg@apple.com>
Remove ENABLE(WEB_SOCKET) guards
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;
}
if (*position != ';' && *position != ',' && !isHTMLSpace(*position))
return false;
- parsedDelay = optionalNumber.value();
+ parsedDelay = time;
while (position < end && isHTMLSpace(*position))
++position;