This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into t/ckeditor5/447
- Loading branch information
Showing
11 changed files
with
1,188 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/** | ||
* @module utils/dom/getborderwidths | ||
*/ | ||
|
||
import global from './global'; | ||
|
||
/** | ||
* Returns an object containing CSS border widths of a specified HTML element. | ||
* | ||
* @param {HTMLElement} element An element which has CSS borders. | ||
* @param {Object} An object containing `top`, `left`, `right` and `bottom` properties | ||
* with numerical values of the `border-[top,left,right,bottom]-width` CSS styles. | ||
*/ | ||
export default function getBorderWidths( element ) { | ||
const style = global.window.getComputedStyle( element ); | ||
|
||
return { | ||
top: parseInt( style.borderTopWidth, 10 ), | ||
right: parseInt( style.borderRightWidth, 10 ), | ||
bottom: parseInt( style.borderBottomWidth, 10 ), | ||
left: parseInt( style.borderLeftWidth, 10 ) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.