Changeset 16575 in webkit


Ignore:
Timestamp:
Sep 26, 2006 5:56:30 AM (18 years ago)
Author:
eseidel
Message:

2006-09-26 Eric Seidel <eric@eseidel.com>

Reviewed by Tim H.

SVGDocument::createElement does not create elements in the SVG namespace
http://bugzilla.opendarwin.org/show_bug.cgi?id=10932


Test: svg/custom/createelement.svg

  • ksvg2/svg/SVGDocument.cpp: (WebCore::SVGDocument::createElement):
  • ksvg2/svg/SVGDocument.h:
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r16574 r16575  
     12006-09-26  Eric Seidel  <eric@eseidel.com>
     2
     3        Reviewed by Tim H.
     4
     5        SVGDocument::createElement does not create elements in the SVG namespace
     6        http://bugzilla.opendarwin.org/show_bug.cgi?id=10932
     7
     8        * svg/custom/createelement-expected.checksum: Added.
     9        * svg/custom/createelement-expected.png: Added.
     10        * svg/custom/createelement-expected.txt: Added.
     11        * svg/custom/createelement.svg: Added.
     12
    1132006-09-26  Eric Seidel  <eric@eseidel.com>
    214
  • trunk/WebCore/ChangeLog

    r16574 r16575  
     12006-09-26  Eric Seidel  <eric@eseidel.com>
     2
     3        Reviewed by Tim H.
     4
     5        SVGDocument::createElement does not create elements in the SVG namespace
     6        http://bugzilla.opendarwin.org/show_bug.cgi?id=10932
     7       
     8        Test: svg/custom/createelement.svg
     9
     10        * ksvg2/svg/SVGDocument.cpp:
     11        (WebCore::SVGDocument::createElement):
     12        * ksvg2/svg/SVGDocument.h:
     13
    1142006-09-26  Eric Seidel  <eric@eseidel.com>
    215
  • trunk/WebCore/ksvg2/svg/SVGDocument.cpp

    r16330 r16575  
    2828#include "ExceptionCode.h"
    2929#include "SVGElement.h"
     30#include "SVGNames.h"
    3031#include "SVGSVGElement.h"
    3132#include "SVGZoomEvent.h"
     
    3334namespace WebCore {
    3435
    35 SVGDocument::SVGDocument(DOMImplementation *i, FrameView *view) : Document(i, view)
     36SVGDocument::SVGDocument(DOMImplementation* i, FrameView* view)
     37    : Document(i, view)
    3638{
    3739}
     
    4143}
    4244
    43 SVGSVGElement *SVGDocument::rootElement() const
     45SVGSVGElement* SVGDocument::rootElement() const
    4446{
    45     Element *elem = documentElement();
    46     if(elem && elem->hasTagName(SVGNames::svgTag))
    47         return static_cast<SVGSVGElement *>(elem);
     47    Element* elem = documentElement();
     48    if (elem && elem->hasTagName(SVGNames::svgTag))
     49        return static_cast<SVGSVGElement*>(elem);
    4850
    4951    return 0;
    5052}
    5153
     54PassRefPtr<Element> SVGDocument::createElement(const String& tagName, ExceptionCode& ec)
     55{
     56    return createElementNS(SVGNames::svgNamespaceURI, tagName, ec);
     57}
     58
    5259void SVGDocument::dispatchZoomEvent(float prevScale, float newScale)
    5360{
    54     // dispatch zoom event
    5561    ExceptionCode ec = 0;
    5662    RefPtr<SVGZoomEvent> event = static_pointer_cast<SVGZoomEvent>(createEvent("SVGZoomEvents", ec));
     
    5864    event->setPreviousScale(prevScale);
    5965    event->setNewScale(newScale);
    60     rootElement()->dispatchEvent(event.get(), ec);
     66    rootElement()->dispatchEvent(event.release(), ec);
    6167}
    6268
    6369void SVGDocument::dispatchScrollEvent()
    6470{
    65     // dispatch zoom event
    6671    ExceptionCode ec = 0;
    6772    RefPtr<Event> event = createEvent("SVGEvents", ec);
    6873    event->initEvent(EventNames::scrollEvent, true, false);
    69     rootElement()->dispatchEvent(event.get(), ec);
     74    rootElement()->dispatchEvent(event.release(), ec);
    7075}
    7176
  • trunk/WebCore/ksvg2/svg/SVGDocument.h

    r15828 r16575  
    2121*/
    2222
    23 #ifndef KSVG_SVGDocumentImpl_H
    24 #define KSVG_SVGDocumentImpl_H
     23#ifndef SVGDocument_H
     24#define SVGDocument_H
    2525#ifdef SVG_SUPPORT
    2626
     
    4040        virtual bool isSVGDocument() const { return true; }
    4141
    42         SVGSVGElement *rootElement() const;
     42        SVGSVGElement* rootElement() const;
     43       
     44        virtual PassRefPtr<Element> SVGDocument::createElement(const String& tagName, ExceptionCode&);
    4345       
    4446        void dispatchZoomEvent(float prevScale, float newScale);
     
    4951
    5052#endif // SVG_SUPPORT
    51 #endif // KSVG_SVGDocumentImpl_H
     53#endif // SVGDocument_H
    5254
    5355// vim:ts=4:noet
Note: See TracChangeset for help on using the changeset viewer.