<!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>[186619] branches/safari-600.8-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/186619">186619</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-07-09 14:02:51 -0700 (Thu, 09 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/186551">r186551</a>. rdar://problem/21716372</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6008branchLayoutTestsChangeLog">branches/safari-600.8-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6008branchLayoutTestshttptestsmisccssacceptanytypeexpectedtxt">branches/safari-600.8-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt</a></li>
<li><a href="#branchessafari6008branchLayoutTestshttptestsmisccssacceptanytypehtml">branches/safari-600.8-branch/LayoutTests/http/tests/misc/css-accept-any-type.html</a></li>
<li><a href="#branchessafari6008branchLayoutTestshttptestssecuritycrossorigincssexpectedtxt">branches/safari-600.8-branch/LayoutTests/http/tests/security/cross-origin-css-expected.txt</a></li>
<li><a href="#branchessafari6008branchLayoutTestshttptestssecuritycrossorigincsshtml">branches/safari-600.8-branch/LayoutTests/http/tests/security/cross-origin-css.html</a></li>
<li><a href="#branchessafari6008branchSourceWebCoreChangeLog">branches/safari-600.8-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6008branchSourceWebCorecssStyleSheetContentscpp">branches/safari-600.8-branch/Source/WebCore/css/StyleSheetContents.cpp</a></li>
<li><a href="#branchessafari6008branchSourceWebCoredomProcessingInstructioncpp">branches/safari-600.8-branch/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#branchessafari6008branchSourceWebCoreinspectorInspectorPageAgentcpp">branches/safari-600.8-branch/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#branchessafari6008branchSourceWebCoreloadercacheCachedCSSStyleSheetcpp">branches/safari-600.8-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp</a></li>
<li><a href="#branchessafari6008branchSourceWebCoreloadercacheCachedCSSStyleSheeth">branches/safari-600.8-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6008branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/LayoutTests/ChangeLog (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/LayoutTests/ChangeLog        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/LayoutTests/ChangeLog        2015-07-09 21:02:51 UTC (rev 186619)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> 2015-07-09 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r186551. rdar://problem/21716372
+
+ 2015-07-08 Matthew Hanson <matthew_hanson@apple.com>
+
+ Merge r180020. rdar://problem/21716511
+
+ 2015-02-12 Chris Dumez <cdumez@apple.com>
+
+ Drop the quirks-mode exception for CSS MIME types
+ https://bugs.webkit.org/show_bug.cgi?id=141501
+
+ Reviewed by Alexey Proskuryakov.
+
+ Update a couple of layout tests now that we dropped the quirks-mode
+ exception for CSS MIME types.
+
+ * http/tests/misc/css-accept-any-type-expected.txt:
+ * http/tests/misc/css-accept-any-type.html:
+ * http/tests/security/cross-origin-css-expected.txt:
+ * http/tests/security/cross-origin-css.html:
+
+2015-07-09 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r186539. rdar://problem/21707873
</span><span class="cx">
</span><span class="cx"> 2015-07-08 Lucas Forschler <lforschler@apple.com>
</span></span></pre></div>
<a id="branchessafari6008branchLayoutTestshttptestsmisccssacceptanytypeexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt        2015-07-09 21:02:51 UTC (rev 186619)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><del>-Test for http://bugs.webkit.org/show_bug.cgi?id=11451 REGRESSION: Dell.com does not render correctly in ToT (stylesheet not loaded).
</del><ins>+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.
</ins><span class="cx">
</span><span class="cx"> SUCCESS
</span></span></pre></div>
<a id="branchessafari6008branchLayoutTestshttptestsmisccssacceptanytypehtml"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/LayoutTests/http/tests/misc/css-accept-any-type.html (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/LayoutTests/http/tests/misc/css-accept-any-type.html        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/LayoutTests/http/tests/misc/css-accept-any-type.html        2015-07-09 21:02:51 UTC (rev 186619)
</span><span class="lines">@@ -10,14 +10,17 @@
</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" ? "SUCCESS" : "FAIL";
</del><ins>+ target.innerText = style.position == "relative" ? "FAIL" : "SUCCESS";
</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>- 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>.
</del><ins>+ 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.
</ins><span class="cx"> </p>
</span><span class="cx"> <p id="target">
</span><span class="cx"> </p>
</span></span></pre></div>
<a id="branchessafari6008branchLayoutTestshttptestssecuritycrossorigincssexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/LayoutTests/http/tests/security/cross-origin-css-expected.txt (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/LayoutTests/http/tests/security/cross-origin-css-expected.txt        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/LayoutTests/http/tests/security/cross-origin-css-expected.txt        2015-07-09 21:02:51 UTC (rev 186619)
</span><span class="lines">@@ -1,7 +1,11 @@
</span><del>-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)
</del><ins>+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.
+
</ins></span></pre></div>
<a id="branchessafari6008branchLayoutTestshttptestssecuritycrossorigincsshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/LayoutTests/http/tests/security/cross-origin-css.html (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/LayoutTests/http/tests/security/cross-origin-css.html        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/LayoutTests/http/tests/security/cross-origin-css.html        2015-07-09 21:02:51 UTC (rev 186619)
</span><span class="lines">@@ -1,5 +1,12 @@
</span><ins>+<!DOCTYPE html>
</ins><span class="cx"> <html>
</span><span class="cx"> <head>
</span><ins>+<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. -->
</ins><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">@@ -9,39 +16,68 @@
</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><del>-<script>
-if (window.testRunner) {
- testRunner.waitUntilDone();
- testRunner.dumpAsText();
-}
</del><span class="cx">
</span><del>-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>
</del><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><ins>+
+/* 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>");
+}
</ins><span class="cx"> </style>
</span><ins>+<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>
</ins><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></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>
+ <div id="data-background-url">PASS background image loaded</div>
+</body>
</ins><span class="cx"> </html>
</span></span></pre></div>
<a id="branchessafari6008branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/ChangeLog (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/Source/WebCore/ChangeLog        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/Source/WebCore/ChangeLog        2015-07-09 21:02:51 UTC (rev 186619)
</span><span class="lines">@@ -1,5 +1,41 @@
</span><span class="cx"> 2015-07-09 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r186551. rdar://problem/21716372
+
+ 2015-07-08 Matthew Hanson <matthew_hanson@apple.com>
+
+ Merge r180020. rdar://problem/21716511
+
+ 2015-02-12 Chris Dumez <cdumez@apple.com>
+
+ Drop the quirks-mode exception for CSS MIME types
+ https://bugs.webkit.org/show_bug.cgi?id=141501
+
+ Reviewed by Alexey Proskuryakov.
+
+ Drop the quirks-mode exception for CSS MIME types.
+ This matches Firefox's behavior.
+
+ This patch is based on the following Blink revision:
+ http://src.chromium.org/viewvc/blink?view=revision&revision=189669
+
+ Tests:
+ - http/tests/misc/css-accept-any-type.html
+ - http/tests/security/cross-origin-css.html
+
+ * css/StyleSheetContents.cpp:
+ (WebCore::StyleSheetContents::parseAuthorStyleSheet):
+ * dom/ProcessingInstruction.cpp:
+ (WebCore::ProcessingInstruction::setCSSStyleSheet):
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::cachedResourceContent):
+ * loader/cache/CachedCSSStyleSheet.cpp:
+ (WebCore::CachedCSSStyleSheet::sheetText):
+ (WebCore::CachedCSSStyleSheet::canUseSheet):
+ * loader/cache/CachedCSSStyleSheet.h:
+
+2015-07-09 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r186539. rdar://problem/21707873
</span><span class="cx">
</span><span class="cx"> 2015-07-08 Lucas Forschler <lforschler@apple.com>
</span></span></pre></div>
<a id="branchessafari6008branchSourceWebCorecssStyleSheetContentscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/css/StyleSheetContents.cpp (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/Source/WebCore/css/StyleSheetContents.cpp        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/Source/WebCore/css/StyleSheetContents.cpp        2015-07-09 21:02:51 UTC (rev 186619)
</span><span class="lines">@@ -285,11 +285,8 @@
</span><span class="cx">
</span><span class="cx"> void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cachedStyleSheet, const SecurityOrigin* securityOrigin)
</span><span class="cx"> {
</span><del>- // 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;
</del><span class="cx"> bool hasValidMIMEType = false;
</span><del>- String sheetText = cachedStyleSheet->sheetText(enforceMIMEType, &hasValidMIMEType);
</del><ins>+ String sheetText = cachedStyleSheet->sheetText(&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="branchessafari6008branchSourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/dom/ProcessingInstruction.cpp (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/Source/WebCore/dom/ProcessingInstruction.cpp        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/Source/WebCore/dom/ProcessingInstruction.cpp        2015-07-09 21:02:51 UTC (rev 186619)
</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(true));
</del><ins>+ parseStyleSheet(sheet->sheetText());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(XSLT)
</span></span></pre></div>
<a id="branchessafari6008branchSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/inspector/InspectorPageAgent.cpp (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-07-09 21:02:51 UTC (rev 186619)
</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(false);
</del><ins>+ *result = toCachedCSSStyleSheet(cachedResource)->sheetText();
</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="branchessafari6008branchSourceWebCoreloadercacheCachedCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2015-07-09 21:02:51 UTC (rev 186619)
</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 enforceMIMEType, bool* hasValidMIMEType) const
-{
</del><ins>+
+const String CachedCSSStyleSheet::sheetText(bool* hasValidMIMEType) const
+{
</ins><span class="cx"> ASSERT(!isPurgeable());
</span><span class="cx">
</span><del>- if (!m_data || m_data->isEmpty() || !canUseSheet(enforceMIMEType, hasValidMIMEType))
</del><ins>+ if (!m_data || m_data->isEmpty() || !canUseSheet(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,13 +115,10 @@
</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 enforceMIMEType, bool* hasValidMIMEType) const
</del><ins>+bool CachedCSSStyleSheet::canUseSheet(bool* hasValidMIMEType) const
</ins><span class="cx"> {
</span><span class="cx"> if (errorOccurred())
</span><span class="cx"> return false;
</span><del>-
- if (!enforceMIMEType && !hasValidMIMEType)
- return true;
</del><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">@@ -134,8 +131,6 @@
</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><del>- if (!enforceMIMEType)
- return true;
</del><span class="cx"> return typeOK;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6008branchSourceWebCoreloadercacheCachedCSSStyleSheeth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.8-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h (186618 => 186619)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.8-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2015-07-09 21:02:45 UTC (rev 186618)
+++ branches/safari-600.8-branch/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2015-07-09 21:02:51 UTC (rev 186619)
</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 enforceMIMEType = true, bool* hasValidMIMEType = 0) const;
</del><ins>+ const String sheetText(bool* hasValidMIMEType = nullptr) 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 enforceMIMEType, bool* hasValidMIMEType) const;
</del><ins>+ bool canUseSheet(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>