diff options
| author | Shimeng (Simon) Wang <swang@google.com> | 2011-07-01 14:41:13 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-01 14:41:13 -0700 |
| commit | b18e666e226b16a009467f4c330cf66aa46f55d4 (patch) | |
| tree | 9becd02fbfc2fc0c856839f40f0ee9ecafa0aa56 /Source/WebCore/html | |
| parent | 7397f7999e73d1595f05a8477b786a61cc0ed028 (diff) | |
| parent | 8db9f9e9e78973e25adf06722ce8f9126e92c60b (diff) | |
| download | external_webkit-b18e666e226b16a009467f4c330cf66aa46f55d4.zip external_webkit-b18e666e226b16a009467f4c330cf66aa46f55d4.tar.gz external_webkit-b18e666e226b16a009467f4c330cf66aa46f55d4.tar.bz2 | |
Merge "Update viewport using webkit's way."
Diffstat (limited to 'Source/WebCore/html')
| -rw-r--r-- | Source/WebCore/html/HTMLBodyElement.cpp | 8 | ||||
| -rw-r--r-- | Source/WebCore/html/HTMLMetaElement.cpp | 22 |
2 files changed, 6 insertions, 24 deletions
diff --git a/Source/WebCore/html/HTMLBodyElement.cpp b/Source/WebCore/html/HTMLBodyElement.cpp index 9cf8730..0c93c95 100644 --- a/Source/WebCore/html/HTMLBodyElement.cpp +++ b/Source/WebCore/html/HTMLBodyElement.cpp @@ -206,13 +206,7 @@ void HTMLBodyElement::insertedIntoDocument() if (settings->viewportWidth() == -1 && (host.startsWith("m.") || host.startsWith("mobile.") || host.startsWith("wap.") || host.contains(".m.") || host.contains(".mobile." || host.contains(".wap.")))) { // fit mobile sites directly in the screen - settings->setMetadataSettings("width", "device-width"); - // update the meta data if it is the top document - if (!ownerElement) { - FrameView* view = document()->view(); - if (view) - PlatformBridge::updateViewport(view); - } + document()->processViewport("width=device-width"); } } #endif diff --git a/Source/WebCore/html/HTMLMetaElement.cpp b/Source/WebCore/html/HTMLMetaElement.cpp index d8d9fb3..493d4ac 100644 --- a/Source/WebCore/html/HTMLMetaElement.cpp +++ b/Source/WebCore/html/HTMLMetaElement.cpp @@ -75,30 +75,18 @@ void HTMLMetaElement::process() { if (!inDocument() || m_content.isNull()) return; + if (equalIgnoringCase(name(), "viewport")) + document()->processViewport(m_content); #ifdef ANDROID_META_SUPPORT // TODO: Evaluate whether to take upstreamed meta support - bool updateViewport = false; - if (equalIgnoringCase(name(), "viewport")) { - document()->processMetadataSettings(m_content); - updateViewport = true; - } else if (equalIgnoringCase(name(), "format-detection")) - document()->processMetadataSettings(m_content); + else if (equalIgnoringCase(name(), "format-detection")) + document()->processViewport(m_content); else if (((equalIgnoringCase(name(), "HandheldFriendly") && equalIgnoringCase(m_content, "true")) || equalIgnoringCase(name(), "MobileOptimized")) && document()->settings() && document()->settings()->viewportWidth() == -1) { // fit mobile sites directly in the screen - document()->settings()->setMetadataSettings("width", "device-width"); - updateViewport = true; + document()->processViewport("width=device-width"); } - // update the meta data if it is the top document - if (updateViewport && !document()->ownerElement()) { - FrameView* view = document()->view(); - if (view) - PlatformBridge::updateViewport(view); - } -#else - if (equalIgnoringCase(name(), "viewport")) - document()->processViewport(m_content); #endif #if ENABLE(ANDROID_INSTALLABLE_WEB_APPS) |
