Changeset 118569 in webkit
- Timestamp:
- May 25, 2012 2:48:51 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r118567 r118569 1 2012-05-25 John Knottenbelt <jknotten@chromium.org> 2 3 Body scrollWidth() and scrollHeight() should be page scale-invariant 4 https://bugs.webkit.org/show_bug.cgi?id=87494 5 6 RenderView::documentRect() is calculating the "scaled" document rect by applying 7 the current transformation matrix to the unscaledDocumentRect() and then 8 returning the rounded-out IntRect result. 9 10 This rounding out is incorrect because it allows the scaled rectangle to 11 represent an area that is not actually covered by the document. 12 13 We fix this by applying the current transform to the document rect 14 as a FloatRect and then explicitly converting to IntRect, which 15 takes the floor of the resulting rectangle coordinates instead of 16 rounding them out. 17 18 This is evidenced by the document.body.scrollWidth() and 19 document.body.scrollHeight() changing under page scale factor when 20 they are expected to remain invariant. 21 22 Reviewed by James Robinson. 23 24 * fast/dom/window-scroll-scaling-expected.txt: Added. 25 * fast/dom/window-scroll-scaling.html: Added. 26 1 27 2012-05-25 Simon Fraser <simon.fraser@apple.com> 2 28 -
trunk/Source/WebCore/ChangeLog
r118568 r118569 1 2012-05-25 John Knottenbelt <jknotten@chromium.org> 2 3 Body scrollWidth() and scrollHeight() should be page scale-invariant 4 https://bugs.webkit.org/show_bug.cgi?id=87494 5 6 RenderView::documentRect() is calculating the "scaled" document rect by applying 7 the current transformation matrix to the unscaledDocumentRect() and then 8 returning the rounded-out IntRect result. 9 10 This rounding out is incorrect because it allows the scaled rectangle to 11 represent an area that is not actually covered by the document. 12 13 We fix this by applying the current transform to the document rect 14 as a FloatRect and then explicitly converting to IntRect, which 15 takes the floor of the resulting rectangle coordinates instead of 16 rounding them out. 17 18 This is evidenced by the document.body.scrollWidth() and 19 document.body.scrollHeight() changing under page scale factor when 20 they are expected to remain invariant. 21 22 Reviewed by James Robinson. 23 24 Test: fast/dom/window-scroll-scaling.html 25 26 * rendering/RenderView.cpp: 27 (WebCore::RenderView::documentRect): 28 1 29 2012-05-25 Dan Bernstein <mitz@apple.com> 2 30 -
trunk/Source/WebCore/rendering/RenderView.cpp
r118567 r118569 756 756 IntRect RenderView::documentRect() const 757 757 { 758 IntRect overflowRect(unscaledDocumentRect());758 FloatRect overflowRect(unscaledDocumentRect()); 759 759 if (hasTransform()) 760 760 overflowRect = layer()->currentTransform().mapRect(overflowRect); 761 return overflowRect;761 return IntRect(overflowRect); 762 762 } 763 763
Note: See TracChangeset
for help on using the changeset viewer.