зеркало из https://github.com/mozilla/gecko-dev.git
4eb06aa944
Gecko starts referring computed style to consider whether block or inline and `HTMLEditUtils::IsEmptyNode` is used with them to check a node like these: https://searchfox.org/mozilla-central/rev/40d51bef58b8e901d6ab4b60dd280f372a0e417d/editor/libeditor/HTMLEditUtils.h#543,554 However, `IsEmptyNode` still checks only the tag names when the caller wants to treat "list items" and/or "table cells" are visible (not empty). Therefore, this mismatch may cause the assertion failure reported in the bug. From code design point of view, `HTMLEditUtils::IsListItem` and `HTMLEditUtils::IsTableCell` should refer the computed style. However, the former is mostly used for checking the logical structure of HTML, and in the latter case, we should keep the table structure even if table cells are styled as inline because browsers do not support table structure recreation except the Gecko specific editing UI (called inline table editor). Therefore, it does not make sense that we would change them. Instead, we should change `IsEmptyNode` which is used only for visibility check. So, using computed style is always reasonable. Note that this patch changes the behavior in some edge cases. The method always treat a list item or a table cell which contains a sub-list or a sub table. However, I would not like to add new `EmptyCheckOption` for it to check the complicated style check. Therefore, this patch changes the behavior to treat them visible if and only if they have another list item or another table cell. Basically, `<table>` and list elements should have a least one table cell or one list item. Therefore, this change should not appear in the web apps in the wild. Differential Revision: https://phabricator.services.mozilla.com/D192442 |
||
---|---|---|
.. | ||
composer | ||
docs | ||
libeditor | ||
reftests | ||
spellchecker | ||
txmgr | ||
AsyncSpellCheckTestHelper.sys.mjs | ||
moz.build | ||
nsIDocumentStateListener.idl | ||
nsIEditActionListener.idl | ||
nsIEditor.idl | ||
nsIEditorMailSupport.idl | ||
nsIEditorSpellCheck.idl | ||
nsIHTMLAbsPosEditor.idl | ||
nsIHTMLEditor.idl | ||
nsIHTMLInlineTableEditor.idl | ||
nsIHTMLObjectResizer.idl | ||
nsITableEditor.idl |