Revert r122824 for a while
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2013 03:57:06 +0000 (03:57 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2013 03:57:06 +0000 (03:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=97867

Reviewed by Hajime Morita.

Source/WebCore:

In r122824, we have introduced ImageInnerElement for making an image element ShadowDOM-available.
However, it turned out that making a replaced-element ShadowDOM-available has a lot of difficulty.
So we would like to postpone it for a while.

Since that patch makes an image element really complicated, we would like to revert it.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/html.css:
* html/HTMLImageElement.cpp:
(WebCore):
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::createRenderer):
(WebCore::HTMLImageElement::attach):
* html/HTMLImageElement.h:
(WebCore):
(HTMLImageElement):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::HTMLImageLoader):
(WebCore::HTMLImageLoader::dispatchLoadEvent):
(WebCore::HTMLImageLoader::sourceURI):
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLImageLoader.h:
(HTMLImageLoader):
* html/HTMLInputElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPlugInElement.h:
(WebCore):
* html/HTMLPlugInImageElement.h:
* html/HTMLTagNames.in:
* html/HTMLVideoElement.h:
* html/shadow/ImageInnerElement.cpp: Removed.
* html/shadow/ImageInnerElement.h: Removed.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::ImageLoader):
(WebCore::ImageLoader::~ImageLoader):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::renderImageResource):
(WebCore::ImageLoader::updatedHasPendingEvent):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
(WebCore::ImageLoader::dispatchPendingLoadEvent):
(WebCore::ImageLoader::dispatchPendingErrorEvent):
* loader/ImageLoader.h:
(WebCore):
(ImageLoader):
(WebCore::ImageLoader::element):
* loader/ImageLoaderClient.h: Removed.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::imageMap):
(WebCore::RenderImage::updateAltText):
* rendering/RenderImage.h:
(WebCore):
(RenderImage):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldRespectImageOrientation):
* svg/SVGImageElement.h:
(SVGImageElement):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::SVGImageLoader):
(WebCore::SVGImageLoader::dispatchLoadEvent):
(WebCore::SVGImageLoader::sourceURI):
* svg/SVGImageLoader.h:
(SVGImageLoader):

LayoutTests:

* fast/dom/shadow/select-image-with-shadow-expected.txt: Removed.
* fast/dom/shadow/select-image-with-shadow.html: Removed.
* fast/dom/shadow/shadowdom-for-image-alt-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-alt-update-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-alt-update.html: Removed.
* fast/dom/shadow/shadowdom-for-image-alt.html: Removed.
* fast/dom/shadow/shadowdom-for-image-content-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-content.html: Removed.
* fast/dom/shadow/shadowdom-for-image-dynamic-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-dynamic.html: Removed.
* fast/dom/shadow/shadowdom-for-image-event-click-expected.txt: Removed.
* fast/dom/shadow/shadowdom-for-image-event-click.html: Removed.
* fast/dom/shadow/shadowdom-for-image-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-in-shadowdom-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-in-shadowdom.html: Removed.
* fast/dom/shadow/shadowdom-for-image-map-expected.txt: Removed.
* fast/dom/shadow/shadowdom-for-image-map.html: Removed.
* fast/dom/shadow/shadowdom-for-image-style-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-style.html: Removed.
* fast/dom/shadow/shadowdom-for-image-with-multiple-shadow-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html: Removed.
* fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html: Removed.
* fast/dom/shadow/shadowdom-for-image-with-width-and-height-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-image-with-width-and-height.html: Removed.
* fast/dom/shadow/shadowdom-for-image.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140097 268f45cc-cd09-0410-ab3c-d52691b4dbfc

56 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/select-image-with-shadow-expected.txt [deleted file]
LayoutTests/fast/dom/shadow/select-image-with-shadow.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-update-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-update.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-alt.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-content-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-content.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-dynamic-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-dynamic.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-event-click-expected.txt [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-event-click.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-in-shadowdom-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-in-shadowdom.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-map-expected.txt [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-map.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-style-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-style.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-with-multiple-shadow-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-with-width-and-height-expected.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image-with-width-and-height.html [deleted file]
LayoutTests/fast/dom/shadow/shadowdom-for-image.html [deleted file]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/html.css
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLImageElement.h
Source/WebCore/html/HTMLImageLoader.cpp
Source/WebCore/html/HTMLImageLoader.h
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLObjectElement.h
Source/WebCore/html/HTMLPlugInElement.h
Source/WebCore/html/HTMLPlugInImageElement.h
Source/WebCore/html/HTMLTagNames.in
Source/WebCore/html/HTMLVideoElement.h
Source/WebCore/html/shadow/ImageInnerElement.cpp [deleted file]
Source/WebCore/html/shadow/ImageInnerElement.h [deleted file]
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/ImageLoader.h
Source/WebCore/loader/ImageLoaderClient.h [deleted file]
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/svg/SVGImageElement.h
Source/WebCore/svg/SVGImageLoader.cpp
Source/WebCore/svg/SVGImageLoader.h

index 65f91f8..d7559b6 100644 (file)
@@ -1,3 +1,37 @@
+2013-01-17  Shinya Kawanaka  <shinyak@chromium.org>
+
+        Revert r122824 for a while
+        https://bugs.webkit.org/show_bug.cgi?id=97867
+
+        Reviewed by Hajime Morita.
+
+        * fast/dom/shadow/select-image-with-shadow-expected.txt: Removed.
+        * fast/dom/shadow/select-image-with-shadow.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-alt-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-alt-update-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-alt-update.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-alt.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-content-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-content.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-dynamic-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-dynamic.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-event-click-expected.txt: Removed.
+        * fast/dom/shadow/shadowdom-for-image-event-click.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-in-shadowdom-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-in-shadowdom.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-map-expected.txt: Removed.
+        * fast/dom/shadow/shadowdom-for-image-map.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-style-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-style.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-with-multiple-shadow-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-with-width-and-height-expected.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image-with-width-and-height.html: Removed.
+        * fast/dom/shadow/shadowdom-for-image.html: Removed.
+
 2013-01-17  Benjamin Poulain  <bpoulain@apple.com>
 
         Remove non-existant test from Mac's TestExpectations
diff --git a/LayoutTests/fast/dom/shadow/select-image-with-shadow-expected.txt b/LayoutTests/fast/dom/shadow/select-image-with-shadow-expected.txt
deleted file mode 100644 (file)
index 4d0fa84..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-PASS selectedString is "KotoriPiyo"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/dom/shadow/select-image-with-shadow.html b/LayoutTests/fast/dom/shadow/select-image-with-shadow.html
deleted file mode 100644 (file)
index 81a1ce8..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-<script src="../../js/resources/js-test-pre.js"></script>
-<img id="host" src="../resources/apple.gif">
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-var shadowRoot = host.webkitCreateShadowRoot();
-shadowRoot.innerHTML = "<span id='span1'>Kotori</span><shadow></shadow><span id='span2'>Piyo</span>";
-
-var span1 = shadowRoot.getElementById('span1');
-var span2 = shadowRoot.getElementById('span2');
-if (window.eventSender) {
-    eventSender.mouseMoveTo(span1.offsetLeft + 1, span1.offsetTop + span1.offsetHeight / 2);
-    eventSender.mouseDown();
-    eventSender.mouseMoveTo(span2.offsetLeft + span2.offsetWidth - 1, span2.offsetTop + span2.offsetHeight / 2);
-    eventSender.mouseUp();
-
-    var selectedString = shadowRoot.getSelection().toString();
-    shouldBe('selectedString', '"KotoriPiyo"');
-}
-
-var successfullyParsed = true;
-</script>
-<script src="../../js/resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-expected.html
deleted file mode 100644 (file)
index 5bc300c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div>
-        <div style="display: inline-block">(before)<img src="there-is-no-such-image.png" alt="Kotori Otonashi" width="300" height="200">(after)</div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-update-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-update-expected.html
deleted file mode 100644 (file)
index 2305fac..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div>
-        <div style="display: inline-block">(before)<img src="there-is-no-such-image.png" alt="72" width="300" height="200">(after)</div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-update.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-alt-update.html
deleted file mode 100644 (file)
index 0ee72f2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div id="container">
-    <div>
-        <img id="host" src="there-is-no-such-image.png" alt="Chihaya Kisaragi">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)";
-
-    var userAgentShadowRoot = internals.oldestShadowRoot(host);
-    var innerElement = userAgentShadowRoot.firstChild;
-    innerElement.style.width = '300px';
-    innerElement.style.height = '200px';
-
-    host.setAttribute('alt', '72');
-}
-
-addShadowDOM(host);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-alt.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-alt.html
deleted file mode 100644 (file)
index 325b77e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div id="container">
-    <div>
-        <img id="host" src="there-is-no-such-image.png" alt="Kotori Otonashi">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)";
-
-    var userAgentShadowRoot = internals.oldestShadowRoot(host);
-    var innerElement = userAgentShadowRoot.firstChild;
-    innerElement.style.width = '300px';
-    innerElement.style.height = '200px';
-}
-
-addShadowDOM(host);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-content-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-content-expected.html
deleted file mode 100644 (file)
index f7d8a75..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div>
-        <div style="display: inline-block">(before)<img src="../resources/apple.gif">(after)<span>light child of span</span></div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-content.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-content.html
deleted file mode 100644 (file)
index 1f73570..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div id="container">
-    <div>
-        <img id="host" src="../resources/apple.gif">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)<content></content>";
-}
-
-var span = document.createElement('span');
-span.innerHTML = 'light child of span';
-
-host.appendChild(span);
-addShadowDOM(host);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-dynamic-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-dynamic-expected.html
deleted file mode 100644 (file)
index 00d1d9c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div>
-        <div style="display: inline-block; width: 20px; height:20px">(before)<img src="../resources/mozilla.gif">(after)</div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-dynamic.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-dynamic.html
deleted file mode 100644 (file)
index 62977e4..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div id="container">
-    <div>
-        <img id="host" src="../resources/apple.gif">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)"
-}
-
-addShadowDOM(host);
-
-if (window.testRunner)
-    testRunner.waitUntilDone();
-
-setTimeout(function() {
-    host.setAttribute("src", "../resources/mozilla.gif");
-    host.setAttribute("width", "20");
-    host.setAttribute("height", "20");
-
-    host.onload = function() {
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
-}, 0);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-event-click-expected.txt b/LayoutTests/fast/dom/shadow/shadowdom-for-image-event-click-expected.txt
deleted file mode 100644 (file)
index cc1f63e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This test confirms img element can listen an event from its Shadow DOM.
-
-PASS
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-event-click.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-event-click.html
deleted file mode 100644 (file)
index 3136771..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<p>This test confirms img element can listen an event from its Shadow DOM.</p>
-<div id="container">
-    <div>
-        <img id="host" src="../resources/apple.gif">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after) <span id='target'>target</span>";
-    return shadowRoot;
-}
-
-host.addEventListener('click', function() {
-    container.innerHTML = "PASS";
-
-    if (window.testRunner)
-        testRunner.notifyDone();
-});
-
-var shadowRoot = addShadowDOM(host);
-
-var target = shadowRoot.getElementById('target');
-if (window.eventSender) {
-    eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth / 2, target.offsetTop + target.offsetHeight / 2);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-}
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-expected.html
deleted file mode 100644 (file)
index 324774f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div>
-        <div style="display: inline-block">(before)<img src="../resources/apple.gif">(after)</div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-in-shadowdom-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-in-shadowdom-expected.html
deleted file mode 100644 (file)
index f4bed00..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div id="host">before(before)<img src="../resources/apple.gif">(after)after</div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-in-shadowdom.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-in-shadowdom.html
deleted file mode 100644 (file)
index 44204f2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div id="container">
-    <div id="host"></div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-var shadowRoot = host.webkitCreateShadowRoot();
-shadowRoot.innerHTML = "before<img id='img' src='../resources/apple.gif'>after";
-
-var img = shadowRoot.getElementById('img');
-var nestedShadowRoot = img.webkitCreateShadowRoot();
-
-nestedShadowRoot.innerHTML = "(before)<shadow></shadow>(after)";
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-map-expected.txt b/LayoutTests/fast/dom/shadow/shadowdom-for-image-map-expected.txt
deleted file mode 100644 (file)
index bf9cb4d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-This test ensures that image map works in img with Shadow DOM.
-
-PASS
-PASS
-PASS
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-map.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-map.html
deleted file mode 100644 (file)
index a4665af..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<p>This test ensures that image map works in img with Shadow DOM.</p>
-<div id="container">
-    <div>
-        <map name="map">
-            <area href="#rect" shape="rect" alt="Rect" coords="0,0,10,10" onclick="result1.innerHTML='PASS'; return false;">
-            <area href="#circle" shape="circle" alt="Circle" coords="20,10,5" onclick="result2.innerHTML='PASS'; return false;">
-            <area href="#poly" shape="poly" alt="Poly" coords="30,0,40,0,40,10,30,10" onclick="result3.innerHTML='PASS'; return false;">
-        </map>
-        <img id="host" src="../resources/apple.gif" usemap="#map" width="100" height="100" ismap>
-    </div>
-</div>
-<div id="result1"></div>
-<div id="result2"></div>
-<div id="result3"></div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-if (window.testRunner)
-    testRunner.dumpAsText();
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "<shadow></shadow>";
-
-    var userAgentShadowRoot = internals.oldestShadowRoot(host);
-    userAgentShadowRoot.firstChild.style.width='100px';
-    userAgentShadowRoot.firstChild.style.height='100px';
-}
-addShadowDOM(host);
-
-function click(x, y) {
-    eventSender.mouseMoveTo(x, y);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-}
-
-click(host.offsetLeft + 5, host.offsetTop + 5);
-click(host.offsetLeft + 20, host.offsetTop + 10);
-click(host.offsetLeft + 35, host.offsetTop + 5);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-style-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-style-expected.html
deleted file mode 100644 (file)
index 15007d1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div>
-    <div>
-        <div style="display: none; width: 20px; height: 20px;">(before)<img src="../resources/apple.gif">(after)</div>
-    </div>
-</div>
-<div>
-    <div>
-        <div style="display: block; width: 20px; height: 20px;">(before)<img src="../resources/apple.gif">(after)</div>
-    </div>
-</div>
-<div>
-    <div>
-        <div style="display: inline; width: 20px; height: 20px;">(before)<img src="../resources/apple.gif">(after)</div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-style.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-style.html
deleted file mode 100644 (file)
index 0926f1e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div>
-    <div>
-        <img id="host1" style="display: none" src="../resources/apple.gif" width="20" height="20">
-    </div>
-</div>
-
-<div>
-    <div>
-        <img id="host2" style="display: block" src="../resources/apple.gif" width="20" height="20">
-    </div>
-</div>
-
-<div>
-    <div>
-        <img id="host3" style="display: inline" src="../resources/apple.gif" width="20" height="20">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)";
-}
-
-addShadowDOM(host1);
-addShadowDOM(host2);
-addShadowDOM(host3);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-multiple-shadow-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-multiple-shadow-expected.html
deleted file mode 100644 (file)
index 2d3a262..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div>
-        <div style="display: inline-block">(before)<div style="display: inline-block">(before)<img src="../resources/apple.gif">(after)</div>(after)</div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html
deleted file mode 100644 (file)
index c47e5b7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div id="container">
-    <div>
-        <img id="host" src="../resources/apple.gif">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)"
-}
-
-addShadowDOM(host);
-addShadowDOM(host);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html
deleted file mode 100644 (file)
index 7db37fc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div>
-        <div style="display: inline-block">(before)<img src="../resources/apple.gif" width="100" height="100">(after)</div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html
deleted file mode 100644 (file)
index 8b30e88..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-<style>
-#host::-webkit-image-inner-element {
-    width: 100px;
-    height: 100px;
-}
-</style>
-
-<div id="container">
-    <div>
-        <img id="host" src="../resources/apple.gif">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)";
-}
-
-addShadowDOM(host);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-width-and-height-expected.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-width-and-height-expected.html
deleted file mode 100644 (file)
index 9ecdf94..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<div id="container">
-    <div>
-        <div style="display: inline-block; width: 30px; height: 30px;">(before)<img src="../resources/apple.gif">(after)</div>
-    </div>
-</div>
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-width-and-height.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-width-and-height.html
deleted file mode 100644 (file)
index e65243e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div id="container">
-    <div>
-        <img id="host" src="../resources/apple.gif" width="30" height="30">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)";
-}
-
-addShadowDOM(host);
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/fast/dom/shadow/shadowdom-for-image.html b/LayoutTests/fast/dom/shadow/shadowdom-for-image.html
deleted file mode 100644 (file)
index 9054d1a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script src="resources/polyfill.js"></script>
-
-<div id="container">
-    <div>
-        <img id="host" src="../resources/apple.gif">
-    </div>
-</div>
-
-<script>
-if (window.internals)
-    internals.settings.setAuthorShadowDOMForAnyElementEnabled(true);
-
-function addShadowDOM(host) {
-    var shadowRoot = host.webkitCreateShadowRoot();
-    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)";
-}
-
-addShadowDOM(host);
-</script>
-
-</body>
-</html>
index 7f6ea85..551ed26 100644 (file)
@@ -1560,7 +1560,6 @@ set(WebCore_SOURCES
     html/shadow/DetailsMarkerControl.cpp
     html/shadow/HTMLContentElement.cpp
     html/shadow/HTMLShadowElement.cpp
-    html/shadow/ImageInnerElement.cpp
     html/shadow/InsertionPoint.cpp
     html/shadow/MediaControlElementTypes.cpp
     html/shadow/MediaControlElements.cpp
index ccab51a..3503d20 100644 (file)
@@ -1,3 +1,80 @@
+2013-01-17  Shinya Kawanaka  <shinyak@chromium.org>
+
+        Revert r122824 for a while
+        https://bugs.webkit.org/show_bug.cgi?id=97867
+
+        Reviewed by Hajime Morita.
+
+        In r122824, we have introduced ImageInnerElement for making an image element ShadowDOM-available.
+        However, it turned out that making a replaced-element ShadowDOM-available has a lot of difficulty.
+        So we would like to postpone it for a while.
+
+        Since that patch makes an image element really complicated, we would like to revert it.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/html.css:
+        * html/HTMLImageElement.cpp:
+        (WebCore):
+        (WebCore::HTMLImageElement::parseAttribute):
+        (WebCore::HTMLImageElement::createRenderer):
+        (WebCore::HTMLImageElement::attach):
+        * html/HTMLImageElement.h:
+        (WebCore):
+        (HTMLImageElement):
+        * html/HTMLImageLoader.cpp:
+        (WebCore::HTMLImageLoader::HTMLImageLoader):
+        (WebCore::HTMLImageLoader::dispatchLoadEvent):
+        (WebCore::HTMLImageLoader::sourceURI):
+        (WebCore::HTMLImageLoader::notifyFinished):
+        * html/HTMLImageLoader.h:
+        (HTMLImageLoader):
+        * html/HTMLInputElement.h:
+        * html/HTMLObjectElement.h:
+        * html/HTMLPlugInElement.h:
+        (WebCore):
+        * html/HTMLPlugInImageElement.h:
+        * html/HTMLTagNames.in:
+        * html/HTMLVideoElement.h:
+        * html/shadow/ImageInnerElement.cpp: Removed.
+        * html/shadow/ImageInnerElement.h: Removed.
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::ImageLoader):
+        (WebCore::ImageLoader::~ImageLoader):
+        (WebCore::ImageLoader::updateFromElement):
+        (WebCore::ImageLoader::notifyFinished):
+        (WebCore::ImageLoader::renderImageResource):
+        (WebCore::ImageLoader::updatedHasPendingEvent):
+        (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
+        (WebCore::ImageLoader::dispatchPendingLoadEvent):
+        (WebCore::ImageLoader::dispatchPendingErrorEvent):
+        * loader/ImageLoader.h:
+        (WebCore):
+        (ImageLoader):
+        (WebCore::ImageLoader::element):
+        * loader/ImageLoaderClient.h: Removed.
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintIntoRect):
+        (WebCore::RenderImage::imageMap):
+        (WebCore::RenderImage::updateAltText):
+        * rendering/RenderImage.h:
+        (WebCore):
+        (RenderImage):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::shouldRespectImageOrientation):
+        * svg/SVGImageElement.h:
+        (SVGImageElement):
+        * svg/SVGImageLoader.cpp:
+        (WebCore::SVGImageLoader::SVGImageLoader):
+        (WebCore::SVGImageLoader::dispatchLoadEvent):
+        (WebCore::SVGImageLoader::sourceURI):
+        * svg/SVGImageLoader.h:
+        (SVGImageLoader):
+
 2013-01-17  Joanmarie Diggs  <jdiggs@igalia.com>
 
         REGRESSION (r139444): Crashes in three accessibility tests on GTK
