-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Element.attachShadow on MathML element #69
Comments
I don't think getting shadows in core is likely to happen too - core should have that as the vision, it's important because a number of steps required to enable us to get there (IDL sorting out, the shape of discussions about things like links, etc) do belong in core. I would suggest this issue itself move to v2. |
from june 1: level 2 |
It would still be rather useful especially when combined with Custom Math Elements to enable slottable templates. e.g. one could create say a summation element: const template = Template.mathML`
<mrow>
<munderover>
<mo part="summationSymbol">Σ</mo>
<mrow><slot name="lowerBound"></slot></mrow>
<msub><slot name="upperBound"></slot></mrow>
</munderover>
<slot></slot>
</mrow>
`;
class SummationElement extends MathElement {
#shadowRoot = this.attachShadow({ mode: "closed "});
constructor() {
super();
this.#shadowRoot.append(...template.content.cloneNode(true));
}
}
customElements.define("sum-", SummationElement, { namespace: MATH_NAMESPACE }); <math>
<sum->
<mrow slot="lowerBound">
<mi>x</mi>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mn slot="upperBound">10</mn>
<mrow>
<mi>x</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</sum->
</math> |
See https://dom.spec.whatwg.org/#dom-element-attachshadow
@rwlbuis has a one-line patch to allow MathML elements too and @bkardell was able to use it for https://bkardell.com/blog/MathForward.html
The text was updated successfully, but these errors were encountered: