Closed Bug 1558942 Opened 6 years ago Closed 6 years ago

Stop using generated content for line numbers in favor of user-select: none/-moz-user-select:none

Categories

(Webtools :: Searchfox, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: asuth, Assigned: asuth)

References

Details

In my changes in bug 1511275 I hadn't realized that Gecko hadn't unprefixed "-moz-user-select" so when I prototyped the DOM changes I thought we needed to use generated content to avoid including line numbers when copying and pasting multiple lines of source code. Happily I was wrong.

My plan is to:

  • Remove the CSS .line-number::before selector that does content: attr(data-line-number).
  • Put the line number as explicit content inside the div, like it was previously and stop generating the data-line-number attribute which was introduced in bug 1511275.
    • This requires small changes to code-highlighter.js. It's cool to be able to do dataset.lineNumber in the JS code, but we already have to parseInt() it and given that the accessibility tree generation for ActorsParent.cpp locks up the browser for longer than I'm ever willing to wait, it can't hurt to keep the DOM svelte when possible.
  • Put all the prefixed "user-select" variants on .line-number back in place. And solemnly swear to always check caniuse.com rather than assuming all prefixed CSS has been abolished.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Regressions: 1616104
You need to log in before you can comment on or make changes to this bug.