Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Don't use is="" with custom-style #5

Merged
merged 1 commit into from
Sep 26, 2016
Merged

Don't use is="" with custom-style #5

merged 1 commit into from
Sep 26, 2016

Conversation

rictic
Copy link
Contributor

@rictic rictic commented Sep 26, 2016

No description provided.

const customStyle =
parse5.treeAdapters.default.createElement('custom-style', '', []);
dom5.insertBefore(parent, style, customStyle);
dom5.remove(style);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove shouldn't be necessary if you only append via dom5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice! Done

dom5.setAttribute(customStyle, 'include', include);
dom5.removeAttribute(style, 'include');
}
customStyle.childNodes = customStyle.childNodes || [];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

append() should work with no childNodes with dom5 2.0.0, and it'll correctly remove the element from existing parents.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@rictic rictic changed the base branch from rough-outline to master September 26, 2016 18:00
@rictic rictic merged commit 2db6e47 into master Sep 26, 2016
@rictic rictic deleted the custom-style-no-is branch September 26, 2016 18:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants