找回密码
 快速注册
搜索
查看: 40|回复: 0

[MathML] CSS试验性属性math-depth决定字号的缩小

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2022-12-29 22:24 |阅读模式
例如
<mroot>
    <mn>2</mn>
    <mn>3</mn>
</mroot>
在$\root3\of2$中, 2的math-depth是0, 而3的math-depth是2
检查computed styles(Browser Styles打勾)发现mroot > :not(:first-child)的math-depth是add(2)
Screenshot 2022-12-29 at 13-56-39 https __bug1791411.bmoattachments.org.png
所以根式的开方次数是深度增加2的, 所以字号很小
如果开方次数是<mfrac>
<mroot>
    <mn>2</mn>
    <mfrac><mn>3</mn><mn>1</mn></mfrac>
</mroot>
在$\root\frac13\of2$中, 3的math-depth是3
检查computed styles(Browser Styles打勾)发现
Screenshot 2022-12-29 at 13-56-39 https __bug1791411.bmoattachments.org.png
可以在style editor打开这个mathml.css
Screenshot 2022-12-29 at 13-56-39 https __bug1791411.bmoattachments.org.png
地址是resource://gre-resources/mathml.css 在新标签页打开却是空白的.
resource开头是浏览器内置的, 见Resource URLs
这里说Resource URL映射到C:\Program Files\Mozilla Firefox\res\...但是(Firefox 108版)没有找到该文件夹
math-depth对应于旧版的mathml.css中的-moz-script-level
  1. /*****************************************/
  2. /* Controlling scriptlevel               */
  3. /*****************************************/
  4. /* mfrac, munder, mover and munderover change the scriptlevels of their children using
  5.    -moz-math-increment-script-level because regular CSS rules are insufficient to
  6.    control when the scriptlevel should be incremented */
  7. :-moz-math-increment-script-level { -moz-script-level:+1; }
  8. /* all other cases can be described using regular CSS, so we do it this way because it's
  9.    more efficient and less code */
  10. mroot > :not(:first-child) { -moz-script-level:+2; }
  11. msub > :not(:first-child),
  12. msup > :not(:first-child),
  13. msubsup > :not(:first-child),
  14. mmultiscripts > :not(:first-child) { -moz-script-level:+1; }
复制代码

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 15:28

Powered by Discuz!

× 快速回复 返回顶部 返回列表