mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-19 08:01:04 +00:00
31 lines
777 B
JavaScript
31 lines
777 B
JavaScript
/*!
|
|
{
|
|
"name": "bdi Element",
|
|
"property": "bdi",
|
|
"notes": [{
|
|
"name": "MDN Docs",
|
|
"href": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi"
|
|
}]
|
|
}
|
|
!*/
|
|
/* DOC
|
|
Detect support for the bdi element, a way to have text that is isolated from its possibly bidirectional surroundings
|
|
*/
|
|
define(['Modernizr', 'createElement', 'docElement', 'computedStyle'], function(Modernizr, createElement, docElement, computedStyle) {
|
|
Modernizr.addTest('bdi', function() {
|
|
var div = createElement('div');
|
|
var bdi = createElement('bdi');
|
|
|
|
bdi.innerHTML = 'إ';
|
|
div.appendChild(bdi);
|
|
|
|
docElement.appendChild(div);
|
|
|
|
var supports = computedStyle(bdi, null, 'direction') === 'rtl';
|
|
|
|
docElement.removeChild(div);
|
|
|
|
return supports;
|
|
});
|
|
});
|