WebKit-https.git
8 months agoDrop WebKit::WebKitPolicyAction type as it is no longer needed
cdumez@apple.com [Fri, 25 Jan 2019 18:49:01 +0000 (18:49 +0000)]
Drop WebKit::WebKitPolicyAction type as it is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=193827

Reviewed by Antti Koivisto.

Drop WebKit::WebKitPolicyAction type as it is no longer needed. It is now identical to
WebCore::PolicyAction.

* Shared/WebPolicyAction.h: Removed.
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::download):
(WebKit::WebFramePolicyListenerProxy::ignore):
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
(WebKit::toPolicyAction): Deleted.
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.h:

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

8 months agowebkitpy: Missing PID in crashlog name should not be fatal (Follow-up fix)
jbedard@apple.com [Fri, 25 Jan 2019 18:48:29 +0000 (18:48 +0000)]
webkitpy: Missing PID in crashlog name should not be fatal (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=193771

Unreviewed infrastructure fix.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort._merge_crash_logs): Correct syntax for catching multiple exception types.

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

8 months agoSource/WebCore:
jond@apple.com [Fri, 25 Jan 2019 18:46:49 +0000 (18:46 +0000)]
Source/WebCore:
Updated feature status for several features
https://bugs.webkit.org/show_bug.cgi?id=193794

Reviewed by Joseph Pecoraro.

Updated feature status for the following: CSS Font Display,
CSS Text Decoration Level 4, SVG in OpenType Fonts, Web SQL,
File and Directory Entries API, MediaStream Recording API,
Readable Streams, Subresource Integrity, Visual Viewport API,
and Web Audio.

* features.json:

Websites/webkit.org:
Added feature status entry for "Removed in Preview"
https://bugs.webkit.org/show_bug.cgi?id=193794

Reviewed by Joseph Pecoraro.

* wp-content/themes/webkit/status.php:

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

8 months agoUpdate JavaScriptCore feature status entries.
jond@apple.com [Fri, 25 Jan 2019 18:45:09 +0000 (18:45 +0000)]
Update JavaScriptCore feature status entries.
https://bugs.webkit.org/show_bug.cgi?id=193797

Reviewed by Mark Lam.

Updated feature status for Async Iteration, and Object rest/spread.

* features.json:

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

8 months ago* Scripts/webkitpy/common/config/contributors.json: Removing a stray comma.
ap@apple.com [Fri, 25 Jan 2019 18:42:00 +0000 (18:42 +0000)]
* Scripts/webkitpy/common/config/contributors.json: Removing a stray comma.

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

8 months agoAdd contributors.json entries for Ling Ho and for a new bot watchers group.
ap@apple.com [Fri, 25 Jan 2019 18:39:48 +0000 (18:39 +0000)]
Add contributors.json entries for Ling Ho and for a new bot watchers group.

* Scripts/webkitpy/common/config/contributors.json:

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

8 months ago[iOS] Add logging of calls
pvollan@apple.com [Fri, 25 Jan 2019 17:58:58 +0000 (17:58 +0000)]
[iOS] Add logging of calls
https://bugs.webkit.org/show_bug.cgi?id=193784

Reviewed by Brent Fulgham.

Add permissive logging of calls on iOS.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

8 months agoRegression(PSON?) Crash under NavigationState::NavigationClient::decidePolicyForNavig...
cdumez@apple.com [Fri, 25 Jan 2019 17:32:53 +0000 (17:32 +0000)]
Regression(PSON?) Crash under NavigationState::NavigationClient::decidePolicyForNavigationAction()
https://bugs.webkit.org/show_bug.cgi?id=193779
<rdar://problem/46170903>

Reviewed by Antti Koivisto.

Source/WebKit:

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryAppLink):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
We were crashing when trying to get the URL of the main frame, which was sad because we never
ended up using the main frame URL. Therefore, this patch drops the code in question.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
Add assertion to make sure that the DecidePolicyForNavigationActionAsync IPC it is getting
from the process is related to its main frame.

Tools:

Add API test that quickly navigates forward to a previous process without waiting for it to
suspend. I suspect the crash could have been happening due to receiving leftover IPC from
the process' previous page when reconnecting the it for the forward navigation.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

8 months agoNeed a way for JavaScript (or bundle) code to participate in undo
wenson_hsieh@apple.com [Fri, 25 Jan 2019 17:23:06 +0000 (17:23 +0000)]
Need a way for JavaScript (or bundle) code to participate in undo
https://bugs.webkit.org/show_bug.cgi?id=190009
<rdar://problem/44807048>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Finish hooking up `UndoManager::addItems()` to CustomUndoStep.

Tests: editing/undo-manager/undo-manager-add-item-exceptions.html
       editing/undo-manager/undo-manager-add-item.html
       editing/undo-manager/undo-manager-delete-stale-undo-items.html
       editing/undo-manager/undo-manager-item-labels.html
       editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html

* editing/CompositeEditCommand.h:
* editing/CustomUndoStep.cpp:
(WebCore::CustomUndoStep::didRemoveFromUndoManager):

Add a method to invalidate CustomUndoStep. This clears out the pointer to the undo item, and also invalidates
the UndoItem, removing it from its UndoManager.

* editing/CustomUndoStep.h:
* editing/Editor.cpp:
(WebCore::Editor::registerCustomUndoStep):

Add a helper method to register a CustomUndoStep as a platform undoable step.

* editing/Editor.h:
* editing/UndoStep.h:
* page/UndoItem.h:
(WebCore::UndoItem::undoManager const):
* page/UndoManager.cpp:
(WebCore::UndoManager::addItem):

Create a CustomUndoStep with the given UndoItem, and register it with the platform undo manager.

* page/UndoManager.h:
* page/UndoManager.idl:

Mark addItem() as capable of throwing exceptions.

Source/WebKit:

Invalidate undo steps when removing them from WebPage. Invalidation is a no-op for editing actions that come
from the UA, but for custom undo steps backed by an UndoItem, we clear out the custom undo step's pointer to its
UndoItem and additionally disconnect the UndoItem from its UndoManager.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addWebUndoStep):
(WebKit::WebPage::removeWebEditCommand):
* WebProcess/WebPage/WebUndoStep.h:
(WebKit::WebUndoStep::invalidate):

Tools:

Add UIScriptController helpers to grab the platform undo and redo action labels. Currently only implemented for
Cocoa platforms in WebKit2. See other ChangeLogs for more detail.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::lastUndoLabel const):
(WTR::UIScriptController::firstRedoLabel const):
(WTR::UIScriptController::platformUndoManager const):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::lastUndoLabel const):
(WTR::UIScriptController::firstRedoLabel const):
(WTR::UIScriptController::platformUndoManager const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::lastUndoLabel const):
(WTR::UIScriptController::firstRedoLabel const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/UIScriptControllerCocoa.mm:
(WTR::UIScriptController::lastUndoLabel const):
(WTR::UIScriptController::firstRedoLabel const):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::platformUndoManager const):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::platformUndoManager const):

LayoutTests:

Add a few new layout tests covering `UndoManager.addItem()`.

* editing/undo-manager/undo-manager-add-item-exceptions-expected.txt: Added.
* editing/undo-manager/undo-manager-add-item-exceptions.html: Added.

Add a test to verify that we throw exceptions when calling addItem() in a couple of circumstances.

* editing/undo-manager/undo-manager-add-item-expected.txt: Added.
* editing/undo-manager/undo-manager-add-item.html: Added.

Add a test that exercises the new API in both the top-level context and a child frame.

* editing/undo-manager/undo-manager-delete-stale-undo-items-expected.txt: Added.
* editing/undo-manager/undo-manager-delete-stale-undo-items.html: Added.

Add a test to verify that after adding undo items, undoing, and then performing other edit actions, garbage
collection will destroy JS wrappers for the previously added UndoItems, since these undo items' handlers can no
longer be invoked.

* editing/undo-manager/undo-manager-item-labels-expected.txt: Added.
* editing/undo-manager/undo-manager-item-labels.html: Added.

Add a test verifying that the undo and redo action labels are updated correctly when undoing and redoing.

* editing/undo-manager/undo-manager-undo-redo-after-garbage-collection-expected.txt: Added.
* editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html: Added.

Add a test to verify that triggering garbage collection after adding an undo item without keeping references to
the item (or its undo/redo handlers) doesn't break the API.

* resources/ui-helper.js:
(window.UIHelper.undoAndRedoLabels):

Add a helper method to grab the platform's current undo and redo action names.

(window.UIHelper):

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

8 months ago[LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
zalan@apple.com [Fri, 25 Jan 2019 16:50:18 +0000 (16:50 +0000)]
[LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
https://bugs.webkit.org/show_bug.cgi?id=193824

Reviewed by Antti Koivisto.

Source/WebCore:

When clear property is set and floats are present, we have to estimate and set the box's vertical position during
static positioning to be able to properly layout its subtree.

<div style="float: left; width: 100px; height: 100px;"></div>
<div style="clear: left;">
  <div style="float: left; width: 100px; height: 100px;"></div>
</div>

In the above example since the second float's parent clears the first float, the second float is positioned below
the first float. If we didn't push down (clear) the box, the float child would get placed next to the first float.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): Deleted.
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
* layout/displaytree/DisplayBox.h:

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

8 months ago[LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedica...
zalan@apple.com [Fri, 25 Jan 2019 16:46:47 +0000 (16:46 +0000)]
[LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedicated function
https://bugs.webkit.org/show_bug.cgi?id=193812

Reviewed by Antti Koivisto.

Move update logic to BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues().

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

8 months ago[GTK][WPE] Add API to add paths to sandbox
commit-queue@webkit.org [Fri, 25 Jan 2019 15:54:54 +0000 (15:54 +0000)]
[GTK][WPE] Add API to add paths to sandbox
https://bugs.webkit.org/show_bug.cgi?id=193571

This allows applications to add paths to the web process
if required by web extensions.

Patch by Patrick Griffis <pgriffis@igalia.com> on 2019-01-25
Reviewed by Michael Catanzaro.

* UIProcess/API/glib/WebKitWebContext.cpp:
(webkit_web_context_add_path_to_sandbox):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bubblewrapSpawn):
* UIProcess/WebProcessPool.h:
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions):

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

8 months agoUse ENABLE_POINTER_EVENTS for the touch-action property
graouts@webkit.org [Fri, 25 Jan 2019 11:36:57 +0000 (11:36 +0000)]
Use ENABLE_POINTER_EVENTS for the touch-action property
https://bugs.webkit.org/show_bug.cgi?id=193819

Reviewed by Antti Koivisto.

Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
Pointer Events specification of which the touch-action property is a part.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* dom/Element.cpp:
(WebCore::Element::allowsDoubleTapGesture const):
* platform/TouchAction.h:
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:

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

8 months agoWeb Inspector: improve invalid Audit/Recording JSON error messages
drousso@apple.com [Fri, 25 Jan 2019 09:27:50 +0000 (09:27 +0000)]
Web Inspector: improve invalid Audit/Recording JSON error messages
https://bugs.webkit.org/show_bug.cgi?id=193476
<rdar://problem/47303659>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Models/AuditTestBase.js:
(WI.AuditTestBase):
* UserInterface/Models/AuditTestCase.js:
(WI.AuditTestCase.async fromPayload):
* UserInterface/Models/AuditTestGroup.js:
(WI.AuditTestGroup.async fromPayload):
* UserInterface/Models/AuditTestCaseResult.js:
(WI.AuditTestCaseResult.async fromPayload.checkArray):
(WI.AuditTestCaseResult.async fromPayload):
* UserInterface/Models/AuditTestGroupResult.js:
(WI.AuditTestGroupResult.async fromPayload):
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.synthesizeWarning): Added.
(WI.AuditManager.synthesizeError):
(WI.AuditManager.prototype.async processJSON):

* UserInterface/Models/Recording.js:
(WI.Recording.fromPayload):
(WI.Recording.synthesizeWarning): Added.
(WI.Recording.synthesizeError):
* UserInterface/Models/RecordingFrame.js:
(WI.RecordingFrame.fromPayload):
* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction.fromPayload):
(WI.RecordingAction.prototype.async swizzle):
(WI.RecordingAction.prototype.apply):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.processJSON):

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/model/auditTestCase.html:
* inspector/model/auditTestCase-expected.txt:
* inspector/model/auditTestCaseResult-expected.txt:
* inspector/model/auditTestGroup.html:
* inspector/model/auditTestGroup-expected.txt:
* inspector/model/auditTestGroupResult-expected.txt:
* inspector/model/recording-expected.txt:

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

8 months agoUpdate macOS JSC bot configurations
ryanhaddad@apple.com [Fri, 25 Jan 2019 07:12:00 +0000 (07:12 +0000)]
Update macOS JSC bot configurations
https://bugs.webkit.org/show_bug.cgi?id=193739

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/config.json: Remove 32-bit BuildAndTest queue.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer): Move JSC EWS to Mojave section.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot): Remove 32-bit BuildAndTest queue from dashboard.
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py: Update unit test.

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

