summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/dom/Document.cpp9
-rw-r--r--WebCore/html/HTMLDocument.cpp16
2 files changed, 9 insertions, 16 deletions
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 066cf46..c510669 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -547,6 +547,15 @@ void Document::setDocType(PassRefPtr<DocumentType> docType)
m_docType = docType;
if (m_docType)
m_docType->setDocument(this);
+#ifdef ANDROID_META_SUPPORT
+ if (!ownerElement() && m_docType->publicId().startsWith("-//wapforum//dtd xhtml mobile 1.", false)) {
+ // fit mobile sites directly in the screen
+ frame()->settings()->setMetadataSettings("width", "device-width");
+ FrameView* frameView = view();
+ if (frameView)
+ android::WebViewCore::getWebViewCore(frameView)->updateViewport();
+ }
+#endif
determineParseMode();
}
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index d60d3fa..96ae9e4 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -75,12 +75,6 @@
#include "DocTypeStrings.cpp"
-#ifdef ANDROID_META_SUPPORT
-#include "FrameTree.h"
-#include "Settings.h"
-#include "WebViewCore.h"
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -381,16 +375,6 @@ void HTMLDocument::determineParseMode()
String lowerPubID = docType->publicId().lower();
CString pubIDStr = lowerPubID.latin1();
-#ifdef ANDROID_META_SUPPORT
- if ((!frame()->tree() || !frame()->tree()->parent()) &&
- strstr(pubIDStr.data(), "-//wapforum//dtd xhtml mobile 1.") == pubIDStr.data()) {
- // fit mobile sites directly in the screen
- frame()->settings()->setMetadataSettings("width", "device-width");
- FrameView* frameView = view();
- if (frameView)
- android::WebViewCore::getWebViewCore(frameView)->updateViewport();
- }
-#endif
// Look up the entry in our gperf-generated table.
const PubIDInfo* doctypeEntry = findDoctypeEntry(pubIDStr.data(), pubIDStr.length());
if (!doctypeEntry)