[Webkit-unassigned] [Bug 113666] SVG outline property is broken and inefficient

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 1 08:16:04 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=113666





--- Comment #1 from Florin Malita <fmalita at chromium.org>  2013-04-01 08:14:15 PST ---
(In reply to comment #0)
> Created an attachment (id=195909)
 --> (https://bugs.webkit.org/attachment.cgi?id=195909&action=review) [details]
> Outline testcase
> 
> WebKit is the only rendering engine that supports outlines on SVG elements:
> <rect x="0" y="0" width="100" height="300" style="outline: 1px solid #000"/>
> 
> Furthermore, our implementation is broken as we paint outlines in a separate paintphase so they always render on top of other siblings (see attached: outlineTest.html).

Strange as this may sound, I believe we are technically in compliance:

1) the spec seems to intentionally avoid describing the behavior in the presence of overlapping (http://www.w3.org/TR/CSS2/ui.html#propdef-outline):

"This specification does not define how multiple overlapping outlines are drawn, or how outlines are drawn for boxes that are partially obscured behind other elements."

2) the stacking context guidelines *encourage* implementations to draw the outline in a separate, last paint phase(http://www.w3.org/TR/CSS21/zindex.html):

"10. Finally, implementations that do not draw outlines in steps above must draw outlines from this stacking context at this stage. (It is recommended to draw outlines in this step and not in the steps above.)"

3) it follows that since SVG does not create any new stacking contexts (except for FOs), its outlines will indeed be drawn at the very end.

Now whether or not this behavior actually makes sense is a different discussion :)

> Note: Presto does this for HTML divs as well, whereas WebKit, Gecko, and Trident all render HTML div outlines below a later sibling's background.

I think that's actually a side effect of using separate layers and compositing for positioned elements more than an actual intent. RenderLayer::paintLayerContents() performs the expected recursive paint phases (paintOutlineForFragments() being the last) so there's no specific effort to correctly interleave outlines.

> Do we even want to support outlines? In supporting it we are making two passes over the render tree which includes a matrix multiply at each node!

It seems like a useful feature and it should be trivial to simply draw outlines during the foreground phase, no? If we all agree that it's the desired SVG behavior, that is.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list