Remove autofill::form_util::ScopedLayoutPreventer

ScopedLayoutPreventer was used to avoid detecting visibility of form
elements in situations when it was believed to cause pre-mature layout
(see Visibility is approximated through
calling IsFocusable on the WebNodes corresponding to forms and their

Looking at recent documentation, though, the WebNode-based API seems
robust enough to prevent such dangerous calls:
  (1) The contract of Element::IsFocusable() only states the need to
      call Document::UpdateStyleAndLayoutTree() beforehand.
  (2) Document::UpdateStyleAndLayoutTree() does not cause the layout.
  (3) WebNode::IsFocusable() causes calling
      Document::UpdateStyleAndLayoutTree() as necessary before
      delegating to Element::IsFocusable().
See for more context.

As a result, ScopedLayoutPreventer blocked visibility checks
unnecessarily, leading to bugs like

Therefore this CL removes ScopedLayoutPreventer.

Bug: 855598,851808,595078
Change-Id: Ic415919be5c40821dfa965eeb16372ae92ba92d5
Reviewed-by: Vadym Doroshenko <>
Reviewed-by: Stefan Zager <>
Commit-Queue: Vaclav Brozek <>
Cr-Commit-Position: refs/heads/master@{#575859}
4 files changed