mirror of
https://github.com/webodf/WebODF.git
synced 2026-12-01 16:56:05 +01:00
Various browser cope differently with unescaped characters in a CSS content block, though all browsers agree it is a bad thing. WebKit will throw an error, Chrome & FF will "guess" where the rule ends (and usually get it wrong). This patch does 2 things to fix this: - Consistently use double-quotes to quote strings - Escape backspace and double-quote chars in the CSS-related content The vast amount of testing code is primarily creating a string tokenizer able to parse out the displayed text across Chrome/WebKit + FF. As there is no simple way to get the "rendered text" from a pseudo-element, a lot of code is required to compute this. There are tests included for the hand-rolled tokenizer as well to ensure proper function. No tests have been added for OdfCanvas, as the existing list logic in here is destined (sooner rather than later) to be merged into the newer list CSS translation class.