WebKit-https.git
8 months ago[ Mac wk2 ] tiled-drawing/simple-document-with-margin-tiles.html is flaky failing.
lawrence.j@apple.com [Tue, 11 Feb 2020 00:30:48 +0000 (00:30 +0000)]
[ Mac wk2 ] tiled-drawing/simple-document-with-margin-tiles.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207518

unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256229 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[iOS] REGRESSION (r255592): The simulated mouse event dispatch quirk should not be...
wenson_hsieh@apple.com [Tue, 11 Feb 2020 00:22:20 +0000 (00:22 +0000)]
[iOS] REGRESSION (r255592): The simulated mouse event dispatch quirk should not be on by default
https://bugs.webkit.org/show_bug.cgi?id=207513
<rdar://problem/59326119>

Reviewed by Tim Horton.

Turn `shouldDispatchSimulatedMouseEvents` back off by default (r255592 enabled it by default on all web pages).

* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256228 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ Mac Debug ] inspector/animation/lifecycle-css-transition.html is flaky failing.
lawrence.j@apple.com [Tue, 11 Feb 2020 00:12:52 +0000 (00:12 +0000)]
[ Mac Debug ] inspector/animation/lifecycle-css-transition.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207517

Unreviewed test gardening.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256227 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ Mac wk2 ] http/wpt/service-workers/service-worker-spinning-fetch.https.html is...
lawrence.j@apple.com [Mon, 10 Feb 2020 23:57:56 +0000 (23:57 +0000)]
[ Mac wk2 ] http/wpt/service-workers/service-worker-spinning-fetch.https.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207515

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256226 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[watchOS] Notification listener is never unregistered
pvollan@apple.com [Mon, 10 Feb 2020 23:49:15 +0000 (23:49 +0000)]
[watchOS] Notification listener is never unregistered
https://bugs.webkit.org/show_bug.cgi?id=207459
Source/WebKit:

<rdar://problem/58923393>

Reviewed by Maciej Stachowiak.

On watchOS, the backlight changed notification is registered in WebProcessPool::registerNotificationObservers(),
but not unregistered in WebProcessPool::unregisterNotificationObservers().

API test: WebKit.BacklightLevelNotificationCrash

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::unregisterNotificationObservers):

Tools:

Reviewed by Maciej Stachowiak.

Add a test which tests that posting a backlight level change notification will not cause a crash.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/BacklightLevelNotification.mm: Added.
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256225 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[WebCore] Shrink Vectors passed to SharedBuffer
basuke.suzuki@sony.com [Mon, 10 Feb 2020 23:17:18 +0000 (23:17 +0000)]
[WebCore] Shrink Vectors passed to SharedBuffer
https://bugs.webkit.org/show_bug.cgi?id=207503

Reviewed by Yusuke Suzuki.

Once SharedBuffer::DataSegment is created, the content won't change in its life cycle. Shrink the passed vector
before assigning to member variable to save space.

With the quick research, when displaying Apple's website, 1~3% RSS usage reduction on PlayStation port.

No new tests because there's no behavior change.

* platform/SharedBuffer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256223 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoREGRESSION: [ Win ] ( r254044 ) css1/box_properties/padding_left.html is failing
antti@apple.com [Mon, 10 Feb 2020 23:14:39 +0000 (23:14 +0000)]
REGRESSION: [ Win ] ( r254044 ) css1/box_properties/padding_left.html is failing
https://bugs.webkit.org/show_bug.cgi?id=207480
<rdar://problem/59316463>

Unreviewed test gardening.

* platform/win/css1/box_properties/padding_left-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256222 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoREGRESSION (r246055): Data detected URLs are no longer blue
timothy@apple.com [Mon, 10 Feb 2020 22:40:26 +0000 (22:40 +0000)]
REGRESSION (r246055): Data detected URLs are no longer blue
https://bugs.webkit.org/show_bug.cgi?id=207490
rdar://problem/58760796

Reviewed by Tim Horton.

This matches how the old code ended up working, since the old approach inlined the blue link color when
"shouldUseLightLinks" was false. This change allows the link style color to naturally apply as expected.
DD only uses light links when the category is "link" or "phone number" and not in the email signature.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange): Only set color: currentColor when setting underline color.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256217 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoStandard gamepad mapping for GameControllerGamepads
commit-queue@webkit.org [Mon, 10 Feb 2020 22:38:22 +0000 (22:38 +0000)]
Standard gamepad mapping for GameControllerGamepads
https://bugs.webkit.org/show_bug.cgi?id=206033

Patch by James Howard <jameshoward@mac.com> on 2020-02-10
Reviewed by Dean Jackson.
Source/WebCore:

Extend PlatformGamepad to add a field for the gamepad mapping.
The mapping defines the order and interpretation of the axes and
buttons vectors, and is passed along to users of the Gamepad
API[1].

Letting PlatformGamepad subclassers define their mapping is the
natural place for this functionality. The PlatformGamepad
already defines the order of the axes and buttons and
PlatformGamepad subclassers may know something about the
physical layout of the gamepad they represent.

This change modifies the GameControllerGamepad subclass of
PlatformGamepad to set the mapping to "standard" when a
GCExtendedGamepad is detected, and to bind the axes and buttons
appropriately. Previously, the buttons and axes were bound
arbitrarily, and in some cases incompletely. While that wasn't a
bug per se, because with the mapping set to the empty string an
implementation is free to provide any interpretation of the
gamepad elements it likes, it was certainly less useful than the
"standard" mapping.

[1] https://www.w3.org/TR/gamepad/#remapping

* Modules/gamepad/Gamepad.cpp:
(WebCore::Gamepad::Gamepad):
* platform/gamepad/PlatformGamepad.h:
(WebCore::PlatformGamepad::mapping const):
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsExtendedGamepad):
* testing/MockGamepad.cpp:
(WebCore::MockGamepad::MockGamepad):
(WebCore::MockGamepad::updateDetails):
* testing/MockGamepad.h:
* testing/MockGamepadProvider.cpp:
(WebCore::MockGamepadProvider::setMockGamepadDetails):
* testing/MockGamepadProvider.h:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setMockGamepadDetails):
* testing/js/WebCoreTestSupport.h:

Source/WebKit:

Make the mapping as provided by PlatformGamepad
available in UIGamepad, and pass it along to
GamepadData so it can be correctly reflected
in the Gamepad API.

* Shared/Gamepad/GamepadData.cpp:
(WebKit::GamepadData::GamepadData):
(WebKit::GamepadData::encode const):
(WebKit::GamepadData::decode):
* Shared/Gamepad/GamepadData.h:
(WebKit::GamepadData::mapping const):
* UIProcess/Gamepad/UIGamepad.cpp:
(WebKit::UIGamepad::UIGamepad):
(WebKit::UIGamepad::fullGamepadData const):
* UIProcess/Gamepad/UIGamepad.h:
* WebProcess/Gamepad/WebGamepad.cpp:
(WebKit::WebGamepad::WebGamepad):

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setMockGamepadDetails):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* gamepad/gamepad-polling-access-expected.txt:
* gamepad/gamepad-polling-access.html:
* gamepad/gamepad-timestamp.html:
* gamepad/gamepad-visibility-1.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoWebContent jetsams on Sony lens webpage due to spike of IOSurfaces
simon.fraser@apple.com [Mon, 10 Feb 2020 22:27:47 +0000 (22:27 +0000)]
WebContent jetsams on Sony lens webpage due to spike of IOSurfaces
https://bugs.webkit.org/show_bug.cgi?id=207493
rdar://problem/59020443

Reviewed by Zalan Bujtas.
Source/WebCore:

There were three issues that contributed to massive backing store allocation on
<https://www.sony.com/electronics/lenses/t/camera-lenses>.

The first, fixed in r256095, was that the Web Animations code unioned the untransitioning
bounds with the transitioning bounds, causing the computation of large extent rects.

The second, fixed in r256181, was that GraphicsLayerCA would keep hold of a transform
animation for an extra frame, causing a rendering update where
RenderLayerBacking::updateGeometry() would have cleared the extent, but GraphicsLayerCA
still thought transform was animating, causing GraphicsLayerCA::updateCoverage() to keep
backing store attached.

This patch is the final fix; when animations start and end, we need to ensure that
RenderLayerBacking::updateGeometry() is called so that we compute the animation extent in
the same frame that adds the animation.

Test: compositing/backing/transition-extent.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::animationFinished):

LayoutTests:

Test with an out-of-view transitioning element which should not get backing store.

* compositing/backing/transition-extent-expected.txt: Added.
* compositing/backing/transition-extent.html: Added.
* platform/ios-wk2/compositing/backing/transition-extent-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ Mac Debug wk2 ] imported/w3c/web-platform-tests/fetch/api/request/destination/fetch...
lawrence.j@apple.com [Mon, 10 Feb 2020 22:24:08 +0000 (22:24 +0000)]
[ Mac Debug wk2 ] imported/w3c/web-platform-tests/fetch/api/request/destination/fetch-destination-worker.https.html is flaky crashing.
https://bugs.webkit.org/show_bug.cgi?id=207509

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ews] Display flaky layout test names in build summary
aakash_jain@apple.com [Mon, 10 Feb 2020 22:08:58 +0000 (22:08 +0000)]
[ews] Display flaky layout test names in build summary
https://bugs.webkit.org/show_bug.cgi?id=207504

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(ReRunWebKitTests.evaluateCommand): Drive-by fix to correct the pluralization.
(AnalyzeLayoutTestsResults.report_pre_existing_failures): Append the flaky failure information.
(AnalyzeLayoutTestsResults.start):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ Mac wk2 ] webgpu/whlsl/textures-load.html is flaky failing.
lawrence.j@apple.com [Mon, 10 Feb 2020 22:08:49 +0000 (22:08 +0000)]
[ Mac wk2 ] webgpu/whlsl/textures-load.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207508

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ iOS wk2 ] http/wpt/cache-storage/cache-put-keys.https.any.html is flaky failing.
lawrence.j@apple.com [Mon, 10 Feb 2020 21:35:12 +0000 (21:35 +0000)]
[ iOS wk2 ] http/wpt/cache-storage/cache-put-keys.https.any.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207496

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoFolloup to r256193 to set the proper ImageOnlyFailure expectation.
tsavell@apple.com [Mon, 10 Feb 2020 21:29:21 +0000 (21:29 +0000)]
Folloup to r256193 to set the proper ImageOnlyFailure expectation.
https://bugs.webkit.org/show_bug.cgi?id=207477

unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256209 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ Win ] (r255593) webanimations/transform-accelerated-animation-finishes-before-remov...
tsavell@apple.com [Mon, 10 Feb 2020 21:27:53 +0000 (21:27 +0000)]
[ Win ] (r255593) webanimations/transform-accelerated-animation-finishes-before-removal.html is failing
https://bugs.webkit.org/show_bug.cgi?id=207499

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoDon't update selection when calling setSelectionRange on a disconnected input element
rniwa@webkit.org [Mon, 10 Feb 2020 21:23:12 +0000 (21:23 +0000)]
Don't update selection when calling setSelectionRange on a disconnected input element
https://bugs.webkit.org/show_bug.cgi?id=207357

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaselined the test that progressed a little. The test now passes offset checks but still fails direction check.

* web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea-expected.txt:

Source/WebCore:

Don't update FrameSelection when the text form control element is disconnected from document.

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):

LayoutTests:

Rebaselined the test that has progressed with this change.

* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256207 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ews] Use SetBuildSummary instead of buildFinished in Layout tests
aakash_jain@apple.com [Mon, 10 Feb 2020 21:14:39 +0000 (21:14 +0000)]
[ews] Use SetBuildSummary instead of buildFinished in Layout tests
https://bugs.webkit.org/show_bug.cgi?id=207492

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKitTests.evaluateCommand):
(ReRunWebKitTests.evaluateCommand):
(AnalyzeLayoutTestsResults.report_pre_existing_failures):
* BuildSlaveSupport/ews-build/factories.py:
(TestFactory.__init__):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256206 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ Win ] (r255383) webanimations/width-and-opacity-separate-animation-yields-compositi...
tsavell@apple.com [Mon, 10 Feb 2020 21:06:45 +0000 (21:06 +0000)]
[ Win ] (r255383) webanimations/width-and-opacity-separate-animation-yields-compositing.html is failing
https://bugs.webkit.org/show_bug.cgi?id=207495

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoUnreviewed, speculative build fix on watchOS simulator
ysuzuki@apple.com [Mon, 10 Feb 2020 20:51:45 +0000 (20:51 +0000)]
Unreviewed, speculative build fix on watchOS simulator
https://bugs.webkit.org/show_bug.cgi?id=207183

* wtf/HashTable.h:
(WTF::HashTableCapacityForSize::capacityForSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256203 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoPlacate exception check validator in GenericArguments<Type>::put().
mark.lam@apple.com [Mon, 10 Feb 2020 20:40:00 +0000 (20:40 +0000)]
Placate exception check validator in GenericArguments<Type>::put().
https://bugs.webkit.org/show_bug.cgi?id=207485
<rdar://problem/59302535>

Reviewed by Robin Morisset.

JSTests:

* stress/placate-exception-check-validator-in-GenericArguments-put.js: Added.

Source/JavaScriptCore:

* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::put):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256202 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[WebAuthn] Merge some of the CTAP response decoder's code
jiewen_tan@apple.com [Mon, 10 Feb 2020 20:26:04 +0000 (20:26 +0000)]
[WebAuthn] Merge some of the CTAP response decoder's code
https://bugs.webkit.org/show_bug.cgi?id=205375

Reviewed by Darin Adler.

This patch makes those code more compact and maintainable.

No change of behaviors.

* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::decodeResponseMap):
(fido::readCTAPMakeCredentialResponse):
(fido::readCTAPGetAssertionResponse):
(fido::readCTAPGetInfoResponse):
* Modules/webauthn/fido/DeviceResponseConverter.h:
* Modules/webauthn/fido/Pin.cpp:
(fido::pin::encodePinCommand):
(fido::pin::RetriesResponse::parse):
(fido::pin::KeyAgreementResponse::parse):
(fido::pin::TokenResponse::parse):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[CMake] Prepend -Wno-noexcept-type only to global CXX flags
commit-queue@webkit.org [Mon, 10 Feb 2020 20:24:03 +0000 (20:24 +0000)]
[CMake] Prepend -Wno-noexcept-type only to global CXX flags
https://bugs.webkit.org/show_bug.cgi?id=207468

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-02-10
Reviewed by Adrian Perez de Castro.

-Wno-noexcept-type is a C++-specific flag that should not be passed to the C compiler. This
causes a warning spam in GCC 10.

* Source/cmake/WebKitCompilerFlags.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256200 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoarm64_32: microbenchmarks/delete-property-keeps-cacheable-structure.js is timing out
justin_michaud@apple.com [Mon, 10 Feb 2020 20:09:45 +0000 (20:09 +0000)]
arm64_32: microbenchmarks/delete-property-keeps-cacheable-structure.js is timing out
https://bugs.webkit.org/show_bug.cgi?id=207484

Reviewed by Yusuke Suzuki.

* microbenchmarks/delete-property-keeps-cacheable-structure.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256199 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoMissing exception check in GenericArguments<Type>::deletePropertyByIndex().
mark.lam@apple.com [Mon, 10 Feb 2020 19:47:58 +0000 (19:47 +0000)]
Missing exception check in GenericArguments<Type>::deletePropertyByIndex().
https://bugs.webkit.org/show_bug.cgi?id=207483
<rdar://problem/59302616>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/missing-exception-check-in-GenericArguments-deletePropertyByIndex.js: Added.

Source/JavaScriptCore:

* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::deletePropertyByIndex):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256198 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoREGRESSION: (256055) http/tests/resourceLoadStatistics/log-cross-site-load-with-link...
katherine_cheney@apple.com [Mon, 10 Feb 2020 19:36:42 +0000 (19:36 +0000)]
REGRESSION: (256055) http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html is failing
https://bugs.webkit.org/show_bug.cgi?id=207479
<rdar://problem/59316238>

Unreviewed test gardening

* http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration-expected.txt:
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256197 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoRename SelectionData classes and structures HighlightData, etc to be more inclusive...
megan_gardner@apple.com [Mon, 10 Feb 2020 19:32:19 +0000 (19:32 +0000)]
Rename SelectionData classes and structures HighlightData, etc to be more inclusive for their new use cases
https://bugs.webkit.org/show_bug.cgi?id=206340

Reviewed by Ryosuke Niwa.

Rename only, no behaviour change.

With the new Highlight API, we will be using these data structures to support Highlights as well as Selection,
rename to Highlight, as a Selection is a type of Highlight.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/DragImage.cpp:
(WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
(WebCore::createDragImageForRange):
* rendering/ComplexLineLayout.cpp:
(WebCore::ComplexLineLayout::constructLine):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
* rendering/EllipsisBox.h:
* rendering/HighlightData.cpp: Renamed from Source/WebCore/rendering/SelectionRangeData.cpp.
(WebCore::isValidRendererForSelection):
(WebCore::collect):
(WebCore::HighlightData::HighlightData):
(WebCore::HighlightData::setRenderRange):
(WebCore::HighlightData::selectionStateForRenderer):
(WebCore::HighlightData::set):
(WebCore::HighlightData::clear):
(WebCore::HighlightData::repaint const):
(WebCore::HighlightData::collectBounds const):
(WebCore::HighlightData::apply):
* rendering/HighlightData.h: Renamed from Source/WebCore/rendering/SelectionRangeData.h.
(WebCore::HighlightData::RenderRange::RenderRange):
(WebCore::HighlightData::RenderRange::operator== const):
(WebCore::HighlightData::get const):
(WebCore::HighlightData::start const):
(WebCore::HighlightData::end const):
(WebCore::HighlightData::startOffset const):
(WebCore::HighlightData::endOffset const):
* rendering/InlineBox.cpp:
(WebCore::InlineBox::selectionState):
* rendering/InlineBox.h:
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::selectionState):
* rendering/InlineFlowBox.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionState):
(WebCore::InlineTextBox::verifySelectionState const):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::clampedStartEndForState const):
(WebCore::InlineTextBox::highlightStartEnd const):
(WebCore::InlineTextBox::collectMarkedTextsForHighlights const):
* rendering/InlineTextBox.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::shouldPaintSelectionGaps const):
(WebCore::RenderBlock::selectionGaps):
(WebCore::RenderBlock::blockSelectionGaps):
(WebCore::RenderBlock::getSelectionGapInfo):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::setSelectionState):
(WebCore::RenderBlockFlow::inlineSelectionGaps):
* rendering/RenderBlockFlow.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::setSelectionState):
* rendering/RenderBoxModelObject.h:
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::setSelectionState):
* rendering/RenderLineBreak.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
(WebCore::RenderListMarker::setSelectionState):
(WebCore::RenderListMarker::selectionRectForRepaint):
* rendering/RenderListMarker.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isSelectionBorder const):
* rendering/RenderObject.h:
(WebCore::RenderObject::selectionState const):
(WebCore::RenderObject::setSelectionState):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
(WebCore::RenderObject::RenderObjectBitfields::selectionState const):
(WebCore::RenderObject::RenderObjectBitfields::setSelectionState):
(WebCore::RenderObject::setSelectionStateIfNeeded):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::shouldDrawSelectionTint const):
(WebCore::RenderReplaced::paint):
(WebCore::RenderReplaced::setSelectionState):
(WebCore::RenderReplaced::isSelected const):
* rendering/RenderReplaced.h:
* rendering/RenderSelectionInfo.h:
(WebCore::RenderSelectionInfoBase::state const):
* rendering/RenderText.cpp:
(WebCore::RenderText::setSelectionState):
(WebCore::RenderText::collectSelectionRectsForLineBoxes):
* rendering/RenderText.h:
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::setSelectionState):
* rendering/RenderTextLineBoxes.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintAttachment):
* rendering/RenderView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setSelectionState):
* rendering/RenderWidget.h:
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::lineSelectionGap):
(WebCore::RootInlineBox::selectionState):
(WebCore::RootInlineBox::firstSelectedBox):
(WebCore::RootInlineBox::lastSelectedBox):
(WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock const):
* rendering/RootInlineBox.h:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintSelectionBackground):
(WebCore::SVGInlineTextBox::paint):
* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::paint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoREGRESSION: [ Win ] css1/box_properties/padding_left.html is failing
tsavell@apple.com [Mon, 10 Feb 2020 18:49:57 +0000 (18:49 +0000)]
REGRESSION: [ Win ] css1/box_properties/padding_left.html is failing
https://bugs.webkit.org/show_bug.cgi?id=207480

Unreviewed test gardening

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoUnreviewed, fix build failure on watchOS simulator
ysuzuki@apple.com [Mon, 10 Feb 2020 18:35:02 +0000 (18:35 +0000)]
Unreviewed, fix build failure on watchOS simulator
https://bugs.webkit.org/show_bug.cgi?id=207183

* wtf/HashTable.h:
(WTF::HashTableCapacityForSize::capacityForSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256194 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoREGRESSION: [ Win ] animations/stacking-context-not-fill-forwards.html is failing
tsavell@apple.com [Mon, 10 Feb 2020 18:25:58 +0000 (18:25 +0000)]
REGRESSION: [ Win ] animations/stacking-context-not-fill-forwards.html is failing
https://bugs.webkit.org/show_bug.cgi?id=207477

unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256193 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoUnreachable code hit in WebCore::Shape::createShape
said@apple.com [Mon, 10 Feb 2020 18:21:56 +0000 (18:21 +0000)]
Unreachable code hit in WebCore::Shape::createShape
https://bugs.webkit.org/show_bug.cgi?id=207399

Reviewed by Darin Adler.

Source/WebCore:

CSS parser should not consume the 'shape-outside' property with type 'path'
since it has not been implemented yet. This will prevent an assertion in
the debug build and null dref in the release build.

Test: css3/shapes/shape-outside-path-no-crash.html

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShape):
(WebCore::consumeShapeOutside):

LayoutTests:

* css3/shapes/shape-outside-path-no-crash-expected.txt: Added.
* css3/shapes/shape-outside-path-no-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256192 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoDisallow setting base URL to a data or JavaScript URL
dbates@webkit.org [Mon, 10 Feb 2020 18:16:49 +0000 (18:16 +0000)]
Disallow setting base URL to a data or JavaScript URL
https://bugs.webkit.org/show_bug.cgi?id=207136

Source/WebCore:

Reviewed by Brent Fulgham.

Inspired by <https://bugs.chromium.org/p/chromium/issues/detail?id=679318>.

