gecko-dev/editor
Masayuki Nakano 4eb06aa944 Bug 1861603 - Make HTMLEditUtils::IsEmptyNode refer the computed style r=m_kato
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
2023-11-09 00:49:07 +00:00
..
composer Bug 1855300 - convert .ini manifests to .toml: batch 11 remaining **/mochitest.ini r=jmaher,geckoview-reviewers,extension-reviewers,valentin,credential-management-reviewers,cookie-reviewers,sgalich,m_kato,robwu 2023-10-13 02:32:24 +00:00
docs Bug 1842986 - Remove dom.forms.inputmode pref r=emilio 2023-09-15 16:49:21 +00:00
libeditor Bug 1861603 - Make HTMLEditUtils::IsEmptyNode refer the computed style r=m_kato 2023-11-09 00:49:07 +00:00
reftests Bug 1850293 - Make editable states not intrinsic. r=smaug,masayuki 2023-08-30 09:18:31 +00:00
spellchecker Bug 1859245 - part 3: Make JoinNodesTransaction and SplitNodeTransaction handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
txmgr Bug 1856795 - Remove redundant member init r=emilio 2023-10-15 15:29:02 +00:00
AsyncSpellCheckTestHelper.sys.mjs
moz.build
nsIDocumentStateListener.idl
nsIEditActionListener.idl Bug 1859245 - part 3: Make JoinNodesTransaction and SplitNodeTransaction handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
nsIEditor.idl
nsIEditorMailSupport.idl
nsIEditorSpellCheck.idl
nsIHTMLAbsPosEditor.idl
nsIHTMLEditor.idl Bug 1851951 - Make HTMLEditor refer computed display instead of the HTML default style at considering block or inline element r=m_kato 2023-09-27 03:01:26 +00:00
nsIHTMLInlineTableEditor.idl
nsIHTMLObjectResizer.idl
nsITableEditor.idl