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/+/1692202Reviewed-by:Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#675708}
Showing
Please register or sign in to comment