gecko-dev/dom/serializers
Masayuki Nakano 43a805714a Bug 1930277 - Make nsHTMLCopyEncoder::RangeNodeContext::IncludeInContext not treat inline editing host as an contextual inline element r=edgar,dom-core
It treats some inline elements as contextual elements.  Then, they will be
preserved in copied HTML fragment.  However, if an inline element is an editing
host, we don't want to contain it to the copied fragment because pasting it
causes duplicating same style into same editing host.  So, if the style includes
relative style like `font-size: 2em`, it will cause bigger text than the
surrounding text.  Additionally, the inline editing host usually has a border
but we don't want to make it appear in editable text.

Unfortunately, with this change, we stop copying the text style specified to
the inline editing host.  However, this is same behavior as when the editing
host is a block element like `<div>`.  Note that pasted text will be merged into
the inline editing host style.  Therefore, if and only if the destination has
different style from the editing host, the result might be different from the
expected one by the user.  However, this is a long standing issue, see
bug 1428046, for example.

Differential Revision: https://phabricator.services.mozilla.com/D228623
2024-11-20 04:35:32 +00:00
..
crashtests
moz.build
nsDocumentEncoder.cpp Bug 1930277 - Make nsHTMLCopyEncoder::RangeNodeContext::IncludeInContext not treat inline editing host as an contextual inline element r=edgar,dom-core 2024-11-20 04:35:32 +00:00
nsDOMSerializer.cpp
nsDOMSerializer.h
nsHTMLContentSerializer.cpp
nsHTMLContentSerializer.h
nsIContentSerializer.h
nsIDocumentEncoder.idl
nsPlainTextSerializer.cpp
nsPlainTextSerializer.h
nsXHTMLContentSerializer.cpp
nsXHTMLContentSerializer.h
nsXMLContentSerializer.cpp
nsXMLContentSerializer.h