Bug 1376640. Fix dynamic updates when an inline that sits between a first-letter and its block changes style. r=heycam

MozReview-Commit-ID: 8osMUpYVRvR
This commit is contained in:
Boris Zbarsky
2017-06-28 22:19:35 -07:00
parent 0d81b85835
commit 2bc0e8180b
9 changed files with 106 additions and 16 deletions

View File

@@ -11811,6 +11811,8 @@ nsCSSFrameConstructor::CreateLetterFrame(nsContainerFrame* aBlockFrame,
}
MOZ_ASSERT(!aBlockFrame->GetPrevContinuation(),
"Setting up a first-letter frame on a non-first block continuation?");
auto parent = static_cast<nsContainerFrame*>(aParentFrame->FirstContinuation());
parent->SetHasFirstLetterChild();
aBlockFrame->SetProperty(nsContainerFrame::FirstLetterProperty(),
letterFrame);
aTextContent->SetPrimaryFrame(textFrame);
@@ -11956,6 +11958,8 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
// Somethings really wrong
return;
}
static_cast<nsContainerFrame*>(parentFrame->FirstContinuation())->
ClearHasFirstLetterChild();
// Create a new text frame with the right style context that maps
// all of the content that was previously part of the letter frame
@@ -12021,6 +12025,8 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresShell* aPresShell,
while (kid) {
if (kid->IsLetterFrame()) {
// Bingo. Found it. First steal away the text frame.
static_cast<nsContainerFrame*>(aFrame->FirstContinuation())->
ClearHasFirstLetterChild();
nsIFrame* textFrame = kid->PrincipalChildList().FirstChild();
if (!textFrame) {
break;