From 43c87db3cad6b3a58bd4710e0b2c3835d1f071fb Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Thu, 31 May 2018 16:55:38 -0700 Subject: [PATCH] Implement getter for child BCs correctly --- components/constellation/constellation.rs | 8 ++++---- .../resetting-a-form/reset-form-event-realm.html.ini | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 tests/wpt/metadata/html/semantics/forms/resetting-a-form/reset-form-event-realm.html.ini diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 2da318fef7d..28d11c90531 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -1164,10 +1164,10 @@ impl Constellation } } FromScriptMsg::GetChildBrowsingContextId(browsing_context_id, index, sender) => { - // We increment here because the 0th element is the parent browsing context itself - let result = self.all_descendant_browsing_contexts_iter(browsing_context_id) - .nth(index + 1) - .map(|bc| bc.id); + let result = self.browsing_contexts.get(&browsing_context_id) + .and_then(|bc| self.pipelines.get(&bc.pipeline_id)) + .and_then(|pipeline| pipeline.children.get(index)) + .map(|maybe_bcid| *maybe_bcid); if let Err(e) = sender.send(result) { warn!("Sending reply to get child browsing context ID failed ({:?}).", e); } diff --git a/tests/wpt/metadata/html/semantics/forms/resetting-a-form/reset-form-event-realm.html.ini b/tests/wpt/metadata/html/semantics/forms/resetting-a-form/reset-form-event-realm.html.ini deleted file mode 100644 index 09d55739a1f..00000000000 --- a/tests/wpt/metadata/html/semantics/forms/resetting-a-form/reset-form-event-realm.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[reset-form-event-realm.html] - type: testharness - [reset()'s event must be fired in the Realm of the target] - expected: FAIL -