Masayuki Nakano c750faea02 Bug 1808886 - Make the style editor treat <font> related styles as exclusive styles r=m_kato
Currently, Gecko does not support updating `font-size` style even in the CSS
mode.  Therefore, `CSSEditUtils` claims that `<font size="...">` style is not
CSS editable.  Supporting it requires a lot of new code but currently we don't
have any reports about this poor support.  Therefore, we should only try to
make the style editor remove `font-size` properties around selection at setting
`<font size="...">` style for now.

Additionally, Blink and WebKit does not allow to nest multiple `<font>` elements
and `<span>` elements which specify `font-size`, `font-family` or `color`.  When
setting one of the styles, they split ancestors which are related to the style
at range boundaries.  Then, unwrap the unnecessary elements.  This makes the
DOM tree simpler, thus, the later handling will be simpler.  Therefore, it's
worthwhile to follow them.

Unfortunately, there are some logic differences when handling styles in elements
having `id` attribute.  Therefore, there are some new test failures, but I guess
that it does not cause any problems in web apps in the wild because it's hard to
manage editable identified elements in cross browsers and I have no idea of
motivations to do it.

Depends on D166617

Differential Revision: https://phabricator.services.mozilla.com/D167011
2023-01-20 03:45:58 +00:00
..