1 21 24 package org.lobobrowser.html.domimpl; 25 26 import org.lobobrowser.html.*; 27 import org.w3c.dom.DOMException ; 28 import org.w3c.dom.DOMImplementation ; 29 import org.w3c.dom.Document ; 30 import org.w3c.dom.DocumentType ; 31 32 public class DOMImplementationImpl implements DOMImplementation { 33 private final UserAgentContext context; 34 35 public DOMImplementationImpl(UserAgentContext context) { 36 this.context = context; 37 } 38 39 public boolean hasFeature(String feature, String version) { 40 return "HTML".equals(feature) && "2.0".compareTo(version) <= 0; 41 } 42 43 public DocumentType createDocumentType(String qualifiedName, 44 String publicId, String systemId) throws DOMException { 45 return new DocumentTypeImpl(qualifiedName, publicId, systemId); 46 } 47 48 public Document createDocument(String namespaceURI, String qualifiedName, 49 DocumentType doctype) throws DOMException { 50 return new HTMLDocumentImpl(this.context); 51 } 52 53 public Object getFeature(String feature, String version) { 54 if("HTML".equals(feature) && "2.0".compareTo(version) <= 0) { 55 return this; 56 } 57 else { 58 return null; 59 } 60 } 61 } 62 | Popular Tags |