Revision 03dbbcfeaff26b603303b524dd72f3a948d68b26 authored by Hwanseung Lee on 15 March 2018, 02:29:59 UTC, committed by Blink WPT Bot on 15 March 2018, 02:39:26 UTC
caption-side[1], isolation[2], unicode-bidi[3], writing-mode[4]
are added to support in whitelist.
and test file are also added.

[1]https://drafts.csswg.org/css-tables-3/#propdef-caption-side
[2]https://drafts.fxtf.org/compositing-2/#propdef-isolation
[3]https://drafts.csswg.org/css-writing-modes-4/#propdef-unicode-bidi
[4]https://drafts.csswg.org/css-writing-modes-4/#propdef-writing-mode

Bug: 820299
Change-Id: Ic0395565e77363b27ed7f93c861c4258396d766e
Reviewed-on: https://chromium-review.googlesource.com/962562
Reviewed-by: Darren Shen <shend@chromium.org>
Commit-Queue: Hwanseung Lee <hwanseung@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543286}
1 parent 5c32dfb
Raw File
registered-property-initial.html
<!DOCTYPE HTML>
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api/#dom-propertydescriptor-initialvalue" />
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api/#register-a-custom-property" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#target {
  background: var(--inherited-color);
  color: var(--non-inherited-color);
}
</style>
<div id=target></div>
<script>
CSS.registerProperty({name: '--length', syntax: '<length>', initialValue: 'calc(10px + 15px)'});
CSS.registerProperty({name: '--length-percentage', syntax: '<length-percentage>', initialValue: 'calc(1in + 10% + 4px)'});
CSS.registerProperty({name: '--inherited-color', syntax: '<color>', initialValue: 'pink', inherits: true});
CSS.registerProperty({name: '--non-inherited-color', syntax: '<color>', initialValue: 'purple'});
CSS.registerProperty({name: '--single-transform-list', syntax: '<transform-list>', initialValue: 'scale(calc(2 + 2))'});
CSS.registerProperty({name: '--multiple-transform-list', syntax: '<transform-list>', initialValue: 'scale(calc(2 + 1)) translateX(calc(3px + 1px))'});

test(function() {
    computedStyle = getComputedStyle(target);
    assert_equals(computedStyle.getPropertyValue('--length'), '25px');
    assert_equals(computedStyle.getPropertyValue('--length-percentage'), 'calc(100px + 10%)');
    assert_equals(computedStyle.getPropertyValue('--inherited-color'), 'pink');
    assert_equals(computedStyle.getPropertyValue('--non-inherited-color'), 'purple');
    assert_equals(computedStyle.getPropertyValue('--single-transform-list'), 'scale(4)');
    assert_equals(computedStyle.getPropertyValue('--multiple-transform-list'), 'scale(3) translateX(4px)');

    assert_equals(computedStyle.backgroundColor, 'rgb(255, 192, 203)');
    assert_equals(computedStyle.color, 'rgb(128, 0, 128)');
}, "Initial values of registered properties can be referenced when no custom properties are explicitly set.");
</script>
back to top