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

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

Issue 2636253002: Handle nested position:sticky elements (Closed)
Patch Set: First attempt at compositing side, does NOT work properly yet 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
« no previous file with comments | « no previous file | cc/layers/layer_sticky_position_constraint.h » ('j') | cc/trees/property_tree.cc » ('J')
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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = 375 web_constraint.parentRelativeStickyBoxOffset =
376 constraint.parent_relative_sticky_box_offset; 376 constraint.parent_relative_sticky_box_offset;
377 web_constraint.scrollContainerRelativeStickyBoxRect = 377 web_constraint.scrollContainerRelativeStickyBoxRect =
378 constraint.scroll_container_relative_sticky_box_rect; 378 constraint.scroll_container_relative_sticky_box_rect;
379 web_constraint.scrollContainerRelativeContainingBlockRect = 379 web_constraint.scrollContainerRelativeContainingBlockRect =
380 constraint.scroll_container_relative_containing_block_rect; 380 constraint.scroll_container_relative_containing_block_rect;
381 return web_constraint; 381 return web_constraint;
flackr 2017/02/02 18:18:11 We need to copy the ancestor pointers here too rig
smcgruer 2017/02/02 20:21:26 Yes, although I'm not immediately clear how to con
382 } 382 }
383 static cc::LayerStickyPositionConstraint ToStickyPositionConstraint( 383 static cc::LayerStickyPositionConstraint ToStickyPositionConstraint(
384 const blink::WebLayerStickyPositionConstraint& web_constraint) { 384 const blink::WebLayerStickyPositionConstraint& web_constraint) {
385 cc::LayerStickyPositionConstraint constraint; 385 cc::LayerStickyPositionConstraint constraint;
386 constraint.is_sticky = web_constraint.isSticky; 386 constraint.is_sticky = web_constraint.isSticky;
387 constraint.is_anchored_left = web_constraint.isAnchoredLeft; 387 constraint.is_anchored_left = web_constraint.isAnchoredLeft;
388 constraint.is_anchored_right = web_constraint.isAnchoredRight; 388 constraint.is_anchored_right = web_constraint.isAnchoredRight;
389 constraint.is_anchored_top = web_constraint.isAnchoredTop; 389 constraint.is_anchored_top = web_constraint.isAnchoredTop;
390 constraint.is_anchored_bottom = web_constraint.isAnchoredBottom; 390 constraint.is_anchored_bottom = web_constraint.isAnchoredBottom;
391 constraint.left_offset = web_constraint.leftOffset; 391 constraint.left_offset = web_constraint.leftOffset;
392 constraint.right_offset = web_constraint.rightOffset; 392 constraint.right_offset = web_constraint.rightOffset;
393 constraint.top_offset = web_constraint.topOffset; 393 constraint.top_offset = web_constraint.topOffset;
394 constraint.bottom_offset = web_constraint.bottomOffset; 394 constraint.bottom_offset = web_constraint.bottomOffset;
395 constraint.parent_relative_sticky_box_offset = 395 constraint.parent_relative_sticky_box_offset =
396 web_constraint.parentRelativeStickyBoxOffset; 396 web_constraint.parentRelativeStickyBoxOffset;
397 constraint.scroll_container_relative_sticky_box_rect = 397 constraint.scroll_container_relative_sticky_box_rect =
398 web_constraint.scrollContainerRelativeStickyBoxRect; 398 web_constraint.scrollContainerRelativeStickyBoxRect;
399 constraint.scroll_container_relative_containing_block_rect = 399 constraint.scroll_container_relative_containing_block_rect =
400 web_constraint.scrollContainerRelativeContainingBlockRect; 400 web_constraint.scrollContainerRelativeContainingBlockRect;
401 constraint.nearest_sticky_element_shifting_sticky_box =
402 web_constraint.nearestStickyElementShiftingStickyBox
403 ? web_constraint.nearestStickyElementShiftingStickyBox->ccLayer()
404 : nullptr;
405 constraint.nearest_sticky_element_shifting_containing_block =
406 web_constraint.nearestStickyElementShiftingContainingBlock
407 ? web_constraint.nearestStickyElementShiftingContainingBlock
408 ->ccLayer()
409 : nullptr;
401 return constraint; 410 return constraint;
402 } 411 }
403 void WebLayerImpl::setStickyPositionConstraint( 412 void WebLayerImpl::setStickyPositionConstraint(
404 const blink::WebLayerStickyPositionConstraint& constraint) { 413 const blink::WebLayerStickyPositionConstraint& constraint) {
405 layer_->SetStickyPositionConstraint(ToStickyPositionConstraint(constraint)); 414 layer_->SetStickyPositionConstraint(ToStickyPositionConstraint(constraint));
406 } 415 }
407 blink::WebLayerStickyPositionConstraint WebLayerImpl::stickyPositionConstraint() 416 blink::WebLayerStickyPositionConstraint WebLayerImpl::stickyPositionConstraint()
408 const { 417 const {
409 return ToWebLayerStickyPositionConstraint( 418 return ToWebLayerStickyPositionConstraint(
410 layer_->sticky_position_constraint()); 419 layer_->sticky_position_constraint());
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 485
477 void WebLayerImpl::setPreferredRasterBounds(const WebSize& bounds) { 486 void WebLayerImpl::setPreferredRasterBounds(const WebSize& bounds) {
478 layer_->SetPreferredRasterBounds(bounds); 487 layer_->SetPreferredRasterBounds(bounds);
479 } 488 }
480 489
481 void WebLayerImpl::clearPreferredRasterBounds() { 490 void WebLayerImpl::clearPreferredRasterBounds() {
482 layer_->ClearPreferredRasterBounds(); 491 layer_->ClearPreferredRasterBounds();
483 } 492 }
484 493
485 } // namespace cc_blink 494 } // namespace cc_blink
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer_sticky_position_constraint.h » ('j') | cc/trees/property_tree.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698