Bug 1436005 - Make type of nsIDOMWindowUtils.focusedInputType AString r?hsivonen
nsIDOMWindowUtils.focusedInputType is necessary to check if IMEStateManager
sets InputContext of widget properly. So, let's keep it but make its type
AString (nsAString&) rather than string (char**).
MozReview-Commit-ID: 1RHhmAsPY5a
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1814,27 +1814,24 @@ nsDOMWindowUtils::GetIMEStatus(uint32_t
return NS_ERROR_FAILURE;
InputContext context = widget->GetInputContext();
*aState = static_cast<uint32_t>(context.mIMEState.mEnabled);
return NS_OK;
}
NS_IMETHODIMP
-nsDOMWindowUtils::GetFocusedInputType(char** aType)
+nsDOMWindowUtils::GetFocusedInputType(nsAString& aType)
{
- NS_ENSURE_ARG_POINTER(aType);
-
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget) {
return NS_ERROR_FAILURE;
}
- InputContext context = widget->GetInputContext();
- *aType = ToNewCString(context.mHTMLInputType);
+ aType = widget->GetInputContext().mHTMLInputType;
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetViewId(nsIDOMElement* aElement, nsViewID* aResult)
{
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
if (content && nsLayoutUtils::FindIDFor(content, aResult)) {
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -1507,17 +1507,17 @@ interface nsIDOMWindowUtils : nsISupport
AString getUnanimatedComputedStyle(in nsIDOMElement aElement,
in AString aPseudoElement,
in AString aProperty,
in long aFlushType);
/**
* Get the type of the currently focused html input, if any.
*/
- readonly attribute string focusedInputType;
+ readonly attribute AString focusedInputType;
/**
* Find the view ID for a given element. This is the reverse of
* findElementWithViewId().
*/
nsViewID getViewId(in nsIDOMElement aElement);
/**