[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

satish at chromium.org satish at chromium.org
Wed Dec 22 13:07:08 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bb647bc7df7c23a42fc0c1793652d2b81d227bdc
Author: satish at chromium.org <satish at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 7 13:27:54 2010 +0000

    2010-09-07  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Steve Block.
    
            Fix speech button's hit test logic for RTL rendering.
            https://bugs.webkit.org/show_bug.cgi?id=45288
    
            * fast/speech/input-text-speechbutton.html: Added RTL test case and merged JS code.
            * fast/speech/script-tests/input-text-speechbutton.js: Removed.
    2010-09-07  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Steve Block.
    
            Fix speech button's hit test logic for RTL rendering.
            https://bugs.webkit.org/show_bug.cgi?id=45288
    
            * rendering/RenderTextControlSingleLine.cpp:
            (WebCore::RenderTextControlSingleLine::forwardEvent):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1145f00..37eaa78 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,15 @@
 2010-09-07  Satish Sampath  <satish at chromium.org>
 
+        Reviewed by Steve Block.
+
+        Fix speech button's hit test logic for RTL rendering.
+        https://bugs.webkit.org/show_bug.cgi?id=45288
+
+        * fast/speech/input-text-speechbutton.html: Added RTL test case and merged JS code.
+        * fast/speech/script-tests/input-text-speechbutton.js: Removed.
+
+2010-09-07  Satish Sampath  <satish at chromium.org>
+
         Reviewed by Jeremy Orlow.
 
         Ignore programmatic clicks on speech input button for security reasons.
diff --git a/LayoutTests/fast/speech/input-text-speechbutton.html b/LayoutTests/fast/speech/input-text-speechbutton.html
index 51ef00b..98bf8b7 100644
--- a/LayoutTests/fast/speech/input-text-speechbutton.html
+++ b/LayoutTests/fast/speech/input-text-speechbutton.html
@@ -7,7 +7,52 @@
 <body>
 <p id="description"></p>
 <div id="console"></div>
-<script src="script-tests/input-text-speechbutton.js"></script>
+<script type="text/javascript">
+description('Tests for speech button click with &lt;input type="text" speech>.');
+
+function onChange() {
+    shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
+    setTimeout(function() {
+        var input = document.getElementById('speechInput');
+        input.dir = 'rtl';
+        input.value = '';
+        input.onchange = function() {
+            shouldBeEqualToString('document.getElementById("speechInput").value',
+                                  'Pictures of the moon');
+            finishJSTest();
+        };
+
+        var x = input.offsetLeft + 4;
+        var y = input.offsetTop + input.offsetHeight / 2;
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }, 50);
+}
+
+function run() {
+    var input = document.createElement('input');
+    input.id = 'speechInput';
+    input.speech = 'speech';
+    input.onchange = onChange;
+    document.body.appendChild(input);
+
+    if (window.layoutTestController && window.eventSender) {
+        layoutTestController.setMockSpeechInputResult('Pictures of the moon');
+
+        // Clicking the speech button should fill in mock speech-recognized text.
+        var x = input.offsetLeft + input.offsetWidth - 4;
+        var y = input.offsetTop + input.offsetHeight / 2;
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+}
+
+window.onload = run;
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
+</script>
 <script src="../js/resources/js-test-post.js"></script>
 </body>
 </html>
diff --git a/LayoutTests/fast/speech/script-tests/input-text-speechbutton.js b/LayoutTests/fast/speech/script-tests/input-text-speechbutton.js
deleted file mode 100644
index c6512bc..0000000
--- a/LayoutTests/fast/speech/script-tests/input-text-speechbutton.js
+++ /dev/null
@@ -1,30 +0,0 @@
-description('Tests for speech button click with &lt;input type="text" speech>.');
-
-function onChange() {
-    shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
-    finishJSTest();
-}
-
-function run() {
-  var input = document.createElement('input');
-  input.id = 'speechInput';
-  input.speech = 'speech';
-  input.addEventListener('change', onChange, false);
-  document.body.appendChild(input);
-
-  if (window.layoutTestController)
-      layoutTestController.setMockSpeechInputResult('Pictures of the moon');
-
-  // Clicking the speech button should fill in mock speech-recognized text.
-  if (window.eventSender) {
-      var x = input.offsetLeft + input.offsetWidth - 4;
-      var y = input.offsetTop + input.offsetHeight / 2;
-      eventSender.mouseMoveTo(x, y);
-      eventSender.mouseDown();
-      eventSender.mouseUp();
-  }
-}
-
-window.onload = run;
-window.jsTestIsAsync = true;
-window.successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4d1bd33..59cf7dc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,15 @@
 2010-09-07  Satish Sampath  <satish at chromium.org>
 
+        Reviewed by Steve Block.
+
+        Fix speech button's hit test logic for RTL rendering.
+        https://bugs.webkit.org/show_bug.cgi?id=45288
+
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::forwardEvent):
+
+2010-09-07  Satish Sampath  <satish at chromium.org>
+
         Reviewed by Jeremy Orlow.
 
         Ignore programmatic clicks on speech input button for security reasons.
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index b553c56..70d98bf 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -374,18 +374,19 @@ void RenderTextControlSingleLine::forwardEvent(Event* event)
         return;
     }
 
-    FloatPoint localPoint = innerTextRenderer->absoluteToLocal(static_cast<MouseEvent*>(event)->absoluteLocation(), false, true);
-    int textRight = innerTextRenderer->borderBoxRect().right();
-
 #if ENABLE(INPUT_SPEECH)
     if (RenderBox* speechBox = m_speechButton ? m_speechButton->renderBox() : 0) {
-        if (localPoint.x() >= speechBox->x() && localPoint.x() < speechBox->x() + speechBox->width()) {
+        FloatPoint pointInTextControlCoords = absoluteToLocal(static_cast<MouseEvent*>(event)->absoluteLocation(), false, true);
+        if (speechBox->frameRect().contains(roundedIntPoint(pointInTextControlCoords))) {
             m_speechButton->defaultEventHandler(event);
             return;
         }
     }
 #endif
 
+    FloatPoint localPoint = innerTextRenderer->absoluteToLocal(static_cast<MouseEvent*>(event)->absoluteLocation(), false, true);
+    int textRight = innerTextRenderer->borderBoxRect().right();
+
     if (m_resultsButton && localPoint.x() < innerTextRenderer->borderBoxRect().x())
         m_resultsButton->defaultEventHandler(event);
     else if (m_cancelButton && localPoint.x() > textRight)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list