layout/base/nsIPresShellInlines.h
author Mike Hommey <mh+mozilla@glandium.org>
Wed, 16 Jan 2019 21:44:54 +0000
changeset 514172 e0fd6ca971ae522dd9398d49f564fe3f7263112b
parent 512431 f0a91d36587266d7454a450c6044d573664fbed5
child 528634 5723ddbc5c44979b0c6dfae7d7989f4f532d8913
permissions -rw-r--r--
Bug 1520377 - Replace/Inline subconfigure.{prefix_lines,execute_and_prefix}. r=nalexander Use an I/O wrapper on the configure output handler to add the "js/src>" prefix. Depends on D16643 Differential Revision: https://phabricator.services.mozilla.com/D16644

/* -*- 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/. */

#ifndef nsIPresShellInlines_h
#define nsIPresShellInlines_h

#include "mozilla/dom/Document.h"

void nsIPresShell::SetNeedLayoutFlush() {
  mNeedLayoutFlush = true;
  if (mozilla::dom::Document* doc = mDocument->GetDisplayDocument()) {
    if (nsIPresShell* shell = doc->GetShell()) {
      shell->mNeedLayoutFlush = true;
    }
  }

#ifdef MOZ_GECKO_PROFILER
  if (!mReflowCause) {
    mReflowCause = profiler_get_backtrace();
  }
#endif
}

void nsIPresShell::SetNeedStyleFlush() {
  mNeedStyleFlush = true;
  if (mozilla::dom::Document* doc = mDocument->GetDisplayDocument()) {
    if (nsIPresShell* shell = doc->GetShell()) {
      shell->mNeedStyleFlush = true;
    }
  }

#ifdef MOZ_GECKO_PROFILER
  if (!mStyleCause) {
    mStyleCause = profiler_get_backtrace();
  }
#endif
}

void nsIPresShell::EnsureStyleFlush() {
  SetNeedStyleFlush();
  ObserveStyleFlushes();
}

void nsIPresShell::SetNeedThrottledAnimationFlush() {
  mNeedThrottledAnimationFlush = true;
  if (mozilla::dom::Document* doc = mDocument->GetDisplayDocument()) {
    if (nsIPresShell* shell = doc->GetShell()) {
      shell->mNeedThrottledAnimationFlush = true;
    }
  }
}

#endif  // nsIPresShellInlines_h