This has been disussed quite a bit lately. The phrasing "do you mind" implies that the person won't mind. " If B said "Yes, I do mind, actually" it would probably be seen as rude.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.