-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhancement] Support Cloning Custom Elements (#129)
* feat(custom-elements): ✨ obtain children of shadow node for custom elements Inspired by tsayen/dom-to-image#370 If element has `shadowRoot` property it is custom (and the shadow node is open) so fetch it's children. Closes #128 * fix: 🐛 add safety checks to support special/custom elements Introduced by 021f124 Access to shadow node exposes the code to custom elements that break the current code. Was breaking because of elements without a style node. This commit fixes these bugs with simple, NON-BREAKING safety checks. * test(htmltoimage): 🚨 Added tests covering custom elements renders mathfield custom element https://github.com/arnog/mathlive
- Loading branch information
Showing
6 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+sAAAAnCAYAAAB3wtkbAAAHq0lEQVR4Xu3dPagcVRgG4DcgiFiIqFhYRAQRK0XERi1MI6bQGJEUamURRQkEtBKNGqzFEAIi2iQpBBVtgj9g4Q/YKGqjdgERBP/QwiAIyidzYBx3191LNndmeRYC2Xt3Zs55ztzi3XPONzviRYAAAQIECBAgQIAAAQIECIxKYMeoWqMxBAgQIECAAAECBAgQIECAQIR1NwEBAgQIECBAgAABAgQIEBiZgLA+sgHRHAIECBAgQIAAAQIECBAgsClh/YIkzyfZn+T+JCe3MLTtHB9u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/+plNvRH0iwABAgQIECBAgAABAgTGIyCsj2cstIQAAQIECBAgQIAAAQIECPwjIKy7EQgQIECAAAECBAgQIECAwMgEhPWRDYjmECBAgAABAgQIECBAgACBvwE3lBQ3hOt8rQAAAABJRU5ErkJggg== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<math-field | ||
value="S_{\triangle }=\frac{ab\sin \left(\gamma \right)}{2}" | ||
scrollingelement="[object HTMLHtmlElement]" | ||
class="math no-touch" | ||
role="textbox" | ||
tabindex="0" | ||
read-only="" | ||
>S_{\triangle }=\frac{ab\sin \left(\gamma \right)}{2} | ||
</math-field> |
Empty file.