Hello & welcome
As you are complaining that swelling appears while drinking or eating only this may be a case of salivary duct obstruction.
Because salivary glands get stimulated and secrete saliva as soon as you intake first bolus of food in the mouth, and if the opening ducts get blocked due to some calculus or any other region saliva can not be drained in mouth and this accumulated saliva can lead to swelling that is painful in nature and gradually subside when you are not drinking or eating anything.
so visit to your dentist
and go for further check up.
bye and take care.