Diff
Modified: branches/safari-605-branch/LayoutTests/ChangeLog (227315 => 227316)
--- branches/safari-605-branch/LayoutTests/ChangeLog 2018-01-22 17:57:45 UTC (rev 227315)
+++ branches/safari-605-branch/LayoutTests/ChangeLog 2018-01-22 17:57:48 UTC (rev 227316)
@@ -1,5 +1,23 @@
2018-01-22 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r227219. rdar://problem/36722501
+
+ 2018-01-19 James Craig <jcr...@apple.com>
+
+ AX: when invert colors is on, double-invert image and picture elements in UserAgentStyleSheet
+ https://bugs.webkit.org/show_bug.cgi?id=181281
+ <rdar://problem/36291776>
+
+ Reviewed by Simon Fraser.
+
+ Updated to include img and picture element tests.
+
+ * accessibility/smart-invert-expected.txt:
+ * accessibility/smart-invert-reference-expected.html:
+ * accessibility/smart-invert.html:
+
+2018-01-22 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r227216. rdar://problem/36722508
2018-01-19 Chris Dumez <cdu...@apple.com>
Modified: branches/safari-605-branch/LayoutTests/accessibility/smart-invert-expected.txt (227315 => 227316)
--- branches/safari-605-branch/LayoutTests/accessibility/smart-invert-expected.txt 2018-01-22 17:57:45 UTC (rev 227315)
+++ branches/safari-605-branch/LayoutTests/accessibility/smart-invert-expected.txt 2018-01-22 17:57:48 UTC (rev 227316)
@@ -16,8 +16,8 @@
PASS: filter for VIDEO.preserve-filter is 'grayscale(1)'.
AFTER INVERT-COLORS IS APPLIED
-PASS: filter for IMG#a is 'none'. Change once IMG/PICTURE elements are inverted, too.
-PASS: filter for PICTURE#b is 'none'. Change once IMG/PICTURE elements are inverted, too.
+PASS: filter for IMG#a is 'invert(1)'.
+PASS: filter for PICTURE#b is 'invert(1)'.
PASS: filter for VIDEO#c is 'invert(1)'.
PASS: filter for VIDEO#d is 'invert(1)'.
PASS: filter for IMG.fallback is 'none'.
Modified: branches/safari-605-branch/LayoutTests/accessibility/smart-invert-reference-expected.html (227315 => 227316)
--- branches/safari-605-branch/LayoutTests/accessibility/smart-invert-reference-expected.html 2018-01-22 17:57:45 UTC (rev 227315)
+++ branches/safari-605-branch/LayoutTests/accessibility/smart-invert-reference-expected.html 2018-01-22 17:57:48 UTC (rev 227316)
@@ -11,8 +11,8 @@
</head>
<body>
- <img src="" alt="">
- <picture><img class="fallback" src="" alt=""></picture>
+ <img class="invert" src="" alt="">
+ <picture class="invert" ><img class="fallback" src="" alt=""></picture>
<video class="invert" poster="../compositing/resources/simple_image.png"></video>
<video class="invert" poster="../compositing/resources/simple_image.png" controls></video>
<br>
Modified: branches/safari-605-branch/LayoutTests/accessibility/smart-invert.html (227315 => 227316)
--- branches/safari-605-branch/LayoutTests/accessibility/smart-invert.html 2018-01-22 17:57:45 UTC (rev 227315)
+++ branches/safari-605-branch/LayoutTests/accessibility/smart-invert.html 2018-01-22 17:57:48 UTC (rev 227316)
@@ -61,7 +61,7 @@
document.getElementById("result").innerHTML += "<br>AFTER INVERT-COLORS IS APPLIED<br>";
// Eventually elements img amd picture will be double-inverted when invert colors is on. Not shipping yet.
- expectFilterValueForElements(NONE_VALUE, document.querySelectorAll("#a, #b"), "Change once IMG/PICTURE elements are inverted, too.");
+ expectFilterValueForElements(INVERTED_VALUE, document.querySelectorAll("#a, #b"));
// Element <video> should be double-inverted when invert colors is on.
expectFilterValueForElements(INVERTED_VALUE, document.querySelectorAll("#c, #d"));
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (227315 => 227316)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-22 17:57:45 UTC (rev 227315)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-22 17:57:48 UTC (rev 227316)
@@ -1,5 +1,26 @@
2018-01-22 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r227219. rdar://problem/36722501
+
+ 2018-01-19 James Craig <jcr...@apple.com>
+
+ AX: when invert colors is on, double-invert image and picture elements in UserAgentStyleSheet
+ https://bugs.webkit.org/show_bug.cgi?id=181281
+ <rdar://problem/36291776>
+
+ Reviewed by Simon Fraser.
+
+ Updated "Smart Invert" to include img and picture element inversion and tests.
+
+ Tests: accessibility/smart-invert-reference.html
+ accessibility/smart-invert.html
+
+ * css/html.css:
+ (@media (inverted-colors)):
+ (img:not(picture>img), picture, video):
+
+2018-01-22 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r227216. rdar://problem/36722508
2018-01-19 Chris Dumez <cdu...@apple.com>
Modified: branches/safari-605-branch/Source/WebCore/css/html.css (227315 => 227316)
--- branches/safari-605-branch/Source/WebCore/css/html.css 2018-01-22 17:57:45 UTC (rev 227315)
+++ branches/safari-605-branch/Source/WebCore/css/html.css 2018-01-22 17:57:48 UTC (rev 227316)
@@ -1238,5 +1238,5 @@
/* Default support for "Smart Invert" where all content color except media is inverted. */
@media (inverted-colors) {
- video { filter: invert(100%); } /* Only videos double-inverted for now. */
+ img:not(picture>img), picture, video { filter: invert(100%); } /* Images and videos double-inverted. */
}