mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #20891 - KiChjang:reversed-bc-iter, r=asajeffrey
Implement getter for child BCs correctly Fixes #20890. <!-- 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/20891) <!-- Reviewable:end -->
This commit is contained in:
commit
36f5b69224
2 changed files with 4 additions and 9 deletions
|
@ -1165,10 +1165,10 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue