X Tutup
Skip to content

Commit 3d96c23

Browse files
committed
Revert "feat(svg): Provide support for SVG foreignObject by adding xhtml namespace"
This reverts commit eb688f2.
1 parent 19cfb4e commit 3d96c23

File tree

3 files changed

+4
-34
lines changed

3 files changed

+4
-34
lines changed

modules/angular2/src/compiler/schema/dom_element_schema_registry.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ import {splitNsName} from 'angular2/src/compiler/html_tags';
66

77
import {ElementSchemaRegistry} from './element_schema_registry';
88

9-
const NAMESPACE_URIS = CONST_EXPR({
10-
'xlink': 'http://www.w3.org/1999/xlink',
11-
'svg': 'http://www.w3.org/2000/svg',
12-
'xhtml': 'http://www.w3.org/1999/xhtml'
13-
});
9+
const NAMESPACE_URIS =
10+
CONST_EXPR({'xlink': 'http://www.w3.org/1999/xlink', 'svg': 'http://www.w3.org/2000/svg'});
1411

1512
@Injectable()
1613
export class DomElementSchemaRegistry extends ElementSchemaRegistry {

modules/angular2/src/platform/dom/dom_renderer.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ import {ViewEncapsulation} from 'angular2/src/core/metadata';
2828
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
2929
import {camelCaseToDashCase} from './util';
3030

31-
const NAMESPACE_URIS = CONST_EXPR({
32-
'xlink': 'http://www.w3.org/1999/xlink',
33-
'svg': 'http://www.w3.org/2000/svg',
34-
'xhtml': 'http://www.w3.org/1999/xhtml'
35-
});
31+
const NAMESPACE_URIS =
32+
CONST_EXPR({'xlink': 'http://www.w3.org/1999/xlink', 'svg': 'http://www.w3.org/2000/svg'});
3633
const TEMPLATE_COMMENT_TEXT = 'template bindings={}';
3734
var TEMPLATE_BINDINGS_EXP = /^template bindings=(.*)$/g;
3835

modules/angular2/test/core/linker/integration_spec.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,30 +1859,6 @@ function declareTests() {
18591859
});
18601860
}));
18611861

1862-
it('should support foreignObjects',
1863-
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
1864-
async) => {
1865-
tcb.overrideView(
1866-
MyComp, new ViewMetadata({
1867-
template:
1868-
'<svg><foreignObject><xhtml:div><p>Test</p></xhtml:div></foreignObject></svg>'
1869-
}))
1870-
.createAsync(MyComp)
1871-
.then((fixture) => {
1872-
var el = fixture.debugElement.nativeElement;
1873-
var svg = DOM.childNodes(el)[0];
1874-
var foreignObject = DOM.childNodes(svg)[0];
1875-
var p = DOM.childNodes(foreignObject)[0];
1876-
expect(DOM.getProperty(<Element>svg, 'namespaceURI'))
1877-
.toEqual('http://www.w3.org/2000/svg');
1878-
expect(DOM.getProperty(<Element>foreignObject, 'namespaceURI'))
1879-
.toEqual('http://www.w3.org/2000/svg');
1880-
expect(DOM.getProperty(<Element>p, 'namespaceURI'))
1881-
.toEqual('http://www.w3.org/1999/xhtml');
1882-
1883-
async.done();
1884-
});
1885-
}));
18861862
});
18871863

18881864
describe('attributes', () => {

0 commit comments

Comments
 (0)
X Tutup