With no doctype
tag, Chrome reports the same value for both calls.
Adding a strict doctype like <!DOCTYPE html>
causes the values to work as advertised.
The doctype
tag must be the very first thing in your document. E.g., you can't have any text before it, even if it doesn't render anything.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…