kooloveme / thtmlviewer

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

wrong link color #343

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Which steps will reproduce the problem?
1. load html with <a style="color: ....">

What is the expected output? What do you see instead?
Link with black color display blue, other color is ok

Which version of the product are you using? Which compiler version are you
using? On which operating system?
htmlviewer 457
delphi xe2
windows 7 x86

Please attach test html files and screenshots, if appropriate.
Please provide any additional information:
demo

Original issue reported on code.google.com by alr888...@gmail.com on 27 Mar 2014 at 11:54

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for spotting this issue.

Original comment by OrphanCat on 27 Mar 2014 at 7:19

GoogleCodeExporter commented 9 years ago
I have found the following about this issue:

when a link is style="color: red" then this line in TProperties.Combine inner 
function Merge continues.

if (Props[Index] <> Unassigned) and not VarIsIntNull(Props[Index]) then
  continue;

Whereas when it is style="color: black" then the line does not continue and so 
the default color is assigned.

I am sure it is because 0 is varEmpty which is equal to Unassigned.

I do not know the solution to this at the moment, as I am not sure how you note 
that it has been assigned by the attribute to be 0.

But if you put this code in it works:

if (VarIsNumeric(Props[Index]) and (Props[Index] = varEmpty)) OR
   ((Props[Index] <> Unassigned) and not VarIsIntNull(Props[Index])) then
  continue;

However, I do not know what side-effects this will have

Original comment by martin.s...@gmail.com on 25 Apr 2014 at 1:05