table related frames don't create frames for children that are invalid (e.g. map, body, etc.)

This commit is contained in:
karnaze%netscape.com 1999-02-11 23:08:28 +00:00
Родитель 29b1b2d3da
Коммит 5c2c55103e
4 изменённых файлов: 354 добавлений и 94 удалений

Просмотреть файл

@ -343,7 +343,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aNewFrame, nsIFrame*& aNewFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
nsIFrame* childList; nsIFrame* childList;
@ -441,7 +441,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext,
//childList->SetNextSibling(nonTableRelatedFrame); //childList->SetNextSibling(nonTableRelatedFrame);
//NS_IF_RELEASE(tag); //NS_IF_RELEASE(tag);
TableProcessChild(aPresContext, childContent, innerFrame, parentStyleContext, TableProcessChild(aPresContext, childContent, innerFrame, parentStyleContext,
aAbsoluteItems, childFrame, aFixedItems); aAbsoluteItems, childFrame, aFixedItems, aTableCreator);
break; break;
} }
@ -472,7 +472,7 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte
nsIFrame*& aOuterFrame, nsIFrame*& aOuterFrame,
nsIFrame*& aInnerFrame, nsIFrame*& aInnerFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult result = NS_OK; nsresult result = NS_OK;
if (NS_SUCCEEDED(result)) { if (NS_SUCCEEDED(result)) {
@ -515,7 +515,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewCaptionFrame, nsIFrame*& aNewCaptionFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_NewAreaFrame(aNewCaptionFrame, 0); nsresult rv = NS_NewAreaFrame(aNewCaptionFrame, 0);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
@ -561,7 +561,7 @@ nsCSSFrameConstructor::ConstructTableGroupFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewGroupFrame, nsIFrame*& aNewGroupFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator, nsTableCreator& aTableCreator,
nsDeque* aToDo) nsDeque* aToDo)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -632,7 +632,7 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewGroupFrame, nsIFrame*& aNewGroupFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
const nsStyleDisplay* styleDisplay = const nsStyleDisplay* styleDisplay =
@ -677,7 +677,7 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
nsFrameItems childItems; nsFrameItems childItems;
if (aIsRowGroup) { if (aIsRowGroup) {
TableProcessChildren(aPresContext, aContent, aNewGroupFrame, aAbsoluteItems, TableProcessChildren(aPresContext, aContent, aNewGroupFrame, aAbsoluteItems,
childItems, aFixedItems); childItems, aFixedItems, aTableCreator);
} else { } else {
ProcessChildren(aPresContext, aContent, aNewGroupFrame, aAbsoluteItems, ProcessChildren(aPresContext, aContent, aNewGroupFrame, aAbsoluteItems,
childItems, aFixedItems); childItems, aFixedItems);
@ -698,7 +698,7 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewRowFrame, nsIFrame*& aNewRowFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator, nsTableCreator& aTableCreator,
nsDeque* aToDo) nsDeque* aToDo)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -770,7 +770,7 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPresContext,
PRBool aProcessChildren, PRBool aProcessChildren,
nsIFrame*& aNewRowFrame, nsIFrame*& aNewRowFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame); nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
@ -778,7 +778,7 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPresContext,
if (aProcessChildren) { if (aProcessChildren) {
nsFrameItems childItems; nsFrameItems childItems;
rv = TableProcessChildren(aPresContext, aContent, aNewRowFrame, aAbsoluteItems, rv = TableProcessChildren(aPresContext, aContent, aNewRowFrame, aAbsoluteItems,
childItems, aFixedItems); childItems, aFixedItems, aTableCreator);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
aNewRowFrame->SetInitialChildList(*aPresContext, nsnull, childItems.childList); aNewRowFrame->SetInitialChildList(*aPresContext, nsnull, childItems.childList);
} }
@ -797,7 +797,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewColFrame, nsIFrame*& aNewColFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -846,7 +846,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewCellFrame, nsIFrame*& aNewCellFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -909,7 +909,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aNewFrame, nsIFrame*& aNewFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv; nsresult rv;
@ -962,7 +962,8 @@ nsCSSFrameConstructor::TableProcessChildren(nsIPresContext* aPresContext,
nsIFrame* aParentFrame, nsIFrame* aParentFrame,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsFrameItems& aChildItems, nsFrameItems& aChildItems,
nsAbsoluteItems& aFixedItems) nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
// Initialize OUT parameter // Initialize OUT parameter
@ -982,7 +983,7 @@ nsCSSFrameConstructor::TableProcessChildren(nsIPresContext* aPresContext,
aContent->ChildAt(i, *getter_AddRefs(childContent)); aContent->ChildAt(i, *getter_AddRefs(childContent));
rv = TableProcessChild(aPresContext, childContent, aParentFrame, parentStyleContext, rv = TableProcessChild(aPresContext, childContent, aParentFrame, parentStyleContext,
aAbsoluteItems, childFrame, aFixedItems); aAbsoluteItems, childFrame, aFixedItems, aTableCreator);
if (NS_SUCCEEDED(rv) && (nsnull != childFrame)) { if (NS_SUCCEEDED(rv) && (nsnull != childFrame)) {
aChildItems.AddChild(childFrame); aChildItems.AddChild(childFrame);
@ -999,9 +1000,12 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext,
nsIStyleContext* aParentStyleContext, nsIStyleContext* aParentStyleContext,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aChildFrame, nsIFrame*& aChildFrame,
nsAbsoluteItems& aFixedItems) nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
aChildFrame = nsnull;
if (nsnull != aChildContent) { if (nsnull != aChildContent) {
aChildFrame = nsnull; aChildFrame = nsnull;
nsCOMPtr<nsIStyleContext> childStyleContext; nsCOMPtr<nsIStyleContext> childStyleContext;
@ -1020,8 +1024,9 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext,
rv = ConstructFrame(aPresContext, aChildContent, aParentFrame, aAbsoluteItems, childItems, aFixedItems); rv = ConstructFrame(aPresContext, aChildContent, aParentFrame, aAbsoluteItems, childItems, aFixedItems);
aChildFrame = childItems.childList; aChildFrame = childItems.childList;
} else { } else {
nsCOMPtr<nsIAtom> tag; nsCOMPtr<nsIAtom> tag;
aChildContent->GetTag(*getter_AddRefs(tag)); aChildContent->GetTag(*getter_AddRefs(tag));
// forms need a frame but it can't be a child of an inner table
if (nsHTMLAtoms::form == tag) { if (nsHTMLAtoms::form == tag) {
// if the parent is a table, put the form in the outer table frame // if the parent is a table, put the form in the outer table frame
const nsStyleDisplay* parentDisplay = (const nsStyleDisplay*) const nsStyleDisplay* parentDisplay = (const nsStyleDisplay*)
@ -1038,24 +1043,27 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext,
aAbsoluteItems, childItems, aFixedItems); aAbsoluteItems, childItems, aFixedItems);
} }
aChildFrame = childItems.childList; aChildFrame = childItems.childList;
} else { // wrap it in a table cell, row, row group, table if it is not whitespace // wrap it in a table cell, row, row group, table if it is a valid tag or display
PRBool needCell = PR_TRUE; // and not whitespace. For example we don't allow map, head, body, etc.
nsIDOMCharacterData* domData = nsnull; } else {
nsresult rv2 = aChildContent->QueryInterface(kIDOMCharacterDataIID, (void**)&domData); if (TableIsValidCellContent(aPresContext, aParentFrame, aChildContent)) {
if ((NS_OK == rv2) && (nsnull != domData)) { PRBool needCell = PR_TRUE;
nsString charData; nsIDOMCharacterData* domData = nsnull;
domData->GetData(charData); nsresult rv2 = aChildContent->QueryInterface(kIDOMCharacterDataIID, (void**)&domData);
charData = charData.StripWhitespace(); if ((NS_OK == rv2) && (nsnull != domData)) {
if (charData.Length() <= 0) { nsString charData;
needCell = PR_FALSE; // only contains whitespace, don't create cell domData->GetData(charData);
charData = charData.StripWhitespace();
if ((charData.Length() <= 0) && (charData != " ")) { // XXX check this
needCell = PR_FALSE; // only contains whitespace, don't create cell
}
NS_RELEASE(domData);
}
if (needCell) {
nsIFrame* cellFrame;
rv = ConstructTableCellFrame(aPresContext, aChildContent, aParentFrame, childStyleContext,
aAbsoluteItems, aChildFrame, cellFrame, aFixedItems, aTableCreator);
} }
NS_RELEASE(domData);
}
if (needCell) {
nsIFrame* cellFrame;
nsTableCreator aTableCreator;
rv = ConstructTableCellFrame(aPresContext, aChildContent, aParentFrame, childStyleContext,
aAbsoluteItems, aChildFrame, cellFrame, aFixedItems, aTableCreator);
} }
} }
} }
@ -1063,6 +1071,71 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext,
return rv; return rv;
} }
PRBool
nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext,
nsIFrame* aParentFrame,
nsIContent* aContent)
{
nsCOMPtr<nsIAtom> tag;
aContent->GetTag(*getter_AddRefs(tag));
nsCOMPtr<nsIStyleContext> styleContext;
nsresult rv = ResolveStyleContext(aPresContext, aParentFrame, aContent, tag, getter_AddRefs(styleContext));
if (NS_FAILED(rv)) {
return PR_FALSE;
}
const nsStyleDisplay* display = (const nsStyleDisplay*)
styleContext->GetStyleData(eStyleStruct_Display);
if (NS_STYLE_DISPLAY_NONE != display->mDisplay) {
return PR_FALSE;
}
// check tags first
if ( (nsHTMLAtoms::img == tag) ||
(nsHTMLAtoms::hr == tag) ||
(nsHTMLAtoms::br == tag) ||
(nsHTMLAtoms::wbr == tag) ||
(nsHTMLAtoms::input == tag) ||
(nsHTMLAtoms::textarea == tag) ||
(nsHTMLAtoms::select == tag) ||
(nsHTMLAtoms::applet == tag) ||
(nsHTMLAtoms::embed == tag) ||
(nsHTMLAtoms::fieldset == tag) ||
(nsHTMLAtoms::legend == tag) ||
(nsHTMLAtoms::object == tag) ||
(nsHTMLAtoms::form == tag) ||
(nsHTMLAtoms::iframe == tag) ||
(nsHTMLAtoms::spacer == tag) ||
(nsHTMLAtoms::button == tag) ||
(nsHTMLAtoms::label == tag )) {
return PR_TRUE;
}
#ifdef INCLUDE_XUL
if ( (nsXULAtoms::button == tag) ||
(nsXULAtoms::checkbox == tag) ||
(nsXULAtoms::radio == tag) ||
(nsXULAtoms::text == tag) ||
(nsXULAtoms::widget == tag) ||
(nsXULAtoms::tree == tag) ||
(nsXULAtoms::treechildren == tag) ||
(nsXULAtoms::treeitem == tag) ||
(nsXULAtoms::treecell == tag) ||
(nsXULAtoms::treeindentation == tag) ||
(nsXULAtoms::toolbox == tag) ||
(nsXULAtoms::toolbar == tag) ||
(nsXULAtoms::progressmeter == tag )) {
return PR_TRUE;
}
#endif
// we should check for display type as well - later
return PR_FALSE;
}
nsresult nsresult
nsCSSFrameConstructor::TableProcessChildLists(nsIPresContext* aPresContext, nsCSSFrameConstructor::TableProcessChildLists(nsIPresContext* aPresContext,
nsDeque* aParentChildPairs) nsDeque* aParentChildPairs)
@ -2348,6 +2421,47 @@ nsCSSFrameConstructor::IsScrollable(nsIPresContext* aPresContext,
return PR_FALSE; return PR_FALSE;
} }
nsresult
nsCSSFrameConstructor::ResolveStyleContext(nsIPresContext* aPresContext,
nsIFrame* aParentFrame,
nsIContent* aContent,
nsIAtom* aTag,
nsIStyleContext** aStyleContext)
{
nsresult rv = NS_OK;
// Resolve the style context based on the content object and the parent
// style context
nsCOMPtr<nsIStyleContext> parentStyleContext;
aParentFrame->GetStyleContext(getter_AddRefs(parentStyleContext));
if (nsLayoutAtoms::textTagName == aTag) {
// Use a special pseudo element style context for text
nsCOMPtr<nsIContent> parentContent;
if (nsnull != aParentFrame) {
aParentFrame->GetContent(getter_AddRefs(parentContent));
}
rv = aPresContext->ResolvePseudoStyleContextFor(parentContent,
nsHTMLAtoms::textPseudo,
parentStyleContext,
aStyleContext);
} else if (nsLayoutAtoms::commentTagName == aTag) {
// Use a special pseudo element style context for comments
nsCOMPtr<nsIContent> parentContent;
if (nsnull != aParentFrame) {
aParentFrame->GetContent(getter_AddRefs(parentContent));
}
rv = aPresContext->ResolvePseudoStyleContextFor(parentContent,
nsHTMLAtoms::commentPseudo,
parentStyleContext,
aStyleContext);
} else {
rv = aPresContext->ResolveStyleContextFor(aContent, parentStyleContext,
aStyleContext);
}
return rv;
}
nsresult nsresult
nsCSSFrameConstructor::ConstructFrame(nsIPresContext* aPresContext, nsCSSFrameConstructor::ConstructFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -2364,6 +2478,10 @@ nsCSSFrameConstructor::ConstructFrame(nsIPresContext* aPresContext,
nsCOMPtr<nsIAtom> tag; nsCOMPtr<nsIAtom> tag;
aContent->GetTag(*getter_AddRefs(tag)); aContent->GetTag(*getter_AddRefs(tag));
nsCOMPtr<nsIStyleContext> styleContext;
rv = ResolveStyleContext(aPresContext, aParentFrame, aContent, tag, getter_AddRefs(styleContext));
#ifdef chris_needs_to_remove_this
// Resolve the style context based on the content object and the parent // Resolve the style context based on the content object and the parent
// style context // style context
nsCOMPtr<nsIStyleContext> styleContext; nsCOMPtr<nsIStyleContext> styleContext;
@ -2394,6 +2512,7 @@ nsCSSFrameConstructor::ConstructFrame(nsIPresContext* aPresContext,
rv = aPresContext->ResolveStyleContextFor(aContent, parentStyleContext, rv = aPresContext->ResolveStyleContextFor(aContent, parentStyleContext,
getter_AddRefs(styleContext)); getter_AddRefs(styleContext));
} }
#endif
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
// Pre-check for display "none" - if we find that, don't create // Pre-check for display "none" - if we find that, don't create

Просмотреть файл

@ -101,6 +101,12 @@ public:
protected: protected:
nsresult ResolveStyleContext(nsIPresContext* aPresContext,
nsIFrame* aParentFrame,
nsIContent* aContent,
nsIAtom* aTag,
nsIStyleContext** aStyleContext);
nsresult ConstructFrame(nsIPresContext* aPresContext, nsresult ConstructFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
nsIFrame* aParentFrame, nsIFrame* aParentFrame,
@ -123,7 +129,7 @@ protected:
nsAbsoluteItems& aAboluteItems, nsAbsoluteItems& aAboluteItems,
nsIFrame*& aNewFrame, nsIFrame*& aNewFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructAnonymousTableFrame(nsIPresContext* aPresContext, nsresult ConstructAnonymousTableFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -131,7 +137,7 @@ protected:
nsIFrame*& aOuterFrame, nsIFrame*& aOuterFrame,
nsIFrame*& aInnerFrame, nsIFrame*& aInnerFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableCaptionFrame(nsIPresContext* aPresContext, nsresult ConstructTableCaptionFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -141,7 +147,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewCaptionFrame, nsIFrame*& aNewCaptionFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableGroupFrame(nsIPresContext* aPresContext, nsresult ConstructTableGroupFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -152,7 +158,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewGroupFrame, nsIFrame*& aNewGroupFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator, nsTableCreator& aTableCreator,
nsDeque* aToDo = nsnull); nsDeque* aToDo = nsnull);
nsresult ConstructTableGroupFrameOnly(nsIPresContext* aPresContext, nsresult ConstructTableGroupFrameOnly(nsIPresContext* aPresContext,
@ -165,7 +171,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewGroupFrame, nsIFrame*& aNewGroupFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableRowFrame(nsIPresContext* aPresContext, nsresult ConstructTableRowFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -175,7 +181,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewRowFrame, nsIFrame*& aNewRowFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator, nsTableCreator& aTableCreator,
nsDeque* aToDo = nsnull); nsDeque* aToDo = nsnull);
nsresult ConstructTableRowFrameOnly(nsIPresContext* aPresContext, nsresult ConstructTableRowFrameOnly(nsIPresContext* aPresContext,
@ -186,7 +192,7 @@ protected:
PRBool aProcessChildren, PRBool aProcessChildren,
nsIFrame*& aNewRowFrame, nsIFrame*& aNewRowFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableColFrame(nsIPresContext* aPresContext, nsresult ConstructTableColFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -196,7 +202,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewColFrame, nsIFrame*& aNewColFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableCellFrame(nsIPresContext* aPresContext, nsresult ConstructTableCellFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -206,7 +212,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewCellFrame, nsIFrame*& aNewCellFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableCellFrameOnly(nsIPresContext* aPresContext, nsresult ConstructTableCellFrameOnly(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -216,14 +222,15 @@ protected:
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aNewFrame, nsIFrame*& aNewFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult TableProcessChildren(nsIPresContext* aPresContext, nsresult TableProcessChildren(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
nsIFrame* aParentFrame, nsIFrame* aParentFrame,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsFrameItems& aChildList, nsFrameItems& aChildList,
nsAbsoluteItems& aFixedItems); nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator);
nsresult TableProcessChild(nsIPresContext* aPresContext, nsresult TableProcessChild(nsIPresContext* aPresContext,
nsIContent* aChildContent, nsIContent* aChildContent,
@ -231,7 +238,8 @@ protected:
nsIStyleContext* aParentStyleContext, nsIStyleContext* aParentStyleContext,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aChildFrame, nsIFrame*& aChildFrame,
nsAbsoluteItems& aFixedItems); nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator);
nsresult TableProcessChildLists(nsIPresContext* aPresContext, nsresult TableProcessChildLists(nsIPresContext* aPresContext,
nsDeque* aParentChildPairs); nsDeque* aParentChildPairs);
@ -240,6 +248,9 @@ protected:
nsIFrame* aFrame, nsIFrame* aFrame,
const nsStyleDisplay* aDisplayType); const nsStyleDisplay* aDisplayType);
PRBool TableIsValidCellContent(nsIPresContext* aPresContext,
nsIFrame* aParentFrame,
nsIContent* aContent);
const nsStyleDisplay* GetDisplay(nsIFrame* aFrame); const nsStyleDisplay* GetDisplay(nsIFrame* aFrame);

Просмотреть файл

@ -343,7 +343,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aNewFrame, nsIFrame*& aNewFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
nsIFrame* childList; nsIFrame* childList;
@ -441,7 +441,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext,
//childList->SetNextSibling(nonTableRelatedFrame); //childList->SetNextSibling(nonTableRelatedFrame);
//NS_IF_RELEASE(tag); //NS_IF_RELEASE(tag);
TableProcessChild(aPresContext, childContent, innerFrame, parentStyleContext, TableProcessChild(aPresContext, childContent, innerFrame, parentStyleContext,
aAbsoluteItems, childFrame, aFixedItems); aAbsoluteItems, childFrame, aFixedItems, aTableCreator);
break; break;
} }
@ -472,7 +472,7 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte
nsIFrame*& aOuterFrame, nsIFrame*& aOuterFrame,
nsIFrame*& aInnerFrame, nsIFrame*& aInnerFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult result = NS_OK; nsresult result = NS_OK;
if (NS_SUCCEEDED(result)) { if (NS_SUCCEEDED(result)) {
@ -515,7 +515,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewCaptionFrame, nsIFrame*& aNewCaptionFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_NewAreaFrame(aNewCaptionFrame, 0); nsresult rv = NS_NewAreaFrame(aNewCaptionFrame, 0);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
@ -561,7 +561,7 @@ nsCSSFrameConstructor::ConstructTableGroupFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewGroupFrame, nsIFrame*& aNewGroupFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator, nsTableCreator& aTableCreator,
nsDeque* aToDo) nsDeque* aToDo)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -632,7 +632,7 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewGroupFrame, nsIFrame*& aNewGroupFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
const nsStyleDisplay* styleDisplay = const nsStyleDisplay* styleDisplay =
@ -677,7 +677,7 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
nsFrameItems childItems; nsFrameItems childItems;
if (aIsRowGroup) { if (aIsRowGroup) {
TableProcessChildren(aPresContext, aContent, aNewGroupFrame, aAbsoluteItems, TableProcessChildren(aPresContext, aContent, aNewGroupFrame, aAbsoluteItems,
childItems, aFixedItems); childItems, aFixedItems, aTableCreator);
} else { } else {
ProcessChildren(aPresContext, aContent, aNewGroupFrame, aAbsoluteItems, ProcessChildren(aPresContext, aContent, aNewGroupFrame, aAbsoluteItems,
childItems, aFixedItems); childItems, aFixedItems);
@ -698,7 +698,7 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewRowFrame, nsIFrame*& aNewRowFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator, nsTableCreator& aTableCreator,
nsDeque* aToDo) nsDeque* aToDo)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -770,7 +770,7 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPresContext,
PRBool aProcessChildren, PRBool aProcessChildren,
nsIFrame*& aNewRowFrame, nsIFrame*& aNewRowFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame); nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
@ -778,7 +778,7 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPresContext,
if (aProcessChildren) { if (aProcessChildren) {
nsFrameItems childItems; nsFrameItems childItems;
rv = TableProcessChildren(aPresContext, aContent, aNewRowFrame, aAbsoluteItems, rv = TableProcessChildren(aPresContext, aContent, aNewRowFrame, aAbsoluteItems,
childItems, aFixedItems); childItems, aFixedItems, aTableCreator);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
aNewRowFrame->SetInitialChildList(*aPresContext, nsnull, childItems.childList); aNewRowFrame->SetInitialChildList(*aPresContext, nsnull, childItems.childList);
} }
@ -797,7 +797,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewColFrame, nsIFrame*& aNewColFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -846,7 +846,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsIPresContext* aPresContext,
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewCellFrame, nsIFrame*& aNewCellFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -909,7 +909,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aNewFrame, nsIFrame*& aNewFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator) nsTableCreator& aTableCreator)
{ {
nsresult rv; nsresult rv;
@ -962,7 +962,8 @@ nsCSSFrameConstructor::TableProcessChildren(nsIPresContext* aPresContext,
nsIFrame* aParentFrame, nsIFrame* aParentFrame,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsFrameItems& aChildItems, nsFrameItems& aChildItems,
nsAbsoluteItems& aFixedItems) nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
// Initialize OUT parameter // Initialize OUT parameter
@ -982,7 +983,7 @@ nsCSSFrameConstructor::TableProcessChildren(nsIPresContext* aPresContext,
aContent->ChildAt(i, *getter_AddRefs(childContent)); aContent->ChildAt(i, *getter_AddRefs(childContent));
rv = TableProcessChild(aPresContext, childContent, aParentFrame, parentStyleContext, rv = TableProcessChild(aPresContext, childContent, aParentFrame, parentStyleContext,
aAbsoluteItems, childFrame, aFixedItems); aAbsoluteItems, childFrame, aFixedItems, aTableCreator);
if (NS_SUCCEEDED(rv) && (nsnull != childFrame)) { if (NS_SUCCEEDED(rv) && (nsnull != childFrame)) {
aChildItems.AddChild(childFrame); aChildItems.AddChild(childFrame);
@ -999,9 +1000,12 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext,
nsIStyleContext* aParentStyleContext, nsIStyleContext* aParentStyleContext,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aChildFrame, nsIFrame*& aChildFrame,
nsAbsoluteItems& aFixedItems) nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
aChildFrame = nsnull;
if (nsnull != aChildContent) { if (nsnull != aChildContent) {
aChildFrame = nsnull; aChildFrame = nsnull;
nsCOMPtr<nsIStyleContext> childStyleContext; nsCOMPtr<nsIStyleContext> childStyleContext;
@ -1020,8 +1024,9 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext,
rv = ConstructFrame(aPresContext, aChildContent, aParentFrame, aAbsoluteItems, childItems, aFixedItems); rv = ConstructFrame(aPresContext, aChildContent, aParentFrame, aAbsoluteItems, childItems, aFixedItems);
aChildFrame = childItems.childList; aChildFrame = childItems.childList;
} else { } else {
nsCOMPtr<nsIAtom> tag; nsCOMPtr<nsIAtom> tag;
aChildContent->GetTag(*getter_AddRefs(tag)); aChildContent->GetTag(*getter_AddRefs(tag));
// forms need a frame but it can't be a child of an inner table
if (nsHTMLAtoms::form == tag) { if (nsHTMLAtoms::form == tag) {
// if the parent is a table, put the form in the outer table frame // if the parent is a table, put the form in the outer table frame
const nsStyleDisplay* parentDisplay = (const nsStyleDisplay*) const nsStyleDisplay* parentDisplay = (const nsStyleDisplay*)
@ -1038,24 +1043,27 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext,
aAbsoluteItems, childItems, aFixedItems); aAbsoluteItems, childItems, aFixedItems);
} }
aChildFrame = childItems.childList; aChildFrame = childItems.childList;
} else { // wrap it in a table cell, row, row group, table if it is not whitespace // wrap it in a table cell, row, row group, table if it is a valid tag or display
PRBool needCell = PR_TRUE; // and not whitespace. For example we don't allow map, head, body, etc.
nsIDOMCharacterData* domData = nsnull; } else {
nsresult rv2 = aChildContent->QueryInterface(kIDOMCharacterDataIID, (void**)&domData); if (TableIsValidCellContent(aPresContext, aParentFrame, aChildContent)) {
if ((NS_OK == rv2) && (nsnull != domData)) { PRBool needCell = PR_TRUE;
nsString charData; nsIDOMCharacterData* domData = nsnull;
domData->GetData(charData); nsresult rv2 = aChildContent->QueryInterface(kIDOMCharacterDataIID, (void**)&domData);
charData = charData.StripWhitespace(); if ((NS_OK == rv2) && (nsnull != domData)) {
if (charData.Length() <= 0) { nsString charData;
needCell = PR_FALSE; // only contains whitespace, don't create cell domData->GetData(charData);
charData = charData.StripWhitespace();
if ((charData.Length() <= 0) && (charData != " ")) { // XXX check this
needCell = PR_FALSE; // only contains whitespace, don't create cell
}
NS_RELEASE(domData);
}
if (needCell) {
nsIFrame* cellFrame;
rv = ConstructTableCellFrame(aPresContext, aChildContent, aParentFrame, childStyleContext,
aAbsoluteItems, aChildFrame, cellFrame, aFixedItems, aTableCreator);
} }
NS_RELEASE(domData);
}
if (needCell) {
nsIFrame* cellFrame;
nsTableCreator aTableCreator;
rv = ConstructTableCellFrame(aPresContext, aChildContent, aParentFrame, childStyleContext,
aAbsoluteItems, aChildFrame, cellFrame, aFixedItems, aTableCreator);
} }
} }
} }
@ -1063,6 +1071,71 @@ nsCSSFrameConstructor::TableProcessChild(nsIPresContext* aPresContext,
return rv; return rv;
} }
PRBool
nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext,
nsIFrame* aParentFrame,
nsIContent* aContent)
{
nsCOMPtr<nsIAtom> tag;
aContent->GetTag(*getter_AddRefs(tag));
nsCOMPtr<nsIStyleContext> styleContext;
nsresult rv = ResolveStyleContext(aPresContext, aParentFrame, aContent, tag, getter_AddRefs(styleContext));
if (NS_FAILED(rv)) {
return PR_FALSE;
}
const nsStyleDisplay* display = (const nsStyleDisplay*)
styleContext->GetStyleData(eStyleStruct_Display);
if (NS_STYLE_DISPLAY_NONE != display->mDisplay) {
return PR_FALSE;
}
// check tags first
if ( (nsHTMLAtoms::img == tag) ||
(nsHTMLAtoms::hr == tag) ||
(nsHTMLAtoms::br == tag) ||
(nsHTMLAtoms::wbr == tag) ||
(nsHTMLAtoms::input == tag) ||
(nsHTMLAtoms::textarea == tag) ||
(nsHTMLAtoms::select == tag) ||
(nsHTMLAtoms::applet == tag) ||
(nsHTMLAtoms::embed == tag) ||
(nsHTMLAtoms::fieldset == tag) ||
(nsHTMLAtoms::legend == tag) ||
(nsHTMLAtoms::object == tag) ||
(nsHTMLAtoms::form == tag) ||
(nsHTMLAtoms::iframe == tag) ||
(nsHTMLAtoms::spacer == tag) ||
(nsHTMLAtoms::button == tag) ||
(nsHTMLAtoms::label == tag )) {
return PR_TRUE;
}
#ifdef INCLUDE_XUL
if ( (nsXULAtoms::button == tag) ||
(nsXULAtoms::checkbox == tag) ||
(nsXULAtoms::radio == tag) ||
(nsXULAtoms::text == tag) ||
(nsXULAtoms::widget == tag) ||
(nsXULAtoms::tree == tag) ||
(nsXULAtoms::treechildren == tag) ||
(nsXULAtoms::treeitem == tag) ||
(nsXULAtoms::treecell == tag) ||
(nsXULAtoms::treeindentation == tag) ||
(nsXULAtoms::toolbox == tag) ||
(nsXULAtoms::toolbar == tag) ||
(nsXULAtoms::progressmeter == tag )) {
return PR_TRUE;
}
#endif
// we should check for display type as well - later
return PR_FALSE;
}
nsresult nsresult
nsCSSFrameConstructor::TableProcessChildLists(nsIPresContext* aPresContext, nsCSSFrameConstructor::TableProcessChildLists(nsIPresContext* aPresContext,
nsDeque* aParentChildPairs) nsDeque* aParentChildPairs)
@ -2348,6 +2421,47 @@ nsCSSFrameConstructor::IsScrollable(nsIPresContext* aPresContext,
return PR_FALSE; return PR_FALSE;
} }
nsresult
nsCSSFrameConstructor::ResolveStyleContext(nsIPresContext* aPresContext,
nsIFrame* aParentFrame,
nsIContent* aContent,
nsIAtom* aTag,
nsIStyleContext** aStyleContext)
{
nsresult rv = NS_OK;
// Resolve the style context based on the content object and the parent
// style context
nsCOMPtr<nsIStyleContext> parentStyleContext;
aParentFrame->GetStyleContext(getter_AddRefs(parentStyleContext));
if (nsLayoutAtoms::textTagName == aTag) {
// Use a special pseudo element style context for text
nsCOMPtr<nsIContent> parentContent;
if (nsnull != aParentFrame) {
aParentFrame->GetContent(getter_AddRefs(parentContent));
}
rv = aPresContext->ResolvePseudoStyleContextFor(parentContent,
nsHTMLAtoms::textPseudo,
parentStyleContext,
aStyleContext);
} else if (nsLayoutAtoms::commentTagName == aTag) {
// Use a special pseudo element style context for comments
nsCOMPtr<nsIContent> parentContent;
if (nsnull != aParentFrame) {
aParentFrame->GetContent(getter_AddRefs(parentContent));
}
rv = aPresContext->ResolvePseudoStyleContextFor(parentContent,
nsHTMLAtoms::commentPseudo,
parentStyleContext,
aStyleContext);
} else {
rv = aPresContext->ResolveStyleContextFor(aContent, parentStyleContext,
aStyleContext);
}
return rv;
}
nsresult nsresult
nsCSSFrameConstructor::ConstructFrame(nsIPresContext* aPresContext, nsCSSFrameConstructor::ConstructFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -2364,6 +2478,10 @@ nsCSSFrameConstructor::ConstructFrame(nsIPresContext* aPresContext,
nsCOMPtr<nsIAtom> tag; nsCOMPtr<nsIAtom> tag;
aContent->GetTag(*getter_AddRefs(tag)); aContent->GetTag(*getter_AddRefs(tag));
nsCOMPtr<nsIStyleContext> styleContext;
rv = ResolveStyleContext(aPresContext, aParentFrame, aContent, tag, getter_AddRefs(styleContext));
#ifdef chris_needs_to_remove_this
// Resolve the style context based on the content object and the parent // Resolve the style context based on the content object and the parent
// style context // style context
nsCOMPtr<nsIStyleContext> styleContext; nsCOMPtr<nsIStyleContext> styleContext;
@ -2394,6 +2512,7 @@ nsCSSFrameConstructor::ConstructFrame(nsIPresContext* aPresContext,
rv = aPresContext->ResolveStyleContextFor(aContent, parentStyleContext, rv = aPresContext->ResolveStyleContextFor(aContent, parentStyleContext,
getter_AddRefs(styleContext)); getter_AddRefs(styleContext));
} }
#endif
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
// Pre-check for display "none" - if we find that, don't create // Pre-check for display "none" - if we find that, don't create

Просмотреть файл

@ -101,6 +101,12 @@ public:
protected: protected:
nsresult ResolveStyleContext(nsIPresContext* aPresContext,
nsIFrame* aParentFrame,
nsIContent* aContent,
nsIAtom* aTag,
nsIStyleContext** aStyleContext);
nsresult ConstructFrame(nsIPresContext* aPresContext, nsresult ConstructFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
nsIFrame* aParentFrame, nsIFrame* aParentFrame,
@ -123,7 +129,7 @@ protected:
nsAbsoluteItems& aAboluteItems, nsAbsoluteItems& aAboluteItems,
nsIFrame*& aNewFrame, nsIFrame*& aNewFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructAnonymousTableFrame(nsIPresContext* aPresContext, nsresult ConstructAnonymousTableFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -131,7 +137,7 @@ protected:
nsIFrame*& aOuterFrame, nsIFrame*& aOuterFrame,
nsIFrame*& aInnerFrame, nsIFrame*& aInnerFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableCaptionFrame(nsIPresContext* aPresContext, nsresult ConstructTableCaptionFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -141,7 +147,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewCaptionFrame, nsIFrame*& aNewCaptionFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableGroupFrame(nsIPresContext* aPresContext, nsresult ConstructTableGroupFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -152,7 +158,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewGroupFrame, nsIFrame*& aNewGroupFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator, nsTableCreator& aTableCreator,
nsDeque* aToDo = nsnull); nsDeque* aToDo = nsnull);
nsresult ConstructTableGroupFrameOnly(nsIPresContext* aPresContext, nsresult ConstructTableGroupFrameOnly(nsIPresContext* aPresContext,
@ -165,7 +171,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewGroupFrame, nsIFrame*& aNewGroupFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableRowFrame(nsIPresContext* aPresContext, nsresult ConstructTableRowFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -175,7 +181,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewRowFrame, nsIFrame*& aNewRowFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator, nsTableCreator& aTableCreator,
nsDeque* aToDo = nsnull); nsDeque* aToDo = nsnull);
nsresult ConstructTableRowFrameOnly(nsIPresContext* aPresContext, nsresult ConstructTableRowFrameOnly(nsIPresContext* aPresContext,
@ -186,7 +192,7 @@ protected:
PRBool aProcessChildren, PRBool aProcessChildren,
nsIFrame*& aNewRowFrame, nsIFrame*& aNewRowFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableColFrame(nsIPresContext* aPresContext, nsresult ConstructTableColFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -196,7 +202,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewColFrame, nsIFrame*& aNewColFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableCellFrame(nsIPresContext* aPresContext, nsresult ConstructTableCellFrame(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -206,7 +212,7 @@ protected:
nsIFrame*& aNewTopMostFrame, nsIFrame*& aNewTopMostFrame,
nsIFrame*& aNewCellFrame, nsIFrame*& aNewCellFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult ConstructTableCellFrameOnly(nsIPresContext* aPresContext, nsresult ConstructTableCellFrameOnly(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
@ -216,14 +222,15 @@ protected:
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aNewFrame, nsIFrame*& aNewFrame,
nsAbsoluteItems& aFixedItems, nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator); nsTableCreator& aTableCreator);
nsresult TableProcessChildren(nsIPresContext* aPresContext, nsresult TableProcessChildren(nsIPresContext* aPresContext,
nsIContent* aContent, nsIContent* aContent,
nsIFrame* aParentFrame, nsIFrame* aParentFrame,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsFrameItems& aChildList, nsFrameItems& aChildList,
nsAbsoluteItems& aFixedItems); nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator);
nsresult TableProcessChild(nsIPresContext* aPresContext, nsresult TableProcessChild(nsIPresContext* aPresContext,
nsIContent* aChildContent, nsIContent* aChildContent,
@ -231,7 +238,8 @@ protected:
nsIStyleContext* aParentStyleContext, nsIStyleContext* aParentStyleContext,
nsAbsoluteItems& aAbsoluteItems, nsAbsoluteItems& aAbsoluteItems,
nsIFrame*& aChildFrame, nsIFrame*& aChildFrame,
nsAbsoluteItems& aFixedItems); nsAbsoluteItems& aFixedItems,
nsTableCreator& aTableCreator);
nsresult TableProcessChildLists(nsIPresContext* aPresContext, nsresult TableProcessChildLists(nsIPresContext* aPresContext,
nsDeque* aParentChildPairs); nsDeque* aParentChildPairs);
@ -240,6 +248,9 @@ protected:
nsIFrame* aFrame, nsIFrame* aFrame,
const nsStyleDisplay* aDisplayType); const nsStyleDisplay* aDisplayType);
PRBool TableIsValidCellContent(nsIPresContext* aPresContext,
nsIFrame* aParentFrame,
nsIContent* aContent);
const nsStyleDisplay* GetDisplay(nsIFrame* aFrame); const nsStyleDisplay* GetDisplay(nsIFrame* aFrame);