index 2bb05f3..019d890 100644 (file)
@@ -3605,8 +3605,6 @@ webcore_sources += \
        Source/WebCore/html/shadow/HTMLContentElement.h \
        Source/WebCore/html/shadow/InsertionPoint.cpp \
        Source/WebCore/html/shadow/InsertionPoint.h \
-       Source/WebCore/html/shadow/ImageInnerElement.cpp \
-       Source/WebCore/html/shadow/ImageInnerElement.h \
        Source/WebCore/html/shadow/MediaControlElements.cpp \
        Source/WebCore/html/shadow/MediaControlElements.h \
        Source/WebCore/html/shadow/MediaControlElementTypes.cpp \
@@ -3966,7 +3964,6 @@ webcore_sources += \
        Source/WebCore/loader/icon/PageURLRecord.h \
        Source/WebCore/loader/ImageLoader.cpp \
        Source/WebCore/loader/ImageLoader.h \
-       Source/WebCore/loader/ImageLoaderClient.h \
        Source/WebCore/loader/LinkLoader.h \
        Source/WebCore/loader/LinkLoader.cpp \
        Source/WebCore/loader/LinkLoaderClient.h \
index 1fee32a..4103260 100644 (file)
@@ -741,7 +741,6 @@ SOURCES += \
     html/shadow/HTMLContentElement.cpp \
     html/shadow/HTMLShadowElement.cpp \
     html/shadow/InsertionPoint.cpp \
-    html/shadow/ImageInnerElement.cpp \
     html/shadow/MediaControls.cpp \
     html/shadow/MediaControlsApple.cpp \
     html/shadow/MeterShadowElement.cpp \
index a034f5d..a741c8d 100644 (file)
             'loader/HistoryController.cpp',
             'loader/ImageLoader.cpp',
             'loader/ImageLoader.h',
-            'loader/ImageLoaderClient.h',
             'loader/LinkLoader.cpp',
             'loader/LinkLoader.h',
             'loader/LinkLoaderClient.h',
             'html/shadow/HTMLContentElement.h',
             'html/shadow/HTMLShadowElement.cpp',
             'html/shadow/HTMLShadowElement.h',
-            'html/shadow/ImageInnerElement.cpp',
-            'html/shadow/ImageInnerElement.h',
             'html/shadow/InsertionPoint.cpp',
             'html/shadow/InsertionPoint.h',
             'html/shadow/MediaControls.cpp',
index 72c8938..35fa959 100755 (executable)
                                >
                        </File>
                        <File
-                               RelativePath="..\loader\ImageLoaderClient.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\loader\LinkLoader.cpp"
                                >
                        </File>
                                        >
                                </File>
                                <File
-                                       RelativePath="..\html\shadow\ImageInnerElement.cpp"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\html\shadow\ImageInnerElement.h"
-                                       >
-                               </File>
-                               <File
                                        RelativePath="..\html\shadow\InsertionPoint.cpp"
                                        >
                                </File>
