Closed
Bug 1375114
Opened 8 years ago
Closed 8 years ago
Text appear selected when switching from display:none to display:block
Categories
(Core :: DOM: Selection, enhancement, P3)
Core
DOM: Selection
Tracking
()
RESOLVED
FIXED
mozilla59
People
(Reporter: flyingrub, Assigned: MatsPalmgren_bugz)
Details
Attachments
(1 file)
|
2.38 KB,
patch
|
chutten
:
review+
|
Details | Diff | Splinter Review |
The text of the subcategory is selected when we switch display: none to display: block. We change it with a css rules if the parent has a special class.
What we tried to fix it :
* Add preventDefault in the click listener
* Wrap the classList.add in a setTimeout()
* If we comment the display none in css no text is selected when adding the class
Current Fix : document.getSelection().empty(); just after the add of the class.
Bug introduced here : https://bugzilla.mozilla.org/show_bug.cgi?id=1370513
My build is rather up-to-date with central and I forgot to mention that this bug is located in about:telemetry.
The source file of about:telemetry are located there : toolkit/content/aboutTelemetry.*
| Assignee | ||
Comment 2•8 years ago
|
||
What are the steps to reproduce the problem?
Component: CSS Parsing and Computation → Selection
Flags: needinfo?(flyinggrub)
Steps to reproduce :
1) Build firefox with this patch : https://reviewboard.mozilla.org/r/146220/
3) Look for the bug number 1375114 and comment the line below
2) Go to about:telemetry and click on the Environment Data section
The text of the subsection should appear selected.
Flags: needinfo?(flyinggrub)
Updated•8 years ago
|
Priority: -- → P3
Updated•8 years ago
|
status-firefox57:
--- → wontfix
| Assignee | ||
Comment 4•8 years ago
|
||
I haven't debugged in detail what happens during the event
handling here but I'm guessing that when a click occurs on
a section header the selection is collapsed to some node there.
Then aboutTelemetry.js handles the event by inserting
new content (the subsections) which somehow ends up inside
that collapsed selection. That might actually be the correct
handling per spec depending on the exact details.
Anyway, there's a simpler way to workaround for this than
manually resetting the selection from script: just disable
selection entirely in the navigation panel.
That's what you want, right?
Attachment #8924379 -
Flags: review?(flyingrub)
Did you tried this fix?
If i remember correctly I already tried to add -moz-user-select: none but it didn't prevent the selection. :/
| Assignee | ||
Comment 6•8 years ago
|
||
Yeah, it works for me in a local build on Linux.
My laptop just died so I don't have any way to test your patch...
:chutten could you take a look ?
Flags: needinfo?(chutten)
Attachment #8924379 -
Flags: review?(flyingrub)
Comment 9•8 years ago
|
||
I'm in transit due to Quantum Launch, but I'm hopeful about this fix. I'll leave the ni? to remind me to try this tomorrow, unless someone else can get to it first...?
Assignee: nobody → mats
Status: NEW → ASSIGNED
Comment 10•8 years ago
|
||
Comment on attachment 8924379 [details] [diff] [review]
fix?
Review of attachment 8924379 [details] [diff] [review]:
-----------------------------------------------------------------
This seems to take care of it in my build
Attachment #8924379 -
Flags: review+
Updated•8 years ago
|
Flags: needinfo?(chutten)
Updated•8 years ago
|
Flags: needinfo?(flyingrub)
Comment 11•8 years ago
|
||
It seems as though :flyingrub is busy elsewhere. :mats, shall we set this to checkin?
Flags: needinfo?(flyingrub)
Updated•8 years ago
|
Flags: needinfo?(mats)
Comment 13•8 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/56f0c8ff41a0
Disable selection entirely in the #categories navigation panel. r=chutten
Keywords: checkin-needed
Comment 14•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
| Reporter | ||
Comment 15•8 years ago
|
||
Just to say I tested it without moz-user-select: none; and it does not select the text anymore.
You need to log in
before you can comment on or make changes to this bug.
Description
•