diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 9ffea09eef07..78a7b3a2c9d7 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -254,7 +254,6 @@ #include "mozilla/dom/DocGroup.h" #include "mozilla/dom/TabGroup.h" #ifdef MOZ_XUL -#include "mozilla/dom/ContainerBoxObject.h" #include "mozilla/dom/ListBoxObject.h" #include "mozilla/dom/MenuBoxObject.h" #include "mozilla/dom/PopupBoxObject.h" @@ -6494,11 +6493,7 @@ nsIDocument::GetBoxObjectFor(Element* aElement, ErrorResult& aRv) RefPtr tag = BindingManager()->ResolveTag(aElement, &namespaceID); #ifdef MOZ_XUL if (namespaceID == kNameSpaceID_XUL) { - if (tag == nsGkAtoms::browser || - tag == nsGkAtoms::editor || - tag == nsGkAtoms::iframe) { - boxObject = new ContainerBoxObject(); - } else if (tag == nsGkAtoms::menu) { + if (tag == nsGkAtoms::menu) { boxObject = new MenuBoxObject(); } else if (tag == nsGkAtoms::popup || tag == nsGkAtoms::menupopup || diff --git a/dom/webidl/ContainerBoxObject.webidl b/dom/webidl/ContainerBoxObject.webidl deleted file mode 100644 index f2dd9ffa576d..000000000000 --- a/dom/webidl/ContainerBoxObject.webidl +++ /dev/null @@ -1,12 +0,0 @@ - -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -[NoInterfaceObject] -interface ContainerBoxObject : BoxObject { - [ChromeOnly] - readonly attribute nsIDocShell? docShell; -}; diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index afe307c9cd64..413390b46841 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -64,9 +64,6 @@ with Files("ClipboardEvent.webidl"): with Files("ConstantSourceNode.webidl"): BUG_COMPONENT = ("Core", "Web Audio") -with Files("ContainerBoxObject.webidl"): - BUG_COMPONENT = ("Core", "DOM") - with Files("ConvolverNode.webidl"): BUG_COMPONENT = ("Core", "Web Audio") @@ -423,7 +420,6 @@ WEBIDL_FILES = [ 'CompositionEvent.webidl', 'Console.webidl', 'ConstantSourceNode.webidl', - 'ContainerBoxObject.webidl', 'ConvolverNode.webidl', 'Coordinates.webidl', 'CreateOfferRequest.webidl', diff --git a/editor/composer/test/test_bug434998.xul b/editor/composer/test/test_bug434998.xul index 47c38e8cf782..1f3fab7514a7 100644 --- a/editor/composer/test/test_bug434998.xul +++ b/editor/composer/test/test_bug434998.xul @@ -99,7 +99,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=434998 function runTest() { var newEditorElement = document.getElementById("editor"); newEditorElement.makeEditable("html", true); - var docShell = newEditorElement.boxObject.docShell; + var docShell = newEditorElement.docShell; progress = docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebProgress); progressListener = new EditorContentListener(newEditorElement); progress.addProgressListener(progressListener, Ci.nsIWebProgress.NOTIFY_ALL); diff --git a/editor/libeditor/tests/test_bug607584.xul b/editor/libeditor/tests/test_bug607584.xul index 4b5f80fca541..16d815965f7f 100644 --- a/editor/libeditor/tests/test_bug607584.xul +++ b/editor/libeditor/tests/test_bug607584.xul @@ -105,7 +105,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=607584 function runTest() { var newEditorElement = document.getElementById("editor"); newEditorElement.makeEditable("html", true); - var docShell = newEditorElement.boxObject.docShell; + var docShell = newEditorElement.docShell; progress = docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebProgress); progressListener = new EditorContentListener(newEditorElement); progress.addProgressListener(progressListener, Ci.nsIWebProgress.NOTIFY_ALL); diff --git a/editor/libeditor/tests/test_bug616590.xul b/editor/libeditor/tests/test_bug616590.xul index b3f0d8beadae..dfc94b1a8f9e 100644 --- a/editor/libeditor/tests/test_bug616590.xul +++ b/editor/libeditor/tests/test_bug616590.xul @@ -94,7 +94,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616590 function runTest() { var editorElement = document.getElementById("editor"); editorElement.makeEditable("htmlmail", true); - var docShell = editorElement.boxObject.docShell; + var docShell = editorElement.docShell; progress = docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebProgress); progressListener = new EditorContentListener(editorElement); progress.addProgressListener(progressListener, Ci.nsIWebProgress.NOTIFY_ALL); diff --git a/editor/libeditor/tests/test_bug780908.xul b/editor/libeditor/tests/test_bug780908.xul index 359d3f24900d..1e0939d041fd 100644 --- a/editor/libeditor/tests/test_bug780908.xul +++ b/editor/libeditor/tests/test_bug780908.xul @@ -103,7 +103,7 @@ adapted from test_bug607584.xul by Kent James function runTest() { var newEditorElement = document.getElementById("editor"); newEditorElement.makeEditable("html", true); - var docShell = newEditorElement.boxObject.docShell; + var docShell = newEditorElement.docShell; progress = docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebProgress); progressListener = new EditorContentListener(newEditorElement); progress.addProgressListener(progressListener, Ci.nsIWebProgress.NOTIFY_ALL); diff --git a/layout/build/nsLayoutCID.h b/layout/build/nsLayoutCID.h index 4aee7a6582c2..43fce1879220 100644 --- a/layout/build/nsLayoutCID.h +++ b/layout/build/nsLayoutCID.h @@ -35,10 +35,6 @@ #define NS_POPUPBOXOBJECT_CID \ { 0x6c392c62, 0x1ab1, 0x4de7, { 0xbf, 0xc6, 0xed, 0x4f, 0x9f, 0xc7, 0x74, 0x9a } } -// {dca9d7c3-7b6a-4490-ad6d-2699a8d683cd} -#define NS_CONTAINERBOXOBJECT_CID \ -{ 0xdca9d7c3, 0x7b6a, 0x4490, { 0xad, 0x6d, 0x26, 0x99, 0xa8, 0xd6, 0x83, 0xcd } } - // {3B581FD4-3497-426c-8F61-3658B971CB80} #define NS_TREEBOXOBJECT_CID \ { 0x3b581fd4, 0x3497, 0x426c, { 0x8f, 0x61, 0x36, 0x58, 0xb9, 0x71, 0xcb, 0x80 } } diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index ba3bb879bf75..692c7f6a47b8 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -311,7 +311,6 @@ nsresult NS_NewListBoxObject(nsIBoxObject** aResult); nsresult NS_NewScrollBoxObject(nsIBoxObject** aResult); nsresult NS_NewMenuBoxObject(nsIBoxObject** aResult); nsresult NS_NewPopupBoxObject(nsIBoxObject** aResult); -nsresult NS_NewContainerBoxObject(nsIBoxObject** aResult); nsresult NS_NewTreeBoxObject(nsIBoxObject** aResult); #endif @@ -376,7 +375,6 @@ MAKE_CTOR(CreateNewMenuBoxObject, nsIBoxObject, NS_NewMenuBoxObj MAKE_CTOR(CreateNewPopupBoxObject, nsIBoxObject, NS_NewPopupBoxObject) MAKE_CTOR(CreateNewScrollBoxObject, nsIBoxObject, NS_NewScrollBoxObject) MAKE_CTOR(CreateNewTreeBoxObject, nsIBoxObject, NS_NewTreeBoxObject) -MAKE_CTOR(CreateNewContainerBoxObject, nsIBoxObject, NS_NewContainerBoxObject) #endif // MOZ_XUL #ifdef MOZ_XUL @@ -521,7 +519,6 @@ NS_DEFINE_NAMED_CID(NS_BOXOBJECT_CID); NS_DEFINE_NAMED_CID(NS_LISTBOXOBJECT_CID); NS_DEFINE_NAMED_CID(NS_MENUBOXOBJECT_CID); NS_DEFINE_NAMED_CID(NS_POPUPBOXOBJECT_CID); -NS_DEFINE_NAMED_CID(NS_CONTAINERBOXOBJECT_CID); NS_DEFINE_NAMED_CID(NS_SCROLLBOXOBJECT_CID); NS_DEFINE_NAMED_CID(NS_TREEBOXOBJECT_CID); #endif // MOZ_XUL @@ -768,7 +765,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kNS_LISTBOXOBJECT_CID, false, nullptr, CreateNewListBoxObject }, { &kNS_MENUBOXOBJECT_CID, false, nullptr, CreateNewMenuBoxObject }, { &kNS_POPUPBOXOBJECT_CID, false, nullptr, CreateNewPopupBoxObject }, - { &kNS_CONTAINERBOXOBJECT_CID, false, nullptr, CreateNewContainerBoxObject }, { &kNS_SCROLLBOXOBJECT_CID, false, nullptr, CreateNewScrollBoxObject }, { &kNS_TREEBOXOBJECT_CID, false, nullptr, CreateNewTreeBoxObject }, #endif // MOZ_XUL @@ -881,7 +877,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { "@mozilla.org/layout/xul-boxobject-listbox;1", &kNS_LISTBOXOBJECT_CID }, { "@mozilla.org/layout/xul-boxobject-menu;1", &kNS_MENUBOXOBJECT_CID }, { "@mozilla.org/layout/xul-boxobject-popup;1", &kNS_POPUPBOXOBJECT_CID }, - { "@mozilla.org/layout/xul-boxobject-container;1", &kNS_CONTAINERBOXOBJECT_CID }, { "@mozilla.org/layout/xul-boxobject-scrollbox;1", &kNS_SCROLLBOXOBJECT_CID }, { "@mozilla.org/layout/xul-boxobject-tree;1", &kNS_TREEBOXOBJECT_CID }, #endif // MOZ_XUL diff --git a/layout/xul/ContainerBoxObject.cpp b/layout/xul/ContainerBoxObject.cpp deleted file mode 100644 index 09ff302ab00d..000000000000 --- a/layout/xul/ContainerBoxObject.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "mozilla/dom/ContainerBoxObject.h" -#include "mozilla/dom/ContainerBoxObjectBinding.h" -#include "nsCOMPtr.h" -#include "nsIDocShell.h" -#include "nsIContent.h" -#include "nsIDocument.h" -#include "nsIFrame.h" -#include "nsSubDocumentFrame.h" - -namespace mozilla { -namespace dom { - -ContainerBoxObject::ContainerBoxObject() -{ -} - -ContainerBoxObject::~ContainerBoxObject() -{ -} - -JSObject* -ContainerBoxObject::WrapObject(JSContext* aCx, JS::Handle aGivenProto) -{ - return ContainerBoxObjectBinding::Wrap(aCx, this, aGivenProto); -} - -already_AddRefed -ContainerBoxObject::GetDocShell() -{ - nsSubDocumentFrame *subDocFrame = do_QueryFrame(GetFrame(false)); - if (subDocFrame) { - // Ok, the frame for mContent is an nsSubDocumentFrame, it knows how - // to reach the docshell, so ask it... - return do_AddRef(subDocFrame->GetDocShell()); - } - - if (!mContent) { - return nullptr; - } - - // No nsSubDocumentFrame available for mContent, try if there's a mapping - // between mContent's document to mContent's subdocument. - - nsIDocument *doc = mContent->GetComposedDoc(); - - if (!doc) { - return nullptr; - } - - nsIDocument *sub_doc = doc->GetSubDocumentFor(mContent); - - if (!sub_doc) { - return nullptr; - } - - nsCOMPtr result = sub_doc->GetDocShell(); - return result.forget(); -} - -} // namespace dom -} // namespace mozilla - -nsresult -NS_NewContainerBoxObject(nsIBoxObject** aResult) -{ - NS_ADDREF(*aResult = new mozilla::dom::ContainerBoxObject()); - return NS_OK; -} diff --git a/layout/xul/ContainerBoxObject.h b/layout/xul/ContainerBoxObject.h deleted file mode 100644 index d177844ae6a6..000000000000 --- a/layout/xul/ContainerBoxObject.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_dom_ContainerBoxObject_h -#define mozilla_dom_ContainerBoxObject_h - -#include "mozilla/dom/BoxObject.h" -#include "nsIDocShell.h" - -namespace mozilla { -namespace dom { - -class ContainerBoxObject final : public BoxObject -{ -public: - ContainerBoxObject(); - - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - - already_AddRefed GetDocShell(); - -private: - ~ContainerBoxObject(); -}; - -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_ContainerBoxObject_h diff --git a/layout/xul/moz.build b/layout/xul/moz.build index 0d0419e6e2b2..31d1f43b3047 100644 --- a/layout/xul/moz.build +++ b/layout/xul/moz.build @@ -33,7 +33,6 @@ EXPORTS += [ EXPORTS.mozilla.dom += [ 'BoxObject.h', - 'ContainerBoxObject.h', 'ListBoxObject.h', 'MenuBoxObject.h', 'PopupBoxObject.h', @@ -61,7 +60,6 @@ UNIFIED_SOURCES += [ if CONFIG['MOZ_XUL']: UNIFIED_SOURCES += [ - 'ContainerBoxObject.cpp', 'ListBoxObject.cpp', 'MenuBoxObject.cpp', 'nsDeckFrame.cpp', diff --git a/layout/xul/nsListItemFrame.h b/layout/xul/nsListItemFrame.h index 6dfbc20818b3..2f2eb785adf2 100644 --- a/layout/xul/nsListItemFrame.h +++ b/layout/xul/nsListItemFrame.h @@ -7,6 +7,8 @@ #include "mozilla/Attributes.h" #include "nsGridRowLeafFrame.h" +using namespace mozilla; + nsIFrame* NS_NewListItemFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle); diff --git a/layout/xul/nsMenuBarListener.cpp b/layout/xul/nsMenuBarListener.cpp index 05eceaa5b366..6287102c4a85 100644 --- a/layout/xul/nsMenuBarListener.cpp +++ b/layout/xul/nsMenuBarListener.cpp @@ -76,7 +76,7 @@ nsMenuBarListener::nsMenuBarListener(nsMenuBarFrame* aMenuBarFrame, NS_LITERAL_STRING("MozDOMFullscreen:Entered"), this, false); // Needs to listen to the deactivate event of the window. - RefPtr topWindowEventTarget = + RefPtr topWindowEventTarget = nsContentUtils::GetWindowRoot(aMenuBarContent->GetComposedDoc()); mTopWindowEventTarget = topWindowEventTarget.get(); diff --git a/layout/xul/nsMenuFrame.cpp b/layout/xul/nsMenuFrame.cpp index 0222f7c6ce94..8698122ff998 100644 --- a/layout/xul/nsMenuFrame.cpp +++ b/layout/xul/nsMenuFrame.cpp @@ -96,7 +96,7 @@ public: domEventToFire.AssignLiteral("DOMMenuItemInactive"); } - RefPtr event = NS_NewDOMEvent(mMenu, mPresContext, nullptr); + RefPtr event = NS_NewDOMEvent(mMenu, mPresContext, nullptr); event->InitEvent(domEventToFire, true, true); event->SetTrusted(true); diff --git a/layout/xul/nsResizerFrame.cpp b/layout/xul/nsResizerFrame.cpp index 10e3ec04ebb0..b2e33c1df657 100644 --- a/layout/xul/nsResizerFrame.cpp +++ b/layout/xul/nsResizerFrame.cpp @@ -541,7 +541,7 @@ nsResizerFrame::MouseClicked(WidgetMouseEvent* aEvent) bool isControl = false; bool isAlt = false; bool isMeta = false; - uint16_t inputSource = MouseEventBinding::MOZ_SOURCE_UNKNOWN; + uint16_t inputSource = dom::MouseEventBinding::MOZ_SOURCE_UNKNOWN; if(aEvent) { isShift = aEvent->IsShift(); diff --git a/layout/xul/nsStackFrame.cpp b/layout/xul/nsStackFrame.cpp index 9f0b4c0f450e..41cd2927b89e 100644 --- a/layout/xul/nsStackFrame.cpp +++ b/layout/xul/nsStackFrame.cpp @@ -22,6 +22,8 @@ #include "nsStackLayout.h" #include "nsDisplayList.h" +using namespace mozilla; + nsIFrame* NS_NewStackFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle) {