Just reviving and old thread to raise awareness on some backwards
compatibility issues we found despite it's already too late to do
anything (almost 2 years later).
On 16/11/16 16:27, Dominik Röttsches wrote:
> *Compatibility risk*
>
> I don't see a risk of breaking content, as these are new properties, and
> the updated behaviour for parsing the text-decoration: shorthand is
> backwards compatible.
This was finally shipped in Chromium 57.0.2928 [1], and it changed how
execCommand("strikeThrough") marks the elements (check the example [2]),
it started to use "text-decoration-line: line-through" from that point.
What's the problem? If you generate some content in Chromium 57 using
that, if someone opens it in a previous version they cannot see it (the
other way around it works without problems, as old versions set
"text-decoration: line-through" which is valid in newer versions).
I'm not sure if this could be easy or not, but in the future it might be
a good idea to keep using the old syntax for a few releases (if
possible, no super complex and compatible like in this particular case).
That way we could allow people to share content between a few extra
versions of Chromium and not break it if you're just one version behind.
If the change happened on M60, then people with previous versions up to
M57 would have things working properly as "text-decoration-line" was
supported since M57.
This mail is just to share this issue to make us think about similar
possibilities in the future. I guess this is odd enough and a corner
case, but I thought it'd be nice to share this even when it doesn't make
any sense to change anything at this stage.
Sorry for the "noise" and thanks for reading that far. :-)
Cheers,
Rego
[1]
https://chromium.googlesource.com/chromium/src/+/da8225b9b7de29db904e7a130a8591c2e0c2ffce
[2] Example:
<!DOCTYPE html>
<div id="foo" contenteditable>foobar</div>
<script>
let sel = window.getSelection();
sel.collapse(foo, 0);
sel.extend(foo, 1);
document.execCommand("styleWithCss");
document.execCommand("strikeThrough");
sel.collapse(foo, 0);
</script>
Which generates the following output from M57 on:
<div id="foo" contenteditable>
<span style="text-decoration-line: line-through;">foobar</span>
</div>