Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] WKWebViews can get into a state with multiple find overlays #1199

Merged
merged 25 commits into from Jun 1, 2022

Conversation

pxlcoder
Copy link
Member

@pxlcoder pxlcoder commented Jun 1, 2022

39f1319

[iOS] WKWebViews can get into a state with multiple find overlays
https://bugs.webkit.org/show_bug.cgi?id=241163
rdar://93904570

Reviewed by Devin Rousso.

When `-[WKWebView didEndTextSearchOperation]` and `-[WKWebView didBeginTextSearchOperation]`
are called in quick succession, the web view can get into a state with multiple
find overlays. This state occurs because `didBeginTextSearchOperation` nulls out
the find overlay before the fade out animation has finished.
`didBeginTextSearchOperation` then observes that there is no find overlay, and
adds another overlay.

To fix, the page overlay member should be nulled out at the right time.

* Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp:
(WebKit::WebFoundTextRangeController::didBeginTextSearchOperation):

If there is already a find overlay, cancel its removal if it is being
uninstalled. This ensures that calling end/begin in quick succession will preserve
the overlay.

(WebKit::WebFoundTextRangeController::didEndTextSearchOperation):

Do not null out the page overlay immediately when uninstalling. Nulling out
the member is handled in `willMoveToPage`, which is called after the animation
is finished.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm:
(traverseLayerTree):
(overlayCount):
(TestWebKitAPI::TEST):

Added an API test to ensure at most one find overlay is in the layer tree at
any time.

Canonical link: https://commits.webkit.org/251193@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295098 268f45cc-cd09-0410-ab3c-d52691b4dbfc

@pxlcoder pxlcoder self-assigned this Jun 1, 2022
@pxlcoder pxlcoder added Other WebKit API For issues and bugs in the Web Kit public embedding APIs labels Jun 1, 2022
@pxlcoder
Copy link
Member Author

pxlcoder commented Jun 1, 2022

Thanks for the review!

dcrousso and others added 6 commits June 1, 2022 01:16
https://bugs.webkit.org/show_bug.cgi?id=241144

Reviewed by Patrick Angle.

* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:
* Source/WebInspectorUI/UserInterface/Base/Setting.js:
* Source/WebInspectorUI/UserInterface/Models/ScreenshotsInstrument.js:
(WI.ScreenshotsInstrument.supported):
* Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

Canonical link: https://commits.webkit.org/251169@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241143

Reviewed by Patrick Angle.

According to <https://webkit.org/web-inspector/script-blackboxing/>
> Script blackboxing is the ability to mark a `<script>` in Web Inspector so that it is ignored by
> the JavaScript debugger, meaning that any JavaScript execution pauses that would happen in that
> `<script>` are instead deferred until JavaScript execution has continued outside of that `<script>`.

Based on that, developers will likely expect that breakpoint evaluations fall under the category of
"things that the JavaScript debugger does" and would therefore expect that they're ignored/deferred.

* Source/WebInspectorUI/UserInterface/Base/Setting.js:

Canonical link: https://commits.webkit.org/251170@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295075 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…ial hint being the most commonly used property of the matching suggestions

https://bugs.webkit.org/show_bug.cgi?id=241146

Reviewed by Patrick Angle.

* Source/WebInspectorUI/UserInterface/Base/Setting.js:

Canonical link: https://commits.webkit.org/251171@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…ions to top level

https://bugs.webkit.org/show_bug.cgi?id=241145

Patch by Kenneth Russell <kbr@chromium.org> on 2022-05-31
Unreviewed test gardening. Move suppressions from
webgl/TestExpectations to top-level TestExpectations.

* LayoutTests/TestExpectations:
* LayoutTests/webgl/TestExpectations:

Canonical link: https://commits.webkit.org/251172@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241165

Patch by Dan Glastonbury <djg@apple.com> on 2022-05-31
Reviewed by Dean Jackson.

* Source/ThirdParty/ANGLE/changes.diff:
Output of update-angle --regenerate-changes-diff

Canonical link: https://commits.webkit.org/251173@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241160

Patch by Kiet Ho <tho22@apple.com> on 2022-05-31
Reviewed by Tim Nguyen.

Imported from WPT commit 9a7bbe4.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/resources/resource-files.json:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-006-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-006.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-007-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-007.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-008.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-inline-end-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-shy-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-shy-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-001-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-002-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-003-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-003.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-004-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-004.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-005-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-005.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-006-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justifyall-006.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-003.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-004.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-005.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-006.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-007.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-008.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-009.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-010-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-010.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-011.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-012.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-013.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-014.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-interpolation-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-last-interpolation.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-01-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-01.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-02-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-02.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-03-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-03.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-04-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-04.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-root-ltr-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-root-ltr-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-root-ltr.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-root-rtl-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-root-rtl-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-match-parent-root-rtl.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-webkit-match-parent-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/text-align-webkit-match-parent.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-align/w3c-import.log:

Canonical link: https://commits.webkit.org/251174@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@webkit-early-warning-system webkit-early-warning-system added the merging-blocked Applied to prevent a change from being merged label Jun 1, 2022
achristensen07 and others added 12 commits June 1, 2022 05:00
…-main runloops

https://bugs.webkit.org/show_bug.cgi?id=241157
<rdar://94130705>

Reviewed by Brady Eidson.

Wouldn't it be nice if all apps used your APIs exactly how you want them to?
This is not the case.  People call decision handlers on non-main threads.
When this happens, just hop to the main thread to avoid threading issues.

* Source/WebKit/UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):

Canonical link: https://commits.webkit.org/251175@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…List

https://bugs.webkit.org/show_bug.cgi?id=241166

Reviewed by Antti Koivisto.

We need to hold on to a reference to the layout box in case logical order != DOM order.

* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::convertFlexItemsToLogicalSpace):

Canonical link: https://commits.webkit.org/251176@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=234008

Patch by Dan Glastonbury <djg@apple.com> on 2022-05-31
Reviewed by Kimmo Kinnunen.

Through experimentation, it was found that reducing the number of render passes
inflight in the system improves performance. Breaking command buffers with a
large number of render passes into smaller chunks, of at most 16 render passes,
brought the frame rate of ANGLE metal backend inline with ANGLE opengl on macOS
and iOS.

* Source/ThirdParty/ANGLE/changes.diff:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.h:
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/ContextMtl.mm:
(rx::ContextMtl::flushCommandBuffer):
(rx::ContextMtl::flushCommandBufferIfNeeded):
(rx::ContextMtl::present):
(rx::ContextMtl::getRenderPassCommandEncoder):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/mtl_common.h:

Canonical link: https://commits.webkit.org/251177@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=239823
<rdar://92390285>

Reviewed by Alan Bujtas.

* LayoutTests/fast/css/display-content-with-pending-stylesheet-crash-expected.txt: Added.
* LayoutTests/fast/css/display-content-with-pending-stylesheet-crash.html: Added.
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):

We can't skip resolution for elements that we have already computed style for. This includes elements with display:contents.

Canonical link: https://commits.webkit.org/251178@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241170

Unreviewed non-unified build fix.

* Source/WebCore/platform/audio/MultiChannelResampler.cpp: Add missing
  wtf/PrintStream.h inclusion.
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp: Add
  missing inclusion of the <functional> stdlib header.

Canonical link: https://commits.webkit.org/251179@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241180

Patch by Žan Doberšek <zdobersek@igalia.com> on 2022-06-01
Unreviewed, WPEToolingsBackend library should link against the GObject library
as required by ATK code, avoiding linking issues that only pop up at the point
of linking the WebKitTestRunner binary, and in only some specific
configurations.

* Tools/wpe/backends/PlatformWPE.cmake:
Have the WPEToolingsBackend link against GObject libraries.

Canonical link: https://commits.webkit.org/251180@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241168

Reviewed by Tim Nguyen.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/resources/resource-files.json:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-002-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-002.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-003-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-003.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-004-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-004.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-for-cue-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-for-cue-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-for-cue.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-for-shadow-dom.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-longhand-animation-type-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-longhand-animation-type.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-computed.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-invalidation-after-load-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-invalidation-after-load.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient-invalidation-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient-invalidation.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-media-queries-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-media-queries.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-shadow-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-shadow.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-svglength-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-svglength.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/br-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/columns-in-table-002-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/container-in-canvas-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/orthogonal-replaced-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/w3c-import.log:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/deep-nested-inline-size-containers.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/iframe-in-container-invalidation-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/iframe-in-container-invalidation.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/inner-first-line-non-matching-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/inner-first-line-non-matching-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/inner-first-line-non-matching.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-002-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-002-ref.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-003.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-004-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-004.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/style-change-in-container.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/support/cq-testcommon.js:
(polyfill_declarative_shadow_dom):
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/support/test.vtt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/support/w3c-import.log:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/svg-foreignobject-child-container-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/svg-foreignobject-child-container.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/svg-g-no-size-container-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/svg-g-no-size-container-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/svg-g-no-size-container.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/w3c-import.log:

Canonical link: https://commits.webkit.org/251181@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241036
<rdar://93614152>

Reviewed by Geoffrey Garen.

In the WebContent process on iOS, we have a workaround to repopulate the Mobile Gestalt cache in case
the disk version is invalid. This workaround should be applied to the GPU process as well.

* Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp:
(WebKit::GPUProcessCreationParameters::encode const):
(WebKit::GPUProcessCreationParameters::decode):
* Source/WebKit/GPUProcess/GPUProcessCreationParameters.h:
* Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb.in:
* Source/WebKit/Shared/AuxiliaryProcess.h:
* Source/WebKit/Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::populateMobileGestaltCache):
* Source/WebKit/Shared/ios/AuxiliaryProcessIOS.cpp:
(WebKit::AuxiliaryProcess::populateMobileGestaltCache):
* Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::createMobileGestaltSandboxExtensionIfNeeded const):
* Source/WebKit/UIProcess/AuxiliaryProcessProxy.h:
* Source/WebKit/UIProcess/Cocoa/GPUProcessProxyCocoa.mm:
(WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters):
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Canonical link: https://commits.webkit.org/251182@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241096

Patch by Youenn Fablet <youennf@gmail.com> on 2022-06-01
Reviewed by Chris Dumez.

The main thread might be blocked by work done by the web page, like executing JavaScript.
This might delay fetch events handling. This can cause PLT regressions when serving content through a service worker.
To limit the perf penalty, we are now hopping to a work queue to process all WebSWContextManagerConnection messages.
For fetch events and message events, we directly go from that thread to the service worker thread.
For install/activate/push/notification events, we keep going through the main thread as they are not as perf crtical.
Also install/activate should follow the same flow as other events like updatefound which are served through WebSWClientConnection.
We change skipWaiting accordingly to remove races in case the reply would go to main thread directly instead of going through the background work queue.

We do some refactoring to allow getting a ServiceWorkerThreadProxy from a background queue.

* Source/WebCore/workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::didSaveScriptsToDisk): Deleted.
* Source/WebCore/workers/service/context/SWContextManager.h:
* Source/WebCore/workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::skipWaiting): Deleted.
* Source/WebCore/workers/service/server/SWServerToContextConnection.h:
* Source/WebCore/workers/service/server/SWServerWorker.h:
* Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::startFetch):
(WebCore::ServiceWorkerThreadProxy::convertFetchToDownload):
(WebCore::ServiceWorkerThreadProxy::continueDidReceiveFetchResponse):
(WebCore::ServiceWorkerThreadProxy::fireMessageEvent):
(WebCore::ServiceWorkerThreadProxy::didSaveScriptsToDisk):
(WebCore::ServiceWorkerThreadProxy::firePushEvent):
(WebCore::ServiceWorkerThreadProxy::firePushSubscriptionChangeEvent):
(WebCore::ServiceWorkerThreadProxy::fireNotificationEvent):
(WebCore::ServiceWorkerThreadProxy::willPostTaskToFireMessageEvent): Deleted.
* Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h:
* Source/WebKit/Shared/WebPreferencesStore.h
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::skipWaiting):
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
* Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::~WebSWContextManagerConnection):
(WebKit::WebSWContextManagerConnection::cancelFetch):
(WebKit::WebSWContextManagerConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorker):
(WebKit::WebSWContextManagerConnection::didSaveScriptsToDisk):
(WebKit::WebSWContextManagerConnection::convertFetchToDownload):
(WebKit::WebSWContextManagerConnection::skipWaiting):
(WebKit::WebSWContextManagerConnection::skipWaitingCompleted):
* Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h:
* Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in:

Canonical link: https://commits.webkit.org/251183@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… on wk1

https://bugs.webkit.org/show_bug.cgi?id=229458
rdar://82301476

Reviewed by Devin Rousso.

This test ensures that the _serverPort, _priority, and request cookies are as-expected when exporting a HAR, but that
data is part of `AdditionalNetworkLoadMetricsForWebInspector` internally, which is not implemented for WK1. In order to
defend the rest of the results going forward, create WK1-specific expectations that exclude those three specific pieces
of data that are unavailable.

* LayoutTests/platform/mac-wk1/TestExpectations:
* LayoutTests/platform/mac-wk1/http/tests/inspector/network/har/har-page-expected.txt: Added.

Canonical link: https://commits.webkit.org/251184@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241022

Reviewed by Chris Fleizach.

Prior to this patch, the inert attribute didn't cause node-only objects
(like those with display:contents) to be ignored. This was because
AccessibilityObject::defaultObjectInclusion only checked `effectiveInert`
for elements with renderers, even though you only need an element to
have style (not a renderer).

This patch fixes this by adding a new AccessibilityObject::style()
method which uses AccessibilityObject::element() to get
Element::computedStyle() and checking effectiveInert on that, which
works for both renderer and renderer-less objects.

* LayoutTests/accessibility/node-only-inert-object-expected.txt: Added.
* LayoutTests/accessibility/node-only-inert-object.html: Added.
* LayoutTests/platform/ios/TestExpectations: Enable new test.
* LayoutTests/platform/mac-wk1/TestExpectations: Skip new test.
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::style const): Added.
(WebCore::AccessibilityObject::defaultObjectInclusion const):
* Source/WebCore/accessibility/AccessibilityObject.h:

