private function checkTagNameAndAttributes(Element $element, $shortcutId, $expectedTagName, $expectedAttribs)
	{
		$actualTagName = $element->name();
		if (isset($expectedTagName) && $actualTagName !== $expectedTagName)
		{
			throw new ViewStateException(__METHOD__ . ": Element '$shortcutId' is expected to be a tag '{$expectedTagName}', but is '$actualTagName'.");
		}
		if (isset($expectedAttribs) && is_array($expectedAttribs))
		{
			foreach ($expectedAttribs as $attribName => $expectedValue)
			{
				$actualValue = $element->attribute($attribName);
				if ($actualValue !== $expectedValue)
				{
					throw new ViewStateException(__METHOD__ . ": Expected value of '$attribName' is '$expectedValue' on element '$shortcutId', actual value is '$actualValue'.");
				}
			}
		}
	}