W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2020

[csswg-drafts] [css-pseudo-4] May selection highlight on an inline replaced element extend to line box edges? (#5395)

From: Xiaocheng Hu via GitHub <sysbot+gh@w3.org>
Date: Tue, 04 Aug 2020 23:10:08 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-673139179-1596582606-sysbot+gh@w3.org>
xiaochengh has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-pseudo-4] May selection highlight on an inline replaced element extend to line box edges? ==
Consider the following HTML
```
<div>some <img> and text</div>
```

When selecting a line with both text and image, different browsers paint different highlight overlays on the image:
- Chrome & Safari: The overlay vertically extends to line box top and bottom
- Firefox: The overlay is the image border box

<img width="870" alt="Screen Shot 2020-08-04 at 4 08 30 PM" src="https://user-images.githubusercontent.com/19384155/89354091-c64d7b00-d66c-11ea-8f9e-a92bdc28688b.png">

The [current spec](https://www.w3.org/TR/css-pseudo-4/#highlight-bounds) says "The overlay may also include other other areas within the border-box of an element", in which case FF seems the most spec compliant. However, it doesn't explicit disallow extending beyond the border box, though.

Besides, when we have both text and replaced elements in the same line, Chrome/Safari's selection highlight look good in the sense that it doesn't "break" at the replaced elements.

Note: We have a WPT css/css-pseudo/active-selection-043.html, which asserts FF's behavior (@TalbotG)


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5395 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 4 August 2020 23:10:10 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:13 UTC