Bug 1663366 Comment 6 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Mike Conley (:mconley) (:⚙️) from comment #5)
> There's a further wrinkle - this code throws an exception: https://searchfox.org/mozilla-central/rev/8a0745cd346f0cfb89ae71690babbf7bff706113/toolkit/actors/SelectParent.jsm#709-711
> 
> because apparently from the print preview UI browser, it's browsingContext.top.embedderElement is... null?

Yeah, this will be because `$0.browsingContext.top == window.browsingContext`, ie it's the browsing context for the chrome window itself, which has no embedder element.

> Not entirely sure why. We'd probably need someone from DOM to help answer that. I'm actually not sure we want browsingContext.top in this case - we probably want the <xul:browser> that hosts the UI and no further.

This sounds right.

> And _then_, we need to make sure that <xul:browser> has its `selectmenulist` attribute set to "ContentSelectDropdown".
> 
> And _then_ I think it'd work.

OK, thanks for digging into this!
(In reply to Mike Conley (:mconley) (:⚙️) from comment #5)
> There's a further wrinkle - this code throws an exception: https://searchfox.org/mozilla-central/rev/8a0745cd346f0cfb89ae71690babbf7bff706113/toolkit/actors/SelectParent.jsm#709-711
> 
> because apparently from the print preview UI browser, it's browsingContext.top.embedderElement is... null?

Yeah, this will be because `printPreviewBrowser.browsingContext.top == window.browsingContext`, ie it's the browsing context for the chrome window itself, which has no embedder element.

> Not entirely sure why. We'd probably need someone from DOM to help answer that. I'm actually not sure we want browsingContext.top in this case - we probably want the <xul:browser> that hosts the UI and no further.

This sounds right.

> And _then_, we need to make sure that <xul:browser> has its `selectmenulist` attribute set to "ContentSelectDropdown".
> 
> And _then_ I think it'd work.

OK, thanks for digging into this!

Back to Bug 1663366 Comment 6