SVG StyleList unused styles?
pkra opened this issue · comments
The styles for the SVG output include .mjx-dashed
and .mjx-dotted
:
MathJax-src/ts/output/svg/Wrappers/mtable.ts
Lines 113 to 119 in 2911de7
Since I couldn't find any content with either class on the AMS end, I looked where these classes might get added - and didn't find anything. It looks like addBorderBroken
does the job of handling these borders.
MathJax-src/ts/output/svg/Wrapper.ts
Lines 272 to 274 in f939f2f
Perhaps the classes are leftovers from v2 or there was a later change or (more likely) I didn't spot where these classes are actually used.
These are used for the lines within a matrix (from the rowlines
and columnlines
attributes of mtable
), and are created in the lineClass()
function
MathJax-src/ts/output/svg/Wrappers/mtable.ts
Lines 241 to 243 in 8565f9d
It constructs the class name dynamically, which is why searching for mjx-dashed
or mjx-dotted
won't find it.
This method is used in the makeFrame()
, makeVLine()
, and makeHLine()
methods that follow it.
Thanks for clarifying!
Just to follow up and more FYI.
Looking at lineClass
, I noticed (from AMS content) that this generates one class name (mjx-solid) that has no declaration in StyleList. So IIUC since authors could specify random attributes, this generates random class names, but only dotted and dashed do anything. I guess that's nice for authors who want to add custom styles.
This reminds me that in AMS content I found that the complex selectors in StyleList never matter (to the content), except for the overflow related one (which we actually replace with a helper class). Now it looks there's also always a class; that's nice (unless mjx-solid is likely to be removed).
I also noticed that data-line has two different attribute values that are never used (and data-frame doesn't really need "true" either). So switching to mjx-solid offers additional opportunities to clean up bloat in post - which is nice.
I realize I'm playing with fire but for SVG this has worked out well over the past few years.