Bug 1565141 [wpt PR 17684] - Fix decision of whether to drop y value for 2d translate...
commit99e05ca5083200a863c5b8a21faea42ff3be999d
authorXiaocheng Hu <xiaochengh@chromium.org>
Mon, 22 Jul 2019 10:20:19 +0000 (22 10:20 +0000)
committerJames Graham <james@hoppipolla.co.uk>
Wed, 24 Jul 2019 12:33:37 +0000 (24 13:33 +0100)
treec074833e1ab75e5a04f1e1738744101dd6e8d08f
parent3df08145a8654be0d924f76962e3fc28213357f1
Bug 1565141 [wpt PR 17684] - Fix decision of whether to drop y value for 2d translate, a=testonly

Automatic update from web-platform-tests
Fix decision of whether to drop y value for 2d translate

Spec requires dropping y value for 2d translate if it's zero (*). The
current implementation contains bug that:

1. It rounds the value before checking, which results in incorrect
   dropping of '0.1px'

2. It calls DoubleValue() on calc() without type checking, while
   DoubleValue() on calc() is meaningless when the calc() doesn't
   resolve to a simple numeric value (e.g., 1px - 1%). This results in
   incorrect dropping of some calc().

Both are fixed by this patch.

This is also a preparation for adding DCHECK in DoubleValue() to ensure
that it's called only when calc() can be resolved into a simple numeric
value.

Bug: 979895
Change-Id: Ie8b846729b91e55006485a25fab0b65533983eac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692202
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675708}

--

wpt-commits: d947446c473a627ee68835eab7dcb928d85488bd
wpt-pr: 17684
testing/web-platform/tests/css/css-transforms/parsing/translate-parsing-valid.html