Skip to content

Commit

Permalink
#1089@minor: Add clientLeft and clientTop.
Browse files Browse the repository at this point in the history
  • Loading branch information
konomae committed Sep 23, 2023
1 parent bcb0225 commit 9432d2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/happy-dom/src/nodes/html-element/HTMLElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export default class HTMLElement extends Element implements IHTMLElement {
public readonly offsetTop = 0;
public readonly clientHeight = 0;
public readonly clientWidth = 0;
public readonly clientLeft = 0;
public readonly clientTop = 0;

public _style: CSSStyleDeclaration = null;
private _dataset: Dataset = null;
Expand Down
2 changes: 2 additions & 0 deletions packages/happy-dom/src/nodes/html-element/IHTMLElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export default interface IHTMLElement extends IElement {
offsetTop: number;
clientHeight: number;
clientWidth: number;
clientLeft: number;
clientTop: number;
innerText: string;
outerText: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ describe('HTMLElement', () => {
'offsetLeft',
'offsetTop',
'clientHeight',
'clientWidth'
'clientWidth',
'clientLeft',
'clientTop'
]) {
describe(`${property}`, () => {
it('Returns "0".', () => {
Expand Down

0 comments on commit 9432d2c

Please sign in to comment.