The CSS style editor looks for the line with the shortest prefixed whitespace and strips that from every line, the idea being that the baseline indentation is ignored and the rules look better. Indentation relative to that baseline is honored. The change made in https://bugs.webkit.org/show_bug.cgi?id=133515 properly handles lines with zero-length prefixed whitespace lines, but doesn't consider completely empty lines in cases such as: div { font-weight: bold; color: red; display: inline; } The empty line here lacks any spaces or tabs. In this case the empty line should be ignored as it is likely the author is eliminating all trailing whitespace from the document. This is so common that many inspected style declarations appear indented when they should not.
<rdar://problem/17583210>
Created attachment 234527 [details] [PATCH] Attempted fix.
Comment on attachment 234527 [details] [PATCH] Attempted fix. Awesome. r=me
Comment on attachment 234527 [details] [PATCH] Attempted fix. Clearing flags on attachment: 234527 Committed r170868: <http://trac.webkit.org/changeset/170868>
All reviewed patches have been landed. Closing bug.
Comment on attachment 234527 [details] [PATCH] Attempted fix. Nice fix! We will likely add the space o the empty line in _formattedContent before committing the change. We likely want to only do that for lines with content to prevent unneeded whitespace. Not critical though.