Opened 11 years ago
Last modified 10 years ago
#12876 confirmed Bug
Required "type" attribute is missing in the <style> element generated by the editor
| Reported by: | Jan Pechanec | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | General | Version: | 4.0 |
| Keywords: | IBM | Cc: |
Description
Type is required attribute of <style> tag according to http://www.w3.org/TR/html401/present/styles.html#style-group
But CKEDITOR generates following
<style>.cke{visibility:hidden;}</style>
There shall be simple fix - add attribute " type='text/css' " to generated <style> tag. We tried to fix downloaded source code by adding one line into document.js:
var style = new CKEDITOR.dom.element( 'style', this );
style.setAttribute('type','text/css'); //added by us
style.append( new CKEDITOR.dom.text( cssStyleText, this ) );
But it seems it does not work in Internet Explorer 11.
It is causing problems with formal validation of HTML code in IBM internal application.
Change History (3)
comment:1 Changed 11 years ago by
| Summary: | required TYPE attribute is missing in <script> → required TYPE attribute is missing in <style> |
|---|
comment:2 Changed 11 years ago by
| Keywords: | IBM added; style html removed |
|---|---|
| Status: | new → confirmed |
| Version: | 4.4.7 → 4.0 |
comment:3 Changed 10 years ago by
| Summary: | required TYPE attribute is missing in <style> → Required "type" attribute is missing in the <style> element generated by the editor |
|---|

Since this attribute is required in HTML 4 and optional but valid in HTML 5 there is no problem in adding this attribute. We will keep backward compatibility and won't break anything.