зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1329093 - Part 3: Overload FromContent() to work with const; r=bz
MozReview-Commit-ID: BUFmPtcf6LM
This commit is contained in:
Родитель
07fc7c5b25
Коммит
bae202bd4f
|
@ -1037,7 +1037,15 @@ inline nsIContent* nsINode::AsContent()
|
|||
{ \
|
||||
return aContent->_check ? static_cast<_class*>(aContent) : nullptr; \
|
||||
} \
|
||||
static const _class* FromContent(const nsIContent* aContent) \
|
||||
{ \
|
||||
return aContent->_check ? static_cast<const _class*>(aContent) : nullptr; \
|
||||
} \
|
||||
static _class* FromContentOrNull(nsIContent* aContent) \
|
||||
{ \
|
||||
return aContent ? FromContent(aContent) : nullptr; \
|
||||
} \
|
||||
static const _class* FromContentOrNull(const nsIContent* aContent) \
|
||||
{ \
|
||||
return aContent ? FromContent(aContent) : nullptr; \
|
||||
}
|
||||
|
|
|
@ -373,7 +373,7 @@ Gecko_GetHTMLPresentationAttrDeclarationBlock(RawGeckoElementBorrowed aElement)
|
|||
"RefPtr should just be a pointer");
|
||||
const nsMappedAttributes* attrs = aElement->GetMappedAttributes();
|
||||
if (!attrs) {
|
||||
auto* svg = nsSVGElement::FromContentOrNull(const_cast<dom::Element*>(aElement));
|
||||
auto* svg = nsSVGElement::FromContentOrNull(aElement);
|
||||
if (svg) {
|
||||
if (auto decl = svg->GetContentDeclarationBlock()) {
|
||||
return decl->AsServo()->RefRawStrong();
|
||||
|
|
Загрузка…
Ссылка в новой задаче