diff --git a/dom/base/nsScreen.cpp b/dom/base/nsScreen.cpp index 23d7e3593cc7..9c634dee32fa 100644 --- a/dom/base/nsScreen.cpp +++ b/dom/base/nsScreen.cpp @@ -222,64 +222,6 @@ nsScreen::GetLockOrientationPermission() const return doc->MozFullScreen() ? FULLSCREEN_LOCK_ALLOWED : LOCK_DENIED; } -NS_IMETHODIMP -nsScreen::MozLockOrientation(JS::Handle aOrientation, JSContext* aCx, - bool* aReturn) -{ - if (aOrientation.isObject()) { - JS::Rooted seq(aCx, &aOrientation.toObject()); - if (IsArrayLike(aCx, seq)) { - uint32_t length; - // JS_GetArrayLength actually works on all objects - if (!JS_GetArrayLength(aCx, seq, &length)) { - return NS_ERROR_FAILURE; - } - - Sequence orientations; - if (!orientations.SetCapacity(length)) { - return NS_ERROR_OUT_OF_MEMORY; - } - - for (uint32_t i = 0; i < length; ++i) { - JS::Rooted temp(aCx); - if (!JS_GetElement(aCx, seq, i, &temp)) { - return NS_ERROR_FAILURE; - } - - JS::Rooted jsString(aCx, JS::ToString(aCx, temp)); - if (!jsString) { - return NS_ERROR_FAILURE; - } - - nsDependentJSString str; - if (!str.init(aCx, jsString)) { - return NS_ERROR_FAILURE; - } - - *orientations.AppendElement() = str; - } - - ErrorResult rv; - *aReturn = MozLockOrientation(orientations, rv); - return rv.ErrorCode(); - } - } - - JS::Rooted jsString(aCx, JS::ToString(aCx, aOrientation)); - if (!jsString) { - return NS_ERROR_FAILURE; - } - - nsDependentJSString orientation; - if (!orientation.init(aCx, jsString)) { - return NS_ERROR_FAILURE; - } - - ErrorResult rv; - *aReturn = MozLockOrientation(orientation, rv); - return rv.ErrorCode(); -} - bool nsScreen::MozLockOrientation(const nsAString& aOrientation, ErrorResult& aRv) { @@ -365,13 +307,6 @@ nsScreen::MozUnlockOrientation() hal::UnlockScreenOrientation(); } -NS_IMETHODIMP -nsScreen::SlowMozUnlockOrientation() -{ - MozUnlockOrientation(); - return NS_OK; -} - bool nsScreen::IsDeviceSizePageSize() { diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 6b5a8aace8f2..10ad877e7be3 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -264,12 +264,6 @@ IsNotDateOrRegExp(JSContext* cx, JS::Handle obj) return !JS_ObjectIsDate(cx, obj) && !JS_ObjectIsRegExp(cx, obj); } -MOZ_ALWAYS_INLINE bool -IsArrayLike(JSContext* cx, JS::Handle obj) -{ - return IsNotDateOrRegExp(cx, obj); -} - MOZ_ALWAYS_INLINE bool IsObjectValueConvertibleToDictionary(JSContext* cx, JS::Handle objVal) diff --git a/dom/interfaces/base/nsIDOMScreen.idl b/dom/interfaces/base/nsIDOMScreen.idl index 111c1954920f..cc53cf90b1a0 100644 --- a/dom/interfaces/base/nsIDOMScreen.idl +++ b/dom/interfaces/base/nsIDOMScreen.idl @@ -5,7 +5,7 @@ #include "nsIDOMEventTarget.idl" -[scriptable, builtinclass, uuid(bcdf4ce4-9785-4e31-a851-1d51ea16da20)] +[scriptable, builtinclass, uuid(e732649a-4f78-4ded-abe1-dbdc36fd59d3)] interface nsIDOMScreen : nsIDOMEventTarget { readonly attribute long top; @@ -26,36 +26,4 @@ interface nsIDOMScreen : nsIDOMEventTarget */ [binaryname(SlowMozOrientation)] readonly attribute DOMString mozOrientation; - - /** - * Lock the screen to the specified orientations(s). This method returns true - * if the lock was acquired successfully, and false otherwise. - * - * The parameter can be a DOMString or an Array of DOMStrings. If you pass a - * string, we lock the screen to that one orientation. If you pass an Array, - * we ensure that the screen is always in one of the given orientations. - * - * Valid orientations are "portrait", "portrait-primary", - * "portrait-secondary", "landscape", "landscape-primary", and - * "landscape-secondary". - * These tokens are case-sensitive. - * - * If you pass a string that's not one of the valid orientations, or if you - * pass an array of orientations and any of the orientations in the array is - * not valid, we reject the lock and return false. - * - * The "-primary" orientations correspond to holding the device right-side up, - * while the "-secondary" orientations correspond to holding the device - * upside-down. Locking the orientation in "portrait" is the same as locking - * the orientation in ['portrait-primary', 'portrait-secondary'], and the - * "landscape" orientation similarly corresponds to the set - * ['landscape-primary', 'landscape-secondary']. - */ - [implicit_jscontext] boolean mozLockOrientation(in jsval orientation); - - /** - * Unlock the screen orientation. - */ - [binaryname(SlowMozUnlockOrientation)] - void mozUnlockOrientation(); };