Skip to content

Commit 6494d56

Browse files
committed
Remove use of '*' in CSS declarations. (mathjax/MathJax#3463)
1 parent ec084b0 commit 6494d56

File tree

6 files changed

+45
-14
lines changed

6 files changed

+45
-14
lines changed

ts/output/chtml.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export class CHTML<N, T, D> extends CommonOutputJax<
156156
'mjx-block': { display: 'block' },
157157
'mjx-itable': { display: 'inline-table' },
158158
'mjx-row': { display: 'table-row' },
159-
'mjx-row > *': { display: 'table-cell' },
159+
[['cell', 'base', 'under', 'over', 'den']
160+
.map((node) => `mjx-row > mjx-${node}`)
161+
.join(', ')]: { display: 'table-cell' },
160162

161163
'mjx-container [inline-breaks]': { display: 'inline' },
162164

ts/output/chtml/Wrappers/menclose.ts

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,45 +250,63 @@ export const ChtmlMenclose = (function <N, T, D>(): ChtmlMencloseClass<
250250
height: 0,
251251
width: 0,
252252
},
253-
'mjx-menclose > mjx-arrow > *': {
253+
'mjx-menclose > mjx-arrow > mjx-aline': {
254254
display: 'block',
255255
position: 'absolute',
256-
'transform-origin': 'bottom',
257-
'border-left': em(Notation.THICKNESS * Notation.ARROWX) + ' solid',
258-
'border-right': 0,
259256
'box-sizing': 'border-box',
260-
},
261-
'mjx-menclose > mjx-arrow > mjx-aline': {
257+
'transform-origin': 'bottom',
262258
left: 0,
263259
top: em(-Notation.THICKNESS / 2),
264260
right: em(Notation.THICKNESS * (Notation.ARROWX - 1)),
265261
height: 0,
266262
'border-top': em(Notation.THICKNESS) + ' solid',
267263
'border-left': 0,
264+
'border-right': 0,
268265
},
269266
'mjx-menclose > mjx-arrow[double] > mjx-aline': {
267+
display: 'block',
268+
position: 'absolute',
269+
'box-sizing': 'border-box',
270+
'transform-origin': 'bottom',
270271
left: em(Notation.THICKNESS * (Notation.ARROWX - 1)),
271272
height: 0,
273+
'border-left': em(Notation.THICKNESS * Notation.ARROWX) + ' solid',
274+
'border-right': 0,
272275
},
273276
'mjx-menclose > mjx-arrow > mjx-rthead': {
277+
display: 'block',
278+
position: 'absolute',
279+
'box-sizing': 'border-box',
280+
'transform-origin': 'bottom',
274281
transform: 'skewX(' + ANGLE + 'rad)',
275282
right: 0,
276283
bottom: '-1px',
284+
'border-left': em(Notation.THICKNESS * Notation.ARROWX) + ' solid',
285+
'border-right': 0,
277286
'border-bottom': '1px solid transparent',
278287
'border-top':
279288
em(Notation.THICKNESS * Notation.ARROWY) + ' solid transparent',
280289
},
281290
'mjx-menclose > mjx-arrow > mjx-rbhead': {
291+
display: 'block',
292+
position: 'absolute',
293+
'box-sizing': 'border-box',
282294
transform: 'skewX(-' + ANGLE + 'rad)',
283295
'transform-origin': 'top',
284296
right: 0,
285297
top: '-1px',
298+
'border-left': em(Notation.THICKNESS * Notation.ARROWX) + ' solid',
299+
'border-right': 0,
286300
'border-top': '1px solid transparent',
287301
'border-bottom':
288302
em(Notation.THICKNESS * Notation.ARROWY) + ' solid transparent',
289303
},
290304
'mjx-menclose > mjx-arrow > mjx-lthead': {
305+
display: 'block',
306+
position: 'absolute',
307+
'box-sizing': 'border-box',
291308
transform: 'skewX(-' + ANGLE + 'rad)',
309+
'transform-origin': 'bottom',
292310
left: 0,
293311
bottom: '-1px',
294312
'border-left': 0,
@@ -298,6 +316,9 @@ export const ChtmlMenclose = (function <N, T, D>(): ChtmlMencloseClass<
298316
em(Notation.THICKNESS * Notation.ARROWY) + ' solid transparent',
299317
},
300318
'mjx-menclose > mjx-arrow > mjx-lbhead': {
319+
display: 'block',
320+
position: 'absolute',
321+
'box-sizing': 'border-box',
301322
transform: 'skewX(' + ANGLE + 'rad)',
302323
'transform-origin': 'top',
303324
left: 0,
@@ -314,7 +335,7 @@ export const ChtmlMenclose = (function <N, T, D>(): ChtmlMencloseClass<
314335
bottom: '50%',
315336
left: 0,
316337
width: em(1.5 * Notation.PADDING),
317-
border: em(Notation.THICKNESS) + ' solid',
338+
'border-width': em(Notation.THICKNESS),
318339
'border-style': 'solid solid none none',
319340
'border-radius': '0 100% 0 0',
320341
'box-sizing': 'border-box',

ts/output/chtml/Wrappers/mfrac.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export const ChtmlMfrac = (function <N, T, D>(): ChtmlMfracClass<N, T, D> {
154154
display: 'inline-table',
155155
width: '100%'
156156
},
157-
'mjx-dtable > *': {
157+
'mjx-dtable > mjx-line, mjx-dtable > mjx-row': {
158158
'font-size': '2000%'
159159
},
160160
'mjx-dbox': {

ts/output/chtml/Wrappers/mo.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ export const ChtmlMo = (function <N, T, D>(): ChtmlMoClass<N, T, D> {
141141
'mjx-stretchy-h': {
142142
display: 'inline-block',
143143
},
144-
'mjx-stretchy-h > *': {
144+
[['beg', 'ext', 'end', 'mid']
145+
.map((node) => `mjx-stretchy-h > mjx-${node}`)
146+
.join(', ')]: {
145147
display: 'inline-block',
146148
width: 0,
147149
'text-align': 'right',
@@ -158,7 +160,9 @@ export const ChtmlMo = (function <N, T, D>(): ChtmlMoClass<N, T, D> {
158160
display: 'inline-block',
159161
'text-align': 'center',
160162
},
161-
'mjx-stretchy-v > *': {
163+
[['beg', 'ext', 'end', 'mid']
164+
.map((node) => `mjx-stretchy-v > mjx-${node}`)
165+
.join(', ')]: {
162166
display: 'block',
163167
height: 0,
164168
margin: '0 auto',

ts/output/chtml/Wrappers/munderover.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ export const ChtmlMover = (function <N, T, D>(): ChtmlMoverClass<N, T, D> {
298298
'mjx-mover:not([limits="false"])': {
299299
'padding-top': '.1em', // big_op_spacing5
300300
},
301-
'mjx-mover:not([limits="false"]) > *': {
301+
[['base', 'over']
302+
.map((node) => `mjx-mover:not([limits="false"]) > mjx-${node}`)
303+
.join(', ')]: {
302304
display: 'block',
303305
'text-align': 'left',
304306
},
@@ -436,7 +438,9 @@ export const ChtmlMunderover = (function <N, T, D>(): ChtmlMunderoverClass<
436438
'mjx-munderover:not([limits="false"])': {
437439
'padding-top': '.1em', // big_op_spacing5
438440
},
439-
'mjx-munderover:not([limits="false"]) > *': {
441+
[['over', 'box']
442+
.map((node) => `mjx-munderover:not([limits="false"]) > mjx-${node}`)
443+
.join(', ')]: {
440444
display: 'block',
441445
},
442446
};

ts/output/common/Wrappers/mo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ export function CommonMoMixin<
531531
*/
532532
public setBreakStyle(linebreak: string = '') {
533533
this.breakStyle =
534-
this.node.parent.isEmbellished && !linebreak
534+
this.node.parent?.isEmbellished && !linebreak
535535
? ''
536536
: this.getBreakStyle(linebreak);
537537
if (!this.breakCount) return;

0 commit comments

Comments
 (0)