Title: [221212] trunk/Source/WebCore
Revision
221212
Author
[email protected]
Date
2017-08-25 16:41:11 -0700 (Fri, 25 Aug 2017)

Log Message

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: trunk/Source/WebCore/ChangeLog (221211 => 221212)


--- trunk/Source/WebCore/ChangeLog	2017-08-25 23:11:25 UTC (rev 221211)
+++ trunk/Source/WebCore/ChangeLog	2017-08-25 23:41:11 UTC (rev 221212)
@@ -1,3 +1,28 @@
+2017-08-25  Daniel Bates  <[email protected]>
+
+        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  Chris Dumez  <[email protected]>
 
         Land stubs for File and Directory Entries API interfaces

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (221211 => 221212)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2017-08-25 23:11:25 UTC (rev 221211)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2017-08-25 23:41:11 UTC (rev 221212)
@@ -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: trunk/Source/WebCore/rendering/InlineTextBox.h (221211 => 221212)


--- trunk/Source/WebCore/rendering/InlineTextBox.h	2017-08-25 23:11:25 UTC (rev 221211)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h	2017-08-25 23:41:11 UTC (rev 221212)
@@ -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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to