Bug 1607573 - Part 3: Remove GetRealFrameElementOuter in favor of GetFrameElement, r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D59550

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nika Layzell 2020-01-10 19:39:01 +00:00
Родитель 808bb3e060
Коммит c76e93dad5
4 изменённых файлов: 4 добавлений и 18 удалений

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

@ -3828,7 +3828,7 @@ Element* nsGlobalWindowInner::GetFrameElement(nsIPrincipal& aSubjectPrincipal,
} }
Element* nsGlobalWindowInner::GetRealFrameElement(ErrorResult& aError) { Element* nsGlobalWindowInner::GetRealFrameElement(ErrorResult& aError) {
FORWARD_TO_OUTER_OR_THROW(GetRealFrameElementOuter, (), aError, nullptr); FORWARD_TO_OUTER_OR_THROW(GetFrameElement, (), aError, nullptr);
} }
void nsGlobalWindowInner::UpdateCommands(const nsAString& anAction, void nsGlobalWindowInner::UpdateCommands(const nsAString& anAction,

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

@ -6342,12 +6342,8 @@ void nsGlobalWindowOuter::NotifyWindowIDDestroyed(const char* aTopic) {
Element* nsGlobalWindowOuter::GetFrameElementOuter( Element* nsGlobalWindowOuter::GetFrameElementOuter(
nsIPrincipal& aSubjectPrincipal) { nsIPrincipal& aSubjectPrincipal) {
if (!mDocShell || mDocShell->GetIsMozBrowser()) {
return nullptr;
}
// Per HTML5, the frameElement getter returns null in cross-origin situations. // Per HTML5, the frameElement getter returns null in cross-origin situations.
Element* element = GetRealFrameElementOuter(); Element* element = GetFrameElement();
if (!element) { if (!element) {
return nullptr; return nullptr;
} }
@ -6359,21 +6355,13 @@ Element* nsGlobalWindowOuter::GetFrameElementOuter(
return element; return element;
} }
Element* nsGlobalWindowOuter::GetRealFrameElementOuter() { Element* nsGlobalWindowOuter::GetFrameElement() {
if (!mBrowsingContext || mBrowsingContext->IsTop()) { if (!mBrowsingContext || mBrowsingContext->IsTop()) {
return nullptr; return nullptr;
} }
return mBrowsingContext->GetEmbedderElement(); return mBrowsingContext->GetEmbedderElement();
} }
/**
* nsIGlobalWindow::GetFrameElement (when called from C++) is just a wrapper
* around GetRealFrameElement.
*/
Element* nsGlobalWindowOuter::GetFrameElement() {
return GetRealFrameElementOuter();
}
namespace { namespace {
class ChildCommandDispatcher : public Runnable { class ChildCommandDispatcher : public Runnable {
public: public:

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

@ -622,7 +622,6 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
mozilla::ErrorResult& aError); mozilla::ErrorResult& aError);
nsIControllers* GetControllersOuter(mozilla::ErrorResult& aError); nsIControllers* GetControllersOuter(mozilla::ErrorResult& aError);
nsresult GetControllers(nsIControllers** aControllers) override; nsresult GetControllers(nsIControllers** aControllers) override;
mozilla::dom::Element* GetRealFrameElementOuter();
float GetMozInnerScreenXOuter(mozilla::dom::CallerType aCallerType); float GetMozInnerScreenXOuter(mozilla::dom::CallerType aCallerType);
float GetMozInnerScreenYOuter(mozilla::dom::CallerType aCallerType); float GetMozInnerScreenYOuter(mozilla::dom::CallerType aCallerType);
double GetDevicePixelRatioOuter(mozilla::dom::CallerType aCallerType); double GetDevicePixelRatioOuter(mozilla::dom::CallerType aCallerType);

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

@ -2232,8 +2232,7 @@ static bool IsFullyActive(nsPIDOMWindowInner* aWindow) {
if (context->IsTopLevelWindow()) { if (context->IsTopLevelWindow()) {
return true; return true;
} }
nsCOMPtr<Element> frameElement = nsCOMPtr<Element> frameElement = context->GetFrameElement();
nsGlobalWindowOuter::Cast(context)->GetRealFrameElementOuter();
if (!frameElement) { if (!frameElement) {
return false; return false;
} }