I’m also excited to see this feature ship, as it’s pretty relevant to our work at Igalia, but I feel I must share and expand on Florian’s concerns about our current behaviour.
On Wednesday, August 18, 2021 at 12:27:04 AM UTC+8 Daniel Clark wrote: > Our thinking on this is that this first version of the Highlight API is > mainly useful for scenarios like custom find-on-page where highlights use > simple formatting (like background-color and color), and overlapping > highlight ranges are not common. So, we don’t expect the discrepancies > between the Chromium implementation and the highlight pseudos specs to be a > big issue. For example, many of these longstanding highlight painting > issues exist with the browser’s current find-on-page implementation, but in > practice they are minimally disruptive. […] Thus I’m hesitant to conclude > that this reworking of the highlight painting code should be a blocker for > shipping the API. Note that it’s not just paint that’s broken, but style too, primarily because we don’t yet impl highlight inheritance. Also, surely even the proposed subset of background-color and color would have uses beyond find-on-page, like multiple selections for online collaboration? It’s one thing to ship with missing features that we can easily add later (such as text-decoration support, more or less), or with bugs of minor consequence (such as <https://crbug.com/1179938>). But do we really want to be the first engine to ship this feature, with an impl that’s broken under the spec’s very first example [0][1], color on ligature-heavy scripts (despite working in ::selection) [2], and even ancient features like ::first-letter [3]? Each of these bugs, if shipped and fixed later, has some impact — however small — on things like compat, author confidence, and even tutorial content. For example, strictly speaking, impl’ing highlight inheritance will break what [4] has to say about text-shadow. Fixing them after the fact in ::selection (currently a separate impl) has proven painful, because chipping away at a big problem over multiple patches has caused regressions [5]. I think it was a mistake for Blink to ship ::target-text in this kind of state, and given the wider range of use cases that ::highlight aims to solve, I think it would be at least as much of a mistake here. [0] https://drafts.csswg.org/css-highlight-api-1/#intro-ex [1] https://bucket.daz.cat/work/igalia/1/1.html [2] https://bucket.daz.cat/work/igalia/1/2.html [3] https://bucket.daz.cat/work/igalia/1/3.html [4] https://css-tricks.com/almanac/selectors/s/selection/ [5] https://crrev.com/c/2925295 Cheers, Delan Azabani Igalia // web platform -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/9420eb48-1c02-4c47-af02-bf932be55c05n%40chromium.org.
