summaryrefslogtreecommitdiffstats
path: root/WebCore/html
diff options
context:
space:
mode:
authorAndrei Popescu <andreip@google.com>2009-08-20 15:56:06 +0100
committerAndrei Popescu <andreip@google.com>2009-08-20 15:56:06 +0100
commit4960fa153430211f38c1637339fbb7fdee54aa83 (patch)
tree06303778d5e07b932d1224fa8f449b403117b340 /WebCore/html
parenta47ceaee54843b761108a6c9157c62e8ea5f05f3 (diff)
downloadexternal_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.cpp22
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