mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 17:27:22 +08:00
DISABLE_THIRD_PARTY_CHECK=NPM fix R=jacktfranklin@chromium.org Bug: none Change-Id: I41baa3294f88b7e4463fdc580c050932c5abe40e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3372932 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
30 lines
604 B
JavaScript
30 lines
604 B
JavaScript
'use strict';
|
|
|
|
const { detachNodeFromParent } = require('../lib/xast.js');
|
|
|
|
exports.name = 'removeStyleElement';
|
|
exports.type = 'visitor';
|
|
exports.active = false;
|
|
exports.description = 'removes <style> element (disabled by default)';
|
|
|
|
/**
|
|
* Remove <style>.
|
|
*
|
|
* https://www.w3.org/TR/SVG11/styling.html#StyleElement
|
|
*
|
|
* @author Betsy Dupuis
|
|
*
|
|
* @type {import('../lib/types').Plugin<void>}
|
|
*/
|
|
exports.fn = () => {
|
|
return {
|
|
element: {
|
|
enter: (node, parentNode) => {
|
|
if (node.name === 'style') {
|
|
detachNodeFromParent(node, parentNode);
|
|
}
|
|
},
|
|
},
|
|
};
|
|
};
|