WebKit-https.git
6 months agoiOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture
rniwa@webkit.org [Thu, 31 Jan 2019 08:40:58 +0000 (08:40 +0000)]
iOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture
https://bugs.webkit.org/show_bug.cgi?id=194083

Reviewed by Tim Horton.

We think this crash is a regression from r236966. Prior to r236966, we could only called
removeSwipeSnapshot() only when m_provisionalOrSameDocumentLoadCallback was set but now
we can call it either when m_snapshotRemovalTracker::start was called, or it had been reset.
This can result in m_webPageProxyForBackForwardListForCurrentSwipe getting cleared before
InteractiveUpdateHandler is called by UIGestureRecognizer, resulting in the crash.

This patch tries to restore the behavior prior to r236966 by only invoking removeSwipeSnapshot()
when SnapshotRemovalTracker has a valid removal callback set.

Unfortunately no new tests since there is no reproducible test case, and neither API tests
nor layout tests seem to have the capability to trigger swipe gestures via UIGestureRecognizer,
which is required for this crash to occur. Notably, back-forward swipe tests I enabled in
r240765 bypass UIKit and emulates the action instead.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
* UIProcess/Cocoa/ViewGestureController.h:
(WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):

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

6 months agoREGRESSION (r240358): IndexedDB/large-binary-keys.html and IndexedDB/large-string...
sihui_liu@apple.com [Thu, 31 Jan 2019 08:06:16 +0000 (08:06 +0000)]
REGRESSION (r240358): IndexedDB/large-binary-keys.html and IndexedDB/large-string-keys.html perf tests failing
https://bugs.webkit.org/show_bug.cgi?id=193956
<rdar://problem/47623109>

Reviewed by Ryosuke Niwa.

r240358 sets default IDB quota as 50 MB for single test, we need to increase that for big tests.

* IndexedDB/large-binary-keys.html:
* IndexedDB/large-string-keys.html:

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

6 months ago[JSC] Symbol should be in destructibleCellSpace
ysuzuki@apple.com [Thu, 31 Jan 2019 07:42:41 +0000 (07:42 +0000)]
[JSC] Symbol should be in destructibleCellSpace
https://bugs.webkit.org/show_bug.cgi?id=194082

Reviewed by Saam Barati.

Because Symbol's member was not poisoned, we changed the subspace for Symbol from destructibleCellSpace
to cellJSValueOOBSpace. But the problem is cellJSValueOOBSpace is a space for cells which are not
destructible. As a result, Symbol::destroy is never called, and SymbolImpl is leaked. This patch makes
Symbol's space destructibleCellSpace to appropriately call the destructor.

* runtime/Symbol.h:

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

6 months agoEnable swipe tests on iOS
rniwa@webkit.org [Thu, 31 Jan 2019 07:31:21 +0000 (07:31 +0000)]
Enable swipe tests on iOS
https://bugs.webkit.org/show_bug.cgi?id=194076

Reviewed by Geoffrey Garen.

Tools:

Removed the superflous call to prepareForAsyncTask and asyncTaskComplete as
it causes a debug assertion failure in runUIScript.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::beginBackSwipe):
(WTR::UIScriptController::completeBackSwipe):

LayoutTests:

Enabled tests in LayoutTests/swipe and added iOS specific results for the failing tests.

* platform/ios/TestExpectations:
* platform/ios/swipe/basic-cached-back-swipe-expected.txt: Added.
* platform/ios/swipe/main-frame-pinning-requirement-expected.txt: Added.
* platform/ios/swipe/pushState-cached-back-swipe-expected.txt: Added.

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

6 months agoWeb Inspector: Memory Timeline View should be responsive / resizable
drousso@apple.com [Thu, 31 Jan 2019 06:52:35 +0000 (06:52 +0000)]
Web Inspector: Memory Timeline View should be responsive / resizable
https://bugs.webkit.org/show_bug.cgi?id=153758
<rdar://problem/24444320>

Reviewed by Joseph Pecoraro.

Leverage the SVG `viewBox` (which was misspelled) to scale the graphs when the width of the
container changes. The `viewBox` used is equal to the total amount of time that is visible.

Make `WI.LineChart` (and its container classes) into subclasses of `WI.View` to leverage the
existing layout system.

Prevent any work from being done when resizing, as this is now handled by CSS/SVG.

* UserInterface/Views/LineChart.js:
(WI.LineChart):
(WI.LineChart.prototype.set size):
(WI.LineChart.prototype.addPoint):
(WI.LineChart.prototype.clear):
(WI.LineChart.prototype.layout):
(WI.LineChart.prototype.get element): Deleted.
(WI.LineChart.prototype.get points): Deleted.
(WI.LineChart.prototype.needsLayout): Deleted.
(WI.LineChart.prototype.updateLayout): Deleted.

* UserInterface/Views/CPUUsageView.js:
(WI.CPUUsageView):
(WI.CPUUsageView.prototype.clear):
(WI.CPUUsageView.prototype.updateChart): Added.
(WI.CPUUsageView.prototype.get element): Deleted.
(WI.CPUUsageView.prototype.layoutWithDataPoints): Deleted.
* UserInterface/Views/CPUUsageView.css:
(.cpu-usage-view):
(.cpu-usage-view > .details):
(.cpu-usage-view > .graph, .cpu-usage-view > .graph > .line-chart, .cpu-usage-view > .graph > .line-chart > svg): Added.
(.cpu-usage-view > .graph): Deleted.

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView):
(WI.CPUTimelineView.prototype.layout):
(WI.CPUTimelineView.prototype.layout.layoutView):
(WI.CPUTimelineView.prototype.layout.layoutView.xScale):
(WI.CPUTimelineView.prototype.layout.layoutView.yScale):
* UserInterface/Views/CPUTimelineView.css:
(body .timeline-view.cpu): Added.
(.timeline-view.cpu > .content):
(.timeline-view.cpu): Deleted.

* UserInterface/Views/MemoryCategoryView.js:
(WI.MemoryCategoryView):
(WI.MemoryCategoryView.prototype.clear):
(WI.MemoryCategoryView.prototype.updateChart): Added.
(WI.MemoryCategoryView.prototype.get element): Deleted.
(WI.MemoryCategoryView.prototype.layoutWithDataPoints): Deleted.
* UserInterface/Views/MemoryCategoryView.css:
(.memory-category-view):
(.memory-category-view > .details):
(.memory-category-view > .graph, .memory-category-view > .graph > .line-chart, .memory-category-view > .graph > .line-chart > svg): Added.
(.memory-category-view > .graph): Deleted.

* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView.prototype.layout):
(WI.MemoryTimelineView.prototype.layout.layoutCategoryView):
(WI.MemoryTimelineView.prototype.layout.layoutCategoryView.xScale):
(WI.MemoryTimelineView.prototype.layout.layoutCategoryView.yScale):
(WI.MemoryTimelineView.prototype._initializeCategoryViews):
(WI.MemoryTimelineView.prototype._initializeCategoryViews.appendLegendRow):
* UserInterface/Views/MemoryTimelineView.css:
(.timeline-view.memory > .content > .overview):
(.timeline-view.memory > .content > .overview > .divider):
(.timeline-view.memory > .content > .overview .total-usage, .timeline-view.memory > .content > .overview .max-percentage, .timeline-view.memory > .content > .overview .legend .size): Added.
(.timeline-view.memory .legend):
(.timeline-view.memory .legend .row): Added.
(.timeline-view.memory .legend .row + .row): Added.
(.timeline-view.memory .legend .swatch): Addd.
(.timeline-view.memory .legend .swatch.javascript): Addd.
(.timeline-view.memory .legend .swatch.images): Addd.
(.timeline-view.memory .legend .swatch.layers): Addd.
(.timeline-view.memory .legend .swatch.page): Addd.
(.timeline-view.memory .legend .swatch.current): Addd.
(.timeline-view.memory > .content): Deleted.
(.timeline-view.memory > .content > .overview .total-usage, .timeline-view.memory > .content > .overview .max-percentage):
(body[dir=ltr] .timeline-view.memory .legend): Deleted.
(body[dir=rtl] .timeline-view.memory .legend): Deleted.
(.timeline-view.memory .legend > .row): Deleted.
(.timeline-view.memory .legend > .row > .swatch): Deleted.
(body[dir=ltr] .timeline-view.memory .legend > .row > .swatch): Deleted.
(body[dir=rtl] .timeline-view.memory .legend > .row > .swatch): Deleted.
(.timeline-view.memory .legend > .row > p): Deleted.
(body[dir=ltr] .timeline-view.memory .legend > .row > :matches(.label, .size)): Deleted.
(body[dir=rtl] .timeline-view.memory .legend > .row > :matches(.label, .size)): Deleted.
(.timeline-view.memory .legend > .row > .label): Deleted.
(.timeline-view.memory .legend > .row > .size): Deleted.
(.timeline-view.memory .legend > .row > .swatch.javascript): Deleted.
(.timeline-view.memory .legend > .row > .swatch.images): Deleted.
(.timeline-view.memory .legend > .row > .swatch.layers): Deleted.
(.timeline-view.memory .legend > .row > .swatch.page): Deleted.
(.timeline-view.memory .legend > .row > .swatch.current): Deleted.

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

6 months agoUnreviewed, rolling out r240755.
mcatanzaro@igalia.com [Thu, 31 Jan 2019 05:04:31 +0000 (05:04 +0000)]
Unreviewed, rolling out r240755.

This was not correct

Reverted changeset:

"Unreviewed, fix GCC build after r240730"
https://bugs.webkit.org/show_bug.cgi?id=194041
https://trac.webkit.org/changeset/240755

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

6 months ago<rdar://problem/47570443> Responsiveness timers are too expensive for frequent events
benjamin@webkit.org [Thu, 31 Jan 2019 04:53:34 +0000 (04:53 +0000)]
<rdar://problem/47570443> Responsiveness timers are too expensive for frequent events
https://bugs.webkit.org/show_bug.cgi?id=194003

Reviewed by Geoffrey Garen.

The problem here is specific to wheel events.

For every wheel event, we start a responsiveness timer and send
a ping to the WebProcess. When the WebProcess respond, we stop the timer.

The cost of setting up the timers adds up since we get many events.

The first step to improve the situation was to switch ResponsivenessTimer
to WebCore::Timer. Since WebCore::Timer reuse the same CFRunLoopTimerRef,
we save the allocation/deallocation, insertion in the event loop, etc.

Using WebCore::Timer saves some instructions but we were still hitting
the kernel at 120hz to set up then kill each timer.
The second improvement of the patch is to avoid that by not killing the timer
when we hear back from the WebProcess.

Instead of killing the timer, we let it run and ignore the result.
When the next event comes, we reschedule the existing timer.
This brings down the timers to 60Hz, the same rate as the events.

The very last event does time out. In that case, we have a bad idle wake up:
we wake up a sleeping CPU do do nothing.
In the case of wheel events, this is fine since we saved a bunch of CPU already.
For all the other cases, I kept the normal operating mode to avoid the idle wake.

* UIProcess/ResponsivenessTimer.cpp:
(WebKit::ResponsivenessTimer::ResponsivenessTimer):
(WebKit::ResponsivenessTimer::invalidate):
(WebKit::ResponsivenessTimer::timerFired):
(WebKit::ResponsivenessTimer::start):
(WebKit::ResponsivenessTimer::startWithLazyStop):
(WebKit::ResponsivenessTimer::stop):
(WebKit::ResponsivenessTimer::processTerminated):
(WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
* UIProcess/ResponsivenessTimer.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sendWheelEvent):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::isResponsiveWithLazyStop):
* UIProcess/WebProcessProxy.h:

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

6 months agoUse correct printf format specifier
krollin@apple.com [Thu, 31 Jan 2019 04:49:57 +0000 (04:49 +0000)]
Use correct printf format specifier
https://bugs.webkit.org/show_bug.cgi?id=194062
<rdar://problem/47686167>

Reviewed by Alexey Proskuryakov.

LayoutTestSpellChecker.mm is trying to format a variable of type
NSTextCheckingType with %tu (unsigned ptrdiff_t), when the type is
actually an unsigned long long. Fix this by formatting with %llu.

* TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
(-[LayoutTestTextCheckingResult description]):

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

6 months ago[iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard...
dbates@webkit.org [Thu, 31 Jan 2019 04:41:35 +0000 (04:41 +0000)]
[iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard on support.apple.com
https://bugs.webkit.org/show_bug.cgi?id=193987
<rdar://problem/47230785>

Reviewed by Tim Horton.

It is unnecessary to relinquish first responder status when a user explicitly dismissing
the keyboard. Moreover, doing so prevents key commands from being intercepted when a
hardware keyboard is subsequently attached.

Following r238635 a page becomes focused (accepting of keyboard input) and defocused
when the WKContentView becomes first responder and resigns first responder, respectively.
When a user explicitly dismisses the keyboard by tapping Done (iPhone) or the hide keyboard
button (iPad) then UIKit tells WKContentView to resign its first responder status only
to make its superview, WKWebView, first responder. When a person subsequently taps on the
page again, the WKContentView requests to become the first responder. However changes to
page focus are not guaranteed to be sent to the WebProcess immediately (WebPageProxy::activityStateDidChange()
will schedule an update). In particular, they are not guaranteed to be sent before the
WebProcess is told about a tap. Therefore, the WebProcess has out-of-date information on
focus state of the page. Instead we should detect when WKWebView is being asked to resign
as a result of the keyboard dismissal and refuse the request, taking care to end the current
editing session, blur the focused element, and dismiss the on-screen keyboard.

* Platform/spi/ios/UIKitSPI.h: Expose some SPI.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]): Register to receive notifications whenever a user
explicitly dismisses the keyboard.
(-[WKContentView resignFirstResponderForWebView]): If we are being asked to resign as a
result of a user explicitly dismissing the keyboard then refuse to resign.
(-[WKContentView _keyboardDidRequestDismissal:]): Update state, if applicable.

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

6 months agoREGRESSION(r240541): WebKit.WebsitePoliciesCustomJavaScriptUserAgent is failing since...
rniwa@webkit.org [Thu, 31 Jan 2019 03:56:19 +0000 (03:56 +0000)]
REGRESSION(r240541): WebKit.WebsitePoliciesCustomJavaScriptUserAgent is failing since introduction on iOS
https://bugs.webkit.org/show_bug.cgi?id=193979

Reviewed by Wenson Hsieh.

Fix the test for iOS. Make the test work with iOS UA string.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:

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

6 months agoUnreviewed, fix GCC build after r240730
mcatanzaro@igalia.com [Thu, 31 Jan 2019 03:27:59 +0000 (03:27 +0000)]
Unreviewed, fix GCC build after r240730
https://bugs.webkit.org/show_bug.cgi?id=194041
<rdar://problem/47680981>

* disassembler/udis86/ud_itab.py:
(UdItabGenerator.genOpcodeTablesLookupIndex):

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

6 months agoImport latest Test262 updates.
ross.kirsling@sony.com [Thu, 31 Jan 2019 03:16:42 +0000 (03:16 +0000)]
Import latest Test262 updates.

Rubber-stamped by Keith Miller.

* test262.yaml: Deleted.
* test262/config.yaml:
* test262/expectations.yaml:
* test262/latest-changes-summary.txt:
* test262/test/:
* test262/test262-Revision.txt:

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

6 months agotestapi's `testBytecodeCache` does not need to run the code twice
tzagallo@apple.com [Thu, 31 Jan 2019 03:07:56 +0000 (03:07 +0000)]
testapi's `testBytecodeCache` does not need to run the code twice
https://bugs.webkit.org/show_bug.cgi?id=194046

Reviewed by Mark Lam.

Since we populate the cache eagerly (unlike the stress tests) we don't
need to run the code twice.

* API/tests/testapi.mm:
(testBytecodeCache):

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

6 months ago[WebAssembly] Change BBQ to generate Air IR
sbarati@apple.com [Thu, 31 Jan 2019 02:49:36 +0000 (02:49 +0000)]
[WebAssembly] Change BBQ to generate Air IR
https://bugs.webkit.org/show_bug.cgi?id=191802
<rdar://problem/47651718>

Reviewed by Keith Miller.

This patch adds a new Wasm compiler for the BBQ tier. Instead
of compiling using  B3-01, we now generate Air code directly.
The goal of doing this was to speed up compile times for Wasm
programs.

This patch provides us with a 20-30% compile time speedup. However, I
have ideas on how to improve compile times even further. For example,
we should probably implement a faster running register allocator:
https://bugs.webkit.org/show_bug.cgi?id=194036

We can also improve on the code we generate.
We should emit better code for Switch: https://bugs.webkit.org/show_bug.cgi?id=194053
And we should do better instruction selection in various
areas: https://bugs.webkit.org/show_bug.cgi?id=193999

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* b3/B3LowerToAir.cpp:
* b3/B3StackmapSpecial.h:
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::emitDefaultPrologue):
* b3/air/AirCode.h:
* b3/air/AirTmp.h:
(JSC::B3::Air::Tmp::Tmp):
* runtime/Options.h:
* wasm/WasmAirIRGenerator.cpp: Added.
(JSC::Wasm::ConstrainedTmp::ConstrainedTmp):
(JSC::Wasm::TypedTmp::TypedTmp):
(JSC::Wasm::TypedTmp::operator== const):
(JSC::Wasm::TypedTmp::operator!= const):
(JSC::Wasm::TypedTmp::operator bool const):
(JSC::Wasm::TypedTmp::operator Tmp const):
(JSC::Wasm::TypedTmp::operator Arg const):
(JSC::Wasm::TypedTmp::tmp const):
(JSC::Wasm::TypedTmp::type const):
(JSC::Wasm::AirIRGenerator::ControlData::ControlData):
(JSC::Wasm::AirIRGenerator::ControlData::dump const):
(JSC::Wasm::AirIRGenerator::ControlData::type const):
(JSC::Wasm::AirIRGenerator::ControlData::signature const):
(JSC::Wasm::AirIRGenerator::ControlData::hasNonVoidSignature const):
(JSC::Wasm::AirIRGenerator::ControlData::targetBlockForBranch):
(JSC::Wasm::AirIRGenerator::ControlData::convertIfToBlock):
(JSC::Wasm::AirIRGenerator::ControlData::resultForBranch const):
(JSC::Wasm::AirIRGenerator::emptyExpression):
(JSC::Wasm::AirIRGenerator::fail const):
(JSC::Wasm::AirIRGenerator::setParser):
(JSC::Wasm::AirIRGenerator::toTmpVector):
(JSC::Wasm::AirIRGenerator::validateInst):
(JSC::Wasm::AirIRGenerator::extractArg):
(JSC::Wasm::AirIRGenerator::append):
(JSC::Wasm::AirIRGenerator::appendEffectful):
(JSC::Wasm::AirIRGenerator::newTmp):
(JSC::Wasm::AirIRGenerator::g32):
(JSC::Wasm::AirIRGenerator::g64):
(JSC::Wasm::AirIRGenerator::f32):
(JSC::Wasm::AirIRGenerator::f64):
(JSC::Wasm::AirIRGenerator::tmpForType):
(JSC::Wasm::AirIRGenerator::addPatchpoint):
(JSC::Wasm::AirIRGenerator::emitPatchpoint):
(JSC::Wasm::AirIRGenerator::emitCheck):
(JSC::Wasm::AirIRGenerator::emitCCall):
(JSC::Wasm::AirIRGenerator::moveOpForValueType):
(JSC::Wasm::AirIRGenerator::instanceValue):
(JSC::Wasm::AirIRGenerator::fixupPointerPlusOffset):
(JSC::Wasm::AirIRGenerator::restoreWasmContextInstance):
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
(JSC::Wasm::AirIRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::AirIRGenerator::emitThrowException):
(JSC::Wasm::AirIRGenerator::addLocal):
(JSC::Wasm::AirIRGenerator::addConstant):
(JSC::Wasm::AirIRGenerator::addArguments):
(JSC::Wasm::AirIRGenerator::getLocal):
(JSC::Wasm::AirIRGenerator::addUnreachable):
(JSC::Wasm::AirIRGenerator::addGrowMemory):
(JSC::Wasm::AirIRGenerator::addCurrentMemory):
(JSC::Wasm::AirIRGenerator::setLocal):
(JSC::Wasm::AirIRGenerator::getGlobal):
(JSC::Wasm::AirIRGenerator::setGlobal):
(JSC::Wasm::AirIRGenerator::emitCheckAndPreparePointer):
(JSC::Wasm::sizeOfLoadOp):
(JSC::Wasm::AirIRGenerator::emitLoadOp):
(JSC::Wasm::AirIRGenerator::load):
(JSC::Wasm::sizeOfStoreOp):
(JSC::Wasm::AirIRGenerator::emitStoreOp):
(JSC::Wasm::AirIRGenerator::store):
(JSC::Wasm::AirIRGenerator::addSelect):
(JSC::Wasm::AirIRGenerator::emitTierUpCheck):
(JSC::Wasm::AirIRGenerator::addLoop):
(JSC::Wasm::AirIRGenerator::addTopLevel):
(JSC::Wasm::AirIRGenerator::addBlock):
(JSC::Wasm::AirIRGenerator::addIf):
(JSC::Wasm::AirIRGenerator::addElse):
(JSC::Wasm::AirIRGenerator::addElseToUnreachable):
(JSC::Wasm::AirIRGenerator::addReturn):
(JSC::Wasm::AirIRGenerator::addBranch):
(JSC::Wasm::AirIRGenerator::addSwitch):
(JSC::Wasm::AirIRGenerator::endBlock):
(JSC::Wasm::AirIRGenerator::addEndToUnreachable):
(JSC::Wasm::AirIRGenerator::addCall):
(JSC::Wasm::AirIRGenerator::addCallIndirect):
(JSC::Wasm::AirIRGenerator::unify):
(JSC::Wasm::AirIRGenerator::unifyValuesWithBlock):
(JSC::Wasm::AirIRGenerator::dump):
(JSC::Wasm::AirIRGenerator::origin):
(JSC::Wasm::parseAndCompileAir):
(JSC::Wasm::AirIRGenerator::emitChecksForModOrDiv):
(JSC::Wasm::AirIRGenerator::emitModOrDiv):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32DivS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32RemS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32DivU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32RemU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64DivS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64RemS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64DivU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64RemU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Ctz>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Ctz>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Popcnt>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Popcnt>):
(JSC::Wasm::AirIRGenerator::addOp<F64ConvertUI64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32ConvertUI64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Nearest>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Nearest>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Trunc>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Trunc>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32TruncSF64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32TruncSF32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32TruncUF64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32TruncUF32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncSF64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncSF32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>):
(JSC::Wasm::AirIRGenerator::addShift):
(JSC::Wasm::AirIRGenerator::addIntegerSub):
(JSC::Wasm::AirIRGenerator::addFloatingPointAbs):
(JSC::Wasm::AirIRGenerator::addFloatingPointBinOp):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Ceil>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Mul>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Sub>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Le>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32DemoteF64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Min>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Ne>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Lt>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Max>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Mul>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Div>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Clz>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Copysign>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64ConvertUI32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32ReinterpretI32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64And>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Ne>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Gt>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Sqrt>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Ge>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64GtS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64GtU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Eqz>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Div>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Add>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Or>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32LeU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32LeS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Ne>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Clz>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Neg>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32And>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32LtU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Rotr>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Abs>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32LtS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Eq>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Copysign>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32ConvertSI64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Rotl>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Lt>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64ConvertSI32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Eq>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Le>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Ge>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32ShrU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32ConvertUI32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32ShrS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32GeU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Ceil>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32GeS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Shl>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Floor>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Xor>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Abs>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Min>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Mul>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Sub>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32ReinterpretF32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Add>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Sub>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Or>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64LtU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64LtS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64ConvertSI64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Xor>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64GeU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Mul>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Sub>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64PromoteF32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Add>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64GeS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64ExtendUI32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Ne>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64ReinterpretI64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Eq>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Eq>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Floor>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32ConvertSI32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Eqz>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64ReinterpretF64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64ShrS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64ShrU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Sqrt>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Shl>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Gt>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32WrapI64>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Rotl>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32Rotr>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32GtU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64ExtendSI32>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I32GtS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Neg>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Max>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64LeU>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64LeS>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::I64Add>):
* wasm/WasmAirIRGenerator.h: Added.
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emptyExpression):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::compileFunctions):
* wasm/WasmCallingConvention.cpp:
(JSC::Wasm::jscCallingConventionAir):
(JSC::Wasm::wasmCallingConventionAir):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::CallingConvention):
(JSC::Wasm::CallingConvention::marshallArgumentImpl const):
(JSC::Wasm::CallingConvention::marshallArgument const):
(JSC::Wasm::CallingConventionAir::CallingConventionAir):
(JSC::Wasm::CallingConventionAir::prologueScratch const):
(JSC::Wasm::CallingConventionAir::marshallArgumentImpl const):
(JSC::Wasm::CallingConventionAir::marshallArgument const):
(JSC::Wasm::CallingConventionAir::headerSizeInBytes):
(JSC::Wasm::CallingConventionAir::loadArguments const):
(JSC::Wasm::CallingConventionAir::setupCall const):
(JSC::Wasm::nextJSCOffset):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::emptyExpression):

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

6 months agoReplace High Sierra LLINT CLoop bot due to hardware failure
ryanhaddad@apple.com [Thu, 31 Jan 2019 02:29:21 +0000 (02:29 +0000)]
Replace High Sierra LLINT CLoop bot due to hardware failure
https://bugs.webkit.org/show_bug.cgi?id=194066

Reviewed by Aakash Jain.

* BuildSlaveSupport/build.webkit.org-config/config.json:

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

6 months agoRegression(PSON) History navigations to twitter.com lead to a 403 HTTP error
cdumez@apple.com [Thu, 31 Jan 2019 02:23:55 +0000 (02:23 +0000)]
Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
https://bugs.webkit.org/show_bug.cgi?id=194023
<rdar://problem/47417981>

Reviewed by Geoffrey Garen.

Source/WebCore:

The issue was caused by the 'isTopSite' flag not getting properly set on the network request
in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
not getting its same-site lax cookies.

The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
bypassing this method entirely when continuing a load in a new process after a swap. This was
intentional as the network request is normally already fully populated by the previous process
and we do not want the new process to modify the request in any way (e.g. we would not want to
add a Origin header back after it was removed by the previous process). However, in case of a
History navigation, we do not actually pass a request along from one process to another. Instead,
we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
we are technically continuing a load in a new process.

We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
continuing a load with a request and not when we're continuing a load with a HistoryItem.

Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
(WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):

LayoutTests:

Add layout test coverage.

* http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load-expected.txt: Added.
* http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php: Added.
* http/tests/cookies/same-site/resources/navigate-back.html: Added.

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

6 months ago[NSDragItem init] is unavailable
krollin@apple.com [Thu, 31 Jan 2019 02:18:18 +0000 (02:18 +0000)]
[NSDragItem init] is unavailable
https://bugs.webkit.org/show_bug.cgi?id=194059
<rdar://problem/47685715>

Reviewed by Wenson Hsieh.

[NSDragItem init] is marked as NS_UNAVAILABLE. This affects
DumpRenderTree and TestWebKitAPI, which both try to create an
NSDragItem in a manner that invokes this method. Address this by using
-initWithPasteboardWriter instead.

Note that the parameter passed to initWithPasteboardWriter is likely
incorrect. In both cases, the object passed does not conform to
NSPasteboardWriting. However, with this fix, we're no worse off than
before, and can now perform builds with newer compilers and SDKs until
a real fix can be crafted. That work is tracked in
https://bugs.webkit.org/show_bug.cgi?id=194060

* DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
(-[DumpRenderTreeDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
* TestWebKitAPI/mac/TestDraggingInfo.mm:
(-[TestDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):

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

6 months ago[WebGPU] Support GPUDepthStencilStateDescriptor
justin_fan@apple.com [Thu, 31 Jan 2019 02:15:06 +0000 (02:15 +0000)]
[WebGPU] Support GPUDepthStencilStateDescriptor
https://bugs.webkit.org/show_bug.cgi?id=194048
<rdar://problem/46289645>

Reviewed by Dean Jackson.

Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.

Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect
without a depth texture attached.

New interface files added:
* Modules/webgpu/GPUCompareFunction.idl:
* Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
* platform/graphics/gpu/GPUCompareFunction.h:
* platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:

Modifications:
* Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
* platform/graphics/gpu/GPURenderPipeline.h: Ditto.
(WebCore::GPURenderPipeline::depthStencilState const): Getter.
(WebCore::GPURenderPipeline::platformRenderPipeline const):
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
(WebCore::GPURenderPassEncoder::setPipeline):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
(WebCore::validateAndConvertDepthCompareFunctionToMtl):
(WebCore::tryCreateMtlDepthStencilState):
(WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::GPURenderPipeline):

Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.

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

6 months agoAdd default constructor for NetworkActivityTracker
krollin@apple.com [Thu, 31 Jan 2019 01:55:27 +0000 (01:55 +0000)]
Add default constructor for NetworkActivityTracker
https://bugs.webkit.org/show_bug.cgi?id=194058
<rdar://problem/47685457>

Reviewed by Chris Dumez.

ResourceNetworkActivityTracker has a default constructor. It also has
a NetworkActivityTracker data member, which does not have a default
constructor. This will cause some compilers to complain -- they can't
default-create a ResourceNetworkActivityTracker because they can't
default-create its data members. Address this by adding a default
constructor for NetworkActivityTracker.

* NetworkProcess/NetworkActivityTracker.h:

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

6 months ago[Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
jer.noble@apple.com [Thu, 31 Jan 2019 01:52:55 +0000 (01:52 +0000)]
[Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
https://bugs.webkit.org/show_bug.cgi?id=193984

Reviewed by Eric Carlson.

MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
completion handler is called.

Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::sessionIdChanged):
* Modules/encryptedmedia/MediaKeySession.h:
* platform/encryptedmedia/CDMInstanceSession.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):

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

6 months ago<rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling...
commit-queue@webkit.org [Thu, 31 Jan 2019 01:50:45 +0000 (01:50 +0000)]
<rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers
https://bugs.webkit.org/show_bug.cgi?id=193992

Patch by Daniel Steffen <dsteffen@apple.com> on 2019-01-30
Reviewed by Geoffrey Garen.

The denap SPI is deprecated.
The new way of staying out of AppNap is through a voucher.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::readFromMachPort):
* Platform/IPC/mac/ImportanceAssertion.h:
(IPC::ImportanceAssertion::ImportanceAssertion):
(IPC::ImportanceAssertion::~ImportanceAssertion):

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

6 months agoFloatWithRect has invalid and inaccessible default constructor
krollin@apple.com [Thu, 31 Jan 2019 01:35:26 +0000 (01:35 +0000)]
FloatWithRect has invalid and inaccessible default constructor
https://bugs.webkit.org/show_bug.cgi?id=194057
<rdar://problem/47685211>

Reviewed by Zalan Bujtas.

FloatWithRect has a default constructor declared as 'default'. This
constructor is invalid because FloatWithRect has a data member that's
a reference that will not get initialized with this constructor. Since
it's invalid, and since it's private and not accessed by anything,
remove this constructor.

No new tests since there should be no observable behavior difference.

* rendering/line/LineLayoutState.h:

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

6 months agoFix crashes when trying to ref the CallbackAggregator in NetworkProcess
cdumez@apple.com [Thu, 31 Jan 2019 00:56:56 +0000 (00:56 +0000)]
Fix crashes when trying to ref the CallbackAggregator in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194054

Reviewed by Brent Fulgham.

The callback aggregators should be ThreadSafeRefCounted since they are passed to other threads.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
(WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):

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

6 months ago[iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content...
commit-queue@webkit.org [Thu, 31 Jan 2019 00:54:04 +0000 (00:54 +0000)]
[iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
https://bugs.webkit.org/show_bug.cgi?id=192824
<rdar://problem/47100332>

Patch by Daniel Bates <dabates@apple.com> on 2019-01-30
Reviewed by Wenson Hsieh.

Source/WebCore:

When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
now that hardware key events to non-editable elements use the same code path as for editable elements.

* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
!USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
(WebCore::isFunctionKey): Ditto.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
USE(UIKIT_KEYBOARD_ADDITIONS) enabled.

Source/WebCore/PAL:

Expose more enumerators.

* pal/spi/cocoa/IOKitSPI.h:

Source/WebKit:

Use the same code path for key events to editable elements and non-editable elements.

Currently we have different code paths for hardware key events depending on whether the active element
is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
presses this differentiation was a necessary workaround for UIKit's event processing precedence of
interpreting key events for system text editing commands and app commands before dispatching unhandled
key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.

As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
key events use the same code path.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
(-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
element (by returning NO in -_requiresKeyboardWhenFirstResponder).
(-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
automatic keyboard UI.
(-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
now that we require a keyboard when first responder even if the focused element is non-editable.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
its chance to interpret the UIEvent, we intercepted, for app key commands.
(-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
(e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
when the popover is presented.

Tools:

Fix a bug where the wrong usage code was used for F13 thru F24.

* WebKitTestRunner/ios/HIDEventGenerator.mm:
(keyCodeForDOMFunctionKey):

LayoutTests:

Update tests and expected results. As it turns out fixing the bug in WebKitTestRunner/ios/HIDEventGenerator.mm
so that we now dispatch key events for F17 thru F24 exposed a bug in UIKit. See <rdar://problem/47128940>.
This same bug is also responsible for a lack of key events when the Insert key is pressed.

Added sub-test for Tab key to keypress-keys-in-non-editable-element.html. Changed expected result in test
keypress-keys-in-non-editable-element.html for the forward delete key to expect failure. We expect that pressing
the forward delete key will not dispatch a keypress to match the behavior on Mac. This will be addressed by a
UIKit fix.

* fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt:
* fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html:
* fast/events/ios/keypress-keys-in-non-editable-element-expected.txt:
* fast/events/ios/keypress-keys-in-non-editable-element.html:

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

6 months agoWeb Inspector: Changes: group CSS rules by resource
nvasilyev@apple.com [Thu, 31 Jan 2019 00:51:48 +0000 (00:51 +0000)]
Web Inspector: Changes: group CSS rules by resource
https://bugs.webkit.org/show_bug.cgi?id=193940
<rdar://problem/47617785>

Reviewed by Matt Baker.

Create resource sections with source links in their headers.

Also:
- Use read-only WI.SpreadsheetStyleProperty to display inline swatches for colors;
- Make the red and green background span the entire width of the panel.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ChangesDetailsSidebarPanel.css:
(.sidebar > .panel.changes-panel):
(.sidebar > .panel.changes-panel .css-rule):
(.sidebar > .panel.selected.changes-panel.empty):
(.changes-panel .resource-section):
(.changes-panel .resource-section > .header):
(.changes-panel .resource-section > .header > a:hover):
(.sidebar > .panel.changes-panel .selector-line,):
(.changes-panel .css-property-line > .property):
(.changes-panel .css-property-line.unchanged):
(.changes-panel .css-property-line.added):
(.changes-panel .css-property-line.removed):
(.changes-panel .css-property-line.removed::before):
(.changes-panel .css-property-line.added::before):
(@media (prefers-color-scheme: dark)):

* UserInterface/Views/ChangesDetailsSidebarPanel.js:
(WI.ChangesDetailsSidebarPanel.prototype.layout):
(WI.ChangesDetailsSidebarPanel.prototype._createRuleElement):
(WI.ChangesDetailsSidebarPanel.prototype._createLocationLink):

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
Allow passing `null` as a delegate.

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

6 months agoObject.keys can now lead to a PhantomNewArrayBuffer, OSR exit from the FTL should...
rmorisset@apple.com [Thu, 31 Jan 2019 00:49:26 +0000 (00:49 +0000)]
Object.keys can now lead to a PhantomNewArrayBuffer, OSR exit from the FTL should know how to materialize a NewArrayBuffer in that case
https://bugs.webkit.org/show_bug.cgi?id=194050
<rdar://problem/47595592>

JSTests:

Reviewed by Yusuke Suzuki.

* stress/object-keys-osr-exit.js: Added.
(foo):
(catch):

Source/JavaScriptCore:

Following https://bugs.webkit.org/show_bug.cgi?id=190047, PhantomNewArrayBuffer is no longer guaranteed to originate from a NewArrayBuffer in the baseline jit.
It can now come from Object.keys, which is a function call. We must teach the FTL how to OSR exit in that case.

Reviewed by Yusuke Suzuki.

* ftl/FTLOperations.cpp:
(JSC::FTL::operationMaterializeObjectInOSR):

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

6 months agoRemove assertion that CachedSymbolTables should have no RareData
tzagallo@apple.com [Thu, 31 Jan 2019 00:46:59 +0000 (00:46 +0000)]
Remove assertion that CachedSymbolTables should have no RareData
https://bugs.webkit.org/show_bug.cgi?id=194037

Reviewed by Mark Lam.

It turns out that we don't need to cache the SymbolTableRareData and
we should not assert that it's empty.

* runtime/CachedTypes.cpp:
(JSC::CachedSymbolTable::encode):

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

6 months agoEnsure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
jer.noble@apple.com [Thu, 31 Jan 2019 00:33:41 +0000 (00:33 +0000)]
Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
https://bugs.webkit.org/show_bug.cgi?id=194063

Reviewed by Jon Lee.

* DerivedSources.make:

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

6 months agoWeb Inspector: change style of device settings override popover content
drousso@apple.com [Wed, 30 Jan 2019 23:54:04 +0000 (23:54 +0000)]
Web Inspector: change style of device settings override popover content
https://bugs.webkit.org/show_bug.cgi?id=194049

Reviewed by Joseph Pecoraro.

* UserInterface/Base/Main.js:
(WI._handleDeviceSettingsToolbarButtonClicked):
(WI._handleDeviceSettingsToolbarButtonClicked.showUserAgentInput):
(WI._handleDeviceSettingsToolbarButtonClicked.createContainer): Deleted.
* UserInterface/Views/Main.css:
(.device-settings-content):
(.device-settings-content > tr > td:first-child): Added.
(.device-settings-content .container):
(.device-settings-content .container > * + *): Added.
(.device-settings-content .column): Added.
(.device-settings-content .user-agent select): Added.
(.device-settings-content .user-agent input): Added.
(.device-settings-content label + label): Added.
(.device-settings-content label > input): Added.
(.device-settings-content .columns): Deleted.
(.device-settings-content .columns > .column): Deleted.
(.device-settings-content .columns > .column + .column): Deleted.
(.device-settings-content .user-agent-value): Deleted.
(.device-settings-content .user-agent-value > select): Deleted.
(.device-settings-content .user-agent-value > input): Deleted.
(body[dir=ltr] .device-settings-content .user-agent-value > input): Deleted.
(body[dir=rtl] .device-settings-content .user-agent-value > input): Deleted.

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

6 months ago[macOS] Sandbox fails to compile on 10.12
pvollan@apple.com [Wed, 30 Jan 2019 23:11:10 +0000 (23:11 +0000)]
[macOS] Sandbox fails to compile on 10.12
https://bugs.webkit.org/show_bug.cgi?id=194035
<rdar://problem/47651260>

Reviewed by Brent Fulgham.

This was caused by the commit <https://trac.webkit.org/changeset/239994>, which is only valid for
10.14 and later.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

6 months agoCachedBytecode's move constructor should not call `freeDataIfOwned`
tzagallo@apple.com [Wed, 30 Jan 2019 22:56:46 +0000 (22:56 +0000)]
CachedBytecode's move constructor should not call `freeDataIfOwned`
https://bugs.webkit.org/show_bug.cgi?id=194045

Reviewed by Mark Lam.

That might result in freeing a garbage value

* parser/SourceProvider.h:
(JSC::CachedBytecode::CachedBytecode):

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

6 months agomul32 should convert powers of 2 to an lshift
keith_miller@apple.com [Wed, 30 Jan 2019 22:42:11 +0000 (22:42 +0000)]
mul32 should convert powers of 2 to an lshift
https://bugs.webkit.org/show_bug.cgi?id=193957

Reviewed by Yusuke Suzuki.

* assembler/MacroAssembler.h:
(JSC::MacroAssembler::mul32):
* assembler/testmasm.cpp:
(JSC::int32Operands):
(JSC::testMul32WithImmediates):
(JSC::run):

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

6 months ago[JSC] Make disassembler data structures constant read-only data
ysuzuki@apple.com [Wed, 30 Jan 2019 22:12:52 +0000 (22:12 +0000)]
[JSC] Make disassembler data structures constant read-only data
https://bugs.webkit.org/show_bug.cgi?id=194041

Reviewed by Mark Lam.

Bunch of disassembler data structures are not marked "const", which prevents the loader to put them in read-only region.
This patch makes them "const".

* disassembler/ARM64/A64DOpcode.cpp:
* disassembler/udis86/ud_itab.py:
(UdItabGenerator.genOpcodeTablesLookupIndex):
(UdItabGenerator.genInsnTable):
(UdItabGenerator.genMnemonicsList):
(genItabH):
* disassembler/udis86/udis86_decode.h:
* disassembler/udis86/udis86_syn.c:
* disassembler/udis86/udis86_syn.h:
* disassembler/udis86/udis86_types.h:

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

6 months agoEnsure image picker sourceType is set before cameraDevice
conrad_shultz@apple.com [Wed, 30 Jan 2019 21:46:52 +0000 (21:46 +0000)]
Ensure image picker sourceType is set before cameraDevice
https://bugs.webkit.org/show_bug.cgi?id=193998

Reviewed by Beth Dakin.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):

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

6 months agoUnreviewed, rolling out r240665.
commit-queue@webkit.org [Wed, 30 Jan 2019 21:33:17 +0000 (21:33 +0000)]
Unreviewed, rolling out r240665.
https://bugs.webkit.org/show_bug.cgi?id=194039

"Better to postpone SPI adoption" (Requested by youenn on
#webkit).

Reverted changeset:

"Adopt new VCP SPI"
https://bugs.webkit.org/show_bug.cgi?id=193357
https://trac.webkit.org/changeset/240665

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

6 months agoLayoutTests/imported/w3c:
youenn@apple.com [Wed, 30 Jan 2019 21:00:30 +0000 (21:00 +0000)]
LayoutTests/imported/w3c:
ServiceWorkerJob should notify its client in case its job is cancelled
https://bugs.webkit.org/show_bug.cgi?id=193747
<rdar://problem/47498196>

Reviewed by Chris Dumez.

* web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt:

Source/WebCore:
Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
https://bugs.webkit.org/show_bug.cgi?id=193747
<rdar://problem/47498196>

Reviewed by Chris Dumez.

Make ServiceWorkerJob be no longer ref counted.
Instead its lifetime is fully controlled by ServiceWorkerContainer.

Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
This allows to ensure that these jobs do not stay forever.
Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.

Before the patch, unsetPendingActivity was only called for successful jobs finishing.
In case of failing loads, ServiceWorkerContainer would leak.
Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
a pending activity in the job map next to the job.

When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.

Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
Update type of exception to be SecurityError when load fails due to AccessControl.

Covered by existing tests.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::scheduleJob):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
(WebCore::ServiceWorkerContainer::jobDidFinish):
(WebCore::ServiceWorkerContainer::stop):
(WebCore::ServiceWorkerContainer::job):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::failedWithException):
(WebCore::ServiceWorkerJob::resolvedWithRegistration):
(WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
(WebCore::ServiceWorkerJob::startScriptFetch):
(WebCore::ServiceWorkerJob::didReceiveResponse):
(WebCore::ServiceWorkerJob::notifyFinished):
(WebCore::ServiceWorkerJob::cancelPendingLoad):
* workers/service/ServiceWorkerJob.h:
(WebCore::ServiceWorkerJob::hasPromise const):
(WebCore::ServiceWorkerJob::takePromise):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):

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

6 months agoUnreviewed, update the builtin test results
ysuzuki@apple.com [Wed, 30 Jan 2019 20:27:45 +0000 (20:27 +0000)]
Unreviewed, update the builtin test results
https://bugs.webkit.org/show_bug.cgi?id=194015

* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result:
* Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:

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

6 months agoRegression(PSON) Load hang can occur on history navigation
cdumez@apple.com [Wed, 30 Jan 2019 20:27:37 +0000 (20:27 +0000)]
Regression(PSON) Load hang can occur on history navigation
https://bugs.webkit.org/show_bug.cgi?id=194030
<rdar://problem/47656939>

Reviewed by Antti Koivisto.

Source/WebKit:

We do not support having more than one WebPage in a WebProcess with the same page ID. As a result,
if we decide to reuse an existing process on process-swap, we need to make sure that we either use
its suspended page (when possible, meaning that it is for the right HistoryItem / page) or we need
make sure we drop the existing suspended page for this process / pagePID combination, so that the
WebPage on WebProcess side gets closed before we attempt to do the new load.

We were doing this correctly in 2 places in WebProcessPool::processForNavigationInternal() but failed
to do so in a third place, when doing back to a HistoryItem which does not have a SuspendedPage but
whose process is still alive (presumably because it is kept alive by another suspended page). This
patch fixes this third place to remove any suspended page in the process for the current page before
reusing the process. An assertion was also added to the call site in
WebPageProxy::receivedNavigationPolicyDecision() to make sure we catch this more easily in the
future.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
(WebKit::WebProcessPool::removeAllSuspendedPagesForPage):
(WebKit::WebProcessPool::hasSuspendedPageFor const):
* UIProcess/WebProcessPool.h:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoWeb Inspector: Uncaught Exception: null is not an object (evaluating 'url.startsWith')
drousso@apple.com [Wed, 30 Jan 2019 20:08:16 +0000 (20:08 +0000)]
Web Inspector: Uncaught Exception: null is not an object (evaluating 'url.startsWith')
https://bugs.webkit.org/show_bug.cgi?id=194029

Reviewed by Matt Baker.

* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):

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

6 months ago[GTK][Wayland] REGRESSION(r240712): Clear the GL context if it's the current one...
commit-queue@webkit.org [Wed, 30 Jan 2019 20:04:14 +0000 (20:04 +0000)]
[GTK][Wayland] REGRESSION(r240712): Clear the GL context if it's the current one on dispose
https://bugs.webkit.org/show_bug.cgi?id=194024

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-01-30
Reviewed by Michael Catanzaro.

Fixes a crash in gdk_gl_context_dispose().

* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):

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

6 months ago[LFC] Expand tests coverage.
zalan@apple.com [Wed, 30 Jan 2019 19:30:17 +0000 (19:30 +0000)]
[LFC] Expand tests coverage.

Unreviewed test gardening.

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

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

6 months agoPointerEvents - tiltX and tiltY are reversed
dino@apple.com [Wed, 30 Jan 2019 19:25:10 +0000 (19:25 +0000)]
PointerEvents - tiltX and tiltY are reversed
https://bugs.webkit.org/show_bug.cgi?id=194032
<rdar://problem/47674184>

Reviewed by Jon Lee.

Source/WebCore:

I got tiltX and tiltY the wrong way around.

* dom/ios/PointerEventIOS.cpp: Flip the values.

LayoutTests:

* pointerevents/ios/pointer-events-dispatch-on-stylus.html:

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

6 months ago[JSC] Make global static variables "const" as much as possible
ysuzuki@apple.com [Wed, 30 Jan 2019 18:55:38 +0000 (18:55 +0000)]
[JSC] Make global static variables "const" as much as possible
https://bugs.webkit.org/show_bug.cgi?id=194015

Patch by Yusuke Suzuki <yusukesuzuki@slowstart.org> on 2019-01-30
Reviewed by Mark Lam.

Some of global static variables are not "const". For example, `static const char* name = ...`
is not constant variable. We should make it `static const char* const name = ...`.

* Scripts/wkbuiltins/builtins_generate_combined_header.py:
(generate_externs_for_object):
* Scripts/wkbuiltins/builtins_generate_separate_header.py:
(generate_externs_for_object):
* Scripts/wkbuiltins/builtins_generator.py:
(BuiltinsGenerator.generate_embedded_code_string_section_for_data):
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::additionBlindedConstant):
* b3/air/AirFormTable.h:
* b3/air/opcode_generator.rb:
* runtime/JSObject.cpp:
(JSC::JSObject::visitButterfly):
* tools/CodeProfile.cpp:
* tools/CodeProfile.h:

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

6 months agoCrash in WebKit::RemoteLayerTreePropertyApplier::updateChildren
antti@apple.com [Wed, 30 Jan 2019 18:44:24 +0000 (18:44 +0000)]
Crash in WebKit::RemoteLayerTreePropertyApplier::updateChildren
https://bugs.webkit.org/show_bug.cgi?id=193897
<rdar://problem/47427750>

Reviewed by Simon Fraser.

There has been some null pointer crashes where we fail to find a remote layer tree node that matches
the transaction properties.

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::updateChildren):

Null check the nodes.

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

6 months ago[Flatpak] Add openjpeg support
commit-queue@webkit.org [Wed, 30 Jan 2019 18:42:07 +0000 (18:42 +0000)]
[Flatpak] Add openjpeg support
https://bugs.webkit.org/show_bug.cgi?id=194019

Patch by Thibault Saunier <tsaunier@igalia.com> on 2019-01-30
Reviewed by Michael Catanzaro.

* flatpak/org.webkit.CommonModules.yaml:

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

6 months agoUnreviewed, rolling out r240708.
commit-queue@webkit.org [Wed, 30 Jan 2019 16:43:10 +0000 (16:43 +0000)]
Unreviewed, rolling out r240708.
https://bugs.webkit.org/show_bug.cgi?id=194022

It broke WPE build (Requested by KaL on #webkit).

Reverted changeset:

"[WPE] Bump font related dependencies to match the GTK+ port"
https://bugs.webkit.org/show_bug.cgi?id=194017
https://trac.webkit.org/changeset/240708

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

6 months ago[LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
zalan@apple.com [Wed, 30 Jan 2019 16:39:54 +0000 (16:39 +0000)]
[LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
https://bugs.webkit.org/show_bug.cgi?id=194001

Reviewed by Antti Koivisto.

Source/WebCore:

Skip to the next position manually. This is exactly what we do in simple line layout.

* layout/inlineformatting/InlineRunProvider.cpp:
(WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):

Tools:

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

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

6 months agoAdd some basic geometry information to the scrolling tree
simon.fraser@apple.com [Wed, 30 Jan 2019 16:33:33 +0000 (16:33 +0000)]
Add some basic geometry information to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=194002
Source/WebCore:

rdar://problem/47656294

Reviewed by Antti Koivisto.

To allow hit-testing in the scrolling tree, store a parent-relative scrollable
rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
of the scrollable area, and whose origin is relative to the parent scrolling tree node.

Frame hosting nodes need this rect because they take care of the geometry offset between
an iframe and its scrolling tree ancestor in the parent document.

Based on a patch by Frédéric Wang in bug 172917.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
* page/scrolling/ScrollingStateFrameHostingNode.cpp:
(WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
(WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
(WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingTreeFrameHostingNode.h:
(WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
(WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
(WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
* rendering/RenderLayerCompositor.h:

Source/WebKit:

Reviewed by Antti Koivisto.

Add a comment explaining why we don't need to encode/decode ParentRelativeScrollableRect.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameHostingNode>::encode):

LayoutTests:

rdar://problem/47656294

Reviewed by Antti Koivisto.

New test results with "parent relative scrollable rect" output and 0,0 anchorPoints.

* compositing/scrolling/overflow-scrolling-layers-are-self-painting-expected.txt:
* fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt:
* fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt:
* fast/scrolling/ios/overflow-scroll-touch-expected.txt:
* fast/scrolling/ios/reconcile-layer-position-recursive-expected.txt:
* fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* platform/ios/compositing/overflow/overflow-auto-with-touch-expected.txt:
* platform/ios/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt:
* platform/ios/compositing/overflow/overflow-overlay-with-touch-expected.txt:
* platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
* platform/ios/compositing/overflow/scrolling-without-painting-expected.txt:
* platform/ios/compositing/overflow/textarea-scroll-touch-expected.txt:
* platform/ios/compositing/overflow/updating-scrolling-content-expected.txt:
* platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
* platform/ios/compositing/scrolling/overflow-scrolling-layers-are-self-painting-expected.txt:
* platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt:
* platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt:
* platform/ios/fast/scrolling/ios/scrolling-content-clip-to-viewport-expected.txt:
* platform/ios/fast/scrolling/ios/textarea-scroll-touch-expected.txt:
* platform/ios/media/video-play-glyph-composited-outside-overflow-scrolling-touch-container-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt:
* tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

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

6 months ago[GTK] gdk_cairo_draw_from_gl() in AcceleratedBackingStoreWayland fails in GtkInspecto...
carlosgc@webkit.org [Wed, 30 Jan 2019 16:14:52 +0000 (16:14 +0000)]
[GTK] gdk_cairo_draw_from_gl() in AcceleratedBackingStoreWayland fails in GtkInspector's magnifier
https://bugs.webkit.org/show_bug.cgi?id=193903

Reviewed by Michael Catanzaro.

The problem is that the GL context used by WaylandCompositor can't share resources with the one used by GTK+
when painting with gdk_cairo_draw_from_gl(). Accelerated compositing in Wayland works only because
WaylandCompositor makes the context current only once on initialization. So, when we render the first frame on
accelerated compositing mode, GTK+ is rendering in non-GL mode, and switches to the GL mode when
gdk_cairo_draw_from_gl() is called. Since GTK+ didn't have a GL context yet, the first frame is always rendered
by GTK+ using the software fallback (glReadPixels). The thing is that the first time gdk_cairo_draw_from_gl() is
called, GTK+ creates a GL context for painting that is made current, and it will remain the current one
forever. The first frame fails to render with "GL_INVALID_OPERATION in glBindTexture(non-gen name)" because the
texture created in WaylandCompositor GL context can't be accessed from GTK+ GL context. The following frames are
handled with the GTK+ GL context. I would say this works by casuality and it could be the cause of other
accelerated compositing issues in Wayland.

We need to create our own GdkGLContext for the WebView, and use that in the WaylandCompositor. When the
GdkGLContext is created, the GTK+ GL context for painting is used as a shared context, ensuring that resources
created in the new context will be accessible from the painting one.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseMakeGLContextCurrent): Call AcceleratedBackingStore::makeContextCurrent().
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/AcceleratedBackingStore.h:
(WebKit::AcceleratedBackingStore::makeContextCurrent): New virtual method only implemented by Wayland backend.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Try to create a GL context with
gdk_window_create_gl_context(), falling back to a WebCore::GLContext if it fails or GTK+ version is not new enough.
(WebKit::AcceleratedBackingStoreWayland::makeContextCurrent): Make the GL context current.
(WebKit::AcceleratedBackingStoreWayland::paint): Check if we have a GdkGLContext before trying to use gdk_cairo_draw_from_gl().
(WebKit::AcceleratedBackingStoreWayland::canGdkUseGL const): Deleted.
* UIProcess/gtk/AcceleratedBackingStoreWayland.h:
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::Surface): Move the texture creation to setWebPage(), since we need the
WebView GL context.
(WebKit::WaylandCompositor::Surface::~Surface): Move the code to destroy GL resources to setWebPage().
(WebKit::WaylandCompositor::Surface::setWebPage): Create the texture when a new page is set and destroy GL
resources when unset.
(WebKit::WaylandCompositor::Surface::prepareTextureForPainting): Make WebView GL context current.
(WebKit::WaylandCompositor::Surface::commit): Ditto.
(WebKit::WaylandCompositor::initializeEGL): Use a temporary GLContext.
* UIProcess/gtk/WaylandCompositor.h:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::makeGLContextCurrent): Call webkitWebViewBaseMakeGLContextCurrent().

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

6 months ago[LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
zalan@apple.com [Wed, 30 Jan 2019 16:13:07 +0000 (16:13 +0000)]
[LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
https://bugs.webkit.org/show_bug.cgi?id=194020

Reviewed by Antti Koivisto.

Source/WebCore:

Check the used margin variables whether we already computed before/after values.

Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):

Tools:

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

LayoutTests:

* fast/block/block-only/absolute-position-with-margin-auto-simple-expected.html: Added.
* fast/block/block-only/absolute-position-with-margin-auto-simple.html: Added.

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

6 months agoAX: Support color well on iOS
cfleizach@apple.com [Wed, 30 Jan 2019 15:10:36 +0000 (15:10 +0000)]
AX: Support color well on iOS
https://bugs.webkit.org/show_bug.cgi?id=194010

Reviewed by Joanmarie Diggs.

Source/WebCore:

Test: accessibility/ios-simulator/color-well.html

Add support for color well on iOS.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXColorWellText):
* platform/LocalizedStrings.h:

Tools:

* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::stringAttributeValue):

LayoutTests:

* accessibility/ios-simulator/color-well-expected.txt: Added.
* accessibility/ios-simulator/color-well.html: Added.

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

6 months agoAX: Role=switch not returning correct accessibilityValue
cfleizach@apple.com [Wed, 30 Jan 2019 15:07:05 +0000 (15:07 +0000)]
AX: Role=switch not returning correct accessibilityValue
https://bugs.webkit.org/show_bug.cgi?id=194006

Reviewed by Joanmarie Diggs.

Source/WebCore:

Return the toggle state of a role=switch element.

Test: accessibility/ios-simulator/role-switch.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityValue]):

LayoutTests:

* accessibility/ios-simulator/role-switch-expected.txt: Added.
* accessibility/ios-simulator/role-switch.html: Added.

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

6 months ago[WPE] Bump font related dependencies to match the GTK+ port
commit-queue@webkit.org [Wed, 30 Jan 2019 15:04:53 +0000 (15:04 +0000)]
[WPE] Bump font related dependencies to match the GTK+ port
https://bugs.webkit.org/show_bug.cgi?id=194017

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-01-30
Reviewed by Žan Doberšek.

* wpe/jhbuild.modules:
* wpe/patches/cairo-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch: Added.
* wpe/patches/icudata-stdlibs.patch: Added.

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

6 months agoUnreviewed WPE gardening. Manage failures in the imported WPT tests,
zandobersek@gmail.com [Wed, 30 Jan 2019 08:46:17 +0000 (08:46 +0000)]
Unreviewed WPE gardening. Manage failures in the imported WPT tests,
adding a few failure expectations but mostly rebaselining the tests
to match their current status.

* platform/wpe/TestExpectations:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-001-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-004-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/basic/header-value-combining.any-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/basic/header-value-combining.any.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-case.any-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-case.any.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.any-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-mode.any.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/request/request-keepalive-quota-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/content-type: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/content-type/script.window-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/http-cache/cc-request-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/nosniff: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/nosniff/parsing-nosniff.window-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/security/dangling-markup-mitigation-data-url.tentative.sub-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/security/embedded-credentials.tentative.sub-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/mimesniff/mime-types/charset-parameter.window-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/resource-timing: Added.
* platform/wpe/imported/w3c/web-platform-tests/resource-timing/resource_timing.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/service-workers/service-worker/websocket-in-service-worker.https-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/xhr/formdata-blob-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/xhr/formdata-expected.txt:

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

6 months agoAlign with Fetch on data: URLs
commit-queue@webkit.org [Wed, 30 Jan 2019 07:58:48 +0000 (07:58 +0000)]
Align with Fetch on data: URLs
https://bugs.webkit.org/show_bug.cgi?id=182325

Patch by Rob Buis <rbuis@igalia.com> on 2019-01-29
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Update improved test expectations.

* web-platform-tests/fetch/data-urls/processing.any-expected.txt:
* web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt:
* web-platform-tests/xhr/overridemimetype-blob-expected.txt:

Source/WebCore:

Implement most remaining steps for data: URL processing [1].
Serialization is still to be implemented.

To make the code in DataURLDecoder::parseMediaType more efficient,
refactor ParsedContentType so that validation and parsing is done
in one pass.

Test: web-platform-tests/fetch/data-urls/processing.any.js

[1] https://fetch.spec.whatwg.org/#data-urls

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::parseMediaType):
(WebCore::DataURLDecoder::DecodeTask::process):
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader):
* platform/network/ParsedContentType.cpp:
(WebCore::containsNewline):
(WebCore::ParsedContentType::parseContentType):
(WebCore::ParsedContentType::create):
(WebCore::isValidContentType):
(WebCore::ParsedContentType::ParsedContentType):
(WebCore::DummyParsedContentType::setContentType const): Deleted.
(WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
(WebCore::parseContentType): Deleted.
* platform/network/ParsedContentType.h:

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

6 months agoUnreviewed WPE gardening. Adding some test failure expectations and
zandobersek@gmail.com [Wed, 30 Jan 2019 07:41:34 +0000 (07:41 +0000)]
Unreviewed WPE gardening. Adding some test failure expectations and
rebasing a few baselines.

* platform/wpe/TestExpectations:
* platform/wpe/css2.1/t1508-c527-font-06-b-expected.txt:
* platform/wpe/fast/borders/rtl-border-04-expected.txt:
* platform/wpe/fast/borders/rtl-border-05-expected.txt:
* platform/wpe/fast/dom/52776-expected.txt:

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

6 months agoUnreviewed WPE gardening.
zandobersek@gmail.com [Wed, 30 Jan 2019 07:16:57 +0000 (07:16 +0000)]
Unreviewed WPE gardening.

* platform/wpe/TestExpectations: Skip the resourceLoadStatistics tests
since that feature is still not yet enabled for the port.

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

6 months agoRemove default constructor from LLIntPrototypeLoadAdaptiveStructureWatchpoint
keith_miller@apple.com [Wed, 30 Jan 2019 05:03:02 +0000 (05:03 +0000)]
Remove default constructor from LLIntPrototypeLoadAdaptiveStructureWatchpoint
https://bugs.webkit.org/show_bug.cgi?id=194000
<rdar://problem/47642894>

Reviewed by Mark Lam.

default constructor is unused and
LLIntPrototypeLoadAdaptiveStructureWatchpoint has a reference
data member which causes sadness.

* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h:

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

6 months agoiOS: Nullptr crash in WebPage::getPositionInformation dereferencing an input element...
rniwa@webkit.org [Wed, 30 Jan 2019 02:55:03 +0000 (02:55 +0000)]
iOS: Nullptr crash in WebPage::getPositionInformation dereferencing an input element for data list
https://bugs.webkit.org/show_bug.cgi?id=193996

Reviewed by Wenson Hsieh.

Added a missing nullptr check.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

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

6 months ago[MSE] add more source buffer logging
eric.carlson@apple.com [Wed, 30 Jan 2019 02:03:39 +0000 (02:03 +0000)]
[MSE] add more source buffer logging
https://bugs.webkit.org/show_bug.cgi?id=193995
<rdar://problem/47650399>

Reviewed by Jon Lee.

No new tests, no functional change.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(WebCore::SourceBufferPrivateAVFObjC::setReadyState):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
(WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):

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

6 months ago[Mac] Update window scale API usage
ap@apple.com [Wed, 30 Jan 2019 02:01:21 +0000 (02:01 +0000)]
[Mac] Update window scale API usage
https://bugs.webkit.org/show_bug.cgi?id=193991
rdar://problem/47614795

Reviewed by Tim Horton.

* DumpRenderTree/mac/DumpRenderTree.mm:
(changeWindowScaleIfNeeded):
* DumpRenderTree/mac/DumpRenderTreeWindow.h:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::changeWindowScaleIfNeeded):

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

6 months agoWeb Inspector: Enabled Changes panel in Elements tab by default
nvasilyev@apple.com [Wed, 30 Jan 2019 01:57:45 +0000 (01:57 +0000)]
Web Inspector: Enabled Changes panel in Elements tab by default
https://bugs.webkit.org/show_bug.cgi?id=193986
<rdar://problem/47647683>

Reviewed by Matt Baker.

* UserInterface/Base/Setting.js:
* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

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

6 months agoAdd nodes to the scrolling tree in z-index order.
simon.fraser@apple.com [Wed, 30 Jan 2019 01:55:52 +0000 (01:55 +0000)]
Add nodes to the scrolling tree in z-index order.
https://bugs.webkit.org/show_bug.cgi?id=192529
<rdar://problem/47402708>

Reviewed by Dean Jackson.
Source/WebCore:

We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
walks to find them.

With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
(which makes it so that the scrolling tree correctly reflects layer z-order).

The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
nodes in their parent document.

There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().

updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.

Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
       scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html

* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::insertNode):
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::~ScrollingTreeNode):
* platform/Logging.cpp:
(WebCore::initializeLogChannelsIfNecessary):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setParent):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::willBeDestroyed):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
(WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::frameHostingNodeForFrame):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::layerWillBeRemoved):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
(WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
(WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
(WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
(WebCore::canCoordinateScrollingForLayer): Deleted.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
(WebCore::enclosingScrollingNodeID): Deleted.
(WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
* rendering/RenderLayerCompositor.h:

Source/WebKit:

FrameHosting nodes have layers, so need to update them.

* Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):

LayoutTests:

New testcases for z-order of sibling fixed layers, and the correct nesting of scrolling tree nodes
for a position:fixed which is also overflow:scroll.

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt: Added.
* platform/mac-wk2/TestExpectations:
* scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/overflow-in-fixed.html: Added.
* scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html: Added.

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

6 months agoMake sure we have a frame before trying to access its loader
bfulgham@apple.com [Wed, 30 Jan 2019 01:42:44 +0000 (01:42 +0000)]
Make sure we have a frame before trying to access its loader
https://bugs.webkit.org/show_bug.cgi?id=193985
<rdar://problem/47618239>

Reviewed by Ryosuke Niwa.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):

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

6 months agoChange NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
achristensen@apple.com [Wed, 30 Jan 2019 01:42:43 +0000 (01:42 +0000)]
Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
https://bugs.webkit.org/show_bug.cgi?id=193974

Reviewed by Tim Horton.

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:

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

6 months agoREGRESSION: ProcessSwap.DoSameSiteNavigationAfterCrossSiteProvisionalLoadStarted...
cdumez@apple.com [Wed, 30 Jan 2019 01:16:04 +0000 (01:16 +0000)]
REGRESSION: ProcessSwap.DoSameSiteNavigationAfterCrossSiteProvisionalLoadStarted Failing on iOS
https://bugs.webkit.org/show_bug.cgi?id=193977
<rdar://problem/47643716>

Reviewed by Geoff Garen.

Update API test to address flakiness on iOS. Instead of doing the last navigation after receiving the
didStartProvisionalLoad, do we right after we answer the navigation policy request. Flakiness was due
to the previous provisional committing *before* we make the last load.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoUpdating expectations for two compositing/repaint/iframes/ tests
tsavell@apple.com [Wed, 30 Jan 2019 01:11:07 +0000 (01:11 +0000)]
Updating expectations for two compositing/repaint/iframes/ tests
https://bugs.webkit.org/show_bug.cgi?id=193907

Unreviewed test gardening.

* platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt:
* platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt:

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

6 months agoTry to fix the watchOS build.
aestes@apple.com [Wed, 30 Jan 2019 00:43:40 +0000 (00:43 +0000)]
Try to fix the watchOS build.

* dom/Element.cpp:

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

6 months agoWeb Inspector: Styles: enable computed style cascades by default
nvasilyev@apple.com [Wed, 30 Jan 2019 00:37:01 +0000 (00:37 +0000)]
Web Inspector: Styles: enable computed style cascades by default
https://bugs.webkit.org/show_bug.cgi?id=193983
<rdar://problem/47645821>

Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.computed-style-properties):
(.computed-style-properties .property .go-to-arrow):
(.details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)):
(.details-section.computed-style-properties > .content):
(@media (prefers-color-scheme: dark)):
(.computed-with-traces .computed-style-properties): Deleted.
(.computed-with-traces .details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)): Deleted.
(.computed-with-traces .details-section.computed-style-properties > .content): Deleted.
(.computed-with-traces .computed-style-properties .property .go-to-arrow): Deleted.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.refresh):
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
* UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
(WI.ComputedStyleDetailsSidebarPanel):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

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

6 months agoAdopt new SPI to evaluate server certificate trust
youenn@apple.com [Wed, 30 Jan 2019 00:16:39 +0000 (00:16 +0000)]
Adopt new SPI to evaluate server certificate trust
https://bugs.webkit.org/show_bug.cgi?id=193355

Reviewed by Alex Christensen.

Source/WebKit:

Use new SPI provided in NSURLSession to evaluate server certificates.
If successful, let loading proceed as usual.
Otherwise, go to the UIProcess to ask for a decision on continuing the load or not.

* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(canNSURLSessionTrustEvaluate):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):

Tools:

Add infrastructure to handle HTTPS server trust evaluation testing.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setCanHandleHTTPSServerTrustEvaluation):
(WTR::TestRunner::canDoServerTrustEvaluationInNetworkProcess):
(WTR::TestRunner::serverTrustEvaluationCallbackCallsCount):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::TestController::didReceiveAuthenticationChallenge):
(WTR::TestController::canDoServerTrustEvaluationInNetworkProcess const):
* WebKitTestRunner/TestController.h:
(WTR::TestController::serverTrustEvaluationCallbackCallsCount const):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::canDoServerTrustEvaluationInNetworkProcess const):

LayoutTests:

* http/tests/ssl/certificate-validation-expected.txt: Added.
* http/tests/ssl/certificate-validation.html: Added.

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

6 months agoFix the build
timothy_horton@apple.com [Wed, 30 Jan 2019 00:14:44 +0000 (00:14 +0000)]
Fix the build

* UIProcess/ios/WKDrawingCoordinator.h:
* UIProcess/ios/WKDrawingCoordinator.mm:
* UIProcess/ios/WKDrawingView.mm:

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

6 months agoRemove unused NetworkProcessProxy::writeBlobToFilePath
achristensen@apple.com [Wed, 30 Jan 2019 00:02:46 +0000 (00:02 +0000)]
Remove unused NetworkProcessProxy::writeBlobToFilePath
https://bugs.webkit.org/show_bug.cgi?id=193990

Reviewed by Wenson Hsieh.

This code was only used in code that was introduced in r235202
but that has since been refactored to not use blobs.  Its tests still pass.
This removes the only UIProcess-controlled code that uses NetworkBlobRegistry::singleton.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::writeBlobToFilePath): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::writeBlobToFilePath): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::writeBlobToFilePath): Deleted.
* UIProcess/WebPageProxy.h:

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

6 months agoRemove FIXME for Annex B.3.5's "for-of var" subcase.
ross.kirsling@sony.com [Tue, 29 Jan 2019 23:10:46 +0000 (23:10 +0000)]
Remove FIXME for Annex B.3.5's "for-of var" subcase.

