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

Method deleteElement

native/desc/Element.cpp:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 void Element::deleteElement() {
27 auto parentOfElement = this->getParent();
28 if (parentOfElement.expired()) {
29 BLOGE("%s", "element is a root elements");
30 return;
31 }
32 auto iter = std::remove_if(parentOfElement.lock()->_children.begin(),
33 parentOfElement.lock()->_children.end(),
34 [&](const ElementPtr &elem) { return elem.get() == this; }
35 );
36 if (iter != parentOfElement.lock()->_children.end()) {
37 parentOfElement.lock()->_childCount--;
38 parentOfElement.lock()->_children.erase(iter);
39 }
40 this->_parent.reset();
41 }
42
43/// According to given xpath selector, containing text, content, classname, resource id, test if
44/// this current element has the same property value as the given xpath selector.

Callers 1

resolveBlackWidgetsMethod · 0.80

Calls 5

getParentMethod · 0.95
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected