Changeset 140097 in webkit


Ignore:
Timestamp:
Jan 17, 2013 7:57:06 PM (11 years ago)
Author:
shinyak@chromium.org
Message:

Revert r122824 for a while
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.
Location:
trunk
Files:
29 deleted
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140096 r140097  
     12013-01-17  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        Revert r122824 for a while
     4        https://bugs.webkit.org/show_bug.cgi?id=97867
     5
     6        Reviewed by Hajime Morita.
     7
     8        * fast/dom/shadow/select-image-with-shadow-expected.txt: Removed.
     9        * fast/dom/shadow/select-image-with-shadow.html: Removed.
     10        * fast/dom/shadow/shadowdom-for-image-alt-expected.html: Removed.
     11        * fast/dom/shadow/shadowdom-for-image-alt-update-expected.html: Removed.
     12        * fast/dom/shadow/shadowdom-for-image-alt-update.html: Removed.
     13        * fast/dom/shadow/shadowdom-for-image-alt.html: Removed.
     14        * fast/dom/shadow/shadowdom-for-image-content-expected.html: Removed.
     15        * fast/dom/shadow/shadowdom-for-image-content.html: Removed.
     16        * fast/dom/shadow/shadowdom-for-image-dynamic-expected.html: Removed.
     17        * fast/dom/shadow/shadowdom-for-image-dynamic.html: Removed.
     18        * fast/dom/shadow/shadowdom-for-image-event-click-expected.txt: Removed.
     19        * fast/dom/shadow/shadowdom-for-image-event-click.html: Removed.
     20        * fast/dom/shadow/shadowdom-for-image-expected.html: Removed.
     21        * fast/dom/shadow/shadowdom-for-image-in-shadowdom-expected.html: Removed.
     22        * fast/dom/shadow/shadowdom-for-image-in-shadowdom.html: Removed.
     23        * fast/dom/shadow/shadowdom-for-image-map-expected.txt: Removed.
     24        * fast/dom/shadow/shadowdom-for-image-map.html: Removed.
     25        * fast/dom/shadow/shadowdom-for-image-style-expected.html: Removed.
     26        * fast/dom/shadow/shadowdom-for-image-style.html: Removed.
     27        * fast/dom/shadow/shadowdom-for-image-with-multiple-shadow-expected.html: Removed.
     28        * fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html: Removed.
     29        * fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html: Removed.
     30        * fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html: Removed.
     31        * fast/dom/shadow/shadowdom-for-image-with-width-and-height-expected.html: Removed.
     32        * fast/dom/shadow/shadowdom-for-image-with-width-and-height.html: Removed.
     33        * fast/dom/shadow/shadowdom-for-image.html: Removed.
     34
    1352013-01-17  Benjamin Poulain  <bpoulain@apple.com>
    236
  • trunk/Source/WebCore/CMakeLists.txt

    r139950 r140097  
    15611561    html/shadow/HTMLContentElement.cpp
    15621562    html/shadow/HTMLShadowElement.cpp
    1563     html/shadow/ImageInnerElement.cpp
    15641563    html/shadow/InsertionPoint.cpp
    15651564    html/shadow/MediaControlElementTypes.cpp
  • trunk/Source/WebCore/ChangeLog

    r140095 r140097  
     12013-01-17  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        Revert r122824 for a while
     4        https://bugs.webkit.org/show_bug.cgi?id=97867
     5
     6        Reviewed by Hajime Morita.
     7
     8        In r122824, we have introduced ImageInnerElement for making an image element ShadowDOM-available.
     9        However, it turned out that making a replaced-element ShadowDOM-available has a lot of difficulty.
     10        So we would like to postpone it for a while.
     11
     12        Since that patch makes an image element really complicated, we would like to revert it.
     13
     14        * CMakeLists.txt:
     15        * GNUmakefile.list.am:
     16        * Target.pri:
     17        * WebCore.gypi:
     18        * WebCore.vcproj/WebCore.vcproj:
     19        * WebCore.xcodeproj/project.pbxproj:
     20        * css/html.css:
     21        * html/HTMLImageElement.cpp:
     22        (WebCore):
     23        (WebCore::HTMLImageElement::parseAttribute):
     24        (WebCore::HTMLImageElement::createRenderer):
     25        (WebCore::HTMLImageElement::attach):
     26        * html/HTMLImageElement.h:
     27        (WebCore):
     28        (HTMLImageElement):
     29        * html/HTMLImageLoader.cpp:
     30        (WebCore::HTMLImageLoader::HTMLImageLoader):
     31        (WebCore::HTMLImageLoader::dispatchLoadEvent):
     32        (WebCore::HTMLImageLoader::sourceURI):
     33        (WebCore::HTMLImageLoader::notifyFinished):
     34        * html/HTMLImageLoader.h:
     35        (HTMLImageLoader):
     36        * html/HTMLInputElement.h:
     37        * html/HTMLObjectElement.h:
     38        * html/HTMLPlugInElement.h:
     39        (WebCore):
     40        * html/HTMLPlugInImageElement.h:
     41        * html/HTMLTagNames.in:
     42        * html/HTMLVideoElement.h:
     43        * html/shadow/ImageInnerElement.cpp: Removed.
     44        * html/shadow/ImageInnerElement.h: Removed.
     45        * loader/ImageLoader.cpp:
     46        (WebCore::ImageLoader::ImageLoader):
     47        (WebCore::ImageLoader::~ImageLoader):
     48        (WebCore::ImageLoader::updateFromElement):
     49        (WebCore::ImageLoader::notifyFinished):
     50        (WebCore::ImageLoader::renderImageResource):
     51        (WebCore::ImageLoader::updatedHasPendingEvent):
     52        (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
     53        (WebCore::ImageLoader::dispatchPendingLoadEvent):
     54        (WebCore::ImageLoader::dispatchPendingErrorEvent):
     55        * loader/ImageLoader.h:
     56        (WebCore):
     57        (ImageLoader):
     58        (WebCore::ImageLoader::element):
     59        * loader/ImageLoaderClient.h: Removed.
     60        * rendering/RenderImage.cpp:
     61        (WebCore::RenderImage::paintIntoRect):
     62        (WebCore::RenderImage::imageMap):
     63        (WebCore::RenderImage::updateAltText):
     64        * rendering/RenderImage.h:
     65        (WebCore):
     66        (RenderImage):
     67        * rendering/RenderObject.cpp:
     68        (WebCore::RenderObject::shouldRespectImageOrientation):
     69        * svg/SVGImageElement.h:
     70        (SVGImageElement):
     71        * svg/SVGImageLoader.cpp:
     72        (WebCore::SVGImageLoader::SVGImageLoader):
     73        (WebCore::SVGImageLoader::dispatchLoadEvent):
     74        (WebCore::SVGImageLoader::sourceURI):
     75        * svg/SVGImageLoader.h:
     76        (SVGImageLoader):
     77
    1782013-01-17  Joanmarie Diggs  <jdiggs@igalia.com>
    279
  • trunk/Source/WebCore/GNUmakefile.list.am

    r140021 r140097  
    36063606        Source/WebCore/html/shadow/InsertionPoint.cpp \
    36073607        Source/WebCore/html/shadow/InsertionPoint.h \
    3608         Source/WebCore/html/shadow/ImageInnerElement.cpp \
    3609         Source/WebCore/html/shadow/ImageInnerElement.h \
    36103608        Source/WebCore/html/shadow/MediaControlElements.cpp \
    36113609        Source/WebCore/html/shadow/MediaControlElements.h \
     
    39673965        Source/WebCore/loader/ImageLoader.cpp \
    39683966        Source/WebCore/loader/ImageLoader.h \
    3969         Source/WebCore/loader/ImageLoaderClient.h \
    39703967        Source/WebCore/loader/LinkLoader.h \
    39713968        Source/WebCore/loader/LinkLoader.cpp \
  • trunk/Source/WebCore/Target.pri

    r140029 r140097  
    742742    html/shadow/HTMLShadowElement.cpp \
    743743    html/shadow/InsertionPoint.cpp \
    744     html/shadow/ImageInnerElement.cpp \
    745744    html/shadow/MediaControls.cpp \
    746745    html/shadow/MediaControlsApple.cpp \
  • trunk/Source/WebCore/WebCore.gypi

    r139978 r140097  
    19291929            'loader/ImageLoader.cpp',
    19301930            'loader/ImageLoader.h',
    1931             'loader/ImageLoaderClient.h',
    19321931            'loader/LinkLoader.cpp',
    19331932            'loader/LinkLoader.h',
     
    34083407            'html/shadow/HTMLShadowElement.cpp',
    34093408            'html/shadow/HTMLShadowElement.h',
    3410             'html/shadow/ImageInnerElement.cpp',
    3411             'html/shadow/ImageInnerElement.h',
    34123409            'html/shadow/InsertionPoint.cpp',
    34133410            'html/shadow/InsertionPoint.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r139978 r140097  
    2771927719                        </File>
    2772027720                        <File
    27721                                 RelativePath="..\loader\ImageLoaderClient.h"
    27722                                 >
    27723                         </File>
    27724                         <File
    2772527721                                RelativePath="..\loader\LinkLoader.cpp"
    2772627722                                >
     
    6497064966                                </File>
    6497164967                                <File
    64972                                         RelativePath="..\html\shadow\ImageInnerElement.cpp"
    64973                                         >
    64974                                 </File>
    64975                                 <File
    64976                                         RelativePath="..\html\shadow\ImageInnerElement.h"
    64977                                         >
    64978                                 </File>
    64979                                 <File
    6498064968                                        RelativePath="..\html\shadow\InsertionPoint.cpp"
    6498164969                                        >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r139950 r140097  
    16941694                5728BD9E1625369600C40B56 /* SiblingTraversalStrategies.h in Headers */ = {isa = PBXBuildFile; fileRef = 5728BD9D1625369600C40B56 /* SiblingTraversalStrategies.h */; };
    16951695                573D134714CE39FF0057ABCA /* InspectorTypeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 573D134514CE39FF0057ABCA /* InspectorTypeBuilder.cpp */; };
    1696                 5759898715AAC0B100353C31 /* ImageInnerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 572145CC15A51DA700AD119C /* ImageInnerElement.h */; };
    1697                 5759898915AAC0E900353C31 /* ImageInnerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572145CB15A51DA700AD119C /* ImageInnerElement.cpp */; };
    1698                 5759898F15AEAB9400353C31 /* ImageLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5759898E15AEAB9400353C31 /* ImageLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    16991696                578DA20E1520EB8C006141C1 /* InspectorFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F4F5FFC11CBD30100A186BF /* InspectorFrontend.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17001697                578DA20F1520EBA3006141C1 /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 573D134614CE39FF0057ABCA /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    90539050                570B78BD1650CE81001DBE1B /* SelectRuleFeatureSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectRuleFeatureSet.cpp; sourceTree = "<group>"; };
    90549051                570B78BE1650CE81001DBE1B /* SelectRuleFeatureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectRuleFeatureSet.h; sourceTree = "<group>"; };
    9055                 572145CB15A51DA700AD119C /* ImageInnerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageInnerElement.cpp; sourceTree = "<group>"; };
    9056                 572145CC15A51DA700AD119C /* ImageInnerElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageInnerElement.h; sourceTree = "<group>"; };
    90579052                5728BD9D1625369600C40B56 /* SiblingTraversalStrategies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SiblingTraversalStrategies.h; sourceTree = "<group>"; };
    90589053                573D134514CE39FF0057ABCA /* InspectorTypeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTypeBuilder.cpp; sourceTree = "<group>"; };
    90599054                573D134614CE39FF0057ABCA /* InspectorTypeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTypeBuilder.h; sourceTree = "<group>"; };
    9060                 5759898E15AEAB9400353C31 /* ImageLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageLoaderClient.h; sourceTree = "<group>"; };
    90619055                57B7919F14C6A62900F202D1 /* ContentDistributor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentDistributor.cpp; sourceTree = "<group>"; };
    90629056                57B791A014C6A62900F202D1 /* ContentDistributor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentDistributor.h; sourceTree = "<group>"; };
     
    1539715391                                4ABDFF0814DBE312004D117D /* HTMLShadowElement.h */,
    1539815392                                4ABDFF0914DBE312004D117D /* HTMLShadowElement.idl */,
    15399                                 572145CB15A51DA700AD119C /* ImageInnerElement.cpp */,
    15400                                 572145CC15A51DA700AD119C /* ImageInnerElement.h */,
    1540115393                                57CF497214EE36D700ECFF14 /* InsertionPoint.cpp */,
    1540215394                                57CF497314EE36D700ECFF14 /* InsertionPoint.h */,
     
    2116721159                                089582530E857A7E00F82C83 /* ImageLoader.cpp */,
    2116821160                                089582540E857A7E00F82C83 /* ImageLoader.h */,
    21169                                 5759898E15AEAB9400353C31 /* ImageLoaderClient.h */,
    2117021161                                98CE4325129E00BD005821DC /* LinkLoader.cpp */,
    2117121162                                98CE4329129E00E5005821DC /* LinkLoader.h */,
     
    2436924360                                A779791A0D6B9D0C003851B9 /* ImageData.h in Headers */,
    2437024361                                97205AB61239291000B17380 /* ImageDocument.h in Headers */,
    24371                                 5759898715AAC0B100353C31 /* ImageInnerElement.h in Headers */,
    2437224362                                F55B3DC21251F12D003EF269 /* ImageInputType.h in Headers */,
    2437324363                                089582560E857A7E00F82C83 /* ImageLoader.h in Headers */,
    24374                                 5759898F15AEAB9400353C31 /* ImageLoaderClient.h in Headers */,
    2437524364                                BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */,
    2437624365                                2D5A5931152525D00036EE51 /* ImageOrientation.h in Headers */,
     
    2763527624                                A77979190D6B9D0C003851B9 /* ImageData.cpp in Sources */,
    2763627625                                97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
    27637                                 5759898915AAC0E900353C31 /* ImageInnerElement.cpp in Sources */,
    2763827626                                F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */,
    2763927627                                089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */,
  • trunk/Source/WebCore/css/html.css

    r139172 r140097  
    11181118/* inline elements */
    11191119
    1120 img {
    1121     display: inline-block;
    1122 }
    1123 
    11241120u, ins {
    11251121    text-decoration: underline
  • trunk/Source/WebCore/html/HTMLImageElement.cpp

    r136337 r140097  
    2727#include "CSSPropertyNames.h"
    2828#include "CSSValueKeywords.h"
    29 #include "ElementShadow.h"
    3029#include "EventNames.h"
    3130#include "FrameView.h"
     
    3433#include "HTMLNames.h"
    3534#include "HTMLParserIdioms.h"
    36 #include "ImageInnerElement.h"
    3735#include "RenderImage.h"
    3836#include "ScriptEventListener.h"
    39 #include "ShadowRoot.h"
    4037
    4138using namespace std;
     
    4441
    4542using namespace HTMLNames;
    46 
    47 void ImageElement::setImageIfNecessary(RenderObject* renderObject, ImageLoader* imageLoader)
    48 {
    49     if (renderObject && renderObject->isImage() && !imageLoader->hasPendingBeforeLoadEvent()) {
    50         RenderImage* renderImage = toRenderImage(renderObject);
    51         RenderImageResource* renderImageResource = renderImage->imageResource();
    52         if (renderImageResource->hasImage())
    53             return;
    54         renderImageResource->setCachedImage(imageLoader->image());
    55 
    56         // If we have no image at all because we have no src attribute, set
    57         // image height and width for the alt text instead.
    58         if (!imageLoader->image() && !renderImageResource->cachedImage())
    59             renderImage->setImageSizeForAltText();
    60     }
    61 }
    62 
    63 RenderObject* ImageElement::createRendererForImage(HTMLElement* element, RenderArena* arena)
    64 {
    65     RenderImage* image = new (arena) RenderImage(element);
    66     image->setImageResource(RenderImageResource::create());
    67     return image;
    68 }
    6943
    7044HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
     
    9367    if (m_form)
    9468        m_form->removeImgElement(this);
    95 }
    96 
    97 void HTMLImageElement::willAddAuthorShadowRoot()
    98 {
    99     if (userAgentShadowRoot())
    100         return;
    101 
    102     createShadowSubtree();
    103 }
    104 
    105 void HTMLImageElement::createShadowSubtree()
    106 {
    107     RefPtr<ImageInnerElement> innerElement = ImageInnerElement::create(document());
    108    
    109     RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot);
    110     root->appendChild(innerElement);
    111 }
    112 
    113 Element* HTMLImageElement::imageElement()
    114 {
    115     if (ShadowRoot* root = userAgentShadowRoot()) {
    116         ASSERT(root->firstChild()->hasTagName(webkitInnerImageTag));
    117         return toElement(root->firstChild());
    118     }
    119 
    120     return this;
    12169}
    12270
     
    163111{
    164112    if (name == altAttr) {
    165         RenderObject* renderObject = shadow() ? innerElement()->renderer() : renderer();
    166         if (renderObject && renderObject->isImage())
    167             toRenderImage(renderObject)->updateAltText();
    168     } else if (name == srcAttr) {
     113        if (renderer() && renderer()->isImage())
     114            toRenderImage(renderer())->updateAltText();
     115    } else if (name == srcAttr)
    169116        m_imageLoader.updateFromElementIgnoringPreviousError();
    170         if (ElementShadow* elementShadow = shadow())
    171             elementShadow->invalidateDistribution();
    172     } else if (name == usemapAttr)
     117    else if (name == usemapAttr)
    173118        setIsLink(!value.isNull());
    174119    else if (name == onloadAttr)
     
    199144RenderObject* HTMLImageElement::createRenderer(RenderArena* arena, RenderStyle* style)
    200145{
    201     if (style->hasContent() || shadow())
     146    if (style->hasContent())
    202147        return RenderObject::createObject(this, style);
    203148
    204     return createRendererForImage(this, arena);
     149    RenderImage* image = new (arena) RenderImage(this);
     150    image->setImageResource(RenderImageResource::create());
     151    return image;
    205152}
    206153
     
    216163{
    217164    HTMLElement::attach();
    218     setImageIfNecessary(renderer(), imageLoader());
     165
     166    if (renderer() && renderer()->isImage() && !m_imageLoader.hasPendingBeforeLoadEvent()) {
     167        RenderImage* renderImage = toRenderImage(renderer());
     168        RenderImageResource* renderImageResource = renderImage->imageResource();
     169        if (renderImageResource->hasImage())
     170            return;
     171        renderImageResource->setCachedImage(m_imageLoader.image());
     172
     173        // If we have no image at all because we have no src attribute, set
     174        // image height and width for the alt text instead.
     175        if (!m_imageLoader.image() && !renderImageResource->cachedImage())
     176            renderImage->setImageSizeForAltText();
     177    }
    219178}
    220179
     
    418377#endif
    419378
    420 inline ImageInnerElement* HTMLImageElement::innerElement() const
    421 {
    422     ASSERT(userAgentShadowRoot());
    423     return toImageInnerElement(userAgentShadowRoot()->firstChild());
    424 }
    425 
    426379void HTMLImageElement::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
    427380{
  • trunk/Source/WebCore/html/HTMLImageElement.h

    r135069 r140097  
    2828#include "HTMLElement.h"
    2929#include "HTMLImageLoader.h"
    30 #include "ImageLoaderClient.h"
    3130
    3231namespace WebCore {
    3332
    3433class HTMLFormElement;
    35 class ImageInnerElement;
    3634
    37 class ImageElement {
    38 protected:
    39     void setImageIfNecessary(RenderObject*, ImageLoader*);
    40     RenderObject* createRendererForImage(HTMLElement*, RenderArena*);
    41 };
    42 
    43 class HTMLImageElement : public HTMLElement, public ImageElement, public ImageLoaderClient {
     35class HTMLImageElement : public HTMLElement {
    4436    friend class HTMLFormElement;
    45     friend class ImageInnerElement;
    4637public:
    4738    static PassRefPtr<HTMLImageElement> create(Document*);
     
    5041
    5142    virtual ~HTMLImageElement();
    52 
    53     virtual void willAddAuthorShadowRoot() OVERRIDE;
    5443
    5544    int width(bool ignorePendingStylesheets = false);
     
    9685
    9786private:
    98     virtual void createShadowSubtree();
    99 
    10087    virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
    101 
    102     // Implementation of ImageLoaderClient
    103     Element* sourceElement() { return this; }
    104     Element* imageElement();
    105     void refSourceElement() { ref(); }
    106     void derefSourceElement() { deref(); }
    10788
    10889    virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
     
    131112#endif
    132113
    133     RenderObject* imageRenderer() const { return HTMLElement::renderer(); }
    134     HTMLImageLoader* imageLoader() { return &m_imageLoader; }
    135     ImageInnerElement* innerElement() const;
    136 
    137114    HTMLImageLoader m_imageLoader;
    138115    HTMLFormElement* m_form;
     
    140117};
    141118
    142 inline bool isHTMLImageElement(Node* node)
    143 {
    144     return node->hasTagName(HTMLNames::imgTag);
    145 }
    146 
    147 inline HTMLImageElement* toHTMLImageElement(Node* node)
    148 {
    149     ASSERT(!node || isHTMLImageElement(node));
    150     return static_cast<HTMLImageElement*>(node);
    151 }
    152 
    153119} //namespace
    154120
  • trunk/Source/WebCore/html/HTMLImageLoader.cpp

    r139541 r140097  
    4040namespace WebCore {
    4141
    42 HTMLImageLoader::HTMLImageLoader(ImageLoaderClient* client)
    43     : ImageLoader(client)
     42HTMLImageLoader::HTMLImageLoader(Element* node)
     43    : ImageLoader(node)
    4444{
    4545}
     
    5252{
    5353    // HTMLVideoElement uses this class to load the poster image, but it should not fire events for loading or failure.
    54     if (client()->sourceElement()->hasTagName(HTMLNames::videoTag))
     54    if (element()->hasTagName(HTMLNames::videoTag))
    5555        return;
    5656
    5757    bool errorOccurred = image()->errorOccurred();
    5858    if (!errorOccurred && image()->response().httpStatusCode() >= 400)
    59         errorOccurred = client()->sourceElement()->hasTagName(HTMLNames::objectTag); // An <object> considers a 404 to be an error and should fire onerror.
    60     client()->eventTarget()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
     59        errorOccurred = element()->hasTagName(HTMLNames::objectTag); // An <object> considers a 404 to be an error and should fire onerror.
     60    element()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
    6161}
    6262
     
    6464{
    6565#if ENABLE(DASHBOARD_SUPPORT)
    66     Settings* settings = client()->sourceElement()->document()->settings();
     66    Settings* settings = element()->document()->settings();
    6767    if (settings && settings->usesDashboardBackwardCompatibilityMode() && attr.length() > 7 && attr.startsWith("url(\"") && attr.endsWith("\")"))
    6868        return attr.string().substring(5, attr.length() - 7);
     
    7676    CachedImage* cachedImage = image();
    7777
    78     RefPtr<Element> element = client()->sourceElement();
     78    RefPtr<Element> element = this->element();
    7979    ImageLoader::notifyFinished(cachedImage);
    8080
  • trunk/Source/WebCore/html/HTMLImageLoader.h

    r122824 r140097  
    3030class HTMLImageLoader : public ImageLoader {
    3131public:
    32     HTMLImageLoader(ImageLoaderClient*);
     32    HTMLImageLoader(Element*);
    3333    virtual ~HTMLImageLoader();
    3434
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r139663 r140097  
    2828#include "FileChooser.h"
    2929#include "HTMLTextFormControlElement.h"
    30 #include "ImageLoaderClient.h"
    3130#include "StepRange.h"
    3231
     
    4443struct DateTimeChooserParameters;
    4544
    46 class HTMLInputElement : public HTMLTextFormControlElement, public ImageLoaderClientBase<HTMLInputElement> {
     45class HTMLInputElement : public HTMLTextFormControlElement {
    4746public:
    4847    static PassRefPtr<HTMLInputElement> create(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
  • trunk/Source/WebCore/html/HTMLObjectElement.h

    r135069 r140097  
    2626#include "FormAssociatedElement.h"
    2727#include "HTMLPlugInImageElement.h"
    28 #include "ImageLoaderClient.h"
    2928
    3029namespace WebCore {
  • trunk/Source/WebCore/html/HTMLPlugInElement.h

    r138729 r140097  
    2525
    2626#include "HTMLFrameOwnerElement.h"
    27 #include "Image.h"
    28 #include "ImageLoaderClient.h"
    2927#include "ScriptInstance.h"
    3028
     
    3533namespace WebCore {
    3634
     35class Image;
    3736class RenderEmbeddedObject;
    3837class RenderWidget;
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.h

    r138729 r140097  
    4545
    4646// Base class for HTMLObjectElement and HTMLEmbedElement
    47 class HTMLPlugInImageElement : public HTMLPlugInElement, public ImageLoaderClientBase<HTMLPlugInImageElement> {
     47class HTMLPlugInImageElement : public HTMLPlugInElement {
    4848public:
    4949    virtual ~HTMLPlugInImageElement();
  • trunk/Source/WebCore/html/HTMLTagNames.in

    r136467 r140097  
    6969image mapToTagName=img
    7070img interfaceName=HTMLImageElement, constructorNeedsFormElement
    71 webkitInnerImage interfaceName=HTMLElement, noConstructor
    7271input constructorNeedsFormElement, constructorNeedsCreatedByParser
    7372intent conditional=WEB_INTENTS_TAG
  • trunk/Source/WebCore/html/HTMLVideoElement.h

    r135069 r140097  
    3030
    3131#include "HTMLMediaElement.h"
    32 #include "ImageLoaderClient.h"
    3332
    3433namespace WebCore {
     
    3635class HTMLImageLoader;
    3736
    38 class HTMLVideoElement : public HTMLMediaElement, public ImageLoaderClientBase<HTMLVideoElement> {
     37class HTMLVideoElement : public HTMLMediaElement {
    3938public:
    4039    static PassRefPtr<HTMLVideoElement> create(const QualifiedName&, Document*, bool);
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r139209 r140097  
    2929#include "Document.h"
    3030#include "Element.h"
    31 #include "ElementShadow.h"
    3231#include "Event.h"
    3332#include "EventSender.h"
     
    3635#include "HTMLObjectElement.h"
    3736#include "HTMLParserIdioms.h"
    38 #include "ImageLoaderClient.h"
    3937#include "RenderImage.h"
    4038#include "ScriptCallStack.h"
     
    5856        if (!p)
    5957            return;
    60         ASSERT(p->client()->imageElement());
    61         ValueCheck<WebCore::Element*>::checkConsistency(p->client()->imageElement());
     58        ASSERT(p->element());
     59        ValueCheck<WebCore::Element*>::checkConsistency(p->element());
    6260    }
    6361};
     
    9290}
    9391
    94 ImageLoader::ImageLoader(ImageLoaderClient* client)
    95     : m_client(client)
     92ImageLoader::ImageLoader(Element* element)
     93    : m_element(element)
    9694    , m_image(0)
    9795    , m_hasPendingBeforeLoadEvent(false)
     
    124122    // remove that protection here.
    125123    if (m_elementIsProtected)
    126         client()->derefSourceElement();
    127 }
    128 
    129 inline Document* ImageLoader::document()
    130 {
    131     return client()->sourceElement()->document();
     124        m_element->deref();
    132125}
    133126
     
    174167    // If we're not making renderers for the page, then don't load images.  We don't want to slow
    175168    // down the raw HTML parsing case by loading images we don't intend to display.
    176     if (!document()->renderer())
    177         return;
    178 
    179     AtomicString attr = client()->sourceElement()->getAttribute(client()->sourceElement()->imageSourceAttributeName());
     169    Document* document = m_element->document();
     170    if (!document->renderer())
     171        return;
     172
     173    AtomicString attr = m_element->getAttribute(m_element->imageSourceAttributeName());
    180174
    181175    if (attr == m_failedLoadURL)
     
    186180    CachedResourceHandle<CachedImage> newImage = 0;
    187181    if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {
    188         CachedResourceRequest request(ResourceRequest(document()->completeURL(sourceURI(attr))));
    189         request.setInitiator(client()->sourceElement());
    190 
    191         String crossOriginMode = client()->sourceElement()->fastGetAttribute(HTMLNames::crossoriginAttr);
     182        CachedResourceRequest request(ResourceRequest(document->completeURL(sourceURI(attr))));
     183        request.setInitiator(element());
     184
     185        String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossoriginAttr);
    192186        if (!crossOriginMode.isNull()) {
    193187            StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
    194             updateRequestForAccessControl(request.mutableResourceRequest(), document()->securityOrigin(), allowCredentials);
     188            updateRequestForAccessControl(request.mutableResourceRequest(), document->securityOrigin(), allowCredentials);
    195189        }
    196190
    197191        if (m_loadManually) {
    198             bool autoLoadOtherImages = document()->cachedResourceLoader()->autoLoadImages();
    199             document()->cachedResourceLoader()->setAutoLoadImages(false);
     192            bool autoLoadOtherImages = document->cachedResourceLoader()->autoLoadImages();
     193            document->cachedResourceLoader()->setAutoLoadImages(false);
    200194            newImage = new CachedImage(request.resourceRequest());
    201195            newImage->setLoading(true);
    202             newImage->setOwningCachedResourceLoader(document()->cachedResourceLoader());
    203             document()->cachedResourceLoader()->m_documentResources.set(newImage->url(), newImage.get());
    204             document()->cachedResourceLoader()->setAutoLoadImages(autoLoadOtherImages);
     196            newImage->setOwningCachedResourceLoader(document->cachedResourceLoader());
     197            document->cachedResourceLoader()->m_documentResources.set(newImage->url(), newImage.get());
     198            document->cachedResourceLoader()->setAutoLoadImages(autoLoadOtherImages);
    205199        } else
    206             newImage = document()->cachedResourceLoader()->requestImage(request);
     200            newImage = document->cachedResourceLoader()->requestImage(request);
    207201
    208202        // If we do not have an image here, it means that a cross-site
     
    210204        // Security Policy, or the page is being dismissed. Trigger an
    211205        // error event if the page is not being dismissed.
    212         if (!newImage && !pageIsBeingDismissed(document())) {
     206        if (!newImage && !pageIsBeingDismissed(document)) {
    213207            m_failedLoadURL = attr;
    214208            m_hasPendingErrorEvent = true;
     
    219213        // Fire an error event if the url is empty.
    220214        // FIXME: Should we fire this event asynchronoulsy via errorEventSender()?
    221         client()->imageElement()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
     215        m_element->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
    222216    }
    223217   
     
    232226
    233227        m_image = newImage;
    234         m_hasPendingBeforeLoadEvent = !document()->isImageDocument() && newImage;
     228        m_hasPendingBeforeLoadEvent = !m_element->document()->isImageDocument() && newImage;
    235229        m_hasPendingLoadEvent = newImage;
    236230        m_imageComplete = !newImage;
    237231
    238232        if (newImage) {
    239             if (!document()->isImageDocument()) {
    240                 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER))
     233            if (!m_element->document()->isImageDocument()) {
     234                if (!m_element->document()->hasListenerType(Document::BEFORELOAD_LISTENER))
    241235                    dispatchPendingBeforeLoadEvent();
    242236                else
     
    280274        return;
    281275
    282     if (client()->sourceElement()->fastHasAttribute(HTMLNames::crossoriginAttr)
    283         && !document()->securityOrigin()->canRequest(image()->response().url())
    284         && !resource->passesAccessControlCheck(document()->securityOrigin())) {
     276    if (m_element->fastHasAttribute(HTMLNames::crossoriginAttr)
     277        && !m_element->document()->securityOrigin()->canRequest(image()->response().url())
     278        && !resource->passesAccessControlCheck(m_element->document()->securityOrigin())) {
    285279
    286280        setImageWithoutConsideringPendingLoadEvent(0);
     
    290284
    291285        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Cross-origin image load denied by Cross-Origin Resource Sharing policy.")));
    292         document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, consoleMessage);
     286        m_element->document()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, consoleMessage);
    293287
    294288        ASSERT(!m_hasPendingLoadEvent);
     
    313307RenderImageResource* ImageLoader::renderImageResource()
    314308{
    315     RenderObject* renderer = client()->imageElement()->renderer();
     309    RenderObject* renderer = m_element->renderer();
    316310
    317311    if (!renderer)
     
    363357
    364358    if (m_elementIsProtected)
    365         client()->refSourceElement();
     359        m_element->ref();
    366360    else
    367         client()->derefSourceElement();
     361        m_element->deref();
    368362}
    369363
     
    386380    if (!m_image)
    387381        return;
    388     if (!document()->attached())
     382    if (!m_element->document()->attached())
    389383        return;
    390384    m_hasPendingBeforeLoadEvent = false;
    391     if (client()->sourceElement()->dispatchBeforeLoadEvent(m_image->url())) {
     385    if (m_element->dispatchBeforeLoadEvent(m_image->url())) {
    392386        updateRenderer();
    393387        return;
     
    400394    loadEventSender().cancelEvent(this);
    401395    m_hasPendingLoadEvent = false;
    402 
    403     if (client()->sourceElement()->hasTagName(HTMLNames::objectTag))
    404         static_cast<HTMLObjectElement*>(client()->sourceElement())->renderFallbackContent();
     396   
     397    if (m_element->hasTagName(HTMLNames::objectTag))
     398        static_cast<HTMLObjectElement*>(m_element)->renderFallbackContent();
    405399
    406400    // Only consider updating the protection ref-count of the Element immediately before returning
     
    416410        return;
    417411    m_hasPendingLoadEvent = false;
    418     if (document()->attached())
     412    if (element()->document()->attached())
    419413        dispatchLoadEvent();
    420414
     
    429423        return;
    430424    m_hasPendingErrorEvent = false;
    431     if (document()->attached())
    432         client()->imageElement()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
     425    if (element()->document()->attached())
     426        element()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
    433427
    434428    // Only consider updating the protection ref-count of the Element immediately before returning
  • trunk/Source/WebCore/loader/ImageLoader.h

    r138724 r140097  
    2727#include "CachedImageClient.h"
    2828#include "CachedResourceHandle.h"
    29 #include <wtf/OwnPtr.h>
    30 #include <wtf/PassOwnPtr.h>
    3129#include <wtf/text/AtomicString.h>
    3230
     
    3533class Element;
    3634class ImageLoader;
    37 class ImageLoaderClient;
    38 class QualifiedName;
    3935class RenderImageResource;
    4036
     
    4440class ImageLoader : public CachedImageClient {
    4541public:
    46     explicit ImageLoader(ImageLoaderClient*);
     42    explicit ImageLoader(Element*);
    4743    virtual ~ImageLoader();
    48 
    49     ImageLoaderClient* client() const { return m_client; }
    5044
    5145    // This function should be called when the element is attached to a document; starts
     
    5953    void elementDidMoveToNewDocument();
    6054
     55    Element* element() const { return m_element; }
    6156    bool imageComplete() const { return m_imageComplete; }
    6257
     
    7974
    8075private:
    81     Document* document();
    8276    virtual void dispatchLoadEvent() = 0;
    8377    virtual String sourceURI(const AtomicString&) const = 0;
     
    9589    void clearFailedLoadURL();
    9690
    97     ImageLoaderClient* m_client;
     91    Element* m_element;
    9892    CachedResourceHandle<CachedImage> m_image;
    9993    AtomicString m_failedLoadURL;
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r140039 r140097  
    460460        return;
    461461
    462     HTMLImageElement* imageElt = hostImageElement();
     462    HTMLImageElement* imageElt = (node() && node()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(node()) : 0;
    463463    CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
    464464    Image* image = m_imageResource->image().get();
     
    508508HTMLMapElement* RenderImage::imageMap() const
    509509{
    510     HTMLImageElement* i = hostImageElement();
     510    HTMLImageElement* i = node() && node()->hasTagName(imgTag) ? static_cast<HTMLImageElement*>(node()) : 0;
    511511    return i ? i->treeScope()->getImageMap(i->fastGetAttribute(usemapAttr)) : 0;
    512512}
     
    543543    if (node()->hasTagName(inputTag))
    544544        m_altText = static_cast<HTMLInputElement*>(node())->altText();
    545     else if (HTMLImageElement* image = hostImageElement())
    546         m_altText = image->altText();
     545    else if (node()->hasTagName(imgTag))
     546        m_altText = static_cast<HTMLImageElement*>(node())->altText();
    547547}
    548548
     
    578578}
    579579
    580 HTMLImageElement* RenderImage::hostImageElement() const
    581 {
    582     if (!node())
    583         return 0;
    584 
    585     if (isHTMLImageElement(node()))
    586         return toHTMLImageElement(node());
    587 
    588     if (node()->hasTagName(webkitInnerImageTag)) {
    589         if (Node* ancestor = node()->shadowHost()) {
    590             if (ancestor->hasTagName(imgTag))
    591                 return toHTMLImageElement(ancestor);
    592         }
    593     }
    594 
    595     return 0;
    596 }
    597 
    598580bool RenderImage::needsPreferredWidthsRecalculation() const
    599581{
  • trunk/Source/WebCore/rendering/RenderImage.h

    r140039 r140097  
    3232
    3333class HTMLAreaElement;
    34 class HTMLImageElement;
    3534class HTMLMapElement;
    3635
     
    6059
    6160protected:
    62     HTMLImageElement* hostImageElement() const;
    63 
    6461    virtual bool needsPreferredWidthsRecalculation() const;
    6562    virtual RenderBox* embeddedContentBox() const;
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r140068 r140097  
    22512251        document()->isImageDocument() ||
    22522252#endif
    2253         (document()->settings() && document()->settings()->shouldRespectImageOrientation() && node() && (node()->hasTagName(HTMLNames::imgTag) || node()->hasTagName(HTMLNames::webkitInnerImageTag))) ? RespectImageOrientation : DoNotRespectImageOrientation;
     2253        (document()->settings() && document()->settings()->shouldRespectImageOrientation() && node() && node()->hasTagName(HTMLNames::imgTag)) ? RespectImageOrientation : DoNotRespectImageOrientation;
    22542254}
    22552255
  • trunk/Source/WebCore/svg/SVGImageElement.h

    r135069 r140097  
    2323
    2424#if ENABLE(SVG)
    25 #include "ImageLoaderClient.h"
    2625#include "SVGAnimatedBoolean.h"
    2726#include "SVGAnimatedLength.h"
     
    4039                        public SVGLangSpace,
    4140                        public SVGExternalResourcesRequired,
    42                         public SVGURIReference,
    43                         public ImageLoaderClientBase<SVGImageElement> {
     41                        public SVGURIReference {
    4442public:
    4543    static PassRefPtr<SVGImageElement> create(const QualifiedName&, Document*);
     
    4745private:
    4846    SVGImageElement(const QualifiedName&, Document*);
    49 
     47   
    5048    virtual bool isValid() const { return SVGTests::isValid(); }
    5149    virtual bool supportsFocus() const { return true; }
  • trunk/Source/WebCore/svg/SVGImageLoader.cpp

    r122824 r140097  
    2727#include "EventNames.h"
    2828#include "HTMLParserIdioms.h"
    29 #include "ImageLoaderClient.h"
    3029#include "RenderImage.h"
    3130#include "SVGImageElement.h"
     
    3332namespace WebCore {
    3433
    35 SVGImageLoader::SVGImageLoader(ImageLoaderClient* client)
    36     : ImageLoader(client)
     34SVGImageLoader::SVGImageLoader(SVGImageElement* node)
     35    : ImageLoader(node)
    3736{
    3837}
     
    4140{
    4241    if (image()->errorOccurred())
    43         client()->imageElement()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
     42        element()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));
    4443    else {
    45         SVGImageElement* imageElement = static_cast<SVGImageElement*>(client()->imageElement());
     44        SVGImageElement* imageElement = static_cast<SVGImageElement*>(element());
    4645        if (imageElement->externalResourcesRequiredBaseValue())
    4746            imageElement->sendSVGLoadEventIfPossible(true);
     
    5150String SVGImageLoader::sourceURI(const AtomicString& attribute) const
    5251{
    53     KURL base = client()->sourceElement()->baseURI();
     52    KURL base = element()->baseURI();
    5453    if (base.isValid())
    5554        return KURL(base, stripLeadingAndTrailingHTMLSpaces(attribute)).string();
    56     return client()->sourceElement()->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(attribute));
     55    return element()->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(attribute));
    5756}
    5857
  • trunk/Source/WebCore/svg/SVGImageLoader.h

    r122824 r140097  
    3030class SVGImageLoader : public ImageLoader {
    3131public:
    32     SVGImageLoader(ImageLoaderClient*);
     32    SVGImageLoader(SVGImageElement*);
    3333
    3434private:
Note: See TracChangeset for help on using the changeset viewer.