Source/WebCore/ChangeLog

 12014-10-11 Mike West <mkwst@chromium.org>
 2
 3 Referrer Policy: Update <meta name="referrer"> values to match the spec
 4 https://bugs.webkit.org/show_bug.cgi?id=137635
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 http://w3c.github.io/webappsec/specs/referrer-policy/#referrer-policy-delivery-meta
 9 defines different keywords than we originally implemented. We should
 10 support them.
 11
 12 This patch is a port of Blink's https://codereview.chromium.org/607433002/
 13
 14 Tests: http/tests/security/referrer-policy-conflicting-policies.html
 15 http/tests/security/referrer-policy-https-no-referrer-when-downgrade.html
 16 http/tests/security/referrer-policy-https-no-referrer.html
 17 http/tests/security/referrer-policy-https-unsafe-url.html
 18 http/tests/security/referrer-policy-no-referrer-when-downgrade.html
 19 http/tests/security/referrer-policy-no-referrer.html
 20
 21 * dom/Document.cpp:
 22 (WebCore::Document::processReferrerPolicy):
 23
1242014-10-11 Carlos Garcia Campos <cgarcia@igalia.com>
225
326 [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource

Source/WebCore/dom/Document.cpp

@@void Document::processReferrerPolicy(const String& policy)
30423042{
30433043 ASSERT(!policy.isNull());
30443044
3045  if (equalIgnoringCase(policy, "never"))
3046  m_referrerPolicy = ReferrerPolicyNever;
3047  else if (equalIgnoringCase(policy, "always"))
3048  m_referrerPolicy = ReferrerPolicyAlways;
 3045 if (equalIgnoringCase(policy, "no-referrer") || equalIgnoringCase(policy, "never"))
 3046 setReferrerPolicy(ReferrerPolicyNever);
 3047 else if (equalIgnoringCase(policy, "unsafe-url") || equalIgnoringCase(policy, "always"))
 3048 setReferrerPolicy(ReferrerPolicyAlways);
30493049 else if (equalIgnoringCase(policy, "origin"))
3050  m_referrerPolicy = ReferrerPolicyOrigin;
3051  else if (equalIgnoringCase(policy, "default"))
3052  m_referrerPolicy = ReferrerPolicyDefault;
 3050 setReferrerPolicy(ReferrerPolicyOrigin);
 3051 else if (equalIgnoringCase(policy, "no-referrer-when-downgrade") || equalIgnoringCase(policy, "default"))
 3052 setReferrerPolicy(ReferrerPolicyDefault);
30533053 else {
3054  addConsoleMessage(MessageSource::Rendering, MessageLevel::Error, "Failed to set referrer policy: The value '" + policy + "' is not one of 'always', 'default', 'never', or 'origin'. Defaulting to 'never'.");
3055  m_referrerPolicy = ReferrerPolicyNever;
 3054 addConsoleMessage(MessageSource::Rendering, MessageLevel::Error, "Failed to set referrer policy: The value '" + policy + "' is not one of 'no-referrer', 'origin', 'no-referrer-when-downgrade', or 'unsafe-url'. Defaulting to 'no-referrer'.");
 3055 setReferrerPolicy(ReferrerPolicyNever);
30563056 }
30573057}
30583058

LayoutTests/ChangeLog

 12014-10-11 Mike West <mkwst@chromium.org>
 2
 3 Referrer Policy: Update <meta name="referrer"> values to match the spec
 4 https://bugs.webkit.org/show_bug.cgi?id=137635
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * http/tests/security/referrer-policy-https-no-referrer-expected.txt: Added.
 9 * http/tests/security/referrer-policy-https-no-referrer-when-downgrade-expected.txt: Added.
 10 * http/tests/security/referrer-policy-https-no-referrer-when-downgrade.html: Added.
 11 * http/tests/security/referrer-policy-https-no-referrer.html: Added.
 12 * http/tests/security/referrer-policy-https-unsafe-url-expected.txt: Added.
 13 * http/tests/security/referrer-policy-https-unsafe-url.html: Added.
 14 * http/tests/security/referrer-policy-invalid-expected.txt: Update the error message with new keywords.
 15 * http/tests/security/referrer-policy-no-referrer-expected.txt: Added.
 16 * http/tests/security/referrer-policy-no-referrer-when-downgrade-expected.txt: Added.
 17 * http/tests/security/referrer-policy-no-referrer-when-downgrade.html: Added.
 18 * http/tests/security/referrer-policy-no-referrer.html: Added.
 19
1202014-10-10 Simon Fraser <simon.fraser@apple.com>
221
322 Make these animation tests not timeout if hit testing fails.

LayoutTests/http/tests/security/referrer-policy-https-no-referrer-expected.txt

 1This test checks the default referrer policy when navigating from a secure URL to an insecure URL. The test passes if the printed referrer is empty.
 2
 3
 4
 5--------
 6Frame: '<!--framePath //<!--frame0-->-->'
 7--------
 8HTTP Referer header is empty
 9Referrer is empty
 10

LayoutTests/http/tests/security/referrer-policy-https-no-referrer-when-downgrade-expected.txt

 1This test checks the default referrer policy when navigating from a secure URL to an insecure URL. The test passes if the printed referrer is empty.
 2
 3
 4
 5--------
 6Frame: '<!--framePath //<!--frame0-->-->'
 7--------
 8HTTP Referer header is empty
 9Referrer is empty
 10

LayoutTests/http/tests/security/referrer-policy-https-no-referrer-when-downgrade.html

 1<html>
 2<head>
 3<script>
 4if (window.testRunner) {
 5 testRunner.dumpAsText();
 6 testRunner.dumpChildFramesAsText();
 7 testRunner.waitUntilDone();
 8}
 9</script>
 10</head>
 11<body>
 12<p>
 13This test checks the default referrer policy when navigating from a secure URL
 14to an insecure URL. The test passes if the printed referrer is empty.
 15</p>
 16<iframe src="https://127.0.0.1:8443/security/resources/referrer-policy-start.html?no-referrer-when-downgrade"></iframe>
 17</body>
 18</html>

LayoutTests/http/tests/security/referrer-policy-https-no-referrer.html

 1<html>
 2<head>
 3<script>
 4if (window.testRunner) {
 5 testRunner.dumpAsText();
 6 testRunner.dumpChildFramesAsText();
 7 testRunner.waitUntilDone();
 8}
 9</script>
 10</head>
 11<body>
 12<p>
 13This test checks the default referrer policy when navigating from a secure URL
 14to an insecure URL. The test passes if the printed referrer is empty.
 15</p>
 16<iframe src="https://127.0.0.1:8443/security/resources/referrer-policy-start.html?no-referrer"></iframe>
 17</body>
 18</html>

LayoutTests/http/tests/security/referrer-policy-https-unsafe-url-expected.txt

 1This test checks the always referrer policy when navigating from a secure URL to an insecure URL. The test passes if the printed referrer is https://127.0.0.1:8443/security/resources/referrer-policy-start.html?unsafe-url
 2
 3
 4
 5--------
 6Frame: '<!--framePath //<!--frame0-->-->'
 7--------
 8HTTP Referer header is https://127.0.0.1:8443/security/resources/referrer-policy-start.html?unsafe-url
 9Referrer is https://127.0.0.1:8443/security/resources/referrer-policy-start.html?unsafe-url
 10

LayoutTests/http/tests/security/referrer-policy-https-unsafe-url.html

 1<html>
 2<head>
 3<script>
 4if (window.testRunner) {
 5 testRunner.dumpAsText();
 6 testRunner.dumpChildFramesAsText();
 7 testRunner.waitUntilDone();
 8}
 9</script>
 10</head>
 11<body>
 12<p>
 13This test checks the always referrer policy when navigating from a secure URL
 14to an insecure URL. The test passes if the printed referrer is
 15https://127.0.0.1:8443/security/resources/referrer-policy-start.html?unsafe-url
 16</p>
 17<iframe src="https://127.0.0.1:8443/security/resources/referrer-policy-start.html?unsafe-url"></iframe>
 18</body>
 19</html>

LayoutTests/http/tests/security/referrer-policy-invalid-expected.txt

1 CONSOLE MESSAGE: Failed to set referrer policy: The value 'invalid' is not one of 'always', 'default', 'never', or 'origin'. Defaulting to 'never'.
 1CONSOLE MESSAGE: Failed to set referrer policy: The value 'invalid' is not one of 'no-referrer', 'origin', 'no-referrer-when-downgrade', or 'unsafe-url'. Defaulting to 'no-referrer'.
22This test checks an invalid referrer policy when navigating from an insecure URL to another insecure URL. The test passes if the printed referrer is empty.
33
44

LayoutTests/http/tests/security/referrer-policy-no-referrer-expected.txt

 1This test checks the never referrer policy when navigating from an insecure URL to another insecure URL. The test passes if the printed referrer is empty.
 2
 3
 4
 5--------
 6Frame: '<!--framePath //<!--frame0-->-->'
 7--------
 8HTTP Referer header is empty
 9Referrer is empty
 10

LayoutTests/http/tests/security/referrer-policy-no-referrer-when-downgrade-expected.txt

 1This test checks the default referrer policy when navigating from an insecure URL to another insecure URL. The test passes if the printed referrer is http://127.0.0.1:8000/security/resources/referrer-policy-start.html?no-referrer-when-downgrade
 2
 3
 4
 5--------
 6Frame: '<!--framePath //<!--frame0-->-->'
 7--------
 8HTTP Referer header is http://127.0.0.1:8000/security/resources/referrer-policy-start.html?no-referrer-when-downgrade
 9Referrer is http://127.0.0.1:8000/security/resources/referrer-policy-start.html?no-referrer-when-downgrade
 10

LayoutTests/http/tests/security/referrer-policy-no-referrer-when-downgrade.html

 1<html>
 2<head>
 3<script>
 4if (window.testRunner) {
 5 testRunner.dumpAsText();
 6 testRunner.dumpChildFramesAsText();
 7 testRunner.waitUntilDone();
 8}
 9</script>
 10</head>
 11<body>
 12<p>
 13This test checks the default referrer policy when navigating from an insecure
 14URL to another insecure URL. The test passes if the printed referrer is
 15http://127.0.0.1:8000/security/resources/referrer-policy-start.html?no-referrer-when-downgrade
 16</p>
 17<iframe src="http://127.0.0.1:8000/security/resources/referrer-policy-start.html?no-referrer-when-downgrade"></iframe>
 18</body>
 19</html>

LayoutTests/http/tests/security/referrer-policy-no-referrer.html

 1<html>
 2<head>
 3<script>
 4if (window.testRunner) {
 5 testRunner.dumpAsText();
 6 testRunner.dumpChildFramesAsText();
 7 testRunner.waitUntilDone();
 8}
 9</script>
 10</head>
 11<body>
 12<p>
 13This test checks the never referrer policy when navigating from an insecure
 14URL to another insecure URL. The test passes if the printed referrer is empty.
 15</p>
 16<iframe src="http://127.0.0.1:8000/security/resources/referrer-policy-start.html?no-referrer"></iframe>
 17</body>
 18</html>