Open
Bug 1360238
Opened 8 years ago
Updated 2 years ago
window.getSelection().toString() displays extra "\n" characters on multiple block elements, even if they are display:inline
Categories
(Core :: DOM: Serializers, defect, P3)
Tracking
()
People
(Reporter: stylizit, Unassigned)
References
()
Details
(Whiteboard: [webcompat][needs-wpt-?])
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
Steps to reproduce:
1) Open the url :
data:text/html;charset=utf-8,<div style%3D"display%3Ainline%3B">this is<%2Fdiv><div style%3D"display%3Ainline%3B">on the same line<%2Fdiv>
2) Right-click on the text in the page and click "Select all"
3) Open Devtools and go to the Console tab
4) Run window.getSelection().toString()
Actual results:
Output returned:
"this is
on the same line"
Expected results:
Output should be:
"this ison the same line"
Updated•8 years ago
|
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Reporter | ||
Comment 1•8 years ago
|
||
Note that Firefox doesn't add an extra "\n" character for the below url
data:text/html;charset=utf-8,<span style%3D"display%3Ainline%3B">this is<%2Fspan><span style%3D"display%3Ainline%3B">on the same line<%2Fspan>
so this seems to happen (presumably) only on block elements.
Safari 10.0.3 & Chrome 57.0.2987.133 both display the selected text correctly (without the extra "\n" character).
Updated•8 years ago
|
Priority: -- → P3
Comment 2•6 years ago
|
||
This could be one of the reasons quote-reply behaves differently in Firefox than Chrome on GitHub. Not 100% sure.
https://webcompat.com/issues/28521
Comment 3•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Webcompat Priority: --- → ?
Comment 4•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•6 years ago
|
See Also: → https://webcompat.com/issues/30041
Updated•6 years ago
|
Webcompat Priority: ? → revisit
Whiteboard: [webcompat] → [webcompat][needs-wpt-?]
Updated•6 years ago
|
Component: DOM: Core & HTML → Serializers
Comment 5•3 years ago
|
||
The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•2 years ago
|
Webcompat Priority: revisit → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•