Bug 99104 - [subpixel] Change intrinsicSize to LayoutUnit
Summary: [subpixel] Change intrinsicSize to LayoutUnit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Emil A Eklund
URL:
Keywords:
: 91007 (view as bug list)
Depends on: 99108
Blocks: 100854
  Show dependency treegraph
 
Reported: 2012-10-11 15:12 PDT by Emil A Eklund
Modified: 2012-11-01 09:13 PDT (History)
13 users (show)

See Also:


Attachments
Patch (1.32 MB, patch)
2012-10-11 15:19 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff
Patch (163.67 KB, patch)
2012-10-12 11:43 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff
Patch (163.54 KB, patch)
2012-10-15 10:47 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff
Patch (164.14 KB, patch)
2012-10-31 08:02 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff
Patch (162.49 KB, patch)
2012-11-01 06:40 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emil A Eklund 2012-10-11 15:12:59 PDT
Change RenderReplaced and intrinsicSize to LayoutUnit to avoid rounding problems when zooming/scaling.
Comment 1 Emil A Eklund 2012-10-11 15:19:42 PDT
Created attachment 168286 [details]
Patch
Comment 2 Levi Weintraub 2012-10-11 15:28:56 PDT
Comment on attachment 168286 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=168286&action=review

> Source/WebCore/loader/cache/CachedImage.h:31
> +#include "SVGImageCache.h"
> +

I'm guessing this isn't necessary.

> Source/WebCore/rendering/InlineFlowBox.cpp:631
> +        LayoutUnit baselinePosition = curr->baselinePosition(baselineType);
> +        if (curr->renderer()->isReplaced())
> +            baselinePosition = baselinePosition.floor();

It seems like the changes here and in RenderBox could be landed, along with a lot of rebaselines, first. This could help shrink the size of this patch to a more reasonable size.

> Source/WebCore/rendering/RenderBox.cpp:3321
> -    computedValues.m_position = logicalLeftPos.round();
> +    computedValues.m_position = logicalLeftPos;

I'd love to see the rationale for this in the changelog.
Comment 3 Emil A Eklund 2012-10-11 16:00:59 PDT
Good idea, I've broken out the InlineFlowBox and RenderBox changes into a separate change, see bug 99108.
Comment 4 Emil A Eklund 2012-10-12 11:43:14 PDT
Created attachment 168454 [details]
Patch
Comment 5 WebKit Review Bot 2012-10-12 13:03:02 PDT
Comment on attachment 168454 [details]
Patch

Attachment 168454 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14266407

New failing tests:
fast/reflections/reflection-with-zoom.html
Comment 6 Emil A Eklund 2012-10-15 10:47:15 PDT
Created attachment 168740 [details]
Patch
Comment 7 Eric Seidel (no email) 2012-10-15 14:15:35 PDT
Attachment 168740 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1
LayoutTests/platform/chromium-linux/compositing/overflow/scroll-ancestor-update-expected.png:0:  Have to enable auto props in the subversion config file (/Users/eseidel/.subversion/config "enable-auto-props = yes"). Have to set the svn:mime-type in the subversion config file (/Users/eseidel/.subversion/config "*.png = svn:mime-type=image/png").  [image/png] [5]
Total errors found: 1 in 36 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 WebKit Review Bot 2012-10-15 21:58:55 PDT
Comment on attachment 168740 [details]
Patch

Attachment 168740 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14389009

New failing tests:
svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml
svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml
fast/reflections/reflection-with-zoom.html
Comment 9 WebKit Review Bot 2012-10-15 23:01:35 PDT
Comment on attachment 168740 [details]
Patch

Attachment 168740 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14390035

New failing tests:
svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml
svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml
fast/reflections/reflection-with-zoom.html
Comment 10 Emil A Eklund 2012-10-31 08:02:44 PDT
Created attachment 171661 [details]
Patch
Comment 11 Dominik Röttsches (drott) 2012-10-31 08:09:32 PDT
Any chance this fixes bug 67712?
Comment 12 Emil A Eklund 2012-10-31 08:28:00 PDT
(In reply to comment #11)
> Any chance this fixes bug 67712?

Sadly it does not. To fix that bug we'll have to change our image scaling to take the pixel snapped (as opposed to rounded) size into account.
Comment 13 Emil A Eklund 2012-11-01 04:24:15 PDT
Ping?
Comment 14 Levi Weintraub 2012-11-01 04:36:57 PDT
Comment on attachment 171661 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171661&action=review

Overall this looks good, except you use LayoutUnits/Rects/Sizes and FractionalLayoutUnits/Rects/Sizes inconsistently through this patch. Let's keep the "Fractional" part out for consistency and give this another try.

> Source/WebCore/html/ImageDocument.cpp:158
> +        // At a zoom level of 1 the image is guaranteed to have an integer size.

This sounds like an assert to me :)

> Source/WebCore/loader/cache/CachedImage.cpp:268
> +    ASSERT(multiplier != 1.0f || (imageSize.width().fraction() == 0.0f && imageSize.height().fraction() == 0.0f));

Actually, looks like you've got it covered!

> Source/WebCore/platform/graphics/FractionalLayoutSize.h:75
> -    void scale(float scale)
> +    void scale(float widthScale, float heightScale)

Why not just add this two-argument version?

> Source/WebCore/rendering/RenderReplaced.h:49
> -    virtual int minimumReplacedHeight() const { return 0; }
> +    virtual LayoutUnit minimumReplacedHeight() const { return 0; }

LayoutUnit()?

> Source/WebCore/rendering/RenderVideo.cpp:84
> +    float scaleFactor = style()->effectiveZoom();
> +    size.scale(scaleFactor, scaleFactor);

This would be easier with the single-argument version, no?

> Source/WebCore/rendering/RenderVideo.cpp:98
> +FractionalLayoutSize RenderVideo::calculateIntrinsicSize()

Why FrationalLayoutSize instead of LayoutSize?

> Source/WebCore/rendering/style/StyleGeneratedImage.cpp:70
> -    IntSize size = imageSize(renderer, 1);
> +    IntSize size = flooredIntSize(imageSize(renderer, 1));

I think another comment about the flooring is warranted.
Comment 15 Emil A Eklund 2012-11-01 06:40:58 PDT
Created attachment 171832 [details]
Patch
Comment 16 Emil A Eklund 2012-11-01 06:41:55 PDT
(In reply to comment #14)
Made the changes you suggested, PTAL.
Comment 17 Levi Weintraub 2012-11-01 06:48:34 PDT
Comment on attachment 171832 [details]
Patch

Perfect. Thanks!
Comment 18 WebKit Review Bot 2012-11-01 08:00:51 PDT
Comment on attachment 171832 [details]
Patch

Clearing flags on attachment: 171832

Committed r133172: <http://trac.webkit.org/changeset/133172>
Comment 19 WebKit Review Bot 2012-11-01 08:00:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 20 Emil A Eklund 2012-11-01 09:13:46 PDT
*** Bug 91007 has been marked as a duplicate of this bug. ***