Bug 137919 - Match spec for font-weight: bolder|lighter
Summary: Match spec for font-weight: bolder|lighter
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: BlinkMergeCandidate
Depends on:
Reported: 2014-10-21 06:21 PDT by Tibor Mészáros
Modified: 2014-10-22 04:16 PDT (History)
5 users (show)

See Also:

Patch (12.98 KB, patch)
2014-10-21 06:50 PDT, Tibor Mészáros
kling: review+
kling: commit-queue-
Details | Formatted Diff | Diff
patch for landing (12.96 KB, patch)
2014-10-22 03:31 PDT, Tibor Mészáros
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tibor Mészáros 2014-10-21 06:21:06 PDT
Consider merging https://chromiumcodereview.appspot.com/15994009 and https://codereview.chromium.org/137813004 from blink to make font-weight: bolder/lighter work correctly.

Match spec for font-weight: bolder|lighter

Currently, bolder and lighter change font-weight in a non-compliant way.
The spec (http://www.w3.org/TR/css3-fonts/#bolderlighter) defines
exactly what the computed values should be given the inherited weight values,
so we should match those.

The removed FIXME's for selecting the next lightest/heaviest weight from
the used font family seems to refer to behaviour from
CSS1 (http://www.w3.org/TR/CSS1/#font-weight), while this is replaced
with a simpler procedure for resolving bolder and lighter in font weights
in CSS2 (http://www.w3.org/TR/CSS2/fonts.html#propdef-font-weight) and CSS3 (link above).

Multiple selectors setting relative font-weight names to an element result in a cumulative result

According to http://dev.w3.org/csswg/css-fonts/#font-weight-prop, the computed
weight of 'lighter' and 'bolder' are based on the inherited 'font-weight', so set
that inherited weight before calculating 'lighter' and 'bolder'.
Comment 1 Tibor Mészáros 2014-10-21 06:50:28 PDT
Created attachment 240199 [details]

This patch will merge https://chromiumcodereview.appspot.com/15994009 and https://codereview.chromium.org/137813004 from blink.
Comment 2 Andreas Kling 2014-10-21 14:00:17 PDT
Comment on attachment 240199 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=240199&action=review

Looks nice. r=me

> Source/WebCore/ChangeLog:29
> +               css3/font-wight.html

font-wight -> font-weight
Comment 3 Tibor Mészáros 2014-10-22 03:31:16 PDT
Created attachment 240260 [details]
patch for landing

patch for landing
Comment 4 WebKit Commit Bot 2014-10-22 04:16:38 PDT
Comment on attachment 240260 [details]
patch for landing

Clearing flags on attachment: 240260

Committed r175043: <http://trac.webkit.org/changeset/175043>
Comment 5 WebKit Commit Bot 2014-10-22 04:16:42 PDT
All reviewed patches have been landed.  Closing bug.