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

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

Issue 16057002: Fixed position elements should layout relative to transformed container (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
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 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 ASSERT(fixedPositionContainerLayer); // We should have hit the RenderVie w's layer at least. 1960 ASSERT(fixedPositionContainerLayer); // We should have hit the RenderVie w's layer at least.
1961 1961
1962 if (fixedPositionContainerLayer != ancestorLayer) { 1962 if (fixedPositionContainerLayer != ancestorLayer) {
1963 LayoutPoint fixedContainerCoords; 1963 LayoutPoint fixedContainerCoords;
1964 layer->convertToLayerCoords(fixedPositionContainerLayer, fixedContai nerCoords); 1964 layer->convertToLayerCoords(fixedPositionContainerLayer, fixedContai nerCoords);
1965 1965
1966 LayoutPoint ancestorCoords; 1966 LayoutPoint ancestorCoords;
1967 ancestorLayer->convertToLayerCoords(fixedPositionContainerLayer, anc estorCoords); 1967 ancestorLayer->convertToLayerCoords(fixedPositionContainerLayer, anc estorCoords);
1968 1968
1969 location += (fixedContainerCoords - ancestorCoords); 1969 location += (fixedContainerCoords - ancestorCoords);
1970 return ancestorLayer; 1970 } else
1971 } 1971 location += toSize(layer->location());
1972 return ancestorLayer;
1972 } 1973 }
1973 1974
1974 RenderLayer* parentLayer; 1975 RenderLayer* parentLayer;
1975 if (position == AbsolutePosition || position == FixedPosition) { 1976 if (position == AbsolutePosition || position == FixedPosition) {
1976 // Do what enclosingPositionedAncestor() does, but check for ancestorLay er along the way. 1977 // Do what enclosingPositionedAncestor() does, but check for ancestorLay er along the way.
1977 parentLayer = layer->parent(); 1978 parentLayer = layer->parent();
1978 bool foundAncestorFirst = false; 1979 bool foundAncestorFirst = false;
1979 while (parentLayer) { 1980 while (parentLayer) {
1980 // RenderFlowThread is a positioned container, child of RenderView, positioned at (0,0). 1981 // RenderFlowThread is a positioned container, child of RenderView, positioned at (0,0).
1981 // This implies that, for out-of-flow positioned elements inside a R enderFlowThread, 1982 // This implies that, for out-of-flow positioned elements inside a R enderFlowThread,
(...skipping 4460 matching lines...) Expand 10 before | Expand all | Expand 10 after
6442 } 6443 }
6443 } 6444 }
6444 6445
6445 void showLayerTree(const WebCore::RenderObject* renderer) 6446 void showLayerTree(const WebCore::RenderObject* renderer)
6446 { 6447 {
6447 if (!renderer) 6448 if (!renderer)
6448 return; 6449 return;
6449 showLayerTree(renderer->enclosingLayer()); 6450 showLayerTree(renderer->enclosingLayer());
6450 } 6451 }
6451 #endif 6452 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698