Title: [231725] trunk/Source/WebCore
Revision
231725
Author
[email protected]
Date
2018-05-11 16:01:37 -0700 (Fri, 11 May 2018)

Log Message

[iOS] Text decoration of dragged content does not paint with opacity
https://bugs.webkit.org/show_bug.cgi?id=185551
<rdar://problem/40166867>

Reviewed by Wenson Hsieh.

Respect alpha when painting the text decoration for dragged content.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Consider alpha when
comparing decoration styles for equality so that we do not coalesce styles with differing alpha.
(WebCore::InlineTextBox::paintMarkedTextDecoration): Respect alpha when painting dragged content.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (231724 => 231725)


--- trunk/Source/WebCore/ChangeLog	2018-05-11 22:47:19 UTC (rev 231724)
+++ trunk/Source/WebCore/ChangeLog	2018-05-11 23:01:37 UTC (rev 231725)
@@ -1,3 +1,18 @@
+2018-05-11  Daniel Bates  <[email protected]>
+
+        [iOS] Text decoration of dragged content does not paint with opacity
+        https://bugs.webkit.org/show_bug.cgi?id=185551
+        <rdar://problem/40166867>
+
+        Reviewed by Wenson Hsieh.
+
+        Respect alpha when painting the text decoration for dragged content.
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Consider alpha when
+        comparing decoration styles for equality so that we do not coalesce styles with differing alpha.
+        (WebCore::InlineTextBox::paintMarkedTextDecoration): Respect alpha when painting dragged content.
+
 2018-05-11  Nan Wang  <[email protected]>
 
         AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (231724 => 231725)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2018-05-11 22:47:19 UTC (rev 231724)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2018-05-11 23:01:37 UTC (rev 231725)
@@ -403,7 +403,7 @@
     }
     static bool areDecorationMarkedTextStylesEqual(const MarkedTextStyle& a, const MarkedTextStyle& b)
     {
-        return a.textDecorationStyles == b.textDecorationStyles && a.textShadow == b.textShadow;
+        return a.textDecorationStyles == b.textDecorationStyles && a.textShadow == b.textShadow && a.alpha == b.alpha;
     }
 
     Color backgroundColor;
@@ -1075,9 +1075,13 @@
 
     {
         GraphicsContextStateSaver stateSaver { context, false };
-        if (!clipOutRect.isEmpty()) {
+        bool isDraggedContent = markedText.type == MarkedText::DraggedContent;
+        if (isDraggedContent || !clipOutRect.isEmpty()) {
             stateSaver.save();
-            context.clipOut(clipOutRect);
+            if (isDraggedContent)
+                context.setAlpha(markedText.style.alpha);
+            if (!clipOutRect.isEmpty())
+                context.clipOut(clipOutRect);
         }
         decorationPainter.paintTextDecoration(textRun.subRun(startOffset, endOffset - startOffset), textOriginFromBoxRect(snappedSelectionRect), snappedSelectionRect.location());
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to