Closed Bug 273812 Opened 20 years ago Closed 17 years ago

Mac widget code needs to stop using docshells

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: jaas)

References

Details

Attachments

(1 file, 2 obsolete files)

At the moment, the mac menu code uses nsIWebShell all over.

With the removal of that interface in bug 273319, I'm switching the code over to
nsIDocShell.

Really, though, we shouldn't be using docshell stuff here at all.  It looks like
it's mostly used to get prescontexts for event dispatch.  Just using DOM events
(for the event types we can use them for) would have the same effect.  Neil says
the COMMAND events can't be done via DOM events, but can be done via
nsIDOMXULElement::DoCommand.

Fixing this would let us move on ahead with fixing the docshell apis to the
point where we can freeze them...
Blocks: 294316
Assignee: sfraser_bugs → joshmoz
Status: NEW → ASSIGNED
Component: Widget: Mac → Widget: Cocoa
Attached patch fix v1.0 (obsolete) — Splinter Review
This gets rid of all docshell usage from Cocoa widgets.
Attachment #280961 - Flags: review?(cbarrett)
Attachment #280961 - Flags: review?(cbarrett)
Attached patch fix v1.0.1 (bump uuid) (obsolete) — Splinter Review
Attachment #280961 - Attachment is obsolete: true
Attachment #280962 - Flags: review?(cbarrett)
Attached patch fix v1.0.2Splinter Review
Turns out we can get rid of webshell too.
Attachment #280965 - Flags: review?(cbarrett)
Attachment #280962 - Attachment is obsolete: true
Attachment #280962 - Flags: review?(cbarrett)
Attachment #280965 - Flags: review?(cbarrett) → review+
Attachment #280965 - Flags: superreview?(bzbarsky)
Attachment #280965 - Flags: approval1.9?
Comment on attachment 280965 [details] [diff] [review]
fix v1.0.2

>Index: widget/src/cocoa/nsMenuBarX.mm

>+  domNode->GetOwnerDocument(getter_AddRefs(domDoc));
>+  if (domDoc) {
>+    nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));

do_QI is null-safe.  So no need to null-check domDoc.  And once you remove that check, you no longer need the addedMutationObserver boolean; just bail out if |doc| is null.

With that change, sr=bzbarsky
Attachment #280965 - Flags: superreview?(bzbarsky) → superreview+
landed on trunk with boris's change
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: