Reland r165040 "Make ancestors of modal <dialog> inert"

Original code review: https://codereview.chromium.org/133393002/
r165040 was reverted due to failing a11y tests in
content_browsertests; they have been disabled and will be rebaselined
after this change is rolled in.

BUG=329407
TBR=esprehn

Review URL: https://codereview.chromium.org/139183002

git-svn-id: svn://svn.chromium.org/blink/trunk@165211 bbb929c8-8fbe-4397-9dbb-9b2b20218538