Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSDB: don't sniff for JSON parser breaker in text/css responses. #9429

Merged
merged 1 commit into from Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions fetch/corb/README.md
@@ -0,0 +1,21 @@
# Tests related to Cross-Origin Resource Blocking (CORB).

This directory contains tests related to the
[Cross-Origin Resource Blocking (CORB)](https://chromium.googlesource.com/chromium/src/+/master/content/browser/loader/cross_origin_read_blocking_explainer.md) algorithm.

Note that CORB is currently in very early stages of standardization path. At
the same time, some tests in this directory (e.g.
`css-with-json-parser-breaker`) cover behavior spec-ed outside of CORB (making
sure that CORB doesn't change the existing web behavior) and therefore are
valuable independently from CORB's standardization efforts.

Tests that cover behavior that is changed by CORB have to be marked as
[tentative](http://web-platform-tests.org/writing-tests/file-names.html)
(using `.tentative` substring in their filename) until CORB
is included in the official
[Fetch spec](https://fetch.spec.whatwg.org/).

The tests in this directory interact with various, random features,
but the tests have been grouped together into the `fetch/corb` directory,
because all of these tests verify behavior that is important to the CORB
algorithm.
17 changes: 17 additions & 0 deletions fetch/corb/css-with-json-parser-breaker.sub.html
@@ -0,0 +1,17 @@
<!doctype html>
<meta charset="utf-8">
<title>CORB should not block text/css with a JSON parser breaker</title>
<link rel="stylesheet" type="text/css"
href="http://{{domains[www1]}}:{{ports[http][0]}}/fetch/corb/resources/css-with-json-parser-breaker.css">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<body>
<h1 id="header">Header example</h1>
<p>Paragraph body</p>
</body>
<script>
test(function() {
var style = getComputedStyle(document.getElementById('header'));
assert_equals(style.getPropertyValue('color'), 'rgb(255, 0, 0)');
}, "CORB should not block text/css with a JSON parser breaker");
</script>
3 changes: 3 additions & 0 deletions fetch/corb/resources/css-with-json-parser-breaker.css
@@ -0,0 +1,3 @@
)]}'
{}
h1 { color: red; }