Consider merging https://chromium.googlesource.com/chromium/blink/+/acc34ea7332c9254511e069181750a7c097790b4 if the hang also reproduces in WebKit The recursion breaks the call stack. We shouldn't do that.
Also see https://code.google.com/p/chromium/issues/detail?id=311317
From Comment 0, the following code exist today: https://github.com/WebKit/WebKit/blob/d03ed349d77c73455b7ba94aa908b7dc0a5eddc8/Source/WebCore/dom/Document.cpp#L3364 While I don't have access to bug mentioned in Comment 01. rniwa@webkit.org - Is this needed? Thanks!