- Source/WebCore/ChangeLog +15 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2011-10-03  Ryosuke Niwa  <rniwa@webkit.org>
2
3
        REGRESSION(r94274): cloned text input loses value
4
        https://bugs.webkit.org/show_bug.cgi?id=69095
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The bug was caused by copyNonAttributeProperties not updating inner element text after copying
9
        m_valueIfDirty. Fixed the bug by calling updateInnerTextValue.
10
11
        Test: fast/forms/clone-input-with-dirty-value.html
12
13
        * html/HTMLInputElement.cpp:
14
        (WebCore::HTMLInputElement::copyNonAttributeProperties):
15
1
2011-09-22  Darin Adler  <darin@apple.com>
16
2011-09-22  Darin Adler  <darin@apple.com>
2
17
3
        Rename many obviously-correct call sites in WebCore using releaseRef to use it by its new name leakRef
18
        Rename many obviously-correct call sites in WebCore using releaseRef to use it by its new name leakRef
- Source/WebCore/html/HTMLInputElement.cpp +3 lines
Lines 1027-1032 void HTMLInputElement::copyNonAttributeP Source/WebCore/html/HTMLInputElement.cpp_sec1
1027
    m_isIndeterminate = sourceElement->m_isIndeterminate;
1027
    m_isIndeterminate = sourceElement->m_isIndeterminate;
1028
1028
1029
    HTMLTextFormControlElement::copyNonAttributeProperties(source);
1029
    HTMLTextFormControlElement::copyNonAttributeProperties(source);
1030
1031
    setFormControlValueMatchesRenderer(false);
1032
    updateInnerTextValue();
1030
}
1033
}
1031
1034
1032
String HTMLInputElement::value() const
1035
String HTMLInputElement::value() const
- LayoutTests/ChangeLog +13 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2011-10-03  Ryosuke Niwa  <rniwa@webkit.org>
2
3
        REGRESSION(r94274): cloned text input loses value
4
        https://bugs.webkit.org/show_bug.cgi?id=69095
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Added a regression test that clones an input element with a dirty value.
9
        The cloned input element should have the edited value.
10
11
        * fast/forms/clone-input-with-dirty-value-expected.txt: Added.
12
        * fast/forms/clone-input-with-dirty-value.html: Added.
13
1
2011-10-03  Adam Barth  <abarth@webkit.org>
14
2011-10-03  Adam Barth  <abarth@webkit.org>
2
15
3
        Update results to account for Windows Vista.
16
        Update results to account for Windows Vista.
- LayoutTests/fast/forms/clone-input-with-dirty-value-expected.txt +4 lines
Line 0 LayoutTests/fast/forms/clone-input-with-dirty-value-expected.txt_sec1
1
This tests cloning an input element with an edited value. The cloned input element should retain the edited value and you should see PASSED blow.
2
3
PASSED
4
- LayoutTests/fast/forms/clone-input-with-dirty-value.html +30 lines
Line 0 LayoutTests/fast/forms/clone-input-with-dirty-value.html_sec1
1
<!DOCTYPE HTML>
2
<html>
3
<body>
4
<p>This tests cloning an input element with an edited value.
5
The cloned input element should retain the edited value and you should see PASSED blow.</p>
6
<pre id="log"></pre>
7
<div><input id="test" title="1" type="text" value="FAIL"></div>
8
<script type="text/javascript">
9
10
if (window.layoutTestController)
11
    layoutTestController.dumpAsText();
12
13
var test = document.getElementById('test');
14
test.value = 'PASS';
15
16
var x = test.offsetLeft; // Force layout
17
18
var clone = test.cloneNode(true);
19
test.parentNode.appendChild(clone);
20
test.value = '';
21
22
clone.focus();
23
clone.selectionStart = clone.selectionEnd = clone.value.length;
24
document.execCommand('InsertText', false, 'ED');
25
26
document.getElementById('log').textContent = clone.value;
27
28
</script>
29
</body>
30
</html>

Return to Bug 69095