When pasting data:text/html with CRLF codes into the address bar and opening it, the layout is different between Firefox and Chrome.
Categories
(Firefox :: Address Bar, defect, P3)
Tracking
()
People
(Reporter: alice0775, Assigned: daisuke)
References
(Regression)
Details
(Keywords: nightly-community, regression)
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
Steps to reproduce:
- Copy the following strings
data:text/html,<span>bla bla bla
bla bla</span>
- Paste into address bar and press enter key
Actual results:
Firefox: bla bla blabla bla
Chrome : bla bla bla bla bla
Expected results:
both same
This does not happen if open from html file.
| Reporter | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
The severity field is not set for this bug.
:adw, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 2•3 years ago
|
||
Adding a space between the two lines on paste, as Chrome does, makes sense to me. More info:
- On paste in the address bar, Firefox doesn't add a space between the two lines
- On paste in textboxes in web content, Firefox does add a space (I tested with textboxes on Bugzilla, in case it matters)
- On paste in the omnibox, Chrome adds a space (as Alice mentioned)
Looks like this behavior was regressed or at least modified by bug 1327589, which deliberately replaced \r and \n with an empty string, see this code. I don't remember the context from that bug. Maybe we could have replaced those characters with single spaces instead of an empty string and still have fixed the bug.
Comment 3•3 years ago
|
||
:daisuke, since you are the author of the regressor, bug 1327589, could you take a look?
For more information, please visit auto_nag documentation.
| Assignee | ||
Comment 4•3 years ago
|
||
Thank you very much for your report!
Yes, I also confirmed the issue.
So, it seems that we need to add special handling for data url at least.
| Assignee | ||
Comment 5•3 years ago
•
|
||
I investigated the behavior of Chrome a bit more.
It seems that if the pasting data has white space at least one, they replace the line break with a white space.
(I could not add a line break in the table in markdown, add <br> instead.)
| name | input | result |
|---|---|---|
| keywords without white space | 123<br>45<br>6 | 123456 |
| keywords with white space | 123<br>45 6 | 123 45 6 |
| url without white space | http://exam<br>ple.<br>com | http://example.com |
| url with white space | http://exam<br>ple.co m | http://exam ple.co m |
| data url without white space | data:text/html,123<br>45<br>6 | data:text/html,123456 |
| data url with white space | data:text/html,123<br>45 6 | data:text/html,123 45 6 |
Chrome is consistent in the sense that its behavior changes depending on whether there is whitespace or not. However, is not consistent for the data type.
For ours, I think we’d better take consistency by the data type as we are doing.
For the data url, when the content expresses by base64, remove line break simply. Otherwise, replace line break with white space.
| name | input | result | remarks |
|---|---|---|---|
| keywords without white space | 123<br>45<br>6 | 123 45 6 | Replace with white space |
| keywords with white space | 123<br>45 6 | 123 45 6 | Replace with white space |
| url without white space | http://exam<br>ple.<br>com | http://example.com | Remove line breaks |
| url with white space | http://exam<br>ple.co m | http://example.co m | Remove line breaks |
| data url without white space | data:text/html,123<br>45<br>6 | data:text/html,123 45 6 | Replace with white space |
| data url with white space | data:text/html,123<br>45 6 | data:text/html,123 45 6 | Replace with white space |
| base64 data url without white space | data:text/html;base64,123<br>45<br>6 | data:text/html;base64,123456 | Remove line breaks |
| base64 data url with white space | data:text/html;base64,123<br>45 6 | data:text/html;base64,12345 6 | Remove line breaks |
I will implement as above, but if you have opinions, please let me know.
| Assignee | ||
Comment 6•3 years ago
|
||
Comment 7•3 years ago
|
||
Set release status flags based on info from the regressing bug 1327589
Comment 8•3 years ago
|
||
Thanks for doing all that research Daisuke! I started doing some too but then I saw your comment, so I'm glad.
IMO Chrome's approach is good because it's simple and predictable, but Firefox has had more complicated behavior around this for a while, including stripping line breaks from strings that look like URLs, so I guess we should continue to respect that (bug 513648 and bug 1014246 for example).
I'll add more comments in the phabricator.
Comment 10•3 years ago
|
||
| bugherder | ||
Comment 11•3 years ago
|
||
The patch landed in nightly and beta is affected.
:daisuke, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox113towontfix.
For more information, please visit auto_nag documentation.
| Assignee | ||
Comment 12•3 years ago
|
||
Comment on attachment 9327741 [details]
Bug 1823690: Change behavior of pasting data url
Beta/Release Uplift Approval Request
- User impact if declined: When user pastes texts including line breaks on urlbar, an unexpected text might be pasted.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This change only affects the behavior of pasting on urlbar.
- String changes made/needed: None
- Is Android affected?: Unknown
Updated•3 years ago
|
Comment 13•3 years ago
|
||
Comment on attachment 9327741 [details]
Bug 1823690: Change behavior of pasting data url
Approved for 113.0b5.
Comment 14•3 years ago
|
||
| bugherder uplift | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 15•3 years ago
|
||
Reproduced this issue on an affected Nightly build from 2023-03-21 on Windows 10, using the STR from comment 0.
Verified as fixed on 114.0a1 (20230419214510) and Firefox 113.0b5 (20230418175842) on Win 10 x64, Ubuntu 20.04 and macOS 10.15.
Description
•