\"]] \"foo[]bar\" queryCommandValue(\"formatblock\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"formatblock\",\"
\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
@@ -27655,7 +27614,6 @@
"[[\"fontname\",\"sans-serif\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"fontname\",\"sans-serif\"],[\"indent\",\"\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontname\",\"sans-serif\"],[\"indent\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontname\") before":true,
"[[\"fontname\",\"sans-serif\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"fontname\",\"sans-serif\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
@@ -27666,7 +27624,6 @@
"[[\"fontname\",\"sans-serif\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"fontname\",\"sans-serif\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontname\",\"sans-serif\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontname\") before":true,
"[[\"fontname\",\"sans-serif\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"inserthorizontalrule\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
@@ -27691,11 +27648,12 @@
"[[\"fontname\",\"sans-serif\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"fontname\") before":true,
+ "[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontname\") before":true,
+ "[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -27728,11 +27686,9 @@
"[[\"fontname\",\"sans-serif\"],[\"insertlinebreak\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertlinebreak\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontname\") before":true,
- "[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontname\") before":true,
- "[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"fontname\",\"sans-serif\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -27753,11 +27709,9 @@
"[[\"fontname\",\"sans-serif\"],[\"insertparagraph\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertparagraph\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontname\") before":true,
- "[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontname\") before":true,
- "[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
"[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"fontname\",\"sans-serif\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -27839,7 +27793,6 @@
"[[\"fontsize\",\"4\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"fontsize\",\"4\"],[\"formatblock\",\"
\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontsize\",\"4\"],[\"formatblock\",\"
\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"],[\"formatblock\",\"
\"]] \"foo[]bar\" queryCommandValue(\"formatblock\") after":true,
"[[\"fontsize\",\"4\"],[\"formatblock\",\"
\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
@@ -27877,7 +27830,6 @@
"[[\"fontsize\",\"4\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"fontsize\",\"4\"],[\"indent\",\"\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontsize\",\"4\"],[\"indent\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"fontsize\",\"4\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
@@ -27888,7 +27840,6 @@
"[[\"fontsize\",\"4\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"fontsize\",\"4\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontsize\",\"4\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
"[[\"fontsize\",\"4\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"4\"],[\"inserthorizontalrule\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
@@ -27913,11 +27864,12 @@
"[[\"fontsize\",\"4\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
+ "[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
+ "[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -27950,11 +27902,9 @@
"[[\"fontsize\",\"4\"],[\"insertlinebreak\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"insertlinebreak\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
- "[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
- "[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"fontsize\",\"4\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -27975,11 +27925,9 @@
"[[\"fontsize\",\"4\"],[\"insertparagraph\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"insertparagraph\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
"[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
- "[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") before":true,
- "[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
"[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"fontsize\",\"4\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -28058,7 +28006,6 @@
"[[\"forecolor\",\"#0000FF\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"forecolor\",\"#0000FF\"],[\"formatblock\",\"
\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"forecolor\",\"#0000FF\"],[\"formatblock\",\"
\"]] \"foo[]bar\" queryCommandValue(\"formatblock\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"formatblock\",\"
\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"forecolor\",\"#0000FF\"],[\"formatblock\",\"
\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
@@ -28092,7 +28039,6 @@
"[[\"forecolor\",\"#0000FF\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"forecolor\",\"#0000FF\"],[\"indent\",\"\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"forecolor\",\"#0000FF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"forecolor\",\"#0000FF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"forecolor\",\"#0000FF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
@@ -28101,7 +28047,6 @@
"[[\"forecolor\",\"#0000FF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"forecolor\",\"#0000FF\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"forecolor\",\"#0000FF\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"inserthorizontalrule\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"forecolor\",\"#0000FF\"],[\"inserthorizontalrule\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
@@ -28122,9 +28067,10 @@
"[[\"forecolor\",\"#0000FF\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" compare innerHTML":true,
+ "[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
+ "[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -28154,10 +28100,8 @@
"[[\"forecolor\",\"#0000FF\"],[\"insertlinebreak\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertlinebreak\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertlinebreak\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"forecolor\",\"#0000FF\"],[\"insertorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
- "[[\"forecolor\",\"#0000FF\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -28175,10 +28119,8 @@
"[[\"forecolor\",\"#0000FF\"],[\"insertparagraph\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertparagraph\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertparagraph\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"forecolor\",\"#0000FF\"],[\"insertunorderedlist\",\"\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
- "[[\"forecolor\",\"#0000FF\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") before":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") before":true,
"[[\"forecolor\",\"#0000FF\"],[\"insertunorderedlist\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") before":true,
@@ -28248,7 +28190,6 @@
"[[\"hilitecolor\",\"#00FFFF\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"hilitecolor\",\"#00FFFF\"],[\"formatblock\",\"
\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"formatblock\",\"
\"]] \"foo[]bar\" queryCommandValue(\"hilitecolor\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"formatblock\",\"
\"]] \"foo[]bar\" queryCommandValue(\"formatblock\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"formatblock\",\"
\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
@@ -28286,7 +28227,6 @@
"[[\"hilitecolor\",\"#00FFFF\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"forwarddelete\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"hilitecolor\",\"#00FFFF\"],[\"indent\",\"\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"indent\",\"\"]] \"foo[]bar\" queryCommandValue(\"hilitecolor\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
@@ -28297,7 +28237,6 @@
"[[\"hilitecolor\",\"#00FFFF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"indent\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"hilitecolor\",\"#00FFFF\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"inserthorizontalrule\",\"\"]] \"foo[]bar\" queryCommandValue(\"hilitecolor\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"inserthorizontalrule\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"inserthorizontalrule\",\"\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
@@ -28318,7 +28257,6 @@
"[[\"hilitecolor\",\"#00FFFF\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"inserttext\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"inserthtml\",\"ab
cd\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"inserttext\") after":true,
- "[[\"hilitecolor\",\"#00FFFF\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" compare innerHTML":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"hilitecolor\") after":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\": execCommand(\"inserttext\", false, \"a\") return value":true,
"[[\"hilitecolor\",\"#00FFFF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" compare innerHTML":true,
@@ -29148,5 +29086,23 @@
"[[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"
[foo]
\" queryCommandValue(\"inserttext\") before":true,
"[[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"
[foo]
\" queryCommandIndeterm(\"inserttext\") after":true,
"[[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"
[foo]
\" queryCommandState(\"inserttext\") after":true,
- "[[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"
[foo]
\" queryCommandValue(\"inserttext\") after":true
+ "[[\"delete\",\"\"],[\"inserttext\",\"a\"]] \"
[foo]
\" queryCommandValue(\"inserttext\") after":true,
+ "[[\"bold\",\"\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandState(\"bold\") after":true,
+ "[[\"bold\",\"\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"bold\") after":true,
+ "[[\"italic\",\"\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandState(\"italic\") after":true,
+ "[[\"italic\",\"\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"italic\") after":true,
+ "[[\"strikethrough\",\"\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandState(\"strikethrough\") after":true,
+ "[[\"strikethrough\",\"\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"strikethrough\") after":true,
+ "[[\"subscript\",\"\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandState(\"subscript\") after":true,
+ "[[\"subscript\",\"\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"subscript\") after":true,
+ "[[\"superscript\",\"\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandState(\"superscript\") after":true,
+ "[[\"superscript\",\"\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"superscript\") after":true,
+ "[[\"underline\",\"\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandState(\"underline\") after":true,
+ "[[\"underline\",\"\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandState(\"underline\") after":true,
+ "[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
+ "[[\"fontname\",\"sans-serif\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontname\") after":true,
+ "[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
+ "[[\"fontsize\",\"4\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"fontsize\") after":true,
+ "[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true,
+ "[[\"forecolor\",\"#0000FF\"],[\"insertimage\",\"/img/lion.svg\"],[\"inserttext\",\"a\"]] \"foo[]bar\" queryCommandValue(\"forecolor\") after":true
}
diff --git a/editor/libeditor/html/nsHTMLDataTransfer.cpp b/editor/libeditor/html/nsHTMLDataTransfer.cpp
index dd07769956d..9efbe37b033 100644
--- a/editor/libeditor/html/nsHTMLDataTransfer.cpp
+++ b/editor/libeditor/html/nsHTMLDataTransfer.cpp
@@ -288,21 +288,20 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
nsAutoRules beginRulesSniffing(this, kOpHTMLPaste, nsIEditor::eNext);
// Get selection
- nsCOMPtr
selection;
- nsresult rv = GetSelection(getter_AddRefs(selection));
- NS_ENSURE_SUCCESS(rv, rv);
+ nsRefPtr selection = GetTypedSelection();
+ NS_ENSURE_STATE(selection);
// create a dom document fragment that represents the structure to paste
nsCOMPtr fragmentAsNode, streamStartParent, streamEndParent;
PRInt32 streamStartOffset = 0, streamEndOffset = 0;
- rv = CreateDOMFragmentFromPaste(aInputString, aContextStr, aInfoStr,
- address_of(fragmentAsNode),
- address_of(streamStartParent),
- address_of(streamEndParent),
- &streamStartOffset,
- &streamEndOffset,
- aTrustedInput);
+ nsresult rv = CreateDOMFragmentFromPaste(aInputString, aContextStr, aInfoStr,
+ address_of(fragmentAsNode),
+ address_of(streamStartParent),
+ address_of(streamEndParent),
+ &streamStartOffset,
+ &streamEndOffset,
+ aTrustedInput);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr targetNode, tempNode;
@@ -405,7 +404,10 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
NS_ENSURE_SUCCESS(rv, rv);
// pasting does not inherit local inline styles
- rv = RemoveAllInlineProperties();
+ nsCOMPtr tmpNode =
+ do_QueryInterface(selection->GetAnchorNode());
+ PRInt32 tmpOffset = selection->GetAnchorOffset();
+ rv = ClearStyle(address_of(tmpNode), &tmpOffset, nsnull, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
}
else
diff --git a/editor/libeditor/html/nsHTMLEditRules.cpp b/editor/libeditor/html/nsHTMLEditRules.cpp
index 09ae3f80181..a37643e2e3b 100644
--- a/editor/libeditor/html/nsHTMLEditRules.cpp
+++ b/editor/libeditor/html/nsHTMLEditRules.cpp
@@ -1264,12 +1264,19 @@ nsHTMLEditRules::WillInsert(nsISelection *aSelection, bool *aCancel)
}
}
- // we need to get the doc
- nsCOMPtr doc = mHTMLEditor->GetDOMDocument();
- NS_ENSURE_TRUE(doc, NS_ERROR_NOT_INITIALIZED);
-
- // for every property that is set, insert a new inline style node
- return CreateStyleForInsertText(aSelection, doc);
+ if (mDidDeleteSelection &&
+ (mTheAction == nsEditor::kOpInsertText ||
+ mTheAction == nsEditor::kOpInsertIMEText ||
+ mTheAction == nsEditor::kOpInsertBreak ||
+ mTheAction == nsEditor::kOpDeleteSelection)) {
+ res = ReapplyCachedStyles();
+ NS_ENSURE_SUCCESS(res, res);
+ }
+ // either way we clear the cached styles array
+ res = ClearCachedStyles();
+ NS_ENSURE_SUCCESS(res, res);
+
+ return NS_OK;
}
nsresult
@@ -1316,6 +1323,14 @@ nsHTMLEditRules::WillInsertText(nsEditor::OperationID aAction,
// initialize out param
// we want to ignore result of WillInsert()
*aCancel = false;
+
+ // we need to get the doc
+ nsCOMPtr doc = mHTMLEditor->GetDOMDocument();
+ NS_ENSURE_TRUE(doc, NS_ERROR_NOT_INITIALIZED);
+
+ // for every property that is set, insert a new inline style node
+ res = CreateStyleForInsertText(aSelection, doc);
+ NS_ENSURE_SUCCESS(res, res);
// get the (collapsed) selection location
res = mHTMLEditor->GetStartNodeAndOffset(aSelection, getter_AddRefs(selNode), &selOffset);
@@ -1326,10 +1341,6 @@ nsHTMLEditRules::WillInsertText(nsEditor::OperationID aAction,
!mHTMLEditor->CanContainTag(selNode, nsGkAtoms::textTagName)) {
return NS_ERROR_FAILURE;
}
-
- // we need to get the doc
- nsCOMPtr doc = mHTMLEditor->GetDOMDocument();
- NS_ENSURE_TRUE(doc, NS_ERROR_NOT_INITIALIZED);
if (aAction == nsEditor::kOpInsertIMEText) {
// Right now the nsWSRunObject code bails on empty strings, but IME needs
@@ -4354,19 +4365,6 @@ nsHTMLEditRules::CreateStyleForInsertText(nsISelection *aSelection,
&offset);
NS_ENSURE_SUCCESS(res, res);
- // if we deleted selection then also for cached styles
- if (mDidDeleteSelection &&
- (mTheAction == nsEditor::kOpInsertText ||
- mTheAction == nsEditor::kOpInsertIMEText ||
- mTheAction == nsEditor::kOpInsertBreak ||
- mTheAction == nsEditor::kOpDeleteSelection)) {
- res = ReapplyCachedStyles();
- NS_ENSURE_SUCCESS(res, res);
- }
- // either way we clear the cached styles array
- res = ClearCachedStyles();
- NS_ENSURE_SUCCESS(res, res);
-
// next examine our present style and make sure default styles are either
// present or explicitly overridden. If neither, add the default style to
// the TypeInState
@@ -4404,82 +4402,9 @@ nsHTMLEditRules::CreateStyleForInsertText(nsISelection *aSelection,
// process clearing any styles first
nsAutoPtr item(mHTMLEditor->mTypeInState->TakeClearProperty());
while (item && node != rootElement) {
- nsCOMPtr leftNode, rightNode;
- res = mHTMLEditor->SplitStyleAbovePoint(address_of(node), &offset,
- item->tag, &item->attr,
- address_of(leftNode),
- address_of(rightNode));
+ res = mHTMLEditor->ClearStyle(address_of(node), &offset,
+ item->tag, &item->attr);
NS_ENSURE_SUCCESS(res, res);
- bool bIsEmptyNode;
- if (leftNode) {
- mHTMLEditor->IsEmptyNode(leftNode, &bIsEmptyNode, false, true);
- if (bIsEmptyNode) {
- // delete leftNode if it became empty
- res = mEditor->DeleteNode(leftNode);
- NS_ENSURE_SUCCESS(res, res);
- }
- }
- if (rightNode) {
- nsCOMPtr secondSplitParent =
- mHTMLEditor->GetLeftmostChild(rightNode);
- // don't try to split non-containers (br's, images, hr's, etc)
- if (!secondSplitParent) {
- secondSplitParent = rightNode;
- }
- nsCOMPtr savedBR;
- if (!mHTMLEditor->IsContainer(secondSplitParent)) {
- if (nsTextEditUtils::IsBreak(secondSplitParent)) {
- savedBR = secondSplitParent;
- }
-
- secondSplitParent->GetParentNode(getter_AddRefs(tmp));
- secondSplitParent = tmp;
- }
- offset = 0;
- res = mHTMLEditor->SplitStyleAbovePoint(address_of(secondSplitParent),
- &offset, item->tag,
- &item->attr,
- address_of(leftNode),
- address_of(rightNode));
- NS_ENSURE_SUCCESS(res, res);
- // should be impossible to not get a new leftnode here
- NS_ENSURE_TRUE(leftNode, NS_ERROR_FAILURE);
- nsCOMPtr newSelParent =
- mHTMLEditor->GetLeftmostChild(leftNode);
- if (!newSelParent) {
- newSelParent = leftNode;
- }
- // If rightNode starts with a br, suck it out of right node and into
- // leftNode. This is so we you don't revert back to the previous style
- // if you happen to click at the end of a line.
- if (savedBR) {
- res = mEditor->MoveNode(savedBR, newSelParent, 0);
- NS_ENSURE_SUCCESS(res, res);
- }
- mHTMLEditor->IsEmptyNode(rightNode, &bIsEmptyNode, false, true);
- if (bIsEmptyNode) {
- // delete rightNode if it became empty
- res = mEditor->DeleteNode(rightNode);
- NS_ENSURE_SUCCESS(res, res);
- }
- // remove the style on this new hierarchy
- PRInt32 newSelOffset = 0;
- {
- // Track the point at the new hierarchy. This is so we can know where
- // to put the selection after we call RemoveStyleInside().
- // RemoveStyleInside() could remove any and all of those nodes, so I
- // have to use the range tracking system to find the right spot to put
- // selection.
- nsAutoTrackDOMPoint tracker(mHTMLEditor->mRangeUpdater,
- address_of(newSelParent), &newSelOffset);
- res = mHTMLEditor->RemoveStyleInside(leftNode, item->tag,
- &(item->attr));
- NS_ENSURE_SUCCESS(res, res);
- }
- // reset our node offset values to the resulting new sel point
- node = newSelParent;
- offset = newSelOffset;
- }
item = mHTMLEditor->mTypeInState->TakeClearProperty();
weDidSomething = true;
}
diff --git a/editor/libeditor/html/nsHTMLEditor.h b/editor/libeditor/html/nsHTMLEditor.h
index e9da77887d5..664bea82b83 100644
--- a/editor/libeditor/html/nsHTMLEditor.h
+++ b/editor/libeditor/html/nsHTMLEditor.h
@@ -765,6 +765,9 @@ protected:
bool aDeleteSelection,
bool aTrustedInput);
+ nsresult ClearStyle(nsCOMPtr* aNode, PRInt32* aOffset,
+ nsIAtom* aProperty, const nsAString* aAttribute);
+
// Data members
protected:
diff --git a/editor/libeditor/html/nsHTMLEditorStyle.cpp b/editor/libeditor/html/nsHTMLEditorStyle.cpp
index 387604ca9b7..90e26148f4f 100644
--- a/editor/libeditor/html/nsHTMLEditorStyle.cpp
+++ b/editor/libeditor/html/nsHTMLEditorStyle.cpp
@@ -626,6 +626,85 @@ nsresult nsHTMLEditor::SplitStyleAbovePoint(nsCOMPtr *aNode,
return NS_OK;
}
+nsresult
+nsHTMLEditor::ClearStyle(nsCOMPtr* aNode, PRInt32* aOffset,
+ nsIAtom* aProperty, const nsAString* aAttribute)
+{
+ nsCOMPtr leftNode, rightNode, tmp;
+ nsresult res = SplitStyleAbovePoint(aNode, aOffset, aProperty, aAttribute,
+ address_of(leftNode),
+ address_of(rightNode));
+ NS_ENSURE_SUCCESS(res, res);
+ if (leftNode) {
+ bool bIsEmptyNode;
+ IsEmptyNode(leftNode, &bIsEmptyNode, false, true);
+ if (bIsEmptyNode) {
+ // delete leftNode if it became empty
+ res = DeleteNode(leftNode);
+ NS_ENSURE_SUCCESS(res, res);
+ }
+ }
+ if (rightNode) {
+ nsCOMPtr secondSplitParent = GetLeftmostChild(rightNode);
+ // don't try to split non-containers (br's, images, hr's, etc)
+ if (!secondSplitParent) {
+ secondSplitParent = rightNode;
+ }
+ nsCOMPtr savedBR;
+ if (!IsContainer(secondSplitParent)) {
+ if (nsTextEditUtils::IsBreak(secondSplitParent)) {
+ savedBR = secondSplitParent;
+ }
+
+ secondSplitParent->GetParentNode(getter_AddRefs(tmp));
+ secondSplitParent = tmp;
+ }
+ *aOffset = 0;
+ res = SplitStyleAbovePoint(address_of(secondSplitParent),
+ aOffset, aProperty, aAttribute,
+ address_of(leftNode), address_of(rightNode));
+ NS_ENSURE_SUCCESS(res, res);
+ // should be impossible to not get a new leftnode here
+ NS_ENSURE_TRUE(leftNode, NS_ERROR_FAILURE);
+ nsCOMPtr newSelParent = GetLeftmostChild(leftNode);
+ if (!newSelParent) {
+ newSelParent = leftNode;
+ }
+ // If rightNode starts with a br, suck it out of right node and into
+ // leftNode. This is so we you don't revert back to the previous style
+ // if you happen to click at the end of a line.
+ if (savedBR) {
+ res = MoveNode(savedBR, newSelParent, 0);
+ NS_ENSURE_SUCCESS(res, res);
+ }
+ bool bIsEmptyNode;
+ IsEmptyNode(rightNode, &bIsEmptyNode, false, true);
+ if (bIsEmptyNode) {
+ // delete rightNode if it became empty
+ res = DeleteNode(rightNode);
+ NS_ENSURE_SUCCESS(res, res);
+ }
+ // remove the style on this new hierarchy
+ PRInt32 newSelOffset = 0;
+ {
+ // Track the point at the new hierarchy. This is so we can know where
+ // to put the selection after we call RemoveStyleInside().
+ // RemoveStyleInside() could remove any and all of those nodes, so I
+ // have to use the range tracking system to find the right spot to put
+ // selection.
+ nsAutoTrackDOMPoint tracker(mRangeUpdater,
+ address_of(newSelParent), &newSelOffset);
+ res = RemoveStyleInside(leftNode, aProperty, aAttribute);
+ NS_ENSURE_SUCCESS(res, res);
+ }
+ // reset our node offset values to the resulting new sel point
+ *aNode = newSelParent;
+ *aOffset = newSelOffset;
+ }
+
+ return NS_OK;
+}
+
bool nsHTMLEditor::NodeIsProperty(nsIDOMNode *aNode)
{
NS_ENSURE_TRUE(aNode, false);