+2006-07-28 Alexey Proskuryakov <ap@nypop.com>
+
+ Rolling out http://bugzilla.opendarwin.org/show_bug.cgi?id=6010 because of failing layout tests.
+ Add better SVGLoad event support.
+
+ * svg/W3C-SVG-1.1/extend-namespace-01-f-expected.checksum:
+ * svg/W3C-SVG-1.1/extend-namespace-01-f-expected.png:
+ * svg/W3C-SVG-1.1/extend-namespace-01-f-expected.txt:
+ * svg/W3C-SVG-1.1/interact-events-01-b-expected.checksum:
+ * svg/W3C-SVG-1.1/interact-events-01-b-expected.png:
+ * svg/W3C-SVG-1.1/struct-dom-01-b-expected.checksum:
+ * svg/W3C-SVG-1.1/struct-dom-01-b-expected.png:
+ * svg/W3C-SVG-1.1/struct-dom-01-b-expected.txt:
+ * svg/W3C-SVG-1.1/struct-dom-02-b-expected.checksum:
+ * svg/W3C-SVG-1.1/struct-dom-02-b-expected.png:
+ * svg/W3C-SVG-1.1/struct-dom-02-b-expected.txt:
+ * svg/W3C-SVG-1.1/struct-dom-03-b-expected.checksum:
+ * svg/W3C-SVG-1.1/struct-dom-03-b-expected.png:
+ * svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt:
+ * svg/W3C-SVG-1.1/struct-dom-04-b-expected.checksum:
+ * svg/W3C-SVG-1.1/struct-dom-04-b-expected.png:
+ * svg/W3C-SVG-1.1/struct-dom-04-b-expected.txt:
+ * svg/W3C-SVG-1.1/struct-dom-05-b-expected.checksum:
+ * svg/W3C-SVG-1.1/struct-dom-05-b-expected.png:
+ * svg/W3C-SVG-1.1/struct-dom-05-b-expected.txt:
+ * svg/W3C-SVG-1.1/struct-dom-06-b-expected.checksum:
+ * svg/W3C-SVG-1.1/struct-dom-06-b-expected.png:
+ * svg/W3C-SVG-1.1/struct-dom-06-b-expected.txt:
+
2006-07-27 Eric Seidel <eric@eseidel.com>
Reviewed by darin.
-40e2571f917ea604155cc19efaa67b48
\ No newline at end of file
+bf2a1657c3305f4818f274ffb5fad223
\ No newline at end of file
layer at (0,0) size 480x360
RenderView at (0,0) size 480x360
KCanvasContainer {svg} at (0.50,0.50) size 479x359
- KCanvasContainer {g} at (126.05,61.42) size 242.55x213.97
+ KCanvasContainer {g} at (0,0) size 0x0
KCanvasContainer {g} at (0,0) size 0x0
RenderSVGText {text} at (0,0) size 465x18
RenderText {#text} at (0,0) size 349x17
text run at (0,0) width 349: "Pie chart built from data in a different namespace."
- KCanvasContainer {g} at (126.05,61.42) size 242.55x213.97
- KCanvasItem {path} at (263.86,76.89) size 104.74x81.61 [transform={m=((1.00,0.00)(0.00,1.00)) t=(27.00,-13.00)}] [stroke={[type=SOLID] [color=#0000FF] [stroke width=3.00]}] [fill={[type=SOLID] [color=#FF8888]}] [data="M240.00,170.00L340.00,170.00C340.10,139.74,326.50,111.06,303.00,92.00"]
- RenderSVGText {text} at (0,0) size 465x16
- RenderText {#text} at (0,0) size 28x16
- text run at (0,0) width 28: "East"
- KCanvasItem {path} at (190.64,61.42) size 113.76x110.37 [stroke={[type=SOLID] [color=#000000] [stroke width=2.00]}] [fill={[type=SOLID] [color=#6D6D6D]}] [data="M240.00,170.00L303.00,92.00C271.46,66.45,227.60,62.50,192.00,82.00"]
- RenderSVGText {text} at (0,0) size 465x16
- RenderText {#text} at (0,0) size 35x16
- text run at (0,0) width 35: "North"
- KCanvasItem {path} at (126.05,80.65) size 115.35x130.67 [stroke={[type=SOLID] [color=#000000] [stroke width=2.00]}] [fill={[type=SOLID] [color=#929292]}] [data="M240.00,170.00L192.00,82.00C146.30,106.75,127.18,162.38,148.00,210.00"]
- RenderSVGText {text} at (0,0) size 465x16
- RenderText {#text} at (0,0) size 32x16
- text run at (0,0) width 32: "West"
- KCanvasItem {path} at (146.68,168.31) size 94.70x100.88 [stroke={[type=SOLID] [color=#000000] [stroke width=2.00]}] [fill={[type=SOLID] [color=#B6B6B6]}] [data="M240.00,170.00L148.00,210.00C160.89,239.68,187.34,261.29,219.00,268.00"]
- RenderSVGText {text} at (0,0) size 465x16
- RenderText {#text} at (0,0) size 46x16
- text run at (0,0) width 46: "Central"
- KCanvasItem {path} at (217.81,169) size 123.26x106.39 [stroke={[type=SOLID] [color=#000000] [stroke width=2.00]}] [fill={[type=SOLID] [color=#DBDBDB]}] [data="M240.00,170.00L219.00,268.00C248.57,274.35,279.43,266.98,302.94,247.94C326.44,228.90,340.07,200.25,340.00,170.00"]
- RenderSVGText {text} at (0,0) size 465x16
- RenderText {#text} at (0,0) size 37x16
- text run at (0,0) width 37: "South"
+ KCanvasContainer {g} at (0,0) size 0x0
RenderSVGText {text} at (0,0) size 465x46
RenderText {#text} at (0,0) size 264x46
text run at (0,0) width 264: "$Revision: 1.1 $"
-a3116bfe576508c62ac7839701ddab5b
\ No newline at end of file
+85fc21b21c47910cdf1b7a4958189b51
\ No newline at end of file
-40a6bbba9a7b85b0d4c525998e31763a
\ No newline at end of file
+0763e33b8aad0b768fa66561d59cf282
\ No newline at end of file
KCanvasContainer {svg} at (0.50,0.50) size 479x359
KCanvasContainer {g} at (40,150) size 50x50
KCanvasItem {rect} at (40,150) size 50x50 [fill={[type=SOLID] [color=#FF0000]}] [data="M40.00,150.00L90.00,150.00L90.00,200.00L40.00,200.00"]
- RenderSVGText {text} at (0,0) size 465x18
- RenderText {#text} at (0,0) size 266x18
- text run at (0,0) width 266: "This document's root identifier is: svg-root"
RenderSVGText {text} at (0,0) size 465x36
RenderText {#text} at (0,0) size 198x36
text run at (0,0) width 198: "$Revision: 1.1 $"
-eb57fcf5ec1c29efaf461f26d34bd57f
\ No newline at end of file
+990fae4e2eca24cf2f3fe0438a6eb8ca
\ No newline at end of file
RenderText {#text} at (0,0) size 198x36
text run at (0,0) width 198: "$Revision: 1.1 $"
KCanvasItem {rect} at (0.50,0.50) size 479x359 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "xml"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "true"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 129x36
- text run at (0,0) width 129: "stylesheets"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "true"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 70x36
- text run at (0,0) width 70: "views"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "true"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 52x36
- text run at (0,0) width 52: "css2"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "true"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 76x36
- text run at (0,0) width 76: "events"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "true"
-ebd638b5c2115f2143e86868c6c44d56
\ No newline at end of file
+990fae4e2eca24cf2f3fe0438a6eb8ca
\ No newline at end of file
RenderText {#text} at (0,0) size 198x36
text run at (0,0) width 198: "$Revision: 1.1 $"
KCanvasItem {rect} at (0.50,0.50) size 479x359 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 99x36
- text run at (0,0) width 99: "uievents"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 154x36
- text run at (0,0) width 154: "mouseevents"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "true"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 181x36
- text run at (0,0) width 181: "mutationevents"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "true"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 102x36
- text run at (0,0) width 102: "traversal"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 46x36
- text run at (0,0) width 46: "true"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 148x36
- text run at (0,0) width 148: "org.w3c.svg"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
-aaf1fe3f6c5db04e7fd07b4830be3e5e
\ No newline at end of file
+990fae4e2eca24cf2f3fe0438a6eb8ca
\ No newline at end of file
RenderText {#text} at (0,0) size 198x36
text run at (0,0) width 198: "$Revision: 1.1 $"
KCanvasItem {rect} at (0.50,0.50) size 479x359 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 207x36
- text run at (0,0) width 207: "org.w3c.svg.lang"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 258x36
- text run at (0,0) width 258: "org.w3c.svg.dynamic"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 218x36
- text run at (0,0) width 218: "org.w3c.svg.static"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 209x36
- text run at (0,0) width 209: "org.w3c.dom.svg"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 148x36
- text run at (0,0) width 148: "org.w3c.svg"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
-9058873570c32158449fa57b60caaa3b
\ No newline at end of file
+990fae4e2eca24cf2f3fe0438a6eb8ca
\ No newline at end of file
RenderText {#text} at (0,0) size 198x36
text run at (0,0) width 198: "$Revision: 1.1 $"
KCanvasItem {rect} at (0.50,0.50) size 479x359 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 279x36
- text run at (0,0) width 279: "org.w3c.dom.svg.static"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 335x36
- text run at (0,0) width 335: "org.w3c.dom.svg.animation"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 319x36
- text run at (0,0) width 319: "org.w3c.dom.svg.dynamic"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 246x36
- text run at (0,0) width 246: "org.w3c.dom.svg.all"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 185x36
- text run at (0,0) width 185: "org.w3c.svg.all"
- RenderSVGText {text} at (0,0) size 465x36
- RenderText {#text} at (0,0) size 56x36
- text run at (0,0) width 56: "false"
-667ede172909f628f8032933dde32df6
\ No newline at end of file
+b50397794a544a22aaf283804f83b426
\ No newline at end of file
layer at (0,0) size 480x360
RenderView at (0,0) size 480x360
- KCanvasContainer {svg} at (0.50,0.50) size 479x359
- KCanvasContainer {g} at (0,0) size 0x0
- KCanvasItem {rect} at (inf,inf) size 0x0 [fill={[type=SOLID] [color=#FF0000]}] [data=""]
- RenderSVGText {text} at (0,0) size 465x18
- RenderText {#text} at (0,0) size 148x18
- text run at (0,0) width 148: "DOM API is supported"
+ KCanvasContainer {svg} at (0,0) size 479.50x450
+ KCanvasContainer {g} at (0,0) size 450x450
+ KCanvasItem {rect} at (0,0) size 450x450 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L450.00,0.00L450.00,450.00L0.00,450.00"]
+ RenderSVGText {text} at (0,0) size 465x72
+ RenderText {#text} at (0,0) size 418x72
+ text run at (0,0) width 418: "Removing DOM Elements is"
+ text run at (0,36) width 213: "not supported"
RenderSVGText {text} at (0,0) size 465x36
RenderText {#text} at (0,0) size 198x36
text run at (0,0) width 198: "$Revision: 1.1 $"
+2006-07-28 Alexey Proskuryakov <ap@nypop.com>
+
+ Rolling out http://bugzilla.opendarwin.org/show_bug.cgi?id=6010 because of failing layout tests.
+ Add better SVGLoad event support.
+
+ * dom/EventTargetNode.cpp:
+ (WebCore::EventTargetNode::dispatchGenericEvent):
+ * html/HTMLImageLoader.cpp:
+ (WebCore::HTMLImageLoader::dispatchLoadEvent):
+ * html/HTMLImageLoader.h:
+ * ksvg2/misc/SVGImageLoader.cpp:
+ (WebCore::SVGImageLoader::SVGImageLoader):
+ * ksvg2/misc/SVGImageLoader.h:
+ * ksvg2/svg/SVGAElement.cpp:
+ (WebCore::SVGAElement::parseMappedAttribute):
+ * ksvg2/svg/SVGAnimatedBoolean.h:
+ * ksvg2/svg/SVGElement.cpp:
+ (WebCore::SVGElement::SVGElement):
+ (WebCore::SVGElement::parseMappedAttribute):
+ * ksvg2/svg/SVGElement.h:
+ (WebCore::SVGElement::adjustViewportClipping):
+ (WebCore::SVGElement::closeRenderer):
+ (WebCore::SVGElement::rendererIsNeeded):
+ (WebCore::SVGElement::isClosed):
+ (WebCore::svg_dynamic_cast):
+ * ksvg2/svg/SVGExternalResourcesRequired.h:
+ * ksvg2/svg/SVGImageElement.cpp:
+ (SVGImageElement::SVGImageElement):
+ * ksvg2/svg/SVGImageElement.h:
+ * ksvg2/svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::parseMappedAttribute):
+ * ksvg2/svg/SVGScriptElement.cpp:
+ (SVGScriptElement::SVGScriptElement):
+ (SVGScriptElement::parseMappedAttribute):
+ (SVGScriptElement::executeScript):
+ * xml/xmlhttprequest.cpp:
+ (WebCore::XMLHttpRequest::callReadyStateChangeListener):
+
2006-07-28 Adele Peterson <adele@apple.com>
Rolling out http://bugzilla.opendarwin.org/show_bug.cgi?id=9753 because of failing layout tests.
RefPtr<Event> evt(e);
assert(!eventDispatchForbidden());
assert(evt->target());
- assert(!evt->type().isNull()); // JavaScript code could create an event with name
+
+ // ### check that type specified
// work out what nodes to send event to
DeprecatedPtrList<Node> nodeChain;
void HTMLImageLoader::dispatchLoadEvent()
{
- if (!haveFiredLoadEvent() && image()) {
- setHaveFiredLoadEvent(true);
- element()->dispatchHTMLEvent(image()->isErrorImage() ? errorEvent : loadEvent, false, false);
+ if (!m_firedLoad && m_image) {
+ m_firedLoad = true;
+ element()->dispatchHTMLEvent(m_image->isErrorImage() ? errorEvent : loadEvent, false, false);
}
}
virtual void updateFromElement();
- virtual void dispatchLoadEvent();
+ void dispatchLoadEvent();
Element* element() const { return m_element; }
bool imageComplete() const { return m_imageComplete; }
protected:
void setLoadingImage(CachedImage*);
-
- bool haveFiredLoadEvent() { return m_firedLoad; }
- void setHaveFiredLoadEvent(bool firedLoad) { m_firedLoad = firedLoad; }
private:
Element* m_element;
namespace WebCore {
-SVGImageLoader::SVGImageLoader(SVGImageElement* node)
- : HTMLImageLoader(node)
+SVGImageLoader::SVGImageLoader(SVGImageElement *node) : HTMLImageLoader(node)
{
}
renderer->resetAnimation();
}
-void SVGImageLoader::dispatchLoadEvent()
-{
- if (!haveFiredLoadEvent() && image()) {
- setHaveFiredLoadEvent(true);
- if (image()->isErrorImage()) {
- // FIXME: We're supposed to put the document in an "error state" per the spec.
- } else
- static_cast<SVGElement*>(element())->sendSVGLoadEventIfPossible(true);
- }
-}
-
}
#endif // SVG_SUPPORT
class SVGImageElement;
class SVGImageLoader : public HTMLImageLoader {
public:
- SVGImageLoader(SVGImageElement*);
+ SVGImageLoader(SVGImageElement *node);
virtual ~SVGImageLoader();
virtual void updateFromElement();
- virtual void dispatchLoadEvent();
};
};
if (attr->name() == SVGNames::targetAttr) {
target()->setBaseVal(value.impl());
} else {
- if (SVGURIReference::parseMappedAttribute(attr)) {
+ if(SVGURIReference::parseMappedAttribute(attr))
+ {
m_isLink = attr->value() != 0;
return;
}
- if (SVGTests::parseMappedAttribute(attr))
- return;
- if (SVGLangSpace::parseMappedAttribute(attr))
- return;
- if (SVGExternalResourcesRequired::parseMappedAttribute(attr))
- return;
+ if(SVGTests::parseMappedAttribute(attr)) return;
+ if(SVGLangSpace::parseMappedAttribute(attr)) return;
+ if(SVGExternalResourcesRequired::parseMappedAttribute(attr)) return;
SVGStyledTransformableElement::parseMappedAttribute(attr);
}
}
Boston, MA 02111-1307, USA.
*/
-#ifndef SVGAnimatedBooleanImpl_H
-#define SVGAnimatedBooleanImpl_H
+#ifndef KSVG_SVGAnimatedBooleanImpl_H
+#define KSVG_SVGAnimatedBooleanImpl_H
#if SVG_SUPPORT
#include "Shared.h"
#include "Attr.h"
#include "Document.h"
-#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
#include "HTMLNames.h"
SVGElement::SVGElement(const QualifiedName& tagName, Document* doc)
: StyledElement(tagName, doc)
+ , m_closed(false)
{
}
void SVGElement::parseMappedAttribute(MappedAttribute *attr)
{
// standard events
- if (attr->name() == onloadAttr)
- addSVGEventListener(loadEvent, attr);
- else if (attr->name() == onclickAttr)
+ if (attr->name() == onclickAttr)
addSVGEventListener(clickEvent, attr);
else if (attr->name() == onmousedownAttr)
addSVGEventListener(mousedownEvent, attr);
StyledElement::parseMappedAttribute(attr);
}
-bool SVGElement::haveLoadedRequiredResources()
-{
- Node* child = fastFirstChild();
- while (child) {
- if (child->isSVGElement() && !static_cast<SVGElement*>(child)->haveLoadedRequiredResources())
- return false;
- child = child->nextSibling();
- }
- return true;
-}
-
-void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents)
-{
- RefPtr<SVGElement> currentTarget = this;
- while (currentTarget && currentTarget->haveLoadedRequiredResources()) {
- RefPtr<Node> parent;
- if (sendParentLoadEvents)
- parent = parentNode(); // save the next parent to dispatch too incase dispatching the event changes the tree
-
- RefPtr<Event> event = new Event(loadEvent, false, false);
- event->setTarget(currentTarget.get());
- handleLocalEvents(event.get(), false);
- currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast<SVGElement>(parent) : 0;
- }
-}
-
-void SVGElement::closeRenderer()
-{
- // closeRenderer() is called when the close tag is reached for an element (e.g. </svg>)
- // we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish
- sendSVGLoadEventIfPossible();
-}
-
bool SVGElement::childShouldCreateRenderer(Node *child) const
{
if (child->isSVGElement())
// Internal
virtual void parseMappedAttribute(MappedAttribute*);
+
+ // To be implemented by any element which can establish new viewports...
+ virtual DeprecatedString adjustViewportClipping() const { return DeprecatedString::null; }
virtual bool isStyled() const { return false; }
virtual bool isStyledTransformable() const { return false; }
// For SVGTests
virtual bool isValid() const { return true; }
- virtual void closeRenderer();
- virtual bool rendererIsNeeded(RenderStyle*) { return false; }
- virtual bool childShouldCreateRenderer(Node*) const;
-
- void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false);
+ virtual void closeRenderer() { m_closed = true; }
+ virtual bool rendererIsNeeded(RenderStyle *) { return false; }
+ virtual bool childShouldCreateRenderer(Node *) const;
- protected:
- void addSVGEventListener(const AtomicString& eventType, const Attribute*);
- virtual bool haveLoadedRequiredResources();
+ // helper:
+ bool isClosed() const { return m_closed; }
+
+ private:
+ bool m_closed;
+ void addSVGEventListener(const AtomicString& eventType, const Attribute* attr);
};
+};
- static inline SVGElement* svg_dynamic_cast(Node* node) {
- SVGElement* svgElement = 0;
+namespace WebCore {
+ static inline SVGElement *svg_dynamic_cast(Node *node) {
+ SVGElement *svgElement = NULL;
if (node && node->isSVGElement())
- svgElement = static_cast<SVGElement*>(node);
+ svgElement = static_cast<SVGElement *>(node);
return svgElement;
}
};
Boston, MA 02111-1307, USA.
*/
-#ifndef SVGExternalResourcesRequiredImpl_H
-#define SVGExternalResourcesRequiredImpl_H
+#ifndef KSVG_SVGExternalResourcesRequiredImpl_H
+#define KSVG_SVGExternalResourcesRequiredImpl_H
#if SVG_SUPPORT
#include <wtf/RefPtr.h>
class MappedAttribute;
class SVGAnimatedBoolean;
- // FIXME: This is wrong for several reasons:
- // 1. externalResourcesRequired is not animateable according to SVG 1.1 section 5.9
- // 2. externalResourcesRequired should just be part of SVGElement, and default to "false" for all elements
- /*
- SPEC: Note that the SVG DOM
- defines the attribute externalResourcesRequired as being of type SVGAnimatedBoolean, whereas the
- SVG language definition says that externalResourcesRequired is not animated. Because the SVG
- language definition states that externalResourcesRequired cannot be animated, the animVal will
- always be the same as the baseVal.
- */
class SVGExternalResourcesRequired {
public:
SVGExternalResourcesRequired();
#include "CSSPropertyNames.h"
#include "KCanvasRenderingStyle.h"
#include "RenderSVGImage.h"
-#include "SVGAnimatedBoolean.h"
#include "SVGAnimatedLength.h"
#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGAnimatedString.h"
using namespace WebCore;
SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document *doc)
- : SVGStyledTransformableElement(tagName, doc)
- , SVGTests()
- , SVGLangSpace()
- , SVGExternalResourcesRequired()
- , SVGURIReference()
- , m_imageLoader(this)
+: SVGStyledTransformableElement(tagName, doc), SVGTests(), SVGLangSpace(), SVGExternalResourcesRequired(), SVGURIReference(), m_imageLoader(this)
{
}
return new (arena) RenderSVGImage(this);
}
-bool SVGImageElement::haveLoadedRequiredResources()
-{
- return (!externalResourcesRequired()->baseVal() || m_imageLoader.imageComplete());
-}
-
void SVGImageElement::attach()
{
SVGStyledTransformableElement::attach();
virtual bool rendererIsNeeded(RenderStyle *style) { return StyledElement::rendererIsNeeded(style); }
virtual RenderObject *createRenderer(RenderArena *arena, RenderStyle *style);
-
- protected:
- virtual bool haveLoadedRequiredResources();
private:
mutable RefPtr<SVGAnimatedLength> m_x;
const AtomicString& value = attr->value();
if (!nearestViewportElement()) {
// Only handle events if we're the outermost <svg> element
- if (attr->name() == onunloadAttr)
+ if (attr->name() == onloadAttr)
+ addSVGWindowEventListner(loadEvent, attr);
+ else if (attr->name() == onunloadAttr)
addSVGWindowEventListner(unloadEvent, attr);
else if (attr->name() == onabortAttr)
addSVGWindowEventListner(abortEvent, attr);
#include "config.h"
#if SVG_SUPPORT
#include "PlatformString.h"
+//#include <kdom/ecma/Ecma.h>
#include "Attr.h"
#include "StringImpl.h"
#include "SVGNames.h"
#include "SVGScriptElement.h"
-namespace WebCore {
+using namespace WebCore;
-SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document* doc)
- : SVGElement(tagName, doc)
- , SVGURIReference()
- , SVGExternalResourcesRequired()
+SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document *doc) : SVGElement(tagName, doc), SVGURIReference(), SVGExternalResourcesRequired()
{
}
{
if (attr->name() == SVGNames::typeAttr)
setType(attr->value().impl());
- else {
- if(SVGURIReference::parseMappedAttribute(attr))
- return;
- if(SVGExternalResourcesRequired::parseMappedAttribute(attr))
- return;
+ else
+ {
+ if(SVGURIReference::parseMappedAttribute(attr)) return;
+ if(SVGExternalResourcesRequired::parseMappedAttribute(attr)) return;
SVGElement::parseMappedAttribute(attr);
}
// Run script
KJS::Completion comp = ecmaEngine->evaluate(jsCode.deprecatedString(), ecmaEngine->globalObject());
- if (comp.complType() == KJS::Throw) {
+ if(comp.complType() == KJS::Throw)
+ {
KJS::ExecState *exec = ecmaEngine->globalExec();
KJS::JSValue *exVal = comp.value();
int lineno = -1;
- if (exVal->isObject()) {
+ if(exVal->isObject())
+ {
KJS::JSValue *lineVal = static_cast<KJS::JSObject *>(exVal)->get(exec, "line");
if(lineVal->type() == KJS::NumberType)
lineno = int(lineVal->toNumber(exec));
// Fire ERROR_EVENT upon errors...
SVGDocument *svgDocument = static_cast<SVGDocument *>(document);
- if (svgDocument && document->hasListenerType(ERROR_EVENT)) {
+ if(svgDocument && document->hasListenerType(ERROR_EVENT))
+ {
RefPtr<Event> event = svgDocument->createEvent("SVGEvents");
event->initEvent(EventNames::errorEvent, false, false);
svgDocument->dispatchRecursiveEvent(event.get(), svgDocument->lastChild());
#endif
}
-}
-
// vim:ts=4:noet
#endif // SVG_SUPPORT
void XMLHttpRequest::callReadyStateChangeListener()
{
if (m_doc && m_doc->frame() && m_onReadyStateChangeListener) {
- RefPtr<Event> ev = new Event(readystatechangeEvent, true, true);
+ ExceptionCode ec;
+ RefPtr<Event> ev = m_doc->createEvent("HTMLEvents", ec);
+ ev->initEvent(readystatechangeEvent, true, true);
m_onReadyStateChangeListener->handleEvent(ev.get(), true);
}
if (m_doc && m_doc->frame() && m_state == Completed && m_onLoadListener) {
- RefPtr<Event> ev = new Event(loadEvent, true, true);
+ ExceptionCode ec;
+ RefPtr<Event> ev = m_doc->createEvent("HTMLEvents", ec);
+ ev->initEvent(loadEvent, true, true);
m_onLoadListener->handleEvent(ev.get(), true);
}
}