Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (205550 => 205551)
--- trunk/Source/WebCore/CMakeLists.txt 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-09-07 17:04:45 UTC (rev 205551)
@@ -2485,7 +2485,7 @@
rendering/RenderView.cpp
rendering/RenderWidget.cpp
rendering/RootInlineBox.cpp
- rendering/ScrollBehavior.cpp
+ rendering/ScrollAlignment.cpp
rendering/SelectionSubtreeRoot.cpp
rendering/SimpleLineLayout.cpp
rendering/SimpleLineLayoutFlowContents.cpp
Modified: trunk/Source/WebCore/ChangeLog (205550 => 205551)
--- trunk/Source/WebCore/ChangeLog 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/ChangeLog 2016-09-07 17:04:45 UTC (rev 205551)
@@ -1,3 +1,35 @@
+2016-09-07 Simon Fraser <simon.fra...@apple.com>
+
+ Rename ScrollBehavior to ScrollAlignment::Behavior
+ https://bugs.webkit.org/show_bug.cgi?id=161677
+
+ Reviewed by Tim Horton.
+
+ Free up ScrollBehavior for future use with CSS OM View scrolling by renaming the
+ existing ScrollBehavior, which is about alignment when scrolling into view.
+
+ Renamed ScrollBehavior* to ScrollAlignment.*, and made ScrollBehavior an enum class
+ in the struct.
+
+ No behavior change.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * editing/FrameSelection.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::getRectToExpose):
+ * rendering/RenderObject.h:
+ * rendering/RenderingAllInOne.cpp:
+ * rendering/ScrollAlignment.cpp: Renamed from Source/WebCore/rendering/ScrollBehavior.cpp.
+ * rendering/ScrollAlignment.h: Renamed from Source/WebCore/rendering/ScrollBehavior.h.
+ (WebCore::ScrollAlignment::getVisibleBehavior):
+ (WebCore::ScrollAlignment::getPartialBehavior):
+ (WebCore::ScrollAlignment::getHiddenBehavior):
+ * rendering/ScrollBehavior.h:
+ (WebCore::ScrollAlignment::getVisibleBehavior): Deleted.
+ (WebCore::ScrollAlignment::getPartialBehavior): Deleted.
+ (WebCore::ScrollAlignment::getHiddenBehavior): Deleted.
+
2016-09-07 Dave Hyatt <hy...@apple.com>
Add CSSAtRule id info for new parser
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (205550 => 205551)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-09-07 17:04:45 UTC (rev 205551)
@@ -2366,8 +2366,8 @@
5D874F130D161D3200796C3B /* NetscapePlugInStreamLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DD0AF589AD00D48324 /* NetscapePlugInStreamLoader.cpp */; };
5D8C4DBF1428222C0026CE72 /* DisplaySleepDisablerCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D8C4DBD1428222C0026CE72 /* DisplaySleepDisablerCocoa.cpp */; };
5D8C4DC01428222C0026CE72 /* DisplaySleepDisablerCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D8C4DBE1428222C0026CE72 /* DisplaySleepDisablerCocoa.h */; };
- 5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */; };
- 5D925B680F64D4DD00B847F0 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 5D925B670F64D4DD00B847F0 /* ScrollAlignment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D925B650F64D4DD00B847F0 /* ScrollAlignment.cpp */; };
+ 5D925B680F64D4DD00B847F0 /* ScrollAlignment.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D925B660F64D4DD00B847F0 /* ScrollAlignment.h */; settings = {ATTRIBUTES = (Private, ); }; };
5DA5E0FC102B953800088CF9 /* JSWebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */; };
5DA5E0FD102B953800088CF9 /* JSWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA5E0FB102B953800088CF9 /* JSWebSocket.h */; };
5DB1BC6A10715A6400EFAA49 /* TransformSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB1BC6810715A6400EFAA49 /* TransformSource.h */; };
@@ -9379,8 +9379,8 @@
5D5975B61963637B00D00878 /* UserAgent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserAgent.mm; sourceTree = "<group>"; };
5D8C4DBD1428222C0026CE72 /* DisplaySleepDisablerCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisplaySleepDisablerCocoa.cpp; sourceTree = "<group>"; };
5D8C4DBE1428222C0026CE72 /* DisplaySleepDisablerCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplaySleepDisablerCocoa.h; sourceTree = "<group>"; };
- 5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollBehavior.cpp; sourceTree = "<group>"; };
- 5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.h; sourceTree = "<group>"; };
+ 5D925B650F64D4DD00B847F0 /* ScrollAlignment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAlignment.cpp; sourceTree = "<group>"; };
+ 5D925B660F64D4DD00B847F0 /* ScrollAlignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAlignment.h; sourceTree = "<group>"; };
5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebSocket.cpp; sourceTree = "<group>"; };
5DA5E0FB102B953800088CF9 /* JSWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebSocket.h; sourceTree = "<group>"; };
5DB1BC6810715A6400EFAA49 /* TransformSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformSource.h; sourceTree = "<group>"; };
@@ -22793,8 +22793,8 @@
A871DFE00A15376B00B12A68 /* RenderWidget.h */,
A8CFF5E00A155A05000A4234 /* RootInlineBox.cpp */,
A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */,
- 5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */,
- 5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */,
+ 5D925B650F64D4DD00B847F0 /* ScrollAlignment.cpp */,
+ 5D925B660F64D4DD00B847F0 /* ScrollAlignment.h */,
CDCFABBC18C0AF19006F8450 /* SelectionSubtreeRoot.cpp */,
CDCFABBB18C0AE31006F8450 /* SelectionSubtreeRoot.h */,
E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */,
@@ -26229,7 +26229,7 @@
44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
- 5D925B680F64D4DD00B847F0 /* ScrollBehavior.h in Headers */,
+ 5D925B680F64D4DD00B847F0 /* ScrollAlignment.h in Headers */,
1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
@@ -29787,7 +29787,7 @@
44C991820F3D1E0D00586670 /* ScrollbarThemeIOS.mm in Sources */,
BCEF869F0E844E9D00A85CD5 /* ScrollbarThemeMac.mm in Sources */,
0FE71405142170B800DB33BA /* ScrollbarThemeMock.cpp in Sources */,
- 5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */,
+ 5D925B670F64D4DD00B847F0 /* ScrollAlignment.cpp in Sources */,
1AA84F04143BA7BD0051D153 /* ScrollController.mm in Sources */,
0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */,
1AF62EE714DA22A70041556C /* ScrollingCoordinator.cpp in Sources */,
Modified: trunk/Source/WebCore/editing/FrameSelection.h (205550 => 205551)
--- trunk/Source/WebCore/editing/FrameSelection.h 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/editing/FrameSelection.h 2016-09-07 17:04:45 UTC (rev 205551)
@@ -31,7 +31,7 @@
#include "IntRect.h"
#include "LayoutRect.h"
#include "Range.h"
-#include "ScrollBehavior.h"
+#include "ScrollAlignment.h"
#include "Timer.h"
#include "VisibleSelection.h"
#include <wtf/Noncopyable.h>
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (205550 => 205551)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2016-09-07 17:04:45 UTC (rev 205551)
@@ -2598,7 +2598,7 @@
LayoutRect RenderLayer::getRectToExpose(const LayoutRect &visibleRect, const LayoutRect &visibleRectRelativeToDocument, const LayoutRect &exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
{
// Determine the appropriate X behavior.
- ScrollBehavior scrollX;
+ ScrollAlignment::Behavior scrollX;
LayoutRect exposeRectX(exposeRect.x(), visibleRect.y(), exposeRect.width(), visibleRect.height());
LayoutUnit intersectWidth = intersection(visibleRect, exposeRectX).width();
if (intersectWidth == exposeRect.width() || intersectWidth >= MIN_INTERSECT_FOR_REVEAL)
@@ -2609,8 +2609,8 @@
else if (intersectWidth == visibleRect.width()) {
// If the rect is bigger than the visible area, don't bother trying to center. Other alignments will work.
scrollX = ScrollAlignment::getVisibleBehavior(alignX);
- if (scrollX == alignCenter)
- scrollX = noScroll;
+ if (scrollX == ScrollAlignment::Behavior::AlignCenter)
+ scrollX = ScrollAlignment::Behavior::NoScroll;
} else if (intersectWidth > 0)
// If the rectangle is partially visible, but not above the minimum threshold, use the specified partial behavior
scrollX = ScrollAlignment::getPartialBehavior(alignX);
@@ -2618,22 +2618,22 @@
scrollX = ScrollAlignment::getHiddenBehavior(alignX);
// If we're trying to align to the closest edge, and the exposeRect is further right
// than the visibleRect, and not bigger than the visible area, then align with the right.
- if (scrollX == alignToClosestEdge && exposeRect.maxX() > visibleRect.maxX() && exposeRect.width() < visibleRect.width())
- scrollX = alignRight;
+ if (scrollX == ScrollAlignment::Behavior::AlignToClosestEdge && exposeRect.maxX() > visibleRect.maxX() && exposeRect.width() < visibleRect.width())
+ scrollX = ScrollAlignment::Behavior::AlignRight;
// Given the X behavior, compute the X coordinate.
LayoutUnit x;
- if (scrollX == noScroll)
+ if (scrollX == ScrollAlignment::Behavior::NoScroll)
x = visibleRect.x();
- else if (scrollX == alignRight)
+ else if (scrollX == ScrollAlignment::Behavior::AlignRight)
x = exposeRect.maxX() - visibleRect.width();
- else if (scrollX == alignCenter)
+ else if (scrollX == ScrollAlignment::Behavior::AlignCenter)
x = exposeRect.x() + (exposeRect.width() - visibleRect.width()) / 2;
else
x = exposeRect.x();
// Determine the appropriate Y behavior.
- ScrollBehavior scrollY;
+ ScrollAlignment::Behavior scrollY;
LayoutRect exposeRectY(visibleRect.x(), exposeRect.y(), visibleRect.width(), exposeRect.height());
LayoutUnit intersectHeight = intersection(visibleRectRelativeToDocument, exposeRectY).height();
if (intersectHeight == exposeRect.height())
@@ -2642,8 +2642,8 @@
else if (intersectHeight == visibleRect.height()) {
// If the rect is bigger than the visible area, don't bother trying to center. Other alignments will work.
scrollY = ScrollAlignment::getVisibleBehavior(alignY);
- if (scrollY == alignCenter)
- scrollY = noScroll;
+ if (scrollY == ScrollAlignment::Behavior::AlignCenter)
+ scrollY = ScrollAlignment::Behavior::NoScroll;
} else if (intersectHeight > 0)
// If the rectangle is partially visible, use the specified partial behavior
scrollY = ScrollAlignment::getPartialBehavior(alignY);
@@ -2651,16 +2651,16 @@
scrollY = ScrollAlignment::getHiddenBehavior(alignY);
// If we're trying to align to the closest edge, and the exposeRect is further down
// than the visibleRect, and not bigger than the visible area, then align with the bottom.
- if (scrollY == alignToClosestEdge && exposeRect.maxY() > visibleRect.maxY() && exposeRect.height() < visibleRect.height())
- scrollY = alignBottom;
+ if (scrollY == ScrollAlignment::Behavior::AlignToClosestEdge && exposeRect.maxY() > visibleRect.maxY() && exposeRect.height() < visibleRect.height())
+ scrollY = ScrollAlignment::Behavior::AlignBottom;
// Given the Y behavior, compute the Y coordinate.
LayoutUnit y;
- if (scrollY == noScroll)
+ if (scrollY == ScrollAlignment::Behavior::NoScroll)
y = visibleRect.y();
- else if (scrollY == alignBottom)
+ else if (scrollY == ScrollAlignment::Behavior::AlignBottom)
y = exposeRect.maxY() - visibleRect.height();
- else if (scrollY == alignCenter)
+ else if (scrollY == ScrollAlignment::Behavior::AlignCenter)
y = exposeRect.y() + (exposeRect.height() - visibleRect.height()) / 2;
else
y = exposeRect.y();
Modified: trunk/Source/WebCore/rendering/RenderObject.h (205550 => 205551)
--- trunk/Source/WebCore/rendering/RenderObject.h 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2016-09-07 17:04:45 UTC (rev 205551)
@@ -33,7 +33,7 @@
#include "PaintPhase.h"
#include "RenderObjectEnums.h"
#include "RenderStyle.h"
-#include "ScrollBehavior.h"
+#include "ScrollAlignment.h"
#include "StyleImage.h"
#include "TextAffinity.h"
Modified: trunk/Source/WebCore/rendering/RenderingAllInOne.cpp (205550 => 205551)
--- trunk/Source/WebCore/rendering/RenderingAllInOne.cpp 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/rendering/RenderingAllInOne.cpp 2016-09-07 17:04:45 UTC (rev 205551)
@@ -139,7 +139,7 @@
#include "RenderView.cpp"
#include "RenderWidget.cpp"
#include "RootInlineBox.cpp"
-#include "ScrollBehavior.cpp"
+#include "ScrollAlignment.cpp"
#include "SelectionSubtreeRoot.cpp"
#include "SimpleLineLayout.cpp"
#include "SimpleLineLayoutFlowContents.cpp"
Copied: trunk/Source/WebCore/rendering/ScrollAlignment.cpp (from rev 205550, trunk/Source/WebCore/rendering/ScrollBehavior.cpp) (0 => 205551)
--- trunk/Source/WebCore/rendering/ScrollAlignment.cpp (rev 0)
+++ trunk/Source/WebCore/rendering/ScrollAlignment.cpp 2016-09-07 17:04:45 UTC (rev 205551)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2016 Apple Inc. All rights reserved.
+ *
+ * Portions are Copyright (C) 1998 Netscape Communications Corporation.
+ *
+ * Other contributors:
+ * Robert O'Callahan <r...@cs.cmu.edu>
+ * David Baron <dba...@fas.harvard.edu>
+ * Christian Biesinger <cbiesin...@web.de>
+ * Randall Jesup <rje...@wgate.com>
+ * Roland Mainz <roland.ma...@informatik.med.uni-giessen.de>
+ * Josh Soref <timel...@mac.com>
+ * Boris Zbarsky <bzbar...@mit.edu>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of either the Mozilla Public License Version 1.1, found at
+ * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
+ * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
+ * (the "GPL"), in which case the provisions of the MPL or the GPL are
+ * applicable instead of those above. If you wish to allow use of your
+ * version of this file only under the terms of one of those two
+ * licenses (the MPL or the GPL) and not to allow others to use your
+ * version of this file under the LGPL, indicate your decision by
+ * deletingthe provisions above and replace them with the notice and
+ * other provisions required by the MPL or the GPL, as the case may be.
+ * If you do not delete the provisions above, a recipient may use your
+ * version of this file under any of the LGPL, the MPL or the GPL.
+ */
+
+#include "config.h"
+#include "ScrollAlignment.h"
+
+namespace WebCore {
+
+const ScrollAlignment ScrollAlignment::alignCenterIfNotVisible = { Behavior::NoScroll, Behavior::AlignCenter, Behavior::NoScroll };
+const ScrollAlignment ScrollAlignment::alignToEdgeIfNotVisible = { Behavior::NoScroll, Behavior::AlignToClosestEdge, Behavior::NoScroll };
+const ScrollAlignment ScrollAlignment::alignCenterIfNeeded = { Behavior::NoScroll, Behavior::AlignCenter, Behavior::AlignToClosestEdge };
+WEBCORE_EXPORT const ScrollAlignment ScrollAlignment::alignToEdgeIfNeeded = { Behavior::NoScroll, Behavior::AlignToClosestEdge, Behavior::AlignToClosestEdge };
+WEBCORE_EXPORT const ScrollAlignment ScrollAlignment::alignCenterAlways = { Behavior::AlignCenter, Behavior::AlignCenter, Behavior::AlignCenter };
+const ScrollAlignment ScrollAlignment::alignTopAlways = { Behavior::AlignTop, Behavior::AlignTop, Behavior::AlignTop };
+const ScrollAlignment ScrollAlignment::alignRightAlways = { Behavior::AlignRight, Behavior::AlignRight, Behavior::AlignRight };
+const ScrollAlignment ScrollAlignment::alignLeftAlways = { Behavior::AlignLeft, Behavior::AlignLeft, Behavior::AlignLeft };
+const ScrollAlignment ScrollAlignment::alignBottomAlways = { Behavior::AlignBottom, Behavior::AlignBottom, Behavior::AlignBottom };
+
+}; // namespace WebCore
Copied: trunk/Source/WebCore/rendering/ScrollAlignment.h (from rev 205550, trunk/Source/WebCore/rendering/ScrollBehavior.h) (0 => 205551)
--- trunk/Source/WebCore/rendering/ScrollAlignment.h (rev 0)
+++ trunk/Source/WebCore/rendering/ScrollAlignment.h 2016-09-07 17:04:45 UTC (rev 205551)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2003, 2009, 2016 Apple Inc. All rights reserved.
+ *
+ * Portions are Copyright (C) 1998 Netscape Communications Corporation.
+ *
+ * Other contributors:
+ * Robert O'Callahan <r...@cs.cmu.edu>
+ * David Baron <dba...@fas.harvard.edu>
+ * Christian Biesinger <cbiesin...@web.de>
+ * Randall Jesup <rje...@wgate.com>
+ * Roland Mainz <roland.ma...@informatik.med.uni-giessen.de>
+ * Josh Soref <timel...@mac.com>
+ * Boris Zbarsky <bzbar...@mit.edu>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of either the Mozilla Public License Version 1.1, found at
+ * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
+ * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
+ * (the "GPL"), in which case the provisions of the MPL or the GPL are
+ * applicable instead of those above. If you wish to allow use of your
+ * version of this file only under the terms of one of those two
+ * licenses (the MPL or the GPL) and not to allow others to use your
+ * version of this file under the LGPL, indicate your decision by
+ * deletingthe provisions above and replace them with the notice and
+ * other provisions required by the MPL or the GPL, as the case may be.
+ * If you do not delete the provisions above, a recipient may use your
+ * version of this file under any of the LGPL, the MPL or the GPL.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+struct ScrollAlignment {
+
+ enum class Behavior {
+ NoScroll,
+ AlignCenter,
+ AlignTop,
+ AlignBottom,
+ AlignLeft,
+ AlignRight,
+ AlignToClosestEdge
+ };
+
+ static Behavior getVisibleBehavior(const ScrollAlignment& s) { return s.m_rectVisible; }
+ static Behavior getPartialBehavior(const ScrollAlignment& s) { return s.m_rectPartial; }
+ static Behavior getHiddenBehavior(const ScrollAlignment& s) { return s.m_rectHidden; }
+
+ static const ScrollAlignment alignCenterIfNotVisible;
+ static const ScrollAlignment alignToEdgeIfNotVisible;
+ static const ScrollAlignment alignCenterIfNeeded;
+ WEBCORE_EXPORT static const ScrollAlignment alignToEdgeIfNeeded;
+ WEBCORE_EXPORT static const ScrollAlignment alignCenterAlways;
+ static const ScrollAlignment alignTopAlways;
+ static const ScrollAlignment alignRightAlways;
+ static const ScrollAlignment alignLeftAlways;
+ static const ScrollAlignment alignBottomAlways;
+
+ Behavior m_rectVisible;
+ Behavior m_rectHidden;
+ Behavior m_rectPartial;
+};
+
+}; // namespace WebCore
Deleted: trunk/Source/WebCore/rendering/ScrollBehavior.cpp (205550 => 205551)
--- trunk/Source/WebCore/rendering/ScrollBehavior.cpp 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/rendering/ScrollBehavior.cpp 2016-09-07 17:04:45 UTC (rev 205551)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * Portions are Copyright (C) 1998 Netscape Communications Corporation.
- *
- * Other contributors:
- * Robert O'Callahan <r...@cs.cmu.edu>
- * David Baron <dba...@fas.harvard.edu>
- * Christian Biesinger <cbiesin...@web.de>
- * Randall Jesup <rje...@wgate.com>
- * Roland Mainz <roland.ma...@informatik.med.uni-giessen.de>
- * Josh Soref <timel...@mac.com>
- * Boris Zbarsky <bzbar...@mit.edu>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Alternatively, the contents of this file may be used under the terms
- * of either the Mozilla Public License Version 1.1, found at
- * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
- * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
- * (the "GPL"), in which case the provisions of the MPL or the GPL are
- * applicable instead of those above. If you wish to allow use of your
- * version of this file only under the terms of one of those two
- * licenses (the MPL or the GPL) and not to allow others to use your
- * version of this file under the LGPL, indicate your decision by
- * deletingthe provisions above and replace them with the notice and
- * other provisions required by the MPL or the GPL, as the case may be.
- * If you do not delete the provisions above, a recipient may use your
- * version of this file under any of the LGPL, the MPL or the GPL.
- */
-
-#include "config.h"
-#include "ScrollBehavior.h"
-
-namespace WebCore {
-
-const ScrollAlignment ScrollAlignment::alignCenterIfNotVisible = { noScroll, alignCenter, noScroll };
-const ScrollAlignment ScrollAlignment::alignToEdgeIfNotVisible = { noScroll, alignToClosestEdge, noScroll };
-const ScrollAlignment ScrollAlignment::alignCenterIfNeeded = { noScroll, alignCenter, alignToClosestEdge };
-WEBCORE_EXPORT const ScrollAlignment ScrollAlignment::alignToEdgeIfNeeded = { noScroll, alignToClosestEdge, alignToClosestEdge };
-WEBCORE_EXPORT const ScrollAlignment ScrollAlignment::alignCenterAlways = { alignCenter, alignCenter, alignCenter };
-const ScrollAlignment ScrollAlignment::alignTopAlways = { alignTop, alignTop, alignTop };
-const ScrollAlignment ScrollAlignment::alignRightAlways = { alignRight, alignRight, alignRight };
-const ScrollAlignment ScrollAlignment::alignLeftAlways = { alignLeft, alignLeft, alignLeft };
-const ScrollAlignment ScrollAlignment::alignBottomAlways = { alignBottom, alignBottom, alignBottom };
-
-}; // namespace WebCore
Deleted: trunk/Source/WebCore/rendering/ScrollBehavior.h (205550 => 205551)
--- trunk/Source/WebCore/rendering/ScrollBehavior.h 2016-09-07 16:54:32 UTC (rev 205550)
+++ trunk/Source/WebCore/rendering/ScrollBehavior.h 2016-09-07 17:04:45 UTC (rev 205551)
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2003, 2009 Apple Inc. All rights reserved.
- *
- * Portions are Copyright (C) 1998 Netscape Communications Corporation.
- *
- * Other contributors:
- * Robert O'Callahan <r...@cs.cmu.edu>
- * David Baron <dba...@fas.harvard.edu>
- * Christian Biesinger <cbiesin...@web.de>
- * Randall Jesup <rje...@wgate.com>
- * Roland Mainz <roland.ma...@informatik.med.uni-giessen.de>
- * Josh Soref <timel...@mac.com>
- * Boris Zbarsky <bzbar...@mit.edu>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Alternatively, the contents of this file may be used under the terms
- * of either the Mozilla Public License Version 1.1, found at
- * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
- * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
- * (the "GPL"), in which case the provisions of the MPL or the GPL are
- * applicable instead of those above. If you wish to allow use of your
- * version of this file only under the terms of one of those two
- * licenses (the MPL or the GPL) and not to allow others to use your
- * version of this file under the LGPL, indicate your decision by
- * deletingthe provisions above and replace them with the notice and
- * other provisions required by the MPL or the GPL, as the case may be.
- * If you do not delete the provisions above, a recipient may use your
- * version of this file under any of the LGPL, the MPL or the GPL.
- */
-
-#ifndef ScrollBehavior_h
-#define ScrollBehavior_h
-
-namespace WebCore {
-
-enum ScrollBehavior {
- noScroll,
- alignCenter,
- alignTop,
- alignBottom,
- alignLeft,
- alignRight,
- alignToClosestEdge
-};
-
-struct ScrollAlignment {
- static ScrollBehavior getVisibleBehavior(const ScrollAlignment& s) { return s.m_rectVisible; }
- static ScrollBehavior getPartialBehavior(const ScrollAlignment& s) { return s.m_rectPartial; }
- static ScrollBehavior getHiddenBehavior(const ScrollAlignment& s) { return s.m_rectHidden; }
-
- static const ScrollAlignment alignCenterIfNotVisible;
- static const ScrollAlignment alignToEdgeIfNotVisible;
- static const ScrollAlignment alignCenterIfNeeded;
- WEBCORE_EXPORT static const ScrollAlignment alignToEdgeIfNeeded;
- WEBCORE_EXPORT static const ScrollAlignment alignCenterAlways;
- static const ScrollAlignment alignTopAlways;
- static const ScrollAlignment alignRightAlways;
- static const ScrollAlignment alignLeftAlways;
- static const ScrollAlignment alignBottomAlways;
-
- ScrollBehavior m_rectVisible;
- ScrollBehavior m_rectHidden;
- ScrollBehavior m_rectPartial;
-};
-
-
-}; // namespace WebCore
-
-#endif // ScrollBehavior_h