fix: close keyframe bypasses on protected controls without policing skin layout

Hold @keyframes to the same hide/yeet checks as regular declarations,
including escaped and namespaced animation names. Loosen decorative
host-chrome layout locks so open skins can restyle layout freely.
Listen for the recovery shortcut in the capture phase, move the
load-failure banner into the host-owned layer, and fix recovery
aria-labels.
This commit is contained in:
OddTurtleHead committed 2026-11-15 01:09:42 +08:00
1 parent a84f66b47d
commit a4ae4de82f
9 files changed
+286 -57

No files matched your search

+14 -6
View File
@@ -1,5 +1,5 @@
<template>
<Teleport to="body">
<Teleport v-if="layer" :to="layer.container">
<section v-if="error" class="skin-load-recovery" data-ws-part="app.skin-load-recovery" role="alert">
<p>{{ labels.skinLoadError(error.skinId) }}</p>
<button type="button" @click="$emit('use-built-in')">{{ labels.skinUseBuiltIn }}</button>
@@ -8,9 +8,10 @@
</template>
<script setup lang="ts">
import { computed } from "vue";
import { computed, onBeforeUnmount } from "vue";
import type { Language } from "../i18n/web-client.js";
import { resolveSkinLayoutLanguage, skinLayoutLabels } from "../i18n/skin-layout.js";
import { createHostOwnedLayer, type HostOwnedLayer } from "../services/host-owned-layer.js";
defineEmits<{ "use-built-in": [] }>();
@@ -19,9 +20,11 @@ const props = defineProps<{
language: Language;
}>();
const labels = computed(() => skinLayoutLabels[resolveSkinLayoutLanguage(props.language)]);
</script>
<style scoped>
// The banner is trusted host UI: render it in a closed shadow root so compiled
// skin CSS cannot restyle it (or hide it) from the document. The layer's fixed
// wrapper is pointer-transparent, so the banner re-enables pointer events.
const SKIN_LOAD_LAYER_CSS = `
.skin-load-recovery {
position: fixed;
z-index: 2147482500;
@@ -40,13 +43,18 @@ const labels = computed(() => skinLayoutLabels[resolveSkinLayoutLanguage(props.l
background: #fffbeb;
box-shadow: 0 8px 28px #0f172a33;
font: 14px/1.45 ui-sans-serif, system-ui, sans-serif;
pointer-events: auto;
}
.skin-load-recovery p { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.skin-load-recovery button { flex: 0 0 auto; min-height: 44px; max-width: 100%; padding: 7px 10px; border: 1px solid #b45309; border-radius: 8px; color: #78350f; background: #fff; cursor: pointer; white-space: normal; }
.skin-load-recovery button:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
@media (max-width: 520px) {
.skin-load-recovery { align-items: stretch; flex-direction: column; gap: 7px; }
.skin-load-recovery button { width: 100%; }
}
</style>
`;
const layer: HostOwnedLayer | null = createHostOwnedLayer("skin-load", SKIN_LOAD_LAYER_CSS);
onBeforeUnmount(() => layer?.dispose());
</script>