Rubber-stamped by Yusuke Suzuki.

This subcase is removed from the spec in https://github.com/tc39/ecma262/pull/1393.

* parser/Parser.h:
(JSC::Parser::declareHoistedVariable):

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

6 months agoWeb Inspector: expose a way of determining if a detached frontend is for a remote...
drousso@apple.com [Tue, 29 Jan 2019 22:40:44 +0000 (22:40 +0000)]
Web Inspector: expose a way of determining if a detached frontend is for a remote target
https://bugs.webkit.org/show_bug.cgi?id=193951
<rdar://problem/47621366>

Reviewed by Joseph Pecoraro.

* UIProcess/WebInspectorProxy.h:
(WebKit::WebInspectorProxy::InspectionTargetType): Added.
(WebKit::WebInspectorProxy::createFrontendWindow):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::createFrontendWindow):
(WebKit::WebInspectorProxy::platformCreateFrontendWindow):
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):

* UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
* UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.
(-[WKInspectorWindow isRemote]): Added.

* Shared/API/Cocoa/_WKNSWindowExtras.mm:
(-[NSWindow _web_isWebInspectorWindow]):

* PlatformMac.cmake:
* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:

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

6 months agoRemove unneeded CPU(BIG_ENDIAN) handling in LLInt after new bytecode format.
mark.lam@apple.com [Tue, 29 Jan 2019 22:25:36 +0000 (22:25 +0000)]
Remove unneeded CPU(BIG_ENDIAN) handling in LLInt after new bytecode format.
https://bugs.webkit.org/show_bug.cgi?id=132333

Reviewed by Yusuke Suzuki.

* bytecode/InstructionStream.h:
(JSC::InstructionStreamWriter::write):
- The 32-bit write() function need not invert the order of the bytes written to
  the bytecode stream for CPU(BUG_ENDIAN) because the incoming uint32_t value to
  be written is already in big endian order for CPU(BUG_ENDIAN) platforms.

* llint/LLIntOfflineAsmConfig.h:
- OFFLINE_ASM_BIG_ENDIAN is no longer needed nor used after the new bytecode format.

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

6 months agoRename ChildProcess to AuxiliaryProcess
achristensen@apple.com [Tue, 29 Jan 2019 22:12:51 +0000 (22:12 +0000)]
Rename ChildProcess to AuxiliaryProcess
https://bugs.webkit.org/show_bug.cgi?id=193943

Reviewed by Andy Estes.

"Child" implies that there is a parent, but I'm about to introduce a type of NetworkProcess that
doesn't always have a parent, and may have many UIProcesses that it is the auxiliary for.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* NetworkProcess/Cookies/WebCookieManager.cpp:
* NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
(WebKit::initializeAuxiliaryProcess<NetworkProcess>):
(WebKit::initializeChildProcess<NetworkProcess>): Deleted.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::callExitSoon):
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::didReceiveMessage):
(WebKit::NetworkProcess::initializeConnection):
(WebKit::NetworkProcess::terminate):
(WebKit::NetworkProcess::initializeProcess):
(WebKit::NetworkProcess::initializeProcessName):
(WebKit::NetworkProcess::initializeSandbox):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessSupplement.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::deleteOldVersions):
* NetworkProcess/ios/NetworkProcessIOS.mm:
(WebKit::NetworkProcess::initializeProcess):
(WebKit::NetworkProcess::initializeProcessName):
(WebKit::NetworkProcess::initializeSandbox):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcess):
(WebKit::NetworkProcess::initializeProcessName):
(WebKit::NetworkProcess::initializeSandbox):
* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
(WebKit::initializeAuxiliaryProcess<NetworkProcess>):
(WebKit::NetworkProcessMainUnix):
(WebKit::initializeChildProcess<NetworkProcess>): Deleted.
* NetworkProcess/watchos/NetworkProximityManager.h:
* NetworkProcess/watchos/NetworkProximityManager.mm:
(WebKit::NetworkProximityManager::NetworkProximityManager):
* NetworkProcess/win/NetworkProcessMainWin.cpp:
(WebKit::initializeAuxiliaryProcess<NetworkProcess>):
(WebKit::NetworkProcessMainWin):
(WebKit::initializeChildProcess<NetworkProcess>): Deleted.
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWin.cmake:
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::initializeProcess):
(WebKit::PluginProcess::initializeConnection):
(WebKit::PluginProcess::didReceiveMessage):
(WebKit::PluginProcess::initializeProcessName):
(WebKit::PluginProcess::initializeSandbox):
* PluginProcess/PluginProcess.h:
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializeProcess):
(WebKit::PluginProcess::initializeProcessName):
(WebKit::PluginProcess::initializeSandbox):
(WebKit::PluginProcess::stopRunLoop):
* PluginProcess/unix/PluginProcessMainUnix.cpp:
(WebKit::PluginProcessMainUnix):
* PluginProcess/unix/PluginProcessUnix.cpp:
(WebKit::PluginProcess::platformInitializeProcess):
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::AuthenticationManager):
* Shared/Authentication/AuthenticationManager.h:
* Shared/AuxiliaryProcess.cpp: Copied from Source/WebKit/Shared/ChildProcess.cpp.
(WebKit::AuxiliaryProcess::AuxiliaryProcess):
(WebKit::AuxiliaryProcess::~AuxiliaryProcess):
(WebKit::AuxiliaryProcess::didClose):
(WebKit::AuxiliaryProcess::initialize):
(WebKit::AuxiliaryProcess::setProcessSuppressionEnabled):
(WebKit::AuxiliaryProcess::initializeProcess):
(WebKit::AuxiliaryProcess::initializeProcessName):
(WebKit::AuxiliaryProcess::initializeConnection):
(WebKit::AuxiliaryProcess::addMessageReceiver):
(WebKit::AuxiliaryProcess::removeMessageReceiver):
(WebKit::AuxiliaryProcess::disableTermination):
(WebKit::AuxiliaryProcess::enableTermination):
(WebKit::AuxiliaryProcess::messageSenderConnection):
(WebKit::AuxiliaryProcess::messageSenderDestinationID):
(WebKit::AuxiliaryProcess::terminationTimerFired):
(WebKit::AuxiliaryProcess::stopRunLoop):
(WebKit::AuxiliaryProcess::platformStopRunLoop):
(WebKit::AuxiliaryProcess::terminate):
(WebKit::AuxiliaryProcess::shutDown):
(WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
(WebKit::AuxiliaryProcess::platformInitialize):
(WebKit::AuxiliaryProcess::initializeSandbox):
(WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
(WebKit::AuxiliaryProcess::didReceiveMemoryPressureEvent):
(WebKit::ChildProcess::ChildProcess): Deleted.
(WebKit::ChildProcess::~ChildProcess): Deleted.
(WebKit::ChildProcess::didClose): Deleted.
(WebKit::ChildProcess::initialize): Deleted.
(WebKit::ChildProcess::setProcessSuppressionEnabled): Deleted.
(WebKit::ChildProcess::initializeProcess): Deleted.
(WebKit::ChildProcess::initializeProcessName): Deleted.
(WebKit::ChildProcess::initializeConnection): Deleted.
(WebKit::ChildProcess::addMessageReceiver): Deleted.
(WebKit::ChildProcess::removeMessageReceiver): Deleted.
(WebKit::ChildProcess::disableTermination): Deleted.
(WebKit::ChildProcess::enableTermination): Deleted.
(WebKit::ChildProcess::messageSenderConnection): Deleted.
(WebKit::ChildProcess::messageSenderDestinationID): Deleted.
(WebKit::ChildProcess::terminationTimerFired): Deleted.
(WebKit::ChildProcess::stopRunLoop): Deleted.
(WebKit::ChildProcess::platformStopRunLoop): Deleted.
(WebKit::ChildProcess::terminate): Deleted.
(WebKit::ChildProcess::shutDown): Deleted.
(WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted.
(WebKit::ChildProcess::platformInitialize): Deleted.
(WebKit::ChildProcess::initializeSandbox): Deleted.
(WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
(WebKit::ChildProcess::didReceiveMemoryPressureEvent): Deleted.
* Shared/AuxiliaryProcess.h: Copied from Source/WebKit/Shared/ChildProcess.h.
(WebKit::ChildProcess::parentProcessConnection const): Deleted.
(WebKit::ChildProcess::messageReceiverMap): Deleted.
(WebKit::ChildProcess::setTerminationTimeout): Deleted.
(WebKit::ChildProcess::shouldOverrideQuarantine): Deleted.
* Shared/AuxiliaryProcess.messages.in: Copied from Source/WebKit/Shared/ChildProcess.messages.in.
* Shared/AuxiliaryProcessSupplement.h: Copied from Source/WebKit/Shared/ChildProcessSupplement.h.
(WebKit::AuxiliaryProcessSupplement::~AuxiliaryProcessSupplement):
(WebKit::ChildProcessSupplement::~ChildProcessSupplement): Deleted.
(WebKit::ChildProcessSupplement::initializeConnection): Deleted.
* Shared/ChildProcess.cpp: Removed.
* Shared/ChildProcess.h: Removed.
* Shared/ChildProcess.messages.in: Removed.
* Shared/ChildProcessSupplement.h: Removed.
* Shared/Cocoa/AuxiliaryProcessCocoa.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
(WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
(WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
* Shared/Cocoa/ChildProcessCocoa.mm: Removed.
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::initializeAuxiliaryProcess):
(WebKit::XPCServiceInitializer):
(WebKit::initializeChildProcess): Deleted.
* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
(WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
(WebKit::m_childProcessType): Deleted.
* Shared/WebSQLiteDatabaseTracker.h:
* Shared/ios/AuxiliaryProcessIOS.mm: Copied from Source/WebKit/Shared/ios/ChildProcessIOS.mm.
(WebKit::AuxiliaryProcess::platformInitialize):
(WebKit::AuxiliaryProcess::initializeSandbox):
(WebKit::AuxiliaryProcess::setQOS):
(WebKit::AuxiliaryProcess::platformStopRunLoop):
(WebKit::ChildProcess::platformInitialize): Deleted.
(WebKit::ChildProcess::initializeSandbox): Deleted.
(WebKit::ChildProcess::setQOS): Deleted.
(WebKit::ChildProcess::platformStopRunLoop): Deleted.
* Shared/ios/ChildProcessIOS.mm: Removed.
* Shared/mac/AuxiliaryProcessMac.mm: Copied from Source/WebKit/Shared/mac/ChildProcessMac.mm.
(WebKit::SandboxInfo::SandboxInfo):
(WebKit::AuxiliaryProcess::launchServicesCheckIn):
(WebKit::AuxiliaryProcess::platformInitialize):
(WebKit::processStorageClass):
(WebKit::sandboxDirectory):
(WebKit::applySandbox):
(WebKit::initializeSandboxParameters):
(WebKit::AuxiliaryProcess::initializeSandbox):
(WebKit::AuxiliaryProcess::stopNSAppRunLoop):
(WebKit::AuxiliaryProcess::stopNSRunLoop):
(WebKit::AuxiliaryProcess::platformStopRunLoop):
(WebKit::AuxiliaryProcess::setQOS):
(WebKit::AuxiliaryProcess::isSystemWebKit):
(WebKit::ChildProcess::launchServicesCheckIn): Deleted.
(WebKit::ChildProcess::platformInitialize): Deleted.
(WebKit::ChildProcess::initializeSandbox): Deleted.
(WebKit::ChildProcess::stopNSAppRunLoop): Deleted.
(WebKit::ChildProcess::stopNSRunLoop): Deleted.
(WebKit::ChildProcess::platformStopRunLoop): Deleted.
(WebKit::ChildProcess::setQOS): Deleted.
(WebKit::ChildProcess::isSystemWebKit): Deleted.
* Shared/mac/ChildProcessMac.mm: Removed.
* Shared/mac/SecItemShim.cpp:
(WebKit::globalNetworkProcess):
(WebKit::sendSecItemRequest):
(WebKit::initializeSecItemShim):
* Shared/mac/SecItemShim.h:
* Shared/unix/AuxiliaryProcessMain.cpp: Copied from Source/WebKit/Shared/unix/ChildProcessMain.cpp.
(WebKit::AuxiliaryProcessMainBase::parseCommandLine):
(WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
* Shared/unix/AuxiliaryProcessMain.h: Copied from Source/WebKit/Shared/unix/ChildProcessMain.h.
(WebKit::AuxiliaryProcessMainBase::takeInitializationParameters):
(WebKit::initializeAuxiliaryProcess):
(WebKit::AuxiliaryProcessMain):
(WebKit::ChildProcessMainBase::platformInitialize): Deleted.
(WebKit::ChildProcessMainBase::platformFinalize): Deleted.
(WebKit::ChildProcessMainBase::takeInitializationParameters): Deleted.
(WebKit::initializeChildProcess): Deleted.
(WebKit::ChildProcessMain): Deleted.
* Shared/unix/ChildProcessMain.cpp: Removed.
* Shared/unix/ChildProcessMain.h: Removed.
* Shared/win/AuxiliaryProcessMainWin.cpp: Copied from Source/WebKit/Shared/win/ChildProcessMainWin.cpp.
(WebKit::AuxiliaryProcessMainBase::parseCommandLine):
(WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
* Shared/win/ChildProcessMainWin.cpp: Removed.
* Sources.txt:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
* UIProcess/Authentication/AuthenticationChallengeProxy.h:
* UIProcess/AuxiliaryProcessProxy.cpp: Copied from Source/WebKit/UIProcess/ChildProcessProxy.cpp.
(WebKit::AuxiliaryProcessProxy::AuxiliaryProcessProxy):
(WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
(WebKit::AuxiliaryProcessProxy::connect):
(WebKit::AuxiliaryProcessProxy::terminate):
(WebKit::AuxiliaryProcessProxy::state const):
(WebKit::AuxiliaryProcessProxy::sendMessage):
(WebKit::AuxiliaryProcessProxy::addMessageReceiver):
(WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
(WebKit::AuxiliaryProcessProxy::dispatchMessage):
(WebKit::AuxiliaryProcessProxy::dispatchSyncMessage):
(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
(WebKit::AuxiliaryProcessProxy::shutDownProcess):
(WebKit::AuxiliaryProcessProxy::setProcessSuppressionEnabled):
(WebKit::AuxiliaryProcessProxy::connectionWillOpen):
(WebKit::ChildProcessProxy::ChildProcessProxy): Deleted.
(WebKit::ChildProcessProxy::~ChildProcessProxy): Deleted.
(WebKit::ChildProcessProxy::getLaunchOptions): Deleted.
(WebKit::ChildProcessProxy::connect): Deleted.
(WebKit::ChildProcessProxy::terminate): Deleted.
(WebKit::ChildProcessProxy::state const): Deleted.
(WebKit::ChildProcessProxy::sendMessage): Deleted.
(WebKit::ChildProcessProxy::addMessageReceiver): Deleted.
(WebKit::ChildProcessProxy::removeMessageReceiver): Deleted.
(WebKit::ChildProcessProxy::dispatchMessage): Deleted.
(WebKit::ChildProcessProxy::dispatchSyncMessage): Deleted.
(WebKit::ChildProcessProxy::didFinishLaunching): Deleted.
(WebKit::ChildProcessProxy::shutDownProcess): Deleted.
(WebKit::ChildProcessProxy::setProcessSuppressionEnabled): Deleted.
(WebKit::ChildProcessProxy::connectionWillOpen): Deleted.
* UIProcess/AuxiliaryProcessProxy.h: Copied from Source/WebKit/UIProcess/ChildProcessProxy.h.
(WebKit::AuxiliaryProcessProxy::send):
(WebKit::AuxiliaryProcessProxy::sendSync):
(WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
(WebKit::ChildProcessProxy::send): Deleted.
(WebKit::ChildProcessProxy::sendSync): Deleted.
(WebKit::ChildProcessProxy::connection const): Deleted.
(WebKit::ChildProcessProxy::hasConnection const): Deleted.
(WebKit::ChildProcessProxy::processIdentifier const): Deleted.
(WebKit::ChildProcessProxy::canSendMessage const): Deleted.
(WebKit::ChildProcessProxy::coreProcessIdentifier const): Deleted.
(WebKit::ChildProcessProxy::platformGetLaunchOptions): Deleted.
(WebKit::ChildProcessProxy::sendWithAsyncReply): Deleted.
* UIProcess/ChildProcessProxy.cpp: Removed.
* UIProcess/ChildProcessProxy.h: Removed.
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::DownloadProxyMap):
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::getLaunchOptions):
(WebKit::NetworkProcessProxy::createDownloadProxy):
(WebKit::NetworkProcessProxy::didFinishLaunching):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::getLaunchOptions):
(WebKit::PluginProcessProxy::sendMemoryPressureEvent):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::sendMemoryPressureEvent):
(WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::getLaunchOptions):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::maybeShutDown):
(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
(WebKit::WebProcessProxy::shouldTerminate):
(WebKit::WebProcessProxy::requestTermination):
(WebKit::WebProcessProxy::canTerminateChildProcess): Deleted.
* UIProcess/WebProcessProxy.h:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):
(WebKit::WebProcess::initializeConnection):
(WebKit::WebProcess::terminate):
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::initializeSandbox):
(WebKit::WebProcess::platformInitializeProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcessSupplement.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::platformInitializeProcess):
(WebKit::WebProcess::stopRunLoop):
(WebKit::WebProcess::initializeSandbox):
* WebProcess/gtk/WebProcessMainGtk.cpp:
(WebKit::WebProcessMainUnix):
* WebProcess/win/WebProcessMainWin.cpp:
(WebKit::WebProcessMainWin):
* WebProcess/wpe/WebProcessMainWPE.cpp:
(WebKit::WebProcessMainUnix):

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

6 months ago[ Mac WK2 ] Layout Test http/tests/cache-storage/cache-clearing-origin.https.html...
commit-queue@webkit.org [Tue, 29 Jan 2019 22:11:39 +0000 (22:11 +0000)]
[ Mac WK2 ] Layout Test http/tests/cache-storage/cache-clearing-origin.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=193976

Unreviewed test gardening.

Patch by Shawn Roberts <sroberts@apple.com> on 2019-01-29

* platform/mac-wk2/TestExpectations:

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

6 months agoValueRecovery::recover() should purify NaN values it recovers.
mark.lam@apple.com [Tue, 29 Jan 2019 22:04:47 +0000 (22:04 +0000)]
ValueRecovery::recover() should purify NaN values it recovers.
https://bugs.webkit.org/show_bug.cgi?id=193978
<rdar://problem/47625488>

Reviewed by Saam Barati.

JSTests:

* stress/value-recovery-of-double-displaced-in-jsstack-should-be-purified.js: Added.

Source/JavaScriptCore:

According to DFG::OSRExit::executeOSRExit() and DFG::OSRExit::compileExit(),
recovered DoubleDisplacedInJSStack values need to be purified.
ValueRecovery::recover() should do the same.

* bytecode/ValueRecovery.cpp:
(JSC::ValueRecovery::recover const):

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

6 months ago[ews-build] Add build step to print bot Configuration
aakash_jain@apple.com [Tue, 29 Jan 2019 21:56:41 +0000 (21:56 +0000)]
[ews-build] Add build step to print bot Configuration
https://bugs.webkit.org/show_bug.cgi?id=193887

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(PrintConfiguration): Build step to print configuration.
* BuildSlaveSupport/ews-build/factories.py:

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

6 months ago[JSC] FTL should handle LocalAllocator*
ysuzuki@apple.com [Tue, 29 Jan 2019 21:55:51 +0000 (21:55 +0000)]
[JSC] FTL should handle LocalAllocator*
https://bugs.webkit.org/show_bug.cgi?id=193980

Reviewed by Saam Barati.

At some point, Allocator holds LocalAllocator* instead of 32bit integer. In FTL allocation path, we fail to use this constant LocalAllocator*
because the FTL still use the incoming value as 32bit integer there.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::allocateHeapCell):

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

6 months agoREGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attem...
simon.fraser@apple.com [Tue, 29 Jan 2019 21:29:27 +0000 (21:29 +0000)]
REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
https://bugs.webkit.org/show_bug.cgi?id=193907
Source/WebCore:

rdar://problem/47604080

Reviewed by Frédéric Wang.

Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the
state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would
show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the
commit would re-create the tree node, but the state node would only have a subset of the
change flags set, so the new tree node would fail to get all of the state (for example, it
would be missing layers and scrolling geometry).

Fix by ensuring that when we reparent state node subtrees, we set all the change flags
so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2).
Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can
set the right change flags.

This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same
information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes
as we encounter them in the tree walk.

Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer.

Test: compositing/geometry/composited-frame-contents.html

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::setPropertyChanged):
(WebCore::ScrollingStateNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::setPropertyChangedBit):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created
if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some
other nodeID which can result in type confusion later.
(WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
(WebCore::ScrollingStateTree::commit):
(WebCore::ScrollingStateTree::willRemoveNode):
(WebCore::ScrollingStateTree::setRemovedNodes): Deleted.
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::removedNodes const): Deleted.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNode):
(WebCore::ScrollingTree::latchedNode):
(WebCore::ScrollingTree::setLatchedNode):
(WebCore::ScrollingTree::clearLatchedNode):
(WebCore::ScrollingTree::scrollingTreeAsText):
(WebCore::ScrollingTree::removeDestroyedNodes): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::hasLatchedNode const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that
setting its position doesn't offset it relative to the center.

Source/WebKit:

Reviewed by Frédéric Wang.

Remove encode/decode of removedNodes.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::encode const):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):

