From 4c7e8f6c1c1335e8dede7eccdba86408b8c56cbe Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Tue, 30 Apr 2024 07:53:58 -0500 Subject: [PATCH] refactor: golf -- better gzip, worse brotli --- src/component.js | 9 +++++---- src/render.js | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/component.js b/src/component.js index a215592f87..b56c1bcb30 100644 --- a/src/component.js +++ b/src/component.js @@ -136,11 +136,12 @@ function renderComponent(component) { newVNode, oldVNode, component._globalContext, - component._parentDom.namespaceURI == 'http://www.w3.org/1999/xhtml' - ? 1 - : component._parentDom.namespaceURI == 'http://www.w3.org/2000/svg' + component._parentDom.namespaceURI == 'http://www.w3.org/2000/svg' ? 2 - : 3, + : component._parentDom.namespaceURI == + 'http://www.w3.org/1998/Math/MathML' + ? 3 + : 1, oldVNode._flags & MODE_HYDRATE ? [oldDom] : null, commitQueue, oldDom == null ? getDomSibling(oldVNode) : oldDom, diff --git a/src/render.js b/src/render.js index dccc97f226..2861befbee 100644 --- a/src/render.js +++ b/src/render.js @@ -41,11 +41,11 @@ export function render(vnode, parentDom, replaceNode) { vnode, oldVNode || EMPTY_OBJ, EMPTY_OBJ, - parentDom.namespaceURI == 'http://www.w3.org/1999/xhtml' - ? 1 - : parentDom.namespaceURI == 'http://www.w3.org/2000/svg' + parentDom.namespaceURI == 'http://www.w3.org/2000/svg' ? 2 - : 3, + : parentDom.namespaceURI == 'http://www.w3.org/1998/Math/MathML' + ? 3 + : 1, !isHydrating && replaceNode ? [replaceNode] : oldVNode