Active power filter (APF) based on voltage source inverter (VSI) is one of the important measures for handling the power quality problem. Mathematically, the APF model in a power grid is a typical nonlinear one. The idea of passivity is a powerful tool to study the stabilization of such a nonlinear system. In this paper, a state-space model of the four-leg APF is derived, based on which a new H-infinity controller for current tracking is proposed from the passivity point of view. It can achieve not only asymptotic tracking, but also disturbance attenuation in the sense of L2-gain. Subsequently, a sufficient condition to guarantee the boundedness and desired mean of the DC voltage is also given. This straightforward condition is consistent with the power-balancing law of electrical circuits. Simulations performed on PSCAD platform verify the validity of the new approach.