Bug 484400. When removing a positioned element use the placeholder frame to get the relevant containing block for first-letter processing. r=bzbarsky
This commit is contained in:
@@ -6985,7 +6985,13 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
|||||||
|
|
||||||
// Examine the containing-block for the removed content and see if
|
// Examine the containing-block for the removed content and see if
|
||||||
// :first-letter style applies.
|
// :first-letter style applies.
|
||||||
nsIFrame* containingBlock = GetFloatContainingBlock(parentFrame);
|
nsIFrame* inflowChild = childFrame;
|
||||||
|
if (childFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
|
||||||
|
inflowChild = frameManager->GetPlaceholderFrameFor(childFrame);
|
||||||
|
NS_ASSERTION(inflowChild, "No placeholder for out-of-flow?");
|
||||||
|
}
|
||||||
|
nsIFrame* containingBlock =
|
||||||
|
GetFloatContainingBlock(inflowChild->GetParent());
|
||||||
PRBool haveFLS = containingBlock && HasFirstLetterStyle(containingBlock);
|
PRBool haveFLS = containingBlock && HasFirstLetterStyle(containingBlock);
|
||||||
if (haveFLS) {
|
if (haveFLS) {
|
||||||
// Trap out to special routine that handles adjusting a blocks
|
// Trap out to special routine that handles adjusting a blocks
|
||||||
@@ -7057,11 +7063,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (haveFLS && mRootElementFrame) {
|
if (haveFLS && mRootElementFrame) {
|
||||||
NS_ASSERTION(containingBlock == GetFloatContainingBlock(parentFrame),
|
|
||||||
"What happened here?");
|
|
||||||
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
|
|
||||||
GetAbsoluteContainingBlock(parentFrame),
|
|
||||||
containingBlock);
|
|
||||||
RecoverLetterFrames(containingBlock);
|
RecoverLetterFrames(containingBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7414,9 +7415,6 @@ nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent,
|
|||||||
frame->CharacterDataChanged(aInfo);
|
frame->CharacterDataChanged(aInfo);
|
||||||
|
|
||||||
if (haveFirstLetterStyle) {
|
if (haveFirstLetterStyle) {
|
||||||
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
|
|
||||||
GetAbsoluteContainingBlock(frame),
|
|
||||||
block, nsnull);
|
|
||||||
RecoverLetterFrames(block);
|
RecoverLetterFrames(block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
layout/reftests/first-letter/484400-1-ref.html
Normal file
11
layout/reftests/first-letter/484400-1-ref.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
div::first-letter { color: red; font-size: 200%; background-color: blue; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
T
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
20
layout/reftests/first-letter/484400-1.html
Normal file
20
layout/reftests/first-letter/484400-1.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<html class="reftest-wait">
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
div::first-letter { color: red; font-size: 200%; background-color: blue; }
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
function boom() {
|
||||||
|
document.documentElement.offsetWidth;
|
||||||
|
var s = document.getElementById("s");
|
||||||
|
s.parentNode.removeChild(s);
|
||||||
|
document.documentElement.offsetWidth;
|
||||||
|
document.documentElement.removeAttribute("class");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body onload="boom();">
|
||||||
|
<div>
|
||||||
|
<span id="s" style="position: absolute;">abcdefh</span>T
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
@@ -53,3 +53,4 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 329069-1.html 329069-1-ref.html # failu
|
|||||||
== 429968-2c.html 429968-2-ref.html
|
== 429968-2c.html 429968-2-ref.html
|
||||||
== 441418-1.html 441418-1-ref.html
|
== 441418-1.html 441418-1-ref.html
|
||||||
== 469227-1.html 469227-1-ref.html
|
== 469227-1.html 469227-1-ref.html
|
||||||
|
== 484400-1.html 484400-1-ref.html
|
||||||
|
|||||||
Reference in New Issue
Block a user