Changeset 190093 in webkit
- Timestamp:
- Sep 21, 2015 5:26:06 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r190091 r190093 1 2015-09-21 Ryosuke Niwa <rniwa@webkit.org> 2 3 The binding for getDistributedNodes unnecessarily makes a vector of nodes 4 https://bugs.webkit.org/show_bug.cgi?id=149434 5 6 Reviewed by Darin Adler. 7 8 Added a jsArray for const Vector<T*>* so that we can generate the binding code for getDistributedNodes() 9 without having to create Vector<RefPtr<Node>> out of Vector<Node*>*. 10 11 * bindings/js/JSDOMBinding.h: 12 (WebCore::jsArray): Added. 13 * html/HTMLSlotElement.cpp: 14 (WebCore::HTMLSlotElement::assignedNodes): 15 (WebCore::HTMLSlotElement::getDistributedNodes): Deleted. 16 * html/HTMLSlotElement.h: 17 * html/HTMLSlotElement.idl: 18 1 19 2015-09-21 Brent Fulgham <bfulgham@apple.com> 2 20 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r188187 r190093 456 456 } 457 457 458 template<typename T, size_t inlineCapacity> inline JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T, inlineCapacity>* vector) 459 { 460 if (!vector) 461 return JSC::constructEmptyArray(exec, nullptr, globalObject, 0); 462 return jsArray(exec, globalObject, *vector); 463 } 464 458 465 WEBCORE_EXPORT JSC::JSValue jsArray(JSC::ExecState*, JSDOMGlobalObject*, PassRefPtr<DOMStringList>); 459 466 -
trunk/Source/WebCore/html/HTMLSlotElement.cpp
r190084 r190093 95 95 } 96 96 97 Vector<RefPtr<Node>> HTMLSlotElement::getDistributedNodes() const98 {99 Vector<RefPtr<Node>> distributedNodes;100 101 if (auto* assignedNodes = this->assignedNodes()) {102 for (auto* node : *assignedNodes)103 distributedNodes.append(node);104 }105 106 return distributedNodes;107 97 } 108 109 } -
trunk/Source/WebCore/html/HTMLSlotElement.h
r190084 r190093 39 39 const Vector<Node*>* assignedNodes() const; 40 40 41 Vector<RefPtr<Node>> getDistributedNodes() const;42 43 41 private: 44 42 HTMLSlotElement(const QualifiedName&, Document&); -
trunk/Source/WebCore/html/HTMLSlotElement.idl
r189950 r190093 31 31 32 32 [Reflect] attribute DOMString name; 33 sequence<Node> getDistributedNodes();33 [ImplementedAs=assignedNodes] sequence<Node> getDistributedNodes(); 34 34 35 35 };
Note: See TracChangeset
for help on using the changeset viewer.