diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index 9d4edd5ee99..33445318ba0 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -299,6 +299,7 @@ var shell = { window.addEventListener('keyup', this, true); window.addEventListener('MozApplicationManifest', this); window.addEventListener('mozfullscreenchange', this); + window.addEventListener('MozAfterPaint', this); window.addEventListener('sizemodechange', this); this.contentBrowser.addEventListener('mozbrowserloadstart', this, true); @@ -511,6 +512,12 @@ var shell = { dump('Error while creating offline cache: ' + e + '\n'); } break; + case 'MozAfterPaint': + window.removeEventListener('MozAfterPaint', this); + this.sendChromeEvent({ + type: 'system-first-paint' + }); + break; } }, diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 2c3c0b7759d..7c03c8ad891 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "d9f759cc10938a3caa252e96420531bbb6d6cab3", + "revision": "f2d88904536ccd68a3981a7feb17e56b2132838c", "repo_path": "/integration/gaia-central" } diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 775f1bbba12..319dc9907bd 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -1143,7 +1143,7 @@ Navigator::GetMozTelephony(ErrorResult& aRv) return mTelephony; } -nsIDOMMozVoicemail* +Voicemail* Navigator::GetMozVoicemail(ErrorResult& aRv) { if (!mVoicemail) { diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index 8bc2274c882..2cd5a61713a 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -35,7 +35,6 @@ class systemMessageCallback; #ifdef MOZ_B2G_RIL class nsIDOMMozMobileConnection; -class nsIDOMMozVoicemail; class nsIDOMMozIccManager; #endif // MOZ_B2G_RIL @@ -90,6 +89,10 @@ class BluetoothManager; } // namespace bluetooth #endif // MOZ_B2G_BT +#ifdef MOZ_B2G_RIL +class Voicemail; +#endif + namespace power { class PowerManager; } // namespace power @@ -221,7 +224,7 @@ public: telephony::Telephony* GetMozTelephony(ErrorResult& aRv); nsIDOMMozMobileConnection* GetMozMobileConnection(ErrorResult& aRv); CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv); - nsIDOMMozVoicemail* GetMozVoicemail(ErrorResult& aRv); + Voicemail* GetMozVoicemail(ErrorResult& aRv); nsIDOMMozIccManager* GetMozIccManager(ErrorResult& aRv); #endif // MOZ_B2G_RIL #ifdef MOZ_GAMEPAD @@ -315,7 +318,7 @@ private: nsRefPtr mMobileMessageManager; #ifdef MOZ_B2G_RIL nsRefPtr mTelephony; - nsCOMPtr mVoicemail; + nsRefPtr mVoicemail; #endif nsRefPtr mConnection; #ifdef MOZ_B2G_RIL diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 5ee391c9e98..ee5f4bb55f7 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -170,7 +170,6 @@ #include "nsIDOMConnection.h" #ifdef MOZ_B2G_RIL -#include "nsIDOMMozVoicemail.h" #include "nsIDOMIccManager.h" #include "nsIDOMMobileConnection.h" #endif // MOZ_B2G_RIL @@ -534,8 +533,6 @@ static nsDOMClassInfoData sClassInfoData[] = { DOM_DEFAULT_SCRIPTABLE_FLAGS) #ifdef MOZ_B2G_RIL - NS_DEFINE_CLASSINFO_DATA(MozVoicemail, nsEventTargetSH, - EVENTTARGET_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(MozIccManager, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) #endif @@ -1395,12 +1392,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_END #ifdef MOZ_B2G_RIL - - DOM_CLASSINFO_MAP_BEGIN(MozVoicemail, nsIDOMMozVoicemail) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozVoicemail) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) - DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(MozIccManager, nsIDOMMozIccManager) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozIccManager) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index fb580a8c8db..5bb88540318 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -127,7 +127,6 @@ DOMCI_CLASS(CSSPageRule) DOMCI_CLASS(MediaQueryList) #ifdef MOZ_B2G_RIL -DOMCI_CLASS(MozVoicemail) DOMCI_CLASS(MozIccManager) #endif diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index f884ceafd50..fd0730672b1 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -772,6 +772,10 @@ DOMInterfaces = { 'headerFile': 'StkCommandEvent.h', }, +'MozVoicemail': { + 'nativeType': 'mozilla::dom::Voicemail', +}, + 'MutationEvent': { 'nativeType': 'nsDOMMutationEvent', }, @@ -1793,7 +1797,7 @@ addExternalIface('MozTreeBoxObject', nativeType='nsITreeBoxObject', notflattened=True) addExternalIface('MozTreeColumn', nativeType='nsITreeColumn', headerFile='nsITreeColumns.h') -addExternalIface('MozVoicemail') +addExternalIface('MozVoicemailStatus') addExternalIface('MozWakeLock', headerFile='nsIDOMWakeLock.h') addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder') addExternalIface('nsIControllers', nativeType='nsIControllers') diff --git a/dom/browser-element/BrowserElementPanning.js b/dom/browser-element/BrowserElementPanning.js index 4068e158fab..b74ddf7b1f1 100644 --- a/dom/browser-element/BrowserElementPanning.js +++ b/dom/browser-element/BrowserElementPanning.js @@ -48,7 +48,7 @@ const ContentPanning = { // If we are using an AsyncPanZoomController for the parent frame, // it will handle subframe scrolling too. We don't need to listen for // these events. - if (!this._asyncPanZoomForViewportFrame) { + if (!docShell.asyncPanZoomEnabled) { let els = Cc["@mozilla.org/eventlistenerservice;1"] .getService(Ci.nsIEventListenerService); @@ -140,23 +140,11 @@ const ContentPanning = { let oldTarget = this.target; [this.target, this.scrollCallback] = this.getPannable(this.pointerDownTarget); - // If we found a target, that means we have found a scrollable subframe. In - // this case, and if we are using async panning and zooming on the parent - // frame, inform the pan/zoom controller that it should not attempt to - // handle any touch events it gets until the next batch (meaning the next - // time we get a touch end). - if (this.target != null && this._asyncPanZoomForViewportFrame) { - this.detectingScrolling = true; - var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService); - os.notifyObservers(docShell, 'detect-scrollable-subframe', null); - } - - // If we have a pointer down target and we're not async - // pan/zooming, we may need to fill in for EventStateManager in - // setting the active state on the target element. Set a timer to + // If we have a pointer down target, we may need to fill in for EventStateManager + // in setting the active state on the target element. Set a timer to // ensure the pointer-down target is active. (If it's already // active, the timer is a no-op.) - if (this.pointerDownTarget !== null && !this.detectingScrolling) { + if (this.pointerDownTarget !== null) { // If there's no possibility this is a drag/pan, activate now. // Otherwise wait a little bit to see if the gesture isn't a // tap. @@ -226,12 +214,6 @@ const ContentPanning = { this.pointerDownTarget = null; }, - // True when there's an async pan-zoom controll watching the - // outermost scrollable frame, and we're waiting to see whether - // we're going to take over from it and synchronously scroll an - // inner scrollable frame. - detectingScrolling: false, - onTouchMove: function cp_onTouchMove(evt) { if (!this.dragging) return; @@ -260,27 +242,6 @@ const ContentPanning = { } let isPan = KineticPanning.isPan(); - if (!isPan && this.detectingScrolling) { - // If panning distance is not large enough and we're waiting to - // see whether we should use the sync scroll fallback or not, - // don't attempt scrolling. - return; - } - - let isScroll = this.scrollCallback(delta.scale(-1)); - - if (this.detectingScrolling) { - this.detectingScrolling = false; - // Stop async-pan-zooming if the user is panning the subframe. - if (isScroll) { - // We're going to drive synchronously scrolling an inner frame. - Services.obs.notifyObservers(docShell, 'cancel-default-pan-zoom', null); - } else { - // Let AsyncPanZoomController handle the scrolling gesture. - this.scrollCallback = null; - return; - } - } // If we've detected a pan gesture, cancel the active state of the // current target. @@ -356,13 +317,6 @@ const ContentPanning = { node = node.parentNode; } - if (ContentPanning._asyncPanZoomForViewportFrame && - nodeContent === content) { - // The parent context is asynchronously panning and zooming our - // root scrollable frame, so don't use our synchronous fallback. - return null; - } - if (nodeContent.scrollMaxX || nodeContent.scrollMaxY) { return nodeContent; } @@ -484,10 +438,6 @@ const ContentPanning = { this._domUtils.setContentState(elt, kStateActive); }, - get _asyncPanZoomForViewportFrame() { - return docShell.asyncPanZoomEnabled; - }, - _recvViewportChange: function(data) { let metrics = data.json; this._viewport = new Rect(metrics.x, metrics.y, @@ -599,7 +549,6 @@ const ContentPanning = { _finishPanning: function() { this._resetActive(); this.dragging = false; - this.detectingScrolling = false; delete this.primaryPointerId; this._activationTimer.cancel(); diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 2d0fe89a6c1..e6ec9fe67f2 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -105,10 +105,8 @@ NS_IMPL_ISUPPORTS1(ContentListener, nsIDOMEventListener) static const CSSSize kDefaultViewportSize(980, 480); -static const char CANCEL_DEFAULT_PAN_ZOOM[] = "cancel-default-pan-zoom"; static const char BROWSER_ZOOM_TO_RECT[] = "browser-zoom-to-rect"; static const char BEFORE_FIRST_PAINT[] = "before-first-paint"; -static const char DETECT_SCROLLABLE_SUBFRAME[] = "detect-scrollable-subframe"; static bool sCpowsEnabled = false; @@ -385,13 +383,7 @@ TabChild::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) { - if (!strcmp(aTopic, CANCEL_DEFAULT_PAN_ZOOM)) { - nsCOMPtr docShell(do_QueryInterface(aSubject)); - nsCOMPtr tabChild(GetTabChildFrom(docShell)); - if (tabChild == this) { - mRemoteFrame->CancelDefaultPanZoom(); - } - } else if (!strcmp(aTopic, BROWSER_ZOOM_TO_RECT)) { + if (!strcmp(aTopic, BROWSER_ZOOM_TO_RECT)) { nsCOMPtr docShell(do_QueryInterface(aSubject)); nsCOMPtr tabChild(GetTabChildFrom(docShell)); if (tabChild == this) { @@ -436,12 +428,6 @@ TabChild::Observe(nsISupports *aSubject, HandlePossibleViewportChange(); } } - } else if (!strcmp(aTopic, DETECT_SCROLLABLE_SUBFRAME)) { - nsCOMPtr docShell(do_QueryInterface(aSubject)); - nsCOMPtr tabChild(GetTabChildFrom(docShell)); - if (tabChild == this) { - mRemoteFrame->DetectScrollableSubframe(); - } } return NS_OK; @@ -2183,10 +2169,8 @@ TabChild::RecvDestroy() nsCOMPtr observerService = do_GetService(NS_OBSERVERSERVICE_CONTRACTID); - observerService->RemoveObserver(this, CANCEL_DEFAULT_PAN_ZOOM); observerService->RemoveObserver(this, BROWSER_ZOOM_TO_RECT); observerService->RemoveObserver(this, BEFORE_FIRST_PAINT); - observerService->RemoveObserver(this, DETECT_SCROLLABLE_SUBFRAME); const InfallibleTArray& idbActors = ManagedPIndexedDBChild(); @@ -2321,18 +2305,12 @@ TabChild::InitRenderingState() do_GetService(NS_OBSERVERSERVICE_CONTRACTID); if (observerService) { - observerService->AddObserver(this, - CANCEL_DEFAULT_PAN_ZOOM, - false); observerService->AddObserver(this, BROWSER_ZOOM_TO_RECT, false); observerService->AddObserver(this, BEFORE_FIRST_PAINT, false); - observerService->AddObserver(this, - DETECT_SCROLLABLE_SUBFRAME, - false); } // This state can't really change during the lifetime of the child. diff --git a/dom/network/tests/marionette/test_call_barring_set_error.js b/dom/network/tests/marionette/test_call_barring_set_error.js index 620864c2d2f..0bc0c77a92a 100644 --- a/dom/network/tests/marionette/test_call_barring_set_error.js +++ b/dom/network/tests/marionette/test_call_barring_set_error.js @@ -52,7 +52,8 @@ function testSetCallBarringOptionError(option) { 'should not fire onsuccess for invaild call barring option: ' + JSON.stringify(option)); }; - request.onerror = function() { + request.onerror = function(event) { + is(event.target.error.name, 'InvalidCallBarringOption', JSON.stringify(option)); nextTest(); }; } diff --git a/dom/permission/tests/test_voicemail.html b/dom/permission/tests/test_voicemail.html index 9cd008d37fc..98428098279 100644 --- a/dom/permission/tests/test_voicemail.html +++ b/dom/permission/tests/test_voicemail.html @@ -20,7 +20,7 @@ var gData = [ { perm: ["voicemail"], obj: "mozVoicemail", - idl: "nsIDOMMozVoicemail", + webidl: "MozVoicemail", }, ] diff --git a/dom/system/gonk/RILContentHelper.js b/dom/system/gonk/RILContentHelper.js index e58f6d7bf1a..c0c8356895e 100644 --- a/dom/system/gonk/RILContentHelper.js +++ b/dom/system/gonk/RILContentHelper.js @@ -1086,7 +1086,7 @@ RILContentHelper.prototype = { let requestId = this.getRequestId(request); if (DEBUG) debug("setCallBarringOption: " + JSON.stringify(option)); - if (!this._isValidCallBarringOption(option)) { + if (!this._isValidCallBarringOption(option, true)) { this.dispatchFireRequestError(requestId, "InvalidCallBarringOption"); return request; } @@ -2072,10 +2072,20 @@ RILContentHelper.prototype = { /** * Helper for guarding us against invalid option for call barring. */ - _isValidCallBarringOption: function _isValidCallBarringOption(option) { - return (option - && option.serviceClass != null - && this._isValidCallBarringProgram(option.program)); + _isValidCallBarringOption: + function _isValidCallBarringOption(option, usedForSetting) { + if (!option || + option.serviceClass == null || + !this._isValidCallBarringProgram(option.program)) { + return false; + } + + // For setting callbarring option, |enabled| and |password| are required. + if (usedForSetting && (option.enabled == null || option.password == null)) { + return false; + } + + return true; } }; diff --git a/dom/voicemail/Voicemail.cpp b/dom/voicemail/Voicemail.cpp index cad531418c7..a4de3a68595 100644 --- a/dom/voicemail/Voicemail.cpp +++ b/dom/voicemail/Voicemail.cpp @@ -5,6 +5,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "Voicemail.h" + +#include "mozilla/dom/MozVoicemailBinding.h" #include "nsIDOMMozVoicemailStatus.h" #include "nsIDOMMozVoicemailEvent.h" @@ -40,22 +42,11 @@ public: NS_IMPL_ISUPPORTS1(Voicemail::Listener, nsIVoicemailListener) -DOMCI_DATA(MozVoicemail, Voicemail) - -NS_INTERFACE_MAP_BEGIN(Voicemail) - NS_INTERFACE_MAP_ENTRY(nsIDOMMozVoicemail) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozVoicemail) -NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper) - -NS_IMPL_ADDREF_INHERITED(Voicemail, nsDOMEventTargetHelper) -NS_IMPL_RELEASE_INHERITED(Voicemail, nsDOMEventTargetHelper) - Voicemail::Voicemail(nsPIDOMWindow* aWindow, nsIVoicemailProvider* aProvider) - : mProvider(aProvider) + : nsDOMEventTargetHelper(aWindow) + , mProvider(aProvider) { - BindToOwner(aWindow); - mListener = new Listener(this); DebugOnly rv = mProvider->RegisterVoicemailMsg(mListener); NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), @@ -70,36 +61,57 @@ Voicemail::~Voicemail() mProvider->UnregisterVoicemailMsg(mListener); } -// nsIDOMMozVoicemail - -NS_IMETHODIMP -Voicemail::GetStatus(nsIDOMMozVoicemailStatus** aStatus) +JSObject* +Voicemail::WrapObject(JSContext* aCx, JS::Handle aScope) { - *aStatus = nullptr; - - NS_ENSURE_STATE(mProvider); - return mProvider->GetVoicemailStatus(aStatus); + return MozVoicemailBinding::Wrap(aCx, aScope, this); } -NS_IMETHODIMP -Voicemail::GetNumber(nsAString& aNumber) +// MozVoicemail WebIDL + +already_AddRefed +Voicemail::GetStatus(ErrorResult& aRv) const +{ + if (!mProvider) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return nullptr; + } + + nsCOMPtr status; + nsresult rv = mProvider->GetVoicemailStatus(getter_AddRefs(status)); + if (NS_FAILED(rv)) { + aRv.Throw(rv); + return nullptr; + } + + return status.forget(); +} + +void +Voicemail::GetNumber(nsString& aNumber, ErrorResult& aRv) const { - NS_ENSURE_STATE(mProvider); aNumber.SetIsVoid(true); - return mProvider->GetVoicemailNumber(aNumber); + if (!mProvider) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return; + } + + aRv = mProvider->GetVoicemailNumber(aNumber); } -NS_IMETHODIMP -Voicemail::GetDisplayName(nsAString& aDisplayName) +void +Voicemail::GetDisplayName(nsString& aDisplayName, ErrorResult& aRv) const { - NS_ENSURE_STATE(mProvider); aDisplayName.SetIsVoid(true); - return mProvider->GetVoicemailDisplayName(aDisplayName); -} + if (!mProvider) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return; + } -NS_IMPL_EVENT_HANDLER(Voicemail, statuschanged) + aRv = mProvider->GetVoicemailDisplayName(aDisplayName); +} // nsIVoicemailListener @@ -118,7 +130,7 @@ Voicemail::NotifyStatusChanged(nsIDOMMozVoicemailStatus* aStatus) } nsresult -NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail) +NS_NewVoicemail(nsPIDOMWindow* aWindow, Voicemail** aVoicemail) { nsPIDOMWindow* innerWindow = aWindow->IsInnerWindow() ? aWindow : @@ -128,8 +140,7 @@ NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail) do_GetService(NS_RILCONTENTHELPER_CONTRACTID); NS_ENSURE_STATE(provider); - nsRefPtr voicemail = - new mozilla::dom::Voicemail(innerWindow, provider); + nsRefPtr voicemail = new Voicemail(innerWindow, provider); voicemail.forget(aVoicemail); return NS_OK; } diff --git a/dom/voicemail/Voicemail.h b/dom/voicemail/Voicemail.h index d622b8de418..5ee5efef4c6 100644 --- a/dom/voicemail/Voicemail.h +++ b/dom/voicemail/Voicemail.h @@ -7,19 +7,22 @@ #ifndef mozilla_dom_voicemail_voicemail_h__ #define mozilla_dom_voicemail_voicemail_h__ +#include "mozilla/Attributes.h" +#include "mozilla/ErrorResult.h" #include "nsDOMEvent.h" #include "nsDOMEventTargetHelper.h" -#include "nsIDOMMozVoicemail.h" #include "nsIVoicemailProvider.h" +class JSObject; +struct JSContext; + class nsPIDOMWindow; class nsIDOMMozVoicemailStatus; namespace mozilla { namespace dom { -class Voicemail : public nsDOMEventTargetHelper, - public nsIDOMMozVoicemail +class Voicemail MOZ_FINAL : public nsDOMEventTargetHelper { /** * Class Voicemail doesn't actually inherit nsIVoicemailListener. Instead, it @@ -31,15 +34,34 @@ class Voicemail : public nsDOMEventTargetHelper, class Listener; public: - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_NSIDOMMOZVOICEMAIL NS_DECL_NSIVOICEMAILLISTENER NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) Voicemail(nsPIDOMWindow* aWindow, nsIVoicemailProvider* aProvider); + virtual ~Voicemail(); + nsPIDOMWindow* + GetParentObject() const + { + return GetOwner(); + } + + virtual JSObject* + WrapObject(JSContext* aCx, JS::Handle aScope) MOZ_OVERRIDE; + + already_AddRefed + GetStatus(ErrorResult& aRv) const; + + void + GetNumber(nsString& aNumber, ErrorResult& aRv) const; + + void + GetDisplayName(nsString& aDisplayName, ErrorResult& aRv) const; + + IMPL_EVENT_HANDLER(statuschanged) + private: nsCOMPtr mProvider; nsRefPtr mListener; @@ -49,6 +71,7 @@ private: } // namespace mozilla nsresult -NS_NewVoicemail(nsPIDOMWindow* aWindow, nsIDOMMozVoicemail** aVoicemail); +NS_NewVoicemail(nsPIDOMWindow* aWindow, + mozilla::dom::Voicemail** aVoicemail); #endif // mozilla_dom_voicemail_voicemail_h__ diff --git a/dom/voicemail/moz.build b/dom/voicemail/moz.build index 073488c2562..8f31a41ee1b 100644 --- a/dom/voicemail/moz.build +++ b/dom/voicemail/moz.build @@ -5,7 +5,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. XPIDL_SOURCES += [ - 'nsIDOMMozVoicemail.idl', 'nsIDOMMozVoicemailEvent.idl', 'nsIDOMMozVoicemailStatus.idl', 'nsIVoicemailProvider.idl', diff --git a/dom/voicemail/nsIDOMMozVoicemail.idl b/dom/webidl/MozVoicemail.webidl similarity index 63% rename from dom/voicemail/nsIDOMMozVoicemail.idl rename to dom/webidl/MozVoicemail.webidl index 45389dd4f54..be72ef05c74 100644 --- a/dom/voicemail/nsIDOMMozVoicemail.idl +++ b/dom/webidl/MozVoicemail.webidl @@ -4,31 +4,33 @@ * 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 "nsIDOMEventTarget.idl" +// nsIDOMMozVoicemailStatus +interface MozVoicemailStatus; -interface nsIDOMMozVoicemailStatus; - -[scriptable, builtinclass, uuid(12e6604b-4981-4aa4-a31f-f77181f8a466)] -interface nsIDOMMozVoicemail : nsIDOMEventTarget +interface MozVoicemail : EventTarget { /** * The current voicemail status, or null when the status is unknown */ - readonly attribute nsIDOMMozVoicemailStatus status; + [GetterThrows] + readonly attribute MozVoicemailStatus? status; /** * The voicemail box dialing number, or null if one wasn't found */ - readonly attribute DOMString number; + [GetterThrows] + readonly attribute DOMString? number; /** * The display name of the voicemail box dialing number, or null if one * wasn't found */ - readonly attribute DOMString displayName; + [GetterThrows] + readonly attribute DOMString? displayName; /** * The current voicemail status has changed */ - [implicit_jscontext] attribute jsval onstatuschanged; + [SetterThrows] + attribute EventHandler onstatuschanged; }; diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl index ce19de4e847..2252f21039f 100644 --- a/dom/webidl/Navigator.webidl +++ b/dom/webidl/Navigator.webidl @@ -269,8 +269,6 @@ partial interface Navigator { readonly attribute MozCellBroadcast mozCellBroadcast; }; -// nsIMozNavigatorVoicemail -interface MozVoicemail; partial interface Navigator { [Throws, Func="Navigator::HasVoicemailSupport"] readonly attribute MozVoicemail mozVoicemail; diff --git a/dom/webidl/WebIDL.mk b/dom/webidl/WebIDL.mk index 002d3a43208..064a9b4a621 100644 --- a/dom/webidl/WebIDL.mk +++ b/dom/webidl/WebIDL.mk @@ -445,6 +445,7 @@ ifdef MOZ_B2G_RIL webidl_files += \ CallsList.webidl \ MozStkCommandEvent.webidl \ + MozVoicemail.webidl \ Telephony.webidl \ TelephonyCall.webidl \ TelephonyCallGroup.webidl \ diff --git a/gfx/layers/composite/APZCTreeManager.cpp b/gfx/layers/composite/APZCTreeManager.cpp index 11fd90aba66..f93bf2b792e 100644 --- a/gfx/layers/composite/APZCTreeManager.cpp +++ b/gfx/layers/composite/APZCTreeManager.cpp @@ -360,24 +360,6 @@ APZCTreeManager::UpdateCompositionBounds(const ScrollableLayerGuid& aGuid, } } -void -APZCTreeManager::CancelDefaultPanZoom(const ScrollableLayerGuid& aGuid) -{ - nsRefPtr apzc = GetTargetAPZC(aGuid); - if (apzc) { - apzc->CancelDefaultPanZoom(); - } -} - -void -APZCTreeManager::DetectScrollableSubframe(const ScrollableLayerGuid& aGuid) -{ - nsRefPtr apzc = GetTargetAPZC(aGuid); - if (apzc) { - apzc->DetectScrollableSubframe(); - } -} - void APZCTreeManager::ZoomToRect(const ScrollableLayerGuid& aGuid, const CSSRect& aRect) diff --git a/gfx/layers/composite/APZCTreeManager.h b/gfx/layers/composite/APZCTreeManager.h index 23e414bef56..2021a6809bf 100644 --- a/gfx/layers/composite/APZCTreeManager.h +++ b/gfx/layers/composite/APZCTreeManager.h @@ -168,22 +168,6 @@ public: void UpdateCompositionBounds(const ScrollableLayerGuid& aGuid, const ScreenIntRect& aCompositionBounds); - /** - * We are scrolling a subframe, so disable our machinery until we hit - * a touch end or a new touch start. This prevents us from accidentally - * panning both the subframe and the parent frame. - * - * XXX/bug 775452: We should eventually be supporting async scrollable - * subframes. - */ - void CancelDefaultPanZoom(const ScrollableLayerGuid& aGuid); - - /** - * We have found a scrollable subframe, so we need to delay the scrolling - * gesture executed and let subframe do the scrolling first. - */ - void DetectScrollableSubframe(const ScrollableLayerGuid& aGuid); - /** * Kicks an animation to zoom to a rect. This may be either a zoom out or zoom * in. The actual animation is done on the compositor thread after being set diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index 4ca926ef10f..ca3d74d1552 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -212,9 +212,7 @@ AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId, mLastAsyncScrollOffset(0, 0), mCurrentAsyncScrollOffset(0, 0), mAsyncScrollTimeoutTask(nullptr), - mDisableNextTouchBatch(false), - mHandlingTouchQueue(false), - mDelayPanning(false) + mHandlingTouchQueue(false) { MOZ_COUNT_CTOR(AsyncPanZoomController); @@ -312,29 +310,12 @@ nsEventStatus AsyncPanZoomController::HandleInputEvent(const InputData& aEvent) nsEventStatus rv = nsEventStatus_eIgnore; nsRefPtr listener = GetGestureEventListener(); - if (listener && !mDisableNextTouchBatch) { + if (listener) { rv = listener->HandleInputEvent(aEvent); if (rv == nsEventStatus_eConsumeNoDefault) return rv; } - if (mDelayPanning && aEvent.mInputType == MULTITOUCH_INPUT) { - const MultiTouchInput& multiTouchInput = aEvent.AsMultiTouchInput(); - if (multiTouchInput.mType == MultiTouchInput::MULTITOUCH_MOVE) { - // Let BrowserElementScrolling perform panning gesture first. - SetState(WAITING_LISTENERS); - mTouchQueue.AppendElement(multiTouchInput); - - if (!mTouchListenerTimeoutTask) { - mTouchListenerTimeoutTask = - NewRunnableMethod(this, &AsyncPanZoomController::TimeoutTouchListeners); - - PostDelayedTask(mTouchListenerTimeoutTask, gTouchListenerTimeout); - } - return nsEventStatus_eConsumeNoDefault; - } - } - switch (aEvent.mInputType) { case MULTITOUCH_INPUT: { const MultiTouchInput& multiTouchInput = aEvent.AsMultiTouchInput(); @@ -416,10 +397,6 @@ nsEventStatus AsyncPanZoomController::OnTouchStart(const MultiTouchInput& aEvent } nsEventStatus AsyncPanZoomController::OnTouchMove(const MultiTouchInput& aEvent) { - if (mDisableNextTouchBatch) { - return nsEventStatus_eIgnore; - } - switch (mState) { case FLING: case NOTHING: @@ -459,11 +436,6 @@ nsEventStatus AsyncPanZoomController::OnTouchMove(const MultiTouchInput& aEvent) } nsEventStatus AsyncPanZoomController::OnTouchEnd(const MultiTouchInput& aEvent) { - if (mDisableNextTouchBatch) { - mDisableNextTouchBatch = false; - return nsEventStatus_eIgnore; - } - { ReentrantMonitorAutoEnter lock(mMonitor); SendAsyncScrollEvent(); @@ -1185,18 +1157,6 @@ void AsyncPanZoomController::UpdateCompositionBounds(const ScreenIntRect& aCompo } } -void AsyncPanZoomController::CancelDefaultPanZoom() { - mDisableNextTouchBatch = true; - nsRefPtr listener = GetGestureEventListener(); - if (listener) { - listener->CancelGesture(); - } -} - -void AsyncPanZoomController::DetectScrollableSubframe() { - mDelayPanning = true; -} - void AsyncPanZoomController::ZoomToRect(CSSRect aRect) { SetState(ANIMATING_ZOOM); @@ -1276,7 +1236,7 @@ void AsyncPanZoomController::ZoomToRect(CSSRect aRect) { } void AsyncPanZoomController::ContentReceivedTouch(bool aPreventDefault) { - if (!mFrameMetrics.mMayHaveTouchListeners && !mDelayPanning) { + if (!mFrameMetrics.mMayHaveTouchListeners) { mTouchQueue.Clear(); return; } @@ -1288,21 +1248,12 @@ void AsyncPanZoomController::ContentReceivedTouch(bool aPreventDefault) { if (mState == WAITING_LISTENERS) { if (!aPreventDefault) { - // Delayed scrolling gesture is pending at TOUCHING state. - if (mDelayPanning) { - SetState(TOUCHING); - } else { - SetState(NOTHING); - } + SetState(NOTHING); } mHandlingTouchQueue = true; while (!mTouchQueue.IsEmpty()) { - // we need to reset mDelayPanning before handling scrolling gesture. - if (!aPreventDefault && mTouchQueue[0].mType == MultiTouchInput::MULTITOUCH_MOVE) { - mDelayPanning = false; - } if (!aPreventDefault) { HandleInputEvent(mTouchQueue[0]); } diff --git a/gfx/layers/ipc/AsyncPanZoomController.h b/gfx/layers/ipc/AsyncPanZoomController.h index ccbe13beab8..f89be4cd043 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.h +++ b/gfx/layers/ipc/AsyncPanZoomController.h @@ -109,22 +109,6 @@ public: */ void UpdateCompositionBounds(const ScreenIntRect& aCompositionBounds); - /** - * We are scrolling a subframe, so disable our machinery until we hit - * a touch end or a new touch start. This prevents us from accidentally - * panning both the subframe and the parent frame. - * - * XXX/bug 775452: We should eventually be supporting async scrollable - * subframes. - */ - void CancelDefaultPanZoom(); - - /** - * We have found a scrollable subframe, so we need to delay the scrolling - * gesture executed and let subframe do the scrolling first. - */ - void DetectScrollableSubframe(); - /** * Kicks an animation to zoom to a rect. This may be either a zoom out or zoom * in. The actual animation is done on the compositor thread after being set @@ -580,22 +564,12 @@ private: // ensures the last mozbrowserasyncscroll event is always been fired. CancelableTask* mAsyncScrollTimeoutTask; - // Flag used to determine whether or not we should disable handling of the - // next batch of touch events. This is used for sync scrolling of subframes. - bool mDisableNextTouchBatch; - // Flag used to determine whether or not we should try to enter the // WAITING_LISTENERS state. This is used in the case that we are processing a // queued up event block. If set, this means that we are handling this queue // and we don't want to queue the events back up again. bool mHandlingTouchQueue; - // Flag used to determine whether or not we should try scrolling by - // BrowserElementScrolling first. If set, we delay delivering - // touchmove events to GestureListener until BrowserElementScrolling - // decides whether it wants to handle panning for this touch series. - bool mDelayPanning; - friend class Axis; /* The functions and members in this section are used to build a tree diff --git a/layout/ipc/PRenderFrame.ipdl b/layout/ipc/PRenderFrame.ipdl index f0f5ce6b2c8..cc6e57a24c3 100644 --- a/layout/ipc/PRenderFrame.ipdl +++ b/layout/ipc/PRenderFrame.ipdl @@ -45,9 +45,6 @@ parent: async NotifyCompositorTransaction(); - async CancelDefaultPanZoom(); - async DetectScrollableSubframe(); - async UpdateHitRegion(nsRegion aRegion); async __delete__(); diff --git a/layout/ipc/RenderFrameChild.cpp b/layout/ipc/RenderFrameChild.cpp index 5130fcc4f6e..7e091338b05 100644 --- a/layout/ipc/RenderFrameChild.cpp +++ b/layout/ipc/RenderFrameChild.cpp @@ -32,18 +32,6 @@ RenderFrameChild::Destroy() // WARNING: |this| is dead, hands off } -void -RenderFrameChild::CancelDefaultPanZoom() -{ - SendCancelDefaultPanZoom(); -} - -void -RenderFrameChild::DetectScrollableSubframe() -{ - SendDetectScrollableSubframe(); -} - PLayerTransactionChild* RenderFrameChild::AllocPLayerTransactionChild() { diff --git a/layout/ipc/RenderFrameChild.h b/layout/ipc/RenderFrameChild.h index 55cd1fd80a4..aa63b32bfd8 100644 --- a/layout/ipc/RenderFrameChild.h +++ b/layout/ipc/RenderFrameChild.h @@ -19,9 +19,6 @@ public: RenderFrameChild() {} virtual ~RenderFrameChild() {} - void CancelDefaultPanZoom(); - void DetectScrollableSubframe(); - void Destroy(); protected: diff --git a/layout/ipc/RenderFrameParent.cpp b/layout/ipc/RenderFrameParent.cpp index b9ff7690759..a916b3801ba 100644 --- a/layout/ipc/RenderFrameParent.cpp +++ b/layout/ipc/RenderFrameParent.cpp @@ -846,24 +846,6 @@ RenderFrameParent::RecvNotifyCompositorTransaction() return true; } -bool -RenderFrameParent::RecvCancelDefaultPanZoom() -{ - if (GetApzcTreeManager()) { - GetApzcTreeManager()->CancelDefaultPanZoom(ScrollableLayerGuid(mLayersId)); - } - return true; -} - -bool -RenderFrameParent::RecvDetectScrollableSubframe() -{ - if (GetApzcTreeManager()) { - GetApzcTreeManager()->DetectScrollableSubframe(ScrollableLayerGuid(mLayersId)); - } - return true; -} - bool RenderFrameParent::RecvUpdateHitRegion(const nsRegion& aRegion) { diff --git a/layout/ipc/RenderFrameParent.h b/layout/ipc/RenderFrameParent.h index b83bf2ebc34..c0678bf2404 100644 --- a/layout/ipc/RenderFrameParent.h +++ b/layout/ipc/RenderFrameParent.h @@ -117,9 +117,6 @@ protected: virtual bool RecvNotifyCompositorTransaction() MOZ_OVERRIDE; - virtual bool RecvCancelDefaultPanZoom() MOZ_OVERRIDE; - virtual bool RecvDetectScrollableSubframe() MOZ_OVERRIDE; - virtual bool RecvUpdateHitRegion(const nsRegion& aRegion) MOZ_OVERRIDE; virtual PLayerTransactionParent* AllocPLayerTransactionParent() MOZ_OVERRIDE;