8 months agoWeb Inspector: Audit: add supports key to test/group for compatibility
drousso@apple.com [Fri, 25 Jan 2019 06:47:49 +0000 (06:47 +0000)]
Web Inspector: Audit: add supports key to test/group for compatibility
https://bugs.webkit.org/show_bug.cgi?id=193686
<rdar://problem/47460872>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Models/AuditTestBase.js:
(WI.AuditTestBase):
(WI.AuditTestBase.prototype.get supported): Added.
(WI.AuditTestBase.prototype.set supported): Added.
(WI.AuditTestBase.prototype.set disabled):
(WI.AuditTestBase.prototype.async start):
(WI.AuditTestBase.prototype.stop):
(WI.AuditTestBase.toJSON):
* UserInterface/Models/AuditTestCase.js:
(WI.AuditTestCase.async fromPayload):
* UserInterface/Models/AuditTestGroup.js:
(WI.AuditTestGroup):
(WI.AuditTestGroup.async fromPayload):
(WI.AuditTestGroup.prototype.get supported): Added.
(WI.AuditTestGroup.prototype.set supported): Added.
Add support for a "supports" key in the test JSON that prevents the test from being run if
it's value is lower than the frontend/backend version.

* UserInterface/Views/AuditTreeElement.js:
(WI.AuditTreeElement.prototype.onattach):
(WI.AuditTreeElement.prototype.ondelete):
(WI.AuditTreeElement.prototype.populateContextMenu):
(WI.AuditTreeElement.prototype._updateStatus): Added.
(WI.AuditTreeElement.prototype._showRunningSpinner):
(WI.AuditTreeElement.prototype._showRunningProgress):
(WI.AuditTreeElement.prototype._updateTestGroupDisabled):
(WI.AuditTreeElement.prototype._handleTestCaseCompleted):
(WI.AuditTreeElement.prototype._handleTestResultCleared):
(WI.AuditTreeElement.prototype._handleTestGroupCompleted):
(WI.AuditTreeElement.prototype._handleManagerEditingChanged):
(WI.AuditTreeElement.prototype.canSelectOnMouseDown): Deleted.
(WI.AuditTreeElement.prototype._updateLevel): Deleted.
* UserInterface/Views/AuditTreeElement.css:
(.tree-outline .item.audit:matches(.test-case, .test-group):not(.unsupported, .manager-active) > .status:hover > img): Added.
(.tree-outline .item.audit > .status:not(:hover) > img.show-on-hover, .tree-outline .item.audit.test-group.expanded:not(.unsupported, .editing-audits) > .status:not(:hover)): Added.
(.tree-outline .item.audit.manager-active > .status > img.show-on-hover, .tree-outline .item.audit.test-group.expanded:not(.editing-audits) > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status, .tree-outline .item.audit.unsupported + .children .item.audit.unsupported  > .status > img): Added.
(.tree-outline .item.audit.unsupported:not(.selected) > :matches(.icon, .titles)): Added.
(.tree-outline .item.audit.unsupported > .status > img): Added.
(.tree-outline .item.audit:matches(.test-case, .test-group):not(.manager-active) > .status:hover > img): Deleted.
(.tree-outline .item.audit > .status:not(:hover) > img.show-on-hover, .tree-outline .item.audit.test-group.expanded:not(.editing-audits) > .status:not(:hover)): Deleted.
(.tree-outline .item.audit.manager-active > .status > img.show-on-hover, .tree-outline .item.audit.test-group.expanded:not(.editing-audits) > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Deleted.
Hide unsupported tests unless in edit mode, where they are greyed out and cannot be enabled.
Drive-by: only allow tests to be deleted when in edit mode.
* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange):

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/audit/version.html:

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

8 months agoRemove usage of internal macro from private header
keith_miller@apple.com [Fri, 25 Jan 2019 04:39:32 +0000 (04:39 +0000)]
Remove usage of internal macro from private header
https://bugs.webkit.org/show_bug.cgi?id=193809

Reviewed by Saam Barati.

Also, add a new file to include all of our API headers to make sure
they don't accidentally include C++ or internal values.

* API/JSScript.h:
* API/tests/testIncludes.m: Added.
* JavaScriptCore.xcodeproj/project.pbxproj:

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

8 months ago[LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
zalan@apple.com [Fri, 25 Jan 2019 04:14:32 +0000 (04:14 +0000)]
[LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
https://bugs.webkit.org/show_bug.cgi?id=193807

Reviewed by Simon Fraser.

Rename updateCollapsedMarginAfter to updateMarginAfterForPreviousSibling and make the margin updating logic more explicit.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter): Deleted.

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

8 months agoiOS: Split keyboard should not shrink visualViewport.height
rniwa@webkit.org [Fri, 25 Jan 2019 02:53:27 +0000 (02:53 +0000)]
iOS: Split keyboard should not shrink visualViewport.height
https://bugs.webkit.org/show_bug.cgi?id=193798

Reviewed by Tim Horton.

Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.

No new tests since while it's possible to transition between split and merged keyboard using some SPI,
there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):

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

8 months ago[JSC] ErrorConstructor should not have own IsoSubspace
ysuzuki@apple.com [Fri, 25 Jan 2019 02:47:58 +0000 (02:47 +0000)]
[JSC] ErrorConstructor should not have own IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=193800

Reviewed by Saam Barati.

Similar to r240456, sizeof(ErrorConstructor) != sizeof(InternalFunction), and that is why we have
IsoSubspace errorConstructorSpace in VM. But it is allocated only one-per-JSGlobalObject, and it is
too costly to have IsoSubspace which allocates 16KB. Since stackTraceLimit information is per
JSGlobalObject information, we should have m_stackTraceLimit in JSGlobalObject instead and put
ErrorConstructor in InternalFunction's IsoSubspace. As r230813 (moving InternalFunction and subclasses
into IsoSubspaces) described,

    "subclasses that are the same size as InternalFunction share its subspace. I did this because the subclasses
    appear to just override methods, which are called dynamically via the structure or class of the object.
    So, I don't see a type confusion risk if UAF is used to allocate one kind of InternalFunction over another."

Then, putting ErrorConstructor in InternalFunction IsoSubspace is fine since it meets the above condition.
This patch removes m_stackTraceLimit in ErrorConstructor, and drops IsoSubspace for errorConstructorSpace.
This reduces the memory usage.

* interpreter/Interpreter.h:
* runtime/Error.cpp:
(JSC::getStackTrace):
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::ErrorConstructor):
(JSC::ErrorConstructor::finishCreation):
(JSC::constructErrorConstructor):
(JSC::callErrorConstructor):
(JSC::ErrorConstructor::put):
(JSC::ErrorConstructor::deleteProperty):
(JSC::Interpreter::constructWithErrorConstructor): Deleted.
(JSC::Interpreter::callErrorConstructor): Deleted.
* runtime/ErrorConstructor.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::stackTraceLimit const):
(JSC::JSGlobalObject::setStackTraceLimit):
(JSC::JSGlobalObject::errorConstructor const): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

8 months ago[iOS] Silence MediaPlayer compile warnings
eric.carlson@apple.com [Fri, 25 Jan 2019 02:00:01 +0000 (02:00 +0000)]
[iOS] Silence MediaPlayer compile warnings
https://bugs.webkit.org/show_bug.cgi?id=193780
<rdar://problem/47518428>

Reviewed by Jer Noble.

Source/WebCore/PAL:

* pal/spi/ios/MediaPlayerSPI.h:

Source/WebKit:

* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:

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

8 months ago[Win][WebKitTestRunner] Implement EventSenderProxy
Hironori.Fujii@sony.com [Fri, 25 Jan 2019 01:49:10 +0000 (01:49 +0000)]
[Win][WebKitTestRunner] Implement EventSenderProxy
https://bugs.webkit.org/show_bug.cgi?id=193755

Reviewed by Don Olmstead.

* WebKitTestRunner/EventSenderProxy.h: Removed unused members m_buttonState and m_mouseButtonsCurrentlyDown.
* WebKitTestRunner/win/EventSenderProxyWin.cpp:
(WTR::EventSenderProxy::dispatchMessage):
(WTR::EventSenderProxy::EventSenderProxy):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):

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

8 months agoUnreviewed fix for API test failure after r240437.
ross.kirsling@sony.com [Fri, 25 Jan 2019 01:16:35 +0000 (01:16 +0000)]
Unreviewed fix for API test failure after r240437.

TestWTF.WTF.StringOperators apparently can't deal with another test using String::operator+. This is fine...

* TestWebKitAPI/Tests/WTF/FileSystem.cpp:

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

8 months agoWeb Inspector: CPU Usage Timeline
commit-queue@webkit.org [Fri, 25 Jan 2019 01:06:17 +0000 (01:06 +0000)]
Web Inspector: CPU Usage Timeline
https://bugs.webkit.org/show_bug.cgi?id=193730
<rdar://problem/46797201>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-24
Reviewed by Devin Rousso.

Source/JavaScriptCore:

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
New files.

* inspector/protocol/CPUProfiler.json: Added.
New domain that follows the pattern of Memory/ScriptProfiler.

* inspector/protocol/Timeline.json:
New enum to auto-start a CPU instrument in the backend.

Source/WebCore:

Test: inspector/cpu-profiler/tracking.html

* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
New files.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const):
(WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent):
Create and track the CPUProfilerAgent.

* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::toggleInstruments):
(WebCore::InspectorTimelineAgent::toggleCPUInstrument):
Handle backend auto-start of the CPU instrument / timeline.

* inspector/agents/InspectorCPUProfilerAgent.h:
* inspector/agents/InspectorCPUProfilerAgent.cpp: Added.
(WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent):
(WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend):
(WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorCPUProfilerAgent::startTracking):
(WebCore::InspectorCPUProfilerAgent::stopTracking):
(WebCore::InspectorCPUProfilerAgent::collectSample):
CPUProfilerAgent uses the ResourceUsageThread to get CPU data.

* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::startTracking):
(WebCore::InspectorMemoryAgent::collectSample):
Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp.

* page/ResourceUsageData.h:
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::addObserver):
(WebCore::ResourceUsageThread::removeObserver):
(WebCore::ResourceUsageThread::notifyObservers):
(WebCore::ResourceUsageThread::recomputeCollectionMode):
(WebCore::ResourceUsageThread::threadBody):
* page/ResourceUsageThread.h:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformInitialize):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformCollectCPUData):
(WebCore::ResourceUsageThread::platformCollectMemoryData):
(WebCore::ResourceUsageThread::platformThreadBody): Deleted.
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::ResourceUsageOverlay::platformInitialize):
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformCollectCPUData):
(WebCore::ResourceUsageThread::platformCollectMemoryData):
(WebCore::ResourceUsageThread::platformThreadBody):
Give each observer their own collection mode. The ResourceUsageThread
will then collect data that is the union of all of the active observers.
This allows collecting CPU and Memory data separately, reducing the cost
of each when gathered individually.

Source/WebInspectorUI:

CPU Usage is gathered in the backend twice a second, the frequency of the
ResourceUsageThread in WebCore. The frontend displays cpu usage in a few
ways in the Timeline.

We use a column chart in the timeline overview to display the frequency and
relative distance of samples. This helps show if the samples were close
together or far apart, which indicates how meaningful they will be at a
particular scale.

We use a line chart in the timeline detail view which will be easier to see
the changes over a particular time range selection.

* Localizations/en.lproj/localizedStrings.js:
New strings.

* UserInterface/Main.html:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
* UserInterface/Protocol/CPUProfilerObserver.js:
(WI.CPUProfilerObserver.prototype.trackingStart):
(WI.CPUProfilerObserver.prototype.trackingUpdate):
(WI.CPUProfilerObserver.prototype.trackingComplete):
(WI.CPUProfilerObserver):
New files and default registration.

* UserInterface/Protocol/Target.js:
(WI.Target.prototype.get CPUProfilerAgent):
New Agent.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.availableTimelineTypes):
(WI.TimelineManager.prototype.cpuProfilerTrackingStarted):
(WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
(WI.TimelineManager.prototype.cpuProfilerTrackingCompleted):
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
(WI.TimelineManager.prototype.memoryTrackingStart): Renamed.
(WI.TimelineManager.prototype.memoryTrackingUpdate): Renamed.
(WI.TimelineManager.prototype.memoryTrackingComplete): Renamed.
* UserInterface/Models/CPUInstrument.js:
(WI.CPUInstrument):
(WI.CPUInstrument.supported):
(WI.CPUInstrument.prototype.get timelineRecordType):
(WI.CPUInstrument.prototype.startInstrumentation):
(WI.CPUInstrument.prototype.stopInstrumentation):
* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord):
(WI.CPUTimelineRecord.prototype.get timestamp):
(WI.CPUTimelineRecord.prototype.get usage):
* UserInterface/Models/Instrument.js:
(WI.Instrument.createForTimelineType):
* UserInterface/Models/TimelineRecord.js:
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.prototype.addRecord):
Expose a new CPU instrument and timeline.

* UserInterface/Views/ColumnChart.js: Added.
(WI.ColumnChart):
(WI.ColumnChart.prototype.get element):
(WI.ColumnChart.prototype.get bars):
(WI.ColumnChart.prototype.get size):
(WI.ColumnChart.prototype.set size):
(WI.ColumnChart.prototype.addBar):
(WI.ColumnChart.prototype.clear):
(WI.ColumnChart.prototype.needsLayout):
(WI.ColumnChart.prototype.updateLayout):
View that will draw vertical bars with independent widths.
This is meant to be used similiar to WI.LineChart.

* UserInterface/Images/CPUInstrument.svg: Added.
* UserInterface/Views/Variables.css:
(:root):
CPU timeline colors and icon.

