Skip to content

Commit 6cd343e

Browse files
PatrickGghostdevv
andauthored
add support for resize observer bindings (#2044)
* add support for resize observer bindings * Update packages/language-server/src/plugins/html/dataProvider.ts Co-authored-by: Willow (GHOST) <[email protected]> --------- Co-authored-by: Willow (GHOST) <[email protected]>
1 parent 1317e3c commit 6cd343e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

packages/language-server/src/plugins/html/dataProvider.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ const svelteAttributes: IAttributeData[] = [
6464
name: 'bind:offsetHeight',
6565
description: 'Available for block level elements. (read-only)'
6666
},
67+
{
68+
name: 'bind:contentRect',
69+
description: 'Available for all elements. (read-only)'
70+
},
71+
{
72+
name: 'bind:contentBoxSize',
73+
description: 'Available for all elements. (read-only)'
74+
},
75+
{
76+
name: 'bind:borderBoxSize',
77+
description: 'Available for all elements. (read-only)'
78+
},
79+
{
80+
name: 'bind:devicePixelContentBoxSize',
81+
description: 'Available for all elements. (read-only)'
82+
},
6783
{
6884
name: 'bind:this',
6985
description:

packages/svelte2tsx/src/htmlxtojsx_v2/nodes/Binding.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ const oneWayBindingAttributes: Set<string> = new Set([
1717
'ended',
1818
'readyState',
1919
'naturalWidth',
20-
'naturalHeight'
20+
'naturalHeight',
21+
'contentRect',
22+
'contentBoxSize',
23+
'borderBoxSize',
24+
'devicePixelContentBoxSize'
2125
]);
2226
/**
2327
* List of all binding names that are transformed to sth like `binding = variable`.

0 commit comments

Comments
 (0)