[webkit-changes] [WebKit/WebKit] 47a291: Implement unprefixed :fullscreen pseudo-class

Tim Nguyen noreply at github.com
Wed Dec 7 22:19:31 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 47a29162018212a00fcd6a8861272bbfd7c0c57d
      https://github.com/WebKit/WebKit/commit/47a29162018212a00fcd6a8861272bbfd7c0c57d
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2022-12-07 (Wed, 07 Dec 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/fullscreen/rendering/fullscreen-css-invalidation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/fullscreen/rendering/fullscreen-pseudo-class-support-expected.txt
    M Source/WebCore/css/CSSSelector.cpp
    M Source/WebCore/css/CSSSelector.h
    M Source/WebCore/css/SelectorChecker.cpp
    M Source/WebCore/css/SelectorCheckerTestFunctions.h
    M Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in
    M Source/WebCore/css/fullscreen.css
    M Source/WebCore/cssjit/SelectorCompiler.cpp
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/FullscreenManager.cpp

  Log Message:
  -----------
  Implement unprefixed :fullscreen pseudo-class
https://bugs.webkit.org/show_bug.cgi?id=246041
rdar://100783064

Reviewed by Antti Koivisto.

Defined in https://fullscreen.spec.whatwg.org/#:fullscreen-pseudo-class

This differs from :-webkit-full-screen, since :fullscreen applies to all fullscreen element in the top layer,
as opposed to :-webkit-full-screen, which applies on the top-most one.

Unfortunately, this still does not allow us to remove full style rebuilds for 2 reasons:
- We still need to support :-webkit-full-screen-ancestor/document
- There seems to be a bug where adding position: fixed; & adding to top layer in the same layout causes dirty renderers.

Tests are not necessary, as this is exercised by the user agent stylesheet (which is already well tested by the fullscreen/ directory).

* LayoutTests/imported/w3c/web-platform-tests/fullscreen/rendering/fullscreen-css-invalidation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/fullscreen/rendering/fullscreen-pseudo-class-support-expected.txt:
* Source/WebCore/css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* Source/WebCore/css/CSSSelector.h:
* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* Source/WebCore/css/SelectorCheckerTestFunctions.h:
(WebCore::matchesFullscreenPseudoClass):
(WebCore::matchesWebkitFullScreenPseudoClass):
(WebCore::matchesFullScreenPseudoClass): Deleted.
* Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in:
* Source/WebCore/css/fullscreen.css:
(#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API):
(:root:-webkit-full-screen-document:not(:fullscreen)):
(:fullscreen video,):
(img:fullscreen):
(iframe:fullscreen):
(:not(:root):fullscreen::backdrop):
(:root:-webkit-full-screen-document:not(:-webkit-full-screen)): Deleted.
(:-webkit-full-screen video,): Deleted.
(img:-webkit-full-screen): Deleted.
(iframe:-webkit-full-screen): Deleted.
(:not(:root):-webkit-full-screen::backdrop): Deleted.
* Source/WebCore/cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::JSC_DEFINE_JIT_OPERATION):
(WebCore::SelectorCompiler::addPseudoClassType):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::setFullscreenFlag):
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::willEnterFullscreen):

Canonical link: https://commits.webkit.org/257542@main




More information about the webkit-changes mailing list