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

Remove an IE7 hack #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -143,10 +143,6 @@ public static void InsertContentIntoElement(string content, ISmartContent sConte
MarkupRange stagingRange = MarkupServices.CreateMarkupRange(sc1, sc2);
stagingRange.MoveToElement(doc.body, false);

//IE7 hack: fixes bug 305512. Note that this will destroy the inner content of the element,
//so make sure it is called before the refreshed content is inserted.
BeforeInsertInvalidateHackForIE7(element);

//move the content from the staging area into the actual insertion point.
MarkupServices.Move(stagingRange.Start, stagingRange.End, htmlRange.End);

Expand Down Expand Up @@ -285,21 +281,6 @@ private static void AppendStyle(string name, string val, StringBuilder sb)
sb.AppendFormat("{0}:{1};", name, val);
}

/// <summary>
/// Forces IE 7 to redraw the new contents of the element.
/// </summary>
/// <param name="e"></param>
private static void BeforeInsertInvalidateHackForIE7(IHTMLElement e)
{
//Fixes bug 305512.
//IE 7 (beta3) has a bad habit of not redrawing the updated HTML if the width
//of the content box has increased while the editor is not focused. Investigation
//has found that setting the innerText is at least one way to force the editor
//to refresh the painting of the element.
//TODO: after IE7 goes final, check to see if this hack is still necessary.
e.innerText = "";
}

// Warning: Does not deal with escaping properly. This is fine as long as
// we're only using it for content we generate and there are no security
// impliciations.
Expand Down