ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

Fullscreen API implementation

Open theIDinside opened this issue 1 year ago • 20 comments

This PR implements the Fullscreen API.

The final commit also adds some Qt UI (an "exit fullscreen" button that animates from the top down, sort of like how Chrome does it, and also Firefox). For Qt-backends, the escape key also exits out of fullscreen, fully.

The spec can be found here.

New web platform test results (fullscreen/api) with this patch series applied:

Ran 57 tests finished in 13.7 seconds.
  • 36 ran as expected. 0 tests skipped.
  • 1 tests had errors unexpectedly
  • 1 tests timed out unexpectedly
  • 21 tests had unexpected subtest results

(up from 0 expected to 36. Another test succeeds when #4329 is applied)

Additional work that needs to happen:

  • https://fullscreen.spec.whatwg.org/#dom-document-fullscreenenabled needs to be implemented fully, where a document's "allowed to use" can be deterimined by the allowFullscreen attribute set on an iframe. This attribute can not be changed dynamically and once set for a document, is set for the rest of it's life time.

Additional work that's required can be determined by the WPT suite.

theIDinside avatar Apr 11 '25 19:04 theIDinside

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Apr 11 '25 20:04 github-actions[bot]

First comment before review: Make sure your commit messages follow the guidelines. e.g. Imperative verbs, not past tense. Do the thing not Did the thing

ADKaster avatar Apr 12 '25 22:04 ADKaster

The missing visit on document::m_fullscreen_element needs fixed: https://github.com/LadybirdBrowser/ladybird/actions/runs/14411993971/job/40447984611?pr=4330#step:11:1711

Make sure your IDE doesn't add "" includes. Files that #include a missing local file: Libraries/LibWeb/CSS/SelectorEngine.cpp Libraries/LibWeb/DOM/Element.cpp UI/Qt/BrowserWindow.cpp

And be sure to use the same version of clang-format as CI.

You should invest in pre-commit https://github.com/LadybirdBrowser/ladybird/blob/master/CONTRIBUTING.md#commit-hooks

ADKaster avatar Apr 12 '25 22:04 ADKaster

The missing visit on document::m_fullscreen_element needs fixed: https://github.com/LadybirdBrowser/ladybird/actions/runs/14411993971/job/40447984611?pr=4330#step:11:1711

Make sure your IDE doesn't add "" includes. Files that #include a missing local file: Libraries/LibWeb/CSS/SelectorEngine.cpp Libraries/LibWeb/DOM/Element.cpp UI/Qt/BrowserWindow.cpp

And be sure to use the same version of clang-format as CI.

You should invest in pre-commit https://github.com/LadybirdBrowser/ladybird/blob/master/CONTRIBUTING.md#commit-hooks

Thanks! i'll do that, I thought I had snuffed out all the style issues, but clearly I did not.

theIDinside avatar Apr 13 '25 12:04 theIDinside

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Apr 14 '25 10:04 github-actions[bot]

@theIDinside looks like the linter check is failing in idl file, it's likely an indentation issue. It should be:

enum FullscreenNavigationUI {
    "auto",
    "show",
    "hide"
};

dictionary FullscreenOptions {
    FullscreenNavigationUI navigationUI = "auto";
};

4 spaces indent. Maybe in other places too

teaalltr avatar Apr 17 '25 15:04 teaalltr

@theIDinside looks like the linter check is failing in idl file, it's likely an indentation issue. It should be:

enum FullscreenNavigationUI {
    "auto",
    "show",
    "hide"
};

dictionary FullscreenOptions {
    FullscreenNavigationUI navigationUI = "auto";
};

4 spaces indent. Maybe in other places too

Fixed it. Rebased on most current master.

theIDinside avatar Apr 18 '25 11:04 theIDinside

Fixed most of your nits & issues @ADKaster. Rebased onto master. Also changed the last commit message (one pertaining to Qt) - which can be viewed as an entirely preliminary commit and one that can be taken off completely. Now that I've added the "hit the escape key" separately, and added that logic as a new commit, this should just work for any backend going forward (obviously, the displayed UI stuff like "here's an exit button" would have to be implemented though).

theIDinside avatar Apr 25 '25 10:04 theIDinside

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar May 02 '25 21:05 github-actions[bot]

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar May 11 '25 18:05 github-actions[bot]

These new round of changes to address nits and other things, I also threw in the implementation for ShadowRoot, which means that our wpt test score for fullscreen/api for this PR gets a small bump to 43 when ran locally.

Fixed a bug in the element ready check steps, where it should check that it's an <svg> element not just "any ol' svg element-kind".

theIDinside avatar Jun 08 '25 12:06 theIDinside

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Jun 10 '25 16:06 github-actions[bot]

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Jun 16 '25 11:06 github-actions[bot]

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Jul 16 '25 22:07 github-actions[bot]

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Jul 18 '25 10:07 github-actions[bot]

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Jul 23 '25 21:07 github-actions[bot]

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Aug 08 '25 17:08 github-actions[bot]

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Aug 20 '25 07:08 github-actions[bot]

Just updating with a comment. Maybe @awesomekling can take a quick look? Would be greatly appreciated.

theIDinside avatar Aug 27 '25 13:08 theIDinside

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

github-actions[bot] avatar Sep 01 '25 19:09 github-actions[bot]

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar Sep 23 '25 02:09 github-actions[bot]

This pull request has been closed because it has not had recent activity. Feel free to open a new pull request if you wish to still contribute these changes. Thank you for your contributions!

github-actions[bot] avatar Oct 01 '25 02:10 github-actions[bot]