haikuwebkit/LayoutTests/svg/overflow/overflow-on-outermost-svg-e...

18 lines
794 B
HTML
Raw Permalink Normal View History

2010-02-09 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. No scroll bars are displayed for standalone SVG image https://bugs.webkit.org/show_bug.cgi?id=11225 Height and width defined for svg element are not honored https://bugs.webkit.org/show_bug.cgi?id=24033 SVG file does not pan and has no scroll bars https://bugs.webkit.org/show_bug.cgi?id=24448 Adapt to SVG 1.1 errata to change the overflow handling: Replace "svg { overflow: hidden }" by "svg:not(:root) { overflow: hidden }" to allow standalone SVG documents to contain scrolllbars. Agreed by SVG WG to make this the default behaviour, already implemented by Opera & FireFox (partial support). Add new tests in svg/overflow covering all special SVG css overflow handling rules on inner/outer svg elements. Tests: svg/overflow/overflow-on-inner-svg-element-defaults.svg svg/overflow/overflow-on-inner-svg-element.svg svg/overflow/overflow-on-outermost-svg-element-defaults.svg svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-1.svg svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2.svg svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3.svg svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto.xhtml svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults.xhtml svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden.xhtml svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll.xhtml svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible.xhtml * css/svg.css: Change default <svg> overflow rule to only apply to inner <svg> elements. * page/FrameView.cpp: (WebCore::FrameView::layout): Only apply overflow rules for non-standalone SVG documents. * rendering/RenderSVGRoot.cpp: Remove all calls to isOverflowHidden - it's always the case for the outermost SVG element, see spec + errata. (WebCore::RenderSVGRoot::paint): Always clip to initial viewport size. (WebCore::RenderSVGRoot::computeRectForRepaint): Ditto. (WebCore::RenderSVGRoot::nodeAtPoint): Simplify. * rendering/RenderSVGViewportContainer.cpp: (WebCore::RenderSVGViewportContainer::applyViewportClip): Use isOverflowHidden() instead of a manual oveflow query and clip in float precision. * rendering/SVGRenderSupport.cpp: (WebCore::SVGRenderBase::isOverflowHidden): Simplify implementation, assure the function is not called anymore for RenderSVGRoot objects. Canonical link: https://commits.webkit.org/45864@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@54551 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-02-09 16:08:18 +00:00
<!--
Verify default overflow rules for the outermost <svg> element in non-standalone documents.
You should see a 400x400 green rectangle, not covering the whole screen size.
Spec reference:
When an outermost 'svg' element is embedded inline within a parent XML grammar which uses CSS layout [CSS2-LAYOUT]
or XSL formatting [XSL], if the 'overflow' property has the value hidden or scroll, then the user agent will establish
an initial clipping path equal to the bounds of the initial viewport; otherwise, the initial clipping path is set
according to the clipping rules as defined in [CSS2-overflow].
-->
<html>
<body>
<svg xmlns="http://www.w3.org/2000/svg" style="overflow: hidden" width="400" height="400">
<rect width="4000" height="4000" fill="green"/>
</svg>
</body>
</html>