Closes#6969
As discussed there, container query support is quite useful to add to Svelte as it is now broadly available with Firefox releasing support imminently w/ FF v110 this upcoming week (~Feb 14th). Chrome has had support since ~Aug '22. The central issue is that css-tree which is a dependency for CSS AST parsing is significantly lagging behind on adding more recent features such as container query support. Ample time has been given to the maintainer to update css-tree and I do have every confidence that in time css-tree will receive a new major version with all sorts of modern CSS syntax supported including container queries. This PR provides an interim solution for what Svelte needs to support container queries now.
- split logic up into "is this a contenteditable element" and depending on the outcome use either .wholeText or .data to check if an update is necessary
- add to puppeteer because jsdom does not support contenteditable
- one test is skipped it because it fails right now but helps test #5018
---------
Co-authored-by: suxin2017 <1107178482@qq.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
#8167 introduced the strict version of it - until this is configurable, we should use the relaxed version instead, since many a11y docs actually advise using ul/ol etc
Closes#3310
---------
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Closes#6050
---------
Co-authored-by: Bob Fanger <b.fanger@wearetriple.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Resolves a second unintended regression introduced in #6170.
Follow-up to #8331, this time addressing the root issue so the correct select option won't be deselected in the first place when the initial bound value is undefined.
Fixes#8361
track all `#each` variables that could result in a change to the inputs and also update the `$$binding_groups` variable which holds the references to the inputs of each group accordingly.
Fixes#7633Fixes#6112Fixes#7884
Closes#4129
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Closes#5085
---------
Co-authored-by: Marcin Wicha <23581770+marcin-wicha@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Fixes#8082, where svelte-ignore somehow does not pick up the reactive-component warning.
The issue on this problem is that the map_children function suppresses warnings and errors while traversing AST nodes as src/compiler/compile/nodes classes. However, the reactive-component warning is called in src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts, and its warnings are not suppressed in map_children. Thus, we need to extract ignores and suppress here separately.
fixes#8026
1. replace the big entities list with entities that have a ; at the end where valid (there are some exceptions)
2. construct two regexes from that entities list: one for HTML where it's strictly matched, one for attributes where it tries to match browser behavior by also allowing = / digit / character afterwards
3. decode character references with one of these regexes depending on this is an attribute value or not
---------
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
Ensure innerHTML for template is done on template element
fixes#7315fixes#7319
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* feat: optimise svelte-element output code for static tag and static attribute
* Update src/compiler/compile/render_dom/wrappers/Element/index.ts
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update src/runtime/internal/dom.ts
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update src/compiler/compile/render_dom/wrappers/Element/index.ts
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* fix logic
* fix pipeline errors
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Prior to this change, the compiler would generate a template literal that had many purely static
string variables nested within it. This change collapses these static strings into the surrounding
template literal which should result in (minor) size and performance improvements for the SSR
generated code.
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Fixes#7964
currently for a case where the parent type is ArrayPattern code needs to check if the elements are of direct type MemberExpression or Identifier, in the case of MemberExpression there will be an Identifier check for the Object of the MemberExpression.
---------
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
Fixes: #7578
When remounting a keyed input element (e.g. because the element order has changed) with spread properties, the input value gets undefined. This has happened because data_value is updated before remounting and it won't contain a value for input-value (because the value hasn't changed). When calling mount() an undefined value was assigned because of a missing check.
fixes#7948
- The assignment of the variable "previous_tag" was incorrectly positioned and could cause race condition when used with transitions.
- We need another variable to detect when we are in a transition to remove a node
---------
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
* add inert to attribute_lookup
* typed for preventing a repeat of the tragedy
* add tests
* revert unnecessary change
* add more test
---------
Co-authored-by: fcrozatier <frederic.crozatier@protonmail.com>
Closes#7771
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
fixes#4233 by calling the callback after the iframe loads, which may be asynchronous
---------
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
Related to #5967. Closes#7874
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>