Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 web_constraint.nearestLayerShiftingStickyBox = | |
| 382 constraint.nearest_layer_shifting_sticky_box; | |
| 383 web_constraint.nearestLayerShiftingContainingBlock = | |
| 384 constraint.nearest_layer_shifting_containing_block; | |
| 381 return web_constraint; | 385 return web_constraint; |
| 382 } | 386 } |
| 383 static cc::LayerStickyPositionConstraint ToStickyPositionConstraint( | 387 static cc::LayerStickyPositionConstraint ToStickyPositionConstraint( |
| 384 const blink::WebLayerStickyPositionConstraint& web_constraint) { | 388 const blink::WebLayerStickyPositionConstraint& web_constraint) { |
| 385 cc::LayerStickyPositionConstraint constraint; | 389 cc::LayerStickyPositionConstraint constraint; |
| 386 constraint.is_sticky = web_constraint.isSticky; | 390 constraint.is_sticky = web_constraint.isSticky; |
| 387 constraint.is_anchored_left = web_constraint.isAnchoredLeft; | 391 constraint.is_anchored_left = web_constraint.isAnchoredLeft; |
| 388 constraint.is_anchored_right = web_constraint.isAnchoredRight; | 392 constraint.is_anchored_right = web_constraint.isAnchoredRight; |
| 389 constraint.is_anchored_top = web_constraint.isAnchoredTop; | 393 constraint.is_anchored_top = web_constraint.isAnchoredTop; |
| 390 constraint.is_anchored_bottom = web_constraint.isAnchoredBottom; | 394 constraint.is_anchored_bottom = web_constraint.isAnchoredBottom; |
| 391 constraint.left_offset = web_constraint.leftOffset; | 395 constraint.left_offset = web_constraint.leftOffset; |
| 392 constraint.right_offset = web_constraint.rightOffset; | 396 constraint.right_offset = web_constraint.rightOffset; |
| 393 constraint.top_offset = web_constraint.topOffset; | 397 constraint.top_offset = web_constraint.topOffset; |
| 394 constraint.bottom_offset = web_constraint.bottomOffset; | 398 constraint.bottom_offset = web_constraint.bottomOffset; |
| 395 constraint.parent_relative_sticky_box_offset = | 399 constraint.parent_relative_sticky_box_offset = |
| 396 web_constraint.parentRelativeStickyBoxOffset; | 400 web_constraint.parentRelativeStickyBoxOffset; |
| 397 constraint.scroll_container_relative_sticky_box_rect = | 401 constraint.scroll_container_relative_sticky_box_rect = |
| 398 web_constraint.scrollContainerRelativeStickyBoxRect; | 402 web_constraint.scrollContainerRelativeStickyBoxRect; |
| 399 constraint.scroll_container_relative_containing_block_rect = | 403 constraint.scroll_container_relative_containing_block_rect = |
| 400 web_constraint.scrollContainerRelativeContainingBlockRect; | 404 web_constraint.scrollContainerRelativeContainingBlockRect; |
| 405 constraint.nearest_layer_shifting_sticky_box = | |
| 406 web_constraint.nearestLayerShiftingStickyBox; | |
| 407 constraint.nearest_layer_shifting_containing_block = | |
| 408 web_constraint.nearestLayerShiftingContainingBlock; | |
|
chrishtr
2017/03/21 22:18:28
This seems unused.
smcgruer
2017/03/21 22:41:35
It is used. See property_tree_builder.cc line 787,
chrishtr
2017/03/21 23:26:05
I see, sorry.
It seems weird to me to expose a "c
| |
| 401 return constraint; | 409 return constraint; |
| 402 } | 410 } |
| 403 void WebLayerImpl::setStickyPositionConstraint( | 411 void WebLayerImpl::setStickyPositionConstraint( |
| 404 const blink::WebLayerStickyPositionConstraint& constraint) { | 412 const blink::WebLayerStickyPositionConstraint& constraint) { |
| 405 layer_->SetStickyPositionConstraint(ToStickyPositionConstraint(constraint)); | 413 layer_->SetStickyPositionConstraint(ToStickyPositionConstraint(constraint)); |
| 406 } | 414 } |
| 407 blink::WebLayerStickyPositionConstraint WebLayerImpl::stickyPositionConstraint() | 415 blink::WebLayerStickyPositionConstraint WebLayerImpl::stickyPositionConstraint() |
| 408 const { | 416 const { |
| 409 return ToWebLayerStickyPositionConstraint( | 417 return ToWebLayerStickyPositionConstraint( |
| 410 layer_->sticky_position_constraint()); | 418 layer_->sticky_position_constraint()); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 469 | 477 |
| 470 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { | 478 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { |
| 471 contents_opaque_is_fixed_ = fixed; | 479 contents_opaque_is_fixed_ = fixed; |
| 472 } | 480 } |
| 473 | 481 |
| 474 void WebLayerImpl::setHasWillChangeTransformHint(bool has_will_change) { | 482 void WebLayerImpl::setHasWillChangeTransformHint(bool has_will_change) { |
| 475 layer_->SetHasWillChangeTransformHint(has_will_change); | 483 layer_->SetHasWillChangeTransformHint(has_will_change); |
| 476 } | 484 } |
| 477 | 485 |
| 478 } // namespace cc_blink | 486 } // namespace cc_blink |
| OLD | NEW |