Backed out changeset c80f64bfb7b7 (bug 968835) for Android failures in test_getWebIDLCaller.html; CLOSED TREE

This commit is contained in:
Ed Morley 2014-04-10 15:48:42 +01:00
Родитель 440f3655df
Коммит 1f6cb07200
2 изменённых файлов: 16 добавлений и 13 удалений

Просмотреть файл

@ -9,7 +9,6 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/dom/HTMLAllCollection.h"
#include "nsCOMPtr.h"
#include "nsGlobalWindow.h"
#include "nsXPIDLString.h"
#include "nsPrintfCString.h"
#include "nsReadableUtils.h"
@ -2155,24 +2154,28 @@ NS_IMETHODIMP
nsHTMLDocument::GetSelection(nsISelection** aReturn)
{
ErrorResult rv;
NS_IF_ADDREF(*aReturn = GetSelection(rv));
*aReturn = GetSelection(rv).take();
return rv.ErrorCode();
}
Selection*
nsHTMLDocument::GetSelection(ErrorResult& aRv)
already_AddRefed<Selection>
nsHTMLDocument::GetSelection(ErrorResult& rv)
{
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(GetScopeObject());
if (!window) {
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(GetScopeObject());
nsCOMPtr<nsPIDOMWindow> pwin = do_QueryInterface(window);
if (!pwin) {
return nullptr;
}
NS_ASSERTION(pwin->IsInnerWindow(), "Should have inner window here!");
if (!pwin->GetOuterWindow() ||
pwin->GetOuterWindow()->GetCurrentInnerWindow() != pwin) {
return nullptr;
}
NS_ASSERTION(window->IsInnerWindow(), "Should have inner window here!");
if (!window->IsCurrentInnerWindow()) {
return nullptr;
}
return static_cast<nsGlobalWindow*>(window.get())->GetSelection(aRv);
nsCOMPtr<nsISelection> sel;
rv = window->GetSelection(getter_AddRefs(sel));
nsRefPtr<Selection> selection = static_cast<Selection*>(sel.get());
return selection.forget();
}
NS_IMETHODIMP

Просмотреть файл

@ -233,7 +233,7 @@ public:
{
// Deprecated
}
mozilla::Selection* GetSelection(mozilla::ErrorResult& aRv);
already_AddRefed<mozilla::Selection> GetSelection(mozilla::ErrorResult& rv);
// The XPCOM CaptureEvents works fine for us.
// The XPCOM ReleaseEvents works fine for us.
// We're picking up GetLocation from Document