aboutsummaryrefslogtreecommitdiff
path: root/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl.js
blob: e4d23dc1982633a214602d71d5b559c7b8288d42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"use strict";
const HTMLElementImpl = require("./HTMLElement-impl").implementation;
const { formOwner } = require("../helpers/form-controls");
const { HTML_NS } = require("../helpers/namespaces");

class HTMLLegendElementImpl extends HTMLElementImpl {
  get form() {
    const parent = this.parentNode;
    if (parent && parent._localName === "fieldset" && parent.namespaceURI === HTML_NS) {
      return formOwner(parent);
    }
    return null;
  }
}

module.exports = {
  implementation: HTMLLegendElementImpl
};