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

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp

Issue 2312293003: [CSSTypedOM] Computed StylePropertyMap use ComputedStyle for Lengths (Closed)
Patch Set: rebase Created 4 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: third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp b/third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp
index c01581d0c21c582ff54aa1dafae273d52ee2d622..b7f2782b4ce6859dc8bde8f7048e2fc9f558e819 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp
@@ -74,6 +74,15 @@ CSSCalcLength* CSSCalcLength::fromCSSValue(const CSSPrimitiveValue&) {
return nullptr;
}
+CSSCalcLength* CSSCalcLength::fromLength(const Length& length) {
+ DCHECK(length.isCalculated());
+ PixelsAndPercent values = length.getPixelsAndPercent();
+ CSSCalcLength* result = new CSSCalcLength();
+ result->set(values.pixels, CSSPrimitiveValue::UnitType::Pixels);
+ result->set(values.percent, CSSPrimitiveValue::UnitType::Percentage);
+ return result;
+}
+
bool CSSCalcLength::containsPercent() const {
return has(CSSPrimitiveValue::UnitType::Percentage);
}
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSCalcLength.h ('k') | third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698