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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2890583002: Fix incorrect use of coords conversion for sticky elements (Closed)
Patch Set: Created 3 years, 7 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 } 1481 }
1482 1482
1483 if (!containing_layer) 1483 if (!containing_layer)
1484 return nullptr; 1484 return nullptr;
1485 1485
1486 location += layer->Location(); 1486 location += layer->Location();
1487 return containing_layer; 1487 return containing_layer;
1488 } 1488 }
1489 1489
1490 void PaintLayer::ConvertToLayerCoords(const PaintLayer* ancestor_layer, 1490 void PaintLayer::ConvertToLayerCoords(const PaintLayer* ancestor_layer,
1491 LayoutPoint& location) const { 1491 LayoutPoint& location,
1492 bool* is_descendant) const {
1492 if (ancestor_layer == this) 1493 if (ancestor_layer == this)
1493 return; 1494 return;
1494 1495
1495 const PaintLayer* curr_layer = this; 1496 const PaintLayer* curr_layer = this;
1496 while (curr_layer && curr_layer != ancestor_layer) 1497 while (curr_layer && curr_layer != ancestor_layer)
1497 curr_layer = 1498 curr_layer =
1498 AccumulateOffsetTowardsAncestor(curr_layer, ancestor_layer, location); 1499 AccumulateOffsetTowardsAncestor(curr_layer, ancestor_layer, location);
1500
1501 if (is_descendant)
1502 *is_descendant = curr_layer == ancestor_layer;
1499 } 1503 }
1500 1504
1501 void PaintLayer::ConvertToLayerCoords(const PaintLayer* ancestor_layer, 1505 void PaintLayer::ConvertToLayerCoords(const PaintLayer* ancestor_layer,
1502 LayoutRect& rect) const { 1506 LayoutRect& rect) const {
1503 LayoutPoint delta; 1507 LayoutPoint delta;
1504 ConvertToLayerCoords(ancestor_layer, delta); 1508 ConvertToLayerCoords(ancestor_layer, delta);
1505 rect.MoveBy(delta); 1509 rect.MoveBy(delta);
1506 } 1510 }
1507 1511
1508 LayoutPoint PaintLayer::VisualOffsetFromAncestor( 1512 LayoutPoint PaintLayer::VisualOffsetFromAncestor(
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after
3328 } 3332 }
3329 3333
3330 void showLayerTree(const blink::LayoutObject* layoutObject) { 3334 void showLayerTree(const blink::LayoutObject* layoutObject) {
3331 if (!layoutObject) { 3335 if (!layoutObject) {
3332 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; 3336 LOG(INFO) << "Cannot showLayerTree. Root is (nil)";
3333 return; 3337 return;
3334 } 3338 }
3335 showLayerTree(layoutObject->EnclosingLayer()); 3339 showLayerTree(layoutObject->EnclosingLayer());
3336 } 3340 }
3337 #endif 3341 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698