Changeset 85560 in webkit


Ignore:
Timestamp:
May 2, 2011 5:20:46 PM (13 years ago)
Author:
Joseph Pecoraro
Message:

2011-05-02 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by David Kilzer.

Respect fixed text-indent on ::-webkit-input-placeholder
https://bugs.webkit.org/show_bug.cgi?id=59825

Placeholder text does not appear in the render tree
dumps, so this is a pixel test for the position of
the placeholder affected by text-indent.

  • fast/forms/input-placeholder-text-indent.html: Added.
  • platform/mac/fast/forms/input-placeholder-text-indent-expected.png: Added.
  • platform/mac/fast/forms/input-placeholder-text-indent-expected.txt: Added.

2011-05-02 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by David Kilzer.

Respect fixed text-indent on ::-webkit-input-placeholder
https://bugs.webkit.org/show_bug.cgi?id=59825

Test: fast/forms/input-placeholder-text-indent.html

  • rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::paintPlaceholder): indent by a fixed text-indent size specified on the placeholder style.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85556 r85560  
     12011-05-02  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Respect fixed text-indent on ::-webkit-input-placeholder
     6        https://bugs.webkit.org/show_bug.cgi?id=59825
     7
     8        Placeholder text does not appear in the render tree
     9        dumps, so this is a pixel test for the position of
     10        the placeholder affected by text-indent.
     11
     12        * fast/forms/input-placeholder-text-indent.html: Added.
     13        * platform/mac/fast/forms/input-placeholder-text-indent-expected.png: Added.
     14        * platform/mac/fast/forms/input-placeholder-text-indent-expected.txt: Added.
     15
    1162011-05-02  Eric Uhrhane  <ericu@chromium.org>
    217
  • trunk/Source/WebCore/ChangeLog

    r85556 r85560  
     12011-05-02  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Respect fixed text-indent on ::-webkit-input-placeholder
     6        https://bugs.webkit.org/show_bug.cgi?id=59825
     7
     8        Test: fast/forms/input-placeholder-text-indent.html
     9
     10        * rendering/RenderTextControl.cpp:
     11        (WebCore::RenderTextControl::paintPlaceholder): indent by
     12        a fixed text-indent size specified on the placeholder style.
     13
    1142011-05-02  Eric Uhrhane  <ericu@chromium.org>
    215
  • trunk/Source/WebCore/rendering/RenderTextControl.cpp

    r85143 r85560  
    643643        IntPoint textPoint;
    644644        textPoint.setY(ty + textBlockInsetTop() + placeholderStyle->fontMetrics().ascent());
     645        int styleTextIndent = placeholderStyle->textIndent().isFixed() ? placeholderStyle->textIndent().calcMinValue(0) : 0;
    645646        if (placeholderStyle->isLeftToRightDirection())
    646             textPoint.setX(tx + textBlockInsetLeft());
     647            textPoint.setX(tx + styleTextIndent + textBlockInsetLeft());
    647648        else
    648             textPoint.setX(tx + width() - textBlockInsetRight() - style()->font().width(textRun));
     649            textPoint.setX(tx + width() - textBlockInsetRight() - styleTextIndent - style()->font().width(textRun));
    649650       
    650651        paintInfo.context->drawBidiText(placeholderStyle->font(), textRun, textPoint);
Note: See TracChangeset for help on using the changeset viewer.