зеркало из https://github.com/mozilla/pjs.git
Fix issues rebuilding <body> attributes from source b=331894 r=glazou sr=mscott
This commit is contained in:
Родитель
38cd5b6f92
Коммит
ace2980bab
|
@ -1824,12 +1824,11 @@ nsHTMLEditor::RebuildDocumentFromSource(const nsAString& aSourceString)
|
||||||
if (!FindInReadable(NS_LITERAL_STRING(">"),beginclosebody,endclosebody))
|
if (!FindInReadable(NS_LITERAL_STRING(">"),beginclosebody,endclosebody))
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsAutoString bodyTag(Substring(beginbody,endclosebody));//<bodyXXXX >
|
|
||||||
// Truncate at the end of the body tag
|
// Truncate at the end of the body tag
|
||||||
|
|
||||||
// Kludge of the year: fool the parser by replacing "body" with "div" so we get a node
|
// Kludge of the year: fool the parser by replacing "body" with "div" so we get a node
|
||||||
bodyTag.ReplaceSubstring(NS_LITERAL_STRING("body").get(),
|
nsAutoString bodyTag;
|
||||||
NS_LITERAL_STRING("div").get());
|
bodyTag.AssignLiteral("<div ");
|
||||||
|
bodyTag.Append(Substring(endbody, endclosebody));
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMRange> range;
|
nsCOMPtr<nsIDOMRange> range;
|
||||||
res = selection->GetRangeAt(0, getter_AddRefs(range));
|
res = selection->GetRangeAt(0, getter_AddRefs(range));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче