Opened 4 years ago

Closed 4 years ago

#13101 closed Bug (fixed)

IE8 adds colon before HTML5 tags

Reported by: Piotr Jasiun Owned by: Piotr Jasiun
Priority: Normal Milestone: CKEditor 4.5.0 Beta
Component: General Version: 4.0 Beta
Keywords: Cc:

Description

There are some problems with HTML5 on IE8.

  • IE8 adds colon before HTML5 tags when native clone is called, this should be fixed.
  • There are a problem with document fragment.
  • getHtmlFromRange should works fine with HTML5 tags on IE8.

Needs tests and fixes.

Attachments (1)

td-tr-ie8.html (336 bytes) - added by Piotr Jasiun 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 4 years ago by Piotr Jasiun

Owner: set to Piotr Jasiun
Status: newassigned

comment:2 Changed 4 years ago by Piotrek Koszuliński

Summary: IE8 add colon before HTML5 tagsIE8 adds colon before HTML5 tags

Changed 4 years ago by Piotr Jasiun

Attachment: td-tr-ie8.html added

comment:3 Changed 4 years ago by Piotr Jasiun

Unfortunately div.innerHTML = element.outerHTML as a workaround for cloneNode as it is described here does not work (see attachment). We need another solution.

comment:4 Changed 4 years ago by Piotr Jasiun

Status: assignedreview

node.clone and documentFragment.getHtml seems to be the only two places which were broken. I decided to fixed them touching as little code as it is possible, so the fix for the edge case does not bring some more serious problems.

  • In node.clone I iterate over the tree and replace nodes which names start with colons. Most probably previous fix would work if we add '_' a the begging of the string and remove it later, but it would totally change the behavior of clone method on IE8 and could bring new bugs.
  • In documentFragment.getHtml I use regexp on the output string. I tried to use fixed clone method there, but it seems not to work on documentFragment. I have changed that method so it do with documentFragment the same it do with element, but the result outerHTML still contain colons.

comment:5 Changed 4 years ago by Piotr Jasiun

I also checked if it makes sens to enableHtml5Elements on every documentFramgent, but it does not, because the only case we need to do this is setting innterHtml, so the native fragment is needed and for that case we already have _getHtml5ShivFrag helper. If we add HTML5 elements any other way, ex. by adding child node with the HTML5, then enableHtml5Elements change nothing.

comment:6 Changed 4 years ago by Piotr Jasiun

Changes in t/13101b.

comment:7 Changed 4 years ago by Piotrek Koszuliński

Status: reviewreview_failed

I pushed one additional commit to branch:t/13101b that shows how to use clone() with docFrag. The problem was inside renameNode() which didn't work with elements inside document fragments.

comment:8 Changed 4 years ago by Piotr Jasiun

Status: review_failedassigned

comment:9 Changed 4 years ago by Piotr Jasiun

Status: assignedreview

Fixed some details and added tests. Changes in t/13101b. Branch rebased on the newest major.

Last edited 4 years ago by Piotr Jasiun (previous) (diff)

comment:10 Changed 4 years ago by Piotrek Koszuliński

Resolution: fixed
Status: reviewclosed
Version: 4.0 Beta

Fixed on major with git:7342d18.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy