diff --git a/core/src/avm2/globals/flash/text/text_field.rs b/core/src/avm2/globals/flash/text/text_field.rs index e21a558cdcc4..88c1d968de48 100644 --- a/core/src/avm2/globals/flash/text/text_field.rs +++ b/core/src/avm2/globals/flash/text/text_field.rs @@ -559,7 +559,6 @@ pub fn set_text<'gc>( { let text = args.get_string_non_null(activation, 0, "text")?; - this.set_is_html(activation.context, false); this.set_text(&text, activation.context); } diff --git a/tests/tests/swfs/avm2/edittext_set_text_vs_html/Test.as b/tests/tests/swfs/avm2/edittext_set_text_vs_html/Test.as new file mode 100644 index 000000000000..9fe8eb659e04 --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_set_text_vs_html/Test.as @@ -0,0 +1,32 @@ +package { +import flash.display.*; +import flash.text.*; +import flash.events.*; +import flash.geom.*; + +public class Test extends MovieClip { + public function Test() { + var tf = new TextField(); + tf.defaultTextFormat = new TextFormat("Default Font"); + tf.defaultTextFormat = new TextFormat("Default Font"); + + tf.htmlText = "bold"; + + trace("After setting HTML:"); + trace(" " + tf.text); + trace(" " + tf.htmlText); + + tf.text = "text"; + + trace("After setting text:"); + trace(" " + tf.text); + trace(" " + tf.htmlText); + + tf.text = "text"; + + trace("After setting text with HTML entities:"); + trace(" " + tf.text); + trace(" " + tf.htmlText); + } +} +} diff --git a/tests/tests/swfs/avm2/edittext_set_text_vs_html/output.txt b/tests/tests/swfs/avm2/edittext_set_text_vs_html/output.txt new file mode 100644 index 000000000000..22934a24ea1f --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_set_text_vs_html/output.txt @@ -0,0 +1,9 @@ +After setting HTML: + bold +
bold
+After setting text: + text +text
+After setting text with HTML entities: + text +<b>text</b>
diff --git a/tests/tests/swfs/avm2/edittext_set_text_vs_html/test.swf b/tests/tests/swfs/avm2/edittext_set_text_vs_html/test.swf new file mode 100644 index 000000000000..61638a18a6da Binary files /dev/null and b/tests/tests/swfs/avm2/edittext_set_text_vs_html/test.swf differ diff --git a/tests/tests/swfs/avm2/edittext_set_text_vs_html/test.toml b/tests/tests/swfs/avm2/edittext_set_text_vs_html/test.toml new file mode 100644 index 000000000000..cf6123969a1d --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_set_text_vs_html/test.toml @@ -0,0 +1 @@ +num_ticks = 1