mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
Prepare root and element nodes for xast
Ref https://github.com/syntax-tree/xast - added type: root | element - renamed elem to name - replaced "elem" property checks with check for correct type
This commit is contained in:
@ -168,7 +168,7 @@ const computeStyle = (node) => {
|
||||
// collect inherited styles
|
||||
const computedStyles = computeOwnStyle(node, stylesheet);
|
||||
let parent = node;
|
||||
while (parent.parentNode && parent.parentNode.elem !== '#document') {
|
||||
while (parent.parentNode && parent.parentNode.type !== 'root') {
|
||||
const inheritedStyles = computeOwnStyle(parent.parentNode, stylesheet);
|
||||
for (const [name, computed] of Object.entries(inheritedStyles)) {
|
||||
if (
|
||||
|
Reference in New Issue
Block a user