зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1408311 - Part 2: Add GetDeclarationBlock method to BindingStyleRule. r=xidorn
MozReview-Commit-ID: 5adkbeTOHQU --HG-- extra : rebase_source : 67d196ac36b5f6daca8e20f6ec6063b3f2f8c84d
This commit is contained in:
Родитель
bbdc9e9e0f
Коммит
6e9ab08423
|
@ -9,6 +9,7 @@
|
|||
#include "nscore.h"
|
||||
#include "nsStringGlue.h"
|
||||
#include "mozilla/css/Rule.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
|
||||
/**
|
||||
* Shared superclass for mozilla::css::StyleRule and mozilla::ServoStyleRule,
|
||||
|
@ -18,6 +19,7 @@
|
|||
class nsICSSDeclaration;
|
||||
|
||||
namespace mozilla {
|
||||
class DeclarationBlock;
|
||||
namespace dom {
|
||||
class Element;
|
||||
}
|
||||
|
@ -54,6 +56,7 @@ public:
|
|||
uint32_t aSelectorIndex,
|
||||
const nsAString& aPseudo,
|
||||
bool* aMatches) = 0;
|
||||
virtual NotNull<DeclarationBlock*> GetDeclarationBlock() const = 0;
|
||||
|
||||
// WebIDL API
|
||||
// For GetSelectorText/SetSelectorText, we purposefully use a signature that
|
||||
|
|
|
@ -298,4 +298,10 @@ ServoStyleRule::SelectorMatchesElement(Element* aElement,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NotNull<DeclarationBlock*>
|
||||
ServoStyleRule::GetDeclarationBlock() const
|
||||
{
|
||||
return WrapNotNull(mDecls.mDecls);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
uint32_t aSelectorIndex,
|
||||
const nsAString& aPseudo,
|
||||
bool* aMatches) override;
|
||||
NotNull<DeclarationBlock*> GetDeclarationBlock() const override;
|
||||
|
||||
// WebIDL interface
|
||||
uint16_t Type() const final;
|
||||
|
|
|
@ -1513,5 +1513,11 @@ StyleRule::SelectorMatchesElement(Element* aElement,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NotNull<DeclarationBlock*>
|
||||
StyleRule::GetDeclarationBlock() const
|
||||
{
|
||||
return WrapNotNull(mDeclaration);
|
||||
}
|
||||
|
||||
} // namespace css
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -347,6 +347,7 @@ public:
|
|||
uint32_t aSelectorIndex,
|
||||
const nsAString& aPseudo,
|
||||
bool* aMatches) override;
|
||||
mozilla::NotNull<DeclarationBlock*> GetDeclarationBlock() const override;
|
||||
|
||||
// WebIDL interface
|
||||
uint16_t Type() const override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче