Bug 508665 - part 1, Change the signature of SetParent/GetParent from nsIFrame* to nsContainerFrame*. r=roc
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include "gfxFont.h"
|
#include "gfxFont.h"
|
||||||
#include "nsFontMetrics.h"
|
#include "nsFontMetrics.h"
|
||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
|
#include "nsContainerFrame.h"
|
||||||
#include "HyperTextAccessible.h"
|
#include "HyperTextAccessible.h"
|
||||||
#include "mozilla/AppUnits.h"
|
#include "mozilla/AppUnits.h"
|
||||||
#include "mozilla/gfx/2D.h"
|
#include "mozilla/gfx/2D.h"
|
||||||
@@ -364,7 +365,7 @@ TextAttrsMgr::BGColorTextAttr::
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame *parentFrame = aFrame->GetParent();
|
nsContainerFrame *parentFrame = aFrame->GetParent();
|
||||||
if (!parentFrame) {
|
if (!parentFrame) {
|
||||||
*aColor = aFrame->PresContext()->DefaultBackgroundColor();
|
*aColor = aFrame->PresContext()->DefaultBackgroundColor();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "nsFocusManager.h"
|
#include "nsFocusManager.h"
|
||||||
#include "nsIDOMRange.h"
|
#include "nsIDOMRange.h"
|
||||||
#include "nsIEditingSession.h"
|
#include "nsIEditingSession.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsFrameSelection.h"
|
#include "nsFrameSelection.h"
|
||||||
#include "nsILineIterator.h"
|
#include "nsILineIterator.h"
|
||||||
#include "nsIInterfaceRequestorUtils.h"
|
#include "nsIInterfaceRequestorUtils.h"
|
||||||
@@ -1257,7 +1257,7 @@ HyperTextAccessible::CaretLineNumber()
|
|||||||
if (hyperTextContent == caretFrame->GetContent()) {
|
if (hyperTextContent == caretFrame->GetContent()) {
|
||||||
return lineNumber; // Must be in a single line hyper text, there is no line iterator
|
return lineNumber; // Must be in a single line hyper text, there is no line iterator
|
||||||
}
|
}
|
||||||
nsIFrame *parentFrame = caretFrame->GetParent();
|
nsContainerFrame *parentFrame = caretFrame->GetParent();
|
||||||
if (!parentFrame)
|
if (!parentFrame)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "mozilla/dom/HTMLOptionElement.h"
|
#include "mozilla/dom/HTMLOptionElement.h"
|
||||||
#include "nsIComboboxControlFrame.h"
|
#include "nsIComboboxControlFrame.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIListControlFrame.h"
|
#include "nsIListControlFrame.h"
|
||||||
|
|
||||||
using namespace mozilla::a11y;
|
using namespace mozilla::a11y;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include "nsIScriptGlobalObject.h"
|
#include "nsIScriptGlobalObject.h"
|
||||||
#include "nsIURL.h"
|
#include "nsIURL.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIAnonymousContentCreator.h"
|
#include "nsIAnonymousContentCreator.h"
|
||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
#include "nsPresContext.h"
|
#include "nsPresContext.h"
|
||||||
@@ -218,7 +218,7 @@ nsIContent::UpdateEditableState(bool aNotify)
|
|||||||
if (root) {
|
if (root) {
|
||||||
nsIFrame* rootFrame = root->GetPrimaryFrame();
|
nsIFrame* rootFrame = root->GetPrimaryFrame();
|
||||||
if (rootFrame) {
|
if (rootFrame) {
|
||||||
nsIFrame* parentFrame = rootFrame->GetParent();
|
nsContainerFrame* parentFrame = rootFrame->GetParent();
|
||||||
nsITextControlFrame* textCtrl = do_QueryFrame(parentFrame);
|
nsITextControlFrame* textCtrl = do_QueryFrame(parentFrame);
|
||||||
isUnknownNativeAnon = !textCtrl;
|
isUnknownNativeAnon = !textCtrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
#include "nsIFormControl.h"
|
#include "nsIFormControl.h"
|
||||||
#include "nsIForm.h"
|
#include "nsIForm.h"
|
||||||
#include "nsIFragmentContentSink.h"
|
#include "nsIFragmentContentSink.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIHTMLDocument.h"
|
#include "nsIHTMLDocument.h"
|
||||||
#include "nsIIdleService.h"
|
#include "nsIIdleService.h"
|
||||||
#include "nsIImageLoadingContent.h"
|
#include "nsIImageLoadingContent.h"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsNodeInfoManager.h"
|
#include "nsNodeInfoManager.h"
|
||||||
#include "mozilla/MouseEvents.h"
|
#include "mozilla/MouseEvents.h"
|
||||||
#include "nsContentPolicyUtils.h"
|
#include "nsContentPolicyUtils.h"
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#include "nsScriptLoader.h"
|
#include "nsScriptLoader.h"
|
||||||
#include "nsRuleData.h"
|
#include "nsRuleData.h"
|
||||||
#include "nsIPrincipal.h"
|
#include "nsIPrincipal.h"
|
||||||
|
#include "nsContainerFrame.h"
|
||||||
|
|
||||||
#include "nsPresState.h"
|
#include "nsPresState.h"
|
||||||
#include "nsILayoutHistoryState.h"
|
#include "nsILayoutHistoryState.h"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "ActiveLayerTracker.h"
|
#include "ActiveLayerTracker.h"
|
||||||
|
|
||||||
#include "nsExpirationTracker.h"
|
#include "nsExpirationTracker.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsRefreshDriver.h"
|
#include "nsRefreshDriver.h"
|
||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "nsDataHashtable.h"
|
#include "nsDataHashtable.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "mozilla/SplayTree.h"
|
#include "mozilla/SplayTree.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
#include "RestyleManager.h"
|
#include "RestyleManager.h"
|
||||||
#include "StickyScrollContainer.h"
|
#include "StickyScrollContainer.h"
|
||||||
#include "nsFieldSetFrame.h"
|
#include "nsFieldSetFrame.h"
|
||||||
|
#include "nsInlineFrame.h"
|
||||||
|
|
||||||
#ifdef MOZ_XUL
|
#ifdef MOZ_XUL
|
||||||
#include "nsIRootBox.h"
|
#include "nsIRootBox.h"
|
||||||
@@ -413,7 +414,7 @@ AnyKidsNeedBlockParent(nsIFrame *aFrameList)
|
|||||||
// Reparent a frame into a wrapper frame that is a child of its old parent.
|
// Reparent a frame into a wrapper frame that is a child of its old parent.
|
||||||
static void
|
static void
|
||||||
ReparentFrame(RestyleManager* aRestyleManager,
|
ReparentFrame(RestyleManager* aRestyleManager,
|
||||||
nsIFrame* aNewParentFrame,
|
nsContainerFrame* aNewParentFrame,
|
||||||
nsIFrame* aFrame)
|
nsIFrame* aFrame)
|
||||||
{
|
{
|
||||||
aFrame->SetParent(aNewParentFrame);
|
aFrame->SetParent(aNewParentFrame);
|
||||||
@@ -422,7 +423,7 @@ ReparentFrame(RestyleManager* aRestyleManager,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
ReparentFrames(nsCSSFrameConstructor* aFrameConstructor,
|
ReparentFrames(nsCSSFrameConstructor* aFrameConstructor,
|
||||||
nsIFrame* aNewParentFrame,
|
nsContainerFrame* aNewParentFrame,
|
||||||
const nsFrameList& aFrameList)
|
const nsFrameList& aFrameList)
|
||||||
{
|
{
|
||||||
RestyleManager* restyleManager = aFrameConstructor->RestyleManager();
|
RestyleManager* restyleManager = aFrameConstructor->RestyleManager();
|
||||||
@@ -1420,7 +1421,7 @@ MoveChildrenTo(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
|
for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
|
||||||
e.get()->SetParent(aNewParent);
|
e.get()->SetParent(static_cast<nsContainerFrame*>(aNewParent)); // XXX static_cast will be removed in a later patch
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aNewParent->PrincipalChildList().IsEmpty() &&
|
if (aNewParent->PrincipalChildList().IsEmpty() &&
|
||||||
@@ -4673,7 +4674,7 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
|
|||||||
// then, create a block frame that will wrap the child frames. Make it a
|
// then, create a block frame that will wrap the child frames. Make it a
|
||||||
// MathML frame so that Get(Absolute/Float)ContainingBlockFor know that this
|
// MathML frame so that Get(Absolute/Float)ContainingBlockFor know that this
|
||||||
// is not a suitable block.
|
// is not a suitable block.
|
||||||
nsIFrame* blockFrame =
|
nsContainerFrame* blockFrame =
|
||||||
NS_NewMathMLmathBlockFrame(mPresShell, blockContext,
|
NS_NewMathMLmathBlockFrame(mPresShell, blockContext,
|
||||||
NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
|
NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
|
||||||
|
|
||||||
@@ -9481,7 +9482,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
|
|||||||
nsRefPtr<nsStyleContext> blockSC = mPresShell->StyleSet()->
|
nsRefPtr<nsStyleContext> blockSC = mPresShell->StyleSet()->
|
||||||
ResolveAnonymousBoxStyle(nsCSSAnonBoxes::mozXULAnonymousBlock,
|
ResolveAnonymousBoxStyle(nsCSSAnonBoxes::mozXULAnonymousBlock,
|
||||||
frameStyleContext);
|
frameStyleContext);
|
||||||
nsIFrame *blockFrame = NS_NewBlockFrame(mPresShell, blockSC);
|
nsBlockFrame* blockFrame = NS_NewBlockFrame(mPresShell, blockSC);
|
||||||
// We might, in theory, want to set NS_BLOCK_FLOAT_MGR and
|
// We might, in theory, want to set NS_BLOCK_FLOAT_MGR and
|
||||||
// NS_BLOCK_MARGIN_ROOT, but I think it's a bad idea given that
|
// NS_BLOCK_MARGIN_ROOT, but I think it's a bad idea given that
|
||||||
// a real block placed here wouldn't get those set on it.
|
// a real block placed here wouldn't get those set on it.
|
||||||
@@ -9519,7 +9520,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLineFrame(
|
|||||||
nsFrameConstructorState& aState,
|
nsFrameConstructorState& aState,
|
||||||
nsIContent* aBlockContent,
|
nsIContent* aBlockContent,
|
||||||
nsIFrame* aBlockFrame,
|
nsIFrame* aBlockFrame,
|
||||||
nsIFrame* aLineFrame,
|
nsFirstLineFrame* aLineFrame,
|
||||||
nsFrameItems& aFrameItems)
|
nsFrameItems& aFrameItems)
|
||||||
{
|
{
|
||||||
// Find the part of aFrameItems that we want to put in the first-line
|
// Find the part of aFrameItems that we want to put in the first-line
|
||||||
@@ -9598,8 +9599,9 @@ nsCSSFrameConstructor::AppendFirstLineFrames(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsFirstLineFrame* lineFrame = static_cast<nsFirstLineFrame*>(lastBlockKid);
|
||||||
WrapFramesInFirstLineFrame(aState, aBlockContent, aBlockFrame,
|
WrapFramesInFirstLineFrame(aState, aBlockContent, aBlockFrame,
|
||||||
lastBlockKid, aFrameItems);
|
lineFrame, aFrameItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special routine to handle inserting a new frame into a block
|
// Special routine to handle inserting a new frame into a block
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ struct nsStyleDisplay;
|
|||||||
class nsIDOMHTMLSelectElement;
|
class nsIDOMHTMLSelectElement;
|
||||||
struct nsGenConInitializer;
|
struct nsGenConInitializer;
|
||||||
|
|
||||||
|
class nsFirstLineFrame;
|
||||||
class nsICSSAnonBoxPseudo;
|
class nsICSSAnonBoxPseudo;
|
||||||
class nsPageContentFrame;
|
class nsPageContentFrame;
|
||||||
struct PendingBinding;
|
struct PendingBinding;
|
||||||
@@ -1675,7 +1676,7 @@ private:
|
|||||||
void WrapFramesInFirstLineFrame(nsFrameConstructorState& aState,
|
void WrapFramesInFirstLineFrame(nsFrameConstructorState& aState,
|
||||||
nsIContent* aBlockContent,
|
nsIContent* aBlockContent,
|
||||||
nsIFrame* aBlockFrame,
|
nsIFrame* aBlockFrame,
|
||||||
nsIFrame* aLineFrame,
|
nsFirstLineFrame* aLineFrame,
|
||||||
nsFrameItems& aFrameItems);
|
nsFrameItems& aFrameItems);
|
||||||
|
|
||||||
// Handle the case when a block with first-line style is appended to (by
|
// Handle the case when a block with first-line style is appended to (by
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsPoint.h"
|
#include "nsPoint.h"
|
||||||
#include "nsRect.h"
|
#include "nsRect.h"
|
||||||
#include "nsCaret.h"
|
#include "nsCaret.h"
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "nsFrameManager.h"
|
#include "nsFrameManager.h"
|
||||||
#include "GeckoProfiler.h"
|
#include "GeckoProfiler.h"
|
||||||
#include "nsIStatefulFrame.h"
|
#include "nsIStatefulFrame.h"
|
||||||
|
#include "nsContainerFrame.h"
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
//#define DEBUG_UNDISPLAYED_MAP
|
//#define DEBUG_UNDISPLAYED_MAP
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "nsFrameTraversal.h"
|
#include "nsFrameTraversal.h"
|
||||||
#include "nsFrameList.h"
|
#include "nsFrameList.h"
|
||||||
#include "nsPlaceholderFrame.h"
|
#include "nsPlaceholderFrame.h"
|
||||||
|
#include "nsContainerFrame.h"
|
||||||
|
|
||||||
|
|
||||||
class nsFrameIterator : public nsIFrameEnumerator
|
class nsFrameIterator : public nsIFrameEnumerator
|
||||||
|
|||||||
@@ -1062,7 +1062,7 @@ nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame)
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// Verify that the frame is actually in that child list or in the
|
// Verify that the frame is actually in that child list or in the
|
||||||
// corresponding overflow list.
|
// corresponding overflow list.
|
||||||
nsIFrame* parent = aChildFrame->GetParent();
|
nsContainerFrame* parent = aChildFrame->GetParent();
|
||||||
bool found = parent->GetChildList(id).ContainsFrame(aChildFrame);
|
bool found = parent->GetChildList(id).ContainsFrame(aChildFrame);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
if (!(aChildFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
|
if (!(aChildFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
EXPORTS += [
|
EXPORTS += [
|
||||||
'nsCanvasFrame.h',
|
'nsCanvasFrame.h',
|
||||||
|
'nsContainerFrame.h',
|
||||||
'nsDirection.h',
|
'nsDirection.h',
|
||||||
|
'nsFrame.h',
|
||||||
'nsFrameIdList.h',
|
'nsFrameIdList.h',
|
||||||
'nsFrameList.h',
|
'nsFrameList.h',
|
||||||
'nsFrameSelection.h',
|
'nsFrameSelection.h',
|
||||||
@@ -28,6 +30,7 @@ EXPORTS += [
|
|||||||
'nsIStatefulFrame.h',
|
'nsIStatefulFrame.h',
|
||||||
'nsObjectFrame.h',
|
'nsObjectFrame.h',
|
||||||
'nsQueryFrame.h',
|
'nsQueryFrame.h',
|
||||||
|
'nsSplittableFrame.h',
|
||||||
'nsSubDocumentFrame.h',
|
'nsSubDocumentFrame.h',
|
||||||
'ScrollbarActivity.h',
|
'ScrollbarActivity.h',
|
||||||
'Selection.h',
|
'Selection.h',
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ NS_DECLARE_FRAME_PROPERTY(BottomEdgeOfChildrenProperty, nullptr)
|
|||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
nsIFrame*
|
nsBlockFrame*
|
||||||
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags)
|
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags)
|
||||||
{
|
{
|
||||||
nsBlockFrame* it = new (aPresShell) nsBlockFrame(aContext);
|
nsBlockFrame* it = new (aPresShell) nsBlockFrame(aContext);
|
||||||
@@ -523,7 +523,8 @@ nsBlockFrame::IsFloatContainingBlock() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ReparentFrame(nsIFrame* aFrame, nsIFrame* aOldParent, nsIFrame* aNewParent)
|
ReparentFrame(nsIFrame* aFrame, nsContainerFrame* aOldParent,
|
||||||
|
nsContainerFrame* aNewParent)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(aOldParent == aFrame->GetParent(),
|
NS_ASSERTION(aOldParent == aFrame->GetParent(),
|
||||||
"Parent not consistent with expectations");
|
"Parent not consistent with expectations");
|
||||||
@@ -536,8 +537,8 @@ ReparentFrame(nsIFrame* aFrame, nsIFrame* aOldParent, nsIFrame* aNewParent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ReparentFrames(nsFrameList& aFrameList, nsIFrame* aOldParent,
|
ReparentFrames(nsFrameList& aFrameList, nsContainerFrame* aOldParent,
|
||||||
nsIFrame* aNewParent)
|
nsContainerFrame* aNewParent)
|
||||||
{
|
{
|
||||||
for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
|
for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
|
||||||
ReparentFrame(e.get(), aOldParent, aNewParent);
|
ReparentFrame(e.get(), aOldParent, aNewParent);
|
||||||
|
|||||||
@@ -99,7 +99,9 @@ public:
|
|||||||
line_iterator line(nsLineBox* aList) { return mLines.begin(aList); }
|
line_iterator line(nsLineBox* aList) { return mLines.begin(aList); }
|
||||||
reverse_line_iterator rline(nsLineBox* aList) { return mLines.rbegin(aList); }
|
reverse_line_iterator rline(nsLineBox* aList) { return mLines.rbegin(aList); }
|
||||||
|
|
||||||
friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
|
friend nsBlockFrame* NS_NewBlockFrame(nsIPresShell* aPresShell,
|
||||||
|
nsStyleContext* aContext,
|
||||||
|
nsFrameState aFlags);
|
||||||
|
|
||||||
// nsQueryFrame
|
// nsQueryFrame
|
||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#ifndef nsFontInflationData_h_
|
#ifndef nsFontInflationData_h_
|
||||||
#define nsFontInflationData_h_
|
#define nsFontInflationData_h_
|
||||||
|
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
|
|
||||||
struct nsHTMLReflowState;
|
struct nsHTMLReflowState;
|
||||||
|
|
||||||
|
|||||||
@@ -7486,6 +7486,17 @@ nsIFrame::ComputePreserve3DChildrenOverflow(nsOverflowAreas& aOverflowAreas, con
|
|||||||
aOverflowAreas.Overflow(eScrollableOverflow) = aOverflowAreas.Overflow(eScrollableOverflow).Union(childScrollable);
|
aOverflowAreas.Overflow(eScrollableOverflow) = aOverflowAreas.Overflow(eScrollableOverflow).Union(childScrollable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
nsIFrame::GetDepthInFrameTree() const
|
||||||
|
{
|
||||||
|
uint32_t result = 0;
|
||||||
|
for (nsContainerFrame* ancestor = GetParent(); ancestor;
|
||||||
|
ancestor = ancestor->GetParent()) {
|
||||||
|
result++;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsFrame::ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas,
|
nsFrame::ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas,
|
||||||
nsIFrame* aChildFrame)
|
nsIFrame* aChildFrame)
|
||||||
@@ -8443,7 +8454,7 @@ nsIFrame::RemoveInPopupStateBitFromDescendants(nsIFrame* aFrame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsFrame::SetParent(nsIFrame* aParent)
|
nsFrame::SetParent(nsContainerFrame* aParent)
|
||||||
{
|
{
|
||||||
bool wasBoxWrapped = IsBoxWrapped();
|
bool wasBoxWrapped = IsBoxWrapped();
|
||||||
mParent = aParent;
|
mParent = aParent;
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ public:
|
|||||||
virtual nsStyleContext* GetAdditionalStyleContext(int32_t aIndex) const MOZ_OVERRIDE;
|
virtual nsStyleContext* GetAdditionalStyleContext(int32_t aIndex) const MOZ_OVERRIDE;
|
||||||
virtual void SetAdditionalStyleContext(int32_t aIndex,
|
virtual void SetAdditionalStyleContext(int32_t aIndex,
|
||||||
nsStyleContext* aStyleContext) MOZ_OVERRIDE;
|
nsStyleContext* aStyleContext) MOZ_OVERRIDE;
|
||||||
virtual void SetParent(nsIFrame* aParent) MOZ_OVERRIDE;
|
virtual void SetParent(nsContainerFrame* aParent) MOZ_OVERRIDE;
|
||||||
virtual nscoord GetBaseline() const MOZ_OVERRIDE;
|
virtual nscoord GetBaseline() const MOZ_OVERRIDE;
|
||||||
virtual const nsFrameList& GetChildList(ChildListID aListID) const MOZ_OVERRIDE;
|
virtual const nsFrameList& GetChildList(ChildListID aListID) const MOZ_OVERRIDE;
|
||||||
virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;
|
virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE;
|
||||||
@@ -603,6 +603,8 @@ public:
|
|||||||
aFrame->GetType() == nsGkAtoms::blockFrame;
|
aFrame->GetType() == nsGkAtoms::blockFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual nsILineIterator* GetLineIterator() MOZ_OVERRIDE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Test if we are selecting a table object:
|
// Test if we are selecting a table object:
|
||||||
@@ -648,8 +650,6 @@ private:
|
|||||||
|
|
||||||
NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState);
|
NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState);
|
||||||
|
|
||||||
virtual nsILineIterator* GetLineIterator() MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "nsFrameList.h"
|
#include "nsFrameList.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
#include "nsPresContext.h"
|
#include "nsPresContext.h"
|
||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
@@ -314,7 +314,7 @@ nsFrameList::ApplySetParent(nsIFrame* aParent) const
|
|||||||
NS_ASSERTION(aParent, "null ptr");
|
NS_ASSERTION(aParent, "null ptr");
|
||||||
|
|
||||||
for (nsIFrame* f = FirstChild(); f; f = f->GetNextSibling()) {
|
for (nsIFrame* f = FirstChild(); f; f = f->GetNextSibling()) {
|
||||||
f->SetParent(aParent);
|
f->SetParent(static_cast<nsContainerFrame*>(aParent)); // XXX static_cast will be removed in a later patch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ class nsTableColFrame;
|
|||||||
// Factory methods for creating html layout objects
|
// Factory methods for creating html layout objects
|
||||||
|
|
||||||
// Create a frame that supports "display: block" layout behavior
|
// Create a frame that supports "display: block" layout behavior
|
||||||
nsIFrame*
|
class nsBlockFrame;
|
||||||
|
nsBlockFrame*
|
||||||
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags = nsFrameState(0));
|
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags = nsFrameState(0));
|
||||||
|
|
||||||
// Special Generated Content Node. It contains text taken from an
|
// Special Generated Content Node. It contains text taken from an
|
||||||
@@ -66,7 +67,7 @@ nsIFrame*
|
|||||||
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
|
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
|
||||||
|
|
||||||
// Create a block formatting context blockframe
|
// Create a block formatting context blockframe
|
||||||
inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell,
|
inline nsBlockFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell,
|
||||||
nsStyleContext* aStyleContext)
|
nsStyleContext* aStyleContext)
|
||||||
{
|
{
|
||||||
return NS_NewBlockFrame(aPresShell, aStyleContext,
|
return NS_NewBlockFrame(aPresShell, aStyleContext,
|
||||||
@@ -120,7 +121,8 @@ nsIFrame*
|
|||||||
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||||
nsIFrame*
|
nsIFrame*
|
||||||
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||||
nsIFrame*
|
class nsFirstLineFrame;
|
||||||
|
nsFirstLineFrame*
|
||||||
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||||
|
|
||||||
// forms
|
// forms
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ class gfxContext;
|
|||||||
class nsLineList_iterator;
|
class nsLineList_iterator;
|
||||||
class nsAbsoluteContainingBlock;
|
class nsAbsoluteContainingBlock;
|
||||||
class nsIContent;
|
class nsIContent;
|
||||||
|
class nsContainerFrame;
|
||||||
|
|
||||||
struct nsPeekOffsetStruct;
|
struct nsPeekOffsetStruct;
|
||||||
struct nsPoint;
|
struct nsPoint;
|
||||||
@@ -672,14 +673,14 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Accessor functions for geometric parent
|
* Accessor functions for geometric parent
|
||||||
*/
|
*/
|
||||||
nsIFrame* GetParent() const { return mParent; }
|
nsContainerFrame* GetParent() const { return static_cast<nsContainerFrame*>(static_cast<void*>(mParent)); } // XXX static_cast will be removed in a later patch
|
||||||
/**
|
/**
|
||||||
* Set this frame's parent to aParent.
|
* Set this frame's parent to aParent.
|
||||||
* If the frame may have moved into or out of a scrollframe's
|
* If the frame may have moved into or out of a scrollframe's
|
||||||
* frame subtree, StickyScrollContainer::NotifyReparentedFrameAcrossScrollFrameBoundary
|
* frame subtree, StickyScrollContainer::NotifyReparentedFrameAcrossScrollFrameBoundary
|
||||||
* must also be called.
|
* must also be called.
|
||||||
*/
|
*/
|
||||||
virtual void SetParent(nsIFrame* aParent) = 0;
|
virtual void SetParent(nsContainerFrame* aParent) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The frame's writing-mode, used for logical layout computations.
|
* The frame's writing-mode, used for logical layout computations.
|
||||||
@@ -1296,14 +1297,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Returns the number of ancestors between this and the root of our frame tree
|
* Returns the number of ancestors between this and the root of our frame tree
|
||||||
*/
|
*/
|
||||||
uint32_t GetDepthInFrameTree() {
|
uint32_t GetDepthInFrameTree() const;
|
||||||
uint32_t result = 0;
|
|
||||||
for (nsIFrame* ancestor = GetParent(); ancestor;
|
|
||||||
ancestor = ancestor->GetParent()) {
|
|
||||||
result++;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event handling of GUI events.
|
* Event handling of GUI events.
|
||||||
|
|||||||
@@ -955,7 +955,7 @@ nsInlineFrame::AccessibleType()
|
|||||||
|
|
||||||
// nsLineFrame implementation
|
// nsLineFrame implementation
|
||||||
|
|
||||||
nsIFrame*
|
nsFirstLineFrame*
|
||||||
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
||||||
{
|
{
|
||||||
return new (aPresShell) nsFirstLineFrame(aContext);
|
return new (aPresShell) nsFirstLineFrame(aContext);
|
||||||
|
|||||||
@@ -187,7 +187,8 @@ class nsFirstLineFrame MOZ_FINAL : public nsInlineFrame {
|
|||||||
public:
|
public:
|
||||||
NS_DECL_FRAMEARENA_HELPERS
|
NS_DECL_FRAMEARENA_HELPERS
|
||||||
|
|
||||||
friend nsIFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
friend nsFirstLineFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell,
|
||||||
|
nsStyleContext* aContext);
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
||||||
|
|||||||
@@ -1578,7 +1578,7 @@ nsMathMLContainerFrame::ReportInvalidChildError(nsIAtom* aChildTag)
|
|||||||
|
|
||||||
//==========================
|
//==========================
|
||||||
|
|
||||||
nsIFrame*
|
nsContainerFrame*
|
||||||
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
|
NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
|
||||||
nsFrameState aFlags)
|
nsFrameState aFlags)
|
||||||
{
|
{
|
||||||
@@ -1593,7 +1593,7 @@ NS_QUERYFRAME_HEAD(nsMathMLmathBlockFrame)
|
|||||||
NS_QUERYFRAME_ENTRY(nsMathMLmathBlockFrame)
|
NS_QUERYFRAME_ENTRY(nsMathMLmathBlockFrame)
|
||||||
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
|
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
|
||||||
|
|
||||||
nsIFrame*
|
nsContainerFrame*
|
||||||
NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
||||||
{
|
{
|
||||||
return new (aPresShell) nsMathMLmathInlineFrame(aContext);
|
return new (aPresShell) nsMathMLmathInlineFrame(aContext);
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ public:
|
|||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
NS_DECL_FRAMEARENA_HELPERS
|
NS_DECL_FRAMEARENA_HELPERS
|
||||||
|
|
||||||
friend nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell,
|
friend nsContainerFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell,
|
||||||
nsStyleContext* aContext, nsFrameState aFlags);
|
nsStyleContext* aContext, nsFrameState aFlags);
|
||||||
|
|
||||||
// beware, mFrames is not set by nsBlockFrame
|
// beware, mFrames is not set by nsBlockFrame
|
||||||
@@ -493,7 +493,8 @@ public:
|
|||||||
NS_DECL_QUERYFRAME
|
NS_DECL_QUERYFRAME
|
||||||
NS_DECL_FRAMEARENA_HELPERS
|
NS_DECL_FRAMEARENA_HELPERS
|
||||||
|
|
||||||
friend nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
friend nsContainerFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell,
|
||||||
|
nsStyleContext* aContext);
|
||||||
|
|
||||||
virtual nsresult
|
virtual nsresult
|
||||||
SetInitialChildList(ChildListID aListID,
|
SetInitialChildList(ChildListID aListID,
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aCo
|
|||||||
nsIFrame* NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
nsIFrame* NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||||
nsIFrame* NS_NewMathMLsemanticsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
nsIFrame* NS_NewMathMLsemanticsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||||
|
|
||||||
nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
|
nsContainerFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
|
||||||
nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
nsContainerFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||||
inline nsIFrame* NS_CreateNewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
inline nsContainerFrame* NS_CreateNewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
||||||
{
|
{
|
||||||
return NS_NewMathMLmathBlockFrame(aPresShell, aContext, nsFrameState(0));
|
return NS_NewMathMLmathBlockFrame(aPresShell, aContext, nsFrameState(0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
#include "mozilla/gfx/2D.h"
|
#include "mozilla/gfx/2D.h"
|
||||||
#include "imgIContainer.h"
|
#include "imgIContainer.h"
|
||||||
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIImageLoadingContent.h"
|
#include "nsIImageLoadingContent.h"
|
||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
#include "nsRenderingContext.h"
|
#include "nsRenderingContext.h"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ XPIDL_SOURCES += [
|
|||||||
XPIDL_MODULE = 'layout_xul'
|
XPIDL_MODULE = 'layout_xul'
|
||||||
|
|
||||||
EXPORTS += [
|
EXPORTS += [
|
||||||
|
'nsBox.h',
|
||||||
'nsIScrollbarMediator.h',
|
'nsIScrollbarMediator.h',
|
||||||
'nsPIBoxObject.h',
|
'nsPIBoxObject.h',
|
||||||
'nsXULPopupManager.h',
|
'nsXULPopupManager.h',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
#include "nsPresContext.h"
|
#include "nsPresContext.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIDocShell.h"
|
#include "nsIDocShell.h"
|
||||||
#include "nsReadableUtils.h"
|
#include "nsReadableUtils.h"
|
||||||
#include "nsDOMClassInfoID.h"
|
#include "nsDOMClassInfoID.h"
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ nsMenuFrame::nsMenuFrame(nsIPresShell* aShell, nsStyleContext* aContext):
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsMenuFrame::SetParent(nsIFrame* aParent)
|
nsMenuFrame::SetParent(nsContainerFrame* aParent)
|
||||||
{
|
{
|
||||||
nsBoxFrame::SetParent(aParent);
|
nsBoxFrame::SetParent(aParent);
|
||||||
InitMenuParent(aParent);
|
InitMenuParent(aParent);
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public:
|
|||||||
// otherwise null will be returned.
|
// otherwise null will be returned.
|
||||||
nsMenuFrame* Enter(mozilla::WidgetGUIEvent* aEvent);
|
nsMenuFrame* Enter(mozilla::WidgetGUIEvent* aEvent);
|
||||||
|
|
||||||
virtual void SetParent(nsIFrame* aParent) MOZ_OVERRIDE;
|
virtual void SetParent(nsContainerFrame* aParent) MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual nsMenuParent *GetMenuParent() { return mMenuParent; }
|
virtual nsMenuParent *GetMenuParent() { return mMenuParent; }
|
||||||
const nsAString& GetRadioGroupName() { return mGroupName; }
|
const nsAString& GetRadioGroupName() { return mGroupName; }
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "ContentHelper.h"
|
#include "ContentHelper.h"
|
||||||
#include "nsQueryFrame.h"
|
|
||||||
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsIScrollableFrame.h"
|
#include "nsIScrollableFrame.h"
|
||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user