WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
227801
Implement ::backdrop pseudo element
https://bugs.webkit.org/show_bug.cgi?id=227801
Summary
Implement ::backdrop pseudo element
Tim Nguyen (:ntim)
Reported
2021-07-08 10:05:53 PDT
https://fullscreen.spec.whatwg.org/#new-stacking-layer
https://fullscreen.spec.whatwg.org/#css-pe-backdrop
Attachments
Patch
(17.45 KB, patch)
2021-08-11 11:43 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(19.59 KB, patch)
2021-08-11 12:41 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(21.34 KB, patch)
2021-08-12 03:33 PDT
,
Tim Nguyen (:ntim)
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(21.41 KB, patch)
2021-08-12 03:42 PDT
,
Tim Nguyen (:ntim)
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(21.61 KB, patch)
2021-08-12 04:02 PDT
,
Tim Nguyen (:ntim)
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(21.62 KB, patch)
2021-08-12 04:08 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(22.61 KB, patch)
2021-08-12 06:38 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(22.60 KB, patch)
2021-08-12 10:18 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(21.79 KB, patch)
2021-08-13 07:19 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-07-08 10:06:43 PDT
<
rdar://problem/80330009
>
Tim Nguyen (:ntim)
Comment 2
2021-08-11 11:43:07 PDT
Created
attachment 435364
[details]
Patch
EWS Watchlist
Comment 3
2021-08-11 11:44:30 PDT
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Tim Nguyen (:ntim)
Comment 4
2021-08-11 12:41:48 PDT
Created
attachment 435369
[details]
Patch
Tim Nguyen (:ntim)
Comment 5
2021-08-12 03:33:16 PDT
Created
attachment 435406
[details]
Patch
Tim Nguyen (:ntim)
Comment 6
2021-08-12 03:42:55 PDT
Created
attachment 435408
[details]
Patch
Tim Nguyen (:ntim)
Comment 7
2021-08-12 04:02:05 PDT
Created
attachment 435410
[details]
Patch
Tim Nguyen (:ntim)
Comment 8
2021-08-12 04:08:28 PDT
Created
attachment 435411
[details]
Patch
Antti Koivisto
Comment 9
2021-08-12 04:44:01 PDT
Comment on
attachment 435411
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=435411&action=review
Seems pretty good but lets do another round.
> Source/WebCore/rendering/RenderElement.cpp:2378 > +RenderBlockFlow* RenderElement::backdropRenderer() const
This could return WeakPtr for safety.
> Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:895 > +void RenderTreeBuilder::updateBackdropRenderer(RenderElement& renderer)
This could go to RenderTreeBuilder::GeneratedContent and maybe invoked from GeneratedContent::updatePseudoElement
> Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:905 > + auto style = renderer.getCachedPseudoStyle(PseudoId::Backdrop, renderer.document().renderStyle());
You can use renderer.view().style(), so you don't bounce into DOM side unnecessarily (it is the same thing).
> Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:907 > + if (!style || style->display() == DisplayType::None) > + return;
Shouldn't we destroy an existing renderer in this case? If so we probably should have a test.
> Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:911 > + auto* backdropRenderer = renderer.backdropRenderer();
This should be a WeakPtr. We have had lots of safety issues in render tree building code.
> Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:923 > + RenderElement* currentParent = backdropRenderer->parent(); > + RenderElement* newParent = renderer.parent();
WeakPtrs
> Source/WebCore/style/StyleTreeResolver.cpp:287 > - > - auto& parentStyle = *elementUpdate.style; > + > + auto& parentStyle = pseudoId == PseudoId::Backdrop ? *element.document().renderStyle() : *elementUpdate.style; > auto* parentBoxStyle = parentBoxStyleForPseudo(elementUpdate); > - > +
This is unnecessary as the code doesn't currently handle Backdrop. You could assert against it.
Antti Koivisto
Comment 10
2021-08-12 04:52:20 PDT
Comment on
attachment 435411
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=435411&action=review
>> Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:905 >> + auto style = renderer.getCachedPseudoStyle(PseudoId::Backdrop, renderer.document().renderStyle()); > > You can use renderer.view().style(), so you don't bounce into DOM side unnecessarily (it is the same thing).
Also you could add a comment (like a spec reference) about the odd parent style.
Antti Koivisto
Comment 11
2021-08-12 04:53:02 PDT
Comment on
attachment 435411
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=435411&action=review
> Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:904 > + // Update ::backdrop renderer style or create renderer
This comment is kinda pointless though.
Tim Nguyen (:ntim)
Comment 12
2021-08-12 06:38:44 PDT
Created
attachment 435420
[details]
Patch
Antti Koivisto
Comment 13
2021-08-12 09:09:08 PDT
Comment on
attachment 435420
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=435420&action=review
> Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:189 > + WeakPtr backdropRenderer = renderer.backdropRenderer();
could be auto
> Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:201 > + WeakPtr currentParent = makeWeakPtr(backdropRenderer->parent()); > + WeakPtr newParent = makeWeakPtr(renderer.parent());
these too
Tim Nguyen (:ntim)
Comment 14
2021-08-12 10:18:24 PDT
Created
attachment 435432
[details]
Patch
Tim Nguyen (:ntim)
Comment 15
2021-08-13 07:19:40 PDT
Created
attachment 435481
[details]
Patch
EWS
Comment 16
2021-08-19 02:02:11 PDT
Committed
r281229
(
240666@main
): <
https://commits.webkit.org/240666@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 435481
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug