<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[281229] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/281229">281229</a></dd>
<dt>Author</dt> <dd>ntim@apple.com</dd>
<dt>Date</dt> <dd>2021-08-19 02:02:02 -0700 (Thu, 19 Aug 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement ::backdrop pseudo element
https://bugs.webkit.org/show_bug.cgi?id=227801

Reviewed by Antti Koivisto.

This adds UA styles, RenderTreeBuilder support and WebInspector support for ::backdrop.
Some imported blink tests now start passing, some still need proper top layer support.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-values/ch-empty-pseudo-recalc-on-font-load-expected.txt:

Source/JavaScriptCore:

* inspector/protocol/CSS.json:

Source/WebCore:

* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId):
* css/CSSSelector.h:
* css/SelectorPseudoElementTypeMap.in:
* css/dialog.css:
(dialog::backdrop):
(::backdrop):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::protocolValueForPseudoId):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::backdropRenderer const):
(WebCore::RenderElement::setBackdropRenderer):
* rendering/RenderElement.h:
* rendering/RenderObject.h:
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateAfterDescendants):
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updateBackdropRenderer):
* rendering/updating/RenderTreeUpdaterGeneratedContent.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle):

Source/WebInspectorUI:

* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.displayNameForPseudoId):

LayoutTests:

* TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssvalueschemptypseudorecalconfontloadexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ch-empty-pseudo-recalc-on-font-load-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolCSSjson">trunk/Source/JavaScriptCore/inspector/protocol/CSS.json</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorh">trunk/Source/WebCore/css/CSSSelector.h</a></li>
<li><a href="#trunkSourceWebCorecssSelectorPseudoElementTypeMapin">trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in</a></li>
<li><a href="#trunkSourceWebCorecssdialogcss">trunk/Source/WebCore/css/dialog.css</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjecth">trunk/Source/WebCore/rendering/RenderObject.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantscpp">trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantsh">trunk/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
<li><a href="#trunkSourceWebCorerenderingupdatingRenderTreeBuildercpp">trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingupdatingRenderTreeUpdatercpp">trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingupdatingRenderTreeUpdaterGeneratedContentcpp">trunk/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingupdatingRenderTreeUpdaterGeneratedContenth">trunk/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleTreeResolvercpp">trunk/Source/WebCore/style/StyleTreeResolver.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCSSManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/LayoutTests/ChangeLog 2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-08-19  Tim Nguyen  <ntim@apple.com>
+
+        Implement ::backdrop pseudo element
+        https://bugs.webkit.org/show_bug.cgi?id=227801
+
+        Reviewed by Antti Koivisto.
+
+        This adds UA styles, RenderTreeBuilder support and WebInspector support for ::backdrop.
+        Some imported blink tests now start passing, some still need proper top layer support.
+
+        * TestExpectations:
+
</ins><span class="cx"> 2021-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
</span><span class="cx"> 
</span><span class="cx">         [WinCairo] Unreviewed test gardening
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/LayoutTests/TestExpectations  2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -2373,17 +2373,10 @@
</span><span class="cx"> imported/blink/fast/multicol/outlines-at-column-boundaries.html [ ImageOnlyFailure ]
</span><span class="cx"> fast/multicol/multicol-with-child-renderLayer-for-input.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><del>-# ::backdrop
-webkit.org/b/227801 imported/blink/dialog/backdrop-descendant-selector.html [ ImageOnlyFailure ]
-webkit.org/b/227801 imported/blink/dialog/backdrop-does-not-inherit.html [ ImageOnlyFailure ]
-webkit.org/b/227801 imported/blink/dialog/backdrop-dynamic-style-change.html [ ImageOnlyFailure ]
-webkit.org/b/227801 imported/blink/dialog/backdrop-in-flow.html [ ImageOnlyFailure ]
-webkit.org/b/227801 imported/blink/dialog/backdrop-stacking-order.html [ ImageOnlyFailure ]
-
</del><span class="cx"> # Top layer tests
</span><ins>+webkit.org/b/84796 imported/blink/dialog/backdrop-in-flow.html [ ImageOnlyFailure ]
+webkit.org/b/84796 imported/blink/dialog/backdrop-stacking-order.html [ ImageOnlyFailure ]
</ins><span class="cx"> webkit.org/b/84796 imported/blink/dialog/dont-share-style-to-top-layer.html [ ImageOnlyFailure ]
</span><del>-webkit.org/b/84796 imported/blink/dialog/modal-dialog-backdrop.html [ ImageOnlyFailure ]
-webkit.org/b/84796 imported/blink/dialog/modal-dialog-generated-content.html [ ImageOnlyFailure ]
</del><span class="cx"> webkit.org/b/84796 imported/blink/dialog/modal-dialog-in-replaced-renderer.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/84796 imported/blink/dialog/modal-dialog-in-table-column.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/84796 imported/blink/dialog/removed-element-is-removed-from-top-layer.html [ ImageOnlyFailure ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-08-19  Tim Nguyen  <ntim@apple.com>
+
+        Implement ::backdrop pseudo element
+        https://bugs.webkit.org/show_bug.cgi?id=227801
+
+        Reviewed by Antti Koivisto.
+
+        This adds UA styles, RenderTreeBuilder support and WebInspector support for ::backdrop.
+        Some imported blink tests now start passing, some still need proper top layer support.
+
+        * web-platform-tests/css/css-values/ch-empty-pseudo-recalc-on-font-load-expected.txt:
+
</ins><span class="cx"> 2021-08-19  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add support for RTCDtlsTransport
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssvalueschemptypseudorecalconfontloadexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ch-empty-pseudo-recalc-on-font-load-expected.txt (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ch-empty-pseudo-recalc-on-font-load-expected.txt        2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/ch-empty-pseudo-recalc-on-font-load-expected.txt   2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> 
</span><del>-FAIL ch in pseudo-element ::before should be recalculated after loading a web font assert_less_than: expected a number less than 24 but got NaN
-FAIL ch in pseudo-element ::after should be recalculated after loading a web font assert_less_than: expected a number less than 24 but got NaN
-FAIL ch in pseudo-element ::backdrop should be recalculated after loading a web font assert_less_than: expected a number less than 24 but got NaN
</del><ins>+PASS ch in pseudo-element ::before should be recalculated after loading a web font
+PASS ch in pseudo-element ::after should be recalculated after loading a web font
+PASS ch in pseudo-element ::backdrop should be recalculated after loading a web font
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/JavaScriptCore/ChangeLog       2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-08-19  Tim Nguyen  <ntim@apple.com>
+
+        Implement ::backdrop pseudo element
+        https://bugs.webkit.org/show_bug.cgi?id=227801
+
+        Reviewed by Antti Koivisto.
+
+        This adds UA styles, RenderTreeBuilder support and WebInspector support for ::backdrop.
+        Some imported blink tests now start passing, some still need proper top layer support.
+
+        * inspector/protocol/CSS.json:
+
</ins><span class="cx"> 2021-08-18  Yusuke Suzuki  <ysuzuki@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [JSC] Remove op_has_indexed_property related code
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolCSSjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/CSS.json (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/CSS.json  2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/JavaScriptCore/inspector/protocol/CSS.json     2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">                 "before",
</span><span class="cx">                 "after",
</span><span class="cx">                 "selection",
</span><ins>+                "backdrop",
</ins><span class="cx">                 "scrollbar",
</span><span class="cx">                 "scrollbar-thumb",
</span><span class="cx">                 "scrollbar-button",
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/ChangeLog      2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2021-08-19  Tim Nguyen  <ntim@apple.com>
+
+        Implement ::backdrop pseudo element
+        https://bugs.webkit.org/show_bug.cgi?id=227801
+
+        Reviewed by Antti Koivisto.
+
+        This adds UA styles, RenderTreeBuilder support and WebInspector support for ::backdrop.
+        Some imported blink tests now start passing, some still need proper top layer support.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::pseudoId):
+        * css/CSSSelector.h:
+        * css/SelectorPseudoElementTypeMap.in:
+        * css/dialog.css:
+        (dialog::backdrop):
+        (::backdrop):
+        * inspector/agents/InspectorCSSAgent.cpp:
+        (WebCore::protocolValueForPseudoId):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::backdropRenderer const):
+        (WebCore::RenderElement::setBackdropRenderer):
+        * rendering/RenderElement.h:
+        * rendering/RenderObject.h:
+        * rendering/style/RenderStyleConstants.cpp:
+        (WebCore::operator<<):
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/updating/RenderTreeBuilder.cpp:
+        (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):
+        * rendering/updating/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::updateAfterDescendants):
+        * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
+        (WebCore::RenderTreeUpdater::GeneratedContent::updateBackdropRenderer):
+        * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::TreeResolver::resolvePseudoStyle):
+
</ins><span class="cx"> 2021-08-19  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         document.hasFocus() returns true for unfocused pages
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp 2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/css/CSSSelector.cpp    2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -232,6 +232,8 @@
</span><span class="cx">         return PseudoId::Highlight;
</span><span class="cx">     case PseudoElementMarker:
</span><span class="cx">         return PseudoId::Marker;
</span><ins>+    case PseudoElementBackdrop:
+        return PseudoId::Backdrop;
</ins><span class="cx">     case PseudoElementBefore:
</span><span class="cx">         return PseudoId::Before;
</span><span class="cx">     case PseudoElementAfter:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.h (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.h   2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/css/CSSSelector.h      2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -180,6 +180,7 @@
</span><span class="cx">         enum PseudoElementType {
</span><span class="cx">             PseudoElementUnknown = 0,
</span><span class="cx">             PseudoElementAfter,
</span><ins>+            PseudoElementBackdrop,
</ins><span class="cx">             PseudoElementBefore,
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">             PseudoElementCue,
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorPseudoElementTypeMapin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in 2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in    2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> after
</span><ins>+backdrop
</ins><span class="cx"> before
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> cue
</span></span></pre></div>
<a id="trunkSourceWebCorecssdialogcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/dialog.css (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/dialog.css      2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/css/dialog.css 2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -24,3 +24,16 @@
</span><span class="cx">     max-width: calc(100% - 6px - 2em);
</span><span class="cx">     max-height: calc(100% - 6px - 2em);
</span><span class="cx"> }
</span><ins>+
+dialog::backdrop {
+    background: rgba(0, 0, 0, 0.1);
+}
+
+::backdrop {
+    display: block;
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreinspectoragentsInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp      2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp 2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -449,6 +449,8 @@
</span><span class="cx">         return Protocol::CSS::PseudoId::FirstLetter;
</span><span class="cx">     case PseudoId::Marker:
</span><span class="cx">         return Protocol::CSS::PseudoId::Marker;
</span><ins>+    case PseudoId::Backdrop:
+        return Protocol::CSS::PseudoId::Backdrop;
</ins><span class="cx">     case PseudoId::Before:
</span><span class="cx">         return Protocol::CSS::PseudoId::Before;
</span><span class="cx">     case PseudoId::After:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp 2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp    2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -2375,4 +2375,14 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WeakPtr<RenderBlockFlow> RenderElement::backdropRenderer() const
+{
+    return hasRareData() ? rareData().backdropRenderer : nullptr;
</ins><span class="cx"> }
</span><ins>+
+void RenderElement::setBackdropRenderer(RenderBlockFlow& renderer)
+{
+    ensureRareData().backdropRenderer = makeWeakPtr(renderer);
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h   2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/RenderElement.h      2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -257,6 +257,9 @@
</span><span class="cx">     virtual void suspendAnimations(MonotonicTime = MonotonicTime()) { }
</span><span class="cx">     std::unique_ptr<RenderStyle> animatedStyle();
</span><span class="cx"> 
</span><ins>+    WeakPtr<RenderBlockFlow> backdropRenderer() const;
+    void setBackdropRenderer(RenderBlockFlow&);
+
</ins><span class="cx"> protected:
</span><span class="cx">     enum BaseTypeFlag {
</span><span class="cx">         RenderLayerModelObjectFlag  = 1 << 0,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.h (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.h    2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/RenderObject.h       2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> class RenderBoxModelObject;
</span><span class="cx"> class RenderInline;
</span><span class="cx"> class RenderBlock;
</span><ins>+class RenderBlockFlow;
</ins><span class="cx"> class RenderElement;
</span><span class="cx"> class RenderFragmentedFlow;
</span><span class="cx"> class RenderGeometryMap;
</span><span class="lines">@@ -938,6 +939,7 @@
</span><span class="cx"> 
</span><span class="cx">         // From RenderElement
</span><span class="cx">         std::unique_ptr<RenderStyle> cachedFirstLineStyle;
</span><ins>+        WeakPtr<RenderBlockFlow> backdropRenderer;
</ins><span class="cx">     };
</span><span class="cx">     
</span><span class="cx">     const RenderObject::RenderObjectRareData& rareData() const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp    2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp       2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -887,6 +887,7 @@
</span><span class="cx">     case PseudoId::FirstLetter: ts << "first-letter"; break;
</span><span class="cx">     case PseudoId::Highlight: ts << "highlight"; break;
</span><span class="cx">     case PseudoId::Marker: ts << "marker"; break;
</span><ins>+    case PseudoId::Backdrop: ts << "backdrop"; break;
</ins><span class="cx">     case PseudoId::Before: ts << "before"; break;
</span><span class="cx">     case PseudoId::After: ts << "after"; break;
</span><span class="cx">     case PseudoId::Selection: ts << "selection"; break;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h      2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h 2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx">     Before,
</span><span class="cx">     After,
</span><span class="cx">     Selection,
</span><ins>+    Backdrop,
</ins><span class="cx">     Scrollbar,
</span><span class="cx"> 
</span><span class="cx">     // Internal:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingupdatingRenderTreeBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp    2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp       2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -807,6 +807,12 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // Also destroy ::backdrop along with element if there is one
+    if (is<RenderElement>(rendererToDestroy)) {
+        if (auto backdropRenderer = downcast<RenderElement>(rendererToDestroy).backdropRenderer())
+            destroy(*backdropRenderer);
+    }
+
</ins><span class="cx">     auto isAnonymousAndSafeToDelete = [] (const auto& renderer) {
</span><span class="cx">         return renderer.isAnonymous() && !renderer.isRenderView() && !renderer.isRenderFragmentedFlow();
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingupdatingRenderTreeUpdatercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp    2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp       2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -266,6 +266,7 @@
</span><span class="cx">     if (!renderer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    generatedContent().updateBackdropRenderer(*renderer);
</ins><span class="cx">     m_builder.updateAfterDescendants(*renderer);
</span><span class="cx"> 
</span><span class="cx">     if (element.hasCustomStyleResolveCallbacks() && updates && updates->update.change == Style::Change::Renderer)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingupdatingRenderTreeUpdaterGeneratedContentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp    2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp       2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -172,6 +172,45 @@
</span><span class="cx">     m_updater.m_builder.updateAfterDescendants(*pseudoElementRenderer);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderTreeUpdater::GeneratedContent::updateBackdropRenderer(RenderElement& renderer)
+{
+    // ::backdrop does not inherit style, hence using the view style as parent style
+    auto style = renderer.getCachedPseudoStyle(PseudoId::Backdrop, &renderer.view().style());
+
+    // Destroy ::backdrop if new element no longer is in top layer, or if it is hidden
+    if ((renderer.element() && !renderer.element()->isInTopLayer()) || !style || style->display() == DisplayType::None) {
+        if (WeakPtr backdropRenderer = renderer.backdropRenderer())
+            m_updater.m_builder.destroy(*backdropRenderer);
+        return;
+    }
+
+    auto newStyle = RenderStyle::clone(*style);
+    RenderPtr<RenderBlockFlow> newBackdropRenderer;
+    auto backdropRenderer = renderer.backdropRenderer();
+    if (backdropRenderer)
+        backdropRenderer->setStyle(WTFMove(newStyle));
+    else {
+        newBackdropRenderer = WebCore::createRenderer<RenderBlockFlow>(renderer.document(), WTFMove(newStyle));
+        newBackdropRenderer->initializeStyle();
+        backdropRenderer = makeWeakPtr(newBackdropRenderer.get());
+        renderer.setBackdropRenderer(*backdropRenderer);
+    }
+
+    // Update or attach to renderer parent
+    auto currentParent = makeWeakPtr(backdropRenderer->parent());
+    auto newParent = makeWeakPtr(renderer.parent());
+
+    ASSERT(newParent, "Should have new parent");
+
+    if (newParent == currentParent)
+        return;
+
+    if (currentParent)
+        m_updater.m_builder.attach(*newParent, m_updater.m_builder.detach(*currentParent, *backdropRenderer, RenderTreeBuilder::CanCollapseAnonymousBlock::No), &renderer);
+    else
+        m_updater.m_builder.attach(*newParent, WTFMove(newBackdropRenderer), &renderer);
+}
+
</ins><span class="cx"> bool RenderTreeUpdater::GeneratedContent::needsPseudoElement(const Style::ElementUpdate* update)
</span><span class="cx"> {
</span><span class="cx">     if (!update)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingupdatingRenderTreeUpdaterGeneratedContenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h      2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.h 2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> public:
</span><span class="cx">     GeneratedContent(RenderTreeUpdater&);
</span><span class="cx"> 
</span><ins>+    void updateBackdropRenderer(RenderElement&);
</ins><span class="cx">     void updatePseudoElement(Element&, const Style::ElementUpdates&, PseudoId);
</span><span class="cx">     void updateRemainingQuotes();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleTreeResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleTreeResolver.cpp 2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp    2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -275,6 +275,8 @@
</span><span class="cx"> 
</span><span class="cx"> std::optional<ElementUpdate> TreeResolver::resolvePseudoStyle(Element& element, const ElementUpdate& elementUpdate, PseudoId pseudoId)
</span><span class="cx"> {
</span><ins>+    ASSERT(pseudoId != PseudoId::Backdrop, "This method does not handle ::backdrop currently");
+
</ins><span class="cx">     if (pseudoId == PseudoId::Marker && elementUpdate.style->display() != DisplayType::ListItem)
</span><span class="cx">         return { };
</span><span class="cx">     if (elementUpdate.style->display() == DisplayType::None)
</span><span class="lines">@@ -281,10 +283,10 @@
</span><span class="cx">         return { };
</span><span class="cx">     if (!elementUpdate.style->hasPseudoStyle(pseudoId))
</span><span class="cx">         return { };
</span><del>-    
</del><ins>+
</ins><span class="cx">     auto& parentStyle = *elementUpdate.style;
</span><span class="cx">     auto* parentBoxStyle = parentBoxStyleForPseudo(elementUpdate);
</span><del>-    
</del><ins>+
</ins><span class="cx">     auto pseudoStyle = scope().resolver->pseudoStyleForElement(element, { pseudoId }, parentStyle, parentBoxStyle, &scope().selectorFilter);
</span><span class="cx">     if (!pseudoStyle)
</span><span class="cx">         return { };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog    2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebInspectorUI/ChangeLog       2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2021-08-19  Tim Nguyen  <ntim@apple.com>
+
+        Implement ::backdrop pseudo element
+        https://bugs.webkit.org/show_bug.cgi?id=227801
+
+        Reviewed by Antti Koivisto.
+
+        This adds UA styles, RenderTreeBuilder support and WebInspector support for ::backdrop.
+        Some imported blink tests now start passing, some still need proper top layer support.
+
+        * UserInterface/Controllers/CSSManager.js:
+        (WI.CSSManager.displayNameForPseudoId):
+
</ins><span class="cx"> 2021-08-17  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: match the undocked tab bar style when docked bottom/side
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCSSManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js (281228 => 281229)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js      2021-08-19 08:46:05 UTC (rev 281228)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js 2021-08-19 09:02:02 UTC (rev 281229)
</span><span class="lines">@@ -155,6 +155,8 @@
</span><span class="cx">             return WI.unlocalizedString("::after");
</span><span class="cx">         case CSSManager.PseudoSelectorNames.Selection:
</span><span class="cx">             return WI.unlocalizedString("::selection");
</span><ins>+        case CSSManager.PseudoSelectorNames.Backdrop:
+            return WI.unlocalizedString("::backdrop");
</ins><span class="cx">         case CSSManager.PseudoSelectorNames.Scrollbar:
</span><span class="cx">             return WI.unlocalizedString("::scrollbar");
</span><span class="cx">         case CSSManager.PseudoSelectorNames.ScrollbarThumb:
</span><span class="lines">@@ -684,6 +686,7 @@
</span><span class="cx"> WI.CSSManager.PseudoSelectorNames = {
</span><span class="cx">     After: "after",
</span><span class="cx">     Before: "before",
</span><ins>+    Backdrop: "backdrop",
</ins><span class="cx">     FirstLetter: "first-letter",
</span><span class="cx">     FirstLine: "first-line",
</span><span class="cx">     Highlight: "highlight",
</span></span></pre>
</div>
</div>

</body>
</html>