KHTML
Go to the documentation of this file.
27 #include "DocLoader.h"
34 #include "RenderImage.h"
38 SVGImageLoader::SVGImageLoader(SVGImageElement* node)
39 : HTMLImageLoader(node)
43 SVGImageLoader::~SVGImageLoader()
48 void SVGImageLoader::updateFromElement()
50 SVGImageElement *imageElement =
static_cast<SVGImageElement *
>(element());
51 WebCore::Document* doc = imageElement->ownerDocument();
53 CachedImage *newImage = 0;
54 if (!imageElement->href().isEmpty()) {
55 KURL uri = imageElement->baseURI();
57 uri = KURL(uri, imageElement->href());
59 uri = KURL(imageElement->href());
60 newImage = doc->docLoader()->requestImage(uri.string());
63 CachedImage* oldImage = image();
64 if (newImage != oldImage) {
65 setLoadingImage(newImage);
67 newImage->addClient(
this);
69 oldImage->removeClient(
this);
72 if (RenderImage* renderer = static_cast<RenderImage*>(imageElement->renderer()))
73 renderer->resetAnimation();
76 void SVGImageLoader::dispatchLoadEvent()
78 if (!haveFiredLoadEvent() && image()) {
79 setHaveFiredLoadEvent(
true);
80 if (image()->errorOccurred()) {
82 }
else if (static_cast<SVGImageElement*>(element())->externalResourcesRequiredBaseValue())
83 static_cast<SVGElement*
>(element())->sendSVGLoadEventIfPossible(
true);
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:19 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.