- move m_responseMIMEType out of ResourceRequest, where it doesn't belong
* page/FramePrivate.h: Add m_responseMIMEType
* page/ResourceRequest.h: Remove m_responseMIMEType
* page/Frame.cpp:
(WebCore::Frame::setResponseMIMEType): added
(WebCore::Frame::responseMIMEType): added
(WebCore::Frame::begin): get MIME type from the right place
(WebCore::Frame::write): ditto
* page/Frame.h:
* bindings/js/kjs_window.cpp:
(KJS::createNewWindow): updated to use new Frame methods
(KJS::WindowFunc::callAsFunction): ditto
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge openURL:reload:contentType:refresh:lastModified:pageCache:]): ditto
(-[WebCoreFrameBridge canProvideDocumentSource]): ditto
* loader/PluginDocument.cpp:
(WebCore::PluginTokenizer::createDocumentStructure): ditto
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17006
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-12 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Eric.
+
+ - move m_responseMIMEType out of ResourceRequest, where it doesn't belong
+
+ * page/FramePrivate.h: Add m_responseMIMEType
+ * page/ResourceRequest.h: Remove m_responseMIMEType
+ * page/Frame.cpp:
+ (WebCore::Frame::setResponseMIMEType): added
+ (WebCore::Frame::responseMIMEType): added
+ (WebCore::Frame::begin): get MIME type from the right place
+ (WebCore::Frame::write): ditto
+ * page/Frame.h:
+ * bindings/js/kjs_window.cpp:
+ (KJS::createNewWindow): updated to use new Frame methods
+ (KJS::WindowFunc::callAsFunction): ditto
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge openURL:reload:contentType:refresh:lastModified:pageCache:]): ditto
+ (-[WebCoreFrameBridge canProvideDocumentSource]): ditto
+ * loader/PluginDocument.cpp:
+ (WebCore::PluginTokenizer::createDocumentStructure): ditto
+
2006-10-12 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
- projectRoot = "";
- shouldCheckCompatibility = 1;
targets = (
93F198A508245E59001E9ABC /* WebCore */,
DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
request.frameName = frameName;
if (activePart)
request.setReferrer(activePart->referrer());
- // FIXME: is this needed?
- request.m_responseMIMEType = "text/html";
// FIXME: It's much better for client API if a new window starts with a URL, here where we
// know what URL we are going to open. Unfortunately, this code passes the empty string
}
return Window::retrieve(frame);
}
- // FIXME: is this needed?
- request.m_responseMIMEType = "text/html";
// request window (new or existing if framename is set)
Frame* newFrame = 0;
// arguments
ResourceRequest request(m_frame->resourceRequest());
request.reload = reload;
- if (contentType)
- request.m_responseMIMEType = contentType;
m_frame->setResourceRequest(request);
-
+ m_frame->setResponseMIMEType(contentType);
+
// opening the URL
if (m_frame->didOpenURL(URL)) {
// things we have to set up after calling didOpenURL
- (BOOL)canProvideDocumentSource
{
- String mimeType = m_frame->resourceRequest().m_responseMIMEType;
+ String mimeType = m_frame->responseMIMEType();
if (WebCore::DOMImplementation::isTextMIMEType(mimeType) ||
Image::supportsType(mimeType) ||
m_embedElement->setAttribute(nameAttr, "plugin");
m_embedElement->setSrc(m_doc->URL());
- m_embedElement->setType(m_doc->frame()->resourceRequest().m_responseMIMEType);
+ m_embedElement->setType(m_doc->frame()->responseMIMEType());
body->appendChild(embedElement, ec);
}
return d->m_request;
}
+void Frame::setResponseMIMEType(const String& contentType)
+{
+ d->m_responseMIMEType = contentType;
+}
+
+const String& Frame::responseMIMEType() const
+{
+ return d->m_responseMIMEType;
+}
+
void Frame::begin(const KURL& url)
{
if (d->m_workingURL.isEmpty())
baseurl = d->m_url;
#ifdef SVG_SUPPORT
- if (d->m_request.m_responseMIMEType == "image/svg+xml")
+ if (d->m_responseMIMEType == "image/svg+xml")
d->m_doc = DOMImplementation::instance()->createSVGDocument(d->m_view.get());
else
#endif
- if (DOMImplementation::isXMLMIMEType(d->m_request.m_responseMIMEType))
+ if (DOMImplementation::isXMLMIMEType(d->m_responseMIMEType))
d->m_doc = DOMImplementation::instance()->createDocument(d->m_view.get());
- else if (DOMImplementation::isTextMIMEType(d->m_request.m_responseMIMEType))
+ else if (DOMImplementation::isTextMIMEType(d->m_responseMIMEType))
d->m_doc = new TextDocument(DOMImplementation::instance(), d->m_view.get());
- else if ((d->m_request.m_responseMIMEType == "application/pdf" || d->m_request.m_responseMIMEType == "text/pdf") && PlugInInfoStore::supportsMIMEType(d->m_request.m_responseMIMEType))
+ else if ((d->m_responseMIMEType == "application/pdf" || d->m_responseMIMEType == "text/pdf") && PlugInInfoStore::supportsMIMEType(d->m_responseMIMEType))
d->m_doc = new PluginDocument(DOMImplementation::instance(), d->m_view.get());
- else if (Image::supportsType(d->m_request.m_responseMIMEType))
+ else if (Image::supportsType(d->m_responseMIMEType))
d->m_doc = new ImageDocument(DOMImplementation::instance(), d->m_view.get());
- else if (PlugInInfoStore::supportsMIMEType(d->m_request.m_responseMIMEType))
+ else if (PlugInInfoStore::supportsMIMEType(d->m_responseMIMEType))
d->m_doc = new PluginDocument(DOMImplementation::instance(), d->m_view.get());
else if (inViewSourceMode())
d->m_doc = new HTMLViewSourceDocument(DOMImplementation::instance(), d->m_view.get());
}
if (!d->m_decoder) {
- d->m_decoder = new Decoder(d->m_request.m_responseMIMEType, settings()->encoding());
+ d->m_decoder = new Decoder(d->m_responseMIMEType, settings()->encoding());
if (!d->m_encoding.isNull())
d->m_decoder->setEncoding(d->m_encoding,
d->m_haveEncoding ? Decoder::UserChosenEncoding : Decoder::EncodingFromHTTPHeader);
KURL url() const;
- void setResourceRequest(const ResourceRequest& request);
+ void setResourceRequest(const ResourceRequest&);
const ResourceRequest& resourceRequest() const;
+ void setResponseMIMEType(const String&);
+ const String& responseMIMEType() const;
+
bool containsPlugins() const;
bool prohibitsScrolling() const;
KURL m_workingURL;
ResourceRequest m_request;
+ String m_responseMIMEType;
+
CachePolicy m_cachePolicy;
Timer<Frame> m_redirectionTimer;
bool m_lockHistory;
public:
- // FIXME: the response MIME type shouldn't be in here, it
- // should be in some kind of response object
- String m_responseMIMEType;
-
FormData postData;
bool reload;
private: