зеркало из https://github.com/mozilla/gecko-dev.git
66d2f119a5
When `HTMLEditor::InsertLinkAroundSelectionAsAction()` calls `HTMLEditor::SetInlinePropertiesAsSubAction()`, it adds 2 elements to the array. One is for `_moz_dirty` attribute and the other is for `href` attribute because `InsertTagCommand::DoCommandParam()` uses `HTMLEditor::CreateElementWithDefaults()`. Then, `HTMLEditor::SetInlinePropertiesAsSubAction()` wraps the `<img>` into `<a _moz_dirty="">` with calling `AutoInlineStyleSetter::ApplyStyle()`. Then, it calls `OnHandle()` with the `<img>` and it collapse the applied range into the `<img>`. Therefore, when `SetInlinePropertiesAsSubAction()` handles `href`, there is only collapsed range and it just puts the style into the cache for applying the style when the user types new text. So, first, `OnHandle()` should not set the boundary points of the applied range into non-container node. And also `InsertLinkAroundSelectionAsAction()` should ignore `_moz_dirty` attribute because if it's truly required, `AutoInlineStyleSetter` should set the attribute to every new element. Note that this causes new failure in `editing/run/fontname.html?1001-200`, but it was accidentally passed. The case is, `queryCommandValue("fontname")` result after calling `execCommand("fontname", false, "sans-serif")` for `foo<tt>{<br></tt>}bar`. The result of the DOM tree is `foo<tt><font face="sans-serif"><br></font></tt>bar` and `Selection` was collapsed in the `<br>` before, but with this patch, the `<br>` is selected. Therefore, the result is changed but similar cases in the tests fail too. So I believe that it accidentally passed with odd `Selection`. Differential Revision: https://phabricator.services.mozilla.com/D219127 |
||
---|---|---|
.. | ||
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 |