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

Unified Diff: webkit/compositor_bindings/web_layer_impl.cc

Issue 12552004: Support bottom-right anchored fixed-position elements during a pinch gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot to save the comments. sorry. :( Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/compositor_bindings/web_layer_impl.cc
diff --git a/webkit/compositor_bindings/web_layer_impl.cc b/webkit/compositor_bindings/web_layer_impl.cc
index c540688240d0ba222f2a6e2816245b0c88c3a621..3e857f79a06082f312a9ac62e95adfb55c5161e2 100644
--- a/webkit/compositor_bindings/web_layer_impl.cc
+++ b/webkit/compositor_bindings/web_layer_impl.cc
@@ -8,8 +8,10 @@
#include "cc/animation/animation.h"
#include "cc/base/region.h"
#include "cc/layers/layer.h"
+#include "cc/layers/layer_position_constraint.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerPositionConstraint.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
#include "webkit/compositor_bindings/web_animation_impl.h"
@@ -309,15 +311,34 @@ void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) {
}
bool WebLayerImpl::isContainerForFixedPositionLayers() const {
- return layer_->is_container_for_fixed_position_layers();
+ return layer_->IsContainerForFixedPositionLayers();
}
-void WebLayerImpl::setFixedToContainerLayer(bool enable) {
- layer_->SetFixedToContainerLayer(enable);
+static WebKit::WebLayerPositionConstraint ToWebLayerPositionConstraint(
+ const cc::LayerPositionConstraint& constraint) {
+ WebKit::WebLayerPositionConstraint web_constraint;
+ web_constraint.isFixedPosition = constraint.is_fixed_position();
+ web_constraint.isFixedToRightEdge = constraint.is_fixed_to_right_edge();
+ web_constraint.isFixedToBottomEdge = constraint.is_fixed_to_bottom_edge();
+ return web_constraint;
}
-bool WebLayerImpl::fixedToContainerLayer() const {
- return layer_->fixed_to_container_layer();
+static cc::LayerPositionConstraint ToLayerPositionConstraint(
+ const WebKit::WebLayerPositionConstraint& web_constraint) {
+ cc::LayerPositionConstraint constraint;
+ constraint.set_is_fixed_position(web_constraint.isFixedPosition);
+ constraint.set_is_fixed_to_right_edge(web_constraint.isFixedToRightEdge);
+ constraint.set_is_fixed_to_bottom_edge(web_constraint.isFixedToBottomEdge);
+ return constraint;
+}
+
+void WebLayerImpl::setPositionConstraint(
+ const WebKit::WebLayerPositionConstraint& constraint) {
+ layer_->SetPositionConstraint(ToLayerPositionConstraint(constraint));
+}
+
+WebKit::WebLayerPositionConstraint WebLayerImpl::positionConstraint() const {
+ return ToWebLayerPositionConstraint(layer_->position_constraint());
}
void WebLayerImpl::setScrollClient(
« no previous file with comments | « webkit/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698