[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
rwlbuis at webkit.org
rwlbuis at webkit.org
Wed Dec 22 15:53:36 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 5d888f060dc4ff57ed2486bdf2af48d9b4a51271
Author: rwlbuis at webkit.org <rwlbuis at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 16 08:10:25 2010 +0000
2010-11-15 Rob Buis <rwlbuis at gmail.com>
Reviewed by Dirk Schulze and Darin Adler.
requiredFeatures does not adapt to SVGStringList changes
https://bugs.webkit.org/show_bug.cgi?id=40887
Centralize the const_cast handling and only do it if needed.
Remove the const_cast in all svgAttributeChanged functions and move
it to SVGTest::handleAttributeChange. Add an early return to
handleAttributeChange to avoid unnecessary const_casts.
No tests necessary as functionality has not changed.
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::svgAttributeChanged):
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::svgAttributeChanged):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged):
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::svgAttributeChanged):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::svgAttributeChanged):
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::svgAttributeChanged):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::svgAttributeChanged):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::svgAttributeChanged):
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::svgAttributeChanged):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::svgAttributeChanged):
* svg/SVGTests.cpp:
(WebCore::SVGTests::handleAttributeChange):
* svg/SVGTests.h:
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::svgAttributeChanged):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::svgAttributeChanged):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3f8a4e9..0187bf0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,45 @@
+2010-11-15 Rob Buis <rwlbuis at gmail.com>
+
+ Reviewed by Dirk Schulze and Darin Adler.
+
+ requiredFeatures does not adapt to SVGStringList changes
+ https://bugs.webkit.org/show_bug.cgi?id=40887
+
+ Centralize the const_cast handling and only do it if needed.
+ Remove the const_cast in all svgAttributeChanged functions and move
+ it to SVGTest::handleAttributeChange. Add an early return to
+ handleAttributeChange to avoid unnecessary const_casts.
+
+ No tests necessary as functionality has not changed.
+
+ * svg/SVGCircleElement.cpp:
+ (WebCore::SVGCircleElement::svgAttributeChanged):
+ * svg/SVGEllipseElement.cpp:
+ (WebCore::SVGEllipseElement::svgAttributeChanged):
+ * svg/SVGForeignObjectElement.cpp:
+ (WebCore::SVGForeignObjectElement::svgAttributeChanged):
+ * svg/SVGGElement.cpp:
+ (WebCore::SVGGElement::svgAttributeChanged):
+ * svg/SVGImageElement.cpp:
+ (WebCore::SVGImageElement::svgAttributeChanged):
+ * svg/SVGLineElement.cpp:
+ (WebCore::SVGLineElement::svgAttributeChanged):
+ * svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::svgAttributeChanged):
+ * svg/SVGPolyElement.cpp:
+ (WebCore::SVGPolyElement::svgAttributeChanged):
+ * svg/SVGRectElement.cpp:
+ (WebCore::SVGRectElement::svgAttributeChanged):
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::svgAttributeChanged):
+ * svg/SVGTests.cpp:
+ (WebCore::SVGTests::handleAttributeChange):
+ * svg/SVGTests.h:
+ * svg/SVGTextContentElement.cpp:
+ (WebCore::SVGTextContentElement::svgAttributeChanged):
+ * svg/SVGUseElement.cpp:
+ (WebCore::SVGUseElement::svgAttributeChanged):
+
2010-11-15 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Darin Adler.
diff --git a/WebCore/svg/SVGCircleElement.cpp b/WebCore/svg/SVGCircleElement.cpp
index e983300..a2c6a8d 100644
--- a/WebCore/svg/SVGCircleElement.cpp
+++ b/WebCore/svg/SVGCircleElement.cpp
@@ -77,7 +77,7 @@ void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- if (SVGTests::handleAttributeChange(const_cast<SVGCircleElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
diff --git a/WebCore/svg/SVGEllipseElement.cpp b/WebCore/svg/SVGEllipseElement.cpp
index 9493328..5726c53 100644
--- a/WebCore/svg/SVGEllipseElement.cpp
+++ b/WebCore/svg/SVGEllipseElement.cpp
@@ -83,7 +83,7 @@ void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- if (SVGTests::handleAttributeChange(const_cast<SVGEllipseElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp
index f58fb9d..d21172a 100644
--- a/WebCore/svg/SVGForeignObjectElement.cpp
+++ b/WebCore/svg/SVGForeignObjectElement.cpp
@@ -81,7 +81,7 @@ void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- if (SVGTests::handleAttributeChange(const_cast<SVGForeignObjectElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderObject* renderer = this->renderer();
diff --git a/WebCore/svg/SVGGElement.cpp b/WebCore/svg/SVGGElement.cpp
index f953d51..b6b4a70 100644
--- a/WebCore/svg/SVGGElement.cpp
+++ b/WebCore/svg/SVGGElement.cpp
@@ -55,7 +55,7 @@ void SVGGElement::svgAttributeChanged(const QualifiedName& attrName)
{
SVGStyledTransformableElement::svgAttributeChanged(attrName);
- if (SVGTests::handleAttributeChange(const_cast<SVGGElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderObject* renderer = this->renderer();
diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp
index f2e2663..3eb64db 100644
--- a/WebCore/svg/SVGImageElement.cpp
+++ b/WebCore/svg/SVGImageElement.cpp
@@ -98,7 +98,7 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- if (SVGTests::handleAttributeChange(const_cast<SVGImageElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderObject* renderer = this->renderer();
diff --git a/WebCore/svg/SVGLineElement.cpp b/WebCore/svg/SVGLineElement.cpp
index 324f9e2..ac461fe 100644
--- a/WebCore/svg/SVGLineElement.cpp
+++ b/WebCore/svg/SVGLineElement.cpp
@@ -79,7 +79,7 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- if (SVGTests::handleAttributeChange(const_cast<SVGLineElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp
index e7cd6b5..8f8bef9 100644
--- a/WebCore/svg/SVGPathElement.cpp
+++ b/WebCore/svg/SVGPathElement.cpp
@@ -201,7 +201,7 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
{
SVGStyledTransformableElement::svgAttributeChanged(attrName);
- if (SVGTests::handleAttributeChange(const_cast<SVGPathElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp
index a750669..211dd58 100644
--- a/WebCore/svg/SVGPolyElement.cpp
+++ b/WebCore/svg/SVGPolyElement.cpp
@@ -66,7 +66,7 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName)
{
SVGStyledTransformableElement::svgAttributeChanged(attrName);
- if (SVGTests::handleAttributeChange(const_cast<SVGPolyElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
diff --git a/WebCore/svg/SVGRectElement.cpp b/WebCore/svg/SVGRectElement.cpp
index d7efdf4..c3ff3cb 100644
--- a/WebCore/svg/SVGRectElement.cpp
+++ b/WebCore/svg/SVGRectElement.cpp
@@ -94,7 +94,7 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- if (SVGTests::handleAttributeChange(const_cast<SVGRectElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index a9d5122..e90fba4 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -331,7 +331,7 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
updateRelativeLengthsInformation();
}
- if (SVGTests::handleAttributeChange(const_cast<SVGSVGElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
if (!renderer())
diff --git a/WebCore/svg/SVGTests.cpp b/WebCore/svg/SVGTests.cpp
index 87f9185..2b9cb14 100644
--- a/WebCore/svg/SVGTests.cpp
+++ b/WebCore/svg/SVGTests.cpp
@@ -95,17 +95,20 @@ bool SVGTests::isKnownAttribute(const QualifiedName& attrName)
return knownAttribute(attrName);
}
-bool SVGTests::handleAttributeChange(SVGElement* element, const QualifiedName& attrName)
+bool SVGTests::handleAttributeChange(const SVGElement* targetElement, const QualifiedName& attrName)
{
- if (knownAttribute(attrName)) {
- bool valid = element->isValid();
- if (valid && !element->attached() && element->inDocument())
- element->attach();
- if (!valid && element->attached())
- element->detach();
- return true;
- }
- return false;
+ if (!knownAttribute(attrName))
+ return false;
+ if (!targetElement->inDocument())
+ return false;
+ SVGElement* svgElement = const_cast<SVGElement*>(targetElement);
+ ASSERT(svgElement);
+ bool valid = svgElement->isValid();
+ if (valid && !svgElement->attached())
+ svgElement->attach();
+ if (!valid && svgElement->attached())
+ svgElement->detach();
+ return true;
}
}
diff --git a/WebCore/svg/SVGTests.h b/WebCore/svg/SVGTests.h
index f6801cb..8cba9d2 100644
--- a/WebCore/svg/SVGTests.h
+++ b/WebCore/svg/SVGTests.h
@@ -42,7 +42,7 @@ public:
bool parseMappedAttribute(Attribute*);
bool isKnownAttribute(const QualifiedName&);
- static bool handleAttributeChange(SVGElement*, const QualifiedName&);
+ static bool handleAttributeChange(const SVGElement*, const QualifiedName&);
protected:
SVGTests();
diff --git a/WebCore/svg/SVGTextContentElement.cpp b/WebCore/svg/SVGTextContentElement.cpp
index 20f78ad..0cbcc9a 100644
--- a/WebCore/svg/SVGTextContentElement.cpp
+++ b/WebCore/svg/SVGTextContentElement.cpp
@@ -205,7 +205,7 @@ void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName)
{
SVGStyledElement::svgAttributeChanged(attrName);
- if (SVGTests::handleAttributeChange(const_cast<SVGTextContentElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
// FIXME: also handle attribute changes for lengthAdjust and textLength
diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp
index 7781b8c..3fbc22e 100644
--- a/WebCore/svg/SVGUseElement.cpp
+++ b/WebCore/svg/SVGUseElement.cpp
@@ -143,7 +143,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
if (isXYAttribute || isWidthHeightAttribute)
updateRelativeLengthsInformation();
- if (SVGTests::handleAttributeChange(const_cast<SVGUseElement*>(this), attrName))
+ if (SVGTests::handleAttributeChange(this, attrName))
return;
RenderObject* object = renderer();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list