public function load($file) {
        // Handle the case where file is a resource.
        if (is_resource($file)) {
            // FIXME: We need a StreamInputStream class.
            return $this->loadHTML(stream_get_contents($file));
        }

        $input = new HTML5_Inputstream_File($file);

        return $this->parse($input);
    }