Bug 419285. nsCSSFrameConstructor should stop looking for first-letter content after a <br>. r+sr=dbaron

This commit is contained in:
Robert O'Callahan 2008-07-29 22:02:00 -07:00
parent 535288ced1
commit 4370d37432
5 changed files with 25 additions and 2 deletions

View File

@ -11890,7 +11890,8 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
while (frame) {
nsIFrame* nextFrame = frame->GetNextSibling();
if (nsGkAtoms::textFrame == frame->GetType()) {
nsIAtom* frameType = frame->GetType();
if (nsGkAtoms::textFrame == frameType) {
// Wrap up first-letter content in a letter frame
nsIContent* textContent = frame->GetContent();
if (IsFirstLetterContent(textContent)) {
@ -11909,7 +11910,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
return NS_OK;
}
}
else if (IsInlineFrame(frame)) {
else if (IsInlineFrame(frame) && frameType != nsGkAtoms::brFrame) {
nsIFrame* kids = frame->GetFirstChild(nsnull);
WrapFramesInFirstLetterFrame(aState, aBlockFrame, frame, kids,
aModifiedParent, aTextFrame,

View File

@ -236,6 +236,8 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
nsLineLayout* ll = aReflowState.mLineLayout;
PRBool pushedFrame;
NS_ASSERTION(ll->GetFirstLetterStyleOK() || GetPrevInFlow(),
"First-in-flow first-letter should have first-letter style enabled in nsLineLayout!");
ll->BeginSpan(this, &aReflowState, bp.left, availSize.width);
ll->ReflowFrame(kid, aReflowStatus, &aMetrics, pushedFrame);
ll->EndSpan(this);

View File

@ -0,0 +1,7 @@
<!DOCTYPE HTML>
<html>
<body style="line-height:50px">
<p><br>Hello
<p><span style="font-size:200%">"</span><br>Hello
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
p::first-letter { font-size:200%; }
</style>
</head>
<body style="line-height:50px">
<p><br>Hello
<p>"<br>Hello
</body>
</html>

View File

@ -789,6 +789,7 @@ skip-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 413292-1.html 413292-1-ref.html # disabl
== 417676.html 417676-ref.html
== 418766-1a.html 418766-1-ref.html
== 418766-1b.html 418766-1-ref.html
== 419285-1.html 419285-1-ref.html
== 419060.html 419060-ref.html
== 419531-1.html 419531-1-ref.html
== 420069-1.html 420069-1-ref.html