Changeset 114461 in webkit


Ignore:
Timestamp:
Apr 17, 2012, 4:10:21 PM (13 years ago)
Author:
yi.4.shen@nokia.com
Message:

Caret is not rendered properly inside an input element with text-indent
https://bugs.webkit.org/show_bug.cgi?id=82688

Reviewed by Ryosuke Niwa.

For an empty input element, there is no RenderText. Instead, RenderBlock::localCaretRect provides
the caret position for rendering the caret in the empty input element. To get correct caret rect,
textIndentOffset() should be used to adjust the caret's position.

Source/WebCore:

Test: editing/style/text-indent.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::localCaretRect):

LayoutTests:

  • editing/style/text-indent-expected.txt: Added.
  • editing/style/text-indent.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r114449 r114461  
     12012-04-17  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        Caret is not rendered properly inside an input element with text-indent
     4        https://bugs.webkit.org/show_bug.cgi?id=82688
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        For an empty input element, there is no RenderText. Instead, RenderBlock::localCaretRect provides
     9        the caret position for rendering the caret in the empty input element. To get correct caret rect,
     10        textIndentOffset() should be used to adjust the caret's position.
     11
     12        * editing/style/text-indent-expected.txt: Added.
     13        * editing/style/text-indent.html: Added.
     14
    1152012-04-17  Vincent Scheib  <scheib@chromium.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r114457 r114461  
     12012-04-17  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        Caret is not rendered properly inside an input element with text-indent
     4        https://bugs.webkit.org/show_bug.cgi?id=82688
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        For an empty input element, there is no RenderText. Instead, RenderBlock::localCaretRect provides
     9        the caret position for rendering the caret in the empty input element. To get correct caret rect,
     10        textIndentOffset() should be used to adjust the caret's position.
     11
     12        Test: editing/style/text-indent.html
     13
     14        * rendering/RenderBlock.cpp:
     15        (WebCore::RenderBlock::localCaretRect):
     16
    1172012-04-17  Filip Pizlo  <fpizlo@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r114315 r114461  
    64836483    switch (alignment) {
    64846484        case alignLeft:
     6485            if (currentStyle->isLeftToRightDirection())
     6486                x += textIndentOffset();
    64856487            break;
    64866488        case alignCenter:
    64876489            x = (x + w - (borderRight() + paddingRight())) / 2;
     6490            if (currentStyle->isLeftToRightDirection())
     6491                x += textIndentOffset() / 2;
     6492            else
     6493                x -= textIndentOffset() / 2;
    64886494            break;
    64896495        case alignRight:
    64906496            x = w - (borderRight() + paddingRight()) - caretWidth;
     6497            if (!currentStyle->isLeftToRightDirection())
     6498                x -= textIndentOffset();
    64916499            break;
    64926500    }
     6501    x = min(x, w - borderRight() - paddingRight() - caretWidth);
    64936502
    64946503    if (extraWidthToEndOfLine) {
Note: See TracChangeset for help on using the changeset viewer.