Skip to content

Commit

Permalink
Merge r184293 - Don't compute selection painting info when we don't h…
Browse files Browse the repository at this point in the history
…ave selection.

https://bugs.webkit.org/show_bug.cgi?id=144920
<rdar://problem/20919920>

Reviewed by Simon Fraser.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):

Just set the selection paint style to the text paint style when we don't have a selection
at all. Computing the selection style takes time in the case where a ::selection pseudo is
used on the page, so we don't want to waste time computing that info unless it's actually
needed.
  • Loading branch information
David Hyatt authored and carlosgcampos committed May 15, 2015
1 parent 616d42f commit fabdced
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
16 changes: 16 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
2015-05-12 David Hyatt <hyatt@apple.com>

Don't compute selection painting info when we don't have selection.
https://bugs.webkit.org/show_bug.cgi?id=144920
<rdar://problem/20919920>

Reviewed by Simon Fraser.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):

Just set the selection paint style to the text paint style when we don't have a selection
at all. Computing the selection style takes time in the case where a ::selection pseudo is
used on the page, so we don't want to waste time computing that info unless it's actually
needed.

2015-05-12 Zalan Bujtas <zalan@apple.com>

REGRESSION(r175617): Some text doesn't render on internationalculinarycenter.com
Expand Down
12 changes: 5 additions & 7 deletions Source/WebCore/rendering/InlineTextBox.cpp
Expand Up @@ -529,14 +529,12 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
// Determine the text colors and selection colors.
TextPaintStyle textPaintStyle = computeTextPaintStyle(renderer().frame(), lineStyle, paintInfo);

bool paintSelectedTextOnly;
bool paintSelectedTextSeparately;
const ShadowData* selectionShadow;
TextPaintStyle selectionPaintStyle = computeTextSelectionPaintStyle(textPaintStyle, renderer(), lineStyle, paintInfo, paintSelectedTextOnly, paintSelectedTextSeparately, selectionShadow);

bool paintSelectedTextOnly = false;
bool paintSelectedTextSeparately = false;
const ShadowData* selectionShadow = nullptr;

// Text with custom underlines does not have selection background painted, so selection paint style is not appropriate for it.
if (useCustomUnderlines)
selectionPaintStyle = textPaintStyle;
TextPaintStyle selectionPaintStyle = haveSelection && !useCustomUnderlines ? computeTextSelectionPaintStyle(textPaintStyle, renderer(), lineStyle, paintInfo, paintSelectedTextOnly, paintSelectedTextSeparately, selectionShadow) : textPaintStyle;

// Set our font.
const FontCascade& font = fontToUse(lineStyle, renderer());
Expand Down

0 comments on commit fabdced

Please sign in to comment.