LayoutTests:

rdar://problem/47604080

Reviewed by Frédéric Wang.

New ref test for layer positions in composited frames.

New baselines with anchor point on the scroll layer.

* compositing/geometry/composited-frame-contents-expected.html: Added.
* compositing/geometry/composited-frame-contents.html: Added.
* compositing/iframes/become-composited-nested-iframes-expected.txt:
* compositing/iframes/become-overlapped-iframe-expected.txt:
* compositing/iframes/composited-parent-iframe-expected.txt:
* compositing/iframes/connect-compositing-iframe-delayed-expected.txt:
* compositing/iframes/connect-compositing-iframe-expected.txt:
* compositing/iframes/connect-compositing-iframe2-expected.txt:
* compositing/iframes/connect-compositing-iframe3-expected.txt:
* compositing/iframes/enter-compositing-iframe-expected.txt:
* compositing/iframes/iframe-resize-expected.txt:
* compositing/iframes/iframe-size-from-zero-expected.txt:
* compositing/iframes/overlapped-iframe-expected.txt:
* compositing/iframes/overlapped-iframe-iframe-expected.txt:
* compositing/iframes/overlapped-nested-iframes-expected.txt:
* compositing/iframes/page-cache-layer-tree-expected.txt:
* compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt:
* compositing/iframes/resize-from-zero-size-expected.txt:
* compositing/iframes/scrolling-iframe-expected.txt:
* compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt:
* compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt:
* compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt:
* platform/ios-wk2/compositing/iframes/composited-parent-iframe-expected.txt:
* platform/ios-wk2/compositing/iframes/connect-compositing-iframe-delayed-expected.txt:
* platform/ios-wk2/compositing/iframes/connect-compositing-iframe-expected.txt:
* platform/ios-wk2/compositing/iframes/connect-compositing-iframe2-expected.txt:
* platform/ios-wk2/compositing/iframes/connect-compositing-iframe3-expected.txt:
* platform/ios-wk2/compositing/iframes/enter-compositing-iframe-expected.txt:
* platform/ios-wk2/compositing/iframes/iframe-resize-expected.txt:
* platform/ios-wk2/compositing/iframes/leave-compositing-iframe-expected.txt:
* platform/ios-wk2/compositing/iframes/overlapped-iframe-expected.txt:
* platform/ios-wk2/compositing/iframes/page-cache-layer-tree-expected.txt:
* platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt:
* platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-expected.txt:
* platform/ios-wk2/compositing/rtl/rtl-iframe-absolute-overflow-expected.txt:
* platform/ios-wk2/compositing/rtl/rtl-iframe-fixed-expected.txt:
* platform/ios-wk2/compositing/rtl/rtl-iframe-relative-expected.txt:
* platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt:
* platform/ios-wk2/compositing/visible-rect/iframe-and-layers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* platform/ios/compositing/iframes/become-composited-nested-iframes-expected.txt:
* platform/ios/compositing/iframes/become-overlapped-iframe-expected.txt:
* platform/ios/compositing/iframes/invisible-nested-iframe-show-expected.txt:
* platform/ios/compositing/iframes/overlapped-nested-iframes-expected.txt:
* platform/ios/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt:
* platform/ios/compositing/iframes/resizer-expected.txt:
* platform/ios/compositing/visible-rect/iframe-with-layers-outside-viewport-expected.txt:
* platform/mac-wk1/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt:
* platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt:
* platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt:
* platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt:
* platform/mac/compositing/iframes/invisible-nested-iframe-show-expected.txt:
* platform/mac/compositing/iframes/resizer-expected.txt:
* platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt:
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* tiled-drawing/tile-coverage-iframe-to-zero-coverage-expected.txt:

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

6 months agoStorageAccess API calls should be direct to the Network Process
bfulgham@apple.com [Tue, 29 Jan 2019 21:27:32 +0000 (21:27 +0000)]
StorageAccess API calls should be direct to the Network Process
https://bugs.webkit.org/show_bug.cgi?id=193924
<rdar://problem/47611249>

Reviewed by Alex Christensen.

