layout/style/ComputedStyleInlines.h
author Mozilla Releng Treescript <release+treescript@mozilla.org>
Fri, 24 Jan 2020 08:03:42 +0000
changeset 571306 ba0e3804016f6d9c4d182cfb78032a2a4bb01a15
parent 515191 6b71e3d434c232998629b8e18a983212e9d3fc9d
permissions -rw-r--r--
no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD ar -> d55ff7d5c760 be -> c7e3f88f1664 br -> 22dc5c545843 fa -> 218585f0f8e4 hu -> 2cc63811e8a4 it -> 1d438d983d51 kk -> 8c6d145a4606 pt-BR -> 8cee3bf62338 ur -> 3e5fcbb50b9f vi -> 4732a0f8a198

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

/*
 * Inlined methods for ComputedStyle. Will just redirect to
 * GeckoComputedStyle methods when compiled without stylo, but will do
 * virtual dispatch (by checking which kind of container it is)
 * in stylo mode.
 */

#ifndef ComputedStyleInlines_h
#define ComputedStyleInlines_h

#include "mozilla/ComputedStyle.h"
#include "mozilla/ServoComputedDataInlines.h"
#include "mozilla/ServoUtils.h"
#include "nsPresContext.h"

namespace mozilla {

void ComputedStyle::StartImageLoads(dom::Document& aDocument,
                                    const ComputedStyle* aOldStyle) {
  MOZ_ASSERT(NS_IsMainThread());
#define STYLE_STRUCT(name_)                                      \
  if (nsStyle##name_::kHasTriggerImageLoads) {                   \
    auto* old = aOldStyle ? aOldStyle->Style##name_() : nullptr; \
    auto* current = const_cast<nsStyle##name_*>(Style##name_()); \
    current->TriggerImageLoads(aDocument, old);                  \
  }
#include "nsStyleStructList.h"
#undef STYLE_STRUCT
}

}  // namespace mozilla

#endif  // ComputedStyleInlines_h