Commit 6ad0d238 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

[css-typed-om] Add test for identifier normalization.

We add a test for identifier normalization that covers [1]. Note that
we're only testing that an <identifier> normalizes to a CSSKeywordValue
(hence the simple test). Testing of which properties normalizes to
CSSKeywordValue will be done in a separate test, as it is in a separate
part of the spec [2].

[1] https://drafts.css-houdini.org/css-typed-om-1/#normalize-ident
[2] https://drafts.css-houdini.org/css-typed-om-1/#stylevalue-normalization

Bug: 774887
Change-Id: Idc2c0bb1279389e1e7fd46373bea13ac9b5dd105
Reviewed-on: https://chromium-review.googlesource.com/765550
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: default avatarBugs Nash <bugsnash@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515889}
parent 353bb5ee
<!doctype html>
<meta charset="utf-8">
<title>Identifier normalization tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#normalize-ident">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<script>
'use strict';
test(() => {
assert_style_value_equals(CSSStyleValue.parse('width', 'auto'),
new CSSKeywordValue('auto'));
}, 'CSS identifiers are normalized from String to CSSKeywordValues');
test(() => {
assert_style_value_equals(
newDivWithStyle('width: auto').styleMap.get('width'),
new CSSKeywordValue('auto'));
}, 'CSS identifiers are normalized from CSSOM to CSSKeywordValues');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment