1 /********************************************** 2 * Copyright (C) 2010 Lukas Laag 3 * This file is part of lib-gwt-svg. 4 * 5 * libgwtsvg is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU Lesser General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * libgwtsvg is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with libgwtsvg. If not, see http://www.gnu.org/licenses/ 17 **********************************************/ 18 /* 19 * Copyright (c) 2004 World Wide Web Consortium, 20 * 21 * (Massachusetts Institute of Technology, European Research Consortium for 22 * Informatics and Mathematics, Keio University). All Rights Reserved. This 23 * work is distributed under the W3C(r) Software License [1] in the hope that 24 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 25 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 26 * 27 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 28 */ 29 30 package org.vectomatic.dom.svg.impl; 31 32 import com.google.gwt.dom.client.Document; 33 34 /** 35 * <p>When an <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement' 36 * title='svg element specification'>svg</a> element is embedded inline as 37 * a component of a document from another namespace, such as when an <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement' 38 * title='svg element specification'>svg</a> element is embedded inline within 39 * an XHTML document [<a href="refs.html#ref-XHTML">XHTML</a>], then an {@link 40 * org.vectomatic.dom.svg.impl.SVGDocument} object will not exist; instead, 41 * the root object in the document object hierarchy will be a Document object 42 * of a different type, such as an HTMLDocument object.</p> <p>However, an 43 * {@link org.vectomatic.dom.svg.impl.SVGDocument} object will indeed exist 44 * when the root element of the XML document hierarchy is an <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement' 45 * title='svg element specification'>svg</a> element, such as when viewing 46 * a stand-alone SVG file (i.e., a file with MIME type "image/svg+xml"). In 47 * this case, the {@link org.vectomatic.dom.svg.impl.SVGDocument} object will 48 * be the root object of the document object model hierarchy.</p> <p>In the 49 * case where an SVG document is embedded by reference, such as when an XHTML 50 * document has an <span class="element-name">'object'</span> element whose 51 * <span class="attr-name">'href'</span> attribute references an SVG document 52 * (i.e., a document whose MIME type is "image/svg+xml" and whose root element 53 * is thus an <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement' 54 * title='svg element specification'>svg</a> element), there will exist two 55 * distinct DOM hierarchies. The first DOM hierarchy will be for the referencing 56 * document (e.g., an XHTML document). The second DOM hierarchy will be for 57 * the referenced SVG document. In this second DOM hierarchy, the root object 58 * of the document object model hierarchy is an {@link org.vectomatic.dom.svg.impl.SVGDocument} 59 * object.</p> <p>The {@link org.vectomatic.dom.svg.impl.SVGDocument} interface 60 * contains a similar list of attributes and methods to the HTMLDocument interface 61 * described in the <a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-html.html">Document 62 * Object Model (HTML) Level 1</a> chapter of the [<a href="refs.html#ref-DOM1">DOM1</a>] 63 * specification.</p> 64 */ 65 public class SVGDocument extends Document { 66 protected SVGDocument() { 67 } 68 69 // Implementation of the svg::SVGDocument W3C IDL interface 70 /** 71 * The root <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement' title='svg 72 * element specification'>svg</a> in the document hierarchy. 73 */ 74 public final native SVGSVGElement getRootElement() /*-{ 75 return this.rootElement; 76 }-*/; 77 78 }