Introduce toSVGRadialGradientElement(), and use it
https://bugs.webkit.org/show_bug.cgi?id=120153

Reviewed by Andreas Kling.

As a step to clean-up static_cast<SVGXXX>, toSVGRadialGradientElement() is added to clean-up
static_cast<SVGRadialGradientElement*>.

* rendering/svg/RenderSVGResourceRadialGradient.cpp:
(WebCore::RenderSVGResourceRadialGradient::collectGradientAttributes):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGResourceContainer):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGRadialGradientElement.h:
(WebCore::toSVGRadialGradientElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: Assertion failure !collection->hasExactlyOneItem() in WebCore::namedItemGetter
https://bugs.webkit.org/show_bug.cgi?id=118056

Reviewed by Ryosuke Niwa.

Source/WebCore:

The assert is hit in Debug mode because the DocumentOrderedMap in HTMLDocument::m_windowNamedItem
includes matched SVG elements, but the WindowNameCollection used to collect the elements does not.
This means the HTMLCollection stripped of SVG elements could end up hitting the empty or single item
assertion, which the testcase verifies.
To fix this change WindowNameCollection to include both SVG and HTML elements so it matches DocumentOrderedMap.

Tests: svg/custom/document-all-includes-svg.html
       svg/custom/window-named-item-lookup.html

* html/HTMLCollection.cpp:
(WebCore::isMatchingElement):
(WebCore::HTMLCollection::updateNameCache):

LayoutTests:

Add test to verify that SVG and HTML elements with id's are both found when using document.all or named properties.

* svg/custom/document-all-includes-svg-expected.txt: Added.
* svg/custom/document-all-includes-svg.html: Added.
* svg/custom/window-named-item-lookup-expected.txt: Added.
* svg/custom/window-named-item-lookup.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154441 268f45cc-cd09-0410-ab3c-d52691b4dbfc