Changeset 199304 in webkit


Ignore:
Timestamp:
Apr 11, 2016 12:31:12 PM (8 years ago)
Author:
Alan Bujtas
Message:

REGRESSION (r193857): Text selection causes text to disappear.
https://bugs.webkit.org/show_bug.cgi?id=156448
rdar://problem/25578952

Reviewed by Simon Fraser.

Apparently when the end position of the selection range is smaller than the start position, we need
to repaint the entire text as it indicates selection clearing.

Source/WebCore:

Test: fast/text/text-disappear-on-deselect.html

  • rendering/TextPainter.cpp:

(WebCore::TextPainter::paintText):

LayoutTests:

  • fast/text/text-disappear-on-deselect-expected.html: Added.
  • fast/text/text-disappear-on-deselect.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199296 r199304  
     12016-04-11  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION (r193857): Text selection causes text to disappear.
     4        https://bugs.webkit.org/show_bug.cgi?id=156448
     5        rdar://problem/25578952
     6
     7        Reviewed by Simon Fraser.
     8
     9        Apparently when the end position of the selection range is smaller than the start position, we need
     10        to repaint the entire text as it indicates selection clearing.
     11
     12        * fast/text/text-disappear-on-deselect-expected.html: Added.
     13        * fast/text/text-disappear-on-deselect.html: Added.
     14
    1152016-04-11  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r199295 r199304  
    246246fast/scrolling/scroll-animator-select-list-events.html [ Skip ]
    247247fast/events/prevent-default-prevents-interaction-with-scrollbars.html [ Skip ]
     248fast/text/text-disappear-on-deselect.html [ ImageOnlyFailure ]
     249
    248250
    249251webkit.org/b/148695 fast/shadow-dom [ Pass ]
  • trunk/Source/WebCore/ChangeLog

    r199299 r199304  
     12016-04-11  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION (r193857): Text selection causes text to disappear.
     4        https://bugs.webkit.org/show_bug.cgi?id=156448
     5        rdar://problem/25578952
     6
     7        Reviewed by Simon Fraser.
     8
     9        Apparently when the end position of the selection range is smaller than the start position, we need
     10        to repaint the entire text as it indicates selection clearing.
     11
     12        Test: fast/text/text-disappear-on-deselect.html
     13
     14        * rendering/TextPainter.cpp:
     15        (WebCore::TextPainter::paintText):
     16
    1172016-04-05  Oliver Hunt  <oliver@apple.com>
    218
  • trunk/Source/WebCore/rendering/TextPainter.cpp

    r193929 r199304  
    155155        GraphicsContextStateSaver stateSaver(m_context, m_textPaintStyle.strokeWidth > 0);
    156156        updateGraphicsContext(m_context, m_textPaintStyle);
    157         if (paintSelectedTextSeparately) {
     157        bool fullPaint = !paintSelectedTextSeparately || selectionEnd <= selectionStart;
     158        if (fullPaint)
     159            paintTextAndEmphasisMarksIfNeeded(textRun, boxRect, textOrigin, 0, length, m_textPaintStyle, m_textShadow);
     160        else {
    158161            // Paint the before and after selection parts.
    159162            if (selectionStart > 0)
     
    161164            if (selectionEnd < length)
    162165                paintTextAndEmphasisMarksIfNeeded(textRun, boxRect, textOrigin, selectionEnd, length, m_textPaintStyle, m_textShadow);
    163         } else
    164             paintTextAndEmphasisMarksIfNeeded(textRun, boxRect, textOrigin, 0, length, m_textPaintStyle, m_textShadow);
     166        }
    165167    }
    166 
    167168    // Paint only the text that is selected.
    168169    if ((paintSelectedTextOnly || paintSelectedTextSeparately) && selectionStart < selectionEnd) {
Note: See TracChangeset for help on using the changeset viewer.