summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-09-04 16:30:32 -0700
committerGrace Kloba <klobag@google.com>2009-09-04 16:30:32 -0700
commitca2fbfb0adeb06991329d7d28854a5166672fe7a (patch)
tree6ddca9caa204541b8f6b35ba700b004672a21954 /WebCore
parentfb386a4cb13329c6a64fd29e134184610c2c3dbc (diff)
downloadexternal_webkit-ca2fbfb0adeb06991329d7d28854a5166672fe7a.zip
external_webkit-ca2fbfb0adeb06991329d7d28854a5166672fe7a.tar.gz
external_webkit-ca2fbfb0adeb06991329d7d28854a5166672fe7a.tar.bz2
Handle another old style meta tag, MobileOptimized. Also if the sites set
the width for the viewport to be less than 320, just use device-width. Fix http://b/issue?id=2098078
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/html/HTMLMetaElement.cpp5
-rw-r--r--WebCore/page/Settings.cpp6
2 files changed, 6 insertions, 5 deletions
diff --git a/WebCore/html/HTMLMetaElement.cpp b/WebCore/html/HTMLMetaElement.cpp
index 83e38fe..f90ad0e 100644
--- a/WebCore/html/HTMLMetaElement.cpp
+++ b/WebCore/html/HTMLMetaElement.cpp
@@ -77,8 +77,9 @@ void HTMLMetaElement::process()
updateViewport = true;
} else if (equalIgnoringCase(name(), "format-detection"))
document()->processMetadataSettings(m_content);
- else if (equalIgnoringCase(name(), "HandheldFriendly")
- && equalIgnoringCase(m_content, "true")
+ else if ((equalIgnoringCase(name(), "HandheldFriendly")
+ && equalIgnoringCase(m_content, "true") ||
+ equalIgnoringCase(name(), "MobileOptimized"))
&& document()->settings()->viewportWidth() == -1) {
// fit mobile sites directly in the screen
document()->settings()->setMetadataSettings("width", "device-width");
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index b36d458..a8d2368 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -424,11 +424,11 @@ void Settings::setMetadataSettings(const String& key, const String& value)
m_viewport_width = 0;
} else {
int width = value.toInt();
- if (width >= 200 && width <= 10000) {
- if (width == 320) {
+ if (width <= 10000) {
+ if (width <= 320) {
// This is a hack to accommodate the pages designed for the
// original iPhone. The new version, since 10/2007, is to
- // use device-width which works for both prtrait and
+ // use device-width which works for both portrait and
// landscape modes.
m_viewport_width = 0;
} else {