зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1292432 part 7 - Move other WebIDL methods to StyleSheet. r=heycam
MozReview-Commit-ID: J0tXKbZvcEq --HG-- extra : source : c9cdb1228b36ffe102aad302f3c030c744c8fe26
This commit is contained in:
Родитель
acac5f6e5c
Коммит
2169694adb
|
@ -214,26 +214,19 @@ public:
|
|||
}
|
||||
|
||||
// WebIDL StyleSheet API
|
||||
CSSStyleSheet* GetParentStyleSheet() const { return mParent; }
|
||||
nsMediaList* Media();
|
||||
using GetParentStyleSheet;
|
||||
nsMediaList* Media() final;
|
||||
|
||||
// WebIDL CSSStyleSheet API
|
||||
// Can't be inline because we can't include ImportRule here. And can't be
|
||||
// called GetOwnerRule because that would be ambiguous with the ImportRule
|
||||
// version.
|
||||
nsIDOMCSSRule* GetDOMOwnerRule() const;
|
||||
nsIDOMCSSRule* GetDOMOwnerRule() const final;
|
||||
using StyleSheet::GetCssRules;
|
||||
using StyleSheet::InsertRule;
|
||||
using StyleSheet::DeleteRule;
|
||||
|
||||
// WebIDL miscellaneous bits
|
||||
dom::ParentObject GetParentObject() const {
|
||||
if (mOwningNode) {
|
||||
return dom::ParentObject(mOwningNode);
|
||||
}
|
||||
|
||||
return dom::ParentObject(static_cast<nsIDOMCSSStyleSheet*>(mParent), mParent);
|
||||
}
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
void WillDirty();
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
class nsIDocument;
|
||||
class nsINode;
|
||||
class nsIPrincipal;
|
||||
class nsMediaList;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -123,11 +124,14 @@ public:
|
|||
// The XPCOM GetType is fine for WebIDL.
|
||||
// The XPCOM GetHref is fine for WebIDL
|
||||
// GetOwnerNode is defined above.
|
||||
inline StyleSheet* GetParentStyleSheet() const;
|
||||
// The XPCOM GetTitle is fine for WebIDL.
|
||||
virtual nsMediaList* Media() = 0;
|
||||
bool Disabled() const { return mDisabled; }
|
||||
// The XPCOM SetDisabled is fine for WebIDL.
|
||||
|
||||
// WebIDL CSSStyleSheet API
|
||||
virtual nsIDOMCSSRule* GetDOMOwnerRule() const = 0;
|
||||
dom::CSSRuleList* GetCssRules(nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aRv);
|
||||
uint32_t InsertRule(const nsAString& aRule, uint32_t aIndex,
|
||||
|
@ -137,6 +141,9 @@ public:
|
|||
nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aRv);
|
||||
|
||||
// WebIDL miscellaneous bits
|
||||
inline dom::ParentObject GetParentObject() const;
|
||||
|
||||
// nsIDOMStyleSheet interface
|
||||
NS_IMETHOD GetType(nsAString& aType) final;
|
||||
NS_IMETHOD GetDisabled(bool* aDisabled) final;
|
||||
|
|
|
@ -106,6 +106,21 @@ StyleSheet::GetParentSheet() const
|
|||
MOZ_STYLO_FORWARD(GetParentSheet, ())
|
||||
}
|
||||
|
||||
StyleSheet*
|
||||
StyleSheet::GetParentStyleSheet() const
|
||||
{
|
||||
return GetParentSheet();
|
||||
}
|
||||
|
||||
dom::ParentObject
|
||||
StyleSheet::GetParentObject() const
|
||||
{
|
||||
if (mOwningNode) {
|
||||
return dom::ParentObject(mOwningNode);
|
||||
}
|
||||
return dom::ParentObject(GetParentSheet());
|
||||
}
|
||||
|
||||
void
|
||||
StyleSheet::AppendStyleSheet(StyleSheet* aSheet)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче