rkd77 / elinks

Fork of elinks
Other
349 stars 38 forks source link

Regression in block elements with background colors #167

Closed dialognewmedia-mws closed 2 years ago

dialognewmedia-mws commented 2 years ago

Hi there,

Thanks for reviving interest in this great little browser. I wanted to let you know that there seems to have been a regression in support for HTML block elements such as <div> or <table>.

In ELinks 0.13, if these elements are assigned a background color, the color is displayed at the full width of the element. In the current master branch, the background color only renders in a collapsed manner.

The screenshots below were taken of https://news.ycombinator.com/

The top orange <td> is set to 100% width of the <table> but when it wraps, the color collapses to the right of the innerHTML.

Screenshot shows incorrect behavior in master branch: image

Screenshot shows correct behavior in 0.13: image

Simplified test code is below:

<html>
<head></head>
<body>
<div style="background: red">Hello</div>
<table bgcolor="green">
<tr>
<td>Hi</td>
</tr>
</table>
</body>
</html>  
rkd77 commented 2 years ago

Thanks for the report. After git bisection turned out that commit b4045ef864de2ba106cd26468876803cf1100064 was faulty. I'm not sure whether the fix does not corrupt blockquotes.

dialognewmedia-mws commented 2 years ago

It looks like this latest commit fixed the TD rendering on Hacker News but the test HTML I sent above still is incorrect for the DIV tag in the example which should be 100% width per spec. Even if the DIV is manually set to 100% width, the background does not render to the right of innerHTML.

Here's a revision to my test case above:

<html>
<head></head>
<body>
<div width="100%" style="width: 100%; background: red">Hello</div>
<table bgcolor="green" width="100%">
<tr><td bgcolor="orange">Hi</td></tr>
</table>
</body></html>

This is how the HTML above renders in 0.13: image

And in 0.16.GIT: image

rkd77 commented 2 years ago

I cannot reproduce it. On all tested versions it looks like 0.16.GIT. Could you provide exact version number, compile options, and changed config options of elinks which renders this page fine?

dialognewmedia-mws commented 2 years ago

Oh that's interesting. I hadn't considered that perhaps it was the 0.13 version I have. It was built from the original code in openSUSE Tumbleweed. Here are the features listed in the Help|About

Standard, Fastmem, IPv6, gzip, bzip2, UTF-8, Periodic Saving, Viewer (Search History, Timer, Marks), Cascading Style Sheets, Protocol (Authentication, BitTorrent, File, CGI, Finger, FTP, Gopher, HTTP, NNTP, URI rewrite, User protocols), SSL (OpenSSL), MIME (Option system, Mailcap, Mimetypes files), LED indicators, Bookmarks, Cookies, Form History, Global History, Scripting (Lua, Perl, Ruby), Exmode, Goto URL History

I tried copying my config from the Suse packages over to my 0.16.Git version but that didn't seem to affect things. I'm attaching it to this message though for what it's worth. It's 0.13.Git, built 2019-07-23. elinks.conf.txt

On 5/9/22 05:17, rkd77 wrote:

I cannot reproduce it. On all tested versions it looks like 0.16.GIT. Could you provide exact version number, compile options, and changed config options of elinks which renders this page fine?

— Reply to this email directly, view it on GitHub https://github.com/rkd77/elinks/issues/167#issuecomment-1121024537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA332U2AMEFLAYUZS2ZAEWDVJD66LANCNFSM5VKZ4HGA. You are receiving this because you authored the thread.Message ID: @.***>

rkd77 commented 2 years ago

Please check now. It was very silly hack, but if you call it regression, I restored old code.

dialognewmedia-mws commented 2 years ago

That seems to have fixed the problem. The former way of doing things did have bugs that I encountered, but at least it didn't collapse innerHTML color entirely.

On 5/9/2022 11:58 AM, rkd77 wrote:

Please check now. It was very silly hack, but if you call it regression, I restored old code.

— Reply to this email directly, view it on GitHub https://github.com/rkd77/elinks/issues/167#issuecomment-1121462231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA332U3ZJPTTU52V6GCBRHLVJFN53ANCNFSM5VKZ4HGA. You are receiving this because you authored the thread.Message ID: @.***>