代码拉取完成,页面将自动刷新
define([
"require", // require, require.toUrl
"./_base/config", // config.blankGif
"./dom-class", // domClass.add
"./dom-style", // domStyle.getComputedStyle
"./has",
"./domReady",
"./_base/window" // win.body
], function(require, config, domClass, domStyle, has, domReady, win){
// module:
// dojo/hccss
/*=====
return function(){
// summary:
// Test if computer is in high contrast mode (i.e. if browser is not displaying background images).
// Defines `has("highcontrast")` and sets `dj_a11y` CSS class on `<body>` if machine is in high contrast mode.
// Returns `has()` method;
};
=====*/
// Has() test for when background images aren't displayed. Don't call has("highcontrast") before dojo/domReady!.
has.add("highcontrast", function(){
// note: if multiple documents, doesn't matter which one we use
var div = win.doc.createElement("div");
try{
div.style.cssText = "border: 1px solid; border-color:red green; position: absolute; height: 5px; top: -999px;" +
"background-image: url(\"" + (config.blankGif || require.toUrl("./resources/blank.gif")) + "\");";
win.body().appendChild(div);
var cs = domStyle.getComputedStyle(div),
bkImg = cs.backgroundImage;
return cs.borderTopColor == cs.borderRightColor ||
(bkImg && (bkImg == "none" || bkImg == "url(invalid-url:)" ));
}catch(e){
console.warn("hccss: exception detecting high-contrast mode, document is likely hidden: " + e.toString());
return false;
}finally{
if(has("ie") <= 8){
div.outerHTML = ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014
}else{
win.body().removeChild(div);
}
}
});
domReady(function(){
if(has("highcontrast")){
domClass.add(win.body(), "dj_a11y");
}
});
return has;
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。