add onBeforeMask
Merge branch '2.x' into 2.6