jQuery 該当の要素が表示中か否か isHiddenWithinTree

jQuery の slideToggleで表示するのか非表示にするのかの判断をどうしているのか知りたくて、jQueryの該当コードを確認しました。

var isHiddenWithinTree = function( elem, el ) {

		// isHiddenWithinTree might be called from jQuery#filter function;
		// in that case, element will be second argument
		elem = el || elem;

		// Inline style trumps all
		return elem.style.display === "none" ||
			elem.style.display === "" &&

			// Otherwise, check computed style
			// Support: Firefox <=43 - 45
			// Disconnected elements can have computed display: none, so first confirm that elem is
			// in the document.
			jQuery.contains( elem.ownerDocument, elem ) &&

			jQuery.css( elem, "display" ) === "none";
	};

インラインスタイルで display が none

もしくは

インラインスタイルで display が 指定されていない かつ 対象の要素がdocumentに含まれている かつ  ブラウザで計算済みスタイルのdisplay が none

であれば、対象の要素が現在非表示であると判断し、その後に表示するとしているのですね。