Auto merge of #20615 - KiChjang:window-indexed-getter, r=emilio

Implement window indexed getter

Fixes #4589.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20615)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-05-17 18:52:38 -04:00 committed by GitHub
commit 3d109b4574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 161 additions and 237 deletions

View file

@ -1231,6 +1231,15 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
warn!("Sending reply to get parent info failed ({:?}).", e);
}
}
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);
if let Err(e) = sender.send(result) {
warn!("Sending reply to get child browsing context ID failed ({:?}).", e);
}
}
FromScriptMsg::RegisterServiceWorker(scope_things, scope) => {
debug!("constellation got store registration scope message");
self.handle_register_serviceworker(scope_things, scope);