Closed Bug 694503 Opened 10 years ago Closed 10 years ago

image map doesn't get updated when map element is removed as part of container subtree


(Core :: Layout: Images, Video, and HTML Frames, defect)

Not set





(Reporter: surkov, Assigned: smaug)




(2 files, 1 obsolete file)

Attached file testcase
nsImageMap register mutation observer on map element, mutation observer doesn't get notified when root is removed as part of containing subtree.

Steps to reproduce:
1) hover of imagemap, hand cursor appears on imagemap mouseover
2) remove area element, no hand cursor on corresponding imagemap area
3) remove the container of map element from DOM, hand cursor appears on imagemap
Component: DOM → Layout: Images
QA Contact: general → layout.images
Seems like imagemap handling is pretty much static. It is all set when nsImageFrame first time
uses imagemap for something, and after that the image frame points to the same map element, even if
the id of it changes etc.
nsImageMap should probably use ReferencedElement to track the changes.
I guess I could take this.
Assignee: nobody → Olli.Pettay
Attached patch patch (obsolete) — Splinter Review
But we really need to fix image map handling. should be fixed to not use
primaryframe of area elements (since we need to get rid of primary frames in that case)

After that fixing focus handling, also remove support for <a> elements as synonyms to
area etc.
Attached patch patchSplinter Review
Handle also name/id changes.

Uploaded to try
Attachment #570119 - Attachment is obsolete: true
Attachment #570297 - Flags: review?(bzbarsky)
Comment on attachment 570297 [details] [diff] [review]

Why do we need to null-check mImageFrame in ParentChainChanged but not AttributeChanged?

r=me with those made consistent.
Attachment #570297 - Flags: review?(bzbarsky) → review+
mImageFrame is null checked in both places.
Closed: 10 years ago
Resolution: --- → FIXED
Duplicate of this bug: 712963
Target Milestone: --- → mozilla10
Blocks: 690417
Product: Core → Core Graveyard
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.