Show a block cursor in overtype mode
authorsergio@webkit.org <sergio@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 May 2013 14:17:12 +0000 (14:17 +0000)
committersergio@webkit.org <sergio@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 May 2013 14:17:12 +0000 (14:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114819

Reviewed by Ryosuke Niwa.

.:

* Source/autotools/symbols.filter: export some extra symbols for
testing purposes.

Source/WebCore:

Test: editing/selection/block-cursor-overtype-mode.html

Overtype mode will use block cursor instead of a caret to
highlight the next character to be replaced. It will fully cover
the next character to be replaced (except at the end of a line
where the usual blinking caret will be shown).

This new block cursor is internally implemented as a selection
(not exposed to JavaScript) because the selection code knows how
to deal with bidi text.

* WebCore.exp.in: Export symbols for testing purposes.
* WebCore.order: Ditto.
* editing/Editor.cpp:
(WebCore::Editor::toggleOverwriteModeEnabled): Added a call to
FrameLoader::setShouldShowBlockCursor.
(WebCore):
* editing/Editor.h:
(Editor):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::updateAppearance): Use a 1-character
long selection to paint the cursor in overtype mode.
(WebCore::FrameSelection::setShouldShowBlockCursor):
(WebCore):
* editing/FrameSelection.h:
(WebCore::FrameSelection::shouldShowBlockCursor):
(FrameSelection):
* testing/Internals.cpp:
(WebCore):
(WebCore::Internals::selectionBounds): Added a new method which
returns the IntRect issued by FrameSelection::bounds().
* testing/Internals.h: Ditto.
* testing/Internals.idl: Ditto.

Source/WebKit:

Export three more WebCore symbols.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Source/WebKit/win:

Export three more WebCore symbols.

* WebKit.vcproj/WebKitExports.def.in:

LayoutTests:

New test case for the new block cursor to be used in overtype
mode. The test verifies that the 1-pixel long caret is replaced by
a selection like 1-character long block cursor when in overtype
mode. This test covers LTR and RTL text in LTR and RTL blocks and
bidi text.

* editing/selection/block-cursor-overtype-mode-expected.txt: Added.
* editing/selection/block-cursor-overtype-mode.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149432 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/editing/selection/block-cursor-overtype-mode-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/block-cursor-overtype-mode.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in
Source/autotools/symbols.filter

index d0b5e70..ed96e87 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-05-01  Sergio Villar Senin  <svillar@igalia.com>
+
+        Show a block cursor in overtype mode
+        https://bugs.webkit.org/show_bug.cgi?id=114819
+
+        Reviewed by Ryosuke Niwa.
+
+        * Source/autotools/symbols.filter: export some extra symbols for
+        testing purposes.
+
 2013-04-30  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         [EFL] Enable scaled cursors
index f589e73..d48085b 100644 (file)
@@ -1,3 +1,19 @@
+2013-05-01  Sergio Villar Senin  <svillar@igalia.com>
+
+        Show a block cursor in overtype mode
+        https://bugs.webkit.org/show_bug.cgi?id=114819
+
+        Reviewed by Ryosuke Niwa.
+
+        New test case for the new block cursor to be used in overtype
+        mode. The test verifies that the 1-pixel long caret is replaced by
+        a selection like 1-character long block cursor when in overtype
+        mode. This test covers LTR and RTL text in LTR and RTL blocks and
+        bidi text.
+
+        * editing/selection/block-cursor-overtype-mode-expected.txt: Added.
+        * editing/selection/block-cursor-overtype-mode.html: Added.
+
 2013-04-30  David Hyatt  <hyatt@apple.com>
 
         <button> ignores margin-bottom.
