cloned image node omits naturalWidth and naturalHeight properties

RESOLVED FIXED in Firefox 42

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: scaturrob, Assigned: bzbarsky)

Tracking

({testcase})

39 Branch
mozilla42
testcase
Points:
---

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36

Steps to reproduce:

I created a fiddle that demonstrates the issue:

http://jsfiddle.net/scaturrob/yqed6ts0/


Actual results:

The loaded image returns the correct dimensions for naturalWidth and naturalHeight. Cloning that image results in a 0 value for both naturalWidth and naturalHeight on the clone.


Expected results:

The original node and clone should have identical naturalWidth and naturalHeight properties

Updated

3 years ago
Component: Untriaged → DOM: Core & HTML
Keywords: testcase
Product: Firefox → Core
(Assignee)

Comment 1

3 years ago
Nice catch.

The problem is that cloning passes false for aNotify to SetAttr, so the image load doesn't get started on the clone.
Assignee: nobody → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

3 years ago
Created attachment 8635413 [details] [diff] [review]
Cloning an image should ensure that the clone tries to load the src, if any

Olli, sorry to pile onto your review load, but this needs some checking wrt the static document bits and the responsive image interaction, and I seem to recall you know about the latter.
Attachment #8635413 - Flags: review?(bugs)

Comment 3

3 years ago
Comment on attachment 8635413 [details] [diff] [review]
Cloning an image should ensure that the clone tries to load the src, if any

oh, hmm, I think we may want to pass true as aNotify in CopyInnerTo, but that needs some more investigation, so not in this bug.
2 spaces for indentation.

but I'm not familiar with responsive image interaction. jdm has done some work there.
Attachment #8635413 - Flags: review?(bugs) → review?(josh)

Comment 4

3 years ago
Comment on attachment 8635413 [details] [diff] [review]
Cloning an image should ensure that the clone tries to load the src, if any

But for static document case, yes, we don't want to load anything there, but just
clone.
Attachment #8635413 - Flags: review+

Comment 5

3 years ago
Comment on attachment 8635413 [details] [diff] [review]
Cloning an image should ensure that the clone tries to load the src, if any

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

Makes sense.
Attachment #8635413 - Flags: review?(josh) → review+
https://hg.mozilla.org/mozilla-central/rev/e0a73c096a3d
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox42: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.