Changeset 128346 in webkit
- Timestamp:
- Sep 12, 2012 12:17:03 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r128342 r128346 1 2012-09-12 Levi Weintraub <leviw@chromium.org> 2 3 Inline repainting can be off-by-one with sub-pixel enabled 4 https://bugs.webkit.org/show_bug.cgi?id=95882 5 6 Reviewed by Eric Seidel. 7 8 Test that we properly repaint selection gaps inside tables with sub-pixel offsets. 9 10 * fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt: Added. 11 * fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html: Added. 12 * platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png: Added. 13 * platform/chromium/TestExpectations: 14 * platform/mac-lion/Skipped: 15 * platform/mac-snowleopard/Skipped: 16 * platform/mac-wk2/Skipped: 17 * platform/mac/Skipped: 18 * platform/qt-4.8/Skipped: 19 * platform/qt/Skipped: 20 * platform/win-wk2/Skipped: 21 * platform/win-xp/Skipped: 22 * platform/win/Skipped: 23 * platform/wincairo/Skipped: 24 * platform/wk2/Skipped: 25 1 26 2012-09-12 Zan Dobersek <zandobersek@gmail.com> 2 27 -
trunk/LayoutTests/platform/chromium/TestExpectations
r128314 r128346 3428 3428 BUGWK94256 DEBUG : fast/block/inline-children-root-linebox-crash.html = PASS CRASH 3429 3429 3430 // Need baselines after bots cycle 3431 BUGLEVIW LINUX WIN SNOWLEOPARD : fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html = PASS IMAGE IMAGE+TEXT MISSING 3432 3430 3433 // Following tests need baselines on Win and Linux 3431 3434 BUGWK94492 WIN LINUX : css3/filters/custom/custom-filter-color-matrix.html = IMAGE -
trunk/LayoutTests/platform/mac-lion/Skipped
r127933 r128346 119 119 fast/sub-pixel/table-rows-no-gaps.html 120 120 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 121 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 121 122 122 123 # This media test always failed on Lion -
trunk/LayoutTests/platform/mac-snowleopard/Skipped
r127933 r128346 213 213 fast/sub-pixel/table-rows-no-gaps.html 214 214 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 215 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 215 216 216 217 # Frame::findString does nothing on pages that prevent selection -
trunk/LayoutTests/platform/mac-wk2/Skipped
r127933 r128346 217 217 fast/sub-pixel/table-rows-no-gaps.html 218 218 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 219 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 219 220 220 221 # fast/events/pagehide-timeout.html, pageshow-pagehide-on-back-cached-with-frames.html, and -
trunk/LayoutTests/platform/mac/Skipped
r128072 r128346 825 825 fast/sub-pixel/table-rows-no-gaps.html 826 826 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 827 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 827 828 828 829 # No CORS support for media elements is implemented yet. -
trunk/LayoutTests/platform/qt-4.8/Skipped
r127933 r128346 106 106 fast/sub-pixel/table-rows-no-gaps.html 107 107 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 108 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 108 109 109 110 # SVG Fonts are only supported when using QRawFont, which is not -
trunk/LayoutTests/platform/qt/Skipped
r128306 r128346 308 308 fast/sub-pixel/table-rows-no-gaps.html 309 309 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 310 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 310 311 311 312 # CSS Regions support not yet enabled. http://webkit.org/b/57312 -
trunk/LayoutTests/platform/win-wk2/Skipped
r127933 r128346 950 950 fast/sub-pixel/table-rows-no-gaps.html 951 951 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 952 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 952 953 953 954 # HiDPI tests require test infrastructure enhancements -
trunk/LayoutTests/platform/win-xp/Skipped
r127933 r128346 49 49 fast/sub-pixel/table-rows-no-gaps.html 50 50 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 51 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 51 52 52 53 # REGRESSION (r83928 or before): Some tests failing assertions in MarkStack::internalAppend / MarkStack::drain -
trunk/LayoutTests/platform/win/Skipped
r128129 r128346 1746 1746 fast/sub-pixel/table-rows-no-gaps.html 1747 1747 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 1748 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 1748 1749 1749 1750 # No CORS support for media elements is implemented yet. -
trunk/LayoutTests/platform/wincairo/Skipped
r127933 r128346 2135 2135 fast/sub-pixel/table-rows-no-gaps.html 2136 2136 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 2137 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 2137 2138 2138 2139 #Battery Status API is not implemented. -
trunk/LayoutTests/platform/wk2/Skipped
r128338 r128346 98 98 fast/sub-pixel/table-rows-no-gaps.html 99 99 fast/sub-pixel/sub-pixel-accumulates-to-layers.html 100 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 100 101 101 102 # [WK2][WTR] svg/animations/animate-text-nested-transforms.html fails -
trunk/Source/WebCore/ChangeLog
r128345 r128346 1 2012-09-12 Levi Weintraub <leviw@chromium.org> 2 3 Inline repainting can be off-by-one with sub-pixel enabled 4 https://bugs.webkit.org/show_bug.cgi?id=95882 5 6 Reviewed by Eric Seidel. 7 8 With sub-pixel layout enabled, context accumulated from containing renderers is used to properly 9 pixel snap. Selection repaint rects are stored outside the affected renderers, and are handed to 10 the embedder without the context to correctly determine the snapped values. This can result in 11 repaint areas smaller than what's needed. 12 13 This could be fixed three ways: 14 - by changing selection repaint rects to an IntRect and pixel snapping the values before storing 15 them outside the render tree. This is the narrowest solution. 16 - by adapting layout to store pixel snapping hints along with the size/location of the renderer. 17 This is the best possible solution, as it would help solve a lot of pixel snapping issues and 18 reduce complexity of handling. I eventually intend on implementing this. 19 - by reverting repaintUsingContainer to IntRects and using pixel snapping when possible, and 20 enclosingIntRect where we lack context. 21 22 This implements the last solution, as it's the least invasive, but can potentially fix numerous 23 sub-pixel repaint issues. 24 25 Test: fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 26 27 * rendering/RenderBlockLineLayout.cpp: 28 (WebCore::RenderBlock::layoutRunsAndFloats): 29 * rendering/RenderLayer.cpp: 30 (WebCore::RenderLayer::updateLayerPositions): 31 (WebCore::RenderLayer::scrollTo): 32 (WebCore::RenderLayer::repaintIncludingNonCompositingDescendants): 33 * rendering/RenderObject.cpp: 34 (WebCore::RenderObject::repaintUsingContainer): 35 (WebCore::RenderObject::repaint): 36 (WebCore::RenderObject::repaintRectangle): 37 (WebCore::RenderObject::repaintAfterLayoutIfNeeded): 38 * rendering/RenderObject.h: 39 (RenderObject): 40 * rendering/RenderSelectionInfo.h: 41 (WebCore::RenderSelectionInfo::repaint): 42 (WebCore::RenderBlockSelectionInfo::repaint): 43 1 44 2012-09-12 Michael Saboff <msaboff@apple.com> 2 45 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r128083 r128346 1233 1233 // before layout started. Luckily the layer has cached the repaint rect for its original 1234 1234 // position and size, and so we can use that to make a repaint happen now. 1235 repaintUsingContainer(containerForRepaint(), layer()->repaintRect());1235 repaintUsingContainer(containerForRepaint(), pixelSnappedIntRect(layer()->repaintRect())); 1236 1236 } 1237 1237 } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r128134 r128346 401 401 if (view && !view->printing()) { 402 402 if (m_repaintStatus & NeedsFullRepaint) { 403 renderer()->repaintUsingContainer(repaintContainer, oldRepaintRect);403 renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldRepaintRect)); 404 404 if (m_repaintRect != oldRepaintRect) 405 renderer()->repaintUsingContainer(repaintContainer, m_repaintRect);405 renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_repaintRect)); 406 406 } else if (shouldRepaintAfterLayout()) 407 407 renderer()->repaintAfterLayoutIfNeeded(repaintContainer, oldRepaintRect, oldOutlineBox, &m_repaintRect, &m_outlineBox); … … 1734 1734 // Just schedule a full repaint of our object. 1735 1735 if (view && !usesCompositedScrolling()) 1736 renderer()->repaintUsingContainer(repaintContainer, m_repaintRect);1736 renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_repaintRect)); 1737 1737 1738 1738 // Schedule the scroll DOM event. … … 4802 4802 void RenderLayer::repaintIncludingNonCompositingDescendants(RenderBoxModelObject* repaintContainer) 4803 4803 { 4804 renderer()->repaintUsingContainer(repaintContainer, renderer()->clippedOverflowRectForRepaint(repaintContainer));4804 renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(renderer()->clippedOverflowRectForRepaint(repaintContainer))); 4805 4805 4806 4806 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) { -
trunk/Source/WebCore/rendering/RenderObject.cpp
r127318 r128346 1278 1278 } 1279 1279 1280 void RenderObject::repaintUsingContainer(RenderBoxModelObject* repaintContainer, const LayoutRect& r, bool immediate) const1280 void RenderObject::repaintUsingContainer(RenderBoxModelObject* repaintContainer, const IntRect& r, bool immediate) const 1281 1281 { 1282 1282 if (!repaintContainer) { … … 1305 1305 LayoutRect repaintRectangle = r; 1306 1306 if (viewHasCompositedLayer && v->layer()->transform()) 1307 repaintRectangle = v->layer()->transform()->mapRect(r);1307 repaintRectangle = enclosingIntRect(v->layer()->transform()->mapRect(r)); 1308 1308 v->repaintViewRectangle(repaintRectangle, immediate); 1309 1309 return; … … 1332 1332 1333 1333 RenderBoxModelObject* repaintContainer = containerForRepaint(); 1334 repaintUsingContainer(repaintContainer ? repaintContainer : view, clippedOverflowRectForRepaint(repaintContainer), immediate);1334 repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnappedIntRect(clippedOverflowRectForRepaint(repaintContainer)), immediate); 1335 1335 } 1336 1336 … … 1353 1353 RenderBoxModelObject* repaintContainer = containerForRepaint(); 1354 1354 computeRectForRepaint(repaintContainer, dirtyRect); 1355 repaintUsingContainer(repaintContainer ? repaintContainer : view, dirtyRect, immediate);1355 repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnappedIntRect(dirtyRect), immediate); 1356 1356 } 1357 1357 … … 1388 1388 1389 1389 if (fullRepaint) { 1390 repaintUsingContainer(repaintContainer, oldBounds);1390 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds)); 1391 1391 if (newBounds != oldBounds) 1392 repaintUsingContainer(repaintContainer, newBounds);1392 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds)); 1393 1393 return true; 1394 1394 } … … 1399 1399 LayoutUnit deltaLeft = newBounds.x() - oldBounds.x(); 1400 1400 if (deltaLeft > 0) 1401 repaintUsingContainer(repaintContainer, LayoutRect(oldBounds.x(), oldBounds.y(), deltaLeft, oldBounds.height()));1401 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), oldBounds.y(), deltaLeft, oldBounds.height())); 1402 1402 else if (deltaLeft < 0) 1403 repaintUsingContainer(repaintContainer, LayoutRect(newBounds.x(), newBounds.y(), -deltaLeft, newBounds.height()));1403 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), newBounds.y(), -deltaLeft, newBounds.height())); 1404 1404 1405 1405 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); 1406 1406 if (deltaRight > 0) 1407 repaintUsingContainer(repaintContainer, LayoutRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()));1407 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height())); 1408 1408 else if (deltaRight < 0) 1409 repaintUsingContainer(repaintContainer, LayoutRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()));1409 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height())); 1410 1410 1411 1411 LayoutUnit deltaTop = newBounds.y() - oldBounds.y(); 1412 1412 if (deltaTop > 0) 1413 repaintUsingContainer(repaintContainer, LayoutRect(oldBounds.x(), oldBounds.y(), oldBounds.width(), deltaTop));1413 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), oldBounds.y(), oldBounds.width(), deltaTop)); 1414 1414 else if (deltaTop < 0) 1415 repaintUsingContainer(repaintContainer, LayoutRect(newBounds.x(), newBounds.y(), newBounds.width(), -deltaTop));1415 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), newBounds.y(), newBounds.width(), -deltaTop)); 1416 1416 1417 1417 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); 1418 1418 if (deltaBottom > 0) 1419 repaintUsingContainer(repaintContainer, LayoutRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom));1419 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom)); 1420 1420 else if (deltaBottom < 0) 1421 repaintUsingContainer(repaintContainer, LayoutRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom));1421 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom)); 1422 1422 1423 1423 if (newOutlineBox == oldOutlineBox) … … 1444 1444 if (rightRect.x() < right) { 1445 1445 rightRect.setWidth(min(rightRect.width(), right - rightRect.x())); 1446 repaintUsingContainer(repaintContainer, rightRect);1446 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rightRect)); 1447 1447 } 1448 1448 } … … 1463 1463 if (bottomRect.y() < bottom) { 1464 1464 bottomRect.setHeight(min(bottomRect.height(), bottom - bottomRect.y())); 1465 repaintUsingContainer(repaintContainer, bottomRect);1465 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(bottomRect)); 1466 1466 } 1467 1467 } -
trunk/Source/WebCore/rendering/RenderObject.h
r127681 r128346 757 757 // Actually do the repaint of rect r for this object which has been computed in the coordinate space 758 758 // of repaintContainer. If repaintContainer is 0, repaint via the view. 759 void repaintUsingContainer(RenderBoxModelObject* repaintContainer, const LayoutRect&, bool immediate = false) const;759 void repaintUsingContainer(RenderBoxModelObject* repaintContainer, const IntRect&, bool immediate = false) const; 760 760 761 761 // Repaint the entire object. Called when, e.g., the color of a border changes, or when a border -
trunk/Source/WebCore/rendering/RenderSelectionInfo.h
r112248 r128346 69 69 void repaint() 70 70 { 71 m_object->repaintUsingContainer(m_repaintContainer, m_rect);71 m_object->repaintUsingContainer(m_repaintContainer, enclosingIntRect(m_rect)); 72 72 } 73 73 … … 90 90 void repaint() 91 91 { 92 m_object->repaintUsingContainer(m_repaintContainer, m_rects);92 m_object->repaintUsingContainer(m_repaintContainer, enclosingIntRect(m_rects)); 93 93 } 94 94
Note: See TracChangeset
for help on using the changeset viewer.