Introduced resolve target document listener
Test case: resolve target document listener
Merge pull request #663