| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 // skip to first separator | 118 // skip to first separator |
| 119 while (!isSeparator(buffer[i])) { | 119 while (!isSeparator(buffer[i])) { |
| 120 error |= isInvalidSeparator(buffer[i]); | 120 error |= isInvalidSeparator(buffer[i]); |
| 121 if (i >= length) | 121 if (i >= length) |
| 122 break; | 122 break; |
| 123 i++; | 123 i++; |
| 124 } | 124 } |
| 125 valueEnd = i; | 125 valueEnd = i; |
| 126 | 126 |
| 127 ASSERT_WITH_SECURITY_IMPLICATION(i <= length); | 127 SECURITY_DCHECK(i <= length); |
| 128 | 128 |
| 129 String keyString = buffer.substring(keyBegin, keyEnd - keyBegin); | 129 String keyString = buffer.substring(keyBegin, keyEnd - keyBegin); |
| 130 String valueString = buffer.substring(valueBegin, valueEnd - valueBegin)
; | 130 String valueString = buffer.substring(valueBegin, valueEnd - valueBegin)
; |
| 131 processViewportKeyValuePair(document, keyString, valueString, viewportMe
taZeroValuesQuirk, data); | 131 processViewportKeyValuePair(document, keyString, valueString, viewportMe
taZeroValuesQuirk, data); |
| 132 } | 132 } |
| 133 if (error && document) { | 133 if (error && document) { |
| 134 String message = "Error parsing a meta element's content: ';' is not a v
alid key-value pair separator. Please use ',' instead."; | 134 String message = "Error parsing a meta element's content: ';' is not a v
alid key-value pair separator. Please use ',' instead."; |
| 135 document->addConsoleMessage(ConsoleMessage::create(RenderingMessageSourc
e, WarningMessageLevel, message)); | 135 document->addConsoleMessage(ConsoleMessage::create(RenderingMessageSourc
e, WarningMessageLevel, message)); |
| 136 } | 136 } |
| 137 } | 137 } |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 { | 377 { |
| 378 switch (errorCode) { | 378 switch (errorCode) { |
| 379 case TruncatedViewportArgumentValueError: | 379 case TruncatedViewportArgumentValueError: |
| 380 case TargetDensityDpiUnsupported: | 380 case TargetDensityDpiUnsupported: |
| 381 case UnrecognizedViewportArgumentKeyError: | 381 case UnrecognizedViewportArgumentKeyError: |
| 382 case UnrecognizedViewportArgumentValueError: | 382 case UnrecognizedViewportArgumentValueError: |
| 383 case MaximumScaleTooLargeError: | 383 case MaximumScaleTooLargeError: |
| 384 return WarningMessageLevel; | 384 return WarningMessageLevel; |
| 385 } | 385 } |
| 386 | 386 |
| 387 ASSERT_NOT_REACHED(); | 387 NOTREACHED(); |
| 388 return ErrorMessageLevel; | 388 return ErrorMessageLevel; |
| 389 } | 389 } |
| 390 | 390 |
| 391 void HTMLMetaElement::reportViewportWarning(Document* document, ViewportErrorCod
e errorCode, const String& replacement1, const String& replacement2) | 391 void HTMLMetaElement::reportViewportWarning(Document* document, ViewportErrorCod
e errorCode, const String& replacement1, const String& replacement2) |
| 392 { | 392 { |
| 393 if (!document || !document->frame()) | 393 if (!document || !document->frame()) |
| 394 return; | 394 return; |
| 395 | 395 |
| 396 String message = viewportErrorMessageTemplate(errorCode); | 396 String message = viewportErrorMessageTemplate(errorCode); |
| 397 if (!replacement1.isNull()) | 397 if (!replacement1.isNull()) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 410 if (description.minZoom == ViewportDescription::ValueAuto) | 410 if (description.minZoom == ViewportDescription::ValueAuto) |
| 411 description.minZoom = 0.25; | 411 description.minZoom = 0.25; |
| 412 | 412 |
| 413 if (description.maxZoom == ViewportDescription::ValueAuto) { | 413 if (description.maxZoom == ViewportDescription::ValueAuto) { |
| 414 description.maxZoom = 5; | 414 description.maxZoom = 5; |
| 415 description.minZoom = std::min(description.minZoom, float(5)); | 415 description.minZoom = std::min(description.minZoom, float(5)); |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie
wportDescription::Type origin) | 418 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie
wportDescription::Type origin) |
| 419 { | 419 { |
| 420 ASSERT(!content.isNull()); | 420 DCHECK(!content.isNull()); |
| 421 | 421 |
| 422 if (!document().shouldOverrideLegacyDescription(origin)) | 422 if (!document().shouldOverrideLegacyDescription(origin)) |
| 423 return; | 423 return; |
| 424 | 424 |
| 425 ViewportDescription descriptionFromLegacyTag(origin); | 425 ViewportDescription descriptionFromLegacyTag(origin); |
| 426 if (document().shouldMergeWithLegacyDescription(origin)) | 426 if (document().shouldMergeWithLegacyDescription(origin)) |
| 427 descriptionFromLegacyTag = document().viewportDescription(); | 427 descriptionFromLegacyTag = document().viewportDescription(); |
| 428 | 428 |
| 429 getViewportDescriptionFromContentAttribute(content, descriptionFromLegacyTag
, &document(), document().settings() && document().settings()->viewportMetaZeroV
aluesQuirk()); | 429 getViewportDescriptionFromContentAttribute(content, descriptionFromLegacyTag
, &document(), document().settings() && document().settings()->viewportMetaZeroV
aluesQuirk()); |
| 430 | 430 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 { | 514 { |
| 515 return getAttribute(http_equivAttr); | 515 return getAttribute(http_equivAttr); |
| 516 } | 516 } |
| 517 | 517 |
| 518 const AtomicString& HTMLMetaElement::name() const | 518 const AtomicString& HTMLMetaElement::name() const |
| 519 { | 519 { |
| 520 return getNameAttribute(); | 520 return getNameAttribute(); |
| 521 } | 521 } |
| 522 | 522 |
| 523 } | 523 } |
| OLD | NEW |