RESOLVED FIXED 48855
Computed style is not correct for negative values in the presence of zooming
https://bugs.webkit.org/show_bug.cgi?id=48855
Summary Computed style is not correct for negative values in the presence of zooming
Erik Arvidsson
Reported 2010-11-02 11:21:53 PDT
Created attachment 72702 [details] Increasing the zoom screws up the negative computed margin style The code that adjusts values for absolute zoom does not correctly handle negatie values. In RenderStyle.h inline int adjustForAbsoluteZoom(int value, const RenderStyle* style) { double zoomFactor = style->effectiveZoom(); if (zoomFactor == 1) return value; // Needed because computeLengthInt truncates (rather than rounds) when scaling up. if (zoomFactor > 1) value++; return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor); } The line value++ screws up negative values which ends up being incorrect.
Attachments
Increasing the zoom screws up the negative computed margin style (582 bytes, text/html)
2010-11-02 11:21 PDT, Erik Arvidsson
no flags
Patch (3.58 KB, patch)
2010-11-02 17:02 PDT, Erik Arvidsson
no flags
Patch (11.02 KB, patch)
2010-11-03 12:28 PDT, Erik Arvidsson
no flags
Patch (11.02 KB, patch)
2010-11-03 13:22 PDT, Erik Arvidsson
no flags
Patch for landing (11.02 KB, patch)
2010-11-03 14:47 PDT, Erik Arvidsson
no flags
Erik Arvidsson
Comment 1 2010-11-02 17:02:01 PDT
Tony Chang
Comment 2 2010-11-03 10:31:55 PDT
Comment on attachment 72772 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=72772&action=review > WebCore/rendering/style/RenderStyle.h:1314 > + if (value < 0) > + value--; Is this supposed to apply both when zoomed in and zoomed out? Does the test try both?
Erik Arvidsson
Comment 3 2010-11-03 10:46:45 PDT
(In reply to comment #2) > (From update of attachment 72772 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=72772&action=review > > > WebCore/rendering/style/RenderStyle.h:1314 > > + if (value < 0) > > + value--; > > Is this supposed to apply both when zoomed in and zoomed out? Does the test try both? I manually tried both. Let me make sure that we check both in the test.
Erik Arvidsson
Comment 4 2010-11-03 12:28:24 PDT
Darin Adler
Comment 5 2010-11-03 12:53:25 PDT
Comment on attachment 72850 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=72850&action=review > LayoutTests/ChangeLog:9 > + Updated the test to include some negative values. I also added tests for zoom less than which in turn > + forced me to increase the values because we lose a lot of precision when zooming out. "Tests for zoom less than"? Not sure what that means.
Erik Arvidsson
Comment 6 2010-11-03 13:22:00 PDT
Erik Arvidsson
Comment 7 2010-11-03 13:22:49 PDT
Fixed description
Erik Arvidsson
Comment 8 2010-11-03 14:47:26 PDT
Created attachment 72874 [details] Patch for landing
WebKit Commit Bot
Comment 9 2010-11-04 02:24:25 PDT
Comment on attachment 72874 [details] Patch for landing Clearing flags on attachment: 72874 Committed r71316: <http://trac.webkit.org/changeset/71316>
WebKit Commit Bot
Comment 10 2010-11-04 02:24:30 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.