WebKit-https.git
8 months agoImport FeedbackServer only if "-f/--feedback-in-browser" option is enabled.
commit-queue@webkit.org [Mon, 17 Dec 2018 23:01:44 +0000 (23:01 +0000)]
Import FeedbackServer only if "-f/--feedback-in-browser" option is enabled.
https://bugs.webkit.org/show_bug.cgi?id=192378

Patch by Suresh Koppisetty <skoppisetty@apple.com> on 2018-12-17
Reviewed by Ryosuke Niwa.

FeedbackServer currently depends on Tornado-5.1, which further adds
dependency of "singledispatch", "backports-abc" and "futures" python libraries.
Importing FeedbackServer only if "-f/--feedback-in-browser" option is enabled
will let us run the benchmark scripts without installing any new python libraries.

* LaunchTime/launch_time.py:
* LaunchTime/new_tab.py:

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

8 months agoRollout r235411
commit-queue@webkit.org [Mon, 17 Dec 2018 23:00:41 +0000 (23:00 +0000)]
Rollout r235411
https://bugs.webkit.org/show_bug.cgi?id=192778
<rdar://46789485>

Disabling access to CoreServices is causing a performance
regression in process launch time.  See <rdar://46141878>

Patch by Suresh Koppisetty <skoppisettyt@apple.com> on 2018-12-17
Reviewed by Alex Christensen.

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

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

8 months agoSuppress ASAN on valid stack accesses in Probe-based OSRExit::executeOSRExit().
mark.lam@apple.com [Mon, 17 Dec 2018 22:46:50 +0000 (22:46 +0000)]
Suppress ASAN on valid stack accesses in Probe-based OSRExit::executeOSRExit().
https://bugs.webkit.org/show_bug.cgi?id=192776
<rdar://problem/46772368>

Reviewed by Keith Miller.

JSTests:

* stress/out-of-frame-stack-accesses-due-to-probe-based-osr-exits.js: Added.

Source/JavaScriptCore:

1. Add some asanUnsafe methods to the Register class.
2. Update the probe-based OSRExit::executeOSRExit() to use these asanUnsafe methods.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
* interpreter/Register.h:
(JSC::Register::asanUnsafeUnboxedInt32 const):
(JSC::Register::asanUnsafeUnboxedInt52 const):
(JSC::Register::asanUnsafeUnboxedStrictInt52 const):
(JSC::Register::asanUnsafeUnboxedDouble const):
(JSC::Register::asanUnsafeUnboxedCell const):

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

8 months agoMake DocumentMarker::allMarkers() constexpr
dbates@webkit.org [Mon, 17 Dec 2018 21:47:53 +0000 (21:47 +0000)]
Make DocumentMarker::allMarkers() constexpr
https://bugs.webkit.org/show_bug.cgi?id=192634

Reviewed by Simon Fraser.

The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
it constexpr to do just that.

* dom/DocumentMarker.h:
(WebCore::DocumentMarker::allMarkers):

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

8 months ago[WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
justin_fan@apple.com [Mon, 17 Dec 2018 21:34:18 +0000 (21:34 +0000)]
[WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
https://bugs.webkit.org/show_bug.cgi?id=192726

Reviewed by Myles C. Maxfield.

Source/WebCore:

Test: webgpu/bind-group-layouts.html
Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
* Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
* Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
* Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
* Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
* Modules/webgpu/WebGPUShaderStageBit.h: Added.
* Modules/webgpu/WebGPUShaderStageBit.idl: Added.
* platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
* platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.

Add the new symbols and files to the project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

Small FIXME update for later:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers):

LayoutTests:

Add simple test to ensure a WebGPUBindGroupLayoutDescriptor can be created.

* webgpu/bind-group-layouts-expected.txt: Added.
* webgpu/bind-group-layouts.html: Added.

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

8 months agoFix stale assertion in attemptToForceStringArrayModeByToStringConversion().
mark.lam@apple.com [Mon, 17 Dec 2018 21:32:39 +0000 (21:32 +0000)]
Fix stale assertion in attemptToForceStringArrayModeByToStringConversion().
https://bugs.webkit.org/show_bug.cgi?id=192770
<rdar://problem/46449037>

Reviewed by Keith Miller.

JSTests:

* stress/force-string-arrayMode-on-originalNonArray-array-class.js: Added.

Source/JavaScriptCore:

This assertion was added before Array::OriginalNonArray was introduced.  It just
needs to be updated to allow for Array::OriginalNonArray.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):

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

8 months agoWeb Inspector: Audit: add plural result strings
drousso@apple.com [Mon, 17 Dec 2018 21:16:30 +0000 (21:16 +0000)]
Web Inspector: Audit: add plural result strings
https://bugs.webkit.org/show_bug.cgi?id=192769
<rdar://problem/46628680>

Reviewed by Brian Burg.

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView.prototype.showNoResultDataPlaceholder):

* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.layout):

* Localizations/en.lproj/localizedStrings.js:

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

8 months agoWeb Inspector: Settings: add singular "space" UIString
drousso@apple.com [Mon, 17 Dec 2018 21:15:39 +0000 (21:15 +0000)]
Web Inspector: Settings: add singular "space" UIString
https://bugs.webkit.org/show_bug.cgi?id=192766
<rdar://problem/46776948>

Reviewed by Brian Burg.

* UserInterface/Views/SettingEditor.js:
(WI.SettingEditor):
(WI.SettingEditor.prototype.get label):
(WI.SettingEditor.prototype.set label): Added.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
(WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting): Added.
(WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting.updateLabel): Added.

* Localizations/en.lproj/localizedStrings.js:

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

8 months agoSupport concatenating StringView with other string types
dbates@webkit.org [Mon, 17 Dec 2018 20:36:31 +0000 (20:36 +0000)]
Support concatenating StringView with other string types
https://bugs.webkit.org/show_bug.cgi?id=177566

Reviewed by Darin Adler.

Source/WTF:

Add operator+ overloads to StringOperators.h to support concatenating a StringView with
other string types (e.g. String). This lets a person write more naturally looking code:

stringView + string

Instead of:

makeString(stringView, string)

* wtf/text/StringOperators.h:
(WTF::operator+): Added various operator+ overloads.

Tools:

Add some tests to ensure we do not regress the number of allocations needed when performing
string concatenation with string views.

* TestWebKitAPI/Tests/WTF/StringOperators.cpp:
(TestWebKitAPI::TEST):

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

8 months agoUnreviewed WPE build fix after r239277.
zandobersek@gmail.com [Mon, 17 Dec 2018 20:21:08 +0000 (20:21 +0000)]
Unreviewed WPE build fix after r239277.

* UIProcess/API/C/WKContext.cpp:
(WKContextClearCurrentModifierStateForTesting):
Use the WebKit:: namespace specifier as it is used across this file.

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

8 months agoUnreviewed build fix.
zalan@apple.com [Mon, 17 Dec 2018 20:18:18 +0000 (20:18 +0000)]
Unreviewed build fix.

Source/WebCore:

* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot const):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebVisiblePosition.mm:
(-[WebVisiblePosition enclosingRangeWithDictationPhraseAlternatives:]):
(-[WebVisiblePosition enclosingRangeWithCorrectionIndicator]):

Source/WebKitLegacy/mac:

* WebView/WebFrame.mm:
(-[WebFrame getDictationResultRanges:andMetadatas:]):

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

8 months agoReproducible ASSERTion failure when toggling layer borders with find-in-page up
zalan@apple.com [Mon, 17 Dec 2018 19:42:55 +0000 (19:42 +0000)]
Reproducible ASSERTion failure when toggling layer borders with find-in-page up
https://bugs.webkit.org/show_bug.cgi?id=192762
<rdar://problem/46676873>

Reviewed by Simon Fraser.

Source/WebCore:

DocumentMarkerController::markersFor() should take a reference instead of a Node*.

Test: editing/document-marker-null-check.html

* dom/DocumentMarkerController.cpp:
(DocumentMarkerController::hasMarkers):
* dom/DocumentMarkerController.h:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToChangedSelection):
* editing/Editor.cpp:
(WebCore::Editor::selectionStartHasMarkerFor const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* rendering/RenderText.cpp:
(WebCore::RenderText::draggedContentRangesBetweenOffsets const):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* testing/Internals.cpp:
(WebCore::Internals::markerCountForNode):

LayoutTests:

* editing/document-marker-null-check-expected.txt: Added.
* editing/document-marker-null-check.html: Added.

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

8 months agoUnreviewed, rolling out r239265 and r239274.
commit-queue@webkit.org [Mon, 17 Dec 2018 19:22:20 +0000 (19:22 +0000)]
Unreviewed, rolling out r239265 and r239274.
https://bugs.webkit.org/show_bug.cgi?id=192765

unorm_normalize is deprecated, and broke an internal build
(Requested by Truitt on #webkit).

Reverted changesets:

"[GTK][WPE] Need a function to convert internal URI to display
("pretty") URI"
https://bugs.webkit.org/show_bug.cgi?id=174816
https://trac.webkit.org/changeset/239265

"Fix the Apple Internal Mac build with a newer SDK"
https://trac.webkit.org/changeset/239274

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

8 months agoImplement UIScriptController::toggleCapsLock() for iOS
dbates@webkit.org [Mon, 17 Dec 2018 19:19:25 +0000 (19:19 +0000)]
Implement UIScriptController::toggleCapsLock() for iOS
https://bugs.webkit.org/show_bug.cgi?id=191815

Reviewed by Andy Estes.

Source/WebCore/PAL:

Add HID usage enumerator for the Caps Lock key.

* pal/spi/cocoa/IOKitSPI.h:

Source/WebKit:

Add test infrastructure to clear the current modifier state. We will use this to ensure that
the caps lock state does not persist between tests.

* UIProcess/API/C/WKContext.cpp:
(WKContextClearCurrentModifierStateForTesting): Added.
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearCurrentModifierStateForTesting): Added.
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::clearCurrentModifierStateForTesting): Added.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Tools:

Add support for toggling the caps lock state in WebKitTestRunner on iOS.

* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues): Clear the current modifier state
before running a test. This ensures that the caps lock state does not persist between
tests should a test enable caps lock and not disable it.
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(hidUsageCodeForCharacter): Map "capsLock" to the Caps Lock key usage code.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::createUIPhysicalKeyboardEvent): Modified to take the keyboard input flags to use to
create the event. Also substituted NSString* for const String& as the data type for the first
two parameters to avoid conversions in the implementation of UIScriptController::toggleCapsLock()
below.
(WTR::UIScriptController::keyDown): Update as needed due to changes to prototype of createUIPhysicalKeyboardEvent().
(WTR::UIScriptController::toggleCapsLock): Dispatch a UIEvent to toggle caps lock.

LayoutTests:

Add iOS-specific results for some of the tests. We need to continue to skip the caps
lock tests on iOS until we have the fix for <rdar://problem/44930119>.

* fast/forms/password-scrolled-after-caps-lock-toggled.html: Replace input.focus() with
UIHelper.activateElement(input) to make it work on iOS and update logic accordingly.
Compensate for the fact that one less character than the size of the input is visible in
a password field on iOS.
* fast/repaint/placeholder-after-caps-lock-hidden.html: Replace input.focus() with
UIHelper.activateElement(input) to make it work on iOS and update logic accordingly.
* platform/ios-wk2/TestExpectations:
* platform/ios-wk2/fast/forms/password-scrolled-after-caps-lock-toggled-expected.txt: Added.
* platform/ios-wk2/fast/repaint/placeholder-after-caps-lock-hidden-expected.txt: Added.

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

8 months agoREGRESSION (r239262): Fix broken builds prior to Mojave
ddkilzer@apple.com [Mon, 17 Dec 2018 19:17:11 +0000 (19:17 +0000)]
REGRESSION (r239262): Fix broken builds prior to Mojave
<https://bugs.webkit.org/show_bug.cgi?id=192373>
<rdar://problem/46462670>

* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
Wrap header in ENABLE(ACCESSIBILITY_EVENTS) to fix the build.

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

8 months ago[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
dbates@webkit.org [Mon, 17 Dec 2018 18:58:52 +0000 (18:58 +0000)]
[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
https://bugs.webkit.org/show_bug.cgi?id=192633

Reviewed by Wenson Hsieh.

Source/WebCore:

UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
for binary compatibility.

* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.

Source/WebKit:

Update code to use the modern initializer.

* UIProcess/ios/WKWebEvent.mm:
(-[WKWebEvent initWithEvent:]):

Tools:

Update code to use the modern initializer.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:withLocation:]):

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

8 months agoFix the Apple Internal Mac build with a newer SDK
dbates@webkit.org [Mon, 17 Dec 2018 18:56:24 +0000 (18:56 +0000)]
Fix the Apple Internal Mac build with a newer SDK

* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):

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

8 months agoUnreviewed, rolling out r239254.
jlewis3@apple.com [Mon, 17 Dec 2018 18:45:16 +0000 (18:45 +0000)]
Unreviewed, rolling out r239254.

This broke the Windows 10 Debug build

Reverted changeset:

"Replace many uses of String::format with more type-safe
alternatives"
https://bugs.webkit.org/show_bug.cgi?id=192742
https://trac.webkit.org/changeset/239254

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

8 months ago[Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
graouts@webkit.org [Mon, 17 Dec 2018 17:51:57 +0000 (17:51 +0000)]
[Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
https://bugs.webkit.org/show_bug.cgi?id=192758

Reviewed by Dean Jackson.

We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
less bookkeeping to perform.

No new test since there is no user-observable change.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
(WebCore::WebAnimation::performMicrotask): Deleted.
* animation/WebAnimation.h:

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

8 months ago[Web Animations] Ensure we don't update an animation's finished state twice when...
graouts@webkit.org [Mon, 17 Dec 2018 17:49:55 +0000 (17:49 +0000)]
[Web Animations] Ensure we don't update an animation's finished state twice when updating animations
https://bugs.webkit.org/show_bug.cgi?id=192757

Reviewed by Dean Jackson.

When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
next call to resolve(), unless any of the timing properties have changed in the meantime.

No new test since there is no user-observable change.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingDidChange):
(WebCore::WebAnimation::tick):
(WebCore::WebAnimation::resolve):
* animation/WebAnimation.h:

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

8 months agoREGRESSION (r233268): Elements animated in from offscreen sometimes don't display
simon.fraser@apple.com [Mon, 17 Dec 2018 17:10:44 +0000 (17:10 +0000)]
REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
https://bugs.webkit.org/show_bug.cgi?id=192725
rdar://problem/46011418

Reviewed by Antoine Quint.

Source/WebCore:

There were two problems with backing store attachment and animation.

First, animations are an input into the "backing store attached" logic, so when they change
we should set the CoverageRectChanged bit on GraphicsLayerCA.

Secondly, when an ancestor has unknown animation extent, all its descendants need to
get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
the current layer has no animation extent.

Tests: compositing/backing/animate-into-view-with-descendant.html
       compositing/backing/animate-into-view.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::removeAnimation):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):

LayoutTests:

* compositing/backing/animate-into-view-expected.txt: Added.
* compositing/backing/animate-into-view-with-descendant-expected.txt: Added.
* compositing/backing/animate-into-view-with-descendant.html: Added.
* compositing/backing/animate-into-view.html: Added.
* platform/ios/compositing/backing/animate-into-view-expected.txt: Added.
* platform/ios/compositing/backing/animate-into-view-with-descendant-expected.txt: Added.

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

8 months ago[LFC][BFC][MarginCollapsing] Unify margin collapse function naming
zalan@apple.com [Mon, 17 Dec 2018 15:44:55 +0000 (15:44 +0000)]
[LFC][BFC][MarginCollapsing] Unify margin collapse function naming
https://bugs.webkit.org/show_bug.cgi?id=192747

Reviewed by Antti Koivisto.

Rename some margin collapse getters.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
(WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
(WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
(WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.

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

8 months agoclang-tidy: loop variable is copied but only used as const reference in WebCore,...
ddkilzer@apple.com [Mon, 17 Dec 2018 14:22:41 +0000 (14:22 +0000)]
clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
<https://webkit.org/b/192751>
<rdar://problem/46771623>

Reviewed by Daniel Bates.

Change loop variables to const references to avoid unnecessary
copies.

Source/WebCore:

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
(WebCore::IDBDatabaseInfo::loggingString const):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::headerObject):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computedNeedsForcedLayout):
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
(WebCore::CryptoKeyRSA::exportJwk const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::OrderedNamedLinesCollector::appendLines const):
* dom/DataTransfer.cpp:
(WebCore::readURLsFromPasteboardAsString):
* dom/TreeScope.cpp:
(WebCore::TreeScope::elementsFromPoint):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreRegion):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setInstruments):
* page/Page.cpp:
(WebCore::Page::updateIntersectionObservations):
* page/TextIndicator.cpp:
(WebCore::estimatedBackgroundColorForRange):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeLayoutDependency):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::append):
* testing/Internals.cpp:
(WebCore::Internals::acceleratedAnimationsForElement):

Source/WebKit:

* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::~WebSWServerConnection):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSErrors):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::performInteractionSequence):
* UIProcess/Plugins/PluginProcessManager.cpp:
(WebKit::PluginProcessManager::getPluginProcess):
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
(WebKit::LocalStorageDatabaseTracker::origins const):
(WebKit::LocalStorageDatabaseTracker::originDetails):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):

Tools:

* DumpRenderTree/mac/DumpRenderTreePasteboard.mm:
(-[LocalPasteboard pasteboardItems]):

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