diff --git a/LayoutTests/editing/selection/block-cursor-overtype-mode-expected.txt b/LayoutTests/editing/selection/block-cursor-overtype-mode-expected.txt
new file mode 100644 (file)
index 0000000..5beb23a
--- /dev/null
@@ -0,0 +1,156 @@
+This test checks that the cursor covers the next character to be overwritten in overtype mode instead of being painted as a caret (1px width bar)
+
+ABC
+ABC
+שדן
+שדן
+שדןABC
+שדןABC
+Verifying block cursor position and width for each position in 'ABC' in a ltr block
+getSelection().collapse(textNode, 0)
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 1)
+PASS blockCursorStartPosition[0] < blockCursorStartPosition[1] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 2)
+PASS blockCursorStartPosition[1] < blockCursorStartPosition[2] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 3)
+PASS blockCursor.width is 0
+PASS internals.absoluteCaretBounds().width is 1
+
+Verifying block cursor position and width for each position in 'ABC' in a rtl block
+getSelection().collapse(textNode, 0)
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 1)
+PASS blockCursorStartPosition[0] < blockCursorStartPosition[1] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 2)
+PASS blockCursorStartPosition[1] < blockCursorStartPosition[2] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 3)
+PASS blockCursor.width is 0
+PASS internals.absoluteCaretBounds().width is 1
+
+Verifying block cursor position and width for each position in 'שדן' in a ltr block
+getSelection().collapse(textNode, 0)
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 1)
+PASS blockCursorStartPosition[0] > blockCursorStartPosition[1] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 2)
+PASS blockCursorStartPosition[1] > blockCursorStartPosition[2] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 3)
+PASS blockCursor.width is 0
+PASS internals.absoluteCaretBounds().width is 1
+
+Verifying block cursor position and width for each position in 'שדן' in a rtl block
+getSelection().collapse(textNode, 0)
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 1)
+PASS blockCursorStartPosition[0] > blockCursorStartPosition[1] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 2)
+PASS blockCursorStartPosition[1] > blockCursorStartPosition[2] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 3)
+PASS blockCursor.width is 0
+PASS internals.absoluteCaretBounds().width is 1
+
+Verifying block cursor position and width for each position in 'שדןABC' in a ltr block
+getSelection().collapse(textNode, 0)
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 1)
+PASS blockCursorStartPosition[0] > blockCursorStartPosition[1] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 2)
+PASS blockCursorStartPosition[1] > blockCursorStartPosition[2] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 3)
+PASS blockCursorStartPosition[2] < blockCursorStartPosition[3] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 4)
+PASS blockCursorStartPosition[3] < blockCursorStartPosition[4] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 5)
+PASS blockCursorStartPosition[4] < blockCursorStartPosition[5] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 6)
+PASS blockCursor.width is 0
+PASS internals.absoluteCaretBounds().width is 1
+
+Verifying block cursor position and width for each position in 'שדןABC' in a rtl block
+getSelection().collapse(textNode, 0)
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 1)
+PASS blockCursorStartPosition[0] > blockCursorStartPosition[1] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 2)
+PASS blockCursorStartPosition[1] > blockCursorStartPosition[2] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 3)
+PASS blockCursorStartPosition[2] > blockCursorStartPosition[3] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 4)
+PASS blockCursorStartPosition[3] < blockCursorStartPosition[4] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 5)
+PASS blockCursorStartPosition[4] < blockCursorStartPosition[5] is true
+PASS getSelection().isCollapsed is true
+PASS blockCursor.width > 1 is true
+PASS internals.absoluteCaretBounds().width is 1
+getSelection().collapse(textNode, 6)
+PASS blockCursor.width is 0
+PASS internals.absoluteCaretBounds().width is 1
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/editing/selection/block-cursor-overtype-mode.html b/LayoutTests/editing/selection/block-cursor-overtype-mode.html
new file mode 100644 (file)
index 0000000..f457178
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript" src="../editing.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js" type="text/javascript"></script>
+</head>
+<body style="font: 20px Ahem">
+<p>This test checks that the cursor covers the next character to be overwritten in overtype mode instead of being painted as a caret (1px width bar)</p>
+<div id="ltrtext" style="direction: ltr;" contenteditable="true">ABC</div>
+<div id="ltrtext-rtl" style="direction: rtl;" contenteditable="true">ABC</div>
+<div id="rtltext" style="direction: ltr;" contenteditable="true">&#x05e9;&#x05d3;&#x05df;</div>
+<div id="rtltext-rtl" style="direction: rtl;" contenteditable="true">&#x05e9;&#x05d3;&#x05df;</div>
+<div id="mixed" style="direction: ltr;" contenteditable="true">&#x05e9;&#x05d3;&#x05df;ABC</div>
+<div id="mixed-rtl" style="direction: rtl;" contenteditable="true">&#x05e9;&#x05d3;&#x05df;ABC</div>
+<div id="console"></div>
+</body>
+<script>
+
+var blockCursorStartPosition;
+var blockCursor;
+var textNode;
+
+function verifyBlockCursorLeftPositionAndWidth(elementId, expected)
+{
+    blockCursorStartPosition = new Array();
+
+    var element = document.getElementById(elementId);
+    textNode = element.firstChild;
+    debug("Verifying block cursor position and width for each position in '" + textNode.nodeValue + "' in a " + element.style.direction + " block");
+
+    for (var i = 0; i < textNode.length; i++) {
+        evalAndLog("getSelection().collapse(textNode, "+i+")");
+
+        blockCursor = internals.selectionBounds();
+        blockCursorStartPosition.push(blockCursor.left);
+
+        if (i > 0 && i < textNode.length) {
+            if (expected[i-1] == ">")
+                shouldBeTrue("blockCursorStartPosition["+(i-1)+"] > blockCursorStartPosition["+i+"]");
+            else
+                shouldBeTrue("blockCursorStartPosition["+(i-1)+"] < blockCursorStartPosition["+i+"]");
+        }
+
+        shouldBeTrue("getSelection().isCollapsed");
+        shouldBeTrue("blockCursor.width > 1");
+        shouldBe("internals.absoluteCaretBounds().width", "1");
+    }
+
+    evalAndLog("getSelection().collapse(textNode, "+i+")");
+    blockCursor = internals.selectionBounds();
+    shouldBeZero("blockCursor.width");
+    shouldBe("internals.absoluteCaretBounds().width", "1");
+    debug("");
+}
+
+if (window.testRunner) {
+
+    internals.toggleOverwriteModeEnabled(document);
+
+    verifyBlockCursorLeftPositionAndWidth("ltrtext", ["<", "<", "<"]);
+    verifyBlockCursorLeftPositionAndWidth("ltrtext-rtl", ["<", "<", "<"]);
+    verifyBlockCursorLeftPositionAndWidth("rtltext", [">", ">", ">"]);
+    verifyBlockCursorLeftPositionAndWidth("rtltext-rtl", [">", ">", ">"]);
+    verifyBlockCursorLeftPositionAndWidth("mixed", [">", ">", "<", "<", "<"]);
+    verifyBlockCursorLeftPositionAndWidth("mixed-rtl", [">", ">", ">", "<", "<"]);
+}
+</script>
+<script src="../../fast/js/resources/js-test-post.js" type="text/javascript"></script>
+</html>
index 7731305..c6d2355 100644 (file)
@@ -1,3 +1,45 @@
+2013-05-01  Sergio Villar Senin  <svillar@igalia.com>
+
+        Show a block cursor in overtype mode
+        https://bugs.webkit.org/show_bug.cgi?id=114819
+
+        Reviewed by Ryosuke Niwa.
+
+        Test: editing/selection/block-cursor-overtype-mode.html
+
+        Overtype mode will use block cursor instead of a caret to
+        highlight the next character to be replaced. It will fully cover
+        the next character to be replaced (except at the end of a line
+        where the usual blinking caret will be shown).
+
+        This new block cursor is internally implemented as a selection
+        (not exposed to JavaScript) because the selection code knows how
+        to deal with bidi text.
+
+        * WebCore.exp.in: Export symbols for testing purposes.
+        * WebCore.order: Ditto.
+        * editing/Editor.cpp:
+        (WebCore::Editor::toggleOverwriteModeEnabled): Added a call to
+        FrameLoader::setShouldShowBlockCursor.
+        (WebCore):
+        * editing/Editor.h:
+        (Editor):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::FrameSelection):
+        (WebCore::FrameSelection::updateAppearance): Use a 1-character
+        long selection to paint the cursor in overtype mode.
+        (WebCore::FrameSelection::setShouldShowBlockCursor):
+        (WebCore):
+        * editing/FrameSelection.h:
+        (WebCore::FrameSelection::shouldShowBlockCursor):
+        (FrameSelection):
+        * testing/Internals.cpp:
+        (WebCore):
+        (WebCore::Internals::selectionBounds): Added a new method which
+        returns the IntRect issued by FrameSelection::bounds().
+        * testing/Internals.h: Ditto.
+        * testing/Internals.idl: Ditto.
+
 2013-04-30  Darin Adler  <darin@apple.com>
 
         [Mac] Remove adoptNS/retain pairs, since the two cancel each other out
