Last Comment Bug 694503 - image map doesn't get updated when map element is removed as part of container subtree
: image map doesn't get updated when map element is removed as part of containe...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout: Images (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla10
Assigned To: Olli Pettay [:smaug] (high review load, please consider other reviewers)
:
Mentors:
: 712963 (view as bug list)
Depends on:
Blocks: 690417
  Show dependency treegraph
 
Reported: 2011-10-13 23:12 PDT by alexander :surkov
Modified: 2012-03-06 23:46 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (621 bytes, text/html)
2011-10-13 23:12 PDT, alexander :surkov
no flags Details
patch (5.93 KB, patch)
2011-10-27 16:56 PDT, Olli Pettay [:smaug] (high review load, please consider other reviewers)
no flags Details | Diff | Review
patch (9.61 KB, patch)
2011-10-28 10:27 PDT, Olli Pettay [:smaug] (high review load, please consider other reviewers)
bzbarsky: review+
Details | Diff | Review

Description alexander :surkov 2011-10-13 23:12:36 PDT
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
Comment 1 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-10-14 03:00:39 PDT
T
Comment 2 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-10-14 03:12:52 PDT
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.
Comment 3 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-10-14 05:56:24 PDT
I guess I could take this.
Comment 4 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-10-27 16:56:49 PDT
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.
Comment 5 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-10-28 10:27:37 PDT
Created attachment 570297 [details] [diff] [review]
patch

Handle also name/id changes.

Uploaded to try
Comment 6 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-10-28 20:35:52 PDT
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.
Comment 7 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-10-29 03:42:08 PDT
mImageFrame is null checked in both places.
Comment 8 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-10-29 06:56:32 PDT
https://hg.mozilla.org/mozilla-central/rev/c33a85b6c9d4
Comment 9 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-12-22 09:07:27 PST
*** Bug 712963 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.