minor aesthetic tweaks (#10692)

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/10693/head
Rich Harris 7 months ago committed by GitHub
parent ee04f973b2
commit 0a9ba9340b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -493,7 +493,7 @@ function serialize_element_attribute_update_assignment(element, node_id, attribu
let grouped_value = value;
if (name === 'autofocus') {
state.init.push(b.stmt(b.call('$.auto_focus', node_id, value)));
state.init.push(b.stmt(b.call('$.autofocus', node_id, value)));
return false;
}
@ -992,7 +992,7 @@ function serialize_inline_component(node, component_name, context) {
const prev = fn;
fn = (node_id) =>
b.call(
'$.cssProps',
'$.css_props',
node_id,
// TODO would be great to do this at runtime instead. Svelte 4 also can't handle cases today
// where it's not statically determinable whether the component is used in a svg or html context

@ -490,7 +490,7 @@ export function text(dom, value) {
* @param {boolean} value
* @returns {void}
*/
export function auto_focus(dom, value) {
export function autofocus(dom, value) {
if (value) {
const body = document.body;
dom.autofocus = true;
@ -1792,7 +1792,7 @@ export function component(anchor_node, component_fn, render_fn) {
* @param {(anchor: Element | Text | Comment) => any} component
* @returns {void}
*/
export function cssProps(anchor, is_html, props, component) {
export function css_props(anchor, is_html, props, component) {
hydrate_block_anchor(anchor);
/** @type {HTMLElement | SVGElement} */
@ -2276,7 +2276,7 @@ export function spread_attributes(dom, prev, attrs, lowercase_attributes, css_ha
} else if (key === 'style') {
dom.style.cssText = value + '';
} else if (key === 'autofocus') {
auto_focus(/** @type {HTMLElement} */ (dom), Boolean(value));
autofocus(/** @type {HTMLElement} */ (dom), Boolean(value));
} else if (key === '__value' || key === 'value') {
// @ts-ignore
dom.value = dom[key] = dom.__value = value;

Loading…
Cancel
Save