зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1551040 - Add const versions of Document casts. r=edgar
Depends on D101516 Differential Revision: https://phabricator.services.mozilla.com/D101517
This commit is contained in:
Родитель
ad1d2a73aa
Коммит
edf7671bfc
|
@ -3556,12 +3556,14 @@ class Document : public nsINode,
|
|||
* Defined inline in nsHTMLDocument.h
|
||||
*/
|
||||
inline nsHTMLDocument* AsHTMLDocument();
|
||||
inline const nsHTMLDocument* AsHTMLDocument() const;
|
||||
|
||||
/**
|
||||
* Asserts IsSVGDocument, and can't return null.
|
||||
* Defined inline in SVGDocument.h
|
||||
*/
|
||||
inline SVGDocument* AsSVGDocument();
|
||||
inline const SVGDocument* AsSVGDocument() const;
|
||||
|
||||
/*
|
||||
* Given a node, get a weak reference to it and append that reference to
|
||||
|
|
|
@ -202,6 +202,11 @@ inline nsHTMLDocument* Document::AsHTMLDocument() {
|
|||
return static_cast<nsHTMLDocument*>(this);
|
||||
}
|
||||
|
||||
inline const nsHTMLDocument* Document::AsHTMLDocument() const {
|
||||
MOZ_ASSERT(IsHTMLOrXHTML());
|
||||
return static_cast<const nsHTMLDocument*>(this);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -43,6 +43,11 @@ inline SVGDocument* Document::AsSVGDocument() {
|
|||
return static_cast<SVGDocument*>(this);
|
||||
}
|
||||
|
||||
inline const SVGDocument* Document::AsSVGDocument() const {
|
||||
MOZ_ASSERT(IsSVGDocument());
|
||||
return static_cast<const SVGDocument*>(this);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче