Bug 985303. Part 1: Assert that nsViews are only associated with a specific, limited set of frame types. r=dbaron

--HG--
extra : rebase_source : 80ce9f2e4841b831fd37acf2b89d4ff350762ab8
This commit is contained in:
Robert O'Callahan 2014-04-03 04:24:58 -04:00
parent 84543bbdaa
commit 5ceb341697

View File

@ -4478,6 +4478,17 @@ nsIFrame::SetView(nsView* aView)
if (aView) { if (aView) {
aView->SetFrame(this); aView->SetFrame(this);
#ifdef DEBUG
nsIAtom* frameType = GetType();
NS_ASSERTION(frameType == nsGkAtoms::scrollFrame ||
frameType == nsGkAtoms::subDocumentFrame ||
frameType == nsGkAtoms::listControlFrame ||
frameType == nsGkAtoms::objectFrame ||
frameType == nsGkAtoms::viewportFrame ||
frameType == nsGkAtoms::menuPopupFrame,
"Only specific frame types can have an nsView");
#endif
// Set a property on the frame // Set a property on the frame
Properties().Set(ViewProperty(), aView); Properties().Set(ViewProperty(), aView);