<!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>[167598] trunk/Source/WebCore</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/167598">167598</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-04-21 11:08:49 -0700 (Mon, 21 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/160908">r160908</a>): Safari doesn't draw rotated images properly first time
https://bugs.webkit.org/show_bug.cgi?id=131930

Reviewed by Anders Carlsson.

With render tree creation sufficiently lazy, we had to put some explicit
calls to updateStyleIfNeeded into the ImageDocument class.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Pass a Frame&amp;.

* html/ImageDocument.cpp:
(WebCore::ImageDocument::imageSize): Added this helper function. This updates
style so we can use the renderer to compute an image size taking things like
orientation into account, and also passes in the zoom factor.
(WebCore::ImageDocument::updateDuringParsing): Moved the body of the
ImageDocumentParser::appendBytes function into this function. Since it's a
member of ImageDocument, it has better access to appropriate private members,
and we don't have to expose as many functions to the public. Also changed to
not use the frame so much. Also merged in the code that creates the document
instead of having it be a side effect in the cachedImage helper function; all
the other call sites were checking for null before calling cachedImage.
(WebCore::ImageDocument::finishedParsing): Moved the body of the
ImageDocumentParser::finish function here. Added a call to updateStyleIfNeeded
before using the renderer to get the image size.
(WebCore::ImageDocumentParser::document): Made this return a reference. It's
just a convenience function used in the two functions below.
(WebCore::ImageDocumentParser::appendBytes): Just call updateDuringParsing.
(WebCore::ImageDocumentParser::finish): Just call finishedParsing.
(WebCore::ImageDocument::ImageDocument): Take a reference for the argument,
use nullptr, and also initialize m_shouldShrinkImage directly instead of using
a shouldShrinkToFit() helper function to do it.
(WebCore::ImageDocument::createDocumentStructure): Removed unneeded check of
null for the frame, since the caller does it. Removed some unneeded
IGNORE_EXCEPTON and a stray semicolon. Use m_shouldShrinkImage instead of
calling shouldShrinkToFit since at this early point they will be identical.
(WebCore::ImageDocument::scale): Make non-const so we can call the new
imageSize helper. Use Document::view instead of Frame::view. Improved the
conversion to floating point so it doesn't involve a static_cast and an extra
conversion from int to LayoutUnit.
(WebCore::ImageDocument::resizeImageToFit): Ditto.
(WebCore::ImageDocument::imageClicked): Ditto.
(WebCore::ImageDocument::imageUpdated): Ditto. Also use m_shouldShrinkImage
ibnstead of shouldShrinkToFit.
(WebCore::ImageDocument::restoreImageSize): Ditto.
(WebCore::ImageDocument::imageFitsInWindow): Ditto.
(WebCore::ImageDocument::windowSizeChanged): Ditto.
(WebCore::ImageDocument::cachedImage): Deleted. Moved logic into updateDuringParsing.
(WebCore::ImageDocument::shouldShrinkToFit): Deleted. Moved logic into constructor.
(WebCore::ImageEventListener::handleEvent): Updated for changes above.
(WebCore::ImageEventListener::operator==): Simplified. No reason this has to check
whether both listeners are in the same document.
(WebCore::ImageDocumentElement::didMoveToNewDocument): Use nullptr.

* html/ImageDocument.h: Deleted some unused things, updated for changes above,
and made some memer functions private.

* loader/FrameLoaderClient.h: Deleted the allowScriptFromSource, allowPlugins,
allowImage, and allowDisplayingInsecureContent functions. These were only used in
Chromium and are now unneeded complexity. We could bring them back if anyone wants them.

* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::canDisplayInsecureContent): Removed call to
allowDisplayingInsecureContent, just use the setting directly.
(WebCore::MixedContentChecker::canRunInsecureContent): Removed call to
allowRunningInsecureContent, just use the setting directly.

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::allowPlugins): Removed call to allowPlugins, just
use the arePluginsEnabled setting directly.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest): Removed call to allowScriptFromSource, just
use the isScriptEnabled setting directly.
(WebCore::CachedResourceLoader::clientDefersImage): Removed call to allowImage.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDOMImplementationcpp">trunk/Source/WebCore/dom/DOMImplementation.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDocumentcpp">trunk/Source/WebCore/html/ImageDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDocumenth">trunk/Source/WebCore/html/ImageDocument.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderClienth">trunk/Source/WebCore/loader/FrameLoaderClient.h</a></li>
<li><a href="#trunkSourceWebCoreloaderMixedContentCheckercpp">trunk/Source/WebCore/loader/MixedContentChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoadercpp">trunk/Source/WebCore/loader/SubframeLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167597 => 167598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-21 18:07:15 UTC (rev 167597)
+++ trunk/Source/WebCore/ChangeLog        2014-04-21 18:08:49 UTC (rev 167598)
</span><span class="lines">@@ -1,3 +1,81 @@
</span><ins>+2014-04-21  Darin Adler  &lt;darin@apple.com&gt;
+
+        REGRESSION (r160908): Safari doesn't draw rotated images properly first time
+        https://bugs.webkit.org/show_bug.cgi?id=131930
+
+        Reviewed by Anders Carlsson.
+
+        With render tree creation sufficiently lazy, we had to put some explicit
+        calls to updateStyleIfNeeded into the ImageDocument class.
+
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument): Pass a Frame&amp;.
+
+        * html/ImageDocument.cpp:
+        (WebCore::ImageDocument::imageSize): Added this helper function. This updates
+        style so we can use the renderer to compute an image size taking things like
+        orientation into account, and also passes in the zoom factor.
+        (WebCore::ImageDocument::updateDuringParsing): Moved the body of the
+        ImageDocumentParser::appendBytes function into this function. Since it's a
+        member of ImageDocument, it has better access to appropriate private members,
+        and we don't have to expose as many functions to the public. Also changed to
+        not use the frame so much. Also merged in the code that creates the document
+        instead of having it be a side effect in the cachedImage helper function; all
+        the other call sites were checking for null before calling cachedImage.
+        (WebCore::ImageDocument::finishedParsing): Moved the body of the
+        ImageDocumentParser::finish function here. Added a call to updateStyleIfNeeded
+        before using the renderer to get the image size.
+        (WebCore::ImageDocumentParser::document): Made this return a reference. It's
+        just a convenience function used in the two functions below.
+        (WebCore::ImageDocumentParser::appendBytes): Just call updateDuringParsing.
+        (WebCore::ImageDocumentParser::finish): Just call finishedParsing.
+        (WebCore::ImageDocument::ImageDocument): Take a reference for the argument,
+        use nullptr, and also initialize m_shouldShrinkImage directly instead of using
+        a shouldShrinkToFit() helper function to do it.
+        (WebCore::ImageDocument::createDocumentStructure): Removed unneeded check of
+        null for the frame, since the caller does it. Removed some unneeded
+        IGNORE_EXCEPTON and a stray semicolon. Use m_shouldShrinkImage instead of
+        calling shouldShrinkToFit since at this early point they will be identical.
+        (WebCore::ImageDocument::scale): Make non-const so we can call the new
+        imageSize helper. Use Document::view instead of Frame::view. Improved the
+        conversion to floating point so it doesn't involve a static_cast and an extra
+        conversion from int to LayoutUnit.
+        (WebCore::ImageDocument::resizeImageToFit): Ditto.
+        (WebCore::ImageDocument::imageClicked): Ditto.
+        (WebCore::ImageDocument::imageUpdated): Ditto. Also use m_shouldShrinkImage
+        ibnstead of shouldShrinkToFit.
+        (WebCore::ImageDocument::restoreImageSize): Ditto.
+        (WebCore::ImageDocument::imageFitsInWindow): Ditto.
+        (WebCore::ImageDocument::windowSizeChanged): Ditto.
+        (WebCore::ImageDocument::cachedImage): Deleted. Moved logic into updateDuringParsing.
+        (WebCore::ImageDocument::shouldShrinkToFit): Deleted. Moved logic into constructor.
+        (WebCore::ImageEventListener::handleEvent): Updated for changes above.
+        (WebCore::ImageEventListener::operator==): Simplified. No reason this has to check
+        whether both listeners are in the same document.
+        (WebCore::ImageDocumentElement::didMoveToNewDocument): Use nullptr.
+
+        * html/ImageDocument.h: Deleted some unused things, updated for changes above,
+        and made some memer functions private.
+
+        * loader/FrameLoaderClient.h: Deleted the allowScriptFromSource, allowPlugins,
+        allowImage, and allowDisplayingInsecureContent functions. These were only used in
+        Chromium and are now unneeded complexity. We could bring them back if anyone wants them.
+
+        * loader/MixedContentChecker.cpp:
+        (WebCore::MixedContentChecker::canDisplayInsecureContent): Removed call to
+        allowDisplayingInsecureContent, just use the setting directly.
+        (WebCore::MixedContentChecker::canRunInsecureContent): Removed call to
+        allowRunningInsecureContent, just use the setting directly.
+
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::allowPlugins): Removed call to allowPlugins, just
+        use the arePluginsEnabled setting directly.
+
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::canRequest): Removed call to allowScriptFromSource, just
+        use the isScriptEnabled setting directly.
+        (WebCore::CachedResourceLoader::clientDefersImage): Removed call to allowImage.
+
</ins><span class="cx"> 2014-04-21  David Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMImplementationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMImplementation.cpp (167597 => 167598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMImplementation.cpp        2014-04-21 18:07:15 UTC (rev 167597)
+++ trunk/Source/WebCore/dom/DOMImplementation.cpp        2014-04-21 18:08:49 UTC (rev 167598)
</span><span class="lines">@@ -328,7 +328,7 @@
</span><span class="cx">     if ((MIMETypeRegistry::isPDFOrPostScriptMIMEType(type)) &amp;&amp; pluginData &amp;&amp; pluginData-&gt;supportsMimeType(type, allowedPluginTypes))
</span><span class="cx">         return PluginDocument::create(frame, url);
</span><span class="cx">     if (Image::supportsType(type))
</span><del>-        return ImageDocument::create(frame, url);
</del><ins>+        return ImageDocument::create(*frame, url);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageDocument.cpp (167597 => 167598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.cpp        2014-04-21 18:07:15 UTC (rev 167597)
+++ trunk/Source/WebCore/html/ImageDocument.cpp        2014-04-21 18:08:49 UTC (rev 167598)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2007, 2008, 2010, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -50,28 +50,21 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><del>-class ImageEventListener : public EventListener {
</del><ins>+class ImageEventListener final : public EventListener {
</ins><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;ImageEventListener&gt; create(ImageDocument* document) { return adoptRef(new ImageEventListener(document)); }
-    static const ImageEventListener* cast(const EventListener* listener)
-    {
-        return listener-&gt;type() == ImageEventListenerType
-            ? static_cast&lt;const ImageEventListener*&gt;(listener)
-            : 0;
-    }
</del><ins>+    static PassRefPtr&lt;ImageEventListener&gt; create(ImageDocument&amp; document) { return adoptRef(new ImageEventListener(document)); }
</ins><span class="cx"> 
</span><del>-    virtual bool operator==(const EventListener&amp; other) override;
-
</del><span class="cx"> private:
</span><del>-    ImageEventListener(ImageDocument* document)
</del><ins>+    ImageEventListener(ImageDocument&amp; document)
</ins><span class="cx">         : EventListener(ImageEventListenerType)
</span><del>-        , m_doc(document)
</del><ins>+        , m_document(document)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    virtual bool operator==(const EventListener&amp;) override;
</ins><span class="cx">     virtual void handleEvent(ScriptExecutionContext*, Event*) override;
</span><span class="cx"> 
</span><del>-    ImageDocument* m_doc;
</del><ins>+    ImageDocument&amp; m_document;
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> class ImageDocumentParser final : public RawDataDocumentParser {
</span><span class="lines">@@ -81,17 +74,14 @@
</span><span class="cx">         return adoptRef(new ImageDocumentParser(document));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ImageDocument* document() const
-    {
-        return toImageDocument(RawDataDocumentParser::document());
-    }
-    
</del><span class="cx"> private:
</span><span class="cx">     ImageDocumentParser(ImageDocument&amp; document)
</span><span class="cx">         : RawDataDocumentParser(document)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    ImageDocument&amp; document() const;
+
</ins><span class="cx">     virtual void appendBytes(DocumentWriter&amp;, const char*, size_t) override;
</span><span class="cx">     virtual void finish() override;
</span><span class="cx"> };
</span><span class="lines">@@ -120,67 +110,84 @@
</span><span class="cx"> 
</span><span class="cx"> // --------
</span><span class="cx"> 
</span><del>-static float pageZoomFactor(const Document* document)
</del><ins>+LayoutSize ImageDocument::imageSize()
</ins><span class="cx"> {
</span><del>-    Frame* frame = document-&gt;frame();
-    return frame ? frame-&gt;pageZoomFactor() : 1;
</del><ins>+    ASSERT(m_imageElement);
+    updateStyleIfNeeded();
+    return m_imageElement-&gt;cachedImage()-&gt;imageSizeForRenderer(m_imageElement-&gt;renderer(), frame() ? frame()-&gt;pageZoomFactor() : 1);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ImageDocumentParser::appendBytes(DocumentWriter&amp;, const char*, size_t)
</del><ins>+void ImageDocument::updateDuringParsing()
</ins><span class="cx"> {
</span><del>-    Frame* frame = document()-&gt;frame();
-    if (!frame-&gt;loader().client().allowImage(frame-&gt;settings().areImagesEnabled(), document()-&gt;url()))
</del><ins>+    if (!frame()-&gt;settings().areImagesEnabled())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CachedImage* cachedImage = document()-&gt;cachedImage();
-    RefPtr&lt;ResourceBuffer&gt; resourceData = frame-&gt;loader().documentLoader()-&gt;mainResourceData();
-    cachedImage-&gt;addDataBuffer(resourceData.get());
</del><ins>+    if (!m_imageElement)
+        createDocumentStructure();
</ins><span class="cx"> 
</span><del>-    document()-&gt;imageUpdated();
</del><ins>+    m_imageElement-&gt;cachedImage()-&gt;addDataBuffer(loader()-&gt;mainResourceData().get());
+
+    imageUpdated();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ImageDocumentParser::finish()
</del><ins>+void ImageDocument::finishedParsing()
</ins><span class="cx"> {
</span><del>-    if (!isStopped() &amp;&amp; document()-&gt;imageElement()) {
-        CachedImage* cachedImage = document()-&gt;cachedImage();
-        RefPtr&lt;ResourceBuffer&gt; data = document()-&gt;frame()-&gt;loader().documentLoader()-&gt;mainResourceData();
</del><ins>+    if (!parser()-&gt;isStopped() &amp;&amp; m_imageElement) {
+        CachedImage&amp; cachedImage = *m_imageElement-&gt;cachedImage();
+        RefPtr&lt;ResourceBuffer&gt; data = loader()-&gt;mainResourceData();
</ins><span class="cx"> 
</span><span class="cx">         // If this is a multipart image, make a copy of the current part, since the resource data
</span><span class="cx">         // will be overwritten by the next part.
</span><del>-        if (document()-&gt;frame()-&gt;loader().documentLoader()-&gt;isLoadingMultipartContent())
</del><ins>+        if (loader()-&gt;isLoadingMultipartContent())
</ins><span class="cx">             data = data-&gt;copy();
</span><span class="cx"> 
</span><del>-        cachedImage-&gt;finishLoading(data.get());
-        cachedImage-&gt;finish();
</del><ins>+        cachedImage.finishLoading(data.get());
+        cachedImage.finish();
</ins><span class="cx"> 
</span><del>-        cachedImage-&gt;setResponse(document()-&gt;frame()-&gt;loader().documentLoader()-&gt;response());
</del><ins>+        cachedImage.setResponse(loader()-&gt;response());
</ins><span class="cx"> 
</span><span class="cx">         // Report the natural image size in the page title, regardless of zoom level.
</span><span class="cx">         // At a zoom level of 1 the image is guaranteed to have an integer size.
</span><del>-        IntSize size = flooredIntSize(cachedImage-&gt;imageSizeForRenderer(document()-&gt;imageElement()-&gt;renderer(), 1.0f));
</del><ins>+        updateStyleIfNeeded();
+        IntSize size = flooredIntSize(cachedImage.imageSizeForRenderer(m_imageElement-&gt;renderer(), 1));
</ins><span class="cx">         if (size.width()) {
</span><del>-            // Compute the title, we use the decoded filename of the resource, falling
-            // back on the (decoded) hostname if there is no path.
-            String fileName = decodeURLEscapeSequences(document()-&gt;url().lastPathComponent());
-            if (fileName.isEmpty())
-                fileName = document()-&gt;url().host();
-            document()-&gt;setTitle(imageTitle(fileName, size));
</del><ins>+            // Compute the title. We use the decoded filename of the resource, falling
+            // back on the hostname if there is no path.
+            String name = decodeURLEscapeSequences(url().lastPathComponent());
+            if (name.isEmpty())
+                name = url().host();
+            setTitle(imageTitle(name, size));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        document()-&gt;imageUpdated();
</del><ins>+        imageUpdated();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    document()-&gt;finishedParsing();
</del><ins>+    HTMLDocument::finishedParsing();
</ins><span class="cx"> }
</span><span class="cx">     
</span><del>-// --------
</del><ins>+inline ImageDocument&amp; ImageDocumentParser::document() const
+{
+    // Only used during parsing, so document is guaranteed to be non-null.
+    ASSERT(RawDataDocumentParser::document());
+    return toImageDocument(*RawDataDocumentParser::document());
+}
</ins><span class="cx"> 
</span><del>-ImageDocument::ImageDocument(Frame* frame, const URL&amp; url)
-    : HTMLDocument(frame, url, ImageDocumentClass)
-    , m_imageElement(0)
</del><ins>+void ImageDocumentParser::appendBytes(DocumentWriter&amp;, const char*, size_t)
+{
+    document().updateDuringParsing();
+}
+
+void ImageDocumentParser::finish()
+{
+    document().finishedParsing();
+}
+
+ImageDocument::ImageDocument(Frame&amp; frame, const URL&amp; url)
+    : HTMLDocument(&amp;frame, url, ImageDocumentClass)
+    , m_imageElement(nullptr)
</ins><span class="cx">     , m_imageSizeIsKnown(false)
</span><span class="cx">     , m_didShrinkImage(false)
</span><del>-    , m_shouldShrinkImage(shouldShrinkToFit())
</del><ins>+    , m_shouldShrinkImage(frame.settings().shrinksStandaloneImagesToFit() &amp;&amp; frame.isMainFrame())
</ins><span class="cx"> {
</span><span class="cx">     setCompatibilityMode(QuirksMode);
</span><span class="cx">     lockCompatibilityMode();
</span><span class="lines">@@ -194,31 +201,27 @@
</span><span class="cx"> void ImageDocument::createDocumentStructure()
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Element&gt; rootElement = Document::createElement(htmlTag, false);
</span><del>-    appendChild(rootElement, IGNORE_EXCEPTION);
</del><ins>+    appendChild(rootElement);
</ins><span class="cx">     toHTMLHtmlElement(rootElement.get())-&gt;insertedByParser();
</span><span class="cx"> 
</span><del>-    if (frame())
-        frame()-&gt;injectUserScripts(InjectAtDocumentStart);
</del><ins>+    frame()-&gt;injectUserScripts(InjectAtDocumentStart);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Element&gt; body = Document::createElement(bodyTag, false);
</span><del>-    body-&gt;setAttribute(styleAttr, &quot;margin: 0px;&quot;);
</del><ins>+    body-&gt;setAttribute(styleAttr, &quot;margin: 0px&quot;);
+    rootElement-&gt;appendChild(body);
</ins><span class="cx">     
</span><del>-    rootElement-&gt;appendChild(body, IGNORE_EXCEPTION);
-    
</del><span class="cx">     RefPtr&lt;ImageDocumentElement&gt; imageElement = ImageDocumentElement::create(*this);
</span><del>-    
</del><span class="cx">     imageElement-&gt;setAttribute(styleAttr, &quot;-webkit-user-select: none&quot;);        
</span><span class="cx">     imageElement-&gt;setLoadManually(true);
</span><span class="cx">     imageElement-&gt;setSrc(url().string());
</span><ins>+    body-&gt;appendChild(imageElement);
</ins><span class="cx">     
</span><del>-    body-&gt;appendChild(imageElement, IGNORE_EXCEPTION);
-    
-    if (shouldShrinkToFit()) {
-        // Add event listeners
-        RefPtr&lt;EventListener&gt; listener = ImageEventListener::create(this);
-        if (DOMWindow* domWindow = this-&gt;domWindow())
-            domWindow-&gt;addEventListener(&quot;resize&quot;, listener, false);
</del><ins>+    if (m_shouldShrinkImage) {
+        RefPtr&lt;EventListener&gt; listener = ImageEventListener::create(*this);
+        if (DOMWindow* window = this-&gt;domWindow())
+            window-&gt;addEventListener(&quot;resize&quot;, listener, false);
</ins><span class="cx">         imageElement-&gt;addEventListener(&quot;click&quot;, listener.release(), false);
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">         // Set the viewport to be in device pixels (rather than the default of 980).
</span><span class="cx">         processViewport(ASCIILiteral(&quot;width=device-width&quot;), ViewportArguments::ImageDocument);
</span><span class="lines">@@ -228,7 +231,7 @@
</span><span class="cx">     m_imageElement = imageElement.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float ImageDocument::scale() const
</del><ins>+float ImageDocument::scale()
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // On iOS big images are subsampled to make them smaller. So, don't resize them.
</span><span class="lines">@@ -237,15 +240,14 @@
</span><span class="cx">     if (!m_imageElement)
</span><span class="cx">         return 1;
</span><span class="cx"> 
</span><del>-    FrameView* view = frame()-&gt;view();
</del><ins>+    FrameView* view = this-&gt;view();
</ins><span class="cx">     if (!view)
</span><span class="cx">         return 1;
</span><span class="cx"> 
</span><del>-    LayoutSize imageSize = m_imageElement-&gt;cachedImage()-&gt;imageSizeForRenderer(m_imageElement-&gt;renderer(), pageZoomFactor(this));
-    LayoutSize windowSize = LayoutSize(view-&gt;width(), view-&gt;height());
</del><ins>+    LayoutSize imageSize = this-&gt;imageSize();
</ins><span class="cx"> 
</span><del>-    float widthScale = static_cast&lt;float&gt;(windowSize.width()) / imageSize.width();
-    float heightScale = static_cast&lt;float&gt;(windowSize.height()) / imageSize.height();
</del><ins>+    float widthScale = view-&gt;width() / imageSize.width().toFloat();
+    float heightScale = view-&gt;height() / imageSize.height().toFloat();
</ins><span class="cx"> 
</span><span class="cx">     return std::min(widthScale, heightScale);
</span><span class="cx"> #endif
</span><span class="lines">@@ -259,7 +261,7 @@
</span><span class="cx">     if (!m_imageElement)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LayoutSize imageSize = m_imageElement-&gt;cachedImage()-&gt;imageSizeForRenderer(m_imageElement-&gt;renderer(), pageZoomFactor(this));
</del><ins>+    LayoutSize imageSize = this-&gt;imageSize();
</ins><span class="cx"> 
</span><span class="cx">     float scale = this-&gt;scale();
</span><span class="cx">     m_imageElement-&gt;setWidth(static_cast&lt;int&gt;(imageSize.width() * scale));
</span><span class="lines">@@ -281,19 +283,20 @@
</span><span class="cx"> 
</span><span class="cx">     m_shouldShrinkImage = !m_shouldShrinkImage;
</span><span class="cx"> 
</span><del>-    if (m_shouldShrinkImage)
</del><ins>+    if (m_shouldShrinkImage) {
+        // Call windowSizeChanged for its side effect of sizing the image.
</ins><span class="cx">         windowSizeChanged();
</span><del>-    else {
</del><ins>+    } else {
</ins><span class="cx">         restoreImageSize();
</span><span class="cx"> 
</span><span class="cx">         updateLayout();
</span><span class="cx"> 
</span><span class="cx">         float scale = this-&gt;scale();
</span><span class="cx"> 
</span><del>-        int scrollX = static_cast&lt;int&gt;(x / scale - (float)frame()-&gt;view()-&gt;width() / 2);
-        int scrollY = static_cast&lt;int&gt;(y / scale - (float)frame()-&gt;view()-&gt;height() / 2);
</del><ins>+        int scrollX = static_cast&lt;int&gt;(x / scale - view()-&gt;width() / 2.0f);
+        int scrollY = static_cast&lt;int&gt;(y / scale - view()-&gt;height() / 2.0f);
</ins><span class="cx"> 
</span><del>-        frame()-&gt;view()-&gt;setScrollPosition(IntPoint(scrollX, scrollY));
</del><ins>+        view()-&gt;setScrollPosition(IntPoint(scrollX, scrollY));
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="lines">@@ -305,13 +308,13 @@
</span><span class="cx">     if (m_imageSizeIsKnown)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_imageElement-&gt;cachedImage()-&gt;imageSizeForRenderer(m_imageElement-&gt;renderer(), pageZoomFactor(this)).isEmpty())
</del><ins>+    if (imageSize().isEmpty())
</ins><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     m_imageSizeIsKnown = true;
</span><del>-    
-    if (shouldShrinkToFit()) {
-        // Force resizing of the image
</del><ins>+
+    if (m_shouldShrinkImage) {
+        // Call windowSizeChanged for its side effect of sizing the image.
</ins><span class="cx">         windowSizeChanged();
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -320,29 +323,29 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_imageElement || !m_imageSizeIsKnown)
</span><span class="cx">         return;
</span><del>-    
-    LayoutSize imageSize = m_imageElement-&gt;cachedImage()-&gt;imageSizeForRenderer(m_imageElement-&gt;renderer(), pageZoomFactor(this));
</del><ins>+
+    LayoutSize imageSize = this-&gt;imageSize();
</ins><span class="cx">     m_imageElement-&gt;setWidth(imageSize.width());
</span><span class="cx">     m_imageElement-&gt;setHeight(imageSize.height());
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (imageFitsInWindow())
</span><span class="cx">         m_imageElement-&gt;removeInlineStyleProperty(CSSPropertyCursor);
</span><span class="cx">     else
</span><span class="cx">         m_imageElement-&gt;setInlineStyleProperty(CSSPropertyCursor, CSSValueWebkitZoomOut);
</span><del>-        
</del><ins>+
</ins><span class="cx">     m_didShrinkImage = false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ImageDocument::imageFitsInWindow() const
</del><ins>+bool ImageDocument::imageFitsInWindow()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_imageElement)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    FrameView* view = frame()-&gt;view();
</del><ins>+    FrameView* view = this-&gt;view();
</ins><span class="cx">     if (!view)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    LayoutSize imageSize = m_imageElement-&gt;cachedImage()-&gt;imageSizeForRenderer(m_imageElement-&gt;renderer(), pageZoomFactor(this));
</del><ins>+    LayoutSize imageSize = this-&gt;imageSize();
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     LayoutSize windowSize = view-&gt;contentsToScreen(view-&gt;visibleContentRect()).size();
</span><span class="cx"> #else
</span><span class="lines">@@ -362,8 +365,8 @@
</span><span class="cx">     if (fitsInWindow)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LayoutSize imageSize = m_imageElement-&gt;cachedImage()-&gt;imageSizeForRenderer(m_imageElement-&gt;renderer(), pageZoomFactor(this));
-    LayoutRect visibleScreenSize = frame()-&gt;view()-&gt;contentsToScreen(frame()-&gt;view()-&gt;visibleContentRect());
</del><ins>+    LayoutSize imageSize = this-&gt;imageSize();
+    LayoutRect visibleScreenSize = view()-&gt;contentsToScreen(view()-&gt;visibleContentRect());
</ins><span class="cx"> 
</span><span class="cx">     float widthScale = static_cast&lt;float&gt;(visibleScreenSize.width()) / imageSize.width();
</span><span class="cx">     float heightScale = static_cast&lt;float&gt;(visibleScreenSize.height()) / imageSize.height();
</span><span class="lines">@@ -383,7 +386,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_didShrinkImage) {
</span><del>-        // If the window has been resized so that the image fits, restore the image size
</del><ins>+        // If the window has been resized so that the image fits, restore the image size,
</ins><span class="cx">         // otherwise update the restored image size.
</span><span class="cx">         if (fitsInWindow)
</span><span class="cx">             restoreImageSize();
</span><span class="lines">@@ -399,34 +402,20 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CachedImage* ImageDocument::cachedImage()
-{ 
-    if (!m_imageElement)
-        createDocumentStructure();
-    
-    return m_imageElement-&gt;cachedImage();
-}
-
-bool ImageDocument::shouldShrinkToFit() const
-{
-    return frame()-&gt;settings().shrinksStandaloneImagesToFit() &amp;&amp; frame()-&gt;isMainFrame();
-}
-
</del><span class="cx"> void ImageEventListener::handleEvent(ScriptExecutionContext*, Event* event)
</span><span class="cx"> {
</span><span class="cx">     if (event-&gt;type() == eventNames().resizeEvent)
</span><del>-        m_doc-&gt;windowSizeChanged();
</del><ins>+        m_document.windowSizeChanged();
</ins><span class="cx">     else if (event-&gt;type() == eventNames().clickEvent &amp;&amp; event-&gt;isMouseEvent()) {
</span><del>-        MouseEvent* mouseEvent = toMouseEvent(event);
-        m_doc-&gt;imageClicked(mouseEvent-&gt;x(), mouseEvent-&gt;y());
</del><ins>+        MouseEvent&amp; mouseEvent = toMouseEvent(*event);
+        m_document.imageClicked(mouseEvent.x(), mouseEvent.y());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ImageEventListener::operator==(const EventListener&amp; listener)
</del><ins>+bool ImageEventListener::operator==(const EventListener&amp; other)
</ins><span class="cx"> {
</span><del>-    if (const ImageEventListener* imageEventListener = ImageEventListener::cast(&amp;listener))
-        return m_doc == imageEventListener-&gt;m_doc;
-    return false;
</del><ins>+    // All ImageEventListener objects compare as equal; OK since there is only one per document.
+    return other.type() == ImageEventListenerType;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // --------
</span><span class="lines">@@ -441,7 +430,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_imageDocument) {
</span><span class="cx">         m_imageDocument-&gt;disconnectImageElement();
</span><del>-        m_imageDocument = 0;
</del><ins>+        m_imageDocument = nullptr;
</ins><span class="cx">     }
</span><span class="cx">     HTMLImageElement::didMoveToNewDocument(oldDocument);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageDocument.h (167597 => 167598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageDocument.h        2014-04-21 18:07:15 UTC (rev 167597)
+++ trunk/Source/WebCore/html/ImageDocument.h        2014-04-21 18:08:49 UTC (rev 167598)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2007, 2008, 2009, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,45 +29,47 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class CachedImage;
</del><span class="cx"> class ImageDocumentElement;
</span><span class="cx"> 
</span><span class="cx"> class ImageDocument final : public HTMLDocument {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;ImageDocument&gt; create(Frame* frame, const URL&amp; url)
</del><ins>+    static PassRefPtr&lt;ImageDocument&gt; create(Frame&amp; frame, const URL&amp; url)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(new ImageDocument(frame, url));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CachedImage* cachedImage();
-    ImageDocumentElement* imageElement() const { return m_imageElement; }
-    void disconnectImageElement() { m_imageElement = 0; }
-    
</del><ins>+    void updateDuringParsing();
+    void finishedParsing();
+
+    void disconnectImageElement() { m_imageElement = nullptr; }
+
</ins><span class="cx">     void windowSizeChanged();
</span><del>-    void imageUpdated();
</del><span class="cx">     void imageClicked(int x, int y);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    ImageDocument(Frame*, const URL&amp;);
</del><ins>+    ImageDocument(Frame&amp;, const URL&amp;);
</ins><span class="cx"> 
</span><span class="cx">     virtual PassRefPtr&lt;DocumentParser&gt; createParser() override;
</span><del>-    
</del><ins>+
+    LayoutSize imageSize();
+
</ins><span class="cx">     void createDocumentStructure();
</span><span class="cx">     void resizeImageToFit();
</span><span class="cx">     void restoreImageSize();
</span><del>-    bool imageFitsInWindow() const;
-    bool shouldShrinkToFit() const;
-    float scale() const;
-    
</del><ins>+    bool imageFitsInWindow();
+    float scale();
+
+    void imageUpdated();
+
</ins><span class="cx">     ImageDocumentElement* m_imageElement;
</span><del>-    
-    // Whether enough of the image has been loaded to determine its size
</del><ins>+
+    // Whether enough of the image has been loaded to determine its size.
</ins><span class="cx">     bool m_imageSizeIsKnown;
</span><del>-    
-    // Whether the image is shrunk to fit or not
</del><ins>+
+    // Whether the image is shrunk to fit or not.
</ins><span class="cx">     bool m_didShrinkImage;
</span><del>-    
-    // Whether the image should be shrunk or not
</del><ins>+
+    // Whether the image should be shrunk or not.
</ins><span class="cx">     bool m_shouldShrinkImage;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (167597 => 167598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoaderClient.h        2014-04-21 18:07:15 UTC (rev 167597)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h        2014-04-21 18:08:49 UTC (rev 167598)
</span><span class="lines">@@ -303,11 +303,6 @@
</span><span class="cx">         virtual void didChangeScrollOffset() { }
</span><span class="cx"> 
</span><span class="cx">         virtual bool allowScript(bool enabledPerSettings) { return enabledPerSettings; }
</span><del>-        virtual bool allowScriptFromSource(bool enabledPerSettings, const URL&amp;) { return enabledPerSettings; }
-        virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettings; }
-        virtual bool allowImage(bool enabledPerSettings, const URL&amp;) { return enabledPerSettings; }
-        virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, SecurityOrigin*, const URL&amp;) { return enabledPerSettings; }
-        virtual bool allowRunningInsecureContent(bool enabledPerSettings, SecurityOrigin*, const URL&amp;) { return enabledPerSettings; }
</del><span class="cx"> 
</span><span class="cx">         // Clients that generally disallow universal access can make exceptions for particular URLs.
</span><span class="cx">         virtual bool shouldForceUniversalAccessFromLocalURL(const URL&amp;) { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderMixedContentCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/MixedContentChecker.cpp (167597 => 167598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/MixedContentChecker.cpp        2014-04-21 18:07:15 UTC (rev 167597)
+++ trunk/Source/WebCore/loader/MixedContentChecker.cpp        2014-04-21 18:08:49 UTC (rev 167598)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     if (!isMixedContent(securityOrigin, url))
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    bool allowed = client().allowDisplayingInsecureContent(m_frame.settings().allowDisplayOfInsecureContent(), securityOrigin, url);
</del><ins>+    bool allowed = m_frame.settings().allowDisplayOfInsecureContent();
</ins><span class="cx">     logWarning(allowed, &quot;displayed&quot;, url);
</span><span class="cx"> 
</span><span class="cx">     if (allowed)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     if (!isMixedContent(securityOrigin, url))
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    bool allowed = client().allowRunningInsecureContent(m_frame.settings().allowRunningOfInsecureContent(), securityOrigin, url);
</del><ins>+    bool allowed = m_frame.settings().allowRunningOfInsecureContent();
</ins><span class="cx">     logWarning(allowed, &quot;ran&quot;, url);
</span><span class="cx"> 
</span><span class="cx">     if (allowed)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (167597 => 167598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.cpp        2014-04-21 18:07:15 UTC (rev 167597)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp        2014-04-21 18:08:49 UTC (rev 167598)
</span><span class="lines">@@ -397,7 +397,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool SubframeLoader::allowPlugins(ReasonForCallingAllowPlugins)
</span><span class="cx"> {
</span><del>-    return m_frame.loader().client().allowPlugins(m_frame.settings().arePluginsEnabled());
</del><ins>+    return m_frame.settings().arePluginsEnabled();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SubframeLoader::shouldUsePlugin(const URL&amp; url, const String&amp; mimeType, bool shouldPreferPlugInsForImages, bool hasFallback, bool&amp; useFallback)
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (167597 => 167598)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-04-21 18:07:15 UTC (rev 167597)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-04-21 18:08:49 UTC (rev 167598)
</span><span class="lines">@@ -347,11 +347,8 @@
</span><span class="cx">     case CachedResource::Script:
</span><span class="cx">         if (!shouldBypassMainWorldContentSecurityPolicy &amp;&amp; !m_document-&gt;contentSecurityPolicy()-&gt;allowScriptFromSource(url))
</span><span class="cx">             return false;
</span><del>-
-        if (frame()) {
-            if (!frame()-&gt;loader().client().allowScriptFromSource(frame()-&gt;settings().isScriptEnabled(), url))
-                return false;
-        }
</del><ins>+        if (frame() &amp;&amp; !frame()-&gt;settings().isScriptEnabled())
+            return false;
</ins><span class="cx">         break;
</span><span class="cx">     case CachedResource::CSSStyleSheet:
</span><span class="cx">         if (!shouldBypassMainWorldContentSecurityPolicy &amp;&amp; !m_document-&gt;contentSecurityPolicy()-&gt;allowStyleFromSource(url))
</span><span class="lines">@@ -678,9 +675,9 @@
</span><span class="cx">     reloadImagesIfNotDeferred();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CachedResourceLoader::clientDefersImage(const URL&amp; url) const
</del><ins>+bool CachedResourceLoader::clientDefersImage(const URL&amp;) const
</ins><span class="cx"> {
</span><del>-    return frame() &amp;&amp; !frame()-&gt;loader().client().allowImage(m_imagesEnabled, url);
</del><ins>+    return !m_imagesEnabled;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CachedResourceLoader::shouldDeferImageLoad(const URL&amp; url) const
</span></span></pre>
</div>
</div>

</body>
</html>