mirror of https://github.com/sveltejs/svelte
				
				
				
			Merge pull request #143 from sveltejs/gh-142
	
		
	
				
					
				
			don't render whitespace text nodes inside SVG elementspull/145/head
						commit
						ac9e98f87d
					
				@ -0,0 +1,9 @@
 | 
				
			||||
export default {
 | 
				
			||||
	test ( assert, component, target ) {
 | 
				
			||||
		const svg = target.querySelector( 'svg' );
 | 
				
			||||
 | 
				
			||||
		assert.equal( svg.childNodes.length, 2 );
 | 
				
			||||
		assert.equal( svg.childNodes[0].nodeName, 'rect' );
 | 
				
			||||
		assert.equal( svg.childNodes[1].nodeName, 'rect' );
 | 
				
			||||
	}
 | 
				
			||||
};
 | 
				
			||||
| 
		 After Width: | Height: | Size: 32 B  | 
@ -0,0 +1,21 @@
 | 
				
			||||
export default {
 | 
				
			||||
	data: {
 | 
				
			||||
		x: 0,
 | 
				
			||||
		y: 0,
 | 
				
			||||
		width: 100,
 | 
				
			||||
		height: 100
 | 
				
			||||
	},
 | 
				
			||||
 | 
				
			||||
	html: `<svg><rect x="0" y="0" width="100" height="100"></rect></svg>`,
 | 
				
			||||
 | 
				
			||||
	test ( assert, component, target ) {
 | 
				
			||||
		const svg = target.querySelector( 'svg' );
 | 
				
			||||
		const rect = target.querySelector( 'rect' );
 | 
				
			||||
 | 
				
			||||
		assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' );
 | 
				
			||||
		assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' );
 | 
				
			||||
 | 
				
			||||
		component.set({ width: 150, height: 50 });
 | 
				
			||||
		assert.equal( target.innerHTML, `<svg><rect x="0" y="0" width="150" height="50"></rect></svg>` );
 | 
				
			||||
	}
 | 
				
			||||
};
 | 
				
			||||
| 
		 After Width: | Height: | Size: 115 B  | 
@ -0,0 +1,8 @@
 | 
				
			||||
{
 | 
				
			||||
	"message": "You can only have one <style> tag per component",
 | 
				
			||||
	"loc": {
 | 
				
			||||
		"line": 9,
 | 
				
			||||
		"column": 0
 | 
				
			||||
	},
 | 
				
			||||
	"pos": 58
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,13 @@
 | 
				
			||||
<div>foo</div>
 | 
				
			||||
 | 
				
			||||
<style>
 | 
				
			||||
	div {
 | 
				
			||||
		color: red;
 | 
				
			||||
	}
 | 
				
			||||
</style>
 | 
				
			||||
 | 
				
			||||
<style>
 | 
				
			||||
	div {
 | 
				
			||||
		color: blue;
 | 
				
			||||
	}
 | 
				
			||||
</style>
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue