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

adele at apple.com adele at apple.com
Wed Dec 22 18:14:31 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 39f77baec4599780c3040e06310c0bd8691d1d7c
Author: adele at apple.com <adele at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 9 01:36:04 2010 +0000

    WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=50725
    <rdar://problem/8694972> REGRESSION (r72052): "Search" placeholder in MobileMe mail is positioned too high
    
    Reviewed by Darin Adler.
    
    Test: fast/forms/placeholder-position.html
    
    Since we center the inner text element for single line text controls,
    we should ask the subclass to give us the y offset instead of trying to calculate it in the RenderTextControl class.
    
    * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::paintPlaceholder):
    * rendering/RenderTextControl.h:
    * rendering/RenderTextControlMultiLine.cpp: (WebCore::RenderTextControlMultiLine::textBlockInsetTop):
    * rendering/RenderTextControlMultiLine.h:
    * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::textBlockInsetTop):
    * rendering/RenderTextControlSingleLine.h:
    
    LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=50725
    <rdar://problem/8694972> REGRESSION (r72052): "Search" placeholder in MobileMe mail is positioned too high
    
    Reviewed by Darin Adler.
    
    * fast/forms/placeholder-position.html: Added.
    * platform/mac/fast/forms/placeholder-position-expected.checksum: Added.
    * platform/mac/fast/forms/placeholder-position-expected.png: Added.
    * platform/mac/fast/forms/placeholder-position-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73572 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f7a2f68..3cb9146 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-08  Adele Peterson  <adele at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Test for https://bugs.webkit.org/show_bug.cgi?id=50725
+        <rdar://problem/8694972> REGRESSION (r72052): "Search" placeholder in MobileMe mail is positioned too high
+
+        * fast/forms/placeholder-position.html: Added.
+        * platform/mac/fast/forms/placeholder-position-expected.checksum: Added.
+        * platform/mac/fast/forms/placeholder-position-expected.png: Added.
+        * platform/mac/fast/forms/placeholder-position-expected.txt: Added.
+
 2010-12-08  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/fast/forms/placeholder-position.html b/LayoutTests/fast/forms/placeholder-position.html
new file mode 100644
index 0000000..a8aa9d9
--- /dev/null
+++ b/LayoutTests/fast/forms/placeholder-position.html
@@ -0,0 +1,9 @@
+<!-- This tests that the placeholder is positioned correctly in different kinds of elements -->
+<input  type="search" placeholder="placeholder"><br>
+<input  type="text" placeholder="placeholder"><br>
+<input  type="search" placeholder="placeholder" style="direction: rtl"><br>
+<textarea placeholder="placeholder"></textarea><br>
+<input type="text" placeholder="placeholder" style="padding-bottom: 15px;"><br>
+<textarea placeholder="placeholder" style="padding-top: 15px;"></textarea><br>
+<input  type="text" placeholder="placeholder" style="font-size: 15px; border: solid 5px black; margin: 5px;"><br>
+<input type="text" placeholder="placeholder" style="padding-top: 15px; -webkit-transform: translateY(30px) rotateZ(30deg)"><br>
diff --git a/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.checksum b/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.checksum
new file mode 100644
index 0000000..cae5aee
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.checksum
@@ -0,0 +1 @@
+97c8812ffb94ad7391bb2135559b2a9f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.png b/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.png
new file mode 100644
index 0000000..190aeaa
Binary files /dev/null and b/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt b/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt
new file mode 100644
index 0000000..cd26c22
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.txt
@@ -0,0 +1,44 @@
+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
+      RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+        RenderBlock {DIV} at (3,3) size 119x13
+          RenderBlock {DIV} at (0,0) size 8x11
+          RenderBlock {DIV} at (106,0) size 13x11
+      RenderBR {BR} at (129,16) size 0x0
+      RenderTextControl {INPUT} at (2,25) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderBR {BR} at (129,39) size 0x0
+      RenderTextControl {INPUT} at (2,48) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+        RenderBlock {DIV} at (3,3) size 119x13
+          RenderBlock {DIV} at (0,0) size 8x11
+          RenderBlock {DIV} at (106,0) size 13x11
+      RenderBR {BR} at (129,62) size 0x0
+      RenderBR {BR} at (165,105) size 0x0
+      RenderTextControl {INPUT} at (2,107) size 125x33 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderBR {BR} at (129,142) size 0x0
+      RenderBR {BR} at (165,191) size 0x0
+      RenderTextControl {INPUT} at (5,196) size 176x30 [bgcolor=#FFFFFF] [border: (5px solid #000000)]
+      RenderBR {BR} at (186,217) size 0x0
+      RenderBR {BR} at (129,254) size 0x0
+layer at (21,13) size 98x13
+  RenderBlock {DIV} at (8,0) size 98x13
+layer at (13,36) size 119x13
+  RenderBlock {DIV} at (3,3) size 119x13
+layer at (21,59) size 98x13
+  RenderBlock {DIV} at (8,0) size 98x13
+layer at (10,79) size 161x32 clip at (11,80) size 159x30
+  RenderTextControl {TEXTAREA} at (2,71) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
+    RenderBlock {DIV} at (3,3) size 155x13
+layer at (13,125) size 119x13
+  RenderBlock {DIV} at (3,10) size 119x13
+layer at (10,152) size 161x45 clip at (11,153) size 159x43
+  RenderTextControl {TEXTAREA} at (2,144) size 161x45 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
+    RenderBlock {DIV} at (3,16) size 155x13
+layer at (19,210) size 164x18
+  RenderBlock {DIV} at (6,6) size 164x18
+layer at (10,241) size 125x33
+  RenderTextControl {INPUT} at (2,233) size 125x33 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+layer at (13,251) size 119x13
+  RenderBlock {DIV} at (3,10) size 119x13
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f133fc9..f498138 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-12-08  Adele Peterson  <adele at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=50725
+        <rdar://problem/8694972> REGRESSION (r72052): "Search" placeholder in MobileMe mail is positioned too high
+
+        Test: fast/forms/placeholder-position.html
+
+        Since we center the inner text element for single line text controls, 
+        we should ask the subclass to give us the y offset instead of trying to calculate it in the RenderTextControl class.
+
+        * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::paintPlaceholder):
+        * rendering/RenderTextControl.h:
+        * rendering/RenderTextControlMultiLine.cpp: (WebCore::RenderTextControlMultiLine::textBlockInsetTop):
+        * rendering/RenderTextControlMultiLine.h:
+        * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::textBlockInsetTop):
+        * rendering/RenderTextControlSingleLine.h:
+
 2010-12-08  Chris Rogers  <crogers at google.com>
 
         Reviewed by Kenneth Russell.
diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp
index 2040f10..0192ee4 100644
--- a/WebCore/rendering/RenderTextControl.cpp
+++ b/WebCore/rendering/RenderTextControl.cpp
@@ -607,7 +607,7 @@ void RenderTextControl::paintPlaceholder(PaintInfo& paintInfo, int tx, int ty)
     RenderBox* textRenderer = innerTextElement() ? innerTextElement()->renderBox() : 0;
     if (textRenderer) {
         IntPoint textPoint;
-        textPoint.setY(ty + borderTop() + paddingTop() + textRenderer->paddingTop() + placeholderStyle->font().ascent());
+        textPoint.setY(ty + textBlockInsetTop() + placeholderStyle->font().ascent());
         if (placeholderStyle->isLeftToRightDirection())
             textPoint.setX(tx + textBlockInsetLeft());
         else
diff --git a/WebCore/rendering/RenderTextControl.h b/WebCore/rendering/RenderTextControl.h
index 4b1d6e3..fdb7fdc 100644
--- a/WebCore/rendering/RenderTextControl.h
+++ b/WebCore/rendering/RenderTextControl.h
@@ -112,6 +112,7 @@ private:
     
     virtual int textBlockInsetLeft() const = 0;
     virtual int textBlockInsetRight() const = 0;
+    virtual int textBlockInsetTop() const = 0;
 
     void paintPlaceholder(PaintInfo&, int tx, int ty);
 
diff --git a/WebCore/rendering/RenderTextControlMultiLine.cpp b/WebCore/rendering/RenderTextControlMultiLine.cpp
index 2014830..3e3ad41 100644
--- a/WebCore/rendering/RenderTextControlMultiLine.cpp
+++ b/WebCore/rendering/RenderTextControlMultiLine.cpp
@@ -147,4 +147,14 @@ int RenderTextControlMultiLine::textBlockInsetRight() const
     return inset;
 }
 
+int RenderTextControlMultiLine::textBlockInsetTop() const
+{
+    int inset = borderTop() + paddingTop();
+    if (HTMLElement* innerText = innerTextElement()) {
+        if (RenderBox* innerTextRenderer = innerText->renderBox())
+            inset += innerTextRenderer->paddingTop();
+    }
+    return inset;
+}
+    
 }
diff --git a/WebCore/rendering/RenderTextControlMultiLine.h b/WebCore/rendering/RenderTextControlMultiLine.h
index 6dc2032..0bb8c8f 100644
--- a/WebCore/rendering/RenderTextControlMultiLine.h
+++ b/WebCore/rendering/RenderTextControlMultiLine.h
@@ -52,6 +52,7 @@ private:
     virtual PassRefPtr<RenderStyle> createInnerTextStyle(const RenderStyle* startStyle) const;
     virtual int textBlockInsetLeft() const;
     virtual int textBlockInsetRight() const;
+    virtual int textBlockInsetTop() const;
 };
 
 inline RenderTextControlMultiLine* toRenderTextControlMultiLine(RenderObject* object)
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index 2df96a2..01b9f28 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -1120,4 +1120,18 @@ int RenderTextControlSingleLine::textBlockInsetRight() const
     return inset;
 }
 
+int RenderTextControlSingleLine::textBlockInsetTop() const
+{
+    RenderBox* innerRenderer = 0;
+    if (m_innerBlock)
+        innerRenderer = m_innerBlock->renderBox();
+    else if (HTMLElement* innerText = innerTextElement())
+        innerRenderer = innerText->renderBox();
+    
+    if (innerRenderer)
+        return innerRenderer->y();
+    
+    return borderTop() + paddingTop();
+}    
+
 }
diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h
index d51d7f3..3dd25ef 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/WebCore/rendering/RenderTextControlSingleLine.h
@@ -149,6 +149,7 @@ private:
 
     virtual int textBlockInsetLeft() const;
     virtual int textBlockInsetRight() const;
+    virtual int textBlockInsetTop() const;
 
     bool m_searchPopupIsVisible;
     bool m_shouldDrawCapsLockIndicator;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list