зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1315601 part 14 - Add InsertRuleIntoGroup support to ServoStyleSheet. r=heycam
MozReview-Commit-ID: GUHtvjQXECW --HG-- extra : rebase_source : dadf70886038ae4d1d62945ee4f4fbc4a3e756aa
This commit is contained in:
Родитель
50cd42411d
Коммит
4e903ddf5c
|
@ -24,6 +24,7 @@ class ServoCSSRuleList final : public dom::CSSRuleList
|
|||
{
|
||||
public:
|
||||
explicit ServoCSSRuleList(already_AddRefed<ServoCssRules> aRawRules);
|
||||
css::GroupRule* GetParentRule() const { return mParentRule; }
|
||||
void SetParentRule(css::GroupRule* aParentRule);
|
||||
void SetStyleSheet(StyleSheet* aSheet);
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "mozilla/StyleBackendType.h"
|
||||
#include "mozilla/ServoBindings.h"
|
||||
#include "mozilla/ServoCSSRuleList.h"
|
||||
#include "mozilla/css/GroupRule.h"
|
||||
#include "mozilla/dom/CSSRuleList.h"
|
||||
|
||||
#include "mozAutoDocUpdate.h"
|
||||
|
@ -202,4 +203,14 @@ ServoStyleSheet::DeleteRuleInternal(uint32_t aIndex, ErrorResult& aRv)
|
|||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
ServoStyleSheet::InsertRuleIntoGroupInternal(const nsAString& aRule,
|
||||
css::GroupRule* aGroup,
|
||||
uint32_t aIndex)
|
||||
{
|
||||
auto rules = static_cast<ServoCSSRuleList*>(aGroup->CssRules());
|
||||
MOZ_ASSERT(rules->GetParentRule() == aGroup);
|
||||
return rules->InsertRule(aRule, aIndex);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -103,6 +103,9 @@ protected:
|
|||
uint32_t InsertRuleInternal(const nsAString& aRule,
|
||||
uint32_t aIndex, ErrorResult& aRv);
|
||||
void DeleteRuleInternal(uint32_t aIndex, ErrorResult& aRv);
|
||||
nsresult InsertRuleIntoGroupInternal(const nsAString& aRule,
|
||||
css::GroupRule* aGroup,
|
||||
uint32_t aIndex);
|
||||
|
||||
void EnabledStateChangedInternal() {}
|
||||
|
||||
|
|
|
@ -473,8 +473,7 @@ StyleSheet::InsertRuleIntoGroup(const nsAString& aRule,
|
|||
if (IsGecko()) {
|
||||
result = AsGecko()->InsertRuleIntoGroupInternal(aRule, aGroup, aIndex);
|
||||
} else {
|
||||
// TODO
|
||||
result = NS_ERROR_NOT_IMPLEMENTED;
|
||||
result = AsServo()->InsertRuleIntoGroupInternal(aRule, aGroup, aIndex);
|
||||
}
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче