File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -2000,6 +2000,31 @@ function declareTests({useJit}: {useJit: boolean}) {
20002000 } ) ;
20012001 } ) ) ;
20022002
2003+ it ( 'should support foreignObjects with document fragments' ,
2004+ inject (
2005+ [ TestComponentBuilder , AsyncTestCompleter ] ,
2006+ ( tcb : TestComponentBuilder , async : AsyncTestCompleter ) => {
2007+ tcb . overrideView (
2008+ MyComp , new ViewMetadata ( {
2009+ template :
2010+ '<svg><foreignObject><xhtml:div><p>Test</p></xhtml:div></foreignObject></svg>'
2011+ } ) )
2012+ . createAsync ( MyComp )
2013+ . then ( ( fixture ) => {
2014+ var el = fixture . debugElement . nativeElement ;
2015+ var svg = getDOM ( ) . childNodes ( el ) [ 0 ] ;
2016+ var foreignObject = getDOM ( ) . childNodes ( svg ) [ 0 ] ;
2017+ var p = getDOM ( ) . childNodes ( foreignObject ) [ 0 ] ;
2018+ expect ( getDOM ( ) . getProperty ( < Element > svg , 'namespaceURI' ) )
2019+ . toEqual ( 'http://www.w3.org/2000/svg' ) ;
2020+ expect ( getDOM ( ) . getProperty ( < Element > foreignObject , 'namespaceURI' ) )
2021+ . toEqual ( 'http://www.w3.org/2000/svg' ) ;
2022+ expect ( getDOM ( ) . getProperty ( < Element > p , 'namespaceURI' ) )
2023+ . toEqual ( 'http://www.w3.org/1999/xhtml' ) ;
2024+
2025+ async . done ( ) ;
2026+ } ) ;
2027+ } ) ) ;
20032028 } ) ;
20042029
20052030 describe ( 'attributes' , ( ) => {
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ import {camelCaseToDashCase} from './util';
2323
2424const NAMESPACE_URIS = {
2525 'xlink' : 'http://www.w3.org/1999/xlink' ,
26- 'svg' : 'http://www.w3.org/2000/svg'
26+ 'svg' : 'http://www.w3.org/2000/svg' ,
27+ 'xhtml' : 'http://www.w3.org/1999/xhtml'
2728} ;
2829const TEMPLATE_COMMENT_TEXT = 'template bindings={}' ;
2930var TEMPLATE_BINDINGS_EXP = / ^ t e m p l a t e b i n d i n g s = ( .* ) $ / g;
You can’t perform that action at this time.
0 commit comments