gecko-dev/layout/style/ServoStyleContext.h
Emilio Cobos Álvarez 2477a4b823 Bug 1383307: Remove ServoStyleContext::UpdateWithElementState. r=manishearth
And kill one GetParentAllowServo call while at it, and some other dumbness...

MozReview-Commit-ID: GmvzXwGorlX
2017-07-23 23:56:39 +02:00

52 lines
1.4 KiB
C++

/* -*- 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 mozilla_ServoStyleContext_h
#define mozilla_ServoStyleContext_h
#include "nsStyleContext.h"
namespace mozilla {
namespace dom {
class Element;
} // namespace dom
class ServoStyleContext final : public nsStyleContext
{
public:
ServoStyleContext(nsStyleContext* aParent,
nsPresContext* aPresContext,
nsIAtom* aPseudoTag,
CSSPseudoElementType aPseudoType,
ServoComputedDataForgotten aComputedValues);
nsPresContext* PresContext() const { return mPresContext; }
const ServoComputedData* ComputedData() const { return &mSource; }
void AddRef() { Servo_StyleContext_AddRef(this); }
void Release() { Servo_StyleContext_Release(this); }
ServoStyleContext* GetStyleIfVisited() const
{
return ComputedData()->visited_style.mPtr;
}
/**
* Makes this context match |aOther| in terms of which style structs have
* been resolved.
*/
inline void ResolveSameStructsAs(const ServoStyleContext* aOther);
private:
nsPresContext* mPresContext;
ServoComputedData mSource;
};
} // namespace mozilla
#endif // mozilla_ServoStyleContext_h