Closed Bug 969727 Opened 11 years ago Closed 11 years ago

Figure out why the [Func] check for MozInputMethod does not work as expected

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: ehsan.akhgari, Unassigned)

Details

See <http://mxr.mozilla.org/mozilla-central/source/dom/webidl/InputMethod.webidl#7> where we do: 7 [JSImplementation="@mozilla.org/b2g-inputmethod;1", 8 NavigatorProperty="mozInputMethod", 9 Func="Navigator::HasInputMethodSupport"] 10 interface MozInputMethod : EventTarget { ... And <http://mxr.mozilla.org/mozilla-central/source/dom/base/Navigator.cpp#1911>: 1909 /* static */ 1910 bool 1911 Navigator::HasInputMethodSupport(JSContext* /* unused */, 1912 JSObject* aGlobal) 1913 { 1914 nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal); 1915 if (Preferences::GetBool("dom.mozInputMethod.testing", false)) { 1916 return true; 1917 } 1918 1919 return Preferences::GetBool("dom.mozInputMethod.enabled", false) && 1920 win && CheckPermission(win, "input"); 1921 } If I'm reading this code correctly, window.MozInputMethod and navigator.mozInputMethod should only be exposed where the pref is enabled and the input permission has been granted. But if I toggle the pref on desktop, both of these properties are exposed. What am I missing?
Flags: needinfo?(bzbarsky)
> But if I toggle the pref on desktop, both of these properties are exposed. In which build? I can't seem to reproduce this if I toggle "dom.mozInputMethod.enabled" locally in an inbound build from earlier today...
Flags: needinfo?(bzbarsky)
(In reply to Boris Zbarsky [:bz] from comment #1) > > But if I toggle the pref on desktop, both of these properties are exposed. > > In which build? I can't seem to reproduce this if I toggle > "dom.mozInputMethod.enabled" locally in an inbound build from earlier > today... Latest Nightly. But I was testing that on about:newtab. I just tested on the google.com and couldn't repro. Do we have special permissions on about:newtab or something?
about:newtab runs with the system principal, and nsPermissionManager::CommonTestPermission returns nsIPermissionManager::ALLOW_ACTION for anything with the system principal.
I see, false alarm then. Thanks, and sorry for wasting your time.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.