Closed Bug 203345 Opened 21 years ago Closed 21 years ago

Imagemaps need to be updated to properly check for XHTML docs

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.4beta

People

(Reporter: bzbarsky, Assigned: jst)

Details

(Keywords: regression, Whiteboard: [HAVE FIX])

Attachments

(2 files)

The code at
http://lxr.mozilla.org/seamonkey/source/content/shared/src/nsImageMapUtils.cpp#87
seems to be semi-bogus now that bug 111514 has been fixed.
Attached patch Proposed fix.Splinter Review
Attachment #121705 - Flags: superreview?(bzbarsky)
Attachment #121705 - Flags: review?(harishd)
Comment on attachment 121705 [details] [diff] [review]
Proposed fix.

Excellent.  ;)
Attachment #121705 - Flags: superreview?(bzbarsky) → superreview+
Status: NEW → ASSIGNED
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla1.4beta
Comment on attachment 121705 [details] [diff] [review]
Proposed fix.

>Index: content/html/document/src/nsHTMLDocument.cpp
>===================================================================
>-    if (map && NS_SUCCEEDED(map->GetName(name))) {
>-      PRBool match;
>+    NS_ASSERTION(map, "Null map in map list!");

We used to return NS_ERROR_FAILURE, with this change we would crash. Please
make it so we return the error and won't crash if !map, and r=heikki.
Attachment #121705 - Flags: review?(harishd) → review+
We won't hit the !map assertion unless someone breaks some code... mImageMaps is
only filled with non-null nsIDOMHTMLMapElement pointers, strongly typed at
compile time. There's no need to error check that, IMO.

Let me know if you strongly disagree.
I can't say I strongly disagree, but if I can make something crash-proof I'd
rather do it.
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
I'd like to get this on the 1.4 branch as well.
Keywords: nsbeta1
Reopening to get this evaluated for the branch.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 121705 [details] [diff] [review]
Proposed fix.

a=asa (on behalf of drivers) for checkin to the 1.4 branch.
Attachment #121705 - Flags: approval1.4? → approval1.4+
adt: nsbeta1-
Keywords: nsbeta1nsbeta1-
a=adt to land this on the 1.4 branch.  Please add the fixed1.4 keyword once this
lands.
Fixed on the branch now too.
Status: REOPENED → RESOLVED
Closed: 21 years ago21 years ago
Keywords: fixed1.4
Resolution: --- → FIXED
Verified, trunk and branch.
Status: RESOLVED → VERIFIED
Keywords: fixed1.4verified1.4
Attached file testcase
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: