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

RESOLVED FIXED in mozilla10

Status

()

Core
Layout: Images
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: surkov, Assigned: smaug)

Tracking

unspecified
mozilla10
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Created attachment 567016 [details]
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
(Assignee)

Comment 1

6 years ago
T
Component: DOM → Layout: Images
QA Contact: general → layout.images
(Assignee)

Comment 2

6 years ago
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.
(Assignee)

Comment 3

6 years ago
I guess I could take this.
Assignee: nobody → Olli.Pettay
(Assignee)

Comment 4

6 years ago
Created attachment 570119 [details] [diff] [review]
patch

But we really need to fix image map handling.

http://mxr.mozilla.org/mozilla-central/source/accessible/src/html/nsHTMLImageMapAccessible.cpp#181 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.
(Assignee)

Comment 5

6 years ago
Created attachment 570297 [details] [diff] [review]
patch

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]
patch

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+
(Assignee)

Comment 7

6 years ago
mImageFrame is null checked in both places.
(Assignee)

Comment 8

6 years ago
https://hg.mozilla.org/mozilla-central/rev/c33a85b6c9d4
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Duplicate of this bug: 712963
Target Milestone: --- → mozilla10
(Reporter)

Updated

5 years ago
Blocks: 690417
You need to log in before you can comment on or make changes to this bug.