Discussion:
Bug in MSHTML (CSS handling) under VB
(too old to reply)
Antonariy
2007-02-06 12:26:21 UTC
Permalink
I'm using WebBrowser control and Microsoft HTML Object Library in many
applications and I found some bugs. Most of them are fixed in latest version
of MSHTML, but this one persists.

I'm maiking an HTML table in VB like that:

t = "<table class='list'>"
For x=0 to y
t = t & "<tr>"
...
and so on. Then I'm settin this table to div's innerHTML -

lDiv.innerHTML = t

CSS class "list" looks like this (it is for keeping headers up in div with
overflow:auto like in DataGrid):

table.list th
{
background-color:Gray;
Z-INDEX: 2;
POSITION: relative;
TOP: expression(ParentDiv(this).scrollTop-2);
}

The problem is in rule "TOP". It is ignored. Expressions in rules don't work
after assigning html text to some innerHTML. But only under VB! It works
only in IE itself. Is it possible to fix this problem?
Antonariy
2007-02-06 14:04:34 UTC
Permalink
I understand now what is happening. I store original innerHTML of the div in
a string variable (template), from which make a table later. And this
variable has value:
<TABLE class=list id=tbl>
<THEAD>
<TR>
<TH style="TOP: -2px">1</TH>
<TH style="TOP: -2px">2</TH>
<TH style="TOP: -2px">3</TH>
<TH style="TOP: -2px">&nbsp;</TH></TR></THEAD>

top:expression sets a value to style!
F**k!!!!
As I understand, there is no walkaround this behaviour. But it's easy to fix
MSHTML - if property of style depends of CSS class and its rule has an
expression, then building outer/innerHTML output must not include style!!!

I'm begging to show this report to MSHTML team because there is no
"mshtml.bugs" newsgroup :(

Loading...