Forgot password?
 Create new account
View 165|Reply 0

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

[Copy link]

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2022-12-29 22:24:09 |Read mode
例如
<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; }
Copy the Code

手机版Mobile version|Leisure Math Forum

2025-4-20 22:23 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list