Block setting the base URL to a data URL or JavaScript URL as such usage is questionable.
This makes WebKit match the behavior of Chrome and Firefox and is in the spirit of the
discussion in <https://github.com/whatwg/html/issues/2249>.

On Mac and iOS, this restriction is applied only to apps linked against a future SDK to
avoid breaking shipped apps.

For all other ports, this restriction is enabled by default.

Tests: fast/url/relative2.html
       fast/url/segments-from-data-url2.html
       http/tests/security/allowed-base-url-data-url-via-setting.html
       http/tests/security/denied-base-url-data-url.html
       http/tests/security/denied-base-url-javascript-url.html

* dom/Document.cpp:
(WebCore::Document::processBaseElement): Condition updating the parsed
base URL on whether is has an allowed scheme, if restrictions are enabled. Otherwise,
do what we do now. If the scheme is disallowed then log a message to the console to
explain this to web developers.
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::scan): Pass whether to apply restrictons to the base URL
to updatePredictedBaseURL(). This depends on whether the setting is enabled or not.
(WebCore::TokenPreloadScanner::updatePredictedBaseURL): Modifed to take a boolean as to
whether to apply restrictions. If restrictions are not to be applied do what we do now.
Otherwise, only do what we do now if the scheme for the predicated base URL is allowed.
* html/parser/HTMLPreloadScanner.h:
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::isBaseURLSchemeAllowed): Added.
* page/SecurityPolicy.h:
* page/Settings.yaml: Add a setting to toggle restrictions on the base URL scheme.

Source/WebKit:

Reviewed by Brent Fulgham.

Apply base URL restrictions to apps linked to a future WebKit to avoid breaking existing apps.

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldRestrictBaseURLSchemes): Added.
(-[WKWebView _setupPageConfiguration:]): Update settings.
* UIProcess/Cocoa/VersionChecks.h:

Source/WebKitLegacy/mac:

Reviewed by Brent Fulgham.

Apply base URL restrictions to apps linked to a future WebKit to avoid breaking existing apps.

* Misc/WebKitVersionChecks.h:
* WebView/WebView.mm:
(shouldRestrictBaseURLSchemes): Added.
(-[WebView _commonInitializationWithFrameName:groupName:]): Update settings.

Source/WTF:

Reviewed by Brent Fulgham.

Add some more macro definitions.

* wtf/spi/darwin/dyldSPI.h:

LayoutTests:

RReviewed by Brent Fulgham.

Add some tests. Update others to toggle the setting to apply or unapply the new behavior.

The test denied-base-url-javascript-url.html is derived from the test base-url-javascript.html,
included in <https://chromium.googlesource.com/chromium/src.git/+/c133efa0b915430701930b76a7cfe35608b9a403>.

* fast/url/relative-expected.txt:
* fast/url/relative.html:
* fast/url/relative2-expected.txt: Copied from LayoutTests/fast/url/relative-expected.txt.
* fast/url/relative2.html: Copied from LayoutTests/fast/url/relative.html.
* fast/url/resources/utilities.js:
(setShouldEllipsizeFileURLPaths): Added. Toggles ellipsizing the path portion of a file URL to simplify matching.
Otherwise, file URLs could be machine-specific.
(canonicalizedPathname): Added.
(segments): Modified to optionally call canonicalizedPathname.
(canonicalize): Ditto.
* fast/url/segments-from-data-url-expected.txt:
* fast/url/segments-from-data-url.html:
* fast/url/segments-from-data-url2-expected.txt: Copied from LayoutTests/fast/url/segments-from-data-url-expected.txt.
* fast/url/segments-from-data-url2.html: Copied from LayoutTests/fast/url/segments-from-data-url.html.
* fetch/fetch-url-serialization-expected.txt:
* http/tests/plugins/navigation-during-load-embed.html:
* http/tests/plugins/navigation-during-load.html:
* http/tests/security/allowed-base-url-data-url-via-setting-expected.txt: Added.
* http/tests/security/allowed-base-url-data-url-via-setting.html: Added.
* http/tests/security/denied-base-url-data-url-expected.txt: Added.
* http/tests/security/denied-base-url-data-url.html: Added.
* http/tests/security/denied-base-url-javascript-url-expected.txt: Added.
* http/tests/security/denied-base-url-javascript-url.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256191 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS wk2 ] webgpu/whlsl/store-to-property-updates-properly.html is flaky failing
jacob_uphoff@apple.com [Mon, 10 Feb 2020 18:14:15 +0000 (18:14 +0000)]
[ macOS wk2 ] webgpu/whlsl/store-to-property-updates-properly.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207476

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256190 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoRegression (r255961): fast/loader/data-url-load-denied.html is consistently timing...
tsavell@apple.com [Mon, 10 Feb 2020 18:08:43 +0000 (18:08 +0000)]
Regression (r255961): fast/loader/data-url-load-denied.html is consistently timing out on windows
https://bugs.webkit.org/show_bug.cgi?id=207373

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256189 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS wk2 ] http/tests/cache-storage/cache-records-persistency.https.html is flaky...
jacob_uphoff@apple.com [Mon, 10 Feb 2020 18:00:06 +0000 (18:00 +0000)]
[ macOS wk2 ] http/tests/cache-storage/cache-records-persistency.https.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207474

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256188 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoCrash under WebProcessProxy::shouldSendPendingMessage()
cdumez@apple.com [Mon, 10 Feb 2020 17:57:30 +0000 (17:57 +0000)]
Crash under WebProcessProxy::shouldSendPendingMessage()
https://bugs.webkit.org/show_bug.cgi?id=207464
<rdar://problem/59293825>

Reviewed by Alex Christensen.

I suspect the WebProcessProxy object is getting destroyed as we are iterating over the
pending messages in AuxiliaryProcessProxy::didFinishLaunching(), thus crashing when
calling WebProcessProxy::shouldSendPendingMessage() inside the loop. As a speculative
fix, protect |this| at the beginning of WebProcessProxy::didFinishLaunching().

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didFinishLaunching):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256187 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS wk1 ] imported/w3c/web-platform-tests/workers/WorkerGlobalScope_ErrorEvent_co...
jacob_uphoff@apple.com [Mon, 10 Feb 2020 17:36:53 +0000 (17:36 +0000)]
[ macOS wk1 ] imported/w3c/web-platform-tests/workers/WorkerGlobalScope_ErrorEvent_colno.htm is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=207470

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoUse ObjectIdentifier for WebRTC resolvers
youenn@apple.com [Mon, 10 Feb 2020 17:29:45 +0000 (17:29 +0000)]
Use ObjectIdentifier for WebRTC resolvers
https://bugs.webkit.org/show_bug.cgi?id=207381

Reviewed by Eric Carlson.

Use ObjectIdentifier instead of uint64_t which gives type safety and ensures we do not receive wrong identifiers from IPC.
No change of behavior.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::close):
(WebKit::NetworkRTCProvider::createResolver):
Remove empty string check case since DNS resolver should be robust to null/empty strings.
(WebKit::NetworkRTCProvider::stopResolver):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* NetworkProcess/webrtc/NetworkRTCResolver.cpp:
(WebKit::NetworkRTCResolver::create):
(WebKit::NetworkRTCResolver::NetworkRTCResolver):
(WebKit::NetworkRTCResolver::start):
(WebKit::NetworkRTCResolver::stop):
* NetworkProcess/webrtc/NetworkRTCResolver.h:
* NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
(WebKit::NetworkRTCResolver::create):
(WebKit::NetworkRTCResolverCocoa::NetworkRTCResolverCocoa):
* NetworkProcess/webrtc/NetworkRTCResolverCocoa.h:
* Scripts/webkit/messages.py:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):
* WebProcess/Network/webrtc/LibWebRTCNetwork.h:
(WebKit::LibWebRTCNetwork::resolver):
* WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
(WebKit::LibWebRTCResolver::Start):
(WebKit::LibWebRTCResolver::Destroy):
* WebProcess/Network/webrtc/LibWebRTCResolver.h:
* WebProcess/Network/webrtc/LibWebRTCResolverIdentifier.h: Copied from Source/WebKit/WebProcess/Network/webrtc/WebRTCResolver.h.
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::createAsyncResolver):
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
(WebKit::LibWebRTCSocketFactory::resolver):
(WebKit::LibWebRTCSocketFactory::takeResolver):
* WebProcess/Network/webrtc/WebRTCResolver.cpp:
(WebKit::WebRTCResolver::WebRTCResolver):
* WebProcess/Network/webrtc/WebRTCResolver.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256185 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoUnreviewed, rolling out r256091.
tsavell@apple.com [Mon, 10 Feb 2020 17:28:29 +0000 (17:28 +0000)]
Unreviewed, rolling out r256091.

Broke internal builds

Reverted changeset:

"Move trivial definitions from FeatureDefines.xcconfig to
PlatformEnableCocoa.h"
https://bugs.webkit.org/show_bug.cgi?id=207155
https://trac.webkit.org/changeset/256091

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256184 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoUnreviewed, rolling out r256103.
tsavell@apple.com [Mon, 10 Feb 2020 17:26:55 +0000 (17:26 +0000)]
Unreviewed, rolling out r256103.

This patch is blocking the rollout of r256091

Reverted changeset:

"Move JavaScriptCore related feature defines from
FeatureDefines.xcconfig to PlatformEnableCocoa.h"
https://bugs.webkit.org/show_bug.cgi?id=207436
https://trac.webkit.org/changeset/256103

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256183 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS wk1 ] imported/w3c/web-platform-tests/svg/animations/slider-switch.html is...
jacob_uphoff@apple.com [Mon, 10 Feb 2020 17:25:50 +0000 (17:25 +0000)]
[ macOS wk1 ] imported/w3c/web-platform-tests/svg/animations/slider-switch.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207469

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256182 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoThere's an event loop cycle between an animation finishing, and it being removed...
graouts@webkit.org [Mon, 10 Feb 2020 17:24:49 +0000 (17:24 +0000)]
There's an event loop cycle between an animation finishing, and it being removed from GraphicsLayerCA
https://bugs.webkit.org/show_bug.cgi?id=207361
<rdar://problem/59280370>

Reviewed by Simon Fraser.

Source/WebCore:

Animations should be removed from GraphicsLayersCAs in the same rendering update that changes the playState of the
animation to "finished", to avoid layer flush where a GraphicsLayersCAs has no extent set, but thinks there is
an active transform animation.

To do this, instead of enqueuing accelerated actions when resolving animations during style resolution, in
KeyframeAnimation::apply(), we enqueue them as soon as an animation's current time may have changed: in
WebAnimation::tick() and WebAnimation::play() with supporting functions newly exposed on AnimationEffect.

Now, accelerated animations are enqueued and applied during the "update animations and send events" procedure.

* animation/AnimationEffect.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::apply):
(WebCore::KeyframeEffect::updateAcceleratedActions):
(WebCore::KeyframeEffect::animationDidTick):
(WebCore::KeyframeEffect::animationDidPlay):
* animation/KeyframeEffect.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::play):
(WebCore::WebAnimation::tick):

LayoutTests:

Lower the number of frames to wait after an animation completes by one to check that the accelerated animation has been removed
to show that we enqueue accelerated actions as part of the "update animations and send events" procedure.

* webanimations/accelerated-animation-removal-upon-transition-completion.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS iOS wk2 ] http/wpt/service-workers/service-worker-networkprocess-crash.html...
jacob_uphoff@apple.com [Mon, 10 Feb 2020 17:13:52 +0000 (17:13 +0000)]
[ macOS iOS wk2 ] http/wpt/service-workers/service-worker-networkprocess-crash.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207466

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256178 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[Web Animations] Fix animations/stop-animation-on-suspend.html
graouts@webkit.org [Mon, 10 Feb 2020 17:11:13 +0000 (17:11 +0000)]
[Web Animations] Fix animations/stop-animation-on-suspend.html
https://bugs.webkit.org/show_bug.cgi?id=184580
<rdar://problem/39406014>

Reviewed by Simon Fraser.

The expectations of this test were incorrect. The test animates a transform from 0 to 400px across 400ms with a linear timing function. The test suspends
animations from 100ms to 300ms with timers, and polls animations at 200ms and 400ms. At 200ms, it expects a value of 100px, which is correct since the animation
is suspended and so the value at 100ms (when it was suspended) is expected.

However, the test expected the value at 400ms to be 200px, which leads me to think this test assumes that animations, when resumed, account for the time suspended
and subtracts it from the page time. This is incorrect: when animations resume, they resume at the current time, no matter how long they were suspended. So the expected
value should be 400px.

* animations/stop-animation-on-suspend-expected.txt:
* animations/stop-animation-on-suspend.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS iOS wk2 ] storage/indexeddb/intversion-long-queue.html is a flaky failure.
jacob_uphoff@apple.com [Mon, 10 Feb 2020 16:54:31 +0000 (16:54 +0000)]
[ macOS iOS wk2 ] storage/indexeddb/intversion-long-queue.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=207465

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256176 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS ] inspector/runtime/getCollectionEntries.html is flaky failing
jacob_uphoff@apple.com [Mon, 10 Feb 2020 16:37:27 +0000 (16:37 +0000)]
[ macOS ] inspector/runtime/getCollectionEntries.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207463

Unreviewed test gardening

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256175 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoRegression (~r252261): [ Mac wk2 ] inspector/heap/getPreview.html is flaky failing
jacob_uphoff@apple.com [Mon, 10 Feb 2020 16:20:06 +0000 (16:20 +0000)]
Regression (~r252261): [ Mac wk2 ] inspector/heap/getPreview.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207209

Correcting test expectations.

Unreviewed test gardening

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256174 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoMake FormDataElement::lengthInBytes() safe to call on a non-main thread
cdumez@apple.com [Mon, 10 Feb 2020 16:17:32 +0000 (16:17 +0000)]
Make FormDataElement::lengthInBytes() safe to call on a non-main thread
https://bugs.webkit.org/show_bug.cgi?id=207419
<rdar://problem/54386521>

Reviewed by Youenn Fablet.

Make FormDataElement::lengthInBytes() safe to call on a non-main thread by using the
ThreadableBlobRegistry. DOMCache code in workers may call this on worker threads for
example.

* platform/network/FormData.cpp:
(WebCore::FormDataElement::lengthInBytes const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256173 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoresults.webkit.org: Abstract archive storage solutions
jbedard@apple.com [Mon, 10 Feb 2020 16:10:22 +0000 (16:10 +0000)]
results.webkit.org: Abstract archive storage solutions
https://bugs.webkit.org/show_bug.cgi?id=207277

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/model/archive_context.py:
(ArchiveContext):
(ArchiveContext.ArchiveMetaDataByCommit.unpack):
(ArchiveContext.__init__): Add archiver member.
(ArchiveContext.__enter__): archiver is a context manager.
(ArchiveContext.__exit__): Ditto.
(ArchiveContext.register): The archiver member owns saving an archive.
(ArchiveContext.find_archive): The archiver member owns retrieving an archive.
(ArchiveContext.ArchiveChunks): Move to CassandraArchiver.
* resultsdbpy/resultsdbpy/model/archiver.py: Added.
(Archiver): Base class for all Archiving systems.
(Archiver.archive_digest): Given a file-like archive, calculate it's digest.
(Archiver.archive_size): Given a file-like archive, calculate it's size.
(Archiver.save):
(Archiver.retrieve):
* resultsdbpy/resultsdbpy/model/cassandra_archiver.py: Added.
(CassandraArchiver):
(CassandraArchiver.ArchiveChunks): Moved from ArchiveContext.
(CassandraArchiver.__init__):
(CassandraArchiver.__enter__):
(CassandraArchiver.__exit__):
(CassandraArchiver.save): Split the provided archive into chunks for saving, moved
from ArchiveContext.
(CassandraArchiver.retrieve): Retrieve an archive with the provided hash, moved
from ArchiveContext.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256172 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS ] imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad...
jacob_uphoff@apple.com [Mon, 10 Feb 2020 16:02:36 +0000 (16:02 +0000)]
[ macOS ] imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207461

Unreviewed test gardening

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256171 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS wk2 ] webgpu/whlsl/buffer-vertex.html is flaky failing
jacob_uphoff@apple.com [Mon, 10 Feb 2020 15:46:01 +0000 (15:46 +0000)]
[ macOS wk2 ] webgpu/whlsl/buffer-vertex.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207127

Correcting test expectations for ImageOnlyFailure

Unreviewed test gardening

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256170 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ macOS wk2 ] webgpu/whlsl/separate-shader-modules/separate-shader-modules-7.html...
jacob_uphoff@apple.com [Mon, 10 Feb 2020 15:34:32 +0000 (15:34 +0000)]
[ macOS wk2 ] webgpu/whlsl/separate-shader-modules/separate-shader-modules-7.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=207460

Unreviewed test gardening

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256169 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[geolocation] Fix non-unified build issues
aperez@igalia.com [Mon, 10 Feb 2020 14:48:38 +0000 (14:48 +0000)]
[geolocation] Fix non-unified build issues
https://bugs.webkit.org/show_bug.cgi?id=207457

Unreviewed build fix.

No new tests needed.

* UIProcess/GeolocationPermissionRequestManagerProxy.h: Add missing includes.
* UIProcess/WebGeolocationManagerProxy.cpp: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256167 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoRemove setHTTPAccept call for main resources
commit-queue@webkit.org [Mon, 10 Feb 2020 14:01:19 +0000 (14:01 +0000)]
Remove setHTTPAccept call for main resources
https://bugs.webkit.org/show_bug.cgi?id=207441

Patch by Rob Buis <rbuis@igalia.com> on 2020-02-10
Reviewed by Darin Adler.

Remove setHTTPAccept call for main resources since all main resource loading goes
through CachedResourceLoader, which sets the Accept header as specified in:
https://fetch.spec.whatwg.org/#fetching (Step 1.3).

This patch also removed unused Accept header related functionality
in ResourceRequest.

No test since no change in behavior, tested by http/tests/misc/xhtml.php.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::addExtraFieldsToRequest):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::httpAccept const): Deleted.
(WebCore::ResourceRequestBase::setHTTPAccept): Deleted.
(WebCore::ResourceRequestBase::clearHTTPAccept): Deleted.
* platform/network/ResourceRequestBase.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256166 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[GTK][WebInspector] Do not make Web Inspector windows transient
aperez@igalia.com [Mon, 10 Feb 2020 11:21:37 +0000 (11:21 +0000)]
[GTK][WebInspector] Do not make Web Inspector windows transient
https://bugs.webkit.org/show_bug.cgi?id=207455

Reviewed by Carlos Garcia Campos.

Stop setting Web Inspector windows as transient for the window
containing the web view being inspected, to allow changing their
relative stacking order. No changes are needed for inspector windows
to continue being destroyed correctly when the corresponding web view
is destroyed because code for handling that was already present in
WebInspectorProxyGtk.cpp.

No new tests needed.

* UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
Do not pass a parent window parameter to webkitInspectorWindowNew().
* UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendWindow): Remove code
to obtain the top level window of the WebKitWebView, which no longer
needs being passed to webkitInspectorWindowNew().
* UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp:
(webkitInspectorWindowNew): Do not set the GtkWindow.transient-for
property for the Web Inspector window. Remove the parent window
parameter.
* UIProcess/Inspector/gtk/WebKitInspectorWindow.h: Remove the parent
window parameter for webkitInspectorWindowNew().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256114 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[GTK] Mouse pointer no longer hidden during fullscreen video playback
eocanha@igalia.com [Mon, 10 Feb 2020 10:13:38 +0000 (10:13 +0000)]
[GTK] Mouse pointer no longer hidden during fullscreen video playback
https://bugs.webkit.org/show_bug.cgi?id=197346

Reviewed by Adrian Perez de Castro.

.:

Enabled the CURSOR_VISIBILITY feature on the GTK port.

* Source/cmake/OptionsGTK.cmake:

Source/WebKit:

Covered by existing tests.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): Added implementation.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256113 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[GTK][WebInspector] Always allow data:// URIs for inspector views
aperez@igalia.com [Mon, 10 Feb 2020 10:04:05 +0000 (10:04 +0000)]
[GTK][WebInspector] Always allow data:// URIs for inspector views
https://bugs.webkit.org/show_bug.cgi?id=207454

Reviewed by Carlos Garcia Campos.

No new tests needed.

* UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateFrontendPage): The Web
Inspector may use navigation to data:// URLs, so always allow it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[WPE] Gardening, update baselines and synchronize with GTK
dpino@igalia.com [Mon, 10 Feb 2020 08:38:07 +0000 (08:38 +0000)]
[WPE] Gardening, update baselines and synchronize with GTK
https://bugs.webkit.org/show_bug.cgi?id=207442

Unreviewed gardening.

* platform/wpe/TestExpectations:
* platform/wpe/css3/selectors3/html/css3-modsel-161-expected.txt:
* platform/wpe/css3/selectors3/xhtml/css3-modsel-161-expected.txt:
* platform/wpe/css3/selectors3/xml/css3-modsel-161-expected.txt:
* platform/wpe/fast/block/float/float-avoidance-expected.txt:
* platform/wpe/fast/block/margin-collapse/103-expected.txt:
* platform/wpe/fast/box-shadow/inset-box-shadow-radius-expected.txt:
* platform/wpe/fast/css/text-transform-select-expected.txt:
* platform/wpe/fast/html/keygen-expected.txt:
* platform/wpe/fast/invalid/014-expected.txt:
* platform/wpe/fast/parser/document-write-option-expected.txt:
* platform/wpe/fast/replaced/replaced-breaking-expected.txt:
* platform/wpe/fast/replaced/replaced-breaking-mixture-expected.txt:
* platform/wpe/fast/replaced/three-selects-break-expected.txt:
* platform/wpe/fast/replaced/width100percent-menulist-expected.txt:
* platform/wpe/tables/mozilla/bugs/bug1188-expected.txt:
* platform/wpe/tables/mozilla/bugs/bug18359-expected.txt:
* platform/wpe/tables/mozilla/bugs/bug2479-3-expected.txt:
* platform/wpe/tables/mozilla/bugs/bug2479-4-expected.txt:
* platform/wpe/tables/mozilla/bugs/bug29326-expected.txt:
* platform/wpe/tables/mozilla/bugs/bug33855-expected.txt:
* platform/wpe/tables/mozilla/bugs/bug4382-expected.txt:
* platform/wpe/tables/mozilla/bugs/bug96334-expected.txt:
* platform/wpe/tables/mozilla/core/margins-expected.txt:
* platform/wpe/tables/mozilla/dom/tableDom-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt:
* platform/wpe/transforms/2d/zoom-menulist-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256111 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoReplace redundant functions with variadic template function.
basuke.suzuki@sony.com [Mon, 10 Feb 2020 05:49:46 +0000 (05:49 +0000)]
Replace redundant functions with variadic template function.
https://bugs.webkit.org/show_bug.cgi?id=207413

Reviewed by Darin Adler.

No new tests. Covered by existing tests.

* loader/TextResourceDecoder.cpp:
(WebCore::bytesEqual):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256110 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[GTK][WPE] Expose allowTopNavigationToDataURL
commit-queue@webkit.org [Mon, 10 Feb 2020 04:47:15 +0000 (04:47 +0000)]
[GTK][WPE] Expose allowTopNavigationToDataURL
https://bugs.webkit.org/show_bug.cgi?id=207384

Patch by Lauro Moura <lmoura@igalia.com> on 2020-02-09
Reviewed by Adrian Perez de Castro.

Source/WebKit:

This patch exposes the new property "allow-top-navigation-to-data-urls"
from r255961 to the glib-based APIs.

* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty): Set new property.
(webKitSettingsGetProperty): Get new property.
(webkit_settings_class_init): Register new property.
(webkit_settings_get_allow_top_navigation_to_data_urls): Added.
(webkit_settings_set_allow_top_navigation_to_data_urls): Added.
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

Tools:

Updates with new "allow-top-navigation-to-data-urls" property.

* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewAllowModalDialogs): This test requires this property to be
set.
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings): Added tests for getter/setter.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256109 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoRe-enable LTO for ARM builds
krollin@apple.com [Mon, 10 Feb 2020 02:04:36 +0000 (02:04 +0000)]
Re-enable LTO for ARM builds
https://bugs.webkit.org/show_bug.cgi?id=207402
<rdar://problem/49190767>

Reviewed by Sam Weinig.

Bug 190758 re-enabled LTO for Production builds for x86-family CPUs.
Enabling it for ARM was left out due to a compiler issue. That issue
has been fixed, and so now we can re-enable LTO for ARM.

Source/bmalloc:

* Configurations/Base.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:

Source/WebCore:

No new tests -- no new or changed functionality.

* Configurations/Base.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:

Source/WebKit:

* Configurations/Base.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256108 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[LFC][Integration] Support intruding floats
antti@apple.com [Mon, 10 Feb 2020 01:51:43 +0000 (01:51 +0000)]
[LFC][Integration] Support intruding floats
https://bugs.webkit.org/show_bug.cgi?id=207099

Reviewed by Zalan Bujtas.

Add support for for floats placed by the legacy render tree layout intruding to IFC flow.

This was the last frequently used feature supported by the simple line layout but not
the integrated LFC (pagination is the final missing piece).

* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::remove): Deleted.
* layout/floats/FloatingContext.h:
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatItem::FloatItem):
(WebCore::Layout::FloatingState::FloatingState):
(WebCore::Layout::FloatingState::remove): Deleted.

Delete some unused functions.

* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::isLeftPositioned const):
(WebCore::Layout::FloatingState::clear):
(WebCore::Layout::FloatingState::FloatItem::operator== const): Deleted.
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::canUseFor):

Allow floats.

(WebCore::LayoutIntegration::LineLayout::layout):
(WebCore::LayoutIntegration::LineLayout::prepareLayoutState):
(WebCore::LayoutIntegration::LineLayout::prepareFloatingState):

Translate floats from render tree to IFC float structures.

* layout/integration/LayoutIntegrationLineLayout.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256107 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[LFC][BFC] Move updatePositiveNegativeMarginValues out of MarginCollapse class
zalan@apple.com [Mon, 10 Feb 2020 01:34:09 +0000 (01:34 +0000)]
[LFC][BFC] Move updatePositiveNegativeMarginValues out of MarginCollapse class
https://bugs.webkit.org/show_bug.cgi?id=207445
<rdar://problem/59297879>

Reviewed by Antti Koivisto.

MarginCollapse::updatePositiveNegativeMarginValues is just a static helper.
Let's split this function so that it can be just a regular member function (move the state updating to the BlockFormattingContext caller).

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::resolvedPositiveNegativeMarginValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256106 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoFix the watchOS build after <rdar://problem/56134081>
wenson_hsieh@apple.com [Sun, 9 Feb 2020 22:42:30 +0000 (22:42 +0000)]
Fix the watchOS build after <rdar://problem/56134081>
https://bugs.webkit.org/show_bug.cgi?id=207443
<rdar://problem/59295173>

Reviewed by Maciej Stachowiak.

Use the version of the SPI that's guaranteed to be available across all platforms.

* UIProcess/ios/WKContentViewInteraction.mm:
(gestureRecognizerModifierFlags):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[ Mac wk2 ] http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoratio...
katherine_cheney@apple.com [Sun, 9 Feb 2020 21:36:53 +0000 (21:36 +0000)]
[ Mac wk2 ] http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=207271
<rdar://problem/59190346>

Reviewed by Maciej Stachowiak.

Source/WebKit:

This patch adds a check to make sure a test is expecting a statistics
processing call before proceeding. Otherwise, this can cause
flakiness in ITP tests if data is removed/changed during the test.

* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):

LayoutTests:

This patch updates all ITP tests to follow the pattern
setEnableFeature(true) at test setup and setEnableFeature(false) when
finished. This enables/disables both ITP and the isRunningTest
parameter so tests don't have to make two calls. It also ensures that
each test which relies on statistics processing notifies the testRunner
so it knows to wait for a callback, and deletes unecessary calls
to setStatisticsNotifyPagesWhenDataRecordsWereScanned which is called
in installStatisticsDidScanDataRecordsCallback.

This will help limit flakiness by processing statistics only for ITP
tests which require it for their purpose.

* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html:
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html:
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html:
* http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html:
* http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html:
* http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html:
* http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction.html:
* http/tests/resourceLoadStatistics/prune-statistics-database.html:
* http/tests/resourceLoadStatistics/prune-statistics.html:
* http/tests/resourceLoadStatistics/resources/util.js:
(setEnableFeature):
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html:
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html:
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/telemetry-generation-advanced-functionality-database.html:
* http/tests/resourceLoadStatistics/telemetry-generation-basic-functionality-database.html:
* http/tests/resourceLoadStatistics/telemetry-generation.html:
* http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html:
* http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256104 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoMove JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformE...
weinig@apple.com [Sun, 9 Feb 2020 20:47:04 +0000 (20:47 +0000)]
Move JavaScriptCore related feature defines from FeatureDefines.xcconfig to PlatformEnableCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=207436

Reviewed by Tim Horton.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:
Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:
Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.

Source/WTF:

* wtf/PlatformEnable.h:
Add default values for ENABLE_FAST_JIT_PERMISSIONS and ENABLE_SEPARATED_WX_HEAP.

* wtf/PlatformEnableCocoa.h:
Added ENABLE_FAST_JIT_PERMISSIONS (from FeatureDefines.xcconfig), ENABLE_SEPARATED_WX_HEAP
(from PlatformEnable.h) and ENABLE_FTL_JIT (from both FeatureDefines.xcconfig and PlatformEnable.h).

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
Remove ENABLE_FAST_JIT_PERMISSIONS and ENABLE_FTL_JIT.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256103 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoOptimize Style::determineChange()
simon.fraser@apple.com [Sun, 9 Feb 2020 17:57:04 +0000 (17:57 +0000)]
Optimize Style::determineChange()
https://bugs.webkit.org/show_bug.cgi?id=207438

Reviewed by Antti Koivisto.

Style::determineChange() called RenderStyle::operator!=() before the testing some other
sets of properties for inequality.

It's faster to call inheritedEqual() etc before the full style compare. Also optimize
comparing alignItems() and justifyItems() by adding a helper function that first tests
for equality of the m_rareNonInheritedData pointer. These (added in r213480) return Inherit
because align-items and justify-items affect child layout.

This is a ~4% progression on some MotionMark subtests. Time under TreeResolver::createAnimatedElementUpdate()
drops from 2.4% to 0.9%.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::descendantAffectingNonInheritedPropertiesEqual const):
* rendering/style/RenderStyle.h:
* style/StyleChange.cpp:
(WebCore::Style::determineChange):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256102 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[LFC] FloatingContext::constraints should take a vertical range instead of just verti...
zalan@apple.com [Sun, 9 Feb 2020 17:46:04 +0000 (17:46 +0000)]
[LFC] FloatingContext::constraints should take a vertical range instead of just vertical position.
https://bugs.webkit.org/show_bug.cgi?id=207440
<rdar://problem/59295022>

Reviewed by Antti Koivisto.

In an IFC, this covers the entire line when searching for intrusive float to shrink the available horizontal space.
(This fix is limited to content with fixed line height)

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::constraints const):
* layout/floats/FloatingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::constraintsForLine):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256101 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[LFC][BFC] Replace "estimated" term with "precomputed"
zalan@apple.com [Sun, 9 Feb 2020 04:12:31 +0000 (04:12 +0000)]
[LFC][BFC] Replace "estimated" term with "precomputed"
https://bugs.webkit.org/show_bug.cgi?id=207433
<rdar://problem/59288794>

Reviewed by Antti Koivisto.

The term "pre-computed" describes better what this value is.

* layout/MarginTypes.h:
(WebCore::Layout::EstimatedMarginBefore::usedValue const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPosition):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForAncestors):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRoot):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::setPrecomputedMarginBefore):
(WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors): Deleted.
(WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::hasEstimatedMarginBefore const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasPrecomputedMarginBefore):
(WebCore::Display::Box::invalidatePrecomputedMarginBefore):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setHasEstimatedMarginBefore): Deleted.
(WebCore::Display::Box::invalidateEstimatedMarginBefore): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256100 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[LFC][BFC] Pre-compute vertical position only when we really need it.
zalan@apple.com [Sun, 9 Feb 2020 03:45:11 +0000 (03:45 +0000)]
[LFC][BFC] Pre-compute vertical position only when we really need it.
https://bugs.webkit.org/show_bug.cgi?id=207432
<rdar://problem/59288539>

Reviewed by Antti Koivisto.

Instead of pre-computing the vertical position at computeStaticVerticalPosition, let's compute it when
1. we are about to layout a new non-float-avoider/float clear FC (e.g. so that intrusive floats can shrink the lines inside IFCs)
2. we are about to compute the non-static vertical position of a float avoider block level box.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
(WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRoot):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear): Deleted.
(WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition): Deleted.
* layout/blockformatting/BlockFormattingContext.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256099 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[LFC][BFC] Remove establishesBlockFormattingContextOnly and establishesInlineFormatti...
zalan@apple.com [Sun, 9 Feb 2020 02:51:46 +0000 (02:51 +0000)]
[LFC][BFC] Remove establishesBlockFormattingContextOnly and establishesInlineFormattingContextOnly
https://bugs.webkit.org/show_bug.cgi?id=207431
<rdar://problem/59288366>

Reviewed by Antti Koivisto.

The current caller of establishesInlineFormattingContextOnly is actually interested in whether the box is float avoider
(and the debug-only caller of establishesBlockFormattingContextOnly should instead check if the box also establishes an IFC).

* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createFormattingContext):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesInlineFormattingContextOnly const): Deleted.
(WebCore::Layout::Box::establishesBlockFormattingContextOnly const): Deleted.
* layout/layouttree/LayoutBox.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256098 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[LFC][BFC] Adjust Box::isFloatAvoider() for Inline and Independent FCs.
zalan@apple.com [Sun, 9 Feb 2020 02:01:13 +0000 (02:01 +0000)]
[LFC][BFC] Adjust Box::isFloatAvoider() for Inline and Independent FCs.
https://bugs.webkit.org/show_bug.cgi?id=207430
<rdar://problem/59288236>

Reviewed by Antti Koivisto.

A block container box that establishes both BFC and IFC is not a float avoider (add support for independent formatting context too).

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isFloatAvoider const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256097 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoMigrate definition of USE_PLATFORM_REGISTERS_WITH_PROFILE to PlatformUse.h
weinig@apple.com [Sun, 9 Feb 2020 01:29:05 +0000 (01:29 +0000)]
Migrate definition of USE_PLATFORM_REGISTERS_WITH_PROFILE to PlatformUse.h
https://bugs.webkit.org/show_bug.cgi?id=207428

Reviewed by Tim Horton.

* wtf/PlatformUse.h:
Move definition of USE_PLATFORM_REGISTERS_WITH_PROFILE from AdditionalFeatureDefines.h, where
it did not belong.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256096 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoExtent of a composited animation should not include the untransformed position
simon.fraser@apple.com [Sun, 9 Feb 2020 01:11:36 +0000 (01:11 +0000)]
Extent of a composited animation should not include the untransformed position
https://bugs.webkit.org/show_bug.cgi?id=207434

Reviewed by Sam Weinig.
Source/WebCore:

To determine whether to create ("attach") backing store for layers with transform animations,
we compute the union of all the states of the animation as an "extent", and ask whether it intersects
the coverage rect in GraphicsLayerCA.

The non-Web Animations transition code did this correctly, just unioning the bounds transformed by
the start and end state.

The non-Web Animations keyframe code, and the Web Animations KeyframeEffect code (used for both CSS transitions
and animations) also unioned with the unanimated bounds, which could create overly large extents in some
cases, contributing to jetsams on iOS (rdar://problem/59020443).

Fix KeyframeAnimation and KeyframeEffect to not union with the untransformed bounds.

Tests: compositing/backing/backing-store-attachment-animating-outside-viewport.html
       legacy-animation-engine/compositing/backing/backing-store-attachment-animating-outside-viewport.html

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):

LayoutTests:

New test that checks backing store attachment and overlap for an element which is positioned in-view,
but is move offscreen by the animation.

New baselines for overlap tests, since overlap no longer considers the unanimated position.

* compositing/backing/backing-store-attachment-animating-outside-viewport-expected.txt: Added.
* compositing/backing/backing-store-attachment-animating-outside-viewport.html: Added.
* compositing/layer-creation/translate-animation-overlap-expected.txt:
* compositing/layer-creation/translate-scale-animation-overlap-expected.txt:
* legacy-animation-engine/compositing/backing/backing-store-attachment-animating-outside-viewport-expected.txt: Added.
* legacy-animation-engine/compositing/backing/backing-store-attachment-animating-outside-viewport.html: Added.
* legacy-animation-engine/compositing/layer-creation/translate-animation-overlap-expected.txt:
* legacy-animation-engine/compositing/layer-creation/translate-scale-animation-overlap-expected.txt:
* platform/ios-wk2/compositing/backing/backing-store-attachment-animating-outside-viewport-expected.txt: Added.
* platform/ios-wk2/legacy-animation-engine/compositing/backing/backing-store-attachment-animating-outside-viewport-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256095 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[LFC][BFC] Box::isFloatAvoider should not check for isFloatingPositioned()
zalan@apple.com [Sat, 8 Feb 2020 21:54:58 +0000 (21:54 +0000)]
[LFC][BFC] Box::isFloatAvoider should not check for isFloatingPositioned()
https://bugs.webkit.org/show_bug.cgi?id=207429
<rdar://problem/59288204>

Reviewed by Antti Koivisto.

Box::isFloatAvoider() already checks for establishesBlockFormattingContext() (and floats do establish BFCs).

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isFloatAvoider const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[WTF] Try using 75% load factor for HashTable
ysuzuki@apple.com [Sat, 8 Feb 2020 21:50:02 +0000 (21:50 +0000)]
[WTF] Try using 75% load factor for HashTable
https://bugs.webkit.org/show_bug.cgi?id=207183

Reviewed by Mark Lam.

Source/WTF:

We know that hash-table is one of the most memory consuming part in WebKit.
By analyzing many production hash-table implementations[1], I found that many
of them are using 75% load-factor while our one is 50%.

This patch changes the load-factor from 50% to 75%. But we pick 75% only for
small tables which capacity is <= 1024 based on collected data by micro-benchmarking.
The collected data is telling that longer probe-length affects on performance if table
size gets larger.

[1]: LLVM DenseMap, Abseil's, rust's, and so on.

* wtf/HashTable.h:
(WTF::HashTableCapacityForSize::shouldExpand):
(WTF::HashTableCapacityForSize::capacityForSize):
(WTF::HashTable::shouldExpand const):
(WTF::KeyTraits>::computeBestTableSize):

Tools:

* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::testInitialCapacity):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256093 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoREGRESSION (r256072): ScrollViewScrollabilityTests.ScrollableWithOverflowHiddenAndInp...
wenson_hsieh@apple.com [Sat, 8 Feb 2020 20:36:28 +0000 (20:36 +0000)]
REGRESSION (r256072): ScrollViewScrollabilityTests.ScrollableWithOverflowHiddenAndInputView fails
https://bugs.webkit.org/show_bug.cgi?id=207425
Followup to <rdar://problem/56960774>

Reviewed by Tim Horton.

The failing test ScrollViewScrollabilityTests.ScrollableWithOverflowHiddenAndInputView relies on -[WKWebView
_zoomToFocusRect:...:] to modify the zoom scale of WKScrollView in order for the next layer tree transaction to
have a zoom scale not equal to the initial scale, which in turn ensures that we make the UIScrollView scrollable
after the next remote layer tree update.

The change in r256072 caused us to bail early in -_zoomToFocusRect: and -_zoomToPoint: in the case where the
scroll view is not scrollable (i.e. the page has `overflow: hidden`); this means that if all the following
conditions are met, we now avoid zooming into focused elements, whereas we would've zoomed before the change:

1.  The user is focusing an element on an iPhone.
2.  The document body has `overflow: hidden;`, or the WebKit client has called `-setScrollEnabled:NO`.
3.  Either an SPI client has vended an empty input view and input accessory view, or the focused element has
    inputmode="none".

To fix the test and restore zooming behavior, we partially revert the change in r256072, such that we no longer
bail from WKWebView's zooming codepaths if the scrollEnabled property is NO.

* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _zoomToPoint:atScale:animated:]):
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoMove trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
weinig@apple.com [Sat, 8 Feb 2020 18:29:37 +0000 (18:29 +0000)]
Move trivial definitions from FeatureDefines.xcconfig to PlatformEnableCocoa.h
https://bugs.webkit.org/show_bug.cgi?id=207155

Reviewed by Tim Horton.
Source/JavaScriptCore:

Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h

To support the move, DerivedSources.make has been updated to generate the list
of ENABLE_* features by directly from preprocessing Platform.h, rather than
just getting the partial list from the xcconfig file.

* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:

Source/WebCore:

Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h

To support the move, DerivedSources.make and generate-unified-sources.sh have been
updated to generate the list of ENABLE_* features by directly from preprocessing
Platform.h, rather than just getting the partial list from the xcconfig file.

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebCore.xcconfig:
* DerivedSources.make:
* Scripts/generate-unified-sources.sh:

Source/WebCore/PAL:

Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h

* Configurations/FeatureDefines.xcconfig:
* Configurations/PAL.xcconfig:
Remove quotes as they should not be necessary (other uses of BUILT_PRODUCTS_DIR
are not quoted) and complicate scripts that want to use HEADER_SEARCH_PATHS.

Source/WebKit:

Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h

To support the move, DerivedSources.make and generate-unified-sources.sh have been
updated to generate the list of ENABLE_* features by directly from preprocessing
Platform.h, rather than just getting the partial list from the xcconfig file.

* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Scripts/generate-unified-sources.sh:

Source/WebKitLegacy:

To support the move, generate-unified-sources.sh has been updated to generate
the list of ENABLE_* features by directly from preprocessing Platform.h, rather
than just getting the partial list from the xcconfig file.

* scripts/generate-unified-sources.sh:

Source/WebKitLegacy/mac:

Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h

To support the move, DerivedSources.make has been updated to generate the list
of ENABLE_* features by directly from preprocessing  Platform.h, rather than
just getting the partial list from the xcconfig file.

* Configurations/FeatureDefines.xcconfig:
* MigrateHeaders.make:

Source/WTF:

Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h

ENABLE_INSPECTOR_TELEMETRY, ENABLE_TEXT_AUTOSIZING, ENABLE_WEBGL, ENABLE_METER_ELEMENT,
ENABLE_VIDEO_TRACK, ENABLE_WEB_AUDIO and ENABLE_CURSOR_VISIBILITY are all now always
set to 1 for Cocoa (if not defined already), as this was already the case via the xcconfig.

* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:

Tools:

Move all trivial definitions (just ENABLE_FOO = ENABLE_FOO; or ENABLE_BAR = ;)
from the FeatureDefines.xcconfigs to PlatformEnableCocoa.h, ensuring each one
also has a default value in PlatformEnable.h

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoResource Load Statistics: Hold off non-cookie website data deletion until an hour...
wilander@apple.com [Sat, 8 Feb 2020 15:48:54 +0000 (15:48 +0000)]
Resource Load Statistics: Hold off non-cookie website data deletion until an hour after user interaction
https://bugs.webkit.org/show_bug.cgi?id=207418
<rdar://problem/58550164>

Reviewed by Chris Dumez.

This change makes sure there is at least a one-hour or older timestamp
for user interaction for some website before activating deletion of
non-cookie website data for sites the user has not interacted with.
This ensures that a fresh start such as after a reset or on a new
device doesn't interpret the lack of data as lack of user interaction.

No new tests. Existing tests make sure we don't regress the functionality.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoCrash in RenderTreeBuilder::Table::findOrCreateParentForChild with multicol spanner
commit-queue@webkit.org [Sat, 8 Feb 2020 14:10:25 +0000 (14:10 +0000)]
Crash in RenderTreeBuilder::Table::findOrCreateParentForChild with multicol spanner
https://bugs.webkit.org/show_bug.cgi?id=206917

Patch by Doug Kelly <dougk@apple.com> on 2020-02-08
Reviewed by Zalan Bujtas.

Source/WebCore:

During render tree construction, multi-column spanners are moved from their original tree position to
next to the enclosing anonymous fragmented flow and we mark their previous location with a spanner placeholder.
If we try to add a new renderer right before the spanner (beforeChild is the spanner renderer), we need to use
the spanner's original position as the insertion point.
This patch addresses the mismatching position issue by adjusting the spanner beforeChild right before
we start searching for the final insertion point.

Test: fast/multicol/spanner-crash-when-finding-table-parent.html

* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::attach):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):

LayoutTests:

* fast/multicol/spanner-crash-when-finding-table-parent-expected.txt: Added.
* fast/multicol/spanner-crash-when-finding-table-parent.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256089 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[bmalloc] VMHeap can be merge into Heap
basuke.suzuki@sony.com [Sat, 8 Feb 2020 10:35:40 +0000 (10:35 +0000)]
[bmalloc] VMHeap can be merge into Heap
https://bugs.webkit.org/show_bug.cgi?id=207410

