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

Unified Diff: Source/platform/fonts/FontDescription.h

Issue 468793003: Make style building for 'font-size' less custom. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix regression related to FontDescriptions with isAbsolute=true. Created 6 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
« no previous file with comments | « Source/core/editing/EditingStyle.cpp ('k') | Source/platform/fonts/FontDescription.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontDescription.h
diff --git a/Source/platform/fonts/FontDescription.h b/Source/platform/fonts/FontDescription.h
index 02cd9a13e6db65b402433d3d7b208745d29f318c..a453fe245580a4d1edbd1264429b4fdc1e09a726 100644
--- a/Source/platform/fonts/FontDescription.h
+++ b/Source/platform/fonts/FontDescription.h
@@ -103,8 +103,21 @@ public:
unsigned contextual : 2;
};
+ struct Size {
+ Size(unsigned keyword, float value, bool isAbsolute)
+ : keyword(keyword)
+ , isAbsolute(isAbsolute)
+ , value(value)
+ {
+ }
+ unsigned keyword : 4; // FontDescription::keywordSize
+ unsigned isAbsolute : 1; // FontDescription::isAbsoluteSize
+ float value;
+ };
+
const FontFamily& family() const { return m_familyList; }
FontFamily& firstFamily() { return m_familyList; }
+ Size size() const { return Size(m_keywordSize, m_specifiedSize, m_isAbsoluteSize); }
float specifiedSize() const { return m_specifiedSize; }
float computedSize() const { return m_computedSize; }
FontStyle style() const { return static_cast<FontStyle>(m_style); }
@@ -115,6 +128,8 @@ public:
FontStretch stretch() const { return static_cast<FontStretch>(m_stretch); }
static FontWeight lighterWeight(FontWeight);
static FontWeight bolderWeight(FontWeight);
+ static Size largerSize(const Size&);
+ static Size smallerSize(const Size&);
GenericFamilyType genericFamily() const { return static_cast<GenericFamilyType>(m_genericFamily); }
// only use fixed default size when there is only one font family, and that family is "monospace"
« no previous file with comments | « Source/core/editing/EditingStyle.cpp ('k') | Source/platform/fonts/FontDescription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698