版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

55 строки
1.7 KiB

  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const DocumentType_1 = __importDefault(require("../nodes/document-type/DocumentType"));
  7. /**
  8. * The DOMImplementation interface represents an object providing methods which are not dependent on any particular document. Such an object is returned by the.
  9. */
  10. class DOMImplementation {
  11. /**
  12. * Constructor.
  13. *
  14. * @param ownerDocument
  15. */
  16. constructor(ownerDocument) {
  17. this._ownerDocument = null;
  18. this._ownerDocument = ownerDocument;
  19. }
  20. /**
  21. * Creates and returns an XML Document.
  22. *
  23. * TODO: Not fully implemented.
  24. */
  25. createDocument() {
  26. const documentClass = this._ownerDocument.constructor;
  27. // @ts-ignore
  28. documentClass._defaultView = this._ownerDocument.defaultView;
  29. // @ts-ignore
  30. return new documentClass();
  31. }
  32. /**
  33. * Creates and returns an HTML Document.
  34. */
  35. createHTMLDocument() {
  36. return this.createDocument();
  37. }
  38. /**
  39. * Creates and returns an HTML Document.
  40. *
  41. * @param qualifiedName Qualified name.
  42. * @param publicId Public ID.
  43. * @param systemId System ID.
  44. */
  45. createDocumentType(qualifiedName, publicId, systemId) {
  46. DocumentType_1.default._ownerDocument = this._ownerDocument;
  47. const documentType = new DocumentType_1.default();
  48. documentType.name = qualifiedName;
  49. documentType.publicId = publicId;
  50. documentType.systemId = systemId;
  51. return documentType;
  52. }
  53. }
  54. exports.default = DOMImplementation;
  55. //# sourceMappingURL=DOMImplementation.js.map