mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]
Tag #1375
This commit is contained in:
parent
fc8fcfc039
commit
ca09afd0b0
30 changed files with 206 additions and 44 deletions
|
|
@ -31,6 +31,9 @@ class nsHTMLCopyEncoder;
|
|||
namespace mozilla {
|
||||
class ErrorResult;
|
||||
struct AutoPrepareFocusRange;
|
||||
namespace dom {
|
||||
class DocGroup;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
struct RangeData
|
||||
|
|
@ -73,6 +76,7 @@ public:
|
|||
nsresult EndBatchChangesInternal(int16_t aReason = nsISelectionListener::NO_REASON);
|
||||
|
||||
nsIDocument* GetParentObject() const;
|
||||
DocGroup* GetDocGroup() const;
|
||||
|
||||
// utility methods for scrolling the selection into view
|
||||
nsPresContext* GetPresContext() const;
|
||||
|
|
|
|||
|
|
@ -3521,6 +3521,18 @@ Selection::GetParentObject() const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
DocGroup*
|
||||
Selection::GetDocGroup() const
|
||||
{
|
||||
nsIPresShell* shell = GetPresShell();
|
||||
if (!shell) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIDocument* doc = shell->GetDocument();
|
||||
return doc ? doc->GetDocGroup() : nullptr;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(Selection)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Selection)
|
||||
|
|
|
|||
|
|
@ -1078,6 +1078,16 @@ public:
|
|||
return mRule ? mRule->GetDocument() : nullptr;
|
||||
}
|
||||
|
||||
virtual DocGroup* GetDocGroup() const override
|
||||
{
|
||||
if (!mRule) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIDocument* document = mRule->GetDocument();
|
||||
return document ? document->GetDocGroup() : nullptr;
|
||||
}
|
||||
|
||||
friend class css::DOMCSSStyleRule;
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
//
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@ class nsMediaList;
|
|||
|
||||
namespace mozilla {
|
||||
|
||||
namespace dom {
|
||||
class DocGroup;
|
||||
class DocGroup;
|
||||
} // namespace dom
|
||||
|
||||
class ErrorResult;
|
||||
|
||||
namespace css {
|
||||
|
|
@ -209,6 +214,7 @@ public:
|
|||
using nsICSSDeclaration::GetPropertyCSSValue;
|
||||
|
||||
virtual nsINode *GetParentObject() override;
|
||||
virtual mozilla::dom::DocGroup* GetDocGroup() const override;
|
||||
virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) override;
|
||||
|
||||
nsresult GetPropertyValue(nsCSSFontDesc aFontDescID,
|
||||
|
|
@ -366,6 +372,7 @@ public:
|
|||
nsICSSDeclaration)
|
||||
|
||||
virtual nsINode* GetParentObject() override;
|
||||
virtual mozilla::dom::DocGroup* GetDocGroup() const override;
|
||||
|
||||
protected:
|
||||
virtual ~nsCSSKeyframeStyleDeclaration();
|
||||
|
|
@ -496,6 +503,7 @@ public:
|
|||
nsICSSDeclaration)
|
||||
|
||||
virtual nsINode *GetParentObject() override;
|
||||
virtual mozilla::dom::DocGroup* GetDocGroup() const override;
|
||||
|
||||
protected:
|
||||
virtual ~nsCSSPageStyleDeclaration();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class DocGroup;
|
||||
class Element;
|
||||
} // namespace dom
|
||||
struct ComputedGridTrackInfo;
|
||||
|
|
@ -84,6 +85,11 @@ public:
|
|||
return mElement;
|
||||
}
|
||||
|
||||
virtual mozilla::dom::DocGroup* GetDocGroup() const override
|
||||
{
|
||||
return mElement ? mElement->GetDocGroup() : nullptr;
|
||||
}
|
||||
|
||||
static already_AddRefed<nsStyleContext>
|
||||
GetStyleContextForElement(mozilla::dom::Element* aElement, nsIAtom* aPseudo,
|
||||
nsIPresShell* aPresShell,
|
||||
|
|
|
|||
|
|
@ -178,6 +178,12 @@ nsDOMCSSAttributeDeclaration::GetParentObject()
|
|||
return mElement;
|
||||
}
|
||||
|
||||
/* virtual */ DocGroup*
|
||||
nsDOMCSSAttributeDeclaration::GetDocGroup() const
|
||||
{
|
||||
return mElement ? mElement->OwnerDoc()->GetDocGroup() : nullptr;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMCSSAttributeDeclaration::SetPropertyValue(const nsCSSPropertyID aPropID,
|
||||
const nsAString& aValue)
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public:
|
|||
NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent) override;
|
||||
|
||||
virtual nsINode* GetParentObject() override;
|
||||
virtual DocGroup* GetDocGroup() const override;
|
||||
|
||||
NS_IMETHOD SetPropertyValue(const nsCSSPropertyID aPropID,
|
||||
const nsAString& aValue) override;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@
|
|||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsINode;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class DocGroup;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
// dbeabbfa-6cb3-4f5c-aec2-dd558d9d681f
|
||||
#define NS_ICSSDECLARATION_IID \
|
||||
|
|
@ -62,6 +67,7 @@ public:
|
|||
const nsAString& aValue) = 0;
|
||||
|
||||
virtual nsINode *GetParentObject() = 0;
|
||||
virtual mozilla::dom::DocGroup* GetDocGroup() const = 0;
|
||||
|
||||
// Also have to declare all the nsIDOMCSSStyleDeclaration methods,
|
||||
// since we want to be able to call them from the WebIDL versions.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue