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

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: Address nit Created 3 years, 9 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.
chrishtr 2017/02/28 19:36:28 "relative to compositingContainer"
smcgruer 2017/03/01 19:58:39 Done.
316 PaintLayer* enclosingLayer =
317 m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf);
chrishtr 2017/02/28 19:36:28 Please pass compositingContainer to updateStickyCo
smcgruer 2017/03/01 19:58:40 Done.
315 LayoutPoint enclosingLayerOffset; 318 LayoutPoint enclosingLayerOffset;
316 m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf) 319 enclosingLayer->convertToLayerCoords(ancestorOverflowLayer,
317 ->convertToLayerCoords(m_owningLayer.ancestorOverflowLayer(), 320 enclosingLayerOffset);
318 enclosingLayerOffset); 321 if (enclosingLayer != ancestorOverflowLayer) {
322 enclosingLayerOffset += LayoutSize(
323 ancestorOverflowLayer->getScrollableArea()->getScrollOffset());
324 }
325
319 FloatPoint stickyBoxOffset = 326 FloatPoint stickyBoxOffset =
320 constraints.scrollContainerRelativeStickyBoxRect().location(); 327 constraints.scrollContainerRelativeStickyBoxRect().location();
321 DCHECK(!m_contentOffsetInCompositingLayerDirty); 328 DCHECK(!m_contentOffsetInCompositingLayerDirty);
322 stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset) - 329 stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset) -
323 FloatSize(contentOffsetInCompositingLayer())); 330 FloatSize(contentOffsetInCompositingLayer()));
324 331
325 webConstraint.isSticky = true; 332 webConstraint.isSticky = true;
326 webConstraint.isAnchoredLeft = 333 webConstraint.isAnchoredLeft =
327 constraints.anchorEdges() & 334 constraints.anchorEdges() &
328 StickyPositionScrollingConstraints::AnchorEdgeLeft; 335 StickyPositionScrollingConstraints::AnchorEdgeLeft;
(...skipping 3151 matching lines...) Expand 10 before | Expand all | Expand 10 after
3480 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3487 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3481 name = "Decoration Layer"; 3488 name = "Decoration Layer";
3482 } else { 3489 } else {
3483 ASSERT_NOT_REACHED(); 3490 ASSERT_NOT_REACHED();
3484 } 3491 }
3485 3492
3486 return name; 3493 return name;
3487 } 3494 }
3488 3495
3489 } // namespace blink 3496 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698