Prevent double counting of DM nodes in getNodeAndOffset

About grouped templates, for example, render multiple siblings
in the DOM, but still have a DM width of 2.

Bug: 67985
Change-Id: Id65e858b90bc7ab5a4d6ba715db30574691817b9
(cherry picked from commit 706e4b3164485b4c156569d1c3b054c6e8268d2f)