haikuwebkit/LayoutTests/css3/font-weight-multiple-select...

43 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

Match spec for font-weight: bolder|lighter https://bugs.webkit.org/show_bug.cgi?id=137919 Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-10-22 Reviewed by Andreas Kling. This patch is a merge of Blink's Source/WebCore: 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). and 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'. Tests: css3/font-weight-multiple-selectors.html css3/font-weight.html * css/DeprecatedStyleBuilder.cpp: (WebCore::ApplyPropertyFontWeight::applyValue): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::lighterWeight): (WebCore::FontDescription::bolderWeight): LayoutTests: https://chromiumcodereview.appspot.com/15994009 and https://codereview.chromium.org/137813004 * css3/font-weight-expected.txt: Added. * css3/font-weight-multiple-selectors-expected.txt: Added. * css3/font-weight-multiple-selectors.html: Added. * css3/font-weight.html: Added. Canonical link: https://commits.webkit.org/155818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-22 11:16:39 +00:00
Test that font-weight: bolder and font-weight: lighter are not cumulative when multiple selectors apply.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS getComputedStyle(outer).fontWeight is "100"
PASS getComputedStyle(bolder).fontWeight is "normal"
PASS getComputedStyle(lighter).fontWeight is "100"
PASS getComputedStyle(outer).fontWeight is "200"
PASS getComputedStyle(bolder).fontWeight is "normal"
PASS getComputedStyle(lighter).fontWeight is "100"
PASS getComputedStyle(outer).fontWeight is "300"
PASS getComputedStyle(bolder).fontWeight is "normal"
PASS getComputedStyle(lighter).fontWeight is "100"
PASS getComputedStyle(outer).fontWeight is "normal"
PASS getComputedStyle(bolder).fontWeight is "bold"
PASS getComputedStyle(lighter).fontWeight is "100"
PASS getComputedStyle(outer).fontWeight is "normal"
PASS getComputedStyle(bolder).fontWeight is "bold"
PASS getComputedStyle(lighter).fontWeight is "100"
PASS getComputedStyle(outer).fontWeight is "500"
PASS getComputedStyle(bolder).fontWeight is "bold"
PASS getComputedStyle(lighter).fontWeight is "100"
PASS getComputedStyle(outer).fontWeight is "600"
PASS getComputedStyle(bolder).fontWeight is "900"
PASS getComputedStyle(lighter).fontWeight is "normal"
PASS getComputedStyle(outer).fontWeight is "bold"
PASS getComputedStyle(bolder).fontWeight is "900"
PASS getComputedStyle(lighter).fontWeight is "normal"
PASS getComputedStyle(outer).fontWeight is "bold"
PASS getComputedStyle(bolder).fontWeight is "900"
PASS getComputedStyle(lighter).fontWeight is "normal"
PASS getComputedStyle(outer).fontWeight is "800"
PASS getComputedStyle(bolder).fontWeight is "900"
PASS getComputedStyle(lighter).fontWeight is "bold"
PASS getComputedStyle(outer).fontWeight is "900"
PASS getComputedStyle(bolder).fontWeight is "900"
PASS getComputedStyle(lighter).fontWeight is "bold"
PASS successfullyParsed is true
TEST COMPLETE