Title: [144687] trunk/Source/WebCore
Revision
144687
Author
[email protected]
Date
2013-03-04 15:25:14 -0800 (Mon, 04 Mar 2013)

Log Message

Give ViewportConstraints classes copy constructors
https://bugs.webkit.org/show_bug.cgi?id=111367

Reviewed by Beth Dakin.

Downstream code requires that ViewportConstraints objects have
copy constructors, so add them.

Also clean up some redundant initialization of stack objects
in RenderLayerCompositor.

No behavior change.

* page/scrolling/ScrollingConstraints.h:
(WebCore::ViewportConstraints::ViewportConstraints):
(ViewportConstraints):
(WebCore::FixedPositionViewportConstraints::FixedPositionViewportConstraints):
(FixedPositionViewportConstraints):
(WebCore::StickyPositionViewportConstraints::StickyPositionViewportConstraints):
(StickyPositionViewportConstraints):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (144686 => 144687)


--- trunk/Source/WebCore/ChangeLog	2013-03-04 23:23:12 UTC (rev 144686)
+++ trunk/Source/WebCore/ChangeLog	2013-03-04 23:25:14 UTC (rev 144687)
@@ -1,3 +1,29 @@
+2013-03-04  Simon Fraser  <[email protected]>
+
+        Give ViewportConstraints classes copy constructors
+        https://bugs.webkit.org/show_bug.cgi?id=111367
+
+        Reviewed by Beth Dakin.
+        
+        Downstream code requires that ViewportConstraints objects have
+        copy constructors, so add them.
+        
+        Also clean up some redundant initialization of stack objects
+        in RenderLayerCompositor.
+
+        No behavior change.
+
+        * page/scrolling/ScrollingConstraints.h:
+        (WebCore::ViewportConstraints::ViewportConstraints):
+        (ViewportConstraints):
+        (WebCore::FixedPositionViewportConstraints::FixedPositionViewportConstraints):
+        (FixedPositionViewportConstraints):
+        (WebCore::StickyPositionViewportConstraints::StickyPositionViewportConstraints):
+        (StickyPositionViewportConstraints):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
+        (WebCore::RenderLayerCompositor::computeStickyViewportConstraints):
+
 2013-03-04  Roger Fong  <[email protected]>
 
         Unreviewed. AppleWin build fix.

Modified: trunk/Source/WebCore/page/scrolling/ScrollingConstraints.h (144686 => 144687)


--- trunk/Source/WebCore/page/scrolling/ScrollingConstraints.h	2013-03-04 23:23:12 UTC (rev 144686)
+++ trunk/Source/WebCore/page/scrolling/ScrollingConstraints.h	2013-03-04 23:25:14 UTC (rev 144687)
@@ -47,6 +47,11 @@
     };
     typedef unsigned AnchorEdges;
 
+    ViewportConstraints(const ViewportConstraints& other)
+        : m_alignmentOffset(other.m_alignmentOffset)
+        , m_anchorEdges(other.m_anchorEdges)
+    { }
+    
     virtual ~ViewportConstraints() { }
     
     virtual ConstraintType constraintType() const = 0;
@@ -70,6 +75,16 @@
 
 class FixedPositionViewportConstraints : public ViewportConstraints {
 public:
+    FixedPositionViewportConstraints()
+        : ViewportConstraints()
+    { }
+
+    FixedPositionViewportConstraints(const FixedPositionViewportConstraints& other)
+        : ViewportConstraints(other)
+        , m_viewportRectAtLastLayout(other.m_viewportRectAtLastLayout)
+        , m_layerPositionAtLastLayout(other.m_layerPositionAtLastLayout)
+    { }
+    
     FloatPoint layerPositionForViewportRect(const FloatRect& viewportRect) const;
 
     const FloatRect& viewportRectAtLastLayout() const { return m_viewportRectAtLastLayout; }
@@ -104,6 +119,18 @@
         , m_bottomOffset(0)
     { }
 
+    StickyPositionViewportConstraints(const StickyPositionViewportConstraints& other)
+        : ViewportConstraints(other)
+        , m_leftOffset(other.m_leftOffset)
+        , m_rightOffset(other.m_rightOffset)
+        , m_topOffset(other.m_topOffset)
+        , m_bottomOffset(other.m_bottomOffset)
+        , m_absoluteContainingBlockRect(other.m_absoluteContainingBlockRect)
+        , m_absoluteStickyBoxRect(other.m_absoluteStickyBoxRect)
+        , m_stickyOffsetAtLastLayout(other.m_stickyOffsetAtLastLayout)
+        , m_layerPositionAtLastLayout(other.m_layerPositionAtLastLayout)
+    { }
+
     FloatSize computeStickyOffset(const FloatRect& viewportRect) const;
 
     const FloatSize stickyOffsetAtLastLayout() const { return m_stickyOffsetAtLastLayout; }

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (144686 => 144687)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-03-04 23:23:12 UTC (rev 144686)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-03-04 23:25:14 UTC (rev 144687)
@@ -2868,7 +2868,7 @@
     FrameView* frameView = m_renderView->frameView();
     LayoutRect viewportRect = frameView->viewportConstrainedVisibleContentRect();
 
-    FixedPositionViewportConstraints constraints = FixedPositionViewportConstraints();
+    FixedPositionViewportConstraints constraints;
 
     GraphicsLayer* graphicsLayer = layer->backing()->graphicsLayer();
 
@@ -2906,7 +2906,7 @@
     FrameView* frameView = m_renderView->frameView();
     LayoutRect viewportRect = frameView->viewportConstrainedVisibleContentRect();
 
-    StickyPositionViewportConstraints constraints = StickyPositionViewportConstraints();
+    StickyPositionViewportConstraints constraints;
 
     RenderBoxModelObject* renderer = toRenderBoxModelObject(layer->renderer());
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to