Bug 713856 - Dynamic change of DOM in lists before block element creates blank line; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 30 Dec 2011 17:22:47 -0500
changeset 84821 36cd5cc8a9097c9a186130073b39bbd06f144ef8
parent 84820 2ea7afaa47a90d18c2ff51095d7e0daa8e4d9dfe
child 84822 de0a0865d0e9f0208b77bd614c81336cbef90cb8
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs713856
milestone12.0a1
Bug 713856 - Dynamic change of DOM in lists before block element creates blank line; r=roc
layout/generic/nsTextFrameThebes.cpp
layout/reftests/bugs/713856-dynamic.html
layout/reftests/bugs/713856-ref.html
layout/reftests/bugs/713856-static.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsTextFrameThebes.cpp
+++ b/layout/generic/nsTextFrameThebes.cpp
@@ -7444,17 +7444,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
     textMetrics.mAscent = NS_MAX(gfxFloat(0.0), -textMetrics.mBoundingBox.Y());
     textMetrics.mDescent = NS_MAX(gfxFloat(0.0), textMetrics.mBoundingBox.YMost());
   }
 
   // Setup metrics for caller
   // Disallow negative widths
   aMetrics.width = NSToCoordCeil(NS_MAX(gfxFloat(0.0), textMetrics.mAdvanceWidth));
 
-  if (completedFirstLetter && transformedCharsFit == 0 && !usedHyphenation) {
+  if (transformedCharsFit == 0 && !usedHyphenation) {
     aMetrics.ascent = 0;
     aMetrics.height = 0;
   } else if (boundingBoxType != gfxFont::LOOSE_INK_EXTENTS) {
     // Use actual text metrics for floating first letter frame.
     aMetrics.ascent = NSToCoordCeil(textMetrics.mAscent);
     aMetrics.height = aMetrics.ascent + NSToCoordCeil(textMetrics.mDescent);
   } else {
     // Otherwise, ascent should contain the overline drawable area.
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/713856-dynamic.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<ul>
+<li id="blub">
+<p>Test</p>
+</li>
+</ul>
+<script>
+  document.getElementById('blub').firstChild.data = document.getElementById('blub').firstChild.data;
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/713856-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<ul>
+<li><p>Test</p>
+</li>
+</ul>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/713856-static.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<ul>
+<li><!--hello--> <!--hello--><p>Test</p>
+</li>
+</ul>
+</body>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1675,8 +1675,10 @@ fails-if(layersGPUAccelerated&&cocoaWidg
 == 691571-1.html 691571-1-ref.html
 == 696307-1.html 696307-1-ref.html
 == 696739-1.html 696739-1-ref.html
 needs-focus == 703186-1.html 703186-1-ref.html
 needs-focus == 703186-2.html 703186-2-ref.html
 needs-focus != 703186-1.html 703186-2.html
 == 711359-1.html 711359-1-ref.html
 == 712849-1.html 712849-1-ref.html
+== 713856-static.html  713856-ref.html
+== 713856-dynamic.html 713856-ref.html