Title: [233135] trunk
Revision
233135
Author
[email protected]
Date
2018-06-24 18:52:59 -0700 (Sun, 24 Jun 2018)

Log Message

Fix the composition underline to be transformed by -apple-color-filter
https://bugs.webkit.org/show_bug.cgi?id=186983
rdar://problem/40515558

Reviewed by Zalan Bujtas.

Source/WebCore:

Transform the composition underline color with the color filter.

Test: css3/color-filters/color-filter-composition-underline-color.html

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintCompositionUnderline const):

LayoutTests:

* css3/color-filters/color-filter-composition-underline-color-expected.html: Added.
* css3/color-filters/color-filter-composition-underline-color.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (233134 => 233135)


--- trunk/LayoutTests/ChangeLog	2018-06-24 19:01:22 UTC (rev 233134)
+++ trunk/LayoutTests/ChangeLog	2018-06-25 01:52:59 UTC (rev 233135)
@@ -1,3 +1,14 @@
+2018-06-24  Simon Fraser  <[email protected]>
+
+        Fix the composition underline to be transformed by -apple-color-filter
+        https://bugs.webkit.org/show_bug.cgi?id=186983
+        rdar://problem/40515558
+
+        Reviewed by Zalan Bujtas.
+        
+        * css3/color-filters/color-filter-composition-underline-color-expected.html: Added.
+        * css3/color-filters/color-filter-composition-underline-color.html: Added.
+
 2018-06-23  Zalan Bujtas  <[email protected]>
 
         [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units

Added: trunk/LayoutTests/css3/color-filters/color-filter-composition-underline-color-expected.html (0 => 233135)


--- trunk/LayoutTests/css3/color-filters/color-filter-composition-underline-color-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/color-filters/color-filter-composition-underline-color-expected.html	2018-06-25 01:52:59 UTC (rev 233135)
@@ -0,0 +1,33 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableColorFilter=true ] -->
+<style>
+    div {
+        position: absolute;
+        top: 0;
+        left: 0;
+    }
+    #test {
+        color: green;
+        font: 20px/1 Monospace;
+        outline: none;
+    }
+    #overlapping-top {
+        background: white;
+        width: 100px;
+        height: 15px;
+    }
+    #overlapping-right {
+        background: white;
+        width: 50px;
+        height: 50px;
+        left: 50px;
+    }
+</style>
+<div contenteditable id="test"></div>
+<!-- The overlapping DIVs are hiding the "^^^^^" characters and the caret to show only the composition underline. -->
+<div id="overlapping-top"></div>
+<div id="overlapping-right"></div>
+<script>
+    document.getElementById("test").focus();
+    if (window.textInputController)
+        textInputController.setMarkedText("^^^^^", 5, 0);
+</script>

Added: trunk/LayoutTests/css3/color-filters/color-filter-composition-underline-color.html (0 => 233135)


--- trunk/LayoutTests/css3/color-filters/color-filter-composition-underline-color.html	                        (rev 0)
+++ trunk/LayoutTests/css3/color-filters/color-filter-composition-underline-color.html	2018-06-25 01:52:59 UTC (rev 233135)
@@ -0,0 +1,34 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableColorFilter=true ] -->
+<style>
+    div {
+        position: absolute;
+        top: 0;
+        left: 0;
+    }
+    #test {
+        color: rgb(255, 128, 255);
+        font: 20px/1 Monospace;
+        outline: none;
+        -apple-color-filter: invert(1);
+    }
+    #overlapping-top {
+        background: white;
+        width: 100px;
+        height: 15px;
+    }
+    #overlapping-right {
+        background: white;
+        width: 50px;
+        height: 50px;
+        left: 50px;
+    }
+</style>
+<div contenteditable id="test"></div>
+<!-- The overlapping DIVs are hiding the "^^^^^" characters and the caret to show only the composition underline. -->
+<div id="overlapping-top"></div>
+<div id="overlapping-right"></div>
+<script>
+    document.getElementById("test").focus();
+    if (window.textInputController)
+        textInputController.setMarkedText("^^^^^", 5, 0);
+</script>

Modified: trunk/Source/WebCore/ChangeLog (233134 => 233135)


--- trunk/Source/WebCore/ChangeLog	2018-06-24 19:01:22 UTC (rev 233134)
+++ trunk/Source/WebCore/ChangeLog	2018-06-25 01:52:59 UTC (rev 233135)
@@ -1,3 +1,18 @@
+2018-06-24  Simon Fraser  <[email protected]>
+
+        Fix the composition underline to be transformed by -apple-color-filter
+        https://bugs.webkit.org/show_bug.cgi?id=186983
+        rdar://problem/40515558
+
+        Reviewed by Zalan Bujtas.
+        
+        Transform the composition underline color with the color filter.
+
+        Test: css3/color-filters/color-filter-composition-underline-color.html
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintCompositionUnderline const):
+
 2018-06-23  Zalan Bujtas  <[email protected]>
 
         [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (233134 => 233135)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2018-06-24 19:01:22 UTC (rev 233134)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2018-06-25 01:52:59 UTC (rev 233135)
@@ -1168,7 +1168,8 @@
     width -= 2;
 
     GraphicsContext& context = paintInfo.context();
-    context.setStrokeColor(underline.compositionUnderlineColor == CompositionUnderlineColor::TextColor ? renderer().style().visitedDependentColorWithColorFilter(CSSPropertyWebkitTextFillColor) : underline.color);
+    Color underlineColor = underline.compositionUnderlineColor == CompositionUnderlineColor::TextColor ? renderer().style().visitedDependentColorWithColorFilter(CSSPropertyWebkitTextFillColor) : renderer().style().colorByApplyingColorFilter(underline.color);
+    context.setStrokeColor(underlineColor);
     context.setStrokeThickness(lineThickness);
     context.drawLineForText(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + logicalHeight() - lineThickness), width, renderer().document().printing());
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to