Title: [234356] branches/safari-606-branch
Revision
234356
Author
[email protected]
Date
2018-07-29 23:28:23 -0700 (Sun, 29 Jul 2018)

Log Message

Cherry-pick r234340. rdar://problem/42721208

    Adjust the color matrix for the inverse apple-invert-lightness() transformation
    https://bugs.webkit.org/show_bug.cgi?id=188131
    rdar://problem/42673070

    Reviewed by Zalan Bujtas.

    Source/WebCore:

    Use the correct inverse matrix values.

    Test: editing/style/inverse-color-filter.html

    * platform/graphics/filters/FilterOperation.cpp:
    (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):

    LayoutTests:

    Rebaseline tests that use the filter inversion. Add a new test that does inversion
    for a whole range of colors, to get good coverage of the inversion matrix.

    * editing/style/inverse-color-filter-expected.txt: Added.
    * editing/style/inverse-color-filter.html: Added.
    * editing/style/set-backColor-with-color-filter-expected.txt:
    * editing/style/set-foreColor-with-color-filter-expected.txt:
    * platform/win/TestExpectations:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234340 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-606-branch/LayoutTests/ChangeLog (234355 => 234356)


--- branches/safari-606-branch/LayoutTests/ChangeLog	2018-07-30 06:28:19 UTC (rev 234355)
+++ branches/safari-606-branch/LayoutTests/ChangeLog	2018-07-30 06:28:23 UTC (rev 234356)
@@ -1,5 +1,54 @@
 2018-07-29  Babak Shafiei  <[email protected]>
 
+        Cherry-pick r234340. rdar://problem/42721208
+
+    Adjust the color matrix for the inverse apple-invert-lightness() transformation
+    https://bugs.webkit.org/show_bug.cgi?id=188131
+    rdar://problem/42673070
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Use the correct inverse matrix values.
+    
+    Test: editing/style/inverse-color-filter.html
+    
+    * platform/graphics/filters/FilterOperation.cpp:
+    (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
+    
+    LayoutTests:
+    
+    Rebaseline tests that use the filter inversion. Add a new test that does inversion
+    for a whole range of colors, to get good coverage of the inversion matrix.
+    
+    * editing/style/inverse-color-filter-expected.txt: Added.
+    * editing/style/inverse-color-filter.html: Added.
+    * editing/style/set-backColor-with-color-filter-expected.txt:
+    * editing/style/set-foreColor-with-color-filter-expected.txt:
+    * platform/win/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-27  Simon Fraser  <[email protected]>
+
+            Adjust the color matrix for the inverse apple-invert-lightness() transformation
+            https://bugs.webkit.org/show_bug.cgi?id=188131
+            rdar://problem/42673070
+
+            Reviewed by Zalan Bujtas.
+
+            Rebaseline tests that use the filter inversion. Add a new test that does inversion
+            for a whole range of colors, to get good coverage of the inversion matrix.
+
+            * editing/style/inverse-color-filter-expected.txt: Added.
+            * editing/style/inverse-color-filter.html: Added.
+            * editing/style/set-backColor-with-color-filter-expected.txt:
+            * editing/style/set-foreColor-with-color-filter-expected.txt:
+            * platform/win/TestExpectations:
+
+2018-07-29  Babak Shafiei  <[email protected]>
+
         Cherry-pick r234330. rdar://problem/42721217
 
     Be more conservative with compositing layer creation when memory is low

Added: branches/safari-606-branch/LayoutTests/editing/style/inverse-color-filter-expected.txt (0 => 234356)


--- branches/safari-606-branch/LayoutTests/editing/style/inverse-color-filter-expected.txt	                        (rev 0)
+++ branches/safari-606-branch/LayoutTests/editing/style/inverse-color-filter-expected.txt	2018-07-30 06:28:23 UTC (rev 234356)
@@ -0,0 +1,720 @@
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 0, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 255, 255)"
+|   <span>
+|     style="background-color: rgb(0, 0, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(235, 235, 235)"
+|   <span>
+|     style="background-color: rgb(25, 25, 25);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(214, 214, 214)"
+|   <span>
+|     style="background-color: rgb(51, 51, 51);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(192, 192, 192)"
+|   <span>
+|     style="background-color: rgb(79, 79, 79);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(170, 170, 170)"
+|   <span>
+|     style="background-color: rgb(106, 106, 106);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(146, 146, 146)"
+|   <span>
+|     style="background-color: rgb(136, 136, 136);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(122, 122, 122)"
+|   <span>
+|     style="background-color: rgb(166, 166, 166);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(96, 96, 96)"
+|   <span>
+|     style="background-color: rgb(199, 199, 199);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(68, 68, 68)"
+|   <span>
+|     style="background-color: rgb(234, 234, 234);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(35, 35, 35)"
+|   <span>
+|     style="background-color: rgb(255, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 0, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 54, 74)"
+|   <span>
+|     style="background-color: rgb(232, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 30, 87)"
+|   <span>
+|     style="background-color: rgb(220, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(17, 5, 59)"
+|   <span>
+|     style="background-color: rgb(255, 252, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(46, 7, 62)"
+|   <span>
+|     style="background-color: rgb(255, 247, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(60, 8, 27)"
+|   <span>
+|     style="background-color: rgb(255, 244, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(92, 7, 0)"
+|   <span>
+|     style="background-color: rgb(255, 207, 198);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(90, 28, 0)"
+|   <span>
+|     style="background-color: rgb(255, 234, 199);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(88, 52, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 199);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(85, 61, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 202);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(102, 97, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 177);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(79, 85, 3)"
+|   <span>
+|     style="background-color: rgb(255, 255, 201);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(38, 62, 15)"
+|   <span>
+|     style="background-color: rgb(255, 255, 236);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 77, 101)"
+|   <span>
+|     style="background-color: rgb(200, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 46, 122)"
+|   <span>
+|     style="background-color: rgb(180, 237, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(26, 10, 83)"
+|   <span>
+|     style="background-color: rgb(245, 225, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(69, 14, 89)"
+|   <span>
+|     style="background-color: rgb(255, 216, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(86, 16, 41)"
+|   <span>
+|     style="background-color: rgb(255, 211, 243);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(131, 17, 0)"
+|   <span>
+|     style="background-color: rgb(255, 168, 147);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(124, 42, 0)"
+|   <span>
+|     style="background-color: rgb(255, 206, 153);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(122, 74, 0)"
+|   <span>
+|     style="background-color: rgb(255, 245, 153);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(120, 87, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 154);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(141, 134, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 122);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(111, 118, 8)"
+|   <span>
+|     style="background-color: rgb(255, 255, 156);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(56, 87, 26)"
+|   <span>
+|     style="background-color: rgb(240, 255, 203);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 109, 143)"
+|   <span>
+|     style="background-color: rgb(150, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 66, 170)"
+|   <span>
+|     style="background-color: rgb(125, 207, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(44, 19, 118)"
+|   <span>
+|     style="background-color: rgb(216, 184, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(97, 23, 124)"
+|   <span>
+|     style="background-color: rgb(255, 175, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(121, 26, 62)"
+|   <span>
+|     style="background-color: rgb(255, 168, 213);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(181, 26, 0)"
+|   <span>
+|     style="background-color: rgb(255, 113, 81);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(173, 62, 0)"
+|   <span>
+|     style="background-color: rgb(255, 165, 88);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(169, 104, 0)"
+|   <span>
+|     style="background-color: rgb(255, 219, 89);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(167, 123, 0)"
+|   <span>
+|     style="background-color: rgb(255, 243, 90);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(196, 188, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 46);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(154, 166, 14)"
+|   <span>
+|     style="background-color: rgb(255, 255, 90);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(79, 122, 40)"
+|   <span>
+|     style="background-color: rgb(205, 255, 156);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 140, 180)"
+|   <span>
+|     style="background-color: rgb(106, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 86, 214)"
+|   <span>
+|     style="background-color: rgb(74, 182, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(55, 26, 148)"
+|   <span>
+|     style="background-color: rgb(186, 150, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(123, 33, 159)"
+|   <span>
+|     style="background-color: rgb(246, 134, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(154, 36, 79)"
+|   <span>
+|     style="background-color: rgb(255, 127, 180);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(227, 36, 0)"
+|   <span>
+|     style="background-color: rgb(255, 65, 20);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(217, 80, 0)"
+|   <span>
+|     style="background-color: rgb(255, 129, 29);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(213, 132, 0)"
+|   <span>
+|     style="background-color: rgb(255, 194, 29);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(210, 157, 0)"
+|   <span>
+|     style="background-color: rgb(255, 227, 31);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(245, 236, 0)"
+|   <span>
+|     style="background-color: rgb(255, 255, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(195, 209, 23)"
+|   <span>
+|     style="background-color: rgb(246, 255, 31);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(102, 156, 53)"
+|   <span>
+|     style="background-color: rgb(173, 240, 111);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 163, 215)"
+|   <span>
+|     style="background-color: rgb(66, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 97, 255)"
+|   <span>
+|     style="background-color: rgb(28, 149, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(77, 34, 179)"
+|   <span>
+|     style="background-color: rgb(168, 114, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(153, 41, 189)"
+|   <span>
+|     style="background-color: rgb(239, 99, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(185, 45, 93)"
+|   <span>
+|     style="background-color: rgb(255, 88, 148);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 64, 19)"
+|   <span>
+|     style="background-color: rgb(255, 40, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 106, 0)"
+|   <span>
+|     style="background-color: rgb(255, 109, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 170, 0)"
+|   <span>
+|     style="background-color: rgb(255, 183, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(254, 199, 0)"
+|   <span>
+|     style="background-color: rgb(255, 218, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 252, 65)"
+|   <span>
+|     style="background-color: rgb(210, 206, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(217, 235, 55)"
+|   <span>
+|     style="background-color: rgb(202, 225, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(119, 187, 65)"
+|   <span>
+|     style="background-color: rgb(138, 223, 71);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(0, 199, 252)"
+|   <span>
+|     style="background-color: rgb(21, 255, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(58, 136, 254)"
+|   <span>
+|     style="background-color: rgb(22, 120, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(94, 48, 235)"
+|   <span>
+|     style="background-color: rgb(107, 50, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(190, 56, 243)"
+|   <span>
+|     style="background-color: rgb(203, 36, 255);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(230, 59, 122)"
+|   <span>
+|     style="background-color: rgb(246, 32, 111);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 98, 81)"
+|   <span>
+|     style="background-color: rgb(207, 11, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 134, 71)"
+|   <span>
+|     style="background-color: rgb(215, 63, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 180, 63)"
+|   <span>
+|     style="background-color: rgb(219, 125, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(254, 203, 62)"
+|   <span>
+|     style="background-color: rgb(218, 154, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 247, 107)"
+|   <span>
+|     style="background-color: rgb(164, 154, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(228, 239, 101)"
+|   <span>
+|     style="background-color: rgb(159, 173, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(150, 211, 95)"
+|   <span>
+|     style="background-color: rgb(110, 186, 41);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(83, 213, 253)"
+|   <span>
+|     style="background-color: rgb(15, 177, 227);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(116, 167, 254)"
+|   <span>
+|     style="background-color: rgb(16, 80, 189);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(135, 78, 254)"
+|   <span>
+|     style="background-color: rgb(95, 24, 244);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(211, 87, 254)"
+|   <span>
+|     style="background-color: rgb(175, 20, 228);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(237, 113, 158)"
+|   <span>
+|     style="background-color: rgb(178, 23, 79);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 140, 130)"
+|   <span>
+|     style="background-color: rgb(149, 5, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 165, 125)"
+|   <span>
+|     style="background-color: rgb(152, 40, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 198, 119)"
+|   <span>
+|     style="background-color: rgb(156, 84, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 216, 119)"
+|   <span>
+|     style="background-color: rgb(154, 105, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 249, 149)"
+|   <span>
+|     style="background-color: rgb(118, 110, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(235, 243, 143)"
+|   <span>
+|     style="background-color: rgb(116, 126, 1);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(177, 221, 140)"
+|   <span>
+|     style="background-color: rgb(79, 134, 33);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(148, 227, 254)"
+|   <span>
+|     style="background-color: rgb(9, 108, 142);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(168, 198, 254)"
+|   <span>
+|     style="background-color: rgb(11, 48, 118);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(177, 140, 254)"
+|   <span>
+|     style="background-color: rgb(62, 16, 159);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(227, 146, 254)"
+|   <span>
+|     style="background-color: rgb(114, 13, 148);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(244, 164, 192)"
+|   <span>
+|     style="background-color: rgb(114, 14, 49);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 181, 175)"
+|   <span>
+|     style="background-color: rgb(95, 3, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 196, 171)"
+|   <span>
+|     style="background-color: rgb(98, 25, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 217, 168)"
+|   <span>
+|     style="background-color: rgb(100, 52, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 228, 168)"
+|   <span>
+|     style="background-color: rgb(99, 65, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 251, 185)"
+|   <span>
+|     style="background-color: rgb(78, 73, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(242, 247, 183)"
+|   <span>
+|     style="background-color: rgb(75, 81, 1);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(204, 232, 181)"
+|   <span>
+|     style="background-color: rgb(51, 86, 23);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(202, 240, 254)"
+|   <span>
+|     style="background-color: rgb(5, 53, 70);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(212, 227, 254)"
+|   <span>
+|     style="background-color: rgb(6, 25, 58);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(217, 202, 254)"
+|   <span>
+|     style="background-color: rgb(27, 8, 73);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(241, 201, 254)"
+|   <span>
+|     style="background-color: rgb(57, 7, 73);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(249, 211, 224)"
+|   <span>
+|     style="background-color: rgb(55, 8, 24);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 218, 216)"
+|   <span>
+|     style="background-color: rgb(47, 0, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 226, 214)"
+|   <span>
+|     style="background-color: rgb(48, 12, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 236, 213)"
+|   <span>
+|     style="background-color: rgb(48, 24, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(255, 242, 213)"
+|   <span>
+|     style="background-color: rgb(48, 31, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(254, 252, 221)"
+|   <span>
+|     style="background-color: rgb(38, 35, 0);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(248, 250, 219)"
+|   <span>
+|     style="background-color: rgb(38, 41, 2);"
+|     "aaa"
+| <div>
+|   contenteditable=""
+|   data-color="rgb(224, 237, 212)"
+|   <span>
+|     style="background-color: rgb(34, 51, 19);"
+|     "<#selection-anchor>aaa<#selection-focus>"

Added: branches/safari-606-branch/LayoutTests/editing/style/inverse-color-filter.html (0 => 234356)


--- branches/safari-606-branch/LayoutTests/editing/style/inverse-color-filter.html	                        (rev 0)
+++ branches/safari-606-branch/LayoutTests/editing/style/inverse-color-filter.html	2018-07-30 06:28:23 UTC (rev 234356)
@@ -0,0 +1,194 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableColorFilter=true ] -->
+<html>
+<head>
+    <style>
+        #container {
+            width: 500px;
+            height: 400px;
+            border: 1px solid black;
+            background-color: white;
+            -apple-color-filter: apple-invert-lightness();
+        }
+        
+        #container > div {
+            height: 30px;
+            width: 30px;
+            margin: 5px;
+            float: left;
+        }
+        
+    </style>
+    <script>
+        const colors = [
+            "rgb(0, 0, 0)",
+            "rgb(255, 255, 255)",
+            "rgb(235, 235, 235)",
+            "rgb(214, 214, 214)",
+            "rgb(192, 192, 192)",
+            "rgb(170, 170, 170)",
+            "rgb(146, 146, 146)",
+            "rgb(122, 122, 122)",
+            "rgb(96, 96, 96)",
+            "rgb(68, 68, 68)",
+            "rgb(35, 35, 35)",
+            "rgb(0, 0, 0)",
+
+            "rgb(0, 54, 74)",
+            "rgb(0, 30, 87)",
+            "rgb(17, 5, 59)",
+            "rgb(46, 7, 62)",
+            "rgb(60, 8, 27)",
+            "rgb(92, 7, 0)",
+            "rgb(90, 28, 0)",
+            "rgb(88, 52, 0)",
+            "rgb(85, 61, 0)",
+            "rgb(102, 97, 0)",
+            "rgb(79, 85, 3)",
+            "rgb(38, 62, 15)",
+
+            "rgb(0, 77, 101)",
+            "rgb(0, 46, 122)",
+            "rgb(26, 10, 83)",
+            "rgb(69, 14, 89)",
+            "rgb(86, 16, 41)",
+            "rgb(131, 17, 0)",
+            "rgb(124, 42, 0)",
+            "rgb(122, 74, 0)",
+            "rgb(120, 87, 0)",
+            "rgb(141, 134, 0)",
+            "rgb(111, 118, 8)",
+            "rgb(56, 87, 26)",
+
+            "rgb(0, 109, 143)",
+            "rgb(0, 66, 170)",
+            "rgb(44, 19, 118)",
+            "rgb(97, 23, 124)",
+            "rgb(121, 26, 62)",
+            "rgb(181, 26, 0)",
+            "rgb(173, 62, 0)",
+            "rgb(169, 104, 0)",
+            "rgb(167, 123, 0)",
+            "rgb(196, 188, 0)",
+            "rgb(154, 166, 14)",
+            "rgb(79, 122, 40)",
+
+            "rgb(0, 140, 180)",
+            "rgb(0, 86, 214)",
+            "rgb(55, 26, 148)",
+            "rgb(123, 33, 159)",
+            "rgb(154, 36, 79)",
+            "rgb(227, 36, 0)",
+            "rgb(217, 80, 0)",
+            "rgb(213, 132, 0)",
+            "rgb(210, 157, 0)",
+            "rgb(245, 236, 0)",
+            "rgb(195, 209, 23)",
+            "rgb(102, 156, 53)",
+
+            "rgb(0, 163, 215)",
+            "rgb(0, 97, 255)",
+            "rgb(77, 34, 179)",
+            "rgb(153, 41, 189)",
+            "rgb(185, 45, 93)",
+            "rgb(255, 64, 19)",
+            "rgb(255, 106, 0)",
+            "rgb(255, 170, 0)",
+            "rgb(254, 199, 0)",
+            "rgb(255, 252, 65)",
+            "rgb(217, 235, 55)",
+            "rgb(119, 187, 65)",
+
+            "rgb(0, 199, 252)",
+            "rgb(58, 136, 254)",
+            "rgb(94, 48, 235)",
+            "rgb(190, 56, 243)",
+            "rgb(230, 59, 122)",
+            "rgb(255, 98, 81)",
+            "rgb(255, 134, 71)",
+            "rgb(255, 180, 63)",
+            "rgb(254, 203, 62)",
+            "rgb(255, 247, 107)",
+            "rgb(228, 239, 101)",
+            "rgb(150, 211, 95)",
+
+            "rgb(83, 213, 253)",
+            "rgb(116, 167, 254)",
+            "rgb(135, 78, 254)",
+            "rgb(211, 87, 254)",
+            "rgb(237, 113, 158)",
+            "rgb(255, 140, 130)",
+            "rgb(255, 165, 125)",
+            "rgb(255, 198, 119)",
+            "rgb(255, 216, 119)",
+            "rgb(255, 249, 149)",
+            "rgb(235, 243, 143)",
+            "rgb(177, 221, 140)",
+
+            "rgb(148, 227, 254)",
+            "rgb(168, 198, 254)",
+            "rgb(177, 140, 254)",
+            "rgb(227, 146, 254)",
+            "rgb(244, 164, 192)",
+            "rgb(255, 181, 175)",
+            "rgb(255, 196, 171)",
+            "rgb(255, 217, 168)",
+            "rgb(255, 228, 168)",
+            "rgb(255, 251, 185)",
+            "rgb(242, 247, 183)",
+            "rgb(204, 232, 181)",
+
+            "rgb(202, 240, 254)",
+            "rgb(212, 227, 254)",
+            "rgb(217, 202, 254)",
+            "rgb(241, 201, 254)",
+            "rgb(249, 211, 224)",
+            "rgb(255, 218, 216)",
+            "rgb(255, 226, 214)",
+            "rgb(255, 236, 213)",
+            "rgb(255, 242, 213)",
+            "rgb(254, 252, 221)",
+            "rgb(248, 250, 219)",
+            "rgb(224, 237, 212)",
+        ];
+        
+        function buildColorSamples()
+        {
+            let container = document.getElementById('container');
+            for (let color of colors) {
+                var child = document.createElement('div');
+                child.setAttribute('contenteditable', '');
+                child.setAttribute('data-color', color);
+                child.textContent = 'aaa';
+                container.appendChild(child);
+            }
+        }
+        
+        function testOneColor(testDiv)
+        {
+            let targetColor = testDiv.getAttribute('data-color');
+            window.getSelection().setPosition(testDiv, 0);
+            window.getSelection().modify('extend', 'forward', 'word');
+            if (window.testRunner)
+                testRunner.execCommand('backColor', false, targetColor);
+        }
+        
+        function runTest()
+        {
+            buildColorSamples();
+
+            let container = document.getElementById('container');
+            for (let child of container.childNodes) {
+                testOneColor(child);
+            }
+
+            Markup.dump(container);
+        }
+        
+        window.addEventListener('load', runTest, false);
+    </script>
+    <script src=""
+</head>
+<body>
+<div id="container" style="-apple-color-filter: apple-invert-lightness()"></div>
+</body>
+</html>

