Surface attached nanobubbles populate surfaces submerged in water. These nanobubbles have a much larger contact angle and longer lifetime than predicted by classical theory. Moreover, it is difficult to distinguish them from hydrophobic droplets, e.g., polymeric contamination, using standard atomic force microscopy. Here, we report fast dynamics of a three phase contact line moving over surface nanobubbles, polymeric droplets, and hydrophobic particles. The dynamics is distinct: across polymeric droplets the contact line quickly jumps and hydrophobic particles pin the contact line, while surface nanobubbles rapidly shrink once merging with the contact line, suggesting a method to differentiate nanoscopic gaseous, liquid, and solid structures. Although the collapse process of surface nanobubbles occurs within a few milliseconds, we show that it is dominated by microscopic dynamics rather than bulk hydrodynamics.