Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 if (!scrollParent() && compositingContainer != ancestorOverflowLayer) { |
|
flackr
2017/03/23 16:58:03
It's probably worth "documenting" why we do this w
smcgruer
2017/03/23 17:22:48
Done.
| |
| 323 enclosingLayerOffset += LayoutSize( | 323 enclosingLayerOffset += LayoutSize( |
| 324 ancestorOverflowLayer->getScrollableArea()->getScrollOffset()); | 324 ancestorOverflowLayer->getScrollableArea()->getScrollOffset()); |
| 325 } | 325 } |
| 326 | 326 |
| 327 FloatPoint stickyBoxOffset = | 327 FloatPoint stickyBoxOffset = |
| 328 constraints.scrollContainerRelativeStickyBoxRect().location(); | 328 constraints.scrollContainerRelativeStickyBoxRect().location(); |
| 329 DCHECK(!m_contentOffsetInCompositingLayerDirty); | 329 DCHECK(!m_contentOffsetInCompositingLayerDirty); |
| 330 stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset) - | 330 stickyBoxOffset.moveBy(FloatPoint(-enclosingLayerOffset) - |
| 331 FloatSize(contentOffsetInCompositingLayer())); | 331 FloatSize(contentOffsetInCompositingLayer())); |
| 332 | 332 |
| (...skipping 3165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3498 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { | 3498 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { |
| 3499 name = "Decoration Layer"; | 3499 name = "Decoration Layer"; |
| 3500 } else { | 3500 } else { |
| 3501 ASSERT_NOT_REACHED(); | 3501 ASSERT_NOT_REACHED(); |
| 3502 } | 3502 } |
| 3503 | 3503 |
| 3504 return name; | 3504 return name; |
| 3505 } | 3505 } |
| 3506 | 3506 |
| 3507 } // namespace blink | 3507 } // namespace blink |
| OLD | NEW |