bug 1366517, because of XBL usage, limit not-flushing-always-during-focus() to non-chrome, r=ehsan
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 23 May 2017 07:34:06 -0400
changeset 360199 87380800d29122fcb9690e29ebfa96f45162106f
parent 360198 6a30c71b11e26932888a47ddba9b3d7a1a13d0d2
child 360200 d614e6f2b9ad6d7480ee90967984bce8784d84c5
push id31872
push userryanvm@gmail.com
push dateTue, 23 May 2017 22:11:58 +0000
treeherdermozilla-central@96e18bec9fc8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1366517
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1366517, because of XBL usage, limit not-flushing-always-during-focus() to non-chrome, r=ehsan
dom/base/nsFocusManager.cpp
dom/base/nsFocusManager.h
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -3727,14 +3727,21 @@ nsFocusManager::MarkUncollectableForCCGe
       MarkUncollectableForCCGeneration(aGeneration);
   }
   if (sInstance->mMouseButtonEventHandlingDocument) {
     sInstance->mMouseButtonEventHandlingDocument->
       MarkUncollectableForCCGeneration(aGeneration);
   }
 }
 
+bool
+nsFocusManager::CanSkipFocus(nsIContent* aContent)
+{
+  return mFocusedContent == aContent &&
+         (!aContent || !nsContentUtils::IsChromeDoc(aContent->OwnerDoc()));
+}
+
 nsresult
 NS_NewFocusManager(nsIFocusManager** aResult)
 {
   NS_IF_ADDREF(*aResult = nsFocusManager::GetFocusManager());
   return NS_OK;
 }
--- a/dom/base/nsFocusManager.h
+++ b/dom/base/nsFocusManager.h
@@ -96,20 +96,17 @@ public:
 
   void NeedsFlushBeforeEventHandling(nsIContent* aContent)
   {
     if (mFocusedContent == aContent) {
       mEventHandlingNeedsFlush = true;
     }
   }
 
-  bool CanSkipFocus(nsIContent* aContent)
-  {
-    return mFocusedContent == aContent;
-  }
+  bool CanSkipFocus(nsIContent* aContent);
 
   void FlushBeforeEventHandlingIfNeeded(nsIContent* aContent)
   {
     if (mEventHandlingNeedsFlush) {
       nsCOMPtr<nsIDocument> doc = aContent->GetComposedDoc();
       if (doc) {
         mEventHandlingNeedsFlush = false;
         doc->FlushPendingNotifications(mozilla::FlushType::Layout);