Reviewed by darin. Landed by eseidel.
Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6930:
% width/height on nested <svg> tags do not work
Set the context correctly for inner <svg>, so calculation of
width/height for inner <svg> elements is done against the
viewport element.
Test: svg/custom/inner-percent.svg
* ksvg2/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::width):
(WebCore::SVGSVGElement::height):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13746
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-04-09 Rob Buis <buis@kde.org>
+
+ Reviewed by eseidel. Landed by eseidel.
+
+ - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6930
+ % width/height on nested <svg> tags do not work
+
+ * svg/custom/inner-percent-expected.txt: Added.
+ * svg/custom/inner-percent.svg: Added.
+
2006-04-08 Darin Adler <darin@apple.com>
Reviewed by Beth.
--- /dev/null
+16310588467cfc20d551635abc59b784
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+ KCanvasContainer {svg} at (0,0) size 100x100
+ KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
+ KCanvasContainer {svg} at (0,0) size 100x100
+ KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
--- /dev/null
+<svg xmlns='http://www.w3.org/2000/svg' width="200" height="200">
+<rect x="0" y="0" width="100" height="100" fill="red"/>
+<svg x="0" y="0" width="100%" height="100%" viewBox="0 0 200 200">
+<rect x="0" y="0" width="100" height="100" fill="green"/>
+</svg>
+</svg>
+2006-04-09 Rob Buis <buis@kde.org>
+
+ Reviewed by darin. Landed by eseidel.
+
+ Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6930:
+ % width/height on nested <svg> tags do not work
+
+ Set the context correctly for inner <svg>, so calculation of
+ width/height for inner <svg> elements is done against the
+ viewport element.
+
+ Test: svg/custom/inner-percent.svg
+
+ * ksvg2/svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::width):
+ (WebCore::SVGSVGElement::height):
+
2006-04-08 Rob Buis <buis@kde.org>
- Reviewed by eseidel.
+ Reviewed by eseidel. Landed by eseidel.
No automated test case possible.
if (!m_width) {
String temp("100%");
const SVGElement *viewport = ownerDocument()->documentElement() == this ? this : viewportElement();
- lazy_create<SVGAnimatedLength>(m_width, (SVGStyledElement *)0, LM_WIDTH, viewport);
+ lazy_create<SVGAnimatedLength>(m_width, (SVGStyledElement *)ownerDocument()->documentElement() == this ? 0 : this, LM_WIDTH, viewport);
m_width->baseVal()->setValueAsString(temp.impl());
}
if (!m_height) {
String temp("100%");
const SVGElement *viewport = ownerDocument()->documentElement() == this ? this : viewportElement();
- lazy_create<SVGAnimatedLength>(m_height, (SVGStyledElement *)0, LM_HEIGHT, viewport);
+ lazy_create<SVGAnimatedLength>(m_height, (SVGStyledElement *)ownerDocument()->documentElement() == this ? 0 : this, LM_HEIGHT, viewport);
m_height->baseVal()->setValueAsString(temp.impl());
}