Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Resolution of several issues in IE 11. #1505

Merged
merged 6 commits into from
Dec 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/editor/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Rich Text Editor Change History
@VERSION@
------

* No changes.
* Resolution of several issues in IE 11. ([#1505][]: @ezequiel)

[#1505]: https://github.com/yui/yui3/issues/1505

3.14.0
------
Expand Down
4 changes: 2 additions & 2 deletions src/editor/js/editor-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
INNER_HTML = 'innerHTML',
FONT_FAMILY = 'fontFamily';

if (Y.UA.ie) {
if (Y.UA.ie && Y.UA.ie < 11) {
textContent = 'nodeValue';
}

Expand All @@ -20,7 +20,7 @@
comp, moved = 0, n, id, root = Y.EditorSelection.ROOT;


if (Y.config.win.getSelection && (!Y.UA.ie || Y.UA.ie < 9)) {
if (Y.config.win.getSelection && (!Y.UA.ie || Y.UA.ie < 9 || Y.UA.ie > 10)) {
sel = Y.config.win.getSelection();
} else if (Y.config.doc.selection) {
sel = Y.config.doc.selection.createRange();
Expand Down
6 changes: 3 additions & 3 deletions src/editor/js/exec-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@

cmd = 'insert' + ((tag === 'ul') ? 'un' : '') + 'orderedlist';

if (Y.UA.ie && !sel.isCollapsed) {
if (Y.UA.ie && Y.UA.ie < 11 && !sel.isCollapsed) {
range = sel._selection;
html = range.htmlText;
div = inst.Node.create(html) || root;
Expand Down Expand Up @@ -565,7 +565,7 @@
}
range.select();
}
} else if (Y.UA.ie) {
} else if (Y.UA.ie && Y.UA.ie < 11) {
par = inst.one(sel._selection.parentElement());
if (par.test('p')) {
if (par && par.hasAttribute(DIR)) {
Expand Down Expand Up @@ -699,7 +699,7 @@
}
});

if (Y.UA.ie) {
if (Y.UA.ie && Y.UA.ie < 11) {
ExecCommand.COMMANDS.bold = function() {
fixIETags.call(this, 'bold', 'b', 'FONT-WEIGHT: bold');
};
Expand Down
10 changes: 5 additions & 5 deletions src/editor/tests/unit/assets/editor-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,9 @@ YUI.add('editor-tests', function(Y) {
_should: {
fail: {
//'test: EditorSelection': (Y.UA.chrome),
test_bidi_plug: (Y.UA.ie && Y.UA.ie >= 9),
test_selection_methods: ((Y.UA.ie || Y.UA.webkit) ? true : false),
test_execCommands: ((Y.UA.ie && Y.UA.ie >= 9) ? true : false)
test_bidi_plug: Y.UA.ie === 9 || Y.UA.ie === 10,
test_selection_methods: (Y.UA.ie && Y.UA.ie < 11) || Y.UA.webkit,
test_execCommands: Y.UA.ie === 9 || Y.UA.ie === 10
},
ignore: {
/* gh issue #653 Editor test failures in Android 4
Expand All @@ -572,8 +572,8 @@ YUI.add('editor-tests', function(Y) {
},
error: { //These tests should error
//'test: EditorSelection': (Y.UA.chrome || Y.UA.webkit),
test_selection_methods: ((Y.UA.ie || Y.UA.webkit || (Y.UA.gecko && Y.UA.gecko >= 12 && Y.UA.gecko < 23)) ? true : false),
test_execCommands: ((Y.UA.ie && Y.UA.ie >= 9) ? true : false),
test_selection_methods: (Y.UA.ie && Y.UA.ie < 11) || Y.UA.webkit || (Y.UA.gecko && Y.UA.gecko > 11 && Y.UA.gecko < 23),
test_execCommands: Y.UA.ie === 9 || Y.UA.ie === 10,
test_double_plug: true,
test_double_plug2: true,
test_bidi_noplug: true
Expand Down