import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 895274 part.2 Define event messages as anonymous enum with EventMessageList.h r=smaug (44a28d5da)
- Bug 895274 part.1 Rename WidgetEvent::message to WidgetEvent::mMessage r=smaug (1a1651a54)
- Bug 895274 part.170 Rename NS_ANIMATION_EVENT_START to eAnimationEventFirst r=smaug (e3bedfd02)
- some cleanup (c496de395)
- Bug 1186582 - AskPermission should check for prompt exceptions; r=fabrice (e7fc39d0a)
- Bug 1170314 - Make console.timeStamp to add also Gecko profiler markers if Gecko profiler is active, r=baku,benwa (7e78b02c1)
- Bug 1178172 - Fix all compile errors in dom/base on non-unified build. r=baku (ffc87d5ae)
- namespace (93bb2e778)
- Bug 1001158 - Handle an invalid distribution.ini gracefully, r=gijs (260ab12f2)
- Bug 1157760: Remove incorrect MOZ_ASSERT in nsMessageManagerSH<Super>::Enumerate. r=bz (e1d86db8a)
- Bug 1148694 patch 1 - Stop creating a CharsetRule object when parsing @charset rules. r=dbaron (5d3b4a237)
- Bug 1148694 patch 2 - Remove interface and implementation of CSSCharsetRule. r=dbaron (e687d6a51)
- Bug 1148694 patch 3 - remove tests affected by removal of CSSCharsetRule. r=dbaron, r=khuey (84e04ec3c)
- Bug 958778 - De-holder nsIXPConnect::GetWrappedNativePrototype(). r=gabor (e862b0197)
- non-EME part of Bug 1160445 - Add detailed logging for EME promise failures (90c5ae1a1)
- Bug 1191305 - Alphabetize some includes; r=froydnj (6bc41455c)
- Bug 1188640 - Add ChromeOnly MutationObserver.mergeAttributeRecords to speed up devtools, r=bz,bgrins (5f07c777f)
- namespace (0e90aac16)
This commit is contained in:
2022-01-03 11:05:37 +08:00
parent cbefc77b36
commit e283739a59
140 changed files with 1372 additions and 1267 deletions
+21
View File
@@ -37,6 +37,10 @@
#include "nsIWebNavigation.h"
#include "nsIXPConnect.h"
#ifdef MOZ_ENABLE_PROFILER_SPS
#include "nsIProfiler.h"
#endif
// The maximum allowed number of concurrent timers per page.
#define MAX_PAGE_TIMERS 10000
@@ -831,6 +835,23 @@ Console::TimeStamp(JSContext* aCx, const JS::Handle<JS::Value> aData)
return;
}
#ifdef MOZ_ENABLE_PROFILER_SPS
if (aData.isString() && NS_IsMainThread()) {
if (!mProfiler) {
mProfiler = do_GetService("@mozilla.org/tools/profiler;1");
}
if (mProfiler) {
bool active = false;
if (NS_SUCCEEDED(mProfiler->IsActive(&active)) && active) {
nsAutoJSString stringValue;
if (stringValue.init(aCx, aData)) {
mProfiler->AddMarker(NS_ConvertUTF16toUTF8(stringValue).get());
}
}
}
}
#endif
Method(aCx, MethodTimeStamp, NS_LITERAL_STRING("timeStamp"), data);
}
+5
View File
@@ -18,6 +18,8 @@
#include "nsPIDOMWindow.h"
class nsIConsoleAPIStorage;
class nsIPrincipal;
class nsIProfiler;
class nsIXPConnectJSObjectHolder;
namespace mozilla {
@@ -199,6 +201,9 @@ private:
nsCOMPtr<nsPIDOMWindow> mWindow;
nsCOMPtr<nsIConsoleAPIStorage> mStorage;
nsCOMPtr<nsIXPConnectJSObjectHolder> mSandbox;
#ifdef MOZ_ENABLE_PROFILER_SPS
nsCOMPtr<nsIProfiler> mProfiler;
#endif
nsDataHashtable<nsStringHashKey, DOMHighResTimeStamp> mTimerRegistry;
nsDataHashtable<nsStringHashKey, uint32_t> mCounterRegistry;
+12
View File
@@ -674,5 +674,17 @@ DOMException::Create(nsresult aRv)
return inst.forget();
}
/* static */already_AddRefed<DOMException>
DOMException::Create(nsresult aRv, const nsCString& aMessage)
{
nsCString name;
nsCString message;
uint16_t code;
NSResultToNameAndMessage(aRv, name, message, &code);
nsRefPtr<DOMException> inst =
new DOMException(aRv, aMessage, name, code);
return inst.forget();
}
} // namespace dom
} // namespace mozilla
+3
View File
@@ -154,6 +154,9 @@ public:
static already_AddRefed<DOMException>
Create(nsresult aRv);
static already_AddRefed<DOMException>
Create(nsresult aRv, const nsCString& aMessage);
protected:
virtual ~DOMException() {}
+7 -7
View File
@@ -2887,9 +2887,9 @@ Element::CheckHandleEventForLinksPrecondition(EventChainVisitor& aVisitor,
{
if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
(!aVisitor.mEvent->mFlags.mIsTrusted &&
(aVisitor.mEvent->message != NS_MOUSE_CLICK) &&
(aVisitor.mEvent->message != NS_KEY_PRESS) &&
(aVisitor.mEvent->message != NS_UI_ACTIVATE)) ||
(aVisitor.mEvent->mMessage != NS_MOUSE_CLICK) &&
(aVisitor.mEvent->mMessage != NS_KEY_PRESS) &&
(aVisitor.mEvent->mMessage != NS_UI_ACTIVATE)) ||
!aVisitor.mPresContext ||
aVisitor.mEvent->mFlags.mMultipleActionsPrevented) {
return false;
@@ -2904,7 +2904,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
{
// Optimisation: return early if this event doesn't interest us.
// IMPORTANT: this switch and the switch below it must be kept in sync!
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_OVER:
case NS_FOCUS_CONTENT:
case NS_MOUSE_OUT:
@@ -2924,7 +2924,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
// We do the status bar updates in PreHandleEvent so that the status bar gets
// updated even if the event is consumed before we have a chance to set it.
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
// Set the status bar similarly for mouseover and focus
case NS_MOUSE_OVER:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
@@ -2965,7 +2965,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
{
// Optimisation: return early if this event doesn't interest us.
// IMPORTANT: this switch and the switch below it must be kept in sync!
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_CLICK:
case NS_UI_ACTIVATE:
@@ -2983,7 +2983,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
nsresult rv = NS_OK;
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
{
if (aVisitor.mEvent->AsMouseEvent()->button ==
+7 -7
View File
@@ -676,10 +676,10 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
// Don't propagate mouseover and mouseout events when mouse is moving
// inside chrome access only content.
bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree();
if ((aVisitor.mEvent->message == NS_MOUSE_OVER ||
aVisitor.mEvent->message == NS_MOUSE_OUT ||
aVisitor.mEvent->message == NS_POINTER_OVER ||
aVisitor.mEvent->message == NS_POINTER_OUT) &&
if ((aVisitor.mEvent->mMessage == NS_MOUSE_OVER ||
aVisitor.mEvent->mMessage == NS_MOUSE_OUT ||
aVisitor.mEvent->mMessage == NS_POINTER_OVER ||
aVisitor.mEvent->mMessage == NS_POINTER_OUT) &&
// Check if we should stop event propagation when event has just been
// dispatched or when we're about to propagate from
// chrome access only subtree or if we are about to propagate out of
@@ -738,7 +738,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
printf("Stopping %s propagation:"
"\n\toriginalTarget=%s \n\tcurrentTarget=%s %s"
"\n\trelatedTarget=%s %s \n%s",
(aVisitor.mEvent->message == NS_MOUSE_OVER)
(aVisitor.mEvent->mMessage == NS_MOUSE_OVER)
? "mouseover" : "mouseout",
NS_ConvertUTF16toUTF8(ot).get(),
NS_ConvertUTF16toUTF8(ct).get(),
@@ -804,7 +804,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
// scroll
// selectstart
bool stopEvent = false;
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_IMAGE_ABORT:
case NS_LOAD_ERROR:
case NS_FORM_SELECTED:
@@ -840,7 +840,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
// The load event is special in that we don't ever propagate it
// to chrome.
nsCOMPtr<nsPIDOMWindow> win = OwnerDoc()->GetWindow();
EventTarget* parentTarget = win && aVisitor.mEvent->message != NS_LOAD
EventTarget* parentTarget = win && aVisitor.mEvent->mMessage != NS_LOAD
? win->GetParentTarget() : nullptr;
aVisitor.mParentTarget = parentTarget;
+2 -1
View File
@@ -5,8 +5,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "PerformanceEntry.h"
#include "nsIURI.h"
#include "MainThreadUtils.h"
#include "mozilla/dom/PerformanceEntryBinding.h"
#include "nsIURI.h"
using namespace mozilla::dom;
+2
View File
@@ -8,6 +8,8 @@
#define mozilla_dom_PerformanceEntry_h___
#include "nsDOMNavigationTiming.h"
#include "nsString.h"
#include "nsWrapperCache.h"
class nsISupports;
+1
View File
@@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "PerformanceMark.h"
#include "MainThreadUtils.h"
#include "mozilla/dom/PerformanceMarkBinding.h"
using namespace mozilla::dom;
+1
View File
@@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "PerformanceMeasure.h"
#include "MainThreadUtils.h"
#include "mozilla/dom/PerformanceMeasureBinding.h"
using namespace mozilla::dom;
+1
View File
@@ -18,6 +18,7 @@
#include "nsGlobalWindow.h"
#include "nsIPresShell.h"
#include "nsIPrincipal.h"
#include "nsPresContext.h"
namespace mozilla {
namespace dom {
+2
View File
@@ -11,9 +11,11 @@
#include "nsCOMPtr.h"
#include "mozilla/nsRefPtr.h"
#include "nsTArray.h"
#include "nsThreadUtils.h"
class nsGlobalWindow;
class nsIPrincipal;
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
+1
View File
@@ -8,6 +8,7 @@
#include "nsContentCID.h"
#include "nsDOMClassInfoID.h"
#include "mozilla/HoldDropJSObjects.h"
using namespace mozilla;
using namespace mozilla::dom;
+1
View File
@@ -5,6 +5,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "SameProcessMessageQueue.h"
#include "nsThreadUtils.h"
using namespace mozilla;
using namespace mozilla::dom;
+4 -4
View File
@@ -242,10 +242,10 @@ TextInputProcessor::IsValidEventTypeForComposition(
const WidgetKeyboardEvent& aKeyboardEvent) const
{
// The key event type of composition methods must be "" or "keydown".
if (aKeyboardEvent.message == NS_KEY_DOWN) {
if (aKeyboardEvent.mMessage == NS_KEY_DOWN) {
return true;
}
if (aKeyboardEvent.message == NS_USER_DEFINED_EVENT &&
if (aKeyboardEvent.mMessage == NS_USER_DEFINED_EVENT &&
aKeyboardEvent.userType &&
nsDependentAtomString(aKeyboardEvent.userType).EqualsLiteral("on")) {
return true;
@@ -300,9 +300,9 @@ TextInputProcessor::MaybeDispatchKeyupForComposition(
return result;
}
// If the message is NS_KEY_DOWN, the caller doesn't want TIP to dispatch
// If the mMessage is NS_KEY_DOWN, the caller doesn't want TIP to dispatch
// keyup event.
if (aKeyboardEvent->message == NS_KEY_DOWN) {
if (aKeyboardEvent->mMessage == NS_KEY_DOWN) {
return result;
}
+1
View File
@@ -34,6 +34,7 @@
#include "xpcpublic.h"
#include "nsObserverService.h"
#include "nsFocusManager.h"
#include "nsIInterfaceRequestorUtils.h"
using namespace mozilla;
using namespace mozilla::dom;
+3 -1
View File
@@ -372,7 +372,9 @@ nsContentPermissionUtils::AskPermission(nsIContentPermissionRequest* aRequest, n
nsCOMPtr<nsIContentPermissionPrompt> prompt =
do_GetService(NS_CONTENT_PERMISSION_PROMPT_CONTRACTID);
if (prompt) {
prompt->Prompt(aRequest);
if (NS_FAILED(prompt->Prompt(aRequest))) {
return NS_ERROR_FAILURE;
}
}
return NS_OK;
}
+2
View File
@@ -17,11 +17,13 @@
#include "nsContentPolicy.h"
#include "nsIURI.h"
#include "nsIDocShell.h"
#include "nsIDOMElement.h"
#include "nsIDOMNode.h"
#include "nsIDOMWindow.h"
#include "nsIContent.h"
#include "nsILoadContext.h"
#include "nsCOMArray.h"
#include "nsContentUtils.h"
#include "mozilla/dom/nsMixedContentBlocker.h"
using mozilla::LogLevel;
+13 -11
View File
@@ -5388,8 +5388,8 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
// For draggesture and dragstart events, the data transfer object is
// created before the event fires, so it should already be set. For other
// drag events, get the object from the drag session.
NS_ASSERTION(aDragEvent->message != NS_DRAGDROP_GESTURE &&
aDragEvent->message != NS_DRAGDROP_START,
NS_ASSERTION(aDragEvent->mMessage != NS_DRAGDROP_GESTURE &&
aDragEvent->mMessage != NS_DRAGDROP_START,
"draggesture event created without a dataTransfer");
nsCOMPtr<nsIDragSession> dragSession = GetDragSession();
@@ -5408,20 +5408,22 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
// means, for instance calling the drag service directly, or a drag
// from another application. In either case, a new dataTransfer should
// be created that reflects the data.
initialDataTransfer = new DataTransfer(aDragEvent->target, aDragEvent->message, true, -1);
initialDataTransfer =
new DataTransfer(aDragEvent->target, aDragEvent->mMessage, true, -1);
// now set it in the drag session so we don't need to create it again
dragSession->SetDataTransfer(initialDataTransfer);
}
bool isCrossDomainSubFrameDrop = false;
if (aDragEvent->message == NS_DRAGDROP_DROP ||
aDragEvent->message == NS_DRAGDROP_DRAGDROP) {
if (aDragEvent->mMessage == NS_DRAGDROP_DROP ||
aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP) {
isCrossDomainSubFrameDrop = CheckForSubFrameDrop(dragSession, aDragEvent);
}
// each event should use a clone of the original dataTransfer.
initialDataTransfer->Clone(aDragEvent->target, aDragEvent->message, aDragEvent->userCancelled,
initialDataTransfer->Clone(aDragEvent->target, aDragEvent->mMessage,
aDragEvent->userCancelled,
isCrossDomainSubFrameDrop,
getter_AddRefs(aDragEvent->dataTransfer));
NS_ENSURE_TRUE(aDragEvent->dataTransfer, NS_ERROR_OUT_OF_MEMORY);
@@ -5429,16 +5431,16 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
// for the dragenter and dragover events, initialize the drop effect
// from the drop action, which platform specific widget code sets before
// the event is fired based on the keyboard state.
if (aDragEvent->message == NS_DRAGDROP_ENTER ||
aDragEvent->message == NS_DRAGDROP_OVER) {
if (aDragEvent->mMessage == NS_DRAGDROP_ENTER ||
aDragEvent->mMessage == NS_DRAGDROP_OVER) {
uint32_t action, effectAllowed;
dragSession->GetDragAction(&action);
aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed);
aDragEvent->dataTransfer->SetDropEffectInt(FilterDropEffect(action, effectAllowed));
}
else if (aDragEvent->message == NS_DRAGDROP_DROP ||
aDragEvent->message == NS_DRAGDROP_DRAGDROP ||
aDragEvent->message == NS_DRAGDROP_END) {
else if (aDragEvent->mMessage == NS_DRAGDROP_DROP ||
aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP ||
aDragEvent->mMessage == NS_DRAGDROP_END) {
// For the drop and dragend events, set the drop effect based on the
// last value that the dropEffect had. This will have been set in
// EventStateManager::PostHandleEvent for the last dragenter or
+4 -5
View File
@@ -40,7 +40,6 @@
#include "nsIFrame.h"
#include "nsIURI.h"
#include "nsISimpleEnumerator.h"
#include "nsIFormControl.h"
// image copy stuff
#include "nsIImageLoadingContent.h"
@@ -629,7 +628,6 @@ bool
nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPresShell* aPresShell,
nsISelection* aSelection, bool* aActionTaken)
{
// Keep track of action taken or not to pass up the chain.
if (aActionTaken) {
*aActionTaken = false;
}
@@ -700,7 +698,7 @@ nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPres
// If the event was cancelled, don't do the clipboard operation
doDefault = (status != nsEventStatus_eConsumeNoDefault);
}
// No need to do anything special during a paste. Either an event listener
// took care of it and cancelled the event, or the caller will handle it.
// Return true to indicate that the event wasn't cancelled.
@@ -711,6 +709,7 @@ nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPres
clipboardData->ClearAll();
clipboardData->SetReadOnly();
}
if (aActionTaken) {
*aActionTaken = true;
}
@@ -742,7 +741,7 @@ nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPres
}
// when cutting non-editable content, do nothing
// XXX this may be the wrong editable flag to check
// XXX this is probably the wrong editable flag to check
if (aType != NS_CUT || content->IsEditable()) {
// get the data from the selection if any
bool isCollapsed;
@@ -791,9 +790,9 @@ nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPres
if (doDefault || count) {
piWindow->UpdateCommands(NS_LITERAL_STRING("clipboard"), nullptr, 0);
}
if (aActionTaken) {
*aActionTaken = true;
}
return doDefault;
}
+1 -12
View File
@@ -72,7 +72,6 @@
#include "nsMemory.h"
// includes needed for the prototype chain interfaces
#include "nsIDOMCSSCharsetRule.h"
#include "nsIDOMCSSImportRule.h"
#include "nsIDOMCSSMediaRule.h"
#include "nsIDOMCSSFontFaceRule.h"
@@ -208,8 +207,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
// CSS classes
NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSCharsetRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSImportRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSMediaRule, nsDOMGenericSH,
@@ -600,10 +597,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSCharsetRule, nsIDOMCSSCharsetRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCharsetRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSImportRule, nsIDOMCSSImportRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSImportRule)
DOM_CLASSINFO_MAP_END
@@ -1737,13 +1730,10 @@ GetXPCProto(nsIXPConnect *aXPConnect, JSContext *cx, nsGlobalWindow *aWin,
}
NS_ENSURE_TRUE(ci, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIXPConnectJSObjectHolder> proto_holder;
nsresult rv =
aXPConnect->GetWrappedNativePrototype(cx, aWin->GetGlobalJSObject(), ci,
getter_AddRefs(proto_holder));
aXPConnect->GetWrappedNativePrototype(cx, aWin->GetGlobalJSObject(), ci, aProto.address());
NS_ENSURE_SUCCESS(rv, rv);
aProto.set(proto_holder->GetJSObject());
return JS_WrapObject(cx, aProto) ? NS_OK : NS_ERROR_FAILURE;
}
@@ -2616,6 +2606,5 @@ nsMessageManagerSH<Super>::Enumerate(nsIXPConnectWrappedNative* wrapper,
// Don't call up to our superclass, since neither nsDOMGenericSH nor
// nsEventTargetSH have WANT_ENUMERATE.
MOZ_ASSERT(!(this->GetScriptableFlags() & nsIXPCScriptable::WANT_ENUMERATE));
return NS_OK;
}
-1
View File
@@ -10,7 +10,6 @@ DOMCI_CLASS(DOMConstructor)
// CSS classes
DOMCI_CLASS(CSSStyleRule)
DOMCI_CLASS(CSSCharsetRule)
DOMCI_CLASS(CSSImportRule)
DOMCI_CLASS(CSSMediaRule)
DOMCI_CLASS(CSSNameSpaceRule)
+2 -2
View File
@@ -28,8 +28,8 @@
namespace mozilla {
namespace dom {
class Blob;
}
}
} // namespace dom
} // namespace mozilla
class nsDOMFileReader final : public mozilla::dom::FileIOObject,
public nsIDOMFileReader,
+39 -11
View File
@@ -7,16 +7,20 @@
#include "nsDOMMutationObserver.h"
#include "mozilla/OwningNonNull.h"
#include "nsError.h"
#include "nsIScriptGlobalObject.h"
#include "nsContentUtils.h"
#include "nsThreadUtils.h"
#include "nsIDOMMutationEvent.h"
#include "nsTextFragment.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/dom/Animation.h"
#include "mozilla/dom/KeyframeEffect.h"
#include "nsContentUtils.h"
#include "nsError.h"
#include "nsIDOMMutationEvent.h"
#include "nsIScriptGlobalObject.h"
#include "nsServiceManagerUtils.h"
#include "nsTextFragment.h"
#include "nsThreadUtils.h"
using mozilla::dom::Animation;
nsAutoTArray<nsRefPtr<nsDOMMutationObserver>, 4>*
nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
@@ -346,12 +350,12 @@ void
nsAnimationReceiver::RecordAnimationMutation(Animation* aAnimation,
AnimationMutation aMutationType)
{
KeyframeEffectReadOnly* effect = aAnimation->GetEffect();
mozilla::dom::KeyframeEffectReadOnly* effect = aAnimation->GetEffect();
if (!effect) {
return;
}
Element* animationTarget = effect->GetTarget();
mozilla::dom::Element* animationTarget = effect->GetTarget();
if (!animationTarget) {
return;
}
@@ -686,7 +690,11 @@ nsDOMMutationObserver::TakeRecords(
for (uint32_t i = 0; i < mPendingMutationCount; ++i) {
nsRefPtr<nsDOMMutationRecord> next;
current->mNext.swap(next);
*aRetVal.AppendElement() = current.forget();
if (!mMergeAttributeRecords ||
!MergeableAttributeRecord(aRetVal.SafeLastElement(nullptr),
current)) {
*aRetVal.AppendElement() = current.forget();
}
current.swap(next);
}
ClearPendingRecords();
@@ -743,6 +751,21 @@ nsDOMMutationObserver::Constructor(const mozilla::dom::GlobalObject& aGlobal,
return observer.forget();
}
bool
nsDOMMutationObserver::MergeableAttributeRecord(nsDOMMutationRecord* aOldRecord,
nsDOMMutationRecord* aRecord)
{
MOZ_ASSERT(mMergeAttributeRecords);
return
aOldRecord &&
aOldRecord->mType == nsGkAtoms::attributes &&
aOldRecord->mType == aRecord->mType &&
aOldRecord->mTarget == aRecord->mTarget &&
aOldRecord->mAttrName == aRecord->mAttrName &&
aOldRecord->mAttrNamespace.Equals(aRecord->mAttrNamespace);
}
void
nsDOMMutationObserver::HandleMutation()
{
@@ -774,7 +797,12 @@ nsDOMMutationObserver::HandleMutation()
for (uint32_t i = 0; i < mPendingMutationCount; ++i) {
nsRefPtr<nsDOMMutationRecord> next;
current->mNext.swap(next);
*mutations.AppendElement(mozilla::fallible) = current;
if (!mMergeAttributeRecords ||
!MergeableAttributeRecord(mutations.Length() ?
mutations.LastElement().get() : nullptr,
current)) {
*mutations.AppendElement(mozilla::fallible) = current;
}
current.swap(next);
}
}
+19 -1
View File
@@ -456,7 +456,8 @@ public:
mozilla::dom::MutationCallback& aCb,
bool aChrome)
: mOwner(aOwner), mLastPendingMutation(nullptr), mPendingMutationCount(0),
mCallback(&aCb), mWaitingForRun(false), mIsChrome(aChrome), mId(++sCount)
mCallback(&aCb), mWaitingForRun(false), mIsChrome(aChrome),
mMergeAttributeRecords(false), mId(++sCount)
{
}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@@ -498,6 +499,22 @@ public:
mozilla::dom::MutationCallback* MutationCallback() { return mCallback; }
bool MergeAttributeRecords()
{
return mMergeAttributeRecords;
}
void SetMergeAttributeRecords(bool aVal)
{
mMergeAttributeRecords = aVal;
}
// If both records are for 'attributes' type and for the same target and
// attribute name and namespace are the same, we can skip the newer record.
// aOldRecord->mPrevValue holds the original value, if observed.
bool MergeableAttributeRecord(nsDOMMutationRecord* aOldRecord,
nsDOMMutationRecord* aRecord);
void AppendMutationRecord(already_AddRefed<nsDOMMutationRecord> aRecord)
{
nsRefPtr<nsDOMMutationRecord> record = aRecord;
@@ -585,6 +602,7 @@ protected:
bool mWaitingForRun;
bool mIsChrome;
bool mMergeAttributeRecords;
uint64_t mId;
+1 -1
View File
@@ -8126,7 +8126,7 @@ nsDocument::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mForceContentDispatch = true;
// Load events must not propagate to |window| object, see bug 335251.
if (aVisitor.mEvent->message != NS_LOAD) {
if (aVisitor.mEvent->mMessage != NS_LOAD) {
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(GetWindow());
aVisitor.mParentTarget =
window ? window->GetTargetForEventTargetChain() : nullptr;
+2 -2
View File
@@ -49,8 +49,8 @@ public:
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) override
{
MOZ_ASSERT(IsInNativeAnonymousSubtree());
if (aVisitor.mEvent->message == NS_LOAD ||
aVisitor.mEvent->message == NS_LOAD_ERROR) {
if (aVisitor.mEvent->mMessage == NS_LOAD ||
aVisitor.mEvent->mMessage == NS_LOAD_ERROR) {
// Don't propagate the events to the parent.
return NS_OK;
}
+5 -5
View File
@@ -3050,7 +3050,7 @@ nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
NS_PRECONDITION(IsInnerWindow(), "PreHandleEvent is used on outer window!?");
static uint32_t count = 0;
uint32_t msg = aVisitor.mEvent->message;
uint32_t msg = aVisitor.mEvent->mMessage;
aVisitor.mCanHandle = true;
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
@@ -3258,7 +3258,7 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
NS_PRECONDITION(IsInnerWindow(), "PostHandleEvent is used on outer window!?");
// Return early if there is nothing to do.
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_RESIZE_EVENT:
case NS_PAGE_UNLOAD:
case NS_LOAD:
@@ -3273,9 +3273,9 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
nsCOMPtr<nsIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler);
nsCOMPtr<nsIScriptContext> kungFuDeathGrip2(GetContextInternal());
if (aVisitor.mEvent->message == NS_RESIZE_EVENT) {
if (aVisitor.mEvent->mMessage == NS_RESIZE_EVENT) {
mIsHandlingResizeEvent = false;
} else if (aVisitor.mEvent->message == NS_PAGE_UNLOAD &&
} else if (aVisitor.mEvent->mMessage == NS_PAGE_UNLOAD &&
aVisitor.mEvent->mFlags.mIsTrusted) {
// Execute bindingdetached handlers before we tear ourselves
// down.
@@ -3283,7 +3283,7 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
mDoc->BindingManager()->ExecuteDetachedHandlers();
}
mIsDocumentLoaded = false;
} else if (aVisitor.mEvent->message == NS_LOAD &&
} else if (aVisitor.mEvent->mMessage == NS_LOAD &&
aVisitor.mEvent->mFlags.mIsTrusted) {
// This is page load event since load events don't propagate to |window|.
// @see nsDocument::PreHandleEvent.
+1 -1
View File
@@ -169,7 +169,7 @@ class BlobURLsReporter final : public nsIMemoryReporter
{
EnumArg* envp = static_cast<EnumArg*>(aUserArg);
nsCOMPtr<nsIDOMBlob> tmp = do_QueryInterface(aInfo->mObject);
nsRefPtr<Blob> blob = static_cast<Blob*>(tmp.get());
nsRefPtr<mozilla::dom::Blob> blob = static_cast<mozilla::dom::Blob*>(tmp.get());
if (blob) {
NS_NAMED_LITERAL_CSTRING
+1 -1
View File
@@ -115,7 +115,7 @@ nsHostObjectURI::Serialize(mozilla::ipc::URIParams& aParams)
hostParams.principal() = info;
} else {
hostParams.principal() = void_t();
hostParams.principal() = mozilla::void_t();
}
aParams = hostParams;
+2 -2
View File
@@ -11,8 +11,8 @@
namespace mozilla {
namespace dom {
class Animation;
}
}
} // namespace dom
} // namespace mozilla
#define NS_IANIMATION_OBSERVER_IID \
{ 0xed025fc7, 0xdeda, 0x48b9, \
+2
View File
@@ -6,6 +6,8 @@
#include "nsIGlobalObject.h"
#include "nsContentUtils.h"
#include "nsThreadUtils.h"
#include "nsHostObjectProtocolHandler.h"
nsIGlobalObject::~nsIGlobalObject()
{
@@ -17,6 +17,7 @@
#include "nsIIOService.h"
#include "nsIExternalProtocolHandler.h"
#include "nsNetUtil.h"
#include "nsContentUtils.h"
NS_IMPL_ISUPPORTS(nsNoDataProtocolContentPolicy, nsIContentPolicy)
+1 -1
View File
@@ -159,7 +159,7 @@ void
nsQueryContentEventResult::SetEventResult(nsIWidget* aWidget,
const WidgetQueryContentEvent &aEvent)
{
mEventID = aEvent.message;
mEventID = aEvent.mMessage;
mSucceeded = aEvent.mSucceeded;
mReversed = aEvent.mReply.mReversed;
mRect = aEvent.mReply.mRect;
+162 -1
View File
@@ -743,7 +743,7 @@ function testStyleRemoveProperty2() {
observer.disconnect();
m = null;
div.removeAttribute("data-test");
then();
then(testAttributeRecordMerging1);
});
m.observe(div, { attributes: true });
is(div.getAttribute("style"), null, "style attribute before unsuccessful removeProperty");
@@ -751,6 +751,167 @@ function testStyleRemoveProperty2() {
div.setAttribute("data-test", "a");
}
function testAttributeRecordMerging1() {
ok(true, "testAttributeRecordMerging1");
var m = new M(function(records, observer) {
is(records.length, 2);
is(records[0].type, "attributes");
is(records[0].target, div);
is(records[0].attributeName, "foo");
is(records[0].attributeNamespace, null);
is(records[0].oldValue, null);
is(records[1].type, "attributes");
is(records[1].target, div.firstChild);
is(records[1].attributeName, "foo");
is(records[1].attributeNamespace, null);
is(records[1].oldValue, null);
observer.disconnect();
div.innerHTML = "";
div.removeAttribute("foo");
then(testAttributeRecordMerging2);
});
m.observe(div, {
attributes: true,
subtree: true
});
SpecialPowers.wrap(m).mergeAttributeRecords = true;
div.setAttribute("foo", "bar_1");
div.setAttribute("foo", "bar_2");
div.innerHTML = "<div></div>";
div.firstChild.setAttribute("foo", "bar_1");
div.firstChild.setAttribute("foo", "bar_2");
}
function testAttributeRecordMerging2() {
ok(true, "testAttributeRecordMerging2");
var m = new M(function(records, observer) {
is(records.length, 2);
is(records[0].type, "attributes");
is(records[0].target, div);
is(records[0].attributeName, "foo");
is(records[0].attributeNamespace, null);
is(records[0].oldValue, "initial");
is(records[1].type, "attributes");
is(records[1].target, div.firstChild);
is(records[1].attributeName, "foo");
is(records[1].attributeNamespace, null);
is(records[1].oldValue, "initial");
observer.disconnect();
div.innerHTML = "";
div.removeAttribute("foo");
then(testAttributeRecordMerging3);
});
div.setAttribute("foo", "initial");
div.innerHTML = "<div></div>";
div.firstChild.setAttribute("foo", "initial");
m.observe(div, {
attributes: true,
subtree: true,
attributeOldValue: true
});
SpecialPowers.wrap(m).mergeAttributeRecords = true;
div.setAttribute("foo", "bar_1");
div.setAttribute("foo", "bar_2");
div.firstChild.setAttribute("foo", "bar_1");
div.firstChild.setAttribute("foo", "bar_2");
}
function testAttributeRecordMerging3() {
ok(true, "testAttributeRecordMerging3");
var m = new M(function(records, observer) {
is(records.length, 4);
is(records[0].type, "attributes");
is(records[0].target, div);
is(records[0].attributeName, "foo");
is(records[0].attributeNamespace, null);
is(records[0].oldValue, "initial");
is(records[1].type, "attributes");
is(records[1].target, div.firstChild);
is(records[1].attributeName, "foo");
is(records[1].attributeNamespace, null);
is(records[1].oldValue, "initial");
is(records[2].type, "attributes");
is(records[2].target, div);
is(records[2].attributeName, "foo");
is(records[2].attributeNamespace, null);
is(records[2].oldValue, "bar_1");
is(records[3].type, "attributes");
is(records[3].target, div.firstChild);
is(records[3].attributeName, "foo");
is(records[3].attributeNamespace, null);
is(records[3].oldValue, "bar_1");
observer.disconnect();
div.innerHTML = "";
div.removeAttribute("foo");
then(testAttributeRecordMerging4);
});
div.setAttribute("foo", "initial");
div.innerHTML = "<div></div>";
div.firstChild.setAttribute("foo", "initial");
m.observe(div, {
attributes: true,
subtree: true,
attributeOldValue: true
});
SpecialPowers.wrap(m).mergeAttributeRecords = true;
// No merging should happen.
div.setAttribute("foo", "bar_1");
div.firstChild.setAttribute("foo", "bar_1");
div.setAttribute("foo", "bar_2");
div.firstChild.setAttribute("foo", "bar_2");
}
function testAttributeRecordMerging4() {
ok(true, "testAttributeRecordMerging4");
var m = new M(function(records, observer) {
});
div.setAttribute("foo", "initial");
div.innerHTML = "<div></div>";
div.firstChild.setAttribute("foo", "initial");
m.observe(div, {
attributes: true,
subtree: true,
attributeOldValue: true
});
SpecialPowers.wrap(m).mergeAttributeRecords = true;
div.setAttribute("foo", "bar_1");
div.setAttribute("foo", "bar_2");
div.firstChild.setAttribute("foo", "bar_1");
div.firstChild.setAttribute("foo", "bar_2");
var records = m.takeRecords();
is(records.length, 2);
is(records[0].type, "attributes");
is(records[0].target, div);
is(records[0].attributeName, "foo");
is(records[0].attributeNamespace, null);
is(records[0].oldValue, "initial");
is(records[1].type, "attributes");
is(records[1].target, div.firstChild);
is(records[1].attributeName, "foo");
is(records[1].attributeNamespace, null);
is(records[1].oldValue, "initial");
m.disconnect();
div.innerHTML = "";
div.removeAttribute("foo");
then();
}
SimpleTest.waitForExplicitFinish();
</script>
+9 -6
View File
@@ -13,16 +13,19 @@
#ifndef mozilla_dom_BindingDeclarations_h__
#define mozilla_dom_BindingDeclarations_h__
#include "nsStringGlue.h"
#include "js/Value.h"
#include "js/RootingAPI.h"
#include "js/Value.h"
#include "mozilla/Maybe.h"
#include "nsCOMPtr.h"
#include "nsTArray.h"
#include "nsAutoPtr.h" // for nsRefPtr member variables
#include "mozilla/dom/DOMString.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/dom/DOMString.h"
#include "nsAutoPtr.h" // for nsRefPtr member variables
#include "nsCOMPtr.h"
#include "nsStringGlue.h"
#include "nsTArray.h"
class nsWrapperCache;
namespace mozilla {
+2 -2
View File
@@ -108,8 +108,8 @@ ClipboardEvent::GetClipboardData()
new DataTransfer(ToSupports(this), NS_COPY, false, -1);
} else {
event->clipboardData =
new DataTransfer(ToSupports(this), event->message,
event->message == NS_PASTE,
new DataTransfer(ToSupports(this), event->mMessage,
event->mMessage == NS_PASTE,
nsIClipboard::kGlobalClipboard);
}
}
+1 -1
View File
@@ -255,7 +255,7 @@ protected:
nsCOMPtr<nsISupports> mParent;
// the event type this data transfer is for. This will correspond to an
// event->message value.
// event->mMessage value.
uint32_t mEventType;
// the drop effect and effect allowed
+11 -11
View File
@@ -265,12 +265,12 @@ Event::GetType(nsAString& aType)
aType = mEvent->typeString;
return NS_OK;
}
const char* name = GetEventName(mEvent->message);
const char* name = GetEventName(mEvent->mMessage);
if (name) {
CopyASCIItoUTF16(name, aType);
return NS_OK;
} else if (mEvent->message == NS_USER_DEFINED_EVENT && mEvent->userType) {
} else if (mEvent->mMessage == NS_USER_DEFINED_EVENT && mEvent->userType) {
aType = Substring(nsDependentAtomString(mEvent->userType), 2); // Remove "on"
mEvent->typeString = aType;
return NS_OK;
@@ -564,10 +564,10 @@ Event::SetEventType(const nsAString& aEventTypeArg)
mEvent->typeString.Truncate();
mEvent->userType =
nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->mClass,
&(mEvent->message));
&(mEvent->mMessage));
} else {
mEvent->userType = nullptr;
mEvent->message = NS_USER_DEFINED_EVENT;
mEvent->mMessage = NS_USER_DEFINED_EVENT;
mEvent->typeString = aEventTypeArg;
}
}
@@ -715,7 +715,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
// triggered while handling user input. See
// nsPresShell::HandleEventInternal() for details.
if (EventStateManager::IsHandlingUserInput()) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_FORM_SELECTED :
if (PopupAllowedForEvent("select")) {
abuse = openControlled;
@@ -734,7 +734,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
// while handling user input. See
// nsPresShell::HandleEventInternal() for details.
if (EventStateManager::IsHandlingUserInput()) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_EDITOR_INPUT:
if (PopupAllowedForEvent("input")) {
abuse = openControlled;
@@ -748,7 +748,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
// while handling user input. See
// nsPresShell::HandleEventInternal() for details.
if (EventStateManager::IsHandlingUserInput()) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_FORM_CHANGE :
if (PopupAllowedForEvent("change")) {
abuse = openControlled;
@@ -763,7 +763,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
case eKeyboardEventClass:
if (aEvent->mFlags.mIsTrusted) {
uint32_t key = aEvent->AsKeyboardEvent()->keyCode;
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_KEY_PRESS :
// return key on focused button. see note at NS_MOUSE_CLICK.
if (key == nsIDOMKeyEvent::DOM_VK_RETURN) {
@@ -790,7 +790,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
break;
case eTouchEventClass:
if (aEvent->mFlags.mIsTrusted) {
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START :
if (PopupAllowedForEvent("touchstart")) {
abuse = openControlled;
@@ -807,7 +807,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
case eMouseEventClass:
if (aEvent->mFlags.mIsTrusted &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_MOUSE_BUTTON_UP :
if (PopupAllowedForEvent("mouseup")) {
abuse = openControlled;
@@ -840,7 +840,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
// triggered while handling user input. See
// nsPresShell::HandleEventInternal() for details.
if (EventStateManager::IsHandlingUserInput()) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_FORM_SUBMIT :
if (PopupAllowedForEvent("submit")) {
abuse = openControlled;
+1 -1
View File
@@ -275,7 +275,7 @@ protected:
bool mPrivateDataDuplicated;
bool mIsMainThreadEvent;
// True when popup control check should rely on event.type, not
// WidgetEvent.message.
// WidgetEvent.mMessage.
bool mWantsPopupControlCheck;
};
+4 -3
View File
@@ -420,12 +420,12 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
NS_ASSERTION(aEvent, "Trying to dispatch without WidgetEvent!");
NS_ENSURE_TRUE(!aEvent->mFlags.mIsBeingDispatched,
NS_ERROR_DOM_INVALID_STATE_ERR);
NS_ASSERTION(!aTargets || !aEvent->message, "Wrong parameters!");
NS_ASSERTION(!aTargets || !aEvent->mMessage, "Wrong parameters!");
// If we're dispatching an already created DOMEvent object, make
// sure it is initialized!
// If aTargets is non-null, the event isn't going to be dispatched.
NS_ENSURE_TRUE(aEvent->message || !aDOMEvent || aTargets,
NS_ENSURE_TRUE(aEvent->mMessage || !aDOMEvent || aTargets,
NS_ERROR_DOM_INVALID_STATE_ERR);
#ifdef MOZ_TASK_TRACER
@@ -493,7 +493,8 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
}
#ifdef DEBUG
if (aEvent->message != NS_EVENT_NULL && !nsContentUtils::IsSafeToRunScript()) {
if (aEvent->mMessage != NS_EVENT_NULL &&
!nsContentUtils::IsSafeToRunScript()) {
nsresult rv = NS_ERROR_FAILURE;
if (target->GetContextForEventHandlers(&rv) ||
NS_FAILED(rv)) {
+1 -1
View File
@@ -246,7 +246,7 @@ public:
* Neither aTarget nor aEvent is allowed to be nullptr.
*
* If aTargets is non-null, event target chain will be created, but
* event won't be handled. In this case aEvent->message should be
* event won't be handled. In this case aEvent->mMessage should be
* NS_EVENT_NULL.
* @note Use this method when dispatching a WidgetEvent.
*/
+4 -4
View File
@@ -563,20 +563,20 @@ EventListenerManager::ListenerCanHandle(Listener* aListener,
WidgetEvent* aEvent)
{
// This is slightly different from EVENT_TYPE_EQUALS in that it returns
// true even when aEvent->message == NS_USER_DEFINED_EVENT and
// true even when aEvent->mMessage == NS_USER_DEFINED_EVENT and
// aListener=>mEventType != NS_USER_DEFINED_EVENT as long as the atoms are
// the same
if (aListener->mAllEvents) {
return true;
}
if (aEvent->message == NS_USER_DEFINED_EVENT) {
if (aEvent->mMessage == NS_USER_DEFINED_EVENT) {
if (mIsMainThreadELM) {
return aListener->mTypeAtom == aEvent->userType;
}
return aListener->mTypeString.Equals(aEvent->typeString);
}
MOZ_ASSERT(mIsMainThreadELM);
return aListener->mEventType == aEvent->message;
return aListener->mEventType == aEvent->mMessage;
}
void
@@ -1168,7 +1168,7 @@ EventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
aEvent->currentTarget = nullptr;
if (mIsMainThreadELM && !hasListener) {
mNoListenerForEvent = aEvent->message;
mNoListenerForEvent = aEvent->mMessage;
mNoListenerForEventAtom = aEvent->userType;
}
+1 -1
View File
@@ -321,7 +321,7 @@ public:
}
// Check if we already know that there is no event listener for the event.
if (mNoListenerForEvent == aEvent->message &&
if (mNoListenerForEvent == aEvent->mMessage &&
(mNoListenerForEvent != NS_USER_DEFINED_EVENT ||
mNoListenerForEventAtom == aEvent->userType)) {
return;
+38 -37
View File
@@ -499,8 +499,8 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (aEvent->mFlags.mIsTrusted &&
((mouseEvent && mouseEvent->IsReal() &&
mouseEvent->message != NS_MOUSE_ENTER_WIDGET &&
mouseEvent->message != NS_MOUSE_EXIT_WIDGET) ||
mouseEvent->mMessage != NS_MOUSE_ENTER_WIDGET &&
mouseEvent->mMessage != NS_MOUSE_EXIT_WIDGET) ||
aEvent->mClass == eWheelEventClass ||
aEvent->mClass == ePointerEventClass ||
aEvent->mClass == eTouchEventClass ||
@@ -518,9 +518,9 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
nsCOMPtr<nsINode> node = do_QueryInterface(aTargetContent);
if (node &&
(aEvent->message == NS_KEY_UP || aEvent->message == NS_MOUSE_BUTTON_UP ||
aEvent->message == NS_WHEEL_WHEEL || aEvent->message == NS_TOUCH_END ||
aEvent->message == NS_POINTER_UP)) {
(aEvent->mMessage == NS_KEY_UP || aEvent->mMessage == NS_MOUSE_BUTTON_UP ||
aEvent->mMessage == NS_WHEEL_WHEEL || aEvent->mMessage == NS_TOUCH_END ||
aEvent->mMessage == NS_POINTER_UP)) {
nsIDocument* doc = node->OwnerDoc();
while (doc && !doc->UserHasInteracted()) {
doc->SetUserHasInteracted(true);
@@ -558,7 +558,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
*aStatus = nsEventStatus_eIgnore;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_CONTEXTMENU:
if (sIsPointerLocked) {
return NS_ERROR_DOM_INVALID_STATE_ERR;
@@ -631,7 +631,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
// Treat it as a synthetic move so we don't generate spurious
// "exit" or "move" events. Any necessary "out" or "over" events
// will be generated by GenerateMouseEnterExit
mouseEvent->message = NS_MOUSE_MOVE;
mouseEvent->mMessage = NS_MOUSE_MOVE;
mouseEvent->reason = WidgetMouseEvent::eSynthesized;
// then fall through...
} else {
@@ -641,7 +641,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
}
GenerateMouseEnterExit(mouseEvent);
//This is a window level mouse exit event and should stop here
aEvent->message = 0;
aEvent->mMessage = 0;
break;
}
case NS_MOUSE_MOVE:
@@ -733,7 +733,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
mCurrentTargetContent = content;
}
if (aEvent->message != NS_WHEEL_WHEEL) {
if (aEvent->mMessage != NS_WHEEL_WHEEL) {
break;
}
@@ -1183,7 +1183,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
case eWheelEventClass:
return true;
case eMouseEventClass:
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_MOVE:
@@ -1195,7 +1195,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
return false;
}
case eTouchEventClass:
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_TOUCH_START:
case NS_TOUCH_MOVE:
case NS_TOUCH_END:
@@ -1205,7 +1205,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
return false;
}
case eDragEventClass:
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_DRAGDROP_OVER:
case NS_DRAGDROP_EXIT:
case NS_DRAGDROP_DROP:
@@ -1231,7 +1231,7 @@ EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
// NB: the elements of |targets| must be unique, for correctness.
nsAutoTArray<nsCOMPtr<nsIContent>, 1> targets;
if (aEvent->mClass != eTouchEventClass ||
aEvent->message == NS_TOUCH_START) {
aEvent->mMessage == NS_TOUCH_START) {
// If this event only has one target, and it's remote, add it to
// the array.
nsIFrame* frame = GetEventTarget();
@@ -2601,7 +2601,7 @@ EventStateManager::DecideGestureEvent(WidgetGestureNotifyEvent* aEvent,
nsIFrame* targetFrame)
{
NS_ASSERTION(aEvent->message == NS_GESTURENOTIFY_EVENT_START,
NS_ASSERTION(aEvent->mMessage == NS_GESTURENOTIFY_EVENT_START,
"DecideGestureEvent called with a non-gesture event");
/* Check the ancestor tree to decide if any frame is willing* to receive
@@ -2803,8 +2803,8 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// Most of the events we handle below require a frame.
// Add special cases here.
if (!mCurrentTarget && aEvent->message != NS_MOUSE_BUTTON_UP &&
aEvent->message != NS_MOUSE_BUTTON_DOWN) {
if (!mCurrentTarget && aEvent->mMessage != NS_MOUSE_BUTTON_UP &&
aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
return NS_OK;
}
@@ -2812,7 +2812,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
nsRefPtr<nsPresContext> presContext = aPresContext;
nsresult ret = NS_OK;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
{
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
@@ -3085,7 +3085,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
ScrollbarsForWheel::PrepareToScrollText(this, aTargetFrame, wheelEvent);
if (aEvent->message != NS_WHEEL_WHEEL ||
if (aEvent->mMessage != NS_WHEEL_WHEEL ||
(!wheelEvent->deltaX && !wheelEvent->deltaY)) {
break;
}
@@ -3249,13 +3249,13 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// For now, do this only for dragover.
//XXXsmaug dragenter needs some more work.
if (aEvent->message == NS_DRAGDROP_OVER && !isChromeDoc) {
if (aEvent->mMessage == NS_DRAGDROP_OVER && !isChromeDoc) {
// Someone has called preventDefault(), check whether is was on
// content or chrome.
dragSession->SetOnlyChromeDrop(
!dragEvent->mDefaultPreventedOnContent);
}
} else if (aEvent->message == NS_DRAGDROP_OVER && !isChromeDoc) {
} else if (aEvent->mMessage == NS_DRAGDROP_OVER && !isChromeDoc) {
// No one called preventDefault(), so handle drop only in chrome.
dragSession->SetOnlyChromeDrop(true);
}
@@ -4068,7 +4068,7 @@ void
EventStateManager::GeneratePointerEnterExit(uint32_t aMessage, WidgetMouseEvent* aEvent)
{
WidgetPointerEvent pointerEvent(*aEvent);
pointerEvent.message = aMessage;
pointerEvent.mMessage = aMessage;
GenerateMouseEnterExit(&pointerEvent);
}
@@ -4082,7 +4082,7 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent)
// Hold onto old target content through the event and reset after.
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
switch(aMouseEvent->message) {
switch(aMouseEvent->mMessage) {
case NS_MOUSE_MOVE:
{
// Mouse movement is reported on the MouseEvent.movement{X,Y} fields.
@@ -4278,7 +4278,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
//Hold onto old target content through the event and reset after.
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
switch(aDragEvent->message) {
switch(aDragEvent->mMessage) {
case NS_DRAGDROP_OVER:
{
// when dragging from one frame to another, events are fired in the
@@ -4430,10 +4430,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
switch (aEvent->button) {
case WidgetMouseEvent::eLeftButton:
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastLeftMouseDownContent = mouseContent;
mLastLeftMouseDownContentParent = mouseContentParent;
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
if (mLastLeftMouseDownContent == mouseContent ||
mLastLeftMouseDownContentParent == mouseContent ||
mLastLeftMouseDownContent == mouseContentParent) {
@@ -4448,10 +4448,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
break;
case WidgetMouseEvent::eMiddleButton:
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastMiddleMouseDownContent = mouseContent;
mLastMiddleMouseDownContentParent = mouseContentParent;
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
if (mLastMiddleMouseDownContent == mouseContent ||
mLastMiddleMouseDownContentParent == mouseContent ||
mLastMiddleMouseDownContent == mouseContentParent) {
@@ -4466,10 +4466,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
break;
case WidgetMouseEvent::eRightButton:
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastRightMouseDownContent = mouseContent;
mLastRightMouseDownContentParent = mouseContentParent;
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
if (mLastRightMouseDownContent == mouseContent ||
mLastRightMouseDownContentParent == mouseContent ||
mLastRightMouseDownContent == mouseContentParent) {
@@ -4593,8 +4593,8 @@ already_AddRefed<nsIContent>
EventStateManager::GetEventTargetContent(WidgetEvent* aEvent)
{
if (aEvent &&
(aEvent->message == NS_FOCUS_CONTENT ||
aEvent->message == NS_BLUR_CONTENT)) {
(aEvent->mMessage == NS_FOCUS_CONTENT ||
aEvent->mMessage == NS_BLUR_CONTENT)) {
nsCOMPtr<nsIContent> content = GetFocusedContent();
return content.forget();
}
@@ -4960,7 +4960,7 @@ EventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
bool
EventStateManager::EventStatusOK(WidgetGUIEvent* aEvent)
{
return !(aEvent->message == NS_MOUSE_BUTTON_DOWN &&
return !(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
!sNormalLMouseEventInProcess);
}
@@ -5056,7 +5056,7 @@ EventStateManager::DoContentCommandEvent(WidgetContentCommandEvent* aEvent)
nsCOMPtr<nsPIWindowRoot> root = window->GetTopWindowRoot();
NS_ENSURE_TRUE(root, NS_ERROR_FAILURE);
const char* cmd;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_CONTENT_COMMAND_CUT:
cmd = "cmd_cut";
break;
@@ -5094,7 +5094,7 @@ EventStateManager::DoContentCommandEvent(WidgetContentCommandEvent* aEvent)
NS_ENSURE_SUCCESS(rv, rv);
aEvent->mIsEnabled = canDoIt;
if (canDoIt && !aEvent->mOnlyEnabledCheck) {
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE: {
nsCOMPtr<nsICommandController> commandController = do_QueryInterface(controller);
NS_ENSURE_STATE(commandController);
@@ -5748,7 +5748,7 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
WidgetEvent* aEvent,
nsIDocument* aDocument) :
mIsHandlingUserInput(aIsHandlingUserInput),
mIsMouseDown(aEvent && aEvent->message == NS_MOUSE_BUTTON_DOWN),
mIsMouseDown(aEvent && aEvent->mMessage == NS_MOUSE_BUTTON_DOWN),
mResetFMMouseButtonHandlingState(false)
{
if (!aIsHandlingUserInput) {
@@ -5762,8 +5762,9 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
if (!aDocument || !aEvent || !aEvent->mFlags.mIsTrusted) {
return;
}
mResetFMMouseButtonHandlingState = (aEvent->message == NS_MOUSE_BUTTON_DOWN ||
aEvent->message == NS_MOUSE_BUTTON_UP);
mResetFMMouseButtonHandlingState =
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP);
if (mResetFMMouseButtonHandlingState) {
nsFocusManager* fm = nsFocusManager::GetFocusManager();
NS_ENSURE_TRUE_VOID(fm);
+2 -2
View File
@@ -964,7 +964,7 @@ private:
// has no frame. This is required for Web compatibility.
#define NS_EVENT_NEEDS_FRAME(event) \
(!(event)->HasPluginActivationEventMessage() && \
(event)->message != NS_MOUSE_CLICK && \
(event)->message != NS_MOUSE_DOUBLECLICK)
(event)->mMessage != NS_MOUSE_CLICK && \
(event)->mMessage != NS_MOUSE_DOUBLECLICK)
#endif // mozilla_EventStateManager_h_
+2 -2
View File
@@ -461,7 +461,7 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext,
return false;
}
// Now, we need to notify only mouse down and mouse up event.
switch (aMouseEvent->message) {
switch (aMouseEvent->mMessage) {
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_BUTTON_DOWN:
break;
@@ -506,7 +506,7 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext,
}
IMENotification notification(NOTIFY_IME_OF_MOUSE_BUTTON_EVENT);
notification.mMouseButtonEventData.mEventMessage = aMouseEvent->message;
notification.mMouseButtonEventData.mEventMessage = aMouseEvent->mMessage;
notification.mMouseButtonEventData.mOffset = charAtPt.mReply.mOffset;
notification.mMouseButtonEventData.mCursorPos.Set(
LayoutDeviceIntPoint::ToUntyped(charAtPt.refPoint));
+9 -9
View File
@@ -1137,7 +1137,7 @@ IMEStateManager::DispatchCompositionEvent(
"mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, "
"aIsSynthesized=%s), tabParent=%p",
aEventTargetNode, aPresContext,
GetEventMessageName(aCompositionEvent->message),
GetEventMessageName(aCompositionEvent->mMessage),
GetBoolName(aCompositionEvent->mFlags.mIsTrusted),
GetBoolName(aCompositionEvent->mFlags.mPropagationStopped),
GetBoolName(aIsSynthesized), tabParent.get()));
@@ -1147,7 +1147,7 @@ IMEStateManager::DispatchCompositionEvent(
return;
}
MOZ_ASSERT(aCompositionEvent->message != NS_COMPOSITION_UPDATE,
MOZ_ASSERT(aCompositionEvent->mMessage != NS_COMPOSITION_UPDATE,
"compositionupdate event shouldn't be dispatched manually");
EnsureTextCompositionArray();
@@ -1163,7 +1163,7 @@ IMEStateManager::DispatchCompositionEvent(
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DispatchCompositionEvent(), "
"adding new TextComposition to the array"));
MOZ_ASSERT(aCompositionEvent->message == NS_COMPOSITION_START);
MOZ_ASSERT(aCompositionEvent->mMessage == NS_COMPOSITION_START);
composition =
new TextComposition(aPresContext, aEventTargetNode, tabParent,
aCompositionEvent);
@@ -1171,7 +1171,7 @@ IMEStateManager::DispatchCompositionEvent(
}
#ifdef DEBUG
else {
MOZ_ASSERT(aCompositionEvent->message != NS_COMPOSITION_START);
MOZ_ASSERT(aCompositionEvent->mMessage != NS_COMPOSITION_START);
}
#endif // #ifdef DEBUG
@@ -1232,10 +1232,10 @@ IMEStateManager::HandleSelectionEvent(nsPresContext* aPresContext,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::HandleSelectionEvent(aPresContext=0x%p, "
"aEventTargetContent=0x%p, aSelectionEvent={ message=%s, "
"aEventTargetContent=0x%p, aSelectionEvent={ mMessage=%s, "
"mFlags={ mIsTrusted=%s } }), tabParent=%p",
aPresContext, aEventTargetContent,
GetEventMessageName(aSelectionEvent->message),
GetEventMessageName(aSelectionEvent->mMessage),
GetBoolName(aSelectionEvent->mFlags.mIsTrusted),
tabParent.get()));
@@ -1267,8 +1267,8 @@ IMEStateManager::OnCompositionEventDiscarded(
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnCompositionEventDiscarded(aCompositionEvent={ "
"message=%s, mFlags={ mIsTrusted=%s } })",
GetEventMessageName(aCompositionEvent->message),
"mMessage=%s, mFlags={ mIsTrusted=%s } })",
GetEventMessageName(aCompositionEvent->mMessage),
GetBoolName(aCompositionEvent->mFlags.mIsTrusted)));
if (!aCompositionEvent->mFlags.mIsTrusted) {
@@ -1277,7 +1277,7 @@ IMEStateManager::OnCompositionEventDiscarded(
// Ignore compositionstart for now because sTextCompositions may not have
// been created yet.
if (aCompositionEvent->message == NS_COMPOSITION_START) {
if (aCompositionEvent->mMessage == NS_COMPOSITION_START) {
return;
}
+1 -1
View File
@@ -30,7 +30,7 @@ public:
{
MOZ_ASSERT(mClass == eMutationEventClass,
"Duplicate() must be overridden by sub class");
InternalMutationEvent* result = new InternalMutationEvent(false, message);
InternalMutationEvent* result = new InternalMutationEvent(false, mMessage);
result->AssignMutationEventData(*this, true);
result->mFlags = mFlags;
return result;
+2 -2
View File
@@ -151,7 +151,7 @@ KeyboardEvent::CharCode()
return mEvent->AsKeyboardEvent()->charCode;
}
switch (mEvent->message) {
switch (mEvent->mMessage) {
case NS_KEY_BEFORE_DOWN:
case NS_KEY_DOWN:
case NS_KEY_AFTER_DOWN:
@@ -195,7 +195,7 @@ KeyboardEvent::Which()
return mInitializedWhichValue;
}
switch (mEvent->message) {
switch (mEvent->mMessage) {
case NS_KEY_BEFORE_DOWN:
case NS_KEY_DOWN:
case NS_KEY_AFTER_DOWN:
+1 -1
View File
@@ -23,7 +23,7 @@ NotifyPaintEvent::NotifyPaintEvent(EventTarget* aOwner,
: Event(aOwner, aPresContext, aEvent)
{
if (mEvent) {
mEvent->message = aEventType;
mEvent->mMessage = aEventType;
}
if (aInvalidateRequests) {
mInvalidateRequests.MoveElementsFrom(aInvalidateRequests->mRequests);
+8 -8
View File
@@ -233,7 +233,7 @@ TextComposition::DispatchCompositionEvent(
RemoveControlCharactersFrom(aCompositionEvent->mData,
aCompositionEvent->mRanges);
}
if (aCompositionEvent->message == NS_COMPOSITION_COMMIT_AS_IS) {
if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT_AS_IS) {
NS_ASSERTION(!aCompositionEvent->mRanges,
"mRanges of NS_COMPOSITION_COMMIT_AS_IS should be null");
aCompositionEvent->mRanges = nullptr;
@@ -247,7 +247,7 @@ TextComposition::DispatchCompositionEvent(
} else {
aCompositionEvent->mData = mLastData;
}
} else if (aCompositionEvent->message == NS_COMPOSITION_COMMIT) {
} else if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT) {
NS_ASSERTION(!aCompositionEvent->mRanges,
"mRanges of NS_COMPOSITION_COMMIT should be null");
aCompositionEvent->mRanges = nullptr;
@@ -282,7 +282,7 @@ TextComposition::DispatchCompositionEvent(
// 2. non-empty string is committed at requesting cancel.
if (!aIsSynthesized && (mIsRequestingCommit || mIsRequestingCancel)) {
nsString* committingData = nullptr;
switch (aCompositionEvent->message) {
switch (aCompositionEvent->mMessage) {
case NS_COMPOSITION_END:
case NS_COMPOSITION_CHANGE:
case NS_COMPOSITION_COMMIT_AS_IS:
@@ -312,7 +312,7 @@ TextComposition::DispatchCompositionEvent(
// composition string empty or didn't have clause information), we don't
// need to dispatch redundant DOM text event.
if (dispatchDOMTextEvent &&
aCompositionEvent->message != NS_COMPOSITION_CHANGE &&
aCompositionEvent->mMessage != NS_COMPOSITION_CHANGE &&
!mIsComposing && mLastData == aCompositionEvent->mData) {
dispatchEvent = dispatchDOMTextEvent = false;
}
@@ -321,7 +321,7 @@ TextComposition::DispatchCompositionEvent(
// which modifies neither composition string, clauses nor caret
// position. In such case, we shouldn't dispatch DOM events.
if (dispatchDOMTextEvent &&
aCompositionEvent->message == NS_COMPOSITION_CHANGE &&
aCompositionEvent->mMessage == NS_COMPOSITION_CHANGE &&
mLastData == aCompositionEvent->mData &&
mRanges && aCompositionEvent->mRanges &&
mRanges->Equals(*aCompositionEvent->mRanges)) {
@@ -340,7 +340,7 @@ TextComposition::DispatchCompositionEvent(
// the limitation of mapping between event messages and DOM event types,
// we cannot map multiple event messages to a DOM event type.
if (dispatchDOMTextEvent &&
aCompositionEvent->message != NS_COMPOSITION_CHANGE) {
aCompositionEvent->mMessage != NS_COMPOSITION_CHANGE) {
aCompositionEvent->mFlags =
CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_CHANGE,
aStatus, aCallBack);
@@ -365,7 +365,7 @@ TextComposition::DispatchCompositionEvent(
if (aCompositionEvent->CausesDOMCompositionEndEvent()) {
// Dispatch a compositionend event if it's necessary.
if (aCompositionEvent->message != NS_COMPOSITION_END) {
if (aCompositionEvent->mMessage != NS_COMPOSITION_END) {
CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_END);
}
MOZ_ASSERT(!mIsComposing, "Why is the editor still composing?");
@@ -411,7 +411,7 @@ TextComposition::NotityUpdateComposition(
// When compositon start, notify the rect of first offset character.
// When not compositon start, notify the rect of selected composition
// string if compositionchange event.
if (aCompositionEvent->message == NS_COMPOSITION_START) {
if (aCompositionEvent->mMessage == NS_COMPOSITION_START) {
nsCOMPtr<nsIWidget> widget = mPresContext->GetRootWidget();
// Update composition start offset
WidgetQueryContentEvent selectedTextEvent(true,
+4 -3
View File
@@ -121,7 +121,8 @@ TouchEvent::Touches()
{
if (!mTouches) {
WidgetTouchEvent* touchEvent = mEvent->AsTouchEvent();
if (mEvent->message == NS_TOUCH_END || mEvent->message == NS_TOUCH_CANCEL) {
if (mEvent->mMessage == NS_TOUCH_END ||
mEvent->mMessage == NS_TOUCH_CANCEL) {
// for touchend events, remove any changed touches from the touches array
WidgetTouchEvent::AutoTouchArray unchangedTouches;
const WidgetTouchEvent::TouchArray& touches = touchEvent->touches;
@@ -148,8 +149,8 @@ TouchEvent::TargetTouches()
for (uint32_t i = 0; i < touches.Length(); ++i) {
// for touchend/cancel events, don't append to the target list if this is a
// touch that is ending
if ((mEvent->message != NS_TOUCH_END &&
mEvent->message != NS_TOUCH_CANCEL) || !touches[i]->mChanged) {
if ((mEvent->mMessage != NS_TOUCH_END &&
mEvent->mMessage != NS_TOUCH_CANCEL) || !touches[i]->mChanged) {
if (touches[i]->mTarget == mEvent->originalTarget) {
targetTouches.AppendElement(touches[i]);
}
+3 -3
View File
@@ -94,7 +94,7 @@ WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame,
WidgetWheelEvent* aEvent)
{
NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!");
MOZ_ASSERT(aEvent->message == NS_WHEEL_WHEEL,
MOZ_ASSERT(aEvent->mMessage == NS_WHEEL_WHEEL,
"Transaction must be started with a wheel event");
ScrollbarsForWheel::OwnWheelTransaction(false);
sTargetFrame = aTargetFrame;
@@ -175,7 +175,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
return;
}
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_WHEEL_WHEEL:
if (sMouseMoved != 0 &&
OutOfTime(sMouseMoved, GetIgnoreMoveDelayTime())) {
@@ -413,7 +413,7 @@ ScrollbarsForWheel::PrepareToScrollText(EventStateManager* aESM,
nsIFrame* aTargetFrame,
WidgetWheelEvent* aEvent)
{
if (aEvent->message == NS_WHEEL_START) {
if (aEvent->mMessage == NS_WHEEL_START) {
WheelTransaction::OwnScrollbars(false);
if (!IsActive()) {
TemporarilyActivateAllPossibleScrollTargets(aESM, aTargetFrame, aEvent);
+6 -6
View File
@@ -216,7 +216,7 @@ nsresult
HTMLButtonElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
@@ -227,7 +227,7 @@ HTMLButtonElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
bool outerActivateEvent =
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
(aVisitor.mEvent->message == NS_UI_ACTIVATE &&
(aVisitor.mEvent->mMessage == NS_UI_ACTIVATE &&
!mInInternalActivate));
if (outerActivateEvent) {
@@ -287,7 +287,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_KEY_PRESS:
case NS_KEY_UP:
{
@@ -295,9 +295,9 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// (bug 25300)
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
if ((keyEvent->keyCode == NS_VK_RETURN &&
NS_KEY_PRESS == aVisitor.mEvent->message) ||
NS_KEY_PRESS == aVisitor.mEvent->mMessage) ||
(keyEvent->keyCode == NS_VK_SPACE &&
NS_KEY_UP == aVisitor.mEvent->message)) {
NS_KEY_UP == aVisitor.mEvent->mMessage)) {
DispatchSimulatedClick(this, aVisitor.mEvent->mFlags.mIsTrusted,
aVisitor.mPresContext);
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
@@ -381,7 +381,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
//
// Using presShell to dispatch the event. It makes sure that
// event is not handled if the window is being destroyed.
if (presShell && (event.message != NS_FORM_SUBMIT ||
if (presShell && (event.mMessage != NS_FORM_SUBMIT ||
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
// We know the element is a submit control, if this check is moved,
// make sure formnovalidate is used only if it's a submit control.
+1 -1
View File
@@ -74,7 +74,7 @@ HTMLFieldSetElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
// Do not process any DOM events if the element is disabled.
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
+4 -4
View File
@@ -505,7 +505,7 @@ HTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
aVisitor.mWantsWillHandleEvent = true;
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
uint32_t msg = aVisitor.mEvent->message;
uint32_t msg = aVisitor.mEvent->mMessage;
if (msg == NS_FORM_SUBMIT) {
if (mGeneratingSubmit) {
aVisitor.mCanHandle = false;
@@ -535,8 +535,8 @@ HTMLFormElement::WillHandleEvent(EventChainPostVisitor& aVisitor)
// If this is the bubble stage and there is a nested form below us which
// received a submit event we do *not* want to handle the submit event
// for this form too.
if ((aVisitor.mEvent->message == NS_FORM_SUBMIT ||
aVisitor.mEvent->message == NS_FORM_RESET) &&
if ((aVisitor.mEvent->mMessage == NS_FORM_SUBMIT ||
aVisitor.mEvent->mMessage == NS_FORM_RESET) &&
aVisitor.mEvent->mFlags.mInBubblingPhase &&
aVisitor.mEvent->originalTarget != static_cast<nsIContent*>(this)) {
aVisitor.mEvent->mFlags.mPropagationStopped = true;
@@ -548,7 +548,7 @@ nsresult
HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
uint32_t msg = aVisitor.mEvent->message;
uint32_t msg = aVisitor.mEvent->mMessage;
if (msg == NS_FORM_SUBMIT) {
// let the form know not to defer subsequent submissions
mDeferSubmission = false;
+31 -31
View File
@@ -3018,7 +3018,7 @@ HTMLInputElement::NeedToInitializeEditorForEvent(
return false;
}
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_MOVE:
case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_EXIT_WIDGET:
@@ -3043,7 +3043,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
// Do not process any DOM events if the element is disabled
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
@@ -3081,7 +3081,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
bool outerActivateEvent =
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
(aVisitor.mEvent->message == NS_UI_ACTIVATE && !mInInternalActivate));
(aVisitor.mEvent->mMessage == NS_UI_ACTIVATE && !mInInternalActivate));
if (outerActivateEvent) {
aVisitor.mItemFlags |= NS_OUTER_ACTIVATE_EVENT;
@@ -3146,7 +3146,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
}
if (IsSingleLineTextControl(false) &&
aVisitor.mEvent->message == NS_MOUSE_CLICK &&
aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
aVisitor.mEvent->AsMouseEvent()->button ==
WidgetMouseEvent::eMiddleButton) {
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
@@ -3156,7 +3156,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mItemFlags |= mType;
// Fire onchange (if necessary), before we do the blur, bug 357684.
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
// Experimental mobile types rely on the system UI to prevent users to not
// set invalid values but we have to be extra-careful. Especially if the
// option has been enabled on desktop.
@@ -3170,8 +3170,8 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
}
if (mType == NS_FORM_INPUT_RANGE &&
(aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
aVisitor.mEvent->message == NS_BLUR_CONTENT)) {
(aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT)) {
// Just as nsGenericHTMLFormElementWithState::PreHandleEvent calls
// nsIFormControlFrame::SetFocus, we handle focus here.
nsIFrame* frame = GetPrimaryFrame();
@@ -3189,7 +3189,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
// we want to end the spin. We do this here (rather than in
// PostHandleEvent) because we don't want to let content preventDefault()
// the end of the spin.
if (aVisitor.mEvent->message == NS_MOUSE_MOVE) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_MOVE) {
// Be aggressive about stopping the spin:
bool stopSpin = true;
nsNumberControlFrame* numberControlFrame =
@@ -3220,13 +3220,13 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (stopSpin) {
StopNumberControlSpinnerSpin();
}
} else if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
StopNumberControlSpinnerSpin();
}
}
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
// Tell our frame it's getting focus so that it can make sure focus
// is moved to our anonymous text control.
nsNumberControlFrame* numberControlFrame =
@@ -3246,7 +3246,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
// that).
frame->InvalidateFrame();
}
} else if (aVisitor.mEvent->message == NS_KEY_UP) {
} else if (aVisitor.mEvent->mMessage == NS_KEY_UP) {
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
if ((keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
!(keyEvent->IsShift() || keyEvent->IsControl() ||
@@ -3278,7 +3278,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
textControl = numberControlFrame->GetAnonTextControl();
}
if (textControl && aVisitor.mEvent->originalTarget == textControl) {
if (aVisitor.mEvent->message == NS_EDITOR_INPUT) {
if (aVisitor.mEvent->mMessage == NS_EDITOR_INPUT) {
// Propogate the anon text control's new value to our HTMLInputElement:
nsAutoString value;
numberControlFrame->GetValueOfAnonTextControl(value);
@@ -3290,7 +3290,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
numberControlFrame->HandlingInputEvent(false);
}
}
else if (aVisitor.mEvent->message == NS_FORM_CHANGE) {
else if (aVisitor.mEvent->mMessage == NS_FORM_CHANGE) {
// We cancel the DOM 'change' event that is fired for any change to our
// anonymous text control since we fire our own 'change' events and
// content shouldn't be seeing two 'change' events. Besides that we
@@ -3577,15 +3577,15 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
return MaybeInitPickers(aVisitor);
}
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT &&
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT &&
MayFireChangeOnBlur() &&
!mIsDraggingRange) { // StartRangeThumbDrag already set mFocusedValue
GetValue(mFocusedValue);
}
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
if (mIsDraggingRange) {
FinishRangeThumbDrag();
} else if (mNumberControlSpinnerIsSpinning) {
@@ -3593,7 +3593,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
}
UpdateValidityUIBits(aVisitor.mEvent->message == NS_FOCUS_CONTENT);
UpdateValidityUIBits(aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT);
UpdateState(true);
}
@@ -3710,7 +3710,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
if (NS_SUCCEEDED(rv)) {
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
if (mType == NS_FORM_INPUT_NUMBER &&
keyEvent && keyEvent->message == NS_KEY_PRESS &&
keyEvent && keyEvent->mMessage == NS_KEY_PRESS &&
aVisitor.mEvent->mFlags.mIsTrusted &&
(keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
!(keyEvent->IsShift() || keyEvent->IsControl() ||
@@ -3733,7 +3733,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}
} else if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_FOCUS_CONTENT:
{
@@ -3768,9 +3768,9 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// For backwards compat, trigger checks/radios/buttons with
// space or enter (bug 25300)
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
if ((aVisitor.mEvent->message == NS_KEY_PRESS &&
if ((aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
keyEvent->keyCode == NS_VK_RETURN) ||
(aVisitor.mEvent->message == NS_KEY_UP &&
(aVisitor.mEvent->mMessage == NS_KEY_UP &&
keyEvent->keyCode == NS_VK_SPACE)) {
switch(mType) {
case NS_FORM_INPUT_CHECKBOX:
@@ -3796,7 +3796,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
} // case
} // switch
}
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
mType == NS_FORM_INPUT_RADIO && !keyEvent->IsAlt() &&
!keyEvent->IsControl() && !keyEvent->IsMeta()) {
bool isMovingBack = false;
@@ -3842,7 +3842,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
* not submit, period.
*/
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
keyEvent->keyCode == NS_VK_RETURN &&
(IsSingleLineTextControl(false, mType) ||
mType == NS_FORM_INPUT_NUMBER ||
@@ -3852,7 +3852,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
NS_ENSURE_SUCCESS(rv, rv);
}
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
mType == NS_FORM_INPUT_RANGE && !keyEvent->IsAlt() &&
!keyEvent->IsControl() && !keyEvent->IsMeta() &&
(keyEvent->keyCode == NS_VK_LEFT ||
@@ -3942,7 +3942,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
nsNumberControlFrame* numberControlFrame =
do_QueryFrame(GetPrimaryFrame());
if (numberControlFrame) {
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN &&
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
IsMutable()) {
switch (numberControlFrame->GetSpinButtonForPointerEvent(
aVisitor.mEvent->AsMouseEvent())) {
@@ -4004,7 +4004,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// pres shell. See bug 125624.
// TODO: removing this code and have the submit event sent by the
// form, see bug 592124.
if (presShell && (event.message != NS_FORM_SUBMIT ||
if (presShell && (event.mMessage != NS_FORM_SUBMIT ||
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
// We know the element is a submit control, if this check is moved,
// make sure formnovalidate is used only if it's a submit control.
@@ -4059,7 +4059,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
return;
}
switch (aVisitor.mEvent->message)
switch (aVisitor.mEvent->mMessage)
{
case NS_MOUSE_BUTTON_DOWN:
case NS_TOUCH_START: {
@@ -4076,7 +4076,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
inputEvent->IsOS()) {
break; // ignore
}
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aVisitor.mEvent->AsMouseEvent()->buttons ==
WidgetMouseEvent::eLeftButtonFlag) {
StartRangeThumbDrag(inputEvent);
+2 -2
View File
@@ -104,7 +104,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mHandlingEvent ||
(!(mouseEvent && mouseEvent->IsLeftClickEvent()) &&
aVisitor.mEvent->message != NS_MOUSE_BUTTON_DOWN) ||
aVisitor.mEvent->mMessage != NS_MOUSE_BUTTON_DOWN) ||
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
!aVisitor.mPresContext ||
// Don't handle the event if it's already been handled by another label
@@ -122,7 +122,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
if (content) {
mHandlingEvent = true;
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
// We reset the mouse-down point on every event because there is
+2 -2
View File
@@ -254,7 +254,7 @@ HTMLMenuItemElement::SetChecked(bool aChecked)
nsresult
HTMLMenuItemElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
if (aVisitor.mEvent->message == NS_MOUSE_CLICK) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK) {
bool originalCheckedValue = false;
switch (mType) {
@@ -290,7 +290,7 @@ nsresult
HTMLMenuItemElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
// Check to see if the event was cancelled.
if (aVisitor.mEvent->message == NS_MOUSE_CLICK &&
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
aVisitor.mItemFlags & NS_CHECKED_IS_TOGGLED &&
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault) {
bool originalCheckedValue =
+1 -1
View File
@@ -210,7 +210,7 @@ HTMLObjectElement::HandleFocusBlurPlugin(Element* aElement,
if (!aEvent->mFlags.mIsTrusted) {
return;
}
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_FOCUS_CONTENT: {
OnFocusBlurPlugin(aElement, true);
break;
+3 -3
View File
@@ -1510,7 +1510,7 @@ nsresult
HTMLSelectElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
@@ -1520,7 +1520,7 @@ HTMLSelectElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
nsresult
HTMLSelectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
// If the invalid UI is shown, we should show it while focused and
// update the invalid/valid UI.
mCanShowInvalidUI = !IsValid() && ShouldShowValidityUI();
@@ -1531,7 +1531,7 @@ HTMLSelectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// We don't have to update NS_EVENT_STATE_MOZ_UI_INVALID nor
// NS_EVENT_STATE_MOZ_UI_VALID given that the states should not change.
} else if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
} else if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
mCanShowInvalidUI = true;
mCanShowValidUI = true;
+1 -1
View File
@@ -77,7 +77,7 @@ HTMLSummaryElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
WidgetKeyboardEvent* keyboardEvent = event->AsKeyboardEvent();
bool dispatchClick = false;
switch (event->message) {
switch (event->mMessage) {
case NS_KEY_PRESS:
if (keyboardEvent->charCode == nsIDOMKeyEvent::DOM_VK_SPACE) {
// Consume 'space' key to prevent scrolling the page down.
+8 -8
View File
@@ -478,13 +478,13 @@ nsresult
HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
// Don't dispatch a second select event if we are already handling
// one.
if (aVisitor.mEvent->message == NS_FORM_SELECTED) {
if (aVisitor.mEvent->mMessage == NS_FORM_SELECTED) {
if (mHandlingSelect) {
return NS_OK;
}
@@ -497,14 +497,14 @@ HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (aVisitor.mEvent->mFlags.mNoContentDispatch) {
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
}
if (aVisitor.mEvent->message == NS_MOUSE_CLICK &&
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
aVisitor.mEvent->AsMouseEvent()->button ==
WidgetMouseEvent::eMiddleButton) {
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
}
// Fire onchange (if necessary), before we do the blur, bug 370521.
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
FireChangeEventIfNeeded();
}
@@ -532,13 +532,13 @@ HTMLTextAreaElement::FireChangeEventIfNeeded()
nsresult
HTMLTextAreaElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
if (aVisitor.mEvent->message == NS_FORM_SELECTED) {
if (aVisitor.mEvent->mMessage == NS_FORM_SELECTED) {
mHandlingSelect = false;
}
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
// If the invalid UI is shown, we should show it while focusing (and
// update). Otherwise, we should not.
GetValueInternal(mFocusedValue, true);
+1 -1
View File
@@ -2251,7 +2251,7 @@ nsresult
nsGenericHTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
if (aVisitor.mEvent->mFlags.mIsTrusted) {
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_FOCUS_CONTENT:
{
// Check to see if focus has bubbled up from a form control's
+1 -1
View File
@@ -907,7 +907,7 @@ nsTextInputListener::HandleEvent(nsIDOMEvent* aEvent)
return NS_ERROR_UNEXPECTED;
}
if (keyEvent->message != NS_KEY_PRESS) {
if (keyEvent->mMessage != NS_KEY_PRESS) {
return NS_OK;
}
-1
View File
@@ -6,7 +6,6 @@
XPIDL_SOURCES += [
'nsIDOMCounter.idl',
'nsIDOMCSSCharsetRule.idl',
'nsIDOMCSSConditionRule.idl',
'nsIDOMCSSCounterStyleRule.idl',
'nsIDOMCSSFontFaceRule.idl',
@@ -1,13 +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/. */
#include "nsIDOMCSSRule.idl"
[scriptable, uuid(756c326c-eb38-4342-95e5-5eabea809174)]
interface nsIDOMCSSCharsetRule : nsIDOMCSSRule
{
attribute DOMString encoding;
// raises(DOMException) on setting
};
+11 -11
View File
@@ -2377,7 +2377,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
}
bool currentlyTrackingTouch = (mActivePointerId >= 0);
if (aEvent.message == NS_TOUCH_START) {
if (aEvent.mMessage == NS_TOUCH_START) {
if (currentlyTrackingTouch || aEvent.touches.Length() > 1) {
// We're tracking a possible tap for another point, or we saw a
// touchstart for a later pointer after we canceled tracking of
@@ -2417,7 +2417,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
LayoutDevicePoint currentPoint = LayoutDevicePoint(trackedTouch->mRefPoint.x, trackedTouch->mRefPoint.y);
int64_t time = aEvent.time;
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_TOUCH_MOVE:
if (std::abs(currentPoint.x - mGestureDownPoint.x) > sDragThreshold.width ||
std::abs(currentPoint.y - mGestureDownPoint.y) > sDragThreshold.height) {
@@ -2494,7 +2494,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
const uint64_t& aInputBlockId,
const nsEventStatus& aApzResponse)
{
TABC_LOG("Receiving touch event of type %d\n", aEvent.message);
TABC_LOG("Receiving touch event of type %d\n", aEvent.mMessage);
WidgetTouchEvent localEvent(aEvent);
localEvent.widget = mPuppetWidget;
@@ -2502,7 +2502,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
mPuppetWidget->GetDefaultScale());
if (localEvent.message == NS_TOUCH_START && AsyncPanZoomEnabled()) {
if (localEvent.mMessage == NS_TOUCH_START && AsyncPanZoomEnabled()) {
if (gfxPrefs::TouchActionEnabled()) {
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(mPuppetWidget,
localEvent, aInputBlockId, mSetAllowedTouchBehaviorCallback);
@@ -2551,13 +2551,13 @@ TabChild::RecvRealDragEvent(const WidgetDragEvent& aEvent,
}
}
if (aEvent.message == NS_DRAGDROP_DROP) {
if (aEvent.mMessage == NS_DRAGDROP_DROP) {
bool canDrop = true;
if (!dragSession || NS_FAILED(dragSession->GetCanDrop(&canDrop)) ||
!canDrop) {
localEvent.message = NS_DRAGDROP_EXIT;
localEvent.mMessage = NS_DRAGDROP_EXIT;
}
} else if (aEvent.message == NS_DRAGDROP_OVER) {
} else if (aEvent.mMessage == NS_DRAGDROP_OVER) {
nsCOMPtr<nsIDragService> dragService =
do_GetService("@mozilla.org/widget/dragservice;1");
if (dragService) {
@@ -2604,7 +2604,7 @@ TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event,
{
AutoCacheNativeKeyCommands autoCache(mPuppetWidget);
if (event.message == NS_KEY_PRESS) {
if (event.mMessage == NS_KEY_PRESS) {
// If content code called preventDefault() on a keydown event, then we don't
// want to process any following keypress events.
if (mIgnoreKeyPressEvent) {
@@ -2624,7 +2624,7 @@ TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event,
localEvent.widget = mPuppetWidget;
nsEventStatus status = APZCCallbackHelper::DispatchWidgetEvent(localEvent);
if (event.message == NS_KEY_DOWN) {
if (event.mMessage == NS_KEY_DOWN) {
mIgnoreKeyPressEvent = status == nsEventStatus_eConsumeNoDefault;
}
@@ -2661,7 +2661,7 @@ TabChild::RecvCompositionEvent(const WidgetCompositionEvent& event)
WidgetCompositionEvent localEvent(event);
localEvent.widget = mPuppetWidget;
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
unused << SendOnEventNeedingAckHandled(event.message);
unused << SendOnEventNeedingAckHandled(event.mMessage);
return true;
}
@@ -2671,7 +2671,7 @@ TabChild::RecvSelectionEvent(const WidgetSelectionEvent& event)
WidgetSelectionEvent localEvent(event);
localEvent.widget = mPuppetWidget;
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
unused << SendOnEventNeedingAckHandled(event.message);
unused << SendOnEventNeedingAckHandled(event.mMessage);
return true;
}
+8 -8
View File
@@ -1369,19 +1369,19 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
if (widget) {
// When we mouseenter the tab, the tab's cursor should
// become the current cursor. When we mouseexit, we stop.
if (NS_MOUSE_ENTER_WIDGET == event.message) {
if (NS_MOUSE_ENTER_WIDGET == event.mMessage) {
mTabSetsCursor = true;
if (mCustomCursor) {
widget->SetCursor(mCustomCursor, mCustomCursorHotspotX, mCustomCursorHotspotY);
} else if (mCursor != nsCursor(-1)) {
widget->SetCursor(mCursor);
}
} else if (NS_MOUSE_EXIT_WIDGET == event.message) {
} else if (NS_MOUSE_EXIT_WIDGET == event.mMessage) {
mTabSetsCursor = false;
}
}
if (NS_MOUSE_MOVE == event.message) {
if (NS_MOUSE_MOVE == event.mMessage) {
return SendRealMouseMoveEvent(event);
}
return SendRealMouseButtonEvent(event);
@@ -1723,7 +1723,7 @@ bool TabParent::SendRealKeyEvent(WidgetKeyboardEvent& event)
MaybeNativeKeyBinding bindings;
bindings = void_t();
if (event.message == NS_KEY_PRESS) {
if (event.mMessage == NS_KEY_PRESS) {
nsCOMPtr<nsIWidget> widget = GetWidget();
AutoInfallibleTArray<mozilla::CommandInt, 4> singleLine;
@@ -1755,7 +1755,7 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event)
// confuses remote content and the panning and zooming logic into thinking
// that the added touches are part of the touchend/cancel, when actually
// they're not.
if (event.message == NS_TOUCH_END || event.message == NS_TOUCH_CANCEL) {
if (event.mMessage == NS_TOUCH_END || event.mMessage == NS_TOUCH_CANCEL) {
for (int i = event.touches.Length() - 1; i >= 0; i--) {
if (!event.touches[i]->mChanged) {
event.touches.RemoveElementAt(i);
@@ -1777,7 +1777,7 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event)
event.touches[i]->mRefPoint += offset;
}
return (event.message == NS_TOUCH_MOVE) ?
return (event.mMessage == NS_TOUCH_MOVE) ?
PBrowserParent::SendRealTouchMoveEvent(event, guid, blockId, apzResponse) :
PBrowserParent::SendRealTouchEvent(event, guid, blockId, apzResponse);
}
@@ -2257,7 +2257,7 @@ TabParent::RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent)
if (mFrameElement &&
PresShell::BeforeAfterKeyboardEventEnabled() &&
localEvent.message != NS_KEY_PRESS) {
localEvent.mMessage != NS_KEY_PRESS) {
presShell->DispatchAfterKeyboardEvent(mFrameElement, localEvent,
aEvent.mFlags.mDefaultPrevented);
}
@@ -2276,7 +2276,7 @@ TabParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent)
NS_WARN_IF(!aEvent.mSucceeded)) {
return true;
}
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_QUERY_TEXT_RECT:
case NS_QUERY_CARET_RECT:
case NS_QUERY_EDITOR_RECT:
+26 -22
View File
@@ -6,39 +6,43 @@
#include "AudioContext.h"
#include "nsPIDOMWindow.h"
#include "blink/PeriodicWave.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/AnalyserNode.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/dom/AudioContextBinding.h"
#include "mozilla/dom/OfflineAudioContextBinding.h"
#include "mozilla/OwningNonNull.h"
#include "MediaStreamGraph.h"
#include "mozilla/dom/AnalyserNode.h"
#include "mozilla/dom/AudioContextBinding.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/dom/OfflineAudioContextBinding.h"
#include "mozilla/dom/Promise.h"
#include "AudioBuffer.h"
#include "AudioBufferSourceNode.h"
#include "AudioChannelService.h"
#include "AudioDestinationNode.h"
#include "AudioBufferSourceNode.h"
#include "AudioBuffer.h"
#include "GainNode.h"
#include "MediaElementAudioSourceNode.h"
#include "MediaStreamAudioSourceNode.h"
#include "DelayNode.h"
#include "PannerNode.h"
#include "AudioListener.h"
#include "DynamicsCompressorNode.h"
#include "AudioStream.h"
#include "BiquadFilterNode.h"
#include "ScriptProcessorNode.h"
#include "StereoPannerNode.h"
#include "ChannelMergerNode.h"
#include "ChannelSplitterNode.h"
#include "MediaStreamAudioDestinationNode.h"
#include "WaveShaperNode.h"
#include "PeriodicWave.h"
#include "ConvolverNode.h"
#include "OscillatorNode.h"
#include "DelayNode.h"
#include "DynamicsCompressorNode.h"
#include "GainNode.h"
#include "MediaElementAudioSourceNode.h"
#include "MediaStreamAudioDestinationNode.h"
#include "MediaStreamAudioSourceNode.h"
#include "MediaStreamGraph.h"
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "AudioStream.h"
#include "mozilla/dom/Promise.h"
#include "nsPIDOMWindow.h"
#include "OscillatorNode.h"
#include "PannerNode.h"
#include "PeriodicWave.h"
#include "ScriptProcessorNode.h"
#include "StereoPannerNode.h"
#include "WaveShaperNode.h"
namespace mozilla {
namespace dom {
+23 -20
View File
@@ -5,47 +5,50 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/Notification.h"
#include "mozilla/Move.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/unused.h"
#include "mozilla/dom/AppNotificationServiceOptionsBinding.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/dom/NotificationEvent.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/PromiseWorkerProxy.h"
#include "mozilla/Move.h"
#include "mozilla/Preferences.h"
#include "mozilla/unused.h"
#include "mozilla/dom/ServiceWorkerGlobalScopeBinding.h"
#include "nsContentPermissionHelper.h"
#include "nsContentUtils.h"
#include "nsDOMJSUtils.h"
#include "nsGlobalWindow.h"
#include "nsIAlertsService.h"
#include "nsIAppsService.h"
#include "nsIContentPermissionPrompt.h"
#include "nsIDocument.h"
#include "nsILoadContext.h"
#include "nsINotificationStorage.h"
#include "nsIPermissionManager.h"
#include "nsIScriptSecurityManager.h"
#include "nsIServiceWorkerManager.h"
#include "nsIUUIDGenerator.h"
#include "nsIXPConnect.h"
#include "nsNetUtil.h"
#include "nsProxyRelease.h"
#include "nsServiceManagerUtils.h"
#include "nsStructuredCloneContainer.h"
#include "nsToolkitCompsCID.h"
#include "nsGlobalWindow.h"
#include "nsDOMJSUtils.h"
#include "nsProxyRelease.h"
#include "nsNetUtil.h"
#include "nsIScriptSecurityManager.h"
#include "nsIXPConnect.h"
#include "mozilla/dom/ServiceWorkerGlobalScopeBinding.h"
#include "mozilla/dom/NotificationEvent.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/Services.h"
#include "nsContentPermissionHelper.h"
#include "nsILoadContext.h"
#ifdef MOZ_B2G
#include "nsIDOMDesktopNotification.h"
#endif
#include "ServiceWorkerManager.h"
#include "WorkerPrivate.h"
#include "WorkerRunnable.h"
#include "WorkerScope.h"
#ifdef MOZ_B2G
#include "nsIDOMDesktopNotification.h"
#endif
namespace mozilla {
namespace dom {
+39 -37
View File
@@ -1482,7 +1482,7 @@ nsresult nsPluginInstanceOwner::DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent)
WidgetEvent* theEvent = aFocusEvent->GetInternalNSEvent();
if (theEvent) {
WidgetGUIEvent focusEvent(theEvent->mFlags.mIsTrusted, theEvent->message,
WidgetGUIEvent focusEvent(theEvent->mFlags.mIsTrusted, theEvent->mMessage,
nullptr);
nsEventStatus rv = ProcessEvent(focusEvent);
if (nsEventStatus_eConsumeNoDefault == rv) {
@@ -1591,7 +1591,7 @@ nsresult nsPluginInstanceOwner::DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent,
aMouseEvent->StopPropagation();
}
}
if (mouseEvent->message == NS_MOUSE_BUTTON_UP) {
if (mouseEvent->mMessage == NS_MOUSE_BUTTON_UP) {
mLastMouseDownButtonType = -1;
}
}
@@ -1656,8 +1656,9 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
if (dragEvent && mInstance) {
WidgetEvent* ievent = aEvent->GetInternalNSEvent();
if ((ievent && ievent->mFlags.mIsTrusted) &&
ievent->message != NS_DRAGDROP_ENTER && ievent->message != NS_DRAGDROP_OVER) {
if (ievent && ievent->mFlags.mIsTrusted &&
ievent->mMessage != NS_DRAGDROP_ENTER &&
ievent->mMessage != NS_DRAGDROP_OVER) {
aEvent->PreventDefault();
}
@@ -1714,7 +1715,7 @@ CocoaEventTypeForEvent(const WidgetGUIEvent& anEvent, nsIFrame* aObjectFrame)
return event->type;
}
switch (anEvent.message) {
switch (anEvent.mMessage) {
case NS_MOUSE_OVER:
return NPCocoaEventMouseEntered;
case NS_MOUSE_OUT:
@@ -1755,12 +1756,12 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
InitializeNPCocoaEvent(&cocoaEvent);
cocoaEvent.type = CocoaEventTypeForEvent(*anEvent, aObjectFrame);
if (anEvent->message == NS_MOUSE_MOVE ||
anEvent->message == NS_MOUSE_BUTTON_DOWN ||
anEvent->message == NS_MOUSE_BUTTON_UP ||
anEvent->message == NS_MOUSE_SCROLL ||
anEvent->message == NS_MOUSE_OVER ||
anEvent->message == NS_MOUSE_OUT)
if (anEvent->mMessage == NS_MOUSE_MOVE ||
anEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
anEvent->mMessage == NS_MOUSE_BUTTON_UP ||
anEvent->mMessage == NS_MOUSE_SCROLL ||
anEvent->mMessage == NS_MOUSE_OVER ||
anEvent->mMessage == NS_MOUSE_OUT)
{
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) -
aObjectFrame->GetContentRectRelativeToSelf().TopLeft();
@@ -1776,7 +1777,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
cocoaEvent.data.mouse.pluginY = double(ptPx.y);
}
switch (anEvent->message) {
switch (anEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
{
@@ -1819,7 +1820,8 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
// That keyEvent->mPluginTextEventString is non-empty is a signal that we should
// create a text event for the plugin, instead of a key event.
if ((anEvent->message == NS_KEY_DOWN) && !keyEvent->mPluginTextEventString.IsEmpty()) {
if (anEvent->mMessage == NS_KEY_DOWN &&
!keyEvent->mPluginTextEventString.IsEmpty()) {
cocoaEvent.type = NPCocoaEventTextInput;
const char16_t* pluginTextEventString = keyEvent->mPluginTextEventString.get();
cocoaEvent.data.text.text = (NPNSString*)
@@ -1845,7 +1847,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
}
case NS_FOCUS_CONTENT:
case NS_BLUR_CONTENT:
cocoaEvent.data.focus.hasFocus = (anEvent->message == NS_FOCUS_CONTENT);
cocoaEvent.data.focus.hasFocus = (anEvent->mMessage == NS_FOCUS_CONTENT);
break;
default:
break;
@@ -1883,7 +1885,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// focus unless it lost focus within the window. For example, ignore a blur
// event if it's coming due to the plugin's window deactivating.
nsCOMPtr<nsIContent> content = do_QueryReferent(mContent);
if (anEvent.message == NS_BLUR_CONTENT &&
if (anEvent.mMessage == NS_BLUR_CONTENT &&
ContentIsFocusedWithinWindow(content)) {
mShouldBlurOnActivate = true;
return nsEventStatus_eIgnore;
@@ -1893,7 +1895,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// it focus. This might happen if it has focus, its window is blurred, then the
// window is made active again. The plugin never lost in-window focus, so it
// shouldn't get a focus event again.
if (anEvent.message == NS_FOCUS_CONTENT &&
if (anEvent.mMessage == NS_FOCUS_CONTENT &&
mLastContentFocused == true) {
mShouldBlurOnActivate = false;
return nsEventStatus_eIgnore;
@@ -1902,9 +1904,9 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// Now, if we're going to send a focus event, update mLastContentFocused and
// tell any plugins in our window that we have taken focus, so they should
// perform any delayed blurs.
if (anEvent.message == NS_FOCUS_CONTENT ||
anEvent.message == NS_BLUR_CONTENT) {
mLastContentFocused = (anEvent.message == NS_FOCUS_CONTENT);
if (anEvent.mMessage == NS_FOCUS_CONTENT ||
anEvent.mMessage == NS_BLUR_CONTENT) {
mLastContentFocused = (anEvent.mMessage == NS_FOCUS_CONTENT);
mShouldBlurOnActivate = false;
PerformDelayedBlurs();
}
@@ -1948,7 +1950,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
}
bool handled = (response == kNPEventHandled || response == kNPEventStartIME);
bool leftMouseButtonDown = (anEvent.message == NS_MOUSE_BUTTON_DOWN) &&
bool leftMouseButtonDown = (anEvent.mMessage == NS_MOUSE_BUTTON_DOWN) &&
(anEvent.AsMouseEvent()->button == WidgetMouseEvent::eLeftButton);
if (handled && !(leftMouseButtonDown && !mContentFocused)) {
rv = nsEventStatus_eConsumeNoDefault;
@@ -1967,7 +1969,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// types
pluginEvent.event = 0;
const WidgetMouseEvent* mouseEvent = anEvent.AsMouseEvent();
switch (anEvent.message) {
switch (anEvent.mMessage) {
case NS_MOUSE_MOVE:
pluginEvent.event = WM_MOUSEMOVE;
break;
@@ -2012,12 +2014,12 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// not the widget they were received on.
// See use of NPEvent in widget/windows/nsWindow.cpp
// for why this assert should be safe
NS_ASSERTION(anEvent.message == NS_MOUSE_BUTTON_DOWN ||
anEvent.message == NS_MOUSE_BUTTON_UP ||
anEvent.message == NS_MOUSE_DOUBLECLICK ||
anEvent.message == NS_MOUSE_OVER ||
anEvent.message == NS_MOUSE_OUT ||
anEvent.message == NS_MOUSE_MOVE,
NS_ASSERTION(anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ||
anEvent.mMessage == NS_MOUSE_BUTTON_UP ||
anEvent.mMessage == NS_MOUSE_DOUBLECLICK ||
anEvent.mMessage == NS_MOUSE_OVER ||
anEvent.mMessage == NS_MOUSE_OUT ||
anEvent.mMessage == NS_MOUSE_MOVE,
"Incorrect event type for coordinate translation");
nsPoint pt =
nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
@@ -2030,7 +2032,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
}
}
else if (!pPluginEvent) {
switch (anEvent.message) {
switch (anEvent.mMessage) {
case NS_FOCUS_CONTENT:
pluginEvent.event = WM_SETFOCUS;
pluginEvent.wParam = 0;
@@ -2071,7 +2073,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
switch(anEvent.mClass) {
case eMouseEventClass:
{
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK:
@@ -2099,13 +2101,13 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
Window root = None; // Could XQueryTree, but this is not important.
#endif
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_MOUSE_OVER:
case NS_MOUSE_OUT:
{
XCrossingEvent& event = pluginEvent.xcrossing;
event.type = anEvent.message == NS_MOUSE_OVER ?
event.type = anEvent.mMessage == NS_MOUSE_OVER ?
EnterNotify : LeaveNotify;
event.root = root;
event.time = anEvent.time;
@@ -2143,7 +2145,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
case NS_MOUSE_BUTTON_UP:
{
XButtonEvent& event = pluginEvent.xbutton;
event.type = anEvent.message == NS_MOUSE_BUTTON_DOWN ?
event.type = anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ?
ButtonPress : ButtonRelease;
event.root = root;
event.time = anEvent.time;
@@ -2186,7 +2188,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
static_cast<const GdkEventKey*>(anEvent.mPluginEvent);
event.keycode = gdkEvent->hardware_keycode;
event.state = gdkEvent->state;
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_KEY_DOWN:
// Handle NS_KEY_DOWN for modifier key presses
@@ -2223,14 +2225,14 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
break;
default:
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_FOCUS_CONTENT:
case NS_BLUR_CONTENT:
{
XFocusChangeEvent &event = pluginEvent.xfocus;
event.type =
anEvent.message == NS_FOCUS_CONTENT ? FocusIn : FocusOut;
anEvent.mMessage == NS_FOCUS_CONTENT ? FocusIn : FocusOut;
// information lost:
event.mode = -1;
event.detail = NotifyDetailNone;
@@ -2271,7 +2273,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
switch(anEvent.mClass) {
case eMouseEventClass:
{
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK:
@@ -2287,7 +2289,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
nsIntPoint pluginPoint(presContext->AppUnitsToDevPixels(appPoint.x),
presContext->AppUnitsToDevPixels(appPoint.y));
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_MOUSE_MOVE:
{
+22 -14
View File
@@ -6,31 +6,35 @@
#include "mozilla/dom/Promise.h"
#include "jsfriendapi.h"
#include "js/Debug.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DOMError.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/dom/PromiseBinding.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/MediaStreamError.h"
#include "mozilla/Atomics.h"
#include "mozilla/CycleCollectedJSRuntime.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DOMError.h"
#include "mozilla/dom/DOMException.h"
#include "mozilla/dom/MediaStreamError.h"
#include "mozilla/dom/PromiseBinding.h"
#include "mozilla/dom/ScriptSettings.h"
#include "jsfriendapi.h"
#include "nsContentUtils.h"
#include "nsGlobalWindow.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsJSEnvironment.h"
#include "nsJSPrincipals.h"
#include "nsJSUtils.h"
#include "nsPIDOMWindow.h"
#include "PromiseCallback.h"
#include "PromiseDebugging.h"
#include "PromiseNativeHandler.h"
#include "PromiseWorkerProxy.h"
#include "nsContentUtils.h"
#include "WorkerPrivate.h"
#include "WorkerRunnable.h"
#include "nsJSPrincipals.h"
#include "nsJSUtils.h"
#include "nsPIDOMWindow.h"
#include "nsJSEnvironment.h"
#include "nsIScriptObjectPrincipal.h"
#include "xpcpublic.h"
#include "nsGlobalWindow.h"
namespace mozilla {
namespace dom {
@@ -1705,6 +1709,10 @@ void Promise::MaybeRejectBrokenly(const nsRefPtr<DOMError>& aArg) {
MaybeSomething(aArg, &Promise::MaybeReject);
}
template<>
void Promise::MaybeRejectBrokenly(const nsRefPtr<DOMException>& aArg) {
MaybeSomething(aArg, &Promise::MaybeReject);
}
template<>
void Promise::MaybeRejectBrokenly(const nsAString& aArg) {
MaybeSomething(aArg, &Promise::MaybeReject);
}
+1 -1
View File
@@ -590,7 +590,7 @@ SVGSVGElement::IsAttributeMapped(const nsIAtom* name) const
nsresult
SVGSVGElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
if (aVisitor.mEvent->message == NS_SVG_LOAD) {
if (aVisitor.mEvent->mMessage == NS_SVG_LOAD) {
if (mTimedDocumentRoot) {
mTimedDocumentRoot->Begin();
// Set 'resample needed' flag, so that if any script calls a DOM method
@@ -307,8 +307,6 @@ var interfaceNamesInGlobalScope =
"CSS2Properties",
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "CSSAnimation", release: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
"CSSCharsetRule",
// IMPORTANT: Do not change this list without review from a DOM peer!
"CSSConditionRule",
// IMPORTANT: Do not change this list without review from a DOM peer!
+2
View File
@@ -47,6 +47,8 @@ interface MutationObserver {
sequence<MutationObservingInfo?> getObservingInfo();
[ChromeOnly]
readonly attribute MutationCallback mutationCallback;
[ChromeOnly]
attribute boolean mergeAttributeRecords;
};
callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer);
+7 -7
View File
@@ -1289,18 +1289,18 @@ nsXULElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
if (IsRootOfNativeAnonymousSubtree() &&
(IsAnyOfXULElements(nsGkAtoms::scrollbar, nsGkAtoms::scrollcorner)) &&
(aVisitor.mEvent->message == NS_MOUSE_CLICK ||
aVisitor.mEvent->message == NS_MOUSE_DOUBLECLICK ||
aVisitor.mEvent->message == NS_XUL_COMMAND ||
aVisitor.mEvent->message == NS_CONTEXTMENU ||
aVisitor.mEvent->message == NS_DRAGDROP_START ||
aVisitor.mEvent->message == NS_DRAGDROP_GESTURE)) {
(aVisitor.mEvent->mMessage == NS_MOUSE_CLICK ||
aVisitor.mEvent->mMessage == NS_MOUSE_DOUBLECLICK ||
aVisitor.mEvent->mMessage == NS_XUL_COMMAND ||
aVisitor.mEvent->mMessage == NS_CONTEXTMENU ||
aVisitor.mEvent->mMessage == NS_DRAGDROP_START ||
aVisitor.mEvent->mMessage == NS_DRAGDROP_GESTURE)) {
// Don't propagate these events from native anonymous scrollbar.
aVisitor.mCanHandle = true;
aVisitor.mParentTarget = nullptr;
return NS_OK;
}
if (aVisitor.mEvent->message == NS_XUL_COMMAND &&
if (aVisitor.mEvent->mMessage == NS_XUL_COMMAND &&
aVisitor.mEvent->mClass == eInputEventClass &&
aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this) &&
!IsXULElement(nsGkAtoms::command)) {
+2 -2
View File
@@ -4653,7 +4653,7 @@ nsEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
WidgetKeyboardEvent* nativeKeyEvent =
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
"HandleKeyPressEvent gets non-keypress event");
// if we are readonly or disabled, then do nothing.
@@ -5109,7 +5109,7 @@ nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
// strange event order.
bool needsWidget = false;
WidgetGUIEvent* widgetGUIEvent = nullptr;
switch (widgetEvent->message) {
switch (widgetEvent->mMessage) {
case NS_USER_DEFINED_EVENT:
// If events are not created with proper event interface, their message
// are initialized with NS_USER_DEFINED_EVENT. Let's ignore such event.
+1 -1
View File
@@ -369,7 +369,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
// calling it, this queries the specific interface. If it would fail,
// each event handler would just ignore the event. So, in this method,
// you don't need to check if the QI succeeded before each call.
switch (internalEvent->message) {
switch (internalEvent->mMessage) {
// dragenter
case NS_DRAGDROP_ENTER: {
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
+1 -1
View File
@@ -596,7 +596,7 @@ nsHTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
WidgetKeyboardEvent* nativeKeyEvent =
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
"HandleKeyPressEvent gets non-keypress event");
switch (nativeKeyEvent->keyCode) {
+2 -2
View File
@@ -362,7 +362,7 @@ nsPlaintextEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
WidgetKeyboardEvent* nativeKeyEvent =
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
"HandleKeyPressEvent gets non-keypress event");
switch (nativeKeyEvent->keyCode) {
@@ -845,7 +845,7 @@ nsPlaintextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
WidgetCompositionEvent* compositionChangeEvent =
aDOMTextEvent->GetInternalNSEvent()->AsCompositionEvent();
NS_ENSURE_TRUE(compositionChangeEvent, NS_ERROR_INVALID_ARG);
MOZ_ASSERT(compositionChangeEvent->message == NS_COMPOSITION_CHANGE,
MOZ_ASSERT(compositionChangeEvent->mMessage == NS_COMPOSITION_CHANGE,
"The internal event should be NS_COMPOSITION_CHANGE");
EnsureComposition(compositionChangeEvent);
+1 -1
View File
@@ -845,7 +845,7 @@ APZCTreeManager::UpdateWheelTransaction(WidgetInputEvent& aEvent)
return;
}
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_MOUSE_MOVE:
case NS_DRAGDROP_OVER: {
WidgetMouseEvent* mouseEvent = aEvent.AsMouseEvent();
+4 -4
View File
@@ -251,14 +251,14 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
uint64_t aInputBlockId,
nsEventStatus aApzResponse)
{
if (aEvent.message == NS_TOUCH_START && aEvent.touches.Length() > 0) {
if (aEvent.mMessage == NS_TOUCH_START && aEvent.touches.Length() > 0) {
mActiveElementManager->SetTargetElement(aEvent.touches[0]->GetTarget());
}
bool isTouchPrevented = TouchManager::gPreventMouseEvents ||
aEvent.mFlags.mMultipleActionsPrevented;
bool sentContentResponse = false;
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_TOUCH_START: {
mTouchEndCancelled = false;
if (mPendingTouchPreventedResponse) {
@@ -302,8 +302,8 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
aApzResponse == nsEventStatus_eConsumeDoDefault &&
gfxPrefs::PointerEventsEnabled()) {
WidgetTouchEvent cancelEvent(aEvent);
cancelEvent.message = NS_TOUCH_CANCEL;
cancelEvent.mFlags.mCancelable = false; // message != NS_TOUCH_CANCEL;
cancelEvent.mMessage = NS_TOUCH_CANCEL;
cancelEvent.mFlags.mCancelable = false; // mMessage != NS_TOUCH_CANCEL;
for (uint32_t i = 0; i < cancelEvent.touches.Length(); ++i) {
if (mozilla::dom::Touch* touch = cancelEvent.touches[i]) {
touch->convertToPointer = true;
+1
View File
@@ -11,6 +11,7 @@
#include "nsCOMPtr.h"
#include "nscore.h"
class nsILoadInfo;
class nsIPrincipal;
namespace IPC {
+2 -2
View File
@@ -266,7 +266,7 @@ interface nsIXPCFunctionThisTranslator : nsISupports
{ 0xbd, 0xd6, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
%}
[noscript, uuid(8bc1230e-036b-4749-8763-768ed65df143)]
[noscript, uuid(b91f1eeb-2fe4-44cc-9983-abcc06d69a94)]
interface nsIXPConnect : nsISupports
{
%{ C++
@@ -458,7 +458,7 @@ interface nsIXPConnect : nsISupports
setFunctionThisTranslator(in nsIIDRef aIID,
in nsIXPCFunctionThisTranslator aTranslator);
nsIXPConnectJSObjectHolder
JSObjectPtr
getWrappedNativePrototype(in JSContextPtr aJSContext,
in JSObjectPtr aScope,
in nsIClassInfo aClassInfo);
+6 -6
View File
@@ -764,14 +764,15 @@ nsXPConnect::EvalInSandboxObject(const nsAString& source, const char* filename,
filenameStr = NS_LITERAL_CSTRING("x-bogus://XPConnect/Sandbox");
}
return EvalInSandbox(cx, sandbox, source, filenameStr, 1,
JSVERSION_DEFAULT, rval);
JSVERSION_LATEST, rval);
}
/* JSObjectPtr getWrappedNativePrototype (in JSContextPtr aJSContext, in JSObjectPtr aScope); */
NS_IMETHODIMP
nsXPConnect::GetWrappedNativePrototype(JSContext * aJSContext,
JSObject * aScopeArg,
nsXPConnect::GetWrappedNativePrototype(JSContext* aJSContext,
JSObject* aScopeArg,
nsIClassInfo* aClassInfo,
nsIXPConnectJSObjectHolder** _retval)
JSObject** aRetVal)
{
RootedObject aScope(aJSContext, aScopeArg);
JSAutoCompartment ac(aJSContext, aScope);
@@ -792,8 +793,7 @@ nsXPConnect::GetWrappedNativePrototype(JSContext * aJSContext,
if (!protoObj)
return UnexpectedFailure(NS_ERROR_FAILURE);
nsRefPtr<XPCJSObjectHolder> holder = new XPCJSObjectHolder(protoObj);
holder.forget(_retval);
*aRetVal = protoObj;
return NS_OK;
}
+4 -4
View File
@@ -500,7 +500,7 @@ AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
kDefaultTouchId : mActiveTouchId);
nsPoint point = GetMouseEventPosition(aEvent);
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
AC_LOGV("Before NS_MOUSE_BUTTON_DOWN, state: %s", mState->Name());
rv = mState->OnPress(this, point, id);
@@ -538,7 +538,7 @@ AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
nsEventStatus
AccessibleCaretEventHub::HandleWheelEvent(WidgetWheelEvent* aEvent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_WHEEL_WHEEL:
AC_LOGV("NS_WHEEL_WHEEL, isMomentum %d, state: %s", aEvent->isMomentum,
mState->Name());
@@ -573,7 +573,7 @@ AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent)
aEvent->touches[0]->Identifier() : mActiveTouchId);
nsPoint point = GetTouchEventPosition(aEvent, id);
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START:
AC_LOGV("Before NS_TOUCH_START, state: %s", mState->Name());
rv = mState->OnPress(this, point, id);
@@ -609,7 +609,7 @@ AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent)
nsEventStatus
AccessibleCaretEventHub::HandleKeyboardEvent(WidgetKeyboardEvent* aEvent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_KEY_UP:
case NS_KEY_DOWN:
case NS_KEY_PRESS:
+9 -9
View File
@@ -197,11 +197,11 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
nsPoint ptInRoot =
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, movePoint, rootFrame);
if (aEvent->message == NS_TOUCH_START ||
(aEvent->message == NS_MOUSE_BUTTON_DOWN &&
if (aEvent->mMessage == NS_TOUCH_START ||
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
mouseEvent->button == WidgetMouseEvent::eLeftButton)) {
// If having a active touch, ignore other touch down event
if (aEvent->message == NS_TOUCH_START && mActiveTouchId >= 0) {
if (aEvent->mMessage == NS_TOUCH_START && mActiveTouchId >= 0) {
return nsEventStatus_eConsumeNoDefault;
}
@@ -224,9 +224,9 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
mActiveTouchId = -1;
LaunchLongTapDetector();
}
} else if (aEvent->message == NS_TOUCH_END ||
aEvent->message == NS_TOUCH_CANCEL ||
aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_TOUCH_END ||
aEvent->mMessage == NS_TOUCH_CANCEL ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
CancelLongTapDetector();
if (mDragMode != NONE) {
// Only care about same id
@@ -237,8 +237,8 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
}
return nsEventStatus_eConsumeNoDefault;
}
} else if (aEvent->message == NS_TOUCH_MOVE ||
aEvent->message == NS_MOUSE_MOVE) {
} else if (aEvent->mMessage == NS_TOUCH_MOVE ||
aEvent->mMessage == NS_MOUSE_MOVE) {
if (mDragMode == START_FRAME || mDragMode == END_FRAME) {
if (mActiveTouchId == nowTouchId) {
ptInRoot.y += mCaretCenterToDownPointOffsetY;
@@ -264,7 +264,7 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
CancelLongTapDetector();
}
} else if (aEvent->message == NS_MOUSE_MOZLONGTAP) {
} else if (aEvent->mMessage == NS_MOUSE_MOZLONGTAP) {
if (!mVisible || !sSelectionCaretDetectsLongTap) {
SELECTIONCARETS_LOG("SelectWord from NS_MOUSE_MOZLONGTAP");
+2 -2
View File
@@ -761,7 +761,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
nsEventStatus status = nsEventStatus_eIgnore;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START:
status = HandleTouchDownEvent(aEvent->AsTouchEvent());
break;
@@ -792,7 +792,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
case NS_WHEEL_START:
case NS_WHEEL_STOP:
// Disable touch caret while key/wheel event is received.
TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->message);
TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->mMessage);
SetVisibility(false);
break;
case NS_MOUSE_MOZLONGTAP:
+4 -4
View File
@@ -101,7 +101,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
bool& aIsHandlingUserInput,
nsCOMPtr<nsIContent>& aCurrentEventContent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START: {
aIsHandlingUserInput = true;
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
@@ -123,7 +123,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
// If it is not already in the queue, it is a new touch
touch->mChanged = true;
}
touch->mMessage = aEvent->message;
touch->mMessage = aEvent->mMessage;
gCaptureTouchList->Put(id, touch);
}
break;
@@ -140,7 +140,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
continue;
}
int32_t id = touch->Identifier();
touch->mMessage = aEvent->message;
touch->mMessage = aEvent->mMessage;
nsRefPtr<dom::Touch> oldTouch = gCaptureTouchList->GetWeak(id);
if (!oldTouch) {
@@ -203,7 +203,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
if (!touch) {
continue;
}
touch->mMessage = aEvent->message;
touch->mMessage = aEvent->mMessage;
touch->mChanged = true;
int32_t id = touch->Identifier();
+54 -50
View File
@@ -468,15 +468,15 @@ public:
virtual void HandleEvent(EventChainPostVisitor& aVisitor) override
{
if (aVisitor.mPresContext && aVisitor.mEvent->mClass != eBasicEventClass) {
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN ||
aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
// Mouse-up and mouse-down events call nsFrame::HandlePress/Release
// which call GetContentOffsetsFromPoint which requires up-to-date layout.
// Bring layout up-to-date now so that GetCurrentEventFrame() below
// will return a real frame and we don't have to worry about
// destroying it by flushing later.
mPresShell->FlushPendingNotifications(Flush_Layout);
} else if (aVisitor.mEvent->message == NS_WHEEL_WHEEL &&
} else if (aVisitor.mEvent->mMessage == NS_WHEEL_WHEEL &&
aVisitor.mEventStatus != nsEventStatus_eConsumeNoDefault) {
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
if (frame) {
@@ -493,8 +493,8 @@ public:
}
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
if (!frame &&
(aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP ||
aVisitor.mEvent->message == NS_TOUCH_END)) {
(aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP ||
aVisitor.mEvent->mMessage == NS_TOUCH_END)) {
// Redirect BUTTON_UP and TOUCH_END events to the root frame to ensure
// that capturing is released.
frame = mPresShell->GetRootFrame();
@@ -6307,7 +6307,7 @@ nsIPresShell::GetPointerInfo(uint32_t aPointerId, bool& aActiveState)
void
PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_ENTER_WIDGET:
// In this case we have to know information about available mouse pointers
if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
@@ -6527,11 +6527,11 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
return;
}
if ((aEvent->message == NS_MOUSE_MOVE &&
if ((aEvent->mMessage == NS_MOUSE_MOVE &&
aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) ||
aEvent->message == NS_MOUSE_ENTER_WIDGET ||
aEvent->message == NS_MOUSE_BUTTON_DOWN ||
aEvent->message == NS_MOUSE_BUTTON_UP) {
aEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
nsIFrame* rootFrame = GetRootFrame();
if (!rootFrame) {
nsView* rootView = mViewManager->GetRootView();
@@ -6542,15 +6542,17 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
}
#ifdef DEBUG_MOUSE_LOCATION
if (aEvent->message == NS_MOUSE_ENTER_WIDGET)
if (aEvent->mMessage == NS_MOUSE_ENTER_WIDGET) {
printf("[ps=%p]got mouse enter for %p\n",
this, aEvent->widget);
}
printf("[ps=%p]setting mouse location to (%d,%d)\n",
this, mMouseLocation.x, mMouseLocation.y);
#endif
if (aEvent->message == NS_MOUSE_ENTER_WIDGET)
if (aEvent->mMessage == NS_MOUSE_ENTER_WIDGET) {
SynthesizeMouseMove(false);
} else if (aEvent->message == NS_MOUSE_EXIT_WIDGET) {
}
} else if (aEvent->mMessage == NS_MOUSE_EXIT_WIDGET) {
// Although we only care about the mouse moving into an area for which this
// pres shell doesn't receive mouse move events, we don't check which widget
// the mouse exit was for since this seems to vary by platform. Hopefully
@@ -6627,7 +6629,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
return NS_OK;
}
int16_t button = mouseEvent->button;
switch (mouseEvent->message) {
switch (mouseEvent->mMessage) {
case NS_MOUSE_MOVE:
if (mouseEvent->buttons == 0) {
button = -1;
@@ -6645,7 +6647,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
}
WidgetPointerEvent event(*mouseEvent);
event.message = pointerMessage;
event.mMessage = pointerMessage;
event.button = button;
event.pressure = event.buttons ?
mouseEvent->pressure ? mouseEvent->pressure : 0.5f :
@@ -6656,7 +6658,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
// loop over all touches and dispatch pointer events on each touch
// copy the event
switch (touchEvent->message) {
switch (touchEvent->mMessage) {
case NS_TOUCH_MOVE:
pointerMessage = NS_POINTER_MOVE;
break;
@@ -6805,7 +6807,7 @@ PresShell::DispatchBeforeKeyboardEventInternal(const nsTArray<nsCOMPtr<Element>
}
uint32_t message =
(aEvent.message == NS_KEY_DOWN) ? NS_KEY_BEFORE_DOWN : NS_KEY_BEFORE_UP;
(aEvent.mMessage == NS_KEY_DOWN) ? NS_KEY_BEFORE_DOWN : NS_KEY_BEFORE_UP;
nsCOMPtr<EventTarget> eventTarget;
// Dispatch before events from the outermost element.
for (int32_t i = length - 1; i >= 0; i--) {
@@ -6839,7 +6841,7 @@ PresShell::DispatchAfterKeyboardEventInternal(const nsTArray<nsCOMPtr<Element> >
}
uint32_t message =
(aEvent.message == NS_KEY_DOWN) ? NS_KEY_AFTER_DOWN : NS_KEY_AFTER_UP;
(aEvent.mMessage == NS_KEY_DOWN) ? NS_KEY_AFTER_DOWN : NS_KEY_AFTER_UP;
bool embeddedCancelled = aEmbeddedCancelled;
nsCOMPtr<EventTarget> eventTarget;
// Dispatch after events from the innermost element.
@@ -6866,8 +6868,8 @@ PresShell::DispatchAfterKeyboardEvent(nsINode* aTarget,
MOZ_ASSERT(aTarget);
MOZ_ASSERT(BeforeAfterKeyboardEventEnabled());
if (NS_WARN_IF(aEvent.message != NS_KEY_DOWN &&
aEvent.message != NS_KEY_UP)) {
if (NS_WARN_IF(aEvent.mMessage != NS_KEY_DOWN &&
aEvent.mMessage != NS_KEY_UP)) {
return;
}
@@ -6896,7 +6898,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget,
nsEventStatus* aStatus,
EventDispatchingCallback* aEventCB)
{
if (aEvent.message == NS_KEY_PRESS ||
if (aEvent.mMessage == NS_KEY_PRESS ||
!BeforeAfterKeyboardEventEnabled()) {
EventDispatcher::Dispatch(aTarget, mPresContext,
&aEvent, nullptr, aStatus, aEventCB);
@@ -6904,7 +6906,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget,
}
MOZ_ASSERT(aTarget);
MOZ_ASSERT(aEvent.message == NS_KEY_DOWN || aEvent.message == NS_KEY_UP);
MOZ_ASSERT(aEvent.mMessage == NS_KEY_DOWN || aEvent.mMessage == NS_KEY_UP);
// Build up a target chain. Each item in the chain will receive a before event.
nsAutoTArray<nsCOMPtr<Element>, 5> chain;
@@ -7085,7 +7087,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
}
#ifdef DEBUG
if (aEvent->IsIMERelatedEvent()) {
nsPrintfCString warning("%d event is discarded", aEvent->message);
nsPrintfCString warning("%d event is discarded", aEvent->mMessage);
NS_WARNING(warning.get());
}
#endif
@@ -7138,7 +7140,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
if (presShell != this) {
nsIFrame* frame = presShell->GetRootFrame();
if (!frame) {
if (aEvent->message == NS_QUERY_TEXT_CONTENT ||
if (aEvent->mMessage == NS_QUERY_TEXT_CONTENT ||
aEvent->IsContentCommandEvent()) {
return NS_OK;
}
@@ -7157,7 +7159,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
if (aEvent->mClass == eKeyboardEventClass &&
mDocument && mDocument->EventHandlingSuppressed()) {
if (aEvent->message == NS_KEY_DOWN) {
if (aEvent->mMessage == NS_KEY_DOWN) {
mNoDelayedKeyEvents = true;
} else if (!mNoDelayedKeyEvents) {
DelayedEvent* event = new DelayedKeyEvent(aEvent->AsKeyboardEvent());
@@ -7264,12 +7266,12 @@ PresShell::HandleEvent(nsIFrame* aFrame,
// all touch events except for touchstart use a captured target
if (aEvent->mClass == eTouchEventClass &&
aEvent->message != NS_TOUCH_START) {
aEvent->mMessage != NS_TOUCH_START) {
captureRetarget = true;
}
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
bool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT_WIDGET) &&
bool isWindowLevelMouseExit = (aEvent->mMessage == NS_MOUSE_EXIT_WIDGET) &&
(mouseEvent && mouseEvent->exit == WidgetMouseEvent::eTopLevel);
// Get the frame at the event point. However, don't do this if we're
@@ -7280,7 +7282,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
if (!captureRetarget && !isWindowLevelMouseExit) {
nsPoint eventPoint;
uint32_t flags = 0;
if (aEvent->message == NS_TOUCH_START) {
if (aEvent->mMessage == NS_TOUCH_START) {
flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
// if this is a continuing session, ensure that all these events are
@@ -7401,7 +7403,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
}
if (aEvent->mClass == ePointerEventClass &&
aEvent->message != NS_POINTER_DOWN) {
aEvent->mMessage != NS_POINTER_DOWN) {
if (WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent()) {
uint32_t pointerId = pointerEvent->pointerId;
nsIContent* pointerCapturingContent = GetPointerCapturingContent(pointerId);
@@ -7416,8 +7418,8 @@ PresShell::HandleEvent(nsIFrame* aFrame,
frame = capturingFrame;
}
if (pointerEvent->message == NS_POINTER_UP ||
pointerEvent->message == NS_POINTER_CANCEL) {
if (pointerEvent->mMessage == NS_POINTER_UP ||
pointerEvent->mMessage == NS_POINTER_CANCEL) {
// Implicitly releasing capture for given pointer.
// LOST_POINTER_CAPTURE should be send after NS_POINTER_UP or NS_POINTER_CANCEL.
releasePointerCaptureCaller.SetTarget(pointerId, pointerCapturingContent);
@@ -7430,9 +7432,10 @@ PresShell::HandleEvent(nsIFrame* aFrame,
// a document which needs events suppressed
if (aEvent->mClass == eMouseEventClass &&
frame->PresContext()->Document()->EventHandlingSuppressed()) {
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mNoDelayedMouseEvents = true;
} else if (!mNoDelayedMouseEvents && aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (!mNoDelayedMouseEvents &&
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
DelayedEvent* event = new DelayedMouseEvent(aEvent->AsMouseEvent());
if (!mDelayedEvents.AppendElement(event)) {
delete event;
@@ -7444,7 +7447,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
PresShell* shell =
static_cast<PresShell*>(frame->PresContext()->PresShell());
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_MOVE:
case NS_TOUCH_CANCEL:
case NS_TOUCH_END: {
@@ -7576,11 +7579,12 @@ PresShell::HandleEvent(nsIFrame* aFrame,
}
}
if (aEvent->message == NS_KEY_DOWN) {
if (aEvent->mMessage == NS_KEY_DOWN) {
NS_IF_RELEASE(gKeyDownTarget);
NS_IF_ADDREF(gKeyDownTarget = eventTarget);
}
else if ((aEvent->message == NS_KEY_PRESS || aEvent->message == NS_KEY_UP) &&
else if ((aEvent->mMessage == NS_KEY_PRESS ||
aEvent->mMessage == NS_KEY_UP) &&
gKeyDownTarget) {
// If a different element is now focused for the keypress/keyup event
// than what was focused during the keydown event, check if the new
@@ -7596,7 +7600,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
}
}
if (aEvent->message == NS_KEY_UP) {
if (aEvent->mMessage == NS_KEY_UP) {
NS_RELEASE(gKeyDownTarget);
}
}
@@ -7784,7 +7788,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
// XXX How about IME events and input events for plugins?
if (aEvent->mFlags.mIsTrusted) {
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_KEY_PRESS:
case NS_KEY_DOWN:
case NS_KEY_UP: {
@@ -7804,7 +7808,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
// The event listeners in chrome can prevent this ESC behavior by
// calling prevent default on the preceding keydown/press events.
if (!mIsLastChromeOnlyEscapeKeyConsumed &&
aEvent->message == NS_KEY_UP) {
aEvent->mMessage == NS_KEY_UP) {
// ESC key released while in DOM fullscreen mode.
// If fullscreen is running in content-only mode, exit the target
// doctree branch from fullscreen, otherwise fully exit all
@@ -7823,7 +7827,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
if (!mIsLastChromeOnlyEscapeKeyConsumed && pointerLockedDoc) {
aEvent->mFlags.mDefaultPrevented = true;
aEvent->mFlags.mOnlyChromeDispatch = true;
if (aEvent->message == NS_KEY_UP) {
if (aEvent->mMessage == NS_KEY_UP) {
nsIDocument::UnlockPointer();
}
}
@@ -7862,7 +7866,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
}
}
if (aEvent->message == NS_CONTEXTMENU) {
if (aEvent->mMessage == NS_CONTEXTMENU) {
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (mouseEvent->context == WidgetMouseEvent::eContextMenuKey &&
!AdjustContextMenuKeyEvent(mouseEvent)) {
@@ -7877,7 +7881,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
AutoHandlingUserInputStatePusher userInpStatePusher(isHandlingUserInput,
aEvent, mDocument);
if (aEvent->mFlags.mIsTrusted && aEvent->message == NS_MOUSE_MOVE) {
if (aEvent->mFlags.mIsTrusted && aEvent->mMessage == NS_MOUSE_MOVE) {
nsIPresShell::AllowMouseCapture(
EventStateManager::GetActiveEventStateManager() == manager);
}
@@ -7922,12 +7926,12 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
}
}
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_KEY_PRESS:
case NS_KEY_DOWN:
case NS_KEY_UP: {
if (aEvent->AsKeyboardEvent()->keyCode == NS_VK_ESCAPE) {
if (aEvent->message == NS_KEY_UP) {
if (aEvent->mMessage == NS_KEY_UP) {
// Reset this flag after key up is handled.
mIsLastChromeOnlyEscapeKeyConsumed = false;
} else {
@@ -8029,9 +8033,9 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent,
// calling preventDefault on touchstart or the first touchmove for a
// point prevents mouse events. calling it on the touchend should
// prevent click dispatching.
bool canPrevent = (aEvent->message == NS_TOUCH_START) ||
(aEvent->message == NS_TOUCH_MOVE && aTouchIsNew) ||
(aEvent->message == NS_TOUCH_END);
bool canPrevent = (aEvent->mMessage == NS_TOUCH_START) ||
(aEvent->mMessage == NS_TOUCH_MOVE && aTouchIsNew) ||
(aEvent->mMessage == NS_TOUCH_END);
bool preventDefault = false;
nsEventStatus tmpStatus = nsEventStatus_eIgnore;
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
@@ -8060,7 +8064,7 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent,
}
// copy the event
WidgetTouchEvent newEvent(touchEvent->mFlags.mIsTrusted,
touchEvent->message, touchEvent->widget);
touchEvent->mMessage, touchEvent->widget);
newEvent.AssignTouchEventData(*touchEvent, false);
newEvent.target = targetPtr;
@@ -9484,7 +9488,7 @@ PresShell::DelayedMouseEvent::DelayedMouseEvent(WidgetMouseEvent* aEvent) :
{
WidgetMouseEvent* mouseEvent =
new WidgetMouseEvent(aEvent->mFlags.mIsTrusted,
aEvent->message,
aEvent->mMessage,
aEvent->widget,
aEvent->reason,
aEvent->context);
@@ -9497,7 +9501,7 @@ PresShell::DelayedKeyEvent::DelayedKeyEvent(WidgetKeyboardEvent* aEvent) :
{
WidgetKeyboardEvent* keyEvent =
new WidgetKeyboardEvent(aEvent->mFlags.mIsTrusted,
aEvent->message,
aEvent->mMessage,
aEvent->widget);
keyEvent->AssignKeyEventData(*aEvent, false);
keyEvent->mFlags.mIsSynthesizedForTests = aEvent->mFlags.mIsSynthesizedForTests;
+1 -1
View File
@@ -1138,7 +1138,7 @@ nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext,
}
#if COMBOBOX_ROLLUP_CONSUME_EVENT == 0
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
nsIWidget* widget = GetNearestWidget();
if (widget && GetContent() == widget->GetLastRollup()) {
// This event did a Rollup on this control - prevent it from opening
+1 -1
View File
@@ -162,7 +162,7 @@ nsImageControlFrame::HandleEvent(nsPresContext* aPresContext,
*aEventStatus = nsEventStatus_eIgnore;
if (aEvent->message == NS_MOUSE_BUTTON_UP &&
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
// Store click point for HTMLInputElement::SubmitNamesValues
// Do this on MouseUp because the specs don't say and that's what IE does
+3 -3
View File
@@ -898,11 +898,11 @@ nsListControlFrame::HandleEvent(nsPresContext* aPresContext,
"NS_MOUSE_LEFT_CLICK",
"NS_MOUSE_MIDDLE_CLICK",
"NS_MOUSE_RIGHT_CLICK"};
int inx = aEvent->message-NS_MOUSE_MESSAGE_START;
int inx = aEvent->mMessage-NS_MOUSE_MESSAGE_START;
if (inx >= 0 && inx <= (NS_MOUSE_RIGHT_CLICK-NS_MOUSE_MESSAGE_START)) {
printf("Mouse in ListFrame %s [%d]\n", desc[inx], aEvent->message);
printf("Mouse in ListFrame %s [%d]\n", desc[inx], aEvent->mMessage);
} else {
printf("Mouse in ListFrame <UNKNOWN> [%d]\n", aEvent->message);
printf("Mouse in ListFrame <UNKNOWN> [%d]\n", aEvent->mMessage);
}*/
if (nsEventStatus_eConsumeNoDefault == *aEventStatus)
+7 -5
View File
@@ -2568,7 +2568,7 @@ nsFrame::HandleEvent(nsPresContext* aPresContext,
nsEventStatus* aEventStatus)
{
if (aEvent->message == NS_MOUSE_MOVE) {
if (aEvent->mMessage == NS_MOUSE_MOVE) {
// XXX If the second argument of HandleDrag() is WidgetMouseEvent,
// the implementation becomes simpler.
return HandleDrag(aPresContext, aEvent, aEventStatus);
@@ -2577,9 +2577,11 @@ nsFrame::HandleEvent(nsPresContext* aPresContext,
if ((aEvent->mClass == eMouseEventClass &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
aEvent->mClass == eTouchEventClass) {
if (aEvent->message == NS_MOUSE_BUTTON_DOWN || aEvent->message == NS_TOUCH_START) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_TOUCH_START) {
HandlePress(aPresContext, aEvent, aEventStatus);
} else if (aEvent->message == NS_MOUSE_BUTTON_UP || aEvent->message == NS_TOUCH_END) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP ||
aEvent->mMessage == NS_TOUCH_END) {
HandleRelease(aPresContext, aEvent, aEventStatus);
}
}
@@ -2612,8 +2614,8 @@ nsFrame::GetDataForTableSelection(const nsFrameSelection* aFrameSelection,
// (Mouse down does normal selection unless Ctrl/Cmd is pressed)
bool doTableSelection =
displaySelection == nsISelectionDisplay::DISPLAY_ALL && selectingTableCells &&
(aMouseEvent->message == NS_MOUSE_MOVE ||
(aMouseEvent->message == NS_MOUSE_BUTTON_UP &&
(aMouseEvent->mMessage == NS_MOUSE_MOVE ||
(aMouseEvent->mMessage == NS_MOUSE_BUTTON_UP &&
aMouseEvent->button == WidgetMouseEvent::eLeftButton) ||
aMouseEvent->IsShift());
+2 -2
View File
@@ -652,7 +652,7 @@ nsresult nsHTMLFramesetFrame::HandleEvent(nsPresContext* aPresContext,
NS_ENSURE_ARG_POINTER(aEventStatus);
if (mDragger) {
// the nsFramesetBorderFrame has captured NS_MOUSE_DOWN
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_MOVE:
MouseDrag(aPresContext, aEvent);
break;
@@ -1544,7 +1544,7 @@ nsHTMLFramesetBorderFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
if (aEvent->message == NS_MOUSE_BUTTON_DOWN &&
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
nsHTMLFramesetFrame* parentFrame = do_QueryFrame(GetParent());
if (parentFrame) {
+3 -3
View File
@@ -1979,9 +1979,9 @@ nsImageFrame::HandleEvent(nsPresContext* aPresContext,
{
NS_ENSURE_ARG_POINTER(aEventStatus);
if ((aEvent->message == NS_MOUSE_BUTTON_UP &&
if ((aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
aEvent->message == NS_MOUSE_MOVE) {
aEvent->mMessage == NS_MOUSE_MOVE) {
nsImageMap* map = GetImageMap();
bool isServerMap = IsServerImageMap();
if ((nullptr != map) || isServerMap) {
@@ -2019,7 +2019,7 @@ nsImageFrame::HandleEvent(nsPresContext* aPresContext,
uri->SetSpec(spec);
bool clicked = false;
if (aEvent->message == NS_MOUSE_BUTTON_UP) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
*aEventStatus = nsEventStatus_eConsumeDoDefault;
clicked = true;
}
+6 -6
View File
@@ -1751,13 +1751,13 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
mInstanceOwner->ConsiderNewEventloopNestingLevel();
if (anEvent->message == NS_PLUGIN_ACTIVATE) {
if (anEvent->mMessage == NS_PLUGIN_ACTIVATE) {
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(GetContent());
if (fm && elem)
return fm->SetFocus(elem, 0);
}
else if (anEvent->message == NS_PLUGIN_FOCUS) {
else if (anEvent->mMessage == NS_PLUGIN_FOCUS) {
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
nsCOMPtr<nsIContent> content = GetContent();
@@ -1780,8 +1780,8 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
#ifdef XP_MACOSX
// we want to process some native mouse events in the cocoa event model
if ((anEvent->message == NS_MOUSE_ENTER_WIDGET ||
anEvent->message == NS_WHEEL_WHEEL) &&
if ((anEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
anEvent->mMessage == NS_WHEEL_WHEEL) &&
mInstanceOwner->GetEventModel() == NPEventModelCocoa) {
*anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
// Due to plugin code reentering Gecko, this frame may be dead at this
@@ -1793,7 +1793,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
// and mouse-up) are needed to make the routing of mouse events while
// dragging conform to standard OS X practice, and to the Cocoa NPAPI spec.
// See bug 525078 and bug 909678.
if (anEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (anEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED);
}
#endif
@@ -1804,7 +1804,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
// nsPluginFrameSuper::HandleEvent() might have killed us.
#ifdef XP_MACOSX
if (anEvent->message == NS_MOUSE_BUTTON_UP) {
if (anEvent->mMessage == NS_MOUSE_BUTTON_UP) {
nsIPresShell::SetCapturingContent(nullptr, 0);
}
#endif
+3 -3
View File
@@ -118,7 +118,7 @@ GetActionForEvent(nsIDOMEvent* aEvent)
}
if (keyEvent->mFlags.mInSystemGroup) {
NS_ASSERTION(keyEvent->message == NS_KEY_DOWN,
NS_ASSERTION(keyEvent->mMessage == NS_KEY_DOWN,
"Assuming we're listening only keydown event in system group");
return eEventAction_StopPropagation;
}
@@ -126,8 +126,8 @@ GetActionForEvent(nsIDOMEvent* aEvent)
if (keyEvent->IsAlt() || keyEvent->IsControl() || keyEvent->IsMeta()) {
// Don't consume keydown event because following keypress event may be
// handled as access key or shortcut key.
return (keyEvent->message == NS_KEY_DOWN) ? eEventAction_StopPropagation :
eEventAction_Suppress;
return (keyEvent->mMessage == NS_KEY_DOWN) ? eEventAction_StopPropagation :
eEventAction_Suppress;
}
static const uint32_t kOKKeyCodes[] = {

Some files were not shown because too many files have changed in this diff Show More