<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>133575</bug_id>
          
          <creation_ts>2014-06-06 09:17:23 -0700</creation_ts>
          <short_desc>(Regression r163262) Subpixel rendering: Text jumps up and down while adjacent &lt;img&gt;&apos;s border size is transitioning.</short_desc>
          <delta_ts>2022-12-30 11:32:27 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc>http://www.imgtec.com/about/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>133932</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="alan">zalan</reporter>
          <assigned_to name="alan">zalan</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>hh.kaka</cc>
    
    <cc>man.zhong</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
    
    <cc>zhiwei1.chen</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1013791</commentid>
    <comment_count>0</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2014-06-06 09:17:23 -0700</bug_when>
    <thetext>Hover Divisions image on http://www.imgtec.com/about/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1013793</commentid>
    <comment_count>1</comment_count>
      <attachid>232616</attachid>
    <who name="alan">zalan</who>
    <bug_when>2014-06-06 09:18:23 -0700</bug_when>
    <thetext>Created attachment 232616
Test reduction</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015747</commentid>
    <comment_count>2</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2014-06-14 19:47:53 -0700</bug_when>
    <thetext>It is actually caused by the integral rounding in RenderReplaced::computeReplacedLogicalHeight(). 

1. animation sets fractional values on the border. 0.25px
2. the calculated box height always snaps to integral value. 399.5 (400px box height - 0.5px border size)-&gt; snaps to 400px
3. 400px + 0.5px border makes the box taller by 0.5px;
 
patch is coming up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015748</commentid>
    <comment_count>3</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2014-06-14 21:57:32 -0700</bug_when>
    <thetext>&lt;rdar://problem/17317439&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1015806</commentid>
    <comment_count>4</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2014-06-15 20:51:55 -0700</bug_when>
    <thetext>This changeset fixes the problem, but unfortunately it also introduces inline positioning regression. (because baseline for inlines is int) tracked here: https://bugs.webkit.org/show_bug.cgi?id=133932

 
diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp
index 82e9c14..3d8ffe4 100644
--- a/Source/WebCore/rendering/RenderReplaced.cpp
+++ b/Source/WebCore/rendering/RenderReplaced.cpp
@@ -375,7 +375,6 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh
         return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style().logicalWidth()), shouldComputePreferred);
 
     RenderBox* contentRenderer = embeddedContentBox();
-
     // 10.3.2 Inline, replaced elements: http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width
     double intrinsicRatio = 0;
     FloatSize constrainedSize;
@@ -394,10 +393,8 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh
             // If &apos;height&apos; and &apos;width&apos; both have computed values of &apos;auto&apos; and the element has no intrinsic width, but does have an intrinsic height and intrinsic ratio;
             // or if &apos;width&apos; has a computed value of &apos;auto&apos;, &apos;height&apos; has some other computed value, and the element does have an intrinsic ratio; then the used value
             // of &apos;width&apos; is: (used height) * (intrinsic ratio)
-            if (intrinsicRatio &amp;&amp; ((computedHeightIsAuto &amp;&amp; !hasIntrinsicWidth &amp;&amp; hasIntrinsicHeight) || !computedHeightIsAuto)) {
-                LayoutUnit logicalHeight = computeReplacedLogicalHeight();
-                return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(logicalHeight * intrinsicRatio)), shouldComputePreferred);
-            }
+            if (intrinsicRatio &amp;&amp; ((computedHeightIsAuto &amp;&amp; !hasIntrinsicWidth &amp;&amp; hasIntrinsicHeight) || !computedHeightIsAuto))
+                return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalHeight() * intrinsicRatio, shouldComputePreferred);
 
             // If &apos;height&apos; and &apos;width&apos; both have computed values of &apos;auto&apos; and the element has an intrinsic ratio but no intrinsic height or width, then the used value of
             // &apos;width&apos; is undefined in CSS 2.1. However, it is suggested that, if the containing block&apos;s width does not itself depend on the replaced element&apos;s width, then
@@ -440,7 +437,6 @@ LayoutUnit RenderReplaced::computeReplacedLogicalHeight() const
         return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style().logicalHeight()));
 
     RenderBox* contentRenderer = embeddedContentBox();
