RESOLVED CONFIGURATION CHANGED 150553
Web Inspector: Editing CSS via Styles sidebar causes some white space to be stripped
https://bugs.webkit.org/show_bug.cgi?id=150553
Summary Web Inspector: Editing CSS via Styles sidebar causes some white space to be s...
Nikita Vasilyev
Reported 2015-10-25 22:30:23 PDT
Created attachment 264037 [details] [Animated GIF] Bug @media all { body { background-color: hsl(60, 80%, 90%); /* lightgoldenrodyellow */ } } Steps: 0. Inspect <body> 1. Change background-color to "white" 2. Go to the CSS resource Expected: @media all { body { background-color: white; /* lightgoldenrodyellow */ } } Actual: @media all { body { background-color: white; /* lightgoldenrodyellow */ } } Reduction: http://nv.github.io/webkit-inspector-bugs/css-media-rules/
Attachments
[Animated GIF] Bug (265.79 KB, image/gif)
2015-10-25 22:30 PDT, Nikita Vasilyev
no flags
Radar WebKit Bug Importer
Comment 1 2015-10-25 22:30:36 PDT
Devin Rousso
Comment 2 2015-10-27 12:45:42 PDT
I think I know why this is happening. I made the previous change to add support for proper whitespace prepending, but I don't think I took into account the case where the text is indented by the formatter (my patch worked by looking at the existing whitespace before the first property and applied that space to every other line). It is possible that the code I added doesn't take into account extra indentations not visible in the text of the style (like a formatted indent). As a fix, I think it may be necessary to look at the ownerRule and see how many items are in mediaList and indent that many times (similar to what generateCSSRuleString does in CSSStyleDeclaration.js).
Timothy Hatcher
Comment 3 2015-12-09 16:06:12 PST
Yeah, the old code tried to infer the base indent for the rule and applied it after editing.
Nikita Vasilyev
Comment 4 2017-10-13 16:50:16 PDT
Fixed in the new styles sidebar.
Note You need to log in before you can comment on or make changes to this bug.