Changeset 113932 in webkit
- Timestamp:
- Apr 11, 2012 6:02:34 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113931 r113932 1 2012-04-11 Levi Weintraub <leviw@chromium.org> 2 3 Correct pixel snapping error in RenderBox::pixelSnappedClientWidth/Height 4 https://bugs.webkit.org/show_bug.cgi?id=83621 5 6 Reviewed by Eric Seidel. 7 8 Though the problem wouldn't yet manifest itself since we haven't flipped the switch on sub-pixel 9 layout, clientWidth and clientHeight, when pixel snapped, need to take the RenderBox's location 10 into account. Previously, ClientLeft/Top were used, but these are simply the width of the borders, 11 and don't include the box's sub-pixel location, which is needed to properly snap the width/height. 12 13 No new tests. Untestable until we switch to FractionalLayoutUnits. A test case that covers this 14 is in the subpixellayout branch and will land with the switch. 15 16 * rendering/RenderBox.cpp: 17 (WebCore::RenderBox::pixelSnappedClientWidth): 18 (WebCore::RenderBox::pixelSnappedClientHeight): 19 (WebCore::RenderBox::scrollWidth): Replacing a raw zero with ZERO_LAYOUT_UNIT. 20 1 21 2012-04-11 Erik Arvidsson <arv@chromium.org> 2 22 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r113885 r113932 488 488 int RenderBox::pixelSnappedClientWidth() const 489 489 { 490 return snapSizeToPixel(clientWidth(), clientLeft());490 return snapSizeToPixel(clientWidth(), x() + clientLeft()); 491 491 } 492 492 493 493 int RenderBox::pixelSnappedClientHeight() const 494 494 { 495 return snapSizeToPixel(clientHeight(), clientTop());495 return snapSizeToPixel(clientHeight(), y() + clientTop()); 496 496 } 497 497 … … 504 504 if (style()->isLeftToRightDirection()) 505 505 return snapSizeToPixel(max(clientWidth(), maxXLayoutOverflow() - borderLeft()), clientLeft()); 506 return clientWidth() - min( 0, minXLayoutOverflow() - borderLeft());506 return clientWidth() - min(ZERO_LAYOUT_UNIT, minXLayoutOverflow() - borderLeft()); 507 507 } 508 508
Note: See TracChangeset
for help on using the changeset viewer.