Patiencer / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
0 stars 0 forks source link

Set CSS style of already parsed elements is not yet supported #383

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of the product are you using? Which compiler version are you
using? On which operating system?
r487, C++Builder XE4, Win 7

Please attach test html files and screenshots, if appropriate.
Please provide any additional information:
<html>
    <head></head>
    <body>
        <table border='0' align='center'>
            <tr>
                <td id='t123'>Hello world!</td>
            </tr>
        </table>
        <style type="text/css">
            #t123 { border: 2px solid red; }
        </style>
    </body>
</html>

In a current web browser you will see a red rectangle around the text "Hello 
world!". In HTMLViewer you will see no rectangle.

Original issue reported on code.google.com by hpk...@sked.de on 29 Oct 2014 at 4:29

GoogleCodeExporter commented 9 years ago
Dear Mr. Kunz,

it is not that HtmlViewer does not supports styles via ID, but it assigns the 
styles while parsing the source. As the style is set after the table it is not 
recognized.

In the source:

<html>
    <head></head>
    <body>
        <table border='0' align='center'>
            <tr>
                <td id='t123'>Hello world!</td>
            </tr>
        </table>
        <style type="text/css">
            #t123 { border: 2px solid red; }
        </style>
        <table border='0' align='center'>
            <tr>
                <td id='t123'>Hello world!</td>
            </tr>
        </table>
    </body>
</html>

the second table is rendered with the border.

Because of this basical weakness it is almost impossible to fix this issue in 
the current HtmlViewer. 

Original comment by OrphanCat on 7 Nov 2014 at 9:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks for the assessment of this issue. Then we have to help ourselves in 
another way.

Original comment by hpk...@sked.de on 14 Nov 2014 at 5:49