Re: mathcolor/mathbackground on <math/> and <semantics/> elements?

Thanks Neil for describing your understanding.  I think that
clarifies where we see things differently.

Neil Soiffer writes:

> The specification for mathbackground says, "Specifies the background color
> to be used to fill in the bounding box of the element and its children. The
> default, "transparent", lets the background color, if any, used in the
> current rendering context to show through."

I read that as the color to fill the "bounding box of the element
and its children" when drawing that element, not that the value is
inherited and also used as the background color to fill the
bounding box when drawing descendant elements.

The background color to fill the bounding box of the descendants
is the default value of mathbackground, which is initially "transparent".

> In your example, specifying "red" on the mfrac means that the fraction and
> all its children should be red.

mstyle changes the default value of attributes.

"Loosely speaking, the effect of the mstyle element is to change
 the default value of an attribute for the elements it contains.
 Style changes work in one of several ways, depending on the way
 in which default values are specified for an attribute."

"Other attributes, such as linethickness on mfrac, have default
 values that are not normally inherited. That is, if the
 linethickness attribute is not set on the start tag of an mfrac
 element, it will normally use the default value of "1", even if
 it was contained in a larger mfrac element that set this
 attribute to a different value. For attributes like this,
 specifying a value with an mstyle element has the effect of
 changing the default value for all elements within its scope. The
 net effect is that setting the attribute value with mstyle
 propagates the change to all the elements it contains directly or
 indirectly, except for the individual elements on which the value
 is overridden. Unlike in the case of inherited attributes,
 elements that explicitly override this attribute have no effect
 on this attribute's value in their children. "

> It would be wrong for mathbackground to
> behave differently on a 'math' element (ie, not set the background color for
> its children).

mathbackground behaves differently on mstyle.

I actually currently think this difference in behavior is
significant enough that the math element should not behave like
mstyle except for a few specified attributes, probably those that
are specific to mstyle (and adopted in math).

> It seems you are implying that a different interpretation
> (eg, not setting the background color of the children) seems reasonable when
> the attribute is on the math element.

I don't interpret that as setting the background color of the
children, even when on regular presentation elements (only that the
color usually shows through behind child elements).

If mathbackground did specify the background color for its
children then that would be inconsistent with the behavior that
mstyle requires.

I don't think mathbackground should specify the background color
for its children, but, if it did, then wouldn't the default value be
"inherit"?

Received on Thursday, 22 April 2010 01:24:17 UTC