| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 class SVGElementWrappingImplementation extends ElementWrappingImplementation imp
lements SVGElement { | 5 class SVGElementWrappingImplementation extends ElementWrappingImplementation imp
lements SVGElement { |
| 6 SVGElementWrappingImplementation._wrap(ptr) : super._wrap(ptr) {} | 6 SVGElementWrappingImplementation._wrap(ptr) : super._wrap(ptr) {} |
| 7 | 7 |
| 8 factory SVGElementWrappingImplementation.tag(String tag) => | 8 factory SVGElementWrappingImplementation.tag(String tag) => |
| 9 LevelDom.wrapSVGElement(dom.document.createElementNS( | 9 LevelDom.wrapSVGElement(dom.document.createElementNS( |
| 10 "http://www.w3.org/2000/svg", tag)); | 10 "http://www.w3.org/2000/svg", tag)); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 String get outerHTML() { | 54 String get outerHTML() { |
| 55 final container = new Element.tag("div"); | 55 final container = new Element.tag("div"); |
| 56 container.elements.add(this.clone(true)); | 56 container.elements.add(this.clone(true)); |
| 57 return container.innerHTML; | 57 return container.innerHTML; |
| 58 } | 58 } |
| 59 | 59 |
| 60 String get innerHTML() { | 60 String get innerHTML() { |
| 61 final container = new Element.tag("div"); | 61 final container = new Element.tag("div"); |
| 62 container.elements.addAll(this.clone(true).elements); | 62 container.elements.addAll(this.clone(true).dynamic.elements); |
| 63 return container.innerHTML; | 63 return container.innerHTML; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void set innerHTML(String svg) { | 66 void set innerHTML(String svg) { |
| 67 var container = new Element.tag("div"); | 67 var container = new Element.tag("div"); |
| 68 // Wrap the SVG string in <svg> so that SVGElements are created, rather than | 68 // Wrap the SVG string in <svg> so that SVGElements are created, rather than |
| 69 // HTMLElements. | 69 // HTMLElements. |
| 70 container.innerHTML = '<svg version="1.1">$svg</svg>'; | 70 container.innerHTML = '<svg version="1.1">$svg</svg>'; |
| 71 this.elements = container.elements.first.elements; | 71 this.elements = container.elements.first.elements; |
| 72 } | 72 } |
| 73 } | 73 } |
| OLD | NEW |