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

Unified Diff: Source/core/css/CSSToLengthConversionData.cpp

Issue 227043007: CSS Length calculation with MediaValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sizes_parser3
Patch Set: Fix debug compile issue Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSToLengthConversionData.h ('k') | Source/core/css/MediaQueryEvaluator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSToLengthConversionData.cpp
diff --git a/Source/core/css/CSSToLengthConversionData.cpp b/Source/core/css/CSSToLengthConversionData.cpp
index 66583963904254f4ca9df0d03dd9e102bba52212..92c8d750d17336a24140144a60c1f4f25d1ff836 100644
--- a/Source/core/css/CSSToLengthConversionData.cpp
+++ b/Source/core/css/CSSToLengthConversionData.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "core/css/CSSToLengthConversionData.h"
+#include "core/css/MediaValues.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/style/RenderStyle.h"
@@ -46,6 +47,7 @@ CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle* style, c
, m_computingFontSize(computingFontSize)
{
ASSERT(zoom > 0);
+ ASSERT(style && rootStyle);
}
CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, bool computingFontSize)
@@ -56,6 +58,7 @@ CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle* style, c
, m_useEffectiveZoom(true)
, m_computingFontSize(computingFontSize)
{
+ ASSERT(style && rootStyle);
}
CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, float viewportWidth, float viewportHeight, float zoom, bool computingFontSize)
@@ -68,6 +71,7 @@ CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle* style, c
, m_computingFontSize(computingFontSize)
{
ASSERT(zoom > 0);
+ ASSERT(style && rootStyle);
}
float CSSToLengthConversionData::zoom() const
@@ -98,4 +102,44 @@ double CSSToLengthConversionData::viewportMaxPercent() const
return std::max(m_viewportWidth, m_viewportHeight) / 100;
}
+bool CSSToLengthConversionData::computingFontSize() const
+{
+ return m_computingFontSize;
+}
+
+double CSSToLengthConversionData::fontSpecifiedSize() const
+{
+ return m_style->fontDescription().specifiedSize();
+}
+
+double CSSToLengthConversionData::fontComputedSize() const
+{
+ return m_style->fontDescription().computedSize();
+}
+
+double CSSToLengthConversionData::rootFontSpecifiedSize() const
+{
+ return m_rootStyle->fontDescription().specifiedSize();
+}
+
+double CSSToLengthConversionData::rootFontComputedSize() const
+{
+ return m_rootStyle->fontDescription().computedSize();
+}
+
+bool CSSToLengthConversionData::hasXHeight() const
+{
+ return m_style->fontMetrics().hasXHeight();
+}
+
+double CSSToLengthConversionData::xHeight() const
+{
+ return m_style->fontMetrics().xHeight();
+}
+
+double CSSToLengthConversionData::zeroWidth() const
+{
+ return m_style->fontMetrics().zeroWidth();
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/css/CSSToLengthConversionData.h ('k') | Source/core/css/MediaQueryEvaluator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698