Changeset 50851 in webkit


Ignore:
Timestamp:
Nov 11, 2009 5:46:24 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-11 Kent Tamura <tkent@chromium.org>

Reviewed by Darin Adler.

Print the file text of a file upload control in DumpRenderTree for ease of tests.
https://bugs.webkit.org/show_bug.cgi?id=31195

  • platform/mac-leopard/fast/forms/file-input-disabled-expected.txt:
  • platform/mac/fast/forms/box-shadow-override-expected.txt:
  • platform/mac/fast/forms/file-input-direction-expected.txt:
  • platform/mac/fast/forms/file-input-disabled-expected.txt:
  • platform/mac/fast/forms/form-element-geometry-expected.txt:
  • platform/mac/fast/forms/hidden-input-file-expected.txt:
  • platform/mac/fast/forms/input-appearance-height-expected.txt:
  • platform/mac/fast/forms/input-value-expected.txt:
  • platform/win/fast/forms/box-shadow-override-expected.txt:
  • platform/win/fast/forms/file-input-disabled-expected.txt:
  • platform/win/fast/forms/input-appearance-height-expected.txt:
  • platform/win/fast/forms/input-value-expected.txt:

2009-11-11 Kent Tamura <tkent@chromium.org>

Reviewed by Darin Adler.

Print the file text of a file upload control in DumpRenderTree for ease of tests.
https://bugs.webkit.org/show_bug.cgi?id=31195

  • rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): (WebCore::RenderFileUploadControl::fileTextValue):
  • rendering/RenderFileUploadControl.h: (WebCore::RenderFileUploadControl::isFileUploadControl): (WebCore::toRenderFileUploadControl):
  • rendering/RenderObject.h: (WebCore::RenderObject::isFileUploadControl):
  • rendering/RenderTreeAsText.cpp: (WebCore::operator<<):
Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r50845 r50851  
     12009-11-11  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Print the file text of a file upload control in DumpRenderTree for ease of tests.
     6        https://bugs.webkit.org/show_bug.cgi?id=31195
     7
     8        * platform/mac-leopard/fast/forms/file-input-disabled-expected.txt:
     9        * platform/mac/fast/forms/box-shadow-override-expected.txt:
     10        * platform/mac/fast/forms/file-input-direction-expected.txt:
     11        * platform/mac/fast/forms/file-input-disabled-expected.txt:
     12        * platform/mac/fast/forms/form-element-geometry-expected.txt:
     13        * platform/mac/fast/forms/hidden-input-file-expected.txt:
     14        * platform/mac/fast/forms/input-appearance-height-expected.txt:
     15        * platform/mac/fast/forms/input-value-expected.txt:
     16        * platform/win/fast/forms/box-shadow-override-expected.txt:
     17        * platform/win/fast/forms/file-input-disabled-expected.txt:
     18        * platform/win/fast/forms/input-appearance-height-expected.txt:
     19        * platform/win/fast/forms/input-value-expected.txt:
     20
    1212009-11-11  Erik Arvidsson  <arv@chromium.org>
    222
  • trunk/LayoutTests/platform/mac-leopard/fast/forms/file-input-disabled-expected.txt

    r42380 r50851  
    1414          RenderText {#text} at (0,38) size 86x18
    1515            text run at (0,38) width 86: "  Select File:  "
    16           RenderFileUploadControl {INPUT} at (88,39) size 237x18
     16          RenderFileUploadControl {INPUT} at (88,39) size 237x18 "no file selected"
    1717            RenderButton {INPUT} at (0,0) size 78x18 [color=#808080] [bgcolor=#C0C0C0]
    1818              RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/mac/fast/forms/box-shadow-override-expected.txt

    r43007 r50851  
    3939        RenderText {#text} at (177,9) size 4x18
    4040          text run at (177,9) width 4: " "
    41         RenderFileUploadControl {INPUT} at (183,10) size 237x18
     41        RenderFileUploadControl {INPUT} at (183,10) size 237x18 "no file selected"
    4242          RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    4343            RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/mac/fast/forms/file-input-direction-expected.txt

    r30635 r50851  
    2121            RenderTableCell {TH} at (2,36) size 83x2 [r=1 c=0 rs=1 cs=1]
    2222            RenderTableCell {TD} at (87,24) size 245x26 [border: (1px solid #000000)] [r=1 c=1 rs=1 cs=1]
    23               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     23              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    2424                RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    2525                  RenderBlock (anonymous) at (8,2) size 62x13
     
    2727                      text run at (0,0) width 62: "Choose File"
    2828            RenderTableCell {TD} at (334,24) size 245x26 [border: (1px solid #000000)] [r=1 c=2 rs=1 cs=1]
    29               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     29              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    3030                RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    3131                  RenderBlock (anonymous) at (8,2) size 62x13
     
    3333                      text run at (0,0) width 62: "Choose File"
    3434            RenderTableCell {TD} at (581,24) size 245x26 [border: (1px solid #000000)] [r=1 c=3 rs=1 cs=1]
    35               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     35              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    3636                RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    3737                  RenderBlock (anonymous) at (8,2) size 62x13
     
    3939                      text run at (0,0) width 62: "Choose File"
    4040            RenderTableCell {TD} at (828,24) size 245x26 [border: (1px solid #000000)] [r=1 c=4 rs=1 cs=1]
    41               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     41              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    4242                RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    4343                  RenderBlock (anonymous) at (8,2) size 62x13
     
    4949                text run at (1,1) width 81: "direction:ltr"
    5050            RenderTableCell {TD} at (87,52) size 245x26 [border: (1px solid #000000)] [r=2 c=1 rs=1 cs=1]
    51               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     51              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    5252                RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    5353                  RenderBlock (anonymous) at (8,2) size 62x13
     
    5555                      text run at (0,0) width 62: "Choose File"
    5656            RenderTableCell {TD} at (334,52) size 245x26 [border: (1px solid #000000)] [r=2 c=2 rs=1 cs=1]
    57               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     57              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    5858                RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    5959                  RenderBlock (anonymous) at (8,2) size 62x13
     
    6161                      text run at (0,0) width 62: "Choose File"
    6262            RenderTableCell {TD} at (581,52) size 245x26 [border: (1px solid #000000)] [r=2 c=3 rs=1 cs=1]
    63               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     63              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    6464                RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    6565                  RenderBlock (anonymous) at (8,2) size 62x13
     
    6767                      text run at (0,0) width 62: "Choose File"
    6868            RenderTableCell {TD} at (828,52) size 245x26 [border: (1px solid #000000)] [r=2 c=4 rs=1 cs=1]
    69               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     69              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    7070                RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    7171                  RenderBlock (anonymous) at (8,2) size 62x13
     
    7777                text run at (1,1) width 81: "direction:rtl"
    7878            RenderTableCell {TD} at (87,80) size 245x26 [border: (1px solid #000000)] [r=3 c=1 rs=1 cs=1]
    79               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     79              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    8080                RenderButton {INPUT} at (159,0) size 78x18 [bgcolor=#C0C0C0]
    8181                  RenderBlock (anonymous) at (8,2) size 62x13
     
    8383                      text run at (0,0) width 62: "Choose File"
    8484            RenderTableCell {TD} at (334,80) size 245x26 [border: (1px solid #000000)] [r=3 c=2 rs=1 cs=1]
    85               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     85              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    8686                RenderButton {INPUT} at (159,0) size 78x18 [bgcolor=#C0C0C0]
    8787                  RenderBlock (anonymous) at (8,2) size 62x13
     
    8989                      text run at (0,0) width 62: "Choose File"
    9090            RenderTableCell {TD} at (581,80) size 245x26 [border: (1px solid #000000)] [r=3 c=3 rs=1 cs=1]
    91               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     91              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    9292                RenderButton {INPUT} at (159,0) size 78x18 [bgcolor=#C0C0C0]
    9393                  RenderBlock (anonymous) at (8,2) size 62x13
     
    9595                      text run at (0,0) width 62: "Choose File"
    9696            RenderTableCell {TD} at (828,80) size 245x26 [border: (1px solid #000000)] [r=3 c=4 rs=1 cs=1]
    97               RenderFileUploadControl {INPUT} at (4,4) size 237x18
     97              RenderFileUploadControl {INPUT} at (4,4) size 237x18 "no file selected"
    9898                RenderButton {INPUT} at (159,0) size 78x18 [bgcolor=#C0C0C0]
    9999                  RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/mac/fast/forms/file-input-disabled-expected.txt

    r42380 r50851  
    1414          RenderText {#text} at (0,38) size 86x18
    1515            text run at (0,38) width 86: "  Select File:  "
    16           RenderFileUploadControl {INPUT} at (88,39) size 237x18
     16          RenderFileUploadControl {INPUT} at (88,39) size 237x18 "no file selected"
    1717            RenderButton {INPUT} at (0,0) size 78x18 [color=#7F7F7F] [bgcolor=#C0C0C0]
    1818              RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/mac/fast/forms/form-element-geometry-expected.txt

    r47440 r50851  
    101101            RenderTableCell {TD} at (126,2) size 243x24 [r=0 c=2 rs=1 cs=1]
    102102              RenderBlock {DIV} at (1,1) size 241x22 [border: (2px solid #0000FF)]
    103                 RenderFileUploadControl {INPUT} at (2,2) size 237x18
     103                RenderFileUploadControl {INPUT} at (2,2) size 237x18 "no file selected"
    104104                  RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    105105                    RenderBlock (anonymous) at (8,2) size 62x13
     
    179179        RenderText {#text} at (105,22) size 4x18
    180180          text run at (105,22) width 4: " "
    181         RenderFileUploadControl {INPUT} at (111,23) size 237x18
     181        RenderFileUploadControl {INPUT} at (111,23) size 237x18 "no file selected"
    182182          RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    183183            RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/mac/fast/forms/hidden-input-file-expected.txt

    r30635 r50851  
    66      RenderText {#text} at (0,1) size 524x18
    77        text run at (0,1) width 524: "This tests that the whole file input control is hidden when visibility is set to hidden. "
    8       RenderFileUploadControl {INPUT} at (526,2) size 237x18
     8      RenderFileUploadControl {INPUT} at (526,2) size 237x18 "no file selected"
    99        RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    1010          RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-height-expected.txt

    r43007 r50851  
    2828        RenderText {#text} at (0,66) size 24x18
    2929          text run at (0,66) width 24: "file "
    30         RenderFileUploadControl {INPUT} at (26,67) size 237x18
     30        RenderFileUploadControl {INPUT} at (26,67) size 237x18 "no file selected"
    3131          RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    3232            RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/mac/fast/forms/input-value-expected.txt

    r43007 r50851  
    192192                  text run at (1,1) width 204: "file with value property changed"
    193193              RenderTableCell {TD} at (389,318) size 243x24 [r=13 c=1 rs=1 cs=1]
    194                 RenderFileUploadControl {INPUT} at (3,3) size 237x18
     194                RenderFileUploadControl {INPUT} at (3,3) size 237x18 "no file selected"
    195195                  RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    196196                    RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/win/fast/forms/box-shadow-override-expected.txt

    r43007 r50851  
    3939        RenderText {#text} at (177,9) size 4x18
    4040          text run at (177,9) width 4: " "
    41         RenderFileUploadControl {INPUT} at (183,10) size 237x18
     41        RenderFileUploadControl {INPUT} at (183,10) size 237x18 "no file selected"
    4242          RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    4343            RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/win/fast/forms/file-input-disabled-expected.txt

    r42383 r50851  
    1414          RenderText {#text} at (0,38) size 86x18
    1515            text run at (0,38) width 86: "  Select File:  "
    16           RenderFileUploadControl {INPUT} at (88,39) size 237x18
     16          RenderFileUploadControl {INPUT} at (88,39) size 237x18 "no file selected"
    1717            RenderButton {INPUT} at (0,0) size 78x18 [color=#808080] [bgcolor=#C0C0C0]
    1818              RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/win/fast/forms/input-appearance-height-expected.txt

    r43007 r50851  
    2828        RenderText {#text} at (0,66) size 24x18
    2929          text run at (0,66) width 24: "file "
    30         RenderFileUploadControl {INPUT} at (26,67) size 237x18
     30        RenderFileUploadControl {INPUT} at (26,67) size 237x18 "no file selected"
    3131          RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    3232            RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/LayoutTests/platform/win/fast/forms/input-value-expected.txt

    r43007 r50851  
    192192                  text run at (1,1) width 204: "file with value property changed"
    193193              RenderTableCell {TD} at (389,318) size 243x24 [r=13 c=1 rs=1 cs=1]
    194                 RenderFileUploadControl {INPUT} at (3,3) size 237x18
     194                RenderFileUploadControl {INPUT} at (3,3) size 237x18 "no file selected"
    195195                  RenderButton {INPUT} at (0,0) size 78x18 [bgcolor=#C0C0C0]
    196196                    RenderBlock (anonymous) at (8,2) size 62x13
  • trunk/WebCore/ChangeLog

    r50850 r50851  
     12009-11-11  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Print the file text of a file upload control in DumpRenderTree for ease of tests.
     6        https://bugs.webkit.org/show_bug.cgi?id=31195
     7
     8        * rendering/RenderFileUploadControl.cpp:
     9        (WebCore::RenderFileUploadControl::paintObject):
     10        (WebCore::RenderFileUploadControl::fileTextValue):
     11        * rendering/RenderFileUploadControl.h:
     12        (WebCore::RenderFileUploadControl::isFileUploadControl):
     13        (WebCore::toRenderFileUploadControl):
     14        * rendering/RenderObject.h:
     15        (WebCore::RenderObject::isFileUploadControl):
     16        * rendering/RenderTreeAsText.cpp:
     17        (WebCore::operator<<):
     18
    1192009-11-11  Gavin Barraclough  <barraclough@apple.com>
    220
  • trunk/WebCore/rendering/RenderFileUploadControl.cpp

    r50760 r50851  
    188188
    189189    if (paintInfo.phase == PaintPhaseForeground) {
    190         const String& displayedFilename = m_fileChooser->basenameForWidth(style()->font(), maxFilenameWidth());       
     190        const String& displayedFilename = fileTextValue();
    191191        unsigned length = displayedFilename.length();
    192192        const UChar* string = displayedFilename.characters();
     
    288288}
    289289
    290 String RenderFileUploadControl::fileTextValue()
     290String RenderFileUploadControl::fileTextValue() const
    291291{
    292292    return m_fileChooser->basenameForWidth(style()->font(), maxFilenameWidth());
  • trunk/WebCore/rendering/RenderFileUploadControl.h

    r46815 r50851  
    3838    virtual ~RenderFileUploadControl();
    3939
     40    virtual bool isFileUploadControl() const { return true; }
     41
    4042    void click();
    4143
     
    4547
    4648    String buttonValue();
    47     String fileTextValue();
     49    String fileTextValue() const;
    4850   
    4951    bool allowsMultipleFiles();
     
    6769inline RenderFileUploadControl* toRenderFileUploadControl(RenderObject* object)
    6870{
    69     ASSERT(!object || !strcmp(object->renderName(), "RenderFileUploadControl"));
     71    ASSERT(!object || object->isFileUploadControl());
    7072    return static_cast<RenderFileUploadControl*>(object);
     73}
     74
     75inline const RenderFileUploadControl* toRenderFileUploadControl(const RenderObject* object)
     76{
     77    ASSERT(!object || object->isFileUploadControl());
     78    return static_cast<const RenderFileUploadControl*>(object);
    7179}
    7280
  • trunk/WebCore/rendering/RenderObject.h

    r50397 r50851  
    254254    virtual bool isCounter() const { return false; }
    255255    virtual bool isFieldset() const { return false; }
     256    virtual bool isFileUploadControl() const { return false; }
    256257    virtual bool isFrame() const { return false; }
    257258    virtual bool isFrameSet() const { return false; }
  • trunk/WebCore/rendering/RenderTreeAsText.cpp

    r50345 r50851  
    3737#include "InlineTextBox.h"
    3838#include "RenderBR.h"
     39#include "RenderFileUploadControl.h"
    3940#include "RenderInline.h"
    4041#include "RenderListMarker.h"
     
    218219
    219220    if (!(o.isText() && !o.isBR())) {
     221        if (o.isFileUploadControl()) {
     222            ts << " " << quoteAndEscapeNonPrintables(toRenderFileUploadControl(&o)->fileTextValue());
     223        }
    220224        if (o.parent() && (o.parent()->style()->color() != o.style()->color()))
    221225            ts << " [color=" << o.style()->color().name() << "]";
Note: See TracChangeset for help on using the changeset viewer.