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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2698843004: Correct for enclosing layers scroll position in sticky_data->main_thread_offset (Closed)
Patch Set: Force compositing inputs dirty in test Created 3 years, 10 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 304 }
305 } 305 }
306 306
307 WebLayerStickyPositionConstraint webConstraint; 307 WebLayerStickyPositionConstraint webConstraint;
308 if (sticky) { 308 if (sticky) {
309 const StickyPositionScrollingConstraints& constraints = 309 const StickyPositionScrollingConstraints& constraints =
310 ancestorOverflowLayer->getScrollableArea()->stickyConstraintsMap().get( 310 ancestorOverflowLayer->getScrollableArea()->stickyConstraintsMap().get(
311 &m_owningLayer); 311 &m_owningLayer);
312 312
313 // Find the layout offset of the unshifted sticky box within its enclosing 313 // Find the layout offset of the unshifted sticky box within its enclosing
314 // layer. 314 // layer. If the enclosing layer is not the scroller, the offset must be
315 // adjusted to include the scroll offset to keep it relative.
316 PaintLayer* enclosingLayer =
317 m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf);
315 LayoutPoint enclosingLayerOffset; 318 LayoutPoint enclosingLayerOffset;
316 m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf) 319 enclosingLayer->convertToLayerCoords(m_owningLayer.ancestorOverflowLayer(),
317 ->convertToLayerCoords(m_owningLayer.ancestorOverflowLayer(), 320 enclosingLayerOffset);
318 enclosingLayerOffset); 321 if (enclosingLayer != m_owningLayer.ancestorOverflowLayer()) {
322 enclosingLayerOffset += LayoutSize(enclosingLayer->ancestorOverflowLayer()
flackr 2017/02/22 20:44:00 nit: use ancestorOverflowLayer (from line 296) her
smcgruer 2017/02/22 20:48:18 Done.
323 ->getScrollableArea()
324 ->getScrollOffset());
325 }
326
319 FloatPoint stickyBoxOffset = 327 FloatPoint stickyBoxOffset =
320 constraints.scrollContainerRelativeStickyBoxRect().location(); 328 constraints.scrollContainerRelativeStickyBoxRect().location();
321 DCHECK(!m_contentOffsetInCompositingLayerDirty); 329 DCHECK(!m_contentOffsetInCompositingLayerDirty);
322 stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset) - 330 stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset) -
323 FloatSize(contentOffsetInCompositingLayer())); 331 FloatSize(contentOffsetInCompositingLayer()));
324 332
325 webConstraint.isSticky = true; 333 webConstraint.isSticky = true;
326 webConstraint.isAnchoredLeft = 334 webConstraint.isAnchoredLeft =
327 constraints.anchorEdges() & 335 constraints.anchorEdges() &
328 StickyPositionScrollingConstraints::AnchorEdgeLeft; 336 StickyPositionScrollingConstraints::AnchorEdgeLeft;
(...skipping 3151 matching lines...) Expand 10 before | Expand all | Expand 10 after
3480 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3488 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3481 name = "Decoration Layer"; 3489 name = "Decoration Layer";
3482 } else { 3490 } else {
3483 ASSERT_NOT_REACHED(); 3491 ASSERT_NOT_REACHED();
3484 } 3492 }
3485 3493
3486 return name; 3494 return name;
3487 } 3495 }
3488 3496
3489 } // namespace blink 3497 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698