Closed Bug 1624061 Opened 5 years ago Closed 5 years ago

Consider joining intersecting outlines of inlines that span multiple lines.

Categories

(Core :: Web Painting, enhancement, P3)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 266122

People

(Reporter: emilio, Unassigned)

Details

(4 keywords, Whiteboard: [layout:backlog:quality])

Attachments

(1 file)

Attached file testcase (deleted) —

Consider the attached test-case.

In WebKit / Blink, it seems they join all the outline boxes first and then paint the outline path over it. Gecko paints a separate outline box for each inline, which causes overlap and so on.

I think WebKit's result is more desirable in this case. I don't know how easy this would be to implement though. Are there cases where the Gecko behavior would be preferable?

Attachment #9134840 - Attachment mime type: text/plain → text/html

https://drafts.csswg.org/css-ui-4/#propdef-outline seems to allow WebKit's behavior:

Outlines may be non-rectangular. For example, if the element is broken across several lines, the outline should be an outline or minimum set of outlines that encloses all the element’s boxes.

I assume that per this comment by roc in 2006 this is just not yet implemented, lol

We're the only browser that doesn't do this, as far as I can tell.

I was thinking of making an nsDisplayOutline just on the first continuation and make it responsible for drawing all the other outlines, but that seems that it may not play well with invalidation...

Matt, do we have a precedent for something like this?

Flags: needinfo?(matt.woodrow)

We do display item merging by putting them together in one temporary item1. Based on the comment, it seems this was also meant to be used by nsDisplayOutline. Merging happens at the display list iteration level, in FlattenedDisplayListIterator2.

This code is very messy because it previously required mutating the display items, which we cannot do with retained display lists. There is also a second problem with retained display lists: the display item ordering can change during display list merging, which means that we cannot rely on items staying consecutive (it should still be the common case). As it is, the code only works for container based display items.

Maybe this "grouping of display items" is better done during display list building or display list merging rather than painting?

(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)

I was thinking of making an nsDisplayOutline just on the first continuation and make it responsible for drawing all the other outlines, but that seems that it may not play well with invalidation...

I think this might be a good approach if the invalidation does not break.

This is really a duplicate of bug 266122.

I guessed there should be a bug for this, but I searched for "join" instead of "encompass" / "connect"... Thanks David! :)

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

Replied in bug 266122.

Flags: needinfo?(matt.woodrow)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: