[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

bdakin at apple.com bdakin at apple.com
Wed Dec 22 18:37:17 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b575fdf5b3e516a4be3bf410a62002790e0f2433
Author: bdakin at apple.com <bdakin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 14 19:34:32 2010 +0000

    WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=50974
    getComputedStyle() returns wrong values for zoomed elements when
    display is none
    -and corresponding-
    <rdar://problem/8522731>
    
    Reviewed by Darin Adler.
    
    If there is no renderer but the RenderStyle's value is a fixed
    length, send it through zoomAdjustedPixelValue(). There's not much
    we can do for other length types without a renderer.
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::zoomAdjustedPixelValueForLength):
    (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
    
    LayoutTests: New test for https://bugs.webkit.org/show_bug.cgi?id=50974
    getComputedStyle() returns wrong values for zoomed elements when
    display is none
    -and corresponding-
    <rdar://problem/8522731>
    
    Reviewed by Darin Adler.
    
    * fast/css/getComputedStyle/zoom-on-display-none-expected.txt: Added.
    * fast/css/getComputedStyle/zoom-on-display-none.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74045 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index eb2aa71..acc05c4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-14  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Darin Adler.
+
+        New test for https://bugs.webkit.org/show_bug.cgi?id=50974 
+        getComputedStyle() returns wrong values for zoomed elements when 
+        display is none
+        -and corresponding-
+        <rdar://problem/8522731>
+
+        * fast/css/getComputedStyle/zoom-on-display-none-expected.txt: Added.
+        * fast/css/getComputedStyle/zoom-on-display-none.html: Added.
+
 2010-12-14  Pavel Feldman  <pfeldman at chromium.org>
 
         Not reviewed. Move chromium-mac expectations to chromium-mac-leopard.
diff --git a/LayoutTests/fast/css/getComputedStyle/zoom-on-display-none-expected.txt b/LayoutTests/fast/css/getComputedStyle/zoom-on-display-none-expected.txt
new file mode 100644
index 0000000..f1ce133
--- /dev/null
+++ b/LayoutTests/fast/css/getComputedStyle/zoom-on-display-none-expected.txt
@@ -0,0 +1,3 @@
+PASS! Neither the computed width of the displayed div nor the computed width of the display:none div has been affected by the zoom factor.
+
+This div has a zoom value of "2." It has a width of 300px.
diff --git a/LayoutTests/fast/css/getComputedStyle/zoom-on-display-none.html b/LayoutTests/fast/css/getComputedStyle/zoom-on-display-none.html
new file mode 100644
index 0000000..9d002ee
--- /dev/null
+++ b/LayoutTests/fast/css/getComputedStyle/zoom-on-display-none.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+<style>
+  .test_div {
+    zoom: 2;
+    width: 300px;
+  }
+  
+  #zoomed_and_displayed {
+    background: #ccc;
+  }
+  #zoomed_and_hidden {
+    display: none;
+    background: orange;
+  }
+</style>
+</head>
+<body>
+
+  <div id="result">FAIL.</div>
+  <br/>
+
+  <div id="zoomed_and_displayed" class="test_div">
+    This div has a zoom value of "2." It has a width of 300px.
+  </div>
+  <div id="zoomed_and_hidden" class="test_div">
+    This div is has a zoom value of "2" and is hidden. It has a width of 300px.
+  </div>
+  
+  <script type="text/javascript" charset="utf-8">
+    var zoomedAndDisplayed = document.getElementById("zoomed_and_displayed");
+    var zoomedAndHidden = document.getElementById("zoomed_and_hidden");
+    var renderedWidth = zoomedAndDisplayed.scrollWidth;
+    var computedWidthDisplayed = parseFloat(document.defaultView.getComputedStyle(zoomedAndDisplayed).width);
+    var computedWidthHidden = parseFloat(document.defaultView.getComputedStyle(zoomedAndHidden).width);
+
+    var result = document.getElementById("result");    
+    if (computedWidthHidden == computedWidthDisplayed && computedWidthDisplayed == renderedWidth)
+        result.innerHTML = "PASS! Neither the computed width of the displayed div nor the computed width of the display:none div has been affected by the zoom factor.";
+  </script>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 72aa499..3d5d222 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-14  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=50974 
+        getComputedStyle() returns wrong values for zoomed elements when 
+        display is none
+        -and corresponding-
+        <rdar://problem/8522731>
+
+        If there is no renderer but the RenderStyle's value is a fixed 
+        length, send it through zoomAdjustedPixelValue(). There's not much 
+        we can do for other length types without a renderer.
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::zoomAdjustedPixelValueForLength):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+
 2010-12-13  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index c29a6dc..fe62f62 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -340,6 +340,13 @@ inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value
     return CSSPrimitiveValue::create(value / style->effectiveZoom(), CSSPrimitiveValue::CSS_NUMBER);
 }
 
+static PassRefPtr<CSSValue> zoomAdjustedPixelValueForLength(const Length& length, const RenderStyle* style)
+{
+    if (length.isFixed())
+        return zoomAdjustedPixelValue(length.value(), style);
+    return CSSPrimitiveValue::create(length);
+}
+
 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection, const RenderStyle* style)
 {
     if (!reflection)
@@ -1062,7 +1069,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         case CSSPropertyHeight:
             if (renderer)
                 return zoomAdjustedPixelValue(sizingBox(renderer).height(), style.get());
-            return CSSPrimitiveValue::create(style->height());
+            return zoomAdjustedPixelValueForLength(style->height(), style.get());
         case CSSPropertyWebkitHighlight:
             if (style->highlight() == nullAtom)
                 return CSSPrimitiveValue::createIdentifier(CSSValueNone);
@@ -1302,7 +1309,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         case CSSPropertyWidth:
             if (renderer)
                 return zoomAdjustedPixelValue(sizingBox(renderer).width(), style.get());
-            return CSSPrimitiveValue::create(style->width());
+            return zoomAdjustedPixelValueForLength(style->width(), style.get());
         case CSSPropertyWordBreak:
             return CSSPrimitiveValue::create(style->wordBreak());
         case CSSPropertyWordSpacing:
@@ -1474,8 +1481,9 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
                 list->append(zoomAdjustedPixelValue(style->perspectiveOriginY().calcMinValue(box.height()), style.get()));
             }
             else {
-                list->append(CSSPrimitiveValue::create(style->perspectiveOriginX()));
-                list->append(CSSPrimitiveValue::create(style->perspectiveOriginY()));
+                list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginX(), style.get()));
+                list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginY(), style.get()));
+                
             }
             return list.release();
         }
@@ -1518,8 +1526,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
                 if (style->transformOriginZ() != 0)
                     list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get()));
             } else {
-                list->append(CSSPrimitiveValue::create(style->transformOriginX()));
-                list->append(CSSPrimitiveValue::create(style->transformOriginY()));
+                list->append(zoomAdjustedPixelValueForLength(style->transformOriginX(), style.get()));
+                list->append(zoomAdjustedPixelValueForLength(style->transformOriginY(), style.get()));
                 if (style->transformOriginZ() != 0)
                     list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get()));
             }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list