Now that the ResourceLoadStatistics data lives in the Network Process, calls to Storage Access
API should happen directly between the WebContent and Network processes.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
(WebKit::NetworkConnectionToWebProcess::logUserInteraction):
(WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
(WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
(WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
(WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
(WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::requestStorageAccess):
(WebKit::NetworkProcess::requestStorageAccessGranted):
* NetworkProcess/NetworkProcess.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccessConfirm):
(WebKit::WebPageProxy::hasStorageAccess): Deleted.
(WebKit::WebPageProxy::requestStorageAccess): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):
(WebKit::nextRequestStorageAccessContextId): Deleted.
(WebKit::WebPage::storageAccessResponse): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

6 months agoRegression (r240046): [PSON] Spurious changes to [WKWebView url] and [WKWebView loadi...
cdumez@apple.com [Tue, 29 Jan 2019 20:59:59 +0000 (20:59 +0000)]
Regression (r240046): [PSON] Spurious changes to [WKWebView url] and [WKWebView loading] after [WKWebView loadRequest]
https://bugs.webkit.org/show_bug.cgi?id=193967
<rdar://problem/47635348>

Reviewed by Alex Christensen.

Source/WebKit:

Update WebPageProxy::receivedPolicyDecision() to no longer clear the pending URL when we send PolicyAction::Ignore to
the old process when the load is continuing in a new process due to PSON.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::receivedPolicyDecision):
* UIProcess/WebPageProxy.h:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONLoadingObserver observeValueForKeyPath:ofObject:change:context:]):

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

6 months ago[ews-app] Handle incoming results data
aakash_jain@apple.com [Tue, 29 Jan 2019 20:55:22 +0000 (20:55 +0000)]
[ews-app] Handle incoming results data
https://bugs.webkit.org/show_bug.cgi?id=193973

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/views/results.py:

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

6 months ago[ews-app] Make the results url generic
aakash_jain@apple.com [Tue, 29 Jan 2019 20:53:17 +0000 (20:53 +0000)]
[ews-app] Make the results url generic
https://bugs.webkit.org/show_bug.cgi?id=193928

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/urls.py:

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

6 months ago[WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
justin_fan@apple.com [Tue, 29 Jan 2019 20:50:17 +0000 (20:50 +0000)]
[WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
https://bugs.webkit.org/show_bug.cgi?id=193926
<rdar://problem/47327648>

Reviewed by Myles C. Maxfield.

Source/WebCore:

Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation.

Test: webgpu/vertex-buffer-triangle-strip.html

* Modules/webgpu/WebGPUVertexInputDescriptor.idl:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types.
(WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation.

LayoutTests:

Updated test for new vertex input logic. Now provides color as a vertex attribute.

* webgpu/vertex-buffer-triangle-strip.html:

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

6 months ago[ews-build] Configure buildbot to send events to ews-app
aakash_jain@apple.com [Tue, 29 Jan 2019 20:37:02 +0000 (20:37 +0000)]
[ews-build] Configure buildbot to send events to ews-app
https://bugs.webkit.org/show_bug.cgi?id=193968

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/events.py: Added.
* BuildSlaveSupport/ews-build/master.cfg:

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

6 months agoAdd .xcfilelists to Run Script build phases
krollin@apple.com [Tue, 29 Jan 2019 20:05:47 +0000 (20:05 +0000)]
Add .xcfilelists to Run Script build phases
https://bugs.webkit.org/show_bug.cgi?id=193792
<rdar://problem/47201785>

Reviewed by Alex Christensen.

As part of supporting XCBuild, update the necessary Run Script build
phases in their Xcode projects to refer to their associated
.xcfilelist files.

Note that the addition of these files bumps the Xcode project version
number to something that's Xcode 10 compatible. This change means that
older versions of the Xcode IDE can't read these projects. Nor can it
fully load workspaces that refer to these projects (the updated
projects are shown as non-expandable placeholders). `xcodebuild` can
still build these projects; it's just that the IDE can't open them.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebCore:

Make special accommodations for incorporating .xcfilelists from
WebKitAdditions.

No new tests since there should be no observable behavior difference.

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

Make special accommodations for incorporating .xcfilelists from
WebKitAdditions.

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* WebKit.xcodeproj/project.pbxproj:

Tools:

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

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

6 months agoAdd data abstraction and validation for Ad Click Attribution
wilander@apple.com [Tue, 29 Jan 2019 19:54:32 +0000 (19:54 +0000)]
Add data abstraction and validation for Ad Click Attribution
https://bugs.webkit.org/show_bug.cgi?id=193916
<rdar://problem/47603481>

Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.

Source/WebCore:

New API tests added.

Ad click attribution has two steps. First, the storage of an ad
campaign ID for a click that takes the user to a destination
site. Second, a conversion on the destination site that can be
attributed to the ad click.

This patch adds a class that represents a request for ad click
attribution. Validation makes sure that the bits of entropy
reported through this mechanism is limited.

This feature is experimental and off by default.

* Sources.txt:
    Added loader/AdClickAttribution.cpp.
* WebCore.xcodeproj/project.pbxproj:
* loader/AdClickAttribution.cpp: Added.
(WebCore::AdClickAttribution::isValid const):
(WebCore::AdClickAttribution::setConversion):
(WebCore::AdClickAttribution::url const):
(WebCore::AdClickAttribution::referrer const):
* loader/AdClickAttribution.h: Added.
(WebCore::AdClickAttribution::Campaign::Campaign):
(WebCore::AdClickAttribution::Campaign::isValid const):
(WebCore::AdClickAttribution::Source::Source):
(WebCore::AdClickAttribution::Destination::Destination):
(WebCore::AdClickAttribution::Priority::Priority):
(WebCore::AdClickAttribution::Conversion::Conversion):
(WebCore::AdClickAttribution::Conversion::isValid const):
(WebCore::AdClickAttribution::AdClickAttribution):
(WebCore::AdClickAttribution::earliestTimeToSend const):
* loader/DocumentLoader.cpp:
    Added missing #include "RuntimeEnabledFeatures.h".

Tools:

Ad click attribution has two steps. First, the storage of an ad
campaign ID for a click that takes the user to a destination
site. Second, a conversion on the destination site that can be
attributed to the ad click.

This patch adds a class that represents a request for ad click
attribution. Validation makes sure that the bits of entropy
reported through this mechanism is limited.

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

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

6 months ago[MathML] Move enum class ScriptType to MathMLScriptsElement.
zalan@apple.com [Tue, 29 Jan 2019 19:39:55 +0000 (19:39 +0000)]
[MathML] Move enum class ScriptType to MathMLScriptsElement.
https://bugs.webkit.org/show_bug.cgi?id=193969

Reviewed by Antti Koivisto.

* mathml/MathMLScriptsElement.cpp:
(WebCore::scriptTypeOf):
* mathml/MathMLScriptsElement.h:
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::scriptType const):
(WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
(WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
(WebCore::RenderMathMLScripts::verticalMetrics):
(WebCore::RenderMathMLScripts::layoutBlock):
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::isValid const):
(WebCore::RenderMathMLUnderOver::under const):
(WebCore::RenderMathMLUnderOver::over const):
(WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths):
(WebCore::RenderMathMLUnderOver::hasAccent const):
(WebCore::RenderMathMLUnderOver::layoutBlock):

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

6 months agoAdopt new VCP SPI
youenn@apple.com [Tue, 29 Jan 2019 19:13:25 +0000 (19:13 +0000)]
Adopt new VCP SPI
https://bugs.webkit.org/show_bug.cgi?id=193357
<rdar://problem/43656651>

Reviewed by Eric Carlson.

Enable VCP through VTB API with specific encoder id.
If encoder id is not supported, fallback to VCP.
A specific routine is added to check for encoder id presence.

* Source/webrtc/sdk/WebKit/EncoderUtilities.h:
* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp:
* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:
* Source/webrtc/sdk/WebKit/WebKitUtilities.mm:
(webrtc::setApplicationStatus):
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCSingleVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):

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

6 months agoWeb Inspector: provide a way to edit page WebRTC settings on a remote target
drousso@apple.com [Tue, 29 Jan 2019 18:39:21 +0000 (18:39 +0000)]
Web Inspector: provide a way to edit page WebRTC settings on a remote target
https://bugs.webkit.org/show_bug.cgi?id=193863

Unreviewed, skip test from r240644 on WK1 since Media Streams aren't supported.

* platform/mac-wk1/TestExpectations:

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

6 months agoREGRESSION (PSON): Flash on link navigation on Mac
antti@apple.com [Tue, 29 Jan 2019 18:18:52 +0000 (18:18 +0000)]
REGRESSION (PSON): Flash on link navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=193961
<rdar://problem/47482507>

Reviewed by Chris Dumez.

The target page sends EnterAcceleratedCompositingMode message too early, before we have a valid layer tree.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attach): Deleted.

Not needed anymore.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didCompletePageTransition):
(WebKit::m_shouldAttachDrawingAreaOnPageTransition): Deleted.

Move message sending logic fully to TiledCoreAnimationDrawingArea.
Unfreezing the layer tree is sufficient to trigger the message.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):

There is no need to treat process swap case differently.

(WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):

Send this after the first successful layer flush with the root layer set.

(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::attach): Deleted.

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

6 months agoAdd back some includes that got removed at some point.
timothy@apple.com [Tue, 29 Jan 2019 18:15:49 +0000 (18:15 +0000)]
Add back some includes that got removed at some point.
https://bugs.webkit.org/show_bug.cgi?id=193942

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:

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

6 months agoMake sure WTF::generateObjectIdentifier() internal counter does not get duplicated
cdumez@apple.com [Tue, 29 Jan 2019 17:50:53 +0000 (17:50 +0000)]
Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
https://bugs.webkit.org/show_bug.cgi?id=193848

Reviewed by Youenn Fablet.

Source/WebCore:

* dom/Document.cpp:
* dom/MessageChannel.cpp:
(WebCore::MessageChannel::MessageChannel):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::contextIdentifier const):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow):
* platform/Process.cpp:
(WebCore::Process::identifier):
* workers/service/ServiceWorkerJobData.cpp:
(WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::Connection):
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::generateServiceWorkerRegistrationIdentifier):
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::generateServerToContextConnectionIdentifier):

Source/WebKit:

* Platform/IPC/Connection.cpp:
(IPC::Connection::Connection):
* UIProcess/ChildProcessProxy.h:
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::restoreFromState):
* UIProcess/WebProcessPool.cpp:
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):

Source/WTF:

Move WTF::generateObjectIdentifier()'s internal counter out-of-line so make sure it never gets
duplicated at each call site. This has caused some hard-to-debug issues with duplicate
identifiers such as Bug 193761.

Also move it to ObjectIdentifier and rename it to generate() as this make call sites nicer
when they have a typedef for the ObjectIdentifier<T> type.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ObjectIdentifier.cpp: Copied from Source/WebCore/platform/Process.cpp.
(WTF::ObjectIdentifierBase::generateIdentifierInternal):
(WTF::ObjectIdentifierBase::generateThreadSafeIdentifierInternal):
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::generate):
(WTF::ObjectIdentifier::generateThreadSafe):

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

6 months agoREGRESSION (PSON): Twitter link gets stuck at t.co after navigating back in tab
cdumez@apple.com [Tue, 29 Jan 2019 17:19:04 +0000 (17:19 +0000)]
REGRESSION (PSON): Twitter link gets stuck at t.co after navigating back in tab
https://bugs.webkit.org/show_bug.cgi?id=193932
<rdar://problem/47598947>

Reviewed by Brady Eidson.

Source/WebKit:

When doing a client side redirect from origin A to origin B, we would swap process and
create a SuspendedPageProxy and save it on the source BackForwardListItem. The issue is
that the BackForwardList is locked for such redirect so we end up updating the current
BackForwardListItem with origin B's URL while origin A's suspended page remained on
the item. When going to another URL in the same origin A, we would not create a suspended
page since no process-swap would occur. When pressing the back button, we would go back
to the previous BackForwardListItem and use its SuspendedPageProxy, which is for the
wrong URL (The pre-client redirect one).

To address the issue, we no longer create a SuspendedPageProxy for cross-site client side
redirects. There will be no way no go back to this suspended page anyway since the
back/forward list item will be updated with the redirection URL.

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

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoRegression(r240046) VoiceOver is no longer working after a process swap
cdumez@apple.com [Tue, 29 Jan 2019 17:16:33 +0000 (17:16 +0000)]
Regression(r240046) VoiceOver is no longer working after a process swap
https://bugs.webkit.org/show_bug.cgi?id=193953
<rdar://problem/47612398>

Reviewed by Alex Christensen.

ProvisionalPageProxy used to forward the RegisterWebProcessAccessibilityToken IPC from
the provisional WebProcess to the WebPageProxy right away. This in turn would notify
the PageClient whose logic would rely on WebPageProxy::process(), which returns the
committed process instead of the provisional one.

To address the issue, the ProvisionalPageProxy now stores the token sent by the
provisional WebProcess and we only call registerWebProcessAccessibilityToken()
on the WebPageProxy *after* we've swapped to the provisional process.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::registerWebProcessAccessibilityToken):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
* UIProcess/ProvisionalPageProxy.h:
(WebKit::ProvisionalPageProxy::takeAccessibilityToken):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::commitProvisionalPage):

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

6 months agoUse lambdas instead of member pointer functions for TransactionOperationImpl
achristensen@apple.com [Tue, 29 Jan 2019 16:39:47 +0000 (16:39 +0000)]
Use lambdas instead of member pointer functions for TransactionOperationImpl
https://bugs.webkit.org/show_bug.cgi?id=193933

Reviewed by Tim Horton.

No change in behavior.  This just makes it easier to add new parameters to these functions in a straightforward manner.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetAllIndexRecords):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteIndex):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::doComplete):
(WebCore::IDBClient::createTransactionOperation): Deleted.

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

6 months agoAdding new passing LFC tests.
zalan@apple.com [Tue, 29 Jan 2019 16:16:24 +0000 (16:16 +0000)]
Adding new passing LFC tests.

Unreviewed test gardening.

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

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

6 months ago[LFC][BFC][MarginCollapsing] Remove incorrect downcast<Container>
zalan@apple.com [Tue, 29 Jan 2019 15:53:30 +0000 (15:53 +0000)]
[LFC][BFC][MarginCollapsing] Remove incorrect downcast<Container>
https://bugs.webkit.org/show_bug.cgi?id=193964

Reviewed by Antti Koivisto.

Source/WebCore:

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):

Tools:

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

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