-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
AcceptedIssue has been reproduced by MathJax teamIssue has been reproduced by MathJax teamCode ExampleContains an illustrative code example, solution, or work-aroundContains an illustrative code example, solution, or work-aroundMergedMerged into develop branchMerged into develop branchv4
Milestone
Description
Issue Summary
When very large documents which include mathjax are edited the mjx-row > * contributes to the high cost of style recalculation.
Most of the CSS selectors in MathJax are neatly scoped, use child combinator (>), and avoid using universal selector (*), which altogether makes recent versions of MathJax quite performant when it comes to style calculation. However this one rule stands out:
'mjx-row > *': { display: 'table-cell' }
I see that elsewhere mjx-row > mjx-cell is used. Is the use of the universal selector here intentional, or was it just a placeholder when the code was initially written?
For context, this rule was initially added in mathjax/MathJax-src#50
Steps to Reproduce:
- Create an HTML document with deep nesting and high number of DOM nodes
- Load MathJax
- Enable CSS statistics collection in Chrome/Edge Performance tab
- Start Chrome profiler
- Make any modification to the DOM
- See that a few ms can be spent in "Recalculate Styles" on matching
mjx-row > *
Technical details:
- MathJax Version: 3.0+
- Browser: Chrome and Edge 141
Supporting information:
Irrelevant
Metadata
Metadata
Assignees
Labels
AcceptedIssue has been reproduced by MathJax teamIssue has been reproduced by MathJax teamCode ExampleContains an illustrative code example, solution, or work-aroundContains an illustrative code example, solution, or work-aroundMergedMerged into develop branchMerged into develop branchv4