| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ |
| 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 scanCommon(token, source, requests); | 429 scanCommon(token, source, requests); |
| 430 } | 430 } |
| 431 | 431 |
| 432 void TokenPreloadScanner::scan(const CompactHTMLToken& token, const SegmentedStr
ing& source, PreloadRequestStream& requests) | 432 void TokenPreloadScanner::scan(const CompactHTMLToken& token, const SegmentedStr
ing& source, PreloadRequestStream& requests) |
| 433 { | 433 { |
| 434 scanCommon(token, source, requests); | 434 scanCommon(token, source, requests); |
| 435 } | 435 } |
| 436 | 436 |
| 437 static void handleMetaViewport(const String& attributeValue, CachedDocumentParam
eters* documentParameters) | 437 static void handleMetaViewport(const String& attributeValue, CachedDocumentParam
eters* documentParameters) |
| 438 { | 438 { |
| 439 if (!documentParameters->viewportMetaEnabled) |
| 440 return; |
| 439 ViewportDescription description(ViewportDescription::ViewportMeta); | 441 ViewportDescription description(ViewportDescription::ViewportMeta); |
| 440 HTMLMetaElement::getViewportDescriptionFromContentAttribute(attributeValue,
description, nullptr, documentParameters->viewportMetaZeroValuesQuirk); | 442 HTMLMetaElement::getViewportDescriptionFromContentAttribute(attributeValue,
description, nullptr, documentParameters->viewportMetaZeroValuesQuirk); |
| 441 FloatSize initialViewport(documentParameters->mediaValues->viewportHeight(),
documentParameters->mediaValues->viewportWidth()); | 443 FloatSize initialViewport(documentParameters->mediaValues->viewportHeight(),
documentParameters->mediaValues->viewportWidth()); |
| 442 PageScaleConstraints constraints = description.resolve(initialViewport, docu
mentParameters->defaultViewportMinWidth); | 444 PageScaleConstraints constraints = description.resolve(initialViewport, docu
mentParameters->defaultViewportMinWidth); |
| 443 MediaValuesCached* cachedMediaValues = static_cast<MediaValuesCached*>(docum
entParameters->mediaValues.get()); | 445 MediaValuesCached* cachedMediaValues = static_cast<MediaValuesCached*>(docum
entParameters->mediaValues.get()); |
| 444 cachedMediaValues->setViewportHeight(constraints.layoutSize.height()); | 446 cachedMediaValues->setViewportHeight(constraints.layoutSize.height()); |
| 445 cachedMediaValues->setViewportWidth(constraints.layoutSize.width()); | 447 cachedMediaValues->setViewportWidth(constraints.layoutSize.width()); |
| 446 } | 448 } |
| 447 | 449 |
| 448 template<typename Token> | 450 template<typename Token> |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 { | 596 { |
| 595 ASSERT(isMainThread()); | 597 ASSERT(isMainThread()); |
| 596 ASSERT(document); | 598 ASSERT(document); |
| 597 if (givenMediaValues) | 599 if (givenMediaValues) |
| 598 mediaValues = givenMediaValues; | 600 mediaValues = givenMediaValues; |
| 599 else | 601 else |
| 600 mediaValues = MediaValuesCached::create(*document); | 602 mediaValues = MediaValuesCached::create(*document); |
| 601 ASSERT(mediaValues->isSafeToSendToAnotherThread()); | 603 ASSERT(mediaValues->isSafeToSendToAnotherThread()); |
| 602 defaultViewportMinWidth = document->viewportDefaultMinWidth(); | 604 defaultViewportMinWidth = document->viewportDefaultMinWidth(); |
| 603 viewportMetaZeroValuesQuirk = document->settings() && document->settings()->
viewportMetaZeroValuesQuirk(); | 605 viewportMetaZeroValuesQuirk = document->settings() && document->settings()->
viewportMetaZeroValuesQuirk(); |
| 606 viewportMetaEnabled = document->settings() && document->settings()->viewport
MetaEnabled(); |
| 604 } | 607 } |
| 605 | 608 |
| 606 } | 609 } |
| OLD | NEW |