Backed out changeset 69c6dbdfd179

This commit is contained in:
Robert O'Callahan 2009-06-14 00:18:06 +12:00
Родитель b9b2bd7a9a
Коммит ba91e5bc8a
34 изменённых файлов: 74 добавлений и 859 удалений

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

@ -68,7 +68,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
var normalHyperlinkAcc = getAccessible("NormalHyperlink",
[nsIAccessibleHyperLink]);
testThis("NormalHyperlink", normalHyperlinkAcc, ROLE_LINK, 1,
"Mozilla Foundation", true, 17, 18);
"Mozilla Foundation", true, 18, 19);
is(normalHyperlinkAcc.getURI(0).spec, "http://www.mozilla.org/",
"URI wrong for normalHyperlinkElement!");
testStates(normalHyperlinkAcc,
@ -84,7 +84,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
var ariaHyperlinkAcc = getAccessible("AriaHyperlink",
[nsIAccessibleHyperLink]);
testThis("AriaHyperlink", ariaHyperlinkAcc, ROLE_LINK, 1,
"Mozilla Foundation Home", true, 30, 31);
"Mozilla Foundation Home", true, 32, 33);
testStates(ariaHyperlinkAcc,
(STATE_FOCUSABLE | STATE_LINKED),
(EXT_STATE_HORIZONTAL));
@ -110,7 +110,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
var imageMapHyperlinkAcc = getAccessible("imgmap",
[nsIAccessibleHyperLink]);
testThis("imgmap", imageMapHyperlinkAcc, ROLE_IMAGE_MAP, 2, "b", true,
79, 80);
83, 84);
is(imageMapHyperlinkAcc.getURI(0).spec,
"http://www.bbc.co.uk/radio4/atoz/index.shtml#b", "URI wrong!");
is(imageMapHyperlinkAcc.getURI(1).spec,
@ -137,7 +137,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
// empty hyperlink
var EmptyHLAcc = getAccessible("emptyLink",
[nsIAccessibleHyperLink]);
testThis("emptyLink", EmptyHLAcc, ROLE_LINK, 1, null, true, 94, 95);
testThis("emptyLink", EmptyHLAcc, ROLE_LINK, 1, null, true, 98, 99);
testStates(EmptyHLAcc,
(STATE_FOCUSABLE | STATE_LINKED),
(EXT_STATE_HORIZONTAL));
@ -148,7 +148,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
var hyperlinkWithSpanAcc = getAccessible("LinkWithSpan",
[nsIAccessibleHyperLink]);
testThis("LinkWithSpan", hyperlinkWithSpanAcc, ROLE_LINK, 1,
"Heise Online", true, 120, 121);
"Heise Online", true, 124, 125);
is(hyperlinkWithSpanAcc.getURI(0).spec, "http://www.heise.de/",
"URI wrong for hyperlinkElementWithSpan!");
testStates(hyperlinkWithSpanAcc,
@ -165,7 +165,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
var namedAnchorAcc = getAccessible("namedAnchor",
[nsIAccessibleHyperLink]);
testThis("namedAnchor", namedAnchorAcc, ROLE_LINK, 1,
"This should never be of state_linked", true, 197, 198);
"This should never be of state_linked", true, 202, 203);
testStates(namedAnchorAcc,
(STATE_SELECTABLE),
(EXT_STATE_HORIZONTAL), (STATE_FOCUSABLE | STATE_LINKED));
@ -176,7 +176,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
var noLinkAcc = getAccessible("noLink",
[nsIAccessibleHyperLink]);
testThis("noLink", noLinkAcc, ROLE_LINK, 1,
"This should never be of state_linked", true, 256, 257);
"This should never be of state_linked", true, 262, 263);
testStates(noLinkAcc,
0,
(EXT_STATE_HORIZONTAL), (STATE_FOCUSABLE | STATE_LINKED));
@ -187,7 +187,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
var linkWithClickAcc = getAccessible("linkWithClick",
[nsIAccessibleHyperLink]);
testThis("linkWithClick", linkWithClickAcc, ROLE_LINK, 1,
"This should have state_linked", true, 294, 295);
"This should have state_linked", true, 301, 302);
testStates(linkWithClickAcc,
(STATE_LINKED),
(EXT_STATE_HORIZONTAL));
@ -201,7 +201,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
// Link with title attribute, no name from the subtree (bug 438325).
var id = "linkWithTitleNoNameFromSubtree";
var linkAcc = getAccessible(id, [nsIAccessibleHyperLink]);
testThis(id, linkAcc, ROLE_LINK, 1, "Link with title", true, 346, 347);
testThis(id, linkAcc, ROLE_LINK, 1, "Link with title", true, 354, 355);
testStates(linkAcc,
(STATE_LINKED),
(EXT_STATE_HORIZONTAL));
@ -212,8 +212,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
// (bug 438325).
id = "linkWithTitleNameFromSubtree";
linkAcc = getAccessible(id, [nsIAccessibleHyperLink]);
testThis(id, linkAcc, ROLE_LINK, 1, "the name from subtree", true, 395,
396);
testThis(id, linkAcc, ROLE_LINK, 1, "the name from subtree", true, 403,
404);
testStates(linkAcc,
(STATE_LINKED),
(EXT_STATE_HORIZONTAL));
@ -223,8 +223,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
// Link with title attribute, name from the nested html:img (bug 438325).
id = "linkWithTitleNameFromImg";
linkAcc = getAccessible(id, [nsIAccessibleHyperLink]);
testThis(id, linkAcc, ROLE_LINK, 1, "The title for link", true, 449,
450);
testThis(id, linkAcc, ROLE_LINK, 1, "The title for link", true, 458,
459);
testStates(linkAcc,
(STATE_LINKED),
(EXT_STATE_HORIZONTAL));
@ -235,7 +235,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
id = "linkWithLabelNoNameFromSubtree";
linkAcc = getAccessible(id, [nsIAccessibleHyperLink]);
testThis(id, linkAcc, ROLE_LINK, 1, "Link with label and nested image:",
true, 452, 453);
true, 462, 463);
testStates(linkAcc,
(STATE_LINKED),
(EXT_STATE_HORIZONTAL));

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

@ -1918,7 +1918,7 @@ nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aStat
}
AddFrameConstructionItemsInternal(aState, container, aParentFrame, elemName,
kNameSpaceID_None, -1, pseudoStyleContext,
kNameSpaceID_None, pseudoStyleContext,
ITEM_IS_GENERATED_CONTENT, aItems);
}
@ -2630,7 +2630,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIContent* aDocEle
nsRefPtr<nsStyleContext> extraRef(styleContext);
FrameConstructionItem item(&rootTableData, aDocElement,
aDocElement->Tag(), kNameSpaceID_None,
-1, extraRef.forget());
extraRef.forget());
nsFrameItems frameItems;
// if the document is a table then just populate it.
@ -3722,8 +3722,7 @@ nsCSSFrameConstructor::FindHTMLData(nsIContent* aContent,
SIMPLE_TAG_CHAIN(mozgeneratedcontentimage,
nsCSSFrameConstructor::FindImgData),
{ &nsGkAtoms::br,
FCDATA_DECL(FCDATA_SKIP_FRAMEMAP | FCDATA_IS_LINE_PARTICIPANT |
FCDATA_IS_LINE_BREAK,
FCDATA_DECL(FCDATA_SKIP_FRAMEMAP | FCDATA_IS_LINE_PARTICIPANT,
NS_NewBRFrame) },
SIMPLE_TAG_CREATE(wbr, NS_NewWBRFrame),
SIMPLE_TAG_CHAIN(input, nsCSSFrameConstructor::FindInputData),
@ -5147,7 +5146,7 @@ nsCSSFrameConstructor::AddPageBreakItem(nsIContent* aContent,
// Lie about the tag and namespace so we don't trigger anything
// interesting during frame construction.
aItems.AppendItem(&sPageBreakData, aContent, nsCSSAnonBoxes::pageBreak,
kNameSpaceID_None, -1, pseudoStyle.forget());
kNameSpaceID_None, pseudoStyle.forget());
}
nsresult
@ -5159,7 +5158,7 @@ nsCSSFrameConstructor::ConstructFrame(nsFrameConstructorState& aState,
{
NS_PRECONDITION(nsnull != aParentFrame, "no parent frame");
FrameConstructionItemList items;
AddFrameConstructionItems(aState, aContent, -1, aParentFrame, items);
AddFrameConstructionItems(aState, aContent, aParentFrame, items);
for (FCItemIterator iter(items); !iter.IsDone(); iter.Next()) {
NS_ASSERTION(iter.item().DesiredParentType() == GetParentType(aParentFrame),
@ -5175,7 +5174,6 @@ nsCSSFrameConstructor::ConstructFrame(nsFrameConstructorState& aState,
void
nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState& aState,
nsIContent* aContent,
PRInt32 aContentIndex,
nsIFrame* aParentFrame,
FrameConstructionItemList& aItems)
{
@ -5194,7 +5192,7 @@ nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState& aState
AddFrameConstructionItemsInternal(aState, aContent, aParentFrame,
aContent->Tag(), aContent->GetNameSpaceID(),
aContentIndex, styleContext,
styleContext,
ITEM_ALLOW_XBL_BASE | ITEM_ALLOW_PAGE_BREAK,
aItems);
}
@ -5227,15 +5225,10 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
nsIFrame* aParentFrame,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
PRInt32 aContentIndex,
nsStyleContext* aStyleContext,
PRUint32 aFlags,
FrameConstructionItemList& aItems)
{
NS_ASSERTION(aContentIndex == -1 ||
aContent->GetParent()->GetChildAt(aContentIndex) == aContent,
"aContentIndex isn't the right content index");
// The following code allows the user to specify the base tag
// of an element using XBL. XUL and HTML objects (like boxes, menus, etc.)
// can then be extended arbitrarily.
@ -5379,7 +5372,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
}
FrameConstructionItem* item =
aItems.AppendItem(data, aContent, aTag, aNameSpaceID, aContentIndex,
aItems.AppendItem(data, aContent, aTag, aNameSpaceID,
styleContext.forget());
if (!item) {
if (isGeneratedContent) {
@ -5462,86 +5455,18 @@ static void DestroyContent(void *aObject,
NS_RELEASE(content);
}
/**
* Return true if the frame construction item pointed to by aIter will
* create a frame adjacent to a line boundary in the frame tree, and that
* line boundary is induced by a content node adjacent to the frame's
* content node in the content tree. The latter condition is necessary so
* that ContentAppended/ContentInserted/ContentRemoved can easily find any
* text nodes that were suppressed here.
*/
PRBool
nsCSSFrameConstructor::AtLineBoundary(FCItemIterator& aIter)
{
PRInt32 contentIndex = aIter.item().mContentIndex;
if (contentIndex < 0) {
// Anonymous, or location unknown, so we can't reliably tell where it
// is in the content tree
return PR_FALSE;
}
if (aIter.AtStart()) {
if (aIter.List()->HasLineBoundaryAtStart() &&
contentIndex == 0)
return PR_TRUE;
} else {
FCItemIterator prev = aIter;
prev.Prev();
PRInt32 prevIndex = prev.item().mContentIndex;
if (prev.item().IsLineBoundary() &&
prevIndex >= 0 && prevIndex + 1 == contentIndex)
return PR_TRUE;
}
FCItemIterator next = aIter;
next.Next();
if (next.IsDone()) {
if (aIter.List()->HasLineBoundaryAtEnd() &&
contentIndex == PRInt32(aIter.item().mContent->GetParent()->GetChildCount()) - 1)
return PR_TRUE;
} else {
if (next.item().IsLineBoundary() &&
contentIndex + 1 == next.item().mContentIndex)
return PR_TRUE;
}
return PR_FALSE;
}
nsresult
nsCSSFrameConstructor::ConstructFramesFromItem(nsFrameConstructorState& aState,
FCItemIterator& aIter,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
nsFrameItems& aFrameItems)
{
nsIFrame* adjParentFrame = aParentFrame;
FrameConstructionItem& item = aIter.item();
nsStyleContext* styleContext = item.mStyleContext;
AdjustParentFrame(adjParentFrame, item.mFCData, styleContext);
nsStyleContext* styleContext = aItem.mStyleContext;
AdjustParentFrame(adjParentFrame, aItem.mFCData, styleContext);
if (item.mIsText) {
// If this is collapsible whitespace next to a line boundary,
// don't create a frame. This also sets the
// FRAMETREE_DEPENDS_ON_CHARS flag in the text node.
// We don't do this for generated content, because some generated
// text content is empty text nodes that are about to be initialized.
// (We check mAdditionalStateBits because only the generated content
// container's frame construction item is marked with
// mIsGeneratedContent, and we might not have an aParentFrame.)
// We don't do it for content that may have XBL anonymous siblings,
// because they make it difficult to correctly create the frame
// due to dynamic changes.
if (AtLineBoundary(aIter) &&
!styleContext->GetStyleText()->NewlineIsSignificant() &&
aIter.List()->ParentHasNoXBLChildren() &&
!(aState.mAdditionalStateBits & NS_FRAME_GENERATED_CONTENT) &&
item.IsWhitespace())
return NS_OK;
// XXXroc Right now if you start with whitespace and then start adding chars
// (e.g. while editing) we reframe on every change, which seems dumb.
// Maybe we should use another flag here, or something.
return ConstructTextFrame(item.mFCData, aState, item.mContent,
if (aItem.mIsText) {
return ConstructTextFrame(aItem.mFCData, aState, aItem.mContent,
adjParentFrame, styleContext,
aFrameItems);
}
@ -5553,7 +5478,7 @@ nsCSSFrameConstructor::ConstructFramesFromItem(nsFrameConstructorState& aState,
}
nsFrameState savedStateBits = aState.mAdditionalStateBits;
if (item.mIsGeneratedContent) {
if (aItem.mIsGeneratedContent) {
// Ensure that frames created here are all tagged with
// NS_FRAME_GENERATED_CONTENT.
aState.mAdditionalStateBits |= NS_FRAME_GENERATED_CONTENT;
@ -5564,15 +5489,15 @@ nsCSSFrameConstructor::ConstructFramesFromItem(nsFrameConstructorState& aState,
// OK, though; we just need to do the property set so that the content will
// get cleaned up when the frame is destroyed.
aParentFrame->SetProperty(styleContext->GetPseudoType(),
item.mContent, DestroyContent);
aItem.mContent, DestroyContent);
// Now that we've passed ownership of item.mContent to the frame, unset
// Now that we've passed ownership of aItem.mContent to the frame, unset
// our generated content flag so we don't release or unbind it ourselves.
item.mIsGeneratedContent = PR_FALSE;
aItem.mIsGeneratedContent = PR_FALSE;
}
// XXXbz maybe just inline ConstructFrameFromItemInternal here or something?
nsresult rv = ConstructFrameFromItemInternal(item, aState, adjParentFrame,
nsresult rv = ConstructFrameFromItemInternal(aItem, aState, adjParentFrame,
aFrameItems);
aState.mAdditionalStateBits = savedStateBits;
@ -6136,61 +6061,6 @@ MaybeGetListBoxBodyFrame(nsIContent* aContainer, nsIContent* aChild)
}
#endif
void
nsCSSFrameConstructor::AddTextItemIfNeeded(nsIFrame* aParentFrame,
nsIContent* aParentContent,
PRInt32 aContentIndex,
FrameConstructionItemList& aItems)
{
NS_ASSERTION(aContentIndex >= 0 &&
aContentIndex < aParentContent->GetChildCount(),
"child index out of range");
nsIContent* content = aParentContent->GetChildAt(aContentIndex);
if (!content->IsNodeOfType(nsINode::eTEXT) ||
!content->HasFlag(FRAMETREE_DEPENDS_ON_CHARS)) {
// Not text, or not suppressed due to being all-whitespace (if it
// were being suppressed, it would have the FRAMETREE_DEPENDS_ON_CHARS
// flag)
return;
}
if (mPresShell->GetPrimaryFrameFor(content)) {
// Already has a frame, don't do anything.
return;
}
// OK, we should try to create something
const FrameConstructionData* data = FindTextData(aParentFrame);
if (!data)
return;
nsRefPtr<nsStyleContext> sc =
ResolveStyleContext(aParentFrame, content);
if (!sc)
return;
aItems.AppendItem(data, content, content->Tag(), content->GetNameSpaceID(),
aContentIndex, sc.forget());
}
void
nsCSSFrameConstructor::ReframeTextIfNeeded(nsIContent* aParentContent,
PRInt32 aContentIndex)
{
NS_ASSERTION(aContentIndex >= 0 &&
aContentIndex < aParentContent->GetChildCount(),
"child index out of range");
nsIContent* content = aParentContent->GetChildAt(aContentIndex);
if (!content->IsNodeOfType(nsINode::eTEXT) ||
!content->HasFlag(FRAMETREE_DEPENDS_ON_CHARS)) {
// Not text, or not suppressed due to being all-whitespace (if it
// were being suppressed, it would have the FRAMETREE_DEPENDS_ON_CHARS
// flag)
return;
}
if (mPresShell->GetPrimaryFrameFor(content)) {
// Already has a frame, don't do anything.
return;
}
ContentInserted(aParentContent, content, aContentIndex, nsnull);
}
nsresult
nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
PRInt32 aNewIndexInContainer)
@ -6329,8 +6199,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
// If the frame we are manipulating is a ``special'' frame (that is, one
// that's been created as a result of a block-in-inline situation) then we
// need to append to the last special sibling, not to the frame itself.
PRBool parentSpecial = IsFrameSpecial(parentFrame);
if (parentSpecial) {
if (IsFrameSpecial(parentFrame)) {
#ifdef DEBUG
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::ContentAppended: parentFrame=");
@ -6349,9 +6218,10 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
// before the AdjustAppendParentForAfterContent call.
parentFrame = nsLayoutUtils::GetLastContinuationWithChild(parentFrame);
nsIAtom* frameType = parentFrame->GetType();
// We should never get here with fieldsets, since they have multiple
// insertion points.
NS_ASSERTION(parentFrame->GetType() != nsGkAtoms::fieldSetFrame,
NS_ASSERTION(frameType != nsGkAtoms::fieldSetFrame,
"Unexpected parent");
// Deal with possible :after generated content on the parent
@ -6382,26 +6252,11 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
state.mFrameManager, containingBlock);
}
nsIAtom* frameType = parentFrame->GetType();
FrameConstructionItemList items;
if (aNewIndexInContainer > 0) {
// If there's a text node in the normal content list just before
// the new items, and it has no frame, make a frame construction item
// for it. If it doesn't need a frame, ConstructFramesFromItemList
// below won't give it one.
// Because we're appending, we don't need to worry about any text
// after the appended content; there can only be XBL anonymous content
// (text in an XBL binding is not suppressed) or generated content
// (and bare text nodes are not generated). Native anonymous content
// generated by frames never participates in inline layout.
AddTextItemIfNeeded(parentFrame, aContainer,
aNewIndexInContainer - 1, items);
}
for (PRUint32 i = aNewIndexInContainer, count = aContainer->GetChildCount();
i < count;
++i) {
AddFrameConstructionItems(state, aContainer->GetChildAt(i), i, parentFrame,
AddFrameConstructionItems(state, aContainer->GetChildAt(i), parentFrame,
items);
}
@ -6419,24 +6274,6 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
}
LAYOUT_PHASE_TEMP_REENTER();
// If the parent is a block frame, and we're not in a special case
// where frames can be moved around, determine if the list is for the
// start or end of the block.
if (nsLayoutUtils::GetAsBlock(parentFrame) && !haveFirstLetterStyle &&
!haveFirstLineStyle && !parentSpecial) {
items.SetLineBoundaryAtStart(!prevSibling ||
!prevSibling->GetStyleDisplay()->IsInlineOutside() ||
prevSibling->GetType() == nsGkAtoms::brFrame);
// :after content can't be <br> so no need to check it
items.SetLineBoundaryAtEnd(!parentAfterFrame ||
!parentAfterFrame->GetStyleDisplay()->IsInlineOutside());
}
// To suppress whitespace-only text frames, we have to verify that
// our container's DOM child list matches its flattened tree child list.
// This is guaranteed to be true if GetXBLChildNodesFor() returns null.
items.SetParentHasNoXBLChildren(
!mDocument->BindingManager()->GetXBLChildNodesFor(aContainer));
nsFrameItems frameItems;
ConstructFramesFromItemList(state, items, parentFrame, frameItems);
@ -6748,23 +6585,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
}
FrameConstructionItemList items;
if (aIndexInContainer > 0) {
// If there's a text node in the normal content list just before
// the new node, and it has no frame, make a frame construction item
// for it, because it might need a frame now.
AddTextItemIfNeeded(parentFrame, aContainer, aIndexInContainer - 1,
items);
}
AddFrameConstructionItems(state, aChild, aIndexInContainer, parentFrame, items);
if (aIndexInContainer + 1 < PRInt32(aContainer->GetChildCount())) {
// If there's a text frame in the normal content list just after
// the new node, and it has no frame, make a frame construction item
// for it, because it might need a frame now.
AddTextItemIfNeeded(parentFrame, aContainer, aIndexInContainer + 1,
items);
}
AddFrameConstructionItems(state, aChild, parentFrame, items);
// Perform special check for diddling around with the frames in
// a special inline frame.
@ -6778,10 +6599,8 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
}
LAYOUT_PHASE_TEMP_REENTER();
// If the container is a table and a caption will be appended, it needs to be
// if the container is a table and a caption will be appended, it needs to be
// put in the outer table frame's additional child list.
// We make no attempt here to set flags to indicate whether the list
// will be at the start or end of a block. It doesn't seem worthwhile.
nsFrameItems frameItems, captionItems;
ConstructFramesFromItemList(state, items, parentFrame, frameItems);
@ -7132,7 +6951,6 @@ nsresult
nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
nsIContent* aChild,
PRInt32 aIndexInContainer,
RemoveFlags aFlags,
PRBool* aDidReconstruct)
{
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
@ -7358,23 +7176,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
RecoverLetterFrames(containingBlock);
}
// If we're just reconstructing frames for the element, then the
// following ContentInserted notification on the element will
// take care of fixing up any adjacent text nodes.
if (aContainer && aIndexInContainer >= 0 &&
aFlags != REMOVE_FOR_RECONSTRUCTION) {
// Adjacent whitespace-only text nodes might have been suppressed if
// this node does not have inline ends. Create frames for them now
// if necessary.
if (aIndexInContainer > 0) {
ReframeTextIfNeeded(aContainer, aIndexInContainer - 1);
}
PRInt32 childCount = aContainer->GetChildCount();
if (aIndexInContainer < childCount) {
ReframeTextIfNeeded(aContainer, aIndexInContainer);
}
}
#ifdef DEBUG
if (gReallyNoisyContentUpdates && parentFrame) {
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
@ -9050,9 +8851,7 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIContent* aContent)
nsINode* containerNode = aContent->GetNodeParent();
if (containerNode) {
// XXXbz what if this is anonymous content?
// XXXroc should we recreate frames for the container here instead?
PRInt32 indexInContainer = containerNode->IndexOf(aContent);
// Before removing the frames associated with the content object,
// ask them to save their state onto a temporary state object.
CaptureStateForFramesOf(aContent, mTempFrameTreeState);
@ -9064,8 +8863,7 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIContent* aContent)
// Remove the frames associated with the content object on which
// the attribute change occurred.
PRBool didReconstruct;
rv = ContentRemoved(container, aContent, indexInContainer,
REMOVE_FOR_RECONSTRUCTION, &didReconstruct);
rv = ContentRemoved(container, aContent, indexInContainer, &didReconstruct);
if (NS_SUCCEEDED(rv) && !didReconstruct) {
// Now, recreate the frames associated with this content object. If
@ -9395,7 +9193,6 @@ nsCSSFrameConstructor::CreateNeededTablePseudos(FrameConstructionItemList& aItem
// to match that of our first child item to
// match the old behavior
iter.item().mNameSpaceID,
-1,
wrapperStyle.forget());
if (!newItem) {
@ -9410,15 +9207,6 @@ nsCSSFrameConstructor::CreateNeededTablePseudos(FrameConstructionItemList& aItem
newItem->mIsAllInline = newItem->mHasInlineEnds =
newItem->mStyleContext->GetStyleDisplay()->IsInlineOutside();
// Table pseudo frames always induce line boundaries around their
// contents.
newItem->mChildItems.SetLineBoundaryAtStart(PR_TRUE);
newItem->mChildItems.SetLineBoundaryAtEnd(PR_TRUE);
// The parent of the items in aItems is also the parent of the items
// in mChildItems
newItem->mChildItems.SetParentHasNoXBLChildren(
aItems.ParentHasNoXBLChildren());
// Eat up all items between |iter| and |endIter| and put them in our wrapper
// Advances |iter| to point to |endIter|.
iter.AppendItemsToList(endIter, newItem->mChildItems);
@ -9503,13 +9291,6 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
FrameConstructionItemList itemsToConstruct;
nsresult rv = NS_OK;
// If we have first-letter or first-line style then frames can get
// moved around so don't set these flags.
if (aAllowBlockStyles && !haveFirstLetterStyle && !haveFirstLineStyle) {
itemsToConstruct.SetLineBoundaryAtStart(PR_TRUE);
itemsToConstruct.SetLineBoundaryAtEnd(PR_TRUE);
}
// Create any anonymous frames we need here. This must happen before the
// non-anonymous children are processed to ensure that popups are never
// constructed before the popupset.
@ -9523,7 +9304,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
"CreateAnonymousFrames manually and not follow the standard "
"ProcessChildren() codepath for this frame");
#endif
AddFrameConstructionItems(aState, anonymousItems[i], -1, aFrame,
AddFrameConstructionItems(aState, anonymousItems[i], aFrame,
itemsToConstruct);
}
@ -9549,10 +9330,8 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
for (ChildIterator::Init(aContent, &iter, &last);
iter != last;
++iter) {
PRInt32 i = iter.XBLInvolved() ? -1 : iter.position();
AddFrameConstructionItems(aState, *iter, i, aFrame, itemsToConstruct);
AddFrameConstructionItems(aState, *iter, aFrame, itemsToConstruct);
}
itemsToConstruct.SetParentHasNoXBLChildren(!iter.XBLInvolved());
if (aCanHaveGeneratedContent) {
// Probe for generated content after
@ -10589,7 +10368,7 @@ nsCSSFrameConstructor::CreateListBoxContent(nsPresContext* aPresContext,
FrameConstructionItemList items;
AddFrameConstructionItemsInternal(state, aChild, aParentFrame,
aChild->Tag(), aChild->GetNameSpaceID(),
-1, styleContext, ITEM_ALLOW_XBL_BASE,
styleContext, ITEM_ALLOW_XBL_BASE,
items);
ConstructFramesFromItemList(state, items, aParentFrame, frameItems);
@ -10959,9 +10738,8 @@ nsCSSFrameConstructor::BuildInlineChildItems(nsFrameConstructorState& aState,
nsRefPtr<nsStyleContext> childContext =
ResolveStyleContext(parentStyleContext, content);
PRInt32 i = iter.XBLInvolved() ? -1 : iter.position();
AddFrameConstructionItemsInternal(aState, content, nsnull, content->Tag(),
content->GetNameSpaceID(), i, childContext,
content->GetNameSpaceID(), childContext,
ITEM_ALLOW_XBL_BASE | ITEM_ALLOW_PAGE_BREAK,
aParentItem.mChildItems);
}

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

@ -116,11 +116,9 @@ public:
PRInt32 aIndexInContainer,
nsILayoutHistoryState* aFrameState);
enum RemoveFlags { REMOVE_CONTENT, REMOVE_FOR_RECONSTRUCTION };
nsresult ContentRemoved(nsIContent* aContainer,
nsIContent* aChild,
PRInt32 aIndexInContainer,
RemoveFlags aFlags,
PRBool* aDidReconstruct);
nsresult CharacterDataChanged(nsIContent* aContent,
@ -322,14 +320,8 @@ private:
// Add the frame construction items for the given aContent and aParentFrame
// to the list. This might add more than one item in some rare cases.
// aContentIndex is the index of aContent in its parent's child list,
// or -1 if it's not in its parent's child list, or the index is
// not known. If the index is not known, optimizations that
// may suppress the construction of white-space-only text frames
// may not be performed.
void AddFrameConstructionItems(nsFrameConstructorState& aState,
nsIContent* aContent,
PRInt32 aContentIndex,
nsIFrame* aParentFrame,
FrameConstructionItemList& aItems);
@ -582,20 +574,17 @@ private:
/* If FCDATA_IS_INLINE is set, then the frame is a non-replaced CSS
inline box. */
#define FCDATA_IS_INLINE 0x2000
/* If FCDATA_IS_LINE_PARTICIPANT is set, the frame is something that will
/* If FCDATA_IS_LINE_PARTICIPANT is set, the the frame is something that will
return true for IsFrameOfType(nsIFrame::eLineParticipant) */
#define FCDATA_IS_LINE_PARTICIPANT 0x4000
/* If FCDATA_IS_LINE_BREAK is set, the frame is something that will
induce a line break boundary before and after itself. */
#define FCDATA_IS_LINE_BREAK 0x8000
/* If FCDATA_ALLOW_BLOCK_STYLES is set, allow block styles when processing
children. This should not be used with FCDATA_FUNC_IS_FULL_CTOR. */
#define FCDATA_ALLOW_BLOCK_STYLES 0x10000
#define FCDATA_ALLOW_BLOCK_STYLES 0x8000
/* If FCDATA_USE_CHILD_ITEMS is set, then use the mChildItems in the relevant
FrameConstructionItem instead of trying to process the content's children.
This can be used with or without FCDATA_FUNC_IS_FULL_CTOR.
The child items might still need table pseudo processing. */
#define FCDATA_USE_CHILD_ITEMS 0x20000
#define FCDATA_USE_CHILD_ITEMS 0x10000
/* Structure representing information about how a frame should be
constructed. */
@ -673,10 +662,7 @@ private:
FrameConstructionItemList() :
mInlineCount(0),
mLineParticipantCount(0),
mItemCount(0),
mLineBoundaryAtStart(PR_FALSE),
mLineBoundaryAtEnd(PR_FALSE),
mParentHasNoXBLChildren(PR_FALSE)
mItemCount(0)
{
PR_INIT_CLIST(&mItems);
memset(mDesiredParentCounts, 0, sizeof(mDesiredParentCounts));
@ -694,14 +680,6 @@ private:
// but that's OK at this point.
}
void SetLineBoundaryAtStart(PRBool aBoundary) { mLineBoundaryAtStart = aBoundary; }
void SetLineBoundaryAtEnd(PRBool aBoundary) { mLineBoundaryAtEnd = aBoundary; }
void SetParentHasNoXBLChildren(PRBool aHasNoXBLChildren) {
mParentHasNoXBLChildren = aHasNoXBLChildren;
}
PRBool HasLineBoundaryAtStart() { return mLineBoundaryAtStart; }
PRBool HasLineBoundaryAtEnd() { return mLineBoundaryAtEnd; }
PRBool ParentHasNoXBLChildren() { return mParentHasNoXBLChildren; }
PRBool IsEmpty() const { return PR_CLIST_IS_EMPTY(&mItems); }
PRBool AnyItemsNeedBlockParent() const { return mLineParticipantCount != 0; }
PRBool AreAllItemsInline() const { return mInlineCount == mItemCount; }
@ -717,19 +695,15 @@ private:
return mDesiredParentCounts[aDesiredParentType] == mItemCount;
}
// aContentIndex is the index of aContent in its parent's child list,
// or -1 if aContent is not in its parent's child list, or the index
// is not known.
FrameConstructionItem* AppendItem(const FrameConstructionData* aFCData,
nsIContent* aContent,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
PRInt32 aContentIndex,
already_AddRefed<nsStyleContext> aStyleContext)
{
FrameConstructionItem* item =
new FrameConstructionItem(aFCData, aContent, aTag, aNameSpaceID,
aContentIndex, aStyleContext);
aStyleContext);
if (item) {
PR_APPEND_LINK(item, &mItems);
++mItemCount;
@ -773,10 +747,6 @@ private:
return *this;
}
FrameConstructionItemList* List() {
return &mList;
}
operator FrameConstructionItem& () {
return item();
}
@ -790,10 +760,6 @@ private:
NS_ASSERTION(!IsDone(), "Should have checked IsDone()!");
mCurrent = PR_NEXT_LINK(mCurrent);
}
void Prev() {
NS_ASSERTION(!AtStart(), "Should have checked AtStart()!");
mCurrent = PR_PREV_LINK(mCurrent);
}
void SetToEnd() { mCurrent = mEnd; }
// Skip over all items that want a parent type different from the given
@ -855,14 +821,6 @@ private:
PRUint32 mLineParticipantCount;
PRUint32 mItemCount;
PRUint32 mDesiredParentCounts[eParentTypeCount];
// True if there is guaranteed to be a line boundary before the
// frames created by these items
PRPackedBool mLineBoundaryAtStart;
// True if there is guaranteed to be a line boundary after the
// frames created by these items
PRPackedBool mLineBoundaryAtEnd;
// True if the parent is guaranteed to have no XBL anonymous children
PRPackedBool mParentHasNoXBLChildren;
};
typedef FrameConstructionItemList::Iterator FCItemIterator;
@ -878,11 +836,9 @@ private:
nsIContent* aContent,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
PRInt32 aContentIndex,
already_AddRefed<nsStyleContext> aStyleContext) :
mFCData(aFCData), mContent(aContent), mTag(aTag),
mNameSpaceID(aNameSpaceID), mContentIndex(aContentIndex),
mStyleContext(aStyleContext),
mNameSpaceID(aNameSpaceID), mStyleContext(aStyleContext),
mIsText(PR_FALSE), mIsGeneratedContent(PR_FALSE),
mIsRootPopupgroup(PR_FALSE), mIsAllInline(PR_FALSE),
mHasInlineEnds(PR_FALSE), mIsPopup(PR_FALSE),
@ -904,10 +860,6 @@ private:
// things.
PRBool IsWhitespace() const;
PRBool IsLineBoundary() const {
return !mHasInlineEnds || (mFCData->mBits & FCDATA_IS_LINE_BREAK);
}
// The FrameConstructionData to use.
const FrameConstructionData* mFCData;
// The nsIContent node to use when initializing the new frame.
@ -916,15 +868,12 @@ private:
nsIAtom* mTag;
// The XBL-resolved namespace to use for frame construction.
PRInt32 mNameSpaceID;
// The index of mContent in its parent's child list, or -1 if it's
// not in the parent's child list or not known.
PRInt32 mContentIndex;
// The style context to use for creating the new frame.
nsRefPtr<nsStyleContext> mStyleContext;
// Whether this is a text content item.
PRPackedBool mIsText;
// Whether this is a generated content container.
// If it is, mContent is a strong pointer.
// Whether this is generated content. If it is, mContent is a strong
// pointer.
PRPackedBool mIsGeneratedContent;
// Whether this is an item for the root popupgroup.
PRPackedBool mIsRootPopupgroup;
@ -1023,18 +972,6 @@ private:
nsStyleContext* aStyleContext,
nsFrameItems& aFrameItems);
// If aParentContent's child at aContentIndex is a text node and
// doesn't have a frame, append a frame construction item for it to aItems.
void AddTextItemIfNeeded(nsIFrame* aParentFrame,
nsIContent* aParentContent,
PRInt32 aContentIndex,
FrameConstructionItemList& aItems);
// If aParentContent's child at aContentIndex is a text node and
// doesn't have a frame, try to create a frame for it.
void ReframeTextIfNeeded(nsIContent* aParentContent,
PRInt32 aContentIndex);
void AddPageBreakItem(nsIContent* aContent,
nsStyleContext* aMainStyleContext,
FrameConstructionItemList& aItems);
@ -1090,24 +1027,15 @@ private:
nsIFrame* aParentFrame,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
PRInt32 aContentIndex,
nsStyleContext* aStyleContext,
PRUint32 aFlags,
FrameConstructionItemList& aItems);
/**
* Construct frames for the given item list and parent frame, and put the
* resulting frames in aFrameItems.
*/
nsresult ConstructFramesFromItemList(nsFrameConstructorState& aState,
FrameConstructionItemList& aItems,
nsIFrame* aParentFrame,
nsFrameItems& aFrameItems);
// On success, always puts something in aChildItems
nsresult ConstructFramesFromItem(nsFrameConstructorState& aState,
FCItemIterator& aItem,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
nsFrameItems& aFrameItems);
static PRBool AtLineBoundary(FCItemIterator& aIter);
nsresult CreateAnonymousFrames(nsFrameConstructorState& aState,
nsIContent* aParent,
@ -1422,6 +1350,15 @@ private:
void BuildInlineChildItems(nsFrameConstructorState& aState,
FrameConstructionItem& aParentItem);
/**
* Construct frames for the given item list and parent frame, and put the
* resulting frames in aFrameItems.
*/
nsresult ConstructFramesFromItemList(nsFrameConstructorState& aState,
FrameConstructionItemList& aItems,
nsIFrame* aParentFrame,
nsFrameItems& aFrameItems);
// Determine whether we need to wipe out what we just did and start over
// because we're doing something like adding block kids to an inline frame
// (and therefore need an {ib} split). aPrevSibling must be correct, even in

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

@ -5003,9 +5003,8 @@ PresShell::ContentRemoved(nsIDocument *aDocument,
mFrameConstructor->RestyleForRemove(aContainer, aChild, aIndexInContainer);
PRBool didReconstruct;
mFrameConstructor->ContentRemoved(aContainer, aChild, aIndexInContainer,
nsCSSFrameConstructor::REMOVE_CONTENT,
&didReconstruct);
mFrameConstructor->ContentRemoved(aContainer, aChild,
aIndexInContainer, &didReconstruct);
VERIFY_STYLE_TREE;
}

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

@ -15,6 +15,5 @@
<tr><td><iframe class="tall"></iframe></td></tr>
</tbody>
</table>
<br>
</body>
</html>

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

@ -16,6 +16,5 @@
<tr><td><iframe class="tall"></iframe></td></tr>
</tfoot>
</table>
<br>
</body>
</html>

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

@ -1,9 +0,0 @@
<!DOCTYPE HTML>
<html>
<body style="border:1px solid black;">
&nbsp;&nbsp;Hello<br>
&nbsp;&nbsp;Hello<br>
<br>
Hello
</body>
</html>

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

@ -1,21 +0,0 @@
<!DOCTYPE HTML>
<html>
<!-- Test that changes to 'white-space' create frames when necessary -->
<head>
<script>
function loaded() {
document.body.offsetHeight;
document.getElementById('d1').style.whiteSpace = 'pre';
document.getElementById('d2').style.whiteSpace = 'pre-wrap';
document.getElementById('d3').style.whiteSpace = 'pre-line';
}
</script>
</head>
<body onload="loaded()" style="border:1px solid black;">
<div id="d1"> <span>Hello</span> </div>
<div id="d2"> <span>Hello</span> </div>
<div id="d3">
<span>Hello</span>
</div>
</body>
</html>

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

@ -1,11 +0,0 @@
<!DOCTYPE HTML>
<html>
<!-- Test that 'white-space' creates frames when necessary -->
<body style="border:1px solid black;">
<div style="white-space:pre"> <span>Hello</span> </div>
<div style="white-space:pre-wrap"> <span>Hello</span> </div>
<div style="white-space:pre-line">
<span>Hello</span>
</div>
</body>
</html>

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

@ -1,7 +0,0 @@
<!DOCTYPE HTML>
<html>
<!-- Test that 'white-space' creates text frames between blocks when necessary -->
<body style="border:1px solid black; white-space:pre"> Hello<div></div> Hello
<div></div>
Hello</body>
</html>

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

@ -1,7 +0,0 @@
<!DOCTYPE HTML>
<html>
<!-- Test that 'white-space' creates text frames between blocks when necessary -->
<body style="border:1px solid black; white-space:pre-wrap"> Hello<div></div> Hello
<div></div>
Hello</body>
</html>

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

@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<!-- Test that 'white-space' creates between text frames blocks (dynamically) when necessary -->
<head>
<script>
function loaded() {
document.body.offsetHeight;
document.body.style.whiteSpace = 'pre';
}
</script>
</head>
<body onload="loaded()" style="border:1px solid black;"> Hello<div></div> Hello
<div></div>
Hello</body>
</html>

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

@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<!-- Test that 'white-space' creates text frames between blocks (dynamically) when necessary -->
<head>
<script>
function loaded() {
document.body.offsetHeight;
document.body.style.whiteSpace = 'pre-wrap';
}
</script>
</head>
<body onload="loaded()" style="border:1px solid black;"> Hello<div></div> Hello
<div></div>
Hello</body>
</html>

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

@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body > div { border:1px solid black; margin:1em; }
</style>
</head>
<body>
<div><span>Hello</span> <span>Kitty</span></div>
<div><span>Hello</span> <span>Kitty</span></div>
<div><span>Hello</span> <span>Kitty</span></div>
<div><span>Hello</span> <span>Kitty</span></div>
</body>
</html>

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

@ -1,29 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test that removing a block element can create frames for text around it -->
<style>
body > div { border:1px solid black; margin:1em; }
</style>
<script>
function remove(id) {
var e = document.getElementById(id);
e.parentNode.removeChild(e);
}
function loaded() {
document.body.offsetHeight;
remove("d1");
remove("d2");
remove("d3");
remove("d4");
}
</script>
</head>
<body onload="loaded()">
<div><span>Hello</span><div id="d1">X</div> <span>Kitty</span></div>
<div><span>Hello</span> <div id="d2">X</div><span>Kitty</span></div>
<!-- we'll create frames here, but they won't make a difference to the rendering -->
<div><div id="d3">X</div> <span>Hello</span> <span>Kitty</span></div>
<div><span>Hello</span> <span>Kitty</span> <div id="d4">X</div></div>
</body>
</html>

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

@ -1,33 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test that inserting inline content can create frames for text around it -->
<style>
body > div { border:1px solid black; margin:1em; }
</style>
<script>
function makeSpan(text) {
var e = document.createElement("span");
e.textContent = text;
return e;
}
function loaded() {
document.body.offsetHeight;
var d1 = document.getElementById("d1");
d1.insertBefore(makeSpan("Hello"), d1.firstChild);
var d2 = document.getElementById("d2");
d2.appendChild(makeSpan("Kitty"));
var d3 = document.getElementById("d3");
d3.insertBefore(makeSpan("Hello"), d3.firstChild.nextSibling);
var d4 = document.getElementById("d4");
d4.insertBefore(makeSpan("Kitty"), d4.lastChild);
}
</script>
</head>
<body onload="loaded()">
<div id="d1"> <span>Kitty</span></div>
<div id="d2"><span>Hello</span> </div>
<div id="d3"><div></div> <span>Kitty</span></div>
<div id="d4"><span>Hello</span> <div></div></div>
</body>
</html>

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

@ -1,35 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test that insertions work in the presence of display:none elements that
separate whitespace from block boundaries -->
<style>
body > div { border:1px solid black; margin:1em; }
em { display:none; }
</style>
<script>
function makeSpan(text) {
var e = document.createElement("span");
e.textContent = text;
return e;
}
function loaded() {
document.body.offsetHeight;
var d1 = document.getElementById("d1");
d1.insertBefore(makeSpan("Hello"), d1.firstChild);
var d2 = document.getElementById("d2");
d2.appendChild(makeSpan("Kitty"));
var d3 = document.getElementById("d3");
d3.insertBefore(makeSpan("Hello"), d3.firstChild.nextSibling);
var d4 = document.getElementById("d4");
d4.insertBefore(makeSpan("Kitty"), d4.lastChild);
}
</script>
</head>
<body onload="loaded()">
<div id="d1"><em>X</em> <span>Kitty</span></div>
<div id="d2"><span>Hello</span> <em>X</em></div>
<div id="d3"><div></div><em>X</em> <span>Kitty</span></div>
<div id="d4"><span>Hello</span> <em>X</em><div></div></div>
</body>
</html>

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

@ -1,27 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test that before/after generated content stops suppression correctly,
both statically and dynamically -->
<style>
body > div { border:1px solid black; margin:1em; }
#d1:before { content:"Hello"; }
#d2:after { content:"Kitty"; }
#d3.c:before { content:"Hello"; }
#d4.c:after { content:"Kitty"; }
</style>
<script>
function loaded() {
document.body.offsetHeight;
document.getElementById("d3").setAttribute("class", "c");
document.getElementById("d4").setAttribute("class", "c");
}
</script>
</head>
<body onload="loaded()">
<div id="d1"> <span>Kitty</span></div>
<div id="d2"><span>Hello</span> </div>
<div id="d3"> <span>Kitty</span></div>
<div id="d4"><span>Hello</span> </div>
</body>
</html>

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

@ -1,29 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test that reframing content stops suppression around it correctly
and that setting text content twice works. Setting text node contents
twice may fail if we create a frame, then reframe, and botch the second
reframe. -->
<style>
body > div { border:1px solid black; margin:1em; }
</style>
<script>
function loaded() {
document.body.offsetHeight;
document.getElementById("d1").style.display = 'inline';
document.getElementById("d2").style.display = 'inline';
document.getElementById("d3").firstChild.data = "H ";
document.getElementById("d3").firstChild.data = "Hello ";
document.getElementById("d4").lastChild.data = " K";
document.getElementById("d4").lastChild.data = " Kitty";
}
</script>
</head>
<body onload="loaded()">
<div><div id="d1">Hello</div> <span>Kitty</span></div>
<div><span>Hello</span> <div id="d2">Kitty</div></div>
<div id="d3"> <span>Kitty</span></div>
<div id="d4"><span>Hello</span> </div>
</body>
</html>

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

@ -1,39 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Test that suppression works (or is turned off) for XBL content -->
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="before">
<content>Hello<children/></content>
</binding>
<binding id="after">
<content><children/>Kitty</content>
</binding>
<binding id="empty1">
<content><div xmlns="http://www.w3.org/1999/xhtml">Hello</div><children/></content>
</binding>
<binding id="empty2">
<content><children/><div xmlns="http://www.w3.org/1999/xhtml">Kitty</div></content>
</binding>
</bindings>
<style>
body > div { border:1px solid black; margin:1em; }
#d1 { -moz-binding:url(#before); }
#d2 { -moz-binding:url(#after); }
#d3 { -moz-binding:url(#empty1); }
#d4 { -moz-binding:url(#empty2); }
</style>
<script>
function loaded() {
document.body.offsetHeight;
document.getAnonymousNodes(document.getElementById("d3"))[0].style.display = 'inline';
document.getAnonymousNodes(document.getElementById("d4"))[2].style.display = 'inline';
}
</script>
</head>
<body onload="loaded()">
<div id="d1"> <span>Kitty</span></div>
<div id="d2"><span>Hello</span> </div>
<div id="d3"> <span>Kitty</span></div>
<div id="d4"><span>Hello</span> </div>
</body>
</html>

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

@ -1,29 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test that removing a <br> can create frames for text around it -->
<style>
body > div { border:1px solid black; margin:1em; }
</style>
<script>
function remove(id) {
var e = document.getElementById(id);
e.parentNode.removeChild(e);
}
function loaded() {
document.body.offsetHeight;
remove("b1");
remove("b2");
remove("b3");
remove("b4");
}
</script>
</head>
<body onload="loaded()">
<div><span>Hello</span><br id="b1"> <span>Kitty</span></div>
<div><span>Hello</span> <br id="b2"><span>Kitty</span></div>
<!-- we'll create frames here, but they won't make a difference to the rendering -->
<div><br id="b3"> <span>Hello</span> <span>Kitty</span></div>
<div><span>Hello</span> <span>Kitty</span> <br id="b4"></div>
</body>
</html>

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

@ -1,18 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test appends -->
<style>
body > div { border:1px solid black; margin:1em; }
#d2:after { content:"Kitty"; }
#d3:after { content:"ty"; }
</style>
<script>function flush() { document.body.offsetHeight; }</script>
</head>
<body>
<div id="d1"><span>Hello</span> <script>flush();</script><span>Kitty</span></div>
<div id="d2"><script>flush();</script><span>Hello</span> </div>
<div id="d3"><span>Hello</span> <script>flush();</script><span>Kit</span></div>
<div id="d4"><span>Hello</span><script>flush();</script> <span>Kitty</span></div>
</body>
</html>

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

@ -1,30 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test that setting a block element to display:none can create frames
for text around it -->
<style>
body > div { border:1px solid black; margin:1em; }
</style>
<script>
function hide(id) {
var e = document.getElementById(id);
e.style.display = 'none';
}
function loaded() {
document.body.offsetHeight;
hide("d1");
hide("d2");
hide("d3");
hide("d4");
}
</script>
</head>
<body onload="loaded()">
<div><span>Hello</span><div id="d1">X</div> <span>Kitty</span></div>
<div><span>Hello</span> <div id="d2">X</div><span>Kitty</span></div>
<!-- we'll create frames here, but they won't make a difference to the rendering -->
<div><div id="d3">X</div> <span>Hello</span> <span>Kitty</span></div>
<div><span>Hello</span> <span>Kitty</span><div id="d4">X</div></div>
</body>
</html>

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

@ -1,4 +0,0 @@
<!DOCTYPE HTML>
<html>
<body style="border:1px solid black;">X</body>
</html>

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

@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html>
<!-- Test that changes to text contents create frames when necessary -->
<head>
<script>
function loaded() {
document.body.offsetHeight;
document.body.firstChild.data = 'X';
}
</script>
</head>
<body onload="loaded()" style="border:1px solid black;">
</body>
</html>

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

@ -1,12 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body > div { border:1px solid black; margin:1em; }
</style>
</head>
<body>
<div id="d3"><br>Hello <span>Kitty</span></div>
<div id="d4"><span>Hello</span> Kitty<br></div>
</body>
</html>

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

@ -1,27 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- Test that inserting inline content can create frames for text around it
when there are <br>s -->
<style>
body > div { border:1px solid black; margin:1em; }
</style>
<script>
function makeSpan(text) {
var e = document.createElement("span");
e.textContent = text;
return e;
}
function loaded() {
var d3 = document.getElementById("d3");
d3.insertBefore(makeSpan("Hello"), d3.firstChild.nextSibling);
var d4 = document.getElementById("d4");
d4.insertBefore(makeSpan("Kitty"), d4.lastChild);
}
</script>
</head>
<body onload="loaded()">
<div id="d3"><br> <span>Kitty</span></div>
<div id="d4"><span>Hello</span> <br></div>
</body>
</html>

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

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body > div { border:1px solid black; margin:1em; }
div:first-line { color:green; }
div:first-letter { color:lime; }
.f:first-letter { float:left; }
</style>
</head>
<body>
<div>Hello<br>Kitty</div>
<div class="f">Hello<br>Kitty</div>
<div>Hello<br>Kitty</div>
<div class="f">Hello<br>Kitty</div>
<div>Hello Hello<br>Kitty</div>
<div class="f">Hello Hello<br>Kitty</div>
</body>
</html>

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

@ -1,36 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body > div { border:1px solid black; margin:1em; }
div:first-line { color:green; }
div:first-letter { color:lime; }
.f:first-letter { float:left; }
</style>
<script>
function setH(id) {
document.getElementById(id).firstChild.data = "H";
}
function insertSpan(id) {
var d = document.getElementById(id);
var span = document.createElement("span");
span.textContent = "Hello";
d.insertBefore(span, d.firstChild);
}
function loaded() {
setH("d1");
setH("d2");
insertSpan("d3");
insertSpan("d4");
}
</script>
</head>
<body onload="loaded()">
<div> Hello<br>Kitty</div>
<div class="f"> <span>Hello</span><br>Kitty</div>
<div id="d1"> <span>ello</span><br>Kitty</div>
<div id="d2" class="f"> <span>ello</span><br>Kitty</div>
<div id="d3"> <span>Hello</span><br>Kitty</div>
<div id="d4" class="f"> <span>Hello</span><br>Kitty</div>
</body>
</html>

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

@ -1245,22 +1245,4 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs
== 494667-1.html 494667-1-ref.html
== 494667-2.html 494667-2-ref.html
== 495274-1.html 495274-1-ref.html
== 495385-1a.html 495385-1-ref.html
== 495385-1b.html 495385-1-ref.html
== 495385-1c.html 495385-1-ref.html
== 495385-1d.html 495385-1-ref.html
== 495385-1e.html 495385-1-ref.html
== 495385-1f.html 495385-1-ref.html
== 495385-2a.html 495385-2-ref.html
== 495385-2b.html 495385-2-ref.html
== 495385-2c.html 495385-2-ref.html
== 495385-2d.html 495385-2-ref.html
== 495385-2e.html 495385-2-ref.html
== 495385-2f.xhtml 495385-2-ref.html
== 495385-2g.html 495385-2-ref.html
== 495385-2h.html 495385-2-ref.html
== 495385-2i.html 495385-2-ref.html
== 495385-3.html 495385-3-ref.html
== 495385-4.html 495385-4-ref.html
== 495385-5.html 495385-5-ref.html
== 496032-1.html 496032-1-ref.html

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

@ -24,6 +24,11 @@
There must be a continuous 10px line at the top
of the gray box, the left half blue and the right
half aqua.
<div class="multicol"><div class="container"><div class="overflow"></div></div></div>
<div class="multicol">
<div class="container">
<div class="overflow">
</div>
</div>
</div>
</body>
</html>

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

@ -9,7 +9,7 @@
== border-breaking-001-cols.xhtml border-breaking-001-cols.ref.xhtml
== border-breaking-002-cols.xhtml border-breaking-002-cols.ref.xhtml
== border-breaking-003-cols.xhtml border-breaking-003-cols.ref.xhtml
fails == border-breaking-004-cols.xhtml border-breaking-002-cols.ref.xhtml
== border-breaking-004-cols.xhtml border-breaking-002-cols.ref.xhtml
== content-inserted-000.xhtml content-inserted-000.ref.xhtml
== content-inserted-001.xhtml content-inserted-001.ref.xhtml
== content-inserted-002.xhtml content-inserted-002.ref.xhtml

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

@ -414,7 +414,7 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther)
// We begin by examining those style structs that are capable of
// causing the maximal difference, a FRAMECHANGE.
// FRAMECHANGE Structs: Display, XUL, Content, UserInterface,
// Visibility, Outline, TableBorder, Table, Text, UIReset, Quotes
// Visibility, Outline, TableBorder, Table, UIReset, Quotes
DO_STRUCT_DIFFERENCE(Display);
DO_STRUCT_DIFFERENCE(XUL);
DO_STRUCT_DIFFERENCE(Column);
@ -425,7 +425,6 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther)
DO_STRUCT_DIFFERENCE(TableBorder);
DO_STRUCT_DIFFERENCE(Table);
DO_STRUCT_DIFFERENCE(UIReset);
DO_STRUCT_DIFFERENCE(Text);
DO_STRUCT_DIFFERENCE(List);
// If the quotes implementation is ever going to change we might not need
// a framechange here and a reflow should be sufficient. See bug 35768.
@ -449,6 +448,7 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther)
DO_STRUCT_DIFFERENCE(Padding);
DO_STRUCT_DIFFERENCE(Border);
DO_STRUCT_DIFFERENCE(Position);
DO_STRUCT_DIFFERENCE(Text);
DO_STRUCT_DIFFERENCE(TextReset);
// At this point, we know that the worst kind of damage we could do is

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

@ -1899,13 +1899,9 @@ nsStyleText::~nsStyleText(void) { }
nsChangeHint nsStyleText::CalcDifference(const nsStyleText& aOther) const
{
if (mWhiteSpace != aOther.mWhiteSpace) {
// This may require construction of suppressed text frames
return NS_STYLE_HINT_FRAMECHANGE;
}
if ((mTextAlign != aOther.mTextAlign) ||
(mTextTransform != aOther.mTextTransform) ||
(mWhiteSpace != aOther.mWhiteSpace) ||
(mWordWrap != aOther.mWordWrap) ||
(mLetterSpacing != aOther.mLetterSpacing) ||
(mLineHeight != aOther.mLineHeight) ||
@ -1920,7 +1916,7 @@ nsChangeHint nsStyleText::CalcDifference(const nsStyleText& aOther) const
/* static */
nsChangeHint nsStyleText::MaxDifference()
{
return NS_STYLE_HINT_FRAMECHANGE;
return NS_STYLE_HINT_REFLOW;
}
#endif