Pekka Lampila
2007-Oct-22 12:35 UTC
[Swfdec] 12 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h test/trace
libswfdec/swfdec_as_strings.c | 1 libswfdec/swfdec_html_parser.c | 43 +++--- libswfdec/swfdec_text_field.c | 2 libswfdec/swfdec_text_field.h | 2 libswfdec/swfdec_text_field_movie.c | 166 ++++++++++++++++----------- libswfdec/swfdec_text_field_movie.h | 6 libswfdec/swfdec_text_field_movie_as.c | 69 +++++++---- test/trace/Makefile.am | 7 + test/trace/text-field-html-input-6.swf |binary test/trace/text-field-html-input-6.swf.trace | 120 +++++++++++++++++++ test/trace/text-field-html-input-7.swf |binary test/trace/text-field-html-input-7.swf.trace | 118 +++++++++++++++++++ test/trace/text-field-html-input-8.swf |binary test/trace/text-field-html-input-8.swf.trace | 118 +++++++++++++++++++ test/trace/text-field-html-input.as | 62 ++++++++++ 15 files changed, 596 insertions(+), 118 deletions(-) New commits: commit ae043a89a73bdc0cfcb72dcece238e0ddc888472 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 15:34:44 2007 +0300 In TextField don't set HTML text to variable if html property is false diff --git a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index 78fd2b3..0bc39e1 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -1477,6 +1477,30 @@ swfdec_text_field_movie_html_text_append_paragraph (SwfdecTextFieldMovie *text, } const char * +swfdec_text_field_movie_get_text (SwfdecTextFieldMovie *text) +{ + char *str, *p; + + str = g_strdup (text->input->str); + + // if input was orginally html, remove all \r + if (text->input_html) { + p = str; + while ((p = strchr (p, '\r')) != NULL) { + memmove (p, p + 1, strlen (p)); + } + } + + // change all \n to \r + p = str; + while ((p = strchr (p, '\n')) != NULL) { + *p = '\r'; + } + + return swfdec_as_context_give_string (SWFDEC_AS_OBJECT (text)->context, str); +} + +const char * swfdec_text_field_movie_get_html_text (SwfdecTextFieldMovie *text) { const char *p, *end; diff --git a/libswfdec/swfdec_text_field_movie.h b/libswfdec/swfdec_text_field_movie.h index 2820c62..fc7371d 100644 --- a/libswfdec/swfdec_text_field_movie.h +++ b/libswfdec/swfdec_text_field_movie.h @@ -133,6 +133,7 @@ void swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie * text, SwfdecTextFormat *swfdec_text_field_movie_get_text_format (SwfdecTextFieldMovie * text, guint start_index, guint end_index); +const char * swfdec_text_field_movie_get_text (SwfdecTextFieldMovie * text); const char * swfdec_text_field_movie_get_html_text (SwfdecTextFieldMovie * text); void swfdec_text_field_movie_set_listen_variable (SwfdecTextFieldMovie * text, const char * value); diff --git a/libswfdec/swfdec_text_field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index 56240d6..48057e8 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -65,37 +65,15 @@ swfdec_text_field_movie_set_readonly (SwfdecAsContext *cx, * Native properties: Text */ static void -swfdec_text_field_movie_get_text (SwfdecAsContext *cx, SwfdecAsObject *object, - guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) +swfdec_text_field_movie_do_get_text (SwfdecAsContext *cx, + SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, + SwfdecAsValue *ret) { SwfdecTextFieldMovie *text; - char *str, *p; SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); - if (text->input == NULL) { - SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY); - return; - } - - str = g_strdup (text->input->str); - - // if input was orginally html, remove all \r - if (text->input_html) { - p = str; - while ((p = strchr (p, '\r')) != NULL) { - memmove (p, p + 1, strlen (p)); - } - } - - // change all \n to \r - p = str; - while ((p = strchr (p, '\n')) != NULL) { - *p = '\r'; - } - - SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string ( - SWFDEC_AS_OBJECT (text)->context, str)); + SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_text_field_movie_get_text (text)); } static void @@ -111,8 +89,13 @@ swfdec_text_field_movie_do_set_text (SwfdecAsContext *cx, swfdec_text_field_movie_set_text (text, value, FALSE); if (text->variable != NULL) { - swfdec_text_field_movie_set_listen_variable_text (text, - swfdec_text_field_movie_get_html_text (text)); + if (text->text->html) { + swfdec_text_field_movie_set_listen_variable_text (text, + swfdec_text_field_movie_get_html_text (text)); + } else { + swfdec_text_field_movie_set_listen_variable_text (text, + swfdec_text_field_movie_get_text (text)); + } } } @@ -152,13 +135,13 @@ swfdec_text_field_movie_get_htmlText (SwfdecAsContext *cx, SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); - if (!text->text->html) { - swfdec_text_field_movie_get_text (cx, object, argc, argv, ret); - return; + if (text->text->html) { + SWFDEC_AS_VALUE_SET_STRING (ret, + swfdec_text_field_movie_get_html_text (text)); + } else { + SWFDEC_AS_VALUE_SET_STRING (ret, + swfdec_text_field_movie_get_text (text)); } - - SWFDEC_AS_VALUE_SET_STRING (ret, - swfdec_text_field_movie_get_html_text (text)); } static void @@ -174,8 +157,13 @@ swfdec_text_field_movie_set_htmlText (SwfdecAsContext *cx, swfdec_text_field_movie_set_text (text, value, text->text->html); if (text->variable != NULL) { - swfdec_text_field_movie_set_listen_variable_text (text, - swfdec_text_field_movie_get_html_text (text)); + if (text->text->html) { + swfdec_text_field_movie_set_listen_variable_text (text, + swfdec_text_field_movie_get_html_text (text)); + } else { + swfdec_text_field_movie_set_listen_variable_text (text, + swfdec_text_field_movie_get_text (text)); + } } } @@ -1223,7 +1211,8 @@ swfdec_text_field_movie_init_properties (SwfdecAsContext *cx) // text swfdec_text_field_movie_add_variable (proto, SWFDEC_AS_STR_text, - swfdec_text_field_movie_get_text, swfdec_text_field_movie_do_set_text); + swfdec_text_field_movie_do_get_text, + swfdec_text_field_movie_do_set_text); swfdec_text_field_movie_add_variable (proto, SWFDEC_AS_STR_html, swfdec_text_field_movie_get_html, swfdec_text_field_movie_set_html); swfdec_text_field_movie_add_variable (proto, SWFDEC_AS_STR_htmlText, commit 65d226fa857aad1e78f18098417ab18465969846 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 15:24:15 2007 +0300 Add SWFDEC_FIXME about IMG tag support diff --git a/libswfdec/swfdec_html_parser.c b/libswfdec/swfdec_html_parser.c index 1c4dfad..a6a0aa0 100644 --- a/libswfdec/swfdec_html_parser.c +++ b/libswfdec/swfdec_html_parser.c @@ -329,6 +329,9 @@ swfdec_text_field_movie_html_parse_tag (ParserData *data, const char *p) swfdec_as_object_set_variable (object, SWFDEC_AS_STR_italic, &val); } else if (tag->name_length == 1 && !g_strncasecmp (tag->name, "u", 1)) { swfdec_as_object_set_variable (object, SWFDEC_AS_STR_underline, &val); + } else if (tag->name_length == 3 && !g_strncasecmp (tag->name, "img", 3)) + { + SWFDEC_FIXME ("IMG tag support for TextField's HTML input missing"); } } commit 90a9604f2af766e86c373a3ccc5d1ab88538af73 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 15:20:48 2007 +0300 Add a test for TextField's HTML input Pretty limited for now diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am index b3a7b76..6b39368 100644 --- a/test/trace/Makefile.am +++ b/test/trace/Makefile.am @@ -1859,6 +1859,13 @@ EXTRA_DIST = \ targetpath-6.swf.trace \ targetpath-7.swf \ targetpath-7.swf.trace \ + text-field-html-input.as \ + text-field-html-input-6.swf \ + text-field-html-input-6.swf.trace \ + text-field-html-input-7.swf \ + text-field-html-input-7.swf.trace \ + text-field-html-input-8.swf \ + text-field-html-input-8.swf.trace \ text-field-length.as \ text-field-length-5.swf \ text-field-length-5.swf.trace \ diff --git a/test/trace/text-field-html-input-6.swf b/test/trace/text-field-html-input-6.swf new file mode 100644 index 0000000..6e68068 Binary files /dev/null and b/test/trace/text-field-html-input-6.swf differ diff --git a/test/trace/text-field-html-input-6.swf.trace b/test/trace/text-field-html-input-6.swf.trace new file mode 100644 index 0000000..e976072 --- /dev/null +++ b/test/trace/text-field-html-input-6.swf.trace @@ -0,0 +1,120 @@ +0: multiline: false condenseWhite: false +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: true condenseWhite: false +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: false condenseWhite: true +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: true condenseWhite: true +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: false condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: true condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: false condenseWhite: false +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: true condenseWhite: false +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: false condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: true condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: false condenseWhite: false +ab c +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">ab</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">c</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/ : align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: true condenseWhite: false +ab c +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">ab</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">c</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/ : align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: false condenseWhite: true +ab c +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">ab</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">c</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/ : align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: true condenseWhite: true +ab c +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">ab</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">c</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+2/ : align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false url+3/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning= leading=0 leftMargin=0 letterSpacing= rightMargin=0 size=12 tabStops= target= underline=false urldiff --git a/test/trace/text-field-html-input-7.swf b/test/trace/text-field-html-input-7.swf new file mode 100644 index 0000000..bf7b7b4 Binary files /dev/null and b/test/trace/text-field-html-input-7.swf differ diff --git a/test/trace/text-field-html-input-7.swf.trace b/test/trace/text-field-html-input-7.swf.trace new file mode 100644 index 0000000..5150aee --- /dev/null +++ b/test/trace/text-field-html-input-7.swf.trace @@ -0,0 +1,118 @@ +0: multiline: false condenseWhite: false +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: true condenseWhite: false +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: false condenseWhite: true +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: true condenseWhite: true +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: false condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: true condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: false condenseWhite: false +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: true condenseWhite: false +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: false condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: true condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: false condenseWhite: false +abc +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">abc</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: true condenseWhite: false +ab c +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">ab</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">c</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/ : align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: false condenseWhite: true +abc +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">abc</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: true condenseWhite: true +ab c +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">ab</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">c</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+2/ : align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false url+3/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=undefined leading=0 leftMargin=0 letterSpacing=undefined rightMargin=0 size=12 tabStops= target= underline=false urldiff --git a/test/trace/text-field-html-input-8.swf b/test/trace/text-field-html-input-8.swf new file mode 100644 index 0000000..c580f99 Binary files /dev/null and b/test/trace/text-field-html-input-8.swf differ diff --git a/test/trace/text-field-html-input-8.swf.trace b/test/trace/text-field-html-input-8.swf.trace new file mode 100644 index 0000000..6079e11 --- /dev/null +++ b/test/trace/text-field-html-input-8.swf.trace @@ -0,0 +1,118 @@ +0: multiline: false condenseWhite: false +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: true condenseWhite: false +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: false condenseWhite: true +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+0: multiline: true condenseWhite: true +a +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: false condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: true condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: false condenseWhite: false +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: true condenseWhite: false +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: false condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: true condenseWhite: false +ab +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3/: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: false condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3: multiline: true condenseWhite: true +a b +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">a b</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/ : align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/b: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: false condenseWhite: false +abc +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">abc</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: true condenseWhite: false +ab c +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">ab</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">c</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/ : align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: false condenseWhite: true +abc +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">abc</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+4: multiline: true condenseWhite: true +ab c +<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">ab</FONT></P><P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">c</FONT></P> +0/a: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+1/b: align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+2/ : align=right blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false url+3/c: align=left blockIndent=0 bold=false bullet=false color=0 display=block font=Times New Roman indent=0 italic=false kerning=false leading=0 leftMargin=0 letterSpacing=0 rightMargin=0 size=12 tabStops= target= underline=false urldiff --git a/test/trace/text-field-html-input.as b/test/trace/text-field-html-input.as new file mode 100644 index 0000000..da34d4a --- /dev/null +++ b/test/trace/text-field-html-input.as @@ -0,0 +1,62 @@ +// makeswf -v 7 -r 1 -o test-7.swf test.as + +var properties = [ + "align", + "blockIndent", + "bold", + "bullet", + "color", + "display", + "font", + "indent", + "italic", + "kerning", + "leading", + "leftMargin", + "letterSpacing", + "rightMargin", + "size", + "tabStops", + "target", + "underline", + "url" +]; + +function format_to_string (fmt) { + str = ""; + for (var i = 0; i < properties.length; i++) { + str += " " + properties[i] + "=" + fmt[properties[i]]; + } + return str; +} + +this.createTextField ("t", 1, 0, 0, 200, 200); + +var texts = [ + "a", + "a\rb", + "a\r\nb", + "a\r\rb", + "a<p align='right'>b</p>c" +]; + +t.html = true; + +for (var i = 0; i < texts.length; i++) { + for (var j = 0; j <= 3; j++) { + t.multiline = j & 1; + t.condenseWhite = j & 2; + t.htmlText = texts[i]; + + trace (i + ": multiline: " + t.multiline + " condenseWhite: " + t.condenseWhite); + + trace (t.text); + trace (t.htmlText); + + for (var k = 0; k < t.length; k++) { + trace (k + "/" + t.text.charAt (k) + ":" + format_to_string (t.getTextFormat (k))); + } + } +} + +loadMovie ("FSCommand:quit", ""); commit 171389a442f643884ffc98de2368b32f995205bb Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 15:14:15 2007 +0300 Add \n not \r after </p> etc. in TextField's HTML parser diff --git a/libswfdec/swfdec_html_parser.c b/libswfdec/swfdec_html_parser.c index 0052cd7..1c4dfad 100644 --- a/libswfdec/swfdec_html_parser.c +++ b/libswfdec/swfdec_html_parser.c @@ -70,7 +70,7 @@ swfdec_text_field_movie_html_parse_close_tag (ParserData *data, ParserTag *tag) break; } } - data->text = g_string_append_c (data->text, '\r'); + data->text = g_string_append_c (data->text, '\n'); } tag->end_index = data->text->len; @@ -287,7 +287,7 @@ swfdec_text_field_movie_html_parse_tag (ParserData *data, const char *p) { if (data->cx->version < 7 && (name_length == 2 && !g_strncasecmp (name, "br", 2))) { - data->text = g_string_append_c (data->text, '\r'); + data->text = g_string_append_c (data->text, '\n'); tag = NULL; } else { SwfdecAsObject *object; @@ -303,7 +303,7 @@ swfdec_text_field_movie_html_parse_tag (ParserData *data, const char *p) ParserTag *f = iter->data; if ((f->name_length == 1 && !g_strncasecmp (f->name, "p", 1)) || (f->name_length == 2 && !g_strncasecmp (f->name, "li", 2))) { - data->text = g_string_append_c (data->text, '\r'); + data->text = g_string_append_c (data->text, '\n'); break; } } commit 97b7664b5d462cc629b631d713d8c6485e99247e Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 15:00:25 2007 +0300 TextField: Return only text in htmlText if html is false (broke this earlier) diff --git a/libswfdec/swfdec_text_field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index 9ca8560..56240d6 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -152,6 +152,11 @@ swfdec_text_field_movie_get_htmlText (SwfdecAsContext *cx, SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); + if (!text->text->html) { + swfdec_text_field_movie_get_text (cx, object, argc, argv, ret); + return; + } + SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_text_field_movie_get_html_text (text)); } commit 93c18b3fb52aefda9c6daa226be061b6571e7119 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 14:44:08 2007 +0300 Change TextField to use GString internally diff --git a/libswfdec/swfdec_html_parser.c b/libswfdec/swfdec_html_parser.c index 798ca5e..0052cd7 100644 --- a/libswfdec/swfdec_html_parser.c +++ b/libswfdec/swfdec_html_parser.c @@ -396,10 +396,12 @@ swfdec_text_field_movie_html_parse (SwfdecTextFieldMovie *text, const char *str) g_return_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_return_if_fail (str != NULL); + text->input = g_string_assign (text->input, ""); + data.cx = SWFDEC_AS_OBJECT (text)->context; data.multiline = (data.cx->version < 7 || text->text->multiline); data.condense_white = text->condense_white; - data.text = g_string_new (""); + data.text = text->input; data.tags_open = NULL; data.tags_closed = NULL; @@ -422,10 +424,6 @@ swfdec_text_field_movie_html_parse (SwfdecTextFieldMovie *text, const char *str) (ParserTag *)data.tags_open->data); } - // set parsed text - text->text_display - swfdec_as_context_give_string (data.cx, g_string_free (data.text, FALSE)); - // add parsed styles while (data.tags_closed != NULL) { ParserTag *tag = (ParserTag *)data.tags_closed->data; diff --git a/libswfdec/swfdec_text_field.c b/libswfdec/swfdec_text_field.c index 7b5c688..a11e2f1 100644 --- a/libswfdec/swfdec_text_field.c +++ b/libswfdec/swfdec_text_field.c @@ -113,7 +113,7 @@ tag_func_define_edit_text (SwfdecSwfDecoder * s, guint tag) text->word_wrap = swfdec_bits_getbit (b); text->multiline = swfdec_bits_getbit (b); text->password = swfdec_bits_getbit (b); - text->input = !swfdec_bits_getbit (b); + text->editable = !swfdec_bits_getbit (b); has_color = swfdec_bits_getbit (b); has_max_length = swfdec_bits_getbit (b); has_font = swfdec_bits_getbit (b); diff --git a/libswfdec/swfdec_text_field.h b/libswfdec/swfdec_text_field.h index cdbe1ec..0ecf9bf 100644 --- a/libswfdec/swfdec_text_field.h +++ b/libswfdec/swfdec_text_field.h @@ -52,7 +52,7 @@ struct _SwfdecTextField gboolean html; - gboolean input; + gboolean editable; gboolean password; int max_chars; gboolean selectable; diff --git a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index d3e4a2a..78fd2b3 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -115,9 +115,9 @@ swfdec_text_field_movie_generate_paragraph (SwfdecTextFieldMovie *text, g_assert (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_assert (paragraph != NULL); g_assert (start_index <= end_index); - g_assert (end_index <= strlen (text->text_display)); + g_assert (end_index <= text->input->len); - paragraph->text = text->text_display + start_index; + paragraph->text = text->input->str + start_index; paragraph->text_length = end_index - start_index; paragraph->blocks = NULL; @@ -299,7 +299,7 @@ swfdec_text_field_movie_get_paragraphs (SwfdecTextFieldMovie *text, int *num) g_assert (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); count = 0; - p = text->text_display; + p = text->input->str; while (p != NULL && *p != '\0') { count++; p = strpbrk (p, "\r\n"); @@ -311,7 +311,7 @@ swfdec_text_field_movie_get_paragraphs (SwfdecTextFieldMovie *text, int *num) *num = count; i = 0; - p = text->text_display; + p = text->input->str; while (*p != '\0') { g_assert (i < count); end = strpbrk (p, "\r\n"); @@ -319,7 +319,7 @@ swfdec_text_field_movie_get_paragraphs (SwfdecTextFieldMovie *text, int *num) end = strchr (p, '\0'); swfdec_text_field_movie_generate_paragraph (text, ¶graphs[i], - p - text->text_display, end - text->text_display); + p - text->input->str, end - text->input->str); p = end; if (*p != '\0') p++; @@ -876,7 +876,6 @@ swfdec_text_field_movie_mark (SwfdecAsObject *object) text = SWFDEC_TEXT_FIELD_MOVIE (object); - swfdec_as_string_mark (text->text_display); if (text->variable != NULL) swfdec_as_string_mark (text->variable); swfdec_as_object_mark (SWFDEC_AS_OBJECT (text->format_new)); @@ -998,6 +997,7 @@ swfdec_text_field_movie_init (SwfdecTextFieldMovie *text) text->surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1); text->cr = cairo_create (text->surface); + text->input = g_string_new (""); text->scroll = 1; text->mouse_wheel_enabled = TRUE; } @@ -1013,7 +1013,7 @@ swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie *text, g_return_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_return_if_fail (SWFDEC_IS_TEXT_FORMAT (format)); g_return_if_fail (start_index < end_index); - g_return_if_fail (end_index <= strlen (text->text_display)); + g_return_if_fail (end_index <= text->input->len); g_assert (text->formats != NULL); g_assert (text->formats->data != NULL); @@ -1031,7 +1031,7 @@ swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie *text, findex_end_index ((SwfdecFormatIndex *)iter->next->data)->index; } else { - findex_end_index = strlen (text->text_display); + findex_end_index = text->input->len; } if (findex_end_index <= start_index) @@ -1093,7 +1093,7 @@ swfdec_text_field_movie_get_text_format (SwfdecTextFieldMovie *text, g_assert (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_assert (start_index < end_index); - g_assert (end_index <= strlen (text->text_display)); + g_assert (end_index <= text->input->len); g_assert (text->formats != NULL); g_assert (text->formats->data != NULL); @@ -1361,7 +1361,7 @@ swfdec_text_field_movie_html_text_append_paragraph (SwfdecTextFieldMovie *text, index_ = ((SwfdecFormatIndex *)(iter->data))->index; format = ((SwfdecFormatIndex *)(iter->data))->format; - escaped = swfdec_xml_escape_len (text->text_display + index_prev, + escaped = swfdec_xml_escape_len (text->input->str + index_prev, index_ - index_prev); string = g_string_append (string, escaped); g_free (escaped); @@ -1449,7 +1449,7 @@ swfdec_text_field_movie_html_text_append_paragraph (SwfdecTextFieldMovie *text, string = g_string_append (string, "<U>"); } - escaped = swfdec_xml_escape_len (text->text_display + index_, + escaped = swfdec_xml_escape_len (text->input->str + index_, end_index - index_); string = g_string_append (string, escaped); g_free (escaped); @@ -1485,22 +1485,19 @@ swfdec_text_field_movie_get_html_text (SwfdecTextFieldMovie *text) g_return_val_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text), SWFDEC_AS_STR_EMPTY); - if (text->text_display == NULL) + if (text->input == NULL) return SWFDEC_AS_STR_EMPTY; - if (text->text->html == FALSE) - return text->text_display; - string = g_string_new (""); - p = text->text_display; + p = text->input->str; while (*p != '\0') { end = strpbrk (p, "\r\n"); if (end == NULL) end = strchr (p, '\0'); string = swfdec_text_field_movie_html_text_append_paragraph (text, string, - p - text->text_display, end - text->text_display); + p - text->input->str, end - text->input->str); p = end; if (*p != '\0') p++; @@ -1515,23 +1512,15 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, guint start_index, guint end_index, const char *str) { SwfdecFormatIndex *findex; - char *text_new; GSList *iter, *prev; gboolean first; g_return_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); - g_return_if_fail (end_index <= strlen (text->text_display)); + g_return_if_fail (end_index <= text->input->len); g_return_if_fail (start_index <= end_index); g_return_if_fail (str != NULL); - text_new = g_malloc (strlen (text->text_display) - - (end_index - start_index) + strlen (str) + 1); - - memcpy (text_new, text->text_display, start_index); - memcpy (text_new + start_index, str, strlen (str)); - memcpy (text_new + start_index + strlen (str), - text->text_display + end_index, - strlen (text->text_display + end_index) + 1); + text->input = g_string_insert (text->input, start_index, str); first = TRUE; prev = NULL; @@ -1540,7 +1529,7 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, findex = iter->data; if (findex->index >= start_index) { - if (end_index == strlen (text->text_display) || (iter->next != NULL && + if (end_index == text->input->len || (iter->next != NULL && ((SwfdecFormatIndex *)iter->next->data)->index <= end_index)) { g_free (iter->data); @@ -1558,7 +1547,7 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, } prev = iter; } - if (end_index == strlen (text->text_display)) { + if (end_index == text->input->len) { if (SWFDEC_AS_OBJECT (text)->context->version < 8) { SWFDEC_FIXME ("replaceText to the end of the TextField might use wrong text format on version 7"); } @@ -1569,9 +1558,6 @@ swfdec_text_field_movie_replace_text (SwfdecTextFieldMovie *text, text->formats = g_slist_append (text->formats, findex); } - text->text_display - swfdec_as_context_give_string (SWFDEC_AS_OBJECT (text)->context, text_new); - swfdec_movie_invalidate (SWFDEC_MOVIE (text)); swfdec_text_field_movie_auto_size (text); swfdec_text_field_movie_update_scroll (text, TRUE); @@ -1609,7 +1595,7 @@ swfdec_text_field_movie_set_text (SwfdecTextFieldMovie *text, const char *str, if (html) { swfdec_text_field_movie_html_parse (text, str); } else { - text->text_display = str; + text->input = g_string_assign (text->input, str); } swfdec_movie_invalidate (SWFDEC_MOVIE (text)); diff --git a/libswfdec/swfdec_text_field_movie.h b/libswfdec/swfdec_text_field_movie.h index 9d6749e..2820c62 100644 --- a/libswfdec/swfdec_text_field_movie.h +++ b/libswfdec/swfdec_text_field_movie.h @@ -80,7 +80,7 @@ struct _SwfdecTextFieldMovie { SwfdecTextField * text; /* the text_field object we render */ - const char * text_display; + GString * input; gboolean input_html; /* whether orginal input was given as HTML */ const char * variable; diff --git a/libswfdec/swfdec_text_field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index aec3bf1..9ca8560 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -73,12 +73,12 @@ swfdec_text_field_movie_get_text (SwfdecAsContext *cx, SwfdecAsObject *object, SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); - if (text->text_display == NULL) { + if (text->input == NULL) { SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY); return; } - str = g_strdup (text->text_display); + str = g_strdup (text->input->str); // if input was orginally html, remove all \r if (text->input_html) { @@ -182,7 +182,7 @@ swfdec_text_field_movie_get_length (SwfdecAsContext *cx, SwfdecAsObject *object, SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); - SWFDEC_AS_VALUE_SET_INT (ret, g_utf8_strlen (text->text_display, -1)); + SWFDEC_AS_VALUE_SET_INT (ret, g_utf8_strlen (text->input->str, -1)); } /* @@ -349,7 +349,7 @@ swfdec_text_field_movie_do_get_type (SwfdecAsContext *cx, SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); - if (text->text->input) { + if (text->text->editable) { SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_input); } else { SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_dynamic); @@ -370,9 +370,9 @@ swfdec_text_field_movie_do_set_type (SwfdecAsContext *cx, SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, "s", &value); if (!g_strcasecmp (value, SWFDEC_AS_STR_input)) { - text->text->input = TRUE; + text->text->editable = TRUE; } else if (!g_strcasecmp (value, SWFDEC_AS_STR_dynamic)) { - text->text->input = FALSE; + text->text->editable = FALSE; } // FIXME: invalidate @@ -949,16 +949,15 @@ swfdec_text_field_movie_setTextFormat (SwfdecAsContext *cx, i = 0; if (argc >= 2) { start_index = swfdec_as_value_to_integer (cx, &argv[i++]); - start_index = CLAMP (start_index, 0, (int)strlen (text->text_display)); + start_index = CLAMP (start_index, 0, (int)text->input->len); } else { start_index = 0; } if (argc >= 3) { end_index = swfdec_as_value_to_integer (cx, &argv[i++]); - end_index = CLAMP (end_index, start_index, - (int)strlen (text->text_display)); + end_index = CLAMP (end_index, start_index, (int)text->input->len); } else { - end_index = (int)strlen (text->text_display); + end_index = text->input->len; } if (start_index == end_index) return; @@ -987,15 +986,15 @@ swfdec_text_field_movie_getTextFormat (SwfdecAsContext *cx, if (argc == 0) { start_index = 0; - end_index = strlen (text->text_display); + end_index = text->input->len; } else { start_index = swfdec_as_value_to_integer (cx, &argv[0]); - start_index = MIN (start_index, strlen (text->text_display)); + start_index = MIN (start_index, text->input->len); if (argc == 1) { end_index = start_index + 1; } else { end_index = swfdec_as_value_to_integer (cx, &argv[1]); - end_index = CLAMP (end_index, start_index, strlen (text->text_display)); + end_index = CLAMP (end_index, start_index, text->input->len); } } @@ -1019,11 +1018,11 @@ swfdec_text_field_movie_replaceText (SwfdecAsContext *cx, SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, "iis", &start_index, &end_index, &str); - start_index = MIN (start_index, (int)strlen (text->text_display)); + start_index = MIN (start_index, (int)text->input->len); if (start_index < 0) return; - end_index = MIN (end_index, (int)strlen (text->text_display)); + end_index = MIN (end_index, (int)text->input->len); if (end_index < start_index) return; @@ -1111,7 +1110,7 @@ swfdec_text_field_movie_createTextField (SwfdecAsContext *cx, edittext = g_object_new (SWFDEC_TYPE_TEXT_FIELD, NULL); edittext->html = FALSE; - edittext->input = FALSE; + edittext->editable = FALSE; edittext->password = FALSE; edittext->selectable = TRUE; edittext->font = NULL; // FIXME commit 4a93d286003fdf5b8a3db1f4d2eed3412b2bb6b3 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 14:30:58 2007 +0300 If TextField's input was originally HTML, remove all \n from text property diff --git a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index 13a3dc8..d3e4a2a 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -1605,6 +1605,7 @@ swfdec_text_field_movie_set_text (SwfdecTextFieldMovie *text, const char *str, block->format = swfdec_text_format_copy (text->format_new); text->formats = g_slist_prepend (text->formats, block); + text->input_html = html; if (html) { swfdec_text_field_movie_html_parse (text, str); } else { diff --git a/libswfdec/swfdec_text_field_movie.h b/libswfdec/swfdec_text_field_movie.h index f5b0910..9d6749e 100644 --- a/libswfdec/swfdec_text_field_movie.h +++ b/libswfdec/swfdec_text_field_movie.h @@ -81,6 +81,7 @@ struct _SwfdecTextFieldMovie { SwfdecTextField * text; /* the text_field object we render */ const char * text_display; + gboolean input_html; /* whether orginal input was given as HTML */ const char * variable; diff --git a/libswfdec/swfdec_text_field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index 9f67634..aec3bf1 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -69,6 +69,7 @@ swfdec_text_field_movie_get_text (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SwfdecTextFieldMovie *text; + char *str, *p; SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); @@ -77,20 +78,24 @@ swfdec_text_field_movie_get_text (SwfdecAsContext *cx, SwfdecAsObject *object, return; } - // change all \n to \r - if (strchr (text->text_display, '\n') != NULL) { - char *str, *p; + str = g_strdup (text->text_display); - str = g_strdup (text->text_display); + // if input was orginally html, remove all \r + if (text->input_html) { p = str; - while ((p = strchr (p, '\n')) != NULL) { - *p = '\r'; + while ((p = strchr (p, '\r')) != NULL) { + memmove (p, p + 1, strlen (p)); } - SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string ( - SWFDEC_AS_OBJECT (text)->context, str)); - } else { - SWFDEC_AS_VALUE_SET_STRING (ret, text->text_display); } + + // change all \n to \r + p = str; + while ((p = strchr (p, '\n')) != NULL) { + *p = '\r'; + } + + SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string ( + SWFDEC_AS_OBJECT (text)->context, str)); } static void commit a53f4965828535510f11f9480e9b3eb0d13c0573 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 14:25:37 2007 +0300 Fix adding text when parsing HTML, that I just broke diff --git a/libswfdec/swfdec_html_parser.c b/libswfdec/swfdec_html_parser.c index 2b49068..798ca5e 100644 --- a/libswfdec/swfdec_html_parser.c +++ b/libswfdec/swfdec_html_parser.c @@ -363,26 +363,25 @@ swfdec_text_field_movie_html_parse_text (ParserData *data, const char *p) // get the text // if condense_white: all whitespace blocks are converted to a single space - if (data->condense_white) { - while (*p != '\0' && *p != '<') { + while (*p != '\0' && *p != '<') { + if (data->condense_white) { end = p + strcspn (p, "< \n\r\t"); + } else { + end = strchr (p, '<'); + if (end == NULL) + end = strchr (p, '\0'); + } - unescaped = swfdec_xml_unescape_len (data->cx, p, end - p); - data->text = g_string_append (data->text, unescaped); - g_free (unescaped); + unescaped = swfdec_xml_unescape_len (data->cx, p, end - p); + data->text = g_string_append (data->text, unescaped); + g_free (unescaped); - if (g_ascii_isspace (*end)) { - data->text = g_string_append_c (data->text, ' '); - p = end + strspn (end, " \n\r\t"); - } else { - p = end; - } + if (data->condense_white && g_ascii_isspace (*end)) { + data->text = g_string_append_c (data->text, ' '); + p = end + strspn (end, " \n\r\t"); + } else { + p = end; } - } else { - end = strchr (p, '<'); - if (end == NULL) - end = strchr (p, '\0'); - p = end; } return p; commit 473419146bc841e87bf918f220f630c746235501 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 14:12:02 2007 +0300 TextField: Only replace \n with \r in text property not internally diff --git a/libswfdec/swfdec_html_parser.c b/libswfdec/swfdec_html_parser.c index 968d6ce..2b49068 100644 --- a/libswfdec/swfdec_html_parser.c +++ b/libswfdec/swfdec_html_parser.c @@ -40,6 +40,7 @@ typedef struct { typedef struct { SwfdecAsContext *cx; gboolean multiline; + gboolean condense_white; GString * text; GSList * tags_open; GSList * tags_closed; @@ -351,8 +352,7 @@ swfdec_text_field_movie_html_parse_tag (ParserData *data, const char *p) } static const char * -swfdec_text_field_movie_html_parse_text (ParserData *data, const char *p, - gboolean condense_white) +swfdec_text_field_movie_html_parse_text (ParserData *data, const char *p) { const char *end; char *unescaped; @@ -363,29 +363,26 @@ swfdec_text_field_movie_html_parse_text (ParserData *data, const char *p, // get the text // if condense_white: all whitespace blocks are converted to a single space - // if not: all \n are converted to \r - while (*p != '\0' && *p != '<') { - if (condense_white) { + if (data->condense_white) { + while (*p != '\0' && *p != '<') { end = p + strcspn (p, "< \n\r\t"); - } else { - end = p + strcspn (p, "<\n"); - } - unescaped = swfdec_xml_unescape_len (data->cx, p, end - p); - data->text = g_string_append (data->text, unescaped); - g_free (unescaped); + unescaped = swfdec_xml_unescape_len (data->cx, p, end - p); + data->text = g_string_append (data->text, unescaped); + g_free (unescaped); - if (g_ascii_isspace (*end)) { - if (condense_white) { + if (g_ascii_isspace (*end)) { data->text = g_string_append_c (data->text, ' '); p = end + strspn (end, " \n\r\t"); } else { - data->text = g_string_append_c (data->text, '\r'); - p = end + 1; + p = end; } - } else { - p = end; } + } else { + end = strchr (p, '<'); + if (end == NULL) + end = strchr (p, '\0'); + p = end; } return p; @@ -402,6 +399,7 @@ swfdec_text_field_movie_html_parse (SwfdecTextFieldMovie *text, const char *str) data.cx = SWFDEC_AS_OBJECT (text)->context; data.multiline = (data.cx->version < 7 || text->text->multiline); + data.condense_white = text->condense_white; data.text = g_string_new (""); data.tags_open = NULL; data.tags_closed = NULL; @@ -415,8 +413,7 @@ swfdec_text_field_movie_html_parse (SwfdecTextFieldMovie *text, const char *str) p = swfdec_text_field_movie_html_parse_tag (&data, p); } } else { - p = swfdec_text_field_movie_html_parse_text (&data, p, - text->condense_white); + p = swfdec_text_field_movie_html_parse_text (&data, p); } } diff --git a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index fb8cec4..13a3dc8 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -302,7 +302,7 @@ swfdec_text_field_movie_get_paragraphs (SwfdecTextFieldMovie *text, int *num) p = text->text_display; while (p != NULL && *p != '\0') { count++; - p = strchr (p, '\r'); + p = strpbrk (p, "\r\n"); if (p != NULL) p++; } @@ -314,7 +314,7 @@ swfdec_text_field_movie_get_paragraphs (SwfdecTextFieldMovie *text, int *num) p = text->text_display; while (*p != '\0') { g_assert (i < count); - end = strchr (p, '\r'); + end = strpbrk (p, "\r\n"); if (end == NULL) end = strchr (p, '\0'); @@ -322,7 +322,7 @@ swfdec_text_field_movie_get_paragraphs (SwfdecTextFieldMovie *text, int *num) p - text->text_display, end - text->text_display); p = end; - if (*p == '\r') p++; + if (*p != '\0') p++; i++; } @@ -1495,18 +1495,15 @@ swfdec_text_field_movie_get_html_text (SwfdecTextFieldMovie *text) p = text->text_display; while (*p != '\0') { - end = strchr (p, '\r'); + end = strpbrk (p, "\r\n"); if (end == NULL) end = strchr (p, '\0'); string = swfdec_text_field_movie_html_text_append_paragraph (text, string, p - text->text_display, end - text->text_display); - if (*end == '\r') { - p = end + 1; - } else { - p = end; - } + p = end; + if (*p != '\0') p++; } return swfdec_as_context_give_string (SWFDEC_AS_OBJECT (text)->context, @@ -1611,20 +1608,7 @@ swfdec_text_field_movie_set_text (SwfdecTextFieldMovie *text, const char *str, if (html) { swfdec_text_field_movie_html_parse (text, str); } else { - // change all \n to \r - if (strchr (str, '\n') != NULL) { - char *string, *p; - - string = g_strdup (str); - p = string; - while ((p = strchr (p, '\n')) != NULL) { - *p = '\r'; - } - text->text_display = swfdec_as_context_give_string ( - SWFDEC_AS_OBJECT (text)->context, string); - } else { - text->text_display = str; - } + text->text_display = str; } swfdec_movie_invalidate (SWFDEC_MOVIE (text)); diff --git a/libswfdec/swfdec_text_field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index 75770bb..9f67634 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -72,8 +72,25 @@ swfdec_text_field_movie_get_text (SwfdecAsContext *cx, SwfdecAsObject *object, SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, ""); - SWFDEC_AS_VALUE_SET_STRING (ret, (text->text_display != NULL ? - text->text_display : SWFDEC_AS_STR_EMPTY)); + if (text->text_display == NULL) { + SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY); + return; + } + + // change all \n to \r + if (strchr (text->text_display, '\n') != NULL) { + char *str, *p; + + str = g_strdup (text->text_display); + p = str; + while ((p = strchr (p, '\n')) != NULL) { + *p = '\r'; + } + SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string ( + SWFDEC_AS_OBJECT (text)->context, str)); + } else { + SWFDEC_AS_VALUE_SET_STRING (ret, text->text_display); + } } static void commit 19bf55d1c8e6500e34a87e65abf54f5a12951746 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 14:01:21 2007 +0300 Remove unused text_input variable from SwfdecTextFieldMovie diff --git a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index 021b8ad..fb8cec4 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -876,8 +876,6 @@ swfdec_text_field_movie_mark (SwfdecAsObject *object) text = SWFDEC_TEXT_FIELD_MOVIE (object); - if (text->text_input != NULL) - swfdec_as_string_mark (text->text_input); swfdec_as_string_mark (text->text_display); if (text->variable != NULL) swfdec_as_string_mark (text->variable); @@ -1592,8 +1590,6 @@ swfdec_text_field_movie_set_text (SwfdecTextFieldMovie *text, const char *str, g_return_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text)); g_return_if_fail (str != NULL); - text->text_input = str; - // remove old formatting info iter = text->formats; while (iter) { diff --git a/libswfdec/swfdec_text_field_movie.h b/libswfdec/swfdec_text_field_movie.h index 70ddb4f..f5b0910 100644 --- a/libswfdec/swfdec_text_field_movie.h +++ b/libswfdec/swfdec_text_field_movie.h @@ -80,7 +80,6 @@ struct _SwfdecTextFieldMovie { SwfdecTextField * text; /* the text_field object we render */ - const char * text_input; const char * text_display; const char * variable; commit 6841fe177bd6d0ea99c78ae3b6f34763a64b6c67 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 11:42:43 2007 +0300 Implement TextField's onScroller property diff --git a/libswfdec/swfdec_as_strings.c b/libswfdec/swfdec_as_strings.c index 313383a..8a940d5 100644 --- a/libswfdec/swfdec_as_strings.c +++ b/libswfdec/swfdec_as_strings.c @@ -421,5 +421,6 @@ const char swfdec_as_strings[] SWFDEC_AS_CONSTANT_STRING ("Monospace") SWFDEC_AS_CONSTANT_STRING ("textHeight") SWFDEC_AS_CONSTANT_STRING ("textWidth") + SWFDEC_AS_CONSTANT_STRING ("onScroller") /* add more here */ ; diff --git a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index 93ac9aa..021b8ad 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -729,16 +729,36 @@ swfdec_text_field_movie_update_scroll (SwfdecTextFieldMovie *text, swfdec_text_field_movie_free_layouts (layouts); layouts = NULL; - text->scroll_max = all - visible + 1; - text->hscroll_max = SWFDEC_TWIPS_TO_DOUBLE (width_max - width); + if (text->scroll_max != all - visible + 1) { + text->scroll_max = all - visible + 1; + text->scroll_changed = TRUE; + } + if (text->hscroll_max != SWFDEC_TWIPS_TO_DOUBLE (width_max - width)) { + text->hscroll_max = SWFDEC_TWIPS_TO_DOUBLE (width_max - width); + text->scroll_changed = TRUE; + } if (check_limits) { - text->scroll = CLAMP(text->scroll, 1, text->scroll_max); - text->scroll_bottom = text->scroll + (visible > 0 ? visible - 1 : 0); - text->hscroll = CLAMP(text->hscroll, 0, text->hscroll_max); + if (text->scroll != CLAMP(text->scroll, 1, text->scroll_max)) { + text->scroll = CLAMP(text->scroll, 1, text->scroll_max); + text->scroll_changed = TRUE; + } + if (text->scroll_bottom != text->scroll + (visible > 0 ? visible - 1 : 0)) + { + text->scroll_bottom = text->scroll + (visible > 0 ? visible - 1 : 0); + text->scroll_changed = TRUE; + } + if (text->hscroll != CLAMP(text->hscroll, 0, text->hscroll_max)) { + text->hscroll = CLAMP(text->hscroll, 0, text->hscroll_max); + text->scroll_changed = TRUE; + } } else { - text->scroll_bottom = MAX (CLAMP(text->scroll, 1, text->scroll_max) + - (visible > 0 ? visible - 1 : 0), text->scroll); + if (text->scroll_bottom != MAX (CLAMP(text->scroll, 1, text->scroll_max) + + (visible > 0 ? visible - 1 : 0), text->scroll)) { + text->scroll_bottom = MAX (CLAMP(text->scroll, 1, text->scroll_max) + + (visible > 0 ? visible - 1 : 0), text->scroll); + text->scroll_changed = TRUE; + } } } @@ -940,6 +960,23 @@ swfdec_text_field_movie_finish_movie (SwfdecMovie *movie) } static void +swfdec_text_field_movie_iterate (SwfdecMovie *movie) +{ + SwfdecTextFieldMovie *text = SWFDEC_TEXT_FIELD_MOVIE (movie); + + if (text->scroll_changed) { + SwfdecAsValue argv[2]; + + SWFDEC_AS_VALUE_SET_STRING (&argv[0], SWFDEC_AS_STR_onScroller); + SWFDEC_AS_VALUE_SET_OBJECT (&argv[1], SWFDEC_AS_OBJECT (movie)); + swfdec_as_object_call (SWFDEC_AS_OBJECT (movie), + SWFDEC_AS_STR_broadcastMessage, 2, argv, NULL); + + text->scroll_changed = FALSE; + } +} + +static void swfdec_text_field_movie_class_init (SwfdecTextFieldMovieClass * g_class) { GObjectClass *object_class = G_OBJECT_CLASS (g_class); @@ -952,6 +989,7 @@ swfdec_text_field_movie_class_init (SwfdecTextFieldMovieClass * g_class) movie_class->init_movie = swfdec_text_field_movie_init_movie; movie_class->finish_movie = swfdec_text_field_movie_finish_movie; + movie_class->iterate_start = swfdec_text_field_movie_iterate; movie_class->update_extents = swfdec_text_field_movie_update_extents; movie_class->render = swfdec_text_field_movie_render; } diff --git a/libswfdec/swfdec_text_field_movie.h b/libswfdec/swfdec_text_field_movie.h index 058d915..70ddb4f 100644 --- a/libswfdec/swfdec_text_field_movie.h +++ b/libswfdec/swfdec_text_field_movie.h @@ -92,6 +92,7 @@ struct _SwfdecTextFieldMovie { gboolean embed_fonts; SwfdecStyleSheet * style_sheet; + gboolean scroll_changed; /* if any of the scroll attributes have changed and we haven't fired the event yet */ int scroll; int scroll_max; int scroll_bottom; diff --git a/libswfdec/swfdec_text_field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index 4235111..75770bb 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -587,6 +587,7 @@ swfdec_text_field_movie_do_set_hscroll (SwfdecAsContext *cx, value = CLAMP (value, 0, text->hscroll_max); if (value != text->hscroll) { text->hscroll = value; + text->scroll_changed = TRUE; swfdec_movie_invalidate (SWFDEC_MOVIE (text)); } } @@ -672,6 +673,7 @@ swfdec_text_field_movie_do_set_scroll (SwfdecAsContext *cx, if (value != text->scroll) { text->scroll_bottom += value - text->scroll; text->scroll = value; + text->scroll_changed = TRUE; swfdec_movie_invalidate (SWFDEC_MOVIE (text)); } } commit 876a5a755308af20d35b7e8528c9a42a6c8d4398 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Mon Oct 22 10:55:47 2007 +0300 Make TextField instances do addListener on themselves diff --git a/libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c index 1d3e791..93ac9aa 100644 --- a/libswfdec/swfdec_text_field_movie.c +++ b/libswfdec/swfdec_text_field_movie.c @@ -890,6 +890,11 @@ swfdec_text_field_movie_init_movie (SwfdecMovie *movie) SWFDEC_AS_VALUE_GET_OBJECT (&val)); } + // listen self + SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (movie)); + swfdec_as_object_call (SWFDEC_AS_OBJECT (movie), SWFDEC_AS_STR_addListener, + 1, &val, NULL); + // format text->format_new SWFDEC_TEXT_FORMAT (swfdec_text_format_new_no_properties (cx)); diff --git a/libswfdec/swfdec_text_field_movie_as.c b/libswfdec/swfdec_text_field_movie_as.c index 4b85cc9..4235111 100644 --- a/libswfdec/swfdec_text_field_movie_as.c +++ b/libswfdec/swfdec_text_field_movie_as.c @@ -1319,5 +1319,7 @@ swfdec_text_field_movie_construct (SwfdecAsContext *cx, SwfdecAsObject *object, swfdec_text_field_movie_init_properties (cx); + // FIXME: do object.addListener (object); + SWFDEC_AS_VALUE_SET_OBJECT (ret, object); }
Maybe Matching Threads
- 5 commits - libswfdec/swfdec_html_parser.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
- 20 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h
- 18 commits - libswfdec/swfdec_player_internal.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_format.c libswfdec/swfdec_text_format.h libswfdec/swfdec_xml.c libswfdec/swfdec_xml_node.c libswfdec/swfdec_xml_node.h test/trace
- 6 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c
- 6 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_codec_video.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c