Bug 1634474. Make `dom/html/` buildable outside of `unified-build` environment. r=farre

Differential Revision: https://phabricator.services.mozilla.com/D73309
This commit is contained in:
Jonathan Watt 2020-05-04 14:29:02 +00:00
Родитель 0fe99be5b1
Коммит 468b918bcd
15 изменённых файлов: 58 добавлений и 43 удалений

Просмотреть файл

@ -29,8 +29,6 @@ class EventTarget;
class KeyboardEvent;
} // namespace dom
using namespace dom;
class KeyEventHandler;
/**
@ -42,7 +40,7 @@ class KeyEventHandler;
*/
class GlobalKeyListener : public nsIDOMEventListener {
public:
explicit GlobalKeyListener(EventTarget* aTarget);
explicit GlobalKeyListener(dom::EventTarget* aTarget);
void InstallKeyboardEventListenersTo(
EventListenerManager* aEventListenerManager);
@ -56,33 +54,33 @@ class GlobalKeyListener : public nsIDOMEventListener {
virtual ~GlobalKeyListener() = default;
MOZ_CAN_RUN_SCRIPT
void WalkHandlers(KeyboardEvent* aKeyEvent);
void WalkHandlers(dom::KeyboardEvent* aKeyEvent);
// walk the handlers, looking for one to handle the event
MOZ_CAN_RUN_SCRIPT
bool WalkHandlersInternal(KeyboardEvent* aKeyEvent, bool aExecute,
bool WalkHandlersInternal(dom::KeyboardEvent* aKeyEvent, bool aExecute,
bool* aOutReservedForChrome = nullptr);
// walk the handlers for aEvent, aCharCode and aIgnoreModifierState. Execute
// it if aExecute = true.
MOZ_CAN_RUN_SCRIPT
bool WalkHandlersAndExecute(KeyboardEvent* aKeyEvent, uint32_t aCharCode,
bool WalkHandlersAndExecute(dom::KeyboardEvent* aKeyEvent, uint32_t aCharCode,
const IgnoreModifierState& aIgnoreModifierState,
bool aExecute,
bool* aOutReservedForChrome = nullptr);
// HandleEvent function for the capturing phase in the default event group.
MOZ_CAN_RUN_SCRIPT
void HandleEventOnCaptureInDefaultEventGroup(KeyboardEvent* aEvent);
void HandleEventOnCaptureInDefaultEventGroup(dom::KeyboardEvent* aEvent);
// HandleEvent function for the capturing phase in the system event group.
MOZ_CAN_RUN_SCRIPT
void HandleEventOnCaptureInSystemEventGroup(KeyboardEvent* aEvent);
void HandleEventOnCaptureInSystemEventGroup(dom::KeyboardEvent* aEvent);
// Check if any handler would handle the given event. Optionally returns
// whether the command handler for the event is marked with the "reserved"
// attribute.
MOZ_CAN_RUN_SCRIPT
bool HasHandlerForEvent(KeyboardEvent* aEvent,
bool HasHandlerForEvent(dom::KeyboardEvent* aEvent,
bool* aOutReservedForChrome = nullptr);
// Returns true if the key would be reserved for the given handler. A reserved
@ -99,12 +97,12 @@ class GlobalKeyListener : public nsIDOMEventListener {
virtual bool IsDisabled() const { return false; }
virtual already_AddRefed<EventTarget> GetHandlerTarget(
virtual already_AddRefed<dom::EventTarget> GetHandlerTarget(
KeyEventHandler* aHandler) {
return do_AddRef(mTarget);
}
EventTarget* mTarget; // weak ref;
dom::EventTarget* mTarget; // weak ref;
KeyEventHandler* mHandler; // Linked list of event handlers.
};
@ -117,10 +115,11 @@ class GlobalKeyListener : public nsIDOMEventListener {
*/
class XULKeySetGlobalKeyListener final : public GlobalKeyListener {
public:
explicit XULKeySetGlobalKeyListener(Element* aElement, EventTarget* aTarget);
explicit XULKeySetGlobalKeyListener(dom::Element* aElement,
dom::EventTarget* aTarget);
static void AttachKeyHandler(Element* aElementTarget);
static void DetachKeyHandler(Element* aElementTarget);
static void AttachKeyHandler(dom::Element* aElementTarget);
static void DetachKeyHandler(dom::Element* aElementTarget);
protected:
virtual ~XULKeySetGlobalKeyListener();
@ -129,14 +128,14 @@ class XULKeySetGlobalKeyListener final : public GlobalKeyListener {
// unless the element has been removed from the document. Optionally returns
// whether the disabled attribute is set on the element (assuming the element
// is non-null).
Element* GetElement(bool* aIsDisabled = nullptr) const;
dom::Element* GetElement(bool* aIsDisabled = nullptr) const;
virtual void EnsureHandlers() override;
virtual bool CanHandle(KeyEventHandler* aHandler,
bool aWillExecute) const override;
virtual bool IsDisabled() const override;
virtual already_AddRefed<EventTarget> GetHandlerTarget(
virtual already_AddRefed<dom::EventTarget> GetHandlerTarget(
KeyEventHandler* aHandler) override;
/**
@ -149,13 +148,13 @@ class XULKeySetGlobalKeyListener final : public GlobalKeyListener {
* @return true if the handler is valid. Otherwise, false.
*/
bool GetElementForHandler(KeyEventHandler* aHandler,
Element** aElementForHandler) const;
dom::Element** aElementForHandler) const;
/**
* IsExecutableElement() returns true if aElement is executable.
* Otherwise, false. aElement should be a command element or a key element.
*/
bool IsExecutableElement(Element* aElement) const;
bool IsExecutableElement(dom::Element* aElement) const;
// Using weak pointer to the DOM Element.
nsWeakPtr mWeakPtrForElement;
@ -169,9 +168,9 @@ class XULKeySetGlobalKeyListener final : public GlobalKeyListener {
*/
class RootWindowGlobalKeyListener final : public GlobalKeyListener {
public:
explicit RootWindowGlobalKeyListener(EventTarget* aTarget);
explicit RootWindowGlobalKeyListener(dom::EventTarget* aTarget);
static void AttachKeyHandler(EventTarget* aTarget);
static void AttachKeyHandler(dom::EventTarget* aTarget);
static layers::KeyboardMap CollectKeyboardShortcuts();

Просмотреть файл

@ -35,8 +35,6 @@ class KeyboardEvent;
class Element;
} // namespace dom
using namespace dom;
// Values of the reserved attribute. When unset, the default value depends on
// the permissions.default.shortcuts preference.
enum ReservedKey : uint8_t {
@ -48,7 +46,8 @@ enum ReservedKey : uint8_t {
class KeyEventHandler final {
public:
// This constructor is used only by XUL key handlers (e.g., <key>)
explicit KeyEventHandler(Element* aHandlerElement, ReservedKey aReserved);
explicit KeyEventHandler(dom::Element* aHandlerElement,
ReservedKey aReserved);
// This constructor is used for keyboard handlers for browser, editor, input
// and textarea elements.
@ -72,10 +71,11 @@ class KeyEventHandler final {
// if aCharCode is not zero, it is used instead of the charCode of
// aKeyEventHandler.
bool KeyEventMatched(KeyboardEvent* aDomKeyboardEvent, uint32_t aCharCode,
bool KeyEventMatched(dom::KeyboardEvent* aDomKeyboardEvent,
uint32_t aCharCode,
const IgnoreModifierState& aIgnoreModifierState);
already_AddRefed<Element> GetHandlerElement();
already_AddRefed<dom::Element> GetHandlerElement();
ReservedKey GetIsReserved() { return mReserved; }
@ -83,7 +83,7 @@ class KeyEventHandler final {
void SetNextHandler(KeyEventHandler* aHandler) { mNextHandler = aHandler; }
MOZ_CAN_RUN_SCRIPT
nsresult ExecuteHandler(EventTarget* aTarget, Event* aEvent);
nsresult ExecuteHandler(dom::EventTarget* aTarget, dom::Event* aEvent);
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
@ -99,10 +99,10 @@ class KeyEventHandler final {
}
}
already_AddRefed<nsIController> GetController(EventTarget* aTarget);
already_AddRefed<nsIController> GetController(dom::EventTarget* aTarget);
inline int32_t GetMatchingKeyCode(const nsAString& aKeyName);
void ConstructPrototype(Element* aKeyElement,
void ConstructPrototype(dom::Element* aKeyElement,
const char16_t* aEvent = nullptr,
const char16_t* aCommand = nullptr,
const char16_t* aKeyCode = nullptr,
@ -111,14 +111,14 @@ class KeyEventHandler final {
void BuildModifiers(nsAString& aModifiers);
void ReportKeyConflict(const char16_t* aKey, const char16_t* aModifiers,
Element* aKeyElement, const char* aMessageName);
dom::Element* aKeyElement, const char* aMessageName);
void GetEventType(nsAString& aEvent);
bool ModifiersMatchMask(UIEvent* aEvent,
bool ModifiersMatchMask(dom::UIEvent* aEvent,
const IgnoreModifierState& aIgnoreModifierState);
MOZ_CAN_RUN_SCRIPT
nsresult DispatchXBLCommand(EventTarget* aTarget, Event* aEvent);
nsresult DispatchXBLCommand(dom::EventTarget* aTarget, dom::Event* aEvent);
MOZ_CAN_RUN_SCRIPT
nsresult DispatchXULKeyCommand(Event* aEvent);
nsresult DispatchXULKeyCommand(dom::Event* aEvent);
Modifiers GetModifiers() const;
Modifiers GetModifiersMask() const;

Просмотреть файл

@ -6,6 +6,7 @@
#include "HTMLFormSubmission.h"
#include "HTMLFormElement.h"
#include "nsCOMPtr.h"
#include "nsIForm.h"
#include "mozilla/dom/Document.h"

Просмотреть файл

@ -7,6 +7,7 @@
#include "mozilla/dom/HTMLHRElement.h"
#include "mozilla/dom/HTMLHRElementBinding.h"
#include "nsCSSProps.h"
#include "nsStyleConsts.h"
#include "mozilla/MappedDeclarations.h"

Просмотреть файл

@ -13,6 +13,7 @@
#include "mozilla/dom/HTMLLabelElementBinding.h"
#include "mozilla/dom/MouseEventBinding.h"
#include "nsFocusManager.h"
#include "nsIFrame.h"
#include "nsContentUtils.h"
#include "nsQueryObject.h"
#include "mozilla/dom/ShadowRoot.h"

Просмотреть файл

@ -5,6 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/HTMLOptionElement.h"
#include "HTMLOptGroupElement.h"
#include "mozilla/dom/HTMLOptionElementBinding.h"
#include "mozilla/dom/HTMLSelectElement.h"
#include "nsGkAtoms.h"

Просмотреть файл

@ -9,6 +9,7 @@
#include "mozilla/MappedDeclarations.h"
#include "nsAttrValueInlines.h"
#include "nsMappedAttributes.h"
#include "nsStyleConsts.h"
#include "mozilla/dom/HTMLTableCaptionElementBinding.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(TableCaption)

Просмотреть файл

@ -5,6 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/HTMLVideoElement.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/dom/HTMLVideoElementBinding.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"

Просмотреть файл

@ -12,6 +12,7 @@
#include "mozilla/dom/ImageDocumentBinding.h"
#include "mozilla/dom/HTMLImageElement.h"
#include "mozilla/dom/MouseEvent.h"
#include "mozilla/LoadInfo.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_privacy.h"
#include "nsRect.h"
@ -137,9 +138,7 @@ ImageDocument::ImageDocument()
mTitleUpdateInProgress(false),
mHasCustomTitle(false),
mOriginalZoomLevel(1.0),
mOriginalResolution(1.0)
{
}
mOriginalResolution(1.0) {}
ImageDocument::~ImageDocument() = default;

Просмотреть файл

@ -7,6 +7,7 @@
#ifndef mozilla_dom_ValidityState_h
#define mozilla_dom_ValidityState_h
#include "nsCOMPtr.h"
#include "nsIConstraintValidation.h"
#include "nsWrapperCache.h"
#include "js/TypeDecls.h"

Просмотреть файл

@ -12,15 +12,15 @@
#include "mozilla/dom/HTMLInputElement.h"
#include "nsDOMTokenList.h"
namespace mozilla {
namespace dom {
const double DateTimeInputTypeBase::kMinimumYear = 1;
const double DateTimeInputTypeBase::kMaximumYear = 275760;
const double DateTimeInputTypeBase::kMaximumMonthInMaximumYear = 9;
const double DateTimeInputTypeBase::kMaximumWeekInMaximumYear = 37;
const double DateTimeInputTypeBase::kMsPerDay = 24 * 60 * 60 * 1000;
using namespace mozilla;
using namespace mozilla::dom;
bool DateTimeInputTypeBase::IsMutable() const {
return !mInputElement->IsDisabled() &&
!mInputElement->HasAttr(kNameSpaceID_None, nsGkAtoms::readonly);
@ -501,3 +501,6 @@ bool DateTimeLocalInputType::ConvertNumberToString(
return true;
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -13,6 +13,7 @@
#include "mozilla/dom/DateTimeInputTypes.h"
#include "mozilla/dom/FileInputType.h"
#include "mozilla/dom/HiddenInputType.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/NumericInputTypes.h"
#include "mozilla/dom/SingleLineTextInputTypes.h"

Просмотреть файл

@ -4,12 +4,14 @@
* 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 "nsHTMLDNSPrefetch.h"
#include "base/basictypes.h"
#include "mozilla/dom/Element.h"
#include "mozilla/net/NeckoCommon.h"
#include "mozilla/net/NeckoChild.h"
#include "nsURLHelper.h"
#include "nsHTMLDNSPrefetch.h"
#include "nsCOMPtr.h"
#include "nsString.h"

Просмотреть файл

@ -7,13 +7,14 @@
#ifndef nsHTMLDNSPrefetch_h___
#define nsHTMLDNSPrefetch_h___
#include "mozilla/OriginAttributes.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsIDNSListener.h"
#include "nsIWebProgressListener.h"
#include "nsWeakReference.h"
#include "nsIObserver.h"
#include "nsIRequest.h"
#include "nsIWebProgressListener.h"
#include "nsString.h"
#include "nsWeakReference.h"
class nsITimer;
namespace mozilla {

Просмотреть файл

@ -18,6 +18,7 @@
#include "nsUnicharUtils.h"
#include "nsGlobalWindowInner.h"
#include "nsIHTMLContentSink.h"
#include "nsIProtocolHandler.h"
#include "nsIXMLContentSink.h"
#include "nsHTMLParts.h"
#include "nsHTMLStyleSheet.h"