Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Unified Diff: Source/core/css/parser/SizesAttributeParser.cpp

Issue 653023002: ASSERTION FAILED: factor > 0 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/parser/SizesAttributeParser.cpp
diff --git a/Source/core/css/parser/SizesAttributeParser.cpp b/Source/core/css/parser/SizesAttributeParser.cpp
index b88940977dfca0f013934795342047594f1cb613..c0b495c290d886b026ccff8dee9e8081fcfde16e 100644
--- a/Source/core/css/parser/SizesAttributeParser.cpp
+++ b/Source/core/css/parser/SizesAttributeParser.cpp
@@ -12,11 +12,12 @@
namespace blink {
-SizesAttributeParser::SizesAttributeParser(PassRefPtr<MediaValues> mediaValues, const String& attribute)
+SizesAttributeParser::SizesAttributeParser(PassRefPtr<MediaValues> mediaValues, const String& attribute, bool hasLocalFrame)
: m_mediaValues(mediaValues)
, m_length(0)
, m_lengthWasSet(false)
, m_viewportDependant(false)
+ , m_hasLocalFrame(hasLocalFrame)
{
CSSTokenizer::tokenize(attribute, m_tokens);
m_isValid = parse(m_tokens);
@@ -39,9 +40,11 @@ bool SizesAttributeParser::calculateLengthInPixels(CSSParserTokenIterator startT
if (!CSSPrimitiveValue::isLength(startToken->unitType()))
return false;
m_viewportDependant = CSSPrimitiveValue::isViewportPercentageLength(startToken->unitType());
- if ((m_mediaValues->computeLength(startToken->numericValue(), startToken->unitType(), length)) && (length >= 0)) {
- result = clampTo<float>(length);
- return true;
+ if (!m_viewportDependant || m_hasLocalFrame) {
+ if ((m_mediaValues->computeLength(startToken->numericValue(), startToken->unitType(), length)) && (length >= 0)) {
+ result = clampTo<float>(length);
+ return true;
+ }
}
} else if (type == FunctionToken) {
SizesCalcParser calcParser(startToken, endToken, m_mediaValues);

Powered by Google App Engine
This is Rietveld 408576698