<!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>[187454] branches/safari-600.1.4.17-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/187454">187454</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-07-27 15:10:55 -0700 (Mon, 27 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Roll out <a href="http://trac.webkit.org/projects/webkit/changeset/180020">r180020</a>. rdar://problem/21716511</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6001417branchLayoutTestsChangeLog">branches/safari-600.1.4.17-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6001417branchLayoutTestshttptestsmisccssacceptanytypeexpectedtxt">branches/safari-600.1.4.17-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt</a></li>
<li><a href="#branchessafari6001417branchLayoutTestshttptestsmisccssacceptanytypehtml">branches/safari-600.1.4.17-branch/LayoutTests/http/tests/misc/css-accept-any-type.html</a></li>
<li><a href="#branchessafari6001417branchLayoutTestshttptestssecuritycrossorigincssexpectedtxt">branches/safari-600.1.4.17-branch/LayoutTests/http/tests/security/cross-origin-css-expected.txt</a></li>
<li><a href="#branchessafari6001417branchLayoutTestshttptestssecuritycrossorigincsshtml">branches/safari-600.1.4.17-branch/LayoutTests/http/tests/security/cross-origin-css.html</a></li>
<li><a href="#branchessafari6001417branchSourceWebCoreChangeLog">branches/safari-600.1.4.17-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6001417branchSourceWebCorecssStyleSheetContentscpp">branches/safari-600.1.4.17-branch/Source/WebCore/css/StyleSheetContents.cpp</a></li>
<li><a href="#branchessafari6001417branchSourceWebCoredomProcessingInstructioncpp">branches/safari-600.1.4.17-branch/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#branchessafari6001417branchSourceWebCoreinspectorInspectorPageAgentcpp">branches/safari-600.1.4.17-branch/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#branchessafari6001417branchSourceWebCoreloadercacheCachedCSSStyleSheetcpp">branches/safari-600.1.4.17-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp</a></li>
<li><a href="#branchessafari6001417branchSourceWebCoreloadercacheCachedCSSStyleSheeth">branches/safari-600.1.4.17-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6001417branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/LayoutTests/ChangeLog (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/LayoutTests/ChangeLog        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/LayoutTests/ChangeLog        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -1,5 +1,9 @@
</span><span class="cx"> 2015-07-27 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Roll out r180020.
+
+2015-07-27 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Roll out r182829.
</span><span class="cx">
</span><span class="cx"> 2015-07-24 Babak Shafiei <bshafiei@apple.com>
</span></span></pre></div>
<a id="branchessafari6001417branchLayoutTestshttptestsmisccssacceptanytypeexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><del>-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.
</del><ins>+Test for http://bugs.webkit.org/show_bug.cgi?id=11451 REGRESSION: Dell.com does not render correctly in ToT (stylesheet not loaded).
</ins><span class="cx">
</span><span class="cx"> SUCCESS
</span></span></pre></div>
<a id="branchessafari6001417branchLayoutTestshttptestsmisccssacceptanytypehtml"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/LayoutTests/http/tests/misc/css-accept-any-type.html (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/LayoutTests/http/tests/misc/css-accept-any-type.html        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/LayoutTests/http/tests/misc/css-accept-any-type.html        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -10,17 +10,14 @@
</span><span class="cx">
</span><span class="cx"> var target = document.getElementById("target");
</span><span class="cx"> var style = getComputedStyle(target);
</span><del>- target.innerText = style.position == "relative" ? "FAIL" : "SUCCESS";
</del><ins>+ target.innerText = style.position == "relative" ? "SUCCESS" : "FAIL";
</ins><span class="cx"> }
</span><span class="cx"> </script>
</span><span class="cx"> </head>
</span><span class="cx"> <body onload="test()">
</span><span class="cx"> <p>
</span><del>- 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.
</del><ins>+ 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>.
</ins><span class="cx"> </p>
</span><span class="cx"> <p id="target">
</span><span class="cx"> </p>
</span></span></pre></div>
<a id="branchessafari6001417branchLayoutTestshttptestssecuritycrossorigincssexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/LayoutTests/http/tests/security/cross-origin-css-expected.txt (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/LayoutTests/http/tests/security/cross-origin-css-expected.txt        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/LayoutTests/http/tests/security/cross-origin-css-expected.txt        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -1,11 +1,7 @@
</span><del>-PASS background image loaded
-
-PASS Testing cross-origin and MIME behavior for CSS.
-PASS xorigincss1.html should not be loaded via .
-PASS xorigincss2.html should not be loaded either via or @import.
-PASS xorigincss1.css should be loaded via
-PASS xorigincss3.html should not be loaded, even though it is same-origin
-PASS xorigincss4.html should not be loaded via @import.
-PASS xorigincss2.css should be loaded.
-PASS xorigincss5.html should not be loaded.
-
</del><ins>+LINK Cross-origin, HTML, valid: rgb(255, 255, 0)
+LINK + IMPORT Cross-origin, HTML, invalid: rgba(0, 0, 0, 0)
+LINK Cross-origin, CSS, invalid: rgb(255, 255, 0)
+LINK Same-origin, HTML, invalid: rgb(255, 255, 0)
+IMPORT Cross-origin, HTML, valid: rgb(255, 255, 0)
+IMPORT Cross-origin, CSS, invalid: rgb(255, 255, 0)
+IMPORT Same-origin, HTML, invalid: rgb(255, 255, 0)
</ins></span></pre></div>
<a id="branchessafari6001417branchLayoutTestshttptestssecuritycrossorigincsshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/LayoutTests/http/tests/security/cross-origin-css.html (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/LayoutTests/http/tests/security/cross-origin-css.html        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/LayoutTests/http/tests/security/cross-origin-css.html        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -1,12 +1,5 @@
</span><del>-<!DOCTYPE html>
</del><span class="cx"> <html>
</span><span class="cx"> <head>
</span><del>-<title>Cross-origin CSS</title>
-
-<script src="/w3c/resources/testharness.js"></script>
-<script src="/w3c/resources/testharnessreport.js"></script>
-
-<!-- Bring in various same- and cross-origin stylesheets. -->
</del><span class="cx"> <link rel="stylesheet"
</span><span class="cx"> href="/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.html"></link>
</span><span class="cx"> <link rel="stylesheet"
</span><span class="lines">@@ -16,68 +9,39 @@
</span><span class="cx"> href="/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss1.css"></link>
</span><span class="cx"> <link rel="stylesheet"
</span><span class="cx"> href="resources/xorigincss3.html"></link>
</span><ins>+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
</ins><span class="cx">
</span><ins>+window.onload = function() {
+ ele = document.getElementById("id1");
+ ele.innerText = "LINK Cross-origin, HTML, valid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id2");
+ ele.innerText = "LINK + IMPORT Cross-origin, HTML, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id3");
+ ele.innerText = "LINK Cross-origin, CSS, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id4");
+ ele.innerText = "LINK Same-origin, HTML, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id5");
+ ele.innerText = "IMPORT Cross-origin, HTML, valid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id6");
+ ele.innerText = "IMPORT Cross-origin, CSS, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ ele = document.getElementById("id7");
+ ele.innerText = "IMPORT Same-origin, HTML, invalid: " + window.getComputedStyle(ele, null).getPropertyValue('background-color');
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+</script>
</ins><span class="cx"> <style>
</span><span class="cx"> /* Deliberately reuse the same file / class / id on this first one */
</span><span class="cx"> @import "/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.html";
</span><span class="cx"> @import "/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss4.html";
</span><span class="cx"> @import "/resources/redirect.php?url=http://localhost:8000/security/resources/xorigincss2.css";
</span><span class="cx"> @import "resources/xorigincss5.html";
</span><del>-
-/* 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>");
-}
</del><span class="cx"> </style>
</span><del>-<script>
-function getBackgroundColorForId(id) {
- return window.getComputedStyle(document.getElementById(id), null).getPropertyValue('background-color')
-}
-
-var onloadTest = async_test("Testing cross-origin and MIME behavior for CSS.");
-
-window.onload = function () {
- test(function () {
- assert_equals(getBackgroundColorForId('id1'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss1.html should not be loaded via <link>.');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id2'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss2.html should not be loaded either via <link> or @import.');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id3'), 'rgb(255, 255, 0)');
- }, 'xorigincss1.css should be loaded via <link>');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id4'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss3.html should not be loaded, even though it is same-origin');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id5'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss4.html should not be loaded via @import.');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id6'), 'rgb(255, 255, 0)');
- }, 'xorigincss2.css should be loaded.');
-
- test(function () {
- assert_equals(getBackgroundColorForId('id7'), 'rgba(0, 0, 0, 0)');
- }, 'xorigincss5.html should not be loaded.');
-
- onloadTest.done();
-};
-</script>
</del><span class="cx"> </head>
</span><del>-<body>
- <div id="id1" class="id1"></div>
- <div id="id2" class="id2"></div>
- <div id="id3" class="id3"></div>
- <div id="id4" class="id4"></div>
- <div id="id5" class="id5"></div>
- <div id="id6" class="id6"></div>
- <div id="id7" class="id7"></div>
- <div id="data-background-url">PASS background image loaded</div>
-</body>
</del><ins>+<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></body>
</ins><span class="cx"> </html>
</span></span></pre></div>
<a id="branchessafari6001417branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/Source/WebCore/ChangeLog (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/Source/WebCore/ChangeLog        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/Source/WebCore/ChangeLog        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -1,5 +1,9 @@
</span><span class="cx"> 2015-07-27 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Roll out r180020.
+
+2015-07-27 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Roll out r182829.
</span><span class="cx">
</span><span class="cx"> 2015-07-24 Babak Shafiei <bshafiei@apple.com>
</span></span></pre></div>
<a id="branchessafari6001417branchSourceWebCorecssStyleSheetContentscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/Source/WebCore/css/StyleSheetContents.cpp (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/Source/WebCore/css/StyleSheetContents.cpp        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/Source/WebCore/css/StyleSheetContents.cpp        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -285,8 +285,11 @@
</span><span class="cx">
</span><span class="cx"> void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cachedStyleSheet, const SecurityOrigin* securityOrigin)
</span><span class="cx"> {
</span><ins>+ // Check to see if we should enforce the MIME type of the CSS resource in strict mode.
+ // Running in iWeb 2 is one example of where we don't want to - <rdar://problem/6099748>
+ bool enforceMIMEType = isStrictParserMode(m_parserContext.mode) && m_parserContext.enforcesCSSMIMETypeInNoQuirksMode;
</ins><span class="cx"> bool hasValidMIMEType = false;
</span><del>- String sheetText = cachedStyleSheet->sheetText(&hasValidMIMEType);
</del><ins>+ String sheetText = cachedStyleSheet->sheetText(enforceMIMEType, &hasValidMIMEType);
</ins><span class="cx">
</span><span class="cx"> CSSParser p(parserContext());
</span><span class="cx"> p.parseSheet(this, sheetText, 0, 0, true);
</span></span></pre></div>
<a id="branchessafari6001417branchSourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/Source/WebCore/dom/ProcessingInstruction.cpp (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/Source/WebCore/dom/ProcessingInstruction.cpp        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/Source/WebCore/dom/ProcessingInstruction.cpp        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx"> // We don't need the cross-origin security check here because we are
</span><span class="cx"> // getting the sheet text in "strict" mode. This enforces a valid CSS MIME
</span><span class="cx"> // type.
</span><del>- parseStyleSheet(sheet->sheetText());
</del><ins>+ parseStyleSheet(sheet->sheetText(true));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(XSLT)
</span></span></pre></div>
<a id="branchessafari6001417branchSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/Source/WebCore/inspector/InspectorPageAgent.cpp (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx"> if (cachedResource) {
</span><span class="cx"> switch (cachedResource->type()) {
</span><span class="cx"> case CachedResource::CSSStyleSheet:
</span><del>- *result = toCachedCSSStyleSheet(cachedResource)->sheetText();
</del><ins>+ *result = toCachedCSSStyleSheet(cachedResource)->sheetText(false);
</ins><span class="cx"> return true;
</span><span class="cx"> case CachedResource::Script:
</span><span class="cx"> *result = toCachedScript(cachedResource)->script();
</span></span></pre></div>
<a id="branchessafari6001417branchSourceWebCoreloadercacheCachedCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -77,17 +77,17 @@
</span><span class="cx"> {
</span><span class="cx"> return m_decoder->encoding().name();
</span><span class="cx"> }
</span><del>-
-const String CachedCSSStyleSheet::sheetText(bool* hasValidMIMEType) const
-{
</del><ins>+
+const String CachedCSSStyleSheet::sheetText(bool enforceMIMEType, bool* hasValidMIMEType) const
+{
</ins><span class="cx"> ASSERT(!isPurgeable());
</span><span class="cx">
</span><del>- if (!m_data || m_data->isEmpty() || !canUseSheet(hasValidMIMEType))
</del><ins>+ if (!m_data || m_data->isEmpty() || !canUseSheet(enforceMIMEType, hasValidMIMEType))
</ins><span class="cx"> return String();
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!m_decodedSheetText.isNull())
</span><span class="cx"> return m_decodedSheetText;
</span><del>-
</del><ins>+
</ins><span class="cx"> // Don't cache the decoded text, regenerating is cheap and it can use quite a bit of memory
</span><span class="cx"> return m_decoder->decodeAndFlush(m_data->data(), m_data->size());
</span><span class="cx"> }
</span><span class="lines">@@ -115,10 +115,13 @@
</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(bool enforceMIMEType, bool* hasValidMIMEType) const
</ins><span class="cx"> {
</span><span class="cx"> if (errorOccurred())
</span><span class="cx"> return false;
</span><ins>+
+ if (!enforceMIMEType && !hasValidMIMEType)
+ return true;
</ins><span class="cx">
</span><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="lines">@@ -131,6 +134,8 @@
</span><span class="cx"> bool typeOK = mimeType.isEmpty() || equalIgnoringCase(mimeType, "text/css") || equalIgnoringCase(mimeType, "application/x-unknown-content-type");
</span><span class="cx"> if (hasValidMIMEType)
</span><span class="cx"> *hasValidMIMEType = typeOK;
</span><ins>+ if (!enforceMIMEType)
+ return true;
</ins><span class="cx"> return typeOK;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6001417branchSourceWebCoreloadercacheCachedCSSStyleSheeth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.17-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h (187453 => 187454)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.17-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2015-07-27 22:07:12 UTC (rev 187453)
+++ branches/safari-600.1.4.17-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2015-07-27 22:10:55 UTC (rev 187454)
</span><span class="lines">@@ -41,13 +41,13 @@
</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>+ const String sheetText(bool enforceMIMEType = true, bool* hasValidMIMEType = 0) const;
</ins><span class="cx">
</span><span class="cx"> PassRefPtr<StyleSheetContents> restoreParsedStyleSheet(const CSSParserContext&);
</span><span class="cx"> void saveParsedStyleSheet(PassRef<StyleSheetContents>);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- bool canUseSheet(bool* hasValidMIMEType) const;
</del><ins>+ bool canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const;
</ins><span class="cx"> virtual PurgePriority purgePriority() const override { return PurgeLast; }
</span><span class="cx"> virtual bool mayTryReplaceEncodedData() const override { return true; }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>