Reviewed by John.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jan 2005 19:27:14 +0000 (19:27 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jan 2005 19:27:14 +0000 (19:27 +0000)
        - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways

        * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        Use specified size rather than computed size when dealing with a percentage for line height.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8458 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/css/css_computedstyle.cpp

index 814e7f9c616f54032c380009342da5c3483ed22f..4d68e8996a30895c3fafe7e58dc25bf035535fc8 100644 (file)
@@ -1,3 +1,12 @@
+2005-01-27  Darin Adler  <darin@apple.com>
+
+        Reviewed by John.
+
+        - fixed <rdar://problem/3807935> DOM CSS computed style line-height is wrong in two ways
+
+        * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
+        Use specified size rather than computed size when dealing with a percentage for line height.
+
 2005-01-27  Darin Adler  <darin@apple.com>
 
         Reviewed by John.
index 9c82c07325810add0e3ad5bd02a7b1c64504167f..4b6ad2c0fcd6b373d46d594519635682189660eb 100644 (file)
@@ -715,8 +715,12 @@ CSSValueImpl *CSSComputedStyleDeclarationImpl::getPropertyCSSValue(int propertyI
        if (length.value < 0)
             return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
         if (length.isPercent()) {
-            float computedSize = style->htmlFont().getFontDef().computedSize;
-            return new CSSPrimitiveValueImpl((int)(length.length() * computedSize) / 100, CSSPrimitiveValue::CSS_PX);
+            // This is imperfect, because it doesn't include the zoom factor and the real computation
+            // for how high to be in pixels does include things like minimum font size and the zoom factor.
+            // On the other hand, since font-size doesn't include the zoom factor, we really can't do
+            // that here either.
+            float fontSize = style->htmlFont().getFontDef().specifiedSize;
+            return new CSSPrimitiveValueImpl((int)(length.length() * fontSize) / 100, CSSPrimitiveValue::CSS_PX);
         }
         else {
             return new CSSPrimitiveValueImpl(length.length(), CSSPrimitiveValue::CSS_PX);