Summary: | Relative-height block SVG root not layed out on container height change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Florin Malita <fmalita> | ||||||||
Component: | SVG | Assignee: | Florin Malita <fmalita> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | webkit.review.bot, zimmermann | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Florin Malita
2012-03-19 08:51:00 PDT
Created attachment 132589 [details]
The SVG element doesn't get adjusted on container height change.
Created attachment 132593 [details]
Patch
Comment on attachment 132593 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=132593&action=review r=me, with some small nitpicks: > Source/WebCore/rendering/RenderBox.cpp:4032 > + RenderStyle* s = style(); You don't need to introduce style() local vars, its inlined. > Source/WebCore/rendering/RenderBox.cpp:4040 > + RenderStyle* s = style(); Ditto. > Source/WebCore/rendering/RenderView.cpp:120 > + // FIXME: can RenderView have non-RenderBox children to justify keeping the explicit style checks below? Can you try this, running regression tests with this fixed, and see if something changes? Ideally before you land this, even if I set r+ :-) > Source/WebCore/rendering/svg/RenderSVGRoot.cpp:428 > + return svg->intrinsicWidth(SVGSVGElement::IgnoreCSSProperties).isPercent() || RenderSVGRoot::hasRelativeLogicalHeight(); I'd leave this as-is to save a virtual function call. Created attachment 132655 [details]
Patch
updated patch
(In reply to comment #3) > > Source/WebCore/rendering/RenderBox.cpp:4032 > > + RenderStyle* s = style(); > > You don't need to introduce style() local vars, its inlined. Done. > > Source/WebCore/rendering/RenderBox.cpp:4040 > > + RenderStyle* s = style(); > > Ditto. Done. > > Source/WebCore/rendering/RenderView.cpp:120 > > + // FIXME: can RenderView have non-RenderBox children to justify keeping the explicit style checks below? > > Can you try this, running regression tests with this fixed, and see if something changes? Ideally before you land this, even if I set r+ :-) Tried it (assuming child->isBox() == true), and it doesn't seem to introduce any regressions. But then I found this snippet in FrameView::embeddedContentBox() which seems to indicate that it's still possible for RenderView to have non-RenderBox children: RenderView* root = rootRenderer(this); if (!root) return 0; RenderObject* rootChild = root->firstChild(); if (!rootChild || !rootChild->isBox()) return 0; So the isBox() check is probably warranted and I will leave it in unless you think otherwise. > > Source/WebCore/rendering/svg/RenderSVGRoot.cpp:428 > > + return svg->intrinsicWidth(SVGSVGElement::IgnoreCSSProperties).isPercent() || RenderSVGRoot::hasRelativeLogicalHeight(); > > I'd leave this as-is to save a virtual function call. Hmm, I don't think that it would trigger a virtual dispatch because it's class-qualified. Nevertheless, it's probably not be worth the extra call so I've reverted it. Comment on attachment 132655 [details]
Patch
Looks good for me. Since Niko already gave r+ and the concerns seems to be addressed (correct me if I am wrong), r=me from me as well.
Comment on attachment 132655 [details] Patch Clearing flags on attachment: 132655 Committed r111279: <http://trac.webkit.org/changeset/111279> All reviewed patches have been landed. Closing bug. |