diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md index 1094e25184..4464d8b507 100644 --- a/site/content/docs/02-template-syntax.md +++ b/site/content/docs/02-template-syntax.md @@ -746,6 +746,22 @@ Videos additionally have readonly `videoWidth` and `videoHeight` bindings. > ``` +##### Image element bindings + +--- + +Image elements (``) have two readonly bindings: + +* `naturalWidth` (readonly) — the original width of the image +* `naturalHeight` (readonly) — the original height of the image + +```sv + +``` + ##### Block-level element bindings --- diff --git a/src/compiler/compile/render_dom/wrappers/Element/index.ts b/src/compiler/compile/render_dom/wrappers/Element/index.ts index 2bd7a52b4d..0885437414 100644 --- a/src/compiler/compile/render_dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render_dom/wrappers/Element/index.ts @@ -133,7 +133,6 @@ const events = [ filter: (node: Element, _name: string) => node.name === 'details' }, - { event_names: ['load'], filter: (_: Element, name: string) => name === 'naturalHeight' || name === 'naturalWidth' diff --git a/test/js/samples/natural-dimension-binding/input.svelte b/test/js/samples/natural-dimension-binding/input.svelte index b06b8f0ee9..67a7a947fa 100644 --- a/test/js/samples/natural-dimension-binding/input.svelte +++ b/test/js/samples/natural-dimension-binding/input.svelte @@ -5,4 +5,4 @@ -{naturalWidth} x {naturalHeight} \ No newline at end of file +{naturalWidth} x {naturalHeight}