index 19a3fc0..546c436 100644 (file)
@@ -68,6 +68,7 @@ __ZN3WTF12AtomicString3addEPK10__CFString
 __ZN3WTF6StringC1EP8NSString
 __ZN3WTF6StringC1EPK10__CFString
 __ZN7WebCore10ClientRectC1ERKNS_7IntRectE
+__ZN7WebCore10ClientRectC1ERKNS_9FloatRectE
 __ZN7WebCore10ClientRectC1Ev
 __ZN7WebCore10CredentialC1ERKN3WTF6StringES4_NS_21CredentialPersistenceE
 __ZN7WebCore10CredentialC1Ev
@@ -960,6 +961,7 @@ __ZN7WebCore6Editor6indentEv
 __ZN7WebCore6Editor7CommandC1Ev
 __ZN7WebCore6Editor7commandERKN3WTF6StringE
 __ZN7WebCore6Editor7outdentEv
+__ZN7WebCore6Editor26toggleOverwriteModeEnabledEv
 __ZN7WebCore6JSNode6s_infoE
 __ZN7WebCore6Region5uniteERKS0_
 __ZN7WebCore6Region8subtractERKS0_
index 3558ae9..3559348 100644 (file)
@@ -42859,3 +42859,4 @@ __ZL31pointerAVMediaTypeClosedCaption
 __ZN7WebCoreL19gPropertyWrapperMapE
 __ZN7WebCoreL12gFunctionMapE
 __ZN7WebCoreL12gFunctionMapE