* UserInterface/Views/CPUTimelineOverviewGraph.css:
(body .sidebar > .panel.navigation.timeline > .timelines-content li.item.cpu,):
(.timeline-overview-graph.cpu):
(.timeline-overview-graph.cpu > .legend):
(body[dir=ltr] .timeline-overview-graph.cpu > .legend):
(body[dir=rtl] .timeline-overview-graph.cpu > .legend):
(.timeline-overview-graph:nth-child(even) > .legend):
(body[dir=rtl] .timeline-overview-graph.cpu > .bar-chart):
(.timeline-overview-graph.cpu > .bar-chart > svg > g > rect):
* UserInterface/Views/CPUTimelineOverviewGraph.js: Added.
(WI.CPUTimelineOverviewGraph):
(WI.CPUTimelineOverviewGraph.prototype.get height):
(WI.CPUTimelineOverviewGraph.prototype.reset):
(WI.CPUTimelineOverviewGraph.prototype.layout.xScale):
(WI.CPUTimelineOverviewGraph.prototype.layout.yScale):
(WI.CPUTimelineOverviewGraph.prototype.layout.yScaleForRecord):
(WI.CPUTimelineOverviewGraph.prototype.layout):
(WI.CPUTimelineOverviewGraph.prototype._updateLegend):
(WI.CPUTimelineOverviewGraph.prototype._cpuTimelineRecordAdded):
* UserInterface/Views/CPUTimelineView.css:
(.timeline-view.cpu):
(.timeline-view.cpu > .content):
(.timeline-view.cpu > .content .subtitle):
(.timeline-view.cpu > .content > .details):
(.timeline-view.cpu > .content > .details > .timeline-ruler):
(body[dir=ltr] .timeline-view.cpu > .content > .details > .timeline-ruler):
(body[dir=rtl] .timeline-view.cpu > .content > .details > .timeline-ruler):
(.timeline-view.cpu > .content > .details > .subtitle):
(.cpu-usage-view .line-chart > svg > path):
(.timeline-view.cpu .legend > .row > .swatch.current):
* UserInterface/Views/CPUTimelineView.js: Added.
(WI.CPUTimelineView):
(WI.CPUTimelineView.prototype.shown):
(WI.CPUTimelineView.prototype.hidden):
(WI.CPUTimelineView.prototype.closed):
(WI.CPUTimelineView.prototype.reset):
(WI.CPUTimelineView.prototype.get scrollableElements):
(WI.CPUTimelineView.prototype.get showsFilterBar):
(WI.CPUTimelineView.prototype.layout.layoutView):
(WI.CPUTimelineView.prototype.layout.xScale):
(WI.CPUTimelineView.prototype.layout.yScale):
(WI.CPUTimelineView.prototype.layout):
(WI.CPUTimelineView.prototype._cpuTimelineRecordAdded):
* UserInterface/Views/CPUUsageView.css:
(.cpu-usage-view):
(.cpu-usage-view > .details):
(body[dir=ltr] .cpu-usage-view > .details):
(body[dir=rtl] .cpu-usage-view > .details):
(.cpu-usage-view > .graph):
(body[dir=rtl] .cpu-usage-view > .graph):
* UserInterface/Views/CPUUsageView.js:
(WI.CPUUsageView):
(WI.CPUUsageView.prototype.get element):
(WI.CPUUsageView.prototype.clear):
(WI.CPUUsageView.prototype.layoutWithDataPoints):
(WI.CPUUsageView.prototype._updateDetails):
* UserInterface/Views/ContentView.js:
(WI.ContentView.createFromRepresentedObject):
* UserInterface/Views/TimelineIcons.css:
(.cpu-icon .icon):
* UserInterface/Views/TimelineOverviewGraph.js:
(WI.TimelineOverviewGraph.createForTimeline):
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.displayNameForTimelineType):
(WI.TimelineTabContentView.iconClassNameForTimelineType):
(WI.TimelineTabContentView.genericClassNameForTimelineType):
(WI.TimelineTabContentView.iconClassNameForRecord):
(WI.TimelineTabContentView.displayNameForRecord):
Timeline views for CPU usage.

* UserInterface/Views/MemoryCategoryView.js:
(WI.MemoryCategoryView):
* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView.createChartContainer):
(WI.MemoryTimelineView):
(WI.MemoryTimelineView.prototype._clearMaxComparisonLegend):
Minor updates to style and comments.

LayoutTests:

* inspector/cpu-profiler/tracking-expected.txt: Added.
* inspector/cpu-profiler/tracking.html: Added.
Test the CPUProfiler domain emits events.

* inspector/heap/tracking-expected.txt:
* inspector/heap/tracking.html:
* inspector/memory/tracking-expected.txt:
* inspector/memory/tracking.html:
* inspector/script-profiler/tracking-expected.txt:
* inspector/script-profiler/tracking.html:
Update test naming.

* platform/win/TestExpectations:
Skip on platforms without RESOURCE_USAGE.

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

8 months ago[JSC] SharedArrayBufferConstructor and ArrayBufferConstructor should not have their...
ysuzuki@apple.com [Fri, 25 Jan 2019 00:49:44 +0000 (00:49 +0000)]
[JSC] SharedArrayBufferConstructor and ArrayBufferConstructor should not have their own IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=193774

Reviewed by Mark Lam.

We put all the instances of InternalFunction and its subclasses in IsoSubspace to make safer from UAF.
But since IsoSubspace requires the memory layout of instances is the same, we created different IsoSubspace
for subclasses of InternalFunction if sizeof(subclass) != sizeof(InternalFunction). One example is
ArrayBufferConstructor and SharedArrayBufferConstructor. But it is too costly to allocate 16KB page just
for these two constructor instances. They are only two instances per JSGlobalObject.

This patch makes sizeof(ArrayBufferConstructor) == sizeof(InternalFunction) so that they can use IsoSubspace
of InternalFunction. We introduce JSGenericArrayBufferConstructor, and it takes ArrayBufferSharingMode as
its template parameter. We define JSArrayBufferConstructor as JSGenericArrayBufferConstructor<ArrayBufferSharingMode::Default>
and JSSharedArrayBufferConstructor as JSGenericArrayBufferConstructor<ArrayBufferSharingMode::Shared> so that
we do not need to hold ArrayBufferSharingMode in the field of the constructor. This change removes IsoSubspace
for ArrayBufferConstructors, and reduces the memory usage.

* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSGenericArrayBufferConstructor<sharingMode>::JSGenericArrayBufferConstructor):
(JSC::JSGenericArrayBufferConstructor<sharingMode>::finishCreation):
(JSC::JSGenericArrayBufferConstructor<sharingMode>::constructArrayBuffer):
(JSC::JSGenericArrayBufferConstructor<sharingMode>::createStructure):
(JSC::JSGenericArrayBufferConstructor<sharingMode>::info):
(JSC::JSArrayBufferConstructor::JSArrayBufferConstructor): Deleted.
(JSC::JSArrayBufferConstructor::finishCreation): Deleted.
(JSC::JSArrayBufferConstructor::create): Deleted.
(JSC::JSArrayBufferConstructor::createStructure): Deleted.
(JSC::constructArrayBuffer): Deleted.
* runtime/JSArrayBufferConstructor.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

8 months ago[webkitdirs] iosSimulatorApplicationsPath may not have iOS.simruntime in its path
jbedard@apple.com [Fri, 25 Jan 2019 00:35:19 +0000 (00:35 +0000)]
[webkitdirs] iosSimulatorApplicationsPath may not have iOS.simruntime in its path
https://bugs.webkit.org/show_bug.cgi?id=193787
<rdar://problem/47497634>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitdirs.pm:
(iosSimulatorApplicationsPath): Pick from available runtime directories.

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

8 months agoImplement PerformanceObserver.supportedEntryTypes
commit-queue@webkit.org [Fri, 25 Jan 2019 00:04:52 +0000 (00:04 +0000)]
Implement PerformanceObserver.supportedEntryTypes
https://bugs.webkit.org/show_bug.cgi?id=193428

LayoutTests/imported/w3c:

Patch by Charles Vazac <cvazac@akamai.com> on 2019-01-24
Reviewed by Joseph Pecoraro.

* web-platform-tests/resource-timing/supported_resource_type.any-expected.txt:
* web-platform-tests/resource-timing/supported_resource_type.any.worker-expected.txt:

Source/WebCore:

PerformanceObserver.supportedEntryTypes should return an array of
entryTypes that can be observed per specification
https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute

Patch by Charles Vazac <cvazac@akamai.com> on 2019-01-24
Reviewed by Joseph Pecoraro.

This is covered by web-platform-tests
LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.

* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::supportedEntryTypes):
* page/PerformanceObserver.h:
* page/PerformanceObserver.idl:

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

8 months agoUnreviewed, rolling out r240446.
tsavell@apple.com [Thu, 24 Jan 2019 23:41:30 +0000 (23:41 +0000)]
Unreviewed, rolling out r240446.

Casued 5 API failures

Reverted changeset:

"Activate the WebResourceLoadStatisticsStore in the
NetworkProcess and deactivate it in the UIProcess."
https://bugs.webkit.org/show_bug.cgi?id=193297
https://trac.webkit.org/changeset/240446

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

8 months ago[iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting...
wenson_hsieh@apple.com [Thu, 24 Jan 2019 23:30:37 +0000 (23:30 +0000)]
[iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
https://bugs.webkit.org/show_bug.cgi?id=193758
<rdar://problem/43614978>

Reviewed by Tim Horton.

Source/WebCore:

CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor
(this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines
a helper method to select all the text inside of a text form control, called `selectInput`, which normally
invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by
setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting
the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround.

This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer
reproduces even without this quirk. To fix CodeMirror, we make two adjustments:

1.  Roll out this ancient demo hack, in favor of standardized behavior.
2.  Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we
    want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To
    achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default
    selection of a text input after focus; on iOS, this helper method moves the selection to the end of the
    input, but everywhere else, it selects all the text in the input element.

This causes 6 existing layout tests to begin passing on iOS.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateFocusAppearance):
(WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
* html/HTMLInputElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):

LayoutTests:

Mark some existing layout tests as passing on iOS. Additionally, remove failing expectations for another
existing layout test on iOS.

* platform/ios/TestExpectations:
* platform/ios/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Removed.

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

8 months agoFix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
jer.noble@apple.com [Thu, 24 Jan 2019 23:15:56 +0000 (23:15 +0000)]
Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
https://bugs.webkit.org/show_bug.cgi?id=193778

Reviewed by Jon Lee.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):

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

8 months agoDidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
zalan@apple.com [Thu, 24 Jan 2019 22:58:09 +0000 (22:58 +0000)]
DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
https://bugs.webkit.org/show_bug.cgi?id=193741
<rdar://problem/47135030>

Reviewed by Antti Koivisto and Simon Fraser.

Source/WebCore:

fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
    1. the received data is not "contentful" yet
    2. and we are expecting some more (loading is not complete yet)
    3. but no layout is initiated anymore
nothing triggers the milestone firing.

This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::loadProgressingStatusChanged):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:
(TestWebKitAPI::TEST):

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

8 months agostress/const-semantics.js fails a dfg-eager / ftl-eager run with an ASAN release...
ysuzuki@apple.com [Thu, 24 Jan 2019 22:37:01 +0000 (22:37 +0000)]
stress/const-semantics.js fails a dfg-eager / ftl-eager run with an ASAN release build.
https://bugs.webkit.org/show_bug.cgi?id=190693

Reviewed by Michael Saboff.

JSTests:

* stress/regress-190693.js: Added.
(truth):
(assert):
(shouldThrowInvalidConstAssignment):
(taz):

Source/JavaScriptCore:

JITStubRoutine's fields are marked only when JITStubRoutine::m_mayBeExecuting is true.
This becomes true when we find the executable address in our conservative roots, which
means that we could be executing it right now. This means that object liveness in
JITStubRoutine depends on the information gathered in ConservativeRoots. However, our
constraints are separated, "Conservative Scan" and "JIT Stub Routines". They can even
be executed concurrently, so that "JIT Stub Routines" may miss to mark the actually
executing JITStubRoutine because "Conservative Scan" finds it later.
When finalizing the GC, we delete the dead JITStubRoutines. At that time, since
"Conservative Scan" already finishes, we do not delete some JITStubRoutines which do not
mark the depending objects. Then, in the next cycle, we find JITStubRoutines still live,
attempt to mark the depending objects, and encounter the dead objects which are collected
in the previous cycles.

This patch removes "JIT Stub Routines" and merge it to "Conservative Scan". Since
"Conservative Scan" and "JIT Stub Routines" need to be executed only when the execution
happens (ensured by GreyedByExecution and CollectionPhase check), this change is OK for
GC stop time.

* heap/ConservativeRoots.h:
(JSC::ConservativeRoots::roots const):
(JSC::ConservativeRoots::roots): Deleted.
* heap/Heap.cpp:
(JSC::Heap::addCoreConstraints):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::append):
* heap/SlotVisitor.h:
* jit/GCAwareJITStubRoutine.cpp:
(JSC::GCAwareJITStubRoutine::GCAwareJITStubRoutine):
* jit/GCAwareJITStubRoutine.h:

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

