diff options
Diffstat (limited to 'WebCore/html/HTMLBodyElement.cpp')
-rw-r--r-- | WebCore/html/HTMLBodyElement.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp index 9828dab..9852858 100644 --- a/WebCore/html/HTMLBodyElement.cpp +++ b/WebCore/html/HTMLBodyElement.cpp @@ -39,6 +39,10 @@ #include "MappedAttribute.h" #include "ScriptEventListener.h" +#ifdef ANDROID_META_SUPPORT +#include "Settings.h" +#endif + namespace WebCore { using namespace HTMLNames; @@ -173,6 +177,15 @@ void HTMLBodyElement::insertedIntoDocument() setAttribute(marginheightAttr, String::number(marginHeight)); } +#ifdef ANDROID_META_SUPPORT + Settings * settings = document()->settings(); + String host = document()->baseURI().host().lower(); + if (settings->viewportWidth() == -1 && (host.startsWith("m.") || host.startsWith("mobile.") + || host.contains(".m.") || host.contains(".mobile."))) + // fit mobile sites directly in the screen + settings->setMetadataSettings("width", "device-width"); +#endif + // FIXME: This call to scheduleRelayout should not be needed here. // But without it we hang during WebKit tests; need to fix that and remove this. if (FrameView* view = document()->view()) |