diff --git a/editor/libeditor/HTMLEditRules.cpp b/editor/libeditor/HTMLEditRules.cpp index 80e75dcacb7d..39b365ef01db 100644 --- a/editor/libeditor/HTMLEditRules.cpp +++ b/editor/libeditor/HTMLEditRules.cpp @@ -6969,6 +6969,17 @@ HTMLEditRules::CacheInlineStyles(nsIDOMNode* aNode) for (int32_t j = 0; j < SIZE_STYLE_TABLE; ++j) { + // If type-in state is set, don't intervene + bool typeInSet, unused; + if (NS_WARN_IF(!mHTMLEditor)) { + return NS_ERROR_UNEXPECTED; + } + mHTMLEditor->mTypeInState->GetTypingState(typeInSet, unused, + mCachedStyles[j].tag, mCachedStyles[j].attr, nullptr); + if (typeInSet) { + continue; + } + bool isSet = false; nsAutoString outValue; // Don't use CSS for , we don't support it usefully (bug 780035) diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 2025c4ff27da..c03aec3627eb 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -37664,6 +37664,12 @@ "url": "/domparsing/style_attribute_html.html" } ], + "editing/other/restoration.html": [ + { + "path": "editing/other/restoration.html", + "url": "/editing/other/restoration.html" + } + ], "editing/other/delete.html": [ { "path": "editing/other/delete.html", diff --git a/testing/web-platform/tests/editing/other/restoration.html b/testing/web-platform/tests/editing/other/restoration.html new file mode 100644 index 000000000000..4c53008b4102 --- /dev/null +++ b/testing/web-platform/tests/editing/other/restoration.html @@ -0,0 +1,90 @@ + + +Restoration of style tests + + + +
+