[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

jhoneycutt at apple.com jhoneycutt at apple.com
Wed Apr 7 23:45:56 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 037271dfb3051d2f6b56675b97a3887682af6d57
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 17 23:38:11 2009 +0000

    Implement DOMHTMLInputElement::replaceCharactersInRange().
    
    https://bugs.webkit.org/show_bug.cgi?id=31492
    
    Reviewed by Dan Bernstein.
    
    * DOMHTMLClasses.cpp:
    (DOMHTMLInputElement::replaceCharactersInRange):
    Get the text of the input field. Replace the given range with the
    replacement text, and set this new string as the input element's value.
    Select from index to the end of the field. This matches the
    implementation in the Obj-C bindings.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index dc274c1..fab4559 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,5 +1,20 @@
 2009-11-12  Jon Honeycutt  <jhoneycutt at apple.com>
 
+        Implement DOMHTMLInputElement::replaceCharactersInRange().
+
+        https://bugs.webkit.org/show_bug.cgi?id=31492
+
+        Reviewed by Dan Bernstein.
+
+        * DOMHTMLClasses.cpp:
+        (DOMHTMLInputElement::replaceCharactersInRange):
+        Get the text of the input field. Replace the given range with the
+        replacement text, and set this new string as the input element's value.
+        Select from index to the end of the field. This matches the
+        implementation in the Obj-C bindings.
+
+2009-11-12  Jon Honeycutt  <jhoneycutt at apple.com>
+
         DOMHTMLOptionElement is missing some functionality.
 
         https://bugs.webkit.org/show_bug.cgi?id=31491
diff --git a/WebKit/win/DOMHTMLClasses.cpp b/WebKit/win/DOMHTMLClasses.cpp
index 9a9f573..deb1975 100644
--- a/WebKit/win/DOMHTMLClasses.cpp
+++ b/WebKit/win/DOMHTMLClasses.cpp
@@ -1306,13 +1306,25 @@ HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::rectOnScreen(
 }
 
 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::replaceCharactersInRange( 
-    /* [in] */ int /*startTarget*/,
-    /* [in] */ int /*endTarget*/,
-    /* [in] */ BSTR /*replacementString*/,
-    /* [in] */ int /*index*/)
+    /* [in] */ int startTarget,
+    /* [in] */ int endTarget,
+    /* [in] */ BSTR replacementString,
+    /* [in] */ int index)
 {
-    ASSERT_NOT_REACHED();
-    return E_NOTIMPL;
+    if (!replacementString)
+        return E_POINTER;
+
+    ASSERT(m_element);
+    ASSERT(m_element->hasTagName(inputTag));
+    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);
+
+    String newValue = inputElement->value();
+    String webCoreReplacementString(static_cast<UChar*>(replacementString), SysStringLen(replacementString));
+    newValue.replace(startTarget, endTarget - startTarget, webCoreReplacementString);
+    inputElement->setValue(newValue);
+    inputElement->setSelectionRange(index, newValue.length());
+
+    return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::selectedRange( 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list