Reviewed by Yusuke Suzuki.

VMHeap has only one member function in it and Heap is the only client of that.
No member variable is defined. It does nothing special with its context as a class.
It is safe to merge the function into Heap.

* CMakeLists.txt:
* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::tryAllocateLargeChunk): Moved from VMHeap.
* bmalloc/Heap.h:
* bmalloc/VMHeap.cpp: Removed.
* bmalloc/VMHeap.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256088 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoThrow OutOfMemory exception instead of crashing if DirectArguments/ScopedArguments...
rmorisset@apple.com [Sat, 8 Feb 2020 06:08:33 +0000 (06:08 +0000)]
Throw OutOfMemory exception instead of crashing if DirectArguments/ScopedArguments can't be created
https://bugs.webkit.org/show_bug.cgi?id=207423

Reviewed by Mark Lam.

AllocationFailureMode::Assert is problematic because fuzzers keep producing spurious error reports when they generate code that tries allocating infinite amount of memory.
The right approach is to use AllocationFailureMode::ReturnNull, and throw a JS exception upon receiving null.

In this patch I fixed two functions that were using AllocationFailureMode::Assert:
    DirectArguments::DirectArguments::overrideThings
    GenericArguments<Type>::initModifiedArgumentsDescriptor

No test added, because the only test we have is highly non-deterministic/flaky (only triggers about 10 to 20% of the time even before the fix).

* runtime/DirectArguments.h:
* runtime/GenericArguments.h:
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::deletePropertyByIndex):
(JSC::GenericArguments<Type>::defineOwnProperty):
(JSC::GenericArguments<Type>::initModifiedArgumentsDescriptor):
(JSC::GenericArguments<Type>::initModifiedArgumentsDescriptorIfNecessary):
(JSC::GenericArguments<Type>::setModifiedArgumentDescriptor):
* runtime/ScopedArguments.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256087 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoWeb Inspector: Revert slim toolbar
jonlee@apple.com [Sat, 8 Feb 2020 04:21:21 +0000 (04:21 +0000)]
Web Inspector: Revert slim toolbar
https://bugs.webkit.org/show_bug.cgi?id=207422

Reviewed by Timothy Hatcher.

The slim toolbar needs a little more work before landing.

This patch reverts r255547, r255557, r255890, r255892, r255893, r255901, r255980.

Source/WebCore:

* en.lproj/Localizable.strings:
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
* UserInterface/Base/Setting.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Debug/Bootstrap.js:
* UserInterface/Images/NewTab.svg: Added.
* UserInterface/Images/NewTabPlus.svg: Added.
* UserInterface/Images/Origin.svg:
* UserInterface/Images/SearchResults.svg: Added.
* UserInterface/Images/SourcesPaused.svg: Removed.
* UserInterface/Main.html:
* UserInterface/Models/DebuggerDashboard.js: Copied from Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css.
* UserInterface/Models/DefaultDashboard.js: Added.
* UserInterface/Views/ActivateButtonToolbarItem.js: Copied from Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css.
* UserInterface/Views/AuditTabContentView.js:
* UserInterface/Views/ButtonNavigationItem.css:
* UserInterface/Views/ButtonNavigationItem.js:
* UserInterface/Views/ButtonToolbarItem.css: Copied from Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css.
* UserInterface/Views/ButtonToolbarItem.js: Copied from Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css.
* UserInterface/Views/ConsoleTabContentView.js:
* UserInterface/Views/ContentBrowserTabContentView.js:
* UserInterface/Views/ControlToolbarItem.css: Copied from Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css.
* UserInterface/Views/ControlToolbarItem.js: Copied from Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.css.
* UserInterface/Views/DOMTreeContentView.css:
* UserInterface/Views/DashboardContainerView.css: Added.
* UserInterface/Views/DashboardContainerView.js: Added.
* UserInterface/Views/DashboardView.js: Copied from Source/WebInspectorUI/UserInterface/Views/PinnedTabBarItem.js.
* UserInterface/Views/DebuggerDashboardView.css: Added.
* UserInterface/Views/DebuggerDashboardView.js: Added.
* UserInterface/Views/DefaultDashboardView.css: Added.
* UserInterface/Views/DefaultDashboardView.js: Added.
* UserInterface/Views/DividerNavigationItem.css:
* UserInterface/Views/ElementsTabContentView.js:
* UserInterface/Views/FlexibleSpaceNavigationItem.css:
* UserInterface/Views/GeneralTabBarItem.js:
* UserInterface/Views/GraphicsTabContentView.js:
* UserInterface/Views/GroupNavigationItem.js:
* UserInterface/Views/LayersTabContentView.js:
* UserInterface/Views/LegacyTabBar.js: Copied from Source/WebInspectorUI/UserInterface/Views/TabBar.js.
* UserInterface/Views/Main.css:
* UserInterface/Views/NavigationBar.js:
* UserInterface/Views/NetworkDetailView.css:
* UserInterface/Views/NetworkTabContentView.js:
* UserInterface/Views/NetworkTableContentView.css:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/NewTabContentView.css: Copied from Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineOverviewGraph.css.
* UserInterface/Views/NewTabContentView.js: Added.
* UserInterface/Views/PinnedTabBarItem.js:
* UserInterface/Views/QuickConsole.js:
* UserInterface/Views/RenderingFrameTimelineOverviewGraph.css:
* UserInterface/Views/SearchTabContentView.js:
* UserInterface/Views/SettingsTabContentView.js:
* UserInterface/Views/Sidebar.js:
* UserInterface/Views/SizesToFitNavigationBar.js: Copied from Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.css.
* UserInterface/Views/SourcesTabContentView.js:
* UserInterface/Views/StorageTabContentView.js:
* UserInterface/Views/TabBar.css:
* UserInterface/Views/TabBar.js:
* UserInterface/Views/TabBarItem.js:
* UserInterface/Views/TabBrowser.js:
* UserInterface/Views/TabContentView.js:
* UserInterface/Views/TimelineOverview.css:
* UserInterface/Views/TimelineRecordFrame.css:
* UserInterface/Views/TimelineRuler.css:
* UserInterface/Views/TimelineTabContentView.js:
* UserInterface/Views/Toolbar.css: Added.
* UserInterface/Views/Toolbar.js: Added.
* UserInterface/Views/Variables.css:

Source/WebKit:

* UIProcess/Inspector/RemoteWebInspectorProxy.cpp:
* UIProcess/Inspector/RemoteWebInspectorProxy.h:
* UIProcess/Inspector/RemoteWebInspectorProxy.messages.in:
* UIProcess/Inspector/WebInspectorProxy.cpp:
* UIProcess/Inspector/WebInspectorProxy.h:
* UIProcess/Inspector/WebInspectorProxy.messages.in:
* UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
* UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
* UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm:
* UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
* UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp:
* UIProcess/Inspector/win/WebInspectorProxyWin.cpp:
* WebProcess/Inspector/RemoteWebInspectorUI.cpp:
* WebProcess/Inspector/RemoteWebInspectorUI.h:
* WebProcess/Inspector/WebInspectorUI.cpp:
* WebProcess/Inspector/WebInspectorUI.h:

Source/WebKitLegacy/ios:

* WebCoreSupport/WebInspectorClientIOS.mm:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256086 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoREGRESSION: ASSERTION FAILED: resetResult == 0 on regression tests in ITP code, reset...
katherine_cheney@apple.com [Sat, 8 Feb 2020 01:03:47 +0000 (01:03 +0000)]
REGRESSION: ASSERTION FAILED: resetResult == 0 on regression tests in ITP code, resetting SQLite statement
https://bugs.webkit.org/show_bug.cgi?id=207269
<rdar://problem/59188891>

Reviewed by Brady Eidson.

Adds logging if ITP telemetry calculations fail to step and makes sure
not to reset the statement in this case as it will result in an error.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256085 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[IPC Hardening] Protect against bad parameters in WebProcessProxy::getPluginProcessCo...
cdumez@apple.com [Sat, 8 Feb 2020 00:52:41 +0000 (00:52 +0000)]
[IPC Hardening] Protect against bad parameters in WebProcessProxy::getPluginProcessConnection()
https://bugs.webkit.org/show_bug.cgi?id=207416
<rdar://problem/58617244>

Reviewed by David Kilzer.

* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::getPluginProcessConnection):
* UIProcess/Plugins/PluginProcessManager.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getPluginProcessConnection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[IPC Hardening] Convert some debug assertions into MESSAGE_CHECKs in WebPaymentCoordi...
cdumez@apple.com [Sat, 8 Feb 2020 00:51:40 +0000 (00:51 +0000)]
[IPC Hardening] Convert some debug assertions into MESSAGE_CHECKs in WebPaymentCoordinatorProxy
https://bugs.webkit.org/show_bug.cgi?id=207414
<rdar://problem/58507177>

Reviewed by Andy Estes.

* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
(WebKit::WebPaymentCoordinatorProxy::completeMerchantValidation):
(WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256083 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoHarden HashTable IPC decoders
achristensen@apple.com [Sat, 8 Feb 2020 00:43:52 +0000 (00:43 +0000)]
Harden HashTable IPC decoders
https://bugs.webkit.org/show_bug.cgi?id=207415

Reviewed by Chris Dumez.

Source/WebKit:

* Platform/IPC/ArgumentCoders.h:

Source/WTF:

* wtf/HashCountedSet.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256081 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoSeveral iOS API tests that call -makeKeyWindow assert after r255907
wenson_hsieh@apple.com [Sat, 8 Feb 2020 00:39:28 +0000 (00:39 +0000)]
Several iOS API tests that call -makeKeyWindow assert after r255907
https://bugs.webkit.org/show_bug.cgi?id=207411

Reviewed by Tim Horton.

r255907 asserted in -makeKeyWindow that the shared UIApplication exists. While this was guaranteed for all call
sites of -makeKeyWindow from API tests, -makeKeyWindow may also be invoked from within UIKit code; in this case,
nothing guarantees that the application has been initialized, and we end up hitting this assertion. To fix this,
replace the assertion with logic to bootstrap the shared UIApplication (if it didn't already exist).

* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(TestWebKitAPI::TEST):
(TestWebKitAPI::overrideBundleIdentifier): Deleted.
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(overrideBundleIdentifier):
(setOverriddenApplicationKeyWindow):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256079 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoNullptr crash in WebCore::FontFamilySpecificationCoreText::fontRanges
rniwa@webkit.org [Sat, 8 Feb 2020 00:21:04 +0000 (00:21 +0000)]
Nullptr crash in WebCore::FontFamilySpecificationCoreText::fontRanges
https://bugs.webkit.org/show_bug.cgi?id=207236
<rdar://problem/57214193>

Patch by Jack Lee <shihchieh_lee@apple.com> on 2020-02-07
Reviewed by Ryosuke Niwa.

Add a state variable in FontDescriptionKey for tracking hash entry deletion.

* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator== const):
(WebCore::FontDescriptionKey::isHashTableDeletedValue const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256077 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoTry adding glBindFramebuffer flush workaround to ANGLE as remedy for flaky WebGL...
commit-queue@webkit.org [Sat, 8 Feb 2020 00:03:28 +0000 (00:03 +0000)]
Try adding glBindFramebuffer flush workaround to ANGLE as remedy for flaky WebGL tests
https://bugs.webkit.org/show_bug.cgi?id=206625

Patch by Kenneth Russell <kbr@chromium.org> on 2020-02-07
Reviewed by Dean Jackson.

* include/platform/FeaturesGL.h:
* src/libANGLE/renderer/gl/StateManagerGL.cpp:
(rx::StateManagerGL::bindFramebuffer):
* src/libANGLE/renderer/gl/renderergl_utils.cpp:
(rx::nativegl_gl::InitializeFeatures):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256076 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[Hardening] Validate Geolocation access permission on UIProcess side
cdumez@apple.com [Fri, 7 Feb 2020 23:39:01 +0000 (23:39 +0000)]
[Hardening] Validate Geolocation access permission on UIProcess side
https://bugs.webkit.org/show_bug.cgi?id=207393
<rdar://problem/56816051>

Reviewed by Brent Fulgham.

Source/WebCore:

Validate Geolocation access permission on UIProcess side, instead of only relying solely on the WebProcess for this.

The workflow is as follows:
- The Geolocation objects request for permission to access location data
- The UIProcess shows a prompt
- If the user accepts, the UIProcess sends an authorization token (a UUID
  string) to the Geolocation object.
- When the Geolocation object later asks for location updates from the UIProcess, the UIProcess validates
  that this is a valid authorization token (one that it previously issued for this page)
- When the Geolocation objects gets destroyed (or resets its permission), the authorization token gets
  revoked so that it is no longer valid.

No new tests, no Web-facing behavior change, merely hardening.

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::~Geolocation):
(WebCore::Geolocation::resumeTimerFired):
(WebCore::Geolocation::resetAllGeolocationPermission):
(WebCore::Geolocation::stop):
(WebCore::Geolocation::setIsAllowed):
(WebCore::Geolocation::revokeAuthorizationTokenIfNecessary):
(WebCore::Geolocation::resetIsAllowed):
* Modules/geolocation/Geolocation.h:
* Modules/geolocation/GeolocationClient.h:
(WebCore::GeolocationClient::revokeAuthorizationToken):
* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::addObserver):
(WebCore::GeolocationController::revokeAuthorizationToken):
(WebCore::GeolocationController::activityStateDidChange):
* Modules/geolocation/GeolocationController.h:
* platform/mock/GeolocationClientMock.cpp:
(WebCore::GeolocationClientMock::permissionTimerFired):
(WebCore::GeolocationClientMock::startUpdating):
* platform/mock/GeolocationClientMock.h:

