<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[187650] branches/safari-601.1-branch</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/187650">187650</a></dd>
<dt>Author</dt> <dd>lforschler@apple.com</dd>
<dt>Date</dt> <dd>2015-07-31 09:42:09 -0700 (Fri, 31 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/187489">r187489</a>. rdar://problem/22010303</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6011branchLayoutTestsChangeLog">branches/safari-601.1-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestsinspectorcssbadmimetypeexpectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/inspector/css/bad-mime-type-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestsmimestandardmodedoesnotloadstylesheetwithtextplainandcssextensionexpectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestsmimestandardmodedoesnotloadstylesheetwithtextplainexpectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestsmisccssrejectanytypeinstrictmodeexpectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-reject-any-type-in-strict-mode-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss1expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-1-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss2expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-2-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss4expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-4-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss5expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-5-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss7expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-7-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestsplatformmachttptestsmiscacid3expectedtxt">branches/safari-601.1-branch/LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreChangeLog">branches/safari-601.1-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6011branchSourceWebCorecssStyleRuleImportcpp">branches/safari-601.1-branch/Source/WebCore/css/StyleRuleImport.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebCorecssStyleSheetContentscpp">branches/safari-601.1-branch/Source/WebCore/css/StyleSheetContents.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebCorecssStyleSheetContentsh">branches/safari-601.1-branch/Source/WebCore/css/StyleSheetContents.h</a></li>
<li><a href="#branchessafari6011branchSourceWebCorehtmlHTMLLinkElementcpp">branches/safari-601.1-branch/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreloadercacheCachedCSSStyleSheetcpp">branches/safari-601.1-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreloadercacheCachedCSSStyleSheeth">branches/safari-601.1-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks1expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks1html">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks2expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks2html">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks3expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks3html">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks4expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks4html">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks5expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks5html">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks6expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks6html">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks7expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks7html">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks8expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks8html">branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss1expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-1-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss1html">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-1.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss2expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-2-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss2html">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-2.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss3expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-3-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss3html">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-3.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss4expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-4-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss4html">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-4.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss5expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-5-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss5html">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-5.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss6expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-6-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss6html">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-6.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss7expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-7-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss7html">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-7.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss8expectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-8-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincss8html">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-8.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincssinquirksexpectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-in-quirks-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestssecuritysameorigincssinquirkshtml">branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-in-quirks.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#branchessafari6011branchLayoutTestshttptestsmisccssacceptanytypeexpectedtxt">branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestshttptestsmisccssacceptanytypehtml">branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-accept-any-type.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6011branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/ChangeLog (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/ChangeLog        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/ChangeLog        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2015-07-31 Lucas Forschler <lforschler@apple.com>
+
+ Merge r187489
+
+ 2015-07-28 Chris Dumez <cdumez@apple.com>
+
+ Allow lax MIME type parsing for same-origin CSS in quirks mode.
+ https://bugs.webkit.org/show_bug.cgi?id=147327
+ <rdar://problem/22010303>
+
+ Reviewed by Zalan Bujtas.
+
+ Add layout test coverage for MIME type parsing for same-origin CSS in
+ quirks mode and not.
+
+ * http/tests/inspector/css/bad-mime-type-expected.txt:
+ * http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt:
+ * http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt:
+ * http/tests/misc/css-accept-any-type-expected.txt: Removed.
+ * http/tests/misc/css-accept-any-type.html: Removed.
+ * http/tests/misc/css-reject-any-type-in-strict-mode-expected.txt:
+ * http/tests/security/cross-origin-css-1-expected.txt:
+ * http/tests/security/cross-origin-css-2-expected.txt:
+ * http/tests/security/cross-origin-css-4-expected.txt:
+ * http/tests/security/cross-origin-css-5-expected.txt:
+ * http/tests/security/cross-origin-css-7-expected.txt:
+ * http/tests/security/cross-origin-css-in-quirks-1-expected.txt: Copied from LayoutTests/http/tests/security/cross-origin-css-1-expected.txt.
+ * http/tests/security/cross-origin-css-in-quirks-1.html: Added.
+ * http/tests/security/cross-origin-css-in-quirks-2-expected.txt: Copied from LayoutTests/http/tests/security/cross-origin-css-2-expected.txt.
+ * http/tests/security/cross-origin-css-in-quirks-2.html: Added.
+ * http/tests/security/cross-origin-css-in-quirks-3-expected.txt: Added.
+ * http/tests/security/cross-origin-css-in-quirks-3.html: Added.
+ * http/tests/security/cross-origin-css-in-quirks-4-expected.txt: Added.
+ * http/tests/security/cross-origin-css-in-quirks-4.html: Added.
+ * http/tests/security/cross-origin-css-in-quirks-5-expected.txt: Copied from LayoutTests/http/tests/security/cross-origin-css-5-expected.txt.
+ * http/tests/security/cross-origin-css-in-quirks-5.html: Added.
+ * http/tests/security/cross-origin-css-in-quirks-6-expected.txt: Added.
+ * http/tests/security/cross-origin-css-in-quirks-6.html: Added.
+ * http/tests/security/cross-origin-css-in-quirks-7-expected.txt: Added.
+ * http/tests/security/cross-origin-css-in-quirks-7.html: Added.
+ * http/tests/security/cross-origin-css-in-quirks-8-expected.txt: Added.
+ * http/tests/security/cross-origin-css-in-quirks-8.html: Added.
+ * http/tests/security/same-origin-css-1-expected.txt: Added.
+ * http/tests/security/same-origin-css-1.html: Added.
+ * http/tests/security/same-origin-css-2-expected.txt: Added.
+ * http/tests/security/same-origin-css-2.html: Added.
+ * http/tests/security/same-origin-css-3-expected.txt: Added.
+ * http/tests/security/same-origin-css-3.html: Added.
+ * http/tests/security/same-origin-css-4-expected.txt: Added.
+ * http/tests/security/same-origin-css-4.html: Added.
+ * http/tests/security/same-origin-css-5-expected.txt: Added.
+ * http/tests/security/same-origin-css-5.html: Added.
+ * http/tests/security/same-origin-css-6-expected.txt: Added.
+ * http/tests/security/same-origin-css-6.html: Added.
+ * http/tests/security/same-origin-css-7-expected.txt: Copied from LayoutTests/http/tests/security/cross-origin-css-7-expected.txt.
+ * http/tests/security/same-origin-css-7.html: Added.
+ * http/tests/security/same-origin-css-8-expected.txt: Added.
+ * http/tests/security/same-origin-css-8.html: Added.
+ * http/tests/security/same-origin-css-in-quirks-expected.txt: Added.
+ * http/tests/security/same-origin-css-in-quirks.html: Added.
+ * platform/mac/http/tests/misc/acid3-expected.txt:
+
</ins><span class="cx"> 2015-07-30 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r187278. rdar://problem/19908029
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestsinspectorcssbadmimetypeexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/inspector/css/bad-mime-type-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/inspector/css/bad-mime-type-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/inspector/css/bad-mime-type-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/misc/resources/stylesheet-bad-mime-type.php' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/misc/resources/stylesheet-bad-mime-type.php' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx"> Tests that showing Web Inspector on a page that has a stylesheet with an invalid MIME type does not crash.
</span><span class="cx">
</span><span class="cx"> This test passes if it does not crash.
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestsmimestandardmodedoesnotloadstylesheetwithtextplainandcssextensionexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,2 +1,2 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/mime/resources/style-with-text-plain.php/foo.css' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/mime/resources/style-with-text-plain.php/foo.css' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx"> This test passes if we do NOT apply the stylesheet (which turns the background color red.) The background color is: rgba(0, 0, 0, 0).
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestsmimestandardmodedoesnotloadstylesheetwithtextplainexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,2 +1,2 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/mime/resources/style-with-text-plain.php' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/mime/resources/style-with-text-plain.php' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx"> This test passes if we do NOT apply the stylesheet (which turns the background color red.) The background color is: rgba(0, 0, 0, 0).
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestsmisccssacceptanytypeexpectedtxt"></a>
<div class="delfile"><h4>Deleted: branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +0,0 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/misc/resources/stylesheet-bad-mime-type.php' because its MIME type was invalid.
-This was a test for http://bugs.webkit.org/show_bug.cgi?id=11451 REGRESSION: Dell.com does not render correctly in ToT (stylesheet not loaded): given the security implications of accepting bad MIME types, we're now intentionally breaking this case to match other browsers.
-
-SUCCESS
</del></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestsmisccssacceptanytypehtml"></a>
<div class="delfile"><h4>Deleted: branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-accept-any-type.html (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-accept-any-type.html        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-accept-any-type.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-<html>
-<head>
- <title></title>
- <link rel="stylesheet" href="resources/stylesheet-bad-mime-type.php">
- <script>
- function test()
- {
- if (window.testRunner)
- testRunner.dumpAsText();
-
- var target = document.getElementById("target");
- var style = getComputedStyle(target);
- target.innerText = style.position == "relative" ? "FAIL" : "SUCCESS";
- }
- </script>
-</head>
-<body onload="test()">
- <p>
- This was a test for
- <i><a href="http://bugs.webkit.org/show_bug.cgi?id=11451">http://bugs.webkit.org/show_bug.cgi?id=11451</a>
- REGRESSION: Dell.com does not render correctly in ToT (stylesheet not loaded)</i>:
- given the security implications of accepting bad MIME types, we're now
- intentionally breaking this case to match other browsers.
- </p>
- <p id="target">
- </p>
-</body>
-</html>
</del></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestsmisccssrejectanytypeinstrictmodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-reject-any-type-in-strict-mode-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-reject-any-type-in-strict-mode-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/misc/css-reject-any-type-in-strict-mode-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/misc/resources/stylesheet-bad-mime-type.php' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/misc/resources/stylesheet-bad-mime-type.php' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx"> Related test to http://bugs.webkit.org/show_bug.cgi?id=11451 REGRESSION: Dell.com does not render correctly in ToT (stylesheet not loaded). Making sure that in strict mode we would not load such a stylesheet.
</span><span class="cx">
</span><span class="cx"> SUCCESS
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss1expectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-1-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-1-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-1-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.html' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.html' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx">
</span><span class="cx"> PASS Testing cross-origin and MIME behavior for CSS.
</span><span class="cx"> PASS xorigincss1.html should not be loaded via <link>.
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss2expectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-2-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-2-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-2-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.html' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.html' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx">
</span><span class="cx"> PASS Testing cross-origin and MIME behavior for CSS.
</span><span class="cx"> PASS xorigincss2.html should not be loaded either via <link> or @import.
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss4expectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-4-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-4-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-4-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/security/resources/xorigincss3.html' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/security/resources/xorigincss3.html' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx">
</span><span class="cx"> PASS Testing cross-origin and MIME behavior for CSS.
</span><span class="cx"> PASS xorigincss3.html should not be loaded, even though it is same-origin
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss5expectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-5-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-5-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-5-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss4.html' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss4.html' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx">
</span><span class="cx"> PASS Testing cross-origin and MIME behavior for CSS.
</span><span class="cx"> PASS xorigincss4.html should not be loaded via @import.
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincss7expectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-7-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-7-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-7-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/security/resources/xorigincss5.html' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/security/resources/xorigincss5.html' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx">
</span><span class="cx"> PASS Testing cross-origin and MIME behavior for CSS.
</span><span class="cx"> PASS xorigincss5.html should not be loaded.
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks1expectedtxtfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks1expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.html' because non CSS MIME types are not allowed for cross-origin stylesheets.
+
+PASS Testing cross-origin and MIME behavior for CSS.
+PASS xorigincss1.html should not be loaded via <link>.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks1htmlfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks1html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1.html (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-1.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Cross-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet" href="/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.html"></link>
+
+<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 &lt;link&gt;.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id1" class="id1"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks2expectedtxtfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks2expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.html' because non CSS MIME types are not allowed for cross-origin stylesheets.
+
+PASS Testing cross-origin and MIME behavior for CSS.
+PASS xorigincss2.html should not be loaded either via <link> or @import.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks2htmlfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks2html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2.html (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-2.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Cross-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet" type="text/css" href="/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.html"></link>
+<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('id2'), 'rgba(0, 0, 0, 0)');
+ }, 'xorigincss2.html should not be loaded either via &lt;link&gt; or @import.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id2" class="id2"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks3expectedtxtfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks3expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Testing cross-origin and MIME behavior for CSS.
+PASS xorigincss1.css should be loaded via <link>
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks3htmlfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks3html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3.html (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-3.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Cross-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet"
+ href="/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.css"></link>
+
+<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('id3'), 'rgb(255, 255, 0)');
+ }, 'xorigincss1.css should be loaded via &lt;link&gt;');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id3" class="id3"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks4expectedtxtfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks4expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Testing cross-origin and MIME behavior for CSS.
+PASS xorigincss3.html should be loaded via <link>
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks4htmlfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks4html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4.html (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-4.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Cross-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet" href="resources/xorigincss3.html"></link>
+
+<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('id4'), 'rgb(255, 255, 0)');
+ }, 'xorigincss3.html should be loaded via &lt;link&gt;');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id4" class="id4"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks5expectedtxtfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks5expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss4.html' because non CSS MIME types are not allowed for cross-origin stylesheets.
+
+PASS Testing cross-origin and MIME behavior for CSS.
+PASS xorigincss4.html should not be loaded via @import.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks5htmlfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks5html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5.html (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-5.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Cross-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<style>
+@import "/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss4.html";
+</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('id5'), 'rgba(0, 0, 0, 0)');
+ }, 'xorigincss4.html should not be loaded via @import.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id5" class="id5"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks6expectedtxtfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks6expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Testing cross-origin and MIME behavior for CSS.
+PASS xorigincss2.css should be loaded.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks6htmlfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks6html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6.html (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-6.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Cross-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<style>
+@import "/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.css";
+</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('id6'), 'rgb(255, 255, 0)');
+ }, 'xorigincss2.css should be loaded.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id6" class="id6"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks7expectedtxtfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks7expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Testing cross-origin and MIME behavior for CSS.
+PASS xorigincss5.html should be loaded via @import.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks7htmlfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks7html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7.html (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-7.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Cross-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<style>
+@import "resources/xorigincss5.html";
+</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('id7'), 'rgb(255, 255, 0)');
+ }, 'xorigincss5.html should be loaded via @import.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id7" class="id7"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks8expectedtxtfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks8expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+Check that data: is still allowed for non-CORS cross-origin image fetches.
+
+PASS background image loaded
+
+PASS Testing cross-origin and MIME behavior for CSS.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritycrossorigincssinquirks8htmlfromrev187489trunkLayoutTestshttptestssecuritycrossorigincssinquirks8html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8.html (from rev 187489, trunk/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/cross-origin-css-in-quirks-8.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Cross-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<style>
+#data-background-url {
+ content: "PASS (image loaded)";
+ 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 () {
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <p>Check that data: is still allowed for non-CORS cross-origin image fetches.</p>
+ <div id="data-background-url">PASS background image loaded</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss1expectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincss1expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-1-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-1-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-1-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-1-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=/security/resources/xorigincss1.html' because non CSS MIME types are not allowed in strict mode.
+
+PASS Testing same-origin and MIME behavior for CSS.
+PASS xorigincss1.html should not be loaded via <link>.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss1htmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincss1html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-1.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-1.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-1.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-1.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Same-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet" href="/resources/redirect.php?url=/security/resources/xorigincss1.html"></link>
+
+<script>
+function getBackgroundColorForId(id) {
+ return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
+}
+
+var onloadTest = async_test("Testing same-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 &lt;link&gt;.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id1" class="id1"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss2expectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincss2expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-2-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-2-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-2-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-2-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=/security/resources/xorigincss2.html' because non CSS MIME types are not allowed in strict mode.
+
+PASS Testing same-origin and MIME behavior for CSS.
+PASS xorigincss2.html should not be loaded either via <link> or @import.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss2htmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincss2html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-2.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-2.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-2.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-2.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Same-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet" type="text/css" href="/resources/redirect.php?url=/security/resources/xorigincss2.html"></link>
+<script>
+function getBackgroundColorForId(id) {
+ return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
+}
+
+var onloadTest = async_test("Testing same-origin and MIME behavior for CSS.");
+
+window.onload = function () {
+ test(function () {
+ assert_equals(getBackgroundColorForId('id2'), 'rgba(0, 0, 0, 0)');
+ }, 'xorigincss2.html should not be loaded either via &lt;link&gt; or @import.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id2" class="id2"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss3expectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincss3expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-3-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-3-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-3-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-3-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Testing same-origin and MIME behavior for CSS.
+PASS xorigincss1.css should be loaded via <link>
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss3htmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincss3html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-3.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-3.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-3.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-3.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Same-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet"
+ href="/resources/redirect.php?url=/security/resources/xorigincss1.css"></link>
+
+<script>
+function getBackgroundColorForId(id) {
+ return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
+}
+
+var onloadTest = async_test("Testing same-origin and MIME behavior for CSS.");
+
+window.onload = function () {
+ test(function () {
+ assert_equals(getBackgroundColorForId('id3'), 'rgb(255, 255, 0)');
+ }, 'xorigincss1.css should be loaded via &lt;link&gt;');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id3" class="id3"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss4expectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincss4expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-4-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-4-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-4-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-4-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Testing same-origin and MIME behavior for CSS.
+PASS xorigincss3.html should not be loaded, even though it is same-origin
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss4htmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincss4html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-4.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-4.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-4.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-4.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Same-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet" href="resources/xorigincss3.html"></link>
+
+<script>
+function getBackgroundColorForId(id) {
+ return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
+}
+
+var onloadTest = async_test("Testing same-origin and MIME behavior for CSS.");
+
+window.onload = function () {
+ test(function () {
+ assert_equals(getBackgroundColorForId('id4'), 'rgba(0, 0, 0, 0)');
+ }, 'xorigincss3.html should not be loaded, even though it is same-origin');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id4" class="id4"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss5expectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincss5expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-5-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-5-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-5-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-5-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/resources/redirect.php?url=/security/resources/xorigincss4.html' because non CSS MIME types are not allowed in strict mode.
+
+PASS Testing same-origin and MIME behavior for CSS.
+PASS xorigincss4.html should not be loaded via @import.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss5htmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincss5html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-5.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-5.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-5.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-5.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Same-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<style>
+@import "/resources/redirect.php?url=/security/resources/xorigincss4.html";
+</style>
+<script>
+function getBackgroundColorForId(id) {
+ return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
+}
+
+var onloadTest = async_test("Testing same-origin and MIME behavior for CSS.");
+
+window.onload = function () {
+ test(function () {
+ assert_equals(getBackgroundColorForId('id5'), 'rgba(0, 0, 0, 0)');
+ }, 'xorigincss4.html should not be loaded via @import.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id5" class="id5"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss6expectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincss6expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-6-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-6-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-6-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-6-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Testing same-origin and MIME behavior for CSS.
+PASS xorigincss2.css should be loaded.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss6htmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincss6html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-6.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-6.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-6.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-6.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Same-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<style>
+@import "/resources/redirect.php?url=/security/resources/xorigincss2.css";
+</style>
+<script>
+function getBackgroundColorForId(id) {
+ return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
+}
+
+var onloadTest = async_test("Testing same-origin and MIME behavior for CSS.");
+
+window.onload = function () {
+ test(function () {
+ assert_equals(getBackgroundColorForId('id6'), 'rgb(255, 255, 0)');
+ }, 'xorigincss2.css should be loaded.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id6" class="id6"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss7expectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincss7expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-7-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-7-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-7-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-7-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/security/resources/xorigincss5.html' because non CSS MIME types are not allowed in strict mode.
+
+PASS Testing same-origin and MIME behavior for CSS.
+PASS xorigincss5.html should not be loaded.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss7htmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincss7html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-7.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-7.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-7.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-7.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Same-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<style>
+@import "resources/xorigincss5.html";
+</style>
+<script>
+function getBackgroundColorForId(id) {
+ return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
+}
+
+var onloadTest = async_test("Testing same-origin and MIME behavior for CSS.");
+
+window.onload = function () {
+ test(function () {
+ assert_equals(getBackgroundColorForId('id7'), 'rgba(0, 0, 0, 0)');
+ }, 'xorigincss5.html should not be loaded.');
+
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <div id="id7" class="id7"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss8expectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincss8expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-8-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-8-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-8-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-8-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+Check that data: is still allowed for non-CORS cross-origin image fetches.
+
+PASS background image loaded
+
+PASS Testing same-origin and MIME behavior for CSS.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincss8htmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincss8html"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-8.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-8.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-8.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-8.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Same-origin CSS</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<style>
+#data-background-url {
+ content: "PASS (image loaded)";
+ 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 same-origin and MIME behavior for CSS.");
+
+window.onload = function () {
+ onloadTest.done();
+};
+</script>
+</head>
+<body>
+ <p>Check that data: is still allowed for non-CORS cross-origin image fetches.</p>
+ <div id="data-background-url">PASS background image loaded</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincssinquirksexpectedtxtfromrev187489trunkLayoutTestshttptestssecuritysameorigincssinquirksexpectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-in-quirks-expected.txt (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-in-quirks-expected.txt) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-in-quirks-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-in-quirks-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+PASS background image loaded
+
+PASS Testing same-origin and MIME behavior for CSS.
+PASS xorigincss1.html should be loaded via <link>.
+PASS xorigincss2.html should be loaded either via <link> or @import.
+PASS xorigincss1.css should be loaded via <link>
+PASS xorigincss3.html should be loaded
+PASS xorigincss4.html should be loaded via @import.
+PASS xorigincss2.css should be loaded.
+PASS xorigincss5.html should be loaded.
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestshttptestssecuritysameorigincssinquirkshtmlfromrev187489trunkLayoutTestshttptestssecuritysameorigincssinquirkshtml"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-in-quirks.html (from rev 187489, trunk/LayoutTests/http/tests/security/same-origin-css-in-quirks.html) (0 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-in-quirks.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/http/tests/security/same-origin-css-in-quirks.html        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+<html>
+<!--
+ Note the lack of doctype above: That is intentional. This test
+ MUST be in quirks mode to have any real testing power.
+-->
+<head>
+<title>Same-origin CSS in quirks mode</title>
+
+<script src="/w3c/resources/testharness.js"></script>
+<script src="/w3c/resources/testharnessreport.js"></script>
+
+<link rel="stylesheet"
+ href="/resources/redirect.php?url=/security/resources/xorigincss1.html"></link>
+<link rel="stylesheet"
+ type="text/css"
+ href="/resources/redirect.php?url=/security/resources/xorigincss2.html"></link>
+<link rel="stylesheet"
+ href="/resources/redirect.php?url=/security/resources/xorigincss1.css"></link>
+<link rel="stylesheet"
+ href="resources/xorigincss3.html"></link>
+<style>
+/* Deliberately reuse the same file / class / id on this first one */
+@import "/resources/redirect.php?url=/security/resources/xorigincss2.html";
+@import "/resources/redirect.php?url=/security/resources/xorigincss4.html";
+@import "/resources/redirect.php?url=/security/resources/xorigincss2.css";
+@import "resources/xorigincss5.html";
+
+/* Check that data: is still allowed for non-CORS cross-origin image fetches. */
+#data-background-url {
+ content: "PASS (image loaded)";
+ 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 same-origin and MIME behavior for CSS.");
+ window.onload = function () {
+ test(function () {
+ assert_equals(getBackgroundColorForId('id1'), 'rgb(255, 255, 0)');
+ }, 'xorigincss1.html should be loaded via &lt;link&gt;.');
+ test(function () {
+ assert_equals(getBackgroundColorForId('id2'), 'rgb(255, 255, 0)');
+ }, 'xorigincss2.html should be loaded either via &lt;link&gt; or @import.');
+ test(function () {
+ assert_equals(getBackgroundColorForId('id3'), 'rgb(255, 255, 0)');
+ }, 'xorigincss1.css should be loaded via &lt;link&gt;');
+ test(function () {
+ assert_equals(getBackgroundColorForId('id4'), 'rgb(255, 255, 0)');
+ }, 'xorigincss3.html should be loaded');
+ test(function () {
+ assert_equals(getBackgroundColorForId('id5'), 'rgb(255, 255, 0)');
+ }, 'xorigincss4.html should 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'), 'rgb(255, 255, 0)');
+ }, 'xorigincss5.html should 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="id8" class="id8"></div>
+ <div id="data-background-url">PASS background image loaded</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestsplatformmachttptestsmiscacid3expectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/misc/resources/acid3/empty.css' because its MIME type was invalid.
</del><ins>+CONSOLE MESSAGE: Did not parse stylesheet at 'http://127.0.0.1:8000/misc/resources/acid3/empty.css' because non CSS MIME types are not allowed in strict mode.
</ins><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx"> RenderView at (0,0) size 800x600
</span><span class="cx"> layer at (20,20) size 644x433
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -1,5 +1,59 @@
</span><span class="cx"> 2015-07-31 Lucas Forschler <lforschler@apple.com>
</span><span class="cx">
</span><ins>+ Merge r187489
+
+ 2015-07-28 Chris Dumez <cdumez@apple.com>
+
+ Allow lax MIME type parsing for same-origin CSS in quirks mode.
+ https://bugs.webkit.org/show_bug.cgi?id=147327
+ <rdar://problem/22010303>
+
+ Reviewed by Zalan Bujtas.
+
+ The change made in r180020 is too strict for the web, and doesn't match Firefox
+ Chrome, or IE's behavior. In particular, it does not respect the same-origin
+ carveout that the HTML spec specifies:
+ https://html.spec.whatwg.org/multipage/semantics.html#link-type-stylesheet
+
+ This patch corrects that oversight and aligns our behavior with other popular
+ browsers.
+
+ This change was adapted from Blink r196678:
+ https://src.chromium.org/viewvc/blink?revision=196678&view=revision
+
+ Tests: http/tests/security/cross-origin-css-in-quirks-1.html
+ http/tests/security/cross-origin-css-in-quirks-2.html
+ http/tests/security/cross-origin-css-in-quirks-3.html
+ http/tests/security/cross-origin-css-in-quirks-4.html
+ http/tests/security/cross-origin-css-in-quirks-5.html
+ http/tests/security/cross-origin-css-in-quirks-6.html
+ http/tests/security/cross-origin-css-in-quirks-7.html
+ http/tests/security/cross-origin-css-in-quirks-8.html
+ http/tests/security/same-origin-css-1.html
+ http/tests/security/same-origin-css-2.html
+ http/tests/security/same-origin-css-3.html
+ http/tests/security/same-origin-css-4.html
+ http/tests/security/same-origin-css-5.html
+ http/tests/security/same-origin-css-6.html
+ http/tests/security/same-origin-css-7.html
+ http/tests/security/same-origin-css-8.html
+ http/tests/security/same-origin-css-in-quirks.html
+
+ * css/StyleRuleImport.cpp:
+ (WebCore::StyleRuleImport::setCSSStyleSheet):
+ * css/StyleSheetContents.cpp:
+ (WebCore::StyleSheetContents::parseAuthorStyleSheet):
+ * css/StyleSheetContents.h:
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::setCSSStyleSheet):
+ * loader/cache/CachedCSSStyleSheet.cpp:
+ (WebCore::CachedCSSStyleSheet::sheetText):
+ (WebCore::CachedCSSStyleSheet::canUseSheet):
+ (WebCore::CachedCSSStyleSheet::checkNotify): Deleted.
+ * loader/cache/CachedCSSStyleSheet.h:
+
+2015-07-31 Lucas Forschler <lforschler@apple.com>
+
</ins><span class="cx"> Merge r187466
</span><span class="cx">
</span><span class="cx"> 2015-07-27 Brady Eidson <beidson@apple.com>
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCorecssStyleRuleImportcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/css/StyleRuleImport.cpp (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/css/StyleRuleImport.cpp        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/Source/WebCore/css/StyleRuleImport.cpp        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -70,8 +70,9 @@
</span><span class="cx"> if (!baseURL.isNull())
</span><span class="cx"> context.baseURL = baseURL;
</span><span class="cx">
</span><ins>+ Document* document = m_parentStyleSheet ? m_parentStyleSheet->singleOwnerDocument() : nullptr;
</ins><span class="cx"> m_styleSheet = StyleSheetContents::create(this, href, context);
</span><del>- m_styleSheet->parseAuthorStyleSheet(cachedStyleSheet);
</del><ins>+ m_styleSheet->parseAuthorStyleSheet(cachedStyleSheet, document ? document->securityOrigin() : nullptr);
</ins><span class="cx">
</span><span class="cx"> m_loading = false;
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCorecssStyleSheetContentscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/css/StyleSheetContents.cpp (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/css/StyleSheetContents.cpp        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/Source/WebCore/css/StyleSheetContents.cpp        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PageConsoleClient.h"
</span><span class="cx"> #include "RuleSet.h"
</span><ins>+#include "SecurityOrigin.h"
</ins><span class="cx"> #include "StyleProperties.h"
</span><span class="cx"> #include "StyleRule.h"
</span><span class="cx"> #include "StyleRuleImport.h"
</span><span class="lines">@@ -290,16 +291,22 @@
</span><span class="cx"> return it->value;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cachedStyleSheet)
</del><ins>+void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cachedStyleSheet, const SecurityOrigin* securityOrigin)
</ins><span class="cx"> {
</span><ins>+ bool isSameOriginRequest = securityOrigin && securityOrigin->canRequest(baseURL());
+ CachedCSSStyleSheet::MIMETypeCheck mimeTypeCheck = isStrictParserMode(m_parserContext.mode) || !isSameOriginRequest ? CachedCSSStyleSheet::MIMETypeCheck::Strict : CachedCSSStyleSheet::MIMETypeCheck::Lax;
</ins><span class="cx"> bool hasValidMIMEType = true;
</span><del>- String sheetText = cachedStyleSheet->sheetText(&hasValidMIMEType);
</del><ins>+ String sheetText = cachedStyleSheet->sheetText(mimeTypeCheck, &hasValidMIMEType);
</ins><span class="cx">
</span><span class="cx"> if (!hasValidMIMEType) {
</span><span class="cx"> ASSERT(sheetText.isNull());
</span><span class="cx"> if (auto* document = singleOwnerDocument()) {
</span><del>- if (auto* page = document->page())
- page->console().addMessage(MessageSource::Security, MessageLevel::Error, "Did not parse stylesheet at '" + cachedStyleSheet->url().stringCenterEllipsizedToLength() + "' because its MIME type was invalid.");
</del><ins>+ if (auto* page = document->page()) {
+ if (isStrictParserMode(m_parserContext.mode))
+ page->console().addMessage(MessageSource::Security, MessageLevel::Error, "Did not parse stylesheet at '" + cachedStyleSheet->url().stringCenterEllipsizedToLength() + "' because non CSS MIME types are not allowed in strict mode.");
+ else
+ page->console().addMessage(MessageSource::Security, MessageLevel::Error, "Did not parse stylesheet at '" + cachedStyleSheet->url().stringCenterEllipsizedToLength() + "' because non CSS MIME types are not allowed for cross-origin stylesheets.");
+ }
</ins><span class="cx"> }
</span><span class="cx"> return;
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCorecssStyleSheetContentsh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/css/StyleSheetContents.h (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/css/StyleSheetContents.h        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/Source/WebCore/css/StyleSheetContents.h        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> class Node;
</span><span class="cx"> class StyleRuleBase;
</span><span class="cx"> class StyleRuleImport;
</span><ins>+class SecurityOrigin;
</ins><span class="cx">
</span><span class="cx"> class StyleSheetContents : public RefCounted<StyleSheetContents> {
</span><span class="cx"> public:
</span><span class="lines">@@ -62,7 +63,7 @@
</span><span class="cx">
</span><span class="cx"> const AtomicString& determineNamespace(const AtomicString& prefix);
</span><span class="cx">
</span><del>- void parseAuthorStyleSheet(const CachedCSSStyleSheet*);
</del><ins>+ void parseAuthorStyleSheet(const CachedCSSStyleSheet*, const SecurityOrigin*);
</ins><span class="cx"> WEBCORE_EXPORT bool parseString(const String&);
</span><span class="cx"> bool parseStringAtPosition(const String&, const TextPosition&, bool createdByParser);
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/html/HTMLLinkElement.cpp (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/html/HTMLLinkElement.cpp        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/Source/WebCore/html/HTMLLinkElement.cpp        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -346,7 +346,7 @@
</span><span class="cx"> m_sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(m_media));
</span><span class="cx"> m_sheet->setTitle(title());
</span><span class="cx">
</span><del>- styleSheet.get().parseAuthorStyleSheet(cachedStyleSheet);
</del><ins>+ styleSheet.get().parseAuthorStyleSheet(cachedStyleSheet, document().securityOrigin());
</ins><span class="cx">
</span><span class="cx"> m_loading = false;
</span><span class="cx"> styleSheet.get().notifyLoadedSheet(cachedStyleSheet);
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreloadercacheCachedCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -78,9 +78,9 @@
</span><span class="cx"> return m_decoder->encoding().name();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const String CachedCSSStyleSheet::sheetText(bool* hasValidMIMEType) const
</del><ins>+const String CachedCSSStyleSheet::sheetText(MIMETypeCheck mimeTypeCheck, bool* hasValidMIMEType) const
</ins><span class="cx"> {
</span><del>- if (!m_data || m_data->isEmpty() || !canUseSheet(hasValidMIMEType))
</del><ins>+ if (!m_data || m_data->isEmpty() || !canUseSheet(mimeTypeCheck, hasValidMIMEType))
</ins><span class="cx"> return String();
</span><span class="cx">
</span><span class="cx"> if (!m_decodedSheetText.isNull())
</span><span class="lines">@@ -113,11 +113,14 @@
</span><span class="cx"> c->setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), m_decoder->encoding().name(), this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CachedCSSStyleSheet::canUseSheet(bool* hasValidMIMEType) const
</del><ins>+bool CachedCSSStyleSheet::canUseSheet(MIMETypeCheck mimeTypeCheck, bool* hasValidMIMEType) const
</ins><span class="cx"> {
</span><span class="cx"> if (errorOccurred())
</span><span class="cx"> return false;
</span><span class="cx">
</span><ins>+ if (mimeTypeCheck == MIMETypeCheck::Lax)
+ return true;
+
</ins><span class="cx"> // This check exactly matches Firefox. Note that we grab the Content-Type
</span><span class="cx"> // header directly because we want to see what the value is BEFORE content
</span><span class="cx"> // sniffing. Firefox does this by setting a "type hint" on the channel.
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreloadercacheCachedCSSStyleSheeth"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h (187649 => 187650)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2015-07-31 16:35:39 UTC (rev 187649)
+++ branches/safari-601.1-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2015-07-31 16:42:09 UTC (rev 187650)
</span><span class="lines">@@ -41,13 +41,14 @@
</span><span class="cx"> CachedCSSStyleSheet(const ResourceRequest&, const String& charset, SessionID);
</span><span class="cx"> virtual ~CachedCSSStyleSheet();
</span><span class="cx">
</span><del>- const String sheetText(bool* hasValidMIMEType = nullptr) const;
</del><ins>+ enum class MIMETypeCheck { Strict, Lax };
+ const String sheetText(MIMETypeCheck = MIMETypeCheck::Strict, bool* hasValidMIMEType = nullptr) const;
</ins><span class="cx">
</span><span class="cx"> PassRefPtr<StyleSheetContents> restoreParsedStyleSheet(const CSSParserContext&, CachePolicy);
</span><span class="cx"> void saveParsedStyleSheet(Ref<StyleSheetContents>&&);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- bool canUseSheet(bool* hasValidMIMEType) const;
</del><ins>+ bool canUseSheet(MIMETypeCheck, bool* hasValidMIMEType) const;
</ins><span class="cx"> virtual bool mayTryReplaceEncodedData() const override { return true; }
</span><span class="cx">
</span><span class="cx"> virtual void didAddClient(CachedResourceClient*) override;
</span></span></pre>
</div>
</div>
</body>
</html>