Closed Bug 342145 Opened 18 years ago Closed 15 years ago

"ASSERTION: Previous Sibling is the Container's frame" involving image map

Categories

(Core :: Layout, defect, P4)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Assigned: MatsPalmgren_bugz)

References

(Depends on 1 open bug)

Details

(Keywords: assertion, testcase, Whiteboard: [dbaron-1.9:Rs])

Attachments

(3 files, 1 obsolete file)

###!!! ASSERTION: Previous Sibling is the Container's frame: 'prevSibling != containerFrame', file /Users/admin/trunk/mozilla/layout/base/nsCSSFrameConstructor.cpp, line 8651
Attached file testcase (obsolete) —
Assignee: nobody → mats.palmgren
OS: Mac OS X 10.4 → All
Hardware: Macintosh → All
Attached patch Patch rev. 1Splinter Review
The problem is that the <area> has the ImageFrame as its primary frame,
which is also the primary frame for the <img> which is its content parent.
An alternative would be verify that "prevSibling->GetContent()" 
is actually the content we are looking at (*iter), here:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/base/nsCSSFrameConstructor.cpp&rev=1.1237&root=/cvsroot&mark=8619#8601
But I think I prefer the attached patch... Boris?
Hmm... This patch seems to make sense, but I'd want David to give it a look too...
Comment on attachment 226438 [details] [diff] [review]
Patch rev. 1

See comment 2 - 4, what do you think?
Attachment #226438 - Flags: review?(dbaron)
dbaron, ping?
So I've forgotten why we set primary frame for areas -- but whatever it is, it's broken, because multiple images can refer to the same image map.  How hard is that to fix?  I've forgotten.

(That's also the sole reason why we bloat the primary frame map entries by a word, unless somebody's fixed that...)
> So I've forgotten why we set primary frame for areas

I thought it had to do with tabbing....  we want to be able to tab between the <area>s within an image, and I thought the ESM needed a frame for that.  Mats or Aaron might know?
Boris, the code and comments seem to disagree, and it's been a while since I've looked at that closely. But, look at this:
http://lxr.mozilla.org/seamonkey/source/content/events/src/nsEventStateManager.cpp#3587
3585       if (currentContent->Tag() == nsGkAtoms::img &&
3586           currentContent->HasAttr(kNameSpaceID_None, nsGkAtoms::usemap)) {
3587         // Must be an image w/ a map -- it's tabbable but no tabindex is specified
3588         // Special case for image maps: they don't get walked by nsIFrameTraversal
3589         nsIContent *areaContent = GetNextTabbableMapArea(forward, currentContent);
3590         if (areaContent) {
3591           NS_ADDREF(*aResultNode = areaContent);
3592           return NS_OK;
3593         }
3594       }
Ah, cool.  If it just works on content, maybe we don't need this anymore...
So that means we can fix this by undoing http://bonsai.mozilla.org/cvslog.cgi?file=/mozilla/layout/base/nsFrameManager.cpp&rev=HEAD&mark=1.100#1.100 and not making the area's primary frame the frame for the first image to use that area?
Comment on attachment 226438 [details] [diff] [review]
Patch rev. 1

In any case, this patch doesn't seem right.  If we want a quick fix here, I think it would be to explicitly exclude imagemap areas (which are sometimes A elements!).

But I suspect there are bigger problems caused by what we're doing here (e.g., what happens if the area is an A element that's also displayed elsewhere, or when multiple images use the same areas).  So I think the real solution is to stop setting the primary frame for imagemap areas and fix the tabbing code to deal.
Attachment #226438 - Flags: review?(dbaron) → review-
> So that means we can fix this by undoing ...

Possibly, yes.  Someone needs to check that tabbing through multiple images that use the same imagemap (e.g. on slashdot) works after that.
Flags: blocking1.9?
Er, doesn't look like slashdot does that anymore.  So we'd need a testcase too.
Keywords: qawanted
I tried the testcase in the original bug about the problem, bug 115481, and it doesn't work.  But I think we need to make it work.
Flags: blocking1.9? → blocking1.9+
Mats, are you going to be able to fix this for Gecko 1.9?  If not, please reassign to nobody so we know this bug needs a new owner.  (It's blocking1.9+.)
Keywords: qawanted
Flags: wanted-next+
Flags: blocking1.9-
Flags: tracking1.9+
Attached file testcase
Moved the image into the testcase file, reduced the timeout.

I can still reproduce the bug on trunk.
Attachment #226320 - Attachment is obsolete: true
WFM on trunk.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
Crashtest: http://hg.mozilla.org/mozilla-central/rev/b64a7e4a35e2
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: