Bug 1389743: followup: Add a comment about why we post a restyle in DestroyFramesFor. r=comment-only
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 25 Aug 2017 09:24:26 +0200
changeset 376861 22c304405b0103e6a684ad0b2721f243d51289b9
parent 376860 17b77db08079a4783a6b74a2a9b92c3b4e3b5672
child 376862 5807c147fcdefcfd7f1ed517245eedac5a38c420
push id32394
push userkwierso@gmail.com
push dateFri, 25 Aug 2017 23:22:16 +0000
treeherdermozilla-central@86a3c73984a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscomment-only
bugs1389743
milestone57.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 1389743: followup: Add a comment about why we post a restyle in DestroyFramesFor. r=comment-only MozReview-Commit-ID: 5xSclV9mqyU
layout/base/PresShell.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -2931,16 +2931,24 @@ PresShell::DestroyFramesFor(Element* aEl
   bool didReconstruct = fc->DestroyFramesFor(aElement);
   fc->EndUpdate();
 
   // XXXmats doesn't frame state need to be restored in this case?
   if (!didReconstruct) {
     PostRecreateFramesFor(aElement);
   }
 
+  // NOTE(emilio): This is needed to force also a full subtree restyle for the
+  // content (in Stylo, where the existence of frames != the existence of
+  // styles).
+  //
+  // It's a bit out of place in a function called DestroyFramesFor,
+  // however the two only callers of this code really need this (given they
+  // shuffle the flattened tree around), and this avoids exposing additional
+  // APIs on the pres shell.
   mPresContext->RestyleManager()->PostRestyleEvent(
     aElement, eRestyle_Subtree, nsChangeHint(0));
 
   --mChangeNestCount;
 }
 
 void
 nsIPresShell::PostRecreateFramesFor(Element* aElement)