Chrome 70 converts top:0;bottom:0;left:0;right:0; to inset:0px; in cssRule.cssText
Reported by
julie...@gmail.com,
Aug 22
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3530.0 Safari/537.36 Steps to reproduce the problem: https://jsfiddle.net/julienv3/1saw7c5h/ var styleElement = document.createElement("style"); styleElement.textContent = "a{top:0;bottom:0;left:0;right:0;}"; document.body.appendChild(styleElement); alert(styleElement.sheet.cssRules[0].cssText); What is the expected behavior? styleElement.sheet.cssRules[0].cssText should be a { top: 0px; bottom: 0px; left: 0px; right: 0px; } What went wrong? styleElement.sheet.cssRules[0].cssText is a { inset: 0px; } and "inset" shows up as an "Unknown property name" in dev tools Did this work before? Yes Version 68.0.3440.106 (Official Build) (64-bit) Chrome version: 70.0.3530.0 Channel: canary OS Version: 10.0 Flash Version:
,
Aug 23
Thanks for filing the issue! Able to reproduce the issue on reported chrome version 70.0.3530.0 using Windows 10, Ububtu 14.04 and Mac 10.13.1. Bisect Information: -------------------- Good Build: 70.0.3525.0 Bad Build: 70.0.3526.0 You are probably looking for a change made after 584026 (known good), but no later than 584027 (first known bad). CHANGELOG URL: https://chromium.googlesource.com/chromium/src/+log/2bb33080f133dc1eecf472cadba2754afe97303f..0c130d2da974789f06b85241e188a88dc5c9f43f Suspecting: https://chromium.googlesource.com/chromium/src/+/0c130d2da974789f06b85241e188a88dc5c9f43f Review URL: https://chromium-review.googlesource.com/1176084 @Oriol Brufau: Please help in reassigning it to others, if this is not related to your change. Note: Adding RB-Stable as this seems to be a recent regression, please remove if not required.
,
Aug 23
I would say this is according to CSSOM, just like margins: $0.style.cssText = "margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;"; $0.style.cssText: // "margin: 0px;" However, I implemented `inset` behind an experimental flag, so it shouldn't happen when it's not enabled. I guess the serialization code should check the shorthands with IsEnabled()
,
Aug 23
,
Aug 24
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/37dedbdfc181d9f300e3bb03a9c88e0fbf7b3a8e commit 37dedbdfc181d9f300e3bb03a9c88e0fbf7b3a8e Author: Oriol Brufau <obrufau@igalia.com> Date: Fri Aug 24 15:02:07 2018 Prevent disabled shorthands from matching enabled longhands The cssText style serialization attempts to minimize the output by converting different longhand declarations into a single shorthand one. However, this shouldn't happen if the shorthand is disabled behind a runtime flag. BUG= 876913 TEST=fast/css/inset-serialize.html Change-Id: I264dff3352c452ab5407e34ccbcf94a519107a99 Reviewed-on: https://chromium-review.googlesource.com/1187102 Commit-Queue: Oriol Brufau <obrufau@igalia.com> Reviewed-by: Javier Fernandez <jfernandez@igalia.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#585839} [add] https://crrev.com/37dedbdfc181d9f300e3bb03a9c88e0fbf7b3a8e/third_party/WebKit/LayoutTests/fast/css/inset-serialize.html [modify] https://crrev.com/37dedbdfc181d9f300e3bb03a9c88e0fbf7b3a8e/third_party/blink/renderer/build/scripts/core/css/templates/style_property_shorthand.cc.tmpl [modify] https://crrev.com/37dedbdfc181d9f300e3bb03a9c88e0fbf7b3a8e/third_party/blink/renderer/platform/runtime_enabled_features.json5
,
Aug 24
|
||||
►
Sign in to add a comment |
||||
Comment 1 by susan.boorgula@chromium.org
, Aug 23