RESOLVED FIXED 179651
iOS: Enable release asserts in updateStyleIfNeeded() and updateLayout() for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=179651
Summary iOS: Enable release asserts in updateStyleIfNeeded() and updateLayout() for W...
Ryosuke Niwa
Reported 2017-11-13 19:40:00 PST
https://trac.webkit.org/r224604 disabled these release asserts in iOS due to a bug in UIKit for WebKit1. Re-enable these release assertions in iOS WebKit2 port.
Attachments
Re-enables the asserts (3.02 KB, patch)
2017-11-13 19:47 PST, Ryosuke Niwa
no flags
Patch for landing (3.12 KB, patch)
2017-11-13 21:17 PST, Ryosuke Niwa
no flags
Radar WebKit Bug Importer
Comment 1 2017-11-13 19:40:30 PST
Ryosuke Niwa
Comment 2 2017-11-13 19:47:12 PST
Created attachment 326841 [details] Re-enables the asserts
Antti Koivisto
Comment 3 2017-11-13 19:55:05 PST
Comment on attachment 326841 [details] Re-enables the asserts View in context: https://bugs.webkit.org/attachment.cgi?id=326841&action=review r=me > Source/WebCore/dom/Document.cpp:1931 > + bool usingWebThread = WebThreadIsEnabled(); :(
Simon Fraser (smfr)
Comment 4 2017-11-13 20:11:15 PST
Comment on attachment 326841 [details] Re-enables the asserts View in context: https://bugs.webkit.org/attachment.cgi?id=326841&action=review > Source/WebCore/dom/Document.cpp:1935 > + return NoEventDispatchAssertion::InMainThread::isEventAllowed() || (frameView && frameView->isInChildFrameWithFrameFlattening()) || usingWebThread; This is pretty confusing to read. This function is about it being safe to update style or do layout, but to a lay reader, what does that have to do with event dispatch or frame flattening? Also NoEventDispatchAssertion::InMainThread::isEventAllowed(): so there's the "no event" negative vs. the "is event allowed", then there's InMainThread but the later usingWebThread check There's altogether too much discordance here. And, as Darin recommends, an assertion should only check one thing, not a list of things (because then you can't tell which failed).
Ryosuke Niwa
Comment 5 2017-11-13 20:41:32 PST
(In reply to Simon Fraser (smfr) from comment #4) > Comment on attachment 326841 [details] > Re-enables the asserts > > View in context: > https://bugs.webkit.org/attachment.cgi?id=326841&action=review > > > Source/WebCore/dom/Document.cpp:1935 > > + return NoEventDispatchAssertion::InMainThread::isEventAllowed() || (frameView && frameView->isInChildFrameWithFrameFlattening()) || usingWebThread; > > This is pretty confusing to read. This function is about it being safe to > update style or do layout, but to a lay reader, what does that have to do > with event dispatch or frame flattening? Indeed. I'd refactor it to as: bool isSafeToExecuteScript = NoEventDispatchAssertion::InMainThread::isEventAllowed(); bool isInFrameFlattening = frameView && frameView->isInChildFrameWithFrameFlattening(); return isSafeToExecuteScript || isInFrameFlattening || usingWebThread; > Also NoEventDispatchAssertion::InMainThread::isEventAllowed(): so there's > the "no event" negative vs. the "is event allowed", then there's > InMainThread but the later usingWebThread check I agree we should rename that but such a renaming / refactoring is outside the scope of this patch. > There's altogether too much discordance here. And, as Darin recommends, an > assertion should only check one thing, not a list of things (because then > you can't tell which failed). The problem is that we can't do it until frame flattening stops doing a nested layout or iOS WebKit bug (<rdar://problem/35522719>) is fixed. An alternative is to do something like this: if (!isInFrameFlattening && !usingWebThread) RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(NoEventDispatchAssertion::InMainThread::isEventAllowed()); I'm not certain if that code is better.
Ryosuke Niwa
Comment 6 2017-11-13 21:17:16 PST
Created attachment 326851 [details] Patch for landing
WebKit Commit Bot
Comment 7 2017-11-13 22:02:36 PST
The commit-queue encountered the following flaky tests while processing attachment 326851 [details]: svg/animations/svgtransform-animation-1.html bug 179354 (authors: ap@webkit.org, arv@chromium.org, krit@webkit.org, mark.lam@apple.com, and zimmermann@kde.org) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 8 2017-11-13 22:03:11 PST
Comment on attachment 326851 [details] Patch for landing Clearing flags on attachment: 326851 Committed r224803: <https://trac.webkit.org/changeset/224803>
WebKit Commit Bot
Comment 9 2017-11-13 22:03:13 PST
All reviewed patches have been landed. Closing bug.
Simon Fraser (smfr)
Comment 10 2017-11-13 22:34:56 PST
> An alternative is to do something like this: > if (!isInFrameFlattening && !usingWebThread) > > RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(NoEventDispatchAssertion:: > InMainThread::isEventAllowed()); > > I'm not certain if that code is better. Maybe better? RELEASE_ASSERT_IMPLIES_WITH_SECURITY_IMPLICATION(!isInFrameFlattening && !usingWebThread, NoEventDispatchAssertion::InMainThread::isEventAllowed()); if we make that macro. What's the difference between RELEASE_ASSERT_IMPLIES_WITH_SECURITY_IMPLICATION and RELEASE_ASSERT?
David Kilzer (:ddkilzer)
Comment 11 2017-11-13 23:39:59 PST
(In reply to Simon Fraser (smfr) from comment #10) > > An alternative is to do something like this: > > if (!isInFrameFlattening && !usingWebThread) > > > > RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(NoEventDispatchAssertion:: > > InMainThread::isEventAllowed()); > > > > I'm not certain if that code is better. > > Maybe better? > > RELEASE_ASSERT_IMPLIES_WITH_SECURITY_IMPLICATION(!isInFrameFlattening && > !usingWebThread, NoEventDispatchAssertion::InMainThread::isEventAllowed()); > > if we make that macro. I'm not sure what that macro does or what it's based on, but maybe I'm missing something. > What's the difference between > RELEASE_ASSERT_IMPLIES_WITH_SECURITY_IMPLICATION and RELEASE_ASSERT? Did you mean RELEASE_ASSERT_WITH_SECURITY_IMPLICATION? In Release builds, they're the same. In Debug builds, they'll have a different exception code (0xfbadbeef for security, 0xbbadbeef for non-security). See also: <https://bugs.webkit.org/show_bug.cgi?id=178269#c0>
Alexey Proskuryakov
Comment 12 2017-11-17 10:14:15 PST
> The commit-queue encountered the following flaky tests while processing attachment 326851 [details]: > svg/animations/svgtransform-animation-1.html bug 179354 (authors: ap@webkit.org, arv@chromium.org, krit@webkit.org, mark.lam@apple.com, and zimmermann@kde.org) Was this a legitimate issue discovered by EWS?
Ryosuke Niwa
Comment 13 2017-11-17 19:30:31 PST
(In reply to Alexey Proskuryakov from comment #12) > > The commit-queue encountered the following flaky tests while processing attachment 326851 [details]: > > > svg/animations/svgtransform-animation-1.html bug 179354 (authors: ap@webkit.org, arv@chromium.org, krit@webkit.org, mark.lam@apple.com, and zimmermann@kde.org) > > Was this a legitimate issue discovered by EWS? Oh, I didn't even see it but it is https://bugs.webkit.org/show_bug.cgi?id=179306.
Note You need to log in before you can comment on or make changes to this bug.