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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/SizesAttributeParser.cpp

Issue 2755493004: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ (Closed)
Patch Set: All windows error are Resolved now. Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/parser/SizesAttributeParser.h" 5 #include "core/css/parser/SizesAttributeParser.h"
6 6
7 #include "core/MediaTypeNames.h" 7 #include "core/MediaTypeNames.h"
8 #include "core/css/MediaQueryEvaluator.h" 8 #include "core/css/MediaQueryEvaluator.h"
9 #include "core/css/parser/CSSTokenizer.h" 9 #include "core/css/parser/CSSTokenizer.h"
10 #include "core/css/parser/SizesCalcParser.h" 10 #include "core/css/parser/SizesCalcParser.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 SizesAttributeParser::SizesAttributeParser(MediaValues* mediaValues, 14 SizesAttributeParser::SizesAttributeParser(MediaValues* mediaValues,
15 const String& attribute) 15 const String& attribute)
16 : m_mediaValues(mediaValues), m_length(0), m_lengthWasSet(false) { 16 : m_mediaValues(mediaValues), m_length(0), m_lengthWasSet(false) {
17 ASSERT(m_mediaValues.get()); 17 DCHECK(m_mediaValues.get());
18 m_isValid = parse(CSSTokenizer(attribute).tokenRange()); 18 m_isValid = parse(CSSTokenizer(attribute).tokenRange());
19 } 19 }
20 20
21 float SizesAttributeParser::length() { 21 float SizesAttributeParser::length() {
22 if (m_isValid) 22 if (m_isValid)
23 return effectiveSize(); 23 return effectiveSize();
24 return effectiveSizeDefaultValue(); 24 return effectiveSizeDefaultValue();
25 } 25 }
26 26
27 bool SizesAttributeParser::calculateLengthInPixels(CSSParserTokenRange range, 27 bool SizesAttributeParser::calculateLengthInPixels(CSSParserTokenRange range,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return m_length; 96 return m_length;
97 return effectiveSizeDefaultValue(); 97 return effectiveSizeDefaultValue();
98 } 98 }
99 99
100 float SizesAttributeParser::effectiveSizeDefaultValue() { 100 float SizesAttributeParser::effectiveSizeDefaultValue() {
101 // Returning the equivalent of "100vw" 101 // Returning the equivalent of "100vw"
102 return clampTo<float>(m_mediaValues->viewportWidth()); 102 return clampTo<float>(m_mediaValues->viewportWidth());
103 } 103 }
104 104
105 } // namespace blink 105 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698