diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 95115ed11934..708ca29b3103 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3254,21 +3254,6 @@ nsIDocument::HasFocus(ErrorResult& rv) const return false; } -TimeStamp -nsIDocument::LastFocusTime() const -{ - return mLastFocusTime; -} - -void -nsIDocument::SetLastFocusTime(const TimeStamp& aFocusTime) -{ - MOZ_DIAGNOSTIC_ASSERT(!aFocusTime.IsNull()); - MOZ_DIAGNOSTIC_ASSERT(mLastFocusTime.IsNull() || - aFocusTime >= mLastFocusTime); - mLastFocusTime = aFocusTime; -} - NS_IMETHODIMP nsDocument::GetReferrer(nsAString& aReferrer) { @@ -4768,14 +4753,6 @@ nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject) } MaybeRescheduleAnimationFrameNotifications(); - - // If we are set in a window that is already focused we should remember this - // as the time the document gained focus. - bool focused = false; - Unused << HasFocus(&focused); - if (focused) { - SetLastFocusTime(TimeStamp::Now()); - } } // Remember the pointer to our window (or lack there of), to avoid diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index d18574e71e45..ad1bf6c95306 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -3611,17 +3611,6 @@ nsFocusManager::SetFocusedWindowInternal(nsPIDOMWindowOuter* aWindow) nsCOMPtr runnable = new PointerUnlocker(); NS_DispatchToCurrentThread(runnable); } - - // Update the last focus time on any affected documents - if (aWindow && aWindow != mFocusedWindow) { - const TimeStamp now(TimeStamp::Now()); - for (nsIDocument* doc = aWindow->GetExtantDoc(); - doc; - doc = doc->GetParentDocument()) { - doc->SetLastFocusTime(now); - } - } - mFocusedWindow = aWindow; } diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index d5c2f59f6889..6bd5d2259576 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -2656,8 +2656,6 @@ public: } Element* GetActiveElement(); bool HasFocus(mozilla::ErrorResult& rv) const; - mozilla::TimeStamp LastFocusTime() const; - void SetLastFocusTime(const mozilla::TimeStamp& aFocusTime); // Event handlers are all on nsINode already bool MozSyntheticDocument() const { @@ -3027,10 +3025,6 @@ protected: // container for per-context fonts (downloadable, SVG, etc.) RefPtr mFontFaceSet; - // Last time this document or a one of its sub-documents was focused. If - // focus has never occurred then mLastFocusTime.IsNull() will be true. - mozilla::TimeStamp mLastFocusTime; - // True if BIDI is enabled. bool mBidiEnabled : 1; // True if a MathML element has ever been owned by this document.