8 months agoUpdate ARM64EHash
sbarati@apple.com [Thu, 24 Jan 2019 22:07:33 +0000 (22:07 +0000)]
Update ARM64EHash
https://bugs.webkit.org/show_bug.cgi?id=193776
<rdar://problem/47526457>

Reviewed by Mark Lam.

See radar for details.

* assembler/AssemblerBuffer.h:
(JSC::ARM64EHash::update):
(JSC::ARM64EHash::finalHash const):

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

8 months agoObject Allocation Sinking phase can move a node that walks the stack into a place...
sbarati@apple.com [Thu, 24 Jan 2019 21:30:55 +0000 (21:30 +0000)]
Object Allocation Sinking phase can move a node that walks the stack into a place where the InlineCallFrame is no longer valid
https://bugs.webkit.org/show_bug.cgi?id=193751
<rdar://problem/47280215>

Reviewed by Michael Saboff.

JSTests:

* stress/object-allocation-sinking-phase-must-only-move-allocations-if-stack-trace-is-still-valid.js: Added.
(let.thing):
(foo.let.hello):
(foo):

Source/JavaScriptCore:

The Object Allocation Sinking phase may move allocations around inside
of the program. However, it was not ensuring that it's still possible
to walk the stack at the point in the program that it moved the allocation to.
Certain InlineCallFrames rely on data in the stack when taking a stack trace.
All allocation sites can do a stack walk (we do a stack walk when we GC).
Conservatively, this patch says we're ok to move this allocation if we are
moving within the same InlineCallFrame. We could be more precise and do an
analysis of stack writes. However, this scenario is so rare that we just
take the conservative-and-straight-forward approach of checking that the place
we're moving to is the same InlineCallFrame as the allocation site.

In general, this issue arises anytime we do any kind of code motion.
Interestingly, LICM gets this right. It gets it right because the only
InlineCallFrames we can't move out of are the InlineCallFrames that
have metadata stored on the stack (callee for closure calls and argument
count for varargs calls). LICM doesn't have this issue because it relies
on Clobberize for doing its effects analysis. In clobberize, we model every
node within an InlineCallFrame that meets the above criteria as reading
from those stack fields. Consequently, LICM won't hoist any node in that
InlineCallFrame past the beginning of the InlineCallFrame since the IR
we generate to set up such an InlineCallFrame contains writes to that
stack location.

* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

8 months agoActivate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate...
bfulgham@apple.com [Thu, 24 Jan 2019 21:09:37 +0000 (21:09 +0000)]
Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=193297
<rdar://problem/47158841>

Reviewed by Alex Christensen.

Source/WebCore:

Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
(WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
(WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
(WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
(WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.

Source/WebKit:

This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
it off in the UIProcess. It also updates test infrastructure to work with this change
in architecture.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
(WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
(WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
(WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
(WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
(WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
(WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
* Webprocess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.

Tools:

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::installStatisticsDidScanDataRecordsCallback): Simplify test configuration by
activating the message used to trigger the callback when it is set.

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

8 months agoAdd Ad Click Attribution as an internal/experimental feature
wilander@apple.com [Thu, 24 Jan 2019 19:17:09 +0000 (19:17 +0000)]
Add Ad Click Attribution as an internal/experimental feature
https://bugs.webkit.org/show_bug.cgi?id=193685
<rdar://problem/47450399>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html

* html/HTMLAnchorElement.h:
* html/HTMLAnchorElement.idl:
* html/HTMLAttributeNames.in:
    Addeed two new experimental attributes:
    - adcampaignid: Ad campaign ID.
    - addestination: Ad link destination site.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const):
(WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled):
* page/Settings.yaml:

Source/WebKit:

* Shared/WebPreferences.yaml:
    Added AdClickAttributionEnabled as a runtime enabled feature, off by default.

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences adClickAttributionEnabled]):
(-[WebPreferences setAdClickAttributionEnabled:]):
    Added support for experimental ad click attribution.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Added test option adClickAttributionEnabled.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):

LayoutTests:

* http/tests/adClickAttribution/anchor-tag-attributes-reflect-expected.txt: Added.
* http/tests/adClickAttribution/anchor-tag-attributes-reflect.html: Added.
* platform/win/TestExpectations:
    Skipped on Windows for now.

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

8 months ago[PSON] Flash on back navigation on Mac
antti@apple.com [Thu, 24 Jan 2019 18:35:05 +0000 (18:35 +0000)]
[PSON] Flash on back navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=193716
<rdar://problem/47148458>

Reviewed by Chris Dumez.

Source/WebKit:

We close the page immediately if we fail to suspend. Layers disappear and we get a flash.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::close):

Track closed state so we don't send the message twice, causing unhandled message errors in web process.

(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):

Close the suspended page if the suspension fails.
Skip this if we are using web process side compositing on Mac.

* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):

On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):

Don't close the page on suspension failure. This is now managed by the UI process.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

Closing of the previous page is delayed so waiting for didFinishNavigation is
not sufficient to guarantee we have received all the messages. Wait for them.

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

8 months agoRegression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL...
cdumez@apple.com [Thu, 24 Jan 2019 18:30:35 +0000 (18:30 +0000)]
Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
https://bugs.webkit.org/show_bug.cgi?id=193761
<rdar://problem/47456405>

Reviewed by Alex Christensen.

Source/WebKit:

When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
navigate to the expected back/forward list item.

WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).

Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
(processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
its constructor like so:
`{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`

However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.

This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
of subframes could end up as the WebBackForwardListItem's mainframe URL.

* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::applyFrameState):
Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

8 months agoUse MonotonicTime in WorkerRunLoop
youenn@apple.com [Thu, 24 Jan 2019 18:30:24 +0000 (18:30 +0000)]
Use MonotonicTime in WorkerRunLoop
https://bugs.webkit.org/show_bug.cgi?id=193417

Reviewed by Saam Barati.

Source/WebCore:

Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
Ditto for WorkerRunLoop.
No easy way to test the change which should not be easily observable.

* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):

Source/WTF:

* wtf/MessageQueue.h:
(WTF::MessageQueue<DataType>::waitForMessage):
(WTF::MessageQueue<DataType>::waitForMessageFilteredWithTimeout):

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

8 months agowebkitpy: Missing PID in crashlog name should not be fatal
jbedard@apple.com [Thu, 24 Jan 2019 18:26:05 +0000 (18:26 +0000)]
webkitpy: Missing PID in crashlog name should not be fatal
https://bugs.webkit.org/show_bug.cgi?id=193771

If we can't determine the PID of a crashlog, just ignore the crashlog instead
of raising an exception.

Reviewed by Lucas Forschler.

* Scripts/webkitpy/port/darwin.py:
(DarwinPort._merge_crash_logs):

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

8 months agotest_exporter.py: webkitpy.common.system.executive.ScriptError from create_branch_wit...
mcatanzaro@igalia.com [Thu, 24 Jan 2019 17:30:10 +0000 (17:30 +0000)]
test_exporter.py: webkitpy.common.system.executive.ScriptError from create_branch_with_patch
https://bugs.webkit.org/show_bug.cgi?id=193746

Reviewed by Youenn Fablet.

It calls 'git apply --index --abort', but --abort is not a valid argument to 'git apply',
so we'd best just not call it.

* Scripts/webkitpy/w3c/test_exporter.py:
(WebPlatformTestExporter.create_branch_with_patch):

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

8 months agoMove FileSystem to WTF
ross.kirsling@sony.com [Thu, 24 Jan 2019 17:25:57 +0000 (17:25 +0000)]
Move FileSystem to WTF
https://bugs.webkit.org/show_bug.cgi?id=193602

Reviewed by Yusuke Suzuki.

Source/WebCore:

* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
* Modules/entriesapi/DOMFileSystem.cpp:
* Modules/entriesapi/FileSystemEntry.cpp:
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
* Modules/webdatabase/DatabaseTracker.cpp:
* Modules/webdatabase/OriginLock.cpp:
* Modules/webdatabase/OriginLock.h:
* Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
* PlatformMac.cmake:
* PlatformPlayStation.cmake:
* PlatformWin.cmake:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/GCController.cpp:
* dom/DataTransferItem.cpp:
* editing/cocoa/WebContentReaderCocoa.mm:
* fileapi/File.cpp:
* fileapi/FileCocoa.mm:
* html/FileInputType.cpp:
* html/FileListCreator.cpp:
* loader/appcache/ApplicationCacheHost.cpp:
* loader/appcache/ApplicationCacheStorage.cpp:
* page/Page.cpp:
* page/SecurityOrigin.cpp:
* page/SecurityOriginData.cpp:
* platform/FileHandle.h:
* platform/FileStream.cpp:
* platform/FileStream.h:
* platform/SharedBuffer.h:
* platform/SourcesGLib.txt:
* platform/cocoa/FileMonitorCocoa.mm:
* platform/glib/FileMonitorGLib.cpp:
* platform/glib/SharedBufferGlib.cpp:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/ios/QuickLook.mm:
* platform/ios/WebItemProviderPasteboard.mm:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
* platform/network/BlobDataFileReference.cpp:
* platform/network/BlobRegistryImpl.cpp:
* platform/network/BlobResourceHandle.cpp:
* platform/network/FormData.cpp:
* platform/network/cf/FormDataStreamCFNet.cpp:
* platform/network/cocoa/ResourceRequestCocoa.mm:
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/CurlCacheEntry.h:
* platform/network/curl/CurlCacheManager.cpp:
* platform/network/curl/CurlFormDataStream.h:
* platform/network/curl/CurlRequest.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
* platform/network/curl/ResourceHandleCurl.cpp:
* platform/network/mac/BlobDataFileReferenceMac.mm:
* platform/network/soup/ResourceHandleSoup.cpp:
* platform/network/soup/SoupNetworkSession.cpp:
* platform/posix/SharedBufferPOSIX.cpp:
* platform/sql/SQLiteFileSystem.cpp:
* platform/text/hyphen/HyphenationLibHyphen.cpp:
* platform/win/SearchPopupMenuDB.cpp:
* rendering/RenderTheme.cpp:
* rendering/RenderThemeGtk.cpp:
* rendering/RenderThemeWin.cpp:
* workers/service/server/RegistrationDatabase.cpp:

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/cache/CacheStorageEngine.cpp:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
* NetworkProcess/cache/NetworkCacheData.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
* PluginProcess/unix/PluginProcessMainUnix.cpp:
* Shared/PersistencyUtils.cpp:
* Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
* Shared/Plugins/unix/PluginSearchPath.cpp:
* Shared/WebMemorySampler.h:
* Shared/glib/ProcessExecutablePathGLib.cpp:
* Shared/ios/ChildProcessIOS.mm:
* Shared/mac/ChildProcessMac.mm:
* Shared/mac/SandboxExtensionMac.mm:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
* UIProcess/API/glib/IconDatabase.cpp:
* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
* UIProcess/API/glib/WebKitFileChooserRequest.cpp:
* UIProcess/API/glib/WebKitWebContext.cpp:
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
* UIProcess/Automation/WebAutomationSession.cpp:
* UIProcess/Cocoa/DownloadClient.mm:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/DeviceIdHashSaltStorage.cpp:
* UIProcess/Downloads/DownloadProxy.cpp:
* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
* UIProcess/ServiceWorkerProcessProxy.cpp:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
* UIProcess/glib/WebProcessProxyGLib.cpp:
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
* UIProcess/gtk/WebProcessPoolGtk.cpp:
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/ios/forms/WKFileUploadPanel.mm:
* UIProcess/mac/WebPageProxyMac.mm:
* UIProcess/win/WebProcessPoolWin.cpp:
* UIProcess/win/WebView.cpp:
* UIProcess/wpe/WebProcessPoolWPE.cpp:
* WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
* WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
* WebProcess/Plugins/PluginProcessConnection.cpp:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
* WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
* WebProcess/WebPage/win/WebInspectorUIWin.cpp:
* WebProcess/cocoa/WebProcessCocoa.mm:

Source/WebKitLegacy:

* Storage/StorageAreaSync.cpp:
* Storage/StorageSyncManager.cpp:
* Storage/StorageTracker.cpp:

Source/WebKitLegacy/mac:

* Misc/WebNSFileManagerExtras.mm:
* Storage/WebDatabaseProvider.mm:
* WebView/WebView.mm:

Source/WebKitLegacy/win:

* Plugins/PluginDatabase.cpp:
* Plugins/PluginPackage.h:
* Plugins/PluginStream.h:
* WebApplicationCache.cpp:
* WebDatabaseManager.cpp:
* WebDownloadCurl.cpp:
* WebPreferences.cpp:
* WebView.cpp:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FileMetadata.h: Renamed from Source/WebCore/platform/FileMetadata.h.
* wtf/FileSystem.cpp: Renamed from Source/WebCore/platform/FileSystem.cpp.
* wtf/FileSystem.h: Renamed from Source/WebCore/platform/FileSystem.h.
* wtf/PlatformGTK.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/cf/FileSystemCF.cpp: Renamed from Source/WebCore/platform/cf/FileSystemCF.cpp.
* wtf/cocoa/FileSystemCocoa.mm: Renamed from Source/WebCore/platform/cocoa/FileSystemCocoa.mm.
* wtf/glib/FileSystemGlib.cpp: Renamed from Source/WebCore/platform/glib/FileSystemGlib.cpp.
* wtf/mac/FileSystemMac.mm: Renamed from Source/WebCore/platform/mac/FileSystemMac.mm.
* wtf/posix/FileSystemPOSIX.cpp: Renamed from Source/WebCore/platform/posix/FileSystemPOSIX.cpp.
* wtf/spi/mac/MetadataSPI.h: Renamed from Source/WebCore/PAL/pal/spi/mac/MetadataSPI.h.
* wtf/win/FileSystemWin.cpp: Renamed from Source/WebCore/platform/win/FileSystemWin.cpp.
* wtf/win/PathWalker.cpp: Renamed from Source/WebCore/platform/win/PathWalker.cpp.
* wtf/win/PathWalker.h: Renamed from Source/WebCore/platform/win/PathWalker.h.

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformJSCOnly.cmake:
* TestWebKitAPI/PlatformPlayStation.cmake:
* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/FileSystem.cpp: Renamed from Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp.
* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
* TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp:
* TestWebKitAPI/Tests/WebCore/SharedBufferTest.cpp:
* TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm:
* TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp:
* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
* TestWebKitAPI/Tests/WebKitCocoa/DownloadProgress.mm:
* TestWebKitAPI/win/PlatformUtilitiesWin.cpp:

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

8 months ago[LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not retur...
zalan@apple.com [Thu, 24 Jan 2019 17:15:46 +0000 (17:15 +0000)]
[LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
https://bugs.webkit.org/show_bug.cgi?id=193768

Reviewed by Antti Koivisto.

When it comes to the actual used values it does not really matter, only from correctness point of view.
(This patch also moves some checks to their correct place.)

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):

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

8 months agoSource/WebCore:
simon.fraser@apple.com [Thu, 24 Jan 2019 16:10:43 +0000 (16:10 +0000)]
Source/WebCore:
Add "frame hosting" nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=193753

Reviewed by Antti Koivisto.

When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
require the iframe's scrolling node to get reparented in a new ancestor, which requires
a layer tree walk of the parent frame. This is error-prone, and not very future-proof.

Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
to provide a consistent parent node for the subframe's scrolling node.

This patch adds the node types, but does not instantiate them yet.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
(WebCore::ScrollingStateFrameHostingNode::create):
(WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
(WebCore::ScrollingStateFrameHostingNode::clone):
(WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameHostingNode.h: Added.
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::isFrameHostingNode const):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode):
* page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
(WebCore::ScrollingTreeFrameHostingNode::create):
(WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
(WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::isFrameHostingNode const):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::createScrollingTreeNode):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::operator<<):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:

Source/WebKit:
Create "frame hosting" nodes for the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=193753

Reviewed by Antti Koivisto.

When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
require the iframe's scrolling node to get reparented in a new ancestor, which requires
a layer tree walk of the parent frame. This is error-prone, and not very future-proof.

Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
to provide a consistent parent node for the subframe's scrolling node.

This patch adds the node types, but does not instantiate them yet.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
(ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):

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

8 months ago[iOS] Enable media element volume on iPad
eric.carlson@apple.com [Thu, 24 Jan 2019 15:31:02 +0000 (15:31 +0000)]
[iOS] Enable media element volume on iPad
https://bugs.webkit.org/show_bug.cgi?id=193745
<rdar://problem/47452297>

Reviewed by Jer Noble.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
(WebCore::HTMLMediaElement::updateVolume):

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):

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

8 months ago[WPE] Remove hard dependency on subprocess32 for the API tests
philn@webkit.org [Thu, 24 Jan 2019 14:34:50 +0000 (14:34 +0000)]
[WPE] Remove hard dependency on subprocess32 for the API tests

Rubber-stamped by Carlos Garcia Campos.

* glib/api_test_runner.py:
(TestRunner._run_test_qt): Lazily import subprocess32 and check
its presence only when running WPEQt tests.

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

8 months ago[JSC] Reenable baseline JIT on mips
guijemont@igalia.com [Thu, 24 Jan 2019 12:04:36 +0000 (12:04 +0000)]
[JSC] Reenable baseline JIT on mips
https://bugs.webkit.org/show_bug.cgi?id=192983

Reviewed by Mark Lam.

.:

Use baseline JIT by default on MIPS.

* Source/cmake/WebKitFeatures.cmake:

JSTests:

Added a new test for a case that was triggering a RELEASE_ASSERT when
testing.
Disable some slow tests that were already disabled for arm and x86.

* stress/json-parse-big-object.js: Added.
* stress/new-largeish-contiguous-array-with-size.js:
* stress/op_add.js:
* stress/op_bitand.js:
* stress/op_bitor.js:
* stress/op_bitxor.js:
* stress/op_lshift-ConstVar.js:
* stress/op_lshift-VarConst.js:
* stress/op_lshift-VarVar.js:
* stress/op_mod-ConstVar.js:
* stress/op_mod-VarConst.js:
* stress/op_mod-VarVar.js:
* stress/op_mul-ConstVar.js:
* stress/op_mul-VarConst.js:
* stress/op_mul-VarVar.js:
* stress/op_rshift-ConstVar.js:
* stress/op_rshift-VarConst.js:
* stress/op_rshift-VarVar.js:
* stress/op_sub-ConstVar.js:
* stress/op_sub-VarConst.js:
* stress/op_sub-VarVar.js:
* stress/op_urshift-ConstVar.js:
* stress/op_urshift-VarConst.js:
* stress/op_urshift-VarVar.js:
* stress/sampling-profiler-richards.js:
* stress/spread-forward-call-varargs-stack-overflow.js:

Source/JavaScriptCore:

Use $s0 as metadata register and make sure it's properly saved and
restored.

* jit/GPRInfo.h:
* jit/RegisterSet.cpp:
(JSC::RegisterSet::vmCalleeSaveRegisters):
(JSC::RegisterSet::llintBaselineCalleeSaveRegisters):
* llint/LowLevelInterpreter.asm:
* offlineasm/mips.rb:

Source/WTF:

Use baseline JIT by default on MIPS.

* wtf/Platform.h:

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

8 months ago[GLIB] Expose JavaScriptCore options in GLib public API
carlosgc@webkit.org [Thu, 24 Jan 2019 11:09:54 +0000 (11:09 +0000)]
[GLIB] Expose JavaScriptCore options in GLib public API
https://bugs.webkit.org/show_bug.cgi?id=188742

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

Add new API to set, get and iterate JSC options.

* API/glib/JSCOptions.cpp: Added.
(valueFromGValue):
(valueToGValue):
(jscOptionsSetValue):
(jscOptionsGetValue):
(jsc_options_set_boolean):
(jsc_options_get_boolean):
(jsc_options_set_int):
(jsc_options_get_int):
(jsc_options_set_uint):
(jsc_options_get_uint):
(jsc_options_set_size):
(jsc_options_get_size):
(jsc_options_set_double):
(jsc_options_get_double):
(jsc_options_set_string):
(jsc_options_get_string):
(jsc_options_set_range_string):
(jsc_options_get_range_string):
(jscOptionsType):
(jsc_options_foreach):
(setOptionEntry):
(jsc_options_get_option_group):
* API/glib/JSCOptions.h: Added.
* API/glib/docs/jsc-glib-4.0-sections.txt:
* API/glib/docs/jsc-glib-docs.sgml:
* API/glib/jsc.h:
* GLib.cmake:

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add JSCOptions.cpp

Tools:

Add a test for the new API.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(testsJSCOptions):
(main):

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

8 months agoFollow-up #2: Override the session configuration for cookieAcceptPolicy
ddkilzer@apple.com [Thu, 24 Jan 2019 10:59:47 +0000 (10:59 +0000)]
Follow-up #2: Override the session configuration for cookieAcceptPolicy
<https://bugs.webkit.org/show_bug.cgi?id=190925>
<rdar://problem/45497382>

* pal/spi/cf/CFNetworkSPI.h: Protect Objective-C code using
defined(__OBJC__) macro.

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

8 months agoDuplicate global variables: WTF::asciiCaseFoldTable
ddkilzer@apple.com [Thu, 24 Jan 2019 10:39:14 +0000 (10:39 +0000)]
Duplicate global variables: WTF::asciiCaseFoldTable
<https://webkit.org/b/193726>
<rdar://problem/47334622>

Reviewed by Michael Catanzaro.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
- Add ASCIICType.cpp to build systems.

* wtf/ASCIICType.cpp: Added.
(WTF::asciiCaseFoldTable): Move table to here so there is only
one copy.  Mark as exported for other frameworks to use.
* wtf/ASCIICType.h:
(WTF::asciiCaseFoldTable): Change to extern declaration, and
mark as exported for other frameworks to use.

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

8 months ago[GTK][WPE] Support JPEG 2000 images
carlosgc@webkit.org [Thu, 24 Jan 2019 10:02:33 +0000 (10:02 +0000)]
[GTK][WPE] Support JPEG 2000 images
https://bugs.webkit.org/show_bug.cgi?id=186272

Reviewed by Žan Doberšek.

.:

Add USE_OPENJPEG build option.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
supported.

* platform/ImageDecoders.cmake:
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedImageMIMETypes):
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::create):
* platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
(WebCore::syccToRGB):
(WebCore::sycc444ToRGB):
(WebCore::sycc422ToRGB):
(WebCore::sycc420ToRGB):
(WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
(WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
(WebCore::JPEG2000ImageDecoder::decode):
* platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.

Tools:

Add OpenJPEG to jhbuild since 2.2.0 version is required and it's not available in debian stable.

* gtk/jhbuild.modules:
* wpe/jhbuild.modules:

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

8 months agoChange some RenderLayerCompositor functions to use references
simon.fraser@apple.com [Thu, 24 Jan 2019 06:10:54 +0000 (06:10 +0000)]
Change some RenderLayerCompositor functions to use references
https://bugs.webkit.org/show_bug.cgi?id=193760

Reviewed by Zalan Bujtas.

RenderWidget* -> RenderWidget&

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterWidgetResize):
(WebCore::RenderLayerBacking::updateConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::frameContentsCompositor):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
* rendering/RenderLayerCompositor.h:

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

8 months ago[Curl] Unreviewed build fix for r240292 and friends.
ross.kirsling@sony.com [Thu, 24 Jan 2019 04:46:01 +0000 (04:46 +0000)]
[Curl] Unreviewed build fix for r240292 and friends.

WinCairo test stability must be restored in subsequent patch.

Source/WebKit:

* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
(WebKit::NetworkProcess::setNetworkProxySettings):

Source/WebKitLegacy:

* WebCoreSupport/NetworkStorageSessionMap.cpp:
(NetworkStorageSessionMap::defaultStorageSession):
(NetworkStorageSessionMap::switchToNewTestingSession):
(NetworkStorageSessionMap::ensureSession):

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

8 months agoUnreviewed, rolling out r240403.
commit-queue@webkit.org [Thu, 24 Jan 2019 04:31:37 +0000 (04:31 +0000)]
Unreviewed, rolling out r240403.
https://bugs.webkit.org/show_bug.cgi?id=193757

"Causes multiple crashes on macOS port (probably used wrong
ENABLE macro)" (Requested by ddkilzer on #webkit).

Reverted changeset:

"[Curl] Unreviewed build fix for r240292 and friends."
https://trac.webkit.org/changeset/240403

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

8 months ago[Curl] Unreviewed build fix for r240292 and friends.
ross.kirsling@sony.com [Thu, 24 Jan 2019 02:50:13 +0000 (02:50 +0000)]
[Curl] Unreviewed build fix for r240292 and friends.

WinCairo test stability must be restored in subsequent patch.

Source/WebKit:

* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
(WebKit::NetworkProcess::setNetworkProxySettings):

Source/WebKitLegacy:

* WebCoreSupport/NetworkStorageSessionMap.cpp:
(NetworkStorageSessionMap::defaultStorageSession):
(NetworkStorageSessionMap::switchToNewTestingSession):
(NetworkStorageSessionMap::ensureSession):

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

8 months agocheck-webkit-style should warn when using soft-linking macros in a header
ddkilzer@apple.com [Thu, 24 Jan 2019 02:47:53 +0000 (02:47 +0000)]
check-webkit-style should warn when using soft-linking macros in a header
<https://webkit.org/b/193750>

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_language): Add softlink/header check by refactoring the
softlink/framework check.
(CppChecker): Enable softlink/header check by default.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_softlink_framework): Rename from
CppStyleTest.test_softlink() and change test framework name in
case AVFoundation gets its own AVFoundationSoftLink.{h,mm}
files. Set file_name for macros that only appear in headers.
(CppStyleTest.test_softlink_header): Add tests for using
soft-link macros in headers.

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

8 months ago<rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
benjamin@webkit.org [Thu, 24 Jan 2019 01:43:58 +0000 (01:43 +0000)]
<rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
https://bugs.webkit.org/show_bug.cgi?id=193742

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
The original bug was fixed, see radar: rdar://problem/27686430

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

8 months agoARM64E should not ENABLE(SEPARATED_WX_HEAP).
mark.lam@apple.com [Thu, 24 Jan 2019 01:17:46 +0000 (01:17 +0000)]
ARM64E should not ENABLE(SEPARATED_WX_HEAP).
https://bugs.webkit.org/show_bug.cgi?id=193744
<rdar://problem/46262952>

Reviewed by Saam Barati.

Source/JavaScriptCore:

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::copyCompactAndLinkCode):

Source/WTF:

* wtf/Platform.h:

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

8 months agoFix the Apple Internal build. See <rdar://problem/47491383>.
conrad_shultz@apple.com [Thu, 24 Jan 2019 01:08:31 +0000 (01:08 +0000)]
Fix the Apple Internal build. See <rdar://problem/47491383>.

Rubber-stamped by Tim Horton.

* WebCoreSupport/WebFrameLoaderClient.mm:

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

8 months agoWeb Inspector: Refactor WI.CSSStyleDeclaration.prototype.update
nvasilyev@apple.com [Thu, 24 Jan 2019 00:59:12 +0000 (00:59 +0000)]
Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update
https://bugs.webkit.org/show_bug.cgi?id=193737

Reviewed by Matt Baker.

Remove unused event data from the WI.CSSStyleDeclaration.Event.PropertiesChanged event.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):

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

8 months agoStop using NetworkProcess::singleton
achristensen@apple.com [Thu, 24 Jan 2019 00:29:48 +0000 (00:29 +0000)]
Stop using NetworkProcess::singleton
https://bugs.webkit.org/show_bug.cgi?id=193700

Reviewed by Don Olmstead.

This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.

* NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
(WebKit::initializeChildProcess<WebKit::NetworkProcess>):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::singleton): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
(WebKit::initializeChildProcess<WebKit::NetworkProcess>):
* NetworkProcess/win/NetworkProcessMainWin.cpp:
(WebKit::initializeChildProcess<WebKit::NetworkProcess>):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::initializeChildProcess):
(WebKit::XPCServiceInitializer):

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

8 months agoUnreviewed, rolling out r240343.
ryanhaddad@apple.com [Thu, 24 Jan 2019 00:23:52 +0000 (00:23 +0000)]
Unreviewed, rolling out r240343.

Caused 4 PSON API test failures.

Reverted changeset:

"[PSON] Flash on back navigation on Mac"
https://bugs.webkit.org/show_bug.cgi?id=193716
https://trac.webkit.org/changeset/240343

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

8 months ago[DFG] AvailabilityMap::pruneByLiveness should make non-live operands Availability...
ysuzuki@apple.com [Thu, 24 Jan 2019 00:17:15 +0000 (00:17 +0000)]
[DFG] AvailabilityMap::pruneByLiveness should make non-live operands Availability::unavailable instead of Availability()
https://bugs.webkit.org/show_bug.cgi?id=193711
<rdar://problem/47250262>

Reviewed by Saam Barati.

JSTests:

* stress/availability-was-cleared-when-locals-are-not-live.js: Added.
(shouldBe):
(foo):
(bar):
(baz):

Source/JavaScriptCore:

When pruning OSR Availability based on bytecode liveness, we accidentally clear the Availability (making it DeadFlush) instead of
making it Availability::unavailable() (Making it ConflictingFlush). In OSRAvailabilityAnalysisPhase, we perform forward analysis.
We first clear all the availability of basic blocks DeadFlush, which is an empty set. And then, we set operands in the root block
ConflictingFlush. In this forward analysis, DeadFlush is BOTTOM, and ConflictingFlush is TOP. Then, we propagate information by
merging availability until we reach to the fixed-point. As an optimization, we perform "pruning" of the availability in the head
of the basic blocks. We remove availabilities of operands which are not live in the bytecode liveness at the head of the basic block.
The problem is, when removing availabilities, we set DeadFlush for them instead of ConflictingFlush. Basically, it means that we set
BOTTOM (an empty set) instead of TOP. Let's consider the following simple example. We have 6 basic blocks, and they are connected
as follows.

    BB0 -> BB1 -> BB2 -> BB4
     |        \        ^
     v          > BB3 /
    BB5

And consider about loc1 in FTL, which is required to be recovered in BB4's OSR exit.

    BB0 does nothing
        head: loc1 is dead
        tail: loc1 is dead

    BB1 has MovHint @1, loc1
        head: loc1 is dead
        tail: loc1 is live

    BB2 does nothing
        head: loc1 is live
        tail: loc1 is live

    BB3 has PutStack @1, loc1
        head: loc1 is live
        tail: loc1 is live

    BB4 has OSR exit using loc1
        head: loc1 is live
        tail: loc1 is live (in bytecode)

    BB5 does nothing
        head: loc1 is dead
        tail: loc1 is dead

In our OSR Availability analysis, we always prune loc1 result in BB1's head since its head says "loc1 is dead".
But at that time, we clear the availability for loc1, which makes it DeadFlush, instead of making it ConflictingFlush.

So, the flush format of loc1 in each tail of BB is like this.

    BB0
        ConflictingFlush (because all the local operands are initialized with ConflictingFlush)
    BB1
        DeadFlush+@1 (pruning clears it)
    BB2
        DeadFlush+@1 (since it is propagated from BB1)
    BB3
        FlushedJSValue+@1 with loc1 (since it has PutStack)
    BB4
        FlushedJSValue+@1 with loc1 (since MERGE(DeadFlush, FlushedJSValue) = FlushedJSValue)
    BB5
        DeadFlush (pruning clears it)

Then, if we go the path BB0->BB1->BB2->BB4, we read the value from the stack while it is not flushed.
The correct fix is making availability "unavailable" when pruning based on bytecode liveness.

* dfg/DFGAvailabilityMap.cpp:
(JSC::DFG::AvailabilityMap::pruneByLiveness): When pruning availability, we first set all the operands Availability::unavailable(),
and copy the calculated value from the current availability map.
* dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
(JSC::DFG::OSRAvailabilityAnalysisPhase::run): Add logging things for debugging.

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

8 months agoDeprecate API to limit the maximum number of WebProcesses
cdumez@apple.com [Wed, 23 Jan 2019 23:34:22 +0000 (23:34 +0000)]
Deprecate API to limit the maximum number of WebProcesses
https://bugs.webkit.org/show_bug.cgi?id=193725
<rdar://problem/47464879>

Reviewed by Geoff Garen.

Source/WebKit:

Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
complexity and is not safe (conflicts with PSON).

Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
Note that enabling the single WebProcess mode will disable PSON and process prewarming.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetMaximumNumberOfProcesses):
(WKContextGetMaximumNumberOfProcesses):
* UIProcess/API/C/WKContext.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration maximumProcessCount]):
(-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
(-[_WKProcessPoolConfiguration usesSingleWebProcess]):
(-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
(-[_WKProcessPoolConfiguration description]):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_set_process_model):
(webkit_web_context_set_web_process_count_limit):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:

Tools:

Update existing API tests to stop using deprecated API.

* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration):
* TestWebKitAPI/Tests/WebKit/UserMedia.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ResponsivenessTimer.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
* TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm:
(TEST):

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

8 months agoAllow failures in flaky tests from bug 193657
commit-queue@webkit.org [Wed, 23 Jan 2019 22:15:54 +0000 (22:15 +0000)]
Allow failures in flaky tests from bug 193657
https://bugs.webkit.org/show_bug.cgi?id=193736

Unreviewed test gardening.

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23

* TestExpectations:

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

8 months ago[ews-app] Rename ews model buildermappings to buildermapping
aakash_jain@apple.com [Wed, 23 Jan 2019 21:58:47 +0000 (21:58 +0000)]
[ews-app] Rename ews model buildermappings to buildermapping
https://bugs.webkit.org/show_bug.cgi?id=193729

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/buildermapping.py: Renamed from Tools/BuildSlaveSupport/ews-app/ews/models/buildermappings.py.
(BuilderMapping): Renamed BuildMappings to BuilderMapping.
* BuildSlaveSupport/ews-app/ews/models/__init__.py: Ditto.

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

8 months agoSwitch NetworkStorageSession portions of ResourceLoadStatistics to Async message...
bfulgham@apple.com [Wed, 23 Jan 2019 21:55:47 +0000 (21:55 +0000)]
Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
https://bugs.webkit.org/show_bug.cgi?id=193659
<rdar://problem/47433290>

Reviewed by Alex Christensen.

Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
consistent, and should reduce the possibility of bookkeeping errors in the message handling
implementations.

Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
(and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.

This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
a connection is established to the network process, causing initialization messages to get dropped
leading to test system flakiness.

Finally: The WK API test code was updated to ensure that completion handlers are always called, even
when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
* NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
* NetworkProcess/Classifier/StorageAccessStatus.h: Added.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcess::setAgeCapForClientSideCookies):
(WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcess::hasStorageAccessForFrame):
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::grantStorageAccess):
(WebKit::NetworkProcess::removeAllStorageAccess):
(WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::deleteWebsiteData):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
is now autogenerated.
(WebKit::NetworkProcessProxy::didClose): Ditto.
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
(WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::removeAllStorageAccess):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
(WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
(WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
(WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
(WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
(WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
(WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
(WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
causing initialization messages to get dropped.
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::setMaxStatisticsEntries):
(WebKit::WebsiteDataStore::setPruneEntriesDownTo):
(WebKit::WebsiteDataStore::setGrandfatheringTime):
(WebKit::WebsiteDataStore::setCacheMaxAgeCap):
(WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
(WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
(WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
(WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
(WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebKit.xcodeproj/project.pbxproj:

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

8 months ago[ews-app] Rename ews model steps to step
aakash_jain@apple.com [Wed, 23 Jan 2019 21:52:34 +0000 (21:52 +0000)]
[ews-app] Rename ews model steps to step
https://bugs.webkit.org/show_bug.cgi?id=193697

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/step.py: Renamed from Tools/BuildSlaveSupport/ews-app/ews/models/steps.py.
(Step): Renamed Steps to Step.

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

8 months agoClean up IndexedDB files between tests
sihui_liu@apple.com [Wed, 23 Jan 2019 21:39:19 +0000 (21:39 +0000)]
Clean up IndexedDB files between tests
https://bugs.webkit.org/show_bug.cgi?id=192796
<rdar://problem/46824999>

Reviewed by Geoffrey Garen.

Source/WebCore:

We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):

Source/WebKit:

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveAllIndexedDatabases):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::RemoveAllIndexedDatabasesCallbackContext::RemoveAllIndexedDatabasesCallbackContext):
(WTR::RemoveAllIndexedDatabasesCallback):
(WTR::TestController::ClearIndexedDatabases):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

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

8 months ago[ews-app] Rename ews model Builds to Build
aakash_jain@apple.com [Wed, 23 Jan 2019 21:37:30 +0000 (21:37 +0000)]
[ews-app] Rename ews model Builds to Build
https://bugs.webkit.org/show_bug.cgi?id=193695

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/build.py: Renamed from Tools/BuildSlaveSupport/ews-app/ews/models/builds.py.
(Build): Renamed Builds to Build.

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

8 months agowebkitpy: Wait longer when launching WebKitTestRunner
jbedard@apple.com [Wed, 23 Jan 2019 21:28:35 +0000 (21:28 +0000)]
webkitpy: Wait longer when launching WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=193734

Reviewed by Aakash Jain.

* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess._start): Increase timeout from 6 seconds to 15 seconds.

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

8 months agoUnreviewed; Revert "Clean up USE(WEB_THREAD)"
conrad_shultz@apple.com [Wed, 23 Jan 2019 21:03:32 +0000 (21:03 +0000)]
Unreviewed; Revert "Clean up USE(WEB_THREAD)"

This reverts commit 24ba8bb9e1dad8679b492d9a2d47da619be85789.
https://bugs.webkit.org/show_bug.cgi?id=193698

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

8 months agoAdd CSS Logical spec to features.json
commit-queue@webkit.org [Wed, 23 Jan 2019 20:54:30 +0000 (20:54 +0000)]
Add CSS Logical spec to features.json
https://bugs.webkit.org/show_bug.cgi?id=193717

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23
Reviewed by Manuel Rego Casasnovas.

* features.json:

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

8 months agoClean up USE(WEB_THREAD)
conrad_shultz@apple.com [Wed, 23 Jan 2019 20:36:37 +0000 (20:36 +0000)]
Clean up USE(WEB_THREAD)
https://bugs.webkit.org/show_bug.cgi?id=193698

Rubber-stamped by Tim Horton.

WebCore:

    * page/CaptionUserPreferencesMediaAF.cpp:
    (WebCore::userCaptionPreferencesChangedNotificationCallback):
    * platform/cf/MainThreadSharedTimerCF.cpp:
    (WebCore::applicationDidBecomeActive):
    * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
    (WebCore::dispatchToMainThread):
    * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
    (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
    * platform/ios/LegacyTileCache.mm:
    (WebCore::LegacyTileCache::layoutTiles):
    (WebCore::LegacyTileCache::setTilingMode):
    * platform/ios/WebCoreMotionManager.mm:
    (-[WebCoreMotionManager sendAccelerometerData:]):
    (-[WebCoreMotionManager sendMotionData:withHeading:]):
    * platform/ios/WebVideoFullscreenControllerAVKit.mm:
    (VideoFullscreenControllerContext::requestUpdateInlineRect):
    (VideoFullscreenControllerContext::requestVideoContentLayer):
    (VideoFullscreenControllerContext::returnVideoContentLayer):
    (VideoFullscreenControllerContext::didSetupFullscreen):
    (VideoFullscreenControllerContext::willExitFullscreen):
    (VideoFullscreenControllerContext::didExitFullscreen):
    (VideoFullscreenControllerContext::didCleanupFullscreen):
    (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
    (VideoFullscreenControllerContext::requestFullscreenMode):
    (VideoFullscreenControllerContext::setVideoLayerFrame):
    (VideoFullscreenControllerContext::setVideoLayerGravity):
    (VideoFullscreenControllerContext::fullscreenModeChanged):
    (VideoFullscreenControllerContext::play):
    (VideoFullscreenControllerContext::pause):
    (VideoFullscreenControllerContext::togglePlayState):
    (VideoFullscreenControllerContext::toggleMuted):
    (VideoFullscreenControllerContext::setMuted):
    (VideoFullscreenControllerContext::setVolume):
    (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
    (VideoFullscreenControllerContext::beginScrubbing):
    (VideoFullscreenControllerContext::endScrubbing):
    (VideoFullscreenControllerContext::seekToTime):
    (VideoFullscreenControllerContext::fastSeek):
    (VideoFullscreenControllerContext::beginScanningForward):
    (VideoFullscreenControllerContext::beginScanningBackward):
    (VideoFullscreenControllerContext::endScanning):
    (VideoFullscreenControllerContext::selectAudioMediaOption):
    (VideoFullscreenControllerContext::selectLegibleMediaOption):
    (VideoFullscreenControllerContext::duration const):
    (VideoFullscreenControllerContext::currentTime const):
    (VideoFullscreenControllerContext::bufferedTime const):
    (VideoFullscreenControllerContext::isPlaying const):
    (VideoFullscreenControllerContext::playbackRate const):
    (VideoFullscreenControllerContext::seekableRanges const):
    (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
    (VideoFullscreenControllerContext::liveUpdateInterval const):
    (VideoFullscreenControllerContext::canPlayFastReverse const):
    (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
    (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
    (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
    (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
    (VideoFullscreenControllerContext::externalPlaybackEnabled const):
    (VideoFullscreenControllerContext::externalPlaybackTargetType const):
    (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
    (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
    (VideoFullscreenControllerContext::setUpFullscreen):
    (VideoFullscreenControllerContext::exitFullscreen):
    (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
    (-[WebVideoFullscreenController enterFullscreen:mode:]):
    (-[WebVideoFullscreenController exitFullscreen]):
    (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
    * platform/ios/wak/WAKWindow.mm:
    (-[WAKWindow setVisible:]):
    (-[WAKWindow setScreenScale:]):
    (-[WAKWindow sendEvent:]):
    (-[WAKWindow sendMouseMoveEvent:contentChange:]):
    * platform/network/ios/NetworkStateNotifierIOS.mm:
    (WebCore::NetworkStateNotifier::startObserving):
    * rendering/RenderThemeIOS.mm:
    (WebCore::contentSizeCategoryDidChange):

WebKitLegacy:

    * Misc/WebGeolocationProviderIOS.mm:
    (-[_WebCoreLocationUpdateThreadingProxy geolocationAuthorizationGranted]):
    (-[_WebCoreLocationUpdateThreadingProxy geolocationAuthorizationDenied]):
    (-[_WebCoreLocationUpdateThreadingProxy positionChanged:]):
    (-[_WebCoreLocationUpdateThreadingProxy errorOccurred:]):
    (-[_WebCoreLocationUpdateThreadingProxy resetGeolocation]):
    * WebCoreSupport/WebFixedPositionContent.mm:
    (-[WebFixedPositionContent didFinishScrollingOrZooming]):
    * Misc/WebCache.mm:
    (+[WebCache emptyInMemoryResources]):
    * WebCoreSupport/WebFrameLoaderClient.mm:
    (-[WebFramePolicyListener use]):
    * WebCoreSupport/WebGeolocationClient.mm:
    (-[WebGeolocationPolicyListener allow]):
    (-[WebGeolocationPolicyListener deny]):
    (-[WebGeolocationPolicyListener denyOnlyThisRequest]):
    * WebView/WebFrame.mm:
    (-[WebFrame deviceOrientationChanged]):
    * WebView/WebHTMLView.mm:
    (hardwareKeyboardAvailabilityChangedCallback):
    * WebView/WebView.mm:
    (+[WebView _releaseMemoryNow]):
    (+[WebView willEnterBackgroundWithCompletionHandler:]):
    (-[WebView updateLayoutIgnorePendingStyleSheets]):
    (-[WebView _dispatchUnloadEvent]):
    (-[WebView _close]):
    (-[WebView _preferencesChangedNotification:]):
    (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]):
    (-[WebView goBack]):
    (-[WebView goForward]):
    (+[WebView _cacheModelChangedNotification:]):
    (-[WebView stopLoading:]):
    (-[WebView stopLoadingAndClear]):
    (-[WebView reload:]):
    (WebInstallMemoryPressureHandler):

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

8 months ago[iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
wenson_hsieh@apple.com [Wed, 23 Jan 2019 20:09:54 +0000 (20:09 +0000)]
[iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
https://bugs.webkit.org/show_bug.cgi?id=193182
<rdar://problem/47452154>

Reviewed by Tim Horton.

Source/WebKit:

Fix an existing bug where blurring an element doesn't always un-suppress text interactions.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidBlur]):

Tools:

This test was timing out because one of its preceding tests (drag-to-autoscroll-in-single-line-editable.html)
long presses and drags to select text, but does not end the touch by lifting up; subsequently, the tap gesture
recognizer isn't fired when simulating a tap in hover-when-style-change-is-async.html.

To fix this, tweak the test runner to make it safe for tests to end while touching the web view without
preventing later tests from recognizing gestures.

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):

Cancel all touches in the UIApplication when resetting to a consistent state between tests.

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

8 months agoWebInspector: Confusingly nested events in the timeline for Mutation Observers
drousso@apple.com [Wed, 23 Jan 2019 19:29:18 +0000 (19:29 +0000)]
WebInspector: Confusingly nested events in the timeline for Mutation Observers
https://bugs.webkit.org/show_bug.cgi?id=192884
<rdar://problem/46854178>

Reviewed by Joseph Pecoraro.

If a microtask event (e.g. `ObserverCallback`) is contained within a `EvaluatedScript`
event, move that microtask event to be a sibling of the `EvaluateScript`, subtracting the
microtask's time taken from the `EvaluateScript`'s time. If there are no other children
after this move, then remove the `EvaluateScript` altogether.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.eventRecorded.fixMicrotaskPlacement): Added.
(WI.TimelineManager.prototype.eventRecorded):
(WI.TimelineManager.prototype._mergeScriptProfileRecords):

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

8 months agoMinor improvements to NetworkProcess
mcatanzaro@igalia.com [Wed, 23 Jan 2019 19:18:59 +0000 (19:18 +0000)]
Minor improvements to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193708

Reviewed by Alex Christensen.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
(WebKit::NetworkProcess::ensureSession): Add useful assertion.
(WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
(WebKit::NetworkProcess::destroySession): Add useful assertion.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
* NetworkProcess/curl/NetworkProcessCurl.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformCreateDefaultStorageSession const):

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

8 months agoFix the Apple Internal build. See <rdar://problem/47486758>.
dbates@webkit.org [Wed, 23 Jan 2019 19:14:55 +0000 (19:14 +0000)]
Fix the Apple Internal build. See <rdar://problem/47486758>.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):

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

8 months ago[macOS] Sandbox fails to compile
pvollan@apple.com [Wed, 23 Jan 2019 19:13:44 +0000 (19:13 +0000)]
[macOS] Sandbox fails to compile
https://bugs.webkit.org/show_bug.cgi?id=193727
<rdar://problem/47476903>

Reviewed by Brent Fulgham.

Use '(with send-signal SIGKILL)' instead of '(with termination)'.

* WebProcess/com.apple.WebProcess.sb.in:

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

8 months agoWeb Inspector: Network Waterfall column should redraw when adding/removing new columns
commit-queue@webkit.org [Wed, 23 Jan 2019 18:46:56 +0000 (18:46 +0000)]
Web Inspector: Network Waterfall column should redraw when adding/removing new columns
https://bugs.webkit.org/show_bug.cgi?id=193696
<rdar://problem/47464149>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-23
Reviewed by Devin Rousso.

* UserInterface/Views/TableColumn.js:
(WI.TableColumn.prototype.get needsReloadOnResize):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.initialLayout):
Mark the waterfall column as sensitive to any resizes.

* UserInterface/Views/Table.js:
(WI.Table.prototype.showColumn):
(WI.Table.prototype.hideColumn):
Update column widths and reload any columns that may be sensitive to resizes.

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

8 months agoREGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit...
bfulgham@apple.com [Wed, 23 Jan 2019 18:44:34 +0000 (18:44 +0000)]
REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
https://bugs.webkit.org/show_bug.cgi?id=193723
<rdar://problem/47476802>

Reviewed by David Kilzer.

The new code added in r240243 could attempt to submit telemetry after the relevant
WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.

* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):

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

8 months agoREGRESSION (r240292): Attempt to fix WinCairo build
ddkilzer@apple.com [Wed, 23 Jan 2019 18:39:37 +0000 (18:39 +0000)]
REGRESSION (r240292): Attempt to fix WinCairo build

* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::handleCookieHeaders): Remove argument to
NetworkingContext::storageSession().

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

8 months agoAX: [GTK] Layout test accessibility/set-selected-editable.html is failing
commit-queue@webkit.org [Wed, 23 Jan 2019 18:00:18 +0000 (18:00 +0000)]
AX: [GTK] Layout test accessibility/set-selected-editable.html is failing
https://bugs.webkit.org/show_bug.cgi?id=193623

Patch by Eric Liang <ericliang@apple.com> on 2019-01-23
Reviewed by Michael Catanzaro.

AXSelected attribute behavior on GTK is different. Skipped.

* platform/gtk/TestExpectations:

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

8 months ago[PSON] Flash on back navigation on Mac
antti@apple.com [Wed, 23 Jan 2019 17:43:02 +0000 (17:43 +0000)]
[PSON] Flash on back navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=193716
<rdar://problem/47148458>

Reviewed by Chris Dumez.

We close the page immediately if we fail to suspend. Layers disappear and we get a flash.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):

Remove the suspended page (so closing it on web process side) if the suspension fails.
Skip this if we are using web process side compositing on Mac.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::enterAcceleratedCompositingMode):

On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):

Don't close the page on suspension failure.

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

8 months agoIntroduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
wenson_hsieh@apple.com [Wed, 23 Jan 2019 17:30:05 +0000 (17:30 +0000)]
Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
https://bugs.webkit.org/show_bug.cgi?id=193706
<rdar://problem/44807048>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
label simultaneously. There should be no change in behavior.

* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::label const):
* editing/CompositeEditCommand.h:
* editing/CustomUndoStep.cpp:
(WebCore::CustomUndoStep::label const):
* editing/CustomUndoStep.h:
* editing/EditAction.cpp:
(WebCore::undoRedoLabel):
(WebCore::nameForUndoRedo): Deleted.
* editing/EditAction.h:

Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
WebKitLegacy.

* editing/UndoStep.h:

Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
localized string, CustomUndoStep implements this by returning the undoable action label provided by script.

Source/WebKit:

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::registerEditCommand):
* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::WebEditCommandProxy):
* UIProcess/WebEditCommandProxy.h:

Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.

(WebKit::WebEditCommandProxy::create):
(WebKit::WebEditCommandProxy::label const):
(WebKit::WebEditCommandProxy::invalidate):
(WebKit::WebEditCommandProxy::editAction const): Deleted.

Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::registerEditCommandForUndo):
(WebKit::WebPageProxy::resetState):

Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
and then iterating over the Vector.

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.

* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::registerEditCommand):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerUndoStep):

Source/WebKitLegacy/mac:

Use UndoStep::label().

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(-[WebUndoStep initWithUndoStep:]):
(+[WebUndoStep stepWithUndoStep:]):
(WebEditorClient::registerUndoOrRedoStep):
(WebEditorClient::registerUndoStep):
(WebEditorClient::registerRedoStep):

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

8 months ago[SOUP] Remove libsoup cruft from WebProcess
mcatanzaro@igalia.com [Wed, 23 Jan 2019 17:26:50 +0000 (17:26 +0000)]
[SOUP] Remove libsoup cruft from WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193710

Reviewed by Carlos Garcia Campos.

SoupNetworkSession is no longer accessible from the web process because it's owned
(indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there

* NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
(AsyncReadData::AsyncReadData):
(webkitSoupRequestInputStreamReadAsyncResultComplete):
(webkitSoupRequestInputStreamPendingReadAsyncComplete):
(webkitSoupRequestInputStreamHasDataToRead):
(webkitSoupRequestInputStreamIsWaitingForData):
(webkitSoupRequestInputStreamReadAsync):
(webkitSoupRequestInputStreamReadFinish):
(webkitSoupRequestInputStreamFinalize):
(webkit_soup_request_input_stream_init):
(webkit_soup_request_input_stream_class_init):
(webkitSoupRequestInputStreamNew):
(webkitSoupRequestInputStreamAddData):
(webkitSoupRequestInputStreamDidFailWithError):
(webkitSoupRequestInputStreamFinished):
* NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformTerminate):

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

8 months ago[SOUP] Clean up NetworkStorageSession
mcatanzaro@igalia.com [Wed, 23 Jan 2019 17:24:19 +0000 (17:24 +0000)]
[SOUP] Clean up NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=193707

Reviewed by Carlos Garcia Campos.

Source/WebCore:

A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
know the session has always already been created. The soupNetworkSession getter can now
return a reference rather than a pointer, because it will never be NULL except after it has
been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
before process termination after nothing else is using it. Cookie jar syncing can also go
away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
use its cookie jar.

* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
* platform/network/soup/DNSResolveQueueSoup.cpp:
(WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
(WebCore::DNSResolveQueueSoup::platformResolve):
(WebCore::DNSResolveQueueSoup::resolve):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::~NetworkStorageSession):
(WebCore::NetworkStorageSession::soupNetworkSession const):
(WebCore::NetworkStorageSession::clearSoupNetworkSession):
(WebCore::NetworkStorageSession::cookieStorage const):
(WebCore::NetworkStorageSession::setCookieStorage):
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
(WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):

Source/WebKit:

Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
adapt to NetworkStorageSessions API changes.

* NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
(WebKit::LegacyCustomProtocolManager::registerScheme):
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::userPreferredLanguagesChanged):
(WebKit::NetworkProcess::setNetworkProxySettings):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::soupSession const):

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

8 months agowebkitpy: Use correct config for --iphone-simulator and --ipad-simulator
jbedard@apple.com [Wed, 23 Jan 2019 17:23:29 +0000 (17:23 +0000)]
webkitpy: Use correct config for --iphone-simulator and --ipad-simulator
https://bugs.webkit.org/show_bug.cgi?id=193722
<rdar://problem/47481475>

Reviewed by Lucas Forschler.

iPhone and iPad ports should both use the iOS config.

* Scripts/webkitpy/port/ios_simulator.py:
(IPhoneSimulatorPort.__init__):
(IPadSimulatorPort.__init__):

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

8 months ago[GTK] Crash when browsing inspector:// uri without port set
philn@webkit.org [Wed, 23 Jan 2019 16:48:04 +0000 (16:48 +0000)]
[GTK] Crash when browsing inspector:// uri without port set
https://bugs.webkit.org/show_bug.cgi?id=193721

Reviewed by Michael Catanzaro.

* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
back to caller after setting the error, if no port was provided
along with the inspector URL.

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

8 months ago[LFC][BFC] computeStaticPosition should include estimated computation as well.
zalan@apple.com [Wed, 23 Jan 2019 16:29:53 +0000 (16:29 +0000)]
[LFC][BFC] computeStaticPosition should include estimated computation as well.
https://bugs.webkit.org/show_bug.cgi?id=193719

Reviewed by Antti Koivisto.

Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
the containing block's width).
This is also in preparation for moving 'clear' positioning to computeStaticPosition.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):

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

8 months agoCompositing updates need to reparent scrolling tree nodes with a changed ancestor
simon.fraser@apple.com [Wed, 23 Jan 2019 16:11:50 +0000 (16:11 +0000)]
Compositing updates need to reparent scrolling tree nodes with a changed ancestor
https://bugs.webkit.org/show_bug.cgi?id=193699

Reviewed by Frédéric Wang.

Source/WebCore:

Now that compositing updates are incremental and may not do a full layer walk,
we need to ensure that when a scrolling tree node is removed, we traverse to all
descendant layers whose scrolling tree nodes refer to the removed node as their parent.

To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
ensures that the updateBackingAndHierarchy part of the compositing update traverses
layers with the bit set.

Adjust the compositing logging to make the legend easier to read.

Tests: scrollingcoordinator/reparent-across-compositing-layers.html
       scrollingcoordinator/reparent-with-layer-removal.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::childrenOfNode const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::childrenOfNode const):
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):

LayoutTests:

* platform/ios-wk2/scrollingcoordinator/reparent-across-compositing-layers-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/reparent-with-layer-removal-expected.txt: Added.
* scrollingcoordinator/reparent-across-compositing-layers-expected.txt: Added.
* scrollingcoordinator/reparent-across-compositing-layers.html: Added.
* scrollingcoordinator/reparent-with-layer-removal-expected.txt: Added.
* scrollingcoordinator/reparent-with-layer-removal.html: Added.

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

8 months ago[JSC] Duplicate global variables: JSC::opcodeLengths
ddkilzer@apple.com [Wed, 23 Jan 2019 15:40:55 +0000 (15:40 +0000)]
[JSC] Duplicate global variables: JSC::opcodeLengths
<https://webkit.org/b/193714>
<rdar://problem/47340200>

Reviewed by Mark Lam.

* bytecode/Opcode.cpp:
(JSC::opcodeLengths): Move array implementation here and mark
const.
* bytecode/Opcode.h:
(JSC::opcodeLengths): Change to extern declaration.

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

8 months ago[css-logical] Implement flow-relative inset properties
commit-queue@webkit.org [Wed, 23 Jan 2019 15:04:50 +0000 (15:04 +0000)]
[css-logical] Implement flow-relative inset properties
https://bugs.webkit.org/show_bug.cgi?id=189441

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Enable the CSSLogicalEnabled flag in the test for logical insets, and
update its expectations. It still has some failures because sideways
writing modes have not been implemented yet
(https://bugs.webkit.org/show_bug.cgi?id=166941).

* web-platform-tests/css/css-logical/logical-box-inset-expected.txt:
* web-platform-tests/css/css-logical/logical-box-inset.html:

Source/WebCore:

Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
behind the CSSLogicalEnabled runtime flag.

Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
       webexposed/css-properties-behind-flags.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isLayoutDependent):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::resolveDirectionAwareProperty):
(WebCore::CSSProperty::isDirectionAwareProperty):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::asText const):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):

LayoutTests:

Check that the new CSS properties are disabled behind runtime flags
and are not exposed.

* webexposed/css-properties-behind-flags-expected.txt:
* webexposed/css-properties-behind-flags.html:

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

8 months ago[css-grid] Properly handle static positions of abspos inside grid items
commit-queue@webkit.org [Wed, 23 Jan 2019 12:44:49 +0000 (12:44 +0000)]
[css-grid] Properly handle static positions of abspos inside grid items
https://bugs.webkit.org/show_bug.cgi?id=193657

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23
Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Import test changes from WPT.
Various orthogonal tests still fail because of https://bugs.webkit.org/show_bug.cgi?id=189513
Some other tests also fail because of https://bugs.webkit.org/show_bug.cgi?id=193656

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html: Added.
* web-platform-tests/css/css-grid/abspos/support/positioned-grid-descendants.css: Added.
(.grid):
(.abspos):
(.orthogonal):
(.grid > :nth-child(1) > .abspos):
(.grid > :nth-child(2) > .abspos):
* web-platform-tests/css/css-grid/abspos/support/positioned-grid-descendants.js: Added.
(export.runTests):
* web-platform-tests/css/css-grid/abspos/support/w3c-import.log:
* web-platform-tests/css/css-grid/abspos/w3c-import.log:

Source/WebCore:

Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
and only if it's needed (not for abspos descentants in their static position).
Add logicalOffsetForChild that finds the value to be set by the functions above.
Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.

Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::layoutPositionedObject):
(WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
(WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
(WebCore::RenderGrid::setLogicalPositionForChild const):
(WebCore::RenderGrid::setLogicalOffsetForChild const):
(WebCore::RenderGrid::logicalOffsetForChild const):
* rendering/RenderGrid.h:

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

8 months agoSwitch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
ddkilzer@apple.com [Wed, 23 Jan 2019 11:58:15 +0000 (11:58 +0000)]
Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
<https://webkit.org/b/193694>
<rdar://problem/47464025>

Reviewed by Tim Horton.

Source/WebCore/PAL:

* pal/cf/CoreMediaSoftLink.cpp:
- Export kCMTimeZero soft-link.
* pal/cf/CoreMediaSoftLink.h:
- Update kCMTimeZero macro to use PAL namespace for use in
  WebKit.framework.

Source/WebKit:

* Shared/ios/WebIconUtilities.mm:
- Switch to using CoreMediaSoftLink.{h,mm} in PAL.

Source/WTF:

* wtf/win/SoftLinking.h:
(SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT):
- Implement for Windows.
(SOFT_LINK_CONSTANT_FOR_SOURCE):
- Define using SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT().

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

8 months agoUpdate MIME type parser
commit-queue@webkit.org [Wed, 23 Jan 2019 11:32:55 +0000 (11:32 +0000)]
Update MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=180526

Patch by Rob Buis <rbuis@igalia.com> on 2019-01-23
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

Update improved test expectations.

* web-platform-tests/xhr/overridemimetype-blob-expected.txt:

Source/WebCore:

Add an enum to allow two modes of MIME type parsing, one mode
to keep supporting RFC2045 as before, and one mode to support
the updated MIME parser from mimesniff [1]. Mimesniff support
brings the following changes:
- allows parameter names without matching =value.
- skips whitespace after subtype, parameter value and before
  parameter name.
- lower cases MIME type and parameter name.
- parameter names parsed before are discarded.

The old mode is still used by CDM.cpp and MIMEHeader.cpp.

[1] https://mimesniff.spec.whatwg.org/

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader):
* platform/network/ParsedContentType.cpp:
(WebCore::DummyParsedContentType::setContentType const):
(WebCore::DummyParsedContentType::setContentTypeParameter const):
(WebCore::isQuotedStringTokenCharacter):
(WebCore::isTokenCharacter):
(WebCore::parseToken):
(WebCore::containsNonTokenCharacters):
(WebCore::parseQuotedString):
(WebCore::isNotForwardSlash):
(WebCore::isNotSemicolon):
(WebCore::isNotSemicolonOrEqualSign):
(WebCore::parseContentType):
(WebCore::isValidContentType):
(WebCore::ParsedContentType::ParsedContentType):
(WebCore::ParsedContentType::setContentType):
(WebCore::isNonTokenCharacter):
(WebCore::isNonQuotedStringTokenCharacter):
(WebCore::ParsedContentType::setContentTypeParameter):
* platform/network/ParsedContentType.h:

Test: web-platform-tests/xhr/overridemimetype-blob.html

Tools:

Add unit tests for both parse modes of ParsedContentType.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp: Added.
(TestWebKitAPI::TEST):

LayoutTests:

Adjust test expectation.

* http/tests/xmlhttprequest/post-blob-content-type-async-expected.txt:
* http/tests/xmlhttprequest/post-blob-content-type-sync-expected.txt:
* http/tests/xmlhttprequest/post-blob-content-type-tests.js:

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

8 months ago[GLIB] Remote Inspector: no data displayed
carlosgc@webkit.org [Wed, 23 Jan 2019 10:12:56 +0000 (10:12 +0000)]
[GLIB] Remote Inspector: no data displayed
https://bugs.webkit.org/show_bug.cgi?id=193569

Reviewed by Michael Catanzaro.

Release the remote inspector mutex before using RemoteConnectionToTarget in RemoteInspector::setup() to avoid a
deadlock.

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::receivedSetupMessage):
(Inspector::RemoteInspector::setup):

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

8 months agoUnreviewed, fix initial global lexical binding epoch
ysuzuki@apple.com [Wed, 23 Jan 2019 06:21:41 +0000 (06:21 +0000)]
Unreviewed, fix initial global lexical binding epoch
https://bugs.webkit.org/show_bug.cgi?id=193603
<rdar://problem/47380869>

JSTests:

* stress/global-lexical-binding-epoch-should-be-correct-one.js: Added.
(f1.f2.f3.f4):
(f1.f2.f3):
(f1.f2):
(f1):

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):

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

8 months agoIntroduce CustomUndoStep.h and CustomUndoStep.cpp
wenson_hsieh@apple.com [Wed, 23 Jan 2019 06:10:45 +0000 (06:10 +0000)]
Introduce CustomUndoStep.h and CustomUndoStep.cpp
https://bugs.webkit.org/show_bug.cgi?id=193704
<rdar://problem/44807048>

Reviewed by Ryosuke Niwa.

This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.

No change in behavior.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/CustomUndoStep.cpp:
(WebCore::CustomUndoStep::CustomUndoStep):

Subclass UndoStep.

(WebCore::CustomUndoStep::unapply):
(WebCore::CustomUndoStep::reapply):

If possible, invoke the UndoItem's undo and redo handlers.

(WebCore::CustomUndoStep::isValid const):
* editing/CustomUndoStep.h:
* editing/EditingStyle.cpp:
* editing/InsertEditableImageCommand.cpp:
(WebCore::InsertEditableImageCommand::doApply):

Unified build fixes.

* page/UndoItem.h:

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

8 months agoREGRESSION(r239612) Crash at runtime due to broken DFG assumption
ysuzuki@apple.com [Wed, 23 Jan 2019 05:55:08 +0000 (05:55 +0000)]
REGRESSION(r239612) Crash at runtime due to broken DFG assumption
https://bugs.webkit.org/show_bug.cgi?id=193709
<rdar://problem/47363838>

Unreviewed, rollout to watch the tests.

JSTests:

* stress/object-tostring-changed-proto.js: Removed.
* stress/object-tostring-changed.js: Removed.
* stress/object-tostring-misc.js: Removed.
* stress/object-tostring-other.js: Removed.
* stress/object-tostring-untyped.js: Removed.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupObjectToString): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectToString): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileToStringOrCallStringConstructorOrStringValueOf):
(JSC::FTL::DFG::LowerDFGToB3::compileObjectToString): Deleted.
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::finishCreation):
(JSC::objectProtoFuncToString):
* runtime/ObjectPrototype.h:
* runtime/ObjectPrototypeInlines.h: Removed.
* runtime/StructureRareData.h:

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