WebView: bugfixes

git-svn-id: svn://kolibrios.org@9318 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-11-25 23:53:46 +00:00
parent 98d64b669d
commit 3d9d07ba7c
3 changed files with 56 additions and 6 deletions

View File

@ -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");
}
*/
}

View File

@ -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";
char version[]="WebView 3.66";

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<body>
<form action="https://www.w3schools.com/action_page.php">
First name: <input type="text" name="fname" value="Mickey"><br>
Last name: <input type="text" name="lname" value="Mouse"><br>
<input type="submit" value="Submit">
</form>
<form action="https://www.w3schools.com/action_page.php" method="post">
First name: <input type="text" name="fname" value="Aboba"><br>
Last name: <input type="text" name="lname" value="Aboba"><br>
<input type="submit" value="Submit">
</form>
<p>Click the "Submit" button and the form-data will be sent to a script on the server.</p>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
<h1>aboba</h1><br>
</body>
</html>