Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg

Differential Revision: https://phabricator.services.mozilla.com/D93998
This commit is contained in:
Andi-Bogdan Postelnicu 2020-10-21 08:00:18 +00:00
Родитель bb35771d56
Коммит c954c55398
12 изменённых файлов: 94 добавлений и 78 удалений

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

@ -15,4 +15,5 @@ dom/credentialmanagement/
dom/crypto/
dom/debugger/
dom/docs/
dom/encoding/
dom/encoding/
dom/events/

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

@ -15,6 +15,7 @@
#include "mozilla/StaticPrefs_dom.h"
#include "nsIClipboard.h"
#include "nsComponentManagerUtils.h"
#include "nsContentUtils.h"
#include "nsITransferable.h"
#include "nsArrayUtils.h"

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

@ -34,6 +34,7 @@ class EventStateManager;
namespace dom {
class DataTransferItem;
class DataTransferItemList;
class DOMStringList;
class Element;
class FileList;

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

@ -39,6 +39,7 @@
#include "nsContentUtils.h"
#include "nsDOMCID.h"
#include "nsError.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsIContent.h"
#include "nsIContentSecurityPolicy.h"

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

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GlobalKeyListener.h"
#include "EventTarget.h"
#include <utility>
@ -34,7 +35,7 @@ namespace mozilla {
using namespace mozilla::layers;
GlobalKeyListener::GlobalKeyListener(EventTarget* aTarget)
GlobalKeyListener::GlobalKeyListener(dom::EventTarget* aTarget)
: mTarget(aTarget), mHandler(nullptr) {}
NS_IMPL_ISUPPORTS(GlobalKeyListener, nsIDOMEventListener)
@ -51,7 +52,7 @@ static void BuildHandlerChain(nsIContent* aContent, KeyEventHandler** aResult) {
continue;
}
Element* keyElement = key->AsElement();
dom::Element* keyElement = key->AsElement();
// Check whether the key element has empty value at key/char attribute.
// Such element is used by localizers for alternative shortcut key
// definition on the locale. See bug 426501.
@ -83,7 +84,7 @@ static void BuildHandlerChain(nsIContent* aContent, KeyEventHandler** aResult) {
}
}
void GlobalKeyListener::WalkHandlers(KeyboardEvent* aKeyEvent) {
void GlobalKeyListener::WalkHandlers(dom::KeyboardEvent* aKeyEvent) {
if (aKeyEvent->DefaultPrevented()) {
return;
}
@ -189,11 +190,11 @@ void GlobalKeyListener::RemoveKeyboardEventListenersFrom(
}
NS_IMETHODIMP
GlobalKeyListener::HandleEvent(Event* aEvent) {
RefPtr<KeyboardEvent> keyEvent = aEvent->AsKeyboardEvent();
GlobalKeyListener::HandleEvent(dom::Event* aEvent) {
RefPtr<dom::KeyboardEvent> keyEvent = aEvent->AsKeyboardEvent();
NS_ENSURE_TRUE(keyEvent, NS_ERROR_INVALID_ARG);
if (aEvent->EventPhase() == Event_Binding::CAPTURING_PHASE) {
if (aEvent->EventPhase() == dom::Event_Binding::CAPTURING_PHASE) {
if (aEvent->WidgetEventPtr()->mFlags.mInSystemGroup) {
HandleEventOnCaptureInSystemEventGroup(keyEvent);
} else {
@ -239,7 +240,7 @@ GlobalKeyListener::HandleEvent(Event* aEvent) {
}
void GlobalKeyListener::HandleEventOnCaptureInDefaultEventGroup(
KeyboardEvent* aEvent) {
dom::KeyboardEvent* aEvent) {
WidgetKeyboardEvent* widgetKeyboardEvent =
aEvent->WidgetEventPtr()->AsKeyboardEvent();
@ -254,7 +255,7 @@ void GlobalKeyListener::HandleEventOnCaptureInDefaultEventGroup(
}
void GlobalKeyListener::HandleEventOnCaptureInSystemEventGroup(
KeyboardEvent* aEvent) {
dom::KeyboardEvent* aEvent) {
WidgetKeyboardEvent* widgetEvent =
aEvent->WidgetEventPtr()->AsKeyboardEvent();
@ -291,7 +292,7 @@ void GlobalKeyListener::HandleEventOnCaptureInSystemEventGroup(
// true, the handler will be executed; otherwise just return an answer telling
// if a handler for that event was found.
//
bool GlobalKeyListener::WalkHandlersInternal(KeyboardEvent* aKeyEvent,
bool GlobalKeyListener::WalkHandlersInternal(dom::KeyboardEvent* aKeyEvent,
bool aExecute,
bool* aOutReservedForChrome) {
WidgetKeyboardEvent* nativeKeyboardEvent =
@ -319,7 +320,7 @@ bool GlobalKeyListener::WalkHandlersInternal(KeyboardEvent* aKeyEvent,
}
bool GlobalKeyListener::WalkHandlersAndExecute(
KeyboardEvent* aKeyEvent, uint32_t aCharCode,
dom::KeyboardEvent* aKeyEvent, uint32_t aCharCode,
const IgnoreModifierState& aIgnoreModifierState, bool aExecute,
bool* aOutReservedForChrome) {
if (aOutReservedForChrome) {
@ -424,7 +425,7 @@ bool GlobalKeyListener::WalkHandlersAndExecute(
return false;
}
nsCOMPtr<EventTarget> target = GetHandlerTarget(handler);
nsCOMPtr<dom::EventTarget> target = GetHandlerTarget(handler);
// XXX Do we execute only one handler even if the handler neither stops
// propagation nor prevents default of the event?
@ -467,7 +468,7 @@ bool GlobalKeyListener::IsReservedKey(WidgetKeyboardEvent* aKeyEvent,
return nsContentUtils::ShouldBlockReservedKeys(aKeyEvent);
}
bool GlobalKeyListener::HasHandlerForEvent(KeyboardEvent* aEvent,
bool GlobalKeyListener::HasHandlerForEvent(dom::KeyboardEvent* aEvent,
bool* aOutReservedForChrome) {
WidgetKeyboardEvent* widgetKeyboardEvent =
aEvent->WidgetEventPtr()->AsKeyboardEvent();
@ -492,9 +493,10 @@ bool GlobalKeyListener::HasHandlerForEvent(KeyboardEvent* aEvent,
// content, then extra work needs to be done to hook it up to the document (XXX
// WHY??)
//
void XULKeySetGlobalKeyListener::AttachKeyHandler(Element* aElementTarget) {
void XULKeySetGlobalKeyListener::AttachKeyHandler(
dom::Element* aElementTarget) {
// Only attach if we're really in a document
nsCOMPtr<Document> doc = aElementTarget->GetUncomposedDoc();
nsCOMPtr<dom::Document> doc = aElementTarget->GetUncomposedDoc();
if (!doc) {
return;
}
@ -524,9 +526,10 @@ void XULKeySetGlobalKeyListener::AttachKeyHandler(Element* aElementTarget) {
//
// Removes a key handler added by AttachKeyHandler.
//
void XULKeySetGlobalKeyListener::DetachKeyHandler(Element* aElementTarget) {
void XULKeySetGlobalKeyListener::DetachKeyHandler(
dom::Element* aElementTarget) {
// Only attach if we're really in a document
nsCOMPtr<Document> doc = aElementTarget->GetUncomposedDoc();
nsCOMPtr<dom::Document> doc = aElementTarget->GetUncomposedDoc();
if (!doc) {
return;
}
@ -547,14 +550,14 @@ void XULKeySetGlobalKeyListener::DetachKeyHandler(Element* aElementTarget) {
aElementTarget->RemoveProperty(nsGkAtoms::listener);
}
XULKeySetGlobalKeyListener::XULKeySetGlobalKeyListener(Element* aElement,
EventTarget* aTarget)
XULKeySetGlobalKeyListener::XULKeySetGlobalKeyListener(
dom::Element* aElement, dom::EventTarget* aTarget)
: GlobalKeyListener(aTarget) {
mWeakPtrForElement = do_GetWeakReference(aElement);
}
Element* XULKeySetGlobalKeyListener::GetElement(bool* aIsDisabled) const {
RefPtr<Element> element = do_QueryReferent(mWeakPtrForElement);
dom::Element* XULKeySetGlobalKeyListener::GetElement(bool* aIsDisabled) const {
RefPtr<dom::Element> element = do_QueryReferent(mWeakPtrForElement);
if (element && aIsDisabled) {
*aIsDisabled = element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
nsGkAtoms::_true, eCaseMatters);
@ -573,7 +576,7 @@ void XULKeySetGlobalKeyListener::EnsureHandlers() {
return;
}
Element* element = GetElement();
dom::Element* element = GetElement();
if (!element) {
return;
}
@ -583,23 +586,23 @@ void XULKeySetGlobalKeyListener::EnsureHandlers() {
bool XULKeySetGlobalKeyListener::IsDisabled() const {
bool isDisabled;
Element* element = GetElement(&isDisabled);
dom::Element* element = GetElement(&isDisabled);
return element && isDisabled;
}
bool XULKeySetGlobalKeyListener::GetElementForHandler(
KeyEventHandler* aHandler, Element** aElementForHandler) const {
KeyEventHandler* aHandler, dom::Element** aElementForHandler) const {
MOZ_ASSERT(aElementForHandler);
*aElementForHandler = nullptr;
RefPtr<Element> keyElement = aHandler->GetHandlerElement();
RefPtr<dom::Element> keyElement = aHandler->GetHandlerElement();
if (!keyElement) {
// This should only be the case where the <key> element that generated the
// handler has been destroyed. Not sure why we return true here...
return true;
}
nsCOMPtr<Element> chromeHandlerElement = GetElement();
nsCOMPtr<dom::Element> chromeHandlerElement = GetElement();
if (!chromeHandlerElement) {
NS_WARNING_ASSERTION(keyElement->IsInUncomposedDoc(), "uncomposed");
keyElement.swap(*aElementForHandler);
@ -617,12 +620,12 @@ bool XULKeySetGlobalKeyListener::GetElementForHandler(
}
// XXX Shouldn't we check this earlier?
Document* doc = keyElement->GetUncomposedDoc();
dom::Document* doc = keyElement->GetUncomposedDoc();
if (NS_WARN_IF(!doc)) {
return false;
}
nsCOMPtr<Element> commandElement = doc->GetElementById(command);
nsCOMPtr<dom::Element> commandElement = doc->GetElementById(command);
if (!commandElement) {
NS_ERROR(
"A XUL <key> is observing a command that doesn't exist. "
@ -634,7 +637,8 @@ bool XULKeySetGlobalKeyListener::GetElementForHandler(
return true;
}
bool XULKeySetGlobalKeyListener::IsExecutableElement(Element* aElement) const {
bool XULKeySetGlobalKeyListener::IsExecutableElement(
dom::Element* aElement) const {
if (!aElement) {
return false;
}
@ -649,9 +653,9 @@ bool XULKeySetGlobalKeyListener::IsExecutableElement(Element* aElement) const {
return !value.IsEmpty();
}
already_AddRefed<EventTarget> XULKeySetGlobalKeyListener::GetHandlerTarget(
already_AddRefed<dom::EventTarget> XULKeySetGlobalKeyListener::GetHandlerTarget(
KeyEventHandler* aHandler) {
nsCOMPtr<Element> commandElement;
nsCOMPtr<dom::Element> commandElement;
if (!GetElementForHandler(aHandler, getter_AddRefs(commandElement))) {
return nullptr;
}
@ -661,7 +665,7 @@ already_AddRefed<EventTarget> XULKeySetGlobalKeyListener::GetHandlerTarget(
bool XULKeySetGlobalKeyListener::CanHandle(KeyEventHandler* aHandler,
bool aWillExecute) const {
nsCOMPtr<Element> commandElement;
nsCOMPtr<dom::Element> commandElement;
if (!GetElementForHandler(aHandler, getter_AddRefs(commandElement))) {
return false;
}
@ -708,7 +712,7 @@ layers::KeyboardMap RootWindowGlobalKeyListener::CollectKeyboardShortcuts() {
// content, then extra work needs to be done to hook it up to the document (XXX
// WHY??)
//
void RootWindowGlobalKeyListener::AttachKeyHandler(EventTarget* aTarget) {
void RootWindowGlobalKeyListener::AttachKeyHandler(dom::EventTarget* aTarget) {
EventListenerManager* manager = aTarget->GetOrCreateListenerManager();
if (!manager) {
return;
@ -723,7 +727,8 @@ void RootWindowGlobalKeyListener::AttachKeyHandler(EventTarget* aTarget) {
handler->InstallKeyboardEventListenersTo(manager);
}
RootWindowGlobalKeyListener::RootWindowGlobalKeyListener(EventTarget* aTarget)
RootWindowGlobalKeyListener::RootWindowGlobalKeyListener(
dom::EventTarget* aTarget)
: GlobalKeyListener(aTarget) {}
/* static */
@ -750,7 +755,7 @@ bool RootWindowGlobalKeyListener::IsHTMLEditorFocused() {
return false;
}
Document* doc = htmlEditor->GetDocument();
dom::Document* doc = htmlEditor->GetDocument();
if (doc->HasFlag(NODE_IS_EDITABLE)) {
// Don't need to perform any checks in designMode documents.
return true;
@ -763,7 +768,8 @@ bool RootWindowGlobalKeyListener::IsHTMLEditorFocused() {
// the document's selection. Even though the document selection is usually
// collapsed to where the focus is, but the page may modify the selection
// without our knowledge, in which case this check will do something useful.
nsCOMPtr<Element> activeEditingHost = htmlEditor->GetActiveEditingHost();
nsCOMPtr<dom::Element> activeEditingHost =
htmlEditor->GetActiveEditingHost();
if (!activeEditingHost) {
return false;
}

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

@ -21,6 +21,7 @@
#include "nsContentUtils.h"
#include "nsGkAtoms.h"
#include "nsAtom.h"
#include "nsDocShell.h"
#include "nsIContent.h"
#include "mozilla/dom/Document.h"
#include "nsIFrame.h"
@ -386,7 +387,7 @@ void IMEContentObserver::ObserveEditableNode() {
mRootContent->AddMutationObserver(this);
// If it's in a document (should be so), we can use document observer to
// reduce redundant computation of text change offsets.
Document* doc = mRootContent->GetComposedDoc();
dom::Document* doc = mRootContent->GetComposedDoc();
if (doc) {
RefPtr<DocumentObserver> documentObserver = mDocumentObserver;
documentObserver->Observe(doc);
@ -587,7 +588,7 @@ nsresult IMEContentObserver::GetSelectionAndRoot(
return NS_OK;
}
void IMEContentObserver::OnSelectionChange(Selection& aSelection) {
void IMEContentObserver::OnSelectionChange(dom::Selection& aSelection) {
if (!mIsObserving) {
return;
}
@ -2012,12 +2013,12 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(IMEContentObserver::DocumentObserver)
NS_IMPL_CYCLE_COLLECTING_RELEASE(IMEContentObserver::DocumentObserver)
void IMEContentObserver::DocumentObserver::Observe(Document* aDocument) {
void IMEContentObserver::DocumentObserver::Observe(dom::Document* aDocument) {
MOZ_ASSERT(aDocument);
// Guarantee that aDocument won't be destroyed during a call of
// StopObserving().
RefPtr<Document> newDocument = aDocument;
RefPtr<dom::Document> newDocument = aDocument;
StopObserving();
@ -2034,7 +2035,7 @@ void IMEContentObserver::DocumentObserver::StopObserving() {
RefPtr<IMEContentObserver> observer = std::move(mIMEContentObserver);
// Stop observing the document first.
RefPtr<Document> document = std::move(mDocument);
RefPtr<dom::Document> document = std::move(mDocument);
document->RemoveObserver(this);
// Notify IMEContentObserver of ending of document updates if this already
@ -2053,7 +2054,8 @@ void IMEContentObserver::DocumentObserver::Destroy() {
mIMEContentObserver = nullptr;
}
void IMEContentObserver::DocumentObserver::BeginUpdate(Document* aDocument) {
void IMEContentObserver::DocumentObserver::BeginUpdate(
dom::Document* aDocument) {
if (NS_WARN_IF(Destroyed()) || NS_WARN_IF(!IsObserving())) {
return;
}
@ -2061,7 +2063,7 @@ void IMEContentObserver::DocumentObserver::BeginUpdate(Document* aDocument) {
mIMEContentObserver->BeginDocumentUpdate();
}
void IMEContentObserver::DocumentObserver::EndUpdate(Document* aDocument) {
void IMEContentObserver::DocumentObserver::EndUpdate(dom::Document* aDocument) {
if (NS_WARN_IF(Destroyed()) || NS_WARN_IF(!IsObserving()) ||
NS_WARN_IF(!IsUpdating())) {
return;

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

@ -13,6 +13,7 @@
#include "mozilla/EditorBase.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStates.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_dom.h"

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

@ -70,7 +70,7 @@ const int32_t KeyEventHandler::cOSMask = (1 << 9);
const int32_t KeyEventHandler::cAllModifiers =
cShiftMask | cAltMask | cControlMask | cMetaMask | cOSMask;
KeyEventHandler::KeyEventHandler(Element* aHandlerElement,
KeyEventHandler::KeyEventHandler(dom::Element* aHandlerElement,
ReservedKey aReserved)
: mHandlerElement(nullptr),
mIsXULKey(true),
@ -156,9 +156,9 @@ bool KeyEventHandler::TryConvertToKeyboardShortcut(
return true;
}
already_AddRefed<Element> KeyEventHandler::GetHandlerElement() {
already_AddRefed<dom::Element> KeyEventHandler::GetHandlerElement() {
if (mIsXULKey) {
nsCOMPtr<Element> element = do_QueryReferent(mHandlerElement);
nsCOMPtr<dom::Element> element = do_QueryReferent(mHandlerElement);
return element.forget();
}
@ -178,14 +178,15 @@ void KeyEventHandler::InitAccessKeys() {
#ifdef XP_MACOSX
kMenuAccessKey = 0;
#else
kMenuAccessKey = KeyboardEvent_Binding::DOM_VK_ALT;
kMenuAccessKey = dom::KeyboardEvent_Binding::DOM_VK_ALT;
#endif
// Get the menu access key value from prefs, overriding the default:
kMenuAccessKey = Preferences::GetInt("ui.key.menuAccessKey", kMenuAccessKey);
}
nsresult KeyEventHandler::ExecuteHandler(EventTarget* aTarget, Event* aEvent) {
nsresult KeyEventHandler::ExecuteHandler(dom::EventTarget* aTarget,
dom::Event* aEvent) {
// In both cases the union should be defined.
if (!mHandlerElement) {
return NS_ERROR_FAILURE;
@ -204,8 +205,8 @@ nsresult KeyEventHandler::ExecuteHandler(EventTarget* aTarget, Event* aEvent) {
return DispatchXBLCommand(aTarget, aEvent);
}
nsresult KeyEventHandler::DispatchXBLCommand(EventTarget* aTarget,
Event* aEvent) {
nsresult KeyEventHandler::DispatchXBLCommand(dom::EventTarget* aTarget,
dom::Event* aEvent) {
// This is a special-case optimization to make command handling fast.
// It isn't really a part of XBL, but it helps speed things up.
@ -232,7 +233,7 @@ nsresult KeyEventHandler::DispatchXBLCommand(EventTarget* aTarget,
privateWindow = do_QueryInterface(aTarget);
if (!privateWindow) {
nsCOMPtr<nsIContent> elt(do_QueryInterface(aTarget));
nsCOMPtr<Document> doc;
nsCOMPtr<dom::Document> doc;
// XXXbz sXBL/XBL2 issue -- this should be the "scope doc" or
// something... whatever we use when wrapping DOM nodes
// normally. It's not clear that the owner doc is the right
@ -274,7 +275,7 @@ nsresult KeyEventHandler::DispatchXBLCommand(EventTarget* aTarget,
aEvent->PreventDefault();
if (mEventName == nsGkAtoms::keypress &&
mDetail == KeyboardEvent_Binding::DOM_VK_SPACE && mMisc == 1) {
mDetail == dom::KeyboardEvent_Binding::DOM_VK_SPACE && mMisc == 1) {
// get the focused element so that we can pageDown only at
// certain times.
@ -314,8 +315,8 @@ nsresult KeyEventHandler::DispatchXBLCommand(EventTarget* aTarget,
return NS_OK;
}
nsresult KeyEventHandler::DispatchXULKeyCommand(Event* aEvent) {
nsCOMPtr<Element> handlerElement = GetHandlerElement();
nsresult KeyEventHandler::DispatchXULKeyCommand(dom::Event* aEvent) {
nsCOMPtr<dom::Element> handlerElement = GetHandlerElement();
NS_ENSURE_STATE(handlerElement);
if (handlerElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
nsGkAtoms::_true, eCaseMatters)) {
@ -326,7 +327,7 @@ nsresult KeyEventHandler::DispatchXULKeyCommand(Event* aEvent) {
aEvent->PreventDefault();
// Copy the modifiers from the key event.
RefPtr<KeyboardEvent> domKeyboardEvent = aEvent->AsKeyboardEvent();
RefPtr<dom::KeyboardEvent> domKeyboardEvent = aEvent->AsKeyboardEvent();
if (!domKeyboardEvent) {
NS_ERROR("Trying to execute a key handler for a non-key event!");
return NS_ERROR_FAILURE;
@ -389,7 +390,7 @@ Modifiers KeyEventHandler::GetModifiersMask() const {
}
already_AddRefed<nsIController> KeyEventHandler::GetController(
EventTarget* aTarget) {
dom::EventTarget* aTarget) {
// XXX Fix this so there's a generic interface that describes controllers,
// This code should have no special knowledge of what objects might have
// controllers.
@ -402,16 +403,16 @@ already_AddRefed<nsIController> KeyEventHandler::GetController(
}
if (!controllers) {
HTMLTextAreaElement* htmlTextArea =
HTMLTextAreaElement::FromNode(targetContent);
dom::HTMLTextAreaElement* htmlTextArea =
dom::HTMLTextAreaElement::FromNode(targetContent);
if (htmlTextArea) {
htmlTextArea->GetControllers(getter_AddRefs(controllers));
}
}
if (!controllers) {
HTMLInputElement* htmlInputElement =
HTMLInputElement::FromNode(targetContent);
dom::HTMLInputElement* htmlInputElement =
dom::HTMLInputElement::FromNode(targetContent);
if (htmlInputElement) {
htmlInputElement->GetControllers(getter_AddRefs(controllers));
}
@ -436,7 +437,7 @@ already_AddRefed<nsIController> KeyEventHandler::GetController(
}
bool KeyEventHandler::KeyEventMatched(
KeyboardEvent* aDomKeyboardEvent, uint32_t aCharCode,
dom::KeyboardEvent* aDomKeyboardEvent, uint32_t aCharCode,
const IgnoreModifierState& aIgnoreModifierState) {
if (mDetail != -1) {
// Get the keycode or charcode of the key event.
@ -501,16 +502,16 @@ int32_t KeyEventHandler::GetMatchingKeyCode(const nsAString& aKeyName) {
int32_t KeyEventHandler::KeyToMask(int32_t key) {
switch (key) {
case KeyboardEvent_Binding::DOM_VK_META:
case dom::KeyboardEvent_Binding::DOM_VK_META:
return cMeta | cMetaMask;
case KeyboardEvent_Binding::DOM_VK_WIN:
case dom::KeyboardEvent_Binding::DOM_VK_WIN:
return cOS | cOSMask;
case KeyboardEvent_Binding::DOM_VK_ALT:
case dom::KeyboardEvent_Binding::DOM_VK_ALT:
return cAlt | cAltMask;
case KeyboardEvent_Binding::DOM_VK_CONTROL:
case dom::KeyboardEvent_Binding::DOM_VK_CONTROL:
default:
return cControl | cControlMask;
}
@ -521,13 +522,13 @@ int32_t KeyEventHandler::KeyToMask(int32_t key) {
int32_t KeyEventHandler::AccelKeyMask() {
switch (WidgetInputEvent::AccelModifier()) {
case MODIFIER_ALT:
return KeyToMask(KeyboardEvent_Binding::DOM_VK_ALT);
return KeyToMask(dom::KeyboardEvent_Binding::DOM_VK_ALT);
case MODIFIER_CONTROL:
return KeyToMask(KeyboardEvent_Binding::DOM_VK_CONTROL);
return KeyToMask(dom::KeyboardEvent_Binding::DOM_VK_CONTROL);
case MODIFIER_META:
return KeyToMask(KeyboardEvent_Binding::DOM_VK_META);
return KeyToMask(dom::KeyboardEvent_Binding::DOM_VK_META);
case MODIFIER_OS:
return KeyToMask(KeyboardEvent_Binding::DOM_VK_WIN);
return KeyToMask(dom::KeyboardEvent_Binding::DOM_VK_WIN);
default:
MOZ_CRASH("Handle the new result of WidgetInputEvent::AccelModifier()");
return 0;
@ -535,7 +536,7 @@ int32_t KeyEventHandler::AccelKeyMask() {
}
void KeyEventHandler::GetEventType(nsAString& aEvent) {
nsCOMPtr<Element> handlerElement = GetHandlerElement();
nsCOMPtr<dom::Element> handlerElement = GetHandlerElement();
if (!handlerElement) {
aEvent.Truncate();
return;
@ -549,7 +550,7 @@ void KeyEventHandler::GetEventType(nsAString& aEvent) {
}
}
void KeyEventHandler::ConstructPrototype(Element* aKeyElement,
void KeyEventHandler::ConstructPrototype(dom::Element* aKeyElement,
const char16_t* aEvent,
const char16_t* aCommand,
const char16_t* aKeyCode,
@ -666,9 +667,9 @@ void KeyEventHandler::BuildModifiers(nsAString& aModifiers) {
void KeyEventHandler::ReportKeyConflict(const char16_t* aKey,
const char16_t* aModifiers,
Element* aKeyElement,
dom::Element* aKeyElement,
const char* aMessageName) {
nsCOMPtr<Document> doc = aKeyElement->OwnerDoc();
nsCOMPtr<dom::Document> doc = aKeyElement->OwnerDoc();
nsAutoString id;
aKeyElement->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id);
@ -677,13 +678,13 @@ void KeyEventHandler::ReportKeyConflict(const char16_t* aKey,
params.AppendElement(aModifiers);
params.AppendElement(id);
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"Key Event Handler"_ns, doc,
"Key dom::Event Handler"_ns, doc,
nsContentUtils::eDOM_PROPERTIES, aMessageName,
params, nullptr, u""_ns, 0);
}
bool KeyEventHandler::ModifiersMatchMask(
UIEvent* aEvent, const IgnoreModifierState& aIgnoreModifierState) {
dom::UIEvent* aEvent, const IgnoreModifierState& aIgnoreModifierState) {
WidgetInputEvent* inputEvent = aEvent->WidgetEventPtr()->AsInputEvent();
NS_ENSURE_TRUE(inputEvent, false);

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

@ -6,6 +6,7 @@
#include "mozilla/dom/StorageEvent.h"
#include "mozilla/dom/Storage.h"
#include "mozilla/dom/StorageEventBinding.h"
namespace mozilla {
namespace dom {

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

@ -12,6 +12,7 @@
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "nsCycleCollectionParticipant.h"
#include "nsPIDOMWindow.h"
#include "nsWrapperCache.h"
namespace mozilla {

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

@ -682,7 +682,7 @@ RawRangeBoundary TextComposition::GetStartRef() const {
SelectionType::eIMERawClause, SelectionType::eIMESelectedRawClause,
SelectionType::eIMEConvertedClause, SelectionType::eIMESelectedClause};
for (auto selectionType : kIMESelectionTypes) {
Selection* selection =
dom::Selection* selection =
selectionController->GetSelection(ToRawSelectionType(selectionType));
if (!selection) {
continue;
@ -739,7 +739,7 @@ RawRangeBoundary TextComposition::GetEndRef() const {
SelectionType::eIMERawClause, SelectionType::eIMESelectedRawClause,
SelectionType::eIMEConvertedClause, SelectionType::eIMESelectedClause};
for (auto selectionType : kIMESelectionTypes) {
Selection* selection =
dom::Selection* selection =
selectionController->GetSelection(ToRawSelectionType(selectionType));
if (!selection) {
continue;

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

@ -659,7 +659,7 @@ ESMAutoDirWheelDeltaAdjuster::ESMAutoDirWheelDeltaAdjuster(
// current document is an HTML document.
dom::Document* document = aScrollFrame.PresShell()->GetDocument();
if (document) {
Element* bodyElement = document->GetBodyElement();
dom::Element* bodyElement = document->GetBodyElement();
if (bodyElement) {
honouredFrame = bodyElement->GetPrimaryFrame();
}