Changeset 142638 in webkit
- Timestamp:
- Feb 12, 2013 9:40:28 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r142635 r142638 1 2013-02-12 Emil A Eklund <eae@chromium.org> 2 3 TransformState::move should not round offset to int 4 https://bugs.webkit.org/show_bug.cgi?id=108266 5 6 Reviewed by Simon Fraser. 7 8 Add new tests for Element::boundingClientRect and clip rects for 9 elements on subpixel boundaries. 10 11 * fast/dom/Window/webkitConvertPoint.html: 12 * platform/chromium-linux/fast/dom/Window/webkitConvertPoint-expected.txt: 13 Update test and expectations to take new rounding into account. 14 15 * fast/sub-pixel/boundingclientrect-subpixel-margin-expected.txt: Added. 16 * fast/sub-pixel/boundingclientrect-subpixel-margin.html: Added. 17 Add test ensuring that boundingClientRect returns accurate and 18 precise (as opposed to rounded) metrics. 19 20 * fast/sub-pixel/clip-rect-box-consistent-rounding-expected.html: Added. 21 * fast/sub-pixel/clip-rect-box-consistent-rounding.html: Added. 22 Add test ensuring that clip rects and elements use consistent rounding. 23 24 1 25 2013-02-12 Rafael Weinstein <rafaelw@chromium.org> 2 26 -
trunk/LayoutTests/fast/dom/Window/webkitConvertPoint.html
r137847 r142638 146 146 runTest("Test 9", "test9", 28, 291, 33, 331); 147 147 runTest("Test 10", "test10", 28, 309, 33, 349); 148 runTest("Test 11", "test11", 158, 3 56, 174, 374);149 runTest("Test 12", "test12", 168, 4 29, 184, 447);148 runTest("Test 11", "test11", 158, 376, 174, 394); 149 runTest("Test 12", "test12", 168, 451, 184, 469); 150 150 runTest("Test 13", "test13", 28, 487, 33, 527); 151 151 } else { -
trunk/LayoutTests/platform/chromium-linux/fast/dom/Window/webkitConvertPoint-expected.txt
r138179 r142638 159 159 Test 11 160 160 PASS x is 158 161 FAIL y should be 356. Was 377. 161 PASS y is 376 162 162 Round Trip of (0,0) 163 163 PASS x is 0 164 164 PASS y is 0 165 165 PASS x is 174 166 FAIL y should be 374. Was 395. 166 PASS y is 394 167 167 Round Trip of (5,40) 168 168 PASS x is 5 … … 171 171 Test 12 172 172 PASS x is 168 173 FAIL y should be 429. Was 452. 173 PASS y is 451 174 174 Round Trip of (0,0) 175 175 PASS x is 0 176 176 PASS y is 0 177 177 PASS x is 184 178 FAIL y should be 447. Was 470. 178 PASS y is 469 179 179 Round Trip of (5,40) 180 180 PASS x is 5 -
trunk/LayoutTests/platform/chromium/TestExpectations
r142619 r142638 955 955 webkit.org/b/109272 platform/chromium/fast/forms/suggestion-picker/datetime-suggestion-picker-mouse-operations.html [ Skip ] 956 956 957 # Skip until 109528 is fixed. 958 webkit.org/b/109528 platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-with-scroll-bar.html [ Skip ] 959 webkit.org/b/109528 platform/chromium/fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar.html [ Skip ] 960 webkit.org/b/109528 platform/chromium/fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar.html [ Skip ] 961 957 962 # Skipping rules for ANDROID are in platform/chromium-android/TestExpectations. 958 963 -
trunk/Source/WebCore/ChangeLog
r142637 r142638 1 2013-02-12 Emil A Eklund <eae@chromium.org> 2 3 TransformState::move should not round offset to int 4 https://bugs.webkit.org/show_bug.cgi?id=108266 5 6 Reviewed by Simon Fraser. 7 8 Currently TransformState::move rounds the offset to the nearest 9 integer values, this results in operations using TransformState 10 to compute a position to misreport the location, specifically 11 Element:getBoundingClientRect and repaint rects. Sizes are 12 handled correctly and do not have the same problem. 13 14 Tests: fast/sub-pixel/boundingclientrect-subpixel-margin.html 15 fast/sub-pixel/clip-rect-box-consistent-rounding.html 16 17 * page/FrameView.cpp: 18 (WebCore::FrameView::convertFromRenderer): 19 Change to use pixel snapping instead of enclosing box. All other 20 code paths use pixelSnappedIntRect to align the rects to device 21 pixels however this used enclosingIntRect (indirectly through 22 the FloatQuad::enclosingBoundingBox call). 23 Without the rounding in TransformState this causes repaint rects 24 for elements on subpixel bounds to be too large by up to one 25 pixel on each axis. For normal repaints this isn't really a 26 problem but in scrollContentsSlowPath it can result in moving 27 too large a rect. 28 29 * platform/graphics/transforms/TransformState.cpp: 30 (WebCore::TransformState::translateTransform): 31 (WebCore::TransformState::translateMappedCoordinates): 32 Change to take a LayoutSize instead of an IntSize. 33 34 (WebCore::TransformState::move): 35 (WebCore::TransformState::applyAccumulatedOffset): 36 * platform/graphics/transforms/TransformState.h: 37 Remove rounding logic and use original, more precise, value. 38 39 * rendering/RenderGeometryMap.cpp: 40 (WebCore::RenderGeometryMap::mapToContainer): 41 Remove rounding logic and use original, more precise, value. 42 1 43 2013-02-12 Jessie Berlin <jberlin@apple.com> 2 44 -
trunk/Source/WebCore/page/FrameView.cpp
r142560 r142638 3588 3588 IntRect FrameView::convertFromRenderer(const RenderObject* renderer, const IntRect& rendererRect) const 3589 3589 { 3590 IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect)).enclosingBoundingBox();3590 IntRect rect = pixelSnappedIntRect(enclosingLayoutRect(renderer->localToAbsoluteQuad(FloatRect(rendererRect)).boundingBox())); 3591 3591 3592 3592 // Convert from page ("absolute") to FrameView coordinates. -
trunk/Source/WebCore/platform/graphics/transforms/TransformState.cpp
r139479 r142638 51 51 } 52 52 53 void TransformState::translateTransform(const IntSize& offset)53 void TransformState::translateTransform(const LayoutSize& offset) 54 54 { 55 55 if (m_direction == ApplyTransformDirection) … … 59 59 } 60 60 61 void TransformState::translateMappedCoordinates(const IntSize& offset)62 { 63 IntSize adjustedOffset = (m_direction == ApplyTransformDirection) ? offset : -offset;61 void TransformState::translateMappedCoordinates(const LayoutSize& offset) 62 { 63 LayoutSize adjustedOffset = (m_direction == ApplyTransformDirection) ? offset : -offset; 64 64 if (m_mapPoint) 65 65 m_lastPlanarPoint.move(adjustedOffset); … … 76 76 if (m_accumulatingTransform && m_accumulatedTransform) { 77 77 // If we're accumulating into an existing transform, apply the translation. 78 translateTransform( roundedIntSize(offset));78 translateTransform(offset); 79 79 80 80 // Then flatten if necessary. … … 83 83 } else 84 84 // Just move the point and/or quad. 85 translateMappedCoordinates( roundedIntSize(offset));85 translateMappedCoordinates(offset); 86 86 } 87 87 m_accumulatingTransform = accumulate == AccumulateTransform; … … 90 90 void TransformState::applyAccumulatedOffset() 91 91 { 92 IntSize offset = roundedIntSize(m_accumulatedOffset);92 LayoutSize offset = m_accumulatedOffset; 93 93 m_accumulatedOffset = LayoutSize(); 94 94 if (!offset.isZero()) { -
trunk/Source/WebCore/platform/graphics/transforms/TransformState.h
r139479 r142638 102 102 103 103 private: 104 void translateTransform(const IntSize&);105 void translateMappedCoordinates(const IntSize&);104 void translateTransform(const LayoutSize&); 105 void translateMappedCoordinates(const LayoutSize&); 106 106 void flattenWithTransform(const TransformationMatrix&, bool* wasClamped); 107 107 void applyAccumulatedOffset(); -
trunk/Source/WebCore/rendering/RenderGeometryMap.cpp
r137847 r142638 129 129 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() && (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) { 130 130 result = rect; 131 result.move( roundedIntSize(m_accumulatedOffset));131 result.move(m_accumulatedOffset); 132 132 } else { 133 133 TransformState transformState(TransformState::ApplyTransformDirection, rect.center(), rect);
Note: See TracChangeset
for help on using the changeset viewer.