Page MenuHomePhabricator

VisualEditor: Style and bgcolor attributes normalized by Internet Explorer
Closed, ResolvedPublic

Description

When you edit a page with VE in IE, CSS styles are normalized, causing dirty diffs. This is because Internet Explorer very aggressively normalizes styles, to the point where we can't tell what the original value was without some nasty hackery.

In practice, this means that any time you save a page in IE, things like style="color: #ffffdd;" get normalized to style="color: rgb(255, 255, 221);", bgcolor="#FFFFDD" gets normalized to bgcolor="#ffffdd" and invalid CSS is removed. The former two are annoying dirty diffs, the latter is actual information loss (someone else can come along later and fix invalid CSS, but not if we remove it).

This normalization is a bug in Internet Explorer. I'm working on a workaround where I extract the original value using an XML parser and stash it so I can restore it later.

hex to rgb normalization: https://fr.wikipedia.org/?diff=107359735
bgcolor normalization: https://sv.wikipedia.org/?diff=27502354
Invalid CSS removal: https://cs.wikipedia.org/?diff=11849661


Version: unspecified
Severity: major

Details

Reference
bz70856

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.
bzimport set Reference to bz70856.
Catrope created this task.Sep 15 2014, 6:18 PM

Change 160583 had a related patch set uploaded by Catrope:
Work around IE's normalization of style attributes by abusing XML parsers

https://gerrit.wikimedia.org/r/160583

Change 160584 had a related patch set uploaded by Catrope:
Use ve.parseXhtml() and ve.serializeXhtml()

https://gerrit.wikimedia.org/r/160584

Change 160596 had a related patch set uploaded by Jforrester:
Use ve.parseXhtml() and ve.serializeXhtml()

https://gerrit.wikimedia.org/r/160596

Change 160597 had a related patch set uploaded by Jforrester:
Use ve.parseXhtml() and ve.serializeXhtml()

https://gerrit.wikimedia.org/r/160597

Change 160584 merged by jenkins-bot:
Use ve.parseXhtml() and ve.serializeXhtml()

https://gerrit.wikimedia.org/r/160584

Change 160596 merged by Catrope:
Use ve.parseXhtml() and ve.serializeXhtml()

https://gerrit.wikimedia.org/r/160596

Change 160597 merged by Catrope:
Use ve.parseXhtml() and ve.serializeXhtml()

https://gerrit.wikimedia.org/r/160597

Deploy scheduled for 08:00 SF time tomorrow.