Title: [124733] trunk
- Revision
- 124733
- Author
- [email protected]
- Date
- 2012-08-05 23:31:39 -0700 (Sun, 05 Aug 2012)
Log Message
Fix assertion during detach of SVG wrappers without baseVal
https://bugs.webkit.org/show_bug.cgi?id=93063
Reviewed by Nikolas Zimmermann.
Source/WebCore:
r131583 introduced a change where SVGAnimatedListPropertyTearOff required
a baseVal to be set before detaching wrappers. This caused an assertion
to be hit if no baseVal was set.
This patch changes this behavior so that wrappers are detached even if
no baseVal is set.
Test: svg/animations/dynamic-modify-transform-without-baseval.html
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::detachListWrappers):
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::detachListWrappersAndResize): Extracted this static method for detaching wrappers without needing an SVGListProperty.
(SVGListProperty):
(WebCore::SVGListProperty::detachListWrappers):
LayoutTests:
* svg/animations/dynamic-modify-transform-without-baseval-expected.txt: Added.
* svg/animations/dynamic-modify-transform-without-baseval.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (124732 => 124733)
--- trunk/LayoutTests/ChangeLog 2012-08-06 06:09:14 UTC (rev 124732)
+++ trunk/LayoutTests/ChangeLog 2012-08-06 06:31:39 UTC (rev 124733)
@@ -1,3 +1,13 @@
+2012-08-05 Philip Rogers <[email protected]>
+
+ Fix assertion during detach of SVG wrappers without baseVal
+ https://bugs.webkit.org/show_bug.cgi?id=93063
+
+ Reviewed by Nikolas Zimmermann.
+
+ * svg/animations/dynamic-modify-transform-without-baseval-expected.txt: Added.
+ * svg/animations/dynamic-modify-transform-without-baseval.html: Added.
+
2012-08-05 Yoshifumi Inoue <[email protected]>
[chromium] fast/forms/focus2.html fails
Added: trunk/LayoutTests/svg/animations/dynamic-modify-transform-without-baseval-expected.txt (0 => 124733)
--- trunk/LayoutTests/svg/animations/dynamic-modify-transform-without-baseval-expected.txt (rev 0)
+++ trunk/LayoutTests/svg/animations/dynamic-modify-transform-without-baseval-expected.txt 2012-08-06 06:31:39 UTC (rev 124733)
@@ -0,0 +1 @@
+This test passes if no assert is hit and PASS is printed: PASS.
Added: trunk/LayoutTests/svg/animations/dynamic-modify-transform-without-baseval.html (0 => 124733)
--- trunk/LayoutTests/svg/animations/dynamic-modify-transform-without-baseval.html (rev 0)
+++ trunk/LayoutTests/svg/animations/dynamic-modify-transform-without-baseval.html 2012-08-06 06:31:39 UTC (rev 124733)
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html>
+<!-- Test for WK93063: This test passes if no assert is hit and PASS is printed. -->
+<svg id="root" xmlns="http://www.w3.org/2000/svg">
+ <rect id="rect">
+ <animateTransform attributeName="transform" dur="2s"/>
+ </rect>
+<script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ var rect = document.getElementById('rect');
+ setTimeout("changeTransform()", 1);
+
+ function changeTransform() {
+ rect.setAttribute("transform", "scale(1)");
+ document.getElementById("root").setCurrentTime(1);
+ document.write("This test passes if no assert is hit and PASS is printed: PASS.");
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+</script>
+</svg>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (124732 => 124733)
--- trunk/Source/WebCore/ChangeLog 2012-08-06 06:09:14 UTC (rev 124732)
+++ trunk/Source/WebCore/ChangeLog 2012-08-06 06:31:39 UTC (rev 124733)
@@ -1,3 +1,25 @@
+2012-08-05 Philip Rogers <[email protected]>
+
+ Fix assertion during detach of SVG wrappers without baseVal
+ https://bugs.webkit.org/show_bug.cgi?id=93063
+
+ Reviewed by Nikolas Zimmermann.
+
+ r131583 introduced a change where SVGAnimatedListPropertyTearOff required
+ a baseVal to be set before detaching wrappers. This caused an assertion
+ to be hit if no baseVal was set.
+ This patch changes this behavior so that wrappers are detached even if
+ no baseVal is set.
+
+ Test: svg/animations/dynamic-modify-transform-without-baseval.html
+
+ * svg/properties/SVGAnimatedListPropertyTearOff.h:
+ (WebCore::SVGAnimatedListPropertyTearOff::detachListWrappers):
+ * svg/properties/SVGListProperty.h:
+ (WebCore::SVGListProperty::detachListWrappersAndResize): Extracted this static method for detaching wrappers without needing an SVGListProperty.
+ (SVGListProperty):
+ (WebCore::SVGListProperty::detachListWrappers):
+
2012-08-05 Kihong Kwon <[email protected]>
Remove DeviceMotionEvent.h and DeviceOrientationEvent.h from Document.cpp
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h (124732 => 124733)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h 2012-08-06 06:09:14 UTC (rev 124732)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h 2012-08-06 06:31:39 UTC (rev 124733)
@@ -66,8 +66,7 @@
void detachListWrappers(unsigned newListSize)
{
- if (m_baseVal)
- static_cast<ListProperty*>(m_baseVal.get())->detachListWrappers(newListSize);
+ ListProperty::detachListWrappersAndResize(&m_wrappers, newListSize);
}
PropertyType& currentAnimatedValue()
Modified: trunk/Source/WebCore/svg/properties/SVGListProperty.h (124732 => 124733)
--- trunk/Source/WebCore/svg/properties/SVGListProperty.h 2012-08-06 06:09:14 UTC (rev 124732)
+++ trunk/Source/WebCore/svg/properties/SVGListProperty.h 2012-08-06 06:31:39 UTC (rev 124733)
@@ -52,23 +52,28 @@
return true;
}
- void detachListWrappers(unsigned newListSize)
+ static void detachListWrappersAndResize(ListWrapperCache* wrappers, unsigned newListSize = 0)
{
- // See SVGPropertyTearOff::detachWrapper() for an explaination what's happening here.
- ASSERT(m_wrappers);
- unsigned size = m_wrappers->size();
+ // See SVGPropertyTearOff::detachWrapper() for an explanation about what's happening here.
+ ASSERT(wrappers);
+ unsigned size = wrappers->size();
for (unsigned i = 0; i < size; ++i) {
- if (ListItemTearOff* item = m_wrappers->at(i).get())
+ if (ListItemTearOff* item = wrappers->at(i).get())
item->detachWrapper();
}
// Reinitialize the wrapper cache to be equal to the new values size, after the XML DOM changed the list.
if (newListSize)
- m_wrappers->fill(0, newListSize);
+ wrappers->fill(0, newListSize);
else
- m_wrappers->clear();
+ wrappers->clear();
}
+ void detachListWrappers(unsigned newListSize)
+ {
+ detachListWrappersAndResize(m_wrappers, newListSize);
+ }
+
void setValuesAndWrappers(PropertyType* values, ListWrapperCache* wrappers, bool shouldOwnValues)
{
// This is only used for animVal support, to switch the underlying values & wrappers
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes