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

Side by Side Diff: Source/core/layout/LayoutObject.cpp

Issue 1315203002: Fix selection invalidation in composited scrollers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 inline void LayoutObject::invalidateSelectionIfNeeded(const LayoutBoxModelObject & paintInvalidationContainer, PaintInvalidationReason invalidationReason) 1285 inline void LayoutObject::invalidateSelectionIfNeeded(const LayoutBoxModelObject & paintInvalidationContainer, PaintInvalidationReason invalidationReason)
1286 { 1286 {
1287 // Update selection rect when we are doing full invalidation (in case that t he object is moved, composite status changed, etc.) 1287 // Update selection rect when we are doing full invalidation (in case that t he object is moved, composite status changed, etc.)
1288 // or shouldInvalidationSelection is set (in case that the selection itself changed). 1288 // or shouldInvalidationSelection is set (in case that the selection itself changed).
1289 bool fullInvalidation = view()->doingFullPaintInvalidation() || isFullPaintI nvalidationReason(invalidationReason); 1289 bool fullInvalidation = view()->doingFullPaintInvalidation() || isFullPaintI nvalidationReason(invalidationReason);
1290 if (!fullInvalidation && !shouldInvalidateSelection()) 1290 if (!fullInvalidation && !shouldInvalidateSelection())
1291 return; 1291 return;
1292 1292
1293 LayoutRect oldSelectionRect = previousSelectionRectForPaintInvalidation(); 1293 LayoutRect oldSelectionRect = previousSelectionRectForPaintInvalidation();
1294 LayoutRect newSelectionRect = selectionRectForPaintInvalidation(&paintInvali dationContainer); 1294 LayoutRect newSelectionRect = selectionRectForPaintInvalidation(&paintInvali dationContainer);
1295
1296 // Composited scrolling should not be included in the bounds and position tr acking, because the graphics layer backing the scroller
1297 // does not move on scroll.
1298 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati onContainer != this) {
1299 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset());
1300 newSelectionRect.move(inverseOffset);
1301 }
1302
1295 setPreviousSelectionRectForPaintInvalidation(newSelectionRect); 1303 setPreviousSelectionRectForPaintInvalidation(newSelectionRect);
1296 1304
1297 if (RuntimeEnabledFeatures::slimmingPaintEnabled() && shouldInvalidateSelect ion()) 1305 if (RuntimeEnabledFeatures::slimmingPaintEnabled() && shouldInvalidateSelect ion())
1298 invalidateDisplayItemClients(paintInvalidationContainer); 1306 invalidateDisplayItemClients(paintInvalidationContainer);
1299 1307
1300 if (fullInvalidation) 1308 if (fullInvalidation)
1301 return; 1309 return;
1302 1310
1303 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection, oldSelectionRect, newSelectionRect); 1311 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection, oldSelectionRect, newSelectionRect);
1304 } 1312 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 1371
1364 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) 1372 if (RuntimeEnabledFeatures::slimmingPaintEnabled())
1365 invalidateDisplayItemClients(paintInvalidationContainer); 1373 invalidateDisplayItemClients(paintInvalidationContainer);
1366 1374
1367 if (invalidationReason == PaintInvalidationIncremental) { 1375 if (invalidationReason == PaintInvalidationIncremental) {
1368 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB ounds, newLocation); 1376 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB ounds, newLocation);
1369 return invalidationReason; 1377 return invalidationReason;
1370 } 1378 }
1371 1379
1372 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun ds, newBounds); 1380 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun ds, newBounds);
1381
1373 return invalidationReason; 1382 return invalidationReason;
1374 } 1383 }
1375 1384
1376 PaintInvalidationReason LayoutObject::paintInvalidationReason(const LayoutBoxMod elObject& paintInvalidationContainer, 1385 PaintInvalidationReason LayoutObject::paintInvalidationReason(const LayoutBoxMod elObject& paintInvalidationContainer,
1377 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalida tionBacking, 1386 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalida tionBacking,
1378 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalida tionBacking) const 1387 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalida tionBacking) const
1379 { 1388 {
1380 // First check for InvalidationLocationChange to avoid it from being hidden by other 1389 // First check for InvalidationLocationChange to avoid it from being hidden by other
1381 // invalidation reasons because we'll need to force check for paint invalida tion for 1390 // invalidation reasons because we'll need to force check for paint invalida tion for
1382 // children when location of this object changed. 1391 // children when location of this object changed.
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
3384 const blink::LayoutObject* root = object1; 3393 const blink::LayoutObject* root = object1;
3385 while (root->parent()) 3394 while (root->parent())
3386 root = root->parent(); 3395 root = root->parent();
3387 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3396 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3388 } else { 3397 } else {
3389 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3398 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3390 } 3399 }
3391 } 3400 }
3392 3401
3393 #endif 3402 #endif
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698