text-decorations propagating into SVG

Yesterday I discovered that both Chrome and FF are propagating
text-decoration into SVG and onto <text> elements.  So, in the following
example, "Foo" is underlined and cannot be disabled, unless it is removed
from the parent <a>.

<a>
  <svg>
    <text>Foo</text>
  </svg>
</a>

This didn't seem quite right to me, so I filed bugs for both browsers.
 FF's argument is that text decorations draw across descendant elements.
(See https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration#Notes).
 However the CSS spec says:

*For block containers that establish an inline formatting context, the
> decorations are propagated to an anonymous inline element that wraps all
> the in-flow inline-level children of the block container. For all other
> elements it is propagated to any in-flow children. Note that text
> decorations are not propagated to floating and absolutely positioned
> descendants, nor to the contents of atomic inline-level descendants such as
> inline blocks and inline tables.*


Wouldn't <text> elements be exempt from inheriting the underline for either
or both of the following reasons:
(a) SVG elements do not establish an inline formatting context, and <text>
elements are not in-flow children.
(b) <text> elements are absolutely positioned descendants.

I guess it depends whether you consider that the content of <text> elements
constitute a "flow" in the CSS sense, and whether SVG elements are
absolutely positioned in the HTML/CSS sense.

Paul

Received on Monday, 25 August 2014 22:10:29 UTC