diff options
author | Andrei Popescu <andreip@google.com> | 2009-08-20 15:56:06 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2009-08-20 15:56:06 +0100 |
commit | 4960fa153430211f38c1637339fbb7fdee54aa83 (patch) | |
tree | 06303778d5e07b932d1224fa8f449b403117b340 /WebCore/html | |
parent | a47ceaee54843b761108a6c9157c62e8ea5f05f3 (diff) | |
download | external_webkit-4960fa153430211f38c1637339fbb7fdee54aa83.zip external_webkit-4960fa153430211f38c1637339fbb7fdee54aa83.tar.gz external_webkit-4960fa153430211f38c1637339fbb7fdee54aa83.tar.bz2 |
Fix a bunch of layout test crashes
Diffstat (limited to 'WebCore/html')
-rw-r--r-- | WebCore/html/HTMLBodyElement.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp index c8ae037..4667381 100644 --- a/WebCore/html/HTMLBodyElement.cpp +++ b/WebCore/html/HTMLBodyElement.cpp @@ -178,16 +178,18 @@ void HTMLBodyElement::insertedIntoDocument() #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"); - // update the meta data if it is the top document - if (!ownerElement) { - FrameView* view = document()->view(); - if (view) - android::WebViewCore::getWebViewCore(view)->updateViewport(); + if (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"); + // update the meta data if it is the top document + if (!ownerElement) { + FrameView* view = document()->view(); + if (view) + android::WebViewCore::getWebViewCore(view)->updateViewport(); + } } } #endif |