0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
Commit Graph

2706 Commits

Author SHA1 Message Date
Tan Li Hau
d16dd5d7ca
feat: add naturalWidth and naturalHeight bindings (#7857)
Closes #7771
---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-02-24 14:20:44 +01:00
Alvin Ramskogler
9f89a92d31
feat: add readonly method to convert writable store to readonly (#6518) 2023-02-23 12:17:34 +01:00
Jos de Jong
e5b0b6235d
fix: ensure bind:offsetHeight updates (#8096)
fixes #4233 by calling the callback after the iframe loads, which may be asynchronous

---------

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-23 12:03:12 +01:00
Tan Li Hau
53de73d08c
feat: simpler output for reactive vars if dependencies are all static (#7942) 2023-02-22 20:02:42 +01:00
Vaibhav
c9a269c149
fix: silence no content a11y warning if the tag has an aria-label (#8299)
fixes #8296

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-02-22 17:19:33 +01:00
ngtr6788
3559997223
feat: implement a11y aria-activedescendant-has-tabindex (#8172)
#820
2023-02-22 17:14:21 +01:00
Yuichiro Yamashita
a0cedf8d82
fix: flush remaining afterUpdate before destroy (#7516)
fixes #7476
2023-02-22 09:46:49 +01:00
Carlos Ivanchuk
aa9b2dd5f3
fix: omit a11y warning on <video> when aria-hidden="true" (#7880)
Related to #5967. Closes #7874

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-21 17:27:49 +01:00
Valter Kraemer
2a5b488386
fix: empty value attribute selector doesn't produce "Unused CSS selector" warning (#8122)
Fixes: #8042

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-21 15:21:48 +01:00
Ben Bucksch
f6ef6a9349
fix: don't throw when calling writable() unsubscribe twice (#8186)
Fixes one case of #4765

---------

Co-authored-by: Ben Bucksch <bbucksch@jw.org>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-21 13:52:39 +01:00
Lioness100
5a3a1e488a
fix: correct typos in variable names (#8257)
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
2023-02-14 10:36:48 -08:00
Tim McCabe
cb972ecdba
[chore] fix a11y-no-nointeractive-tabindex typo (#8252) 2023-02-05 20:23:43 +09:00
Ben McCann
34ae6aaf1f
fix: make noreferrer warning less zealous (#8230)
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-01-28 08:50:14 -08:00
Jay Harris
4f42daeff7
feat: trusted-types CSP compatibility for Web Components (#8135) 2023-01-27 16:25:04 -08:00
Emil Tholin
b06e435684
[fix] Spread component props immutably during SSR (#8176)
By passing an empty object literal as first argument to Object.assign we can avoid having objects spread as props on a component being mutated during SSR.

Fixes #8171
2023-01-10 09:39:50 +01:00
Yuichiro Yamashita
4b84c4df3a
[fix] Improve is_promise handling (#8162)
* correctly handle promises that are of function type

* add License

Co-authored-by: Vilsol <me@vil.so>
2023-01-03 12:48:06 +09:00
Yuichiro Yamashita
e1a1c7fa87
[chore] Fix CI (#8160)
* ci build

* fix test

* add test for #7938
2023-01-02 15:55:14 +09:00
Simon H
762d0429b1
[fix] propagate bindings correctly (#8114)
Fixes #8103 introduced through #7981
Keeps the infinite loop from happening but reopens #6298 and #5689
2023-01-02 14:51:01 +09:00
Mathias Picker
c9e98e6bba
[fix]: remove double up initialization on svelte:element (#8142)
* fixed double up initialization on svelte:element elements

* updated test and fixed bug

* update other svelte:element test

* removed whitespace

* refactor

* correctly update expected ouput resulting from #7938

* remove .solo

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-01-02 10:48:34 +08:00
Ming07
1f021226c5
[fix] named slots breaks svelte-ignore comments (#8105)
* [fix] Named slots breaks svelte-ignore comments

Fixes #8075

* test: add tests

* refactor

* refactor test

Co-authored-by: mojinming <mojinming@cmcm.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-01-02 10:23:35 +08:00
wackbyte
094483b397
[fix] say "nonnegative" instead of "positive" tabIndex for a11y-no-noninteractive-tabindex (#8126) 2023-01-02 09:39:55 +08:00
Ramon Snir
f84c00edb9
[fix] static svelte:element not replaced with tag in production mode (#7938)
* [fix] static svelte:element not replaced with tag in production mode

* [fix] static svelte:element not replaced with tag in production mode

* add optimization of static <svelte:element> and fix a bug

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-01-01 16:41:00 +08:00
Yuichiro Yamashita
de6821a1de
[ chore] disable puppeteer on Linux for Node8 and 10 (#8155) 2022-12-31 10:13:52 +09:00
Yuichiro Yamashita
94e51df07b
[fix] escape style attribute for SSR (#8087) 2022-12-06 14:23:23 -05:00
Tan Li Hau
2f61907ec1
[fix] allow invalidating variables from @const declared function (#7858) 2022-12-06 00:01:51 +09:00
Simon H
4c5469b1ee
[fix] don't run binding init unnecessarily (#7981) 2022-12-05 23:43:39 +09:00
Bert B
ed3ac92ec0
[fix] Suppress a11y-no-noninteractive-tabindex warning if an element has a tabpanel (#8025)
* update tabindex warning to ignore tabpanels

* refactor

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2022-12-05 23:25:25 +09:00
Torsten Dittmann
676716979a
[fix] a11y - allow fallback roles (#8045) 2022-12-05 23:00:51 +09:00
Pat Cavit
84d61c61f8
[feat] Add options w/ direction to transitions (#8068) 2022-12-05 22:43:59 +09:00
Dominik G
ee480bded6
[fix] only read static value for rel attribute validation (#8003)
fixes #7994
2022-11-10 14:00:08 +01:00
Maximiliano Ruani
773dedf714
[feat] Compiler option css: 'none' support (#7914) 2022-11-09 10:21:38 -08:00
Josh Soref
b265bc6f0f
[chore] fix spelling and typos (#7974) 2022-10-27 08:09:18 -07:00
Sid
8921c04a21
[chore] Upgrade css-tree version to 2.1.0 (#7572)
* chore: upgrade to css-tree major version

* fix: handle whitespace token for new ast

* fix: css syntax error

* remove @types/css-tree

* import css-tree/parser instead of file path import

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-10-16 16:58:34 +08:00
Tan Li Hau
e8b4997bb5
[fix] duplicate meta tags during hydration (#7941) 2022-10-14 14:15:04 +09:00
Billy Levin
88ed9931f2
warn on assignment to const (#4960)
* warn on assignment to const

* fix formatting and switch to error

* check most local scopes first

* fix logic and add more tests

* more formatting

* Fix broken test

* use find_owner instead

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-10-13 22:23:07 +08:00
Joffrey LEVEUGLE
c7c6c05c7f
[feat] add security warning for anchor element (rel attribute) (#6289)
* add security warning for anchor element (rel attribute)

* manage more case for security warnings on anchor (aplocks, false positive ...)

* remove noopener checks as noreferrer imples noopener

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-10-13 21:58:10 +08:00
gtmnayan
bee1851faa
[feat] |important modifier for style directive (#7489)
* important modifier for style directive

* docs

* Exclude third param if false
third param for set_style is optional

* Remove unused test

Runtime test doesn't work because of weird behaviour of computed style
the puppeteer test should cover it

* remove unnecessary test

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-10-13 21:52:06 +08:00
metonym
26a428972b
[fix] "not interactive" -> "noninteractive" (#7930) 2022-10-13 20:49:00 +08:00
Tan Li Hau
8de7931c64
[feat] better error message for invalid logic block placement (#7862)
* better error message for invalid logic block placement

* include checking for {@html} tags in invalid location
2022-10-07 08:23:12 +08:00
Tan Li Hau
158ec43d99
[fix] do not warn about missing props for bindings (#6583) 2022-10-06 23:29:48 +09:00
Tan Li Hau
81d4dbad99
[fix] call on_destroy if unmounted called immediately before on_mount (#7860)
* call on_destroy if unmounted called immediately before on_mount

* feat: review changes
2022-10-06 10:21:36 +09:00
Tan Li Hau
5c5bc27d97
[feat] Support style props for SVG components (#7859) 2022-10-06 01:18:37 +09:00
Yuichiro Yamashita
01a91163a9
[fix] Improve error message if this attribute of <svelte:component> is not valid (#7551)
* add test

* improve error message if this attribute of <svelte:component> is not SvelteComponent

* add more tests

* improve validation

* simplify test

Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
2022-10-05 23:28:00 +08:00
Tan Li Hau
b20fb114a6
allow nullish values for component event handlers (#7863) 2022-09-21 21:48:01 +08:00
Yuichiro Yamashita
433460ec2d
[feat] skip custom element check if <svelte:element> uses under svg (#7869)
* add test

* skip custom element check if svelte element uses under svg
2022-09-15 22:22:40 +09:00
Yuichiro Yamashita
5adac302c0
[fix] call attribute bindings for custom element if <svelte:element> render custom element (#7766)
* call attr bindings if tag is custom element

* add test
2022-09-13 23:56:19 +08:00
metonym
980aff8a4a
[fix] omit a11y warning for native checkbox/radio inputs (#7838)
* [fix] omit a11y warning for native checkbox/radio inputs

Fixes #7837

* align implementation with eslint-plugin-jsx-a11y

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-09-13 23:44:20 +08:00
MCMXC
82013aa161
feat(a11y): add click-events-have-key-events rule (#5073)
* feat(a11y): add click-events-have-key-events rule

Signed-off-by: mhatvan <markus_hatvan@aon.at>

* Fine-tune click-events-have-key-events rule

Signed-off-by: mhatvan <markus_hatvan@aon.at>

* Implement PR feedback

Signed-off-by: Markus Hatvan <markus_hatvan@aon.at>

* Implement PR feedback

Signed-off-by: Markus Hatvan <markus_hatvan@aon.at>

* slight refactor to use existing utils

* update docs

* fix rebase conflicts

Signed-off-by: mhatvan <markus_hatvan@aon.at>
Signed-off-by: Markus Hatvan <markus_hatvan@aon.at>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
Co-authored-by: dsfx3d <dsfx3d@gmail.com>
2022-09-13 21:22:10 +08:00
Yuichiro Yamashita
e2538c594b
[feat] support --style-props for <svelte:component> (#7468)
* add test

* support --style-props for <svelte:component>

* refactor

* add more test

* support switching instance

* add test with svelte:self

* merge duplicated if statement

* slight refactor

* remove unnecessary anchor

* reorder insertion

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-09-13 19:20:45 +08:00
tanhauhau
899d0cc67c update docs for a11y-no-noninteractive-tabindex and rename from a11y-no-nointeractive-tabindex -> a11y-no-noninteractive-tabindex 2022-09-13 19:16:58 +08:00