| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 message.replace("%replacement2", replacement2); | 381 message.replace("%replacement2", replacement2); |
| 382 | 382 |
| 383 // FIXME: This message should be moved off the console once a solution to ht
tps://bugs.webkit.org/show_bug.cgi?id=103274 exists. | 383 // FIXME: This message should be moved off the console once a solution to ht
tps://bugs.webkit.org/show_bug.cgi?id=103274 exists. |
| 384 document().addConsoleMessage(RenderingMessageSource, viewportErrorMessageLev
el(errorCode), message); | 384 document().addConsoleMessage(RenderingMessageSource, viewportErrorMessageLev
el(errorCode), message); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie
wportDescription::Type origin) | 387 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie
wportDescription::Type origin) |
| 388 { | 388 { |
| 389 ASSERT(!content.isNull()); | 389 ASSERT(!content.isNull()); |
| 390 | 390 |
| 391 if (!document().settings()) | |
| 392 return; | |
| 393 | |
| 394 if (!document().shouldOverrideLegacyDescription(origin)) | 391 if (!document().shouldOverrideLegacyDescription(origin)) |
| 395 return; | 392 return; |
| 396 | 393 |
| 397 ViewportDescription descriptionFromLegacyTag(origin); | 394 ViewportDescription descriptionFromLegacyTag(origin); |
| 398 if (document().shouldMergeWithLegacyDescription(origin)) | 395 if (document().shouldMergeWithLegacyDescription(origin)) |
| 399 descriptionFromLegacyTag = document().viewportDescription(); | 396 descriptionFromLegacyTag = document().viewportDescription(); |
| 400 | 397 |
| 401 parseContentAttribute(content, &HTMLMetaElement::processViewportKeyValuePair
, (void*)&descriptionFromLegacyTag); | 398 parseContentAttribute(content, &HTMLMetaElement::processViewportKeyValuePair
, (void*)&descriptionFromLegacyTag); |
| 402 | 399 |
| 403 if (descriptionFromLegacyTag.minZoom == ViewportDescription::ValueAuto) | 400 if (descriptionFromLegacyTag.minZoom == ViewportDescription::ValueAuto) |
| 404 descriptionFromLegacyTag.minZoom = 0.25; | 401 descriptionFromLegacyTag.minZoom = 0.25; |
| 405 | 402 |
| 406 if (descriptionFromLegacyTag.maxZoom == ViewportDescription::ValueAuto) { | 403 if (descriptionFromLegacyTag.maxZoom == ViewportDescription::ValueAuto) { |
| 407 descriptionFromLegacyTag.maxZoom = 5; | 404 descriptionFromLegacyTag.maxZoom = 5; |
| 408 descriptionFromLegacyTag.minZoom = std::min(descriptionFromLegacyTag.min
Zoom, float(5)); | 405 descriptionFromLegacyTag.minZoom = std::min(descriptionFromLegacyTag.min
Zoom, float(5)); |
| 409 } | 406 } |
| 410 | 407 |
| 411 const Settings* settings = document().settings(); | |
| 412 | |
| 413 if (descriptionFromLegacyTag.maxWidth.isAuto()) { | |
| 414 if (descriptionFromLegacyTag.zoom == ViewportDescription::ValueAuto) { | |
| 415 descriptionFromLegacyTag.minWidth = Length(ExtendToZoom); | |
| 416 descriptionFromLegacyTag.maxWidth = Length(settings->layoutFallbackW
idth(), Fixed); | |
| 417 } else if (descriptionFromLegacyTag.maxHeight.isAuto()) { | |
| 418 descriptionFromLegacyTag.minWidth = Length(ExtendToZoom); | |
| 419 descriptionFromLegacyTag.maxWidth = Length(ExtendToZoom); | |
| 420 } | |
| 421 } | |
| 422 | |
| 423 document().setViewportDescription(descriptionFromLegacyTag); | 408 document().setViewportDescription(descriptionFromLegacyTag); |
| 424 } | 409 } |
| 425 | 410 |
| 426 | 411 |
| 427 void HTMLMetaElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) | 412 void HTMLMetaElement::parseAttribute(const QualifiedName& name, const AtomicStri
ng& value) |
| 428 { | 413 { |
| 429 if (name == http_equivAttr || name == contentAttr) { | 414 if (name == http_equivAttr || name == contentAttr) { |
| 430 process(); | 415 process(); |
| 431 return; | 416 return; |
| 432 } | 417 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 { | 480 { |
| 496 return getAttribute(http_equivAttr); | 481 return getAttribute(http_equivAttr); |
| 497 } | 482 } |
| 498 | 483 |
| 499 const AtomicString& HTMLMetaElement::name() const | 484 const AtomicString& HTMLMetaElement::name() const |
| 500 { | 485 { |
| 501 return getNameAttribute(); | 486 return getNameAttribute(); |
| 502 } | 487 } |
| 503 | 488 |
| 504 } | 489 } |
| OLD | NEW |