Bug 126898 - Subpixel layout: -webkit-flex pushes content off of-by-one pixel.
Summary: Subpixel layout: -webkit-flex pushes content off of-by-one pixel.
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks: 126283
  Show dependency treegraph
 
Reported: 2014-01-13 07:36 PST by zalan
Modified: 2022-02-15 17:19 PST (History)
10 users (show)

See Also:


Attachments
Patch (1.80 KB, patch)
2021-04-02 05:18 PDT, Rob Buis
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2014-01-13 07:36:01 PST
LayoutTests/css3/flexbox/image-percent-max-height.html
Comment 1 zalan 2014-01-15 20:05:23 PST
The flexbox layout ends up with different value for the available space (compared to the default layout flow) -> centering the content results in different x pos.
Comment 2 zalan 2014-01-15 20:21:46 PST
this double rounding is probably unnecessary. The reason why it works when subpixel is off is in that case both layout paths round, one is explicitly while the other is implicitly (due to using only integral px positions).

diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp
index d81b6cb..c0dc7a4 100644
--- a/Source/WebCore/rendering/RenderReplaced.cpp
+++ b/Source/WebCore/rendering/RenderReplaced.cpp
@@ -388,7 +388,7 @@ LayoutUnit RenderReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh
             // of 'width' is: (used height) * (intrinsic ratio)
             if (intrinsicRatio && ((heightIsAuto && !hasIntrinsicWidth && hasIntrinsicHeight) || !heightIsAuto)) {
                 LayoutUnit logicalHeight = computeReplacedLogicalHeight();
-                return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(logicalHeight * intrinsicRatio)), shouldComputePreferred);
+                return computeReplacedLogicalWidthRespectingMinMaxWidth(logicalHeight * intrinsicRatio, shouldComputePreferred);
             }
Comment 3 zalan 2014-01-19 17:59:00 PST
<rdar://problem/15855716>
Comment 4 Jonathan Bedard 2017-06-03 08:27:10 PDT
This is only an issue in simulators, this test passes on device.  Moved the expectation in <https://trac.webkit.org/changeset/217757/webkit>.
Comment 5 Rob Buis 2021-04-02 05:18:03 PDT
Created attachment 425009 [details]
Patch