line-height patch take 2

David Hyatt hyatt at apple.com
Sat Jan 31 19:34:18 CET 2004


That line-height patch I sent out caused a couple of minor regressions. 
  Here are the fixes:

-------------- next part --------------
Index: khtml/rendering//render_flow.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_flow.cpp,v
retrieving revision 1.121
diff -u -p -r1.121 khtml/rendering//render_flow.cpp
--- khtml/rendering//render_flow.cpp	2004/01/30 19:12:54	1.121
+++ khtml/rendering//render_flow.cpp	2004/01/31 18:33:31
@@ -157,9 +157,12 @@ short RenderFlow::lineHeight(bool firstL
         RenderStyle* s = style(firstLine);
         Length lh = s->lineHeight();
         if (lh.value < 0) {
-	    if (m_lineHeight == -1)
-	      m_lineHeight = RenderObject::lineHeight(false);
-	    return m_lineHeight;
+            if (s == style()) {
+                if (m_lineHeight == -1)
+                    m_lineHeight = RenderObject::lineHeight(false);
+                return m_lineHeight;
+            }
+            return s->fontMetrics().lineSpacing();
 	}
         if (lh.isPercent())
             return lh.minWidth(s->font().pixelSize());
Index: khtml/rendering//render_text.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_text.cpp,v
retrieving revision 1.107
diff -u -p -r1.107 khtml/rendering//render_text.cpp
--- khtml/rendering//render_text.cpp	2004/01/30 19:12:55	1.107
+++ khtml/rendering//render_text.cpp	2004/01/31 18:33:33
@@ -1174,9 +1174,9 @@ int RenderText::height() const
     return retval;
 }
 
-short RenderText::lineHeight( bool firstLine, bool isRootLineBox) const
+short RenderText::lineHeight( bool firstLine, bool) const
 {
-    return parent()->lineHeight(firstLine, isRootLineBox);
+    return parent()->lineHeight(firstLine, true);
 }
 
 short RenderText::baselinePosition( bool firstLine, bool ) const
-------------- next part --------------


dave


More information about the Khtml-devel mailing list