This source file includes following definitions.
- dispatchLoadEvent
- sourceURI
#include "config.h"
#include "core/svg/SVGImageLoader.h"
#include "core/events/Event.h"
#include "core/fetch/ImageResource.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/svg/SVGImageElement.h"
namespace WebCore {
SVGImageLoader::SVGImageLoader(SVGImageElement* node)
: ImageLoader(node)
{
}
void SVGImageLoader::dispatchLoadEvent()
{
if (image()->errorOccurred())
element()->dispatchEvent(Event::create(EventTypeNames::error));
else {
SVGImageElement* imageElement = toSVGImageElement(element());
imageElement->sendSVGLoadEventIfPossible(true);
}
}
String SVGImageLoader::sourceURI(const AtomicString& attribute) const
{
KURL base = element()->baseURI();
if (base.isValid())
return KURL(base, stripLeadingAndTrailingHTMLSpaces(attribute)).string();
return element()->document().completeURL(stripLeadingAndTrailingHTMLSpaces(attribute));
}
}