Changeset 240251 in webkit
- Timestamp:
- Jan 22, 2019 1:52:48 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r240249 r240251 1 2019-01-22 Oriol Brufau <obrufau@igalia.com> 2 3 [css-logical] Implement flow-relative margin, padding and border shorthands 4 https://bugs.webkit.org/show_bug.cgi?id=188697 5 6 Reviewed by Simon Fraser and Antti Koivisto. 7 8 Add tests checking that CSS properties disabled behind runtime flags 9 are not exposed. 10 11 * webexposed/css-properties-behind-flags-expected.txt: Added. 12 * webexposed/css-properties-behind-flags.html: Added. 13 1 14 2019-01-21 Antti Koivisto <antti@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/ChangeLog
r240158 r240251 1 2019-01-22 Oriol Brufau <obrufau@igalia.com> 2 3 [css-logical] Implement flow-relative margin, padding and border shorthands 4 https://bugs.webkit.org/show_bug.cgi?id=188697 5 6 Reviewed by Simon Fraser and Antti Koivisto. 7 8 Import tests from the WPT test suite for CSS Logical Properties and Values, 9 and enable the CSSLogicalEnabled runtime flag for them. 10 11 They still have some failures because sideways writing modes have not been 12 implemented yet (https://bugs.webkit.org/show_bug.cgi?id=166941). 13 14 * web-platform-tests/css/css-logical/logical-box-border-color-expected.txt: 15 * web-platform-tests/css/css-logical/logical-box-border-color.html: 16 * web-platform-tests/css/css-logical/logical-box-border-shorthands-expected.txt: 17 * web-platform-tests/css/css-logical/logical-box-border-shorthands.html: 18 * web-platform-tests/css/css-logical/logical-box-border-style-expected.txt: 19 * web-platform-tests/css/css-logical/logical-box-border-style.html: 20 * web-platform-tests/css/css-logical/logical-box-border-width-expected.txt: 21 * web-platform-tests/css/css-logical/logical-box-border-width.html: 22 * web-platform-tests/css/css-logical/logical-box-inset-expected.txt: 23 * web-platform-tests/css/css-logical/logical-box-inset.html: 24 * web-platform-tests/css/css-logical/logical-box-margin-expected.txt: 25 * web-platform-tests/css/css-logical/logical-box-margin.html: 26 * web-platform-tests/css/css-logical/logical-box-padding-expected.txt: 27 * web-platform-tests/css/css-logical/logical-box-padding.html: 28 * web-platform-tests/css/css-logical/logical-box-size.html: 29 * web-platform-tests/css/css-logical/resources/test-box-properties.js: 30 (export.createBoxPropertyGroup): 31 (export.createSizingPropertyGroup): 32 (export.runTests.set test): 33 (export.runTests): 34 * web-platform-tests/css/css-logical/resources/test-shared.js: Added. 35 (export.testCSSValues): 36 (export.testComputedValues): 37 (export.makeDeclaration): 38 * web-platform-tests/css/css-logical/resources/w3c-import.log: 39 1 40 2019-01-18 Ali Juma <ajuma@chromium.org> 2 41 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color-expected.txt
r238262 r240251 1 1 2 2 PASS Test that logical border-*-color properties are supported. 3 PASS Test that border-inline-color shorthand sets longhands and serializes correctly. 4 PASS Test that border-block-color shorthand sets longhands and serializes correctly. 5 PASS Test that border-color shorthand sets longhands and serializes correctly. 3 6 PASS Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: ltr; '. 4 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: ltr; ', border-inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 7 PASS Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. 5 8 PASS Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 6 9 PASS Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 7 10 PASS Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: rtl; '. 8 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: rtl; ', border-inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 11 PASS Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. 9 12 PASS Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 10 13 PASS Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 11 14 PASS Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: rtl; '. 12 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: rtl; ', border-inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 15 PASS Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. 13 16 PASS Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 14 17 PASS Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 15 18 FAIL Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border-bottom-color expected "rgb(1, 1, 1)" but got "rgb(4, 4, 4)" 16 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border- inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)"19 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border-bottom-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 17 20 FAIL Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'border-inline-start-color' last on single declaration, 'writing-mode: sideways-rl; direction: rtl; ', border-block-end-color expected "rgb(1, 1, 1)" but got "rgb(4, 4, 4)" 18 21 FAIL Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'border-inline-start-color', two declarations, 'writing-mode: sideways-rl; direction: rtl; ', border-block-end-color expected "rgb(1, 1, 1)" but got "rgb(4, 4, 4)" 19 22 PASS Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: ltr; '. 20 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: ltr; ', border-inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 23 PASS Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. 21 24 PASS Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 22 25 PASS Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 23 26 FAIL Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border-top-color expected "rgb(1, 1, 1)" but got "rgb(3, 3, 3)" 24 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border- inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)"27 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border-top-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 25 28 FAIL Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'border-inline-start-color' last on single declaration, 'writing-mode: sideways-rl; direction: ltr; ', border-left-color expected "rgb(1, 1, 1)" but got "rgb(5, 5, 5)" 26 29 FAIL Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'border-inline-start-color', two declarations, 'writing-mode: sideways-rl; direction: ltr; ', border-left-color expected "rgb(1, 1, 1)" but got "rgb(5, 5, 5)" 27 30 PASS Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: rtl; '. 28 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: rtl; ', border-inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 31 PASS Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. 29 32 PASS Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 30 33 PASS Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 31 34 FAIL Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border-bottom-color expected "rgb(1, 1, 1)" but got "rgb(4, 4, 4)" 32 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border- inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)"35 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border-bottom-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 33 36 FAIL Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'border-inline-start-color' last on single declaration, 'writing-mode: sideways-lr; direction: ltr; ', border-left-color expected "rgb(1, 1, 1)" but got "rgb(5, 5, 5)" 34 37 FAIL Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'border-inline-start-color', two declarations, 'writing-mode: sideways-lr; direction: ltr; ', border-left-color expected "rgb(1, 1, 1)" but got "rgb(5, 5, 5)" 35 38 PASS Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: ltr; '. 36 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: ltr; ', border-inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 39 PASS Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. 37 40 PASS Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 38 41 PASS Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 39 42 FAIL Test that logical border-*-color properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border-top-color expected "rgb(1, 1, 1)" but got "rgb(3, 3, 3)" 40 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border- inline-start-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)"43 FAIL Test that border-*-color shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border-top-color expected "rgb(1, 1, 1)" but got "rgb(0, 0, 0)" 41 44 FAIL Test that border-*-color properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'border-inline-start-color' last on single declaration, 'writing-mode: sideways-lr; direction: rtl; ', border-block-start-color expected "rgb(1, 1, 1)" but got "rgb(3, 3, 3)" 42 45 FAIL Test that border-*-color properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'border-inline-start-color', two declarations, 'writing-mode: sideways-lr; direction: rtl; ', border-block-start-color expected "rgb(1, 1, 1)" but got "rgb(3, 3, 3)" -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
r238262 r240251 1 <!DOCTYPE html> 1 <!DOCTYPE html> <!-- webkit-test-runner [ internal:CSSLogicalEnabled=true ] --> 2 2 <meta charset="utf-8" /> 3 3 <title>CSS Logical Properties: Flow-Relative Border Colors</title> … … 10 10 <div id="log"></div> 11 11 12 <script src="./resources/test-box-properties.js"></script>13 <script> 12 <script type="module"> 13 import {runTests, createBoxPropertyGroup} from "./resources/test-box-properties.js"; 14 14 runTests(createBoxPropertyGroup("border-*-color", {type: "color"})); 15 15 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands-expected.txt
r238262 r240251 1 1 2 2 PASS Test that logical border-* properties are supported. 3 PASS Test that border-inline shorthand sets longhands and serializes correctly. 4 PASS Test that border-block shorthand sets longhands and serializes correctly. 5 PASS Test that border shorthand sets longhands and serializes correctly. 3 6 PASS Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: ltr; '. 4 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: ltr; ', border-inline-start expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 7 PASS Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. 5 8 PASS Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 6 9 PASS Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 7 10 PASS Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: rtl; '. 8 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: rtl; ', border-inline-start expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 11 PASS Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. 9 12 PASS Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 10 13 PASS Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 11 14 PASS Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: rtl; '. 12 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: rtl; ', border-inline-start expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 15 PASS Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. 13 16 PASS Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 14 17 PASS Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 15 18 FAIL Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border-bottom expected "1px solid rgb(1, 1, 1)" but got "4px double rgb(4, 4, 4)" 16 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border- inline-startexpected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)"19 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border-bottom expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 17 20 FAIL Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'border-inline-start' last on single declaration, 'writing-mode: sideways-rl; direction: rtl; ', border-block-end expected "1px solid rgb(1, 1, 1)" but got "4px double rgb(4, 4, 4)" 18 21 FAIL Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'border-inline-start', two declarations, 'writing-mode: sideways-rl; direction: rtl; ', border-block-end expected "1px solid rgb(1, 1, 1)" but got "4px double rgb(4, 4, 4)" 19 22 PASS Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: ltr; '. 20 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: ltr; ', border-inline-start expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 23 PASS Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. 21 24 PASS Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 22 25 PASS Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 23 26 FAIL Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border-top expected "1px solid rgb(1, 1, 1)" but got "3px dotted rgb(3, 3, 3)" 24 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border- inline-startexpected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)"27 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border-top expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 25 28 FAIL Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'border-inline-start' last on single declaration, 'writing-mode: sideways-rl; direction: ltr; ', border-left expected "1px solid rgb(1, 1, 1)" but got "5px groove rgb(5, 5, 5)" 26 29 FAIL Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'border-inline-start', two declarations, 'writing-mode: sideways-rl; direction: ltr; ', border-left expected "1px solid rgb(1, 1, 1)" but got "5px groove rgb(5, 5, 5)" 27 30 PASS Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: rtl; '. 28 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: rtl; ', border-inline-start expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 31 PASS Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. 29 32 PASS Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 30 33 PASS Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 31 34 FAIL Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border-bottom expected "1px solid rgb(1, 1, 1)" but got "4px double rgb(4, 4, 4)" 32 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border- inline-startexpected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)"35 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border-bottom expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 33 36 FAIL Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'border-inline-start' last on single declaration, 'writing-mode: sideways-lr; direction: ltr; ', border-left expected "1px solid rgb(1, 1, 1)" but got "5px groove rgb(5, 5, 5)" 34 37 FAIL Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'border-inline-start', two declarations, 'writing-mode: sideways-lr; direction: ltr; ', border-left expected "1px solid rgb(1, 1, 1)" but got "5px groove rgb(5, 5, 5)" 35 38 PASS Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: ltr; '. 36 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: ltr; ', border-inline-start expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 39 PASS Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. 37 40 PASS Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 38 41 PASS Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 39 42 FAIL Test that logical border-* properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border-top expected "1px solid rgb(1, 1, 1)" but got "3px dotted rgb(3, 3, 3)" 40 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border- inline-startexpected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)"43 FAIL Test that border-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border-top expected "1px solid rgb(1, 1, 1)" but got "0px none rgb(0, 0, 0)" 41 44 FAIL Test that border-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'border-inline-start' last on single declaration, 'writing-mode: sideways-lr; direction: rtl; ', border-block-start expected "1px solid rgb(1, 1, 1)" but got "3px dotted rgb(3, 3, 3)" 42 45 FAIL Test that border-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'border-inline-start', two declarations, 'writing-mode: sideways-lr; direction: rtl; ', border-block-start expected "1px solid rgb(1, 1, 1)" but got "3px dotted rgb(3, 3, 3)" -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
r238262 r240251 1 <!DOCTYPE html> 1 <!DOCTYPE html> <!-- webkit-test-runner [ internal:CSSLogicalEnabled=true ] --> 2 2 <meta charset="utf-8" /> 3 3 <title>CSS Logical Properties: Flow-Relative Border Shorthands</title> … … 10 10 <div id="log"></div> 11 11 12 <script src="./resources/test-box-properties.js"></script>13 <script> 12 <script type="module"> 13 import {runTests, createBoxPropertyGroup} from "./resources/test-box-properties.js"; 14 14 runTests(createBoxPropertyGroup("border-*", {type: ["length", "border-style", "color"]})); 15 15 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style-expected.txt
r238262 r240251 1 1 2 2 PASS Test that logical border-*-style properties are supported. 3 PASS Test that border-inline-style shorthand sets longhands and serializes correctly. 4 PASS Test that border-block-style shorthand sets longhands and serializes correctly. 5 PASS Test that border-style shorthand sets longhands and serializes correctly. 3 6 PASS Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: ltr; '. 4 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: ltr; ', border-inline-start-style expected "solid" but got "none" 7 PASS Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. 5 8 PASS Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 6 9 PASS Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 7 10 PASS Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: rtl; '. 8 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: rtl; ', border-inline-start-style expected "solid" but got "none" 11 PASS Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. 9 12 PASS Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 10 13 PASS Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 11 14 PASS Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: rtl; '. 12 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: rtl; ', border-inline-start-style expected "solid" but got "none" 15 PASS Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. 13 16 PASS Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 14 17 PASS Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 15 18 FAIL Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border-bottom-style expected "solid" but got "double" 16 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border- inline-start-style expected "solid" but got "none"19 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border-bottom-style expected "solid" but got "none" 17 20 FAIL Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'border-inline-start-style' last on single declaration, 'writing-mode: sideways-rl; direction: rtl; ', border-block-end-style expected "solid" but got "double" 18 21 FAIL Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'border-inline-start-style', two declarations, 'writing-mode: sideways-rl; direction: rtl; ', border-block-end-style expected "solid" but got "double" 19 22 PASS Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: ltr; '. 20 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: ltr; ', border-inline-start-style expected "solid" but got "none" 23 PASS Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. 21 24 PASS Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 22 25 PASS Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 23 26 FAIL Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border-top-style expected "solid" but got "dotted" 24 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border- inline-start-style expected "solid" but got "none"27 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border-top-style expected "solid" but got "none" 25 28 FAIL Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'border-inline-start-style' last on single declaration, 'writing-mode: sideways-rl; direction: ltr; ', border-left-style expected "solid" but got "groove" 26 29 FAIL Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'border-inline-start-style', two declarations, 'writing-mode: sideways-rl; direction: ltr; ', border-left-style expected "solid" but got "groove" 27 30 PASS Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: rtl; '. 28 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: rtl; ', border-inline-start-style expected "solid" but got "none" 31 PASS Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. 29 32 PASS Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 30 33 PASS Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 31 34 FAIL Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border-bottom-style expected "solid" but got "double" 32 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border- inline-start-style expected "solid" but got "none"35 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border-bottom-style expected "solid" but got "none" 33 36 FAIL Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'border-inline-start-style' last on single declaration, 'writing-mode: sideways-lr; direction: ltr; ', border-left-style expected "solid" but got "groove" 34 37 FAIL Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'border-inline-start-style', two declarations, 'writing-mode: sideways-lr; direction: ltr; ', border-left-style expected "solid" but got "groove" 35 38 PASS Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: ltr; '. 36 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: ltr; ', border-inline-start-style expected "solid" but got "none" 39 PASS Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. 37 40 PASS Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 38 41 PASS Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 39 42 FAIL Test that logical border-*-style properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border-top-style expected "solid" but got "dotted" 40 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border- inline-start-style expected "solid" but got "none"43 FAIL Test that border-*-style shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border-top-style expected "solid" but got "none" 41 44 FAIL Test that border-*-style properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'border-inline-start-style' last on single declaration, 'writing-mode: sideways-lr; direction: rtl; ', border-block-start-style expected "solid" but got "dotted" 42 45 FAIL Test that border-*-style properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'border-inline-start-style', two declarations, 'writing-mode: sideways-lr; direction: rtl; ', border-block-start-style expected "solid" but got "dotted" -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
r238262 r240251 1 <!DOCTYPE html> 1 <!DOCTYPE html> <!-- webkit-test-runner [ internal:CSSLogicalEnabled=true ] --> 2 2 <meta charset="utf-8" /> 3 3 <title>CSS Logical Properties: Flow-Relative Border Styles</title> … … 10 10 <div id="log"></div> 11 11 12 <script src="./resources/test-box-properties.js"></script>13 <script> 12 <script type="module"> 13 import {runTests, createBoxPropertyGroup} from "./resources/test-box-properties.js"; 14 14 runTests(createBoxPropertyGroup("border-*-style", {type: "border-style"})); 15 15 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width-expected.txt
r238262 r240251 1 1 2 2 PASS Test that logical border-*-width properties are supported. 3 PASS Test that border-inline-width shorthand sets longhands and serializes correctly. 4 PASS Test that border-block-width shorthand sets longhands and serializes correctly. 5 PASS Test that border-width shorthand sets longhands and serializes correctly. 3 6 PASS Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: ltr; '. 4 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: ltr; ', border-inline-start-width expected "1px" but got "3px" 7 PASS Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. 5 8 PASS Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 6 9 PASS Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 7 10 PASS Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: rtl; '. 8 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: rtl; ', border-inline-start-width expected "1px" but got "3px" 11 PASS Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. 9 12 PASS Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 10 13 PASS Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 11 14 PASS Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: rtl; '. 12 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: rtl; ', border-inline-start-width expected "1px" but got "3px" 15 PASS Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. 13 16 PASS Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 14 17 PASS Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 15 18 FAIL Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border-bottom-width expected "1px" but got "4px" 16 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border- inline-start-width expected "1px" but got "3px"19 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', border-bottom-width expected "1px" but got "3px" 17 20 FAIL Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'border-inline-start-width' last on single declaration, 'writing-mode: sideways-rl; direction: rtl; ', border-block-end-width expected "1px" but got "4px" 18 21 FAIL Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'border-inline-start-width', two declarations, 'writing-mode: sideways-rl; direction: rtl; ', border-block-end-width expected "1px" but got "4px" 19 22 PASS Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: ltr; '. 20 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: ltr; ', border-inline-start-width expected "1px" but got "3px" 23 PASS Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. 21 24 PASS Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 22 25 PASS Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 23 26 FAIL Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border-top-width expected "1px" but got "3px" 24 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border- inline-start-width expected "1px" but got "3px"27 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', border-top-width expected "1px" but got "3px" 25 28 FAIL Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'border-inline-start-width' last on single declaration, 'writing-mode: sideways-rl; direction: ltr; ', border-left-width expected "1px" but got "5px" 26 29 FAIL Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'border-inline-start-width', two declarations, 'writing-mode: sideways-rl; direction: ltr; ', border-left-width expected "1px" but got "5px" 27 30 PASS Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: rtl; '. 28 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: rtl; ', border-inline-start-width expected "1px" but got "3px" 31 PASS Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. 29 32 PASS Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 30 33 PASS Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 31 34 FAIL Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border-bottom-width expected "1px" but got "4px" 32 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border- inline-start-width expected "1px" but got "3px"35 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', border-bottom-width expected "1px" but got "3px" 33 36 FAIL Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'border-inline-start-width' last on single declaration, 'writing-mode: sideways-lr; direction: ltr; ', border-left-width expected "1px" but got "5px" 34 37 FAIL Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'border-inline-start-width', two declarations, 'writing-mode: sideways-lr; direction: ltr; ', border-left-width expected "1px" but got "5px" 35 38 PASS Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: ltr; '. 36 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: ltr; ', border-inline-start-width expected "1px" but got "3px" 39 PASS Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. 37 40 PASS Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 38 41 PASS Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 39 42 FAIL Test that logical border-*-width properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border-top-width expected "1px" but got "3px" 40 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border- inline-start-width expected "1px" but got "3px"43 FAIL Test that border-*-width shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', border-top-width expected "1px" but got "3px" 41 44 FAIL Test that border-*-width properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'border-inline-start-width' last on single declaration, 'writing-mode: sideways-lr; direction: rtl; ', border-block-start-width expected "1px" but got "3px" 42 45 FAIL Test that border-*-width properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'border-inline-start-width', two declarations, 'writing-mode: sideways-lr; direction: rtl; ', border-block-start-width expected "1px" but got "3px" -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
r238262 r240251 1 <!DOCTYPE html> 1 <!DOCTYPE html> <!-- webkit-test-runner [ internal:CSSLogicalEnabled=true ] --> 2 2 <meta charset="utf-8" /> 3 3 <title>CSS Logical Properties: Flow-Relative Border Widths</title> … … 10 10 <div id="log"></div> 11 11 12 <script src="./resources/test-box-properties.js"></script>13 <script> 12 <script type="module"> 13 import {runTests, createBoxPropertyGroup} from "./resources/test-box-properties.js"; 14 14 runTests(createBoxPropertyGroup("border-*-width", { 15 15 type: "length", -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-inset-expected.txt
r238262 r240251 1 1 2 2 FAIL Test that logical inset-* properties are supported. assert_equals: logical properties in inline style, inset-inline-start expected "1px" but got "" 3 FAIL Test that inset-inline shorthand sets longhands and serializes correctly. assert_equals: shorthand in inline style, inset-inline expected "1px 2px" but got "" 4 FAIL Test that inset-block shorthand sets longhands and serializes correctly. assert_equals: shorthand in inline style, inset-block expected "1px 2px" but got "" 5 FAIL Test that inset shorthand sets longhands and serializes correctly. assert_equals: shorthand in inline style, inset expected "1px 2px 3px 4px" but got "" 3 6 FAIL Test that logical inset-* properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: ltr; ', inset-inline-start expected "1px" but got "" 4 7 FAIL Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: ltr; ', inset-inline-start expected "1px" but got "" -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
r238262 r240251 10 10 <div id="log"></div> 11 11 12 <script src="./resources/test-box-properties.js"></script>13 <script> 12 <script type="module"> 13 import {runTests, createBoxPropertyGroup} from "./resources/test-box-properties.js"; 14 14 runTests(createBoxPropertyGroup("inset-*", { 15 15 type: "length", -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-margin-expected.txt
r238262 r240251 1 1 2 2 PASS Test that logical margin-* properties are supported. 3 PASS Test that margin-inline shorthand sets longhands and serializes correctly. 4 PASS Test that margin-block shorthand sets longhands and serializes correctly. 5 PASS Test that margin shorthand sets longhands and serializes correctly. 3 6 PASS Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: ltr; '. 4 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: ltr; ', margin-inline-start expected "1px" but got "0px" 7 PASS Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. 5 8 PASS Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 6 9 PASS Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 7 10 PASS Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: rtl; '. 8 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: rtl; ', margin-inline-start expected "1px" but got "0px" 11 PASS Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. 9 12 PASS Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 10 13 PASS Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 11 14 PASS Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: rtl; '. 12 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: rtl; ', margin-inline-start expected "1px" but got "0px" 15 PASS Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. 13 16 PASS Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 14 17 PASS Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 15 18 FAIL Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', margin-bottom expected "1px" but got "4px" 16 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', margin- inline-startexpected "1px" but got "0px"19 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', margin-bottom expected "1px" but got "0px" 17 20 FAIL Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'margin-inline-start' last on single declaration, 'writing-mode: sideways-rl; direction: rtl; ', margin-block-end expected "1px" but got "4px" 18 21 FAIL Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'margin-inline-start', two declarations, 'writing-mode: sideways-rl; direction: rtl; ', margin-block-end expected "1px" but got "4px" 19 22 PASS Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: ltr; '. 20 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: ltr; ', margin-inline-start expected "1px" but got "0px" 23 PASS Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. 21 24 PASS Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 22 25 PASS Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 23 26 FAIL Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', margin-top expected "1px" but got "3px" 24 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', margin- inline-startexpected "1px" but got "0px"27 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', margin-top expected "1px" but got "0px" 25 28 FAIL Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'margin-inline-start' last on single declaration, 'writing-mode: sideways-rl; direction: ltr; ', margin-left expected "1px" but got "5px" 26 29 FAIL Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'margin-inline-start', two declarations, 'writing-mode: sideways-rl; direction: ltr; ', margin-left expected "1px" but got "5px" 27 30 PASS Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: rtl; '. 28 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: rtl; ', margin-inline-start expected "1px" but got "0px" 31 PASS Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. 29 32 PASS Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 30 33 PASS Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 31 34 FAIL Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', margin-bottom expected "1px" but got "4px" 32 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', margin- inline-startexpected "1px" but got "0px"35 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', margin-bottom expected "1px" but got "0px" 33 36 FAIL Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'margin-inline-start' last on single declaration, 'writing-mode: sideways-lr; direction: ltr; ', margin-left expected "1px" but got "5px" 34 37 FAIL Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'margin-inline-start', two declarations, 'writing-mode: sideways-lr; direction: ltr; ', margin-left expected "1px" but got "5px" 35 38 PASS Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: ltr; '. 36 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: ltr; ', margin-inline-start expected "1px" but got "0px" 39 PASS Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. 37 40 PASS Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 38 41 PASS Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 39 42 FAIL Test that logical margin-* properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', margin-top expected "1px" but got "3px" 40 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', margin- inline-startexpected "1px" but got "0px"43 FAIL Test that margin-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', margin-top expected "1px" but got "0px" 41 44 FAIL Test that margin-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'margin-inline-start' last on single declaration, 'writing-mode: sideways-lr; direction: rtl; ', margin-block-start expected "1px" but got "3px" 42 45 FAIL Test that margin-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'margin-inline-start', two declarations, 'writing-mode: sideways-lr; direction: rtl; ', margin-block-start expected "1px" but got "3px" -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
r238262 r240251 1 <!DOCTYPE html> 1 <!DOCTYPE html> <!-- webkit-test-runner [ internal:CSSLogicalEnabled=true ] --> 2 2 <meta charset="utf-8" /> 3 3 <title>CSS Logical Properties: Flow-Relative Margins</title> … … 10 10 <div id="log"></div> 11 11 12 <script src="./resources/test-box-properties.js"></script>13 <script> 12 <script type="module"> 13 import {runTests, createBoxPropertyGroup} from "./resources/test-box-properties.js"; 14 14 runTests(createBoxPropertyGroup("margin-*", {type: "length"})); 15 15 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-padding-expected.txt
r238262 r240251 1 1 2 2 PASS Test that logical padding-* properties are supported. 3 PASS Test that padding-inline shorthand sets longhands and serializes correctly. 4 PASS Test that padding-block shorthand sets longhands and serializes correctly. 5 PASS Test that padding shorthand sets longhands and serializes correctly. 3 6 PASS Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: ltr; '. 4 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: ltr; ', padding-inline-start expected "1px" but got "0px" 7 PASS Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '. 5 8 PASS Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 6 9 PASS Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: ltr; '. 7 10 PASS Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: horizontal-tb; direction: rtl; '. 8 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: horizontal-tb; direction: rtl; ', padding-inline-start expected "1px" but got "0px" 11 PASS Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '. 9 12 PASS Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 10 13 PASS Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: horizontal-tb; direction: rtl; '. 11 14 PASS Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: rtl; '. 12 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: rtl; ', padding-inline-start expected "1px" but got "0px" 15 PASS Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '. 13 16 PASS Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 14 17 PASS Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: rtl; '. 15 18 FAIL Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', padding-bottom expected "1px" but got "4px" 16 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', padding- inline-startexpected "1px" but got "0px"19 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: rtl; ', padding-bottom expected "1px" but got "0px" 17 20 FAIL Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'padding-inline-start' last on single declaration, 'writing-mode: sideways-rl; direction: rtl; ', padding-block-end expected "1px" but got "4px" 18 21 FAIL Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: rtl; '. assert_equals: 'padding-inline-start', two declarations, 'writing-mode: sideways-rl; direction: rtl; ', padding-block-end expected "1px" but got "4px" 19 22 PASS Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: vertical-rl; direction: ltr; '. 20 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-rl; direction: ltr; ', padding-inline-start expected "1px" but got "0px" 23 PASS Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '. 21 24 PASS Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 22 25 PASS Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-rl; direction: ltr; '. 23 26 FAIL Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', padding-top expected "1px" but got "3px" 24 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', padding- inline-startexpected "1px" but got "0px"27 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-rl; direction: ltr; ', padding-top expected "1px" but got "0px" 25 28 FAIL Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'padding-inline-start' last on single declaration, 'writing-mode: sideways-rl; direction: ltr; ', padding-left expected "1px" but got "5px" 26 29 FAIL Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-rl; direction: ltr; '. assert_equals: 'padding-inline-start', two declarations, 'writing-mode: sideways-rl; direction: ltr; ', padding-left expected "1px" but got "5px" 27 30 PASS Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: rtl; '. 28 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: rtl; ', padding-inline-start expected "1px" but got "0px" 31 PASS Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '. 29 32 PASS Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 30 33 PASS Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: rtl; '. 31 34 FAIL Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', padding-bottom expected "1px" but got "4px" 32 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', padding- inline-startexpected "1px" but got "0px"35 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: ltr; ', padding-bottom expected "1px" but got "0px" 33 36 FAIL Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'padding-inline-start' last on single declaration, 'writing-mode: sideways-lr; direction: ltr; ', padding-left expected "1px" but got "5px" 34 37 FAIL Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: ltr; '. assert_equals: 'padding-inline-start', two declarations, 'writing-mode: sideways-lr; direction: ltr; ', padding-left expected "1px" but got "5px" 35 38 PASS Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: vertical-lr; direction: ltr; '. 36 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: vertical-lr; direction: ltr; ', padding-inline-start expected "1px" but got "0px" 39 PASS Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '. 37 40 PASS Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 38 41 PASS Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: vertical-lr; direction: ltr; '. 39 42 FAIL Test that logical padding-* properties share computed values with their physical associates, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: logical properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', padding-top expected "1px" but got "3px" 40 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', padding- inline-startexpected "1px" but got "0px"43 FAIL Test that padding-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: shorthand properties on one declaration, writing mode properties on another, 'writing-mode: sideways-lr; direction: rtl; ', padding-top expected "1px" but got "0px" 41 44 FAIL Test that padding-* properties honor order of appearance when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'padding-inline-start' last on single declaration, 'writing-mode: sideways-lr; direction: rtl; ', padding-block-start expected "1px" but got "3px" 42 45 FAIL Test that padding-* properties honor selector specificty when both logical and physical associates are declared, with 'writing-mode: sideways-lr; direction: rtl; '. assert_equals: 'padding-inline-start', two declarations, 'writing-mode: sideways-lr; direction: rtl; ', padding-block-start expected "1px" but got "3px" -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
r238262 r240251 1 <!DOCTYPE html> 1 <!DOCTYPE html> <!-- webkit-test-runner [ internal:CSSLogicalEnabled=true ] --> 2 2 <meta charset="utf-8" /> 3 3 <title>CSS Logical Properties: Flow-Relative Padding</title> … … 10 10 <div id="log"></div> 11 11 12 <script src="./resources/test-box-properties.js"></script>13 <script> 12 <script type="module"> 13 import {runTests, createBoxPropertyGroup} from "./resources/test-box-properties.js"; 14 14 runTests(createBoxPropertyGroup("padding-*", {type: "length"})); 15 15 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/logical-box-size.html
r238262 r240251 10 10 <div id="log"></div> 11 11 12 <script src="./resources/test-box-properties.js"></script>13 <script> 12 <script type="module"> 13 import {runTests, createSizingPropertyGroup} from "./resources/test-box-properties.js"; 14 14 runTests(createSizingPropertyGroup("")); 15 15 runTests(createSizingPropertyGroup("max-")); -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/resources/test-box-properties.js
r238262 r240251 1 "use strict"; 2 (function(exports) { 3 const sheet = document.head.appendChild(document.createElement("style")); 4 5 // Specify size for outer <div> to avoid unconstrained-size warnings 6 // when writing-mode of the inner test <div> is vertical-* 7 const wrapper = document.body.appendChild(document.createElement("div")); 8 wrapper.style.cssText = "width:100px; height: 100px;"; 9 const testElement = wrapper.appendChild(document.createElement("div")); 10 testElement.id = testElement.className = "test"; 11 12 // Values to use while testing 13 const testValues = { 14 "length": ["1px", "2px", "3px", "4px", "5px"], 15 "color": ["rgb(1, 1, 1)", "rgb(2, 2, 2)", "rgb(3, 3, 3)", "rgb(4, 4, 4)", "rgb(5, 5, 5)"], 16 "border-style": ["solid", "dashed", "dotted", "double", "groove"], 1 import { 2 testElement, 3 writingModes, 4 testCSSValues, 5 testComputedValues, 6 makeDeclaration 7 } from "./test-shared.js"; 8 9 // Values to use while testing 10 const testValues = { 11 "length": ["1px", "2px", "3px", "4px", "5px"], 12 "color": ["rgb(1, 1, 1)", "rgb(2, 2, 2)", "rgb(3, 3, 3)", "rgb(4, 4, 4)", "rgb(5, 5, 5)"], 13 "border-style": ["solid", "dashed", "dotted", "double", "groove"], 14 }; 15 16 /** 17 * Creates a group of physical and logical box properties, such as 18 * 19 * { physical: { 20 * left: "margin-left", right: "margin-right", 21 * top: "margin-top", bottom: "margin-bottom", 22 * }, logical: { 23 * inlineStart: "margin-inline-start", inlineEnd: "margin-inline-end", 24 * blockStart: "margin-block-start", blockEnd: "margin-block-end", 25 * }, shorthands: { 26 * "margin": ["margin-top", "margin-right", "margin-bottom", "margin-left"], 27 * "margin-inline": ["margin-inline-start", "margin-inline-end"], 28 * "margin-block": ["margin-block-start", "margin-block-end"], 29 * }, type: ["length"], prerequisites: "...", property: "margin-*" } 30 * 31 * @param {string} property 32 * A string representing the property names, like "margin-*". 33 * @param {Object} descriptor 34 * @param {string|string[]} descriptor.type 35 * Describes the kind of values accepted by the property, like "length". 36 * Must be a key or a collection of keys from the `testValues` object. 37 * @param {Object={}} descriptor.prerequisites 38 * Represents property declarations that are needed by `property` to work. 39 * For example, border-width properties require a border style. 40 */ 41 export function createBoxPropertyGroup(property, descriptor) { 42 const logical = {}; 43 const physical = {}; 44 const shorthands = {}; 45 for (const axis of ["inline", "block"]) { 46 const shorthand = property.replace("*", axis); 47 const longhands = []; 48 shorthands[shorthand] = longhands; 49 for (const side of ["start", "end"]) { 50 const logicalSide = axis + "-" + side; 51 const camelCase = logicalSide.replace(/-(.)/g, (match, $1) => $1.toUpperCase()); 52 const longhand = property.replace("*", logicalSide); 53 logical[camelCase] = longhand; 54 longhands.push(longhand); 55 } 56 } 57 const isInset = property === "inset-*"; 58 let prerequisites = ""; 59 for (const physicalSide of ["left", "right", "top", "bottom"]) { 60 physical[physicalSide] = isInset ? physicalSide : property.replace("*", physicalSide); 61 prerequisites += makeDeclaration(descriptor.prerequisites, physicalSide); 62 } 63 shorthands[property.replace("-*", "")] = 64 ["top", "right", "bottom", "left"].map(physicalSide => physical[physicalSide]); 65 const type = [].concat(descriptor.type); 66 return {logical, physical, shorthands, type, prerequisites, property}; 67 } 68 69 /** 70 * Creates a group of physical and logical sizing properties. 71 * 72 * @param {string} prefix 73 * One of "", "max-" or "min-". 74 */ 75 export function createSizingPropertyGroup(prefix) { 76 return { 77 logical: { 78 inline: `${prefix}inline-size`, 79 block: `${prefix}block-size`, 80 }, 81 physical: { 82 horizontal: `${prefix}width`, 83 vertical: `${prefix}height`, 84 }, 85 type: ["length"], 86 prerequisites: makeDeclaration({display: "block"}), 87 property: (prefix ? prefix.slice(0, -1) + " " : "") + "sizing", 17 88 }; 18 19 // Six unique overall writing modes for property-mapping purposes. 20 const writingModes = [ 21 { 22 styles: [ 23 {"writing-mode": "horizontal-tb", "direction": "ltr"}, 24 ], 25 blockStart: "top", blockEnd: "bottom", inlineStart: "left", inlineEnd: "right", 26 block: "vertical", inline: "horizontal" }, 27 { 28 styles: [ 29 {"writing-mode": "horizontal-tb", "direction": "rtl"}, 30 ], 31 blockStart: "top", blockEnd: "bottom", inlineStart: "right", inlineEnd: "left", 32 block: "vertical", inline: "horizontal" }, 33 { 34 styles: [ 35 {"writing-mode": "vertical-rl", "direction": "rtl"}, 36 {"writing-mode": "sideways-rl", "direction": "rtl"}, 37 ], 38 blockStart: "right", blockEnd: "left", inlineStart: "bottom", inlineEnd: "top", 39 block: "horizontal", inline: "vertical" }, 40 { 41 styles: [ 42 {"writing-mode": "vertical-rl", "direction": "ltr"}, 43 {"writing-mode": "sideways-rl", "direction": "ltr"}, 44 ], 45 blockStart: "right", blockEnd: "left", inlineStart: "top", inlineEnd: "bottom", 46 block: "horizontal", inline: "vertical" }, 47 { 48 styles: [ 49 {"writing-mode": "vertical-lr", "direction": "rtl"}, 50 {"writing-mode": "sideways-lr", "direction": "ltr"}, 51 ], 52 blockStart: "left", blockEnd: "right", inlineStart: "bottom", inlineEnd: "top", 53 block: "horizontal", inline: "vertical" }, 54 { 55 styles: [ 56 {"writing-mode": "vertical-lr", "direction": "ltr"}, 57 {"writing-mode": "sideways-lr", "direction": "rtl"}, 58 ], 59 blockStart: "left", blockEnd: "right", inlineStart: "top", inlineEnd: "bottom", 60 block: "horizontal", inline: "vertical" }, 61 ]; 62 63 function testCSSValues(testName, style, expectedValues) { 64 for (const [property, value] of expectedValues) { 65 assert_equals(style.getPropertyValue(property), value, `${testName}, ${property}`); 66 } 67 } 68 69 function testComputedValues(testName, rules, expectedValues) { 70 sheet.textContent = rules; 71 const cs = getComputedStyle(testElement); 72 testCSSValues(testName, cs, expectedValues); 73 sheet.textContent = ""; 74 } 75 76 function makeDeclaration(object = {}, replacement = "*") { 77 let decl = ""; 78 for (const [property, value] of Object.entries(object)) { 79 decl += `${property.replace("*", replacement)}: ${value}; `; 80 } 81 return decl; 82 } 83 84 /** 85 * Creates a group of physical and logical box properties, such as 86 * 87 * { physical: { 88 * left: "margin-left", right: "margin-right", 89 * top: "margin-top", bottom: "margin-bottom", 90 * }, logical: { 91 * inlineStart: "margin-inline-start", inlineEnd: "margin-inline-end", 92 * blockStart: "margin-block-start", blockEnd: "margin-block-end", 93 * }, shorthands: { 94 * inline: ["margin-inline-start", "margin-inline-end"], 95 * block: ["margin-block-start", "margin-block-end"], 96 * }, type: ["length"], prerequisites: "...", property: "'margin-*'" } 97 * 98 * @param {string} property 99 * A string representing the property names, like "margin-*". 100 * @param {Object} descriptor 101 * @param {string|string[]} descriptor.type 102 * Describes the kind of values accepted by the property, like "length". 103 * Must be a key or a collection of keys from the `testValues` object. 104 * @param {Object={}} descriptor.prerequisites 105 * Represents property declarations that are needed by `property` to work. 106 * For example, border-width properties require a border style. 107 */ 108 exports.createBoxPropertyGroup = function(property, descriptor) { 109 const logical = {}; 110 const physical = {}; 111 const shorthands = {}; 112 for (const axis of ["inline", "block"]) { 113 const shorthand = property.replace("*", axis); 114 const longhands = []; 115 shorthands[shorthand] = longhands; 116 for (const side of ["start", "end"]) { 117 const logicalSide = axis + "-" + side; 118 const camelCase = logicalSide.replace(/-(.)/g, (match, $1) => $1.toUpperCase()); 119 const longhand = property.replace("*", logicalSide); 120 logical[camelCase] = longhand; 121 longhands.push(longhand); 89 } 90 91 /** 92 * Tests a grup of logical and physical properties in different writing modes. 93 * 94 * @param {Object} group 95 * An object returned by createBoxPropertyGroup or createSizingPropertyGroup. 96 */ 97 export function runTests(group) { 98 const values = testValues[group.type[0]].map(function(_, i) { 99 return group.type.map(type => testValues[type][i]).join(" "); 100 }); 101 const logicals = Object.values(group.logical); 102 const physicals = Object.values(group.physical); 103 const shorthands = group.shorthands ? Object.entries(group.shorthands) : null; 104 105 test(function() { 106 const expected = []; 107 for (const [i, logicalProp] of logicals.entries()) { 108 testElement.style.setProperty(logicalProp, values[i]); 109 expected.push([logicalProp, values[i]]); 110 } 111 testCSSValues("logical properties in inline style", testElement.style, expected); 112 }, `Test that logical ${group.property} properties are supported.`); 113 testElement.style.cssText = ""; 114 115 const shorthandValues = {}; 116 for (const [shorthand, longhands] of shorthands || []) { 117 let valueArray; 118 if (group.type.length > 1) { 119 valueArray = [values[0]]; 120 } else { 121 valueArray = testValues[group.type].slice(0, longhands.length); 122 } 123 shorthandValues[shorthand] = valueArray; 124 const value = valueArray.join(" "); 125 const expected = [[shorthand, value]]; 126 for (let [i, longhand] of longhands.entries()) { 127 expected.push([longhand, valueArray[group.type.length > 1 ? 0 : i]]); 128 } 129 test(function() { 130 testElement.style.setProperty(shorthand, value); 131 testCSSValues("shorthand in inline style", testElement.style, expected); 132 const stylesheet = `.test { ${group.prerequisites} }`; 133 testComputedValues("shorthand in computed style", stylesheet, expected); 134 }, `Test that ${shorthand} shorthand sets longhands and serializes correctly.`); 135 testElement.style.cssText = ""; 136 } 137 138 for (const writingMode of writingModes) { 139 for (const style of writingMode.styles) { 140 const writingModeDecl = makeDeclaration(style); 141 142 const associated = {}; 143 for (const [logicalSide, logicalProp] of Object.entries(group.logical)) { 144 const physicalProp = group.physical[writingMode[logicalSide]]; 145 associated[logicalProp] = physicalProp; 146 associated[physicalProp] = logicalProp; 122 147 } 123 } 124 const isInset = property === "inset-*"; 125 let prerequisites = ""; 126 for (const physicalSide of ["left", "right", "top", "bottom"]) { 127 physical[physicalSide] = isInset ? physicalSide : property.replace("*", physicalSide); 128 prerequisites += makeDeclaration(descriptor.prerequisites, physicalSide); 129 } 130 const type = [].concat(descriptor.type); 131 return {name, logical, physical, shorthands, type, prerequisites, property}; 132 }; 133 134 /** 135 * Creates a group of physical and logical sizing properties. 136 * 137 * @param {string} prefix 138 * One of "", "max-" or "min-". 139 */ 140 exports.createSizingPropertyGroup = function(prefix) { 141 return { 142 logical: { 143 inline: `${prefix}inline-size`, 144 block: `${prefix}block-size`, 145 }, 146 physical: { 147 horizontal: `${prefix}width`, 148 vertical: `${prefix}height`, 149 }, 150 type: ["length"], 151 prerequisites: makeDeclaration({display: "block"}), 152 property: (prefix ? prefix.slice(0, -1) + " " : "") + "sizing", 153 }; 154 }; 155 156 /** 157 * Tests a grup of logical and physical properties in different writing modes. 158 * 159 * @param {Object} group 160 * An object returned by createBoxPropertyGroup or createSizingPropertyGroup. 161 */ 162 exports.runTests = function(group) { 163 const values = testValues[group.type[0]].map(function(_, i) { 164 return group.type.map(type => testValues[type][i]).join(" "); 165 }); 166 const logicals = Object.values(group.logical); 167 const physicals = Object.values(group.physical); 168 const shorthands = group.shorthands ? Object.entries(group.shorthands) : null; 169 170 test(function() { 171 const expected = []; 172 for (const [i, logicalProp] of logicals.entries()) { 173 testElement.style.setProperty(logicalProp, values[i]); 174 expected.push([logicalProp, values[i]]); 148 149 // Test that logical properties are converted to their physical 150 // equivalent correctly when all in the group are present on a single 151 // declaration, with no overwriting of previous properties and 152 // no physical properties present. We put the writing mode properties 153 // on a separate declaration to test that the computed values of these 154 // properties are used, rather than those on the same declaration. 155 test(function() { 156 let decl = group.prerequisites; 157 const expected = []; 158 for (const [i, logicalProp] of logicals.entries()) { 159 decl += `${logicalProp}: ${values[i]}; `; 160 expected.push([logicalProp, values[i]]); 161 expected.push([associated[logicalProp], values[i]]); 162 } 163 testComputedValues("logical properties on one declaration, writing " + 164 `mode properties on another, '${writingModeDecl}'`, 165 `.test { ${writingModeDecl} } .test { ${decl} }`, 166 expected); 167 }, `Test that logical ${group.property} properties share computed values ` 168 + `with their physical associates, with '${writingModeDecl}'.`); 169 170 // Test logical shorthand properties. 171 if (shorthands) { 172 test(function() { 173 for (const [shorthand, longhands] of shorthands) { 174 let valueArray = shorthandValues[shorthand]; 175 const decl = group.prerequisites + `${shorthand}: ${valueArray.join(" ")}; `; 176 const expected = []; 177 for (let [i, longhand] of longhands.entries()) { 178 const longhandValue = valueArray[group.type.length > 1 ? 0 : i]; 179 expected.push([longhand, longhandValue]); 180 expected.push([associated[longhand], longhandValue]); 181 } 182 testComputedValues("shorthand properties on one declaration, writing " + 183 `mode properties on another, '${writingModeDecl}'`, 184 `.test { ${writingModeDecl} } .test { ${decl} }`, 185 expected); 186 } 187 }, `Test that ${group.property} shorthands set the computed value of both ` 188 + `logical and physical longhands, with '${writingModeDecl}'.`); 175 189 } 176 testCSSValues("logical properties in inline style", testElement.style, expected); 177 }, `Test that logical ${group.property} properties are supported.`); 178 testElement.style.cssText = ""; 179 180 for (const writingMode of writingModes) { 181 for (const style of writingMode.styles) { 182 const writingModeDecl = makeDeclaration(style); 183 184 const associated = {}; 185 for (const [logicalSide, logicalProp] of Object.entries(group.logical)) { 186 const physicalProp = group.physical[writingMode[logicalSide]]; 187 associated[logicalProp] = physicalProp; 188 associated[physicalProp] = logicalProp; 190 191 // Test that logical and physical properties are cascaded together, 192 // honoring their relative order on a single declaration 193 // (a) with a single logical property after the physical ones 194 // (b) with a single physical property after the logical ones 195 test(function() { 196 for (const lastIsLogical of [true, false]) { 197 const lasts = lastIsLogical ? logicals : physicals; 198 const others = lastIsLogical ? physicals : logicals; 199 for (const lastProp of lasts) { 200 let decl = writingModeDecl + group.prerequisites; 201 const expected = []; 202 for (const [i, prop] of others.entries()) { 203 decl += `${prop}: ${values[i]}; `; 204 const valueIdx = associated[prop] === lastProp ? others.length : i; 205 expected.push([prop, values[valueIdx]]); 206 expected.push([associated[prop], values[valueIdx]]); 207 } 208 decl += `${lastProp}: ${values[others.length]}; `; 209 testComputedValues(`'${lastProp}' last on single declaration, '${writingModeDecl}'`, 210 `.test { ${decl} }`, 211 expected); 212 } 189 213 } 190 191 // Test that logical properties are converted to their physical 192 // equivalent correctly when all in the group are present on a single 193 // declaration, with no overwriting of previous properties and 194 // no physical properties present. We put the writing mode properties 195 // on a separate declaration to test that the computed values of these 196 // properties are used, rather than those on the same declaration. 197 test(function() { 198 let decl = group.prerequisites; 199 const expected = []; 200 for (const [i, logicalProp] of logicals.entries()) { 201 decl += `${logicalProp}: ${values[i]}; `; 202 expected.push([logicalProp, values[i]]); 203 expected.push([associated[logicalProp], values[i]]); 204 } 205 testComputedValues("logical properties on one declaration, writing " + 206 `mode properties on another, '${writingModeDecl}'`, 207 `.test { ${writingModeDecl} } .test { ${decl} }`, 208 expected); 209 }, `Test that logical ${group.property} properties share computed values ` 210 + `with their physical associates, with '${writingModeDecl}'.`); 211 212 213 // Test logical shorthand properties. 214 if (shorthands) { 215 test(function() { 216 for (const [shorthand, longhands] of shorthands) { 217 let shorthandValues; 218 if (group.type.length > 1) { 219 shorthandValues = [values[0]]; 220 } else { 221 shorthandValues = testValues[group.type].slice(0, longhands.length); 222 } 223 const decl = group.prerequisites + `${shorthand}: ${shorthandValues.join(" ")}; `; 224 const expected = []; 225 for (let [i, longhand] of longhands.entries()) { 226 const longhandValue = shorthandValues[group.type.length > 1 ? 0 : i]; 227 expected.push([longhand, longhandValue]); 228 expected.push([associated[longhand], longhandValue]); 229 } 230 testComputedValues("shorthand properties on one declaration, writing " + 231 `mode properties on another, '${writingModeDecl}'`, 232 `.test { ${writingModeDecl} } .test { ${decl} }`, 233 expected); 214 }, `Test that ${group.property} properties honor order of appearance when both ` 215 + `logical and physical associates are declared, with '${writingModeDecl}'.`); 216 217 // Test that logical and physical properties are cascaded properly when 218 // on different declarations 219 // (a) with a logical property in the high specificity rule 220 // (b) with a physical property in the high specificity rule 221 test(function() { 222 for (const highIsLogical of [true, false]) { 223 let lowDecl = writingModeDecl + group.prerequisites; 224 const high = highIsLogical ? logicals : physicals; 225 const others = highIsLogical ? physicals : logicals; 226 for (const [i, prop] of others.entries()) { 227 lowDecl += `${prop}: ${values[i]}; `; 228 } 229 for (const highProp of high) { 230 const highDecl = `${highProp}: ${values[others.length]}; `; 231 const expected = []; 232 for (const [i, prop] of others.entries()) { 233 const valueIdx = associated[prop] === highProp ? others.length : i; 234 expected.push([prop, values[valueIdx]]); 235 expected.push([associated[prop], values[valueIdx]]); 234 236 } 235 }, `Test that ${group.property} shorthands set the computed value of both ` 236 + `logical and physical longhands, with '${writingModeDecl}'.`); 237 testComputedValues(`'${highProp}', two declarations, '${writingModeDecl}'`, 238 `#test { ${highDecl} } .test { ${lowDecl} }`, 239 expected); 240 } 237 241 } 238 239 // Test that logical and physical properties are cascaded together, 240 // honoring their relative order on a single declaration 241 // (a) with a single logical property after the physical ones 242 // (b) with a single physical property after the logical ones 243 test(function() { 244 for (const lastIsLogical of [true, false]) { 245 const lasts = lastIsLogical ? logicals : physicals; 246 const others = lastIsLogical ? physicals : logicals; 247 for (const lastProp of lasts) { 248 let decl = writingModeDecl + group.prerequisites; 249 const expected = []; 250 for (const [i, prop] of others.entries()) { 251 decl += `${prop}: ${values[i]}; `; 252 const valueIdx = associated[prop] === lastProp ? others.length : i; 253 expected.push([prop, values[valueIdx]]); 254 expected.push([associated[prop], values[valueIdx]]); 255 } 256 decl += `${lastProp}: ${values[others.length]}; `; 257 testComputedValues(`'${lastProp}' last on single declaration, '${writingModeDecl}'`, 258 `.test { ${decl} }`, 259 expected); 260 } 261 } 262 }, `Test that ${group.property} properties honor order of appearance when both ` 263 + `logical and physical associates are declared, with '${writingModeDecl}'.`); 264 265 // Test that logical and physical properties are cascaded properly when 266 // on different declarations 267 // (a) with a logical property in the high specificity rule 268 // (b) with a physical property in the high specificity rule 269 test(function() { 270 for (const highIsLogical of [true, false]) { 271 let lowDecl = writingModeDecl + group.prerequisites; 272 const high = highIsLogical ? logicals : physicals; 273 const others = highIsLogical ? physicals : logicals; 274 for (const [i, prop] of others.entries()) { 275 lowDecl += `${prop}: ${values[i]}; `; 276 } 277 for (const highProp of high) { 278 const highDecl = `${highProp}: ${values[others.length]}; `; 279 const expected = []; 280 for (const [i, prop] of others.entries()) { 281 const valueIdx = associated[prop] === highProp ? others.length : i; 282 expected.push([prop, values[valueIdx]]); 283 expected.push([associated[prop], values[valueIdx]]); 284 } 285 testComputedValues(`'${highProp}', two declarations, '${writingModeDecl}'`, 286 `#test { ${highDecl} } .test { ${lowDecl} }`, 287 expected); 288 } 289 } 290 }, `Test that ${group.property} properties honor selector specificty when both ` 291 + `logical and physical associates are declared, with '${writingModeDecl}'.`); 292 } 293 } 294 }; 295 })(window); 242 }, `Test that ${group.property} properties honor selector specificty when both ` 243 + `logical and physical associates are declared, with '${writingModeDecl}'.`); 244 } 245 } 246 } -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/resources/w3c-import.log
r238262 r240251 16 16 List of files: 17 17 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/resources/test-box-properties.js 18 /LayoutTests/imported/w3c/web-platform-tests/css/css-logical/resources/test-shared.js -
trunk/Source/WebCore/ChangeLog
r240249 r240251 1 2019-01-22 Oriol Brufau <obrufau@igalia.com> 2 3 [css-logical] Implement flow-relative margin, padding and border shorthands 4 https://bugs.webkit.org/show_bug.cgi?id=188697 5 6 Reviewed by Simon Fraser and Antti Koivisto. 7 8 Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html 9 imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html 10 imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html 11 imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html 12 imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html 13 imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html 14 webexposed/css-properties-behind-flags.html 15 16 * css/CSSComputedStyleDeclaration.cpp: 17 (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): 18 Allow the new properties to serialize their computed value. 19 20 (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand): 21 (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand): 22 * css/CSSComputedStyleDeclaration.h: 23 Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand, 24 and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided 25 shorthands. 26 27 * css/CSSProperties.json: 28 Add the new properties behind the CSSLogicalEnabled runtime flag. 29 30 * css/CSSStyleDeclaration.cpp: 31 (WebCore::CSSStyleDeclaration::supportedPropertyNames const): 32 Prevent CSS properties disabled behind a runtime flag from being exposed in 33 style declarations. 34 35 * css/StyleProperties.cpp: 36 (WebCore::StyleProperties::getPropertyValue const): 37 Allow the new properties to serialize their specified value. 38 39 (WebCore::StyleProperties::get2Values const): 40 Add get2Values, analogous to get4Values, for serializing 2-sided shorthands. 41 42 (WebCore::StyleProperties::borderPropertyValue const): 43 Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands 44 corresponding to width, style and color. 45 46 (WebCore::MutableStyleProperties::setProperty): 47 Prevent CSS properties disabled behind a runtime flag from being set a value. 48 49 (WebCore::StyleProperties::asText const): 50 Allow the new properties to be serialized in cssText. 51 Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText, 52 and serialize the longhands instead. Note that there could be another shorthand 53 available which is enabled, but a proper solution would require bug 190496. 54 55 * css/StyleProperties.h: 56 Update declarations of borderPropertyValue and get2Values. 57 58 * css/makeprop.pl: 59 (addProperty): 60 Add isEnabledCSSProperty function for checking that a CSS property is not 61 disabled behind a runtime flag. 62 63 * css/parser/CSSPropertyParser.cpp: 64 (WebCore::cssPropertyID): 65 Prevent CSS properties disabled behind a runtime flag from being exposed in 66 computed styles. 67 68 (WebCore::CSSPropertyParser::addProperty): 69 Prevent CSS properties disabled behind a runtime flag from being set a value. 70 71 (WebCore::CSSPropertyParser::consumeBorder): 72 Change consumeBorder to provide the caller with the parsed values instead of 73 setting properties. Then the caller can decide to which properties the values 74 should be set, and whether border-image should be reset or not. 75 76 (WebCore::CSSPropertyParser::consume2ValueShorthand): 77 (WebCore::CSSPropertyParser::consume4ValueShorthand): 78 Rename consume4Values to consume4ValueShorthand, and add analogous 79 consume2ValueShorthand for parsing shorthands with two longhands. 80 81 (WebCore::CSSPropertyParser::parseShorthand): 82 Allow the new properties to be parsed. 83 84 * css/parser/CSSPropertyParser.h: 85 Update declarations of consumeBorder, consume2ValueShorthand and 86 consume4ValueShorthand. 87 88 * inspector/agents/InspectorCSSAgent.cpp: 89 (WebCore::InspectorCSSAgent::getSupportedCSSProperties): 90 Prevent CSS properties disabled behind a runtime flag from being exposed in 91 the CSS inspector tool. 92 93 * page/RuntimeEnabledFeatures.h: 94 (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled): 95 (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const): 96 Add the CSSLogicalEnabled runtime flag. 97 1 98 2019-01-21 Antti Koivisto <antti@apple.com> 2 99 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r239978 r240251 3930 3930 return value; 3931 3931 } 3932 case CSSPropertyBorderBlock: { 3933 auto value = propertyValue(CSSPropertyBorderBlockStart, DoNotUpdateLayout); 3934 if (!compareCSSValuePtr<CSSValue>(value, propertyValue(CSSPropertyBorderBlockEnd, DoNotUpdateLayout))) 3935 return nullptr; 3936 return value; 3937 } 3938 case CSSPropertyBorderBlockColor: 3939 return getCSSPropertyValuesFor2SidesShorthand(borderBlockColorShorthand()); 3940 case CSSPropertyBorderBlockStyle: 3941 return getCSSPropertyValuesFor2SidesShorthand(borderBlockStyleShorthand()); 3942 case CSSPropertyBorderBlockWidth: 3943 return getCSSPropertyValuesFor2SidesShorthand(borderBlockWidthShorthand()); 3932 3944 case CSSPropertyBorderBottom: 3933 3945 return getCSSPropertyValuesForShorthandProperties(borderBottomShorthand()); 3934 3946 case CSSPropertyBorderColor: 3935 return getCSSPropertyValuesFor SidesShorthand(borderColorShorthand());3947 return getCSSPropertyValuesFor4SidesShorthand(borderColorShorthand()); 3936 3948 case CSSPropertyBorderLeft: 3937 3949 return getCSSPropertyValuesForShorthandProperties(borderLeftShorthand()); 3938 3950 case CSSPropertyBorderImage: 3939 3951 return valueForNinePieceImage(style.borderImage()); 3952 case CSSPropertyBorderInline: { 3953 auto value = propertyValue(CSSPropertyBorderInlineStart, DoNotUpdateLayout); 3954 if (!compareCSSValuePtr<CSSValue>(value, propertyValue(CSSPropertyBorderInlineEnd, DoNotUpdateLayout))) 3955 return nullptr; 3956 return value; 3957 } 3958 case CSSPropertyBorderInlineColor: 3959 return getCSSPropertyValuesFor2SidesShorthand(borderInlineColorShorthand()); 3960 case CSSPropertyBorderInlineStyle: 3961 return getCSSPropertyValuesFor2SidesShorthand(borderInlineStyleShorthand()); 3962 case CSSPropertyBorderInlineWidth: 3963 return getCSSPropertyValuesFor2SidesShorthand(borderInlineWidthShorthand()); 3940 3964 case CSSPropertyBorderRadius: 3941 3965 return borderRadiusShorthandValue(style); … … 3943 3967 return getCSSPropertyValuesForShorthandProperties(borderRightShorthand()); 3944 3968 case CSSPropertyBorderStyle: 3945 return getCSSPropertyValuesFor SidesShorthand(borderStyleShorthand());3969 return getCSSPropertyValuesFor4SidesShorthand(borderStyleShorthand()); 3946 3970 case CSSPropertyBorderTop: 3947 3971 return getCSSPropertyValuesForShorthandProperties(borderTopShorthand()); 3948 3972 case CSSPropertyBorderWidth: 3949 return getCSSPropertyValuesFor SidesShorthand(borderWidthShorthand());3973 return getCSSPropertyValuesFor4SidesShorthand(borderWidthShorthand()); 3950 3974 case CSSPropertyColumnRule: 3951 3975 return getCSSPropertyValuesForShorthandProperties(columnRuleShorthand()); … … 3955 3979 return getCSSPropertyValuesForShorthandProperties(listStyleShorthand()); 3956 3980 case CSSPropertyMargin: 3957 return getCSSPropertyValuesForSidesShorthand(marginShorthand()); 3981 return getCSSPropertyValuesFor4SidesShorthand(marginShorthand()); 3982 case CSSPropertyMarginBlock: 3983 return getCSSPropertyValuesFor2SidesShorthand(marginBlockShorthand()); 3984 case CSSPropertyMarginInline: 3985 return getCSSPropertyValuesFor2SidesShorthand(marginInlineShorthand()); 3958 3986 case CSSPropertyOutline: 3959 3987 return getCSSPropertyValuesForShorthandProperties(outlineShorthand()); 3960 3988 case CSSPropertyPadding: 3961 return getCSSPropertyValuesForSidesShorthand(paddingShorthand()); 3962 3989 return getCSSPropertyValuesFor4SidesShorthand(paddingShorthand()); 3990 case CSSPropertyPaddingBlock: 3991 return getCSSPropertyValuesFor2SidesShorthand(paddingBlockShorthand()); 3992 case CSSPropertyPaddingInline: 3993 return getCSSPropertyValuesFor2SidesShorthand(paddingInlineShorthand()); 3963 3994 #if ENABLE(CSS_SCROLL_SNAP) 3964 3995 case CSSPropertyScrollSnapMargin: 3965 return getCSSPropertyValuesFor SidesShorthand(scrollSnapMarginShorthand());3996 return getCSSPropertyValuesFor4SidesShorthand(scrollSnapMarginShorthand()); 3966 3997 case CSSPropertyScrollSnapMarginBottom: 3967 3998 return zoomAdjustedPixelValueForLength(style.scrollSnapMarginBottom(), style); … … 3973 4004 return zoomAdjustedPixelValueForLength(style.scrollSnapMarginLeft(), style); 3974 4005 case CSSPropertyScrollPadding: 3975 return getCSSPropertyValuesFor SidesShorthand(scrollPaddingShorthand());4006 return getCSSPropertyValuesFor4SidesShorthand(scrollPaddingShorthand()); 3976 4007 case CSSPropertyScrollPaddingBottom: 3977 4008 return zoomAdjustedPixelValueForLength(style.scrollPaddingBottom(), style); … … 4253 4284 } 4254 4285 4255 RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand& shorthand) 4286 RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand(const StylePropertyShorthand& shorthand) 4287 { 4288 auto list = CSSValueList::createSpaceSeparated(); 4289 4290 // Assume the properties are in the usual order start, end. 4291 auto startValue = propertyValue(shorthand.properties()[0], DoNotUpdateLayout); 4292 auto endValue = propertyValue(shorthand.properties()[1], DoNotUpdateLayout); 4293 4294 // All 2 properties must be specified. 4295 if (!startValue || !endValue) 4296 return nullptr; 4297 4298 bool showEnd = !compareCSSValuePtr(startValue, endValue); 4299 4300 list->append(startValue.releaseNonNull()); 4301 if (showEnd) 4302 list->append(endValue.releaseNonNull()); 4303 4304 return WTFMove(list); 4305 } 4306 4307 RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand(const StylePropertyShorthand& shorthand) 4256 4308 { 4257 4309 auto list = CSSValueList::createSpaceSeparated(); -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h
r239535 r240251 93 93 94 94 Ref<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&); 95 RefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&); 95 RefPtr<CSSValueList> getCSSPropertyValuesFor2SidesShorthand(const StylePropertyShorthand&); 96 RefPtr<CSSValueList> getCSSPropertyValuesFor4SidesShorthand(const StylePropertyShorthand&); 96 97 Ref<CSSValueList> getBackgroundShorthandValue(); 97 98 Ref<CSSValueList> getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&); -
trunk/Source/WebCore/css/CSSProperties.json
r239978 r240251 125 125 "generate code when the macro define is not enabled.", 126 126 "", 127 "* runtime-flag:", 128 "The name of the flag on RuntimeEnabledFeatures (e.g. \"cssLogical\")", 129 "that conditionally enables the property.", 130 "", 127 131 "2. Lesser known capabilities of this file format", 128 132 "", … … 1193 1197 } 1194 1198 }, 1199 "border-block": { 1200 "codegen-properties": { 1201 "runtime-flag": "cssLogical", 1202 "longhands": [ 1203 "border-block-start-color", 1204 "border-block-start-style", 1205 "border-block-start-width", 1206 "border-block-end-color", 1207 "border-block-end-style", 1208 "border-block-end-width" 1209 ] 1210 }, 1211 "specification": { 1212 "category": "css-logical-props", 1213 "url": "https://www.w3.org/TR/css-logical/#border-shorthands" 1214 } 1215 }, 1216 "border-block-color": { 1217 "codegen-properties": { 1218 "runtime-flag": "cssLogical", 1219 "longhands": [ 1220 "border-block-start-color", 1221 "border-block-end-color" 1222 ] 1223 }, 1224 "specification": { 1225 "category": "css-logical-props", 1226 "url": "https://www.w3.org/TR/css-logical/#border-color" 1227 } 1228 }, 1195 1229 "border-block-end": { 1196 1230 "codegen-properties": { … … 1321 1355 } 1322 1356 }, 1357 "border-block-style": { 1358 "codegen-properties": { 1359 "runtime-flag": "cssLogical", 1360 "longhands": [ 1361 "border-block-start-style", 1362 "border-block-end-style" 1363 ] 1364 }, 1365 "specification": { 1366 "category": "css-logical-props", 1367 "url": "https://www.w3.org/TR/css-logical/#border-style" 1368 } 1369 }, 1370 "border-block-width": { 1371 "codegen-properties": { 1372 "runtime-flag": "cssLogical", 1373 "longhands": [ 1374 "border-block-start-width", 1375 "border-block-end-width" 1376 ] 1377 }, 1378 "specification": { 1379 "category": "css-logical-props", 1380 "url": "https://www.w3.org/TR/css-logical/#border-width" 1381 } 1382 }, 1323 1383 "border-bottom": { 1324 1384 "codegen-properties": { … … 1490 1550 } 1491 1551 }, 1552 "border-inline": { 1553 "codegen-properties": { 1554 "runtime-flag": "cssLogical", 1555 "longhands": [ 1556 "border-inline-start-color", 1557 "border-inline-start-style", 1558 "border-inline-start-width", 1559 "border-inline-end-color", 1560 "border-inline-end-style", 1561 "border-inline-end-width" 1562 ] 1563 }, 1564 "specification": { 1565 "category": "css-logical-props", 1566 "url": "https://www.w3.org/TR/css-logical/#border-shorthands" 1567 } 1568 }, 1569 "border-inline-color": { 1570 "codegen-properties": { 1571 "runtime-flag": "cssLogical", 1572 "longhands": [ 1573 "border-inline-start-color", 1574 "border-inline-end-color" 1575 ] 1576 }, 1577 "specification": { 1578 "category": "css-logical-props", 1579 "url": "https://www.w3.org/TR/css-logical/#border-color" 1580 } 1581 }, 1492 1582 "border-inline-end": { 1493 1583 "codegen-properties": { … … 1612 1702 ], 1613 1703 "skip-builder": true 1704 }, 1705 "specification": { 1706 "category": "css-logical-props", 1707 "url": "https://www.w3.org/TR/css-logical/#border-width" 1708 } 1709 }, 1710 "border-inline-style": { 1711 "codegen-properties": { 1712 "runtime-flag": "cssLogical", 1713 "longhands": [ 1714 "border-inline-start-style", 1715 "border-inline-end-style" 1716 ] 1717 }, 1718 "specification": { 1719 "category": "css-logical-props", 1720 "url": "https://www.w3.org/TR/css-logical/#border-style" 1721 } 1722 }, 1723 "border-inline-width": { 1724 "codegen-properties": { 1725 "runtime-flag": "cssLogical", 1726 "longhands": [ 1727 "border-inline-start-width", 1728 "border-inline-end-width" 1729 ] 1614 1730 }, 1615 1731 "specification": { … … 2648 2764 } 2649 2765 }, 2650 "margin-block-end": { 2651 "codegen-properties": { 2652 "aliases": [ 2653 "-webkit-margin-after" 2654 ], 2655 "skip-builder": true 2766 "margin-block": { 2767 "codegen-properties": { 2768 "runtime-flag": "cssLogical", 2769 "longhands": [ 2770 "margin-block-start", 2771 "margin-block-end" 2772 ] 2656 2773 }, 2657 2774 "specification": { … … 2660 2777 } 2661 2778 }, 2662 "margin-block- start": {2663 "codegen-properties": { 2664 "aliases": [ 2665 "-webkit-margin- before"2779 "margin-block-end": { 2780 "codegen-properties": { 2781 "aliases": [ 2782 "-webkit-margin-after" 2666 2783 ], 2667 2784 "skip-builder": true … … 2672 2789 } 2673 2790 }, 2791 "margin-block-start": { 2792 "codegen-properties": { 2793 "aliases": [ 2794 "-webkit-margin-before" 2795 ], 2796 "skip-builder": true 2797 }, 2798 "specification": { 2799 "category": "css-logical-props", 2800 "url": "https://www.w3.org/TR/css-logical/#margin-properties" 2801 } 2802 }, 2674 2803 "margin-bottom": { 2675 2804 "codegen-properties": { … … 2680 2809 "category": "css-22", 2681 2810 "url": "https://www.w3.org/TR/CSS22/box.html#propdef-margin-bottom" 2811 } 2812 }, 2813 "margin-inline": { 2814 "codegen-properties": { 2815 "runtime-flag": "cssLogical", 2816 "longhands": [ 2817 "margin-inline-start", 2818 "margin-inline-end" 2819 ] 2820 }, 2821 "specification": { 2822 "category": "css-logical-props", 2823 "url": "https://www.w3.org/TR/css-logical/#margin-properties" 2682 2824 } 2683 2825 }, … … 3068 3210 } 3069 3211 }, 3070 "padding-block-end": { 3071 "codegen-properties": { 3072 "aliases": [ 3073 "-webkit-padding-after" 3074 ], 3075 "skip-builder": true 3212 "padding-block": { 3213 "codegen-properties": { 3214 "runtime-flag": "cssLogical", 3215 "longhands": [ 3216 "padding-block-start", 3217 "padding-block-end" 3218 ] 3076 3219 }, 3077 3220 "specification": { … … 3080 3223 } 3081 3224 }, 3082 "padding-block- start": {3083 "codegen-properties": { 3084 "aliases": [ 3085 "-webkit-padding- before"3225 "padding-block-end": { 3226 "codegen-properties": { 3227 "aliases": [ 3228 "-webkit-padding-after" 3086 3229 ], 3087 3230 "skip-builder": true … … 3092 3235 } 3093 3236 }, 3237 "padding-block-start": { 3238 "codegen-properties": { 3239 "aliases": [ 3240 "-webkit-padding-before" 3241 ], 3242 "skip-builder": true 3243 }, 3244 "specification": { 3245 "category": "css-logical-props", 3246 "url": "https://www.w3.org/TR/css-logical/#padding-properties" 3247 } 3248 }, 3094 3249 "padding-bottom": { 3095 3250 "codegen-properties": { … … 3100 3255 "category": "css-22", 3101 3256 "url": "https://www.w3.org/TR/CSS22/box.html#propdef-padding-bottom" 3257 } 3258 }, 3259 "padding-inline": { 3260 "codegen-properties": { 3261 "runtime-flag": "cssLogical", 3262 "longhands": [ 3263 "padding-inline-start", 3264 "padding-inline-end" 3265 ] 3266 }, 3267 "specification": { 3268 "category": "css-logical-props", 3269 "url": "https://www.w3.org/TR/css-logical/#padding-properties" 3102 3270 } 3103 3271 }, -
trunk/Source/WebCore/css/CSSStyleDeclaration.cpp
r239427 r240251 242 242 auto* hashTableEntry = findProperty(name, outputLength); 243 243 if (auto propertyID = hashTableEntry ? hashTableEntry->id : 0) { 244 propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix; 245 propertyInfo.propertyID = static_cast<CSSPropertyID>(propertyID); 246 propertyInfoCache.get().add(propertyNameString, propertyInfo); 244 auto id = static_cast<CSSPropertyID>(propertyID); 245 if (isEnabledCSSProperty(id)) { 246 propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix; 247 propertyInfo.propertyID = id; 248 propertyInfoCache.get().add(propertyNameString, propertyInfo); 249 } 247 250 } 248 251 return propertyInfo; … … 309 312 Vector<AtomicString> CSSStyleDeclaration::supportedPropertyNames() const 310 313 { 314 static unsigned numNames = 0; 311 315 static const AtomicString* const cssPropertyNames = [] { 312 316 String names[numCSSProperties]; 313 for (int i = 0; i < numCSSProperties; ++i) 314 names[i] = getJSPropertyName(static_cast<CSSPropertyID>(firstCSSProperty + i)); 315 std::sort(&names[0], &names[numCSSProperties], WTF::codePointCompareLessThan); 316 auto* identifiers = new AtomicString[numCSSProperties]; 317 for (int i = 0; i < numCSSProperties; ++i) 317 for (int i = 0; i < numCSSProperties; ++i) { 318 CSSPropertyID id = static_cast<CSSPropertyID>(firstCSSProperty + i); 319 if (isEnabledCSSProperty(id)) 320 names[numNames++] = getJSPropertyName(id); 321 } 322 std::sort(&names[0], &names[numNames], WTF::codePointCompareLessThan); 323 auto* identifiers = new AtomicString[numNames]; 324 for (unsigned i = 0; i < numNames; ++i) 318 325 identifiers[i] = names[i]; 319 326 return identifiers; … … 321 328 322 329 Vector<AtomicString> result; 323 result.reserveInitialCapacity(num CSSProperties);324 325 for (unsigned i = 0; i < num CSSProperties; ++i)330 result.reserveInitialCapacity(numNames); 331 332 for (unsigned i = 0; i < numNames; ++i) 326 333 result.uncheckedAppend(cssPropertyNames[i]); 327 334 -
trunk/Source/WebCore/css/StyleProperties.cpp
r239427 r240251 151 151 return getLayeredShorthandValue(backgroundShorthand()); 152 152 case CSSPropertyBorder: 153 return borderPropertyValue( );153 return borderPropertyValue(borderWidthShorthand(), borderStyleShorthand(), borderColorShorthand()); 154 154 case CSSPropertyBorderTop: 155 155 return getShorthandValue(borderTopShorthand()); … … 160 160 case CSSPropertyBorderLeft: 161 161 return getShorthandValue(borderLeftShorthand()); 162 case CSSPropertyBorderBlock: 163 return borderPropertyValue(borderBlockWidthShorthand(), borderBlockStyleShorthand(), borderBlockColorShorthand()); 164 case CSSPropertyBorderBlockColor: 165 return get2Values(borderBlockColorShorthand()); 166 case CSSPropertyBorderBlockStyle: 167 return get2Values(borderBlockStyleShorthand()); 168 case CSSPropertyBorderBlockWidth: 169 return get2Values(borderBlockWidthShorthand()); 162 170 case CSSPropertyBorderBlockStart: 163 171 return getShorthandValue(borderBlockStartShorthand()); 164 172 case CSSPropertyBorderBlockEnd: 165 173 return getShorthandValue(borderBlockEndShorthand()); 174 case CSSPropertyBorderInline: 175 return borderPropertyValue(borderInlineWidthShorthand(), borderInlineStyleShorthand(), borderInlineColorShorthand()); 176 case CSSPropertyBorderInlineColor: 177 return get2Values(borderInlineColorShorthand()); 178 case CSSPropertyBorderInlineStyle: 179 return get2Values(borderInlineStyleShorthand()); 180 case CSSPropertyBorderInlineWidth: 181 return get2Values(borderInlineWidthShorthand()); 166 182 case CSSPropertyBorderInlineStart: 167 183 return getShorthandValue(borderInlineStartShorthand()); … … 204 220 case CSSPropertyMargin: 205 221 return get4Values(marginShorthand()); 222 case CSSPropertyMarginBlock: 223 return get2Values(marginBlockShorthand()); 224 case CSSPropertyMarginInline: 225 return get2Values(marginInlineShorthand()); 206 226 case CSSPropertyWebkitMarginCollapse: 207 227 return getShorthandValue(webkitMarginCollapseShorthand()); … … 210 230 case CSSPropertyPadding: 211 231 return get4Values(paddingShorthand()); 232 case CSSPropertyPaddingBlock: 233 return get2Values(paddingBlockShorthand()); 234 case CSSPropertyPaddingInline: 235 return get2Values(paddingInlineShorthand()); 212 236 case CSSPropertyTransition: 213 237 return getLayeredShorthandValue(transitionShorthand()); … … 357 381 } 358 382 383 String StyleProperties::get2Values(const StylePropertyShorthand& shorthand) const 384 { 385 // Assume the properties are in the usual order start, end. 386 int startValueIndex = findPropertyIndex(shorthand.properties()[0]); 387 int endValueIndex = findPropertyIndex(shorthand.properties()[1]); 388 389 if (startValueIndex == -1 || endValueIndex == -1) 390 return { }; 391 392 auto start = propertyAt(startValueIndex); 393 auto end = propertyAt(endValueIndex); 394 395 // All 2 properties must be specified. 396 if (!start.value() || !end.value()) 397 return { }; 398 399 // Important flags must be the same 400 if (start.isImportant() != end.isImportant()) 401 return { }; 402 403 if (start.isInherited() && end.isInherited()) 404 return getValueName(CSSValueInherit); 405 406 if (start.value()->isInitialValue() || end.value()->isInitialValue()) { 407 if (start.value()->isInitialValue() && end.value()->isInitialValue() && !start.isImplicit()) 408 return getValueName(CSSValueInitial); 409 return { }; 410 } 411 412 StringBuilder result; 413 result.append(start.value()->cssText()); 414 if (!start.value()->equals(*end.value())) { 415 result.append(' '); 416 result.append(end.value()->cssText()); 417 } 418 return result.toString(); 419 } 420 359 421 String StyleProperties::get4Values(const StylePropertyShorthand& shorthand) const 360 422 { … … 622 684 } 623 685 624 String StyleProperties::borderPropertyValue( ) const625 { 626 const StylePropertyShorthand properties[3] = { borderWidthShorthand(), borderStyleShorthand(), borderColorShorthand()};686 String StyleProperties::borderPropertyValue(const StylePropertyShorthand& width, const StylePropertyShorthand& style, const StylePropertyShorthand& color) const 687 { 688 const StylePropertyShorthand properties[3] = { width, style, color }; 627 689 String commonValue; 628 690 StringBuilder result; … … 764 826 bool MutableStyleProperties::setProperty(CSSPropertyID propertyID, const String& value, bool important, CSSParserContext parserContext) 765 827 { 828 if (!isEnabledCSSProperty(propertyID)) 829 return false; 830 766 831 // Setting the value to an empty string just removes the property in both IE and Gecko. 767 832 // Setting it to null seems to produce less consistent results, but we treat it just the same. … … 910 975 CSSPropertyID shorthandPropertyID = CSSPropertyInvalid; 911 976 CSSPropertyID borderFallbackShorthandProperty = CSSPropertyInvalid; 977 CSSPropertyID borderBlockFallbackShorthandProperty = CSSPropertyInvalid; 978 CSSPropertyID borderInlineFallbackShorthandProperty = CSSPropertyInvalid; 912 979 String value; 980 auto serializeBorderShorthand = [&] (const CSSPropertyID borderProperty, const CSSPropertyID fallbackProperty) { 981 // FIXME: Deal with cases where only some of border sides are specified. 982 ASSERT(borderProperty - firstCSSProperty < shorthandPropertyAppeared.size()); 983 if (!shorthandPropertyAppeared[borderProperty - firstCSSProperty] && isEnabledCSSProperty(borderProperty)) { 984 value = getPropertyValue(borderProperty); 985 if (value.isNull()) 986 shorthandPropertyAppeared.set(borderProperty - firstCSSProperty); 987 else 988 shorthandPropertyID = borderProperty; 989 } else if (shorthandPropertyUsed[borderProperty - firstCSSProperty]) 990 shorthandPropertyID = borderProperty; 991 if (!shorthandPropertyID) 992 shorthandPropertyID = fallbackProperty; 993 }; 913 994 914 995 if (property.value() && property.value()->isPendingSubstitutionValue()) { … … 960 1041 if (!borderFallbackShorthandProperty) 961 1042 borderFallbackShorthandProperty = CSSPropertyBorderColor; 962 963 // FIXME: Deal with cases where only some of border-(top|right|bottom|left) are specified. 964 ASSERT(CSSPropertyBorder - firstCSSProperty < shorthandPropertyAppeared.size()); 965 if (!shorthandPropertyAppeared[CSSPropertyBorder - firstCSSProperty]) { 966 value = borderPropertyValue(); 967 if (value.isNull()) 968 shorthandPropertyAppeared.set(CSSPropertyBorder - firstCSSProperty); 969 else 970 shorthandPropertyID = CSSPropertyBorder; 971 } else if (shorthandPropertyUsed[CSSPropertyBorder - firstCSSProperty]) 972 shorthandPropertyID = CSSPropertyBorder; 973 if (!shorthandPropertyID) 974 shorthandPropertyID = borderFallbackShorthandProperty; 1043 serializeBorderShorthand(CSSPropertyBorder, borderFallbackShorthandProperty); 1044 break; 1045 case CSSPropertyBorderBlockStartWidth: 1046 case CSSPropertyBorderBlockEndWidth: 1047 if (!borderBlockFallbackShorthandProperty) 1048 borderBlockFallbackShorthandProperty = CSSPropertyBorderBlockWidth; 1049 FALLTHROUGH; 1050 case CSSPropertyBorderBlockStartStyle: 1051 case CSSPropertyBorderBlockEndStyle: 1052 if (!borderBlockFallbackShorthandProperty) 1053 borderBlockFallbackShorthandProperty = CSSPropertyBorderBlockStyle; 1054 FALLTHROUGH; 1055 case CSSPropertyBorderBlockStartColor: 1056 case CSSPropertyBorderBlockEndColor: 1057 if (!borderBlockFallbackShorthandProperty) 1058 borderBlockFallbackShorthandProperty = CSSPropertyBorderBlockColor; 1059 serializeBorderShorthand(CSSPropertyBorderBlock, borderBlockFallbackShorthandProperty); 1060 break; 1061 case CSSPropertyBorderInlineStartWidth: 1062 case CSSPropertyBorderInlineEndWidth: 1063 if (!borderInlineFallbackShorthandProperty) 1064 borderInlineFallbackShorthandProperty = CSSPropertyBorderInlineWidth; 1065 FALLTHROUGH; 1066 case CSSPropertyBorderInlineStartStyle: 1067 case CSSPropertyBorderInlineEndStyle: 1068 if (!borderInlineFallbackShorthandProperty) 1069 borderInlineFallbackShorthandProperty = CSSPropertyBorderInlineStyle; 1070 FALLTHROUGH; 1071 case CSSPropertyBorderInlineStartColor: 1072 case CSSPropertyBorderInlineEndColor: 1073 if (!borderInlineFallbackShorthandProperty) 1074 borderInlineFallbackShorthandProperty = CSSPropertyBorderInlineColor; 1075 serializeBorderShorthand(CSSPropertyBorderInline, borderInlineFallbackShorthandProperty); 975 1076 break; 976 1077 case CSSPropertyWebkitBorderHorizontalSpacing: … … 997 1098 shorthandPropertyID = CSSPropertyMargin; 998 1099 break; 1100 case CSSPropertyMarginBlockStart: 1101 case CSSPropertyMarginBlockEnd: 1102 shorthandPropertyID = CSSPropertyMarginBlock; 1103 break; 1104 case CSSPropertyMarginInlineStart: 1105 case CSSPropertyMarginInlineEnd: 1106 shorthandPropertyID = CSSPropertyMarginInline; 1107 break; 999 1108 case CSSPropertyOutlineWidth: 1000 1109 case CSSPropertyOutlineStyle: … … 1011 1120 case CSSPropertyPaddingLeft: 1012 1121 shorthandPropertyID = CSSPropertyPadding; 1122 break; 1123 case CSSPropertyPaddingBlockStart: 1124 case CSSPropertyPaddingBlockEnd: 1125 shorthandPropertyID = CSSPropertyPaddingBlock; 1126 break; 1127 case CSSPropertyPaddingInlineStart: 1128 case CSSPropertyPaddingInlineEnd: 1129 shorthandPropertyID = CSSPropertyPaddingInline; 1013 1130 break; 1014 1131 #if ENABLE(CSS_SCROLL_SNAP) … … 1067 1184 1068 1185 unsigned shortPropertyIndex = shorthandPropertyID - firstCSSProperty; 1069 if (shorthandPropertyID ) {1186 if (shorthandPropertyID && isEnabledCSSProperty(shorthandPropertyID)) { 1070 1187 ASSERT(shortPropertyIndex < shorthandPropertyUsed.size()); 1071 1188 if (shorthandPropertyUsed[shortPropertyIndex]) -
trunk/Source/WebCore/css/StyleProperties.h
r239427 r240251 163 163 String getCommonValue(const StylePropertyShorthand&) const; 164 164 String getAlignmentShorthandValue(const StylePropertyShorthand&) const; 165 String borderPropertyValue( ) const;165 String borderPropertyValue(const StylePropertyShorthand&, const StylePropertyShorthand&, const StylePropertyShorthand&) const; 166 166 String getLayeredShorthandValue(const StylePropertyShorthand&) const; 167 String get2Values(const StylePropertyShorthand&) const; 167 168 String get4Values(const StylePropertyShorthand&) const; 168 169 String borderSpacingValue(const StylePropertyShorthand&) const; -
trunk/Source/WebCore/css/makeprop.pl
r239255 r240251 61 61 my @names; 62 62 my @internalProprerties; 63 my %runtimeFlags; 63 64 my $numPredefinedProperties = 2; 64 65 my %nameIsInherited; … … 200 201 # internal-only properties exist to make it easier to parse compound properties (e.g. background-repeat) as if they were shorthands. 201 202 push @internalProprerties, $name 203 } elsif ($codegenOptionName eq "runtime-flag") { 204 $runtimeFlags{$name} = $codegenProperties->{"runtime-flag"}; 202 205 } else { 203 206 die "Unrecognized codegen property \"$codegenOptionName\" for $name property."; … … 244 247 #include \"CSSPropertyNames.h\" 245 248 #include \"HashTools.h\" 249 #include "RuntimeEnabledFeatures.h" 246 250 #include <wtf/ASCIICType.h> 247 251 #include <wtf/text/AtomicString.h> … … 321 325 } 322 326 327 bool isEnabledCSSProperty(const CSSPropertyID id) 328 { 329 switch (id) { 330 EOF 331 332 foreach my $name (keys %runtimeFlags) { 333 print GPERF " case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n"; 334 print GPERF " return RuntimeEnabledFeatures::sharedFeatures()." . $runtimeFlags{$name} . "Enabled();\n"; 335 } 336 337 print GPERF << "EOF"; 338 default: 339 return true; 340 } 341 } 342 323 343 const char* getPropertyName(CSSPropertyID id) 324 344 { … … 466 486 467 487 bool isInternalCSSProperty(const CSSPropertyID); 488 bool isEnabledCSSProperty(const CSSPropertyID); 468 489 const char* getPropertyName(CSSPropertyID); 469 490 const WTF::AtomicString& getPropertyNameAtomicString(CSSPropertyID id); -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r239978 r240251 147 147 148 148 const Property* hashTableEntry = findProperty(name, length); 149 return hashTableEntry ? static_cast<CSSPropertyID>(hashTableEntry->id) : CSSPropertyInvalid; 149 if (hashTableEntry) { 150 auto propertyID = static_cast<CSSPropertyID>(hashTableEntry->id); 151 if (isEnabledCSSProperty(propertyID)) 152 return propertyID; 153 } 154 return CSSPropertyInvalid; 150 155 } 151 156 … … 228 233 void CSSPropertyParser::addProperty(CSSPropertyID property, CSSPropertyID currentShorthand, Ref<CSSValue>&& value, bool important, bool implicit) 229 234 { 235 if (!isEnabledCSSProperty(property)) 236 return; 237 230 238 int shorthandIndex = 0; 231 239 bool setFromShorthand = false; … … 4991 4999 } 4992 5000 4993 bool CSSPropertyParser::consumeBorder(bool important) 4994 { 4995 RefPtr<CSSValue> width; 4996 RefPtr<CSSValue> style; 4997 RefPtr<CSSValue> color; 4998 5001 bool CSSPropertyParser::consumeBorder(RefPtr<CSSValue>& width, RefPtr<CSSValue>& style, RefPtr<CSSValue>& color) 5002 { 4999 5003 while (!width || !style || !color) { 5000 5004 if (!width) { … … 5026 5030 color = CSSValuePool::singleton().createImplicitInitialValue(); 5027 5031 5028 addExpandedPropertyForValue(CSSPropertyBorderWidth, width.releaseNonNull(), important);5029 addExpandedPropertyForValue(CSSPropertyBorderStyle, style.releaseNonNull(), important);5030 addExpandedPropertyForValue(CSSPropertyBorderColor, color.releaseNonNull(), important);5031 addExpandedPropertyForValue(CSSPropertyBorderImage, CSSValuePool::singleton().createImplicitInitialValue(), important);5032 5033 5032 return m_range.atEnd(); 5034 5033 } 5035 5034 5036 bool CSSPropertyParser::consume4Values(const StylePropertyShorthand& shorthand, bool important) 5035 bool CSSPropertyParser::consume2ValueShorthand(const StylePropertyShorthand& shorthand, bool important) 5036 { 5037 ASSERT(shorthand.length() == 2); 5038 const CSSPropertyID* longhands = shorthand.properties(); 5039 RefPtr<CSSValue> start = parseSingleValue(longhands[0], shorthand.id()); 5040 if (!start) 5041 return false; 5042 5043 RefPtr<CSSValue> end = parseSingleValue(longhands[1], shorthand.id()); 5044 bool endImplicit = !end; 5045 if (endImplicit) 5046 end = start; 5047 addProperty(longhands[0], shorthand.id(), start.releaseNonNull(), important); 5048 addProperty(longhands[1], shorthand.id(), end.releaseNonNull(), important, endImplicit); 5049 5050 return m_range.atEnd(); 5051 } 5052 5053 bool CSSPropertyParser::consume4ValueShorthand(const StylePropertyShorthand& shorthand, bool important) 5037 5054 { 5038 5055 ASSERT(shorthand.length() == 4); … … 5732 5749 return consumeShorthandGreedily(webkitTextDecorationShorthand(), important); 5733 5750 case CSSPropertyMargin: 5734 return consume4Values(marginShorthand(), important); 5751 return consume4ValueShorthand(marginShorthand(), important); 5752 case CSSPropertyMarginBlock: 5753 return consume2ValueShorthand(marginBlockShorthand(), important); 5754 case CSSPropertyMarginInline: 5755 return consume2ValueShorthand(marginInlineShorthand(), important); 5735 5756 case CSSPropertyPadding: 5736 return consume4Values(paddingShorthand(), important); 5757 return consume4ValueShorthand(paddingShorthand(), important); 5758 case CSSPropertyPaddingBlock: 5759 return consume2ValueShorthand(paddingBlockShorthand(), important); 5760 case CSSPropertyPaddingInline: 5761 return consume2ValueShorthand(paddingInlineShorthand(), important); 5737 5762 #if ENABLE(CSS_SCROLL_SNAP) 5738 5763 case CSSPropertyScrollSnapMargin: 5739 return consume4Value s(scrollSnapMarginShorthand(), important);5764 return consume4ValueShorthand(scrollSnapMarginShorthand(), important); 5740 5765 case CSSPropertyScrollPadding: 5741 return consume4Value s(scrollPaddingShorthand(), important);5766 return consume4ValueShorthand(scrollPaddingShorthand(), important); 5742 5767 #endif 5743 5768 case CSSPropertyWebkitTextEmphasis: … … 5745 5770 case CSSPropertyOutline: 5746 5771 return consumeShorthandGreedily(outlineShorthand(), important); 5772 case CSSPropertyBorderInline: { 5773 RefPtr<CSSValue> width; 5774 RefPtr<CSSValue> style; 5775 RefPtr<CSSValue> color; 5776 if (!consumeBorder(width, style, color)) 5777 return false; 5778 5779 addExpandedPropertyForValue(CSSPropertyBorderInlineWidth, width.releaseNonNull(), important); 5780 addExpandedPropertyForValue(CSSPropertyBorderInlineStyle, style.releaseNonNull(), important); 5781 addExpandedPropertyForValue(CSSPropertyBorderInlineColor, color.releaseNonNull(), important); 5782 return true; 5783 } 5784 case CSSPropertyBorderInlineColor: 5785 return consume2ValueShorthand(borderInlineColorShorthand(), important); 5786 case CSSPropertyBorderInlineStyle: 5787 return consume2ValueShorthand(borderInlineStyleShorthand(), important); 5788 case CSSPropertyBorderInlineWidth: 5789 return consume2ValueShorthand(borderInlineWidthShorthand(), important); 5747 5790 case CSSPropertyBorderInlineStart: 5748 5791 return consumeShorthandGreedily(borderInlineStartShorthand(), important); 5749 5792 case CSSPropertyBorderInlineEnd: 5750 5793 return consumeShorthandGreedily(borderInlineEndShorthand(), important); 5794 case CSSPropertyBorderBlock: { 5795 RefPtr<CSSValue> width; 5796 RefPtr<CSSValue> style; 5797 RefPtr<CSSValue> color; 5798 if (!consumeBorder(width, style, color)) 5799 return false; 5800 5801 addExpandedPropertyForValue(CSSPropertyBorderBlockWidth, width.releaseNonNull(), important); 5802 addExpandedPropertyForValue(CSSPropertyBorderBlockStyle, style.releaseNonNull(), important); 5803 addExpandedPropertyForValue(CSSPropertyBorderBlockColor, color.releaseNonNull(), important); 5804 return true; 5805 } 5806 case CSSPropertyBorderBlockColor: 5807 return consume2ValueShorthand(borderBlockColorShorthand(), important); 5808 case CSSPropertyBorderBlockStyle: 5809 return consume2ValueShorthand(borderBlockStyleShorthand(), important); 5810 case CSSPropertyBorderBlockWidth: 5811 return consume2ValueShorthand(borderBlockWidthShorthand(), important); 5751 5812 case CSSPropertyBorderBlockStart: 5752 5813 return consumeShorthandGreedily(borderBlockStartShorthand(), important); … … 5786 5847 } 5787 5848 case CSSPropertyBorderColor: 5788 return consume4Value s(borderColorShorthand(), important);5849 return consume4ValueShorthand(borderColorShorthand(), important); 5789 5850 case CSSPropertyBorderStyle: 5790 return consume4Value s(borderStyleShorthand(), important);5851 return consume4ValueShorthand(borderStyleShorthand(), important); 5791 5852 case CSSPropertyBorderWidth: 5792 return consume4Value s(borderWidthShorthand(), important);5853 return consume4ValueShorthand(borderWidthShorthand(), important); 5793 5854 case CSSPropertyBorderTop: 5794 5855 return consumeShorthandGreedily(borderTopShorthand(), important); … … 5799 5860 case CSSPropertyBorderLeft: 5800 5861 return consumeShorthandGreedily(borderLeftShorthand(), important); 5801 case CSSPropertyBorder: 5802 return consumeBorder(important); 5862 case CSSPropertyBorder: { 5863 RefPtr<CSSValue> width; 5864 RefPtr<CSSValue> style; 5865 RefPtr<CSSValue> color; 5866 if (!consumeBorder(width, style, color)) 5867 return false; 5868 5869 addExpandedPropertyForValue(CSSPropertyBorderWidth, width.releaseNonNull(), important); 5870 addExpandedPropertyForValue(CSSPropertyBorderStyle, style.releaseNonNull(), important); 5871 addExpandedPropertyForValue(CSSPropertyBorderColor, color.releaseNonNull(), important); 5872 addExpandedPropertyForValue(CSSPropertyBorderImage, CSSValuePool::singleton().createImplicitInitialValue(), important); 5873 return true; 5874 } 5803 5875 case CSSPropertyBorderImage: 5804 5876 return consumeBorderImage(property, important); -
trunk/Source/WebCore/css/parser/CSSPropertyParser.h
r238262 r240251 70 70 void addExpandedPropertyForValue(CSSPropertyID propId, Ref<CSSValue>&&, bool); 71 71 72 bool consumeBorder( bool important);72 bool consumeBorder(RefPtr<CSSValue>& width, RefPtr<CSSValue>& style, RefPtr<CSSValue>& color); 73 73 74 74 bool parseShorthand(CSSPropertyID, bool important); 75 75 bool consumeShorthandGreedily(const StylePropertyShorthand&, bool important); 76 bool consume4Values(const StylePropertyShorthand&, bool important); 76 bool consume2ValueShorthand(const StylePropertyShorthand&, bool important); 77 bool consume4ValueShorthand(const StylePropertyShorthand&, bool important); 77 78 78 79 // Legacy parsing allows <string>s for animation-name -
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
r239273 r240251 720 720 for (int i = firstCSSProperty; i <= lastCSSProperty; ++i) { 721 721 CSSPropertyID propertyID = convertToCSSPropertyID(i); 722 if (isInternalCSSProperty(propertyID) )722 if (isInternalCSSProperty(propertyID) || !isEnabledCSSProperty(propertyID)) 723 723 continue; 724 724 … … 740 740 for (unsigned j = 0; j < shorthand.length(); ++j) { 741 741 CSSPropertyID longhandID = shorthand.properties()[j]; 742 longhands->addItem(getPropertyNameString(longhandID)); 742 if (isEnabledCSSProperty(longhandID)) 743 longhands->addItem(getPropertyNameString(longhandID)); 743 744 } 744 745 property->setLonghands(WTFMove(longhands)); -
trunk/Source/WebCore/page/RuntimeEnabledFeatures.h
r240129 r240251 338 338 bool systemPreviewEnabled() const { return m_systemPreviewEnabled; } 339 339 #endif 340 341 void setCSSLogicalEnabled(bool isEnabled) { m_CSSLogicalEnabled = isEnabled; } 342 bool cssLogicalEnabled() const { return m_CSSLogicalEnabled; } 340 343 341 344 WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); … … 512 515 bool m_undoManagerAPIEnabled { false }; 513 516 517 bool m_CSSLogicalEnabled { false }; 518 514 519 friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; 515 520 }; -
trunk/Source/WebKit/ChangeLog
r240250 r240251 1 2019-01-22 Oriol Brufau <obrufau@igalia.com> 2 3 [css-logical] Implement flow-relative margin, padding and border shorthands 4 https://bugs.webkit.org/show_bug.cgi?id=188697 5 6 Reviewed by Simon Fraser and Antti Koivisto. 7 8 Add a CSSLogicalEnabled runtime flag. 9 10 * Shared/WebPreferences.yaml: 11 1 12 2019-01-22 Frederic Wang <fwang@igalia.com> 2 13 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r240250 r240251 1536 1536 category: internal 1537 1537 webcoreBinding: RuntimeEnabledFeatures 1538 1539 CSSLogicalEnabled: 1540 type: bool 1541 defaultValue: false 1542 humanReadableName: "CSS Logical Properties and Values" 1543 humanReadableDescription: "Enable CSS Logical Properties and Values" 1544 webcoreBinding: RuntimeEnabledFeatures 1545 category: internal -
trunk/Source/WebKitLegacy/mac/ChangeLog
r240237 r240251 1 2019-01-22 Oriol Brufau <obrufau@igalia.com> 2 3 [css-logical] Implement flow-relative margin, padding and border shorthands 4 https://bugs.webkit.org/show_bug.cgi?id=188697 5 6 Reviewed by Simon Fraser and Antti Koivisto. 7 8 Add CSSLogicalEnabled runtime flag. 9 10 * WebView/WebPreferenceKeysPrivate.h: 11 * WebView/WebPreferences.mm: 12 (+[WebPreferences initialize]): 13 (-[WebPreferences cssLogicalEnabled]): 14 (-[WebPreferences setCSSLogicalEnabled:]): 15 * WebView/WebPreferencesPrivate.h: 16 * WebView/WebView.mm: 17 (-[WebView _preferencesChanged:]): 18 1 19 2019-01-15 Darin Adler <darin@apple.com> 2 20 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
r239470 r240251 264 264 #define WebKitServerTimingEnabledPreferenceKey @"WebKitServerTimingEnabled" 265 265 #define WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey @"WebKitSelectionAcrossShadowBoundariesEnabled" 266 #define WebKitCSSLogicalEnabledPreferenceKey @"WebKitCSSLogicalEnabled" -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
r239897 r240251 669 669 #endif 670 670 [NSNumber numberWithBool:YES], WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey, 671 [NSNumber numberWithBool:NO], WebKitCSSLogicalEnabledPreferenceKey, 671 672 #if ENABLE(INTERSECTION_OBSERVER) 672 673 @NO, WebKitIntersectionObserverEnabledPreferenceKey, … … 3379 3380 } 3380 3381 3382 - (BOOL)cssLogicalEnabled 3383 { 3384 return [self _boolValueForKey:WebKitCSSLogicalEnabledPreferenceKey]; 3385 } 3386 3387 - (void)setCSSLogicalEnabled:(BOOL)flag 3388 { 3389 [self _setBoolValue:flag forKey:WebKitCSSLogicalEnabledPreferenceKey]; 3390 } 3391 3381 3392 @end 3382 3393 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
r239470 r240251 582 582 - (void)setSelectionAcrossShadowBoundariesEnabled:(BOOL)flag; 583 583 - (BOOL)selectionAcrossShadowBoundariesEnabled; 584 585 - (void)setCSSLogicalEnabled:(BOOL)flag; 586 - (BOOL)cssLogicalEnabled; 584 587 585 588 @property (nonatomic) BOOL visualViewportEnabled; -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r240237 r240251 3078 3078 #endif 3079 3079 3080 RuntimeEnabledFeatures::sharedFeatures().setCSSLogicalEnabled([preferences cssLogicalEnabled]); 3081 3080 3082 settings.setHiddenPageDOMTimerThrottlingEnabled([preferences hiddenPageDOMTimerThrottlingEnabled]); 3081 3083 -
trunk/Tools/ChangeLog
r240245 r240251 1 2019-01-22 Oriol Brufau <obrufau@igalia.com> 2 3 [css-logical] Implement flow-relative margin, padding and border shorthands 4 https://bugs.webkit.org/show_bug.cgi?id=188697 5 6 Reviewed by Simon Fraser and Antti Koivisto. 7 8 * DumpRenderTree/TestOptions.cpp: 9 (TestOptions::TestOptions): 10 * DumpRenderTree/TestOptions.h: 11 * DumpRenderTree/mac/DumpRenderTree.mm: 12 (setWebPreferencesForTestOptions): 13 Allow tests to enable the CSSLogicalEnabled flag in WK1. 14 15 * Scripts/webkitpy/style/checkers/jsonchecker.py: 16 (JSONCSSPropertiesChecker.check_codegen_properties): 17 Allow CSS property definitions to have a 'runtime-flag' parameter which 18 disables the property when the specified runtime flag is disabled. 19 1 20 2019-01-21 Fujii Hironori <Hironori.Fujii@sony.com> 2 21 -
trunk/Tools/DumpRenderTree/TestOptions.cpp
r239470 r240251 108 108 else if (key == "experimental:WebGPUEnabled") 109 109 enableWebGPU = parseBooleanTestHeaderValue(value); 110 else if (key == "internal:CSSLogicalEnabled") 111 enableCSSLogical = parseBooleanTestHeaderValue(value); 110 112 pairStart = pairEnd + 1; 111 113 } -
trunk/Tools/DumpRenderTree/TestOptions.h
r239470 r240251 45 45 bool enableSelectionAcrossShadowBoundaries { true }; 46 46 bool enableWebGPU { false }; 47 bool enableCSSLogical { false }; 47 48 std::string jscOptions; 48 49 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r239496 r240251 1011 1011 preferences.selectionAcrossShadowBoundariesEnabled = options.enableSelectionAcrossShadowBoundaries; 1012 1012 preferences.webGPUEnabled = options.enableWebGPU; 1013 preferences.CSSLogicalEnabled = options.enableCSSLogical; 1013 1014 } 1014 1015 -
trunk/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py
r238262 r240251 289 289 'name-for-methods': self.validate_string, 290 290 'no-default-color': self.validate_boolean, 291 'runtime-flag': self.validate_string, 291 292 'setter': self.validate_string, 292 293 'skip-builder': self.validate_boolean,
Note: See TracChangeset
for help on using the changeset viewer.