index c6c2cb9..bc82166 100644 (file)
                570B78C01650CE81001DBE1B /* SelectRuleFeatureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 570B78BE1650CE81001DBE1B /* SelectRuleFeatureSet.h */; };
                5728BD9E1625369600C40B56 /* SiblingTraversalStrategies.h in Headers */ = {isa = PBXBuildFile; fileRef = 5728BD9D1625369600C40B56 /* SiblingTraversalStrategies.h */; };
                573D134714CE39FF0057ABCA /* InspectorTypeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 573D134514CE39FF0057ABCA /* InspectorTypeBuilder.cpp */; };
-               5759898715AAC0B100353C31 /* ImageInnerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 572145CC15A51DA700AD119C /* ImageInnerElement.h */; };
-               5759898915AAC0E900353C31 /* ImageInnerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572145CB15A51DA700AD119C /* ImageInnerElement.cpp */; };
-               5759898F15AEAB9400353C31 /* ImageLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5759898E15AEAB9400353C31 /* ImageLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                578DA20E1520EB8C006141C1 /* InspectorFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F4F5FFC11CBD30100A186BF /* InspectorFrontend.h */; settings = {ATTRIBUTES = (Private, ); }; };
                578DA20F1520EBA3006141C1 /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 573D134614CE39FF0057ABCA /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
                57B791A314C6A62900F202D1 /* ContentDistributor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B7919F14C6A62900F202D1 /* ContentDistributor.cpp */; };
                550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                570B78BD1650CE81001DBE1B /* SelectRuleFeatureSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectRuleFeatureSet.cpp; sourceTree = "<group>"; };
                570B78BE1650CE81001DBE1B /* SelectRuleFeatureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectRuleFeatureSet.h; sourceTree = "<group>"; };
-               572145CB15A51DA700AD119C /* ImageInnerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageInnerElement.cpp; sourceTree = "<group>"; };
-               572145CC15A51DA700AD119C /* ImageInnerElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageInnerElement.h; sourceTree = "<group>"; };
                5728BD9D1625369600C40B56 /* SiblingTraversalStrategies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SiblingTraversalStrategies.h; sourceTree = "<group>"; };
                573D134514CE39FF0057ABCA /* InspectorTypeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTypeBuilder.cpp; sourceTree = "<group>"; };
                573D134614CE39FF0057ABCA /* InspectorTypeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTypeBuilder.h; sourceTree = "<group>"; };
-               5759898E15AEAB9400353C31 /* ImageLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageLoaderClient.h; sourceTree = "<group>"; };
                57B7919F14C6A62900F202D1 /* ContentDistributor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentDistributor.cpp; sourceTree = "<group>"; };
                57B791A014C6A62900F202D1 /* ContentDistributor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentDistributor.h; sourceTree = "<group>"; };
                57B791A114C6A62900F202D1 /* ContentSelectorQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentSelectorQuery.cpp; sourceTree = "<group>"; };
                                4ABDFF0714DBE312004D117D /* HTMLShadowElement.cpp */,
                                4ABDFF0814DBE312004D117D /* HTMLShadowElement.h */,
                                4ABDFF0914DBE312004D117D /* HTMLShadowElement.idl */,
-                               572145CB15A51DA700AD119C /* ImageInnerElement.cpp */,
-                               572145CC15A51DA700AD119C /* ImageInnerElement.h */,
                                57CF497214EE36D700ECFF14 /* InsertionPoint.cpp */,
                                57CF497314EE36D700ECFF14 /* InsertionPoint.h */,
                                417253A81354BBBC00360F2A /* MediaControlElements.cpp */,
                                97DCE20010807C750057D394 /* HistoryController.h */,
                                089582530E857A7E00F82C83 /* ImageLoader.cpp */,
                                089582540E857A7E00F82C83 /* ImageLoader.h */,
-                               5759898E15AEAB9400353C31 /* ImageLoaderClient.h */,
                                98CE4325129E00BD005821DC /* LinkLoader.cpp */,
                                98CE4329129E00E5005821DC /* LinkLoader.h */,
                                984264EF12D5280A000D88A4 /* LinkLoaderClient.h */,
                                22BD9F81135364FE009BD102 /* ImageBufferDataCG.h in Headers */,
                                A779791A0D6B9D0C003851B9 /* ImageData.h in Headers */,
                                97205AB61239291000B17380 /* ImageDocument.h in Headers */,
-                               5759898715AAC0B100353C31 /* ImageInnerElement.h in Headers */,
                                F55B3DC21251F12D003EF269 /* ImageInputType.h in Headers */,
                                089582560E857A7E00F82C83 /* ImageLoader.h in Headers */,
-                               5759898F15AEAB9400353C31 /* ImageLoaderClient.h in Headers */,
                                BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */,
                                2D5A5931152525D00036EE51 /* ImageOrientation.h in Headers */,
                                49291E4B134172C800E753DE /* ImageRenderingMode.h in Headers */,
                                B275355E0B053814002CE64F /* ImageCG.cpp in Sources */,
                                A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */,
                                97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
-                               5759898915AAC0E900353C31 /* ImageInnerElement.cpp in Sources */,
                                F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */,
                                089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */,
                                B275357B0B053814002CE64F /* ImageMac.mm in Sources */,
index 4223541..8fdc5bc 100644 (file)
@@ -1117,10 +1117,6 @@ progress::-webkit-progress-value {
 
 /* inline elements */
 
-img {
-    display: inline-block;
-}
-
 u, ins {
     text-decoration: underline
 }
index 093c7d2..d25a9b0 100644 (file)
 #include "Attribute.h"
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
-#include "ElementShadow.h"
 #include "EventNames.h"
 #include "FrameView.h"
 #include "HTMLDocument.h"
 #include "HTMLFormElement.h"
 #include "HTMLNames.h"
 #include "HTMLParserIdioms.h"
-#include "ImageInnerElement.h"
 #include "RenderImage.h"
 #include "ScriptEventListener.h"
-#include "ShadowRoot.h"
 
 using namespace std;
 
@@ -44,29 +41,6 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-void ImageElement::setImageIfNecessary(RenderObject* renderObject, ImageLoader* imageLoader)
-{
-    if (renderObject && renderObject->isImage() && !imageLoader->hasPendingBeforeLoadEvent()) {
-        RenderImage* renderImage = toRenderImage(renderObject);
-        RenderImageResource* renderImageResource = renderImage->imageResource();
-        if (renderImageResource->hasImage())
-            return;
-        renderImageResource->setCachedImage(imageLoader->image());
-
-        // If we have no image at all because we have no src attribute, set
-        // image height and width for the alt text instead.
-        if (!imageLoader->image() && !renderImageResource->cachedImage())
-            renderImage->setImageSizeForAltText();
-    }
-}
-
-RenderObject* ImageElement::createRendererForImage(HTMLElement* element, RenderArena* arena)
-{
-    RenderImage* image = new (arena) RenderImage(element);
-    image->setImageResource(RenderImageResource::create());
-    return image;
-}
-
 HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
     : HTMLElement(tagName, document)
     , m_imageLoader(this)
@@ -94,32 +68,6 @@ HTMLImageElement::~HTMLImageElement()
         m_form->removeImgElement(this);
 }
 
-void HTMLImageElement::willAddAuthorShadowRoot()
-{
-    if (userAgentShadowRoot())
-        return;
-
-    createShadowSubtree();
-}
-
-void HTMLImageElement::createShadowSubtree()
-{
-    RefPtr<ImageInnerElement> innerElement = ImageInnerElement::create(document());
-    
-    RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot);
-    root->appendChild(innerElement);
-}
-
-Element* HTMLImageElement::imageElement()
-{
-    if (ShadowRoot* root = userAgentShadowRoot()) {
-        ASSERT(root->firstChild()->hasTagName(webkitInnerImageTag));
-        return toElement(root->firstChild());
-    }
-
-    return this;
-}
-
 PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document* document, const int* optionalWidth, const int* optionalHeight)
 {
     RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document));
@@ -162,14 +110,11 @@ void HTMLImageElement::collectStyleForPresentationAttribute(const Attribute& att
 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == altAttr) {
-        RenderObject* renderObject = shadow() ? innerElement()->renderer() : renderer();
-        if (renderObject && renderObject->isImage())
-            toRenderImage(renderObject)->updateAltText();
-    } else if (name == srcAttr) {
+        if (renderer() && renderer()->isImage())
+            toRenderImage(renderer())->updateAltText();
+    } else if (name == srcAttr)
         m_imageLoader.updateFromElementIgnoringPreviousError();
-        if (ElementShadow* elementShadow = shadow())
-            elementShadow->invalidateDistribution();
-    } else if (name == usemapAttr)
+    else if (name == usemapAttr)
         setIsLink(!value.isNull());
     else if (name == onloadAttr)
         setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
@@ -198,10 +143,12 @@ String HTMLImageElement::altText() const
 
 RenderObject* HTMLImageElement::createRenderer(RenderArena* arena, RenderStyle* style)
 {
-    if (style->hasContent() || shadow())
+    if (style->hasContent())
         return RenderObject::createObject(this, style);
 
-    return createRendererForImage(this, arena);
+    RenderImage* image = new (arena) RenderImage(this);
+    image->setImageResource(RenderImageResource::create());
+    return image;
 }
 
 bool HTMLImageElement::canStartSelection() const
@@ -215,7 +162,19 @@ bool HTMLImageElement::canStartSelection() const
 void HTMLImageElement::attach()
 {
     HTMLElement::attach();
-    setImageIfNecessary(renderer(), imageLoader());
+
+    if (renderer() && renderer()->isImage() && !m_imageLoader.hasPendingBeforeLoadEvent()) {
+        RenderImage* renderImage = toRenderImage(renderer());
+        RenderImageResource* renderImageResource = renderImage->imageResource();
+        if (renderImageResource->hasImage())
+            return;
+        renderImageResource->setCachedImage(m_imageLoader.image());
+
+        // If we have no image at all because we have no src attribute, set
+        // image height and width for the alt text instead.
+        if (!m_imageLoader.image() && !renderImageResource->cachedImage())
+            renderImage->setImageSizeForAltText();
+    }
 }
 
 Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode* insertionPoint)
@@ -417,12 +376,6 @@ void HTMLImageElement::setItemValueText(const String& value, ExceptionCode&)
 }
 #endif
 
-inline ImageInnerElement* HTMLImageElement::innerElement() const
-{
-    ASSERT(userAgentShadowRoot());
-    return toImageInnerElement(userAgentShadowRoot()->firstChild());
-}
-
 void HTMLImageElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
     MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
index 5f5ebef..a7b187c 100644 (file)
 #include "GraphicsTypes.h"
 #include "HTMLElement.h"
 #include "HTMLImageLoader.h"
