Closed Bug 1183365 Opened 9 years ago Closed 7 years ago

'float: right' inside 'white-space: pre' or 'white-space: nowrap' div goes on a new line

Categories

(Core :: Layout: Floats, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 488725
Tracking Status
firefox42 --- affected

People

(Reporter: botond, Unassigned)

Details

Attachments

(1 file)

Consider the following HTML:

<html><body>                                                                       
  <div style="white-space: pre">                                                   
    long time; <span style="float: right; white-space: normal">// know C?</span>
  </div>                                                                           
</body></html>

Gecko renders the comment ("// know C?") on a new line compared to "long time;".

WebKit renders the comment on the same line (and this is what the author of the snippet was trying to achieve).

I don't know who's right; Markus said he suspects it might be WebKit.
'white-space:nowrap' has the same behavior, so this is not related to preformatting of whitespace but rather to the wrapping-prevention bits...

I agree that or rendering here seems pretty suspicious.
Summary: 'float: right' inside 'white-space: pre' div goes on a new line → 'float: right' inside 'white-space: pre' or 'white-space: nowrap' div goes on a new line
This bug is responsible for a misrendering on Google's mobile sports page, too: https://github.com/webcompat/web-bugs/issues/7349  (as well as apparently for a Google Trends issue, per dependent bug 1184053)
Attached file testcase 1
(Here's the testcase I reduced from the Google Sports issue, FWIW. It's similar to the markup quoted in comment 0 here.)
No longer blocks: 1184053
And actually, this is a dupe of bug 488725. Marking as such.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: