Bug 137919

Summary: Match spec for font-weight: bolder|lighter
Product: WebKit Reporter: Tibor Mészáros <mtiborinf>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, ossy, rniwa, syoichi
Priority: P2 Keywords: BlinkMergeCandidate
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
kling: review+, kling: commit-queue-
patch for landing none

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
https://chromiumcodereview.appspot.com/15994009

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
https://codereview.chromium.org/137813004

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]
Patch

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]
Patch

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.