mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 835981 part 6. Change nsIDOMXULElement::GetControllers consumers to nsXULElement. r=peterv
This commit is contained in:
parent
1a543ff1ad
commit
ac6be6fde3
@ -27,7 +27,7 @@
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsXULElement.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
@ -231,9 +231,13 @@ nsWindowRoot::GetControllers(nsIControllers** aResult)
|
||||
nsFocusManager::GetFocusedDescendant(mWindow, true, getter_AddRefs(focusedWindow));
|
||||
if (focusedContent) {
|
||||
#ifdef MOZ_XUL
|
||||
nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(focusedContent));
|
||||
if (xulElement)
|
||||
return xulElement->GetControllers(aResult);
|
||||
RefPtr<nsXULElement> xulElement = nsXULElement::FromContent(focusedContent);
|
||||
if (xulElement) {
|
||||
ErrorResult rv;
|
||||
*aResult = xulElement->GetControllers(rv);
|
||||
NS_IF_ADDREF(*aResult);
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLTextAreaElement> htmlTextArea =
|
||||
|
@ -63,7 +63,6 @@ interface nsIDOMXULElement : nsIDOMElement
|
||||
attribute boolean allowEvents;
|
||||
|
||||
readonly attribute nsIRDFResource resource;
|
||||
readonly attribute nsIControllers controllers;
|
||||
|
||||
void focus();
|
||||
void blur();
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIController.h"
|
||||
#include "nsIControllers.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsXULElement.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDOMHTMLTextAreaElement.h"
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
@ -553,9 +553,13 @@ nsXBLPrototypeHandler::GetController(EventTarget* aTarget)
|
||||
// This code should have no special knowledge of what objects might have controllers.
|
||||
nsCOMPtr<nsIControllers> controllers;
|
||||
|
||||
nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(aTarget));
|
||||
if (xulElement)
|
||||
xulElement->GetControllers(getter_AddRefs(controllers));
|
||||
nsCOMPtr<nsIContent> targetContent(do_QueryInterface(aTarget));
|
||||
RefPtr<nsXULElement> xulElement =
|
||||
nsXULElement::FromContentOrNull(targetContent);
|
||||
if (xulElement) {
|
||||
IgnoredErrorResult rv;
|
||||
controllers = xulElement->GetControllers(rv);
|
||||
}
|
||||
|
||||
if (!controllers) {
|
||||
nsCOMPtr<nsIDOMHTMLTextAreaElement> htmlTextArea(do_QueryInterface(aTarget));
|
||||
|
@ -1474,15 +1474,6 @@ nsXULElement::IsAttributeMapped(const nsIAtom* aAttribute) const
|
||||
return false;
|
||||
}
|
||||
|
||||
// Controllers Methods
|
||||
NS_IMETHODIMP
|
||||
nsXULElement::GetControllers(nsIControllers** aResult)
|
||||
{
|
||||
ErrorResult rv;
|
||||
NS_IF_ADDREF(*aResult = GetControllers(rv));
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
|
||||
nsIControllers*
|
||||
nsXULElement::GetControllers(ErrorResult& rv)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user