shaving 是现在分词,用作时间状语,相当于 while / when (he was) shaving。
类似地,下面句子中的现在分词也是时间状语:
I got rather lost trying to find the station. 我找车站找得晕头转向。
I cut my face shaving this morning. 今天早上我刮胡须时把脸刮破了。
I broke my leg playing football. 我的腿踢足球时骨折了。
						《高考英语备考1号·速效编》
					
						《高考英语备考1号·写作编》
					
						《高中英语晨读晚记》
					
						《高中英语错题笔记》
					
						《零起点考大学英语》