diff options
author | Ben Murdoch <benm@google.com> | 2009-08-18 11:35:14 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2009-08-18 11:35:14 +0100 |
commit | e0330ac957b8434cd2c9c7b5447aaa0faabe77ec (patch) | |
tree | 395ba85351595e79b5e357e46af5c28a0dcb5211 /WebCore/html | |
parent | b32f88b61a9162a5194ab02c12fc3aff6140e30e (diff) | |
parent | 8ca4160fde81af362cf2ea375997797b1df8243d (diff) | |
download | external_webkit-e0330ac957b8434cd2c9c7b5447aaa0faabe77ec.zip external_webkit-e0330ac957b8434cd2c9c7b5447aaa0faabe77ec.tar.gz external_webkit-e0330ac957b8434cd2c9c7b5447aaa0faabe77ec.tar.bz2 |
Merge commit 'goog/master' into merge
Conflicts:
WebCore/bindings/v8/ScriptController.cpp
WebCore/page/Geolocation.cpp
WebCore/platform/android/GeolocationServiceAndroid.cpp
Diffstat (limited to 'WebCore/html')
-rw-r--r-- | WebCore/html/HTMLBodyElement.cpp | 13 | ||||
-rw-r--r-- | WebCore/html/HTMLMetaElement.cpp | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp index f81377d..be6663f 100644 --- a/WebCore/html/HTMLBodyElement.cpp +++ b/WebCore/html/HTMLBodyElement.cpp @@ -35,6 +35,10 @@ #include "MappedAttribute.h" #include "ScriptEventListener.h" +#ifdef ANDROID_META_SUPPORT +#include "Settings.h" +#endif + namespace WebCore { using namespace HTMLNames; @@ -171,6 +175,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()) diff --git a/WebCore/html/HTMLMetaElement.cpp b/WebCore/html/HTMLMetaElement.cpp index 48284e3..5d3e925 100644 --- a/WebCore/html/HTMLMetaElement.cpp +++ b/WebCore/html/HTMLMetaElement.cpp @@ -27,6 +27,10 @@ #include "HTMLNames.h" #include "MappedAttribute.h" +#ifdef ANDROID_META_SUPPORT +#include "Settings.h" +#endif + namespace WebCore { using namespace HTMLNames; @@ -68,6 +72,10 @@ void HTMLMetaElement::process() return; if (equalIgnoringCase(name(), "viewport") || equalIgnoringCase(name(), "format-detection")) document()->processMetadataSettings(m_content); + else if (equalIgnoringCase(name(), "HandheldFriendly") && equalIgnoringCase(m_content, "true") + && document()->settings()->viewportWidth() == -1) + // fit mobile sites directly in the screen + document()->settings()->setMetadataSettings("width", "device-width"); #endif // Get the document to process the tag, but only if we're actually part of DOM tree (changing a meta tag while // it's not in the tree shouldn't have any effect on the document) |