From b47de28da543f165795812afa366cacd64211a01 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 24 Jan 2020 00:40:33 +0100 Subject: [PATCH 1/6] MSC2422: Allow color on font tag Signed-off-by: Nicolas Werner --- .../2422-allow-color-attribute-on-font-tag.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 proposals/2422-allow-color-attribute-on-font-tag.md diff --git a/proposals/2422-allow-color-attribute-on-font-tag.md b/proposals/2422-allow-color-attribute-on-font-tag.md new file mode 100644 index 00000000..4287a696 --- /dev/null +++ b/proposals/2422-allow-color-attribute-on-font-tag.md @@ -0,0 +1,38 @@ +# MSC2422: Allow `color` as attribute for `` in messages + +Currently the spec requires you to use `data-mx-color` instead of the standard +`color` html attribute for the `` tag. This is probably done to make it +consistent with ``, where you may not want to allow a generic style tag for. + +On the other hand the /rainbow command on almost every client just uses the +`color` attribute of the `` tag. While some clients support +`data-mx-color` (i.e. Riot Web), most clients don't. Most clients support +rendering `color` however. + +It would probably be for the best to allow or even prefer `color` on the +`` tag. + +## Proposal + +Add the `color` attribute to the allowed attributes of `` in section +13.2.1.7. Allow only hexcodes as allowed value for this attribute for now. + +## Potential issues + +- We now have a redundant attribute in the spec. While it matches, what the + clients currently do, it may be better to fix each client instead. +- Clients may not sanitize the color attribute and will let other color values + through, increasing compatibility issues again. +- Clients may never support the data-mx-* attributes now. +- Old messages could loose their color +- This proposal doesn't touch span at all, maybe it should? + +## Alternatives + +- fix the clients +- remove the `data-mx-color` and `data-mx-bg-color` attributes entirely, leaving + us just with `color` for `` +- Add a section to tell the clients to prefer `color` over `mx-data-color` +- Spec an entirely different format for messages (that would probably not make + this proposal obsolete) + From 438ff8fc1d19f89cbf77583b95a3dbe55d4c6b96 Mon Sep 17 00:00:00 2001 From: "DeepBlueV7.X" Date: Thu, 5 Mar 2020 21:02:09 +0000 Subject: [PATCH 2/6] Update proposals/2422-allow-color-attribute-on-font-tag.md Co-Authored-By: Travis Ralston --- proposals/2422-allow-color-attribute-on-font-tag.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proposals/2422-allow-color-attribute-on-font-tag.md b/proposals/2422-allow-color-attribute-on-font-tag.md index 4287a696..7a87f143 100644 --- a/proposals/2422-allow-color-attribute-on-font-tag.md +++ b/proposals/2422-allow-color-attribute-on-font-tag.md @@ -1,6 +1,6 @@ # MSC2422: Allow `color` as attribute for `` in messages -Currently the spec requires you to use `data-mx-color` instead of the standard +Currently the spec recommends that you to use `data-mx-color` instead of the standard `color` html attribute for the `` tag. This is probably done to make it consistent with ``, where you may not want to allow a generic style tag for. @@ -35,4 +35,3 @@ Add the `color` attribute to the allowed attributes of `` in section - Add a section to tell the clients to prefer `color` over `mx-data-color` - Spec an entirely different format for messages (that would probably not make this proposal obsolete) - From 6b2752c4c2c0fd183224f22ed339226362ddddfd Mon Sep 17 00:00:00 2001 From: "DeepBlueV7.X" Date: Thu, 5 Mar 2020 21:02:23 +0000 Subject: [PATCH 3/6] Update proposals/2422-allow-color-attribute-on-font-tag.md Co-Authored-By: Travis Ralston --- proposals/2422-allow-color-attribute-on-font-tag.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/2422-allow-color-attribute-on-font-tag.md b/proposals/2422-allow-color-attribute-on-font-tag.md index 7a87f143..9e4b1645 100644 --- a/proposals/2422-allow-color-attribute-on-font-tag.md +++ b/proposals/2422-allow-color-attribute-on-font-tag.md @@ -15,7 +15,7 @@ It would probably be for the best to allow or even prefer `color` on the ## Proposal Add the `color` attribute to the allowed attributes of `` in section -13.2.1.7. Allow only hexcodes as allowed value for this attribute for now. +13.2.1.7. No changes to the allowable values from the HTML spec are made here. ## Potential issues From b760ec2d747281294634bec051064191d4fd3357 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 7 Mar 2020 14:57:32 +0100 Subject: [PATCH 4/6] Add comments why alternatives to MSC2422 weren't chosen --- .../2422-allow-color-attribute-on-font-tag.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/proposals/2422-allow-color-attribute-on-font-tag.md b/proposals/2422-allow-color-attribute-on-font-tag.md index 9e4b1645..3fb03aa5 100644 --- a/proposals/2422-allow-color-attribute-on-font-tag.md +++ b/proposals/2422-allow-color-attribute-on-font-tag.md @@ -29,9 +29,11 @@ Add the `color` attribute to the allowed attributes of `` in section ## Alternatives -- fix the clients -- remove the `data-mx-color` and `data-mx-bg-color` attributes entirely, leaving - us just with `color` for `` -- Add a section to tell the clients to prefer `color` over `mx-data-color` -- Spec an entirely different format for messages (that would probably not make - this proposal obsolete) +- fix the clients + -> This currently seems not feasible. Multiple clients started using color first (i.e. RiotX, Gomuks) and if it isn't spelled out explicitly in the spec, this will probably continue. +- remove the `data-mx-color` and `data-mx-bg-color` attributes entirely, leaving us just with `color` for `` + -> This would break old messages and can be done independently of this proposal at a later date, if it is deemed useful. +- Add a section to tell the clients to prefer `color` over `mx-data-color` + -> I don't really know, why mx-data-* was chosen, but I assume there was a reason, so I don't want to change that. +- Spec an entirely different format for messages (that would probably not make this proposal obsolete) + -> This wouldn't fix the issue, where some client may choose to remove the color tag, since it is dicouraged in the spec. Migration would probably also take a while, so this proposal is a quick solution, that doesn't prevent other solutions at a later date. From 2d85422a2ff500cb79fcf88c82fa5c73fc4f4b1a Mon Sep 17 00:00:00 2001 From: "DeepBlueV7.X" Date: Sat, 7 Mar 2020 18:34:07 +0000 Subject: [PATCH 5/6] Update proposals/2422-allow-color-attribute-on-font-tag.md Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- proposals/2422-allow-color-attribute-on-font-tag.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/2422-allow-color-attribute-on-font-tag.md b/proposals/2422-allow-color-attribute-on-font-tag.md index 3fb03aa5..11f06bff 100644 --- a/proposals/2422-allow-color-attribute-on-font-tag.md +++ b/proposals/2422-allow-color-attribute-on-font-tag.md @@ -19,7 +19,7 @@ Add the `color` attribute to the allowed attributes of `` in section ## Potential issues -- We now have a redundant attribute in the spec. While it matches, what the +- We now have a redundant attribute in the spec. While it matches what the clients currently do, it may be better to fix each client instead. - Clients may not sanitize the color attribute and will let other color values through, increasing compatibility issues again. From 28dc6a05153437c76156ea022c7d2a7efe58be04 Mon Sep 17 00:00:00 2001 From: "DeepBlueV7.X" Date: Fri, 20 Mar 2020 20:29:44 +0000 Subject: [PATCH 6/6] Update proposals/2422-allow-color-attribute-on-font-tag.md Apply typo fix as suggested. Co-Authored-By: David Vo --- proposals/2422-allow-color-attribute-on-font-tag.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/2422-allow-color-attribute-on-font-tag.md b/proposals/2422-allow-color-attribute-on-font-tag.md index 11f06bff..4e6a9ced 100644 --- a/proposals/2422-allow-color-attribute-on-font-tag.md +++ b/proposals/2422-allow-color-attribute-on-font-tag.md @@ -36,4 +36,4 @@ Add the `color` attribute to the allowed attributes of `` in section - Add a section to tell the clients to prefer `color` over `mx-data-color` -> I don't really know, why mx-data-* was chosen, but I assume there was a reason, so I don't want to change that. - Spec an entirely different format for messages (that would probably not make this proposal obsolete) - -> This wouldn't fix the issue, where some client may choose to remove the color tag, since it is dicouraged in the spec. Migration would probably also take a while, so this proposal is a quick solution, that doesn't prevent other solutions at a later date. + -> This wouldn't fix the issue, where some client may choose to remove the color tag, since it is discouraged in the spec. Migration would probably also take a while, so this proposal is a quick solution, that doesn't prevent other solutions at a later date.