Layout with has one extra pixel width on MacOs |
||||||
Issue descriptionhttps://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/image_paint_timing_detector_test.cc?q=image_paint_timing+package:%5Echromium$&dr=C&l=127 When I was writing this test case, I discover that the layout object on the MacOS always has one extra pixel in width. For example, when h*w = 5*6, the size result becomes 37; when h*x = 7*10, the size result becomes 77. The size result in the test is not completely the layout size. It's the layout size that get transformed and intersected with viewport size. Extra work will be needed to tell whether the transform and intersecting have played a role in it.
,
Nov 19
The code I wrote that you linked to is about the control clip of a native-rendered select element. But are you testing such a situation? I think the link you gave may be out of date. What case are you testing?
,
Nov 19
I also use #ifdef here. https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/image_paint_timing_detector_test.cc?q=image_paint_timing+package:%5Echromium$&dr=C&l=304 I was testing the image size. When we set an image of a certain size, the layout size will turn out to be one pixel larger in width, in MacOs only. This looks like the same issue with yours.
,
Nov 23
chrishtr@, I'm marking this available, let me know if you disagree.
,
Dec 3
The issue is due to font heights of inlines being platform-dependent. <img> is by default display:inline, which causes it to use vertical positioning according to the "font" that is used by its inline range. You can fix it easily by changing the images to display:block in your unittest.
,
Jan 7
,
Jan 7
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2e7cb796ead3315ea3795ac7813e89da23e0d27a commit 2e7cb796ead3315ea3795ac7813e89da23e0d27a Author: Liquan(Max) Gu <maxlg@chromium.org> Date: Mon Jan 07 20:12:24 2019 [FCP++] Set Display:block to image paint unit tests As the font heights of inlines is platform-dependent, the height of image in Mac and other platform are determined differently. <img> is by default display:inline, which causes it to use vertical positioning according to the "font" that is used by its inline range. As a result, the unittest shows different height for the image on different platform. To fix it, I change the images to display:block in the unittest. Bug: 894234 Change-Id: I43a582ee41e1bacb3025e2487135e2cbf0a69887 Reviewed-on: https://chromium-review.googlesource.com/c/1398520 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Cr-Commit-Position: refs/heads/master@{#620443} [modify] https://crrev.com/2e7cb796ead3315ea3795ac7813e89da23e0d27a/third_party/blink/renderer/core/paint/image_paint_timing_detector_test.cc
,
Jan 7
Thanks Chris, the problem has been fixed:) |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by maxlg@chromium.org
, Oct 10