Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / layout / mathml / base / src / nsMathMLForeignFrameWrapper.h
blob9bd21b34c76d3d85f9d5a5e5ea46eb939b12d975
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is Mozilla MathML Project.
17 * The Initial Developer of the Original Code is
18 * The University Of Queensland.
19 * Portions created by the Initial Developer are Copyright (C) 1999
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Roger B. Sidje <rbs@maths.uq.edu.au>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
40 // a helper frame class to wrap non-MathML frames so that foreign elements
41 // (e.g., html:img) can mix better with other surrounding MathML markups
44 #ifndef nsMathMLForeignFrameWrapper_h___
45 #define nsMathMLForeignFrameWrapper_h___
47 #include "nsCOMPtr.h"
48 #include "nsMathMLContainerFrame.h"
50 class nsMathMLForeignFrameWrapper : public nsBlockFrame,
51 public nsMathMLFrame {
52 public:
53 friend nsIFrame* NS_NewMathMLForeignFrameWrapper(nsIPresShell* aPresShell, nsStyleContext* aContext);
55 NS_DECL_ISUPPORTS_INHERITED
57 // Overloaded nsIMathMLFrame methods
59 NS_IMETHOD
60 UpdatePresentationDataFromChildAt(PRInt32 aFirstIndex,
61 PRInt32 aLastIndex,
62 PRUint32 aFlagsValues,
63 PRUint32 aFlagsToUpdate)
65 nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(this,
66 aFirstIndex, aLastIndex, aFlagsValues, aFlagsToUpdate);
67 return NS_OK;
70 // overloaded nsBlockFrame methods
72 #ifdef NS_DEBUG
73 NS_IMETHOD
74 SetInitialChildList(nsIAtom* aListName,
75 nsIFrame* aChildList)
77 nsresult rv = nsBlockFrame::SetInitialChildList(aListName, aChildList);
78 // cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames
79 nsFrameList frameList(aChildList);
80 NS_ASSERTION(frameList.FirstChild() && frameList.GetLength() == 1,
81 "there must be one and only one child frame");
82 return rv;
84 #endif
86 NS_IMETHOD
87 Reflow(nsPresContext* aPresContext,
88 nsHTMLReflowMetrics& aDesiredSize,
89 const nsHTMLReflowState& aReflowState,
90 nsReflowStatus& aStatus);
92 // we are just a wrapper and these methods shouldn't be called
93 NS_IMETHOD
94 AppendFrames(nsIAtom* aListName,
95 nsIFrame* aFrameList)
97 NS_NOTREACHED("unsupported operation");
98 return NS_ERROR_NOT_IMPLEMENTED;
101 NS_IMETHOD
102 InsertFrames(nsIAtom* aListName,
103 nsIFrame* aPrevFrame,
104 nsIFrame* aFrameList)
106 NS_NOTREACHED("unsupported operation");
107 return NS_ERROR_NOT_IMPLEMENTED;
110 // Our life is bound to the life of our unique child.
111 // When our child goes away, we ask our parent to delete us
112 NS_IMETHOD
113 RemoveFrame(nsIAtom* aListName,
114 nsIFrame* aOldFrame)
116 return mParent->RemoveFrame(aListName, this);
119 protected:
120 nsMathMLForeignFrameWrapper(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
121 virtual ~nsMathMLForeignFrameWrapper() {}
124 #endif /* nsMathMLForeignFrameWrapper_h___ */