Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: Source/core/rendering/RenderLayerScrollableArea.cpp

Issue 568453002: Removing container's Left & Top border from computed scroll offset bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: exposeRect() : Removing borderTop from localExposeRect of scrollable box Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 } 1374 }
1375 1375
1376 document.updateLayout(); 1376 document.updateLayout();
1377 1377
1378 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view. 1378 // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view.
1379 } 1379 }
1380 1380
1381 LayoutRect RenderLayerScrollableArea::exposeRect(const LayoutRect& rect, const S crollAlignment& alignX, const ScrollAlignment& alignY) 1381 LayoutRect RenderLayerScrollableArea::exposeRect(const LayoutRect& rect, const S crollAlignment& alignX, const ScrollAlignment& alignY)
1382 { 1382 {
1383 LayoutRect localExposeRect(box().absoluteToLocalQuad(FloatQuad(FloatRect(rec t)), UseTransforms).boundingBox()); 1383 LayoutRect localExposeRect(box().absoluteToLocalQuad(FloatQuad(FloatRect(rec t)), UseTransforms).boundingBox());
1384 if (box().borderTop() > 0)
1385 localExposeRect.setY(localExposeRect.y().toInt() - box().borderTop());
1386
1384 LayoutRect layerBounds(0, 0, box().clientWidth(), box().clientHeight()); 1387 LayoutRect layerBounds(0, 0, box().clientWidth(), box().clientHeight());
pals 2014/09/24 12:31:36 What about borderLeft()? We should really change (
1385 LayoutRect r = ScrollAlignment::getRectToExpose(layerBounds, localExposeRect , alignX, alignY); 1388 LayoutRect r = ScrollAlignment::getRectToExpose(layerBounds, localExposeRect , alignX, alignY);
1386 1389
1387 IntSize clampedScrollOffset = clampScrollOffset(adjustedScrollOffset() + toI ntSize(roundedIntRect(r).location())); 1390 IntSize clampedScrollOffset = clampScrollOffset(adjustedScrollOffset() + toI ntSize(roundedIntRect(r).location()));
1388 if (clampedScrollOffset == adjustedScrollOffset()) 1391 if (clampedScrollOffset == adjustedScrollOffset())
1389 return rect; 1392 return rect;
1390 1393
1391 IntSize oldScrollOffset = adjustedScrollOffset(); 1394 IntSize oldScrollOffset = adjustedScrollOffset();
1392 scrollToOffset(clampedScrollOffset); 1395 scrollToOffset(clampedScrollOffset);
1393 IntSize scrollOffsetDifference = adjustedScrollOffset() - oldScrollOffset; 1396 IntSize scrollOffsetDifference = adjustedScrollOffset() - oldScrollOffset;
1394 localExposeRect.move(-scrollOffsetDifference); 1397 localExposeRect.move(-scrollOffsetDifference);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild) 1472 void RenderLayerScrollableArea::setTopmostScrollChild(RenderLayer* scrollChild)
1470 { 1473 {
1471 // We only want to track the topmost scroll child for scrollable areas with 1474 // We only want to track the topmost scroll child for scrollable areas with
1472 // overlay scrollbars. 1475 // overlay scrollbars.
1473 if (!hasOverlayScrollbars()) 1476 if (!hasOverlayScrollbars())
1474 return; 1477 return;
1475 m_nextTopmostScrollChild = scrollChild; 1478 m_nextTopmostScrollChild = scrollChild;
1476 } 1479 }
1477 1480
1478 } // namespace blink 1481 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698