From 793562e4dda6696baccc5974028fa1aefe355803 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 24 Feb 2016 18:01:12 +1100 Subject: [PATCH] Bug 1250377 - Part 2: Stub out enough ServoStyleSet methods to be able to create one for a document. r=bholley --- layout/style/ServoStyleSet.cpp | 20 ++++++++++++++------ layout/style/ServoStyleSet.h | 6 ++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 932727d21fa..f6e2689da15 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -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 diff --git a/layout/style/ServoStyleSet.h b/layout/style/ServoStyleSet.h index 97e40965a15..d5da8045d1c 100644 --- a/layout/style/ServoStyleSet.h +++ b/layout/style/ServoStyleSet.h @@ -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