CSS clip-path clips keyboard caret on Gecko but not on Blink/WebKit
Categories
(Core :: Layout, defect)
Tracking
()
People
(Reporter: saschanaz, Assigned: emilio)
References
Details
Attachments
(4 files)
- Open the attachment
- See the caret is clipped by clip-path. (It becomes smaller or even invisible inside "bar".)
This currently affects Twitter where emojis use clip-path: circle(0% at center center);
which causes carets completely invisible. No such effect on WebKit/Blink.
Reporter | ||
Comment 1•4 years ago
|
||
Reporter | ||
Comment 2•4 years ago
|
||
Emilio, do you mind taking a look? Thanks!
Assignee | ||
Comment 3•4 years ago
|
||
So our behavior here seems pretty reasonable, off-hand. We treat the caret as a normal item in the flow.
Seems like other browsers paint the caret to the containing block. That sounds a bit sketchy because it may not account for transforms and other things in inlines... But maybe it's fine.
Assignee | ||
Comment 4•4 years ago
|
||
This matches other browsers and shouldn't be too terrible, though I'm
not a terrible fan of it.
Assignee | ||
Comment 5•4 years ago
|
||
The patch above needs tests and a try run but seems to work. Btw, I just looked this up afterwards, but this is the relevant Chromium code I think... https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/caret_display_item_client.cc;l=55-69;drc=36c0310725bd6a03de6c11dae1d4986e7e64bb18
Kagami, do you know how Safari behaves? I think our current behavior is not bad, Chrome's feels a bit odd to me and maybe we should just reach out to Twitter.
Reporter | ||
Comment 6•4 years ago
•
|
||
I don't have Safari access but WebKit Windows build behaves same as Blink does. I agree that it's odd though.
Assignee | ||
Comment 7•4 years ago
|
||
Mats, Masauki, you're familiar with the caret stuff, do you have a strong opinion here?
From point of view of a11y, caret shouldn't be clipped except by the viewport because it's line mouse cursor for users who use caret browsing mode (I don't know how much users use it). On the other hand, caret is representation of a collapsed selection range. Therefore, clipped as same as non-collapsed selection could be consistent behavior in theory. But I don't have strong opinion, just random thoughts.
From point of view of a11y, caret shouldn't be clipped except by the viewport because it's line mouse cursor for users who use caret browsing mode (I don't know how much users use it).
Well, but if caret is in invisible element, e.g., transparent <textarea>
, it could break backward compatibility.
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 10•4 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5dd5f0d3a09b Paint caret geometry from the containing block. r=mats
Comment 11•4 years ago
|
||
Backout by nbeleuzu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ecffe880103c Backed out changeset 5dd5f0d3a09b for mochitest failure on test_reftests_with_caret.html CLOSED TREE
Comment 12•4 years ago
|
||
Backed out for mochitest failure on test_reftests_with_caret.html
Backout link: https://hg.mozilla.org/integration/autoland/rev/ecffe880103c7e279d2909f63fd93739376d70d2
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=317702481&repo=autoland&lineNumber=4656
Reporter | ||
Comment 15•3 years ago
|
||
Do we have some blockers here or the it's just the test to be updated?
Assignee | ||
Comment 16•3 years ago
|
||
I don't recall what the test failure was, but no, the patch should be fine, I'll try to re-land it.
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 17•3 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ccc6e271d9db Paint caret geometry from the containing block. r=mats
Comment 18•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Comment 19•2 years ago
|
||
I managed to reproduce this bug on Firefox 89.0(20210527174632) on Win10 64-bits; Confirmed as fixed on Firefox 99.0(20220328190900) and Nightly 100.a1(20220403215202) on Win 10 64-bits, MacOS 10.15 and Linux x86_64(Ubuntu 20.04).
Description
•