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

Side by Side Diff: cc/blink/web_layer_impl.cc

Issue 2401903002: Compute and include the offset of the sticky box to its enclosing composited layer. (Closed)
Patch Set: Merge with master and fix long line. Created 4 years, 2 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
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/blink/web_layer_impl.h" 5 #include "cc/blink/web_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 blink::WebLayerStickyPositionConstraint web_constraint; 365 blink::WebLayerStickyPositionConstraint web_constraint;
366 web_constraint.isSticky = constraint.is_sticky; 366 web_constraint.isSticky = constraint.is_sticky;
367 web_constraint.isAnchoredLeft = constraint.is_anchored_left; 367 web_constraint.isAnchoredLeft = constraint.is_anchored_left;
368 web_constraint.isAnchoredRight = constraint.is_anchored_right; 368 web_constraint.isAnchoredRight = constraint.is_anchored_right;
369 web_constraint.isAnchoredTop = constraint.is_anchored_top; 369 web_constraint.isAnchoredTop = constraint.is_anchored_top;
370 web_constraint.isAnchoredBottom = constraint.is_anchored_bottom; 370 web_constraint.isAnchoredBottom = constraint.is_anchored_bottom;
371 web_constraint.leftOffset = constraint.left_offset; 371 web_constraint.leftOffset = constraint.left_offset;
372 web_constraint.rightOffset = constraint.right_offset; 372 web_constraint.rightOffset = constraint.right_offset;
373 web_constraint.topOffset = constraint.top_offset; 373 web_constraint.topOffset = constraint.top_offset;
374 web_constraint.bottomOffset = constraint.bottom_offset; 374 web_constraint.bottomOffset = constraint.bottom_offset;
375 web_constraint.parentRelativeStickyBoxOffset =
376 constraint.parent_relative_sticky_box_offset;
375 web_constraint.scrollContainerRelativeStickyBoxRect = 377 web_constraint.scrollContainerRelativeStickyBoxRect =
376 constraint.scroll_container_relative_sticky_box_rect; 378 constraint.scroll_container_relative_sticky_box_rect;
377 web_constraint.scrollContainerRelativeContainingBlockRect = 379 web_constraint.scrollContainerRelativeContainingBlockRect =
378 constraint.scroll_container_relative_containing_block_rect; 380 constraint.scroll_container_relative_containing_block_rect;
379 return web_constraint; 381 return web_constraint;
380 } 382 }
381 static cc::LayerStickyPositionConstraint ToStickyPositionConstraint( 383 static cc::LayerStickyPositionConstraint ToStickyPositionConstraint(
382 const blink::WebLayerStickyPositionConstraint& web_constraint) { 384 const blink::WebLayerStickyPositionConstraint& web_constraint) {
383 cc::LayerStickyPositionConstraint constraint; 385 cc::LayerStickyPositionConstraint constraint;
384 constraint.is_sticky = web_constraint.isSticky; 386 constraint.is_sticky = web_constraint.isSticky;
385 constraint.is_anchored_left = web_constraint.isAnchoredLeft; 387 constraint.is_anchored_left = web_constraint.isAnchoredLeft;
386 constraint.is_anchored_right = web_constraint.isAnchoredRight; 388 constraint.is_anchored_right = web_constraint.isAnchoredRight;
387 constraint.is_anchored_top = web_constraint.isAnchoredTop; 389 constraint.is_anchored_top = web_constraint.isAnchoredTop;
388 constraint.is_anchored_bottom = web_constraint.isAnchoredBottom; 390 constraint.is_anchored_bottom = web_constraint.isAnchoredBottom;
389 constraint.left_offset = web_constraint.leftOffset; 391 constraint.left_offset = web_constraint.leftOffset;
390 constraint.right_offset = web_constraint.rightOffset; 392 constraint.right_offset = web_constraint.rightOffset;
391 constraint.top_offset = web_constraint.topOffset; 393 constraint.top_offset = web_constraint.topOffset;
392 constraint.bottom_offset = web_constraint.bottomOffset; 394 constraint.bottom_offset = web_constraint.bottomOffset;
395 constraint.parent_relative_sticky_box_offset =
396 web_constraint.parentRelativeStickyBoxOffset;
393 constraint.scroll_container_relative_sticky_box_rect = 397 constraint.scroll_container_relative_sticky_box_rect =
394 web_constraint.scrollContainerRelativeStickyBoxRect; 398 web_constraint.scrollContainerRelativeStickyBoxRect;
395 constraint.scroll_container_relative_containing_block_rect = 399 constraint.scroll_container_relative_containing_block_rect =
396 web_constraint.scrollContainerRelativeContainingBlockRect; 400 web_constraint.scrollContainerRelativeContainingBlockRect;
397 return constraint; 401 return constraint;
398 } 402 }
399 void WebLayerImpl::setStickyPositionConstraint( 403 void WebLayerImpl::setStickyPositionConstraint(
400 const blink::WebLayerStickyPositionConstraint& constraint) { 404 const blink::WebLayerStickyPositionConstraint& constraint) {
401 layer_->SetStickyPositionConstraint(ToStickyPositionConstraint(constraint)); 405 layer_->SetStickyPositionConstraint(ToStickyPositionConstraint(constraint));
402 } 406 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 468
465 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { 469 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) {
466 contents_opaque_is_fixed_ = fixed; 470 contents_opaque_is_fixed_ = fixed;
467 } 471 }
468 472
469 void WebLayerImpl::setHasWillChangeTransformHint(bool has_will_change) { 473 void WebLayerImpl::setHasWillChangeTransformHint(bool has_will_change) {
470 layer_->SetHasWillChangeTransformHint(has_will_change); 474 layer_->SetHasWillChangeTransformHint(has_will_change);
471 } 475 }
472 476
473 } // namespace cc_blink 477 } // namespace cc_blink
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698