From 1a200ca0e6090e705a29a5bdd7bf00e7d44e35f1 Mon Sep 17 00:00:00 2001 From: drcbeatz Date: Sun, 5 Dec 2021 11:31:46 -0500 Subject: [PATCH] refactored tests & squashed commits --- .eslintignore | 4 + package.json | 3 + src/runtime/internal/style_manager.ts | 29 +++++++- test/svelte-styles-csp/index.ts | 70 ++++++++++++++++++ .../build/bundle.css | 1 + .../build/bundle.js | 16 ++++ .../favicon.png | Bin 0 -> 3127 bytes .../global.css | 63 ++++++++++++++++ .../index.html | 20 +++++ .../build/bundle.css | 1 + .../build/bundle.js | 2 + .../favicon.png | Bin 0 -> 3127 bytes .../global.css | 63 ++++++++++++++++ .../index.html | 21 ++++++ .../svelte-stylesheet.css | 0 15 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 test/svelte-styles-csp/index.ts create mode 100644 test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/bundle.css create mode 100644 test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/bundle.js create mode 100644 test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/favicon.png create mode 100644 test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/global.css create mode 100644 test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/index.html create mode 100644 test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/bundle.css create mode 100644 test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/bundle.js create mode 100644 test/svelte-styles-csp/svelte-test-transitions-styles-csp/favicon.png create mode 100644 test/svelte-styles-csp/svelte-test-transitions-styles-csp/global.css create mode 100644 test/svelte-styles-csp/svelte-test-transitions-styles-csp/index.html create mode 100644 test/svelte-styles-csp/svelte-test-transitions-styles-csp/svelte-stylesheet.css diff --git a/.eslintignore b/.eslintignore index d123c10530..4be619a0b0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,6 +2,10 @@ **/expected.js _output test/*/samples/*/output.js +test/svelte-styles-csp/*.js +test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/*.js +test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/*.js + # automatically generated internal_exports.ts diff --git a/package.json b/package.json index 7078b3a9cf..214bb3ad1b 100644 --- a/package.json +++ b/package.json @@ -162,5 +162,8 @@ ], "sourceMap": true, "instrument": true + }, + "optionalDependencies": { + "fsevents": "^2.1.3" } } diff --git a/src/runtime/internal/style_manager.ts b/src/runtime/internal/style_manager.ts index 0993b3bf18..8ad0a7adbd 100644 --- a/src/runtime/internal/style_manager.ts +++ b/src/runtime/internal/style_manager.ts @@ -18,6 +18,24 @@ function hash(str: string) { return hash >>> 0; } +export function get_svelte_style_sheet_index(style_sheet_list: StyleSheetList) { + let svelte_style_sheet_index: number; + const svelte_style_sheet_title = 'svelte-stylesheet'; + + for (let i = 0; i < style_sheet_list.length; i++) { + if ( style_sheet_list[i].type !== 'text/css') continue; + const css = style_sheet_list[i]; + + const css_rules = css?.cssRules; + if (!css_rules) continue; + if (css.title === svelte_style_sheet_title && css_rules.length === 0) { + svelte_style_sheet_index = i; + break; + } + } + return svelte_style_sheet_index; +} + export function create_rule(node: Element & ElementCSSInlineStyle, a: number, b: number, duration: number, delay: number, ease: (t: number) => number, fn: (t: number, u: number) => string, uid: number = 0) { const step = 16.666 / duration; let keyframes = '{\n'; @@ -31,7 +49,16 @@ export function create_rule(node: Element & ElementCSSInlineStyle, a: number, b: const name = `__svelte_${hash(rule)}_${uid}`; const doc = get_root_for_style(node) as ExtendedDoc; active_docs.add(doc); - const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = append_empty_stylesheet(node).sheet as CSSStyleSheet); + + let svelte_style_sheet_index: number; + + if (!doc.__svelte_stylesheet) { + svelte_style_sheet_index = get_svelte_style_sheet_index(document.styleSheets); + } + + const stylesheet = doc.__svelte_stylesheet || + (doc.__svelte_stylesheet = (document.styleSheets[svelte_style_sheet_index] as CSSStyleSheet) ?? + append_empty_stylesheet(node).sheet as CSSStyleSheet); const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {}); if (!current_rules[name]) { diff --git a/test/svelte-styles-csp/index.ts b/test/svelte-styles-csp/index.ts new file mode 100644 index 0000000000..327bb849c2 --- /dev/null +++ b/test/svelte-styles-csp/index.ts @@ -0,0 +1,70 @@ +const puppeteer = require('puppeteer'); +import * as assert from 'assert'; +const path = require('path'); + +// set to false to view transitions tested in Chromium +const headless_browser = true; + +// set to true to allow 1000ms delay between transition start and finish +// (gives time to view transitions when not in headless mode) +const transition_delay = false; + +describe('svelte-style-csp', async () => { + describe('test transitions with svelte-styles-csp & strict-CSP', async () => { + it('svelte-stylesheet loaded and transitions work', async () => { + const absolutePath = path.join( + __dirname, + 'svelte-test-transitions-styles-csp/index.html' + ); + const browser = await puppeteer.launch({ headless: headless_browser }); + const page = await browser.newPage(); + try { + await page.goto('file://' + absolutePath); + let linkTitle: string; + const linkTitles = await page.evaluateHandle(() => { + return Array.from(document.getElementsByTagName('link')).map( + (a) => a.title + ); + }); + const linkList = await linkTitles.jsonValue(); + + for (const item of linkList) { + if (item == 'svelte-stylesheet') linkTitle = item; + } + + await page.click('input'); + if (transition_delay) { + await page.waitFor(1000); + } + await page.click('input'); + await browser.close(); + assert.equal(linkTitle, 'svelte-stylesheet'); + } catch (err) { + throw new Error(err); + } + }); + }); + + describe('test transitions without svelte-styles-csp & strict CSP', async () => { + it('transitions fail with strict CSP and no style-src: unsafe-inline', async () => { + const absolutePath = path.join( + __dirname, + 'svelte-test-transitions-no-styles-csp/index.html' + ); + const browser = await puppeteer.launch({ headless: headless_browser }); + const page = await browser.newPage(); + try { + await page.goto('file://' + absolutePath); + await page.click('input'); + if (transition_delay) { + await page.waitFor(1000); + } + await page.click('input'); + await browser.close(); + } catch (err) { + // Transitions should fail with strict CSP + assert.throws(err); + } + }); + }); +}); diff --git a/test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/bundle.css b/test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/bundle.css new file mode 100644 index 0000000000..bc30dc15b2 --- /dev/null +++ b/test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/bundle.css @@ -0,0 +1 @@ +h1.svelte-i7qo5m{color:purple}.contact-card.svelte-vatk6b{box-shadow:0 2px 8px rgba(0, 0, 0, 0.26);max-width:30rem;border-radius:5px;margin:1rem 0}header.svelte-vatk6b{display:flex;justify-content:space-between;align-items:center;height:7rem}.thumb.svelte-vatk6b{width:33%;height:100%}.thumb-placeholder.svelte-vatk6b{background-color:grey}img.svelte-vatk6b{width:100%;height:100%;object-fit:cover}.user-data.svelte-vatk6b{width:67%;display:flex;flex-direction:column;justify-content:center}h1.svelte-vatk6b{font-size:1.25rem;font-family:"Roboto Slab", sans-serif;margin:0.5rem 0}h2.svelte-vatk6b{font-size:1rem;font-weight:normal;color:#5a5a5a;margin:0;margin-bottom:0.5rem}.description.svelte-vatk6b{border-top:1px solid #ccc;padding:1rem} \ No newline at end of file diff --git a/test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/bundle.js b/test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/bundle.js new file mode 100644 index 0000000000..0e09a38657 --- /dev/null +++ b/test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/build/bundle.js @@ -0,0 +1,16 @@ +var app=function(){"use strict";function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(){return Object.create(null)}function i(t){t.forEach(o)}function a(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}const c="undefined"!=typeof window;let u=c?()=>window.performance.now():()=>Date.now(),l=c?t=>requestAnimationFrame(t):t;const d=new Set;function f(t){d.forEach((n=>{n.c(t)||(d.delete(n),n.f())})),0!==d.size&&l(f)}function p(t){let n;return 0===d.size&&l(f),{promise:new Promise((e=>{d.add(n={c:t,f:e})})),abort(){d.delete(n)}}}function g(t,n){t.appendChild(n)}function h(t){if(!t)return document;const n=t.getRootNode?t.getRootNode():t.ownerDocument;return n.host?n:document}function m(t){const n=b("style");return function(t,n){g(t.head||t,n)}(h(t),n),n}function y(t,n,e){t.insertBefore(n,e||null)}function $(t){t.parentNode.removeChild(t)}function b(t){return document.createElement(t)}function _(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function x(t){return document.createTextNode(t)}function w(){return x(" ")}function v(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}const k=new Set;let C,S=0;function E(t,n,e,o,r,i,a,s=0){const c=16.666/o;let u="{\n";for(let t=0;t<=1;t+=c){const o=n+(e-n)*i(t);u+=100*t+`%{${a(o,1-o)}}\n`}const l=u+`100% {${a(e,1-e)}}\n}`,d=`__svelte_${function(t){let n=5381,e=t.length;for(;e--;)n=(n<<5)-n^t.charCodeAt(e);return n>>>0}(l)}_${s}`,f=h(t);k.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=m(t).sheet),g=f.__svelte_rules||(f.__svelte_rules={});g[d]||(g[d]=!0,p.insertRule(`@keyframes ${d} ${l}`,p.cssRules.length));const y=t.style.animation||"";return t.style.animation=`${y?`${y}, `:""}${d} ${o}ms linear ${r}ms 1 both`,S+=1,d}function O(t,n){const e=(t.style.animation||"").split(", "),o=e.filter(n?t=>t.indexOf(n)<0:t=>-1===t.indexOf("__svelte")),r=e.length-o.length;r&&(t.style.animation=o.join(", "),S-=r,S||l((()=>{S||(k.forEach((t=>{const n=t.__svelte_stylesheet;let e=n.cssRules.length;for(;e--;)n.deleteRule(e);t.__svelte_rules={}})),k.clear())})))}function F(t){C=t}const j=[],B=[],M=[],R=[],N=Promise.resolve();let T=!1;function A(t){M.push(t)}let P=!1;const q=new Set;function L(){if(!P){P=!0;do{for(let t=0;t{D=null}))),D}function I(t,n,e){t.dispatchEvent(function(t,n,e=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,!1,n),o}(`${n?"intro":"outro"}${e}`))}const G=new Set;let H;function J(t,n){t&&t.i&&(G.delete(t),t.i(n))}function K(t,n,e,o){if(t&&t.o){if(G.has(t))return;G.add(t),H.c.push((()=>{G.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r,s){let c=o(e,r),l=s?0:1,d=null,f=null,g=null;function h(){g&&O(e,g)}function m(t,n){const e=t.b-l;return n*=Math.abs(e),{a:l,b:t.b,d:e,duration:n,start:t.start,end:t.start+n,group:t.group}}function y(o){const{delay:r=0,duration:a=300,easing:s=n,tick:y=t,css:$}=c||Q,b={start:u()+r,b:o};o||(b.group=H,H.r+=1),d||f?f=b:($&&(h(),g=E(e,l,o,a,r,s,$)),o&&y(0,1),d=m(b,a),A((()=>I(e,o,"start"))),p((t=>{if(f&&t>f.start&&(d=m(f,a),f=null,I(e,d.b,"start"),$&&(h(),g=E(e,l,d.b,d.duration,0,s,c.css))),d)if(t>=d.end)y(l=d.b,1-l),I(e,d.b,"end"),f||(d.b?h():--d.group.r||i(d.group.c)),d=null;else if(t>=d.start){const n=t-d.start;l=d.a+d.d*s(n/d.duration),y(l,1-l)}return!(!d&&!f)})))}return{run(t){a(c)?W().then((()=>{c=c(),y(t)})):y(t)},end(){h(),d=f=null}}}function V(t,n){-1===t.$$.dirty[0]&&(j.push(t),T||(T=!0,N.then(L)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const r=o.length?o[0]:e;return g.ctx&&u(g.ctx[t],g.ctx[t]=r)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](r),h&&V(n,t)),e})):[],g.update(),h=!0,i(g.before_update),g.fragment=!!c&&c(g.ctx),e.target){if(e.hydrate){const t=function(t){return Array.from(t.childNodes)}(e.target);g.fragment&&g.fragment.l(t),t.forEach($)}else g.fragment&&g.fragment.c();e.intro&&J(n.$$.fragment),function(t,n,e,r){const{fragment:s,on_mount:c,on_destroy:u,after_update:l}=t.$$;s&&s.m(n,e),r||A((()=>{const n=c.map(o).filter(a);u?u.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(A)}(n,e.target,e.anchor,e.customElement),L()}F(p)}function Y(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function Z(t){return t*t*t}function tt(t){const n=t-1;return n*n*n+1}function nt(t){return--t*t*t*t*t+1} +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */function et(t,{delay:n=0,duration:e=400,easing:o=Y,amount:r=5,opacity:i=0}={}){const a=getComputedStyle(t),s=+a.opacity,c="none"===a.filter?"":a.filter,u=s*(1-i);return{delay:n,duration:e,easing:o,css:(t,n)=>`opacity: ${s-u*n}; filter: ${c} blur(${n*r}px);`}}function ot(t,{delay:e=0,duration:o=400,easing:r=n}={}){const i=+getComputedStyle(t).opacity;return{delay:e,duration:o,easing:r,css:t=>"opacity: "+t*i}}function rt(t,{delay:n=0,duration:e=400,easing:o=tt,x:r=0,y:i=0,opacity:a=0}={}){const s=getComputedStyle(t),c=+s.opacity,u="none"===s.transform?"":s.transform,l=c*(1-a);return{delay:n,duration:e,easing:o,css:(t,n)=>`\n\t\t\ttransform: ${u} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${c-l*n}`}}function it(t,{delay:n=0,duration:e=400,easing:o=tt}={}){const r=getComputedStyle(t),i=+r.opacity,a=parseFloat(r.height),s=parseFloat(r.paddingTop),c=parseFloat(r.paddingBottom),u=parseFloat(r.marginTop),l=parseFloat(r.marginBottom),d=parseFloat(r.borderTopWidth),f=parseFloat(r.borderBottomWidth);return{delay:n,duration:e,easing:o,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*i};height: ${t*a}px;padding-top: ${t*s}px;padding-bottom: ${t*c}px;margin-top: ${t*u}px;margin-bottom: ${t*l}px;border-top-width: ${t*d}px;border-bottom-width: ${t*f}px;`}}function at(t,{delay:n=0,duration:e=400,easing:o=tt,start:r=0,opacity:i=0}={}){const a=getComputedStyle(t),s=+a.opacity,c="none"===a.transform?"":a.transform,u=1-r,l=s*(1-i);return{delay:n,duration:e,easing:o,css:(t,n)=>`\n\t\t\ttransform: ${c} scale(${1-u*n});\n\t\t\topacity: ${s-l*n}\n\t\t`}}function st(t,{delay:n=0,speed:e,duration:o,easing:r=Y}={}){const i=t.getTotalLength();return void 0===o?o=void 0===e?800:i/e:"function"==typeof o&&(o=o(i)),{delay:n,duration:o,easing:r,css:(t,n)=>`stroke-dasharray: ${t*i} ${n*i}`}}function ct(t){var{fallback:n}=t,o=function(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r(t.set(c.key,{rect:s.getBoundingClientRect()}),()=>{if(r.has(c.key)){const{rect:t}=r.get(c.key);return r.delete(c.key),function(t,n,r){const{delay:i=0,duration:s=(t=>30*Math.sqrt(t)),easing:c=tt}=e(e({},o),r),u=n.getBoundingClientRect(),l=t.left-u.left,d=t.top-u.top,f=t.width/u.width,p=t.height/u.height,g=Math.sqrt(l*l+d*d),h=getComputedStyle(n),m="none"===h.transform?"":h.transform,y=+h.opacity;return{delay:i,duration:a(s)?s(g):s,easing:c,css:(t,n)=>`\n\t\t\t\topacity: ${t*y};\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: ${m} translate(${n*l}px,${n*d}px) scale(${t+(1-t)*f}, ${t+(1-t)*p});\n\t\t\t`}}(t,s,c)}return t.delete(c.key),n&&n(s,c,i)})}return[s(i,r,!1),s(r,i,!0)]}function ut(e){let o,r,s,c,l,d,f,h,m,x,k,C,S,F,j,B,M,R,N,T,P,q,L;return{c(){o=b("p"),o.textContent="Fade",s=w(),c=b("p"),c.textContent="Blur",d=w(),f=b("p"),f.textContent="Fly",m=w(),x=b("p"),x.textContent="Slide",C=w(),S=b("p"),S.textContent="Scale",j=w(),B=_("svg"),M=_("path"),N=w(),T=b("p"),T.textContent="Crossfade",v(M,"d","m1139.31 208.73s-799.28 1.15-784.89.44 786.4-10.92 770.57-10.92-810.14 \n\t1.44-787.84-.72 777-16.54 777-16.54c-32.37 2.87-739.57 1.43-757.55-1.44"),v(M,"fill","none"),v(M,"stroke","#484596"),v(M,"stroke-linecap","round"),v(M,"stroke-linejoin","round"),v(M,"stroke-width","10"),v(M,"transform","translate(-331.69 -174.55)"),v(B,"class","hero__underline"),v(B,"viewBox","0 0 812.62 39.85"),v(B,"xmlns","http://www.w3.org/2000/svg")},m(t,n){y(t,o,n),y(t,s,n),y(t,c,n),y(t,d,n),y(t,f,n),y(t,m,n),y(t,x,n),y(t,C,n),y(t,S,n),y(t,j,n),y(t,B,n),g(B,M),y(t,N,n),y(t,T,n),L=!0},p(t,n){e=t},i(i){L||(A((()=>{r||(r=U(o,ot,{},!0)),r.run(1)})),A((()=>{l||(l=U(c,et,{},!0)),l.run(1)})),A((()=>{h||(h=U(f,rt,{x:-100,opacity:1,easing:Z},!0)),h.run(1)})),A((()=>{k||(k=U(x,it,{},!0)),k.run(1)})),A((()=>{F||(F=U(S,at,{delay:250,duration:300,easing:nt},!0)),F.run(1)})),A((()=>{R||(R=U(M,st,{duration:1e3},!0)),R.run(1)})),A((()=>{q&&q.end(1),P=function(e,o,r){let i,s,c=o(e,r),l=!1,d=0;function f(){i&&O(e,i)}function g(){const{delay:o=0,duration:r=300,easing:a=n,tick:g=t,css:h}=c||Q;h&&(i=E(e,0,1,r,o,a,h,d++)),g(0,1);const m=u()+o,y=m+r;s&&s.abort(),l=!0,A((()=>I(e,!0,"start"))),s=p((t=>{if(l){if(t>=y)return g(1,0),I(e,!0,"end"),f(),l=!1;if(t>=m){const n=a((t-m)/r);g(n,1-n)}}return l}))}let h=!1;return{start(){h||(h=!0,O(e),a(c)?(c=c(),W().then(g)):g())},invalidate(){h=!1},end(){l&&(f(),l=!1)}}}(T,e[1],{}),P.start()})),L=!0)},o(s){r||(r=U(o,ot,{},!1)),r.run(0),l||(l=U(c,et,{},!1)),l.run(0),h||(h=U(f,rt,{x:-100,opacity:1,easing:Z},!1)),h.run(0),k||(k=U(x,it,{},!1)),k.run(0),F||(F=U(S,at,{delay:250,duration:300,easing:nt},!1)),F.run(0),R||(R=U(M,st,{duration:1e3},!1)),R.run(0),P&&P.invalidate(),q=function(e,o,r){let s,c=o(e,r),l=!0;const d=H;function f(){const{delay:o=0,duration:r=300,easing:a=n,tick:f=t,css:g}=c||Q;g&&(s=E(e,1,0,r,o,a,g));const h=u()+o,m=h+r;A((()=>I(e,!1,"start"))),p((t=>{if(l){if(t>=m)return f(0,1),I(e,!1,"end"),--d.r||i(d.c),!1;if(t>=h){const n=a((t-h)/r);f(1-n,n)}}return l}))}return d.r+=1,a(c)?W().then((()=>{c=c(),f()})):f(),{end(t){t&&c.tick&&c.tick(1,0),l&&(s&&O(e,s),l=!1)}}}(T,e[2],{}),L=!1},d(t){t&&$(o),t&&r&&r.end(),t&&$(s),t&&$(c),t&&l&&l.end(),t&&$(d),t&&$(f),t&&h&&h.end(),t&&$(m),t&&$(x),t&&k&&k.end(),t&&$(C),t&&$(S),t&&F&&F.end(),t&&$(j),t&&$(B),t&&R&&R.end(),t&&$(N),t&&$(T),t&&q&&q.end()}}}function lt(t){let n,e,o,r,a,s,c,u,l,d,f=t[0]&&ut(t);return{c(){n=b("label"),e=b("h1"),e.textContent="Svelte Test Transitions",o=w(),r=b("input"),a=x("\n\tShow transitions"),s=w(),f&&f.c(),c=x(""),v(r,"type","checkbox")},m(i,p){var h,m,$,b;y(i,n,p),g(n,e),g(n,o),g(n,r),r.checked=t[0],g(n,a),y(i,s,p),f&&f.m(i,p),y(i,c,p),u=!0,l||(h=r,m="change",$=t[3],h.addEventListener(m,$,b),d=()=>h.removeEventListener(m,$,b),l=!0)},p(t,[n]){1&n&&(r.checked=t[0]),t[0]?f?(f.p(t,n),1&n&&J(f,1)):(f=ut(t),f.c(),J(f,1),f.m(c.parentNode,c)):f&&(H={r:0,c:[],p:H},K(f,1,1,(()=>{f=null})),H.r||i(H.c),H=H.p)},i(t){u||(J(f),u=!0)},o(t){K(f),u=!1},d(t){t&&$(n),t&&$(s),f&&f.d(t),t&&$(c),l=!1,d()}}}function dt(t,n,e){const[o,r]=ct({fallback:ot,duration:2e3});let i=!1;return[i,o,r,function(){i=this.checked,e(0,i)}]}return new class extends class{$destroy(){!function(t,n){const e=t.$$;null!==e.fragment&&(i(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){super(),X(this,t,dt,lt,s,{})}}({target:document.body})}(); +//# sourceMappingURL=bundle.js.map diff --git a/test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/favicon.png b/test/svelte-styles-csp/svelte-test-transitions-no-styles-csp/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..7e6f5eb5a2f1f1c882d265cf479de25caa925645 GIT binary patch literal 3127 zcmV-749N3|P)i z7)}s4L53SJCkR}iVi00SFk;`MXX*#X*kkwKs@nFGS}c;=?XFjU|G$3t^5sjIVS2G+ zw)WGF83CpoGXhLGW(1gW%uV|X7>1P6VhCX=Ux)Lb!*DZ%@I3!{Gsf7d?gtIQ%nQiK z3%(LUSkBji;C5Rfgd6$VsF@H`Pk@xtY6t<>FNR-pD}=C~$?)9pdm3XZ36N5PNWYjb z$xd$yNQR9N!dfj-Vd@BwQo^FIIWPPmT&sZyQ$v81(sCBV=PGy{0wltEjB%~h157*t zvbe_!{=I_783x!0t1-r#-d{Y?ae$Q4N_Nd^Ui^@y(%)Gjou6y<3^XJdu{rmUf-Me?)zZ>9OR&6U5H*cK; z$gUlB{g0O4gN0sLSO|Of?hU(l?;h(jA3uH!Z{EBKuV23ouU@^Y6#%v+QG;>e*E}%?wlu-NT4DG zs)z)7WbLr)vGAu(ohrKc^em@OpO&f~6_>E61n_e0_V3@{U3^O;j{`^mNCJUj_>;7v zsMs6Hu3g7+@v+lSo;=yTYFqq}jZmQ-BK8K{C4kqi_i*jBaQE(Au0607V-zKeT;EPg zX(`vrn=L+e74+-Tqeok@_`tDa$G9I|$nTU5H*2V8@y()n*zqM?J1G!-1aX;CfDC9B zTnJ#j_%*n8Qb1)re*Bno7g0RG{Eb;IK14irJYJp$5Z6ac9~b_P?+5t~95~SRG$g?1 znFJ7p$xV&GZ18m~79TGRdfsc-BcX$9yXTR*n)mPD@1~O(_?cT$ZvFPucRmGlq&se0 zKrcUf^k}4hM*biEJOWKzz!qQe;CB_ZtSOO9Owg#lZAc=s65^rb{fZe(TYu_rk!wKkEf}RIt=#Om( zR8mN`DM<^xj~59euMMspBolVN zAPTr8sSDI104orIAdmL$uOXn*6hga1G+0WD0E?UtabxC#VC~vf3|10|phW;yQ3CY8 z2CM=)ErF;xq-YJ5G|um}>*1#E+O_Mu|Nr#qQ&G1P-NMq@f?@*XUcSbV?tX=)ilM-Q zBZP|!Bpv0V;#ojKcpc7$=eqO;#Uy~#?^kNI{vSZfLx&DEt~LTmaKWXcx=joubklI<*Aw z>LtMaQ7DR<1I2LkWvwyu#Rwn~;ezT}_g(@5l3h?W%-a86Y-t#O1PubP+z<%?V5D(U zy57A6{h+{?kOZp7&WKZR+=sznMJ}+Dnpo=C_0%R_x_t~J5T?E_{+))l5v1%52>)d-`iiZyx|5!%M2Fb2dU zW3~MwwpEH9Rhue+k$UIOoo($Ds!NbOyMR36fRHu;*15(YcA7siIZk#%JWz>P!qX1?IUojG&nKR>^gArBt2 zit(ETyZ=@V&7mv_Fi4bABcnwP+jzQuHcfU&BrAV91u-rFvEi7y-KnWsvHH=d2 zgAk(GKm_S8RcTJ>2N3~&Hbwp{Z3NF_Xeh}g4Eke)V&dY{W(3&b1j9t4yK_aYJisZZ{1rcU5- z;eD>K;ndPq&B-8yA_S0F!4ThA&{1{x)H<#?k9a#6Pc6L?V^s0``ynL&D;p(!Nmx`Y zFkHex{4p!Ggm^@DlehW}iHHVi}~u=$&N? z(NEBLQ#UxxAkdW>X9LnqUr#t4Lu0=9L8&o>JsqTtT5|%gb3QA~hr0pED71+iFFr)dZ=Q=E6ng{NE{Z~0)C?deO#?Aj zSDQ$z#TeC2T^|=}6GBo-&$;E{HL3!q3Z-szuf)O=G#zDjin4SSP%o%6+2IT#sLjQa ziyxFFz~LMjWY+_a5H!U6%a<=b7QVP^ z*90a62;bVq{?@)P6^DWd^Yilq4|YTV2Nw!Yu;a1lPI-sxR)rf@Fe5DhDP7FH zZZ%4S*1C30P;|O+jB!1;m|rXT90Sm5*RBbQN`PKu+hDD*S^yE(CdtSfg=z>u$cIj> z + + + + + + Svelte app + + + + + + + + + + + diff --git a/test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/bundle.css b/test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/bundle.css new file mode 100644 index 0000000000..bc30dc15b2 --- /dev/null +++ b/test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/bundle.css @@ -0,0 +1 @@ +h1.svelte-i7qo5m{color:purple}.contact-card.svelte-vatk6b{box-shadow:0 2px 8px rgba(0, 0, 0, 0.26);max-width:30rem;border-radius:5px;margin:1rem 0}header.svelte-vatk6b{display:flex;justify-content:space-between;align-items:center;height:7rem}.thumb.svelte-vatk6b{width:33%;height:100%}.thumb-placeholder.svelte-vatk6b{background-color:grey}img.svelte-vatk6b{width:100%;height:100%;object-fit:cover}.user-data.svelte-vatk6b{width:67%;display:flex;flex-direction:column;justify-content:center}h1.svelte-vatk6b{font-size:1.25rem;font-family:"Roboto Slab", sans-serif;margin:0.5rem 0}h2.svelte-vatk6b{font-size:1rem;font-weight:normal;color:#5a5a5a;margin:0;margin-bottom:0.5rem}.description.svelte-vatk6b{border-top:1px solid #ccc;padding:1rem} \ No newline at end of file diff --git a/test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/bundle.js b/test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/bundle.js new file mode 100644 index 0000000000..ad74590ec9 --- /dev/null +++ b/test/svelte-styles-csp/svelte-test-transitions-styles-csp/build/bundle.js @@ -0,0 +1,2 @@ +var app=function(){"use strict";function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(){return Object.create(null)}function s(t){t.forEach(o)}function i(t){return"function"==typeof t}function a(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}const c="undefined"!=typeof window;let u=c?()=>window.performance.now():()=>Date.now(),l=c?t=>requestAnimationFrame(t):t;const d=new Set;function f(t){d.forEach((n=>{n.c(t)||(d.delete(n),n.f())})),0!==d.size&&l(f)}function p(t){let n;return 0===d.size&&l(f),{promise:new Promise((e=>{d.add(n={c:t,f:e})})),abort(){d.delete(n)}}}function h(t,n){t.appendChild(n)}function g(t){if(!t)return document;const n=t.getRootNode?t.getRootNode():t.ownerDocument;return n&&n.host?n:t.ownerDocument}function m(t){const n=_("style");return function(t,n){h(t.head||t,n)}(g(t),n),n}function y(t,n,e){t.insertBefore(n,e||null)}function $(t){t.parentNode.removeChild(t)}function _(t){return document.createElement(t)}function b(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function x(t){return document.createTextNode(t)}function v(){return x(" ")}function w(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function k(t){let n,e=t[0],o=1;for(;oe.call(n,...t))),n=void 0)}return e}const C=new Set;let S,E=0;function F(t,n,e,o,r,s,i,a=0){const c=16.666/o;let u="{\n";for(let t=0;t<=1;t+=c){const o=n+(e-n)*s(t);u+=100*t+`%{${i(o,1-o)}}\n`}const l=u+`100% {${i(e,1-e)}}\n}`,d=`__svelte_${function(t){let n=5381,e=t.length;for(;e--;)n=(n<<5)-n^t.charCodeAt(e);return n>>>0}(l)}_${a}`,f=g(t);let p;C.add(f),f.__svelte_stylesheet||(p=function(t){let n;for(let e=0;et.cssRules]);if(r&&"svelte-stylesheet"===o.title&&0===r.length){n=e;break}}return n}(document.styleSheets));const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=(y=document.styleSheets[p],$=()=>m(t).sheet,null!=y?y:$()));var y,$;const _=f.__svelte_rules||(f.__svelte_rules={});_[d]||(_[d]=!0,h.insertRule(`@keyframes ${d} ${l}`,h.cssRules.length));const b=t.style.animation||"";return t.style.animation=`${b?`${b}, `:""}${d} ${o}ms linear ${r}ms 1 both`,E+=1,d}function A(t,n){const e=(t.style.animation||"").split(", "),o=e.filter(n?t=>t.indexOf(n)<0:t=>-1===t.indexOf("__svelte")),r=e.length-o.length;r&&(t.style.animation=o.join(", "),E-=r,E||l((()=>{E||(C.forEach((t=>{const n=t.__svelte_stylesheet;let e=n.cssRules.length;for(;e--;)n.deleteRule(e);t.__svelte_rules={}})),C.clear())})))}function R(t){S=t}const B=[],M=[],N=[],T=[],j=Promise.resolve();let O=!1;function q(t){N.push(t)}let L=!1;const P=new Set;function D(){if(!L){L=!0;do{for(let t=0;t{z=null}))),z}function G(t,n,e){t.dispatchEvent(function(t,n,e=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,!1,n),o}(`${n?"intro":"outro"}${e}`))}const H=new Set;let J;function K(t,n){t&&t.i&&(H.delete(t),t.i(n))}function Q(t,n,e,o){if(t&&t.o){if(H.has(t))return;H.add(t),J.c.push((()=>{H.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const U={duration:0};function V(e,o,r,a){let c=o(e,r),l=a?0:1,d=null,f=null,h=null;function g(){h&&A(e,h)}function m(t,n){const e=t.b-l;return n*=Math.abs(e),{a:l,b:t.b,d:e,duration:n,start:t.start,end:t.start+n,group:t.group}}function y(o){const{delay:r=0,duration:i=300,easing:a=n,tick:y=t,css:$}=c||U,_={start:u()+r,b:o};o||(_.group=J,J.r+=1),d||f?f=_:($&&(g(),h=F(e,l,o,i,r,a,$)),o&&y(0,1),d=m(_,i),q((()=>G(e,o,"start"))),p((t=>{if(f&&t>f.start&&(d=m(f,i),f=null,G(e,d.b,"start"),$&&(g(),h=F(e,l,d.b,d.duration,0,a,c.css))),d)if(t>=d.end)y(l=d.b,1-l),G(e,d.b,"end"),f||(d.b?g():--d.group.r||s(d.group.c)),d=null;else if(t>=d.start){const n=t-d.start;l=d.a+d.d*a(n/d.duration),y(l,1-l)}return!(!d&&!f)})))}return{run(t){i(c)?I().then((()=>{c=c(),y(t)})):y(t)},end(){g(),d=f=null}}}function X(t,n){-1===t.$$.dirty[0]&&(B.push(t),O||(O=!0,j.then(D)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const r=o.length?o[0]:e;return h.ctx&&u(h.ctx[t],h.ctx[t]=r)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](r),g&&X(n,t)),e})):[],h.update(),g=!0,s(h.before_update),h.fragment=!!c&&c(h.ctx),e.target){if(e.hydrate){const t=function(t){return Array.from(t.childNodes)}(e.target);h.fragment&&h.fragment.l(t),t.forEach($)}else h.fragment&&h.fragment.c();e.intro&&K(n.$$.fragment),function(t,n,e,r){const{fragment:a,on_mount:c,on_destroy:u,after_update:l}=t.$$;a&&a.m(n,e),r||q((()=>{const n=c.map(o).filter(i);u?u.push(...n):s(n),t.$$.on_mount=[]})),l.forEach(q)}(n,e.target,e.anchor,e.customElement),D()}R(p)}function Z(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function tt(t){return t*t*t}function nt(t){const n=t-1;return n*n*n+1}function et(t){return--t*t*t*t*t+1}function ot(t,{delay:n=0,duration:e=400,easing:o=Z,amount:r=5,opacity:s=0}={}){const i=getComputedStyle(t),a=+i.opacity,c="none"===i.filter?"":i.filter,u=a*(1-s);return{delay:n,duration:e,easing:o,css:(t,n)=>`opacity: ${a-u*n}; filter: ${c} blur(${n*r}px);`}}function rt(t,{delay:e=0,duration:o=400,easing:r=n}={}){const s=+getComputedStyle(t).opacity;return{delay:e,duration:o,easing:r,css:t=>"opacity: "+t*s}}function st(t,{delay:n=0,duration:e=400,easing:o=nt,x:r=0,y:s=0,opacity:i=0}={}){const a=getComputedStyle(t),c=+a.opacity,u="none"===a.transform?"":a.transform,l=c*(1-i);return{delay:n,duration:e,easing:o,css:(t,n)=>`\n\t\t\ttransform: ${u} translate(${(1-t)*r}px, ${(1-t)*s}px);\n\t\t\topacity: ${c-l*n}`}}function it(t,{delay:n=0,duration:e=400,easing:o=nt}={}){const r=getComputedStyle(t),s=+r.opacity,i=parseFloat(r.height),a=parseFloat(r.paddingTop),c=parseFloat(r.paddingBottom),u=parseFloat(r.marginTop),l=parseFloat(r.marginBottom),d=parseFloat(r.borderTopWidth),f=parseFloat(r.borderBottomWidth);return{delay:n,duration:e,easing:o,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*s};height: ${t*i}px;padding-top: ${t*a}px;padding-bottom: ${t*c}px;margin-top: ${t*u}px;margin-bottom: ${t*l}px;border-top-width: ${t*d}px;border-bottom-width: ${t*f}px;`}}function at(t,{delay:n=0,duration:e=400,easing:o=nt,start:r=0,opacity:s=0}={}){const i=getComputedStyle(t),a=+i.opacity,c="none"===i.transform?"":i.transform,u=1-r,l=a*(1-s);return{delay:n,duration:e,easing:o,css:(t,n)=>`\n\t\t\ttransform: ${c} scale(${1-u*n});\n\t\t\topacity: ${a-l*n}\n\t\t`}}function ct(t,{delay:n=0,speed:e,duration:o,easing:r=Z}={}){let s=t.getTotalLength();const i=getComputedStyle(t);return"butt"!==i.strokeLinecap&&(s+=parseInt(i.strokeWidth)),void 0===o?o=void 0===e?800:s/e:"function"==typeof o&&(o=o(s)),{delay:n,duration:o,easing:r,css:(t,n)=>`stroke-dasharray: ${t*s} ${n*s}`}}function ut({fallback:t,...n}){const o=new Map,r=new Map;function s(o,r,s){return(a,c)=>(o.set(c.key,{rect:a.getBoundingClientRect()}),()=>{if(r.has(c.key)){const{rect:t}=r.get(c.key);return r.delete(c.key),function(t,o,r){const{delay:s=0,duration:a=(t=>30*Math.sqrt(t)),easing:c=nt}=e(e({},n),r),u=o.getBoundingClientRect(),l=t.left-u.left,d=t.top-u.top,f=t.width/u.width,p=t.height/u.height,h=Math.sqrt(l*l+d*d),g=getComputedStyle(o),m="none"===g.transform?"":g.transform,y=+g.opacity;return{delay:s,duration:i(a)?a(h):a,easing:c,css:(t,n)=>`\n\t\t\t\topacity: ${t*y};\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: ${m} translate(${n*l}px,${n*d}px) scale(${t+(1-t)*f}, ${t+(1-t)*p});\n\t\t\t`}}(t,a,c)}return o.delete(c.key),t&&t(a,c,s)})}return[s(r,o,!1),s(o,r,!0)]}function lt(e){let o,r,a,c,l,d,f,g,m,x,k,C,S,E,R,B,M,N,T,j,O,L,P;return{c(){o=_("p"),o.textContent="Fade",a=v(),c=_("p"),c.textContent="Blur",d=v(),f=_("p"),f.textContent="Fly",m=v(),x=_("p"),x.textContent="Slide",C=v(),S=_("p"),S.textContent="Scale",R=v(),B=b("svg"),M=b("path"),T=v(),j=_("p"),j.textContent="Crossfade",w(M,"d","m1139.31 208.73s-799.28 1.15-784.89.44 786.4-10.92 770.57-10.92-810.14 \n\t1.44-787.84-.72 777-16.54 777-16.54c-32.37 2.87-739.57 1.43-757.55-1.44"),w(M,"fill","none"),w(M,"stroke","#484596"),w(M,"stroke-linecap","round"),w(M,"stroke-linejoin","round"),w(M,"stroke-width","10"),w(M,"transform","translate(-331.69 -174.55)"),w(B,"class","hero__underline"),w(B,"viewBox","0 0 812.62 39.85"),w(B,"xmlns","http://www.w3.org/2000/svg")},m(t,n){y(t,o,n),y(t,a,n),y(t,c,n),y(t,d,n),y(t,f,n),y(t,m,n),y(t,x,n),y(t,C,n),y(t,S,n),y(t,R,n),y(t,B,n),h(B,M),y(t,T,n),y(t,j,n),P=!0},p(t,n){e=t},i(s){P||(q((()=>{r||(r=V(o,rt,{},!0)),r.run(1)})),q((()=>{l||(l=V(c,ot,{},!0)),l.run(1)})),q((()=>{g||(g=V(f,st,{x:-100,opacity:1,easing:tt},!0)),g.run(1)})),q((()=>{k||(k=V(x,it,{},!0)),k.run(1)})),q((()=>{E||(E=V(S,at,{delay:250,duration:300,easing:et},!0)),E.run(1)})),q((()=>{N||(N=V(M,ct,{duration:1e3},!0)),N.run(1)})),q((()=>{L&&L.end(1),O=function(e,o,r){let s,a,c=o(e,r),l=!1,d=0;function f(){s&&A(e,s)}function h(){const{delay:o=0,duration:r=300,easing:i=n,tick:h=t,css:g}=c||U;g&&(s=F(e,0,1,r,o,i,g,d++)),h(0,1);const m=u()+o,y=m+r;a&&a.abort(),l=!0,q((()=>G(e,!0,"start"))),a=p((t=>{if(l){if(t>=y)return h(1,0),G(e,!0,"end"),f(),l=!1;if(t>=m){const n=i((t-m)/r);h(n,1-n)}}return l}))}let g=!1;return{start(){g||(g=!0,A(e),i(c)?(c=c(),I().then(h)):h())},invalidate(){g=!1},end(){l&&(f(),l=!1)}}}(j,e[1],{}),O.start()})),P=!0)},o(a){r||(r=V(o,rt,{},!1)),r.run(0),l||(l=V(c,ot,{},!1)),l.run(0),g||(g=V(f,st,{x:-100,opacity:1,easing:tt},!1)),g.run(0),k||(k=V(x,it,{},!1)),k.run(0),E||(E=V(S,at,{delay:250,duration:300,easing:et},!1)),E.run(0),N||(N=V(M,ct,{duration:1e3},!1)),N.run(0),O&&O.invalidate(),L=function(e,o,r){let a,c=o(e,r),l=!0;const d=J;function f(){const{delay:o=0,duration:r=300,easing:i=n,tick:f=t,css:h}=c||U;h&&(a=F(e,1,0,r,o,i,h));const g=u()+o,m=g+r;q((()=>G(e,!1,"start"))),p((t=>{if(l){if(t>=m)return f(0,1),G(e,!1,"end"),--d.r||s(d.c),!1;if(t>=g){const n=i((t-g)/r);f(1-n,n)}}return l}))}return d.r+=1,i(c)?I().then((()=>{c=c(),f()})):f(),{end(t){t&&c.tick&&c.tick(1,0),l&&(a&&A(e,a),l=!1)}}}(j,e[2],{}),P=!1},d(t){t&&$(o),t&&r&&r.end(),t&&$(a),t&&$(c),t&&l&&l.end(),t&&$(d),t&&$(f),t&&g&&g.end(),t&&$(m),t&&$(x),t&&k&&k.end(),t&&$(C),t&&$(S),t&&E&&E.end(),t&&$(R),t&&$(B),t&&N&&N.end(),t&&$(T),t&&$(j),t&&L&&L.end()}}}function dt(t){let n,e,o,r,i,a,c,u,l,d,f=t[0]&<(t);return{c(){n=_("label"),e=_("h1"),e.textContent="Svelte Test Transitions (Svelte-Stylesheet CSP)",o=v(),r=_("input"),i=x("\n\tShow transitions"),a=v(),f&&f.c(),c=x(""),w(r,"type","checkbox")},m(s,p){var g,m,$,_;y(s,n,p),h(n,e),h(n,o),h(n,r),r.checked=t[0],h(n,i),y(s,a,p),f&&f.m(s,p),y(s,c,p),u=!0,l||(g=r,m="change",$=t[3],g.addEventListener(m,$,_),d=()=>g.removeEventListener(m,$,_),l=!0)},p(t,[n]){1&n&&(r.checked=t[0]),t[0]?f?(f.p(t,n),1&n&&K(f,1)):(f=lt(t),f.c(),K(f,1),f.m(c.parentNode,c)):f&&(J={r:0,c:[],p:J},Q(f,1,1,(()=>{f=null})),J.r||s(J.c),J=J.p)},i(t){u||(K(f),u=!0)},o(t){Q(f),u=!1},d(t){t&&$(n),t&&$(a),f&&f.d(t),t&&$(c),l=!1,d()}}}function ft(t,n,e){const[o,r]=ut({fallback:rt,duration:2e3});let s=!1;return[s,o,r,function(){s=this.checked,e(0,s)}]}return new class extends class{$destroy(){!function(t,n){const e=t.$$;null!==e.fragment&&(s(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){super(),Y(this,t,ft,dt,a,{})}}({target:document.body})}(); +//# sourceMappingURL=bundle.js.map diff --git a/test/svelte-styles-csp/svelte-test-transitions-styles-csp/favicon.png b/test/svelte-styles-csp/svelte-test-transitions-styles-csp/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..7e6f5eb5a2f1f1c882d265cf479de25caa925645 GIT binary patch literal 3127 zcmV-749N3|P)i z7)}s4L53SJCkR}iVi00SFk;`MXX*#X*kkwKs@nFGS}c;=?XFjU|G$3t^5sjIVS2G+ zw)WGF83CpoGXhLGW(1gW%uV|X7>1P6VhCX=Ux)Lb!*DZ%@I3!{Gsf7d?gtIQ%nQiK z3%(LUSkBji;C5Rfgd6$VsF@H`Pk@xtY6t<>FNR-pD}=C~$?)9pdm3XZ36N5PNWYjb z$xd$yNQR9N!dfj-Vd@BwQo^FIIWPPmT&sZyQ$v81(sCBV=PGy{0wltEjB%~h157*t zvbe_!{=I_783x!0t1-r#-d{Y?ae$Q4N_Nd^Ui^@y(%)Gjou6y<3^XJdu{rmUf-Me?)zZ>9OR&6U5H*cK; z$gUlB{g0O4gN0sLSO|Of?hU(l?;h(jA3uH!Z{EBKuV23ouU@^Y6#%v+QG;>e*E}%?wlu-NT4DG zs)z)7WbLr)vGAu(ohrKc^em@OpO&f~6_>E61n_e0_V3@{U3^O;j{`^mNCJUj_>;7v zsMs6Hu3g7+@v+lSo;=yTYFqq}jZmQ-BK8K{C4kqi_i*jBaQE(Au0607V-zKeT;EPg zX(`vrn=L+e74+-Tqeok@_`tDa$G9I|$nTU5H*2V8@y()n*zqM?J1G!-1aX;CfDC9B zTnJ#j_%*n8Qb1)re*Bno7g0RG{Eb;IK14irJYJp$5Z6ac9~b_P?+5t~95~SRG$g?1 znFJ7p$xV&GZ18m~79TGRdfsc-BcX$9yXTR*n)mPD@1~O(_?cT$ZvFPucRmGlq&se0 zKrcUf^k}4hM*biEJOWKzz!qQe;CB_ZtSOO9Owg#lZAc=s65^rb{fZe(TYu_rk!wKkEf}RIt=#Om( zR8mN`DM<^xj~59euMMspBolVN zAPTr8sSDI104orIAdmL$uOXn*6hga1G+0WD0E?UtabxC#VC~vf3|10|phW;yQ3CY8 z2CM=)ErF;xq-YJ5G|um}>*1#E+O_Mu|Nr#qQ&G1P-NMq@f?@*XUcSbV?tX=)ilM-Q zBZP|!Bpv0V;#ojKcpc7$=eqO;#Uy~#?^kNI{vSZfLx&DEt~LTmaKWXcx=joubklI<*Aw z>LtMaQ7DR<1I2LkWvwyu#Rwn~;ezT}_g(@5l3h?W%-a86Y-t#O1PubP+z<%?V5D(U zy57A6{h+{?kOZp7&WKZR+=sznMJ}+Dnpo=C_0%R_x_t~J5T?E_{+))l5v1%52>)d-`iiZyx|5!%M2Fb2dU zW3~MwwpEH9Rhue+k$UIOoo($Ds!NbOyMR36fRHu;*15(YcA7siIZk#%JWz>P!qX1?IUojG&nKR>^gArBt2 zit(ETyZ=@V&7mv_Fi4bABcnwP+jzQuHcfU&BrAV91u-rFvEi7y-KnWsvHH=d2 zgAk(GKm_S8RcTJ>2N3~&Hbwp{Z3NF_Xeh}g4Eke)V&dY{W(3&b1j9t4yK_aYJisZZ{1rcU5- z;eD>K;ndPq&B-8yA_S0F!4ThA&{1{x)H<#?k9a#6Pc6L?V^s0``ynL&D;p(!Nmx`Y zFkHex{4p!Ggm^@DlehW}iHHVi}~u=$&N? z(NEBLQ#UxxAkdW>X9LnqUr#t4Lu0=9L8&o>JsqTtT5|%gb3QA~hr0pED71+iFFr)dZ=Q=E6ng{NE{Z~0)C?deO#?Aj zSDQ$z#TeC2T^|=}6GBo-&$;E{HL3!q3Z-szuf)O=G#zDjin4SSP%o%6+2IT#sLjQa ziyxFFz~LMjWY+_a5H!U6%a<=b7QVP^ z*90a62;bVq{?@)P6^DWd^Yilq4|YTV2Nw!Yu;a1lPI-sxR)rf@Fe5DhDP7FH zZZ%4S*1C30P;|O+jB!1;m|rXT90Sm5*RBbQN`PKu+hDD*S^yE(CdtSfg=z>u$cIj> z + + + + + + Svelte app + + + + + + + + + + + + diff --git a/test/svelte-styles-csp/svelte-test-transitions-styles-csp/svelte-stylesheet.css b/test/svelte-styles-csp/svelte-test-transitions-styles-csp/svelte-stylesheet.css new file mode 100644 index 0000000000..e69de29bb2