]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/hccss.js.uncompressed.js
2 "require", // require.toUrl
3 "./_base/config", // config.blankGif
4 "./dom-class", // domClass.add
5 "./dom-style", // domStyle.getComputedStyle
8 "./_base/window" // win.body
9 ], function(require
, config
, domClass
, domStyle
, has
, ready
, win
){
17 // Test if computer is in high contrast mode (i.e. if browser is not displaying background images).
18 // Defines `has("highcontrast")` and sets `dj_a11y` CSS class on `<body>` if machine is in high contrast mode.
19 // Returns `has()` method;
23 // Has() test for when background images aren't displayed. Don't call has("highcontrast") before dojo/domReady!.
24 has
.add("highcontrast", function(){
25 // note: if multiple documents, doesn't matter which one we use
26 var div
= win
.doc
.createElement("div");
27 div
.style
.cssText
= "border: 1px solid; border-color:red green; position: absolute; height: 5px; top: -999px;" +
28 "background-image: url(" + (config
.blankGif
|| require
.toUrl("./resources/blank.gif")) + ");";
29 win
.body().appendChild(div
);
31 var cs
= domStyle
.getComputedStyle(div
),
32 bkImg
= cs
.backgroundImage
,
33 hc
= (cs
.borderTopColor
== cs
.borderRightColor
) ||
34 (bkImg
&& (bkImg
== "none" || bkImg
== "url(invalid-url:)" ));
37 div
.outerHTML
= ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014
39 win
.body().removeChild(div
);
45 // Priority is 90 to run ahead of parser priority of 100. For 2.0, remove the ready() call and instead
46 // change this module to depend on dojo/domReady!
48 if(has("highcontrast")){
49 domClass
.add(win
.body(), "dj_a11y");