Bug 1250377 - Part 2: Stub out enough ServoStyleSet methods to be able to create one for a document. r=bholley

This commit is contained in:
Cameron McCormack 2016-02-24 18:01:12 +11:00
parent 6bafe776a2
commit 793562e4dd
2 changed files with 20 additions and 6 deletions

View File

@ -11,28 +11,30 @@
using namespace mozilla;
using namespace mozilla::dom;
ServoStyleSet::ServoStyleSet()
: mBatching(0)
{
}
void
ServoStyleSet::Init(nsPresContext* aPresContext)
{
MOZ_CRASH("stylo: not implemented");
}
void
ServoStyleSet::BeginShutdown()
{
MOZ_CRASH("stylo: not implemented");
}
void
ServoStyleSet::Shutdown()
{
MOZ_CRASH("stylo: not implemented");
}
bool
ServoStyleSet::GetAuthorStyleDisabled() const
{
MOZ_CRASH("stylo: not implemented");
return false;
}
nsresult
@ -44,13 +46,19 @@ ServoStyleSet::SetAuthorStyleDisabled(bool aStyleDisabled)
void
ServoStyleSet::BeginUpdate()
{
MOZ_CRASH("stylo: not implemented");
++mBatching;
}
nsresult
ServoStyleSet::EndUpdate()
{
MOZ_CRASH("stylo: not implemented");
MOZ_ASSERT(mBatching > 0);
if (--mBatching > 0) {
return NS_OK;
}
// ... do something ...
return NS_OK;
}
// resolve a style context

View File

@ -22,6 +22,7 @@ class Element;
class CSSStyleSheet;
class ServoStyleSheet;
} // namespace mozilla
class nsIDocument;
class nsStyleContext;
class nsPresContext;
struct TreeMatchContext;
@ -35,6 +36,8 @@ namespace mozilla {
class ServoStyleSet
{
public:
ServoStyleSet();
void Init(nsPresContext* aPresContext);
void BeginShutdown();
void Shutdown();
@ -105,6 +108,9 @@ public:
mozilla::CSSPseudoElementType aPseudoType,
dom::Element* aPseudoElement,
EventStates aStateMask);
private:
int32_t mBatching;
};
} // namespace mozilla