Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#15032 closed defect (fixed)

Dijit/Editor image problem with IE9

Reported by: Jovanovic Owned by: bill
Priority: undecided Milestone: 1.6.2
Component: Editor Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

Only with Internet Explorer 9, images doesn't render in dijit/Editor widget when they are width and height attribute.

And other problem (i don't know if it's linked with thirst problem), always only with IE9, when i use ViewSource? plugin and i see code source of the editor content, tags width and height attributes of the image take alt value.

Simple example :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Testt</title>

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

<script>
    dojoConfig= {
        has: {
            "dojo-firebug": true
        },
        parseOnLoad: true,
		isDebug: true,
        async:true
    };
</script>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js" type="text/javascript"></script>

<style type='text/css'>
@import 'http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dijit/themes/claro/claro.css';
</style>
</head>

<body class="claro">
<b>Toggle the View Source button to see the contents in source mode.</b>
<br>
<div data-dojo-type="dijit.Editor" id="editor" extraplugins="['viewsource']">
Simple image test :
<img alt="test"  width="150" height="88" id="bibli_WR4479" src="http://img.viralpatel.net/dojo-toolkit-javascript-framework-logo.png" title="test" />
</div>
</body>

</html>
<script>
require([
    "dojo/parser",
    "dijit/Editor",
	"dijit/_editor/plugins/ViewSource"
]);
</script>

Attachments (1)

test2.html (1.1 KB) - added by Jovanovic 8 years ago.

Download all attachments as: .zip

Change History (12)

Changed 8 years ago by Jovanovic

Attachment: test2.html added

comment:1 Changed 8 years ago by bill

Component: DijitEditor
Milestone: tbd1.8
Owner: set to bill
Status: newassigned

I do reproduce it, due to this line:

html = htmlapi.getChildrenHtml(dn);

returning corrupted HTML (this is from reading the initial editor value as specified in markup). dn.innerHTML is the right value.

comment:2 Changed 8 years ago by bill

Resolution: fixed
Status: assignedclosed

In [28189]:

Fix dijit/_editor/html on IE9 to use W3C code path to get node attribute .
Had to move some has() tests from parser.js to has.js, so they could be shared by this module.

Also making IE8 (in standards mode) follow W3C code path as much as possible, to be able to remove IE6-7 code branch for 2.0.

Fixes image tag width/height corruption on IE9.

Fixes #15032 !strict.

comment:3 Changed 8 years ago by bill

In [28196]:

Workaround IE8 bug where completed="completed" gets printed twice for <img> nodes in LinkDialog test, due to (somehow) "completed" appearing twice in node.attributes[]. I'm not even sure how it gets there at all. Refs #15032 !strict.

comment:4 Changed 8 years ago by bill

#15223 is a duplicate of this ticket.

comment:5 Changed 8 years ago by DJ Mountney

Concerning the latest changes for this bug, on, line 63 : has("dom-attributes-specified-flag") is always going to return true, this is because in addition to being true for IE8, has("dom-attributes-specified-flag") will always be true for browsers with has("dom-attributes-explicit") because of the way they are determined.

comment:6 Changed 8 years ago by bill

Ah, you are right, I'll revise that expression.

comment:7 Changed 8 years ago by bill

In [28510]:

Make dom-attributes-specified-flag test more robust, so it only is true for IE. Note that the flag means "you need to check if attr.specified is true", not that "attr has a specified flag but it's always set to true".

Refs #14672, #15032 !strict.

comment:5 Changed 7 years ago by bill

In [30262]:

Backport [28189], [28196], and [28510] to the 1.7 branch, to use feature testing rather than browser sniffing for dijit/_editor/html module. Fixes #15032 on 1.7 branch !strict.

comment:6 Changed 7 years ago by bill

Milestone: 1.81.7.5

comment:7 Changed 7 years ago by Ed Chatelain

In [30498]:

Backport minimal changes from [30262] to the 1.6 branch, change IE test to isIE < 9 to fix problem with losing image width and height on IE9 and 10 in dijit/_editor/html module. Fixes #15032 on 1.6 branch !strict.

comment:8 Changed 7 years ago by Ed Chatelain

Milestone: 1.7.51.6.2
Note: See TracTickets for help on using tickets.