Skip to content

Commit

Permalink
Unreviewed, revert [257194@main] Support ::backdrop renderer on all e…
Browse files Browse the repository at this point in the history
…lements

https://bugs.webkit.org/show_bug.cgi?id=248456
rdar://102748281

Manually reverting this patch since commit-queue does not process it in https://bugs.webkit.org/show_bug.cgi?id=248640.

* Source/WebCore/css/dialog.css:
(::backdrop):
* Source/WebCore/css/html.css:
(::backdrop): Deleted.
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updateBackdropRenderer):

Canonical link: https://commits.webkit.org/257263@main
  • Loading branch information
Constellation committed Dec 2, 2022
1 parent cf2a6c5 commit 4674572
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
9 changes: 9 additions & 0 deletions Source/WebCore/css/dialog.css
Expand Up @@ -29,3 +29,12 @@ dialog:modal {
dialog::backdrop {
background: rgba(0, 0, 0, 0.1);
}

::backdrop {
display: block;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
8 changes: 0 additions & 8 deletions Source/WebCore/css/html.css
Expand Up @@ -112,14 +112,6 @@ abbr[title], acronym[title] {
text-decoration: dotted underline;
}

/* ::backdrop */

::backdrop {
display: block;
position: fixed;
inset: 0;
}

/* media elements */

body:-webkit-full-page-media {
Expand Down
Expand Up @@ -175,6 +175,8 @@ void RenderTreeUpdater::GeneratedContent::updatePseudoElement(Element& current,

void RenderTreeUpdater::GeneratedContent::updateBackdropRenderer(RenderElement& renderer)
{
if (!renderer.canHaveGeneratedChildren())
return;
// ::backdrop does not inherit style, hence using the view style as parent style
auto style = renderer.getCachedPseudoStyle(PseudoId::Backdrop, &renderer.view().style());

Expand All @@ -192,10 +194,7 @@ void RenderTreeUpdater::GeneratedContent::updateBackdropRenderer(RenderElement&
auto newBackdropRenderer = WebCore::createRenderer<RenderBlockFlow>(renderer.document(), WTFMove(newStyle));
newBackdropRenderer->initializeStyle();
renderer.setBackdropRenderer(*newBackdropRenderer.get());

// Use the renderer as parent when we can for hit-testing purposes.
RenderElement& parentRenderer = renderer.canHaveGeneratedChildren() ? renderer : renderer.view();
m_updater.m_builder.attach(parentRenderer, WTFMove(newBackdropRenderer), parentRenderer.lastChild());
m_updater.m_builder.attach(renderer, WTFMove(newBackdropRenderer), renderer.firstChild());
}
}

Expand Down

0 comments on commit 4674572

Please sign in to comment.