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

Unified Diff: sky/engine/core/editing/EditorCommand.cpp

Issue 879993004: Remove ScrollableArea and Scrollbar (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/frame/FrameView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/editing/EditorCommand.cpp
diff --git a/sky/engine/core/editing/EditorCommand.cpp b/sky/engine/core/editing/EditorCommand.cpp
index 20f3b0733c7d834c6e838a853e8a6b57ee461065..0d1270c7445e7d5ffd84092ecd922966d827c889 100644
--- a/sky/engine/core/editing/EditorCommand.cpp
+++ b/sky/engine/core/editing/EditorCommand.cpp
@@ -49,7 +49,6 @@
#include "sky/engine/core/page/EditorClient.h"
#include "sky/engine/core/page/EventHandler.h"
#include "sky/engine/core/rendering/RenderBox.h"
-#include "sky/engine/platform/scroll/Scrollbar.h"
#include "sky/engine/public/platform/Platform.h"
#include "sky/engine/wtf/text/AtomicString.h"
@@ -75,6 +74,8 @@ static const bool isTextInsertion = true;
static const bool allowExecutionWhenDisabled = true;
static const bool doNotAllowExecutionWhenDisabled = false;
+static const float kMinFractionToStepWhenPaging = 0.875f;
+
// Related to Editor::selectionForCommand.
// Certain operations continue to use the target control's selection even if the event handler
// already moved the selection outside of the text control.
@@ -104,7 +105,7 @@ static unsigned verticalScrollDistance(LocalFrame& frame)
return 0;
int height = std::min<int>(renderBox.clientHeight(),
frame.view()->height());
- return static_cast<unsigned>(max(max<int>(height * ScrollableArea::minFractionToStepWhenPaging(), height - ScrollableArea::maxOverlapBetweenPages()), 1));
+ return static_cast<unsigned>(max<int>(height * kMinFractionToStepWhenPaging, 1));
}
static bool executeCopy(LocalFrame& frame, Event*, EditorCommandSource, const String&)
« no previous file with comments | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698