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

tkent at chromium.org tkent at chromium.org
Wed Dec 22 14:16:34 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 45a203ca44e60efd43473dea3fcbbe5841838bad
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 6 04:36:09 2010 +0000

    REGRESSION (r67166): "Placeholder" text remains in input box after 2nd focus()
    https://bugs.webkit.org/show_bug.cgi?id=45940
    
    Reviewed by Dimitri Glazkov.
    
    WebCore:
    
    Test: fast/forms/input-placeholder-focus-twice.html
    
    * html/HTMLFormControlElement.h: Make supportsPlaceholder() public.
    * rendering/RenderTextControlSingleLine.cpp:
    (WebCore::RenderTextControlSingleLine::updateFromElement):
     We always need to update the renderer value with the DOM value if
     the element supports the placeholder feature.
     Note: the placeholder feature and "unacceptable renderer value"
     are exclusive.
    
    LayoutTests:
    
    * fast/forms/input-placeholder-focus-twice.html: Added.
    * platform/chromium/test_expectations.txt:
    * platform/mac/fast/forms/input-placeholder-focus-twice-expected.checksum: Added.
    * platform/mac/fast/forms/input-placeholder-focus-twice-expected.png: Added.
    * platform/mac/fast/forms/input-placeholder-focus-twice-expected.txt: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69176 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 12d5eb6..33ac24d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-05  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        REGRESSION (r67166): "Placeholder" text remains in input box after 2nd focus()
+        https://bugs.webkit.org/show_bug.cgi?id=45940
+
+        * fast/forms/input-placeholder-focus-twice.html: Added.
+        * platform/chromium/test_expectations.txt:
+        * platform/mac/fast/forms/input-placeholder-focus-twice-expected.checksum: Added.
+        * platform/mac/fast/forms/input-placeholder-focus-twice-expected.png: Added.
+        * platform/mac/fast/forms/input-placeholder-focus-twice-expected.txt: Added.
+
 2010-10-05  Martin Robinson  <mrobinson at igalia.com>
 
         [GTK] editing/pasteboard/dataTransfer-setData-getData.html fails on GTK+
diff --git a/LayoutTests/fast/forms/input-placeholder-focus-twice.html b/LayoutTests/fast/forms/input-placeholder-focus-twice.html
new file mode 100644
index 0000000..41a00e8
--- /dev/null
+++ b/LayoutTests/fast/forms/input-placeholder-focus-twice.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+</head>
+<body>
+<p id="description">Bug 45940: A bug that a placeholder text is not cleared by the second focus.
+The first input field should not have any text.</p>
+<div>
+<input id=i1 placeholder="FAIL; This should no be visible." style="color: red;">
+<input id=i2>
+<script>
+var i1 = document.getElementById('i1');
+var i2 = document.getElementById('i2');
+i1.focus();
+i2.focus();
+i1.focus();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 25222c1..4bf9ae6 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -3186,3 +3186,6 @@ BUG58096 MAC : fast/table/simple_paint.html = IMAGE
 BUG57950 WIN LINUX : svg/batik/text/verticalText.svg = CRASH PASS
 
 BUG57957 LINUX DEBUG : fast/blockflow/block-level-images.html = IMAGE PASS
+
+// Need new baseline.
+BUG_TKENT : fast/forms/input-placeholder-focus-twice.html = FAIL
diff --git a/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.checksum b/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.checksum
new file mode 100644
index 0000000..54b338a
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.checksum
@@ -0,0 +1 @@
+1ed686cfe61d40b2432e4c49c70741d3
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.png b/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.png
new file mode 100644
index 0000000..02eda05
Binary files /dev/null and b/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.txt b/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.txt
new file mode 100644
index 0000000..469bd8b
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/input-placeholder-focus-twice-expected.txt
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 768x18
+          text run at (0,0) width 768: "Bug 45940: A bug that a placeholder text is not cleared by the second focus. The first input field should not have any text."
+      RenderBlock {DIV} at (0,34) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 125x19 [color=#FF0000] [bgcolor=#FFFFFF] [border: (2px inset #FF0000)]
+        RenderText {#text} at (129,2) size 4x18
+          text run at (129,2) width 4: " "
+        RenderTextControl {INPUT} at (135,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+layer at (13,47) size 119x13
+  RenderBlock {DIV} at (3,3) size 119x13
+layer at (146,47) size 119x13
+  RenderBlock {DIV} at (3,3) size 119x13
+caret: position 0 of child 0 {DIV} of child 1 {INPUT} of child 3 {DIV} of body
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3cb175d..b5030c1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-10-05  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        REGRESSION (r67166): "Placeholder" text remains in input box after 2nd focus()
+        https://bugs.webkit.org/show_bug.cgi?id=45940
+
+        Test: fast/forms/input-placeholder-focus-twice.html
+
+        * html/HTMLFormControlElement.h: Make supportsPlaceholder() public.
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::updateFromElement):
+         We always need to update the renderer value with the DOM value if
+         the element supports the placeholder feature.
+         Note: the placeholder feature and "unacceptable renderer value"
+         are exclusive.
+
 2010-10-05  Kyusun Kim  <maniagoon at company100.net>
 
         Reviewed by Kent Tamura.
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index eae7f0a..b685896 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -177,6 +177,8 @@ public:
 
     virtual ~HTMLTextFormControlElement();
 
+    // The derived class should return true if placeholder processing is needed.
+    virtual bool supportsPlaceholder() const = 0;
     String strippedPlaceholder() const;
 
     int selectionStart();
@@ -204,8 +206,6 @@ private:
     virtual int cachedSelectionStart() const = 0;
     virtual int cachedSelectionEnd() const = 0;
 
-    // The derived class should return true if placeholder processing is needed.
-    virtual bool supportsPlaceholder() const = 0;
     // Returns true if user-editable value is empty. Used to check placeholder visibility.
     virtual bool isEmptyValue() const = 0;
     // Called in dispatchFocusEvent(), after placeholder process, before calling parent's dispatchFocusEvent().
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index 75da999..2211110 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -683,11 +683,18 @@ void RenderTextControlSingleLine::updateFromElement()
     } else {
         if (!inputElement()->suggestedValue().isNull())
             setInnerTextValue(inputElement()->suggestedValue());
-        else if (!node()->isHTMLElement() || !static_cast<HTMLInputElement*>(node())->formControlValueMatchesRenderer())
-            // For HTMLInputElement, update the renderer value only if the
-            // formControlValueMatchesRenderer() flag is false. It protects an
-            // unacceptable renderer value from being overwritten with the DOM value.
-            setInnerTextValue(inputElement()->value());
+        else {
+            bool shouldUpdateValue = true;
+            if (node()->isHTMLElement()) {
+                // For HTMLInputElement, update the renderer value if the element
+                // supports placeholder or the formControlValueMatchesRenderer()
+                // flag is false. It protects an unacceptable renderer value from
+                // being overwritten with the DOM value.
+                shouldUpdateValue = static_cast<HTMLTextFormControlElement*>(node())->supportsPlaceholder() || !static_cast<HTMLInputElement*>(node())->formControlValueMatchesRenderer();
+            }
+            if (shouldUpdateValue)
+                setInnerTextValue(inputElement()->value());
+        }
     }
 
     if (m_searchPopupIsVisible)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list