You would be correct in surmising that it is your total damage/(modified) weapon speed. The actual weapon stats don't change - for example if you take an attack speed pot and have a chest piece with a +damage ghost stat, this wouldn't affect the stats of an Axe that you are looking at on the AH, nor does it if you have it in your grubby little mitt.
But masteries, etc., do certainly work.
Trust me, I'm a professional