From 1c8cd3045bd430249449b299df769b248575524d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 30 Jan 2018 16:35:13 +0100 Subject: [PATCH 1/3] script: Partially implement the window named getter. There's tons of layout tests that depend on this, and I keep forgetting Servo doesn't support it :) --- components/script/dom/document.rs | 129 +++++++++++--------- components/script/dom/element.rs | 4 + components/script/dom/webidls/Window.webidl | 2 +- components/script/dom/window.rs | 58 ++++++++- 4 files changed, 131 insertions(+), 62 deletions(-) diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 436d4e71d1a8..66adea442eec 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -368,6 +368,56 @@ pub struct Document { throw_on_dynamic_markup_insertion_counter: Cell, } +// https://html.spec.whatwg.org/multipage/#dom-document-nameditem-filter +fn filter_by_name(name: &Atom, element: &Element) -> bool { + // TODO: Handle ,