Bug 126898

Summary: Subpixel layout: -webkit-flex pushes content off of-by-one pixel.
Product: WebKit Reporter: alan baradlay <zalan>
Component: Layout and RenderingAssignee: alan baradlay <zalan>
Status: ASSIGNED    
Severity: Normal CC: changseok, esprehn+autocc, ews-watchlist, glenn, jbedard, jonlee, kondapallykalyan, pdr, rbuis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=236680
Bug Depends on:    
Bug Blocks: 126283    
Attachments:
Description Flags
Patch ews-feeder: commit-queue-

alan baradlay
Reported 2014-01-13 07:36:01 PST
LayoutTests/css3/flexbox/image-percent-max-height.html
Attachments
Patch (1.80 KB, patch)
2021-04-02 05:18 PDT, Rob Buis
ews-feeder: commit-queue-
alan baradlay
Comment 1 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.
alan baradlay
Comment 2 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); }
alan baradlay
Comment 3 2014-01-19 17:59:00 PST
Jonathan Bedard
Comment 4 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>.
Rob Buis
Comment 5 2021-04-02 05:18:03 PDT
Note You need to log in before you can comment on or make changes to this bug.