+__ZN7WebCore6Editor26toggleOverwriteModeEnabledEv
\ No newline at end of file
index 2b5824b..3277c1c 100644 (file)
@@ -3124,4 +3124,10 @@ void Editor::applyDictationAlternativelternative(const String& alternativeString
     m_alternativeTextController->applyDictationAlternative(alternativeString);
 }
 
+void Editor::toggleOverwriteModeEnabled()
+{
+    m_overwriteModeEnabled = !m_overwriteModeEnabled;
+    frame()->selection()->setShouldShowBlockCursor(m_overwriteModeEnabled);
+};
+
 } // namespace WebCore
index 44f0f37..f86c51b 100644 (file)
@@ -246,7 +246,7 @@ public:
     void markAndReplaceFor(PassRefPtr<SpellCheckRequest>, const Vector<TextCheckingResult>&);
 
     bool isOverwriteModeEnabled() const { return m_overwriteModeEnabled; }
-    void toggleOverwriteModeEnabled() { m_overwriteModeEnabled = !m_overwriteModeEnabled; }
+    void toggleOverwriteModeEnabled();
 
 #if USE(APPKIT)
     void uppercaseWord();
index e5d460c..fd27ee2 100644 (file)
@@ -114,6 +114,7 @@ FrameSelection::FrameSelection(Frame* frame)
     , m_caretPaint(true)
     , m_isCaretBlinkingSuspended(false)
     , m_focused(frame && frame->page() && frame->page()->focusController()->focusedFrame() == frame)
