Pass the right frame to the first-line stuff. Bug 367489, r+sr=roc.
This commit is contained in:
Родитель
e294051e35
Коммит
be85e170e4
|
@ -8571,7 +8571,8 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
|||
if (haveFirstLineStyle) {
|
||||
// It's possible that some of the new frames go into a
|
||||
// first-line frame. Look at them and see...
|
||||
AppendFirstLineFrames(state, aContainer, parentFrame, frameItems);
|
||||
AppendFirstLineFrames(state, containingBlock->GetContent(),
|
||||
containingBlock, frameItems);
|
||||
}
|
||||
|
||||
nsresult result = NS_OK;
|
||||
|
@ -9159,7 +9160,8 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
|
|||
// frame. Look at it and see...
|
||||
if (isAppend) {
|
||||
// Use append logic when appending
|
||||
AppendFirstLineFrames(state, aContainer, parentFrame, frameItems);
|
||||
AppendFirstLineFrames(state, containingBlock->GetContent(),
|
||||
containingBlock, frameItems);
|
||||
}
|
||||
else {
|
||||
// Use more complicated insert logic when inserting
|
||||
|
@ -11341,8 +11343,8 @@ ReparentFrame(nsFrameManager* aFrameManager,
|
|||
nsresult
|
||||
nsCSSFrameConstructor::WrapFramesInFirstLineFrame(
|
||||
nsFrameConstructorState& aState,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aFrame,
|
||||
nsIContent* aBlockContent,
|
||||
nsIFrame* aBlockFrame,
|
||||
nsFrameItems& aFrameItems)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -11368,15 +11370,16 @@ nsCSSFrameConstructor::WrapFramesInFirstLineFrame(
|
|||
}
|
||||
|
||||
// Create line frame
|
||||
nsStyleContext* parentStyle = aFrame->GetStyleContext();
|
||||
nsRefPtr<nsStyleContext> firstLineStyle = GetFirstLineStyle(aContent,
|
||||
nsStyleContext* parentStyle = aBlockFrame->GetStyleContext();
|
||||
nsRefPtr<nsStyleContext> firstLineStyle = GetFirstLineStyle(aBlockContent,
|
||||
parentStyle);
|
||||
|
||||
nsIFrame* lineFrame = NS_NewFirstLineFrame(mPresShell, firstLineStyle);
|
||||
|
||||
if (lineFrame) {
|
||||
// Initialize the line frame
|
||||
rv = InitAndRestoreFrame(aState, aContent, aFrame, nsnull, lineFrame);
|
||||
rv = InitAndRestoreFrame(aState, aBlockContent, aBlockFrame, nsnull,
|
||||
lineFrame);
|
||||
|
||||
// Mangle the list of frames we are giving to the block: first
|
||||
// chop the list in two after lastInlineFrame
|
||||
|
@ -11419,7 +11422,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLineFrame(
|
|||
nsresult
|
||||
nsCSSFrameConstructor::AppendFirstLineFrames(
|
||||
nsFrameConstructorState& aState,
|
||||
nsIContent* aContent,
|
||||
nsIContent* aBlockContent,
|
||||
nsIFrame* aBlockFrame,
|
||||
nsFrameItems& aFrameItems)
|
||||
{
|
||||
|
@ -11427,7 +11430,7 @@ nsCSSFrameConstructor::AppendFirstLineFrames(
|
|||
// created because it doesn't currently have any children.
|
||||
nsIFrame* blockKid = aBlockFrame->GetFirstChild(nsnull);
|
||||
if (!blockKid) {
|
||||
return WrapFramesInFirstLineFrame(aState, aContent,
|
||||
return WrapFramesInFirstLineFrame(aState, aBlockContent,
|
||||
aBlockFrame, aFrameItems);
|
||||
}
|
||||
|
||||
|
@ -11501,6 +11504,9 @@ nsCSSFrameConstructor::InsertFirstLineFrames(
|
|||
nsFrameItems& aFrameItems)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
// XXXbz If you make this method actually do something, check to make sure
|
||||
// that the caller is passing what you expect. In particular, which content
|
||||
// is aContent?
|
||||
#if 0
|
||||
nsIFrame* parentFrame = *aParentFrame;
|
||||
nsIFrame* newFrame = aFrameItems.childList;
|
||||
|
|
|
@ -899,8 +899,8 @@ private:
|
|||
// Methods support :first-line style
|
||||
|
||||
nsresult WrapFramesInFirstLineFrame(nsFrameConstructorState& aState,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aFrame,
|
||||
nsIContent* aBlockContent,
|
||||
nsIFrame* aBlockFrame,
|
||||
nsFrameItems& aFrameItems);
|
||||
|
||||
nsresult AppendFirstLineFrames(nsFrameConstructorState& aState,
|
||||
|
|
Загрузка…
Ссылка в новой задаче