From 1300727b08605499c528c4d8cb9b8b5ce92c4d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 16 Feb 2018 18:55:27 +0100 Subject: [PATCH] Bug 1438911: Avoid doing changeset changes off a runnable for stylo. r=bz MozReview-Commit-ID: Kgu9OxjtY5v --HG-- extra : rebase_source : ae14355731b10c026f526b564d7eee23a57d2da5 --- layout/base/nsPresContext.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index e4a45f7c6482..9197535068a4 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -126,6 +126,8 @@ public: nsPresContext* mPresContext; }; +#ifdef MOZ_OLD_STYLE + namespace { class CharSetChangingRunnable : public Runnable @@ -152,6 +154,8 @@ private: } // namespace +#endif + nscolor nsPresContext::MakeColorPref(const nsString& aColor) { @@ -1162,9 +1166,16 @@ nsPresContext::UpdateCharSet(NotNull aCharSet) void nsPresContext::DispatchCharSetChange(NotNull aEncoding) { - RefPtr runnable = - new CharSetChangingRunnable(this, aEncoding); - Document()->Dispatch(TaskCategory::Other, runnable.forget()); +#ifdef MOZ_OLD_STYLE + if (!Document()->IsStyledByServo()) { + RefPtr runnable = + new CharSetChangingRunnable(this, aEncoding); + Document()->Dispatch(TaskCategory::Other, runnable.forget()); + return; + } +#endif + // In Servo RebuildAllStyleData is async, so no need to do the runnable dance. + DoChangeCharSet(aEncoding); } nsPresContext*