MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / findMatchedElements

Method findMatchedElements

native/events/Preference.cpp:419–432  ·  view source on GitHub ↗

According to the given xpath selector, match and return the satisfied elements inside UI page \param outElements A vector storing matched elements \param xpathSelector xpath selector describing the value of property that a matched element should have \param elementXML Node from the XML tree of UI page

Source from the content-addressed store, hash-verified

417/// \param xpathSelector xpath selector describing the value of property that a matched element should have
418/// \param elementXML Node from the XML tree of UI page
419 void Preference::findMatchedElements(std::vector<ElementPtr> &outElements,
420 const XpathPtr &xpathSelector,
421 const ElementPtr &elementXML) {
422 if (!elementXML) {
423 BLOGE("%s", "xml node is null");
424 return;
425 }
426 if (elementXML->matchXpathSelector(xpathSelector))
427 outElements.push_back(elementXML);
428
429 for (const auto &child: elementXML->getChildren()) {
430 findMatchedElements(outElements, xpathSelector, child);
431 }
432 }
433
434 void Preference::deMixResMapping(const ElementPtr &rootXML) {
435 if (!rootXML || this->_resMixedMapping.empty())

Callers 2

patchActionBoundsMethod · 0.95
resolveBlackWidgetsMethod · 0.95

Calls 2

matchXpathSelectorMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected