-
-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add avm2/edittext_set_text_vs_html test
This test verifies the behavior of htmlText vs text setters and how they set the HTML bit.
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = "<font face='NonDefault Font'><b>bold</b></font>"; | ||
|
||
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 = "<b>text</b>"; | ||
|
||
trace("After setting text with HTML entities:"); | ||
trace(" " + tf.text); | ||
trace(" " + tf.htmlText); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
After setting HTML: | ||
bold | ||
<P ALIGN="LEFT"><FONT FACE="NonDefault Font" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"><B>bold</B></FONT></P> | ||
After setting text: | ||
text | ||
<P ALIGN="LEFT"><FONT FACE="Default Font" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">text</FONT></P> | ||
After setting text with HTML entities: | ||
<b>text</b> | ||
<P ALIGN="LEFT"><FONT FACE="Default Font" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"><b>text</b></FONT></P> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
num_ticks = 1 |