From 9dea8a307fc24e2f0f452bf2f237c38952b3c9e1 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Thu, 23 Feb 2023 18:44:31 +0100 Subject: [PATCH] docs, lint --- site/content/docs/02-template-syntax.md | 16 ++++++++++++++++ .../compile/render_dom/wrappers/Element/index.ts | 1 - .../natural-dimension-binding/input.svelte | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) 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}