<!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>[180020] trunk</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/180020">180020</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-02-12 15:23:55 -0800 (Thu, 12 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Drop the quirks-mode exception for CSS MIME types
https://bugs.webkit.org/show_bug.cgi?id=141501
Reviewed by Alexey Proskuryakov.
Source/WebCore:
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:
LayoutTests:
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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsmisccssacceptanytypeexpectedtxt">trunk/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsmisccssacceptanytypehtml">trunk/LayoutTests/http/tests/misc/css-accept-any-type.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossorigincssexpectedtxt">trunk/LayoutTests/http/tests/security/cross-origin-css-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossorigincsshtml">trunk/LayoutTests/http/tests/security/cross-origin-css.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheetContentscpp">trunk/Source/WebCore/css/StyleSheetContents.cpp</a></li>
<li><a href="#trunkSourceWebCoredomProcessingInstructioncpp">trunk/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedCSSStyleSheetcpp">trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedCSSStyleSheeth">trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/LayoutTests/ChangeLog        2015-02-12 23:23:55 UTC (rev 180020)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+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:
+
</ins><span class="cx"> 2015-02-12 Beth Dakin <bdakin@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION: Should not send wheel events with a delta of 0
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsmisccssacceptanytypeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/LayoutTests/http/tests/misc/css-accept-any-type-expected.txt        2015-02-12 23:23:55 UTC (rev 180020)
</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="trunkLayoutTestshttptestsmisccssacceptanytypehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/misc/css-accept-any-type.html (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/misc/css-accept-any-type.html        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/LayoutTests/http/tests/misc/css-accept-any-type.html        2015-02-12 23:23:55 UTC (rev 180020)
</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="trunkLayoutTestshttptestssecuritycrossorigincssexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-origin-css-expected.txt (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-css-expected.txt        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css-expected.txt        2015-02-12 23:23:55 UTC (rev 180020)
</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="trunkLayoutTestshttptestssecuritycrossorigincsshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-origin-css.html (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-css.html        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/LayoutTests/http/tests/security/cross-origin-css.html        2015-02-12 23:23:55 UTC (rev 180020)
</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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/Source/WebCore/ChangeLog        2015-02-12 23:23:55 UTC (rev 180020)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+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:
+
</ins><span class="cx"> 2015-02-12 Beth Dakin <bdakin@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION: Should not send wheel events with a delta of 0
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheetContentscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheetContents.cpp        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp        2015-02-12 23:23:55 UTC (rev 180020)
</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="trunkSourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ProcessingInstruction.cpp (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2015-02-12 23:23:55 UTC (rev 180020)
</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="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-02-12 23:23:55 UTC (rev 180020)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> if (cachedResource) {
</span><span class="cx"> switch (cachedResource->type()) {
</span><span class="cx"> case CachedResource::CSSStyleSheet:
</span><del>- *result = downcast<CachedCSSStyleSheet>(*cachedResource).sheetText(false);
</del><ins>+ *result = downcast<CachedCSSStyleSheet>(*cachedResource).sheetText();
</ins><span class="cx"> return true;
</span><span class="cx"> case CachedResource::Script:
</span><span class="cx"> *result = downcast<CachedScript>(*cachedResource).script();
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp        2015-02-12 23:23:55 UTC (rev 180020)
</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 enforceMIMEType, bool* hasValidMIMEType) const
</del><ins>+const String CachedCSSStyleSheet::sheetText(bool* hasValidMIMEType) const
</ins><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><span class="cx">
</span><span class="cx"> if (!m_decodedSheetText.isNull())
</span><span class="lines">@@ -113,13 +113,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">@@ -132,8 +129,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="trunkSourceWebCoreloadercacheCachedCSSStyleSheeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h (180019 => 180020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2015-02-12 23:10:30 UTC (rev 180019)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h        2015-02-12 23:23:55 UTC (rev 180020)
</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(Ref<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 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>