Canonical link: https://commits.webkit.org/251185@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=239588

Patch by Asumu Takikawa <asumu@igalia.com> on 2022-06-01
Reviewed by Keith Miller.

JSTests:

* wasm/regress/239588.js: Added.
(module):

Source/JavaScriptCore:

* wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseInitExpr):

Canonical link: https://commits.webkit.org/251186@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
cdumez and others added 3 commits June 1, 2022 16:58
…ttps://bugs.webkit.org/show_bug.cgi?id=241162

Reviewed by Geoffrey Garen.

WeakHashMap::ensure() may crash if the map contains null references, because
the WeakHashMap iterator destructor can clear null references and the AddResult
constructor copies and destroys the input iterator.

I find it very error-prone that destroying an iterator would modify the hash
map and thus invalidate other iterators (or even itself if the iterator was
merely copied). As a result, I removed this logic from the
WeakHashMapIteratorBase destructor. Instead, I now increase
WeakHashMap::m_operationCountSinceLastCleanup whenever the iterator gets
incremented so that null references will be removed the next time the hash map
is modified.

I also updated other read-only operations (such as get() / find() / contains())
to just increment m_operationCountSinceLastCleanup without actually clearing
null references for the same reason as above. Having such read-only operations
invalidate existing iterators is just too error-prone.

Finally, I updated the AddResult constructor to avoid copying the
WeakHashMapIterator it is passed, given that the WeakHashMapIterator
constructor and destructor do some work.

* Source/WTF/wtf/WeakHashMap.h:
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::identifier const):
* Tools/TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/251187@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…writing content in the macOS SDK"

Unreviewed, this reverts commit 251168@main to fix internal builds.

Canonical link: https://commits.webkit.org/251188@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241104
<rdar://88110302>

Reviewed by Antti Koivisto.

Do not cross containing block boundary while resolving fill-available. If the containing block does not specify the constraint value for the fill-available descendant, we should just return "can't resolve" instead of climbing the containing block tree and potentially hit the ICB as the first container with fixed height(width).

* LayoutTests/fast/block/fill-available-with-no-specified-containing-block-height-expected.html: Added.
* LayoutTests/fast/block/fill-available-with-no-specified-containing-block-height.html: Added.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::isOrthogonal):
(WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing const):

Canonical link: https://commits.webkit.org/251189@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@pxlcoder pxlcoder added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Jun 1, 2022
ryanhaddad and others added 4 commits June 1, 2022 17:32
…d on non-main runloops"

Unreviewed, this reverts commit 251175@main.

Canonical link: https://commits.webkit.org/251190@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295095 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241161
<rdar://problem/94185199>

Reviewed by Alexey Proskuryakov.

* Tools/Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:
(Git.Cache.populate): Append -- to `git log` command.
(Git.commit): Ditto.
(Git.commits): Ditto.
(Git.checkout): Append -- to `git checkout` command.

Canonical link: https://commits.webkit.org/251191@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…1.0.3/conformance/attribs/gl-vertexattribpointer-offsets.html is an almost consistent timeout

https://bugs.webkit.org/show_bug.cgi?id=241191
<rdar://94231182>

Unreviewed test gardening.

* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/251192@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=241163
rdar://93904570

Reviewed by Devin Rousso.

When `-[WKWebView didEndTextSearchOperation]` and `-[WKWebView didBeginTextSearchOperation]`
are called in quick succession, the web view can get into a state with multiple
find overlays. This state occurs because `didBeginTextSearchOperation` nulls out
the find overlay before the fade out animation has finished.
`didBeginTextSearchOperation` then observes that there is no find overlay, and
adds another overlay.

To fix, the page overlay member should be nulled out at the right time.

* Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp:
(WebKit::WebFoundTextRangeController::didBeginTextSearchOperation):

If there is already a find overlay, cancel its removal if it is being
uninstalled. This ensures that calling end/begin in quick succession will preserve
the overlay.

(WebKit::WebFoundTextRangeController::didEndTextSearchOperation):

Do not null out the page overlay immediately when uninstalling. Nulling out
the member is handled in `willMoveToPage`, which is called after the animation
is finished.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm:
(traverseLayerTree):
(overlayCount):
(TestWebKitAPI::TEST):

Added an API test to ensure at most one find overlay is in the layer tree at
any time.

Canonical link: https://commits.webkit.org/251193@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@webkit-early-warning-system
Copy link
Collaborator

Committed r295098 (251193@main): https://commits.webkit.org/251193@main

Reviewed commits have been landed. Closing PR #1199 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system removed the merge-queue Applied to send a pull request to merge-queue label Jun 1, 2022
@pxlcoder pxlcoder deleted the eng/241163 branch June 1, 2022 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit API For issues and bugs in the Web Kit public embedding APIs
Projects
None yet