Reviewed by Darin Adler.
Check SVG element type in FrameView::scrollToAnchor
https://bugs.webkit.org/show_bug.cgi?id=51718
Test: svg/custom/scroll-to-anchor-in-symbol.svg
* page/FrameView.cpp:
(WebCore::FrameView::scrollToAnchor):
2010-12-29 Justin Schuh <jschuh@chromium.org>
Reviewed by Darin Adler.
Check SVG element type in FrameView::scrollToAnchor
https://bugs.webkit.org/show_bug.cgi?id=51718
* svg/custom/scroll-to-anchor-in-symbol-expected.txt: Added.
* svg/custom/scroll-to-anchor-in-symbol.svg: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74779
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2010-12-29 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Check SVG element type in FrameView::scrollToAnchor
+ https://bugs.webkit.org/show_bug.cgi?id=51718
+
+ * svg/custom/scroll-to-anchor-in-symbol-expected.txt: Added.
+ * svg/custom/scroll-to-anchor-in-symbol.svg: Added.
+
2010-12-29 Zhenyao Mo <zmo@google.com>
Reviewed by Eric Seidel.
--- /dev/null
+PASS: Navigating to symbol did not crash.
--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg"> \r
+ <script>\r
+ if (window.layoutTestController) {\r
+ layoutTestController.dumpAsText();\r
+ layoutTestController.waitUntilDone();\r
+ }\r
+ window.onload = function () {\r
+ location.hash = 'v1';\r
+ setTimeout(function(){\r
+ document.getElementById("t1").appendChild(document.createTextNode("PASS: Navigating to symbol did not crash."));\r
+ if (window.layoutTestController)\r
+ layoutTestController.notifyDone();\r
+ }, 0);\r
+ }\r
+ </script>\r
+ <symbol><view id="v1"/></symbol>\r
+ <text x="20" y="20" fill="green" id="t1"></text>\r
+</svg>\r
+2010-12-29 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Check SVG element type in FrameView::scrollToAnchor
+ https://bugs.webkit.org/show_bug.cgi?id=51718
+
+ Test: svg/custom/scroll-to-anchor-in-symbol.svg
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollToAnchor):
+
2010-12-29 Anton Muhin <antonm@chromium.org>
Reviewed by Eric Seidel.
if (anchorNode && anchorNode->hasTagName(SVGNames::viewTag)) {
RefPtr<SVGViewElement> viewElement = anchorNode->hasTagName(SVGNames::viewTag) ? static_cast<SVGViewElement*>(anchorNode) : 0;
if (viewElement.get()) {
- RefPtr<SVGSVGElement> svg = static_cast<SVGSVGElement*>(SVGLocatable::nearestViewportElement(viewElement.get()));
- svg->inheritViewAttributes(viewElement.get());
+ SVGElement* element = SVGLocatable::nearestViewportElement(viewElement.get());
+ if (element->hasTagName(SVGNames::svgTag)) {
+ RefPtr<SVGSVGElement> svg = static_cast<SVGSVGElement*>(element);
+ svg->inheritViewAttributes(viewElement.get());
+ }
}
}
}