img tag within p tags not separated by a space from the text is not rendered correctly
Categories
(Core :: Layout: Block and Inline, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox-esr68 | --- | fixed |
firefox68 | --- | wontfix |
firefox69 | --- | fixed |
firefox70 | --- | fixed |
People
(Reporter: bunglegrind, Assigned: jfkthame)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files)
1.36 KB,
text/html
|
Details | |
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr68+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr68+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
Steps to reproduce:
Just open the html file herein attached. Not sure about CSP, if the picture does not appear, please download it and edit the img src accordingly.
The issue appears in Firefox 68 and above (in 69.0b5 for instance), Win64 and OS X platforms. At least. Not present in 67.0.4.
Actual results:
You should note that the text in the first div is at the right of the picture, whereas in the second div is (correctly) under the image.
Please note that the picture is about the same size of the div.
Expected results:
Chrome correctly shows the text under the picture in both cases.
Comment 1•6 years ago
|
||
I bet this is a regression from bug 1283222, but will confirm ASAP.
Comment 2•6 years ago
|
||
Jonathan, sounds like maybe floats should be excluded from the check? Or we should allow breaking at the beginning of the line unconditionally? Or something of that sort?
Assignee | ||
Comment 3•6 years ago
|
||
Interestingly, if I open the DevTools inspector, it magically fixes the rendering for me. (It's not immediately obvious why; seems like maybe a devtools bug?)
We should probably allow a break after a float if the line is (otherwise) empty. Building with a patch to check how it behaves...
Comment 4•6 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #3)
Interestingly, if I open the DevTools inspector, it magically fixes the rendering for me. (It's not immediately obvious why; seems like maybe a devtools bug?)
Devtools causes the whole page to reframe, and causes the creation of whitespace-only text-nodes. Probably the whitespace that is before the image in the test-case, which usually is optimized away in the frame constructor, is acting as a soft break opportunity.
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
I think something like this ^^ should resolve the issue; pushed a try run to check if anything breaks. https://treeherder.mozilla.org/#/jobs?repo=try&revision=0399cf6c715b1a50a4269fdec8703dc24eb3bb6a
Assuming it looks good, we should also add some tests.
(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)
Devtools causes the whole page to reframe, and causes the creation of whitespace-only text-nodes. Probably the whitespace that is before the image in the test-case, which usually is optimized away in the frame constructor, is acting as a soft break opportunity.
Right, I think that's what is happening; but it seems like a bug to me. Simply opening the Inspector should not modify the thing being inspected!
Assignee | ||
Comment 7•6 years ago
|
||
Comment 8•6 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #6)
Right, I think that's what is happening; but it seems like a bug to me. Simply opening the Inspector should not modify the thing being inspected!
Yes, inspector should probably not call getBoxQuads()
on all nodes in the page, which is what causes the creation of these. I'll file an inspector bug.
Comment 12•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/77f2a37b794a
https://hg.mozilla.org/mozilla-central/rev/3169928e34dc
Updated•6 years ago
|
Comment 13•6 years ago
|
||
Is this worth a Beta backport? Not sure about ESR68 either.
Assignee | ||
Comment 14•6 years ago
|
||
Yes, probably worth backporting this, as it could manifest as a layout regression on real sites (I assume the reporter here observed the bug on a site, and then created the reduced testcase to illustrate it), and the patch is really small and simple.
Assignee | ||
Comment 15•6 years ago
|
||
Comment on attachment 9079075 [details]
Bug 1567098 - Allow line-break after a float placeholder if the line is empty. r=emilio
Beta/Release Uplift Approval Request
- User impact if declined: Incorrect float placement in some cases
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- 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): Very minor patch that partially reverts to earlier behavior around floats
- String changes made/needed: none
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Bug can result in broken layout, e.g. in cases where there is a full-width float at the start of a block
- User impact if declined: Bad layout on affected sites
- Fix Landed on Version: 70
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Very minor patch that partially reverts to earlier behavior around floats
- String or UUID changes made by this patch: none
Assignee | ||
Updated•6 years ago
|
Comment 16•6 years ago
|
||
Comment on attachment 9079075 [details]
Bug 1567098 - Allow line-break after a float placeholder if the line is empty. r=emilio
Simple fix with automated test for incorrect float placement in some circumstances. Approved for 69.0b8 and 68.1esr.
Updated•6 years ago
|
Comment 17•6 years ago
|
||
bugherder uplift |
Comment 18•6 years ago
|
||
bugherder uplift |
Reporter | ||
Comment 19•6 years ago
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #14)
Yes, probably worth backporting this, as it could manifest as a layout regression on real sites (I assume the reporter here observed the bug on a site, and then created the reduced testcase to illustrate it), and the patch is really small and simple.
Yes, indeed.
Updated•3 years ago
|
Description
•