WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
230008
Accelerated animations on ::backdrop shouldn't affect <dialog> (backdrop-animate-002.html fails)
https://bugs.webkit.org/show_bug.cgi?id=230008
Summary
Accelerated animations on ::backdrop shouldn't affect <dialog> (backdrop-anim...
Tim Nguyen (:ntim)
Reported
2021-09-07 09:56:32 PDT
CADebug -s layers backdrop: (name "CALayer(0x138610950) GraphicsLayer(0x1006b4f00, 21) RenderBlock (positioned) 0x1008d7960") (opacity 0.101961) dialog: (values (array (vector 0.1000000015) (vector 0.1000000015))) For some reason the opacity animation on ::backdrop affects the dialog by adding an opacity on the <dialog>. Also happens when using @keyframes.
Attachments
Patch
(7.07 KB, patch)
2021-10-14 12:37 PDT
,
Antoine Quint
simon.fraser
: review+
Details
Formatted Diff
Diff
Patch for landing
(7.62 KB, patch)
2021-10-15 04:05 PDT
,
Antoine Quint
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch for landing
(7.61 KB, patch)
2021-10-15 06:52 PDT
,
Antoine Quint
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-09-10 09:29:31 PDT
<
rdar://problem/82975766
>
Tim Nguyen (:ntim)
Comment 2
2021-10-14 07:28:01 PDT
hmm transform animations also affect the <dialog> itself
Antoine Quint
Comment 3
2021-10-14 12:37:31 PDT
Created
attachment 441256
[details]
Patch
Tim Nguyen (:ntim)
Comment 4
2021-10-14 13:00:22 PDT
Comment on
attachment 441256
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=441256&action=review
> Source/WebCore/ChangeLog:3 > + Accelerated animations on ::backdrop shouldn't affect <dialog> (backdrop-animate-002.html fails)
Not sure this is the best title for this change.
> Source/WebCore/style/Styleable.cpp:55 > + // FIXME: handle ::marker.
I think you can implement marker as: ``` if (renderer.style().styleType() == PseudoId::Marker) { ASSERT(renderer.parent()->markerRenderer() == &renderer); return Styleable(renderer.parent()->markerRenderer(), PseudoId::Marker); } ``` ::marker is a child in the render tree of RenderListItem:
https://webkit-search.igalia.com/webkit/source/Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp#88
Tim Nguyen (:ntim)
Comment 5
2021-10-14 13:02:31 PDT
Comment on
attachment 441256
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=441256&action=review
>> Source/WebCore/style/Styleable.cpp:55 >> + // FIXME: handle ::marker. > > I think you can implement marker as: > > ``` > if (renderer.style().styleType() == PseudoId::Marker) { > ASSERT(renderer.parent()->markerRenderer() == &renderer); > return Styleable(renderer.parent()->markerRenderer(), PseudoId::Marker); > } > ``` > > ::marker is a child in the render tree of RenderListItem:
https://webkit-search.igalia.com/webkit/source/Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp#88
well: return Styleable(renderer.parent()->element(), PseudoId::Marker); I *think*
Tim Nguyen (:ntim)
Comment 6
2021-10-14 13:09:34 PDT
Comment on
attachment 441256
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=441256&action=review
> Source/WebCore/style/Styleable.cpp:54 > +{
One thing that would be nice is to `ASSERT` of expected PseudoId types in this function. So future bugs like this can be caught easily in the future, since the test would just crash and assert at the right place: ``` auto pseudoId = renderer.style().styleType(); ASSERT(pseudoId == PseudoId::None || pseudoId == PseudoId::Before || pseudoId == PseudoId::After || [...], "PseudoId should be handled by Styleable); ```
Simon Fraser (smfr)
Comment 7
2021-10-14 13:14:59 PDT
Comment on
attachment 441256
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=441256&action=review
> Source/WebCore/style/Styleable.cpp:86 > + if (pseudoId == PseudoId::After) { > + if (auto* afterPseudoElement = element.afterPseudoElement()) > + return afterPseudoElement->renderer(); > + } else if (pseudoId == PseudoId::Backdrop) { > + if (auto* hostRenderer = element.renderer()) > + return hostRenderer->backdropRenderer().get(); > + } else if (pseudoId == PseudoId::Before) { > + if (auto* beforePseudoElement = element.beforePseudoElement()) > + return beforePseudoElement->renderer(); > + } else if (pseudoId == PseudoId::Marker) { > + if (is<RenderListItem>(element.renderer())) > + return downcast<RenderListItem>(*element.renderer()).markerRenderer(); > + } else if (pseudoId == PseudoId::None) > + return element.renderer();
Switch
Tim Nguyen (:ntim)
Comment 8
2021-10-14 13:16:35 PDT
(In reply to Simon Fraser (smfr) from
comment #7
)
> Comment on
attachment 441256
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=441256&action=review
> > > Source/WebCore/style/Styleable.cpp:86 > > + if (pseudoId == PseudoId::After) { > > + if (auto* afterPseudoElement = element.afterPseudoElement()) > > + return afterPseudoElement->renderer(); > > + } else if (pseudoId == PseudoId::Backdrop) { > > + if (auto* hostRenderer = element.renderer()) > > + return hostRenderer->backdropRenderer().get(); > > + } else if (pseudoId == PseudoId::Before) { > > + if (auto* beforePseudoElement = element.beforePseudoElement()) > > + return beforePseudoElement->renderer(); > > + } else if (pseudoId == PseudoId::Marker) { > > + if (is<RenderListItem>(element.renderer())) > > + return downcast<RenderListItem>(*element.renderer()).markerRenderer(); > > + } else if (pseudoId == PseudoId::None) > > + return element.renderer(); > > Switch
Use ASSERT_NOT_REACHED(); in unhandled cases too :)
Antoine Quint
Comment 9
2021-10-15 04:05:13 PDT
Created
attachment 441362
[details]
Patch for landing
Antoine Quint
Comment 10
2021-10-15 06:47:25 PDT
(In reply to Tim Nguyen (:ntim) from
comment #6
)
> Comment on
attachment 441256
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=441256&action=review
> > > Source/WebCore/style/Styleable.cpp:54 > > +{ > > One thing that would be nice is to `ASSERT` of expected PseudoId types in > this function. > > So future bugs like this can be caught easily in the future, since the test > would just crash and assert at the right place: > > ``` > auto pseudoId = renderer.style().styleType(); > ASSERT(pseudoId == PseudoId::None || pseudoId == PseudoId::Before || > pseudoId == PseudoId::After || [...], "PseudoId should be handled by > Styleable); > ```
In the case of Styleable::renderer(), it currently makes sense to have an ASSERT_NOT_REACHED() call for unhandled pseudo-elements. However, in the case of Styleable::fromRenderer() it doesn't, because that function is called under RenderLayerCompositor::requiresCompositingForAnimation() which may be called for any potentially-composited element, which can be the case for :first-letter for instance.
Antoine Quint
Comment 11
2021-10-15 06:52:34 PDT
Created
attachment 441374
[details]
Patch for landing
Tim Nguyen (:ntim)
Comment 12
2021-10-15 07:24:06 PDT
(In reply to Antoine Quint from
comment #10
)
> However, in the case of Styleable::fromRenderer() it doesn't, because that > function is called under > RenderLayerCompositor::requiresCompositingForAnimation() which may be called > for any potentially-composited element, which can be the case for > :first-letter for instance.
I think we should at least warn, it's fishy to end up in an unhandled case.
Antoine Quint
Comment 13
2021-10-16 03:25:27 PDT
Landed in
r284313
.
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