Closed Bug 304753 Opened 19 years ago Closed 19 years ago

[FIX]nsImageMap is too eager to invalidate on attribute changes

Categories

(Core :: Layout, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file)

STEPS TO REPRODUCE:

1)  Load https://bugzilla.mozilla.org/attachment.cgi?id=162706
2)  Watch it freeze up for 2-3 seconds

EXPECTED RESULTS: no freeze

The problem is that we rebuild the imagemap on every attr set, which makes the
whole thing O(N^2) in the number of <area>s.  Since none of the attrs relevant
to the functioning of the imagemap are changing, we shouldn't be rebuilding.
Attached patch Proposed patchSplinter Review
OS: Linux → All
Priority: -- → P2
Hardware: PC → All
Summary: nsImageMap is too eager to invalidate on attribute changes → [FIX]nsImageMap is too eager to invalidate on attribute changes
Target Milestone: --- → mozilla1.9alpha
Attachment #192780 - Flags: superreview?(jst)
Attachment #192780 - Flags: review?(jst)
Comment on attachment 192780 [details] [diff] [review]
Proposed patch

+  if (aContent->IsContentOfType(nsIContent::eHTML) &&
+      (aContent->GetNodeInfo()->Equals(nsHTMLAtoms::area) ||
+	aContent->GetNodeInfo()->Equals(nsHTMLAtoms::a)) &&

aContent->GetNodeInfo() is a virtual function, you may be better off storing it
in a local here. Your call.

r+sr=jst either way.
Attachment #192780 - Flags: superreview?(jst)
Attachment #192780 - Flags: superreview+
Attachment #192780 - Flags: review?(jst)
Attachment #192780 - Flags: review+
This is 1.9 stuff, and I expect peterv's inlining (and renaming) of
nsIContent::NodeInfo() to land in 1.9, hopefully sometime soon.  ;)
(In reply to comment #3)
> peterv's inlining (and renaming) of
> nsIContent::NodeInfo()

That's sicking's, I wouldn't do such crazy things! :-P
Fixed.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: