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

Unified Diff: Source/core/platform/graphics/FontDescription.cpp

Issue 15994009: Match spec for font-weight: bolder|lighter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: presubmit has svn error, maybe re-upload will fix? Created 7 years, 6 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 | « LayoutTests/css3/font-weight-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/FontDescription.cpp
diff --git a/Source/core/platform/graphics/FontDescription.cpp b/Source/core/platform/graphics/FontDescription.cpp
index 89b57b283ae1072d0a8ecd70a43c2ad99659dbef..5b0f32cf25d09da10d78d139dc27e284e73cfdab 100644
--- a/Source/core/platform/graphics/FontDescription.cpp
+++ b/Source/core/platform/graphics/FontDescription.cpp
@@ -45,27 +45,19 @@ COMPILE_ASSERT(sizeof(FontDescription) == sizeof(SameSizeAsFontDescription), Fon
FontWeight FontDescription::lighterWeight(void) const
{
- // FIXME: Should actually return the CSS weight corresponding to next lightest
- // weight of the currently used font family.
switch (m_weight) {
case FontWeight100:
case FontWeight200:
- return FontWeight100;
-
case FontWeight300:
- return FontWeight200;
-
case FontWeight400:
case FontWeight500:
- return FontWeight300;
+ return FontWeight100;
case FontWeight600:
case FontWeight700:
return FontWeight400;
case FontWeight800:
- return FontWeight500;
-
case FontWeight900:
return FontWeight700;
}
@@ -75,13 +67,9 @@ FontWeight FontDescription::lighterWeight(void) const
FontWeight FontDescription::bolderWeight(void) const
{
- // FIXME: Should actually return the CSS weight corresponding to next heaviest
- // weight of the currently used font family.
switch (m_weight) {
case FontWeight100:
case FontWeight200:
- return FontWeight300;
-
case FontWeight300:
return FontWeight400;
@@ -91,8 +79,6 @@ FontWeight FontDescription::bolderWeight(void) const
case FontWeight600:
case FontWeight700:
- return FontWeight800;
-
case FontWeight800:
case FontWeight900:
return FontWeight900;
« no previous file with comments | « LayoutTests/css3/font-weight-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698