gfx::Factory::CheckSurfaceSize (called with only the size argument) only checks that the size is non-size and the storage required does not exceed int32_t addressable range. But CreateSimilarDrawTarget will reject if any dimension is over 32k. gfx::Factory::AllowedSurfaceSize would check the same, so CheckSurfaceSize is only appropriate in more limited contexts despite seeming more general.
Differential Revision: https://phabricator.services.mozilla.com/D260614