*aState = NS_STATIC_CAST(nsILayoutHistoryState *, state);
NS_NewLayoutHistoryState(nsILayoutHistoryState** aState){    NS_PRECONDITION(aState != nsnull, "null ptr");    if (! aState)        return NS_ERROR_NULL_POINTER;    *aState = new nsLayoutHistoryState();    if (! *aState)        return NS_ERROR_OUT_OF_MEMORY;    NS_ADDREF(*aState);    return NS_OK;}