+    , m_shouldShowBlockCursor(false)
 {
     if (shouldAlwaysUseDirectionalSelection(m_frame))
         m_selection.setIsDirectional(true);
@@ -1753,11 +1754,19 @@ inline static bool shouldStopBlinkingDueToTypingCommand(Frame* frame)
 
 void FrameSelection::updateAppearance()
 {
+    // Paint a block cursor instead of a caret in overtype mode unless the caret is at the end of a line (in this case
+    // the FrameSelection will paint a blinking caret as usual).
+    VisiblePosition forwardPosition;
+    if (m_shouldShowBlockCursor && m_selection.isCaret()) {
+        forwardPosition = modifyExtendingForward(CharacterGranularity);
+        m_caretPaint = forwardPosition.isNull();
+    }
+
 #if ENABLE(TEXT_CARET)
     bool caretRectChangedOrCleared = recomputeCaretRect();
 
     bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
-    bool shouldBlink = caretIsVisible() && isCaret() && (isContentEditable() || caretBrowsing);
+    bool shouldBlink = caretIsVisible() && isCaret() && (isContentEditable() || caretBrowsing) && forwardPosition.isNull();
 
     // If the caret moved, stop the blink timer so we can restart with a
     // black caret in the new location.
@@ -1783,7 +1792,7 @@ void FrameSelection::updateAppearance()
 
     // Construct a new VisibleSolution, since m_selection is not necessarily valid, and the following steps
     // assume a valid selection. See <https://bugs.webkit.org/show_bug.cgi?id=69563> and <rdar://problem/10232866>.
-    VisibleSelection selection(m_selection.visibleStart(), m_selection.visibleEnd());
+    VisibleSelection selection(m_selection.visibleStart(), forwardPosition.isNotNull() ? forwardPosition : m_selection.visibleEnd());
 
     if (!selection.isRange()) {
         view->clearSelection();
@@ -2056,6 +2065,15 @@ inline bool FrameSelection::visualWordMovementEnabled() const
     return settings && settings->visualWordMovementEnabled();
 }
 
+void FrameSelection::setShouldShowBlockCursor(bool shouldShowBlockCursor)
+{
+    m_shouldShowBlockCursor = shouldShowBlockCursor;
+
+    m_frame->document()->updateLayoutIgnorePendingStylesheets();
+
+    updateAppearance();
+}
+
 #ifndef NDEBUG
 
 void FrameSelection::formatForDebugger(char* buffer, unsigned length) const
index f19ef5f..a6fb6c4 100644 (file)
@@ -255,6 +255,9 @@ public:
     void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent);
     void setSelectionFromNone();
 
+    bool shouldShowBlockCursor() const { return m_shouldShowBlockCursor; }
+    void setShouldShowBlockCursor(bool);
+
 private:
     enum EPositionType { START, END, BASE, EXTENT };
 
@@ -311,6 +314,7 @@ private:
     bool m_caretPaint : 1;
     bool m_isCaretBlinkingSuspended : 1;
     bool m_focused : 1;
+    bool m_shouldShowBlockCursor : 1;
 };
 
 inline EditingStyle* FrameSelection::typingStyle() const
index 19cc279..eb8317a 100644 (file)
@@ -2295,6 +2295,18 @@ double Internals::closestTimeToTimeRanges(double time, TimeRanges* ranges)
 {
     return ranges->nearest(time);
 }
+
+PassRefPtr<ClientRect> Internals::selectionBounds(ExceptionCode& ec)
+{
+    Document* document = contextDocument();
+    if (!document || !document->frame() || !document->frame()->selection()) {
+        ec = INVALID_ACCESS_ERR;
+        return ClientRect::create();
+    }
+
+    return ClientRect::create(document->frame()->selection()->bounds());
+}
+
 #endif
 
 }
index 82906e4..b7b73a2 100644 (file)
@@ -328,6 +328,8 @@ public:
     double closestTimeToTimeRanges(double time, TimeRanges*);
 #endif
 
+    PassRefPtr<ClientRect> selectionBounds(ExceptionCode&);
+
 private:
     explicit Internals(Document*);
     Document* contextDocument() const;
index 4ee0add..7050b53 100644 (file)
     [Conditional=VIDEO] double closestTimeToTimeRanges(double time, TimeRanges ranges);
 
     boolean isSelectPopupVisible(Node node);
+
+    ClientRect selectionBounds() raises(DOMException);
 };
index c390ea4..4faf7cd 100644 (file)
@@ -1,3 +1,14 @@
+2013-05-01  Sergio Villar Senin  <svillar@igalia.com>
+
+        Show a block cursor in overtype mode
+        https://bugs.webkit.org/show_bug.cgi?id=114819
+
+        Reviewed by Ryosuke Niwa.
+
+        Export three more WebCore symbols.
+
+        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
+
 2013-04-29  Brent Fulgham  <bfulgham@webkit.org>
 
         [Windows, WinCairo] Remove pthread paths for WebKit build.
index 6d3bb2b..c667370 100644 (file)
@@ -155,6 +155,7 @@ EXPORTS
         ??1NodeRenderingContext@WebCore@@QAE@XZ
         ??1Range@WebCore@@QAE@XZ
         ?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
