Open Bug 1842208 Opened 2 years ago Updated 18 days ago

screen.orientation.lock should be allowed when window is fullscreen and owner document isn't fullscreen

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

People

(Reporter: m_kato, Assigned: m_kato)

References

(Blocks 1 open bug, )

Details

Attachments

(2 files)

In the spec, (https://w3c.github.io/screen-orientation/#dfn-pre-lock-conditions), per-lock-condition isn't well-defined.

Gecko only allows document is pending fullscreen (bug 1744288. This is YouTube case) or fullscreen only. But Chrome allows that window is fullscreen even if ower document isn't fullscreen.

WPT (https://searchfox.org/mozilla-central/source/testing/web-platform/tests/screen-orientation/unlock.html) has the following test

  promise_test(async (t) => {
    t.add_cleanup(makeCleanup());
    await test_driver.bless("request full screen");
    await document.documentElement.requestFullscreen();
    const iframe = await attachIframe();
    const promise = iframe.contentWindow.screen.orientation.lock(
      getOppositeOrientation()
    );
    screen.orientation.unlock();
    await promise_rejects_dom(
      t,
      "AbortError",
      iframe.contentWindow.DOMException,
      promise
    );
  }, "unlock() aborts a pending lock request across documents");

Although iframe.contentWindow isn't fullscreen state, screen.orientation.lock is expectedly successful since parent document is fullscreen.

Assignee: nobody → m_kato
Severity: -- → S3

Currently, our per-lock condition for screen orientation lock API is
whether current document is fullscreen.

But Chrome and some WPT allow if nested iframe is fullscreen.

So I would like to allow screen orientation lock if nested iframe is
fullscreen and it is same origin.

Also, Chrome seems to allow it even if it is cross origin. If we should
allow it, I will work on it later.

After fixing part 1, /screen-orientation/fullscreen-interactions.html in
wpt is failure. this test doesn't work well even if part 1 isn't fixed.

Before fullscreen has been entered, fullscreen operation is canceled, we
should abort screen lock with security error.

Is there a spec bug for clarifying the spec's language?

(In reply to Peter Van der Beken [:peterv] from comment #3)

Is there a spec bug for clarifying the spec's language?

I filed https://github.com/w3c/screen-orientation/issues/255.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: