Ticket #3341 (closed Bug: fixed)
[IE] getOuterHtml incorrect for namespaced element name
| Reported by: | garry.yao | Owned by: | fredck |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 3.0 |
| Component: | General | Version: | |
| Keywords: | IE Confirmed Review+ | Cc: |
Description
IE is returning the namespace definition as the following along with the 'outerHtml' when creating an element with tag name 'cke:custom', which is unexpected.
<?xml:namespace prefix="cke" />
Attachments
Change History
Changed 4 years ago by garry.yao
- Attachment test_element_getOuterHtml.patch added
comment:1 Changed 4 years ago by garry.yao
- Status changed from new to assigned
- Keywords IE Review? added
comment:2 Changed 4 years ago by fredck
- Keywords Review- added; Review? removed
- Owner changed from garry.yao to fredck
- Status changed from assigned to new
The TC is good. I can't tell the same for the path though.
The patch is limiting the fix for elements with "cke:" namespace only. There is no need fur such limitation, as it's quite easy to match the <?xml:namespace> tag.
Actually, we we are already spending time with a regex test, let's simply strip the <?xml:namespace> tag from the string when returning it. The replacement would still perform better than a DOM manipulation.
I'm coming with a new patch for it.
comment:4 Changed 4 years ago by fredck
- Keywords Review? added; Review- removed
Added a new patch... it's always good to have weird stuff commented.
comment:5 Changed 4 years ago by alfonsoml
- Keywords Review- added; Review? removed
That regexp should be
<\?[^>]*>
as the ? is a very special character in regexp.
Another approach (haven't tested and it might not be worth) would be to declare the namespace in the head of the document, so that it isn't included in the body.

Unit Test Case