layout invalidation fix

constrain the document changes to, at a minimum, include the commented
out areas

fixes #11