Closed
Bug 348573
Opened 18 years ago
Closed 18 years ago
[FIX]PresShell should get notifications through the binding manager
Categories
(Core :: Layout, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(2 files, 2 obsolete files)
|
40.14 KB,
patch
|
Details | Diff | Splinter Review | |
|
16.30 KB,
patch
|
sicking
:
review+
sicking
:
superreview+
|
Details | Diff | Splinter Review |
We've talked about this on and off for a while. We should just do it.
| Assignee | ||
Updated•18 years ago
|
Priority: -- → P1
Summary: PresShell should get notifications through the binding manager → [FIX]PresShell should get notifications through the binding manager
Target Milestone: --- → mozilla1.9alpha
| Assignee | ||
Comment 1•18 years ago
|
||
| Assignee | ||
Comment 2•18 years ago
|
||
Attachment #233541 -
Flags: superreview?(bugmail)
Attachment #233541 -
Flags: review?(bugmail)
Comment on attachment 233541 [details] [diff] [review] Same as diff -w >Index: content/xbl/src/nsBindingManager.cpp >+nsBindingManager::AddObserver(nsIDocumentObserver* aObserver) >+nsBindingManager::RemoveObserver(nsIDocumentObserver* aObserver) Inline these to save code? >Index: content/base/src/nsDocument.cpp >@@ -826,24 +826,23 @@ nsDocument::Init() > mBindingManager = bindingManager; > > // The binding manager must always be the first observer of the document. > mObservers.PrependObserver(bindingManager); > nsINode::nsSlots* slots = GetSlots(); > NS_ENSURE_TRUE(slots && > slots->mMutationObservers.PrependObserver(bindingManager), > NS_ERROR_OUT_OF_MEMORY); > // Prepend self as mutation-observer whether we need it or not (some > // subclasses currently do, other don't). This is because the code in >- // nsNodeUtils always notifies the first observer first, even when going >- // backwards, expecting the first observer to be the document. >- // If we remove that hack, we can move the below registring out to the leaf >- // classes. >+ // nsNodeUtils always notifies the first observer first, expecting the >+ // first observer to be the document. If we remove that hack, we can >+ // move the below registring out to the leaf classes. Didn't you just fix that hack? (Though you'd still have to prepend since I think the leaf classes might want to get notified first). >Index: content/base/src/nsTObserverArray.h >+ // XXXbz do we still want to keep ReverseIterator around? >+ I'd say no. >+// XXXbz I wish I didn't have to pass in the observer type, but I >+// don't see a way to get it out of array_. >+#define NS_OBSERVER_ARRAY_NOTIFY_OBSERVERS(array_, obstype_, func_, params_) \ If you made this into an templetized (inline) function you could. But i'm not sure if that's worth it.
Attachment #233541 -
Flags: superreview?(bugmail)
Attachment #233541 -
Flags: superreview+
Attachment #233541 -
Flags: review?(bugmail)
Attachment #233541 -
Flags: review+
| Assignee | ||
Comment 4•18 years ago
|
||
> Inline these to save code? They're virtual methods anyway. Unless you mean push the member up to nsIBindingManager and inline there? > Didn't you just fix that hack? I wasn't sure. At this point "hack" refers to the assumption that the document is first in the list. ;) > I'd say no. OK, I'll remove it. > If you made this into an templetized (inline) function Then I couldn't pass through the func and args in a reasonable way.... :(
> > Inline these to save code? > > They're virtual methods anyway. Unless you mean push the member up to > nsIBindingManager and inline there? Either way is fine with me. > > Didn't you just fix that hack? > > I wasn't sure. At this point "hack" refers to the assumption that the > document is first in the list. ;) Yeah, the hack is gone so we can add just as we need. That said, i'm not sure which is cleaner, i'm sure we'll in the future have to make all nsDocuments observe themselfs so it's not that important to me to push it out to the leaves.
| Assignee | ||
Comment 6•18 years ago
|
||
Attachment #233540 -
Attachment is obsolete: true
Attachment #233541 -
Attachment is obsolete: true
| Assignee | ||
Comment 7•18 years ago
|
||
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 8•18 years ago
|
||
Actually, that patch breaks other consumers (like the DOM inspector listeners). I think what we _really_ want is for all mutation listeners to go through the binding manager. I'll write up a followup to do that.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 9•18 years ago
|
||
Attachment #233909 -
Flags: superreview?(bugmail)
Attachment #233909 -
Flags: review?(bugmail)
| Assignee | ||
Updated•18 years ago
|
Attachment #233909 -
Flags: superreview?(bugmail)
Attachment #233909 -
Flags: superreview+
Attachment #233909 -
Flags: review?(bugmail)
Attachment #233909 -
Flags: review+
One thing that i'm not super exited about is that adding an observer to the document will behave so different from adding an observer to, say, the documentElement. But I can't think of any problems that that will bring up in reality so I think it's fine.
Just to clarify, the problems that i'm worried about is for users that attaches listeners to random nsINodes, like nsContentList
| Assignee | ||
Comment 12•18 years ago
|
||
But those shouldn't care about XBL insertion points, right?
Yeah, that was my hope too.
| Assignee | ||
Comment 14•18 years ago
|
||
Checked in the followup patch. Fixed.
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Core → Core Graveyard
Updated•6 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•