Lines Matching defs:parent

135 	public $parent = null;
160 $this->parent = null;
238 function parent($parent = null)
243 if ($parent !== null) {
244 $this->parent = $parent;
245 $this->parent->nodes[] = $this;
246 $this->parent->children[] = $this;
249 return $this->parent;
288 if ($this->parent === null) {
292 $idx = array_search($this, $this->parent->children, true);
294 if ($idx !== false && isset($this->parent->children[$idx + 1])) {
295 return $this->parent->children[$idx + 1];
303 if ($this->parent === null) {
307 $idx = array_search($this, $this->parent->children, true);
310 return $this->parent->children[$idx - 1];
321 if ($this->parent === null) {
325 $ancestor = $this->parent;
336 $ancestor = $ancestor->parent;
572 // Find parent closing tag if the current element doesn't have a closing
576 $parent = $this->parent;
577 while (!isset($parent->_[HDOM_INFO_END]) && $parent !== null) {
579 $parent = $parent->parent;
581 $end += $parent->_[HDOM_INFO_END];
591 && $this->parent
592 && in_array($this, $this->parent->children)) { // Next-Sibling Combinator
593 $index = array_search($this, $this->parent->children, true) + 1;
594 if ($index < count($this->parent->children))
595 $nodes[] = $this->parent->children[$index];
597 && $this->parent
598 && in_array($this, $this->parent->children)) { // Subsequent Sibling Combinator
599 $index = array_search($this, $this->parent->children, true);
600 $nodes = array_slice($this->parent->children, $index);
610 if(!$node->parent) {
622 if($pass && !in_array($node, $node->parent->children, true)) {
682 * the 3rd element within it's parent).
692 // Find index of current element in parent
693 foreach ($node->parent->children as $c) {
1165 // Look at all the parent tags of this image to see if they specify a
1286 if ($this->parent) {
1287 $this->parent->removeChild($this);
1344 return $this->parent();
1384 $node->parent($this);
1406 protected $parent;
1608 if (isset($this->parent)) {
1609 $this->parent->clear();
1610 unset($this->parent);
1648 $this->parent = $this->root;
1835 $parent_lower = strtolower($this->parent->tag);
1838 // The end tag is supposed to close the parent tag. Handle situations
1846 $this->parent->_[HDOM_INFO_END] = 0;
1847 $org_parent = $this->parent;
1851 while (($this->parent->parent)
1852 && strtolower($this->parent->tag) !== $tag_lower
1854 $this->parent = $this->parent->parent;
1858 if (strtolower($this->parent->tag) !== $tag_lower) {
1859 $this->parent = $org_parent; // restore origonal parent
1861 if ($this->parent->parent) {
1862 $this->parent = $this->parent->parent;
1865 $this->parent->_[HDOM_INFO_END] = $this->cursor;
1868 } elseif (($this->parent->parent)
1872 // parent doesn't have an end tag
1873 $this->parent->_[HDOM_INFO_END] = 0; // No end tag
1874 $org_parent = $this->parent;
1878 while (($this->parent->parent)
1879 && strtolower($this->parent->tag) !== $tag_lower
1881 $this->parent = $this->parent->parent;
1885 if (strtolower($this->parent->tag) !== $tag_lower) {
1886 $this->parent = $org_parent; // restore origonal parent
1887 $this->parent->_[HDOM_INFO_END] = $this->cursor;
1890 } elseif (($this->parent->parent)
1891 && strtolower($this->parent->parent->tag) === $tag_lower
1893 $this->parent->_[HDOM_INFO_END] = 0;
1894 $this->parent = $this->parent->parent;
1900 // Set end position of parent tag to current cursor position
1901 $this->parent->_[HDOM_INFO_END] = $this->cursor;
1903 if ($this->parent->parent) {
1904 $this->parent = $this->parent->parent;
1975 while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)])) {
1976 $this->parent->_[HDOM_INFO_END] = 0;
1977 $this->parent = $this->parent->parent;
1979 $node->parent = $this->parent;
2071 // reset parent
2073 $this->parent = $node;
2139 $node->parent = $this->parent;
2140 $this->parent->nodes[] = $node;
2142 $this->parent->children[] = $node;