summaryrefslogtreecommitdiffstats
path: root/WebCore/editing/EditorCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/editing/EditorCommand.cpp')
-rw-r--r--WebCore/editing/EditorCommand.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 3379b3c..6a9e10f 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -32,6 +32,7 @@
#include "CSSMutableStyleDeclaration.h"
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
+#include "Chrome.h"
#include "CreateLinkCommand.h"
#include "DocumentFragment.h"
#include "Editor.h"
@@ -259,7 +260,7 @@ static int verticalScrollDistance(Frame* frame)
if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || renderer->isTextArea()))
return 0;
int height = toRenderBox(renderer)->clientHeight();
- return max((height + 1) / 2, height - cAmountToKeepWhenPaging);
+ return max(height * cFractionToStepWhenPaging, 1.f);
}
static RefPtr<Range> unionDOMRanges(Range* a, Range* b)
@@ -471,7 +472,7 @@ static bool executeInsertHorizontalRule(Frame* frame, Event*, EditorCommandSourc
{
RefPtr<HTMLHRElement> hr = new HTMLHRElement(hrTag, frame->document());
if (!value.isEmpty())
- hr->setAttribute(idAttr, value);
+ hr->setAttribute(hr->idAttributeName(), value);
return executeInsertNode(frame, hr.release());
}