Modified: branches/safari-606-branch/LayoutTests/editing/style/set-backColor-with-color-filter-expected.txt (234355 => 234356)


--- branches/safari-606-branch/LayoutTests/editing/style/set-backColor-with-color-filter-expected.txt	2018-07-30 06:28:19 UTC (rev 234355)
+++ branches/safari-606-branch/LayoutTests/editing/style/set-backColor-with-color-filter-expected.txt	2018-07-30 06:28:23 UTC (rev 234356)
@@ -2,5 +2,5 @@
 
 "world" should be #ecfffd / rgb(236, 255, 253):
 | <span>
-|   style="background-color: rgb(236, 255, 253);"
+|   style="background-color: rgb(233, 255, 254);"
 |   "<#selection-anchor>hello world<#selection-focus>"

Modified: branches/safari-606-branch/LayoutTests/editing/style/set-foreColor-with-color-filter-expected.txt (234355 => 234356)


--- branches/safari-606-branch/LayoutTests/editing/style/set-foreColor-with-color-filter-expected.txt	2018-07-30 06:28:19 UTC (rev 234355)
+++ branches/safari-606-branch/LayoutTests/editing/style/set-foreColor-with-color-filter-expected.txt	2018-07-30 06:28:23 UTC (rev 234356)
@@ -2,5 +2,5 @@
 
 "world" should be #ecfffd:
 | <font>
