Commit c4157489 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

Unreviewed, rolling out r129388.

http://trac.webkit.org/changeset/129388
https://bugs.webkit.org/show_bug.cgi?id=97477

Caused an assertion in a WebKit2 unit test (Requested by
abarth on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-24

.:

* Source/autotools/symbols.filter:

Source/WebCore:

* WebCore.exp.in:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequest):
* loader/cache/CachedImage.cpp:
* loader/cache/CachedImage.h:
(WebCore::CachedImage::stillNeedsLoad):
(CachedImage):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAddClient):
* loader/cache/CachedResource.h:
(WebCore):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::CachedResourceLoader):
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
(WebCore::CachedResourceLoader::setAutoLoadImages):
* loader/cache/CachedResourceLoader.h:
(CachedResourceLoader):
* page/Settings.cpp:
(WebCore::setLoadsImagesAutomaticallyInAllFrames):
(WebCore::Settings::Settings):
(WebCore::Settings::setLoadsImagesAutomatically):
(WebCore::Settings::loadsImagesAutomaticallyTimerFired):
(WebCore::Settings::setImagesEnabled):
* page/Settings.h:
(Settings):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
(Backup):
(InternalSettings):
* testing/InternalSettings.idl:

Source/WebKit2:

* win/WebKit2.def:

LayoutTests:

