Title: [184293] trunk/Source/WebCore
Revision
184293
Author
[email protected]
Date
2015-05-13 11:56:15 -0700 (Wed, 13 May 2015)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184292 => 184293)


--- trunk/Source/WebCore/ChangeLog	2015-05-13 18:51:46 UTC (rev 184292)
+++ trunk/Source/WebCore/ChangeLog	2015-05-13 18:56:15 UTC (rev 184293)
@@ -1,3 +1,19 @@
+2015-05-12  David Hyatt  <[email protected]>
+
+        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-13  Joseph Pecoraro  <[email protected]>
 
         Pass String as reference in more places

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (184292 => 184293)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2015-05-13 18:51:46 UTC (rev 184292)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2015-05-13 18:56:15 UTC (rev 184293)
@@ -530,14 +530,12 @@
     // 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());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to