Get MSHTML's DOM Hidden Elements

  • Thread starter Thread starter ThroatWobblerMangrove
  • Start date Start date
T

ThroatWobblerMangrove

I hope I can explain this well.

I'm working in MSHTML. I have a Document and I'm trying to get ALL the
hidden elements. However, I can't parse the Document to get
properties/attributes because it is not consistent. Some elements are
directly 'Display:none' and some are hidden through a CSS (class="hidden")
and some are something else I can't deduce from parsing the DOM.

So my question is, is the an object that MSHTML exposes which from which I
can tell what elements the browser is going to show and not show?

Thanks!!
 
ThroatWobblerMangrove said:
I hope I can explain this well.

I'm working in MSHTML. I have a Document and I'm trying to get ALL the
hidden elements. However, I can't parse the Document to get
properties/attributes because it is not consistent. Some elements are
directly 'Display:none' and some are hidden through a CSS (class="hidden")
and some are something else I can't deduce from parsing the DOM.
You don't "parse the DOM", the DOM is the result of parsing the document.
It's done for you.
So my question is, is the an object that MSHTML exposes which from which I
can tell what elements the browser is going to show and not show?
Not without defining "show". If an element has style "left: -10000px", is it
showing? How about a paragraph with "color: white; background-color: white"?
How about an <object> for which the plugin is not installed? How about an
element that's going to be hidden by Javascript once the document is loaded?

You may find it sufficient to enumerate through all elements and check the
..currentStyle.display property. If that won't do it for you, try asking in
comp.os.ms-windows.programmer.win32 instead, as your question has nothing to
do with C#.
 
Back
Top