-|   color="#ecfffd"
+|   color="#e9fffe"
 |   "<#selection-anchor>hello world<#selection-focus>"

Modified: branches/safari-606-branch/LayoutTests/platform/win/TestExpectations (234355 => 234356)


--- branches/safari-606-branch/LayoutTests/platform/win/TestExpectations	2018-07-30 06:28:19 UTC (rev 234355)
+++ branches/safari-606-branch/LayoutTests/platform/win/TestExpectations	2018-07-30 06:28:23 UTC (rev 234356)
@@ -100,6 +100,7 @@
 webkit.org/b/173281 http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html [ Skip ]
 webkit.org/b/173281 editing/style/set-foreColor-with-color-filter.html [ Skip ]
 webkit.org/b/173281 editing/style/set-backColor-with-color-filter.html [ Skip ]
+webkit.org/b/173281 editing/style/inverse-color-filter.html [ Skip ]
 
 # TODO HW filters not yet supported on Windows
 webkit.org/b/74716 css3/filters/effect-blur-hw.html [ Skip ]

Modified: branches/safari-606-branch/Source/WebCore/ChangeLog (234355 => 234356)


--- branches/safari-606-branch/Source/WebCore/ChangeLog	2018-07-30 06:28:19 UTC (rev 234355)
+++ branches/safari-606-branch/Source/WebCore/ChangeLog	2018-07-30 06:28:23 UTC (rev 234356)
@@ -1,5 +1,52 @@
 2018-07-29  Babak Shafiei  <[email protected]>
 
