summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/scrolling/ScrollingConstraints.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/page/scrolling/ScrollingConstraints.h')
-rw-r--r--Source/WebCore/page/scrolling/ScrollingConstraints.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/WebCore/page/scrolling/ScrollingConstraints.h b/Source/WebCore/page/scrolling/ScrollingConstraints.h
index d4c1dd461..9d3860062 100644
--- a/Source/WebCore/page/scrolling/ScrollingConstraints.h
+++ b/Source/WebCore/page/scrolling/ScrollingConstraints.h
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScrollingConstraints_h
-#define ScrollingConstraints_h
+#pragma once
#include "FloatRect.h"
@@ -33,6 +32,7 @@ namespace WebCore {
// ViewportConstraints classes encapsulate data and logic required to reposition elements whose layout
// depends on the viewport rect (positions fixed and sticky), when scrolling and zooming.
class ViewportConstraints {
+ WTF_MAKE_FAST_ALLOCATED;
public:
enum ConstraintType {
FixedPositionConstraint,
@@ -85,7 +85,7 @@ public:
, m_layerPositionAtLastLayout(other.m_layerPositionAtLastLayout)
{ }
- FloatPoint layerPositionForViewportRect(const FloatRect& viewportRect) const;
+ WEBCORE_EXPORT FloatPoint layerPositionForViewportRect(const FloatRect& viewportRect) const;
const FloatRect& viewportRectAtLastLayout() const { return m_viewportRectAtLastLayout; }
void setViewportRectAtLastLayout(const FloatRect& rect) { m_viewportRectAtLastLayout = rect; }
@@ -104,7 +104,7 @@ public:
bool operator!=(const FixedPositionViewportConstraints& other) const { return !(*this == other); }
private:
- virtual ConstraintType constraintType() const override { return FixedPositionConstraint; };
+ ConstraintType constraintType() const override { return FixedPositionConstraint; };
FloatRect m_viewportRectAtLastLayout;
FloatPoint m_layerPositionAtLastLayout;
@@ -137,7 +137,7 @@ public:
const FloatSize stickyOffsetAtLastLayout() const { return m_stickyOffsetAtLastLayout; }
void setStickyOffsetAtLastLayout(const FloatSize& offset) { m_stickyOffsetAtLastLayout = offset; }
- FloatPoint layerPositionForConstrainingRect(const FloatRect& constrainingRect) const;
+ WEBCORE_EXPORT FloatPoint layerPositionForConstrainingRect(const FloatRect& constrainingRect) const;
const FloatPoint& layerPositionAtLastLayout() const { return m_layerPositionAtLastLayout; }
void setLayerPositionAtLastLayout(const FloatPoint& point) { m_layerPositionAtLastLayout = point; }
@@ -167,7 +167,9 @@ public:
bool operator==(const StickyPositionViewportConstraints& other) const
{
- return m_leftOffset == other.m_leftOffset
+ return m_alignmentOffset == other.m_alignmentOffset
+ && m_anchorEdges == other.m_anchorEdges
+ && m_leftOffset == other.m_leftOffset
&& m_rightOffset == other.m_rightOffset
&& m_topOffset == other.m_topOffset
&& m_bottomOffset == other.m_bottomOffset
@@ -180,7 +182,7 @@ public:
bool operator!=(const StickyPositionViewportConstraints& other) const { return !(*this == other); }
private:
- virtual ConstraintType constraintType() const override { return StickyPositionConstraint; };
+ ConstraintType constraintType() const override { return StickyPositionConstraint; };
float m_leftOffset;
float m_rightOffset;
@@ -193,6 +195,7 @@ private:
FloatPoint m_layerPositionAtLastLayout;
};
-} // namespace WebCore
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FixedPositionViewportConstraints&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StickyPositionViewportConstraints&);
-#endif // ScrollingConstraints_h
+} // namespace WebCore