Closed Bug 1351217 Opened 3 years ago Closed 3 years ago

Preemptively fix unified build bustage in layout/xul

Categories

(Core :: Layout, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

This bug is one in a series of "fix latent missing-#include/declaration/namespace compile errors which are currently being hidden by unified builds" issues. (This is worth doing periodically, because otherwise these issues are just landmines that get discovered when we add new .cpp files or make another change that reshuffles the unification.)

This one's for layout/xul.
Comment on attachment 8851923 [details]
Bug 1351217: Add missing includes to fix latent unified bustage in layout/xul.

https://reviewboard.mozilla.org/r/124174/#review126688

::: layout/xul/ContainerBoxObject.h:11
(Diff revision 1)
>  
>  #ifndef mozilla_dom_ContainerBoxObject_h
>  #define mozilla_dom_ContainerBoxObject_h
>  
>  #include "mozilla/dom/BoxObject.h"
> +#include "nsIDocShell.h"

This is to address this error for a line further down in this file:
 $OBJ/dist/include/mozilla/dom/ContainerBoxObject.h:22:20: error: use of undeclared identifier 'nsIDocShell'
   already_AddRefed<nsIDocShell> GetDocShell();
                    ^

::: layout/xul/nsButtonBoxFrame.cpp:8
(Diff revision 1)
>   * 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 "nsCOMPtr.h"
>  #include "nsButtonBoxFrame.h"
>  #include "nsIContent.h"
> +#include "nsIDOMEvent.h"

This is to address this error:
 $SRC/layout/xul/nsButtonBoxFrame.cpp:36:9: error: member access into incomplete type 'nsIDOMEvent'
   aEvent->GetType(eventType);
         ^

::: layout/xul/nsMenuBarListener.cpp:10
(Diff revision 1)
>  
>  #include "nsMenuBarListener.h"
>  #include "nsMenuBarFrame.h"
>  #include "nsMenuPopupFrame.h"
>  #include "nsIDOMEvent.h"
> +#include "nsPIWindowRoot.h"

This is to address this error:

 $OBJ/dist/include/mozilla/RefPtr.h:129:7: error: cannot initialize a member subobject of type 'mozilla::dom::EventTarget *' with an rvalue of type 'nsPIWindowRoot *'
     : mRawPtr(aSmartPtr.take())
       ^       ~~~~~~~~~~~~~~~~
 $SRC/layout/xul/nsMenuBarListener.cpp:73:5: note: in instantiation of function template specialization 'RefPtr<mozilla::dom::EventTarget>::RefPtr<nsPIWindowRoot>' requested here
     nsContentUtils::GetWindowRoot(aMenuBarContent->GetComposedDoc());
     ^

::: layout/xul/nsMenuPopupFrame.cpp:21
(Diff revision 1)
>  #include "nsWidgetsCID.h"
>  #include "nsMenuFrame.h"
>  #include "nsMenuBarFrame.h"
>  #include "nsPopupSetFrame.h"
>  #include "nsPIDOMWindow.h"
> +#include "nsIDOMEvent.h"

This is to address:
 $SRC/layout/xul/nsMenuPopupFrame.cpp:368:9: error: member access into incomplete type 'nsIDOMEvent'
   aEvent->GetTarget(getter_AddRefs(eventTarget));
         ^

::: layout/xul/nsMenuPopupFrame.cpp:24
(Diff revision 1)
>  #include "nsPopupSetFrame.h"
>  #include "nsPIDOMWindow.h"
> +#include "nsIDOMEvent.h"
>  #include "nsIDOMKeyEvent.h"
>  #include "nsIDOMScreen.h"
> +#include "nsIDOMXULMenuListElement.h"

This is to address a bunch of errors that start with:
 $OBJ/dist/include/nsCOMPtr.h:519:45: error: incomplete type 'nsIDOMHTMLMenuElement' named in nested name specifier
     assign_from_qi(aQI, NS_GET_TEMPLATE_IID(T));
                         ~~~~~~~~~~~~~~~~~~~~^~

::: layout/xul/nsMenuPopupFrame.cpp:58
(Diff revision 1)
>  #include "mozilla/EventStates.h"
>  #include "mozilla/Preferences.h"
>  #include "mozilla/LookAndFeel.h"
>  #include "mozilla/MouseEvents.h"
>  #include "mozilla/dom/Element.h"
> +#include "mozilla/dom/Event.h"

This is to address:
 $SRC/layout/xul/nsMenuPopupFrame.cpp:2033:23: error: member access into incomplete type 'mozilla::dom::Event'
   aKeyEvent->AsEvent()->GetTimeStamp(&keyTime);
                       ^
Comment on attachment 8851923 [details]
Bug 1351217: Add missing includes to fix latent unified bustage in layout/xul.

https://reviewboard.mozilla.org/r/124174/#review126770
Attachment #8851923 - Flags: review?(mats) → review+
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eee63e31b97a
Add missing includes to fix latent unified bustage in layout/xul. r=mats
https://hg.mozilla.org/mozilla-central/rev/eee63e31b97a
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Core → Core Graveyard
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.