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

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, 3 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 878ed5be782d8eafcc60a19b7860cd0610b84958..8fc937d6d4ca9cad128ebbe31a25e4263b652657 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp
@@ -68,6 +68,16 @@ CSSCalcLength* CSSCalcLength::create(const CSSCalcDictionary& dictionary, Except
return result;
}
+CSSCalcLength* CSSCalcLength::fromLength(const Length& length)
meade_UTC10 2016/09/27 04:41:39 [no action required] btw I'm implementing CSSCalcE
+{
+ 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);

Powered by Google App Engine
This is Rietveld 408576698