Approved
Last Updated: 20 Dec 2017 09:42 by ADMIN
Richard
Created on: 12 Dec 2017 10:03
Category: RichTextEditor
Type: Bug Report
1
FIX. RadRichTextEditor - CSS properties in 'style' attribute should take precedence over HTML attributes
There is an issue with the way the editor decides what width to render a table.

The example I have encountered is in an HTML email from Outlook that contained a table. Whatever way Outlook composes the HTML, it adds a width attribute and a style attribute to the table's opening tag:

<table width="0" style="width: 500px;">

In this situation, the inline style should take precedence over the width attribute (the width attribute is actually deprecated as of HTML5). This is how all common browsers behave.

You can see in the attached 1_browser.png that Chrome correctly renders the table at 500px;

However the RadRichtextEditor component incorrectly renders the table at width 0 as shown in attached 2_RadRichtextEditor.png, ignoring the width specified in the style attribute.

Curiously, other CSS rules in the style attribute are correctly interpreted.
For example:

<table width="0" style="width: 500px;font-weight:bold;">

will display a table of zero width with bold text in the RadRichTextEditor.

Thanks guys!
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
1 comment
ADMIN
Peter
Posted on: 20 Dec 2017 09:42
When HTML attribute is set and the same property in set in CSS, the element should be styled according to the CSS values, because they have higher priority. For example:

<table border="5" style="border: 1px solid black">