[Mono-bugs] [Bug 428172] New: WebBrowser: DocumentXxxx properties broken

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Sep 21 08:50:04 EDT 2008


User andyhume32 at yahoo.co.uk added comment

           Summary: WebBrowser: DocumentXxxx properties broken
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: avidigal at novell.com
        ReportedBy: andyhume32 at yahoo.co.uk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

The following properties don't work in WebBrowser, as tested in Windows
2.0preview+.  Not tested on Linux (I should really think about getting a
working WebBrowser setup on Linux!).  Only #2 would appear possibly platform

BTW these properties were most not implemented in 1.9, so no regression.

1) get_DocumentStream uses StreamReader to read from a string DocumentText,
thus uses the string as a path!  BTW once a page is loaded the error from #2
occurs when this property is accessed.

If using DocumentText to get the data it would need to be something like:
    string text = DocumentText;
    if( text == null) return null;
    System.Text.Encoding enc = … … 
    Stream s = new MemoryStream(enc.GetBytes(text), false);
But what encoding to use?  Is Document.Encoding valid?

Ideally the raw content as downloaded by the browser would be returned…

set_DocumentStream untested due to #2.

2) DocumentText (get_ and set_) fails with InvalidCastException.
base.WebHost.Document.FirstChild apparently returns a Mono.Mozilla.DOM.Node,
which implements INode (and IDisposable) but not IElement…

3) DocumentTitle (get_ and set_) fails with NRE before first painted.

4) DocumentType (get_ and set_) fails with NRE before first page loaded.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list