зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1626794 - Add strong ref to document and MOZ_CAN_RUN_SCRIPT annotation to Animation::CommitStyles r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D75418
This commit is contained in:
Родитель
baa852c82b
Коммит
0ee5c5dc91
|
@ -707,10 +707,13 @@ void Animation::CommitStyles(ErrorResult& aRv) {
|
|||
"Target is not capable of having a style attribute");
|
||||
}
|
||||
|
||||
// Hold onto a strong reference to the doc in case the flush destroys it.
|
||||
RefPtr<Document> doc = target.mElement->GetComposedDoc();
|
||||
|
||||
// Flush frames before checking if the target element is rendered since the
|
||||
// result could depend on pending style changes, and IsRendered() looks at the
|
||||
// primary frame.
|
||||
if (Document* doc = target.mElement->GetComposedDoc()) {
|
||||
if (doc) {
|
||||
doc->FlushPendingNotifications(FlushType::Frames);
|
||||
}
|
||||
if (!target.mElement->IsRendered()) {
|
||||
|
|
|
@ -150,7 +150,7 @@ class Animation : public DOMEventTargetHelper,
|
|||
virtual void Reverse(ErrorResult& aRv);
|
||||
|
||||
void Persist();
|
||||
void CommitStyles(ErrorResult& aRv);
|
||||
MOZ_CAN_RUN_SCRIPT void CommitStyles(ErrorResult& aRv);
|
||||
|
||||
bool IsRunningOnCompositor() const;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче