[Webkit-unassigned] [Bug 13843] WenKitQt doesn't provide any function which open html code from a String

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 29 00:52:23 PDT 2007


------- Comment #4 from mjs at apple.com  2007-05-29 00:52 PDT -------
setHTML might be misleaqding, since the load may still not be completely
synchronous (at least if it works like data loads in other browsers). Also, I
believe this particular approach to implementing the method is wrong. What I
suggest instead is to make the FrameLoader do a data load, as that

You also need a way to set the base URL.

I suggest looking at the following methods in WebFrame in the Mac/ObjC WebKit

- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)URL
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType
textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL

The former is a convenience for a string but still lets you set a base URL for
subresources, the later would be the equivalent of the QByteArray suggestion,
it also lets you define the encoding and MIME type.

In Qt terms, you could have:

void loadHTMLString(const QString& string, const QUrl& baseURL);
void loadData(const QByteArray& data, const QString& MIMEType, const QString&
textEncodingName, const QUrl& baseURL);

You should also look at the Mac implementation of these methods, they
ultimately call down to FrameLoader::load(const ResourceRequest&, const
SubstituteData&). This isx ultimately the right way to do it, just using
begin/write/end can skip many necessary steps.

r- to consider my and Simon's comments.

Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list