Firefox no reset height for images with empty src attrib
Categories
(Core :: Layout, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox71 | --- | wontfix |
firefox72 | --- | verified |
firefox73 | --- | verified |
People
(Reporter: krystian3w, Assigned: emilio)
References
(Regression)
Details
(Keywords: regression)
Attachments
(4 files)
14.06 KB,
text/html
|
Details | |
777 bytes,
text/html
|
Details | |
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
Steps to reproduce:
Open this demo: https://jsfiddle.net/jpz8nfxL/
In right down square you should see image element with "border", even though the photo size was reset to 0 jheight before.
Actual results:
CSS height: auto;
no longer reset size to 0 value if atrrib src for image is empty
Expected results:
Still reset size image to 0 height.
Like Firefox 70 and any Chromium / Legacy Edge (EdgeHTML engine).
Reporter | ||
Comment 1•5 years ago
|
||
manually reset height for Firefox 71+:
@supports (grid-template-columns: subgrid) {
img[src=""][height] {
height: 0;
}
}
Reporter | ||
Comment 2•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
This is working as expected per the changes discussed in bug 1547231 / https://github.com/WICG/intrinsicsize-attribute/issues/16.
The width and height attribute causes the image to have a defined aspect ratio, despite the src being broken.
Are you aware of this breaking any site? We can probably still change behavior here but it seems to be the intended thing if you specify the width
and height
of the image that the size of the image is computed relative to that.
Reporter | ||
Comment 4•5 years ago
|
||
Breaking this blog:
https://davidpohl.wordpress.com/
source (Polish): https://mozillapl.org/forum/viewtopic.php?p=245707#p245707
And the creator may not necessarily have time to remove the graphics from the template or hide it in CSS (and Wordpress surpasses it).
Assignee | ||
Comment 5•5 years ago
|
||
Alright, I'll take a look at this.
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 7•5 years ago
|
||
We always pass mImage.
Assignee | ||
Comment 8•5 years ago
|
||
This works in chrome because they don't event create an image box for this case,
which is totally against the spec.
The spec doesn't consider an image with a null image request, but our behavior
changes in some other places as well because of it...
Depends on D56367
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 13•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5178a33eae28
https://hg.mozilla.org/mozilla-central/rev/bc309b2cd9e7
Comment 14•5 years ago
|
||
Given that this has been around since Fx69, is this worth Beta backport consideration?
Assignee | ||
Comment 15•5 years ago
|
||
Comment on attachment 9114555 [details]
Bug 1602047 - Cleanup nsImageFrame::UpdateIntrinsic{Size,Ratio}. r=tnikkel
Beta/Release Uplift Approval Request
- User impact if declined: comment 0
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: comment 0
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Minor change to not apply a new feature to images with no src attribute.
- String changes made/needed: none
Assignee | ||
Updated•5 years ago
|
Comment 16•5 years ago
|
||
Slightly confused because comment 0 says this is new in 71, but the regressing bug was in 69.
Assignee | ||
Comment 17•5 years ago
|
||
(In reply to Julien Cristau [:jcristau] from comment #16)
Slightly confused because comment 0 says this is new in 71, but the regressing bug was in 69.
The feature introduced by the regressing bug was only enabled on release for 71.
Assignee | ||
Comment 18•5 years ago
|
||
(In bug 1585637 in particular)
Comment 19•5 years ago
|
||
Comment on attachment 9114555 [details]
Bug 1602047 - Cleanup nsImageFrame::UpdateIntrinsic{Size,Ratio}. r=tnikkel
Aha, thanks. Probably makes sense to uplift in that case; approved for 72.0b8.
Updated•5 years ago
|
Comment 20•5 years ago
|
||
bugherder uplift |
Updated•5 years ago
|
Updated•5 years ago
|
Comment 21•5 years ago
|
||
Verified as fixed on Firefox 72 beta 9 and on the latest Nightly 73.oa1 (build ID: 20191222215627) on Windows 10 x64, Ubuntu 18.04 and Mac OS X 10.15.
Reporter | ||
Comment 22•4 years ago
|
||
I suppose problem is back on same WordPress blog (https://davidpohl.wordpress.com/
), new specification revert these repair added to Firefox 72-85?
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 23•4 years ago
|
||
I fastly checked and something new added into Firefox 83+ reverted/glitched:
https://hg.mozilla.org/releases/mozilla-beta/rev/a0d750de744a
https://hg.mozilla.org/releases/mozilla-beta/rev/df4c26f082cf
Assignee | ||
Comment 24•4 years ago
|
||
Can you elaborate? The image also looks big in other browsers.
Reporter | ||
Comment 25•4 years ago
|
||
Can you elaborate?
-
In Chrome 89 frame with information about broken image is much is smaller:
https://jsfiddle.net/4ch5t3wL/ - https://i.imgur.com/ReNuPPg.png browser don't use
height="680"
for frame and I see ~20 pixels height between lines. I don't know what generate margin/padding bottom equal ~660 pixels. -
Firefox 83+ - frame is huge like as 680
height
attrib: https://i.imgur.com/aW5O4WD.png -
Safari 14 - reserves size equal 1 line of text (~16 px height) - maybe due used
<a> ... </a>
element.
The image also looks big in other browsers.
So it's all about how much space the element now reserves and not the frame size reshuffling for an empty src attribute or a network error accessing the file.
Comment 26•4 years ago
|
||
Please file a new bug for comments 23/25.
Reporter | ||
Comment 27•4 years ago
|
||
OK, cloned and I wait for feedback by people better know how should works based on documentation for html/css.
Description
•