If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Editing text node trims trailing space

RESOLVED FIXED in Firefox 40

Status

()

Firefox
Developer Tools: Inspector
--
minor
RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: Jesse Ruderman, Assigned: bgrins)

Tracking

Trunk
Firefox 40
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox40 fixed)

Details

(Whiteboard: [polish-backlog][difficulty=easy])

Attachments

(2 attachments, 1 obsolete attachment)

Comment hidden (empty)
(Reporter)

Comment 1

3 years ago
Created attachment 8590543 [details]
testcase with instructions
Thanks for spotting this problem, I found the root cause to be in the InplaceEditor widget we use for editing the textContent:
http://mxr.mozilla.org/mozilla-central/source/browser/devtools/shared/inplace-editor.js#791

It trims the value in the input, no matter what.
Some of the users of this widget may want this, but we sure don't want this to happen in the case described here. So perhaps we need a new option for this widget.
Mentor: pbrosset@mozilla.com
OS: Mac OS X → All
Hardware: x86_64 → All
(Assignee)

Comment 3

2 years ago
I'll fix this
Assignee: nobody → bgrinstead
Mentor: pbrosset@mozilla.com
Status: NEW → ASSIGNED
Whiteboard: [devedition-40][difficulty=easy]
(Assignee)

Comment 4

2 years ago
Created attachment 8598977 [details] [diff] [review]
trim-space.patch

What do you think?  Just don't trim if in multiline, and adds a test. Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3d3f822af46e
Attachment #8598977 - Flags: review?(pbrosset)
(Assignee)

Updated

2 years ago
See Also: → bug 1046803
(Assignee)

Updated

2 years ago
Blocks: 1046803
(Assignee)

Updated

2 years ago
See Also: bug 1046803
Comment on attachment 8598977 [details] [diff] [review]
trim-space.patch

Review of attachment 8598977 [details] [diff] [review]:
-----------------------------------------------------------------

This seems to do the trick, but I'm wondering if we shouldn't instead add a new option to the inplace editor rather than assume that non-multilines want values trimmed.
What if I want a single-line editor that doesn't trim the string?
Attachment #8598977 - Flags: review?(pbrosset)
(Assignee)

Comment 6

2 years ago
Created attachment 8599511 [details] [diff] [review]
trim-space.patch

Changed this to a trimOutput option (true by default so we don't need to change all of the other places that may have been relying on it trimming).
Attachment #8598977 - Attachment is obsolete: true
Attachment #8599511 - Flags: review?(pbrosset)
(Assignee)

Comment 7

2 years ago
Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=faaf6c401c80
Comment on attachment 8599511 [details] [diff] [review]
trim-space.patch

Review of attachment 8599511 [details] [diff] [review]:
-----------------------------------------------------------------

Ship It!
Attachment #8599511 - Flags: review?(pbrosset) → review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed
(Assignee)

Comment 9

2 years ago
remote:   https://hg.mozilla.org/integration/fx-team/rev/cd5b4e44e260
Keywords: checkin-needed
Whiteboard: [devedition-40][difficulty=easy] → [fixed-in-fx-team][devedition-40][difficulty=easy]
https://hg.mozilla.org/mozilla-central/rev/cd5b4e44e260
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox40: affected → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team][devedition-40][difficulty=easy] → [devedition-40][difficulty=easy]
Target Milestone: --- → Firefox 40
Whiteboard: [devedition-40][difficulty=easy] → [polish-backlog][difficulty=easy]
You need to log in before you can comment on or make changes to this bug.