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

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

Issue 2765503003: Fix position:sticky location bug when scroller is not a stacking context (Closed)
Patch Set: Add DCHECK, whitespace fix 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 ancestorOverflowLayer->getScrollableArea()->stickyConstraintsMap().at( 312 ancestorOverflowLayer->getScrollableArea()->stickyConstraintsMap().at(
313 &m_owningLayer); 313 &m_owningLayer);
314 314
315 // Find the layout offset of the unshifted sticky box within its 315 // Find the layout offset of the unshifted sticky box within its
316 // compositingContainer. If the enclosing layer is not the scroller, then 316 // compositingContainer. If the enclosing layer is not the scroller, then
317 // the offset must be adjusted to include the scroll offset to keep it 317 // the offset must be adjusted to include the scroll offset to keep it
318 // relative to compositingContainer. 318 // relative to compositingContainer.
319 LayoutPoint enclosingLayerOffset; 319 LayoutPoint enclosingLayerOffset;
320 compositingContainer->convertToLayerCoords(ancestorOverflowLayer, 320 compositingContainer->convertToLayerCoords(ancestorOverflowLayer,
321 enclosingLayerOffset); 321 enclosingLayerOffset);
322 if (compositingContainer != ancestorOverflowLayer) { 322 DCHECK(!scrollParent() || scrollParent() == ancestorOverflowLayer);
323 if (!scrollParent() && compositingContainer != ancestorOverflowLayer) {
323 enclosingLayerOffset += LayoutSize( 324 enclosingLayerOffset += LayoutSize(
324 ancestorOverflowLayer->getScrollableArea()->getScrollOffset()); 325 ancestorOverflowLayer->getScrollableArea()->getScrollOffset());
325 } 326 }
326 327
327 FloatPoint stickyBoxOffset = 328 FloatPoint stickyBoxOffset =
328 constraints.scrollContainerRelativeStickyBoxRect().location(); 329 constraints.scrollContainerRelativeStickyBoxRect().location();
329 DCHECK(!m_contentOffsetInCompositingLayerDirty); 330 DCHECK(!m_contentOffsetInCompositingLayerDirty);
330 stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset) - 331 stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset) -
331 FloatSize(contentOffsetInCompositingLayer())); 332 FloatSize(contentOffsetInCompositingLayer()));
332 333
(...skipping 3165 matching lines...) Expand 10 before | Expand all | Expand 10 after
3498 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3499 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3499 name = "Decoration Layer"; 3500 name = "Decoration Layer";
3500 } else { 3501 } else {
3501 ASSERT_NOT_REACHED(); 3502 ASSERT_NOT_REACHED();
3502 } 3503 }
3503 3504
3504 return name; 3505 return name;
3505 } 3506 }
3506 3507
3507 } // namespace blink 3508 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698