Lines Matching refs:parent
138 public $parent = null;
163 $this->parent = null;
241 function parent($parent = null)
246 if ($parent !== null) {
247 $this->parent = $parent;
248 $this->parent->nodes[] = $this;
249 $this->parent->children[] = $this;
252 return $this->parent;
291 if ($this->parent === null) {
295 $idx = array_search($this, $this->parent->children, true);
297 if ($idx !== false && isset($this->parent->children[$idx + 1])) {
298 return $this->parent->children[$idx + 1];
306 if ($this->parent === null) {
310 $idx = array_search($this, $this->parent->children, true);
313 return $this->parent->children[$idx - 1];
324 if ($this->parent === null) {
328 $ancestor = $this->parent;
339 $ancestor = $ancestor->parent;
575 // Find parent closing tag if the current element doesn't have a closing
579 $parent = $this->parent;
580 while (!isset($parent->_[HDOM_INFO_END]) && $parent !== null) {
582 $parent = $parent->parent;
584 $end += $parent->_[HDOM_INFO_END];
594 && $this->parent
595 && in_array($this, $this->parent->children)) { // Next-Sibling Combinator
596 $index = array_search($this, $this->parent->children, true) + 1;
597 if ($index < count($this->parent->children))
598 $nodes[] = $this->parent->children[$index];
600 && $this->parent
601 && in_array($this, $this->parent->children)) { // Subsequent Sibling Combinator
602 $index = array_search($this, $this->parent->children, true);
603 $nodes = array_slice($this->parent->children, $index);
613 if(!$node->parent) {
618 if($pass && !in_array($node, $node->parent->children, true)) {
678 * the 3rd element within it's parent).
688 // Find index of current element in parent
689 foreach ($node->parent->children as $c) {
1161 // Look at all the parent tags of this image to see if they specify a
1282 if ($this->parent) {
1283 $this->parent->removeChild($this);
1340 return $this->parent();
1380 $node->parent($this);
1400 protected $parent;
1602 if (isset($this->parent)) {
1603 $this->parent->clear();
1604 unset($this->parent);
1642 $this->parent = $this->root;
1829 $parent_lower = strtolower($this->parent->tag);
1832 // The end tag is supposed to close the parent tag. Handle situations
1840 $this->parent->_[HDOM_INFO_END] = 0;
1841 $org_parent = $this->parent;
1845 while (($this->parent->parent)
1846 && strtolower($this->parent->tag) !== $tag_lower
1848 $this->parent = $this->parent->parent;
1852 if (strtolower($this->parent->tag) !== $tag_lower) {
1853 $this->parent = $org_parent; // restore origonal parent
1855 if ($this->parent->parent) {
1856 $this->parent = $this->parent->parent;
1859 $this->parent->_[HDOM_INFO_END] = $this->cursor;
1862 } elseif (($this->parent->parent)
1866 // parent doesn't have an end tag
1867 $this->parent->_[HDOM_INFO_END] = 0; // No end tag
1868 $org_parent = $this->parent;
1872 while (($this->parent->parent)
1873 && strtolower($this->parent->tag) !== $tag_lower
1875 $this->parent = $this->parent->parent;
1879 if (strtolower($this->parent->tag) !== $tag_lower) {
1880 $this->parent = $org_parent; // restore origonal parent
1881 $this->parent->_[HDOM_INFO_END] = $this->cursor;
1884 } elseif (($this->parent->parent)
1885 && strtolower($this->parent->parent->tag) === $tag_lower
1887 $this->parent->_[HDOM_INFO_END] = 0;
1888 $this->parent = $this->parent->parent;
1894 // Set end position of parent tag to current cursor position
1895 $this->parent->_[HDOM_INFO_END] = $this->cursor;
1897 if ($this->parent->parent) {
1898 $this->parent = $this->parent->parent;
1969 while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)])) {
1970 $this->parent->_[HDOM_INFO_END] = 0;
1971 $this->parent = $this->parent->parent;
1973 $node->parent = $this->parent;
2065 // reset parent
2067 $this->parent = $node;
2133 $node->parent = $this->parent;
2134 $this->parent->nodes[] = $node;
2136 $this->parent->children[] = $node;