Diff
Modified: trunk/LayoutTests/ChangeLog (86827 => 86828)
--- trunk/LayoutTests/ChangeLog 2011-05-19 09:21:58 UTC (rev 86827)
+++ trunk/LayoutTests/ChangeLog 2011-05-19 09:22:47 UTC (rev 86828)
@@ -1,3 +1,17 @@
+2011-05-19 Kenichi Ishibashi <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ [Chromium] IME candidate window appears wrong position in an iframe
+ https://bugs.webkit.org/show_bug.cgi?id=61023
+
+ Added a test which ensures the IME candidate position is located
+ at suitable position.
+
+ * platform/chromium-mac/editing/input/ime-candidate-window-position-expected.txt: Added.
+ * platform/chromium-mac/editing/input/ime-candidate-window-position.html: Added.
+ * platform/chromium-mac/editing/resources/ime-candidate-window-position-iframe.html: Added.
+
2011-05-19 Emil A Eklund <[email protected]>
Reviewed by Alexey Proskuryakov.
Added: trunk/LayoutTests/platform/chromium-mac/editing/input/ime-candidate-window-position-expected.txt (0 => 86828)
--- trunk/LayoutTests/platform/chromium-mac/editing/input/ime-candidate-window-position-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium-mac/editing/input/ime-candidate-window-position-expected.txt 2011-05-19 09:22:47 UTC (rev 86828)
@@ -0,0 +1,8 @@
+This test ensures that the IME candidate window appears at the appropriate position. Enter some text with IME in the following gray box and convert them. Then check whether the candidate window appears the below of the composition text. In DRT, this test checks it by calling textInputController.firstRectForCharacterRange().
+rect[0] denotes x coodinate and rect[1] denotes y coodinate
+PASS rect[0] is frame.offsetLeft + input.offsetLeft + 1
+PASS rect[1] is frame.offsetTop + input.offsetTop
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/platform/chromium-mac/editing/input/ime-candidate-window-position.html (0 => 86828)
--- trunk/LayoutTests/platform/chromium-mac/editing/input/ime-candidate-window-position.html (rev 0)
+++ trunk/LayoutTests/platform/chromium-mac/editing/input/ime-candidate-window-position.html 2011-05-19 09:22:47 UTC (rev 86828)
@@ -0,0 +1,42 @@
+<html>
+<head>
+<style>
+* {
+ padding: 0px;
+ margin: 0px;
+ border: 0px;
+}
+</style>
+<link rel="stylesheet" href=""
+<script src=""
+<script>
+window.jsTestIsAsync = true;
+var successfullyParsed = false;
+
+function doTest() {
+ if (window.layoutTestController) {
+ frame = document.getElementsByTagName('iframe')[0];
+ input = frames['iframe'].document.getElementsByTagName('input')[0];
+ input.focus();
+ rect = textInputController.firstRectForCharacterRange(0, 0);
+ debug('rect[0] denotes x coodinate and rect[1] denotes y coodinate');
+ // I'm not sure why we need to +1 for x coodinate here but
+ // firstRectForCharacterRange returns that value.
+ shouldBe('rect[0]', 'frame.offsetLeft + input.offsetLeft + 1');
+ shouldBe('rect[1]', 'frame.offsetTop + input.offsetTop');
+ }
+ successfullyParsed = true;
+ finishJSTest();
+}
+</script>
+</head>
+<body _onload_="doTest()">
+<div>
+This test ensures that the IME candidate window appears at the appropriate position. Enter some text with IME in the following gray box and convert them. Then check whether the candidate window appears the below of the composition text. In DRT, this test checks it by calling textInputController.firstRectForCharacterRange().
+</div>
+<div id="console"></div>
+<iframe name="iframe" style="position: absolute; top: 200px; left: 200px;" src="" width="300" height="300">
+</iframe>
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/platform/chromium-mac/editing/resources/ime-candidate-window-position-iframe.html (0 => 86828)
--- trunk/LayoutTests/platform/chromium-mac/editing/resources/ime-candidate-window-position-iframe.html (rev 0)
+++ trunk/LayoutTests/platform/chromium-mac/editing/resources/ime-candidate-window-position-iframe.html 2011-05-19 09:22:47 UTC (rev 86828)
@@ -0,0 +1,11 @@
+<style>
+* {
+ padding: 0px;
+ margin: 0px;
+ border: 0px;
+}
+</style>
+<input style="background:#aaa;" />
+<script>
+document.getElementsByTagName('input')[0].focus();
+</script>
Modified: trunk/Source/WebKit/chromium/ChangeLog (86827 => 86828)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-05-19 09:21:58 UTC (rev 86827)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-05-19 09:22:47 UTC (rev 86828)
@@ -1,3 +1,16 @@
+2011-05-19 Kenichi Ishibashi <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ [Chromium] IME candidate window appears wrong position in an iframe
+ https://bugs.webkit.org/show_bug.cgi?id=61023
+
+ Always adjusts the range to window relative coordinates.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::firstRectForCharacterRange): Removed condition
+ which excludes editable selectionRoot from adjusting.
+
2011-05-18 Nat Duca <[email protected]>
Reviewed by James Robinson.
Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp (86827 => 86828)
--- trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2011-05-19 09:21:58 UTC (rev 86827)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2011-05-19 09:22:47 UTC (rev 86828)
@@ -1161,9 +1161,7 @@
return false;
IntRect intRect = frame()->editor()->firstRectForRange(range.get());
rect = WebRect(intRect);
- // When inside an text control, don't adjust the range.
- if (!selectionRoot)
- rect = frame()->view()->contentsToWindow(rect);
+ rect = frame()->view()->contentsToWindow(rect);
return true;
}
Modified: trunk/Tools/ChangeLog (86827 => 86828)
--- trunk/Tools/ChangeLog 2011-05-19 09:21:58 UTC (rev 86827)
+++ trunk/Tools/ChangeLog 2011-05-19 09:22:47 UTC (rev 86828)
@@ -1,3 +1,16 @@
+2011-05-19 Kenichi Ishibashi <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ [Chromium] IME candidate window appears wrong position in an iframe
+ https://bugs.webkit.org/show_bug.cgi?id=61023
+
+ Call the focused frame's firstRectForCharacterRange() instead of the
+ main frame so that DRT behaves as the same as Chromium.
+
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::firstRectForCharacterRange):
+
2011-05-18 Adam Roben <[email protected]>
Add a new page to build.webkit.org to help find when tests started failing
Modified: trunk/Tools/DumpRenderTree/chromium/TextInputController.cpp (86827 => 86828)
--- trunk/Tools/DumpRenderTree/chromium/TextInputController.cpp 2011-05-19 09:21:58 UTC (rev 86827)
+++ trunk/Tools/DumpRenderTree/chromium/TextInputController.cpp 2011-05-19 09:22:47 UTC (rev 86828)
@@ -181,15 +181,15 @@
{
result->setNull();
- WebFrame* mainFrame = getMainFrame();
- if (!mainFrame)
+ WebFrame* frame = testShell->webView()->focusedFrame();
+ if (!frame)
return;
if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
return;
WebRect rect;
- if (!mainFrame->firstRectForCharacterRange(arguments[0].toInt32(), arguments[1].toInt32(), rect))
+ if (!frame->firstRectForCharacterRange(arguments[0].toInt32(), arguments[1].toInt32(), rect))
return;
Vector<int> intArray(4);