Console: Viewport argument value
334 static const char* viewportErrorMessageTemplate(ViewportErrorCode errorCode) 335 { 336 static const char* const errors[] = { 337 "Viewport argument key \"%replacement1\" not recognized and ignored.", 338 "Viewport argument value \"%replacement1\" for key \"%replacement2\" not recognized. Content ignored.", 339 "Viewport argument value \"%replacement1\" for key \"%replacement2\" was truncated to its numeric prefix.", 340 "Viewport maximum-scale cannot be larger than 10.0. The maximum-scale will be set to 10.0.", 341 "Viewport target-densitydpi has to take a number between 70 and 400 as a valid target dpi, try using \"device-dpi\", \"low-dpi\", \"medium-dpi\" or \"high-dpi\" instead for future compatibility." 342 }; 343 344 return errors[errorCode]; 345 }
37 enum ViewportErrorCode { 38 UnrecognizedViewportArgumentKeyError, 39 UnrecognizedViewportArgumentValueError, 40 TruncatedViewportArgumentValueError, 41 MaximumScaleTooLargeError, 42 TargetDensityDpiTooSmallOrLargeError 43 };
181 static float numericPrefix(const String& keyString, const String& valueString, Document* document, bool* ok) 182 { 183 // If a prefix of property-value can be converted to a number using strtod, 184 // the value will be that number. The remainder of the string is ignored. 185 // So when String::toFloat says there is an error, it may be a false positive, 186 // and we should check if the valueString prefix was a number. 187 188 bool didReadNumber; 189 float value = valueString.toFloat(ok, &didReadNumber); 190 if (!*ok) { 191 if (!didReadNumber) { 192 ASSERT(!value); 193 reportViewportWarning(document, UnrecognizedViewportArgumentValueError, valueString, keyString); <========== 194 return value; 195 } 196 *ok = true; 197 reportViewportWarning(document, TruncatedViewportArgumentValueError, valueString, keyString); 198 } 199 return value; 200 }
>