W3C home > Mailing lists > Public > public-test-infra@w3.org > April to June 2017

Re: Recommended way to force layout in a test?

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Tue, 18 Apr 2017 23:59:30 -0700
Message-ID: <CABNRm63h6q2MRvf57ic8qAqXq6n+vRfwtiZWo9bjx1uHJ4+s_g@mail.gmail.com>
To: Koji Ishii <kojii@chromium.org>
Cc: public-test-infra <public-test-infra@w3.org>
On Tue, Apr 18, 2017 at 10:06 PM, Koji Ishii <kojii@chromium.org> wrote:
> Hi all,
> Sorry if this was discussed before, but is there a recommended way to force
> layout in a test?

This came up during a F2F meeting we had in Mountain View a couple of
months ago.

We thought it would be a good idea to add a new JS helper file which
contains a list of common operations like this, and let each UA
override its functions in their (potentially private) test environment
to ensure the desired effect.

For example, we can add style-helper.js with code like this:
StyleHelper = {
    updateStyle: (element) => { element.getBoundingClientRect() }

If we let UA test environment override StyleHelper, each engine can
use its own proprietary test-enviornment-only mechanism to force a
style update on the element.

- R. Niwa
Received on Wednesday, 19 April 2017 07:00:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:34:13 UTC