+        Cherry-pick r234340. rdar://problem/42721208
+
+    Adjust the color matrix for the inverse apple-invert-lightness() transformation
+    https://bugs.webkit.org/show_bug.cgi?id=188131
+    rdar://problem/42673070
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Use the correct inverse matrix values.
+    
+    Test: editing/style/inverse-color-filter.html
+    
+    * platform/graphics/filters/FilterOperation.cpp:
+    (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
+    
+    LayoutTests:
+    
+    Rebaseline tests that use the filter inversion. Add a new test that does inversion
+    for a whole range of colors, to get good coverage of the inversion matrix.
+    
+    * editing/style/inverse-color-filter-expected.txt: Added.
+    * editing/style/inverse-color-filter.html: Added.
+    * editing/style/set-backColor-with-color-filter-expected.txt:
+    * editing/style/set-foreColor-with-color-filter-expected.txt:
+    * platform/win/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-27  Simon Fraser  <[email protected]>
+
+            Adjust the color matrix for the inverse apple-invert-lightness() transformation
+            https://bugs.webkit.org/show_bug.cgi?id=188131
+            rdar://problem/42673070
+
+            Reviewed by Zalan Bujtas.
+
+            Use the correct inverse matrix values.
+
+            Test: editing/style/inverse-color-filter.html
+
+            * platform/graphics/filters/FilterOperation.cpp:
+            (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
+
+2018-07-29  Babak Shafiei  <[email protected]>
+
         Cherry-pick r234330. rdar://problem/42721217
 
     Be more conservative with compositing layer creation when memory is low

Modified: branches/safari-606-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp (234355 => 234356)


--- branches/safari-606-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp	2018-07-30 06:28:19 UTC (rev 234355)
+++ branches/safari-606-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp	2018-07-30 06:28:23 UTC (rev 234356)
@@ -258,11 +258,10 @@
     FloatComponents rgbComponents = sRGBColorComponents;
     // Apply the matrix.
     float matrixValues[20] = {
-        -1.124858, -0.244747, 0.119605, 0, 1.25,
-        -0.124506, -1.244758, 0.119264, 0, 1.25,
-        -0.12445, -0.244568, -0.880982, 0, 1.25,
-        0, 0, 0, 1, 0
-
+        -1.300, -0.097,  0.147, 0, 1.25,
+        -0.049, -1.347,  0.146, 0, 1.25,
+        -0.049, -0.097, -1.104, 0, 1.25,
+         0,      0,      0,     1, 0
     };
     ColorMatrix toLightModeMatrix(matrixValues);
     toLightModeMatrix.transformColorComponents(rgbComponents);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to