diff --git a/accessible/tests/mochitest/attributes.js b/accessible/tests/mochitest/attributes.js index f491e2820a71..3a437dfbd4f0 100644 --- a/accessible/tests/mochitest/attributes.js +++ b/accessible/tests/mochitest/attributes.js @@ -342,6 +342,14 @@ function fontFamily(aComputedStyle) { } } +/** + * Returns a computed system color for this document. + */ +function getSystemColor(aColor) { + let { r, g, b, a } = InspectorUtils.colorToRGBA(aColor, document); + return a == 1 ? `rgb(${r}, ${g}, ${b})` : `rgba(${r}, ${g}, ${b}, ${a})`; +} + /** * Build an object of default text attributes expected for the given accessible. * @@ -355,7 +363,7 @@ function buildDefaultTextAttrs(aID, aFontSize, aFontWeight, aFontFamily) { var computedStyle = document.defaultView.getComputedStyle(elm); var bgColor = computedStyle.backgroundColor == "rgba(0, 0, 0, 0)" - ? "rgb(255, 255, 255)" + ? getSystemColor("Canvas") : computedStyle.backgroundColor; var defAttrs = { diff --git a/accessible/tests/mochitest/textattrs/test_general.html b/accessible/tests/mochitest/textattrs/test_general.html index eeb85138e460..ed698c7de94f 100644 --- a/accessible/tests/mochitest/textattrs/test_general.html +++ b/accessible/tests/mochitest/textattrs/test_general.html @@ -2,24 +2,21 @@