* fast/loader/display-image-unset-allows-cached-image-load-expected.txt: Removed.
* fast/loader/display-image-unset-allows-cached-image-load.html: Removed.
* fast/loader/display-image-unset-can-block-image-and-can-reload-in-place-expected.txt: Removed.
* fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html: Removed.
* fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place-expected.txt: Removed.
* fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place.html: Removed.
* fast/loader/resources/image1.html: Removed.
* fast/loader/resources/image2.html: Removed.
* platform/chromium/permissionclient/image-permissions-expected.txt:
* platform/chromium/permissionclient/image-permissions.html:
* platform/chromium/permissionclient/resources/image.html:
* platform/wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8b0430f0
2012-09-24 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r129388.
http://trac.webkit.org/changeset/129388
https://bugs.webkit.org/show_bug.cgi?id=97477
Caused an assertion in a WebKit2 unit test (Requested by
abarth on #webkit).
* Source/autotools/symbols.filter:
2012-09-24 Dominik Röttsches <dominik.rottsches@intel.com>
[EFL][DRT] Enable Regions support
......
2012-09-24 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r129388.
http://trac.webkit.org/changeset/129388
https://bugs.webkit.org/show_bug.cgi?id=97477
Caused an assertion in a WebKit2 unit test (Requested by
abarth on #webkit).
* fast/loader/display-image-unset-allows-cached-image-load-expected.txt: Removed.
* fast/loader/display-image-unset-allows-cached-image-load.html: Removed.
* fast/loader/display-image-unset-can-block-image-and-can-reload-in-place-expected.txt: Removed.
* fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html: Removed.
* fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place-expected.txt: Removed.
* fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place.html: Removed.
* fast/loader/resources/image1.html: Removed.
* fast/loader/resources/image2.html: Removed.
* platform/chromium/permissionclient/image-permissions-expected.txt:
* platform/chromium/permissionclient/image-permissions.html:
* platform/chromium/permissionclient/resources/image.html:
* platform/wk2/Skipped:
2012-09-24 Erik Arvidsson <arv@chromium.org>
 
DOM4 remove method
Test that WebKitDisplayImagesKey unset does not block image in cache.
PASS
<html>
<head>
<script>
// Opens two windows containing the same image. First window will populate the cache with
// image. The second window is opened with WebKitDisplayImagesKey unset, but image should
// still load since it is in cache.
function runTest()
{
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
document.getElementById('result').innerHTML = 'FAILURE: image1.html not loaded';
window.open("resources/image1.html", "_blank");
}
}
function image1Loaded()
{
testRunner.overridePreference('WebKitDisplayImagesKey', 0);
document.getElementById('result').innerHTML = 'FAILURE: image2.html not loaded';
window.setTimeout(function() {window.open("resources/image2.html", "_blank");}, 0);
}
function image2Loaded()
{
document.getElementById('result').innerHTML = 'PASS';
testRunner.notifyDone();
}
</script>
</head>
<body onload="runTest()">
Test that WebKitDisplayImagesKey unset does not block image in cache.
<div id="result">FAILURE: Test script didn't run.</div>
</body>
</html>
Test that DisplayImages disabled can block http image and can be reloaded in-place when toggled.
SUCCESS
<html>
<head>
<script>
// Setting WebKitDisplayImagesKey is asynchronous, so using queueReload and setInterval to check when the setting actually take effect.
var intervalId;
var imageOnloadFired = 0;
if (window.testRunner) {
testRunner.dumpAsText();
window.internals.settings.setImagesEnabled(true);
testRunner.overridePreference('WebKitDisplayImagesKey', 0);
testRunner.queueReload();
}
function runTest()
{
var image = document.getElementById('image');
if (image.naturalHeight != 0 || image.naturalWidth != 0 || imageOnloadFired != 0) {
document.getElementById('result').innerHTML = 'FAILURE: Image should not be loaded when DisplayImage is unset';
return;
}
testRunner.overridePreference('WebKitDisplayImagesKey', 1);
document.getElementById('result').innerHTML = 'FAILURE: Image should reload in-place when DispalyImage is changes from unset to set';
testRunner.waitUntilDone();
intervalId = window.setInterval(runTestRest, 10);
}
function runTestRest()
{
var image = document.getElementById('image');
if (image.naturalHeight == 33 && image.naturalWidth == 37 && imageOnloadFired == 1) {
document.getElementById('result').innerHTML = 'SUCCESS';
window.clearInterval(intervalId);
testRunner.notifyDone();
}
}
</script>
</head>
<body onload="runTest()">
Test that DisplayImages disabled can block http image and can be reloaded in-place when toggled.
<div id="result">FAILURE: Test script didn't run.</div>
<img id="image" src="../images/resources/oval.png" onload="imageOnloadFired=1;">
</body>
</html>
Test that EnableImages unset can block image and can be reloaded in-place when toggled.
SUCCESS
<html>
<head>
<script>
// Setting ImagesEnabled is asynchronous, so using queueReload and setInterval to check when the setting actually take effect.
var intervalId;
var imageOnloadFired = 0;
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.overridePreference('WebKitDisplayImagesKey', 1);
window.internals.settings.setImagesEnabled(false);
testRunner.queueReload();
}
function runTest()
{
var image = document.getElementById('image');
if (image.naturalHeight != 0 || image.naturalWidth != 0 || imageOnloadFired != 0) {
document.getElementById('result').innerHTML = 'FAILURE: Image should not be loaded when ImagesEnabled is unset';
return;
}
window.internals.settings.setImagesEnabled(true);
document.getElementById('result').innerHTML = 'FAILURE: Image should reload in-place when ImagesEnabled is changes from unset to set';
testRunner.waitUntilDone();
intervalId = window.setInterval(runTestRest, 10);
}
function runTestRest()
{
var image = document.getElementById('image');
if (image.naturalHeight == 33 && image.naturalWidth == 37 || imageOnloadFired == 1) {
document.getElementById('result').innerHTML = 'SUCCESS';
window.clearInterval(intervalId);
testRunner.notifyDone();
}
}
</script>
</head>
<body onload="runTest()">
Test that EnableImages unset can block image and can be reloaded in-place when toggled.
<div id="result">FAILURE: Test script didn't run.</div>
<img id="image" src="../images/resources/oval.png" onload="imageOnloadFired=1;">
</body>
</html>
<html>
<body>
<img src="../../images/resources/oval.png" onload="window.opener.image1Loaded();">
</body>
</html>
<html>
<body>
<img src="../../images/resources/oval.png" onload="window.opener.image2Loaded();">
</body>
</html>
......@@ -5,4 +5,6 @@ PERMISSION CLIENT: allowImage((file test):platform/chromium/permissionclient/res
PASS: first image loaded
PASS: error event for not cached image
PASS: error event for image from cache
<html>
<head>
<script>
// Blocked images can be reloaded, so neither onload nor onerror is called.
// Only check here that onload is never called when image is blocked.
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpPermissionClientCallbacks();
......@@ -24,12 +21,14 @@ function loaded()
// Load an image not in cache.
var img = document.createElement('img');
img.onerror = function () { log("PASS: error event for not cached image"); }
img.onload = function () { log("FAIL: not cached image loaded"); }
img.src = "resources/boston.gif?nocache";
document.getElementById("img").appendChild(img);
// Load an image from cache.
var imgFromCache = document.createElement('img');
imgFromCache.onerror = function () { log("PASS: error event for image from cache"); }
imgFromCache.onload = function () { log("FAIL: image from cache loaded"); }
imgFromCache.src = "resources/boston.gif";
document.getElementById("img").appendChild(imgFromCache);
......@@ -42,7 +41,7 @@ function loaded()
</script>
</head>
<body>
<img src="resources/boston.gif" onload="loaded()">
<img src="resources/boston.gif" onload="loaded()" onerror="log('FAIL: error event for first image')">
<div id="img"></div>
<div id="results"></div>
</body>
......
......@@ -8,7 +8,7 @@ function log(a)
</script>
</head>
<body>
<img src="boston.gif" onload="log('FAIL: load event for iframed image')">
<img src="boston.gif" onload="log('FAIL: load event for iframed image)" onerror="log('FAIL: error event for iframed image')">
<div id="results"></div>
</body>
</html>
......@@ -203,7 +203,6 @@ fast/canvas/webgl/webgl-specific.html
fast/canvas/webgl/oes-vertex-array-object.html
fast/harness/override-preferences-2.html
fast/images/animated-gif-restored-from-bfcache.html
fast/loader/display-image-unset-allows-cached-image-load.html
fast/text/zero-font-size.html
# WebKitTestRunner needs to support layoutTestController.dumpDOMAsWebArchive
......@@ -318,8 +317,6 @@ svg/custom/svg-allowed-in-dashboard-object.html
# <https://bugs.webkit.org/show_bug.cgi?id=42672>
fast/css/compare-content-style.html
fast/frames/frame-display-none-focus.html
fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html
fast/loader/images-enabled-unset-can-block-image-and-can-reload-in-place.html
fast/loader/reload-policy-delegate.html
# WebKitTestRunner needs layoutTestController.queueLoad
......
2012-09-24 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r129388.
http://trac.webkit.org/changeset/129388
https://bugs.webkit.org/show_bug.cgi?id=97477
Caused an assertion in a WebKit2 unit test (Requested by
abarth on #webkit).
* WebCore.exp.in:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequest):
* loader/cache/CachedImage.cpp:
* loader/cache/CachedImage.h:
(WebCore::CachedImage::stillNeedsLoad):
(CachedImage):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAddClient):
* loader/cache/CachedResource.h:
(WebCore):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::CachedResourceLoader):
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
(WebCore::CachedResourceLoader::setAutoLoadImages):
* loader/cache/CachedResourceLoader.h:
(CachedResourceLoader):
* page/Settings.cpp:
(WebCore::setLoadsImagesAutomaticallyInAllFrames):
(WebCore::Settings::Settings):
(WebCore::Settings::setLoadsImagesAutomatically):
(WebCore::Settings::loadsImagesAutomaticallyTimerFired):
(WebCore::Settings::setImagesEnabled):
* page/Settings.h:
(Settings):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
(Backup):
(InternalSettings):
* testing/InternalSettings.idl:
2012-09-24 Erik Arvidsson <arv@chromium.org>
 
