2018-03-22 22:04:20 +03:00
|
|
|
/* -*- 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/. */
|
|
|
|
|
|
|
|
/* the interface (to internal code) for retrieving computed style data */
|
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
#ifndef _ComputedStyle_h_
|
|
|
|
#define _ComputedStyle_h_
|
2018-03-22 22:04:20 +03:00
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
#include "nsIMemoryReporter.h"
|
|
|
|
#include <algorithm>
|
2018-03-29 14:15:46 +03:00
|
|
|
#include "mozilla/ArenaObjectID.h"
|
2018-03-22 22:04:20 +03:00
|
|
|
#include "mozilla/Assertions.h"
|
2018-08-15 08:46:42 +03:00
|
|
|
#include "mozilla/CachedInheritingStyles.h"
|
|
|
|
#include "mozilla/Maybe.h"
|
2018-05-16 08:35:59 +03:00
|
|
|
#include "mozilla/ServoComputedData.h"
|
2018-03-29 14:15:46 +03:00
|
|
|
#include "mozilla/ServoTypes.h"
|
2018-03-22 22:04:20 +03:00
|
|
|
#include "mozilla/ServoUtils.h"
|
|
|
|
#include "mozilla/StyleComplexColor.h"
|
|
|
|
#include "nsCSSAnonBoxes.h"
|
2018-03-29 14:15:46 +03:00
|
|
|
#include "nsCSSPseudoElements.h"
|
2018-03-22 22:04:20 +03:00
|
|
|
|
2018-03-29 14:15:46 +03:00
|
|
|
#include "nsStyleStructFwd.h"
|
|
|
|
|
2018-03-22 22:04:20 +03:00
|
|
|
class nsAtom;
|
2018-03-29 14:15:46 +03:00
|
|
|
enum nsChangeHint : uint32_t;
|
|
|
|
class nsIPresShell;
|
2018-03-22 22:04:20 +03:00
|
|
|
class nsPresContext;
|
2018-03-28 02:44:49 +03:00
|
|
|
class nsWindowSizes;
|
2018-03-22 22:04:20 +03:00
|
|
|
|
2018-03-29 14:15:46 +03:00
|
|
|
#define STYLE_STRUCT(name_) struct nsStyle##name_;
|
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
extern "C" {
|
2018-03-22 21:20:41 +03:00
|
|
|
void Servo_ComputedStyle_AddRef(const mozilla::ComputedStyle* aStyle);
|
|
|
|
void Servo_ComputedStyle_Release(const mozilla::ComputedStyle* aStyle);
|
2018-03-26 00:50:35 +03:00
|
|
|
void Gecko_ComputedStyle_Destroy(mozilla::ComputedStyle*);
|
2018-03-22 22:04:20 +03:00
|
|
|
}
|
|
|
|
|
2018-03-29 14:15:46 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
enum class CSSPseudoElementType : uint8_t;
|
|
|
|
class ComputedStyle;
|
|
|
|
|
2018-03-22 22:04:20 +03:00
|
|
|
/**
|
2018-09-12 10:37:37 +03:00
|
|
|
* A ComputedStyle represents the computed style data for an element.
|
2018-03-22 22:04:20 +03:00
|
|
|
*
|
2018-09-12 10:37:37 +03:00
|
|
|
* The computed style data are stored in a set of reference counted structs
|
|
|
|
* (see nsStyleStruct.h) that are stored directly on the ComputedStyle.
|
|
|
|
*
|
|
|
|
* Style structs are immutable once they have been produced, so when any change
|
|
|
|
* is made that needs a restyle, we create a new ComputedStyle.
|
2018-03-22 22:04:20 +03:00
|
|
|
*
|
2018-03-22 21:20:41 +03:00
|
|
|
* ComputedStyles are reference counted. References are generally held by:
|
|
|
|
*
|
2018-09-12 10:37:37 +03:00
|
|
|
* 1. nsIFrame::mComputedStyle, for every frame
|
|
|
|
* 2. Element::mServoData, for every element not inside a display:none subtree
|
|
|
|
* 3. nsComputedDOMStyle, when created for elements in display:none subtrees
|
|
|
|
* 4. media_queries::Device, which holds the initial value of every property
|
2018-03-22 22:04:20 +03:00
|
|
|
*/
|
|
|
|
|
2018-05-24 18:49:24 +03:00
|
|
|
enum class ComputedStyleBit : uint8_t
|
|
|
|
{
|
|
|
|
HasTextDecorationLines = 1 << 0,
|
|
|
|
HasPseudoElementData = 1 << 1,
|
|
|
|
SuppressLineBreak = 1 << 2,
|
|
|
|
IsTextCombined = 1 << 3,
|
|
|
|
RelevantLinkVisited = 1 << 4,
|
|
|
|
};
|
|
|
|
|
|
|
|
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ComputedStyleBit)
|
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
class ComputedStyle
|
2018-03-22 22:04:20 +03:00
|
|
|
{
|
2018-05-24 18:49:24 +03:00
|
|
|
using Bit = ComputedStyleBit;
|
2018-03-22 22:04:20 +03:00
|
|
|
public:
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle(nsPresContext* aPresContext,
|
|
|
|
nsAtom* aPseudoTag,
|
|
|
|
CSSPseudoElementType aPseudoType,
|
|
|
|
ServoComputedDataForgotten aComputedValues);
|
|
|
|
|
2018-04-06 15:53:06 +03:00
|
|
|
// FIXME(emilio, bug 548397): This will need to go away. Don't add new callers
|
|
|
|
// of this methed.
|
|
|
|
nsPresContext* PresContextForFrame() const { return mPresContext; }
|
2018-03-22 21:20:41 +03:00
|
|
|
const ServoComputedData* ComputedData() const { return &mSource; }
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
// These two methods are for use by ArenaRefPtr.
|
2018-03-22 21:20:41 +03:00
|
|
|
//
|
|
|
|
// FIXME(emilio): Think this can go away.
|
2018-03-22 22:04:20 +03:00
|
|
|
static mozilla::ArenaObjectID ArenaObjectID()
|
|
|
|
{
|
2018-03-22 21:20:41 +03:00
|
|
|
return mozilla::eArenaObjectID_GeckoComputedStyle;
|
2018-03-22 22:04:20 +03:00
|
|
|
}
|
|
|
|
nsIPresShell* Arena();
|
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
void AddRef() { Servo_ComputedStyle_AddRef(this); }
|
|
|
|
void Release() { Servo_ComputedStyle_Release(this); }
|
2018-03-22 22:04:20 +03:00
|
|
|
|
2018-03-23 16:49:21 +03:00
|
|
|
// Return the ComputedStyle whose style data should be used for the R,
|
2018-03-22 21:20:41 +03:00
|
|
|
// G, and B components of color, background-color, and border-*-color
|
|
|
|
// if RelevantLinkIsVisited().
|
|
|
|
//
|
2018-03-23 16:49:21 +03:00
|
|
|
// GetPseudo() and GetPseudoType() on this ComputedStyle return the
|
2018-03-22 21:20:41 +03:00
|
|
|
// same as on |this|, and its depth in the tree (number of GetParent()
|
|
|
|
// calls until null is returned) is the same as |this|, since its
|
|
|
|
// parent is either |this|'s parent or |this|'s parent's
|
|
|
|
// style-if-visited.
|
|
|
|
//
|
|
|
|
// Structs on this context should never be examined without also
|
|
|
|
// examining the corresponding struct on |this|. Doing so will likely
|
|
|
|
// both (1) lead to a privacy leak and (2) lead to dynamic change bugs
|
|
|
|
// related to the Peek code in ComputedStyle::CalcStyleDifference.
|
|
|
|
ComputedStyle* GetStyleIfVisited() const
|
|
|
|
{
|
|
|
|
return ComputedData()->visited_style.mPtr;
|
|
|
|
}
|
2018-03-22 22:04:20 +03:00
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
bool IsLazilyCascadedPseudoElement() const
|
|
|
|
{
|
|
|
|
return IsPseudoElement() &&
|
|
|
|
!nsCSSPseudoElements::IsEagerlyCascadedInServo(GetPseudoType());
|
|
|
|
}
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
nsAtom* GetPseudo() const { return mPseudoTag; }
|
2018-05-24 18:49:24 +03:00
|
|
|
mozilla::CSSPseudoElementType GetPseudoType() const
|
|
|
|
{
|
|
|
|
return mPseudoType;
|
2018-03-22 22:04:20 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool IsInheritingAnonBox() const {
|
|
|
|
return GetPseudoType() == mozilla::CSSPseudoElementType::InheritingAnonBox;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsNonInheritingAnonBox() const {
|
|
|
|
return GetPseudoType() == mozilla::CSSPseudoElementType::NonInheritingAnonBox;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function is rather slow; you probably don't want to use it outside
|
|
|
|
// asserts unless you have to. We _could_ add a new CSSPseudoElementType for
|
|
|
|
// wrapper anon boxes, but that adds a bunch of complexity everywhere we
|
|
|
|
// resolve anonymous box styles...
|
|
|
|
bool IsWrapperAnonBox() const {
|
|
|
|
return nsCSSAnonBoxes::IsWrapperAnonBox(GetPseudo());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsAnonBox() const {
|
|
|
|
return IsInheritingAnonBox() || IsNonInheritingAnonBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsPseudoElement() const { return mPseudoTag && !IsAnonBox(); }
|
|
|
|
|
2018-03-23 16:49:21 +03:00
|
|
|
// Does this ComputedStyle or any of its ancestors have text
|
2018-03-22 22:04:20 +03:00
|
|
|
// decoration lines?
|
|
|
|
// Differs from nsStyleTextReset::HasTextDecorationLines, which tests
|
|
|
|
// only the data for a single context.
|
|
|
|
bool HasTextDecorationLines() const
|
2018-05-24 18:49:24 +03:00
|
|
|
{
|
|
|
|
return bool(mBits & Bit::HasTextDecorationLines);
|
|
|
|
}
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
// Whether any line break inside should be suppressed? If this returns
|
|
|
|
// true, the line should not be broken inside, which means inlines act
|
|
|
|
// as if nowrap is set, <br> is suppressed, and blocks are inlinized.
|
|
|
|
// This bit is propogated to all children of line partitipants. It is
|
|
|
|
// currently used by ruby to make its content frames unbreakable.
|
|
|
|
// NOTE: for nsTextFrame, use nsTextFrame::ShouldSuppressLineBreak()
|
|
|
|
// instead of this method.
|
|
|
|
bool ShouldSuppressLineBreak() const
|
2018-05-24 18:49:24 +03:00
|
|
|
{
|
|
|
|
return bool(mBits & Bit::SuppressLineBreak);
|
|
|
|
}
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
// Is this horizontal-in-vertical (tate-chu-yoko) text? This flag is
|
2018-08-15 08:46:39 +03:00
|
|
|
// only set on ComputedStyles whose pseudo is nsCSSAnonBoxes::mozText().
|
2018-03-22 22:04:20 +03:00
|
|
|
bool IsTextCombined() const
|
2018-05-24 18:49:24 +03:00
|
|
|
{
|
|
|
|
return bool(mBits & Bit::IsTextCombined);
|
|
|
|
}
|
2018-03-22 22:04:20 +03:00
|
|
|
|
2018-03-23 16:49:21 +03:00
|
|
|
// Does this ComputedStyle represent the style for a pseudo-element or
|
|
|
|
// inherit data from such a ComputedStyle? Whether this returns true
|
2018-03-22 22:04:20 +03:00
|
|
|
// is equivalent to whether it or any of its ancestors returns
|
|
|
|
// non-null for IsPseudoElement().
|
|
|
|
bool HasPseudoElementData() const
|
2018-05-24 18:49:24 +03:00
|
|
|
{
|
|
|
|
return bool(mBits & Bit::HasPseudoElementData);
|
|
|
|
}
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
// Is the only link whose visitedness is allowed to influence the
|
2018-03-23 16:49:21 +03:00
|
|
|
// style of the node this ComputedStyle is for (which is that element
|
2018-03-22 22:04:20 +03:00
|
|
|
// or its nearest ancestor that is a link) visited?
|
|
|
|
bool RelevantLinkVisited() const
|
2018-05-24 18:49:24 +03:00
|
|
|
{
|
|
|
|
return bool(mBits & Bit::RelevantLinkVisited);
|
|
|
|
}
|
2018-03-22 22:04:20 +03:00
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle* GetCachedInheritingAnonBoxStyle(nsAtom* aAnonBox) const
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(nsCSSAnonBoxes::IsInheritingAnonBox(aAnonBox));
|
|
|
|
return mCachedInheritingStyles.Lookup(aAnonBox);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetCachedInheritedAnonBoxStyle(nsAtom* aAnonBox, ComputedStyle* aStyle)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(!GetCachedInheritingAnonBoxStyle(aAnonBox));
|
|
|
|
mCachedInheritingStyles.Insert(aStyle);
|
|
|
|
}
|
|
|
|
|
|
|
|
ComputedStyle* GetCachedLazyPseudoStyle(CSSPseudoElementType aPseudo) const;
|
|
|
|
|
|
|
|
void SetCachedLazyPseudoStyle(ComputedStyle* aStyle)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aStyle->GetPseudo() && !aStyle->IsAnonBox());
|
|
|
|
MOZ_ASSERT(!GetCachedLazyPseudoStyle(aStyle->GetPseudoType()));
|
|
|
|
MOZ_ASSERT(!IsLazilyCascadedPseudoElement(), "lazy pseudos can't inherit lazy pseudos");
|
|
|
|
MOZ_ASSERT(aStyle->IsLazilyCascadedPseudoElement());
|
|
|
|
|
|
|
|
// Since we're caching lazy pseudo styles on the ComputedValues of the
|
|
|
|
// originating element, we can assume that we either have the same
|
|
|
|
// originating element, or that they were at least similar enough to share
|
|
|
|
// the same ComputedValues, which means that they would match the same
|
|
|
|
// pseudo rules. This allows us to avoid matching selectors and checking
|
|
|
|
// the rule node before deciding to share.
|
|
|
|
//
|
|
|
|
// The one place this optimization breaks is with pseudo-elements that
|
|
|
|
// support state (like :hover). So we just avoid sharing in those cases.
|
|
|
|
if (nsCSSPseudoElements::PseudoElementSupportsUserActionState(aStyle->GetPseudoType())) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mCachedInheritingStyles.Insert(aStyle);
|
|
|
|
}
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Define typesafe getter functions for each style struct by
|
|
|
|
* preprocessing the list of style structs. These functions are the
|
|
|
|
* preferred way to get style data. The macro creates functions like:
|
|
|
|
* const nsStyleBorder* StyleBorder();
|
|
|
|
* const nsStyleColor* StyleColor();
|
|
|
|
*/
|
2018-03-26 12:09:17 +03:00
|
|
|
#define STYLE_STRUCT(name_) \
|
2018-03-22 22:04:20 +03:00
|
|
|
inline const nsStyle##name_ * Style##name_() MOZ_NONNULL_RETURN;
|
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Equivalent to StyleFoo(), except that we skip the cache write during the
|
|
|
|
* servo traversal. This can cause incorrect behavior if used improperly,
|
|
|
|
* since we won't record that layout potentially depends on the values in
|
|
|
|
* this style struct. Use with care.
|
|
|
|
*/
|
|
|
|
|
2018-03-26 12:09:17 +03:00
|
|
|
#define STYLE_STRUCT(name_) \
|
2018-03-22 22:04:20 +03:00
|
|
|
inline const nsStyle##name_ * ThreadsafeStyle##name_();
|
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PeekStyle* is like Style* but doesn't trigger style
|
2018-03-23 16:49:21 +03:00
|
|
|
* computation if the data is not cached on either the ComputedStyle
|
2018-03-22 22:04:20 +03:00
|
|
|
* or the rule node.
|
|
|
|
*
|
2018-03-22 21:20:41 +03:00
|
|
|
* Perhaps this shouldn't be a public ComputedStyle API.
|
2018-03-22 22:04:20 +03:00
|
|
|
*/
|
2018-03-26 12:09:17 +03:00
|
|
|
#define STYLE_STRUCT(name_) \
|
2018-03-22 22:04:20 +03:00
|
|
|
inline const nsStyle##name_ * PeekStyle##name_();
|
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Compute the style changes needed during restyling when this style
|
|
|
|
* context is being replaced by aNewContext. (This is nonsymmetric since
|
|
|
|
* we optimize by skipping comparison for styles that have never been
|
|
|
|
* requested.)
|
|
|
|
*
|
|
|
|
* This method returns a change hint (see nsChangeHint.h). All change
|
|
|
|
* hints apply to the frame and its later continuations or ib-split
|
|
|
|
* siblings. Most (all of those except the "NotHandledForDescendants"
|
|
|
|
* hints) also apply to all descendants.
|
|
|
|
*
|
|
|
|
* aEqualStructs must not be null. Into it will be stored a bitfield
|
|
|
|
* representing which structs were compared to be non-equal.
|
|
|
|
*
|
2018-03-24 17:47:44 +03:00
|
|
|
* CSS Variables are not compared here. Instead, the caller is responsible for
|
2018-04-10 08:11:12 +03:00
|
|
|
* that when needed (basically only for elements).
|
2018-03-22 22:04:20 +03:00
|
|
|
*/
|
2018-03-22 21:20:41 +03:00
|
|
|
nsChangeHint CalcStyleDifference(ComputedStyle* aNewContext,
|
2018-03-24 17:47:44 +03:00
|
|
|
uint32_t* aEqualStructs);
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Get a color that depends on link-visitedness using this and
|
|
|
|
* this->GetStyleIfVisited().
|
|
|
|
*
|
|
|
|
* @param aField A pointer to a member variable in a style struct.
|
|
|
|
* The member variable and its style struct must have
|
|
|
|
* been listed in nsCSSVisitedDependentPropList.h.
|
|
|
|
*/
|
|
|
|
template<typename T, typename S>
|
|
|
|
nscolor GetVisitedDependentColor(T S::* aField);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* aColors should be a two element array of nscolor in which the first
|
|
|
|
* color is the unvisited color and the second is the visited color.
|
|
|
|
*
|
|
|
|
* Combine the R, G, and B components of whichever of aColors should
|
|
|
|
* be used based on aLinkIsVisited with the A component of aColors[0].
|
|
|
|
*/
|
2018-05-24 18:49:24 +03:00
|
|
|
static nscolor CombineVisitedColors(nscolor* aColors, bool aLinkIsVisited);
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
/**
|
2018-03-23 16:49:21 +03:00
|
|
|
* Start the background image loads for this ComputedStyle.
|
2018-03-22 22:04:20 +03:00
|
|
|
*/
|
|
|
|
inline void StartBackgroundImageLoads();
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
2018-03-24 07:50:14 +03:00
|
|
|
void List(FILE* out, int32_t aIndent);
|
2018-05-24 18:49:24 +03:00
|
|
|
static const char* StructName(StyleStructID aSID);
|
|
|
|
static Maybe<StyleStructID> LookupStruct(const nsACString& aName);
|
2018-03-22 22:04:20 +03:00
|
|
|
#endif
|
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
/**
|
|
|
|
* Makes this context match |aOther| in terms of which style structs have
|
|
|
|
* been resolved.
|
|
|
|
*/
|
|
|
|
inline void ResolveSameStructsAs(const ComputedStyle* aOther);
|
|
|
|
|
|
|
|
// The |aCVsSize| outparam on this function is where the actual CVs size
|
|
|
|
// value is added. It's done that way because the callers know which value
|
|
|
|
// the size should be added to.
|
2018-03-28 02:44:49 +03:00
|
|
|
void AddSizeOfIncludingThis(nsWindowSizes& aSizes, size_t* aCVsSize) const;
|
2018-03-22 21:20:41 +03:00
|
|
|
|
2018-03-22 22:04:20 +03:00
|
|
|
protected:
|
2018-05-24 18:49:24 +03:00
|
|
|
bool HasRequestedStruct(StyleStructID aID) const
|
|
|
|
{
|
|
|
|
return mRequestedStructs & StyleStructConstants::BitFor(aID);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetRequestedStruct(StyleStructID aID)
|
|
|
|
{
|
|
|
|
mRequestedStructs |= StyleStructConstants::BitFor(aID);
|
|
|
|
}
|
|
|
|
|
2018-03-26 00:50:35 +03:00
|
|
|
// Needs to be friend so that it can call the destructor without making it
|
|
|
|
// public.
|
|
|
|
friend void ::Gecko_ComputedStyle_Destroy(ComputedStyle*);
|
|
|
|
|
|
|
|
~ComputedStyle() = default;
|
2018-03-22 22:04:20 +03:00
|
|
|
|
2018-05-24 18:49:24 +03:00
|
|
|
nsPresContext* const mPresContext;
|
2018-03-22 21:20:41 +03:00
|
|
|
|
|
|
|
ServoComputedData mSource;
|
|
|
|
|
|
|
|
// A cache of anonymous box and lazy pseudo styles inheriting from this style.
|
|
|
|
CachedInheritingStyles mCachedInheritingStyles;
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
// Helper functions for GetStyle* and PeekStyle*
|
2018-03-26 12:09:17 +03:00
|
|
|
#define STYLE_STRUCT_INHERITED(name_) \
|
|
|
|
template<bool aComputeData> \
|
2018-03-22 22:04:20 +03:00
|
|
|
const nsStyle##name_ * DoGetStyle##name_();
|
2018-03-26 12:09:17 +03:00
|
|
|
#define STYLE_STRUCT_RESET(name_) \
|
|
|
|
template<bool aComputeData> \
|
2018-03-22 22:04:20 +03:00
|
|
|
const nsStyle##name_ * DoGetStyle##name_();
|
|
|
|
|
|
|
|
#include "nsStyleStructList.h"
|
|
|
|
#undef STYLE_STRUCT_RESET
|
|
|
|
#undef STYLE_STRUCT_INHERITED
|
|
|
|
|
2018-03-23 16:49:21 +03:00
|
|
|
// If this ComputedStyle is for a pseudo-element or anonymous box,
|
2018-03-22 22:04:20 +03:00
|
|
|
// the relevant atom.
|
2018-05-24 18:49:24 +03:00
|
|
|
const RefPtr<nsAtom> mPseudoTag;
|
|
|
|
|
|
|
|
// A bitfield with the structs that have been requested so far.
|
|
|
|
uint32_t mRequestedStructs = 0;
|
|
|
|
const Bit mBits;
|
|
|
|
const CSSPseudoElementType mPseudoType;
|
2018-03-22 22:04:20 +03:00
|
|
|
};
|
|
|
|
|
2018-03-22 21:20:41 +03:00
|
|
|
} // namespace mozilla
|
2018-03-22 22:04:20 +03:00
|
|
|
|
|
|
|
#endif
|