Title: [104569] trunk/Source/WebKit2
- Revision
- 104569
- Author
- [email protected]
- Date
- 2012-01-10 07:20:10 -0800 (Tue, 10 Jan 2012)
Log Message
WIP
Modified Paths
Diff
Modified: trunk/Source/WebKit2/Shared/EditorState.cpp (104568 => 104569)
--- trunk/Source/WebKit2/Shared/EditorState.cpp 2012-01-10 15:17:50 UTC (rev 104568)
+++ trunk/Source/WebKit2/Shared/EditorState.cpp 2012-01-10 15:20:10 UTC (rev 104569)
@@ -44,7 +44,8 @@
#if PLATFORM(QT)
encoder->encode(cursorPosition);
encoder->encode(anchorPosition);
- encoder->encode(microFocus);
+ encoder->encode(editorRect);
+ encoder->encode(cursorRect);
encoder->encode(compositionRect);
encoder->encode(selectedText);
encoder->encode(surroundingText);
@@ -81,9 +82,12 @@
if (!decoder->decode(result.anchorPosition))
return false;
- if (!decoder->decode(result.microFocus))
+ if (!decoder->decode(result.editorRect))
return false;
+ if (!decoder->decode(result.cursorRect))
+ return false;
+
if (!decoder->decode(result.compositionRect))
return false;
Modified: trunk/Source/WebKit2/Shared/EditorState.h (104568 => 104569)
--- trunk/Source/WebKit2/Shared/EditorState.h 2012-01-10 15:17:50 UTC (rev 104568)
+++ trunk/Source/WebKit2/Shared/EditorState.h 2012-01-10 15:20:10 UTC (rev 104569)
@@ -63,7 +63,8 @@
unsigned cursorPosition;
unsigned anchorPosition;
- WebCore::IntRect microFocus;
+ WebCore::IntRect editorRect;
+ WebCore::IntRect cursorRect;
WebCore::IntRect compositionRect;
WTF::String selectedText;
WTF::String surroundingText;
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (104568 => 104569)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-01-10 15:17:50 UTC (rev 104568)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-01-10 15:20:10 UTC (rev 104569)
@@ -924,7 +924,7 @@
switch(property) {
case Qt::ImCursorRectangle:
- return QRectF(state.microFocus);
+ return QRectF(state.cursorRect);
case Qt::ImFont:
return QVariant();
case Qt::ImCursorPosition:
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp (104568 => 104569)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp 2012-01-10 15:17:50 UTC (rev 104568)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp 2012-01-10 15:20:10 UTC (rev 104569)
@@ -186,8 +186,9 @@
EditorState state = m_page->editorState();
#if PLATFORM(QT)
- if (Element* scope = frame->selection()->rootEditableElement())
- m_page->send(Messages::WebPageProxy::FocusEditableArea(state.microFocus, scope->getRect()));
+ // FIXME: Move this to act on the vkb visibility change.
+ if (state.isContentEditable)
+ m_page->send(Messages::WebPageProxy::FocusEditableArea(state.cursorRect, state.editorRect));
#endif
m_page->send(Messages::WebPageProxy::EditorStateChanged(state));
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (104568 => 104569)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-01-10 15:17:50 UTC (rev 104568)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-01-10 15:20:10 UTC (rev 104569)
@@ -398,6 +398,9 @@
if (!scope)
return result;
+ if (selectionRoot)
+ result.editorRect = frame->view()->contentsToWindow(selectionRoot->getRect());
+
RefPtr<Range> range;
if (result.hasComposition && (range = frame->editor()->compositionRange())) {
frame->editor()->getCompositionSelection(result.anchorPosition, result.cursorPosition);
@@ -415,7 +418,7 @@
}
if (range)
- result.microFocus = frame->view()->contentsToWindow(frame->editor()->firstRectForRange(range.get()));
+ result.cursorRect = frame->view()->contentsToWindow(frame->editor()->firstRectForRange(range.get()));
// FIXME: We should only transfer innerText when it changes and do this on the UI side.
if (result.isContentEditable && !result.isInPasswordField) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes