Diff
Modified: trunk/LayoutTests/ChangeLog (152403 => 152404)
--- trunk/LayoutTests/ChangeLog 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/LayoutTests/ChangeLog 2013-07-04 18:48:51 UTC (rev 152404)
@@ -1,3 +1,23 @@
+2013-07-04 Christophe Dumez <ch.du...@sisa.samsung.com>
+
+ Have SVGTextContentElement inherit SVGGraphicsElement
+ https://bugs.webkit.org/show_bug.cgi?id=118351
+
+ Reviewed by Dirk Schulze.
+
+ Fix conversion to absolute (user agent) coordinates in the svg/text
+ tests to use SVGGraphicsElement::getScreenCTM() instead of
+ SVGGraphicsElement::getTransformToElement(). The previous code was
+ working until now due to a bug in getTransformToElement(), which
+ was not taking into consideration the CTM of the SVGTextElement (as
+ it was not recognized as a "locatable" element). Now that
+ SVGTextElement inherits from SVGGraphicsElement, it is properly
+ recognized as a "locatable" element by getTransformToElement().
+
+ * svg/text/resources/SelectionTestCase.js:
+ (toAbsoluteCoordinates):
+ * svg/text/selection-doubleclick.svg:
+
2013-07-04 KyungTae Kim <ktf....@samsung.com>
[EFL] Gardening. Unskip tests related with editing
Modified: trunk/LayoutTests/svg/text/resources/SelectionTestCase.js (152403 => 152404)
--- trunk/LayoutTests/svg/text/resources/SelectionTestCase.js 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/LayoutTests/svg/text/resources/SelectionTestCase.js 2013-07-04 18:48:51 UTC (rev 152404)
@@ -29,7 +29,9 @@
}
function toAbsoluteCoordinates(point, element) {
- return transformPoint(point, document.rootElement.getTransformToElement(element));
+ // getScreenCTM() returns the transformation matrix from current user units (i.e., after application of the ‘transform’ property)
+ // to the parent user agent's notice of a "pixel".
+ return transformPoint(point, element.getScreenCTM());
}
// Select a range of characters in text element 'id', from the start position of the 'start' character to the end position of the 'end' character
Modified: trunk/LayoutTests/svg/text/selection-doubleclick.svg (152403 => 152404)
--- trunk/LayoutTests/svg/text/selection-doubleclick.svg 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/LayoutTests/svg/text/selection-doubleclick.svg 2013-07-04 18:48:51 UTC (rev 152404)
@@ -4,7 +4,7 @@
<script>
var line1 = document.getElementById("line1");
var center = document.rootElement.createSVGPoint();
-var matrix = document.rootElement.getTransformToElement(line1);
+var matrix = line1.getScreenCTM();
var bbox = line1.getBBox();
center.x = bbox.x + bbox.width/2;
Modified: trunk/Source/WebCore/ChangeLog (152403 => 152404)
--- trunk/Source/WebCore/ChangeLog 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/ChangeLog 2013-07-04 18:48:51 UTC (rev 152404)
@@ -1,3 +1,49 @@
+2013-07-04 Christophe Dumez <ch.du...@sisa.samsung.com>
+
+ Have SVGTextContentElement inherit SVGGraphicsElement
+ https://bugs.webkit.org/show_bug.cgi?id=118351
+
+ Reviewed by Dirk Schulze.
+
+ Have SVGTextContentElement inherit SVGGraphicsElement instead of
+ SVGStyledElement in order to match the latest SVG2 specification:
+ https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextContentElement
+
+ This patch also removes the SVGTransformable and SVGLocatable IDL
+ interfaces as they are no longer needed (were merged into
+ SVGGraphicsElement in the latest specification).
+
+ This is one step towards getting rid of multiple inheritance in
+ SVG, and complying with the latest SVG2 specification.
+
+ No new tests, covered by existing tests.
+
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GetGnuVTableOffsetForType):
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ * svg/SVGAnimateMotionElement.cpp:
+ (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::getBoundingBox):
+ * svg/SVGLocatable.idl: Removed.
+ * svg/SVGTextContentElement.cpp:
+ (WebCore::SVGTextContentElement::SVGTextContentElement):
+ (WebCore::SVGTextContentElement::isSupportedAttribute):
+ (WebCore::SVGTextContentElement::isPresentationAttribute):
+ (WebCore::SVGTextContentElement::collectStyleForPresentationAttribute):
+ (WebCore::SVGTextContentElement::parseAttribute):
+ (WebCore::SVGTextContentElement::svgAttributeChanged):
+ * svg/SVGTextContentElement.h:
+ * svg/SVGTextContentElement.idl:
+ * svg/SVGTextElement.cpp:
+ (WebCore::SVGTextElement::SVGTextElement):
+ (WebCore::SVGTextElement::animatedLocalTransform):
+ * svg/SVGTextElement.h:
+ * svg/SVGTextElement.idl:
+ * svg/SVGTransformable.idl: Removed.
+
2013-07-03 Gavin Barraclough <barraclo...@apple.com>
Remove PageThrottler::m_activeThrottleBlockers
Modified: trunk/Source/WebCore/DerivedSources.make (152403 => 152404)
--- trunk/Source/WebCore/DerivedSources.make 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/DerivedSources.make 2013-07-04 18:48:51 UTC (rev 152404)
@@ -555,7 +555,6 @@
$(WebCore)/svg/SVGLengthList.idl \
$(WebCore)/svg/SVGLineElement.idl \
$(WebCore)/svg/SVGLinearGradientElement.idl \
- $(WebCore)/svg/SVGLocatable.idl \
$(WebCore)/svg/SVGMPathElement.idl \
$(WebCore)/svg/SVGMarkerElement.idl \
$(WebCore)/svg/SVGMaskElement.idl \
@@ -616,7 +615,6 @@
$(WebCore)/svg/SVGTitleElement.idl \
$(WebCore)/svg/SVGTransform.idl \
$(WebCore)/svg/SVGTransformList.idl \
- $(WebCore)/svg/SVGTransformable.idl \
$(WebCore)/svg/SVGURIReference.idl \
$(WebCore)/svg/SVGUnitTypes.idl \
$(WebCore)/svg/SVGUseElement.idl \
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (152403 => 152404)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2013-07-04 18:48:51 UTC (rev 152404)
@@ -10628,7 +10628,6 @@
B22278A70D00BF200071B782 /* SVGLineElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGLineElement.idl; sourceTree = "<group>"; };
B22278AA0D00BF200071B782 /* SVGLocatable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLocatable.cpp; sourceTree = "<group>"; };
B22278AB0D00BF200071B782 /* SVGLocatable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGLocatable.h; sourceTree = "<group>"; };
- B22278AC0D00BF200071B782 /* SVGLocatable.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGLocatable.idl; sourceTree = "<group>"; };
B22278AD0D00BF200071B782 /* SVGMarkerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGMarkerElement.cpp; sourceTree = "<group>"; };
B22278AE0D00BF200071B782 /* SVGMarkerElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGMarkerElement.h; sourceTree = "<group>"; };
B22278AF0D00BF200071B782 /* SVGMarkerElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGMarkerElement.idl; sourceTree = "<group>"; };
@@ -10767,7 +10766,6 @@
B22279420D00BF210071B782 /* SVGTransform.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGTransform.idl; sourceTree = "<group>"; };
B22279430D00BF210071B782 /* SVGTransformable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformable.cpp; sourceTree = "<group>"; };
B22279440D00BF210071B782 /* SVGTransformable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGTransformable.h; sourceTree = "<group>"; };
- B22279450D00BF210071B782 /* SVGTransformable.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGTransformable.idl; sourceTree = "<group>"; };
B22279460D00BF210071B782 /* SVGTransformDistance.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformDistance.cpp; sourceTree = "<group>"; };
B22279470D00BF210071B782 /* SVGTransformDistance.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGTransformDistance.h; sourceTree = "<group>"; };
B22279480D00BF210071B782 /* SVGTransformList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformList.cpp; sourceTree = "<group>"; };
@@ -17999,7 +17997,6 @@
B22278A70D00BF200071B782 /* SVGLineElement.idl */,
B22278AA0D00BF200071B782 /* SVGLocatable.cpp */,
B22278AB0D00BF200071B782 /* SVGLocatable.h */,
- B22278AC0D00BF200071B782 /* SVGLocatable.idl */,
B22278AD0D00BF200071B782 /* SVGMarkerElement.cpp */,
B22278AE0D00BF200071B782 /* SVGMarkerElement.h */,
B22278AF0D00BF200071B782 /* SVGMarkerElement.idl */,
@@ -18171,7 +18168,6 @@
B22279420D00BF210071B782 /* SVGTransform.idl */,
B22279430D00BF210071B782 /* SVGTransformable.cpp */,
B22279440D00BF210071B782 /* SVGTransformable.h */,
- B22279450D00BF210071B782 /* SVGTransformable.idl */,
B22279460D00BF210071B782 /* SVGTransformDistance.cpp */,
B22279470D00BF210071B782 /* SVGTransformDistance.h */,
B22279480D00BF210071B782 /* SVGTransformList.cpp */,
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (152403 => 152404)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2013-07-04 18:48:51 UTC (rev 152404)
@@ -1504,7 +1504,6 @@
|| $typename eq "SVGGraphicsElement"
|| $typename eq "SVGSwitchElement"
|| $typename eq "SVGTextElement"
- || $typename eq "SVGTransformable"
|| $typename eq "SVGUseElement") {
return "3";
}
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (152403 => 152404)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2013-07-04 18:48:51 UTC (rev 152404)
@@ -55,7 +55,7 @@
# Hashes
my %protocolTypeHash = ("XPathNSResolver" => 1, "EventListener" => 1, "EventTarget" => 1, "NodeFilter" => 1,
- "SVGLocatable" => 1, "SVGTransformable" => 1, "SVGFilterPrimitiveStandardAttributes" => 1,
+ "SVGFilterPrimitiveStandardAttributes" => 1,
"SVGTests" => 1, "SVGLangSpace" => 1, "SVGExternalResourcesRequired" => 1, "SVGURIReference" => 1,
"SVGZoomAndPan" => 1, "SVGFitToViewBox" => 1, "SVGAnimatedPathData" => 1, "ElementTimeControl" => 1);
my %nativeObjCTypeHash = ("URL" => 1, "Color" => 1);
Modified: trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp 2013-07-04 18:48:51 UTC (rev 152404)
@@ -62,7 +62,7 @@
return false;
// We don't have a special attribute name to verify the animation type. Check the element name instead.
- if (!targetElement->isSVGGraphicsElement() && !targetElement->hasTagName(SVGNames::textTag))
+ if (!targetElement->isSVGGraphicsElement())
return false;
// Spec: SVG 1.1 section 19.2.15
// FIXME: svgTag is missing. Needs to be checked, if transforming <svg> could cause problems.
Modified: trunk/Source/WebCore/svg/SVGElement.cpp (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGElement.cpp 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGElement.cpp 2013-07-04 18:48:51 UTC (rev 152404)
@@ -40,7 +40,6 @@
#include "SVGGraphicsElement.h"
#include "SVGNames.h"
#include "SVGSVGElement.h"
-#include "SVGTextElement.h"
#include "ScriptEventListener.h"
#include "XMLNames.h"
@@ -259,10 +258,6 @@
rect = toSVGGraphicsElement(this)->getBBox(styleUpdateStrategy);
return true;
}
- if (hasTagName(SVGNames::textTag)) {
- rect = static_cast<SVGTextElement*>(this)->getBBox(styleUpdateStrategy);
- return true;
- }
return false;
}
Deleted: trunk/Source/WebCore/svg/SVGLocatable.idl (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGLocatable.idl 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGLocatable.idl 2013-07-04 18:48:51 UTC (rev 152404)
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig <sam.wei...@gmail.com>
- * Copyright (C) 2006 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject,
- Conditional=SVG,
- ObjCProtocol,
- SuppressToJSObject,
-] interface SVGLocatable {
- readonly attribute SVGElement nearestViewportElement;
- readonly attribute SVGElement farthestViewportElement;
-
- SVGRect getBBox();
- SVGMatrix getCTM();
- SVGMatrix getScreenCTM();
- [RaisesException] SVGMatrix getTransformToElement([Default=Undefined] optional SVGElement element);
-};
-
Modified: trunk/Source/WebCore/svg/SVGTextContentElement.cpp (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGTextContentElement.cpp 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGTextContentElement.cpp 2013-07-04 18:48:51 UTC (rev 152404)
@@ -61,12 +61,11 @@
REGISTER_LOCAL_ANIMATED_PROPERTY(textLength)
REGISTER_LOCAL_ANIMATED_PROPERTY(lengthAdjust)
REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement)
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
END_REGISTER_ANIMATED_PROPERTIES
SVGTextContentElement::SVGTextContentElement(const QualifiedName& tagName, Document* document)
- : SVGStyledElement(tagName, document)
+ : SVGGraphicsElement(tagName, document)
, m_textLength(LengthModeOther)
, m_specifiedTextLength(LengthModeOther)
, m_lengthAdjust(SVGLengthAdjustSpacing)
@@ -217,7 +216,6 @@
{
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
if (supportedAttributes.isEmpty()) {
- SVGTests::addSupportedAttributes(supportedAttributes);
SVGLangSpace::addSupportedAttributes(supportedAttributes);
SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
supportedAttributes.add(SVGNames::lengthAdjustAttr);
@@ -230,13 +228,13 @@
{
if (name.matches(XMLNames::spaceAttr))
return true;
- return SVGStyledElement::isPresentationAttribute(name);
+ return SVGGraphicsElement::isPresentationAttribute(name);
}
void SVGTextContentElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
if (!isSupportedAttribute(name))
- SVGStyledElement::collectStyleForPresentationAttribute(name, value, style);
+ SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
else if (name.matches(XMLNames::spaceAttr)) {
DEFINE_STATIC_LOCAL(const AtomicString, preserveString, ("preserve", AtomicString::ConstructFromLiteral));
@@ -252,15 +250,14 @@
SVGParsingError parseError = NoError;
if (!isSupportedAttribute(name))
- SVGStyledElement::parseAttribute(name, value);
+ SVGGraphicsElement::parseAttribute(name, value);
else if (name == SVGNames::lengthAdjustAttr) {
SVGLengthAdjustType propertyValue = SVGPropertyTraits<SVGLengthAdjustType>::fromString(value);
if (propertyValue > 0)
setLengthAdjustBaseValue(propertyValue);
} else if (name == SVGNames::textLengthAttr) {
m_textLength.value = SVGLength::construct(LengthModeOther, value, parseError, ForbidNegativeLengths);
- } else if (SVGTests::parseAttribute(name, value)
- || SVGExternalResourcesRequired::parseAttribute(name, value)) {
+ } else if (SVGExternalResourcesRequired::parseAttribute(name, value)) {
} else if (SVGLangSpace::parseAttribute(name, value)) {
} else
ASSERT_NOT_REACHED();
@@ -271,15 +268,12 @@
void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName)
{
if (!isSupportedAttribute(attrName)) {
- SVGStyledElement::svgAttributeChanged(attrName);
+ SVGGraphicsElement::svgAttributeChanged(attrName);
return;
}
SVGElementInstance::InvalidationGuard invalidationGuard(this);
- if (SVGTests::handleAttributeChange(this, attrName))
- return;
-
if (attrName == SVGNames::textLengthAttr)
m_specifiedTextLength = m_textLength.value;
Modified: trunk/Source/WebCore/svg/SVGTextContentElement.h (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGTextContentElement.h 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGTextContentElement.h 2013-07-04 18:48:51 UTC (rev 152404)
@@ -26,8 +26,7 @@
#include "SVGAnimatedEnumeration.h"
#include "SVGAnimatedLength.h"
#include "SVGExternalResourcesRequired.h"
-#include "SVGStyledElement.h"
-#include "SVGTests.h"
+#include "SVGGraphicsElement.h"
namespace WebCore {
@@ -66,8 +65,7 @@
}
};
-class SVGTextContentElement : public SVGStyledElement,
- public SVGTests,
+class SVGTextContentElement : public SVGGraphicsElement,
public SVGExternalResourcesRequired {
public:
// Forward declare enumerations in the W3C naming scheme, for IDL generation.
@@ -121,11 +119,6 @@
DECLARE_ANIMATED_ENUMERATION(LengthAdjust, lengthAdjust, SVGLengthAdjustType)
DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
END_DECLARE_ANIMATED_PROPERTIES
-
- // SVGTests
- virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
- virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
- virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
};
inline SVGTextContentElement* toSVGTextContentElement(SVGElement* element)
Modified: trunk/Source/WebCore/svg/SVGTextContentElement.idl (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGTextContentElement.idl 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGTextContentElement.idl 2013-07-04 18:48:51 UTC (rev 152404)
@@ -25,7 +25,7 @@
[
Conditional=SVG
-] interface SVGTextContentElement : SVGStyledElement {
+] interface SVGTextContentElement : SVGGraphicsElement {
// lengthAdjust Types
const unsigned short LENGTHADJUST_UNKNOWN = 0;
const unsigned short LENGTHADJUST_SPACING = 1;
@@ -47,5 +47,5 @@
[Default=Undefined,IsIndex] optional unsigned long length);
};
+// FIXME: SVGTextContentElement is not supposed to implement SVGExternalResourcesRequired.
SVGTextContentElement implements SVGExternalResourcesRequired;
-SVGTextContentElement implements SVGTests;
Modified: trunk/Source/WebCore/svg/SVGTextElement.cpp (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGTextElement.cpp 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGTextElement.cpp 2013-07-04 18:48:51 UTC (rev 152404)
@@ -23,9 +23,7 @@
#if ENABLE(SVG)
#include "SVGTextElement.h"
-#include "AffineTransform.h"
#include "Attribute.h"
-#include "FloatRect.h"
#include "NodeRenderingContext.h"
#include "RenderSVGResource.h"
#include "RenderSVGText.h"
@@ -36,19 +34,10 @@
namespace WebCore {
-// Animated property definitions
-DEFINE_ANIMATED_TRANSFORM_LIST(SVGTextElement, SVGNames::transformAttr, Transform, transform)
-
-BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTextElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(transform)
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextPositioningElement)
-END_REGISTER_ANIMATED_PROPERTIES
-
inline SVGTextElement::SVGTextElement(const QualifiedName& tagName, Document* doc)
: SVGTextPositioningElement(tagName, doc)
{
ASSERT(hasTagName(SVGNames::textTag));
- registerAnimatedPropertiesForSVGTextElement();
}
PassRefPtr<SVGTextElement> SVGTextElement::create(const QualifiedName& tagName, Document* document)
@@ -56,57 +45,8 @@
return adoptRef(new SVGTextElement(tagName, document));
}
-bool SVGTextElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty())
- supportedAttributes.add(SVGNames::transformAttr);
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
-void SVGTextElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
-{
- if (!isSupportedAttribute(name)) {
- SVGTextPositioningElement::parseAttribute(name, value);
- return;
- }
-
- if (name == SVGNames::transformAttr) {
- SVGTransformList newList;
- newList.parse(value);
- detachAnimatedTransformListWrappers(newList.size());
- setTransformBaseValue(newList);
- return;
- }
-
- ASSERT_NOT_REACHED();
-}
-
-SVGElement* SVGTextElement::nearestViewportElement() const
-{
- return SVGTransformable::nearestViewportElement(this);
-}
-
-SVGElement* SVGTextElement::farthestViewportElement() const
-{
- return SVGTransformable::farthestViewportElement(this);
-}
-
-FloatRect SVGTextElement::getBBox(StyleUpdateStrategy styleUpdateStrategy)
-{
- return SVGTransformable::getBBox(this, styleUpdateStrategy);
-}
-
-AffineTransform SVGTextElement::getCTM(StyleUpdateStrategy styleUpdateStrategy)
-{
- return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope, styleUpdateStrategy);
-}
-
-AffineTransform SVGTextElement::getScreenCTM(StyleUpdateStrategy styleUpdateStrategy)
-{
- return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope, styleUpdateStrategy);
-}
-
+// We override SVGGraphics::animatedLocalTransform() so that the transform-origin
+// is not taken into account.
AffineTransform SVGTextElement::animatedLocalTransform() const
{
AffineTransform matrix;
@@ -123,18 +63,12 @@
} else
transform().concatenate(matrix);
- if (m_supplementalTransform)
- return *m_supplementalTransform * matrix;
+ const AffineTransform* transform = const_cast<SVGTextElement*>(this)->supplementalTransform();
+ if (transform)
+ return *transform * matrix;
return matrix;
}
-AffineTransform* SVGTextElement::supplementalTransform()
-{
- if (!m_supplementalTransform)
- m_supplementalTransform = adoptPtr(new AffineTransform);
- return m_supplementalTransform.get();
-}
-
RenderObject* SVGTextElement::createRenderer(RenderArena* arena, RenderStyle*)
{
return new (arena) RenderSVGText(this);
@@ -155,28 +89,6 @@
return false;
}
-void SVGTextElement::svgAttributeChanged(const QualifiedName& attrName)
-{
- if (!isSupportedAttribute(attrName)) {
- SVGTextPositioningElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElementInstance::InvalidationGuard invalidationGuard(this);
-
- RenderObject* renderer = this->renderer();
- if (!renderer)
- return;
-
- if (attrName == SVGNames::transformAttr) {
- renderer->setNeedsTransformUpdate();
- RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
- return;
- }
-
- ASSERT_NOT_REACHED();
}
-}
-
#endif // ENABLE(SVG)
Modified: trunk/Source/WebCore/svg/SVGTextElement.h (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGTextElement.h 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGTextElement.h 2013-07-04 18:48:51 UTC (rev 152404)
@@ -24,21 +24,13 @@
#if ENABLE(SVG)
#include "SVGAnimatedTransformList.h"
#include "SVGTextPositioningElement.h"
-#include "SVGTransformable.h"
namespace WebCore {
-class SVGTextElement FINAL : public SVGTextPositioningElement,
- public SVGTransformable {
+class SVGTextElement FINAL : public SVGTextPositioningElement {
public:
static PassRefPtr<SVGTextElement> create(const QualifiedName&, Document*);
- virtual SVGElement* nearestViewportElement() const;
- virtual SVGElement* farthestViewportElement() const;
-
- virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate);
- virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate);
- virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate);
virtual AffineTransform animatedLocalTransform() const;
private:
@@ -46,23 +38,8 @@
virtual bool supportsFocus() const OVERRIDE { return true; }
- bool isSupportedAttribute(const QualifiedName&);
- virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
-
- virtual AffineTransform* supplementalTransform();
- virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGTransformable::localCoordinateSpaceTransform(mode); }
-
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const;
-
- virtual void svgAttributeChanged(const QualifiedName&);
-
- BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGTextElement)
- DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform)
- END_DECLARE_ANIMATED_PROPERTIES
-
- // Used by <animateMotion>
- OwnPtr<AffineTransform> m_supplementalTransform;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/svg/SVGTextElement.idl (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGTextElement.idl 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGTextElement.idl 2013-07-04 18:48:51 UTC (rev 152404)
@@ -25,7 +25,6 @@
[
Conditional=SVG
-] interface SVGTextElement : SVGTextPositioningElement,
- SVGTransformable {
+] interface SVGTextElement : SVGTextPositioningElement {
};
Deleted: trunk/Source/WebCore/svg/SVGTransformable.idl (152403 => 152404)
--- trunk/Source/WebCore/svg/SVGTransformable.idl 2013-07-04 18:42:16 UTC (rev 152403)
+++ trunk/Source/WebCore/svg/SVGTransformable.idl 2013-07-04 18:48:51 UTC (rev 152404)
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig <sam.wei...@gmail.com>
- * Copyright (C) 2006 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
- NoInterfaceObject,
- Conditional=SVG,
- ObjCProtocol,
-] interface SVGTransformable : SVGLocatable {
- readonly attribute SVGAnimatedTransformList transform;
-};
-