Bug 1518633 - Add profiler label for anchor node selection. r=mstange
authorRyan Hunt <rhunt@eqrion.net>
Wed, 16 Jan 2019 12:27:49 -0600
changeset 511323 5f184a902803e881355a3575862f57f35a355b0a
parent 511322 4c08e7df7398a16e32d3e42943c960a5fc331a20
child 511324 d1d7a79aa38e7e6583333c703b2ad8dbb885c7b3
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1518633
milestone66.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 1518633 - Add profiler label for anchor node selection. r=mstange
layout/generic/ScrollAnchorContainer.cpp
--- a/layout/generic/ScrollAnchorContainer.cpp
+++ b/layout/generic/ScrollAnchorContainer.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ScrollAnchorContainer.h"
 
+#include "GeckoProfiler.h"
 #include "mozilla/dom/Text.h"
 #include "mozilla/StaticPrefs.h"
 #include "nsGfxScrollFrame.h"
 #include "nsLayoutUtils.h"
 
 #define ANCHOR_LOG(...)
 // #define ANCHOR_LOG(...) printf_stderr("ANCHOR: " __VA_ARGS__)
 
@@ -118,16 +119,17 @@ static nsRect FindScrollAnchoringBoundin
 void ScrollAnchorContainer::SelectAnchor() {
   MOZ_ASSERT(mScrollFrame->mScrolledFrame);
   MOZ_ASSERT(mAnchorNodeIsDirty);
 
   if (!StaticPrefs::layout_css_scroll_anchoring_enabled()) {
     return;
   }
 
+  AUTO_PROFILER_LABEL("ScrollAnchorContainer::SelectAnchor", LAYOUT);
   ANCHOR_LOG("Selecting anchor for %p with scroll-port [%d %d x %d %d].\n",
              this, mScrollFrame->mScrollPort.x, mScrollFrame->mScrollPort.y,
              mScrollFrame->mScrollPort.width, mScrollFrame->mScrollPort.height);
 
   const nsStyleDisplay* disp = Frame()->StyleDisplay();
 
   // Don't select a scroll anchor if the scroll frame has `overflow-anchor:
   // none`.