Sha256: 3f4e76055925ddbc843ee0235028c200caa4069aff00bed1f7ec95e69ec35d07

Contents?: true

Size: 1019 Bytes

Versions: 20

Compression:

Stored size: 1019 Bytes

Contents

"use strict";

const { parseFragment } = require("../../browser/parser");
const { HTML_NS } = require("../helpers/namespaces.js");
const { isShadowRoot } = require("../helpers/shadow-dom.js");
const NODE_TYPE = require("../node-type.js");
const { fragmentSerialization } = require("./serialization.js");

// https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin
exports.implementation = class InnerHTMLImpl {
  // https://w3c.github.io/DOM-Parsing/#dom-innerhtml-innerhtml
  get innerHTML() {
    return fragmentSerialization(this, {
      requireWellFormed: true,
      globalObject: this._globalObject
    });
  }
  set innerHTML(markup) {
    const contextElement = isShadowRoot(this) ? this.host : this;
    const fragment = parseFragment(markup, contextElement);

    let contextObject = this;
    if (this.nodeType === NODE_TYPE.ELEMENT_NODE && this.localName === "template" && this.namespaceURI === HTML_NS) {
      contextObject = this._templateContents;
    }

    contextObject._replaceAll(fragment);
  }
};

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
appmap-0.72.2 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.72.1 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.72.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.71.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.70.2 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.70.1 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.70.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.69.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.68.2 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.68.1 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.68.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.67.1 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.67.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.66.2 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.66.1 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.66.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.65.1 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.65.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.64.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js
appmap-0.63.0 ./node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js