mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 484400. When removing a positioned element use the placeholder frame to get the relevant containing block for first-letter processing. r=bzbarsky
--HG-- extra : rebase_source : 9a327e8f44541ac822bc7be52caa1ceab825ccd1
This commit is contained in:
parent
5f6a955352
commit
ad77d4e1d7
@ -6985,7 +6985,13 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
|
||||
// Examine the containing-block for the removed content and see if
|
||||
// :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);
|
||||
if (haveFLS) {
|
||||
// Trap out to special routine that handles adjusting a blocks
|
||||
@ -7057,11 +7063,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
}
|
||||
|
||||
if (haveFLS && mRootElementFrame) {
|
||||
NS_ASSERTION(containingBlock == GetFloatContainingBlock(parentFrame),
|
||||
"What happened here?");
|
||||
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
|
||||
GetAbsoluteContainingBlock(parentFrame),
|
||||
containingBlock);
|
||||
RecoverLetterFrames(containingBlock);
|
||||
}
|
||||
|
||||
@ -7414,9 +7415,6 @@ nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent,
|
||||
frame->CharacterDataChanged(aInfo);
|
||||
|
||||
if (haveFirstLetterStyle) {
|
||||
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
|
||||
GetAbsoluteContainingBlock(frame),
|
||||
block, nsnull);
|
||||
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
|
||||
== 441418-1.html 441418-1-ref.html
|
||||
== 469227-1.html 469227-1-ref.html
|
||||
== 484400-1.html 484400-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user