Bug 1414345 - Part 1: Add 'Frame Construction' markers to all frame construction paths r?mstange draft
authorNazım Can Altınova <canaltinova@gmail.com>
Thu, 26 Jul 2018 16:17:17 +0200
changeset 823101 3eaba63aac7f2c0f45a504a057a8fd739714f68c
parent 819019 f6df6a982ee9510ca32dd3afa52dfe9f8c3586a3
child 823102 791690d2a75e27931664985b402d42cbc1498226
push id117563
push userbmo:canaltinova@gmail.com
push dateThu, 26 Jul 2018 14:46:45 +0000
reviewersmstange
bugs1414345
milestone63.0a1
Bug 1414345 - Part 1: Add 'Frame Construction' markers to all frame construction paths r?mstange MozReview-Commit-ID: 4s9MGljBqPp
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2702,16 +2702,17 @@ nsCSSFrameConstructor::ConstructDocEleme
 
   return newFrame;
 }
 
 
 nsIFrame*
 nsCSSFrameConstructor::ConstructRootFrame()
 {
+  AUTO_PROFILER_TRACING("Frame Construction", "ConstructRootFrame");
   AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
 
   ServoStyleSet* styleSet = mPresShell->StyleSet();
 
   // --------- BUILD VIEWPORT -----------
   RefPtr<ComputedStyle> viewportPseudoStyle =
     styleSet->ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::viewport,
                                                  nullptr);
@@ -7083,16 +7084,17 @@ nsCSSFrameConstructor::FindNextSiblingFo
 
 void
 nsCSSFrameConstructor::ContentAppended(nsIContent* aFirstNewContent,
                                        InsertionKind aInsertionKind)
 {
   MOZ_ASSERT(aInsertionKind == InsertionKind::Sync ||
              !RestyleManager()->IsInStyleRefresh());
 
+  AUTO_PROFILER_TRACING("Frame Construction", "ContentAppended");
   AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
 
 #ifdef DEBUG
   if (gNoisyContentUpdates) {
     printf("nsCSSFrameConstructor::ContentAppended container=%p "
            "first-child=%p lazy=%d\n",
            aFirstNewContent->GetParent(),
            aFirstNewContent,
@@ -7428,16 +7430,17 @@ void
 nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aStartChild,
                                             nsIContent* aEndChild,
                                             nsILayoutHistoryState* aFrameState,
                                             InsertionKind aInsertionKind)
 {
   MOZ_ASSERT(aInsertionKind == InsertionKind::Sync ||
              !RestyleManager()->IsInStyleRefresh());
 
+  AUTO_PROFILER_TRACING("Frame Construction", "ContentRangeInserted");
   AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
 
   MOZ_ASSERT(aStartChild, "must always pass a child");
 
 #ifdef DEBUG
   if (gNoisyContentUpdates) {
     printf("nsCSSFrameConstructor::ContentRangeInserted container=%p "
            "start-child=%p end-child=%p lazy=%d\n",
@@ -7889,16 +7892,17 @@ nsCSSFrameConstructor::ContentRangeInser
 bool
 nsCSSFrameConstructor::ContentRemoved(nsIContent* aChild,
                                       nsIContent* aOldNextSibling,
                                       RemoveFlags aFlags)
 {
   MOZ_ASSERT(aChild);
   MOZ_ASSERT(!aChild->IsRootOfAnonymousSubtree() || !aOldNextSibling,
              "Anonymous roots don't have siblings");
+  AUTO_PROFILER_TRACING("Frame Construction", "ContentRemoved");
   AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
   nsPresContext* presContext = mPresShell->GetPresContext();
   MOZ_ASSERT(presContext, "Our presShell should have a valid presContext");
 
   // We want to detect when the viewport override element stored in the
   // prescontext is in the subtree being removed.  Except in fullscreen cases
   // (which are handled in Element::UnbindFromTree and do not get stored on the
   // prescontext), the override element is always either the root element or a
@@ -8286,16 +8290,17 @@ nsCSSFrameConstructor::EnsureFrameForTex
     root, nsRestyleHint(0), nsChangeHint_ReconstructFrame);
   return true;
 }
 
 void
 nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent,
                                             const CharacterDataChangeInfo& aInfo)
 {
+  AUTO_PROFILER_TRACING("Frame Construction", "CharacterDataChanged");
   AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
 
   if ((aContent->HasFlag(NS_CREATE_FRAME_IF_NON_WHITESPACE) &&
        !aContent->TextIsOnlyWhitespace()) ||
       (aContent->HasFlag(NS_REFRAME_IF_WHITESPACE) &&
        aContent->TextIsOnlyWhitespace())) {
 #ifdef DEBUG
     nsIFrame* frame = aContent->GetPrimaryFrame();