forked from inexorabletash/polyfill
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcssom.js
More file actions
21 lines (18 loc) · 686 Bytes
/
cssom.js
File metadata and controls
21 lines (18 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(function(global) {
'use strict';
if (!('window' in global && 'document' in global))
return;
//----------------------------------------------------------------------
//
// CSSOM View Module
// https://dev.w3.org/csswg/cssom-view/
//
//----------------------------------------------------------------------
// Fix for IE8-'s Element.getBoundingClientRect()
if ('TextRectangle' in global && !('width' in global.TextRectangle.prototype)) {
Object.defineProperties(global.TextRectangle.prototype, {
width: { get: function() { return this.right - this.left; } },
height: { get: function() { return this.bottom - this.top; } }
});
}
}(self));