Changeset 143483 in webkit


Ignore:
Timestamp:
Feb 20, 2013 11:51:03 AM (11 years ago)
Author:
robert@webkit.org
Message:

No caret on empty contenteditable element with negative text-indent
https://bugs.webkit.org/show_bug.cgi?id=108633

Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/repaint/paint-caret-in-div-with-negative-indent.html

When an editable element has a negative text indent we won't paint the caret when the
element is empty because it falls outside the element's border box. To ensure the caret is painted,
account for any negative indent with our overflow.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computeOverflow):

LayoutTests:

  • fast/repaint/paint-caret-in-div-with-negative-indent-expected.png: Added.
  • fast/repaint/paint-caret-in-div-with-negative-indent-expected.txt: Added.
  • fast/repaint/paint-caret-in-div-with-negative-indent.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143476 r143483  
     12013-02-20  Robert Hogan  <robert@webkit.org>
     2
     3        No caret on empty contenteditable element with negative text-indent
     4        https://bugs.webkit.org/show_bug.cgi?id=108633
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * fast/repaint/paint-caret-in-div-with-negative-indent-expected.png: Added.
     9        * fast/repaint/paint-caret-in-div-with-negative-indent-expected.txt: Added.
     10        * fast/repaint/paint-caret-in-div-with-negative-indent.html: Added.
     11
    1122013-02-20  Ojan Vafai  <ojan@chromium.org>
    213
  • trunk/Source/WebCore/ChangeLog

    r143479 r143483  
     12013-02-20  Robert Hogan  <robert@webkit.org>
     2
     3        No caret on empty contenteditable element with negative text-indent
     4        https://bugs.webkit.org/show_bug.cgi?id=108633
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Test: fast/repaint/paint-caret-in-div-with-negative-indent.html
     9
     10        When an editable element has a negative text indent we won't paint the caret when the
     11        element is empty because it falls outside the element's border box. To ensure the caret is painted,
     12        account for any negative indent with our overflow.
     13
     14        * rendering/RenderBlock.cpp:
     15        (WebCore::RenderBlock::computeOverflow):
     16
    1172013-02-20  Ojan Vafai  <ojan@chromium.org>
    218
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r143395 r143483  
    17291729    }
    17301730       
     1731    // Allow our overflow to catch cases where the caret in an empty editable element with negative text indent needs to get painted.
     1732    LayoutUnit textIndent = textIndentOffset();
     1733    if (textIndent < 0) {
     1734        LayoutRect clientRect(clientBoxRect());
     1735        LayoutRect rectToApply = LayoutRect(clientRect.x() + min<LayoutUnit>(0, textIndent), clientRect.y(), clientRect.width() - min<LayoutUnit>(0, textIndent), clientRect.height());
     1736        addVisualOverflow(rectToApply);
     1737    }
     1738
    17311739    // Add visual overflow from box-shadow and border-image-outset.
    17321740    addVisualEffectOverflow();
Note: See TracChangeset for help on using the changeset viewer.