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
☠☠ backed out by e3af803ff889 ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 02 Feb 2010 12:18:57 +1300
changeset 33718 377a9f8f62c26dded4dca2948ce2f891fc933eaa
parent 33717 60dce6cf3aaa5853fbf049f9d8b835c847004fde
child 33719 110a1591e7d1f1147267a33aed9cda08441749ea
child 33724 e3af803ff8893cb618ae1440fa22d9989c6eb3ed
push id1142
push usertimeless@mozdev.org
push dateTue, 09 Mar 2010 14:35:12 +0000
reviewersdbaron
bugs538935
milestone1.9.2.2pre
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 a=beltzner
layout/generic/nsLineLayout.cpp
layout/reftests/bugs/538935-1-ref.html
layout/reftests/bugs/538935-1.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -925,17 +925,17 @@ nsLineLayout::ReflowFrame(nsIFrame* aFra
     else if (nsGkAtoms::brFrame == frameType) {
       pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE);
       isEmpty = PR_FALSE;
     } else {
       if (nsGkAtoms::letterFrame==frameType) {
         pfd->SetFlag(PFD_ISLETTERFRAME, PR_TRUE);
       }
       if (pfd->mSpan) {
-        isEmpty = !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty();
+        isEmpty = !pfd->mSpan->mHasNonemptyContent;
       } else {
         isEmpty = pfd->mFrame->IsEmpty();
       }
     }
   }
 
   mFloatManager->Translate(-tx, -ty);
 
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/538935-1-ref.html
@@ -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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/538935-1.html
@@ -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>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1329,9 +1329,10 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") ==
 == 528038-1e.html 528038-1-ref.html
 == 528038-1f.html 528038-1-ref.html
 == 528038-2.html 528038-2-ref.html
 == 530686-1.html 530686-1-ref.html
 == 531371-1.html 531371-1-ref.html
 == 534919-1.html 534919-1-ref.html
 == 541406-1.html 541406-1-ref.html
 == 537471-1.html 537471-1-ref.html
+== 538935-1.html 538935-1-ref.html
 == 542620-1.html 542620-1-ref.html