diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/page/scrolling/ScrollingConstraints.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/page/scrolling/ScrollingConstraints.h')
-rw-r--r-- | Source/WebCore/page/scrolling/ScrollingConstraints.h | 21 |
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 |