MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / addMappedElement

Method addMappedElement

src/main/java/org/htmlunit/html/HtmlPage.java:1852–1861  ·  view source on GitHub ↗

Adds an element to the ID and name maps, if necessary. @param element the element to be added to the ID and name maps @param recurse indicates if children must be added too

(final DomElement element, final boolean recurse)

Source from the content-addressed store, hash-verified

1850 * @param recurse indicates if children must be added too
1851 */
1852 void addMappedElement(final DomElement element, final boolean recurse) {
1853 // Index is built lazily; skip while not built. ensureMappedElementsBuilt()
1854 // walks the tree once and populates everything on first read.
1855 if (!mappedElementsBuilt_) {
1856 return;
1857 }
1858 if (isAncestorOf(element)) {
1859 addElement(element, recurse);
1860 }
1861 }
1862
1863 private void ensureMappedElementsBuilt() {
1864 if (mappedElementsBuilt_) {

Callers 4

removeAttributeMethod · 0.95
notifyNodeAddedMethod · 0.95
setTextContentMethod · 0.80

Calls 2

addElementMethod · 0.95
isAncestorOfMethod · 0.80

Tested by

no test coverage detected