Right now, Parsoid calls $env->getDataAccess()->getFileInfo() and then manually constructs the html for a file, for example AddMediaInfo::handleImage(). This means that it would need it a native implementation for all file types. This leads to problems like T305210 where the implementation is missing features.
The current code can probably stick around for the standalone version.