DOM4 remove method
......@@ -852,7 +852,6 @@ __ZN7WebCore8GradientC1ERKNS_10FloatPointES3_
__ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEiNS0_10AnchorTypeE
__ZN7WebCore8Settings14setJavaEnabledEb
__ZN7WebCore8Settings15setWebGLEnabledEb
__ZN7WebCore8Settings16setImagesEnabledEb
__ZN7WebCore8Settings16setScriptEnabledEb
__ZN7WebCore8Settings16setUsesPageCacheEb
__ZN7WebCore8Settings17setPluginsEnabledEb
......
......@@ -647,7 +647,6 @@ void FrameLoader::didBeginDocument(bool dispatch)
m_frame->document()->initContentSecurityPolicy();
Settings* settings = m_frame->document()->settings();
m_frame->document()->cachedResourceLoader()->setImagesEnabled(!settings || settings->areImagesEnabled());
m_frame->document()->cachedResourceLoader()->setAutoLoadImages(settings && settings->loadsImagesAutomatically());
if (m_documentLoader) {
......
......@@ -167,13 +167,11 @@ void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou
ResourceLoader::willSendRequest(newRequest, redirectResponse);
if (!previousURL.isNull() && !newRequest.isNull() && previousURL != newRequest.url()) {
if (m_document->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) {
if (m_resource->type() != CachedResource::ImageResource || !m_document->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) {
m_resource->willSendRequest(newRequest, redirectResponse);
return;
}
if (!m_document->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) {
cancel();
return;
}
cancel();
m_resource->willSendRequest(newRequest, redirectResponse);
}
}
......
......@@ -29,6 +29,7 @@
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
#include "CachedResourceLoader.h"
#include "Frame.h"
#include "FrameLoaderClient.h"
#include "FrameLoaderTypes.h"
#include "FrameView.h"
......
......@@ -82,7 +82,8 @@ public:
virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return true; }
virtual bool isImage() const { return true; }
virtual bool stillNeedsLoad() const OVERRIDE { return !errorOccurred() && status() == Unknown && !isLoading(); }
bool stillNeedsLoad() const { return !errorOccurred() && status() == Unknown && !isLoading(); }
void load();
// ImageObserver
virtual void decodedSizeChanged(const Image* image, int delta);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment