We present measurements of the power-dependent microwave surface impedance of YBa2Cu3O7−δ thin films, performed using patterned coplanar waveguide (CPW) resonators at 5.87 GHz and 76 K. We compare these resonator measurements with third-harmonic generation measurements performed on CPW transmission lines of the same geometry patterned onto the same thin-film sample at the same frequency and temperature. We find that the power-dependent surface reactance Xs(Prf) is directly related to the magnitude of the generated third-harmonic signal, indicating a common origin for both of these manifestations of nonlinearity in high temperature superconductor (HTS) devices. These results are consistent with the nonlinear response generated by a current-dependent penetration depth λ(J), which provides a material limitation on the linearity that can be achieved in any practical HTS microwave device.