Painting link highlights as part of the document

20 views
Skip to first unread message

Chris Harrelson

unread,
Jul 13, 2015, 4:21:15 PM7/13/15
to pain...@chromium.org, Tien-Ren Chen, Alexandre Elias
Right now, link highlights are painted as their own special compositing layer that is separate from the other ones and paints on top. It would be nice if we could stop doing that, and instead treat link highlight like focus rings and paint them in the appropriate phase of the regular painting algorithm. I think the main/only downside of this change would be that link highlights would sometimes be clipped by containing content. But unsure when that matters or is a better UX.

Alex/Tien-Ren, what do you think? I don't have as much context on the use cases for this feature as you.

Thanks,
Chris

Tien-Ren Chen

unread,
Jul 13, 2015, 4:34:19 PM7/13/15
to Chris Harrelson, pain...@chromium.org, Alexandre Elias
My personal opinion is that ideally we should do those by the style
system similar to how :hover works.

However if I remember correctly, it is implemented the current way
because we do want to avoid style update and re-rastering of the
original contents. Also I think it is faster to do fade-out animation
when they have exclusive compositing layers.

I'm happy to implement either way and I think it is up to the UI
designer to decide what is the preferred behavior.
> --
> You received this message because you are subscribed to the Google Groups
> "paint-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to paint-dev+...@chromium.org.
> To post to this group, send email to pain...@chromium.org.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/paint-dev/CAOMQ%2Bw9ExDe%3D3JZffUp%2BiaZDB8ScmwU90%2BhyT2XD0z14wjtC9g%40mail.gmail.com.

Stephen Chenney

unread,
Jul 13, 2015, 4:37:36 PM7/13/15
to Tien-Ren Chen, Chris Harrelson, pain...@chromium.org, Alexandre Elias
Here's the bug where I broke link highlighting.


The only real bug feedback as to why it's important is related to the non-obviousness of the loading bar in the Chrome UI, so it's sometimes hard to see what's happening after you think you clicked on a link.

Stephen.

Dana Jansens

unread,
Jul 13, 2015, 4:42:07 PM7/13/15
to Stephen Chenney, Tien-Ren Chen, Chris Harrelson, pain...@chromium.org, Alexandre Elias
On Mon, Jul 13, 2015 at 1:37 PM, Stephen Chenney <sche...@chromium.org> wrote:
Here's the bug where I broke link highlighting.


The only real bug feedback as to why it's important is related to the non-obviousness of the loading bar in the Chrome UI, so it's sometimes hard to see what's happening after you think you clicked on a link.

It's also hard to see which link you hit under your finger without some feedback?
 

Alexandre Elias

unread,
Jul 13, 2015, 4:46:05 PM7/13/15
to Stephen Chenney, Tien-Ren Chen, Chris Harrelson, pain...@chromium.org
Right, the main reason for the current implementation is performance.  The full paint path was too slow for something that's supposed to immediately respond to touch, particularly in cases of  large link highlights, such as large boxes containing an image.  We also used to have a fade-out animation that would've been particularly impossible to reraster at a good framerate, although that's been broken for a while now and I'm not sure it's very important to bring back.  I don't particularly care about details of clipping behavior.

With all the recent improvements to paint performance, I agree it's a good time to change this to resemble the selection highlight implementation to avoid the code complexity.

On Mon, Jul 13, 2015 at 1:37 PM, Stephen Chenney <sche...@chromium.org> wrote:

Xianzhu Wang

unread,
Jul 13, 2015, 5:07:59 PM7/13/15
to Alexandre Elias, Stephen Chenney, Tien-Ren Chen, Chris Harrelson, pain...@chromium.org
Currently paint invalidation in slimming-paint is per object. I think if we could invalidate in smaller pieces (e.g. per paint phase), then we could repaint link highlights without repainting the whole underlying object. Cc layerization could also allocate a layer for the link highlight display item.

(BTW this would also allow us to invalidate less display items on style change, for example, to invalidate only the background when the background style of an object changes.)

Xianzhu Wang

unread,
Jul 13, 2015, 5:12:04 PM7/13/15
to Alexandre Elias, Stephen Chenney, Tien-Ren Chen, Chris Harrelson, pain...@chromium.org
Actually we don't need smaller invalidation pieces for link highlights. We just need to let the link highlight's DisplayItem use a dedicated DisplayItemClient other than the link object.

Chris Harrelson

unread,
Jul 15, 2015, 11:17:57 AM7/15/15
to Xianzhu Wang, Alexandre Elias, Stephen Chenney, Tien-Ren Chen, pain...@chromium.org
Cool. I filed crbug.com/510456 to track this. I also marked as blocking Slimming Paint phase 2, since otherwise we would need substantial one-off code to support the equivalent of the old code.

Ian Vollick

unread,
Jul 15, 2015, 11:45:54 AM7/15/15
to Chris Harrelson, Xianzhu Wang, W. James MacLean, Alexandre Elias, Stephen Chenney, Tien-Ren Chen, pain...@chromium.org
Reply all
Reply to author
Forward
0 new messages