QDoc: Extract atom dispatch from content traversal loop
The content builder's traversal loop mixes iteration with dispatch.
Separating these concerns prepares for format-conditional traversal,
where the loop needs to detect boundary atoms before dispatching
content atoms.
The dispatch function returns the last atom it consumed instead of
void, preparing for atom types that consume trailing atoms from the
chain.
Task-number: QTBUG-144240
Change-Id: I315052b342e72ceca2d1970f80a5e90e52bebbdb
Reviewed-by: Topi Reinio <topi.reinio@qt.io>