W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2020

Re: [csswg-drafts] [css-syntax-3]: Voluntary semicolons (#5413)

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Mon, 17 Aug 2020 02:15:23 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-674620707-1597630522-sysbot+gh@w3.org>
Besides the discussion as to whether this is desirable, I would be extremely surprised if this was web compatible, For two reasons:

1) As tab mentioned, breaking declaration across multiple lines is a common practice for properties that take long values, and this break up has been done so far without consideration for possible semi-colon insertion. If we started injecting them, it is pretty much certain that the way we inject them would break some of these pages. This might be possible to address with something like your "Simple Rule" in https://github.com/w3c/csswg-drafts/issues/5413#issuecomment-671550148, but there's more:

2) The second reason is similar to https://wiki.csswg.org/faq#error-handling-in-selectors-aka-breaking-pages-by-making-them-work (quoting the relevant part here, tuned to apply to this problem rather than the original one):

    > Forgetting a semicolon at the end of a line is an easy mistake to make, so lots of people have made it. Moreover, when a page doesn't quite look the way the author expected, a common strategy is to write more CSS rules until it does, rather than trying to understand why the existing rules do not create the expected result.
    > 
    > Then, when the page looks good, the author ships it, including all mistaken cruft that doesn't do anything. This dead code might even survive later redesigns.
    > 
    > Effectively, even though it is not intentional, many pages that have been fixed through additional css declarations now depend on this sort of cruft not to work. More often than not, “randomly“ changing the background, the size, the borders, or the display value of some elements in the page will break it badly. It doesn't matter that the source of the “randomness“ is the author's previous mistakes. Injecting semi-colons would fix the syntax error, but that would break the page.

And so, even if we agree that semi-colon injection is desirable, this is unlikely to be something that can be changed, as it would probably break countless sites. 

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5413#issuecomment-674620707 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 17 August 2020 02:15:25 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:13 UTC