mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
c83d685fe9
Height of inline elements are considered with current `font-size` and `line-height`. Therefore, if content in inline elements are taller, the `background-color` does not fill the bigger content background entirely. For solving this issue, Chrome handles styles of `<font>` element as outer-most style. This is reasonable approach, let's follow this. For solving this issue, we can change the order of `PreservedStyle`s at setting the preserved styles. Then, `SetInlinePropertiesAsSubAction` is called with reversed order and apply later style first and applies newer styles to all content in an element which is previously inserted. Therefore, the `<font>` element styles should be last elements of `PendingStyles::mPreservingStyles`. When applying new style, our style editor does not reuse existing `<font>` element, and this causes writing WPT harder. Therefore, this patch also changes the applying range of `<font>` style to wrapping existing `<font>` element if and only if its content is entirely selected. Unfortunately, this approach cannot get exactly same result as Chrome because we insert outer-most `<font>` element first, then, try to apply `background-color`, at this moment, our style editor applies the style to the previously inserted `<font>` element instead of creating new `<span>` element. This behavior is required for compatibility in the other cases. Additionally, changing only this behavior requires a lot of method changes to specify how to handle it. However, this incompatible behavior may not cause any problems in web apps in the wild. Therefore, this patch does not solve this incompatible issue. I think that once we get a bug report caused by this difference, we should redesign how to set multiple inline styles once. Differential Revision: https://phabricator.services.mozilla.com/D166617 |
||
---|---|---|
.. | ||
composer | ||
docs | ||
libeditor | ||
reftests | ||
spellchecker | ||
txmgr | ||
AsyncSpellCheckTestHelper.jsm | ||
moz.build | ||
nsIDocumentStateListener.idl | ||
nsIEditActionListener.idl | ||
nsIEditor.idl | ||
nsIEditorMailSupport.idl | ||
nsIEditorSpellCheck.idl | ||
nsIHTMLAbsPosEditor.idl | ||
nsIHTMLEditor.idl | ||
nsIHTMLInlineTableEditor.idl | ||
nsIHTMLObjectResizer.idl | ||
nsITableEditor.idl |