diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 07:29:57 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 07:29:57 -0400 |
commit | 010f37f47b9c15935a6113cd82e43f0673122016 (patch) | |
tree | ced1fbdc9767f6d87428f30331bf6305938a291e /layout/style/nsCSSRules.cpp | |
parent | 38056aa9c931ef7e769f7fd42613318dc8aeb77b (diff) | |
download | UXP-010f37f47b9c15935a6113cd82e43f0673122016.tar UXP-010f37f47b9c15935a6113cd82e43f0673122016.tar.gz UXP-010f37f47b9c15935a6113cd82e43f0673122016.tar.lz UXP-010f37f47b9c15935a6113cd82e43f0673122016.tar.xz UXP-010f37f47b9c15935a6113cd82e43f0673122016.zip |
Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]
Tag #1375
Diffstat (limited to 'layout/style/nsCSSRules.cpp')
-rw-r--r-- | layout/style/nsCSSRules.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp index 4b90b6f0c..dc79e471d 100644 --- a/layout/style/nsCSSRules.cpp +++ b/layout/style/nsCSSRules.cpp @@ -1515,6 +1515,13 @@ nsCSSFontFaceStyleDecl::GetParentObject() return ContainingRule()->GetDocument(); } +DocGroup* +nsCSSFontFaceStyleDecl::GetDocGroup() const +{ + nsIDocument* document = ContainingRule()->GetDocument(); + return document ? document->GetDocGroup() : nullptr; +} + JSObject* nsCSSFontFaceStyleDecl::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) { @@ -1991,6 +1998,17 @@ nsCSSKeyframeStyleDeclaration::GetParentObject() return mRule ? mRule->GetDocument() : nullptr; } +DocGroup* +nsCSSKeyframeStyleDeclaration::GetDocGroup() const +{ + if (!mRule) { + return nullptr; + } + + nsIDocument* document = mRule->GetDocument(); + return document ? document->GetDocGroup() : nullptr; +} + // ------------------------------------------- // nsCSSKeyframeRule // @@ -2538,6 +2556,17 @@ nsCSSPageStyleDeclaration::GetParentObject() return mRule ? mRule->GetDocument() : nullptr; } +DocGroup* +nsCSSPageStyleDeclaration::GetDocGroup() const +{ + if (!mRule) { + return nullptr; + } + + nsIDocument* document = mRule->GetDocument(); + return document ? document->GetDocGroup() : nullptr; +} + // ------------------------------------------- // nsCSSPageRule // |