Fix #13265 #13332: traversing methods with text nodes. Close gh-1145.