Determines if a node can reset a form.

@param \DOMElement $node Node.

@return boolean
427719
private function canResetForm(\DOMElement $node)
    {
        $type = $node->hasAttribute('type') ? $node->getAttribute('type') : null;

        return in_array($node->nodeName, array('input', 'button'), true) && 'reset' === $type;
    }
1162841
protected function isWrapped(DomNode $node)
    {
        while ($node = $node->parentNode) {
            if ($node->localName === 'eztemplate' || $node->localName === 'eztemplateinline') {
                return true;
            }
        }

        return false;
    }
595134
public function addChoice(\DOMElement $node) {
		if($node->nodeName != 'input')
			return;
		$inputValue = $node->getAttribute('value');
		$this->choices[] = $inputValue;
		switch($node->getAttribute('type')) {
			case 'radio':
				if($node->getAttribute('checked') == 'checked')
					$this->value = $inputValue;
				break;
			case 'checkbox':
				if($node->getAttribute('checked') == 'checked')
					$this->value = $inputValue;
				break;
		}
	}
1219436
private function normalizeStyleAttributes(\DOMElement $node)
    {
        $normalizedOriginalStyle = preg_replace_callback(
            '/[A-z\\-]+(?=\\:)/S',
            function (array $m) {
                return strtolower($m[0]);
            },
            $node->getAttribute('style')
        );

        // in order to not overwrite existing style attributes in the HTML, we
        // have to save the original HTML styles
        $nodePath = $node->getNodePath();
        if (!isset($this->styleAttributesForNodes[$nodePath])) {
            $this->styleAttributesForNodes[$nodePath] = $this->parseCssDeclarationsBlock($normalizedOriginalStyle);
            $this->visitedNodes[$nodePath] = $node;
        }

        $node->setAttribute('style', $normalizedOriginalStyle);
    }
69244
public function add(\DOMElement $node) {
		$name = $node->getAttribute('name');
		if($this->has($name))
			$this->get($name)->addChoice($node);
		else
			$this->set($name, new Field($node));
	}
681719
public function appliesTo(Node $node)
    {
        if ($node->wasCancelled()
            && $this->result == self::NODE_RESULT_CANCEL
        ) {
            return true;
        } elseif ($node->isComplete()
            && $this->result == self::NODE_RESULT_COMPLETE
            && (!isset($this->data['input'])
                || $this->data['input'] == $node->getInput()
                )
        ) {
            return true;
        } elseif ($node->maxInputsReached()
            && $this->result == self::NODE_RESULT_MAX_ATTEMPTS_REACHED
        ) {
            return true;
        }
        return false;
    }
794375
static public function hasClass(DOMElement $node, $class)
    {
        if (is_array($class) === false) {
            $class = array($class);
        }

        $attr = explode("\x20", $node->getAttribute('class'));

        foreach ($class as $c) {
            if (in_array($c, $attr) === false) {
                return false;
            }
        }

        return true;
    }
714325
protected function checkHelperConditional(Mage_Core_Model_Layout_Element $node)
    {
        if (isset($node['ifhelper']) && ($helperString = trim((string)$node['ifhelper']))) {
            $negativeCheck = (substr($helperString, 0, 1) === '!');
            $helperString = ($negativeCheck ? substr($helperString, 1) : $helperString);
            if ((bool)$this->getHelperMethodValue($helperString) === $negativeCheck) {
                return false;
            }
        }

        return true;
    }
1181808
public function saveConfig(Node $node = null)
    {
        if (!empty($node)) return $this->saveNode($node);

        return true;
    }
251088
protected function checkNode(DOMNode $node, Tag $tag)
	{
		if ($node instanceof DOMAttr)
		{
			$this->checkAttributeNode($node, $tag);
		}
		elseif ($node instanceof DOMElement)
		{
			if ($node->namespaceURI === self::XMLNS_XSL && $node->localName === 'copy-of')
			{
				$this->checkCopyOfNode($node, $tag);
			}
			else
			{
				$this->checkElementNode($node, $tag);
			}
		}
	}
833117
private function isBool(Node $node) {
		if ($node instanceof ConstFetch) {
			$const = $node->name->parts[0];
			if (isset($this->constMap[$const])) {
				return is_bool($this->constMap[$const]);
			}
	
			return is_bool($const);
		}
	}
610156
private function ensureNodeClass(DOMNode $node)
    {
        $class = $this->nodeClasses['DOMElement'];

        if (true !== ($node instanceof $class) && $node instanceof \DOMElement) {
            return $node->ownerDocument->importNode($node, true);
        }

        return $node;
    }
312554
final protected function _setRoot($node = 'root')
	{
		if (is_string($node)) {
			$this->body = $this->appendChild($this->createElement($node));
		} elseif (is_object($node) and $node instanceof \DOMNode) {
			$this->body = $this->appendChild($node);
		} else {
			trigger_error(
				sprintf('$node must be either a DOMNode or string, %s given', gettype($node)),
				E_USER_WARNING
			);
		}
		return $this;
	}
361247
public function enterNode(Node $node)
    {
        if ($node instanceof Assign && $node->var instanceof Variable && $node->var->name === 'this') {
            throw new FatalErrorException('Cannot re-assign $this', 0, E_ERROR, null, $node->getLine());
        }
    }
176942
public function is($node)
    {
        if ($node instanceof Element) {
            $node = $node->getNode();
        }

        if (!$node instanceof DOMNode) {
            throw new InvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s or DOMNode, %s given', __METHOD__, __CLASS__, (is_object($node) ? get_class($node) : gettype($node))));
        }

        return $this->node->isSameNode($node);
    }
465712
protected function isFormattingSpan(DOMElement $node)
	{
		if ($node->nodeName !== 'span')
		{
			return false;
		}

		if ($node->getAttribute('class') === '' && $node->getAttribute('style') === '')
		{
			return false;
		}

		foreach ($node->attributes as $attrName => $attribute)
		{
			if ($attrName !== 'class' && $attrName !== 'style')
			{
				return false;
			}
		}

		return true;
	}
238678
public static function is_block_tag( \DOMNode $node ) {
		return $node instanceof \DOMElement && isset( self::$block_tags[ $node->tagName ] );
	}