Bug 538935. A span should be considered non-empty (for the purposes of deciding whether stuff after it is 'at the beginning of the line') only if it contains non-empty content. r=dbaron

--HG--
extra : rebase_source : 70e158527ef017ed5d5271e861a775aa85986645
This commit is contained in:
Robert O'Callahan 2010-02-02 12:18:57 +13:00
parent c4012b90b5
commit abe4078562
4 changed files with 34 additions and 1 deletions

View File

@ -933,7 +933,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
pfd->SetFlag(PFD_ISLETTERFRAME, PR_TRUE); pfd->SetFlag(PFD_ISLETTERFRAME, PR_TRUE);
} }
if (pfd->mSpan) { if (pfd->mSpan) {
isEmpty = !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty(); isEmpty = !pfd->mSpan->mHasNonemptyContent;
} else { } else {
isEmpty = pfd->mFrame->IsEmpty(); isEmpty = pfd->mFrame->IsEmpty();
} }

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<body>
<div>Hello</div>
<div style="padding-left:2px;">Hello</div>
<div>Hello</div>
<div style="padding-left:2px;">Hello</div>
<div style="padding-left:1px;">Hello</div>
<div>Hello</div>
<div style="padding-left:2px;">Hello</div>
<div>Hello</div>
<div style="padding-left:2px;">Hello</div>
<div style="padding-left:1px;">Hello</div>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<body>
<div><span></span> Hello</div>
<div><span style="border:1px solid transparent"></span> Hello</div>
<div><span style="outline:1px transparent"></span> Hello</div>
<div><span style="padding:1px"></span> Hello</div>
<div><span style="margin:1px"></span> Hello</div>
<div><span> </span> Hello</div>
<div><span style="border:1px solid transparent"> </span> Hello</div>
<div><span style="outline:1px transparent"> </span> Hello</div>
<div><span style="padding:1px"> </span> Hello</div>
<div><span style="margin:1px"> </span> Hello</div>
</body>
</html>

View File

@ -1379,5 +1379,6 @@ fails HTTP(..) == 518172-2b.html 518172-b-ref.html # bug 518172
== 537507-1.xul 537507-1-ref.xul == 537507-1.xul 537507-1-ref.xul
== 537507-2.html 537507-2-ref.html == 537507-2.html 537507-2-ref.html
== 537471-1.html 537471-1-ref.html == 537471-1.html 537471-1-ref.html
== 538935-1.html 538935-1-ref.html
== 539226-1.html about:blank == 539226-1.html about:blank
== 541382-1.html 541382-1-ref.html == 541382-1.html 541382-1-ref.html