This merges #94204 with the only difference being that I modified the history into three commits that should be easier to review and understand. Original history: 3524f4cfa9 Modified history: df267a4cca
3524f4cfa9
df267a4cca