Summary: | %-sizing of elements with a html parent is broken | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Joost de Valk (AlthA) <joost> | ||||||
Component: | SVG | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | Keywords: | HasReduction | ||||||
Priority: | P2 | ||||||||
Version: | 420+ | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Bug Depends on: | 12207 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Joost de Valk (AlthA)
2006-07-06 04:49:09 PDT
Created attachment 9224 [details]
testcase
Hum... shouldn't be hard to fix. Looking at the RenderTree debug window, it seems the <svg> is correctly sized to 200x200, but the item inside it is not. I expect this has to do with SVG doing all of its layout in the DOM tree instead of the render tree. The function which would need to change is: float SVGLength::PercentageOfViewport(float value, const SVGStyledElement* context, SVGLengthMode mode) } else if (viewportElement && viewportElement->isSVG()) { const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(viewportElement); if (svg->hasAttribute(SVGNames::viewBoxAttr)) { width = svg->viewBox().width(); height = svg->viewBox().height(); } else { width = svg->width().value(); height = svg->height().value(); } } Possibly that if should just check to see if the <svg> has a renderer() and if it does, use that width/height. Seems a little hacky however. Really SVG length resolution just needs to move entirely into the rendering tree. This is probably at least related to bug 5940 Created attachment 15025 [details]
First attempt
This should do it:)
Cheers,
Rob.
Comment on attachment 15025 [details]
First attempt
This looks fine. Since the change is in SVGLength, I wonder if now things like <div><svg:circle></div> will draw...
Landed in r 23530. |