-#include "ImageLoaderClient.h"
 
 namespace WebCore {
 
 class HTMLFormElement;
-class ImageInnerElement;
 
-class ImageElement {
-protected:
-    void setImageIfNecessary(RenderObject*, ImageLoader*);
-    RenderObject* createRendererForImage(HTMLElement*, RenderArena*);
-};
-
-class HTMLImageElement : public HTMLElement, public ImageElement, public ImageLoaderClient {
+class HTMLImageElement : public HTMLElement {
     friend class HTMLFormElement;
-    friend class ImageInnerElement;
 public:
     static PassRefPtr<HTMLImageElement> create(Document*);
     static PassRefPtr<HTMLImageElement> create(const QualifiedName&, Document*, HTMLFormElement*);
@@ -50,8 +41,6 @@ public:
 
     virtual ~HTMLImageElement();
 
-    virtual void willAddAuthorShadowRoot() OVERRIDE;
-
     int width(bool ignorePendingStylesheets = false);
     int height(bool ignorePendingStylesheets = false);
 
@@ -95,16 +84,8 @@ protected:
     virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE;
 
 private:
-    virtual void createShadowSubtree();
-
     virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
 
-    // Implementation of ImageLoaderClient
-    Element* sourceElement() { return this; }
-    Element* imageElement();
-    void refSourceElement() { ref(); }
-    void derefSourceElement() { deref(); }
-
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
     virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
     virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
@@ -130,26 +111,11 @@ private:
     virtual void setItemValueText(const String&, ExceptionCode&) OVERRIDE;
 #endif
 
-    RenderObject* imageRenderer() const { return HTMLElement::renderer(); }
-    HTMLImageLoader* imageLoader() { return &m_imageLoader; }
-    ImageInnerElement* innerElement() const;
-
     HTMLImageLoader m_imageLoader;
     HTMLFormElement* m_form;
     CompositeOperator m_compositeOperator;
 };
 
-inline bool isHTMLImageElement(Node* node)
-{
-    return node->hasTagName(HTMLNames::imgTag);
-}
-
-inline HTMLImageElement* toHTMLImageElement(Node* node)
-{
-    ASSERT(!node || isHTMLImageElement(node));
-    return static_cast<HTMLImageElement*>(node);
-}
-
 } //namespace
 
 #endif
index 573bd8c..a3a34a1 100644 (file)
@@ -39,8 +39,8 @@
 
 namespace WebCore {
 
-HTMLImageLoader::HTMLImageLoader(ImageLoaderClient* client)
-    : ImageLoader(client)
+HTMLImageLoader::HTMLImageLoader(Element* node)
+    : ImageLoader(node)
 {
 }
 
@@ -51,19 +51,19 @@ HTMLImageLoader::~HTMLImageLoader()
 void HTMLImageLoader::dispatchLoadEvent()
 {
     // HTMLVideoElement uses this class to load the poster image, but it should not fire events for loading or failure.
-    if (client()->sourceElement()->hasTagName(HTMLNames::videoTag))
+    if (element()->hasTagName(HTMLNames::videoTag))
         return;
 
     bool errorOccurred = image()->errorOccurred();
     if (!errorOccurred && image()->response().httpStatusCode() >= 400)
-        errorOccurred = client()->sourceElement()->hasTagName(HTMLNames::objectTag); // An <object> considers a 404 to be an error and should fire onerror.
-    client()->eventTarget()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
+        errorOccurred = element()->hasTagName(HTMLNames::objectTag); // An <object> considers a 404 to be an error and should fire onerror.
+    element()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
 }
 
 String HTMLImageLoader::sourceURI(const AtomicString& attr) const
 {
 #if ENABLE(DASHBOARD_SUPPORT)
-    Settings* settings = client()->sourceElement()->document()->settings();
+    Settings* settings = element()->document()->settings();
     if (settings && settings->usesDashboardBackwardCompatibilityMode() && attr.length() > 7 && attr.startsWith("url(\"") && attr.endsWith("\")"))
         return attr.string().substring(5, attr.length() - 7);
 #endif
@@ -75,7 +75,7 @@ void HTMLImageLoader::notifyFinished(CachedResource*)
 {
     CachedImage* cachedImage = image();
 
-    RefPtr<Element> element = client()->sourceElement();
+    RefPtr<Element> element = this->element();
     ImageLoader::notifyFinished(cachedImage);
 
     bool loadError = cachedImage->errorOccurred() || cachedImage->response().httpStatusCode() >= 400;
index 89399a6..d3b6068 100644 (file)
@@ -29,7 +29,7 @@ namespace WebCore {
 
 class HTMLImageLoader : public ImageLoader {
 public:
-    HTMLImageLoader(ImageLoaderClient*);
+    HTMLImageLoader(Element*);
     virtual ~HTMLImageLoader();
 
     virtual void dispatchLoadEvent();
index 0a6d5d9..5b86918 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "FileChooser.h"
 #include "HTMLTextFormControlElement.h"
-#include "ImageLoaderClient.h"
 #include "StepRange.h"
 
 namespace WebCore {
@@ -43,7 +42,7 @@ class KURL;
 class ListAttributeTargetObserver;
 struct DateTimeChooserParameters;
 
-class HTMLInputElement : public HTMLTextFormControlElement, public ImageLoaderClientBase<HTMLInputElement> {
+class HTMLInputElement : public HTMLTextFormControlElement {
 public:
     static PassRefPtr<HTMLInputElement> create(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
     virtual ~HTMLInputElement();
index dc19ff2..5477edf 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "FormAssociatedElement.h"
 #include "HTMLPlugInImageElement.h"
-#include "ImageLoaderClient.h"
 
 namespace WebCore {
 
index 11633c6..4796b86 100644 (file)
@@ -24,8 +24,6 @@
 #define HTMLPlugInElement_h
 
 #include "HTMLFrameOwnerElement.h"
-#include "Image.h"
-#include "ImageLoaderClient.h"
 #include "ScriptInstance.h"
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
@@ -34,6 +32,7 @@ struct NPObject;
 
 namespace WebCore {
 
+class Image;
 class RenderEmbeddedObject;
 class RenderWidget;
 class Widget;
index 654b63e..04731b5 100644 (file)
@@ -44,7 +44,7 @@ enum PreferPlugInsForImagesOption {
 };
 
 // Base class for HTMLObjectElement and HTMLEmbedElement
-class HTMLPlugInImageElement : public HTMLPlugInElement, public ImageLoaderClientBase<HTMLPlugInImageElement> {
+class HTMLPlugInImageElement : public HTMLPlugInElement {
 public:
     virtual ~HTMLPlugInImageElement();
 
index d623dd9..4d82ed1 100644 (file)
@@ -68,7 +68,6 @@ i interfaceName=HTMLElement
 iframe interfaceName=HTMLIFrameElement
 image mapToTagName=img
 img interfaceName=HTMLImageElement, constructorNeedsFormElement
-webkitInnerImage interfaceName=HTMLElement, noConstructor
 input constructorNeedsFormElement, constructorNeedsCreatedByParser
 intent conditional=WEB_INTENTS_TAG
 ins interfaceName=HTMLModElement
index f86d53b..26849d3 100644 (file)
 #if ENABLE(VIDEO)
 
 #include "HTMLMediaElement.h"
-#include "ImageLoaderClient.h"
 
 namespace WebCore {
 
 class HTMLImageLoader;
 
-class HTMLVideoElement : public HTMLMediaElement, public ImageLoaderClientBase<HTMLVideoElement> {
+class HTMLVideoElement : public HTMLMediaElement {
 public:
     static PassRefPtr<HTMLVideoElement> create(const QualifiedName&, Document*, bool);
 
diff --git a/Source/WebCore/html/shadow/ImageInnerElement.cpp b/Source/WebCore/html/shadow/ImageInnerElement.cpp
deleted file mode 100644 (file)
index 839cc92..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ImageInnerElement.h"
-
-#include "HTMLImageElement.h"
-#include "ImageLoader.h"
-#include "RenderImage.h"
-
-namespace WebCore {
-
-using namespace HTMLNames;
-
-ImageInnerElement::ImageInnerElement(Document* document)
-    : HTMLElement(HTMLNames::webkitInnerImageTag, document)
-{
-}
-
-inline HTMLImageElement* ImageInnerElement::hostImage()
-{
-    return toHTMLImageElement(shadowAncestorNode());
-}
-
-inline ImageLoader* ImageInnerElement::imageLoader()
-{
-    return hostImage()->imageLoader();
-}
-
-void ImageInnerElement::attach()
-{
-    HTMLElement::attach();
-    setImageIfNecessary(renderer(), imageLoader());
-}
-
-RenderObject* ImageInnerElement::createRenderer(RenderArena* arena, RenderStyle* style)
-{
-    if (style->hasContent())
-        return RenderObject::createObject(this, style);
-
-    return createRendererForImage(this, arena);
-}
-
-const AtomicString& ImageInnerElement::shadowPseudoId() const
-{
-    DEFINE_STATIC_LOCAL(AtomicString, pseudoId, ("-webkit-image-inner-element", AtomicString::ConstructFromLiteral));
-    return pseudoId;
-}
-
-}
diff --git a/Source/WebCore/html/shadow/ImageInnerElement.h b/Source/WebCore/html/shadow/ImageInnerElement.h
deleted file mode 100644 (file)
index 553d443..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ImageInnerElement_h
-#define ImageInnerElement_h
-
-#include "HTMLImageElement.h"
-
-namespace WebCore {
-
-class HTMLImageElement;
-class ImageLoader;
-class RenderObject;
-
-class ImageInnerElement : public HTMLElement, public ImageElement {
-public:
-    static PassRefPtr<ImageInnerElement> create(Document*);
-
-private:
-    ImageInnerElement(Document*);
-
-    HTMLImageElement* hostImage();
-
-    ImageLoader* imageLoader();
-    RenderObject* imageRenderer() const { return HTMLElement::renderer(); }
-
-    virtual void attach() OVERRIDE;
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
-
-    virtual bool canStartSelection() const { return false; }
-
-    virtual const AtomicString& shadowPseudoId() const OVERRIDE;
-};
-
-inline PassRefPtr<ImageInnerElement> ImageInnerElement::create(Document* document)
-{
-    return adoptRef(new ImageInnerElement(document));
-}
-
-inline bool isImageInnerElement(Node* node)
-{
-    return !node || node->hasTagName(HTMLNames::webkitInnerImageTag);
-}
-
-inline ImageInnerElement* toImageInnerElement(Node* node)
-{
-    ASSERT(isImageInnerElement(node));
-    return static_cast<ImageInnerElement*>(node);
-}
-
-}
-
-#endif
index 7e38c3c..30b928e 100644 (file)
 #include "CrossOriginAccessControl.h"
 #include "Document.h"
 #include "Element.h"
-#include "ElementShadow.h"
 #include "Event.h"
 #include "EventSender.h"
 #include "Frame.h"
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
 #include "HTMLParserIdioms.h"
-#include "ImageLoaderClient.h"
 #include "RenderImage.h"
 #include "ScriptCallStack.h"
 #include "SecurityOrigin.h"
@@ -57,8 +55,8 @@ template<> struct ValueCheck<WebCore::ImageLoader*> {
     {
         if (!p)
             return;
-        ASSERT(p->client()->imageElement());
-        ValueCheck<WebCore::Element*>::checkConsistency(p->client()->imageElement());
+        ASSERT(p->element());
+        ValueCheck<WebCore::Element*>::checkConsistency(p->element());
     }
 };
 
@@ -91,8 +89,8 @@ static inline bool pageIsBeingDismissed(Document* document)
     return frame && frame->loader()->pageDismissalEventBeingDispatched() != FrameLoader::NoDismissal;
 }
 
-ImageLoader::ImageLoader(ImageLoaderClient* client)
-    : m_client(client)
+ImageLoader::ImageLoader(Element* element)
+    : m_element(element)
     , m_image(0)
     , m_hasPendingBeforeLoadEvent(false)
     , m_hasPendingLoadEvent(false)
@@ -123,12 +121,7 @@ ImageLoader::~ImageLoader()
     // If the ImageLoader is being destroyed but it is still protecting its image-loading Element,
     // remove that protection here.
     if (m_elementIsProtected)
-        client()->derefSourceElement();
-}
-
-inline Document* ImageLoader::document()
-{
-    return client()->sourceElement()->document();
+        m_element->deref();
 }
 
 void ImageLoader::setImage(CachedImage* newImage)
@@ -173,10 +166,11 @@ void ImageLoader::updateFromElement()
 {
     // If we're not making renderers for the page, then don't load images.  We don't want to slow
     // down the raw HTML parsing case by loading images we don't intend to display.
-    if (!document()->renderer())
+    Document* document = m_element->document();
+    if (!document->renderer())
         return;
 
-    AtomicString attr = client()->sourceElement()->getAttribute(client()->sourceElement()->imageSourceAttributeName());
+    AtomicString attr = m_element->getAttribute(m_element->imageSourceAttributeName());
 
     if (attr == m_failedLoadURL)
         return;
@@ -185,31 +179,31 @@ void ImageLoader::updateFromElement()
     // an empty string.
     CachedResourceHandle<CachedImage> newImage = 0;
     if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {
-        CachedResourceRequest request(ResourceRequest(document()->completeURL(sourceURI(attr))));
-        request.setInitiator(client()->sourceElement());
+        CachedResourceRequest request(ResourceRequest(document->completeURL(sourceURI(attr))));
+        request.setInitiator(element());
 
-        String crossOriginMode = client()->sourceElement()->fastGetAttribute(HTMLNames::crossoriginAttr);
+        String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossoriginAttr);
         if (!crossOriginMode.isNull()) {
             StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
-            updateRequestForAccessControl(request.mutableResourceRequest(), document()->securityOrigin(), allowCredentials);
+            updateRequestForAccessControl(request.mutableResourceRequest(), document->securityOrigin(), allowCredentials);
         }
 
         if (m_loadManually) {
-            bool autoLoadOtherImages = document()->cachedResourceLoader()->autoLoadImages();
-            document()->cachedResourceLoader()->setAutoLoadImages(false);
+            bool autoLoadOtherImages = document->cachedResourceLoader()->autoLoadImages();
+            document->cachedResourceLoader()->setAutoLoadImages(false);
             newImage = new CachedImage(request.resourceRequest());
             newImage->setLoading(true);
-            newImage->setOwningCachedResourceLoader(document()->cachedResourceLoader());
-            document()->cachedResourceLoader()->m_documentResources.set(newImage->url(), newImage.get());
-            document()->cachedResourceLoader()->setAutoLoadImages(autoLoadOtherImages);
+            newImage->setOwningCachedResourceLoader(document->cachedResourceLoader());
+            document->cachedResourceLoader()->m_documentResources.set(newImage->url(), newImage.get());
+            document->cachedResourceLoader()->setAutoLoadImages(autoLoadOtherImages);
         } else
-            newImage = document()->cachedResourceLoader()->requestImage(request);
+            newImage = document->cachedResourceLoader()->requestImage(request);
 
         // If we do not have an image here, it means that a cross-site
         // violation occurred, or that the image was blocked via Content
         // Security Policy, or the page is being dismissed. Trigger an
         // error event if the page is not being dismissed.
-        if (!newImage && !pageIsBeingDismissed(document())) {
+        if (!newImage && !pageIsBeingDismissed(document)) {
             m_failedLoadURL = attr;
             m_hasPendingErrorEvent = true;
             errorEventSender().dispatchEventSoon(this);
@@ -218,7 +212,7 @@ void ImageLoader::updateFromElement()
     } else if (!attr.isNull()) {
         // Fire an error event if the url is empty.
         // FIXME: Should we fire this event asynchronoulsy via errorEventSender()?
-        client()->imageElement()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        m_element->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
     }
     
     CachedImage* oldImage = m_image.get();
@@ -231,13 +225,13 @@ void ImageLoader::updateFromElement()
             errorEventSender().cancelEvent(this);
 
         m_image = newImage;
-        m_hasPendingBeforeLoadEvent = !document()->isImageDocument() && newImage;
+        m_hasPendingBeforeLoadEvent = !m_element->document()->isImageDocument() && newImage;
         m_hasPendingLoadEvent = newImage;
         m_imageComplete = !newImage;
 
         if (newImage) {
-            if (!document()->isImageDocument()) {
-                if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER))
+            if (!m_element->document()->isImageDocument()) {
+                if (!m_element->document()->hasListenerType(Document::BEFORELOAD_LISTENER))
                     dispatchPendingBeforeLoadEvent();
                 else
                     beforeLoadEventSender().dispatchEventSoon(this);
@@ -279,9 +273,9 @@ void ImageLoader::notifyFinished(CachedResource* resource)
     if (!m_hasPendingLoadEvent)
         return;
 
-    if (client()->sourceElement()->fastHasAttribute(HTMLNames::crossoriginAttr)
-        && !document()->securityOrigin()->canRequest(image()->response().url())
-        && !resource->passesAccessControlCheck(document()->securityOrigin())) {
+    if (m_element->fastHasAttribute(HTMLNames::crossoriginAttr)
+        && !m_element->document()->securityOrigin()->canRequest(image()->response().url())
+        && !resource->passesAccessControlCheck(m_element->document()->securityOrigin())) {
 
         setImageWithoutConsideringPendingLoadEvent(0);
 
@@ -289,7 +283,7 @@ void ImageLoader::notifyFinished(CachedResource* resource)
         errorEventSender().dispatchEventSoon(this);
 
         DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Cross-origin image load denied by Cross-Origin Resource Sharing policy.")));
-        document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, consoleMessage);
+        m_element->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, consoleMessage);
 
         ASSERT(!m_hasPendingLoadEvent);
 
@@ -312,7 +306,7 @@ void ImageLoader::notifyFinished(CachedResource* resource)
 
 RenderImageResource* ImageLoader::renderImageResource()
 {
-    RenderObject* renderer = client()->imageElement()->renderer();
+    RenderObject* renderer = m_element->renderer();
 
     if (!renderer)
         return 0;
@@ -362,9 +356,9 @@ void ImageLoader::updatedHasPendingEvent()
         return;
 
     if (m_elementIsProtected)
-        client()->refSourceElement();
+        m_element->ref();
     else
-        client()->derefSourceElement();
+        m_element->deref();
 }
 
 void ImageLoader::dispatchPendingEvent(ImageEventSender* eventSender)
@@ -385,10 +379,10 @@ void ImageLoader::dispatchPendingBeforeLoadEvent()
         return;
     if (!m_image)
         return;
-    if (!document()->attached())
+    if (!m_element->document()->attached())
         return;
     m_hasPendingBeforeLoadEvent = false;
-    if (client()->sourceElement()->dispatchBeforeLoadEvent(m_image->url())) {
+    if (m_element->dispatchBeforeLoadEvent(m_image->url())) {
         updateRenderer();
         return;
     }
@@ -399,9 +393,9 @@ void ImageLoader::dispatchPendingBeforeLoadEvent()
 
     loadEventSender().cancelEvent(this);
     m_hasPendingLoadEvent = false;
-
-    if (client()->sourceElement()->hasTagName(HTMLNames::objectTag))
-        static_cast<HTMLObjectElement*>(client()->sourceElement())->renderFallbackContent();
+    
+    if (m_element->hasTagName(HTMLNames::objectTag))
+        static_cast<HTMLObjectElement*>(m_element)->renderFallbackContent();
 
     // Only consider updating the protection ref-count of the Element immediately before returning
     // from this function as doing so might result in the destruction of this ImageLoader.
@@ -415,7 +409,7 @@ void ImageLoader::dispatchPendingLoadEvent()
     if (!m_image)
         return;
     m_hasPendingLoadEvent = false;
-    if (document()->attached())
+    if (element()->document()->attached())
         dispatchLoadEvent();
 
     // Only consider updating the protection ref-count of the Element immediately before returning
@@ -428,8 +422,8 @@ void ImageLoader::dispatchPendingErrorEvent()
     if (!m_hasPendingErrorEvent)
         return;
     m_hasPendingErrorEvent = false;
-    if (document()->attached())
-        client()->imageElement()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+    if (element()->document()->attached())
+        element()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
 
     // Only consider updating the protection ref-count of the Element immediately before returning
     // from this function as doing so might result in the destruction of this ImageLoader.
index 4cf3521..f59d4d5 100644 (file)
 #include "CachedImage.h"
 #include "CachedImageClient.h"
 #include "CachedResourceHandle.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/AtomicString.h>
 
 namespace WebCore {
 
 class Element;
 class ImageLoader;
-class ImageLoaderClient;
-class QualifiedName;
 class RenderImageResource;
 
 template<typename T> class EventSender;
@@ -43,11 +39,9 @@ typedef EventSender<ImageLoader> ImageEventSender;
 
 class ImageLoader : public CachedImageClient {
 public:
-    explicit ImageLoader(ImageLoaderClient*);
+    explicit ImageLoader(Element*);
     virtual ~ImageLoader();
 
-    ImageLoaderClient* client() const { return m_client; }
-
     // This function should be called when the element is attached to a document; starts
     // loading if a load hasn't already been started.
     void updateFromElement();
@@ -58,6 +52,7 @@ public:
 
     void elementDidMoveToNewDocument();
 
+    Element* element() const { return m_element; }
     bool imageComplete() const { return m_imageComplete; }
 
     CachedImage* image() const { return m_image.get(); }
@@ -78,7 +73,6 @@ protected:
     virtual void notifyFinished(CachedResource*);
 
 private:
-    Document* document();
     virtual void dispatchLoadEvent() = 0;
     virtual String sourceURI(const AtomicString&) const = 0;
 
@@ -94,7 +88,7 @@ private:
     void setImageWithoutConsideringPendingLoadEvent(CachedImage*);
     void clearFailedLoadURL();
 
-    ImageLoaderClient* m_client;
+    Element* m_element;
     CachedResourceHandle<CachedImage> m_image;
     AtomicString m_failedLoadURL;
     bool m_hasPendingBeforeLoadEvent : 1;
diff --git a/Source/WebCore/loader/ImageLoaderClient.h b/Source/WebCore/loader/ImageLoaderClient.h
deleted file mode 100644 (file)
index 4ed1e65..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ImageLoaderClient_h
-#define ImageLoaderClient_h
-
-namespace WebCore {
-
-class Element;
-
-class ImageLoaderClient {
-public:
-    virtual ~ImageLoaderClient() { }
-
-    virtual Element* sourceElement() = 0;
-    virtual Element* imageElement() = 0;
-    Element* eventTarget() { return sourceElement(); }
-
-    virtual void refSourceElement() = 0;
-    virtual void derefSourceElement() = 0;
-};
-
-template<typename T>
-class ImageLoaderClientBase : public ImageLoaderClient {
-public:
-    Element* sourceElement() { return static_cast<T*>(this); }
-    Element* imageElement() { return static_cast<T*>(this); }
-
-    void refSourceElement() { static_cast<T*>(this)->ref(); }
-    void derefSourceElement() { static_cast<T*>(this)->deref(); }
-};
-
-}
-
-#endif
index b987236..279a823 100644 (file)
@@ -459,7 +459,7 @@ void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect
     if (!img || img->isNull())
         return;
 
-    HTMLImageElement* imageElt = hostImageElement();
+    HTMLImageElement* imageElt = (node() && node()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(node()) : 0;
     CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
     Image* image = m_imageResource->image().get();
     bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
@@ -507,7 +507,7 @@ LayoutUnit RenderImage::minimumReplacedHeight() const
 
 HTMLMapElement* RenderImage::imageMap() const
 {
-    HTMLImageElement* i = hostImageElement();
+    HTMLImageElement* i = node() && node()->hasTagName(imgTag) ? static_cast<HTMLImageElement*>(node()) : 0;
     return i ? i->treeScope()->getImageMap(i->fastGetAttribute(usemapAttr)) : 0;
 }
 
@@ -542,8 +542,8 @@ void RenderImage::updateAltText()
 
     if (node()->hasTagName(inputTag))
         m_altText = static_cast<HTMLInputElement*>(node())->altText();
-    else if (HTMLImageElement* image = hostImageElement())
-        m_altText = image->altText();
+    else if (node()->hasTagName(imgTag))
+        m_altText = static_cast<HTMLImageElement*>(node())->altText();
 }
 
 void RenderImage::layout()
@@ -577,24 +577,6 @@ void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, dou
     }
 }
 
-HTMLImageElement* RenderImage::hostImageElement() const
-{
-    if (!node())
-        return 0;
-
-    if (isHTMLImageElement(node()))
-        return toHTMLImageElement(node());
-
-    if (node()->hasTagName(webkitInnerImageTag)) {
-        if (Node* ancestor = node()->shadowHost()) {
-            if (ancestor->hasTagName(imgTag))
-                return toHTMLImageElement(ancestor);
-        }
-    }
-
-    return 0;
-}
-
 bool RenderImage::needsPreferredWidthsRecalculation() const
 {
     if (RenderReplaced::needsPreferredWidthsRecalculation())
index 3c7bf8b..33ad9a1 100644 (file)
@@ -31,7 +31,6 @@
 namespace WebCore {
 
 class HTMLAreaElement;
-class HTMLImageElement;
 class HTMLMapElement;
 
 class RenderImage : public RenderReplaced {
@@ -59,8 +58,6 @@ public:
     bool isGeneratedContent() const { return m_isGeneratedContent; }
 
 protected:
-    HTMLImageElement* hostImageElement() const;
-
     virtual bool needsPreferredWidthsRecalculation() const;
     virtual RenderBox* embeddedContentBox() const;
     virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio, bool& isPercentageIntrinsicSize) const;
index 7f81a62..f560011 100644 (file)
@@ -2250,7 +2250,7 @@ RespectImageOrientationEnum RenderObject::shouldRespectImageOrientation() const
         // This can only be enabled for ports which honor the orientation flag in their drawing code.
         document()->isImageDocument() ||
 #endif
-        (document()->settings() && document()->settings()->shouldRespectImageOrientation() && node() && (node()->hasTagName(HTMLNames::imgTag) || node()->hasTagName(HTMLNames::webkitInnerImageTag))) ? RespectImageOrientation : DoNotRespectImageOrientation;
+        (document()->settings() && document()->settings()->shouldRespectImageOrientation() && node() && node()->hasTagName(HTMLNames::imgTag)) ? RespectImageOrientation : DoNotRespectImageOrientation;
 }
 
 bool RenderObject::hasOutlineAnnotation() const
index cd96476..08b7cba 100644 (file)
@@ -22,7 +22,6 @@
 #define SVGImageElement_h
 
 #if ENABLE(SVG)
-#include "ImageLoaderClient.h"
 #include "SVGAnimatedBoolean.h"
 #include "SVGAnimatedLength.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
@@ -39,14 +38,13 @@ class SVGImageElement : public SVGStyledTransformableElement,
                         public SVGTests,
                         public SVGLangSpace,
                         public SVGExternalResourcesRequired,
-                        public SVGURIReference,
-                        public ImageLoaderClientBase<SVGImageElement> {
+                        public SVGURIReference {
 public:
     static PassRefPtr<SVGImageElement> create(const QualifiedName&, Document*);
 
 private:
     SVGImageElement(const QualifiedName&, Document*);
-
+    
     virtual bool isValid() const { return SVGTests::isValid(); }
     virtual bool supportsFocus() const { return true; }
 
index 290acdb..4f33d56 100644 (file)
 #include "Event.h"
 #include "EventNames.h"
 #include "HTMLParserIdioms.h"
-#include "ImageLoaderClient.h"
 #include "RenderImage.h"
 #include "SVGImageElement.h"
 
 namespace WebCore {
 
-SVGImageLoader::SVGImageLoader(ImageLoaderClient* client)
-    : ImageLoader(client)
+SVGImageLoader::SVGImageLoader(SVGImageElement* node)
+    : ImageLoader(node)
 {
 }
 
 void SVGImageLoader::dispatchLoadEvent()
 {
     if (image()->errorOccurred())
-        client()->imageElement()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
+        element()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
     else {
-        SVGImageElement* imageElement = static_cast<SVGImageElement*>(client()->imageElement());
+        SVGImageElement* imageElement = static_cast<SVGImageElement*>(element());
         if (imageElement->externalResourcesRequiredBaseValue())
             imageElement->sendSVGLoadEventIfPossible(true);
     }
@@ -50,10 +49,10 @@ void SVGImageLoader::dispatchLoadEvent()
 
 String SVGImageLoader::sourceURI(const AtomicString& attribute) const
 {
-    KURL base = client()->sourceElement()->baseURI();
+    KURL base = element()->baseURI();
     if (base.isValid())
         return KURL(base, stripLeadingAndTrailingHTMLSpaces(attribute)).string();
-    return client()->sourceElement()->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(attribute));
+    return element()->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(attribute));
 }
 
 }
index d617cd8..b7a1617 100644 (file)
@@ -29,7 +29,7 @@ class SVGImageElement;
 
 class SVGImageLoader : public ImageLoader {
 public:
-    SVGImageLoader(ImageLoaderClient*);
+    SVGImageLoader(SVGImageElement*);
 
 private:
     virtual void dispatchLoadEvent();