+        ??0ClientRect@WebCore@@AAE@ABVFloatRect@1@@Z
         ??0ClientRect@WebCore@@AAE@ABVIntRect@1@@Z
         ??0ClientRect@WebCore@@AAE@XZ
         ??0ClientRectList@WebCore@@AAE@XZ
@@ -187,6 +188,7 @@ EXPORTS
         ?find@StringImpl@WTF@@QAEIPAV12@I@Z
         ?find@StringImpl@WTF@@QAEIPAV12@@Z
         ?absoluteCaretBounds@FrameSelection@WebCore@@QAE?AVIntRect@2@XZ
+        ?bounds@FrameSelection@WebCore@@QBE?AVFloatRect@2@_N@Z
         ?fromUTF8@String@WTF@@SA?AV12@PBE@Z
         ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z
         ?garbageCollectDocumentResources@CachedResourceLoader@WebCore@@QAEXXZ
@@ -317,6 +319,7 @@ EXPORTS
         ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
         ?isContinuousSpellCheckingEnabled@Editor@WebCore@@QBE_NXZ
         ?toggleContinuousSpellChecking@Editor@WebCore@@QAEXXZ
+        ?toggleOverwriteModeEnabled@Editor@WebCore@@QAEXXZ
 #if ENABLE(FULLSCREEN_API)
         ?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
         ?webkitDidEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
index c60d2da..fed3ef2 100644 (file)
@@ -1,3 +1,14 @@
+2013-05-01  Sergio Villar Senin  <svillar@igalia.com>
+
+        Show a block cursor in overtype mode
+        https://bugs.webkit.org/show_bug.cgi?id=114819
+
+        Reviewed by Ryosuke Niwa.
+
+        Export three more WebCore symbols.
+
+        * WebKit.vcproj/WebKitExports.def.in:
+
 2013-04-29  Brent Fulgham  <bfulgham@webkit.org>
 
         [Windows, WinCairo] Remove pthread paths for WebKit build.
index 095a696..3f82128 100644 (file)
@@ -156,6 +156,7 @@ EXPORTS
         ??1NodeRenderingContext@WebCore@@QAE@XZ
         ??1Range@WebCore@@QAE@XZ
         ?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
+        ??0ClientRect@WebCore@@AAE@ABVFloatRect@1@@Z
         ??0ClientRect@WebCore@@AAE@ABVIntRect@1@@Z
         ??0ClientRect@WebCore@@AAE@XZ
         ??0ClientRectList@WebCore@@AAE@XZ
@@ -188,6 +189,7 @@ EXPORTS
         ?find@StringImpl@WTF@@QAEIPAV12@I@Z
         ?find@StringImpl@WTF@@QAEIPAV12@@Z
         ?absoluteCaretBounds@FrameSelection@WebCore@@QAE?AVIntRect@2@XZ
+        ?bounds@FrameSelection@WebCore@@QBE?AVFloatRect@2@_N@Z
         ?fromUTF8@String@WTF@@SA?AV12@PBE@Z
         ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z
         ?garbageCollectDocumentResources@CachedResourceLoader@WebCore@@QAEXXZ
@@ -318,6 +320,7 @@ EXPORTS
         ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
         ?isContinuousSpellCheckingEnabled@Editor@WebCore@@QBE_NXZ
         ?toggleContinuousSpellChecking@Editor@WebCore@@QAEXXZ
+        ?toggleOverwriteModeEnabled@Editor@WebCore@@QAEXXZ
 #if ENABLE(FULLSCREEN_API)
         ?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
         ?webkitDidEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
index 8f0e6b5..868bde4 100644 (file)
@@ -311,6 +311,9 @@ _ZNK7WebCore4Node28deprecatedShadowAncestorNodeEv;
 _ZNK7WebCore7IntRect10intersectsERKS0_;
 _ZNK7WebCore8Document13nodesFromRectEiijjjjj;
 _ZTVN7WebCore14StaticNodeListE;
+_ZN7WebCore6Editor26toggleOverwriteModeEnabledEv;
+_ZNK7WebCore14FrameSelection6boundsEb;
+_ZN7WebCore10ClientRectC1ERKNS_9FloatRectE;
 
 local:
 _Z*;