From 3d9d07ba7ce72e32ee46eafdec6a38fae38541e4 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Thu, 25 Nov 2021 23:53:46 +0000 Subject: [PATCH] WebView: bugfixes git-svn-id: svn://kolibrios.org@9318 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/browser/TWB/set_style.h | 22 +++++++++++++---- programs/cmm/browser/const.h | 4 ++-- programs/cmm/browser/tests/form.html | 36 ++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 programs/cmm/browser/tests/form.html diff --git a/programs/cmm/browser/TWB/set_style.h b/programs/cmm/browser/TWB/set_style.h index 536789ddf8..e7d24db5f9 100644 --- a/programs/cmm/browser/TWB/set_style.h +++ b/programs/cmm/browser/TWB/set_style.h @@ -362,6 +362,8 @@ void TWebBrowser::tag_table() if (table.depth==1) { table.count++; colcount = 0; + td_pos = 0; + row_start_y = draw_y; if (tag.get_number_of("width")) { if (strchr(tag.value, '%')) tag.number = list.w * tag.number / 100; table.width.set(table.count, math.min(tag.number,list.w)); @@ -376,8 +378,9 @@ void TWebBrowser::tag_table() if (table.depth==0) { draw_x = left_gap = style.tag_list.level * 5 * list.font_w + BODY_MARGIN; draw_w = list.w; + if (td_pos) draw_y = math.max(draw_y, tallest_cell_in_row); draw_y = math.max(draw_y+style.cur_line_h, tallest_cell_in_row); - row_start_y = draw_y = tallest_cell_in_row = draw_y; + row_start_y = tallest_cell_in_row = draw_y; style.cur_line_h = list.item_h; } } @@ -403,6 +406,7 @@ void TWebBrowser::tag_table() } else { if (tag.is("tr")) { if (tag.opened) { + if (td_pos) draw_y = math.max(draw_y, tallest_cell_in_row); _TR_FIX: if (draw_x==left_gap) && (draw_y==BODY_MARGIN) { row_start_y = tallest_cell_in_row = draw_y; @@ -414,6 +418,7 @@ void TWebBrowser::tag_table() td_pos = 0; } else { draw_y = math.max(draw_y, tallest_cell_in_row); + td_pos = 0; } draw_x = left_gap = style.tag_list.level * 5 * list.font_w + BODY_MARGIN; draw_w = list.w; @@ -441,10 +446,12 @@ void TWebBrowser::tag_table() draw_w = table.width.get(table.count) - BODY_MARGIN; } else { draw_x = left_gap = left_gap + draw_w; - draw_w = table.width.get(table.count) - left_gap; + draw_w = table.width.get(table.count) - left_gap + table.margin - BODY_MARGIN; } - if (EAX = table.cols.get(tr_pos-1)-td_pos) draw_w /= EAX; else { + if (EAX = table.cols.get(tr_pos-1)-td_pos) { + draw_w /= EAX; + } else { draw_y = row_start_y; draw_x = left_gap = table.margin; } @@ -456,7 +463,8 @@ void TWebBrowser::tag_table() } draw_y = row_start_y; //canvas.WriteText(draw_x, draw_y, 10001001b, 0x0000FE, itoa(draw_x), NULL); - td_pos++; + //canvas.WriteText(draw_x, draw_y+20, 10001001b, 0xFF0000, itoa(draw_w), NULL); + td_pos++; } } } @@ -470,5 +478,11 @@ void TWebBrowser::tag_table() canvas.DrawBar(0, draw_y, 20, 20, 0xFF0000); } } + /* + if (left_gap + draw_w > list.w) { + draw_w = list.w - left_gap; + if (debug_mode) debugln("anomaly draw_W"); + } + */ } diff --git a/programs/cmm/browser/const.h b/programs/cmm/browser/const.h index 57b649534b..2fa881e89c 100644 --- a/programs/cmm/browser/const.h +++ b/programs/cmm/browser/const.h @@ -105,6 +105,6 @@ char editbox_icons[] = FROM "res/editbox_icons.raw"; #define WIN_W 850 #define WIN_H 920 -#define DEFAULT_URL URL_SERVICE_HOMEPAGE +#define DEFAULT_URL "/sys/fonts/ru.htm" -char version[]="WebView 3.65"; \ No newline at end of file +char version[]="WebView 3.66"; \ No newline at end of file diff --git a/programs/cmm/browser/tests/form.html b/programs/cmm/browser/tests/form.html new file mode 100644 index 0000000000..9d4ec8d5b6 --- /dev/null +++ b/programs/cmm/browser/tests/form.html @@ -0,0 +1,36 @@ + + + + +
+First name:
+Last name:
+ +
+ +
+ First name:
+ Last name:
+ +
+ +

Click the "Submit" button and the form-data will be sent to a script on the server.

+ +

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+

aboba


+ + + +