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

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

Issue 839103002: Consider transformed container's scroll offset when calculating fixed descendant's offset (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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 | « LayoutTests/fast/repaint/fixed-descendant-of-transformed-scrolled-expected.txt ('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) 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 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 if (fixedPositionContainerLayer != ancestorLayer) { 1375 if (fixedPositionContainerLayer != ancestorLayer) {
1376 LayoutPoint fixedContainerCoords; 1376 LayoutPoint fixedContainerCoords;
1377 layer->convertToLayerCoords(fixedPositionContainerLayer, fixedContai nerCoords); 1377 layer->convertToLayerCoords(fixedPositionContainerLayer, fixedContai nerCoords);
1378 1378
1379 LayoutPoint ancestorCoords; 1379 LayoutPoint ancestorCoords;
1380 ancestorLayer->convertToLayerCoords(fixedPositionContainerLayer, anc estorCoords); 1380 ancestorLayer->convertToLayerCoords(fixedPositionContainerLayer, anc estorCoords);
1381 1381
1382 location += (fixedContainerCoords - ancestorCoords); 1382 location += (fixedContainerCoords - ancestorCoords);
1383 } else { 1383 } else {
1384 location += layer->location(); 1384 location += layer->location();
1385 // The spec (http://dev.w3.org/csswg/css-transforms/#transform-rende ring) doesn't say if a
1386 // fixed-position element under a scrollable transformed element sho uld scroll. However,
1387 // other parts of blink scroll the fixed-position element, and the f ollowing keeps the consistency.
1388 if (RenderLayerScrollableArea* scrollableArea = ancestorLayer->scrol lableArea())
Julien - ping for review 2015/01/09 13:25:02 Won't this add the RenderView's scrollOffset to th
Xianzhu 2015/01/09 17:54:16 The RenderView case has been handled above (line 1
1389 location -= LayoutSize(scrollableArea->scrollOffset());
1385 } 1390 }
1386 return ancestorLayer; 1391 return ancestorLayer;
1387 } 1392 }
1388 1393
1389 RenderLayer* parentLayer; 1394 RenderLayer* parentLayer;
1390 if (position == AbsolutePosition) { 1395 if (position == AbsolutePosition) {
1391 // Do what enclosingPositionedAncestor() does, but check for ancestorLay er along the way. 1396 // Do what enclosingPositionedAncestor() does, but check for ancestorLay er along the way.
1392 parentLayer = layer->parent(); 1397 parentLayer = layer->parent();
1393 bool foundAncestorFirst = false; 1398 bool foundAncestorFirst = false;
1394 while (parentLayer) { 1399 while (parentLayer) {
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 } 2905 }
2901 } 2906 }
2902 2907
2903 void showLayerTree(const blink::RenderObject* renderer) 2908 void showLayerTree(const blink::RenderObject* renderer)
2904 { 2909 {
2905 if (!renderer) 2910 if (!renderer)
2906 return; 2911 return;
2907 showLayerTree(renderer->enclosingLayer()); 2912 showLayerTree(renderer->enclosingLayer());
2908 } 2913 }
2909 #endif 2914 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/repaint/fixed-descendant-of-transformed-scrolled-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698