servo: Merge #6231 - Restrict output of getElementsByName to HTML elements (from aopicier:get_elements_by_name); r=Ms2ger

Fixes #1745
Should I adjust the expected result of the corresponding wpt test cases?

html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace.html
html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace.xhtml

Source-Repo: https://github.com/servo/servo
Source-Revision: bb95e07f8e75663706f9077138912c4e06c3eac9
This commit is contained in:
Philipp Hartwig 2015-06-03 04:14:18 -05:00
Родитель f51f93b5f6
Коммит 789c1bea66
1 изменённых файлов: 3 добавлений и 0 удалений

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

@ -1540,6 +1540,9 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
Some(element) => element,
None => return false,
};
if element.namespace() != &ns!(HTML) {
return false;
}
element.get_attribute(&ns!(""), &atom!("name")).root().map_or(false, |attr| {
// FIXME(https://github.com/rust-lang/rust/issues/23338)
let attr = attr.r();