layout/style/nsStyleContextInlines.h
author Manish Goregaokar <manishearth@gmail.com>
Sat, 10 Jun 2017 22:27:45 -0700
changeset 595123 6e9cce6ce87ab235bfb284dfc75d61f74edc8802
parent 595122 364de39d4df995f8c9418129e4d28d5c77b68bd5
child 594426 63142548fea81e975a977dccd0509e05cc4fe6b6
permissions -rw-r--r--
Bug 1373018 - Part 8: stylo: Move nsStyleContext::SetStyle to GeckoStyleContext; r?bholley MozReview-Commit-ID: ycXu95whnG

/* -*- 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 nsStyleContext. Will just redirect to
 * GeckoStyleContext methods when compiled without stylo, but will do
 * virtual dispatch (by checking which kind of container it is)
 * in stylo mode.
 */

#ifndef nsStyleContextInlines_h
#define nsStyleContextInlines_h

#include "nsStyleContext.h"
#include "mozilla/ServoStyleContext.h"
#include "mozilla/GeckoStyleContext.h"
#include "mozilla/ServoUtils.h"

using namespace mozilla;

MOZ_DEFINE_STYLO_METHODS(nsStyleContext, GeckoStyleContext, ServoStyleContext);

nsRuleNode*
nsStyleContext::RuleNode()
{
    MOZ_RELEASE_ASSERT(IsGecko());
    return AsGecko()->RuleNode();
}

#endif // nsStyleContextInlines_h