Title: [221357] releases/WebKitGTK/webkit-2.18/Source/WebCore
Revision
221357
Author
carlo...@webkit.org
Date
2017-08-30 02:27:32 -0700 (Wed, 30 Aug 2017)

Log Message

Merge r221212 - InlineTextBox::paintDocumentMarker() does not need to special case painting of grammar and
dictation alternatives
https://bugs.webkit.org/show_bug.cgi?id=175966

Reviewed by Tim Horton.

Remove code that forced computing the marker rect for grammar and dictation alternative
regardless of whether the marker spans the entire width of the line box. InlineTextBox::paintDocumentMarker()
has performance optimizations to avoid computing the marker rect if it spans the entire line box.
Prior to r190363 we had to opt out of these optimizations for grammar and dictation alternative
markers so that we could store their computed marker rect. In r190363 we removed the logic in
InlineTextBox::paintDocumentMarker() to store the computed marker rect and hence no longer
needed to opt out of the optimization for these marker types, but inadvertently left in the
conditional code that opts them out.

No functionality changed. So no new tests.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDocumentMarker): Remove unnecessary argument grammar and
code that special cased handling of grammar an dictation alternative markers.
(WebCore::InlineTextBox::paintDocumentMarkers): Update as necessary.
* rendering/InlineTextBox.h:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog (221356 => 221357)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-08-30 09:20:33 UTC (rev 221356)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-08-30 09:27:32 UTC (rev 221357)
@@ -1,3 +1,28 @@
+2017-08-25  Daniel Bates  <daba...@apple.com>
+
+        InlineTextBox::paintDocumentMarker() does not need to special case painting of grammar and
+        dictation alternatives
+        https://bugs.webkit.org/show_bug.cgi?id=175966
+
+        Reviewed by Tim Horton.
+
+        Remove code that forced computing the marker rect for grammar and dictation alternative
+        regardless of whether the marker spans the entire width of the line box. InlineTextBox::paintDocumentMarker()
+        has performance optimizations to avoid computing the marker rect if it spans the entire line box.
+        Prior to r190363 we had to opt out of these optimizations for grammar and dictation alternative
+        markers so that we could store their computed marker rect. In r190363 we removed the logic in
+        InlineTextBox::paintDocumentMarker() to store the computed marker rect and hence no longer
+        needed to opt out of the optimization for these marker types, but inadvertently left in the
+        conditional code that opts them out.
+
+        No functionality changed. So no new tests.
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintDocumentMarker): Remove unnecessary argument grammar and
+        code that special cased handling of grammar an dictation alternative markers.
+        (WebCore::InlineTextBox::paintDocumentMarkers): Update as necessary.
+        * rendering/InlineTextBox.h:
+
 2017-08-25  Miguel Gomez  <mago...@igalia.com>
 
         [GTK] Completely garbled display in Transifex in accelerated compositing mode

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/rendering/InlineTextBox.cpp (221356 => 221357)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/rendering/InlineTextBox.cpp	2017-08-30 09:20:33 UTC (rev 221356)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/rendering/InlineTextBox.cpp	2017-08-30 09:27:32 UTC (rev 221357)
@@ -804,7 +804,7 @@
     }
 }
 
-void InlineTextBox::paintDocumentMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const FontCascade& font, bool grammar)
+void InlineTextBox::paintDocumentMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const FontCascade& font)
 {
     // Never print spelling/grammar markers (5327887)
     if (renderer().document().printing())
@@ -825,8 +825,7 @@
     if (m_truncation != cNoTruncation)
         markerSpansWholeBox = false;
 
-    bool isDictationMarker = marker.type() == DocumentMarker::DictationAlternatives;
-    if (!markerSpansWholeBox || grammar || isDictationMarker) {
+    if (!markerSpansWholeBox) {
         unsigned startPosition = clampedOffset(marker.startOffset());
         unsigned endPosition = clampedOffset(marker.endOffset());
         
@@ -940,15 +939,15 @@
             case DocumentMarker::Spelling:
             case DocumentMarker::CorrectionIndicator:
             case DocumentMarker::DictationAlternatives:
-                paintDocumentMarker(context, boxOrigin, *marker, style, font, false);
+                paintDocumentMarker(context, boxOrigin, *marker, style, font);
                 break;
             case DocumentMarker::Grammar:
-                paintDocumentMarker(context, boxOrigin, *marker, style, font, true);
+                paintDocumentMarker(context, boxOrigin, *marker, style, font);
                 break;
 #if PLATFORM(IOS)
             // FIXME: See <rdar://problem/8933352>. Also, remove the PLATFORM(IOS)-guard.
             case DocumentMarker::DictationPhraseWithAlternatives:
-                paintDocumentMarker(context, boxOrigin, *marker, style, font, true);
+                paintDocumentMarker(context, boxOrigin, *marker, style, font);
                 break;
 #endif
             case DocumentMarker::TextMatch:

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/rendering/InlineTextBox.h (221356 => 221357)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/rendering/InlineTextBox.h	2017-08-30 09:20:33 UTC (rev 221356)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/rendering/InlineTextBox.h	2017-08-30 09:27:32 UTC (rev 221357)
@@ -161,7 +161,7 @@
     void paintDecoration(GraphicsContext&, const FontCascade&, RenderCombineText*, const TextRun&, const FloatPoint& textOrigin, const FloatRect& boxRect,
         TextDecoration, TextPaintStyle, const ShadowData*, const FloatRect& clipOutRect);
     void paintSelection(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const FontCascade&, const Color& textColor);
-    void paintDocumentMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&, bool grammar);
+    void paintDocumentMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&);
     void paintTextMatchMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&);
 
     ExpansionBehavior expansionBehavior() const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to