зеркало из 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:
Родитель
8798b5286b
Коммит
91d84e11c8
|
@ -3556,12 +3556,14 @@ class Document : public nsINode,
|
||||||
* Defined inline in nsHTMLDocument.h
|
* Defined inline in nsHTMLDocument.h
|
||||||
*/
|
*/
|
||||||
inline nsHTMLDocument* AsHTMLDocument();
|
inline nsHTMLDocument* AsHTMLDocument();
|
||||||
|
inline const nsHTMLDocument* AsHTMLDocument() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts IsSVGDocument, and can't return null.
|
* Asserts IsSVGDocument, and can't return null.
|
||||||
* Defined inline in SVGDocument.h
|
* Defined inline in SVGDocument.h
|
||||||
*/
|
*/
|
||||||
inline SVGDocument* AsSVGDocument();
|
inline SVGDocument* AsSVGDocument();
|
||||||
|
inline const SVGDocument* AsSVGDocument() const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given a node, get a weak reference to it and append that reference to
|
* 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);
|
return static_cast<nsHTMLDocument*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const nsHTMLDocument* Document::AsHTMLDocument() const {
|
||||||
|
MOZ_ASSERT(IsHTMLOrXHTML());
|
||||||
|
return static_cast<const nsHTMLDocument*>(this);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,11 @@ inline SVGDocument* Document::AsSVGDocument() {
|
||||||
return static_cast<SVGDocument*>(this);
|
return static_cast<SVGDocument*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const SVGDocument* Document::AsSVGDocument() const {
|
||||||
|
MOZ_ASSERT(IsSVGDocument());
|
||||||
|
return static_cast<const SVGDocument*>(this);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace dom
|
} // namespace dom
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче