Introduce SVGGraphicsElement IDL interface
https://bugs.webkit.org/show_bug.cgi?id=118178
Reviewed by Kentaro Hara.
Source/WebCore:
Introduce SVGGraphicsElement IDL interface as per the latest SVG
specification:
- https://svgwg.org/svg2-draft/types.html#InterfaceSVGGraphicsElement
SVGGraphicsElement is a merge of SVGLocatable and SVGTransformable.
This is one step towards simplifying inheritance in SVG and matching
the latest SVG2 specification.
No new tests, already covered by existing tests.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.order:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GetGnuVTableOffsetForType):
* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::RenderSVGEllipse):
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::RenderSVGPath):
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
* rendering/svg/RenderSVGResourceMarker.cpp:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::RenderSVGShape):
(WebCore::RenderSVGShape::updateShapeFromElement):
(WebCore::RenderSVGShape::layout):
(WebCore::RenderSVGShape::nonScalingStrokeTransform):
(WebCore::RenderSVGShape::shouldGenerateMarkerPositions):
* rendering/svg/RenderSVGShape.h:
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::RenderSVGTransformableContainer):
(WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
* rendering/svg/RenderSVGTransformableContainer.h:
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::SVGAElement):
(WebCore::SVGAElement::parseAttribute):
(WebCore::SVGAElement::svgAttributeChanged):
(WebCore::SVGAElement::defaultEventHandler):
(WebCore::SVGAElement::supportsFocus):
(WebCore::SVGAElement::isURLAttribute):
* svg/SVGAElement.h:
* svg/SVGAElement.idl:
* svg/SVGAllInOne.cpp:
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::hasValidAttributeType):
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::SVGCircleElement):
(WebCore::SVGCircleElement::parseAttribute):
(WebCore::SVGCircleElement::svgAttributeChanged):
* svg/SVGCircleElement.h:
* svg/SVGCircleElement.idl:
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::SVGClipPathElement):
(WebCore::SVGClipPathElement::parseAttribute):
(WebCore::SVGClipPathElement::svgAttributeChanged):
(WebCore::SVGClipPathElement::childrenChanged):
* svg/SVGClipPathElement.h:
* svg/SVGClipPathElement.idl:
* svg/SVGDefsElement.cpp:
(WebCore::SVGDefsElement::SVGDefsElement):
* svg/SVGDefsElement.h:
* svg/SVGDefsElement.idl:
* svg/SVGElement.h:
(WebCore::SVGElement::isSVGGraphicsElement):
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::SVGEllipseElement):
(WebCore::SVGEllipseElement::parseAttribute):
(WebCore::SVGEllipseElement::svgAttributeChanged):
* svg/SVGEllipseElement.h:
* svg/SVGEllipseElement.idl:
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
(WebCore::SVGForeignObjectElement::parseAttribute):
(WebCore::SVGForeignObjectElement::svgAttributeChanged):
(WebCore::SVGForeignObjectElement::rendererIsNeeded):
* svg/SVGForeignObjectElement.h:
* svg/SVGForeignObjectElement.idl:
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::SVGGElement):
(WebCore::SVGGElement::parseAttribute):
(WebCore::SVGGElement::svgAttributeChanged):
* svg/SVGGElement.h:
* svg/SVGGElement.idl:
* svg/SVGGraphicsElement.cpp: Renamed from Source/WebCore/svg/SVGStyledTransformableElement.cpp.
(WebCore::SVGGraphicsElement::SVGGraphicsElement):
(WebCore::SVGGraphicsElement::~SVGGraphicsElement):
(WebCore::SVGGraphicsElement::getCTM):
(WebCore::SVGGraphicsElement::getScreenCTM):
(WebCore::SVGGraphicsElement::animatedLocalTransform):
(WebCore::SVGGraphicsElement::supplementalTransform):
(WebCore::SVGGraphicsElement::isSupportedAttribute):
(WebCore::SVGGraphicsElement::parseAttribute):
(WebCore::SVGGraphicsElement::svgAttributeChanged):
(WebCore::SVGGraphicsElement::nearestViewportElement):
(WebCore::SVGGraphicsElement::farthestViewportElement):
(WebCore::SVGGraphicsElement::getBBox):
(WebCore::SVGGraphicsElement::createRenderer):
(WebCore::SVGGraphicsElement::toClipPath):
* svg/SVGGraphicsElement.h: Renamed from Source/WebCore/svg/SVGStyledTransformableElement.h.
(WebCore::SVGGraphicsElement::localCoordinateSpaceTransform):
(WebCore::SVGGraphicsElement::synchronizeRequiredFeatures):
(WebCore::SVGGraphicsElement::synchronizeRequiredExtensions):
(WebCore::SVGGraphicsElement::synchronizeSystemLanguage):
(WebCore::toSVGGraphicsElement):
* svg/SVGGraphicsElement.idl: Copied from Source/WebCore/svg/SVGForeignObjectElement.idl.
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::SVGImageElement):
(WebCore::SVGImageElement::isPresentationAttribute):
(WebCore::SVGImageElement::collectStyleForPresentationAttribute):
(WebCore::SVGImageElement::parseAttribute):
(WebCore::SVGImageElement::svgAttributeChanged):
(WebCore::SVGImageElement::attach):
(WebCore::SVGImageElement::insertedInto):
(WebCore::SVGImageElement::addSubresourceAttributeURLs):
(WebCore::SVGImageElement::didMoveToNewDocument):
* svg/SVGImageElement.h:
* svg/SVGImageElement.idl:
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::SVGLineElement):
(WebCore::SVGLineElement::parseAttribute):
(WebCore::SVGLineElement::svgAttributeChanged):
* svg/SVGLineElement.h:
* svg/SVGLineElement.idl:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::parseAttribute):
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::insertedInto):
(WebCore::SVGPathElement::removedFrom):
* svg/SVGPathElement.h:
* svg/SVGPathElement.idl:
* svg/SVGPatternElement.cpp:
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::SVGPolyElement):
(WebCore::SVGPolyElement::parseAttribute):
(WebCore::SVGPolyElement::svgAttributeChanged):
* svg/SVGPolyElement.h:
* svg/SVGPolygonElement.idl:
* svg/SVGPolylineElement.idl:
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::SVGRectElement):
(WebCore::SVGRectElement::parseAttribute):
(WebCore::SVGRectElement::svgAttributeChanged):
* svg/SVGRectElement.h:
* svg/SVGRectElement.idl:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement):
(WebCore::SVGSVGElement::didMoveToNewDocument):
(WebCore::SVGSVGElement::parseAttribute):
(WebCore::SVGSVGElement::insertedInto):
(WebCore::SVGSVGElement::removedFrom):
* svg/SVGSVGElement.h:
* svg/SVGSVGElement.idl:
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::localCoordinateSpaceTransform):
* svg/SVGSwitchElement.cpp:
(WebCore::SVGSwitchElement::SVGSwitchElement):
* svg/SVGSwitchElement.h:
* svg/SVGSwitchElement.idl:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::SVGUseElement):
(WebCore::SVGUseElement::parseAttribute):
(WebCore::SVGUseElement::insertedInto):
(WebCore::SVGUseElement::removedFrom):
(WebCore::SVGUseElement::svgAttributeChanged):
(WebCore::SVGUseElement::toClipPath):
(WebCore::SVGUseElement::finishParsingChildren):
* svg/SVGUseElement.h:
* svg/SVGUseElement.idl:
LayoutTests:
Rebaseline js/global-constructors-attributes.html test case now that
SVGGraphicsElement is exposed on the global Window object.
* fast/js/global-constructors-attributes-expected.txt:
* platform/efl/fast/js/global-constructors-attributes-expected.txt:
* platform/gtk/fast/js/global-constructors-attributes-expected.txt:
* platform/mac-lion/fast/js/global-constructors-attributes-expected.txt:
* platform/qt/fast/js/global-constructors-attributes-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/svg/SVGImageElement.cpp b/Source/WebCore/svg/SVGImageElement.cpp
index 5bd39b3..2f94271 100644
--- a/Source/WebCore/svg/SVGImageElement.cpp
+++ b/Source/WebCore/svg/SVGImageElement.cpp
@@ -53,12 +53,11 @@
REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
REGISTER_LOCAL_ANIMATED_PROPERTY(href)
REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* document)
- : SVGStyledTransformableElement(tagName, document)
+ : SVGGraphicsElement(tagName, document)
, m_x(LengthModeWidth)
, m_y(LengthModeHeight)
, m_width(LengthModeWidth)
@@ -95,13 +94,13 @@
{
if (name == SVGNames::widthAttr || name == SVGNames::heightAttr)
return true;
- return SVGStyledTransformableElement::isPresentationAttribute(name);
+ return SVGGraphicsElement::isPresentationAttribute(name);
}
void SVGImageElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
if (!isSupportedAttribute(name))
- SVGStyledTransformableElement::collectStyleForPresentationAttribute(name, value, style);
+ SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
else if (name == SVGNames::widthAttr)
addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
else if (name == SVGNames::heightAttr)
@@ -113,7 +112,7 @@
SVGParsingError parseError = NoError;
if (!isSupportedAttribute(name))
- SVGStyledTransformableElement::parseAttribute(name, value);
+ SVGGraphicsElement::parseAttribute(name, value);
else if (name == SVGNames::xAttr)
setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError));
else if (name == SVGNames::yAttr)
@@ -139,7 +138,7 @@
void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
{
if (!isSupportedAttribute(attrName)) {
- SVGStyledTransformableElement::svgAttributeChanged(attrName);
+ SVGGraphicsElement::svgAttributeChanged(attrName);
return;
}
@@ -201,7 +200,7 @@
void SVGImageElement::attach(const AttachContext& context)
{
- SVGStyledTransformableElement::attach(context);
+ SVGGraphicsElement::attach(context);
if (RenderSVGImage* imageObj = toRenderSVGImage(renderer())) {
if (imageObj->imageResource()->hasImage())
@@ -213,7 +212,7 @@
Node::InsertionNotificationRequest SVGImageElement::insertedInto(ContainerNode* rootParent)
{
- SVGStyledTransformableElement::insertedInto(rootParent);
+ SVGGraphicsElement::insertedInto(rootParent);
if (!rootParent->inDocument())
return InsertionDone;
// Update image loader, as soon as we're living in the tree.
@@ -229,7 +228,7 @@
void SVGImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
{
- SVGStyledTransformableElement::addSubresourceAttributeURLs(urls);
+ SVGGraphicsElement::addSubresourceAttributeURLs(urls);
addSubresourceURL(urls, document()->completeURL(href()));
}
@@ -237,7 +236,7 @@
void SVGImageElement::didMoveToNewDocument(Document* oldDocument)
{
m_imageLoader.elementDidMoveToNewDocument();
- SVGStyledTransformableElement::didMoveToNewDocument(oldDocument);
+ SVGGraphicsElement::didMoveToNewDocument(oldDocument);
}
}