-
     // 10.6.2 Inline, replaced elements: http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height
     double intrinsicRatio = 0;
     FloatSize constrainedSize;
@@ -448,7 +444,6 @@ LayoutUnit RenderReplaced::computeReplacedLogicalHeight() const
 
     bool widthIsAuto = style().logicalWidth().isAuto();
     bool hasIntrinsicHeight = constrainedSize.height() &gt; 0;
-
     // If &apos;height&apos; and &apos;width&apos; both have computed values of &apos;auto&apos; and the element also has an intrinsic height, then that intrinsic height is the used value of &apos;height&apos;.
     if (widthIsAuto &amp;&amp; hasIntrinsicHeight)
         return computeReplacedLogicalHeightRespectingMinMaxHeight(constrainedSize.height());
@@ -456,7 +451,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalHeight() const
     // Otherwise, if &apos;height&apos; has a computed value of &apos;auto&apos;, and the element has an intrinsic ratio then the used value of &apos;height&apos; is:
     // (used width) / (intrinsic ratio)
     if (intrinsicRatio)
-        return computeReplacedLogicalHeightRespectingMinMaxHeight(roundToInt(round(availableLogicalWidth() / intrinsicRatio)));
+        return computeReplacedLogicalHeightRespectingMinMaxHeight(availableLogicalWidth() / intrinsicRatio);
 
     // Otherwise, if &apos;height&apos; has a computed value of &apos;auto&apos;, and the element has an intrinsic height, then that intrinsic height is the used value of &apos;height&apos;.
     if (hasIntrinsicHeight)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876431</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-06-17 04:39:31 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 15.5 on macOS 12.4 using attached test case (Although picture is broken now).

** Safari behavior:

Image (broken) ease-in while slowly transitioning but below &lt;div&gt; is jumpy/shimmering and show fast flickering (can be observed based on border shimmering).

** Firefox behavior (IDEAL - IMO):

Image (broken) ease-in while slowly transitioning but below &lt;div&gt; does not show any strange behavior as Safari.

** Chrome behavior:

Image (broken) ease-in BUT PUSHES Image out while slowly transitioning but below &lt;div&gt; does not show any strange behavior as Safari.

___

I am not clear whether Safari want to achieve Firefox or Chrome behavior but I think Firefox behavior seems more reasonable. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922282</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-12-30 08:27:22 -0800</bug_when>
    <thetext>@Alan - it seems Safari Technology Preview 160 is not making &lt;div&gt; jump or stutter as much as before or as Safari 16.2, is something fixed or reduced this happening further?

Can you corroborate my above understanding?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922288</commentid>
    <comment_count>7</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2022-12-30 11:32:27 -0800</bug_when>
    <thetext>Yeah, this seems to have been fixed (tested with WebKit nightly and code reading)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>232616</attachid>
            <date>2014-06-06 09:18:23 -0700</date>
            <delta_ts>2014-06-06 09:18:23 -0700</delta_ts>
            <desc>Test reduction</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>345</size>
            <attacher name="alan">zalan</attacher>
            
              <data encoding="base64">PGh0bWw+CjxzdHlsZT4KaW1nOmhvdmVyIHsKCS13ZWJraXQtYm94LXNpemluZzogYm9yZGVyLWJv
eDsKCWJvcmRlcjogMzBweCBzb2xpZCByZWQ7Cn0KCmltZyB7Cgl0cmFuc2l0aW9uOiBhbGwgMTBz
IGxpbmVhcjsKICAgIHdpZHRoOiAxNDBweDsKfQoKZGl2IHsKICAgYm9yZGVyOiBzb2xpZCAxcHgg
Z3JlZW47IAogICBoZWlnaHQ6IDIwMHB4OyAKICAgd2lkdGg6IDIwMHB4Owp9Cjwvc3R5bGU+Cjxi
b2R5Pgo8cD5Ib3ZlciBvdmVyIHRoZSBpbWcgYW5kIHdhdGNoIHRoZSBib3ggYmVsb3cganVtcCB1
cCBhbmQgZG93bi48L3A+CjxpbWcgc3JjPSJmb28iPgo8ZGl2PjwvZGl2Pgo8L2JvZHk+CjwvaHRt
bD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>