Index: Source/core/html/parser/HTMLSrcsetParser.cpp |
diff --git a/Source/core/html/parser/HTMLSrcsetParser.cpp b/Source/core/html/parser/HTMLSrcsetParser.cpp |
index 8283ecd41536a733ce2d23e426c427da4eeffa4c..e14c4e4953ceb6fb67df34d2a843a0d5d279c798 100644 |
--- a/Source/core/html/parser/HTMLSrcsetParser.cpp |
+++ b/Source/core/html/parser/HTMLSrcsetParser.cpp |
@@ -97,7 +97,11 @@ struct DescriptorToken { |
isValid = false; |
return 0; |
} |
- return charactersToFloat(attribute + start, lengthExcludingDescriptor, &isValid); |
+ Decimal result = parseToDecimalForNumberType(String(attribute + start, lengthExcludingDescriptor)); |
+ isValid = result.isFinite(); |
+ if (!isValid) |
+ return 0; |
+ return clampTo<float>(result.toDouble()); |
tkent
2015/08/25 10:02:46
This looks to have a behavior change for numbers g
Yoav Weiss
2015/08/25 10:07:58
I didn't mean for that to be a behavior change. Is
tkent
2015/08/25 10:14:23
AFAIK, static_cast<float>(greater-than-float-max)
|
} |
}; |