imported patch 499092-prefix-v2

This commit is contained in:
Ms2ger 2010-02-25 10:49:34 -08:00
Родитель 1c481955b5
Коммит 05b28bbdbe
5 изменённых файлов: 59 добавлений и 11 удалений

Просмотреть файл

@ -4924,20 +4924,11 @@ nsDocument::GetTitleContent(PRUint32 aNamespace)
return nsnull;
nsRefPtr<nsContentList> list =
NS_GetContentList(this, nsGkAtoms::title, kNameSpaceID_Unknown);
NS_GetContentList(this, nsGkAtoms::title, aNamespace);
if (!list)
return nsnull;
for (PRUint32 i = 0; ; ++i) {
// Avoid calling list->Length --- by calling Item one at a time,
// we can avoid scanning the whole document to build the list of all
// matches
nsIContent* elem = list->Item(i, PR_FALSE);
if (!elem)
return nsnull;
if (elem->IsInNamespace(aNamespace))
return elem;
}
return list->Item(0, PR_FALSE);
}
void

Просмотреть файл

@ -98,6 +98,9 @@ _TEST_FILES = test_bug1682.html \
test_bug497242.xhtml \
test_bug512367.html \
test_bug340017.xhtml \
test_bug499092.html \
bug499092.xml \
bug499092.html \
$(NULL)
libs:: $(_TEST_FILES)

Просмотреть файл

@ -0,0 +1,6 @@
<!DOCTYPE html>
<script>
var title = document.createElementNS("http://www.w3.org/1999/xhtml", "aa:title");
title.textContent = "HTML OK";
document.documentElement.firstChild.appendChild(title);
</script>

Просмотреть файл

@ -0,0 +1,4 @@
<?xml version="1.0"?>
<doc xmlns:aa="http://www.w3.org/1999/xhtml">
<aa:title>XML OK</aa:title>
</doc>

Просмотреть файл

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=499092
-->
<head>
<title>Test for Bug 499092</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=499092">Mozilla Bug 499092</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 499092 **/
SimpleTest.waitForExplicitFinish();
var content = document.getElementById("content");
function testHtml() {
is(this.contentDocument.title, "HTML OK");
SimpleTest.finish();
}
function testXml() {
is(this.contentDocument.title, "XML OK");
var iframeHtml = document.createElement("iframe");
iframeHtml.onload = testHtml;
iframeHtml.src = "bug499092.html";
content.appendChild(iframeHtml);
}
var iframeXml = document.createElement("iframe");
iframeXml.onload = testXml;
iframeXml.src = "bug499092.xml";
content.appendChild(iframeXml);
</script>
</pre>
</body>
</html>