Closed Bug 1223523 Opened 9 years ago Closed 9 years ago

Named getter on document should not return images with empty name

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(2 files, 1 obsolete file)

Spec says that <img id="foo"> only creates a named property named "foo" on the document if the <img> element also has a nonempty "name" attribute.  Chrome seems to do that.
Oh, and specifically the spec says that the set of named elements with name "name" include:

  img elements that have an id content attribute whose value is "name", and that have a
  non-empty name content attribute present also.
Hmm... I check this again and don't see that Chrome (48.0.2535.0) change it's behaviour: https://bugzilla.mozilla.org/show_bug.cgi?id=1010241#c2
I'm not sure what that has to do with this bug.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8686989 - Attachment is obsolete: true
Attachment #8686989 - Flags: review?(peterv)
Attachment #8687015 - Flags: review?(peterv) → review+
https://hg.mozilla.org/mozilla-central/rev/4488d33aa551
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Found a question on SUMO [1] and narrowed down to this bug with mozregression. Yes, the new behaviour matches Chrome but needs a site compatibility doc.

https://support.mozilla.org/en-US/questions/1113589
Well, the new behaviour does not match Chrome, actually... Anyway, I have just posted the site compatibility document: https://www.fxsitecompat.com/en-CA/docs/2016/image-with-id-no-longer-appears-on-document-unless-it-has-name-as-well/
> Well, the new behaviour does not match Chrome, actually...

Er... it did in my testing.  How do they differ?
Flags: needinfo?(kohei.yoshino)
Attached file testcase (deleted) —
Hmm, I was testing with the snippet posted on SUMO (comment 8). In this case, Firefox returns both img1 and img2, but Chrome doesn't return img1 which is from DOMParser. Maybe a bug in Chrome?
Flags: needinfo?(kohei.yoshino)
Yes, definitely a bug in Chrome.  Filed https://bugs.chromium.org/p/chromium/issues/detail?id=594008 -- they just have a broken named getter on the return value of DOMParser, whether you do it by id or name or something else.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: