зеркало из https://github.com/mozilla/gecko-dev.git
Bug 856243 - Add missing do_QueryFrame support. r=dholbert
This commit is contained in:
Родитель
d82140fe1a
Коммит
333122f564
|
@ -142,6 +142,7 @@ protected:
|
|||
class nsHTMLFramesetBlankFrame : public nsLeafFrame
|
||||
{
|
||||
public:
|
||||
NS_DECL_QUERYFRAME_TARGET(nsHTMLFramesetBlankFrame)
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
typedef mozilla::layers::LayerManager LayerManager;
|
||||
typedef mozilla::FrameLayerBuilder::ContainerParameters ContainerParameters;
|
||||
|
||||
NS_DECL_QUERYFRAME_TARGET(nsHTMLCanvasFrame)
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
nsHTMLCanvasFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
#include "nscore.h"
|
||||
|
||||
#define NS_DECL_QUERYFRAME_TARGET(classname) \
|
||||
static const nsQueryFrame::FrameIID kFrameIID = nsQueryFrame::classname##_id;
|
||||
static const nsQueryFrame::FrameIID kFrameIID = nsQueryFrame::classname##_id; \
|
||||
typedef classname* Has_NS_DECL_QUERYFRAME_TARGET;
|
||||
|
||||
#define NS_DECL_QUERYFRAME \
|
||||
virtual void* QueryFrame(FrameIID id);
|
||||
|
@ -63,9 +64,10 @@ public:
|
|||
|
||||
template<class Dest>
|
||||
operator Dest*() {
|
||||
if (!mRawPtr)
|
||||
return nullptr;
|
||||
|
||||
if (!mRawPtr) {
|
||||
// Ensure that Dest declared itself as a queryframe target.
|
||||
return static_cast<typename Dest::Has_NS_DECL_QUERYFRAME_TARGET>(nullptr);
|
||||
}
|
||||
return reinterpret_cast<Dest*>(mRawPtr->QueryFrame(Dest::kFrameIID));
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче