-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support MathML namespace #4364
Conversation
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Resultscreate10k
duration
usedJSHeapSize
filter-list
duration
usedJSHeapSize
hydrate1k
duration
usedJSHeapSize
many-updates
duration
usedJSHeapSize
replace1k
duration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-update
duration
usedJSHeapSize
todo
duration
usedJSHeapSize
update10th1k
duration
usedJSHeapSize
|
Size Change: +154 B (0%) Total Size: 61.2 kB
ℹ️ View Unchanged
|
b053667
to
c17c7c0
Compare
7200207
to
06a0d73
Compare
4c7e8f6
to
7f3d7cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super familiar with Preact internals but this change looks good overall to me. It touches the various places I found when reporting the issue.
Perhaps some tests that handle conditional rendering would ensure context isn't lost in those cases?
Yeah that's fair -- will try to add later (for SVGs too) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you for tackling this! I left two size-nits
e985a80
to
2d07ca8
Compare
if (nodeType === 'svg') namespace = 'http://www.w3.org/2000/svg'; | ||
else if (nodeType === 'math') | ||
namespace = 'http://www.w3.org/1998/Math/MathML'; | ||
else if (!namespace) namespace = 'http://www.w3.org/1999/xhtml'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching this to a ternary shaves off -6b or so but performs a fair bit worse.
Closes #4363
Probably needs a proper refactor ofDoneisSvg
to anamespace
enum, but I need to play around with this a bit to see what we can skip & what we need.