2017-03-14 10:50:28 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_CSSNamespaceRule_h
|
|
|
|
#define mozilla_dom_CSSNamespaceRule_h
|
|
|
|
|
|
|
|
#include "mozilla/css/Rule.h"
|
|
|
|
#include "mozilla/dom/CSSNamespaceRuleBinding.h"
|
2018-06-01 13:35:39 +03:00
|
|
|
#include "mozilla/ServoBindingTypes.h"
|
2017-03-14 10:50:28 +03:00
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
class nsAtom;
|
2017-03-14 10:50:28 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-06-01 13:35:39 +03:00
|
|
|
class CSSNamespaceRule final : public css::Rule {
|
2017-03-14 10:50:28 +03:00
|
|
|
public:
|
2018-06-01 13:35:39 +03:00
|
|
|
CSSNamespaceRule(already_AddRefed<RawServoNamespaceRule> aRule,
|
2018-06-29 05:56:09 +03:00
|
|
|
StyleSheet* aSheet, css::Rule* aParentRule, uint32_t aLine,
|
|
|
|
uint32_t aColumn)
|
|
|
|
: css::Rule(aSheet, aParentRule, aLine, aColumn),
|
2018-06-01 13:35:39 +03:00
|
|
|
mRawRule(std::move(aRule)) {}
|
|
|
|
|
2018-02-06 09:46:57 +03:00
|
|
|
bool IsCCLeaf() const final { return Rule::IsCCLeaf(); }
|
2017-03-14 10:50:28 +03:00
|
|
|
|
2018-06-01 13:35:39 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
void List(FILE* out = stdout, int32_t aIndent = 0) const final;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
nsAtom* GetPrefix() const;
|
|
|
|
void GetURLSpec(nsString& aURLSpec) const;
|
|
|
|
|
|
|
|
// WebIDL interface
|
2020-12-17 17:04:35 +03:00
|
|
|
void GetCssText(nsACString& aCssText) const final;
|
2017-03-14 10:50:28 +03:00
|
|
|
|
2021-09-08 14:18:32 +03:00
|
|
|
StyleCssRuleType Type() const final;
|
2018-06-01 13:35:39 +03:00
|
|
|
|
2020-08-10 21:00:44 +03:00
|
|
|
const RawServoNamespaceRule* Raw() const { return mRawRule.get(); }
|
2021-07-20 16:17:02 +03:00
|
|
|
void SetRawAfterClone(RefPtr<RawServoNamespaceRule>);
|
2020-08-10 21:00:44 +03:00
|
|
|
|
2017-12-21 04:17:37 +03:00
|
|
|
void GetNamespaceURI(nsString& aNamespaceURI) { GetURLSpec(aNamespaceURI); }
|
2018-06-01 13:35:39 +03:00
|
|
|
|
2017-12-21 04:17:37 +03:00
|
|
|
void GetPrefix(DOMString& aPrefix) {
|
2017-12-22 21:02:51 +03:00
|
|
|
aPrefix.SetKnownLiveAtom(GetPrefix(), DOMString::eTreatNullAsEmpty);
|
2017-12-21 04:17:37 +03:00
|
|
|
}
|
2017-03-14 10:50:28 +03:00
|
|
|
|
2018-06-01 13:35:39 +03:00
|
|
|
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const final;
|
2017-03-14 10:50:28 +03:00
|
|
|
|
|
|
|
JSObject* WrapObject(JSContext* aCx,
|
2018-02-06 09:46:57 +03:00
|
|
|
JS::Handle<JSObject*> aGivenProto) final {
|
2018-06-26 00:20:54 +03:00
|
|
|
return CSSNamespaceRule_Binding::Wrap(aCx, this, aGivenProto);
|
2017-03-14 10:50:28 +03:00
|
|
|
}
|
2018-06-01 13:35:39 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
~CSSNamespaceRule();
|
|
|
|
RefPtr<RawServoNamespaceRule> mRawRule;
|
2017-03-14 10:50:28 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_CSSNamespaceRule_h
|