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. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 */ | 21 */ |
22 | 22 |
23 #include "config.h" | 23 #include "config.h" |
24 #include "core/html/HTMLMetaElement.h" | 24 #include "core/html/HTMLMetaElement.h" |
25 | 25 |
26 #include "core/HTMLNames.h" | 26 #include "core/HTMLNames.h" |
27 #include "core/dom/Document.h" | 27 #include "core/dom/Document.h" |
28 #include "core/frame/LocalFrame.h" | 28 #include "core/frame/LocalFrame.h" |
29 #include "core/frame/Settings.h" | 29 #include "core/frame/Settings.h" |
| 30 #include "core/inspector/ConsoleMessage.h" |
30 #include "core/loader/FrameLoaderClient.h" | 31 #include "core/loader/FrameLoaderClient.h" |
31 #include "platform/RuntimeEnabledFeatures.h" | 32 #include "platform/RuntimeEnabledFeatures.h" |
32 | 33 |
33 namespace blink { | 34 namespace blink { |
34 | 35 |
35 #define DEFINE_ARRAY_FOR_MATCHING(name, source, maxMatchLength) \ | 36 #define DEFINE_ARRAY_FOR_MATCHING(name, source, maxMatchLength) \ |
36 const UChar* name; \ | 37 const UChar* name; \ |
37 const unsigned uMaxMatchLength = maxMatchLength; \ | 38 const unsigned uMaxMatchLength = maxMatchLength; \ |
38 UChar characterBuffer[uMaxMatchLength]; \ | 39 UChar characterBuffer[uMaxMatchLength]; \ |
39 if (!source.is8Bit()) { \ | 40 if (!source.is8Bit()) { \ |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 valueEnd = i; | 122 valueEnd = i; |
122 | 123 |
123 ASSERT_WITH_SECURITY_IMPLICATION(i <= length); | 124 ASSERT_WITH_SECURITY_IMPLICATION(i <= length); |
124 | 125 |
125 String keyString = buffer.substring(keyBegin, keyEnd - keyBegin); | 126 String keyString = buffer.substring(keyBegin, keyEnd - keyBegin); |
126 String valueString = buffer.substring(valueBegin, valueEnd - valueBegin)
; | 127 String valueString = buffer.substring(valueBegin, valueEnd - valueBegin)
; |
127 (this->*callback)(keyString, valueString, data); | 128 (this->*callback)(keyString, valueString, data); |
128 } | 129 } |
129 if (error) { | 130 if (error) { |
130 String message = "Error parsing a meta element's content: ';' is not a v
alid key-value pair separator. Please use ',' instead."; | 131 String message = "Error parsing a meta element's content: ';' is not a v
alid key-value pair separator. Please use ',' instead."; |
131 document().addConsoleMessage(RenderingMessageSource, WarningMessageLevel
, message); | 132 document().addConsoleMessage(ConsoleMessage::create(RenderingMessageSour
ce, WarningMessageLevel, message)); |
132 } | 133 } |
133 } | 134 } |
134 | 135 |
135 static inline float clampLengthValue(float value) | 136 static inline float clampLengthValue(float value) |
136 { | 137 { |
137 // Limits as defined in the css-device-adapt spec. | 138 // Limits as defined in the css-device-adapt spec. |
138 if (value != ViewportDescription::ValueAuto) | 139 if (value != ViewportDescription::ValueAuto) |
139 return std::min(float(10000), std::max(value, float(1))); | 140 return std::min(float(10000), std::max(value, float(1))); |
140 return value; | 141 return value; |
141 } | 142 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 if (!document().frame()) | 386 if (!document().frame()) |
386 return; | 387 return; |
387 | 388 |
388 String message = viewportErrorMessageTemplate(errorCode); | 389 String message = viewportErrorMessageTemplate(errorCode); |
389 if (!replacement1.isNull()) | 390 if (!replacement1.isNull()) |
390 message.replace("%replacement1", replacement1); | 391 message.replace("%replacement1", replacement1); |
391 if (!replacement2.isNull()) | 392 if (!replacement2.isNull()) |
392 message.replace("%replacement2", replacement2); | 393 message.replace("%replacement2", replacement2); |
393 | 394 |
394 // FIXME: This message should be moved off the console once a solution to ht
tps://bugs.webkit.org/show_bug.cgi?id=103274 exists. | 395 // FIXME: This message should be moved off the console once a solution to ht
tps://bugs.webkit.org/show_bug.cgi?id=103274 exists. |
395 document().addConsoleMessage(RenderingMessageSource, viewportErrorMessageLev
el(errorCode), message); | 396 document().addConsoleMessage(ConsoleMessage::create(RenderingMessageSource,
viewportErrorMessageLevel(errorCode), message)); |
396 } | 397 } |
397 | 398 |
398 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie
wportDescription::Type origin) | 399 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie
wportDescription::Type origin) |
399 { | 400 { |
400 ASSERT(!content.isNull()); | 401 ASSERT(!content.isNull()); |
401 | 402 |
402 if (!document().shouldOverrideLegacyDescription(origin)) | 403 if (!document().shouldOverrideLegacyDescription(origin)) |
403 return; | 404 return; |
404 | 405 |
405 ViewportDescription descriptionFromLegacyTag(origin); | 406 ViewportDescription descriptionFromLegacyTag(origin); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 { | 497 { |
497 return getAttribute(http_equivAttr); | 498 return getAttribute(http_equivAttr); |
498 } | 499 } |
499 | 500 |
500 const AtomicString& HTMLMetaElement::name() const | 501 const AtomicString& HTMLMetaElement::name() const |
501 { | 502 { |
502 return getNameAttribute(); | 503 return getNameAttribute(); |
503 } | 504 } |
504 | 505 |
505 } | 506 } |
OLD | NEW |