Bug 189146

Summary: Add assignedElements to HTMLSlotElement
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: annevk, cdumez, darin, esprehn+autocc, ews-watchlist, ggaren, gyuyoung.kim, koivisto, kondapallykalyan, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 148695    
Attachments:
Description Flags
Adds the method darin: review+

Description Ryosuke Niwa 2018-08-29 22:30:09 PDT
Add a variant of assignedNodes which returns elements.
Added in https://github.com/whatwg/html/pull/2269.
Comment 1 Ryosuke Niwa 2018-08-29 22:43:33 PDT
Created attachment 348485 [details]
Adds the method
Comment 2 Radar WebKit Bug Importer 2018-08-29 22:44:31 PDT
<rdar://problem/43872965>
Comment 3 Darin Adler 2018-08-30 09:03:57 PDT
Comment on attachment 348485 [details]
Adds the method

View in context: https://bugs.webkit.org/attachment.cgi?id=348485&action=review

> Source/WebCore/html/HTMLSlotElement.h:43
>      Vector<Node*> assignedNodes(const AssignedNodesOptions&) const;
> +    Vector<Ref<Element>> assignedElements(const AssignedNodesOptions&) const;

Why does assignedNodes return Node* instead of Ref<Node>? Why not make the two consistent?
Comment 4 Ryosuke Niwa 2018-08-30 18:58:48 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 348485 [details]
> Adds the method
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=348485&action=review
> 
> > Source/WebCore/html/HTMLSlotElement.h:43
> >      Vector<Node*> assignedNodes(const AssignedNodesOptions&) const;
> > +    Vector<Ref<Element>> assignedElements(const AssignedNodesOptions&) const;
> 
> Why does assignedNodes return Node* instead of Ref<Node>? Why not make the
> two consistent?

That's a good point. Since we're making a copy in both cases, we should probably always return Vector<Ref<~>>. Will fix before landing.
Comment 5 Ryosuke Niwa 2018-08-30 19:26:28 PDT
Committed r235535: <https://trac.webkit.org/changeset/235535>
Comment 6 Anne van Kesteren 2019-10-16 00:31:47 PDT
*** Bug 180908 has been marked as a duplicate of this bug. ***