8 months ago[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
Ms2ger@igalia.com [Mon, 17 Dec 2018 14:08:46 +0000 (14:08 +0000)]
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816

Reviewed by Michael Catanzaro.

Source/WebCore:

Tests: enabled fast/url/user-visible/.

* testing/Internals.cpp:
(WebCore::Internals::userVisibleString): Enable method on all platforms.

Source/WebKit:

Add webkit_uri_for_display for GTK and WPE.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
(webkit_uri_for_display):
* UIProcess/API/gtk/WebKitURIUtilities.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitURIUtilities.h: Added.
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:

Source/WTF:

Translate userVisibleString and dependent code into platform-neutral C++
in wtf/URLHelpers.{h,cpp}.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/URLHelpers.cpp: Added.
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::URLHelpers::isArmenianLookalikeCharacter):
(WTF::URLHelpers::isArmenianScriptCharacter):
(WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
(WTF::URLHelpers::isLookalikeCharacter):
(WTF::URLHelpers::whiteListIDNScript):
(WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
(WTF::URLHelpers::isRussianDomainNameCharacter):
(WTF::URLHelpers::allCharactersAllowedByTLDRules):
(WTF::URLHelpers::mapHostName):
(WTF::URLHelpers::collectRangesThatNeedMapping):
(WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
(WTF::URLHelpers::applyHostNameFunctionToURLString):
(WTF::URLHelpers::mapHostNames):
(WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
(WTF::URLHelpers::userVisibleURL):
* wtf/URLHelpers.h: Added.
* wtf/cocoa/NSURLExtras.mm:
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::decodePercentEscapes):
(WTF::decodeHostName):
(WTF::encodeHostName):
(WTF::URLWithUserTypedString):
(WTF::userVisibleString):

Tools:

Add tests for userVisibleString() and (for GTK and WPE) webkit_uri_for_display().

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/URLHelpers.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitURIUtilities.cpp: Added.
(testURIForDisplayUnaffected):
(testURIForDisplayAffected):
(beforeAll):
(afterAll):
* TestWebKitAPI/glib/CMakeLists.txt:

LayoutTests:

* TestExpectations: Enable fast/url/user-visible/.

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

8 months ago[WPE] Add API to notify about frame displayed view backend callback
carlosgc@webkit.org [Mon, 17 Dec 2018 13:31:27 +0000 (13:31 +0000)]
[WPE] Add API to notify about frame displayed view backend callback
https://bugs.webkit.org/show_bug.cgi?id=192224

Reviewed by Michael Catanzaro.

Source/WebKit:

Add API to add a callback to the view to be called when the view backend notifies that a frame has been
displayed.

* UIProcess/API/glib/WebKitWebView.cpp:
(FrameDisplayedCallback::FrameDisplayedCallback):
(FrameDisplayedCallback::~FrameDisplayedCallback):
(webkit_web_view_add_frame_displayed_callback):
(webkit_web_view_remove_frame_displayed_callback):
* UIProcess/API/wpe/WebKitWebView.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:

Tools:

Add a test case to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewFrameDisplayed):
(beforeAll):
* wpe/jhbuild.modules: Bump WPEBackend-fdo to 1.1.0.

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

8 months agoAX: Support keyboard access preference for iOS in WebKit
cfleizach@apple.com [Mon, 17 Dec 2018 00:44:23 +0000 (00:44 +0000)]
AX: Support keyboard access preference for iOS in WebKit
https://bugs.webkit.org/show_bug.cgi?id=192373
<rdar://problem/46462670>

Reviewed by Tim Horton.

* Platform/spi/ios/AccessibilitySupportSPI.h:
* PlatformMac.cmake:
* SourcesCocoa.txt:
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added.
* UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added.
(platformIsFullKeyboardAccessEnabled):
(-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
(-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
(-[WKFullKeyboardAccessWatcher init]):
(+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::fullKeyboardAccessEnabled):
* UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed.
* UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed.
* WebKit.xcodeproj/project.pbxproj:

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

8 months agoUnreviewed follow up after r239260
aperez@igalia.com [Sun, 16 Dec 2018 22:29:13 +0000 (22:29 +0000)]
Unreviewed follow up after r239260
https://bugs.webkit.org/show_bug.cgi?id=192714
<rdar://problem/46762407>

* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::allocate): Use PAGE_READWRITE directly instead
of going through the protectAttribute() function, which is removed
because it is now unused.

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

8 months agoUnify SharedMemory factory functions
aperez@igalia.com [Sun, 16 Dec 2018 19:39:38 +0000 (19:39 +0000)]
Unify SharedMemory factory functions
https://bugs.webkit.org/show_bug.cgi?id=192714

Reviewed by Darin Adler.

This unifies SharedMemory so in the following way, across platforms:

- SharedMemory::create() is removed, to avoid ambiguity.
- SharedMemory::allocate() always allocates a new block of shared memory.
- SharedMemory::wrapMap() always creates a SharedMemory object which refers to an
  existing region of memory resulting from memory-mapping a file.

* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::tryCreateSharedMemory const): Use SharedMemory::wrapMap().
* Platform/SharedMemory.h: Remove the definition of SharedMemory::create(), and make
SharedMemory::wrapMap() available on OS(DARWIN) as well.
* Platform/cocoa/SharedMemoryCocoa.cpp:
(WebKit::SharedMemory::wrapMap): Renamed from ::create().
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::allocate): Renamed from ::create().
* Platform/win/SharedMemoryWin.cpp:
(WebKit::SharedMemory::allocate): Renamed from ::create()
* UIProcess/API/APIContentRuleListStore.cpp:
(API::createExtension): Use NetworkCache::Data::tryCreateSharedMemory() instead of
SharedMemory::create().

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

8 months agoUnreviewed build fix after r239253
aperez@igalia.com [Sun, 16 Dec 2018 12:05:46 +0000 (12:05 +0000)]
Unreviewed build fix after r239253

* gtk/jhbuild.modules: Fix typo in libpsl dependency name.

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

8 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Sun, 16 Dec 2018 07:25:21 +0000 (07:25 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449
<rdar://problem/46595508>

Reviewed by Darin Adler.

Part 7: Files in UIProcess/API

* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/APIHitTestResult.cpp:
* UIProcess/API/APINavigation.cpp:
* UIProcess/API/APIOpenPanelParameters.cpp:
* UIProcess/API/APIPageConfiguration.cpp:
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetTypeID):
(WKApplicationCacheManagerGetApplicationCacheOrigins):
(WKApplicationCacheManagerDeleteEntriesForOrigin):
(WKApplicationCacheManagerDeleteAllEntries):
* UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
(WKAuthenticationDecisionListenerGetTypeID):
(WKAuthenticationDecisionListenerUseCredential):
(WKAuthenticationDecisionListenerCancel):
(WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue):
* UIProcess/API/C/WKBackForwardListItemRef.cpp:
(WKBackForwardListItemGetTypeID):
(WKBackForwardListItemCopyURL):
(WKBackForwardListItemCopyTitle):
(WKBackForwardListItemCopyOriginalURL):
* UIProcess/API/C/WKContext.cpp:
(WKContextGetTypeID):
(WKContextCreate):
(WKContextCreateWithInjectedBundlePath):
(WKContextCreateWithConfiguration):
(WKContextSetClient):
(WKContextSetInjectedBundleClient):
(WKContextSetHistoryClient):
(WKContextSetDownloadClient):
(WKContextSetConnectionClient):
(WKContextDownloadURLRequest):
(WKContextResumeDownload):
(WKContextSetInitializationUserDataForInjectedBundle):
(WKContextPostMessageToInjectedBundle):
(WKContextGetGlobalStatistics):
(WKContextAddVisitedLink):
(WKContextClearVisitedLinks):
(WKContextSetCacheModel):
(WKContextGetCacheModel):
(WKContextSetMaximumNumberOfProcesses):
(WKContextGetMaximumNumberOfProcesses):
(WKContextSetAlwaysUsesComplexTextCodePath):
(WKContextSetShouldUseFontSmoothing):
(WKContextSetAdditionalPluginsDirectory):
(WKContextRefreshPlugIns):
(WKContextRegisterURLSchemeAsEmptyDocument):
(WKContextRegisterURLSchemeAsSecure):
(WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy):
(WKContextRegisterURLSchemeAsCachePartitioned):
(WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
(WKContextSetDomainRelaxationForbiddenForURLScheme):
(WKContextSetCanHandleHTTPSServerTrustEvaluation):
(WKContextSetPrewarmsProcessesAutomatically):
(WKContextSetCustomWebContentServiceBundleIdentifier):
(WKContextSetDiskCacheSpeculativeValidationEnabled):
(WKContextPreconnectToServer):
(WKContextGetCookieManager):
(WKContextGetWebsiteDataStore):
(WKContextGetGeolocationManager):
(WKContextGetMediaSessionFocusManager):
(WKContextGetNotificationManager):
(WKContextStartMemorySampler):
(WKContextStopMemorySampler):
(WKContextAllowSpecificHTTPSCertificateForHost):
(WKContextDisableProcessTermination):
(WKContextEnableProcessTermination):
(WKContextSetHTTPPipeliningEnabled):
(WKContextWarmInitialProcess):
(WKContextGetStatistics):
(WKContextGetStatisticsWithOptions):
(WKContextJavaScriptConfigurationFileEnabled):
(WKContextSetJavaScriptConfigurationFileEnabled):
(WKContextGarbageCollectJavaScriptObjects):
(WKContextSetJavaScriptGarbageCollectorTimerEnabled):
(WKContextUseTestingNetworkSession):
(WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
(WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
(WKContextClearCachedCredentials):
(WKContextCopyPlugInAutoStartOriginHashes):
(WKContextSetPlugInAutoStartOriginHashes):
(WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
(WKContextSetPlugInAutoStartOrigins):
(WKContextSetInvalidMessageFunction):
(WKContextSetMemoryCacheDisabled):
(WKContextSetFontWhitelist):
(WKContextTerminateNetworkProcess):
(WKContextTerminateServiceWorkerProcess):
(WKContextGetNetworkProcessIdentifier):
(WKContextAddSupportedPlugin):
(WKContextClearSupportedPlugins):
(WKContextSetIDBPerOriginQuota):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
(WKPageSetPageLoaderClient):
(WKPageSetPagePolicyClient):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:

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

8 months agoUnreviewed, suppress warnings in Linux
yusukesuzuki@slowstart.org [Sun, 16 Dec 2018 06:12:53 +0000 (06:12 +0000)]
Unreviewed, suppress warnings in Linux

Source/bmalloc:

* bmalloc/Gigacage.cpp:

Source/JavaScriptCore:

* jsc.cpp:
(jscmain):

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

8 months agoNull pointer dereference in JSC::WriteBarrierBase()
yusukesuzuki@slowstart.org [Sun, 16 Dec 2018 05:49:01 +0000 (05:49 +0000)]
Null pointer dereference in JSC::WriteBarrierBase()
https://bugs.webkit.org/show_bug.cgi?id=191252

Reviewed by Keith Miller.

Source/JavaScriptCore:

JSPromiseDeferred::create can return nullptr and an exception if stack overflow happens.
We would like to make it RELEASE_ASSERT since the current module mechanism is not immune
to stack overflow.

This patch renames JSPromiseDeferred::create to JSPromiseDeferred::tryCreate to tell that
it can return nullptr. And we insert error checks or assertions after this call.

* jsc.cpp:
(GlobalObject::moduleLoaderImportModule):
(GlobalObject::moduleLoaderFetch):
* runtime/Completion.cpp:
(JSC::rejectPromise):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncImportModule):
* runtime/JSInternalPromiseDeferred.cpp:
(JSC::JSInternalPromiseDeferred::tryCreate):
(JSC::JSInternalPromiseDeferred::create): Deleted.
* runtime/JSInternalPromiseDeferred.h:
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::importModule):
(JSC::JSModuleLoader::resolve):
(JSC::JSModuleLoader::fetch):
(JSC::moduleLoaderParseModule):
* runtime/JSPromise.h:
* runtime/JSPromiseDeferred.cpp:
(JSC::JSPromiseDeferred::tryCreate):
* runtime/JSPromiseDeferred.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::webAssemblyInstantiateFunc):
(JSC::webAssemblyCompileStreamingInternal):
(JSC::webAssemblyInstantiateStreamingInternal):

Source/WebCore:

* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::whenDefined):
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::createDeferredPromise):
* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::DeferredPromise::create):
(WebCore::callPromiseFunction):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderFetch):
(WebCore::JSDOMWindowBase::moduleLoaderImportModule):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch):
(WebCore::rejectPromise):

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

8 months agoUse warning-ignoring macros more consistently and simply
darin@apple.com [Sun, 16 Dec 2018 00:21:25 +0000 (00:21 +0000)]
Use warning-ignoring macros more consistently and simply
https://bugs.webkit.org/show_bug.cgi?id=192743

Reviewed by Mark Lam.

Source/JavaScriptCore:

* dfg/DFGSpeculativeJIT64.cpp: Use IGNORE_WARNINGS_BEGIN/END instead of
IGNORE_CLANG_WARNINGS_BEGIN/END. Other callsites are using the non-clang-specific
one for this warning, "implicit-fallthrough", and it seems there is no special
need to use the clang-specific one here.
* llint/LLIntData.cpp: Ditto, but here it's "missing-noreturn"."
* tools/CodeProfiling.cpp: Ditto.

Source/WebCore:

* bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
files like this one with non-clang compilers, and no need to worry about
them when choosing the macro.

* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.

* css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
the "unknown-pragmas" trick, which the macro should take care of.
* css/makevalues.pl: Ditto.
* platform/ColorData.gperf: Ditto.

* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.

* platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.

* platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const): Use
ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.

Source/WebCore/PAL:

* pal/spi/cocoa/AVKitSPI.h: Use IGNORE_WARNINGS_BEGIN instead of
IGNORE_CLANG_WARNINGS_BEGIN; there is no special need to accomodate
non-clang compilers here.

Source/WebKit:

* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _EVOrganizationName]): Ditto.

* WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use
IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END
because there is no need to accomodate non-clang compilers here.
Also use #pragma once, add a missing "explicit", and fix conditionals.

Source/WebKitLegacy/mac:

* DOM/DOM.mm: Use IGNORE_WARNINGS_BEGIN/END instead of
IGNORE_CLANG_WARNINGS_BEGIN since there is no need to accomodate non-clang
compilers in Objective-C++ code.

* WebCoreSupport/WebAlternativeTextClient.h: Use IGNORE_WARNINGS_BEGIN/END
instead of IGNORE_CLANG_WARNINGS_BEGIN/END because there is no need to
accomodate non-clang compilers here. Also use #pragma once, add a missing
"explicit" and fix conditionals.

Source/WTF:

* wtf/Assertions.h: Use IGNORE_WARNINGS_BEGIN rather than
IGNORE_CLANG_WARNINGS_BEGIN since we don't need special handling for
non-clang compilers, in part since the code is already inside
#if COMPILER(CLANG), but also because it would be harmless to ignore this
warning on non-clang; we should almost never use IGNORE_CLANG_WARNINGS_BEGIN.

Tools:

* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(handleEventCarbon): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
* DumpRenderTree/mac/TextInputControllerMac.m:
(-[TextInputController interpretKeyEvents:withSender:]): Use
IGNORE_WARNINGS_BEGIN/END.
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseForceClick): Use
IGNORE_NULL_CHECK_WARNINGS_BEGIN/END.
(WTR::EventSenderProxy::startAndCancelMouseForceClick): Ditto.
(WTR::EventSenderProxy::mouseForceDown): Ditto.
(WTR::EventSenderProxy::mouseForceUp): Ditto.
(WTR::EventSenderProxy::mouseForceChanged): Ditto.

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

8 months agoReplace many uses of String::format with more type-safe alternatives
darin@apple.com [Sun, 16 Dec 2018 00:09:32 +0000 (00:09 +0000)]
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742

Reviewed by Mark Lam.

Source/JavaScriptCore:

* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeCall): Use makeString.
(Inspector::InjectedScriptBase::makeAsyncCall): Ditto.
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::getPropertyValue): Ditto.
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::enable): Ditto.
* jsc.cpp:
(FunctionJSCStackFunctor::operator() const): Ditto.

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::initializeDateTimeFormat): Use string concatenation.
* runtime/IntlObject.cpp:
(JSC::canonicalizeLocaleList): Ditto.

Source/WebCore:

A while back, String::format was more efficient than string concatenation,
but that is no longer true, and we should prefer String::number, makeString,
or concatenation with the "+" operator to String::format for new code.

This is not as good for programmers who are fond of printf formatting
style, and in some cases it's a little harder to read the strings
interspersed with variables rather than a format string, but it's better
in a few ways:

- more efficient (I didn't measure the difference, but it's definitely
  slower to use String::Format which calls vsnprintf twice than to use
  the WTF code)
- works in a type-safe way without a need to use a format specifier such
  as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
  subtle differences between platforms
- allows us to use StringView in some cases to sidestep the need to
  allocate temporary WTF::String objects
- does not require converting each WTF::String to a C string, allowing
  us to remove many cases of ".utf8().data()" and similar expressions,
  eliminating the allocation of temporary WTF::CString objects

This patch covers a batch of easiest-to-convert call sites.
Later patches will allow us to deprecate or remove String::format.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
(WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const): Ditto.
(WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::loggingString const): Ditto.
* Modules/webdatabase/Database.cpp:
(WebCore::formatErrorMessage): Ditto.
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::create): Ditto.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Use makeString.

* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Updated expected results.

Source/WebCore/PAL:

* pal/FileSizeFormatter.cpp:
(fileSizeDescription): Use makeString.

Source/WebKit:

* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::writeHeaders): Use makeString.

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::makeCredential): Use string concatentation.

* UIProcess/WebInspectorUtilities.cpp:
(WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
(WebKit::WebProcessPool::startMemorySampler): Ditto.

Source/WTF:

* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply): Use makeString.

* wtf/dtoa.cpp:
(WTF::dtoa): Use sprintf instead of String::format in the comments,
since these functions have nothing to do with WTF::String.

Tools:

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::cacheTestRunnerCallback): Use makeString.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveAuthenticationChallenge): Use makeString.
(WTR::TestController::downloadDidFail): Use an ASCIILiteral via the _s syntax.

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

8 months ago[WPE][GTK] Add libpsl to JHBuild module sets
aperez@igalia.com [Sat, 15 Dec 2018 23:01:37 +0000 (23:01 +0000)]
[WPE][GTK] Add libpsl to JHBuild module sets
https://bugs.webkit.org/show_bug.cgi?id=192740

Reviewed by Michael Catanzaro.

* gtk/jhbuild.modules: Add libpsl module.
* wpe/jhbuild.modules: Ditto.

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

8 months agoMake RTCRtpSender.setParameters to activate specific encodings
youenn@apple.com [Sat, 15 Dec 2018 17:40:26 +0000 (17:40 +0000)]
Make RTCRtpSender.setParameters to activate specific encodings
https://bugs.webkit.org/show_bug.cgi?id=192732

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

The conversion between libwebrtc and WebCore is lossy for send parameters.
Libwebrtc checking the differences of values, call to setParameters will often fail.

Given some parameters cannot be exposed, the sender backend keeps the
current set of parameters when gathered and reuses them when parameters are set.

For encodings, we only change activate/maxBitRate/maxFrameRate as
these are the most important parameters to be able to modify.

Covered by added tests in webrtc/video.html.

* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::getParameters const):
(WebCore::LibWebRTCRtpSenderBackend::setParameters):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::fromRTCRtpSendParameters):
(WebCore::fromRTCEncodingParameters): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCUtils.h:

LayoutTests:

* webrtc/video-expected.txt:
* webrtc/video.html:

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

8 months agoWeb Inspector: Styles: toggling selected properties may cause data corruption
nvasilyev@apple.com [Sat, 15 Dec 2018 10:03:19 +0000 (10:03 +0000)]
Web Inspector: Styles: toggling selected properties may cause data corruption
https://bugs.webkit.org/show_bug.cgi?id=192396
<rdar://problem/46478383>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

Uncommenting a property after a commented out property used to insert an unnecessary semicolon,
and not updating ranges of the following properties.

For example:

    /* color: red; */
    /* font-size: 12px */

Uncommenting `font-size` would result in something like this:

    /* color: red; */; font-size: 12px
                     ^
                     unnecessary semicolon

Now the semicolon doesn't get inserted and the white space is preserved better:

    /* color: red; */
    font-size: 12px

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
(WI.CSSProperty.prototype._appendSemicolonIfNeeded): Removed.
(WI.CSSProperty.prototype._prependSemicolonIfNeeded): Added.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.remove):
(WI.SpreadsheetStyleProperty.prototype.update):
(WI.SpreadsheetStyleProperty.prototype._handleNameChange):
(WI.SpreadsheetStyleProperty.prototype._handleValueChange):
Style declaration should be locked while editing. Add asserts to ensure this.

LayoutTests:

* inspector/css/add-css-property-expected.txt: Added.
* inspector/css/add-css-property.html: Added.
Test adding new properties.

* inspector/css/modify-css-property-expected.txt:
* inspector/css/modify-css-property.html:
Test commenting out and uncommenting CSS properties.

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

8 months agoAdd a style checker rule for Xcode version macros use
ap@apple.com [Sat, 15 Dec 2018 07:51:56 +0000 (07:51 +0000)]
Add a style checker rule for Xcode version macros use
https://bugs.webkit.org/show_bug.cgi?id=192703

Reviewed by Alex Christensen.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_os_version_checks):
(process_line):
(CppChecker):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_os_version_checks):

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

8 months agoVerify size is valid in USE_SYSTEM_MALLOC version of tryAllocateZeroedVirtualPages
darin@apple.com [Sat, 15 Dec 2018 07:48:18 +0000 (07:48 +0000)]
Verify size is valid in USE_SYSTEM_MALLOC version of tryAllocateZeroedVirtualPages
https://bugs.webkit.org/show_bug.cgi?id=192738
rdar://problem/37502342

Reviewed by Mark Lam.

* wtf/Gigacage.cpp:
(Gigacage::tryAllocateZeroedVirtualPages): Added a RELEASE_ASSERT just
like the one in tryLargeZeroedMemalignVirtual in bmalloc.

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

8 months agoLiteralParser has a bunch of uses of String::format with untrusted data
darin@apple.com [Sat, 15 Dec 2018 07:42:38 +0000 (07:42 +0000)]
LiteralParser has a bunch of uses of String::format with untrusted data
https://bugs.webkit.org/show_bug.cgi?id=108883
rdar://problem/13666409

Reviewed by Mark Lam.

* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::Lexer::lex): Use makeString instead of String::format.
(JSC::LiteralParser<CharType>::Lexer::lexStringSlow): Ditto.
(JSC::LiteralParser<CharType>::parse): Ditto.

* runtime/LiteralParser.h:
(JSC::LiteralParser::getErrorMessage): Use string concatenation instead of
String::format.

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

8 months agoWeb Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS...
commit-queue@webkit.org [Sat, 15 Dec 2018 04:30:41 +0000 (04:30 +0000)]
Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
https://bugs.webkit.org/show_bug.cgi?id=192724
<rdar://problem/46745911>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-14
Reviewed by Devin Rousso.

iOS never installs the InspectorOverlay page as a page overlay.
It also uses its own node highlighting painting. Avoid any work
and resources associated with the overlay page for iOS.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::overlayPage):
(WebCore::evaluateCommandInOverlay):

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

8 months agoWeb Inspector: REGRESSION(r238599): Uncaught Exception: TypeError: null is not an...
mattbaker@apple.com [Sat, 15 Dec 2018 03:34:54 +0000 (03:34 +0000)]
Web Inspector: REGRESSION(r238599): Uncaught Exception: TypeError: null is not an object (evaluating 'treeElement.listItemElement.classList')
https://bugs.webkit.org/show_bug.cgi?id=192090
<rdar://problem/46318614>

Reviewed by Devin Rousso.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
Check that `listItemElement` is valid before accessing it to update class
names. The selection can change before the TreeElement has been attached.

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

8 months agoGigacage runway should immediately follow the primitive cage
keith_miller@apple.com [Sat, 15 Dec 2018 03:05:59 +0000 (03:05 +0000)]
Gigacage runway should immediately follow the primitive cage
https://bugs.webkit.org/show_bug.cgi?id=192733

Reviewed by Saam Barati.

This patch makes sure that the Gigacage runway is always
immediately after the primitive cage. Since writing outside the
primitive gigacage is likely to be more dangerous than the JSValue
cage. The ordering of the cages is still random however.

* bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):

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

8 months agoCallFrame::convertToStackOverflowFrame() needs to keep the top CodeBlock alive.
mark.lam@apple.com [Sat, 15 Dec 2018 02:28:17 +0000 (02:28 +0000)]
CallFrame::convertToStackOverflowFrame() needs to keep the top CodeBlock alive.
https://bugs.webkit.org/show_bug.cgi?id=192717
<rdar://problem/46660677>

Reviewed by Saam Barati.

JSTests:

* stress/regress-192717.js: Added.

Source/JavaScriptCore:

When throwing a StackOverflowError, we convert the topCallFrame into a
StackOverflowFrame.  Previously, we would nullify the codeBlock field in the frame
because a StackOverflowFrame is only a sentinel and doesn't really correspond to
any CodeBlocks.  However, this is a problem because the topCallFrame may be the
only remaining place that references the CodeBlock that the stack overflow is
triggered in.  The way we handle exceptions in JIT code is to return (from the
runtime operation function throwing the exception) to the JIT code to check for
the exception and if needed, do some clean up before jumping to the exception
handling thunk.  As a result, we need to keep that JIT code alive, which means we
need to keep its CodeBlock alive.  We only need to keep this CodeBlock alive until
we've unwound (in terms of exception handling) out of it.

We fix this issue by storing the CodeBlock to keep alive in the StackOverflowFrame
for the GC to scan while the frame is still on the stack.

We removed the call to convertToStackOverflowFrame() in
lookupExceptionHandlerFromCallerFrame() because it is redundant.
lookupExceptionHandlerFromCallerFrame() will only every be called after
a StackOverFlowError has been thrown.  Hence, the top frame is already
guaranteed to be a StackOverflowFrame, and there should always be a
StackOverFlowError exception pending.  We added assertions for these
instead.

* interpreter/CallFrame.cpp:
(JSC::CallFrame::convertToStackOverflowFrame):
* interpreter/CallFrame.h:
* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::codeBlockFromCallFrameCallee):
(JSC::CommonSlowPaths::arityCheckFor):
* runtime/VM.h:
(JSC::VM::exceptionForInspection const):

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

8 months agoMediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
youenn@apple.com [Sat, 15 Dec 2018 01:07:18 +0000 (01:07 +0000)]
MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
https://bugs.webkit.org/show_bug.cgi?id=192720

Reviewed by Eric Carlson.

Source/WebCore:

Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
as the latter is a ref counted object.
Made some refactoring to return early in case of error.

Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
the MediaRecorder will stop listening for its tracks.
Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.

Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html

* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::didAddOrRemoveTrack):
(WebCore::MediaRecorder::setNewRecordingState): Deleted.
* Modules/mediarecorder/MediaRecorder.h:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
(WebCore::MediaRecorderPrivateAVFImpl::create):
(WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
(WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
(WebCore::MediaRecorderPrivateAVFImpl::fetchData):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::MediaRecorderPrivateWriter::create):
(WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.

LayoutTests:

* http/wpt/mediarecorder/MediaRecorder-onremovetrack-expected.txt: Added.
* http/wpt/mediarecorder/MediaRecorder-onremovetrack.html: Added.

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

8 months agoUnreviewed, fix the build with recent SDKs.
ryanhaddad@apple.com [Sat, 15 Dec 2018 00:30:48 +0000 (00:30 +0000)]
Unreviewed, fix the build with recent SDKs.

* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):

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

8 months agokVTVideoEncoderSpecification_Usage should not be set if VCP is not enabled
youenn@apple.com [Sat, 15 Dec 2018 00:06:15 +0000 (00:06 +0000)]
kVTVideoEncoderSpecification_Usage should not be set if VCP is not enabled
https://bugs.webkit.org/show_bug.cgi?id=192716

Reviewed by Eric Carlson.

https://trac.webkit.org/changeset/239220 sets the usage value for all platforms, but we should only enable it for VCP.
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCSingleVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):

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

8 months agogetSenders/getReceivers() should not return closed transceiver senders/receivers
youenn@apple.com [Fri, 14 Dec 2018 23:52:40 +0000 (23:52 +0000)]
getSenders/getReceivers() should not return closed transceiver senders/receivers
https://bugs.webkit.org/show_bug.cgi?id=192706

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html:
* web-platform-tests/webrtc/RTCRtpTransceiver.https.html:

Source/WebCore:

Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
This forces us to compute the sender/receiver list at getter call time.
Updated the internal call sites of senders to use the list of transceivers instead.

Covered by updated WPT tests.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::getSenders const):
(WebCore::RTCPeerConnection::getReceivers const):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::stopped const):
(WebCore::RtpTransceiverSet::append):
(WebCore::RtpTransceiverSet::senders const):
(WebCore::RtpTransceiverSet::receivers const):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RtpTransceiverSet::senders const): Deleted.
(WebCore::RtpTransceiverSet::receivers const): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::findExistingSender):
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):

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

8 months agoclang-tidy: Fix unnecessary copy of objects for operator==() methods
ddkilzer@apple.com [Fri, 14 Dec 2018 23:23:10 +0000 (23:23 +0000)]
clang-tidy: Fix unnecessary copy of objects for operator==() methods
<https://webkit.org/b/192712>
<rdar://problem/46739332>

Reviewed by Andy Estes.

Source/JavaScriptCore:

* b3/air/AirAllocateRegistersByGraphColoring.cpp:
(JSC::B3::Air::(anonymous namespace)::AbstractColoringAllocator::InterferenceEdge::operator==):
- Change argument from const to const reference to avoid a copy.

Source/WebCore:

* contentextensions/HashableActionList.h:
(WebCore::ContentExtensions::HashableActionList::operator== const):
(WebCore::ContentExtensions::HashableActionList::operator!= const):
* platform/network/FormData.h:
(WebCore::FormDataElement::EncodedFileData::operator== const):
(WebCore::FormDataElement::EncodedBlobData::operator== const):
- Change arguments from const to const reference to avoid
  copies.

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

8 months agoCRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const...
jer.noble@apple.com [Fri, 14 Dec 2018 22:59:36 +0000 (22:59 +0000)]
CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
https://bugs.webkit.org/show_bug.cgi?id=192713
<rdar://problem/46739706>

Reviewed by Eric Carlson.

A callback is being called twice, and the second time has a null Promise. Instead of these
callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
have ASSERTS() that they are called once-and-only-once.

* platform/encryptedmedia/CDMInstanceSession.h:
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceSessionClearKey::closeSession):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):

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

8 months ago[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https...
jiewen_tan@apple.com [Fri, 14 Dec 2018 22:49:07 +0000 (22:49 +0000)]
[Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
https://bugs.webkit.org/show_bug.cgi?id=192061

Reviewed by Dewei Zhu.

Part 2.

Add some additional temporary logging info. Since the failure cannot be reproduced easily by human, we have to
rely on the test infrastructure to reporoduce it. Once the bug is determined and fixed, we should remove all
logging added in this patch.

* UIProcess/WebAuthentication/Cocoa/HidService.mm:
(WebKit::HidService::deviceAdded):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::makeCredential):
(WebKit::CtapHidAuthenticator::getAssertion):
* UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
(WebKit::CtapHidDriver::Worker::write):
(WebKit::CtapHidDriver::Worker::read):
(WebKit::CtapHidDriver::Worker::returnMessage):
(WebKit::CtapHidDriver::transact):
(WebKit::CtapHidDriver::continueAfterChannelAllocated):
(WebKit::CtapHidDriver::continueAfterResponseReceived):

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

8 months agoclang-tidy: Fix unnecessary copy of AtomicString each time one is logged
ddkilzer@apple.com [Fri, 14 Dec 2018 21:50:47 +0000 (21:50 +0000)]
clang-tidy: Fix unnecessary copy of AtomicString each time one is logged
<https://webkit.org/b/192710>
<rdar://problem/46738962>

Reviewed by Eric Carlson.

* wtf/Logger.h:
(WTF::LogArgument::toString): Make argument a const reference to
avoid the copy.

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

8 months agoUnreviewed, rolling out r239153, r239154, and r239155.
commit-queue@webkit.org [Fri, 14 Dec 2018 21:40:27 +0000 (21:40 +0000)]
Unreviewed, rolling out r239153, r239154, and r239155.
https://bugs.webkit.org/show_bug.cgi?id=192715

Caused flaky GC-related crashes seen with layout tests
(Requested by ryanhaddad on #webkit).

Reverted changesets:

"[JSC] Optimize Object.keys by caching own keys results in
StructureRareData"
https://bugs.webkit.org/show_bug.cgi?id=190047
https://trac.webkit.org/changeset/239153

"Unreviewed, build fix after r239153"
https://bugs.webkit.org/show_bug.cgi?id=190047
https://trac.webkit.org/changeset/239154

"Unreviewed, build fix after r239153, part 2"
https://bugs.webkit.org/show_bug.cgi?id=190047
https://trac.webkit.org/changeset/239155

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

8 months agoclang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation...
ddkilzer@apple.com [Fri, 14 Dec 2018 21:12:23 +0000 (21:12 +0000)]
clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
<https://webkit.org/b/192708>
<rdar://problem/46735907>

Reviewed by Jer Noble.

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::toSample):
- Make argument a const reference.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
- Update method signatures for implementation changes.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
- Make RetainPtr<> argument an rvalue reference and use WTFMove().
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
- Make RetainPtr<> argument a const reference.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
- Change for loop keys to be const references.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
- Update method signatures for implementation changes.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
(WebCore::SourceBufferPrivateAVFObjC::seekToTime):
- Make Mediatime arguments a const reference.

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

8 months ago[GTK] Unreviewed build fix.
aperez@igalia.com [Fri, 14 Dec 2018 21:05:10 +0000 (21:05 +0000)]
[GTK] Unreviewed build fix.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Add missing WebPolicyAction.h include.

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

8 months agoUnreviewed, fix assertion failure in API test after r239210.
cdumez@apple.com [Fri, 14 Dec 2018 20:59:23 +0000 (20:59 +0000)]
Unreviewed, fix assertion failure in API test after r239210.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createDocumentLoader):

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

8 months agoCallers of JSString::getIndex should check for OOM exceptions
keith_miller@apple.com [Fri, 14 Dec 2018 20:53:08 +0000 (20:53 +0000)]
Callers of JSString::getIndex should check for OOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=192709

Reviewed by Mark Lam.

JSTests:

* stress/StringObject-define-length-getter-rope-string-oom.js: Added.

Source/JavaScriptCore:

This patch also allows Strings to OOM when the StringObject wrapper
attempts to look up an own property on the string.

Remove isExtensibleImpl because it's only used in one place and call
isStructureExtensible instead.

* runtime/JSObject.cpp:
(JSC::JSObject::isExtensible):
* runtime/JSObject.h:
(JSC::JSObject::isExtensibleImpl): Deleted.
* runtime/JSString.h:
(JSC::JSString::getStringPropertySlot):
* runtime/StringObject.cpp:
(JSC::StringObject::defineOwnProperty):

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

8 months agoWeb Inspector: Cookies view should use model objects instead of raw payload data
mattbaker@apple.com [Fri, 14 Dec 2018 20:41:31 +0000 (20:41 +0000)]
Web Inspector: Cookies view should use model objects instead of raw payload data
https://bugs.webkit.org/show_bug.cgi?id=189533
<rdar://problem/44364183>

Reviewed by Joseph Pecoraro and Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Models/Cookie.js:
(WI.Cookie):
(WI.Cookie.fromPayload):
(WI.Cookie.parseSetCookieResponseHeader):
(WI.Cookie.prototype.get type):
(WI.Cookie.prototype.get name):
(WI.Cookie.prototype.get value):
(WI.Cookie.prototype.get header):
(WI.Cookie.prototype.get expires):
(WI.Cookie.prototype.get maxAge):
(WI.Cookie.prototype.get path):
(WI.Cookie.prototype.get domain):
(WI.Cookie.prototype.get secure):
(WI.Cookie.prototype.get httpOnly):
(WI.Cookie.prototype.get sameSite):
(WI.Cookie.prototype.get size):
(WI.Cookie.prototype.get url):
(WI.Cookie.prototype.expirationDate):
Cleanup Cookie object; add pubic getters for data, `url` property,
static `fromPayload` method, and calculate `_size` if missing.

* UserInterface/Views/CookieStorageContentView.js:
(WI.CookieStorageContentView.prototype.tableDidRemoveRows):
(WI.CookieStorageContentView.prototype._reloadCookies):
Create Cookie objects from the payload instead of using raw payload data.

LayoutTests:

* inspector/unit-tests/cookie-expected.txt:
* inspector/unit-tests/cookie.html:

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

8 months ago[SOUP] Unreviewed build fix after r239219
aperez@igalia.com [Fri, 14 Dec 2018 20:06:38 +0000 (20:06 +0000)]
[SOUP] Unreviewed build fix after r239219

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Remove
handling of PolicyAction::Suspend, which is no longer available.

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

8 months agoUnreviewed, apply post-landing review comments after r239221.
joepeck@webkit.org [Fri, 14 Dec 2018 19:36:54 +0000 (19:36 +0000)]
Unreviewed, apply post-landing review comments after r239221.

* UIProcess/WebPageDebuggable.cpp:
(WebKit::WebPageDebuggable::url const):
Switch to WTF::blankURL() instead of using "about:blank" directly.

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

8 months ago[PSON] Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigatio...
cdumez@apple.com [Fri, 14 Dec 2018 19:29:41 +0000 (19:29 +0000)]
[PSON] Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls
https://bugs.webkit.org/show_bug.cgi?id=192704

Reviewed by Geoffrey Garen.

Source/WebKit:

Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls. This
is because we were failing to pass the ShouldTreatAsContinuingLoad flag to the WebContent process when
doing a LoadData.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadAlternateHTML):
* WebProcess/WebPage/WebPage.h:

Tools:

Extend existing API test to reproduce the problem.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

8 months agoREGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
simon.fraser@apple.com [Fri, 14 Dec 2018 19:05:43 +0000 (19:05 +0000)]
REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
https://bugs.webkit.org/show_bug.cgi?id=188655
rdar://problem/43382687

Reviewed by Antoine Quint.

Source/WebCore:

The logic that computes animation extent, used by backing store attachment code, failed
to account for the behavior where a keyframe animation with a missing 0% keyframe uses
the transform from the unanimated style. This resulted in the computed extent being wrong,
which caused us to remove the layer's backing store in some scenarios.

Fix both animation code paths to use the renderer style if the first keyframe doesn't
contain a transform.

Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
       legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html

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

LayoutTests:

* compositing/backing/backing-store-attachment-empty-keyframe-expected.txt: Added.
* compositing/backing/backing-store-attachment-empty-keyframe.html: Added.
* legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe-expected.txt: Added.
* legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html: Added.

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

8 months agoWeb Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url
commit-queue@webkit.org [Fri, 14 Dec 2018 18:26:47 +0000 (18:26 +0000)]
Web Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url
https://bugs.webkit.org/show_bug.cgi?id=192691
<rdar://problem/46719798>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-14
Reviewed by Darin Adler.

* UIProcess/WebPageDebuggable.cpp:
(WebKit::WebPageDebuggable::url const):
Instead of an empty string, return "about:blank" in bail cases.
When inspecting the page that matches the contents.

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

8 months agoSet kVTVideoEncoderSpecification_Usage both when creating the compression session...
youenn@apple.com [Fri, 14 Dec 2018 18:24:21 +0000 (18:24 +0000)]
Set kVTVideoEncoderSpecification_Usage both when creating the compression session and once created
https://bugs.webkit.org/show_bug.cgi?id=192700

Reviewed by Eric Carlson.

Previously we were setting the usage value once the compression session is created.
We now also set it at creation time.

* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCSingleVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):

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

8 months ago[PSON] Stop exposing PolicyAction::Suspend to WebCore
cdumez@apple.com [Fri, 14 Dec 2018 18:23:55 +0000 (18:23 +0000)]
[PSON] Stop exposing PolicyAction::Suspend to WebCore
https://bugs.webkit.org/show_bug.cgi?id=192701

Reviewed by Brady Eidson.

Source/WebCore:

Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/FrameLoaderTypes.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):

Source/WebKit:

Introduce a new WebPolicyAction enum that is used at WebKit2 layer and augments
WebCore::PolicyAction with a "Suspend" value.

* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(toNSURLSessionResponseDisposition):
* Shared/WebPolicyAction.h: Added.
* 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::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::toPolicyAction):
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

8 months agoRemove a global 'using namespace WebKit' in WebViewImpl.mm
david_quesada@apple.com [Fri, 14 Dec 2018 18:14:32 +0000 (18:14 +0000)]
Remove a global 'using namespace WebKit' in WebViewImpl.mm
https://bugs.webkit.org/show_bug.cgi?id=192690

Reviewed by Tim Horton.

* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKTextListTouchBarViewController initWithWebViewImpl:]):
(-[WKTextListTouchBarViewController _selectList:]):
(-[WKTextListTouchBarViewController setCurrentListType:]):
(-[WKTextTouchBarItemController initWithWebViewImpl:]):

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

8 months agoUnreviewed test gardening.
zalan@apple.com [Fri, 14 Dec 2018 17:58:21 +0000 (17:58 +0000)]
Unreviewed test gardening.

LFC does not support logical to physical coordinate conversion yet.

* fast/block/block-only/float-avoider-with-margins-expected.txt:
* fast/block/block-only/float-avoider-with-margins.html:

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

8 months agoIDB should store RTCCertificate
youenn@apple.com [Fri, 14 Dec 2018 17:44:47 +0000 (17:44 +0000)]
IDB should store RTCCertificate
https://bugs.webkit.org/show_bug.cgi?id=192599

Reviewed by Brady Eidson.

Source/WebCore:

In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
Instead, create an empty object so that the deserialization can still succeed.
This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.

Test: webrtc/certificates-indexeddb.html

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):

LayoutTests:

* webrtc/certificates-indexeddb-expected.txt: Added.
* webrtc/certificates-indexeddb.html: Added.

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

8 months ago[PSON] WebsitePolicies are lost on process-swap
cdumez@apple.com [Fri, 14 Dec 2018 17:40:53 +0000 (17:40 +0000)]
[PSON] WebsitePolicies are lost on process-swap
https://bugs.webkit.org/show_bug.cgi?id=192694
<rdar://problem/46715748>

Reviewed by Brady Eidson.

Source/WebKit:

In case of process-swap on navigation, instead of sending the websitePolicies to the old
process, send them to the new process as we trigger the navigation. We tell the new process
that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction.

* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/LoadParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::loadRequestWithNavigation):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadAlternateHTML):
(WebKit::WebPage::goToBackForwardItem):
(WebKit::WebPage::createDocumentLoader):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Extend existing API test to reproduce the issue.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:

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

8 months ago[GTK] Error writing data to TLS socket in some sites when using the jhbuild
mcatanzaro@igalia.com [Fri, 14 Dec 2018 17:18:55 +0000 (17:18 +0000)]
[GTK] Error writing data to TLS socket in some sites when using the jhbuild
https://bugs.webkit.org/show_bug.cgi?id=192678

Reviewed by Carlos Garcia Campos.

Update our ancient versions of libsoup and glib-networking.

* gtk/install-dependencies:
* gtk/jhbuild.modules:
* gtk/patches/libsoup-auth-Fix-async-authentication-when-flag-SOUP_MESSAGE.patch: Removed.
* gtk/patches/libsoup-auth-do-not-use-cached-credentials-in-lookup-method-.patch: Removed.
* gtk/patches/libsoup-soup-message-io-Do-not-fail-when-there-s-no-empty-li.patch: Removed.
* gtk/patches/libsoup-soup-socket-fix-critical-warning-when-the-peer-certi.patch: Removed.
* wpe/install-dependencies:
* wpe/jhbuild.modules:
* wpe/patches/libsoup-soup-socket-fix-critical-warning-when-the-peer-certi.patch: Removed.

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

8 months ago[LFC][BFC] Transition to logical margin types.
zalan@apple.com [Fri, 14 Dec 2018 16:52:24 +0000 (16:52 +0000)]
[LFC][BFC] Transition to logical margin types.
https://bugs.webkit.org/show_bug.cgi?id=192699

Reviewed by Antti Koivisto.

This is in preparation for moving over to logical types.
(This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/MarginTypes.h:
(WebCore::Layout::VerticalMargin::usedValues const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::hasPrecomputedMarginBefore):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
(WebCore::Layout::hasPrecomputedMarginTop): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::hasMarginBeforeQuirkValue):
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
(WebCore::Layout::hasMarginTopQuirkValue): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginBeforeCollapsedWithSibling):
(WebCore::Layout::isMarginAfterCollapsedWithSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
(WebCore::Layout::isMarginAfterCollapsedThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
(WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
(WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
(WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::rectWithMargin const):
(WebCore::Display::Box::estimatedMarginBefore const):
(WebCore::Display::Box::setEstimatedMarginBefore):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::marginBefore const):
(WebCore::Display::Box::marginStart const):
(WebCore::Display::Box::marginAfter const):
(WebCore::Display::Box::marginEnd const):
(WebCore::Display::Box::nonCollapsedMarginBefore const):
(WebCore::Display::Box::nonCollapsedMarginAfter const):
(WebCore::Display::Box::nonComputedMarginStart const):
(WebCore::Display::Box::nonComputedMarginEnd const):
(WebCore::Display::Box::estimatedMarginTop const): Deleted.
(WebCore::Display::Box::setEstimatedMarginTop): Deleted.
(WebCore::Display::Box::marginTop const): Deleted.
(WebCore::Display::Box::marginLeft const): Deleted.
(WebCore::Display::Box::marginBottom const): Deleted.
(WebCore::Display::Box::marginRight const): Deleted.
(WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
(WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
(WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
(WebCore::Display::Box::nonComputedMarginRight const): Deleted.
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::setHorizontalConstraints):
(WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
(WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::marginBefore const):
(WebCore::Layout::FloatAvoider::marginAfter const):
(WebCore::Layout::FloatAvoider::marginStart const):
(WebCore::Layout::FloatAvoider::marginEnd const):
(WebCore::Layout::FloatAvoider::marginBoxWidth const):
(WebCore::Layout::FloatAvoider::marginTop const): Deleted.
(WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
(WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
(WebCore::Layout::FloatAvoider::marginRight const): Deleted.
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::rect const):
(WebCore::Layout::FloatBox::horizontalPositionCandidate):
(WebCore::Layout::FloatBox::verticalPositionCandidate):
(WebCore::Layout::FloatBox::initialVerticalPosition const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):

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

8 months ago[LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
zalan@apple.com [Fri, 14 Dec 2018 15:22:02 +0000 (15:22 +0000)]
[LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
https://bugs.webkit.org/show_bug.cgi?id=192692

Reviewed by Antti Koivisto.

This is in preparation for completing block margin collapsing.

* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
* layout/LayoutUnits.h:
(WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
* layout/MarginTypes.h: Added.
(WebCore::Layout::VerticalMargin::nonCollapsedValues const):
(WebCore::Layout::VerticalMargin::collapsedValues const):
(WebCore::Layout::VerticalMargin::setCollapsedValues):
(WebCore::Layout::VerticalMargin::VerticalMargin):
(WebCore::Layout::VerticalMargin::usedValues const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setHorizontalNonComputedMargin):
(WebCore::Display::Box::verticalMargin const):
(WebCore::Display::Box::marginTop const):
(WebCore::Display::Box::marginLeft const):
(WebCore::Display::Box::marginBottom const):
(WebCore::Display::Box::marginRight const):
(WebCore::Display::Box::nonCollapsedMarginTop const):
(WebCore::Display::Box::nonCollapsedMarginBottom const):
(WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):

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

8 months ago[GTK][WPE] Fix forwarding webkit socket to flatpak sandbox
commit-queue@webkit.org [Fri, 14 Dec 2018 14:38:48 +0000 (14:38 +0000)]
[GTK][WPE] Fix forwarding webkit socket to flatpak sandbox
https://bugs.webkit.org/show_bug.cgi?id=192622

Patch by Patrick Griffis <pgriffis@igalia.com> on 2018-12-14
Reviewed by Michael Catanzaro.

This fixes running with the sandbox enabled in Flatpak.

* UIProcess/Launcher/glib/FlatpakLauncher.cpp:
(WebKit::flatpakSpawn):
* UIProcess/Launcher/glib/FlatpakLauncher.h:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):

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

8 months ago[WPE] Use new view state API from libwpe
carlosgc@webkit.org [Fri, 14 Dec 2018 12:57:22 +0000 (12:57 +0000)]
[WPE] Use new view state API from libwpe
https://bugs.webkit.org/show_bug.cgi?id=191906

Reviewed by Žan Doberšek.

Source/WebKit:

Remove WKViewSetViewState from the C API.

* UIProcess/API/C/wpe/WKAPICastWPE.h:
* UIProcess/API/C/wpe/WKView.cpp:
* UIProcess/API/C/wpe/WKView.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::View): Add implementation for activity_state_changed vfunc of the view backend client.):
(WKWPE::View::setViewState): Remove the default flags.
* UIProcess/API/wpe/WPEView.h:
(WKWPE::View::setViewState const): Make it private.

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(beforeAll): Enable /webkit/WebKitWebView/page-visibility in WPE.
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebViewBackend): Make the view initially hidden for consistency with GTK+ tests.
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:
* TestWebKitAPI/glib/WebKitGLib/wpe/WebViewTestWPE.cpp:
(WebViewTest::showInWindow): Add wpe_view_activity_state_visible, wpe_view_activity_state_in_window and
wpe_view_activity_state_focused state flags.
(WebViewTest::hideView): Remove wpe_view_activity_state_visible and wpe_view_activity_state_focused state flags.
* wpe/backends/HeadlessViewBackend.cpp:
(WPEToolingBackends::HeadlessViewBackend::HeadlessViewBackend): Assume view is always visible, focused and in window.
* wpe/backends/WindowViewBackend.cpp:
(WPEToolingBackends::WindowViewBackend::WindowViewBackend): Update the view state flags depending on state
received in configure callback.
* wpe/jhbuild.modules: Bump libwpe to 1.1.0

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

8 months ago[GLib] RunLoop::dispatchAfter() GSource requires microsecond precision
zandobersek@gmail.com [Fri, 14 Dec 2018 12:14:40 +0000 (12:14 +0000)]
[GLib] RunLoop::dispatchAfter() GSource requires microsecond precision
https://bugs.webkit.org/show_bug.cgi?id=192696

Reviewed by Michael Catanzaro.

The GSource we set up in GLib's RunLoop::dispatchAfter() implementation
should support microsecond-precision delays. Such delays are common in
JSC's Watchdog implementation and missing support for them has been
causing test failures in the `testapi` program as well as some JSC
tests that depend on the termination determination functionality of the
JSC::Watchdog class.

RunLoop::dispatchAfter() is changed to spawn a raw GSource that uses the
existing GSourceFuncs implementation used elsewhere in GLib's RunLoop.
The GSource's ready time is set manually, now with the necessary
microsecond precision.

* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::dispatchAfter):

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

8 months ago[Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
Hironori.Fujii@sony.com [Fri, 14 Dec 2018 08:09:53 +0000 (08:09 +0000)]
[Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
https://bugs.webkit.org/show_bug.cgi?id=192693

Reviewed by Ross Kirsling.

No new tests, no behavior changes.

* platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
* platform/win/CursorWin.cpp:
(WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
* platform/win/DefWndProcWindowClass.cpp:
(WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
* platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
* platform/win/PasteboardWin.cpp:
(WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
(WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
* platform/win/PlatformMouseEventWin.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
* platform/win/PopupMenuWin.h: Marked override methods with 'override'.
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace.
(WebCore::signedPublicKeyAndChallengeString): Ditto.
* platform/win/SearchPopupMenuDB.cpp:
(WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT.
* platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86).
* platform/win/SystemInfo.cpp:
(WebCore::osVersionForUAString): Added default case.

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

8 months ago[WinCairo][Clang] DLLLauncherMain.cpp: warning: unused function 'prependPath' and...
Hironori.Fujii@sony.com [Fri, 14 Dec 2018 07:54:59 +0000 (07:54 +0000)]
[WinCairo][Clang] DLLLauncherMain.cpp: warning: unused function 'prependPath' and 'appleApplicationSupportDirectory'
https://bugs.webkit.org/show_bug.cgi?id=192688

Reviewed by Ross Kirsling.

Source/JavaScriptCore:

These functions are used only in AppleWin port.

* shell/DLLLauncherMain.cpp:
(copyEnvironmentVariable): Moved.
(getStringValue): Enclosed with #if !defined(WIN_CAIRO).
(applePathFromRegistry): Ditto.
(appleApplicationSupportDirectory): Ditto.
(prependPath): Ditto.

Tools:

* win/DLLLauncher/DLLLauncherMain.cpp:
(copyEnvironmentVariable): Moved.
(getStringValue): Enclosed with #if !defined(WIN_CAIRO).
(applePathFromRegistry): Ditto.
(appleApplicationSupportDirectory): Ditto.
(prependPath): Ditto.

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

8 months agoImprove GDB output for LLInt on Linux
dinfuehr@igalia.com [Fri, 14 Dec 2018 07:17:32 +0000 (07:17 +0000)]
Improve GDB output for LLInt on Linux
https://bugs.webkit.org/show_bug.cgi?id=192660

Reviewed by Yusuke Suzuki.

Annotate assembly code generated for LLInt with the bytecode operation. When debugging
LLInt assembly code GDB is then able to show which bytecode instruction is implemented by
the current assembly code. This also works for linux-perf.

* llint/LowLevelInterpreter.cpp:
* offlineasm/arm.rb:

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

8 months agoAdd a missing exception check.
mark.lam@apple.com [Fri, 14 Dec 2018 05:21:35 +0000 (05:21 +0000)]
Add a missing exception check.
https://bugs.webkit.org/show_bug.cgi?id=192626
<rdar://problem/46662163>

Reviewed by Keith Miller.

JSTests:

* stress/regress-192626.js: Added.

Source/JavaScriptCore:

* runtime/ScopedArguments.h:

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

8 months ago[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIn...
cdumez@apple.com [Fri, 14 Dec 2018 04:39:11 +0000 (04:39 +0000)]
[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
https://bugs.webkit.org/show_bug.cgi?id=192689
<rdar://problem/46323610>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-13
Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
* UIProcess/WebPageProxy.h:
Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
which broadcasts it as a remote inspector target. Terminate this
as soon as the WebPageProxy closes and becomes invalid.

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

8 months ago[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIn...
commit-queue@webkit.org [Fri, 14 Dec 2018 04:09:59 +0000 (04:09 +0000)]
[iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication
https://bugs.webkit.org/show_bug.cgi?id=192689
<rdar://problem/46323610>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-12-13
Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
* UIProcess/WebPageProxy.h:
Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable
which broadcasts it as a remote inspector target. Terminate this
as soon as the WebPageProxy closes and becomes invalid.

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

8 months agoThe JSC shell should listen for memory pressure events and respond to them
sbarati@apple.com [Fri, 14 Dec 2018 04:05:41 +0000 (04:05 +0000)]
The JSC shell should listen for memory pressure events and respond to them
https://bugs.webkit.org/show_bug.cgi?id=192647

Reviewed by Keith Miller.

Source/JavaScriptCore:

We want the JSC shell to behave more like the WebContent process when
it comes to running performance tests. One way to make the shell
more like this is to have it respond to memory pressure events in
a similar way as the WebContent process. This makes it easier to run
benchmarks like JetStream2 on the CLI on iOS.

* jsc.cpp:
(jscmain):
* runtime/VM.cpp:
(JSC::VM::drainMicrotasks):
* runtime/VM.h:
(JSC::VM::setOnEachMicrotaskTick):

Source/WTF:

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::MemoryPressureHandler):
(WTF::MemoryPressureHandler::setDispatchQueue):
Make it so that we can customize which dispatch queue memory pressure
events get handled on.

* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::setShouldLogMemoryMemoryPressureEvents):
Make it so that we can disable logging that happens on each memory
pressure event.

* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
(WTF::MemoryPressureHandler::uninstall):
(WTF::MemoryPressureHandler::holdOff):

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

8 months agoUnreviewed build fix for tvOS.
cdumez@apple.com [Fri, 14 Dec 2018 03:48:34 +0000 (03:48 +0000)]
Unreviewed build fix for tvOS.

* Platform/cocoa/WKCrashReporter.mm:

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

8 months agoUnreviewed. Changed my status to a reviewer.
Hironori.Fujii@sony.com [Fri, 14 Dec 2018 02:47:15 +0000 (02:47 +0000)]
Unreviewed. Changed my status to a reviewer.

Patch by Don Olmstead <don.olmstead@sony.com> on 2018-12-13

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

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

8 months agoRTCRtpTransceiver.stopped should be true when applying a remote description with...
youenn@apple.com [Fri, 14 Dec 2018 02:19:20 +0000 (02:19 +0000)]
RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
https://bugs.webkit.org/show_bug.cgi?id=192685

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html:

Source/WebCore:

In case the remote description contains a rejected m section,
the corresponding transceiver should be marked as stopped.
Libwebrtc backend has that information so pipe it up to JS.

Covered by updated WPT test.

* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::stopped const):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::stopped const): Deleted.
* Modules/mediastream/RTCRtpTransceiverBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
(WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:

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

8 months agoEnsure that StructureFlags initialization always starts with Base::StructureFlags.
mark.lam@apple.com [Fri, 14 Dec 2018 02:14:28 +0000 (02:14 +0000)]
Ensure that StructureFlags initialization always starts with Base::StructureFlags.
https://bugs.webkit.org/show_bug.cgi?id=192686

Reviewed by Keith Miller.

Source/JavaScriptCore:

This is purely a refactoring effort to make the code consistently start all
StructureFlags initialization with Base::StructureFlags.  Previously, sometimes
Base::StructureFlags is appended at the end, and sometimes, it is expressed using
the name of the superclass.  This patch makes the code all consistent and easier
to do a quick eye scan audit on to verify that no StructureFlags are forgetting
to inherit Base::StructureFlags.

Also added a static_assert in JSCallbackObject.h and JSBoundFunction.h.  Both of
these implement a customHasInstance() method, and rely on ImplementsHasInstance
being included in the StructureFlags, and conversely, ImplementsDefaultHasInstance
has to be excluded.

JSBoundFunction.h is the only case where a bit (ImplementsDefaultHasInstance)
needs to be masked out of the inherited Base::StructureFlags.

* API/JSCallbackObject.h:
* runtime/ArrayConstructor.h:
* runtime/ArrayIteratorPrototype.h:
* runtime/Exception.h:
* runtime/FunctionRareData.h:
* runtime/InferredType.h:
* runtime/InferredTypeTable.h:
* runtime/InferredValue.h:
* runtime/JSBoundFunction.h:
* runtime/MapPrototype.h:
* runtime/SetPrototype.h:
* runtime/StringPrototype.h:
* runtime/SymbolConstructor.h:

Source/WebCore:

No new tests needed because there's no new functionality.  Just refactoring.

* bindings/js/JSDOMWindowProperties.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePrototypeDeclaration):
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestEnabledBySetting.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestPluginInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.h:

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

8 months agoMake HTMLConverter work across shadow boundaries
rniwa@webkit.org [Fri, 14 Dec 2018 01:45:24 +0000 (01:45 +0000)]
Make HTMLConverter work across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=192640

Reviewed by Wenson Hsieh.

Source/WebCore:

Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions.

Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html
       editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html

* dom/Position.cpp:
(WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter
and serializePreservingVisualAppearanceInternal.
* dom/Position.h:
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::convert):
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverterCaches::floatPropertyValueForNode):
(HTMLConverter::_blockLevelElementForNode):
(HTMLConverterCaches::colorPropertyValueForNode):
(HTMLConverter::aggregatedAttributesForAncestors):
(HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
(HTMLConverter::_processElement):
(HTMLConverter::_traverseNode):
(HTMLConverter::_traverseFooterNode):
(HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
(WebCore::attributedStringFromSelection):
* editing/markup.cpp:
(WebCore::commonShadowIncludingAncestor): Moved to Position.cpp.

LayoutTests:

Added tests for generating attributed string out across shadow boundaries based on the tests
of respective names in editing/pasteboard.

* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html: Added.
* editing/mac/attributed-string/resources/dump-attributed-string.js:
(window.dumpAttributedString): Now takes start and end containers and offsets.
(serializeSubtreeWithShadow): Added. This function serializes the content of shadow roots along with
start and end markers.
(serializeSubtreeWithShadow.serializeCharacterData): Added.
(serializeSubtreeWithShadow.serializeNode): Added.
(serializeSubtreeWithShadow.serializeChildNodes): Added.
(serializeSubtreeWithShadow.serializeShadowRootAndChildNodes): Added.
(dumpAttributedString): Deleted.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2-expected.txt: Added.

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

8 months agoTrying to play a media element synchronously after setting srcObject should succeed...
youenn@apple.com [Fri, 14 Dec 2018 01:17:57 +0000 (01:17 +0000)]
Trying to play a media element synchronously after setting srcObject should succeed without user gesture
https://bugs.webkit.org/show_bug.cgi?id=192679

Reviewed by Eric Carlson.

Source/WebCore:

Check the srcObject mediaProvider value which is set synchronously.
Covered by updated fast/mediastream/local-audio-playing-event.html.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):

LayoutTests:

* fast/mediastream/local-audio-playing-event-expected.txt:
* fast/mediastream/local-audio-playing-event.html:

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

8 months agoAdd the JSC_traceBaselineJITExecution option for tracing baseline JIT execution.
mark.lam@apple.com [Fri, 14 Dec 2018 00:53:11 +0000 (00:53 +0000)]
Add the JSC_traceBaselineJITExecution option for tracing baseline JIT execution.
https://bugs.webkit.org/show_bug.cgi?id=192684

Reviewed by Saam Barati.

This dataLogs the bytecode execution order of baseline JIT code when the
JSC_traceBaselineJITExecution option is true.

* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* runtime/Options.h:

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

8 months agoclang-tidy: Fix unnecessary object copies in JavaScriptCore
ddkilzer@apple.com [Fri, 14 Dec 2018 00:19:23 +0000 (00:19 +0000)]
clang-tidy: Fix unnecessary object copies in JavaScriptCore
<https://webkit.org/b/192680>
<rdar://problem/46708767>

Reviewed by Mark Lam.

* assembler/testmasm.cpp:
(JSC::invoke):
- Make MacroAssemblerCodeRef<JSEntryPtrTag> argument a const
  reference.

* b3/testb3.cpp:
(JSC::B3::checkDisassembly):
- Make CString argument a const reference.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStringEquality):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
- Make JITCompiler::JumpList arguments a const reference.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::checkStructure):
- Make RegisteredStructureSet argument a const reference.

* jsc.cpp:
(GlobalObject::moduleLoaderImportModule): Make local auto
variables const references.
(Workers::report): Make String argument a const reference.
(addOption): Make Identifier argument a const reference.
(runJSC): Make CString loop variable a const reference.

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

8 months agoVersioning.
kocsen_chung@apple.com [Fri, 14 Dec 2018 00:18:54 +0000 (00:18 +0000)]
Versioning.

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

8 months agoVerify that tryLargeZeroedMemalignVirtual()'s aligned size and alignment values are...
mark.lam@apple.com [Fri, 14 Dec 2018 00:13:21 +0000 (00:13 +0000)]
Verify that tryLargeZeroedMemalignVirtual()'s aligned size and alignment values are valid.
https://bugs.webkit.org/show_bug.cgi?id=192682
<rdar://problem/37751522>

Reviewed by Saam Barati.

* bmalloc/bmalloc.cpp:
(bmalloc::api::tryLargeZeroedMemalignVirtual):

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

8 months ago[iOS] Support dropping contact card data (public.vcard) in editable content
wenson_hsieh@apple.com [Thu, 13 Dec 2018 23:25:20 +0000 (23:25 +0000)]
[iOS] Support dropping contact card data (public.vcard) in editable content
https://bugs.webkit.org/show_bug.cgi?id=192570
<rdar://problem/35626913>

Reviewed by Tim Horton.

Source/WebCore:

Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details.

Tests:  DragAndDropTests.ExternalSourceContactIntoEditableAreas
        DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea
        DragAndDropTests.ExternalSourceMapItemIntoEditableAreas
        WKAttachmentTestsIOS.InsertDroppedContactAsAttachment
        WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment

* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attachmentForFilePath):

Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths`
as well as `readVirtualContactFile`.

(WebCore::WebContentReader::readFilePaths):
(WebCore::WebContentReader::readVirtualContactFile):

Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting
fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is
empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a
contact, there is no associated URL, so we only have an attachment.

* platform/Pasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readPasteboardWebContentDataForType):

Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for
"public.vcard" data, which is then passed on to the web content reader. Additionally, by returning
`ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents
of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since
"public.vcard" conforms to "public.text").

(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
* platform/ios/WebItemProviderPasteboard.mm:
(-[NSItemProvider web_fileUploadContentTypes]):

Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is
tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only
suitable for deserialization into an `MKMapItem`.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:

Add API tests to verify that registering `MKMapItem`s and `CNContact`s to item providers and dropping them in
attachment-enabled rich text editable areas inserts attachment elements (and in the case of `MKMapItem`,
additionally inserts a link).

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::createMapItemForTesting):
(TestWebKitAPI::createContactItemForTesting):

Add API tests to verify that dropping map items and contact items into rich and plain editable areas behaves as
expected (in the case where a URL is present, e.g. dropping a map item, we insert the URL as an anchor, and when
there is no other suitable representation in the item provider, we do nothing at all, which is the case for the
dropped `CNContact`). Also, add a test to verify that drag and drop can be used to upload these items as .vcf
files.

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

8 months agoWeb Inspector: remove DOM.BackendNodeId and associated commands/events
drousso@apple.com [Thu, 13 Dec 2018 23:20:35 +0000 (23:20 +0000)]
Web Inspector: remove DOM.BackendNodeId and associated commands/events
https://bugs.webkit.org/show_bug.cgi?id=192478

Reviewed by Matt Baker.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:

Source/WebCore:

Removing unused code, so no change in functionality.

* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::discardBindings):
(WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted.
(WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted.
(WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted.

Source/WebInspectorUI:

* Versions/Inspector-iOS-8.0.json:
* Versions/Inspector-iOS-9.0.json:
* Versions/Inspector-iOS-9.3.json:
* Versions/Inspector-iOS-10.0.json:
* Versions/Inspector-iOS-10.3.json:
* Versions/Inspector-iOS-11.0.json:
* Versions/Inspector-iOS-11.3.json:
* Versions/Inspector-iOS-12.0.json:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:

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

8 months ago[PSON] We should not need to navigate to 'about:blank' to suspend pages
cdumez@apple.com [Thu, 13 Dec 2018 23:17:44 +0000 (23:17 +0000)]
[PSON] We should not need to navigate to 'about:blank' to suspend pages
https://bugs.webkit.org/show_bug.cgi?id=192668
<rdar://problem/46701466>

Reviewed by Alex Christensen.

Source/WebCore:

* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable):
* history/PageCache.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::stopAllLoaders):
(WebCore::FrameLoader::setDocumentLoader):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
* loader/FrameLoaderTypes.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/PolicyChecker.h:

Source/WebKit:

To support PageCache when process-swap on cross-site navigation is enabled,
we've been navigating the previous process to 'about:blank' when swapping.
This would trigger PageCaching of the page in the old process. While
convenient, this design has led to a lot of bugs because we did not really
want a navigation to happen in the old process.

To address the issue, when a WebPage is asked to suspend (for process-swap),
we now attempt to add it to PageCache and save it on the current HistoryItem,
*without* triggering any navigation. Any pending navigation gets cancelled
and we just suspend in place.

Later on, when we want to go back to this HistoryItem, we simply leverage the
existing WebPage::goToBackForwardItem() code path. The only subtlety is that
we're actually asking the WebPage to load a HistoryItem that is the current
one in the History. I had to tweak a some logic / assertions to support this
as this is not something we usually do. However, it actually works with very
little changes and successfully restores the PageCache entry on the current
HistoryItem.

There is no expected overall behavior change and ProcessSwap API tests (which
cover PageCache) still pass. This is merely a simpler design because it avoids
navigating to about:blank.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::didSuspend):
(WebKit::SuspendedPageProxy::didReceiveMessage):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didSuspendAfterProcessSwap):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebPage/WebDocumentLoader.cpp:
(WebKit::WebDocumentLoader::setNavigationID):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
* WebProcess/WebPage/WebPage.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::origin):

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

8 months ago[macOS] Inline WebVTT styles should override styles from Captions settings in System...
pvollan@apple.com [Thu, 13 Dec 2018 23:06:49 +0000 (23:06 +0000)]
[macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences
https://bugs.webkit.org/show_bug.cgi?id=192638

Reviewed by Eric Carlson.

Source/WebCore:

It is currently not possible to override caption styles generated from System Preferences with inline
WebVTT styles without adding !important. The reason for this is that the generated styles from
System preferences are author styles which have higher priority than the inline WebVTT styles, which
are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated
styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since
they are added after the generated styles. This patch also fixes a problem where inline styles could be
added twice to the video user agent shadow root.

Test: media/track/track-cue-css.html

* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::getDisplayTree):
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
* page/Page.cpp:
(WebCore::Page::setCaptionUserPreferencesStyleSheet):

LayoutTests:

* media/track/captions-webvtt/css-styling.vtt:
* media/track/captions-webvtt/no-css-styling.vtt:
* media/track/track-css-user-override-expected.txt:
* media/track/track-css-user-override.html:
* media/track/track-cue-css-expected.html:

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

8 months agoFix leak of AVPlayer boundaryTimeObserver object.
jer.noble@apple.com [Thu, 13 Dec 2018 22:32:29 +0000 (22:32 +0000)]
Fix leak of AVPlayer boundaryTimeObserver object.
https://bugs.webkit.org/show_bug.cgi?id=192674

Reviewed by Eric Carlson.

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

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

8 months agoWeb Inspector: experimental settings reload button disappears after changing more...
drousso@apple.com [Thu, 13 Dec 2018 22:31:25 +0000 (22:31 +0000)]
Web Inspector: experimental settings reload button disappears after changing more than one setting
https://bugs.webkit.org/show_bug.cgi?id=192645
<rdar://problem/46626204>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView.listenForChange):
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

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

8 months agoWeb Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't...
mattbaker@apple.com [Thu, 13 Dec 2018 22:29:07 +0000 (22:29 +0000)]
Web Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't select the nearest node after deletion
https://bugs.webkit.org/show_bug.cgi?id=192116
<rdar://problem/46344339>

Reviewed by Devin Rousso.

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.removeSelectedItems):
Finding a new index to select should go through the delegate instead of
naively advancing the index.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._populateNodeContextMenu):
(WI.DOMTreeElement.prototype.ondelete): Deleted.
The menu item for removing the DOM node is now managed by the parent
DOMTreeOutline, since its UI and behavior now depend on whether there
are multiple elements selected.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
(WI.DOMTreeOutline.prototype.ondelete.level):
(WI.DOMTreeOutline.prototype.ondelete):
Implement `ondelete` to remove selected DOM nodes using the delete and
backspace keys. Also used by the DOMTreeOutline's context menu handler.

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

8 months agoclang-tidy: Fix unnecessary parameter copies in ParallelHelperPool.cpp
ddkilzer@apple.com [Thu, 13 Dec 2018 20:49:10 +0000 (20:49 +0000)]
clang-tidy: Fix unnecessary parameter copies in ParallelHelperPool.cpp
<https://webkit.org/b/192666>
<rdar://problem/46697952>

Reviewed by Alex Christensen.

* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::ParallelHelperClient): Use rvalue
reference and WTFMove().
(WTF::ParallelHelperClient::setTask): Ditto.
(WTF::ParallelHelperClient::runTaskInParallel): Ditto.
(WTF::ParallelHelperClient::runTask): Use const reference.
* wtf/ParallelHelperPool.h: Update declarations to match
implementations.

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