Source/WebKit:

* UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
(WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
(WebKit::GeolocationPermissionRequestManagerProxy::isValidAuthorizationToken const):
(WebKit::GeolocationPermissionRequestManagerProxy::revokeAuthorizationToken):
* UIProcess/GeolocationPermissionRequestManagerProxy.h:
* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::startUpdating):
* UIProcess/WebGeolocationManagerProxy.h:
* UIProcess/WebGeolocationManagerProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::geolocationPermissionRequestManager):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
(WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
(WebKit::GeolocationPermissionRequestManager::revokeAuthorizationToken):
(WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision):
* WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
* WebProcess/Geolocation/WebGeolocationManager.cpp:
(WebKit::WebGeolocationManager::registerWebPage):
* WebProcess/Geolocation/WebGeolocationManager.h:
* WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
(WebKit::WebGeolocationClient::startUpdating):
(WebKit::WebGeolocationClient::revokeAuthorizationToken):
* WebProcess/WebCoreSupport/WebGeolocationClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceiveGeolocationPermissionDecision):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebGeolocationClient.h:
* WebCoreSupport/WebGeolocationClient.mm:
(WebGeolocationClient::startUpdating):
(WebGeolocationClient::requestPermission):
(-[WebGeolocationPolicyListener allow]):
(-[WebGeolocationPolicyListener deny]):

Source/WebKitLegacy/win:

* WebCoreSupport/WebGeolocationClient.cpp:
(WebGeolocationClient::startUpdating):
* WebCoreSupport/WebGeolocationClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256075 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoTestWebKitAPI: Disable legacy ActionSheet tests on Catalyst
jbedard@apple.com [Fri, 7 Feb 2020 23:38:17 +0000 (23:38 +0000)]
TestWebKitAPI: Disable legacy ActionSheet tests on Catalyst
https://bugs.webkit.org/show_bug.cgi?id=207405

Reviewed by Wenson Hsieh.

* TestWebKitAPI/Tests/ios/ActionSheetTests.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256074 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoRemember if we used legacy TLS in the back/forward cache like we remember if we have...
achristensen@apple.com [Fri, 7 Feb 2020 23:30:29 +0000 (23:30 +0000)]
Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content
https://bugs.webkit.org/show_bug.cgi?id=207409
rdar://problem/59275641

Patch by Alex Christensen <achristensen@apple.com> on 2020-02-07
Reviewed by Chris Dumez.

Source/WebCore:

Covered by an API test.

* history/CachedFrame.cpp:
(WebCore::CachedFrame::setHasInsecureContent):
* history/CachedFrame.h:
(WebCore::CachedFrame::usedLegacyTLS const):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::dispatchDidCommitLoad):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:

Source/WebKit:

* Scripts/webkit/messages.py:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::hasInsecureContent):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
(WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidCommitLoad):

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidCommitLoad):
* WebCoreSupport/WebFrameLoaderClient.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256073 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[iOS] Double tapping shouldn't scroll the page when the body has `overflow: hidden`
wenson_hsieh@apple.com [Fri, 7 Feb 2020 23:25:45 +0000 (23:25 +0000)]
[iOS] Double tapping shouldn't scroll the page when the body has `overflow: hidden`
https://bugs.webkit.org/show_bug.cgi?id=207390
<rdar://problem/56960774>

Reviewed by Tim Horton and Simon Fraser.

Source/WebKit:

Bail out of several codepaths that zoom and scroll WKScrollView as a result of smart magnification gestures
(e.g. one-finger double taps), in the case where scrolling has been disabled on WKScrollView. This may occur
if the page has `overflow: hidden` on the body or root, but may also happen due to a WebKit client disabling
scrolling via native API, such as `webView.scrollView.scrollingEnabled = NO;`.

Test: fast/scrolling/ios/double-tap-to-scroll-with-scrolling-disabled.html

* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _zoomToPoint:atScale:animated:]):
(-[WKWebView _scrollToRect:origin:minimumScrollDistance:]):

Drive-by fix: change some `false`s to `NO`s, and `true`s to `YES`s.

(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

LayoutTests:

Add a new layout test to verify that double tapping an element doesn't cause the page to scroll if `overflow:
hidden` is applied to the body.

* fast/scrolling/ios/double-tap-to-scroll-with-scrolling-disabled-expected.txt: Added.
* fast/scrolling/ios/double-tap-to-scroll-with-scrolling-disabled.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256072 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[Apple Pay] Provide a redacted billing contact during payment method selection
ryanhaddad@apple.com [Fri, 7 Feb 2020 23:19:52 +0000 (23:19 +0000)]
[Apple Pay] Provide a redacted billing contact during payment method selection
https://bugs.webkit.org/show_bug.cgi?id=207169

Patch by Nikos Mouchtaris <nmouchtaris@apple.com> on 2020-02-07
Reviewed by Andy Estes.

Fix for build problem.

* pal/spi/cocoa/PassKitSPI.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256071 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoCrash under WKBundleFrameForJavaScriptContext dereferencing a NULL WebCore::Frame.
timothy@apple.com [Fri, 7 Feb 2020 23:01:42 +0000 (23:01 +0000)]
Crash under WKBundleFrameForJavaScriptContext dereferencing a NULL WebCore::Frame.
https://bugs.webkit.org/show_bug.cgi?id=207407
rdar://problem/59206599

Reviewed by Tim Horton.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::frameForContext): Add a null check for the coreFrame.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256068 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoUnreviewed, rolling out r256051.
ryanhaddad@apple.com [Fri, 7 Feb 2020 22:49:56 +0000 (22:49 +0000)]
Unreviewed, rolling out r256051.

Broke internal builds.

Reverted changeset:

"Move trivial definitions from FeatureDefines.xcconfig to
PlatformEnableCocoa.h"
https://bugs.webkit.org/show_bug.cgi?id=207155
https://trac.webkit.org/changeset/256051

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256066 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months agoiPad testers failing to launch processes
jbedard@apple.com [Fri, 7 Feb 2020 22:45:40 +0000 (22:45 +0000)]
iPad testers failing to launch processes
https://bugs.webkit.org/show_bug.cgi?id=207401
<rdar://problem/58184777>

Unreviewed infrastructure fix.

This is a speculative fix because I've had problems reproducing this error.
The only time I managed to reproduce the problem was immediately after killing the
SimulatorTrampoline and CoreSimulator.xpc processes.

* BuildSlaveSupport/kill-old-processes:
(main): Only kill Simulator.app, not all associated simulator processes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256065 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[Win] Two FileSystem API tests fail
stephan.szabo@sony.com [Fri, 7 Feb 2020 22:29:17 +0000 (22:29 +0000)]
[Win] Two FileSystem API tests fail
https://bugs.webkit.org/show_bug.cgi?id=207388

Reviewed by Don Olmstead.

* wtf/win/FileSystemWin.cpp:
Make getFinalPathName return dos path rather than nt volume path.
Change createSymbolicLink return to match CreateSymbolicLinkW
Have directoryName strip trailing slashes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256063 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8 months ago[WebAuthn] Report CTAP Client Pin Error to clients
jiewen_tan@apple.com [Fri, 7 Feb 2020 22:16:54 +0000 (22:16 +0000)]
[WebAuthn] Report CTAP Client Pin Error to clients
https://bugs.webkit.org/show_bug.cgi?id=205837
<rdar://problem/58356872>

Reviewed by Brent Fulgham.

Source/WebKit:

Authenticators could return four different errors { kCtap2ErrPinInvalid, kCtap2ErrPinBlocked, kCtap2ErrPinAuthInvalid, kCtap2ErrPinAuthBlocked }
during 1) GetPinToken or 2) MakeCredential/GetAssertion with PinAuth.

All errors should be reported to the client so that appropriate UI can be displayed to users.
For kCtap2ErrPinAuthInvalid and kCtap2ErrPinInvalid, we will restart the whole Pin process to get
another Pin from the user.

Covered by API tests.

* UIProcess/API/APIWebAuthenticationPanelClient.h:
* UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
(WebKit::wkWebAuthenticationPanelUpdate):
* UIProcess/WebAuthentication/WebAuthenticationFlags.h:
* UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
(WebKit::fido::toStatus):
(WebKit::fido::isPinError):
(WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived):
(WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
(WebKit::CtapAuthenticator::continueRequestAfterGetPinToken):
(WebKit::CtapAuthenticator::tryRestartPin):
* UIProcess/WebAuthentication/fido/CtapAuthenticator.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
(-[TestWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-pin-auth-blocked-error.html: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-get-pin-token-error.html.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-pin-invalid-error-retry.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-auth-blocked-error.html: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-get-pin-token-error.html.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-get-pin-token-pin-auth-blocked-error.html: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-get-pin-token-error.html.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-get-pin-token-pin-auth-invalid-error-retry.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-get-pin-token-pin-blocked-error.html: Renamed from Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-get-pin-token-error.html.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-get-pin-token-pin-invalid-error-retry.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-hid-pin-invalid-error-retry.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256062 268f45cc-cd09-0410-ab3c-d52691b4dbfc