Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: LayoutTests/http/tests/security/cross-origin-css.html

Issue 904143002: Revert "CSS: Drop the quirks-mode exception for CSS MIME types." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/cross-origin-css.html
diff --git a/LayoutTests/http/tests/security/cross-origin-css.html b/LayoutTests/http/tests/security/cross-origin-css.html
index 4cca0b685a851881d43bc2047a00dd72e2f45903..3f35232e9a3a6f418ab70fd469eb6f3d0185747a 100644
--- a/LayoutTests/http/tests/security/cross-origin-css.html
+++ b/LayoutTests/http/tests/security/cross-origin-css.html
@@ -1,12 +1,5 @@
-<!DOCTYPE html>
<html>
<head>
-<title>Cross-origin CSS</title>
-
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-
-<!-- Bring in various same- and cross-origin stylesheets. -->
<link rel="stylesheet"
href="resources/redir.php?url=http://localhost:8000/security/resources/xorigincss1.html"></link>
<link rel="stylesheet"
@@ -16,7 +9,32 @@
href="resources/redir.php?url=http://localhost:8000/security/resources/xorigincss1.css"></link>
<link rel="stylesheet"
href="resources/xorigincss3.html"></link>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+window.onload = function() {
+ ele = document.getElementById("id1");
+ ele.innerText = "LINK Cross-origin, HTML, valid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id2");
+ ele.innerText = "LINK + IMPORT Cross-origin, HTML, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id3");
+ ele.innerText = "LINK Cross-origin, CSS, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id4");
+ ele.innerText = "LINK Same-origin, HTML, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id5");
+ ele.innerText = "IMPORT Cross-origin, HTML, valid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id6");
+ ele.innerText = "IMPORT Cross-origin, CSS, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id7");
+ ele.innerText = "IMPORT Same-origin, HTML, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+</script>
<style>
/* Deliberately reuse the same file / class / id on this first one */
@import "resources/redir.php?url=http://localhost:8000/security/resources/xorigincss2.html";
@@ -30,54 +48,6 @@
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='0px' height='0px'></svg>");
}
</style>
-<script>
-function getBackgroundColorForId(id) {
- return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
-}
-
-var onloadTest = async_test("Testing cross-origin and MIME behavior for CSS.");
-
-window.onload = function () {
- test(function () {
- assert_equals(getBackgroundColorForId('id1'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss1.html should not be loaded via <link>.');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id2'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss2.html should not be loaded either via <link> or @import.');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id3'), 'rgb(255, 255, 0)');
- }, 'xorigincss1.css should be loaded via <link>');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id4'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss3.html should not be loaded, even though it is same-origin');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id5'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss4.html should not be loaded via @import.');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id6'), 'rgb(255, 255, 0)');
- }, 'xorigincss2.css should be loaded.');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id7'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss5.html should not be loaded.');
-
- onloadTest.done();
-};
-</script>
</head>
-<body>
- <div id="id1" class="id1"></div>
- <div id="id2" class="id2"></div>
- <div id="id3" class="id3"></div>
- <div id="id4" class="id4"></div>
- <div id="id5" class="id5"></div>
- <div id="id6" class="id6"></div>
- <div id="id7" class="id7"></div>
- <div id="data-background-url">PASS background image loaded</div>
-</body>
+<body><div id="id1" class="id1"></div><div id="id2" class="id2"></div><div id="id3" class="id3"></div><div id="id4" class="id4"></div><div id="id5" class="id5"></div><div id="id6" class="id6"></div><div id="id7" class="id7"></div><div id="data-background-url">PASS background image loaded</div></body>
</html>

Powered by Google App Engine
This is Rietveld 408576698