Web Inspector: don't include accessibility role in DOM.Node object payloads
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-13  Brian Burg  <bburg@apple.com>
2
3         Web Inspector: don't include accessibility role in DOM.Node object payloads
4         https://bugs.webkit.org/show_bug.cgi?id=194623
5         <rdar://problem/36384037>
6
7         Reviewed by Devin Rousso.
8
9         Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
10         Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
11         first place due to a DOM node tree update (i.e., NodeInserted).
12
13         It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
14         the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
15         necessary to collect this information in a problematic way when initially pushing the node, as
16         it will be updated anyway.
17
18         No new tests, no change in behavior.
19
20         * inspector/agents/InspectorDOMAgent.cpp:
21         (WebCore::InspectorDOMAgent::buildObjectForNode):
22
23 2019-02-14  Zalan Bujtas  <zalan@apple.com>
24
25         [LFC][BFC][MarginCollapse] Replaced boxes don't collapse through their margins
26         https://bugs.webkit.org/show_bug.cgi?id=194622
27
28         Reviewed by Antti Koivisto.
29
30         Ensure that block replaced boxes don't collapse through their vertical margins. 
31
32         Test: fast/block/block-only/block-replaced-with-vertical-margins.html
33
34         * layout/blockformatting/BlockMarginCollapse.cpp:
35         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
36         * page/FrameViewLayoutContext.cpp:
37         (WebCore::layoutUsingFormattingContext):
38
39 2019-02-14  Zalan Bujtas  <zalan@apple.com>
40
41         [LFC] Shrink-to-fit-width should be constrained by min/max width
42         https://bugs.webkit.org/show_bug.cgi?id=194653
43
44         Reviewed by Antti Koivisto.
45
46         Use the fixed value of min-width/max-width to constrain the computed preferred width.
47
48         * layout/FormattingContext.h:
49         * layout/FormattingContextGeometry.cpp:
50         (WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth):
51         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
52         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
53         * layout/inlineformatting/InlineFormattingContext.cpp:
54         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
55
56 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
57
58         Crash in DOMTimer::fired
59         https://bugs.webkit.org/show_bug.cgi?id=194638
60
61         Reviewed by Brent Fulgham.
62
63         This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934.
64
65         The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer
66         is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired).
67
68         Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit
69         from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map
70         we would not leak these DOM timers.
71
72         We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the
73         size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier.
74         Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code,
75         and is no longer the preferred approach when dealing with these classes of bugs in WebKit.
76
77         Test: fast/dom/timer-destruction-during-firing.html
78
79         * page/DOMTimer.cpp:
80         (WebCore::NestedTimersMap::add):
81         (WebCore::DOMTimer::install):
82         (WebCore::DOMTimer::fired):
83
84 2019-02-13  Joseph Pecoraro  <pecoraro@apple.com>
85
86         Web Inspector: Crash when inspecting an element that constantly changes visibility
87         https://bugs.webkit.org/show_bug.cgi?id=194632
88         <rdar://problem/48060258>
89
90         Reviewed by Matt Baker and Devin Rousso.
91
92         * inspector/agents/InspectorDOMAgent.h:
93         * inspector/agents/InspectorDOMAgent.cpp:
94         (WebCore::InspectorDOMAgent::processAccessibilityChildren):
95         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
96         Don't use rvalue-references as that was taking ownership and deleting
97         the object we want to keep around. Instead simplify this to just use
98         references so no ref counting changes happen.
99
100 2019-02-13  Chris Fleizach  <cfleizach@apple.com>
101
102         AX: Crash in handleMenuOpen
103         https://bugs.webkit.org/show_bug.cgi?id=194627
104
105         Reviewed by Zalan Bujtas.
106
107         Tests run under libGuardMalloc will cause crashes.
108
109         This list of objects is a Node list, not an Element list, so we were
110         not removing some nodes when they were being deallocated.
111
112         * accessibility/AXObjectCache.cpp:
113         (WebCore::AXObjectCache::remove):
114
115 2019-02-13  Jer Noble  <jer.noble@apple.com>
116
117         [Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized.
118         https://bugs.webkit.org/show_bug.cgi?id=194621
119         <rdar://problem/48002560>
120
121         Reviewed by Eric Carlson.
122
123         When Safari is minimized, no rAF() requests are executed. Don't gate responding to presentation
124         change events in the media-controller.js on rAF().
125
126         * Modules/modern-media-controls/media/media-controller.js:
127         (MediaController.prototype._returnMediaLayerToInlineIfNeeded):
128
129 2019-02-13  John Wilander  <wilander@apple.com>
130
131         Ignore Ad Click Attribution where source and destination are same-site
132         https://bugs.webkit.org/show_bug.cgi?id=194620
133         <rdar://problem/47890018>
134
135         Reviewed by Jiewen Tan.
136
137         Updated the existing test.
138
139         We should not accept Ad Click Attribution requests where the site of the
140         anchor tag and its addestination attribute are same-site. Such attributions
141         don’t make sense (the site can track intra-site clicks through better means)
142         and would just lead to increased memory use where are the pending
143         attributions are stored.
144
145         For ports that don't have access to the Public Suffix List, this patch
146         only checks that the hosts don't match, i.e. not just eTLD+1.
147
148         * html/HTMLAnchorElement.cpp:
149         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
150             Now returns WTF::nullopt if the current document and the
151             addestination are same site. Also fixed a console message
152             typo.
153
154 2019-02-13  Eric Carlson  <eric.carlson@apple.com> and Youenn Fablet  <youenn@apple.com>
155
156         getUserMedia with an ideal deviceId constraint doesn't always select the correct device
157         https://bugs.webkit.org/show_bug.cgi?id=193614
158
159         Reviewed by Eric Carlson.
160
161         Compute a fitness score based on constraints.
162         For each constraint, a fitness score is computed from the distance.
163         The smaller the distance, the higher the score.
164         Fitness scores are then summed to give a device fitness score.
165         Matching devices are then sorted according the fitness score.
166
167         For important constraints, deviceId and facingMode, add a more important weight.
168         This ensures that should any of these ideal constraints are set, they will be respected.
169
170         Restrict our automatic setting of default constraints to not add a default ideal facingMode in case of existing deviceId constraint.
171         Do not set a default ideal frameRate if width and height are already set.
172
173         Covered by updated test.
174
175         * platform/mediastream/MediaConstraints.cpp:
176         (WebCore::FlattenedConstraint::set):
177         (WebCore::MediaConstraints::setDefaultVideoConstraints):
178         * platform/mediastream/RealtimeMediaSource.cpp:
179         (WebCore::RealtimeMediaSource::fitnessDistance):
180         (WebCore::RealtimeMediaSource::selectSettings):
181         (WebCore::RealtimeMediaSource::supportsConstraints):
182         (WebCore::RealtimeMediaSource::applyConstraints):
183         * platform/mediastream/RealtimeMediaSource.h:
184         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
185         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
186
187 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
188
189         [iOS] Add a hack to work around buggy video control library
190         https://bugs.webkit.org/show_bug.cgi?id=194615
191         <rdar://problem/46146946>
192
193         Reviewed by Jer Noble.
194
195         Test: media/ios/video-volume-ios-quirk.html
196
197         * html/HTMLMediaElement.cpp:
198         (WebCore::HTMLMediaElement::setVolume): Change m_volume for one turn of the runloop.
199         (WebCore::HTMLMediaElement::cancelPendingTasks): Clear the task queue used to restore m_volume.
200         (WebCore::HTMLMediaElement::closeTaskQueues): Close it.
201         * html/HTMLMediaElement.h:
202
203 2019-02-13  Jer Noble  <jer.noble@apple.com>
204
205         [Cocoa] Media elements will restart network buffering just before suspending
206         https://bugs.webkit.org/show_bug.cgi?id=193691
207
208         Reviewed by Eric Carlson.
209
210         API Test: WebKit.ProcessSuspendMediaBuffering
211
212         Allow the Page to suspend all media buffering in its child Documents.
213
214         * dom/Document.cpp:
215         (WebCore::Document::suspendAllMediaBuffering):
216         (WebCore::Document::resumeAllMediaBuffering):
217         * dom/Document.h:
218         * html/MediaElementSession.cpp:
219         (WebCore::MediaElementSession::dataBufferingPermitted const):
220         (WebCore::MediaElementSession::suspendBuffering):
221         (WebCore::MediaElementSession::resumeBuffering):
222         (WebCore::MediaElementSession::bufferingSuspended const):
223         * html/MediaElementSession.h:
224         * page/Page.cpp:
225         (WebCore::Page::suspendAllMediaBuffering):
226         (WebCore::Page::resumeAllMediaBuffering):
227         * page/Page.h:
228         (WebCore::Page::mediaPlaybackIsSuspended const):
229         (WebCore::Page::mediaBufferingIsSuspended const):
230         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
231         * platform/audio/PlatformMediaSession.h:
232         (WebCore::PlatformMediaSession::suspendBuffering):
233         (WebCore::PlatformMediaSession::resumeBuffering):
234         * platform/audio/PlatformMediaSessionManager.cpp:
235         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
236         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
237         * platform/audio/PlatformMediaSessionManager.h:
238
239 2019-02-13  Jer Noble  <jer.noble@apple.com>
240
241         Entering fullscreen inside a shadow root will not set fullscreen pseudoclasses outside of root
242         https://bugs.webkit.org/show_bug.cgi?id=194516
243         <rdar://problem/44678353>
244
245         Reviewed by Antoine Quint.
246
247         Test: fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html
248
249         When walking up the element ancestor chain, use parentElementInComposedTree() to
250         walk past the shadow root boundary.
251
252         * dom/Element.cpp:
253         (WebCore::parentCrossingFrameBoundaries):
254
255 2019-02-13  Chris Dumez  <cdumez@apple.com>
256
257         Unreviewed, update localizable strings.
258
259         * en.lproj/Localizable.strings:
260
261 2019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
262
263         Further restricting webarchive loads
264         https://bugs.webkit.org/show_bug.cgi?id=194567
265         <rdar://problem/47610130>
266
267         Reviewed by Youenn Fablet.
268
269         This patch futher restricts main frame webarchive loads to the followings:
270         1) loaded by clients;
271         2) loaded by drag;
272         3) reloaded from any of the previous two.
273
274         It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document
275         to FrameLoader such that the option is remembered during redirections.
276
277         Covered by API tests.
278
279         * dom/Document.h:
280         (WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted.
281         (WebCore::Document::alwaysAllowLocalWebarchive const): Deleted.
282         * loader/DocumentLoader.cpp:
283         (WebCore::DocumentLoader::disallowWebArchive const):
284         * loader/DocumentLoader.h:
285         (WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame):
286         (WebCore::DocumentLoader::allowsWebArchiveForMainFrame):
287         * loader/FrameLoadRequest.h:
288         (WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput):
289         (WebCore::FrameLoadRequest::isRequestFromClientOrUserInput):
290         * loader/FrameLoader.cpp:
291         (WebCore::FrameLoader::load):
292         (WebCore::FrameLoader::reload):
293         * loader/FrameLoader.h:
294         (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive):
295         (WebCore::FrameLoader::alwaysAllowLocalWebarchive const):
296         * page/DragController.cpp:
297         (WebCore::DragController::performDragOperation):
298         * testing/Internals.cpp:
299         (WebCore::Internals::setAlwaysAllowLocalWebarchive const):
300         * testing/Internals.h:
301         * testing/Internals.idl:
302
303 2019-02-13  Jer Noble  <jer.noble@apple.com>
304
305         Null-deref crash at SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged()
306         https://bugs.webkit.org/show_bug.cgi?id=194613
307         <rdar://problem/48023912>
308
309         Reviewed by Eric Carlson.
310
311         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
312         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
313
314 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
315
316         Unreviewed, fix unused variable warnings after r241148/r241251
317         https://bugs.webkit.org/show_bug.cgi?id=194348
318         <rdar://problem/47566449>
319
320         * Modules/mediasource/SourceBuffer.cpp:
321         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
322         (WebCore::SourceBuffer::evictCodedFrames):
323         (WebCore::SourceBuffer::provideMediaData):
324
325 2019-02-13  Sihui Liu  <sihui_liu@apple.com>
326
327         REGRESSION: [ Mac Debug WK2 ] Layout Test storage/indexeddb/key-type-infinity-private.html is a flaky crash
328         https://bugs.webkit.org/show_bug.cgi?id=194413
329         <rdar://problem/47897254>
330
331         Reviewed by Brady Eidson.
332
333         IDB clients expected transaction operations to be executed in order, but in 
334         UniqueIDBDatabase::immediateCloseForUserDelete, callbacks in callback map were errored out randomly.
335         This patch added a callback queue to UniqueIDBDatabase to make sure callbacks will be called in the same order
336         as IDB Server receives the request.
337
338         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
339         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
340         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
341         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
342         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
343         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
344         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
345         (WebCore::IDBServer::UniqueIDBDatabase::performCountCallback):
346         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
347         * Modules/indexeddb/server/UniqueIDBDatabase.h:
348
349 2019-02-13  John Wilander  <wilander@apple.com>
350
351         Store Ad Click Attribution requests in the network process
352         https://bugs.webkit.org/show_bug.cgi?id=194510
353         <rdar://problem/47650118>
354
355         Reviewed by Alex Christensen and Daniel Bates.
356
357         Test: http/tests/adClickAttribution/store-ad-click-attribution.html
358
359         This patch adds support functions for validation and storage of
360         WebCore::AdClickAttribution objects. It also adds WTF::HashTraits so that
361         WebCore::AdClickAttribution::Source and WebCore::AdClickAttribution::Destination
362         can be used in a HashMap.
363
364         * loader/AdClickAttribution.cpp:
365         (WebCore::AdClickAttribution::toString const):
366         * loader/AdClickAttribution.h:
367         (WebCore::AdClickAttribution::Source::operator== const):
368         (WebCore::AdClickAttribution::Source::deletedValue):
369         (WebCore::AdClickAttribution::Source::constructDeletedValue):
370         (WebCore::AdClickAttribution::Source::deleteValue):
371         (WebCore::AdClickAttribution::Source::isDeletedValue const):
372         (WebCore::AdClickAttribution::SourceHash::hash):
373         (WebCore::AdClickAttribution::SourceHash::equal):
374         (WebCore::AdClickAttribution::Destination::operator== const):
375         (WebCore::AdClickAttribution::Destination::matches const):
376             This convenience function allows matching of a WTF::URL object.
377         (WebCore::AdClickAttribution::Destination::deletedValue):
378         (WebCore::AdClickAttribution::Destination::constructDeletedValue):
379         (WebCore::AdClickAttribution::Destination::deleteValue):
380         (WebCore::AdClickAttribution::Destination::isDeletedValue const):
381         (WebCore::AdClickAttribution::DestinationHash::hash):
382         (WebCore::AdClickAttribution::DestinationHash::equal):
383         (WebCore::AdClickAttribution::source const):
384         (WebCore::AdClickAttribution::destination const):
385             Getters added to support mapped storage based on source and destination.
386         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::emptyValue):
387         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::constructDeletedValue):
388         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::isDeletedValue):
389         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::emptyValue):
390         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::constructDeletedValue):
391         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::isDeletedValue):
392         * loader/NavigationAction.h:
393         (WebCore::NavigationAction::adClickAttribution const):
394         (WebCore::NavigationAction::adClickAttribution): Deleted.
395             Corrected the constness of this function.
396
397 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
398
399         Revert r240434
400         https://bugs.webkit.org/show_bug.cgi?id=194600
401         <rdar://problem/48044566>
402
403         Reviewed by Brent Fulgham.
404
405         * html/HTMLMediaElement.cpp:
406         (WebCore::HTMLMediaElement::setVolume):
407         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
408         (WebCore::HTMLMediaElement::updateVolume):
409         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
410         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
411
412 2019-02-13  Alex Christensen  <achristensen@webkit.org>
413
414         Stop using setDefersLoading from WebCore
415         https://bugs.webkit.org/show_bug.cgi?id=194315
416
417         Reviewed by Jer Noble.
418
419         That is what CompletionHandlers are for.
420
421         * loader/MediaResourceLoader.cpp:
422         (WebCore::MediaResource::responseReceived):
423         (WebCore::MediaResource::setDefersLoading): Deleted.
424         * loader/MediaResourceLoader.h:
425         * platform/graphics/PlatformMediaResourceLoader.h:
426         (WebCore::PlatformMediaResourceClient::responseReceived):
427         (WebCore::PlatformMediaResource::stop):
428         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
429         * platform/network/cocoa/WebCoreNSURLSession.mm:
430         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
431         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
432         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
433         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
434
435 2019-02-13  Jer Noble  <jer.noble@apple.com>
436
437         [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
438         https://bugs.webkit.org/show_bug.cgi?id=194580
439         <rdar://problem/42727739>
440
441         Reviewed by Eric Carlson.
442
443         * platform/cocoa/CoreVideoSoftLink.cpp:
444         * platform/cocoa/CoreVideoSoftLink.h:
445         * platform/graphics/cv/PixelBufferConformerCV.cpp:
446         (WebCore::CVPixelBufferGetBytePointerCallback):
447         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
448
449 2019-02-13  Antoine Quint  <graouts@apple.com>
450
451         Support simulated mouse events on iOS based on a PlatformTouchEvent
452         https://bugs.webkit.org/show_bug.cgi?id=194501
453         <rdar://problem/46910790>
454
455         Reviewed by Dean Jackson.
456
457         Add support for two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and
458         whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. To facilitate
459         that, we allow for a MouseEvent to be created, much like a PointerEvent, based on a PlatformTouchEvent. Then, we set a flag on Event within
460         EventTarget::innerInvokeEventListeners() to see whether any page code has been evaluated as a result of a mousemove event being dispatched.
461         Finally, we also track mouse events when invalidating touch regions provided the required internal runtime flag is on.
462
463         Test: fast/events/touch/ios/mouse-events-dispatch-with-touch.html
464
465         * SourcesCocoa.txt:
466         * WebCore.xcodeproj/project.pbxproj:
467         * dom/Event.cpp:
468         * dom/Event.h:
469         (WebCore::Event::hasEncounteredListener const):
470         (WebCore::Event::setHasEncounteredListener):
471         * dom/EventNames.h:
472         (WebCore::EventNames::isTouchRelatedEventType const):
473         (WebCore::EventNames::touchRelatedEventNames const):
474         (WebCore::EventNames::extendedTouchRelatedEventNames const):
475         (WebCore::EventNames::isTouchEventType const): Deleted.
476         (WebCore::EventNames::touchAndPointerEventNames const): Deleted.
477         * dom/EventTarget.cpp:
478         (WebCore::EventTarget::innerInvokeEventListeners):
479         * dom/MouseEvent.h:
480         * dom/Node.cpp:
481         (WebCore::Node::moveNodeToNewDocument):
482         (WebCore::tryAddEventListener):
483         (WebCore::tryRemoveEventListener):
484         (WebCore::Node::defaultEventHandler):
485         * dom/ios/MouseEventIOS.cpp: Added.
486         (WebCore::mouseEventType):
487         (WebCore::MouseEvent::create):
488         * dom/ios/PointerEventIOS.cpp:
489         (WebCore::pointerEventType):
490         (WebCore::PointerEvent::create):
491         (WebCore::eventType): Deleted.
492         * page/DOMWindow.cpp:
493         (WebCore::DOMWindow::addEventListener):
494         (WebCore::DOMWindow::removeEventListener):
495         * page/EventHandler.h:
496         * page/RuntimeEnabledFeatures.h:
497         (WebCore::RuntimeEnabledFeatures::mouseEventsSimulationEnabled const):
498         (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
499         (WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const):
500         (WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled):
501
502 2019-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
503
504         [FreeType] Unable to render some Hebrew characters
505         https://bugs.webkit.org/show_bug.cgi?id=194498
506
507         Reviewed by Michael Catanzaro.
508
509         We are failing to find a font for some of the combining character sequences because normalization is failing due
510         to overflow error. In case of overflow, normalize returns the required length for the normalized characters, so
511         we should handle that case to resize the output buffer and try again.
512
513         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
514         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
515
516 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
517
518         Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
519         https://bugs.webkit.org/show_bug.cgi?id=194582
520
521         Reviewed by Antti Koivisto.
522
523         Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
524         from the non-generated identifier being sent to us as it was the case in this failure.
525
526         * loader/PolicyChecker.cpp:
527         (WebCore::PolicyCheckIdentifier::isValidFor):
528
529 2019-02-13  Commit Queue  <commit-queue@webkit.org>
530
531         Unreviewed, rolling out r241273.
532         https://bugs.webkit.org/show_bug.cgi?id=194579
533
534         This change is causing a flaky assertion failure crash in High
535         Sierra Debug (Requested by ShawnRoberts on #webkit).
536
537         Reverted changeset:
538
539         "Stop using setDefersLoading from WebCore"
540         https://bugs.webkit.org/show_bug.cgi?id=194315
541         https://trac.webkit.org/changeset/241273
542
543 2019-02-12  Mark Lam  <mark.lam@apple.com>
544
545         Remove unnecessary null check in bindings.
546         https://bugs.webkit.org/show_bug.cgi?id=194581
547
548         Reviewed by Yusuke Suzuki.
549
550         It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
551         It will just return false.  Since we don't expect the root pointer to be null in
552         the common case, having a null check here is also not optimal.  We'll remove this
553         unneeded null check.
554
555         * bindings/scripts/CodeGeneratorJS.pm:
556         (GenerateImplementation):
557         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
558         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
559
560 2019-02-12  Rob Buis  <rbuis@igalia.com>
561
562         Align with Fetch on data: URLs
563         https://bugs.webkit.org/show_bug.cgi?id=182325
564
565         Reviewed by Alex Christensen.
566
567         The MIME type part of the data url should be serialized as
568         specified in step 3 under "data" [1].
569
570         Test: web-platform-tests/fetch/data-urls/processing.any.js
571
572         [1] https://fetch.spec.whatwg.org/#concept-scheme-fetch 
573
574         * platform/network/DataURLDecoder.cpp:
575         (WebCore::DataURLDecoder::parseMediaType):
576
577 2019-02-12  Alex Christensen  <achristensen@webkit.org>
578
579         Build fix after r241320
580         https://bugs.webkit.org/show_bug.cgi?id=194271
581
582         * page/Frame.cpp:
583         (WebCore::Frame::requestDOMPasteAccess):
584
585 2019-02-12  Justin Fan  <justin_fan@apple.com>
586
587         [WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
588         https://bugs.webkit.org/show_bug.cgi?id=194552
589
590         Reviewed by Dean Jackson.
591
592         WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
593         Consolidate the two versions of these classes in our implementation.
594
595         Affected layout tests updated with new names. No change in behavior.
596
597         * CMakeLists.txt:
598         * DerivedSources-input.xcfilelist:
599         * DerivedSources-output.xcfilelist:
600         * DerivedSources.make:
601         * Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
602         * Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
603         * Modules/webgpu/WebGPUBufferUsage.h: Removed.
604         * Modules/webgpu/WebGPUDevice.cpp:
605         (WebCore::WebGPUDevice::createBuffer const):
606         * Modules/webgpu/WebGPUDevice.h:
607         * Modules/webgpu/WebGPUDevice.idl:
608         * Sources.txt:
609         * WebCore.xcodeproj/project.pbxproj:
610         * bindings/js/WebCoreBuiltinNames.h:
611         * platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
612         * platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.
613
614 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
615
616         Unreviewed, try to fix the internal iOS build after r241321
617
618         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
619
620 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
621
622         Allow pages to trigger programmatic paste from script on iOS
623         https://bugs.webkit.org/show_bug.cgi?id=194271
624         <rdar://problem/47808810>
625
626         Reviewed by Tim Horton.
627
628         Tests: editing/pasteboard/ios/dom-paste-confirmation.html
629                editing/pasteboard/ios/dom-paste-consecutive-confirmations.html
630                editing/pasteboard/ios/dom-paste-rejection.html
631                editing/pasteboard/ios/dom-paste-requires-user-gesture.html
632
633         * dom/UserGestureIndicator.cpp:
634         (WebCore::UserGestureIndicator::~UserGestureIndicator):
635
636         Reset a gesture token's DOM paste access when exiting the scope of a user gesture. This prevents DOM paste
637         access permissions from leaking into `setTimeout()` callbacks when we forward user gesture tokens.
638
639         * dom/UserGestureIndicator.h:
640         (WebCore::UserGestureToken::resetDOMPasteAccess):
641
642 2019-02-12  Chris Fleizach  <cfleizach@apple.com>
643
644         AX: IsolatedTree: Implement more attributes
645         https://bugs.webkit.org/show_bug.cgi?id=193911
646         <rdar://problem/47599217>
647
648         Reviewed by Daniel Bates.
649
650         Make use of new HIServices SPI to use a secondary AX thread.
651         Store root node/focused node status in IsolatedTree rather than on the element.
652         Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description.
653         Implement hit-testing using relative-frames.
654         Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to.
655
656         * SourcesCocoa.txt:
657         * WebCore.xcodeproj/project.pbxproj:
658         * accessibility/AXObjectCache.cpp:
659         (WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
660         * accessibility/AXObjectCache.h:
661         (WebCore::AXObjectCache::focusedUIElementForPage):
662         * accessibility/AccessibilityAttachment.cpp:
663         (WebCore::AccessibilityAttachment::accessibilityText const):
664         (WebCore::AccessibilityAttachment::accessibilityText): Deleted.
665         * accessibility/AccessibilityAttachment.h:
666         * accessibility/AccessibilityImageMapLink.cpp:
667         (WebCore::AccessibilityImageMapLink::accessibilityText const):
668         (WebCore::AccessibilityImageMapLink::accessibilityText): Deleted.
669         * accessibility/AccessibilityImageMapLink.h:
670         * accessibility/AccessibilityMediaControls.cpp:
671         (WebCore::AccessibilityMediaControl::accessibilityText const):
672         (WebCore::AccessibilityMediaControl::accessibilityText): Deleted.
673         * accessibility/AccessibilityMediaControls.h:
674         * accessibility/AccessibilityNodeObject.cpp:
675         (WebCore::AccessibilityNodeObject::accessibilityText const):
676         (WebCore::AccessibilityNodeObject::accessibilityText): Deleted.
677         * accessibility/AccessibilityNodeObject.h:
678         * accessibility/AccessibilityObject.cpp:
679         (WebCore::AccessibilityObject::convertFrameToSpace const):
680         (WebCore::AccessibilityObject::relativeFrame const):
681         (WebCore::AccessibilityObject::elementAccessibilityHitTest const):
682         (WebCore::AccessibilityObject::focusedUIElement const):
683         * accessibility/AccessibilityObject.h:
684         (WebCore::AccessibilityObject::accessibilityText const):
685         (WebCore::AccessibilityObject::isLink const): Deleted.
686         (WebCore::AccessibilityObject::isImage const): Deleted.
687         (WebCore::AccessibilityObject::isAttachment const): Deleted.
688         (WebCore::AccessibilityObject::isFileUploadButton const): Deleted.
689         (WebCore::AccessibilityObject::isImageMapLink const): Deleted.
690         (WebCore::AccessibilityObject::isMediaControlLabel const): Deleted.
691         (WebCore::AccessibilityObject::isTree const): Deleted.
692         (WebCore::AccessibilityObject::isTreeItem const): Deleted.
693         (WebCore::AccessibilityObject::isScrollbar const): Deleted.
694         (WebCore::AccessibilityObject::accessibilityHitTest const): Deleted.
695         (WebCore::AccessibilityObject::accessibilityText): Deleted.
696         (WebCore::AccessibilityObject::roleValue const): Deleted.
697         (WebCore::AccessibilityObject::wrapper const): Deleted.
698         * accessibility/AccessibilityObjectInterface.h: Replaced.
699         * accessibility/AccessibilityRenderObject.cpp:
700         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
701         (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const):
702         (WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const):
703         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
704         (WebCore::AccessibilityRenderObject::selectedChildren):
705         * accessibility/AccessibilityRenderObject.h:
706         * accessibility/AccessibilitySVGElement.cpp:
707         (WebCore::AccessibilitySVGElement::accessibilityText const):
708         (WebCore::AccessibilitySVGElement::accessibilityText): Deleted.
709         * accessibility/AccessibilitySVGElement.h:
710         * accessibility/AccessibilityScrollView.cpp:
711         (WebCore::AccessibilityScrollView::accessibilityHitTest const):
712         * accessibility/AccessibilityScrollView.h:
713         * accessibility/ios/AccessibilityObjectIOS.mm:
714         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
715         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
716         (-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted.
717         * accessibility/isolatedtree: Replaced.
718         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
719         (WebCore::AXIsolatedTree::treePageCache):
720         (WebCore::AXIsolatedTree::AXIsolatedTree):
721         (WebCore::AXIsolatedTree::nodeInTreeForID):
722         (WebCore::AXIsolatedTree::nodeForID const):
723         (WebCore::AXIsolatedTree::focusedUIElement):
724         (WebCore::AXIsolatedTree::setRootNodeID):
725         (WebCore::AXIsolatedTree::setFocusedNodeID):
726         (WebCore::AXIsolatedTree::setInitialRequestInProgress):
727         (WebCore::AXIsolatedTree::applyPendingChanges):
728         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
729         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
730         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
731         (WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode):
732         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
733         (WebCore::AXIsolatedTreeNode::setProperty):
734         (WebCore::AXIsolatedTreeNode::setParent):
735         (WebCore::AXIsolatedTreeNode::setTreeIdentifier):
736         (WebCore::AXIsolatedTreeNode::focusedUIElement const):
737         (WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const):
738         (WebCore::AXIsolatedTreeNode::accessibilityHitTest const):
739         (WebCore::AXIsolatedTreeNode::tree const):
740         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
741         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
742         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
743         * accessibility/mac/AXObjectCacheMac.mm:
744         (WebCore::AXObjectCache::associateIsolatedTreeNode):
745         * accessibility/mac/AccessibilityObjectBase.mm: Added.
746         (WebCore::AccessibilityObject::speechHintAttributeValue const):
747         (WebCore::AccessibilityObject::descriptionAttributeValue const):
748         (WebCore::AccessibilityObject::titleAttributeValue const):
749         (WebCore::AccessibilityObject::helpTextAttributeValue const):
750         * accessibility/mac/AccessibilityObjectMac.mm:
751         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
752         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
753         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
754         (addChildToArray):
755         (convertToNSArray):
756         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
757         (-[WebAccessibilityObjectWrapperBase detach]):
758         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
759         (-[WebAccessibilityObjectWrapperBase accessibilityObject]):
760         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
761         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
762         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
763         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
764         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
765         (convertPathToScreenSpaceFunction):
766         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
767         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
768         (-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted.
769         (-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted.
770         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
771         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
772         (-[WebAccessibilityObjectWrapper childrenVectorSize]):
773         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
774         (-[WebAccessibilityObjectWrapper position]):
775         (-[WebAccessibilityObjectWrapper subrole]):
776         (-[WebAccessibilityObjectWrapper roleDescription]):
777         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
778         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
779         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
780         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
781         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
782         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
783
784 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
785
786         Allow pages to trigger programmatic paste from script on iOS
787         https://bugs.webkit.org/show_bug.cgi?id=194271
788         <rdar://problem/47808810>
789
790         Reviewed by Ryosuke Niwa.
791
792         Add support for allowing script to trigger programmatic paste commands. Currently on macOS and iOS, the ability
793         to trigger programmatic paste (i.e. `document.execCommand('Paste');`) is disabled by default, such that
794         execCommand is simply a no-op that returns false. This policy is a privacy measure (common among other major
795         browsers) that prevents untrusted web content from sniffing content from the system pasteboard (even on user
796         interaction, since unintended user interaction occasionally happens as well!).
797
798         In order to make it possible for web pages to programmatically paste without opening the door to privacy and
799         security issues, we make paste commands triggered from bindings present platform UI on iOS, in the form of a
800         callout bar with the single option to paste. This UI is dismissed upon any user interaction; furthermore, any
801         user interaction short of explicitly triggering the "Paste" action subsequently prevents the page from executing
802         the paste (and causes execCommand to return false). However, if the paste action is chosen by the user, we
803         instead follow through with the programmatic paste command.
804
805         New tests to come in a followup patch.
806
807         * WebCore.xcodeproj/project.pbxproj:
808         * dom/DOMPasteAccessPolicy.h: Added.
809         * dom/UserGestureIndicator.h:
810         (WebCore::UserGestureToken::domPasteAccessPolicy const):
811         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
812
813         Add helpers on UserGestureToken to update and query the current DOM paste access policy. The access policies are
814         "NotRequestedYet" (i.e. pending a response from the user), "Granted" (the user has granted DOM paste access to
815         the page), or "Denied" (the user has prevented the page from reading the contents of the clipboard). When DOM
816         paste access is granted or rejected, make this decision sticky until the end of the current user gesture.
817
818         * editing/EditorCommand.cpp:
819         (WebCore::executePaste):
820         (WebCore::executePasteAndMatchStyle):
821         (WebCore::executePasteAsPlainText):
822         (WebCore::executePasteAsQuotation):
823
824         When executing a paste command where the source is DOM bindings, request DOM paste if needed before proceeding
825         with the paste.
826
827         (WebCore::supportedPaste):
828         * loader/EmptyClients.cpp:
829         * page/EditorClient.h:
830         * page/Frame.cpp:
831         (WebCore::Frame::requestDOMPasteAccess):
832
833         Add a helper method that requests access to the clipboard on behalf of script when pasting.
834
835         * page/Frame.h:
836         * page/Settings.yaml:
837
838         Introduce a new WebCore setting, used to gate DOM paste access requests.
839
840 2019-02-12  Alex Christensen  <achristensen@webkit.org>
841
842         Remove setDefersLoading infrastructure from WebKit2
843         https://bugs.webkit.org/show_bug.cgi?id=194506
844
845         Reviewed by Brady Eidson.
846
847         setDefersLoading is inherently racy from WebCore to the NetworkProcess,
848         it adds unwanted complexity to the initialization and use of network objects,
849         and it has led to many unrecoverable hang bugs over the years.
850         We needed to force it into WebKit2 to transition some existing clients who relied on it,
851         but we have recently finished transitioning those clients to other solutions, mostly
852         completion handlers.
853
854         * inspector/PageScriptDebugServer.cpp:
855         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
856
857 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
858
859         Unreviewed, fix build warnings after content extensions enablement
860         https://bugs.webkit.org/show_bug.cgi?id=193622
861         <rdar://problem/47982850>
862
863         * contentextensions/DFABytecode.h:
864         (WebCore::ContentExtensions::instructionSizeWithArguments):
865         * contentextensions/DFABytecodeCompiler.h:
866         * contentextensions/URLFilterParser.cpp:
867         (WebCore::ContentExtensions::URLFilterParser::statusString):
868
869 2019-02-12  Justin Fan  <justin_fan@apple.com>
870
871         [Web GPU] DepthStencilAttachment implementation
872         https://bugs.webkit.org/show_bug.cgi?id=194458
873         <rdar://problem/47932446>
874
875         Reviewed by Dean Jackson.
876
877         Implement ability to provide a depth attachment to the render pass encoder. Also implement
878         GPULoad/StoreOp and update color attachments' implementation for full functionality.
879
880         Test: webgpu/depth-enabled-triangle-strip.html
881
882         Update project files for new symbols:
883         * CMakeLists.txt:
884         * DerivedSources-input.xcfilelist:
885         * DerivedSources-output.xcfilelist:
886         * DerivedSources.make:
887         * Sources.txt:
888         * WebCore.xcodeproj/project.pbxproj:
889
890         * Modules/webgpu/GPUColor.idl: Renamed from WebGPUColor.idl
891         * Modules/webgpu/GPULoadOp.idl: Added. Interface for attachment operation enum.
892         * Modules/webgpu/GPUStoreOp.idl: Ditto.
893         * Modules/webpug/WebGPUColor.h: Removed.
894         * Modules/webgpu/WebGPUCommandBuffer.cpp: Refactored descriptor validation logic out of this file.
895         (WebCore::WebGPUCommandBuffer::beginRenderPass):
896         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Added. Now owns code for validating descriptors.
897         (WebCore::WebGPURenderPassDescriptor::validateAndConvertToGPUVersion const):
898         * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h/idl: Removed. Code moved into WebGPURenderPassDescriptor.
899         * Modules/webgpu/WebGPURenderPassDescriptor.h: Move sub-descriptor definitions into this file.
900         * Modules/webgpu/WebGPURenderPassDescriptor.idl: Ditto.
901         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Make depthStencilState optional to match API update.
902         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
903         * Modules/webgpu/WebGPUTextureView.h:
904         * platform/graphics/gpu/GPULoadOp.h: Added.
905         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Removed (moved into GPURenderPassDescriptor).
906         * platform/graphics/gpu/GPURenderPassDescriptor.h: Mirror WebGPU* changes.
907         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Make depthStencilState optional.
908         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
909         * platform/graphics/gpu/GPUStoreOp.h: Added.
910         * platform/graphics/gpu/GPUTexture.h:
911         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
912         (WebCore::loadActionForGPULoadOp): Added.
913         (WebCore::storeActionForGPUStoreOp): Added.
914         (WebCore::populateMtlColorAttachmentsArray): Added. Create all expected color attachments, rather than just the first.
915         (WebCore::populateMtlDepthStencilAttachment): Added.
916         (WebCore::GPURenderPassEncoder::create):
917         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Make depthStencilState optional.
918         (WebCore::GPURenderPipeline::create):
919
920 2019-02-12  David Kilzer  <ddkilzer@apple.com>
921
922         REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
923         <https://webkit.org/b/194529>
924         <rdar://problem/47924449>
925
926         Reviewed by Eric Carlson.
927
928         * SourcesCocoa.txt:
929         - Do not include DataDetectorsCoreSoftLink.mm in unified
930           sources.
931         * WebCore.xcodeproj/project.pbxproj:
932         - Add DataDetectorsCoreSoftLink.mm to the WebCore target now
933           that it isn't part of the unifed sources.
934         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
935         - Switch from using SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL() to
936           SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE() when linking
937           DataDetectorsCore.framework. None of the other macros assume
938           this framework is optional, and it was likely made optional
939           originally because the framework was new to iOS and thus
940           didn't exist on older versions.
941         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
942         - Change use of SOFT_LINK_CLASS_FOR_SOURCE() macros to
943           SOFT_LINK_CLASS() since the latter can only be used with
944           SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation).  This broke after
945           the fix for <wtf/SoftLinking.h> was applied.
946
947 2019-02-12  Youenn Fablet  <youenn@apple.com>
948
949         Make use of is<SubresourceLoader>
950         https://bugs.webkit.org/show_bug.cgi?id=194541
951
952         Reviewed by Alex Christensen.
953
954         No change of behavior.
955
956         * inspector/agents/InspectorNetworkAgent.cpp:
957         (WebCore::InspectorNetworkAgent::didReceiveResponse):
958         * loader/SubresourceLoader.h:
959         (isType):
960
961 2019-02-12  Mark Lam  <mark.lam@apple.com>
962
963         Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions.
964         https://bugs.webkit.org/show_bug.cgi?id=194530
965         <rdar://problem/47973274>
966
967         Reviewed by Chris Dumez.
968
969         This is needed to fix a null pointer dereference that arises from the following scenario:
970         1. a Document detaches from its StyleSheetList.
971         2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet
972            to be scanned and collected by the GC.
973         3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and
974            discovers a null owner pointer.
975
976         This patch fixes this issue by applying the following null checks:
977
978         1. Add a null check in JSNodeCustom.h's root().
979
980            root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm.
981            isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result
982            to root().  However, depending on which class the ownerNode() method belongs to,
983            it can either return a pointer or a reference.  The null check only makes sense
984            in the pointer case.
985
986            To accommodate the 2 forms, root() itself is has an overload that takes a
987            reference instead of a pointer.
988
989            Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode()
990            returns, it can't discern when the result is a pointer and apply the null check.
991            Instead, we just add the null check to the version of root() that takes a
992            pointer.  If the node pointer is null, we'll return a null opaque root.
993
994         2. Fix CodeGeneratorJS.pm to null check the opaque root before using it.
995
996         * bindings/js/JSNodeCustom.h:
997         (WebCore::root):
998         * bindings/scripts/CodeGeneratorJS.pm:
999         (GenerateImplementation):
1000         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1001         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
1002
1003 2019-02-12  Andy Estes  <aestes@apple.com>
1004
1005         [iOSMac] Enable Parental Controls Content Filtering
1006         https://bugs.webkit.org/show_bug.cgi?id=194521
1007         <rdar://39732376>
1008
1009         Reviewed by Tim Horton.
1010
1011         * Configurations/FeatureDefines.xcconfig:
1012         * platform/ContentFilterUnblockHandler.h:
1013         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1014         * platform/cocoa/ParentalControlsContentFilter.mm:
1015
1016 2019-02-11  Jer Noble  <jer.noble@apple.com>
1017
1018         Unreviewed build fix; add a HAVE_CELESTIAL guard around Celestial framework usage.
1019
1020         * platform/audio/ios/MediaSessionManagerIOS.h:
1021         * platform/audio/ios/MediaSessionManagerIOS.mm:
1022         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
1023
1024 2019-02-12  Antti Koivisto  <antti@apple.com>
1025
1026         Crash in WebCore::ScrollingTree::updateTreeFromStateNode
1027         https://bugs.webkit.org/show_bug.cgi?id=194538
1028         <rdar://problem/47841926>
1029
1030         Reviewed by Zalan Bujtas.
1031
1032         * page/scrolling/ScrollingTree.cpp:
1033         (WebCore::ScrollingTree::updateTreeFromStateNode):
1034
1035         Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent.
1036
1037 2019-02-12  Zalan Bujtas  <zalan@apple.com>
1038
1039         [LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
1040         https://bugs.webkit.org/show_bug.cgi?id=194540
1041
1042         Reviewed by Antti Koivisto.
1043
1044         Use FormattingContext::computeBorderAndPadding instead.
1045
1046         * layout/FormattingContext.cpp:
1047         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1048         * layout/FormattingContext.h:
1049         * layout/inlineformatting/InlineFormattingContext.cpp:
1050         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
1051         * layout/inlineformatting/InlineFormattingContext.h:
1052
1053 2019-02-12  Zalan Bujtas  <zalan@apple.com>
1054
1055         [LFC][IFC] Add intrinsic width support for float boxes.
1056         https://bugs.webkit.org/show_bug.cgi?id=194528
1057
1058         Reviewed by Antti Koivisto.
1059
1060         This patch implements a very simple float box support for intrinsic width.
1061
1062         * layout/inlineformatting/InlineFormattingContext.cpp:
1063         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1064         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
1065         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
1066         (WebCore::Layout::InlineFormattingContext::computeMargin const):
1067         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const): Deleted.
1068         * layout/inlineformatting/InlineFormattingContext.h:
1069
1070 2019-02-12  Rob Buis  <rbuis@igalia.com>
1071
1072         Implement serializing in MIME type parser
1073         https://bugs.webkit.org/show_bug.cgi?id=193909
1074
1075         Reviewed by Darin Adler.
1076
1077         Implement serializing in MIME type parser [1], to preserve the parameter
1078         order the Vector m_parameterNames is introduced, since HashMaps do not
1079         guarantee any order.
1080
1081         Test: ParsedContentType.Serialize
1082
1083         [1] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
1084
1085         * platform/network/ParsedContentType.cpp:
1086         (WebCore::skipSpaces):
1087         (WebCore::parseQuotedString):
1088         (WebCore::ParsedContentType::parseContentType):
1089         (WebCore::ParsedContentType::parameterValueForName const):
1090         (WebCore::ParsedContentType::parameterCount const):
1091         (WebCore::ParsedContentType::setContentType):
1092         (WebCore::ParsedContentType::setContentTypeParameter):
1093         (WebCore::ParsedContentType::serialize const):
1094         * platform/network/ParsedContentType.h:
1095
1096 2019-02-08  Chris Fleizach  <cfleizach@apple.com>
1097
1098         AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc
1099         https://bugs.webkit.org/show_bug.cgi?id=182280
1100         <rdar://problem/37018386>
1101
1102         Reviewed by Alan Bujtas.
1103
1104         Remove the possibility that changing children calls back into updating layout by
1105         handling children changes in a deferred manner.
1106
1107         This follows the same architecture as many other deferred changes, but also requires us to check deferred changes
1108         in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children.
1109
1110         A few tests had to be modified to no longer change the tree and then check the children immediately. 
1111
1112         * accessibility/AXObjectCache.cpp:
1113         (WebCore::AXObjectCache::remove):
1114         (WebCore::AXObjectCache::childrenChanged):
1115         (WebCore::AXObjectCache::prepareForDocumentDestruction):
1116         (WebCore::AXObjectCache::performDeferredCacheUpdate):
1117         * accessibility/AXObjectCache.h:
1118         * accessibility/AccessibilityObject.cpp:
1119         (WebCore::AccessibilityObject::updateBackingStore):
1120         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1121         (convertToNSArray):
1122         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1123
1124 2019-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
1125
1126         [Cocoa] Ask platform for generic font family mappings
1127         https://bugs.webkit.org/show_bug.cgi?id=187723
1128         <rdar://problem/41892438>
1129
1130         Reviewed by Brent Fulgham.
1131
1132         WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
1133         When trying to style a character with a generic font family, we first look to see if
1134         we have a mapping for the particular script the character is rendered with, and if we
1135         don't find a match, we then check USCRIPT_COMMON.
1136
1137         In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
1138         the only scripts which won't use the API families) is in
1139         SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
1140         for the CJK scripts.
1141
1142         The mappings inside SettingsBase are incorrect and conflict with our policy regarding
1143         user-installed fonts. Instead, we should be consulting with the platform for some of
1144         these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
1145         API still has to work to set the mappings for untagged content. Therefore, we use the
1146         system mappings for language-tagged content, and the API mappings for non-language-tagged
1147         content. This is a good balance that makes sure we always have a good mapping for every
1148         language, but API clients can still set the mappings, too.
1149
1150         Test: fast/text/ja-sans-serif.html
1151
1152         * css/CSSComputedStyleDeclaration.cpp:
1153         * css/CSSFontSelector.cpp:
1154         (WebCore::resolveGenericFamily):
1155         * css/parser/CSSPropertyParser.cpp:
1156         (WebCore::consumeFontFamily):
1157         * page/cocoa/SettingsBaseCocoa.mm:
1158         (WebCore::SettingsBase::initializeDefaultFontFamilies):
1159         (WebCore::osakaMonoIsInstalled): Deleted.
1160         * platform/graphics/FontDescription.cpp:
1161         (WebCore::FontDescription::platformResolveGenericFamily):
1162         * platform/graphics/FontDescription.h:
1163         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1164         (WebCore::computeSpecializedChineseLocale):
1165         (WebCore::cachedSpecializedChineseLocale):
1166         (WebCore::languageChanged):
1167         (WebCore::FontDescription::platformResolveGenericFamily):
1168         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1169         (WebCore::SystemFontDatabaseCoreText::clear):
1170         (WebCore::genericFamily):
1171         (WebCore::SystemFontDatabaseCoreText::serifFamily):
1172         (WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
1173         (WebCore::SystemFontDatabaseCoreText::cursiveFamily):
1174         (WebCore::SystemFontDatabaseCoreText::fantasyFamily):
1175         (WebCore::SystemFontDatabaseCoreText::monospaceFamily):
1176         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
1177
1178 2019-02-11  Adrian Perez de Castro  <aperez@igalia.com>
1179
1180         [GTK][WPE] Add content extensions support in WKTR and unskip layout tests
1181         https://bugs.webkit.org/show_bug.cgi?id=193622
1182
1183         Reviewed by Michael Catanzaro.
1184
1185         No new tests needed.
1186
1187         * SourcesCocoa.txt: Remove loader/ResourceLoadInfo.cpp, it's not Cocoa-specific anymore.
1188         * Sources.txt: Add loader/ResourceLoadInfo.cpp, all ports use it now.
1189
1190 2019-02-11  Daniel Bates  <dabates@apple.com>
1191
1192         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1193         https://bugs.webkit.org/show_bug.cgi?id=191446
1194         <rdar://problem/45929460>
1195
1196         Reviewed by Tim Horton.
1197
1198         Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
1199         on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
1200         to be passed to WebKit.
1201
1202         Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
1203                fast/events/touch/ios/pointer-events-with-modifiers.html
1204                fast/events/touch/ios/touch-events-with-modifiers.html
1205
1206         * platform/ios/PlatformEventFactoryIOS.mm:
1207         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1208         * platform/ios/WebEvent.h:
1209         * platform/ios/WebEvent.mm:
1210         (-[WebEvent initWithMouseEventType:timeStamp:location:]):
1211         (-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
1212
1213 2019-02-11  Jer Noble  <jer.noble@apple.com>
1214
1215         [Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
1216         https://bugs.webkit.org/show_bug.cgi?id=194504
1217
1218         Reviewed by Eric Carlson.
1219
1220         This allows the MediaRemote framework to associate the WebContent process with its host application.
1221
1222         * Modules/mediastream/UserMediaRequest.cpp:
1223         (WebCore::UserMediaRequest::start):
1224         * platform/audio/PlatformMediaSessionManager.h:
1225         (WebCore::PlatformMediaSessionManager::prepareToSendUserMediaPermissionRequest):
1226         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
1227         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1228         (MediaSessionManagerCocoa::prepareToSendUserMediaPermissionRequest):
1229         (MediaSessionManagerCocoa::providePresentingApplicationPIDIfNecessary):
1230         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1231
1232 2019-02-11  Commit Queue  <commit-queue@webkit.org>
1233
1234         Unreviewed, rolling out r241272 and r241276.
1235         https://bugs.webkit.org/show_bug.cgi?id=194514
1236
1237         Broke the Apple Internal build and the fix requires human
1238         intervention :( (Requested by dydz on #webkit).
1239
1240         Reverted changesets:
1241
1242         "[iOS] Mouse/Touch/Pointer events are missing modifier keys"
1243         https://bugs.webkit.org/show_bug.cgi?id=191446
1244         https://trac.webkit.org/changeset/241272
1245
1246         "Fix internal iOS build after r241272"
1247         https://bugs.webkit.org/show_bug.cgi?id=191446
1248         https://trac.webkit.org/changeset/241276
1249
1250 2019-02-11  Alex Christensen  <achristensen@webkit.org>
1251
1252         Stop using setDefersLoading from WebCore
1253         https://bugs.webkit.org/show_bug.cgi?id=194315
1254
1255         Reviewed by Jer Noble.
1256
1257         That is what CompletionHandlers are for.
1258
1259         * loader/MediaResourceLoader.cpp:
1260         (WebCore::MediaResource::responseReceived):
1261         (WebCore::MediaResource::setDefersLoading): Deleted.
1262         * loader/MediaResourceLoader.h:
1263         * platform/graphics/PlatformMediaResourceLoader.h:
1264         (WebCore::PlatformMediaResourceClient::responseReceived):
1265         (WebCore::PlatformMediaResource::stop):
1266         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
1267         * platform/network/cocoa/WebCoreNSURLSession.mm:
1268         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1269         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
1270         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
1271         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
1272
1273 2019-02-11  Daniel Bates  <dabates@apple.com>
1274
1275         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1276         https://bugs.webkit.org/show_bug.cgi?id=191446
1277         <rdar://problem/45929460>
1278
1279         Reviewed by Tim Horton.
1280
1281         Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
1282         on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
1283         to be passed to WebKit.
1284
1285         Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
1286                fast/events/touch/ios/pointer-events-with-modifiers.html
1287                fast/events/touch/ios/touch-events-with-modifiers.html
1288
1289         * platform/ios/PlatformEventFactoryIOS.mm:
1290         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1291         * platform/ios/WebEvent.h:
1292         * platform/ios/WebEvent.mm:
1293         (-[WebEvent initWithMouseEventType:timeStamp:location:]):
1294         (-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
1295
1296 2019-02-11  Daniel Bates  <dabates@apple.com>
1297
1298         Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing
1299         https://bugs.webkit.org/show_bug.cgi?id=193591
1300
1301         Reviewed by Simon Fraser.
1302
1303         Untangle the Mac-specific concept of animated focus ring drawing from the concepts of using
1304         the fancy shrink-wrapped focus ring appearance and using the platform focus ring color when
1305         outline-style: auto.
1306
1307         No functionality changed. So, no new tests.
1308
1309         * platform/graphics/GraphicsContext.h:
1310         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1311         (WebCore::drawFocusRing):
1312         (WebCore::drawFocusRingToContextAtTime):
1313         Change some macro guards.
1314
1315         * rendering/RenderElement.cpp:
1316         (WebCore::usePlatformFocusRingColorForOutlineStyleAuto): Added.
1317         (WebCore::useShrinkWrappedFocusRingForOutlineStyleAuto): Added.
1318         (WebCore::drawFocusRing): Added.
1319         (WebCore::RenderElement::paintFocusRing): Write in terms of drawFocusRing().
1320
1321 2019-02-11  Truitt Savell  <tsavell@apple.com>
1322
1323         Unreviewed, rolling out r241229.
1324
1325         Revision broke internal builds for watchOS.
1326
1327         Reverted changeset:
1328
1329         "[Cocoa] Ask platform for generic font family mappings"
1330         https://bugs.webkit.org/show_bug.cgi?id=187723
1331         https://trac.webkit.org/changeset/241229
1332
1333 2019-02-11  Youenn Fablet  <youenn@apple.com>
1334
1335         Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
1336         https://bugs.webkit.org/show_bug.cgi?id=194404
1337         <rdar://problem/47891915>
1338
1339         Reviewed by Geoffrey Garen.
1340
1341         Align with the spec, except for known problematic web sites.
1342         Covered by updated test.
1343
1344         * Modules/fetch/FetchRequest.cpp:
1345         (WebCore::needsSignalQuirk):
1346         (WebCore::processInvalidSignal):
1347         (WebCore::FetchRequest::initializeWith):
1348
1349 2019-02-11  Zalan Bujtas  <zalan@apple.com>
1350
1351         [LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues
1352         https://bugs.webkit.org/show_bug.cgi?id=194490
1353
1354         Reviewed by Antti Koivisto.
1355
1356         This is in preparation for adding floating preferred width computation support. It requires height computaiton
1357         which uses containing block width to resolve vertical margins.
1358
1359         * layout/FormattingContext.cpp:
1360         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1361         * layout/FormattingContext.h:
1362         * layout/FormattingContextGeometry.cpp:
1363         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1364         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1365         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1366         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
1367         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1368         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
1369         * layout/FormattingContextQuirks.cpp:
1370         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1371         * layout/LayoutUnits.h:
1372         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
1373         * layout/blockformatting/BlockFormattingContext.cpp:
1374         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1375         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1376         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1377         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1378         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1379         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1380         * layout/blockformatting/BlockMarginCollapse.cpp:
1381         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
1382         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1383         * layout/inlineformatting/InlineFormattingContext.cpp:
1384         (WebCore::Layout::InlineFormattingContext::layout const):
1385         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1386         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1387         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
1388
1389 2019-02-11  Zalan Bujtas  <zalan@apple.com>
1390
1391         [LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrinsic widths consistently.
1392         https://bugs.webkit.org/show_bug.cgi?id=194483
1393
1394         Reviewed by Antti Koivisto.
1395
1396         Rename intrinsicWidthConstraints to computeIntrinsicWidthConstraints (it does not return the width values anymore).
1397
1398         * layout/FormattingContext.h:
1399         * layout/FormattingContextGeometry.cpp:
1400         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1401         * layout/blockformatting/BlockFormattingContext.cpp:
1402         (WebCore::Layout::BlockFormattingContext::computeIntrinsicWidthConstraints const):
1403         (WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const): Deleted.
1404         * layout/blockformatting/BlockFormattingContext.h:
1405         * layout/inlineformatting/InlineFormattingContext.cpp:
1406         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1407         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
1408         (WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const): Deleted.
1409         * layout/inlineformatting/InlineFormattingContext.h:
1410
1411 2019-02-10  Zalan Bujtas  <zalan@apple.com>
1412
1413         [LFC] Fix spelling error.
1414         https://bugs.webkit.org/show_bug.cgi?id=194489
1415
1416         Reviewed by Simon Fraser.
1417
1418         instrinsic -> intrinsic
1419
1420         * layout/FormattingContext.h:
1421         * layout/FormattingContextGeometry.cpp:
1422         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1423         * layout/FormattingState.h:
1424         (WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
1425         (WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
1426         (WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
1427         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): Deleted.
1428         (WebCore::Layout::FormattingState::clearInstrinsicWidthConstraints): Deleted.
1429         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const): Deleted.
1430         * layout/blockformatting/BlockFormattingContext.cpp:
1431         (WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const):
1432         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): Deleted.
1433         * layout/blockformatting/BlockFormattingContext.h:
1434         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1435         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth):
1436         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
1437         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth): Deleted.
1438         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): Deleted.
1439         * layout/inlineformatting/InlineFormattingContext.cpp:
1440         (WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const):
1441         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
1442         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): Deleted.
1443         * layout/inlineformatting/InlineFormattingContext.h:
1444
1445 2019-02-10  Darin Adler  <darin@apple.com>
1446
1447         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
1448         https://bugs.webkit.org/show_bug.cgi?id=194485
1449
1450         Reviewed by Daniel Bates.
1451
1452         * Modules/websockets/WebSocket.cpp:
1453         (WebCore::encodeProtocolString): Use appendUnsignedAsHexFixedSize instead of String::format.
1454
1455         * css/parser/CSSParserToken.cpp:
1456         (WebCore::CSSParserToken::serialize const): Fixed style of many return statements
1457         that called a function returning void; doesn't match WebKit's prevailing style.
1458         Also use break instead of return. Used appendLiteral instead of append in many
1459         cases, and append character instead of single-character literal in others.
1460         Use appendUnsignedAsHex instead of String::format.
1461
1462         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1463         (WebCore::generateHashedName): Use appendUnsignedAsHex instad of appendUnsigned64AsHex.
1464         Should come back here and use makeString once we make HexNumber.h work with that.
1465
1466         * platform/mac/WebCoreNSURLExtras.mm: Removed unnecessary include of HexNumber.h.
1467
1468         * rendering/RenderTreeAsText.cpp:
1469         (WebCore::quoteAndEscapeNonPrintables): Use appendLiteral instead of multiple calls
1470         to character append. Touched because it was next to a call to appendUnsignedAsHex.
1471
1472 2019-02-10  Pablo Saavedra  <psaavedra@igalia.com>
1473
1474         libWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
1475         https://bugs.webkit.org/show_bug.cgi?id=194484
1476
1477         Reviewed by Darin Adler.
1478
1479         * bindings/js/JSUndoItemCustom.cpp:
1480
1481 2019-02-10  Philippe Normand  <pnormand@igalia.com>
1482
1483         Unreviewed, GTK Debug build fix after r241148.
1484
1485         * Modules/mediasource/SourceBuffer.cpp:
1486         (WebCore::removeSamplesFromTrackBuffer):
1487         SourceBuffer::logClassName and friends are declared for
1488         !RELEASE_LOG_DISABLED builds so adapt calling sites accordingly.
1489
1490 2019-02-10  Zalan Bujtas  <zalan@apple.com>
1491
1492         [LFC][IFC] Add intrinsic width support for inline-block boxes
1493         https://bugs.webkit.org/show_bug.cgi?id=194479
1494
1495         Reviewed by Antti Koivisto.
1496
1497         Compute the intrinsic width for the inline-block (formatting context root) and set it as the content box width while
1498         laying out the content for the min/max width.
1499
1500         <div style="position: absolute">before<span id=inline-block style="display: inline-block">inline_block content<span>after</div>
1501
1502         The "inline-block" formatting root returns "inline_block" width for the minimum and "inline_block width" for
1503         the maximum width. These min/max values are used to figure out the intrinsic width for the parent <div>.
1504
1505         * layout/inlineformatting/InlineFormattingContext.cpp:
1506         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1507         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
1508         (WebCore::Layout::InlineFormattingContext::computeMargin const):
1509         * layout/inlineformatting/InlineFormattingContext.h:
1510         * page/FrameViewLayoutContext.cpp:
1511         (WebCore::layoutUsingFormattingContext):
1512
1513 2019-02-10  Zalan Bujtas  <zalan@apple.com>
1514
1515         [LFC][IFC] Add intrinsic width support for replaced boxes
1516         https://bugs.webkit.org/show_bug.cgi?id=194478
1517
1518         Reviewed by Antti Koivisto.
1519
1520         * layout/inlineformatting/InlineFormattingContext.cpp:
1521         (WebCore::Layout::InlineFormattingContext::layout const):
1522         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1523         (WebCore::Layout::InlineFormattingContext::computeMargin const):
1524         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
1525         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1526         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
1527         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const): Deleted.
1528         * layout/inlineformatting/InlineFormattingContext.h:
1529
1530 2019-02-10  Alicia Boya García  <aboya@igalia.com>
1531
1532         [MSE][GStreamer] Add missing return type to lambda
1533         https://bugs.webkit.org/show_bug.cgi?id=194414
1534
1535         Reviewed by Darin Adler.
1536
1537         Since g_signal_connect() is untyped, a compiler error was not
1538         generated when a lambda with a missing GstFlowReturn return type was
1539         provided for a signal that expects it.
1540
1541         This used to work before r240784 because a recent function call had
1542         set GST_FLOW_OK in the return value register and it happened to
1543         survive until the lambda function call ended. Starting on that commit
1544         such return value was removed and it stopped working on debug.
1545
1546         Of course, the actual problem is in the signature of the lambda
1547         function, and this patch fixes that.
1548
1549         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1550         (WebCore::AppendPipeline::AppendPipeline):
1551
1552 2019-02-09  Darin Adler  <darin@apple.com>
1553
1554         Eliminate unnecessary String temporaries by using StringConcatenateNumbers
1555         https://bugs.webkit.org/show_bug.cgi?id=194021
1556
1557         Reviewed by Geoffrey Garen.
1558
1559         For floating point numbers, String::number gives a fixed precision result,
1560         stripping trailing zeroes. When possible, I changed the code to instead use the
1561         equivalent of String::numberToStringECMAScript, which is what makeString does by
1562         default for floating point, gives the same results for many cases, and gives
1563         better results in many others. However, for floats, we do not yet have a good
1564         implementation, so instead I used FormattedNumber::fixedPrecision to match
1565         the old behavior.
1566
1567         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1568         (WebCore::IDBTransactionInfo::loggingString const): Remove String::number and let
1569         makeString do the conversion without allocating/destroying a String.
1570         * Modules/websockets/ThreadableWebSocketChannel.cpp:
1571         (WebCore::ThreadableWebSocketChannel::create): Ditto.
1572         * Modules/websockets/WebSocket.cpp:
1573         (WebCore::WebSocket::connect): Ditto. Added a cast to "unsigned" to sidestep the
1574         ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
1575         and sometimes used for UTF-16 code units (UChar) and can be the same type.
1576
1577         * Modules/websockets/WebSocketChannel.cpp:
1578         (WebCore::WebSocketChannel::didFailSocketStream): Use ASCIILiteral when intializing
1579         a string instead of just a normal C literal. Switched to makeString so we could
1580         remove String::number and do the conversion without allocating/destroying a String.
1581         (WebCore::WebSocketChannel::didFail): Ditto.
1582         (WebCore::WebSocketChannel::processFrame): Ditto.
1583         * Modules/websockets/WebSocketFrame.cpp:
1584         (WebCore::WebSocketFrame::parseFrame): Ditto.
1585         * Modules/websockets/WebSocketHandshake.cpp:
1586         (WebCore::WebSocketHandshake::readServerHandshake): Ditto.
1587         * accessibility/AccessibilityRenderObject.cpp:
1588         (WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA const): Ditto.
1589         * bindings/js/JSDOMConvertNumbers.cpp:
1590         (WebCore::rangeErrorString): Ditto.
1591         * css/CSSAspectRatioValue.cpp:
1592         (WebCore::CSSAspectRatioValue::customCSSText const): Ditto. Used
1593         FormattedNumber::fixedPrecision since these are floats.
1594
1595         * css/DOMMatrixReadOnly.cpp:
1596         (WebCore::DOMMatrixReadOnly::toString const): Use
1597         StringBuilder::builder.appendECMAScriptNumber instead of
1598         String::numberToStringECMAScript so we can do it without allocating/destroying
1599         a String.
1600         * css/WebKitCSSMatrix.cpp:
1601         (WebCore::WebKitCSSMatrix::toString const): Ditto.
1602
1603         * dom/MessagePortIdentifier.h:
1604         (WebCore::MessagePortIdentifier::logString const): Remove String::number and let
1605         makeString do the conversion without allocating/destroying a String.
1606
1607         * editing/cocoa/DataDetection.mm:
1608         (WebCore::dataDetectorStringForPath): Remove unnecessary type casts on values
1609         passed to String::number and to StringBuilder::appendNumber. These could do
1610         harm if the values were out of range, and should not be necessary.
1611
1612         * history/BackForwardItemIdentifier.h:
1613         (WebCore::BackForwardItemIdentifier::logString const): Remove String::number
1614         and let makeString do the conversion without allocating/destroying a String.
1615         * html/FTPDirectoryDocument.cpp:
1616         (WebCore::processFileDateString): Ditto.
1617         * html/canvas/WebGLRenderingContextBase.cpp:
1618         (WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
1619         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Ditto.
1620         * inspector/agents/WebConsoleAgent.cpp:
1621         (WebCore::WebConsoleAgent::didReceiveResponse): Ditto.
1622         * loader/WorkerThreadableLoader.cpp:
1623         (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
1624         * loader/appcache/ApplicationCacheGroup.cpp:
1625         (WebCore::ApplicationCacheGroup::didFailLoadingManifest): Ditto.
1626         * page/PageSerializer.cpp:
1627         (WebCore::PageSerializer::urlForBlankFrame): Ditto.
1628         * page/PrintContext.cpp:
1629         (WebCore::PrintContext::pageProperty): Ditto.
1630         (WebCore::PrintContext::pageSizeAndMarginsInPixels): Ditto.
1631
1632         * page/WheelEventTestTrigger.cpp:
1633         (WebCore::dumpState): Use StringBuilder::appendNumber instead of
1634         String::number so we can do it without allocating/destroying a String.
1635         Also use StringBuilder::appendLiteral on a literal.
1636
1637         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1638         (WebCore::ResourceUsageOverlay::platformDraw): Pass explicit
1639         KeepTrailingZeros to FormattedNumber::fixedPrecision to preserve behavior,
1640         since default is now to truncate trailing zeros.
1641
1642         * platform/graphics/Color.cpp:
1643         (WebCore::Color::cssText): Use StringBuilder::appendNumber instead of
1644         calling numberToFixedPrecisionString to do the same thing.
1645         * platform/graphics/ExtendedColor.cpp:
1646         (WebCore::ExtendedColor::cssText): Ditto.
1647
1648         * platform/graphics/ca/GraphicsLayerCA.cpp:
1649         (WebCore::animationIdentifier): Remove String::number and let makeString
1650         do the conversion without allocating/destroying a String. Had to add
1651         a typecast to convert the enumeration into an integer.
1652         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
1653         (WebCore::PlatformCAFilters::setFiltersOnLayer): Ditto.
1654         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1655         (WebCore::FontPlatformData::description const): Ditto.
1656
1657         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1658         (WebCore::MockMediaSample::MockMediaSample): Use AtomicString::number
1659         instead of String::number to avoid unneccessarily allocating an additional
1660         temporary String when an AtomicString already exists.
1661
1662         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1663         (WebCore::SocketStreamHandleImpl::reportErrorToClient): Remove String::number
1664         and let makeString do the conversion without allocating/destroying a String.
1665         * platform/sql/SQLiteDatabase.cpp:
1666         (WebCore::SQLiteDatabase::setMaximumSize): Ditto.
1667         (WebCore::SQLiteDatabase::setSynchronous): Ditto. Had to add a typecast to
1668         convert the enumeration into an integer.
1669         * svg/SVGAngleValue.cpp:
1670         (WebCore::SVGAngleValue::valueAsString const): Ditto.
1671         * svg/SVGLengthValue.cpp:
1672         (WebCore::SVGLengthValue::valueAsString const): Ditto.
1673         * testing/Internals.cpp:
1674         (WebCore::Internals::configurationForViewport): Ditto. Used
1675         FormattedNumber::fixedPrecision since these are floats.
1676         (WebCore::Internals::getCurrentCursorInfo): Use StringBuilder::appendNumber
1677         instead of calling numberToFixedPrecisionString to do the same thing.
1678         (WebCore::Internals::queueMicroTask): Remove String::number and let makeString
1679         do the conversion without allocating/destroying a String.
1680         (WebCore::appendOffsets): Use StringBuilder::appendNumber instead of
1681         String::number so we can do it without allocating/destroying a String.
1682
1683         * workers/service/ServiceWorkerClientIdentifier.h:
1684         (WebCore::ServiceWorkerClientIdentifier::toString const): Remove String::number
1685         and let makeString do the conversion without allocating/destroying a String.
1686         * workers/service/server/RegistrationDatabase.cpp:
1687         (WebCore::databaseFilenameFromVersion): Ditto.
1688
1689 2019-02-09  Zalan Bujtas  <zalan@apple.com>
1690
1691         [LFC][IFC] Add intrinsic width support for basic inline containers
1692         https://bugs.webkit.org/show_bug.cgi?id=194473
1693
1694         Reviewed by Antti Koivisto.
1695
1696         Preferred width computation logic is very similar to normal layout.
1697         One of the main difference is that the preferred width codepath does not provide valid containing block width.
1698         This patch implement basic inline container support by passing nullopt containing block width in UsedHorizontalValues. 
1699
1700         * layout/inlineformatting/InlineFormattingContext.cpp:
1701         (WebCore::Layout::InlineFormattingContext::layout const):
1702         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1703         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
1704         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
1705         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
1706         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1707         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
1708         * layout/inlineformatting/InlineFormattingContext.h:
1709
1710 2019-02-08  Myles C. Maxfield  <mmaxfield@apple.com>
1711
1712         [Cocoa] CTLineGetGlyphRuns() might return nullptr
1713         https://bugs.webkit.org/show_bug.cgi?id=194467
1714         <rdar://problem/42423999>
1715
1716         Reviewed by Simon Fraser.
1717
1718         Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.
1719
1720         Covered by find/text/find-backwards.html
1721
1722         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1723         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1724
1725 2019-02-08  Myles C. Maxfield  <mmaxfield@apple.com>
1726
1727         [Cocoa] Ask platform for generic font family mappings
1728         https://bugs.webkit.org/show_bug.cgi?id=187723
1729         <rdar://problem/41892438>
1730
1731         Reviewed by Brent Fulgham.
1732
1733         WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
1734         When trying to style a character with a generic font family, we first look to see if
1735         we have a mapping for the particular script the character is rendered with, and if we
1736         don't find a match, we then check USCRIPT_COMMON.
1737
1738         In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
1739         the only scripts which won't use the API families) is in
1740         SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
1741         for the CJK scripts.
1742
1743         The mappings inside SettingsBase are incorrect and conflict with our policy regarding
1744         user-installed fonts. Instead, we should be consulting with the platform for some of
1745         these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
1746         API still has to work to set the mappings for untagged content. Therefore, we use the
1747         system mappings for language-tagged content, and the API mappings for non-language-tagged
1748         content. This is a good balance that makes sure we always have a good mapping for every
1749         language, but API clients can still set the mappings, too.
1750
1751         Test: fast/text/ja-sans-serif.html
1752
1753         * css/CSSComputedStyleDeclaration.cpp:
1754         * css/CSSFontSelector.cpp:
1755         (WebCore::resolveGenericFamily):
1756         * css/parser/CSSPropertyParser.cpp:
1757         (WebCore::consumeFontFamily):
1758         * page/cocoa/SettingsBaseCocoa.mm:
1759         (WebCore::SettingsBase::initializeDefaultFontFamilies):
1760         (WebCore::osakaMonoIsInstalled): Deleted.
1761         * platform/graphics/FontDescription.cpp:
1762         (WebCore::FontDescription::platformResolveGenericFamily):
1763         * platform/graphics/FontDescription.h:
1764         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1765         (WebCore::computeSpecializedChineseLocale):
1766         (WebCore::cachedSpecializedChineseLocale):
1767         (WebCore::languageChanged):
1768         (WebCore::FontDescription::platformResolveGenericFamily):
1769         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1770         (WebCore::SystemFontDatabaseCoreText::clear):
1771         (WebCore::SystemFontDatabaseCoreText::serifFamily):
1772         (WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
1773         (WebCore::SystemFontDatabaseCoreText::cursiveFamily):
1774         (WebCore::SystemFontDatabaseCoreText::fantasyFamily):
1775         (WebCore::SystemFontDatabaseCoreText::monospaceFamily):
1776         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
1777
1778 2019-02-08  Yusuke Suzuki  <ysuzuki@apple.com>
1779
1780         [JSC] Shrink sizeof(CodeBlock) more
1781         https://bugs.webkit.org/show_bug.cgi?id=194419
1782
1783         Reviewed by Mark Lam.
1784
1785         * testing/Internals.cpp:
1786         (WebCore::Internals::parserMetaData):
1787
1788 2019-02-08  Chris Dumez  <cdumez@apple.com>
1789
1790         [Cocoa] Optimize ResourceResponse::platformLazyInit()
1791         https://bugs.webkit.org/show_bug.cgi?id=194438
1792
1793         Reviewed by Alex Christensen.
1794
1795         Optimize ResourceResponse::platformLazyInit(). Most of the CPU time currently goes into getting the
1796         HTTP headers from CFNetwork:
1797         """
1798         Sample Count, Samples %, CPU %, Symbol
1799         46, 0.0%, 0.0%, WebCore::initializeHTTPHeaders(WebCore::OnlyCommonHeaders, NSHTTPURLResponse*, WebCore::HTTPHeaderMap&) (in WebCore)
1800         34, 0.0%, 0.0%,     HTTPHeaderDict::copyAsOrdinaryDict(__CFAllocator const*) const (in CFNetwork)
1801         11, 0.0%, 0.0%,     CFDictionaryApplyFunction (in CoreFoundation)
1802         """
1803
1804         We currently have 2 levels of initialization: CommonFieldsOnly & AllFields. With WebKit2, most ResourceResponses get sent over IPC
1805         and thus end up getting initialized twice, once with CommonFieldsOnly and then with AllFields.
1806         This would cause us to call the expensive HTTPHeaderDict::copyAsOrdinaryDict() twice instead of once, simply to initialize the common
1807         HTTP headers first and then the uncommon ones later.
1808
1809         This patch updates ResourceResponse::platformLazyInit() to initialize all HTTP headers at once, as soon as CommonFieldsOnly
1810         initialization is requested, so that we no longer copy all HTTP headers twice.
1811
1812         * platform/network/cocoa/ResourceResponseCocoa.mm:
1813         (WebCore::initializeHTTPHeaders):
1814         (WebCore::ResourceResponse::platformLazyInit):
1815
1816 2019-02-08  Justin Fan  <justin_fan@apple.com>
1817
1818         [Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
1819         https://bugs.webkit.org/show_bug.cgi?id=194443
1820
1821         Unreviewed build fix.
1822
1823         For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
1824         if not using MTLStorageModePrivate, must use MTLStorageModeShared.
1825
1826         Behavior unchanged.
1827
1828         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
1829         (WebCore::storageModeForPixelFormatAndSampleCount):
1830
1831 2019-02-08  Per Arne Vollan  <pvollan@apple.com>
1832
1833         [WebVTT] Inline WebVTT styles should start with '::cue'
1834         https://bugs.webkit.org/show_bug.cgi?id=194227
1835         <rdar://problem/47791087>
1836
1837         Reviewed by Eric Carlson.
1838
1839         Check that the CSS string starts with '::cue' and is successfully parsed before adding it
1840         to the CSS stylesheet list. Also, the caption preferences CSS string should start with
1841         '::cue', since it is added inside the video shadow root element.
1842
1843         Test: media/track/track-cue-css.html
1844
1845         * html/track/WebVTTParser.cpp:
1846         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
1847         * page/CaptionUserPreferencesMediaAF.cpp:
1848         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
1849
1850 2019-02-08  Youenn Fablet  <youenn@apple.com>
1851
1852         Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
1853         https://bugs.webkit.org/show_bug.cgi?id=194380
1854         <rdar://problem/47916514>
1855
1856         Reviewed by Eric Carlson.
1857
1858         Set whether VP8 is supported at creation of the page.
1859         This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.
1860
1861         Add internal API to enable resetting the factory to enable proper testing.
1862
1863         Covered by updated test.
1864
1865         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1866         (WebCore::createLibWebRTCPeerConnectionBackend):
1867         * page/Page.cpp:
1868         (WebCore::m_applicationManifest):
1869         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1870         * testing/Internals.cpp:
1871         (WebCore::Internals::clearPeerConnectionFactory):
1872         * testing/Internals.h:
1873         * testing/Internals.idl:
1874
1875 2019-02-08  Andy Estes  <aestes@apple.com>
1876
1877         [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces
1878         https://bugs.webkit.org/show_bug.cgi?id=190997
1879         <rdar://problem/35983035>
1880
1881         Reviewed by Brent Fulgham.
1882
1883         Support serializing sequences and FrozenArrays of types that aren't interfaces. This is
1884         needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings.
1885
1886         We should support serializing sequences of interfaces too, but that's slightly more
1887         complicated since it involves iterating the sequence and serializing each of its items. I
1888         left that as a follow-up task, since I don't see any IDLs that currently need this.
1889
1890         We also don't support serializing sequences with the CachedAttribute or CustomGetter
1891         extended attributes, because WebIDL specifies that a new array should be created when
1892         converting an IDL sequence into an ECMAScript value.
1893
1894         Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to
1895         http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html.
1896
1897         * bindings/scripts/CodeGenerator.pm:
1898         (GetInterfaceForType): Renamed from GetInterfaceForAttribute.
1899         (IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types.
1900         (hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an
1901         attribute has the CachedAttribute or CustomGetter extended attributes.
1902         (IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter
1903         extended attributes before calling IsSerializableType.
1904         (GetInterfaceForAttribute): Renamed to GetInterfaceForType.
1905         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1906         * bindings/scripts/test/TestSerialization.idl:
1907
1908 2019-02-08  Sihui Liu  <sihui_liu@apple.com>
1909
1910         IndexedDB tests leak documents
1911         https://bugs.webkit.org/show_bug.cgi?id=189435
1912         <rdar://problem/44240043>
1913
1914         Reviewed by Geoffrey Garen.
1915
1916         Remove use of JSC::Strong in IndexedDatabase.
1917
1918         * Modules/indexeddb/IDBCursor.cpp:
1919         (WebCore::IDBCursor::update):
1920         (WebCore::IDBCursor::continuePrimaryKey):
1921         (WebCore::IDBCursor::continueFunction):
1922         (WebCore::IDBCursor::deleteFunction):
1923         (WebCore::IDBCursor::setGetResult):
1924         * Modules/indexeddb/IDBCursor.h:
1925         (WebCore::IDBCursor::key):
1926         (WebCore::IDBCursor::primaryKey):
1927         (WebCore::IDBCursor::value):
1928         (WebCore::IDBCursor::keyWrapper):
1929         (WebCore::IDBCursor::primaryKeyWrapper):
1930         (WebCore::IDBCursor::valueWrapper):
1931         (WebCore::IDBCursor::key const): Deleted.
1932         (WebCore::IDBCursor::primaryKey const): Deleted.
1933         (WebCore::IDBCursor::value const): Deleted.
1934         * Modules/indexeddb/IDBCursor.idl:
1935         * Modules/indexeddb/IDBCursorWithValue.idl:
1936         * Modules/indexeddb/IDBObjectStore.cpp:
1937         (WebCore::IDBObjectStore::putForCursorUpdate):
1938         * Modules/indexeddb/IDBObjectStore.h:
1939         * Modules/indexeddb/IDBRequest.cpp:
1940         (WebCore::IDBRequest::IDBRequest):
1941         (WebCore::IDBRequest::~IDBRequest):
1942         (WebCore::IDBRequest::result const):
1943         (WebCore::IDBRequest::setResult):
1944         (WebCore::IDBRequest::setResultToStructuredClone):
1945         (WebCore::IDBRequest::setResultToUndefined):
1946         (WebCore::IDBRequest::resultCursor):
1947         (WebCore::IDBRequest::willIterateCursor):
1948         (WebCore::IDBRequest::didOpenOrIterateCursor):
1949         * Modules/indexeddb/IDBRequest.h:
1950         (WebCore::IDBRequest::resultWrapper):
1951         * Modules/indexeddb/IDBRequest.idl:
1952         * Sources.txt:
1953         * WebCore.xcodeproj/project.pbxproj:
1954         * bindings/js/JSIDBCursorCustom.cpp:
1955         (WebCore::JSIDBCursor::key const):
1956         (WebCore::JSIDBCursor::primaryKey const):
1957         (WebCore::JSIDBCursor::visitAdditionalChildren):
1958         * bindings/js/JSIDBCursorWithValueCustom.cpp:
1959         (WebCore::JSIDBCursorWithValue::value const):
1960         (WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
1961         * bindings/js/JSIDBRequestCustom.cpp: Added.
1962         (WebCore::JSIDBRequest::result const):
1963         (WebCore::JSIDBRequest::visitAdditionalChildren):
1964         * inspector/agents/InspectorIndexedDBAgent.cpp:
1965
1966 2019-02-08  Zalan Bujtas  <zalan@apple.com>
1967
1968         [LFC] The used containing block width value is optional
1969         https://bugs.webkit.org/show_bug.cgi?id=194428
1970
1971         Reviewed by Antti Koivisto.
1972
1973         The preferred width codepath cannot provide a valid used containing block width value.
1974
1975         "The percentage is calculated with respect to the width of the generated box's containing block.
1976         If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.2."
1977
1978         Let's use 0 as used value for now.
1979
1980         * layout/FormattingContextGeometry.cpp:
1981         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1982         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1983         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1984         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1985         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1986         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1987         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1988         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
1989         * layout/LayoutUnits.h:
1990         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
1991         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1992         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1993         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1994         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1995         * page/FrameViewLayoutContext.cpp:
1996
1997 2019-02-08  Zalan Bujtas  <zalan@apple.com>
1998
1999         [LFC] Horizontal geometry compute functions should take the containing block's width as a used value
2000         https://bugs.webkit.org/show_bug.cgi?id=194424
2001
2002         Reviewed by Antti Koivisto.
2003
2004         This is in preparation for passing optional containing block width for the preferred with codepath. 
2005
2006         * layout/FormattingContext.cpp:
2007         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2008         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2009         * layout/FormattingContext.h:
2010         * layout/FormattingContextGeometry.cpp:
2011         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2012         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2013         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2014         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2015         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2016         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2017         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
2018         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
2019         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
2020         * layout/LayoutUnits.h:
2021         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
2022         * layout/blockformatting/BlockFormattingContext.cpp:
2023         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2024         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2025         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2026         * layout/inlineformatting/InlineFormattingContext.cpp:
2027         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
2028         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2029         * layout/inlineformatting/InlineFormattingContext.h:
2030         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2031         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2032
2033 2019-02-08  Benjamin Poulain  <benjamin@webkit.org>
2034
2035         clampTo(): do not convert the input to double when dealing with integers
2036         https://bugs.webkit.org/show_bug.cgi?id=194263
2037         <rdar://problem/47692312>
2038
2039         Reviewed by Darin Adler.
2040
2041         Make the calls to clampTo<float>() unambiguous.
2042
2043         * page/FrameView.cpp:
2044         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
2045         * rendering/style/RenderStyle.h:
2046         (WebCore::RenderStyle::setOpacity):
2047         (WebCore::RenderStyle::setShapeImageThreshold):
2048
2049 2019-02-08  Eric Liang  <ericliang@apple.com>
2050
2051         When performing AXPress, check to see if the menu list is disabled.
2052         https://bugs.webkit.org/show_bug.cgi?id=193878
2053
2054         Reviewed by Chris Fleizach.
2055
2056         Test: accessibility/mac/press-not-work-for-disabled-menu-list.html
2057
2058         * accessibility/AXObjectCache.h:
2059         * accessibility/AccessibilityMenuList.cpp:
2060         (WebCore::AccessibilityMenuList::press):
2061         * accessibility/mac/AXObjectCacheMac.mm:
2062         (WebCore::AXObjectCache::postPlatformNotification):
2063
2064 2019-02-07  Devin Rousso  <drousso@apple.com>
2065
2066         PseudoElement created for any ::before/::after selector regardless of whether a content property exists
2067         https://bugs.webkit.org/show_bug.cgi?id=194423
2068         <rdar://problem/46787260>
2069
2070         Reviewed by Antti Koivisto.
2071
2072         Test: inspector/css/pseudo-creation.html
2073
2074         * style/StyleTreeResolver.cpp:
2075         (WebCore::Style::TreeResolver::resolvePseudoStyle):
2076         We should only be creating `PseudoElement`s if we actually have a `content` proprety in the
2077         `PseudoElement`'s style. Otherwise, we end up creating `PseudoElement`s for every CSS rule
2078         that has a `::before`/`::after`, only to immediately destroy them as there is nothing to show.
2079
2080 2019-02-07  Chris Dumez  <cdumez@apple.com>
2081
2082         Mark more heap-allocated classes as fast allocated
2083         https://bugs.webkit.org/show_bug.cgi?id=194422
2084
2085         Reviewed by Ryosuke Niwa.
2086
2087         * Modules/applepay/PaymentCoordinator.h:
2088         * Modules/beacon/NavigatorBeacon.h:
2089         * Modules/cache/DOMWindowCaches.h:
2090         * Modules/cache/WorkerGlobalScopeCaches.h:
2091         * Modules/credentialmanagement/NavigatorCredentials.h:
2092         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
2093         * Modules/gamepad/NavigatorGamepad.h:
2094         * Modules/indexeddb/IDBGetAllResult.h:
2095         * Modules/indexeddb/IDBGetResult.h:
2096         * Modules/indexeddb/IDBKeyData.h:
2097         * Modules/indexeddb/IDBValue.h:
2098         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
2099         * Modules/indexeddb/server/IndexValueEntry.h:
2100         * Modules/indexeddb/server/IndexValueStore.h:
2101         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2102         * Modules/indexeddb/server/MemoryCursor.h:
2103         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2104         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2105         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2106         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
2107         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2108         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2109         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2110         * Modules/indexeddb/shared/IDBTransactionInfo.h:
2111         * Modules/mediacapabilities/NavigatorMediaCapabilities.h:
2112         * Modules/mediasession/WebMediaSessionManager.cpp:
2113         * Modules/mediastream/NavigatorMediaDevices.h:
2114         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2115         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
2116         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2117         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
2118         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
2119         * Modules/quota/DOMWindowQuota.h:
2120         * Modules/quota/NavigatorStorageQuota.h:
2121         * Modules/quota/WorkerNavigatorStorageQuota.h:
2122         * Modules/speech/DOMWindowSpeechSynthesis.h:
2123         * Modules/webaudio/BiquadProcessor.h:
2124         * Modules/webaudio/DelayProcessor.h:
2125         * Modules/webauthn/fido/FidoHidPacket.h:
2126         * Modules/webdriver/NavigatorWebDriver.h:
2127         * Modules/webgpu/DOMWindowWebGPU.h:
2128         * Modules/websockets/WebSocketChannel.h:
2129         * Modules/webvr/NavigatorWebVR.h:
2130         * accessibility/AXObjectCache.h:
2131         * bindings/js/DOMGCOutputConstraint.h:
2132         * bindings/js/DOMPromiseProxy.h:
2133         * bridge/c/c_runtime.h:
2134         * contentextensions/CombinedURLFilters.cpp:
2135         * crypto/CryptoAlgorithmParameters.h:
2136         * css/CSSComputedStyleDeclaration.h:
2137         * css/CSSRegisteredCustomProperty.h:
2138         * css/DOMCSSPaintWorklet.h:
2139         * css/DOMCSSRegisterCustomProperty.h:
2140         * css/StyleRule.h:
2141         * dom/ConstantPropertyMap.h:
2142         * dom/CustomElementReactionQueue.h:
2143         * dom/Document.h:
2144         * dom/GenericEventQueue.h:
2145         * dom/RejectedPromiseTracker.h:
2146         * dom/UserGestureIndicator.h:
2147         * editing/ReplaceSelectionCommand.cpp:
2148         * editing/SelectionRectGatherer.h:
2149         * editing/TextIterator.h:
2150         * editing/cocoa/HTMLConverter.mm:
2151         * fileapi/AsyncFileStream.cpp:
2152         * fileapi/AsyncFileStream.h:
2153         * html/forms/FileIconLoader.h:
2154         * html/parser/HTMLTreeBuilder.h:
2155         * html/track/WebVTTParser.h:
2156         * inspector/DOMPatchSupport.cpp:
2157         * loader/FrameLoaderClient.h:
2158         * loader/WorkerThreadableLoader.cpp:
2159         * page/IntersectionObserver.h:
2160         * page/PerformanceMonitor.h:
2161         * page/PerformanceUserTiming.h:
2162         * page/PrintContext.h:
2163         * page/ValidationMessageClient.h:
2164         * platform/ColorChooser.h:
2165         * platform/ControlStates.h:
2166         * platform/DataListSuggestionPicker.h:
2167         * platform/FileStream.h:
2168         * platform/KeyedCoding.h:
2169         * platform/LowPowerModeNotifier.h:
2170         * platform/PlatformSpeechSynthesizer.h:
2171         * platform/WebGLStateTracker.h:
2172         * platform/audio/AudioArray.h:
2173         * platform/audio/AudioDestination.h:
2174         * platform/audio/DownSampler.h:
2175         * platform/audio/DynamicsCompressor.h:
2176         * platform/audio/FFTFrame.h:
2177         * platform/audio/HRTFDatabase.h:
2178         * platform/audio/MultiChannelResampler.h:
2179         * platform/audio/Panner.h:
2180         * platform/audio/Reverb.h:
2181         * platform/audio/ReverbConvolver.h:
2182         * platform/audio/ReverbConvolverStage.h:
2183         * platform/audio/UpSampler.h:
2184         * platform/audio/mac/AudioSessionMac.cpp:
2185         * platform/audio/mac/CAAudioStreamDescription.h:
2186         * platform/audio/mac/CARingBuffer.h:
2187         * platform/cocoa/ScrollSnapAnimatorState.h:
2188         * platform/gamepad/PlatformGamepad.h:
2189         * platform/graphics/GraphicsLayer.cpp:
2190         * platform/graphics/GraphicsLayerFactory.h:
2191         * platform/graphics/PlatformTimeRanges.h:
2192         * platform/graphics/TextTrackRepresentation.h:
2193         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
2194         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2195         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2196         * platform/graphics/displaylists/DisplayListRecorder.h:
2197         * platform/network/cocoa/WebCoreNSURLSession.mm:
2198         * platform/sql/SQLiteDatabase.h:
2199         * platform/text/TextCodecICU.h:
2200         * rendering/GridBaselineAlignment.h:
2201         * rendering/GridTrackSizingAlgorithm.h:
2202         * rendering/RenderObject.h:
2203         * rendering/style/GridArea.h:
2204         * workers/service/context/SWContextManager.h:
2205
2206 2019-02-07  Justin Fan  <justin_fan@apple.com>
2207
2208         [Web GPU] GPUDevice::createTexture implementation prototype
2209         https://bugs.webkit.org/show_bug.cgi?id=194409
2210         <rdar://problem/47894312>
2211
2212         Reviewed by Myles C. Maxfield.
2213
2214         Test: textures-textureviews.html updated to test new functionality.
2215
2216         Implement GPUDevice::createTexture():
2217         * Modules/webgpu/WebGPUDevice.cpp:
2218         (WebCore::WebGPUDevice::createTexture const):
2219         * Modules/webgpu/WebGPUDevice.h:
2220         * Modules/webgpu/WebGPUDevice.idl:
2221         * Modules/webgpu/WebGPUTexture.cpp:
2222         (WebCore::WebGPUTexture::create): Modified to return non-nullable to match direction of API.
2223         (WebCore::WebGPUTexture::WebGPUTexture):
2224         * Modules/webgpu/WebGPUTexture.h:
2225
2226         Metal backend MTLTextureDescriptor and MTLTexture creation:
2227         * platform/graphics/gpu/GPUDevice.cpp:
2228         (WebCore::GPUDevice::tryCreateTexture const):
2229         * platform/graphics/gpu/GPUDevice.h:
2230         * platform/graphics/gpu/GPUTexture.h:
2231         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
2232         (WebCore::mtlTextureTypeForGPUTextureDescriptor):
2233         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
2234         (WebCore::storageModeForPixelFormatAndSampleCount):
2235         (WebCore::tryCreateMtlTextureDescriptor):
2236         (WebCore::GPUTexture::tryCreate):
2237         (WebCore::GPUTexture::createDefaultTextureView): Add ObjC try/catch guards.
2238
2239         Add GPUUtils.h/cpp for shared utility functions:
2240         * SourcesCocoa.txt:
2241         * WebCore.xcodeproj/project.pbxproj:
2242         * platform/graphics/gpu/GPUUtils.h: Added. Moved platformTextureFormatForGPUTextureFormat here.
2243         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2244         (WebCore::GPUSwapChain::setFormat):
2245         (WebCore::platformTextureFormatForGPUTextureFormat): Moved to GPUUtils.
2246         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Added.
2247         (WebCore::platformTextureFormatForGPUTextureFormat): Moved here to be referenced by multiple files.
2248
2249 2019-02-07  Sihui Liu  <sihui_liu@apple.com>
2250
2251         REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&)
2252         https://bugs.webkit.org/show_bug.cgi?id=194402
2253         <rdar://problem/47858241>
2254
2255         Reviewed by Geoffrey Garen.
2256
2257         r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be
2258         around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it
2259         is valid during access.
2260
2261         * Modules/indexeddb/server/ServerOpenDBRequest.cpp:
2262         (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
2263         (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
2264         * Modules/indexeddb/server/ServerOpenDBRequest.h:
2265
2266 2019-02-07  Timothy Hatcher  <timothy@apple.com>
2267
2268         Overflow element scrollbar is light for dark mode content.
2269         https://bugs.webkit.org/show_bug.cgi?id=194407
2270         rdar://problem/45991585
2271
2272         Reviewed by Beth Dakin.
2273
2274         Tested by css-dark-mode/supported-color-schemes-scrollbar.html.
2275
2276         * page/ChromeClient.h:
2277         (WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
2278         short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
2279         that do not implement preferredScrollbarOverlayStyle().
2280         * page/FrameView.cpp:
2281         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
2282         to auto detect overlay style when page() is null.
2283         * rendering/RenderLayer.cpp:
2284         (WebCore::RenderLayer::useDarkAppearance const): Added.
2285         * rendering/RenderLayer.h:
2286         * testing/Internals.cpp:
2287         (WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
2288         (WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
2289         * testing/Internals.h:
2290         * testing/Internals.idl:
2291
2292 2019-02-07  Eric Carlson  <eric.carlson@apple.com>
2293
2294         [MSE] Convert debug-only logging to runtime logging
2295         https://bugs.webkit.org/show_bug.cgi?id=194348
2296         <rdar://problem/47566449>
2297
2298         Reviewed by Jer Noble.
2299
2300         No new tests, this just changes existing logging.
2301
2302         * Modules/mediasource/MediaSource.cpp:
2303         (WebCore::convertEnumerationToString):
2304         (WebCore::MediaSource::MediaSource):
2305         (WebCore::MediaSource::~MediaSource):
2306         (WebCore::MediaSource::setPrivateAndOpen):
2307         (WebCore::MediaSource::addedToRegistry):
2308         (WebCore::MediaSource::removedFromRegistry):
2309         (WebCore::MediaSource::durationChanged):
2310         (WebCore::MediaSource::seekToTime):
2311         (WebCore::MediaSource::completeSeek):
2312         (WebCore::MediaSource::setLiveSeekableRange):
2313         (WebCore::MediaSource::clearLiveSeekableRange):
2314         (WebCore::MediaSource::setDuration):
2315         (WebCore::MediaSource::setDurationInternal):
2316         (WebCore::MediaSource::setReadyState):
2317         (WebCore::MediaSource::endOfStream):
2318         (WebCore::MediaSource::streamEndedWithError):
2319         (WebCore::MediaSource::addSourceBuffer):
2320         (WebCore::MediaSource::removeSourceBuffer):
2321         (WebCore::MediaSource::isTypeSupported):
2322         (WebCore::MediaSource::detachFromElement):
2323         (WebCore::MediaSource::attachToElement):
2324         (WebCore::MediaSource::openIfInEndedState):
2325         (WebCore::MediaSource::suspend):
2326         (WebCore::MediaSource::resume):
2327         (WebCore::MediaSource::stop):
2328         (WebCore::MediaSource::onReadyStateChange):
2329         (WebCore::MediaSource::scheduleEvent):
2330         (WebCore::MediaSource::logChannel const):
2331         (WebCore::MediaSourceInternal::toString): Deleted.
2332         * Modules/mediasource/MediaSource.h:
2333         (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString):
2334         (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString):
2335         * Modules/mediasource/SourceBuffer.cpp:
2336         (WebCore::SourceBuffer::SourceBuffer):
2337         (WebCore::SourceBuffer::~SourceBuffer):
2338         (WebCore::SourceBuffer::remove):
2339         (WebCore::SourceBuffer::seekToTime):
2340         (WebCore::SourceBuffer::appendBufferInternal):
2341         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
2342         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
2343         (WebCore::removeSamplesFromTrackBuffer):
2344         (WebCore::SourceBuffer::removeCodedFrames):
2345         (WebCore::SourceBuffer::evictCodedFrames):
2346         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
2347         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2348         (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples):
2349         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
2350         (WebCore::SourceBuffer::provideMediaData):
2351         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
2352         (WebCore::SourceBuffer::monitorBufferingRate):
2353         (WebCore::SourceBuffer::logChannel const):
2354         * Modules/mediasource/SourceBuffer.h:
2355         * dom/Document.cpp:
2356         (WebCore::messageSourceForWTFLogChannel):
2357         (WebCore::Document::didLogMessage):
2358         * html/HTMLMediaElement.cpp:
2359         (WebCore::convertEnumerationToString):
2360         (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
2361         (WebCore::HTMLMediaElement::selectMediaResource):
2362         (WebCore::HTMLMediaElement::loadResource):
2363         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2364         (WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
2365         (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
2366         (WebCore::HTMLMediaElement::scheduleUpdatePlayState):
2367         (WebCore::HTMLMediaElement::scheduleUpdateMediaState):
2368         * platform/ContentType.cpp:
2369         (WebCore::ContentType::toJSONString const):
2370         * platform/ContentType.h:
2371         (WTF::LogArgument<WebCore::ContentType>::toString):
2372         * platform/MediaSample.h:
2373         (WebCore::MediaSample::toJSONString const):
2374         (WTF::LogArgument<WebCore::MediaSample>::toString):
2375         * platform/graphics/FloatSize.cpp:
2376         (WebCore::FloatSize::toJSONObject const):
2377         (WebCore::FloatSize::toJSONString const):
2378         * platform/graphics/FloatSize.h:
2379         (WTF::LogArgument<WebCore::FloatSize>::toString):
2380         * platform/graphics/MediaSourcePrivate.h:
2381         (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier):
2382         (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString):
2383         (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString):
2384         * platform/graphics/SourceBufferPrivate.h:
2385         (WebCore::SourceBufferPrivate::sourceBufferLogger const):
2386         (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier):
2387         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2388         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
2389         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
2390         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
2391         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
2392         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
2393         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
2394         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
2395         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2396         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier):
2397         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
2398         (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString):
2399         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2400         (WebCore::convertEnumerationToString):
2401         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2402         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
2403         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
2404         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
2405         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
2406         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
2407         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
2408         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
2409         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
2410         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
2411         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
2412         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2413         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted):
2414         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
2415         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
2416         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
2417         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
2418         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
2419         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
2420         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2421         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2422         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
2423         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
2424         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
2425         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
2426         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
2427         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
2428         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
2429         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
2430         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
2431         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const):
2432         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2433         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
2434         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
2435         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2436         (WebCore::MediaSampleAVFObjC::toJSONString const):
2437         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2438         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2439         (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
2440         (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
2441         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
2442         (WebCore::MediaSourcePrivateAVFObjC::logChannel const):
2443         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2444         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2445         (WebCore::bufferWasConsumedCallback):
2446         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2447         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2448         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2449         (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
2450         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
2451         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
2452         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2453         (WebCore::SourceBufferPrivateAVFObjC::append):
2454         (WebCore::SourceBufferPrivateAVFObjC::abort):
2455         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
2456         (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
2457         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
2458         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2459         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
2460         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
2461         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
2462         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2463         (WebCore::SourceBufferPrivateAVFObjC::flush):
2464         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
2465         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2466         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
2467         (WebCore::SourceBufferPrivateAVFObjC::setActive):
2468         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
2469         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
2470         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
2471         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
2472         (WebCore::SourceBufferPrivateAVFObjC::logChannel const):
2473
2474 2019-02-07  Youenn Fablet  <youenn@apple.com>
2475
2476         Simplify applyConstraints callbacks
2477         https://bugs.webkit.org/show_bug.cgi?id=194297
2478
2479         Reviewed by Eric Carlson.
2480
2481         Make use of one callback for both success and failure cases.
2482         No changed of behavior.
2483
2484         * Modules/mediastream/MediaStreamTrack.cpp:
2485         (WebCore::MediaStreamTrack::applyConstraints):
2486         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2487         (WebCore::MediaStreamTrackPrivate::applyConstraints):
2488         * platform/mediastream/MediaStreamTrackPrivate.h:
2489         * platform/mediastream/RealtimeMediaSource.cpp:
2490         (WebCore::RealtimeMediaSource::applyConstraints):
2491         * platform/mediastream/RealtimeMediaSource.h:
2492         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2493         (WebCore::AVVideoCaptureSource::create):
2494         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2495         (WebCore::CoreAudioCaptureSource::create):
2496         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2497         (WebCore::MockGStreamerAudioCaptureSource::applyConstraints):
2498         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
2499         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
2500         (WebCore::MockGStreamerVideoCaptureSource::applyConstraints):
2501         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
2502
2503 2019-02-07  Youenn Fablet  <youenn@apple.com>
2504
2505         Unable to sign in leetcode.
2506         https://bugs.webkit.org/show_bug.cgi?id=194366
2507         rdar://problem/47259025.
2508
2509         Reviewed by Chris Dumez.
2510
2511         In case a signal is passed as part of a FetchRequestInit,
2512         the IDL binding code is throwing an exception in case signal is not an AbortSignal object.
2513         This breaks an AbortSignal shim used in some web sites.
2514         Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest.
2515
2516         Test: http/wpt/fetch/request-abort.html
2517         Also covered by manually signing in to leetcode.
2518
2519         * Modules/fetch/FetchRequest.cpp:
2520         (WebCore::FetchRequest::initializeWith):
2521         * Modules/fetch/FetchRequestInit.h:
2522         (WebCore::FetchRequestInit::hasMembers const):
2523         * Modules/fetch/FetchRequestInit.idl:
2524
2525 2019-02-07  Youenn Fablet  <youenn@apple.com>
2526
2527         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
2528         https://bugs.webkit.org/show_bug.cgi?id=194312
2529
2530         Reviewed by Eric Carlson.
2531
2532         Add a way for sources to know when they are ended, i.e. that they will never be started again.
2533         No observable change of behavior.
2534
2535         * platform/mediastream/RealtimeMediaSource.cpp:
2536         (WebCore::RealtimeMediaSource::requestStop):
2537         * platform/mediastream/RealtimeMediaSource.h:
2538
2539 2019-02-07  Jer Noble  <jer.noble@apple.com>
2540
2541         HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class
2542         https://bugs.webkit.org/show_bug.cgi?id=194360
2543
2544         HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should
2545         really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement,
2546         make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor
2547         taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases.
2548
2549         Reviewed by Geoffrey Garen.
2550
2551         * Modules/applepay/ApplePaySession.cpp:
2552         (WebCore::ApplePaySession::ApplePaySession):
2553         * Modules/mediarecorder/MediaRecorder.cpp:
2554         (WebCore::MediaRecorder::MediaRecorder):
2555         * Modules/mediastream/MediaDevices.cpp:
2556         (WebCore::MediaDevices::MediaDevices):
2557         * Modules/mediastream/UserMediaRequest.cpp:
2558         (WebCore::UserMediaRequest::UserMediaRequest):
2559         * Modules/notifications/Notification.cpp:
2560         (WebCore::Notification::Notification):
2561         * Modules/paymentrequest/PaymentRequest.cpp:
2562         (WebCore::PaymentRequest::PaymentRequest):
2563         * Modules/webaudio/AudioContext.cpp:
2564         (WebCore::AudioContext::AudioContext):
2565         * animation/WebAnimation.cpp:
2566         (WebCore::WebAnimation::WebAnimation):
2567         * css/FontFaceSet.cpp:
2568         (WebCore::FontFaceSet::FontFaceSet):
2569         * dom/ActiveDOMObject.cpp:
2570         (WebCore::ActiveDOMObject::ActiveDOMObject):
2571         * dom/ActiveDOMObject.h:
2572         * dom/Document.h:
2573         (WebCore::ActiveDOMObject::ActiveDOMObject):
2574         * html/HTMLMarqueeElement.cpp:
2575         (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
2576         * html/HTMLMediaElement.cpp:
2577         (WebCore::HTMLMediaElement::HTMLMediaElement):
2578         * html/HTMLSourceElement.cpp:
2579         (WebCore::HTMLSourceElement::HTMLSourceElement):
2580         * page/IntersectionObserver.cpp:
2581         (WebCore::IntersectionObserver::IntersectionObserver):
2582
2583 2019-02-07  Zalan Bujtas  <zalan@apple.com>
2584
2585         [LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
2586         https://bugs.webkit.org/show_bug.cgi?id=194391
2587
2588         Reviewed by Antti Koivisto.
2589
2590         The spec is not clear about this but that's what matches the current behaviour.
2591
2592         Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
2593
2594         * layout/FormattingContext.cpp:
2595         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2596
2597 2019-02-07  Zalan Bujtas  <zalan@apple.com>
2598
2599         [LFC] Use dedicated data structures for optional used values (input to geometry functions)
2600         https://bugs.webkit.org/show_bug.cgi?id=194376
2601
2602         Reviewed by Antti Koivisto.
2603
2604         This is in preparation for being able to pass in the containing block's width as an optional used value.
2605         During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.
2606
2607         * layout/FormattingContext.cpp:
2608         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2609         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
2610         * layout/FormattingContext.h:
2611         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
2612         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
2613         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
2614         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
2615         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
2616         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
2617         (): Deleted.
2618         (WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
2619         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
2620         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
2621         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
2622         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
2623         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
2624         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
2625         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.
2626         * layout/FormattingContextGeometry.cpp:
2627         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2628         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2629         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2630         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2631         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2632         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2633         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
2634         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2635         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
2636         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
2637         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2638         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2639         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2640         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2641         * layout/LayoutUnits.h:
2642         * layout/blockformatting/BlockFormattingContext.cpp:
2643         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2644         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2645         * layout/blockformatting/BlockFormattingContext.h:
2646         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
2647         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
2648         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
2649         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
2650         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
2651         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2652         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2653         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2654         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2655         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2656         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2657         * layout/inlineformatting/InlineFormattingContext.cpp:
2658         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2659         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2660         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2661         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2662         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2663         * page/FrameViewLayoutContext.cpp:
2664         (WebCore::layoutUsingFormattingContext):
2665
2666 2019-02-07  Antti Koivisto  <antti@apple.com>
2667
2668         Infinite recursion via CachedResource::~CachedResource
2669         https://bugs.webkit.org/show_bug.cgi?id=194378
2670         <rdar://problem/42023295>
2671
2672         Reviewed by Daniel Bates.
2673
2674         I don't know the exact steps to trigger this but the mechanism seems clear.
2675
2676         1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map.
2677         2) This decrements the handle count of resource and causes it be deleted.
2678         3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with
2679            resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled).
2680         4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created.
2681            This increments the handle count of the resource from 0 back to 1.
2682         5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3).
2683
2684         The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource.
2685         It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles.
2686
2687         Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource
2688         has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything
2689         other than bail out is going to crash.
2690
2691         CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to
2692         support this erranous call so they are removed as well.
2693
2694         * loader/ImageLoader.cpp:
2695         (WebCore::ImageLoader::updateFromElement):
2696         * loader/cache/CachedResource.cpp:
2697         (WebCore::CachedResource::~CachedResource):
2698
2699         This is the substantive change. The rest just removes now-dead code.
2700
2701         * loader/cache/CachedResource.h:
2702         (WebCore::CachedResource::setOwningCachedResourceLoader): Deleted.
2703         * loader/cache/CachedResourceLoader.cpp:
2704         (WebCore::CachedResourceLoader::~CachedResourceLoader):
2705         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2706         (WebCore::CachedResourceLoader::requestResource):
2707         (WebCore::CachedResourceLoader::loadResource):
2708         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
2709         (WebCore::CachedResourceLoader::removeCachedResource): Deleted.
2710         * loader/cache/CachedResourceLoader.h:
2711
2712 2019-02-07  Miguel Gomez  <magomez@igalia.com>
2713
2714         [WPE] Implement GStreamer based holepunch
2715         https://bugs.webkit.org/show_bug.cgi?id=193715
2716
2717         Reviewed by Xabier Rodriguez-Calvar.
2718
2719         Implement GStreamer based holepunch functionality. Instead of getting the video frames from the
2720         video sink and drawing then, the player just draws a transparent rectangle on the position where
2721         the video should be. MediaPlayerPrivateGStreamerBase will instantiate a platform dependant video
2722         sink which will be in charge of displaying the video frames in some way (usually on a plane below
2723         the browser), and will push empty frames to the compositor indicating that the rectangle to draw
2724         should overwrite the existent content. TextureMapperPlatformLayerBuffer::HolePunchClient is used
2725         to tell the video sink where to position the video so it's set below the browser transparent hole.
2726
2727         Added ManualTest wpe/video-player-holepunch.html to test the feature.
2728
2729         * platform/graphics/MediaPlayer.cpp:
2730         (WebCore::MediaPlayer::shouldIgnoreIntrinsicSize):
2731         * platform/graphics/MediaPlayer.h:
2732         * platform/graphics/MediaPlayerPrivate.h:
2733         (WebCore::MediaPlayerPrivateInterface::shouldIgnoreIntrinsicSize):
2734         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2735         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
2736         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
2737         (WebCore::setRectangleToVideoSink):
2738         (WebCore::GStreamerHolePunchClient::GStreamerHolePunchClient):
2739         (WebCore::MediaPlayerPrivateGStreamerBase::createHolePunchVideoSink):
2740         (WebCore::MediaPlayerPrivateGStreamerBase::pushNextHolePunchBuffer):
2741         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2742         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2743         * platform/graphics/texmap/TextureMapper.h:
2744         * platform/graphics/texmap/TextureMapperGL.cpp:
2745         (WebCore::TextureMapperGL::drawSolidColor):
2746         * platform/graphics/texmap/TextureMapperGL.h:
2747         * platform/graphics/texmap/TextureMapperLayer.cpp:
2748         (WebCore::TextureMapperLayer::paintSelf):
2749         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2750         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
2751         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2752         (WebCore::TextureMapperPlatformLayerBuffer::setHolePunchClient):
2753         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2754         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
2755         * rendering/RenderVideo.cpp:
2756         (WebCore::RenderVideo::videoBox const):
2757
2758 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
2759
2760         Unreviewed, rolling out r240759 and r240944.
2761
2762         Some timer uses are done off the main thread, WebCore::Timer
2763         cannot be used
2764
2765         Reverted changesets:
2766
2767         "<rdar://problem/47570443> Responsiveness timers are too
2768         expensive for frequent events"
2769         https://bugs.webkit.org/show_bug.cgi?id=194003
2770         https://trac.webkit.org/changeset/240759
2771
2772         "Use deferrable timer to restart the Responsiveness Timer on
2773         each wheel event"
2774         https://bugs.webkit.org/show_bug.cgi?id=194135
2775         https://trac.webkit.org/changeset/240944
2776
2777 2019-02-06  Keith Rollin  <krollin@apple.com>
2778
2779         Update .xcfilelist files
2780
2781         Unreviewed build fix.
2782
2783         * DerivedSources-input.xcfilelist:
2784         * DerivedSources-output.xcfilelist:
2785
2786 2019-02-06  Devin Rousso  <drousso@apple.com>
2787
2788         Web Inspector: DOM: don't send the entire function string with each event listener
2789         https://bugs.webkit.org/show_bug.cgi?id=194293
2790         <rdar://problem/47822809>
2791
2792         Reviewed by Joseph Pecoraro.
2793
2794         Test: inspector/dom/getEventListenersForNode.html
2795
2796         * inspector/agents/InspectorDOMAgent.cpp:
2797         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2798
2799 2019-02-06  Andy Estes  <aestes@apple.com>
2800
2801         [Payment Request] It should be possible to require a phonetic name for shipping contacts
2802         https://bugs.webkit.org/show_bug.cgi?id=194311
2803         <rdar://46733045>
2804
2805         Reviewed by Alex Christensen.
2806
2807         It should be possible to require that a shipping contact has a phonetic name in Payment Request.
2808         To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to
2809         ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data.
2810
2811         Since required shipping contact fields can now be specified both in
2812         requiredShippingContactFields and PaymentOptions, we merge the required fields from these
2813         two sources such that, e.g., email is required if it is specified in either place.
2814
2815         So that clients can detect this new feature, the API version number is bumped from 5 to 6.
2816
2817         Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html.
2818
2819         * DerivedSources.make:
2820         * Modules/applepay/ApplePayPaymentRequest.h:
2821         * Modules/applepay/ApplePayPaymentRequest.idl:
2822         * Modules/applepay/ApplePayRequestBase.cpp:
2823         (WebCore::convertAndValidate):
2824         * Modules/applepay/ApplePayRequestBase.h:
2825         * Modules/applepay/ApplePayRequestBase.idl:
2826         * Modules/applepay/ApplePaySession.cpp:
2827         (WebCore::convertAndValidate):
2828         * Modules/applepay/PaymentCoordinatorClient.cpp: Added.
2829         (WebCore::PaymentCoordinatorClient::supportsVersion):
2830         * Modules/applepay/PaymentCoordinatorClient.h:
2831         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2832         (WebCore::mergePaymentOptions):
2833         (WebCore::ApplePayPaymentHandler::show):
2834         * SourcesCocoa.txt:
2835         * WebCore.xcodeproj/project.pbxproj:
2836         * loader/EmptyClients.cpp:
2837         * testing/MockPaymentContactFields.h: Added.
2838         (WebCore::MockPaymentContactFields::MockPaymentContactFields):
2839         * testing/MockPaymentContactFields.idl: Added.
2840         * testing/MockPaymentCoordinator.cpp:
2841         (WebCore::MockPaymentCoordinator::showPaymentUI):
2842         (WebCore::MockPaymentCoordinator::supportsVersion): Deleted.
2843         * testing/MockPaymentCoordinator.h:
2844         * testing/MockPaymentCoordinator.idl:
2845
2846 2019-02-06  Yusuke Suzuki  <ysuzuki@apple.com>
2847
2848         [JSC] PrivateName to PublicName hash table is wasteful
2849         https://bugs.webkit.org/show_bug.cgi?id=194277
2850
2851         Reviewed by Michael Saboff.
2852
2853         Use WebCoreBuiltinNames instead of adding WebCore names to JSC CommonIdentifiers.
2854
2855         * bindings/js/JSDOMWindowCustom.cpp:
2856         (WebCore::addCrossOriginPropertyNames):
2857         * bindings/js/JSLocationCustom.cpp:
2858         (WebCore::getOwnPropertySlotCommon):
2859         (WebCore::putCommon):
2860         * bindings/js/WebCoreBuiltinNames.h:
2861
2862 2019-02-06  Keith Rollin  <krollin@apple.com>
2863
2864         Really enable the automatic checking and regenerations of .xcfilelists during builds
2865         https://bugs.webkit.org/show_bug.cgi?id=194357
2866         <rdar://problem/47861231>
2867
2868         Reviewed by Chris Dumez.
2869
2870         Bug 194124 was supposed to enable the automatic checking and
2871         regenerating of .xcfilelist files during the build. While related
2872         changes were included in that patch, the change to actually enable the
2873         operation somehow was omitted. This patch actually enables the
2874         operation. The check-xcfilelist.sh scripts now check
2875         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
2876         from the checking.
2877
2878         No new tests since there should be no observable behavior difference.
2879
2880         * Scripts/check-xcfilelists.sh:
2881
2882 2019-02-06  John Wilander  <wilander@apple.com>
2883
2884         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
2885         https://bugs.webkit.org/show_bug.cgi?id=194325
2886         <rdar://problem/47840283>
2887
2888         Reviewed by Chris Dumez.
2889
2890         No new tests. This is just data forwarding. Once the data is stored, I will create
2891         test infrastructure to query it.
2892
2893         * html/HTMLAnchorElement.cpp:
2894         (WebCore::HTMLAnchorElement::handleClick):
2895         * loader/AdClickAttribution.h:
2896         (WebCore::AdClickAttribution::encode const):
2897         (WebCore::AdClickAttribution::decode):
2898         (WebCore::AdClickAttribution::Conversion::encode const):
2899         (WebCore::AdClickAttribution::Conversion::decode):
2900             Infrastructure for IPC.
2901         * loader/FrameLoader.cpp:
2902         (WebCore::FrameLoader::urlSelected):
2903         (WebCore::FrameLoader::loadURLIntoChildFrame):
2904         (WebCore::FrameLoader::loadFrameRequest):
2905         (WebCore::FrameLoader::loadURL):
2906             These functions forward the optional WebCore::AdClickAttribution object
2907             FrameLoader::loadURL() creates the NavigationAction object and sets the
2908             WebCore::AdClickAttribution object on there.
2909         * loader/FrameLoader.h:
2910         (WebCore::FrameLoader::urlSelected):
2911         (WebCore::FrameLoader::loadURL):
2912         * loader/NavigationAction.h:
2913         (WebCore::NavigationAction::adClickAttribution):
2914         (WebCore::NavigationAction::setAdClickAttribution):
2915
2916 2019-02-06  Justin Fan  <justin_fan@apple.com>
2917
2918         [Web GPU] Implement supporting dictionaries for GPUTexture
2919         https://bugs.webkit.org/show_bug.cgi?id=194354
2920
2921         Reviewed by Dean Jackson.
2922
2923         Add dictionaries needed to create a GPUTextureDescriptor.
2924
2925         No new tests; no change in behavior. 
2926
2927         New interface and dictionaries added:
2928         * Modules/webgpu/GPUExtent3D.idl:
2929         * Modules/webgpu/GPUTextureDescriptor.idl:
2930         * Modules/webgpu/GPUTextureDimension.idl:
2931         * Modules/webgpu/GPUTextureUsage.idl:
2932         * platform/graphics/gpu/GPUExtent3D.h:
2933         * platform/graphics/gpu/GPUTextureDescriptor.h:
2934         * platform/graphics/gpu/GPUTextureDimension.h:
2935         * platform/graphics/gpu/GPUTextureUsage.h:
2936
2937         Update WebGPUTextureFormatEnum to GPUTextureFormat:
2938         * Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
2939         * Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
2940         * platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
2941         * Modules/webgpu/WebGPUSwapChain.cpp:
2942         * Modules/webgpu/WebGPUSwapChain.h:
2943         * Modules/webgpu/WebGPUSwapChain.idl:
2944         * platform/graphics/gpu/GPUSwapChain.h:
2945         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2946         (WebCore::platformTextureFormatForGPUTextureFormat):
2947         (WebCore::GPUSwapChain::setFormat):
2948
2949         Update project files with new symbols:
2950         * CMakeLists.txt:
2951         * DerivedSources.make:
2952         * Sources.txt:
2953         * WebCore.xcodeproj/project.pbxproj:
2954         * bindings/js/WebCoreBuiltinNames.h:
2955
2956 2019-02-12  Dean Jackson  <dino@apple.com>
2957
2958         BitmapRenderer should handle existing ImageBuffers
2959         https://bugs.webkit.org/show_bug.cgi?id=194555
2960         <rdar://problem/47857150>
2961
2962         Reviewed by Tim Horton.
2963
2964         Our logic in ImageBitmapRenderingContext assumed that
2965         it had always created the ImageBuffer being used. However, it's
2966         valid to call something like toBlob() or toDataURL() before creating
2967         a context, so we need to handle the case where an ImageBuffer
2968         already exists.
2969
2970         Test: fast/canvas/bitmaprenderer-created-after-toBlob.html
2971
2972         * html/HTMLCanvasElement.cpp:
2973         (WebCore::HTMLCanvasElement::createImageBuffer const): Move some logic into setImageBuffer.
2974         (WebCore::HTMLCanvasElement::setImageBuffer const): Make sure to clear the state saver.
2975
2976 2019-02-06  Daniel Bates  <dabates@apple.com>
2977
2978         Standardize on ControlKey instead of CtrlKey
2979         https://bugs.webkit.org/show_bug.cgi?id=194317
2980
2981         Reviewed by Tim Horton.
2982
2983         * dom/UIEventWithKeyState.cpp:
2984         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
2985         (WebCore::UIEventWithKeyState::setModifierKeys):
2986         * dom/UIEventWithKeyState.h:
2987         (WebCore::UIEventWithKeyState::ctrlKey const):
2988         * page/ios/EventHandlerIOS.mm:
2989         (WebCore::EventHandler::accessKeyModifiers):
2990         * page/mac/EventHandlerMac.mm:
2991         (WebCore::EventHandler::accessKeyModifiers):
2992         * platform/PlatformEvent.h:
2993         (WebCore::PlatformEvent::controlKey const):
2994         (WebCore::PlatformEvent::PlatformEvent):
2995         (WebCore::PlatformEvent::ctrlKey const): Deleted.
2996         * platform/cocoa/KeyEventCocoa.mm:
2997         (WebCore::PlatformKeyboardEvent::getCurrentModifierState):
2998         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2999         (WebCore::modifiersForGdkKeyEvent):
3000         * platform/gtk/PlatformMouseEventGtk.cpp:
3001         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3002         * platform/gtk/PlatformWheelEventGtk.cpp:
3003         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3004         * platform/ios/KeyEventIOS.mm:
3005         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
3006         * platform/ios/PlatformEventFactoryIOS.mm:
3007         (WebCore::modifiersForEvent):
3008         * platform/mac/KeyEventMac.mm:
3009         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
3010         * platform/mac/PlatformEventFactoryMac.mm:
3011         (WebCore::modifiersForEvent):
3012         * testing/Internals.cpp:
3013         (WebCore::Internals::accessKeyModifiers const):
3014
3015 2019-02-06  Alex Christensen  <achristensen@webkit.org>
3016
3017         Fix WatchOS build
3018         https://bugs.webkit.org/show_bug.cgi?id=194353
3019
3020         Rubber stamped by Tim Horton and Wenson Hsieh.
3021
3022         * rendering/RenderThemeIOS.mm:
3023         (WebCore::iconForAttachment):
3024
3025 2019-02-06  Olivier Blin  <olivier.blin@softathome.com>
3026
3027         [SVG] fix SVGURIReference build by including SVGElement
3028         https://bugs.webkit.org/show_bug.cgi?id=194292
3029
3030         Reviewed by Michael Catanzaro.
3031
3032         * svg/SVGURIReference.h:
3033         SVGURIReference is making use of SVGElement in its constructor, but
3034         it was not declared.
3035
3036         The issue was not seen in unified builds because it was grouped with
3037         other files including SVGElement.
3038
3039 2019-02-06  Zalan Bujtas  <zalan@apple.com>
3040
3041         [LFC][IFC] Move line layout code to a dedicated file
3042         https://bugs.webkit.org/show_bug.cgi?id=194328
3043
3044         Reviewed by Antti Koivisto.
3045
3046         * Sources.txt:
3047         * WebCore.xcodeproj/project.pbxproj:
3048         * layout/inlineformatting/InlineFormattingContext.cpp:
3049         (WebCore::Layout::InlineFormattingContext::layout const):
3050         (WebCore::Layout::isTrimmableContent): Deleted.
3051         (WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
3052         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
3053         (WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
3054         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
3055         (WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
3056         (WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
3057         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
3058         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
3059         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
3060         * layout/inlineformatting/InlineFormattingContext.h:
3061         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
3062         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
3063         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
3064         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
3065         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
3066         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
3067         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
3068         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
3069         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
3070         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
3071         (WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
3072         (WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
3073         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
3074         (WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
3075         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
3076         (WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
3077         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
3078         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
3079         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
3080         (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
3081         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3082         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
3083         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
3084         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
3085         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
3086         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
3087         * layout/inlineformatting/Line.cpp:
3088         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
3089         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
3090         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
3091         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
3092         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
3093         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
3094         (WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
3095         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
3096         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
3097         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
3098         (WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
3099         (WebCore::Layout::InlineFormattingContext::Line::close): Deleted.
3100
3101 2019-02-06  Youenn Fablet  <youenn@apple.com>
3102
3103         CoreAudioCaptureSource should not configure its audio unit until it starts producing data
3104         https://bugs.webkit.org/show_bug.cgi?id=194310
3105
3106         Reviewed by Eric Carlson.
3107
3108         Delay the configuration of the audio unit until the source is instructed to start producing data.
3109         This allows the UIProcess to not start changing the audio unit when
3110         checking for constraints during getUserMedia call before the prompt.
3111         Covered by manual testing.
3112
3113         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3114         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
3115         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
3116         (WebCore::CoreAudioCaptureSource::startProducingData):
3117         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3118
3119 2019-02-06  Youenn Fablet  <youenn@apple.com>
3120
3121         Disable audio ducking at Audio Unit setup time
3122         https://bugs.webkit.org/show_bug.cgi?id=194303
3123
3124         Reviewed by Eric Carlson.
3125
3126         When creating a CoreAudioCaptureSource, the audio unit might be
3127         reconfigured if a past audio capture was done.
3128         This might trigger audio ducking which is undone in startInternal.
3129         In some cases, startInternal will never call start.
3130         In that case, the audio unit will continue ducking the other processing.
3131         To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.
3132
3133         In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
3134         This might affect all applications.
3135         Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
3136         This has noticeable effects in the quality of audio being played on bluetooth devices.
3137
3138         Covered by manual tests.
3139
3140         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3141         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
3142         (WebCore::CoreAudioSharedUnit::unduck):
3143         (WebCore::CoreAudioSharedUnit::startInternal):
3144         (WebCore::CoreAudioSharedUnit::captureFailed):
3145         (WebCore::CoreAudioSharedUnit::stopProducingData):
3146
3147 2019-02-06  Antti Koivisto  <antti@apple.com>
3148
3149         RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
3150         https://bugs.webkit.org/show_bug.cgi?id=194333
3151         <rdar://problem/47822929>
3152
3153         Reviewed by Zalan Bujtas.
3154
3155         Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
3156         the legacy animation code triggering a resource load.
3157
3158         Test: http/tests/contentextensions/css-display-none-keyframe.html
3159
3160         * style/StyleScope.cpp:
3161         (WebCore::Style::Scope::scheduleUpdate):
3162
3163         Avoid clearing the style resolver if we are in the middle of a style resolution.
3164         A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
3165
3166 2019-02-06  Pablo Saavedra  <psaavedra@igalia.com>
3167
3168         Build failure after r240315
3169         https://bugs.webkit.org/show_bug.cgi?id=194341
3170
3171         Reviewed by Wenson Hsieh.
3172
3173         * bindings/js/JSUndoItemCustom.cpp:
3174         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
3175
3176 2019-02-05  Ryosuke Niwa  <rniwa@webkit.org>
3177
3178         REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
3179         https://bugs.webkit.org/show_bug.cgi?id=194329
3180
3181         Reviewed by Geoffrey Garen.
3182
3183         The bug was caused by the code path for when navigating with a specific target frame name that does not exist
3184         never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
3185         navigation, resulting in this release assertion.
3186
3187         Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.
3188
3189         Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html
3190
3191         * loader/FrameLoader.cpp:
3192         (WebCore::FrameLoader::loadURL):
3193
3194 2019-02-05  Claudio Saavedra  <csaavedra@igalia.com>
3195
3196         [FreeType] Build fix for Debian stable
3197
3198         Unreviewed build fix.
3199
3200         Debian stable currently has a version of fontconfig that doesn't
3201         yet have FC_COLOR. #ifdef its use to fix the build.
3202
3203         * platform/graphics/freetype/FontCacheFreeType.cpp:
3204         (WebCore::FontCache::systemFallbackForCharacters):
3205
3206 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3207
3208         Stop using blobRegistry in NetworkProcess
3209         https://bugs.webkit.org/show_bug.cgi?id=194027
3210
3211         Reviewed by Youenn Fablet.
3212
3213         Also stop using NetworkBlobRegistry::singleton.
3214         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
3215         We now have to resolve all blob file references while we still have a
3216         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
3217         using the singleton after we have passed everything to the loading code, but it works the same
3218         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
3219         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
3220         which extensions to revoke.
3221
3222         * platform/network/BlobRegistryImpl.h:
3223         * platform/network/FormData.cpp:
3224         (WebCore::appendBlobResolved):
3225         (WebCore::FormData::resolveBlobReferences):
3226         * platform/network/FormData.h:
3227         * platform/network/cf/FormDataStreamCFNet.cpp:
3228         (WebCore::createHTTPBodyCFReadStream):
3229         * platform/network/curl/CurlFormDataStream.cpp:
3230         (WebCore::CurlFormDataStream::CurlFormDataStream):
3231
3232 2019-02-05  Truitt Savell  <tsavell@apple.com>
3233
3234         Unreviewed, rolling out r240984.
3235
3236         Revision casued two API timeouts
3237
3238         Reverted changeset:
3239
3240         "Stop using blobRegistry in NetworkProcess"
3241         https://bugs.webkit.org/show_bug.cgi?id=194027
3242         https://trac.webkit.org/changeset/240984
3243
3244 2019-02-05  Keith Rollin  <krollin@apple.com>
3245
3246         Enable the automatic checking and regenerations of .xcfilelists during builds
3247         https://bugs.webkit.org/show_bug.cgi?id=194124
3248         <rdar://problem/47721277>
3249
3250         Reviewed by Tim Horton.
3251
3252         Bug 193790 add a facility for checking -- during build time -- that
3253         any needed .xcfilelist files are up-to-date and for updating them if
3254         they are not. This facility was initially opt-in by setting
3255         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
3256         the process seemed robust. Its now time to enable this facility and
3257         make it opt-out. If there is a need to disable this facility, set and
3258         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
3259         running `make` or `build-webkit`, or before running Xcode from the
3260         command line.
3261
3262         Additionally, remove the step that generates a list of source files
3263         going into the UnifiedSources build step. It's only necessarily to
3264         specify Sources.txt and SourcesCocoa.txt as inputs.
3265
3266         No new tests since there should be no observable behavior difference.
3267
3268         * UnifiedSources-input.xcfilelist: Removed.
3269         * WebCore.xcodeproj/project.pbxproj:
3270
3271 2019-02-05  Keith Rollin  <krollin@apple.com>
3272
3273         Update .xcfilelist files
3274         https://bugs.webkit.org/show_bug.cgi?id=194121
3275         <rdar://problem/47720863>
3276
3277         Reviewed by Tim Horton.
3278
3279         Preparatory to enabling the facility for automatically updating the
3280         .xcfilelist files, check in a freshly-updated set so that not everyone
3281         runs up against having to regenerate them themselves.
3282
3283         No new tests since there should be no observable behavior difference.
3284
3285         * DerivedSources-input.xcfilelist:
3286         * DerivedSources-output.xcfilelist:
3287
3288 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3289
3290         Stop using blobRegistry in NetworkProcess
3291         https://bugs.webkit.org/show_bug.cgi?id=194027
3292
3293         Reviewed by Youenn Fablet.
3294
3295         Also stop using NetworkBlobRegistry::singleton.
3296         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
3297         We now have to resolve all blob file references while we still have a
3298         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
3299         using the singleton after we have passed everything to the loading code, but it works the same
3300         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
3301         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
3302         which extensions to revoke.
3303
3304         * platform/network/BlobRegistryImpl.h:
3305         * platform/network/FormData.cpp:
3306         (WebCore::appendBlobResolved):
3307         (WebCore::FormData::resolveBlobReferences):
3308         * platform/network/FormData.h:
3309         * platform/network/cf/FormDataStreamCFNet.cpp:
3310         (WebCore::createHTTPBodyCFReadStream):
3311         * platform/network/curl/CurlFormDataStream.cpp:
3312         (WebCore::CurlFormDataStream::CurlFormDataStream):
3313
3314 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
3315
3316         Unreviewed, rolling out r240742.
3317
3318         Causes crashes on iOS simulator.
3319
3320         Reverted changeset:
3321
3322         "[iOS] Keyups for non-modifier keys identified as "Dead" when
3323         not focused in a content-editable element"
3324         https://bugs.webkit.org/show_bug.cgi?id=192824
3325         https://trac.webkit.org/changeset/240742
3326
3327 2019-02-05  Zalan Bujtas  <zalan@apple.com>
3328
3329         [LFC][IFC] collectInlineContent should use pre-computed margins, paddings and borders
3330         https://bugs.webkit.org/show_bug.cgi?id=194269
3331
3332         Reviewed by Antti Koivisto.
3333
3334         In this patch we pre-compute the margins padding and borders for formatting context roots, replaced boxes and non-replaced containers.
3335         These property values are input to collectInlineContent's inline item detaching logic.
3336
3337         * layout/inlineformatting/InlineFormattingContext.cpp:
3338         (WebCore::Layout::nextInPreOrder):
3339         (WebCore::Layout::InlineFormattingContext::layout const):
3340         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
3341         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
3342         * layout/inlineformatting/InlineFormattingContext.h:
3343         * layout/layouttree/LayoutBox.h: ran out bits. 
3344
3345 2019-02-05  Antoine Quint  <graouts@apple.com>
3346
3347         REGRESSION (r240579): com.apple.WebKit.WebContent at WebCore: WebCore::Document::absoluteEventRegionForNode
3348         https://bugs.webkit.org/show_bug.cgi?id=194284
3349         <rdar://problem/47774298>
3350
3351         Reviewed by Antti Koivisto.
3352
3353         The m_touchActionElements list needs to be HashSet<RefPtr<Element>> instead of HashSet<Element*>. It was initially storing raw pointers based on m_touchEventTargets
3354         which is an EventTargetSet (typedef’d to HashCountedSet<Node*>), but that's because these nodes have an event listener registered for them and as such are kept alive,
3355         whereas elements with a touch-action property aren’t. Elements are removed from this list from Document::nodeWillBeRemoved() and from Document::updateTouchActionElements(),
3356         the latter being called from Style::TreeResolver::resolveElement().
3357
3358         * dom/Document.cpp:
3359         (WebCore::Document::updateTouchActionElements):
3360         * dom/Document.h:
3361         (WebCore::Document::touchActionElements const):
3362
3363 2019-02-05  Benjamin Poulain  <benjamin@webkit.org>
3364
3365         Hit testing functions optimizations
3366         https://bugs.webkit.org/show_bug.cgi?id=194073
3367         <rdar://problem/47692312>
3368
3369         Reviewed by Zalan Bujtas.
3370
3371         This patch implements some easy optimizations that speed up
3372         hit testing without changing the algorithms.
3373
3374         * page/FrameViewLayoutContext.h:
3375         The code for:
3376             view().frameView().layoutContext().isPaintOffsetCacheEnabled()
3377         followed by:
3378             view().frameView().layoutContext().layoutState()
3379         was loading all the intermediate values twice and calling layoutState()
3380         twice.
3381
3382         By marking the function as pure, Clang can CSE the whole thing and
3383         remove the duplicated code.
3384
3385         * platform/graphics/LayoutRect.h:
3386         (WebCore::LayoutRect::isInfinite const):
3387         That one is pretty funny.
3388
3389         Since LayoutRect::isInfinite() was implemented before operator==() is
3390         declared, the compiler was falling back to the implicit convertion to FloatRect()
3391         before doing any comparison.
3392
3393         This explains a bunch of the convertions to float when using LayoutRect.
3394
3395         * rendering/RenderBox.cpp:
3396         (WebCore::RenderBox::mapLocalToContainer const):
3397         Just reoder to make the register nice and clean for the optimization described above.
3398
3399 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
3400
3401         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
3402         https://bugs.webkit.org/show_bug.cgi?id=193993
3403
3404         Reviewed by Keith Miller.
3405
3406         * bindings/scripts/CodeGeneratorJS.pm:
3407         (GenerateHeader):
3408         * bridge/runtime_method.h:
3409
3410 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
3411
3412         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
3413         https://bugs.webkit.org/show_bug.cgi?id=194245
3414
3415         Reviewed by Zalan Bujtas.
3416
3417         ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa
3418         directory.
3419
3420         Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC).
3421
3422         Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build.
3423
3424         * SourcesCocoa.txt:
3425         * WebCore.xcodeproj/project.pbxproj:
3426         * page/scrolling/ScrollingThread.cpp:
3427         (WebCore::ScrollingThread::initializeRunLoop):
3428         (WebCore::ScrollingThread::wakeUpRunLoop):
3429         (WebCore::ScrollingThread::threadRunLoopSourceCallback):
3430         * page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h.
3431         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm.
3432         * page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h.
3433         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm.
3434         * page/scrolling/mac/ScrollingThreadMac.mm:
3435         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
3436         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3437
3438 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
3439
3440         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3441         https://bugs.webkit.org/show_bug.cgi?id=174816
3442
3443         Reviewed by Michael Catanzaro.
3444
3445         Tests: enabled fast/url/user-visible/.
3446
3447         * testing/Internals.cpp:
3448         (WebCore::Internals::userVisibleString): Enable method on all platforms.
3449
3450 2019-02-04  Fujii Hironori  <Hironori.Fujii@sony.com>
3451
3452         [curl] ASSERTION FAILED: !m_didNotifyResponse || m_multipartHandle
3453         https://bugs.webkit.org/show_bug.cgi?id=190895
3454
3455         Reviewed by Ross Kirsling.
3456
3457         An assertion was failing in CurlRequest::invokeDidReceiveResponse
3458         because DidReceiveResponse was already dispatched. This condition
3459         was met if CurlRequestScheduler::completeTransfer is called while
3460         waiting for the reply for the first DidReceiveResponse.
3461
3462         No new tests, covered by existing tests.
3463
3464         * platform/network/curl/CurlRequest.h:
3465         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
3466         Return true if m_didNotifyResponse is false disregard to
3467         m_didReturnFromNotify.
3468
3469 2019-02-04  Said Abou-Hallawa  <said@apple.com>
3470
3471         [CG] Enable setAdditionalSupportedImageTypes for WK1
3472         https://bugs.webkit.org/show_bug.cgi?id=194190
3473
3474         Reviewed by Tim Horton.
3475
3476         Move the function webCoreStringVectorFromNSStringArray from WebKit to
3477         WebCore so it can be used by both WebKit and WebKitLegacy.
3478
3479         * platform/mac/StringUtilities.h:
3480         * platform/mac/StringUtilities.mm:
3481         (WebCore::webCoreStringVectorFromNSStringArray):
3482
3483 2019-02-04  Justin Fan  <justin_fan@apple.com>
3484
3485         [Web GPU] Code clean-up for RenderPipeline backend
3486         https://bugs.webkit.org/show_bug.cgi?id=194238
3487
3488         Reviewed by Dean Jackson.
3489
3490         Replace dot syntax setters with calls to setter methods, and remove unnecessary setter calls for 
3491         the input state's descriptor arrays.
3492
3493         Covered by existing tests; no change in behavior.
3494
3495         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3496         (WebCore::tryCreateMtlDepthStencilState): Refactor to use implicit setters rather than dot syntax.
3497         (WebCore::setInputStateForPipelineDescriptor): Ditto, and remove unnecessary setter calls on array objects.
3498
3499 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
3500
3501         Use deferrable timer to restart the Responsiveness Timer on each wheel event
3502         https://bugs.webkit.org/show_bug.cgi?id=194135
3503         <rdar://problem/47724099>
3504
3505         Reviewed by Simon Fraser.
3506
3507         The original DeferrableOneShotTimer was not really deferrable.
3508         What it allows is to restart the count down from scratch after
3509         firing.
3510
3511         For this optimization, I want to keep the correct timing but avoid
3512         starting a real timer every time.
3513
3514         I renamed DeferrableOneShotTimer to ResettableOneShotTimer and
3515         created a real DeferrableOneShotTimer that support deadlines.
3516
3517         * css/CSSImageGeneratorValue.cpp:
3518         * html/HTMLPlugInImageElement.h:
3519         * loader/cache/CachedResource.h:
3520         * platform/Timer.cpp:
3521         (WebCore::DeferrableOneShotTimer::startOneShot):
3522         (WebCore::DeferrableOneShotTimer::fired):
3523         * platform/Timer.h:
3524         (WebCore::TimerBase::nextFireTime const):
3525         (WebCore::ResettableOneShotTimer::ResettableOneShotTimer):
3526         (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
3527         (WebCore::DeferrableOneShotTimer::stop):
3528         (WebCore::DeferrableOneShotTimer::restart): Deleted.
3529         * platform/graphics/ca/TileController.h:
3530         * platform/graphics/cg/SubimageCacheWithTimer.h:
3531
3532 2019-02-04  Antoine Quint  <graouts@apple.com>
3533
3534         Use constants for pointer types
3535         https://bugs.webkit.org/show_bug.cgi?id=194232
3536
3537         Reviewed by Dean Jackson.
3538
3539         We cannot use an enum for the pointer type since a custom pointer type can be created by developers when creating a
3540         pointer event using JavaScript, but we can at least used string constants for the ones created internally.
3541
3542         * dom/PointerEvent.cpp:
3543         (WebCore::PointerEvent::mousePointerType):
3544         (WebCore::PointerEvent::penPointerType):
3545         (WebCore::PointerEvent::touchPointerType):
3546         * dom/PointerEvent.h:
3547         * dom/ios/PointerEventIOS.cpp:
3548
3549 2019-02-04  Zalan Bujtas  <zalan@apple.com>
3550
3551         [First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async scripts into account.
3552         https://bugs.webkit.org/show_bug.cgi?id=194168
3553
3554         Reviewed by Simon Fraser.
3555
3556         First paint should not be blocked by async or deferred scripts.
3557
3558         * page/FrameView.cpp:
3559         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
3560
3561 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
3562
3563         Async overflow scroll with border-radius renders incorrectly
3564         https://bugs.webkit.org/show_bug.cgi?id=194205
3565         <rdar://problem/47771668>
3566
3567         Reviewed by Zalan Bujtas.
3568
3569         When an element has composited overflow:scroll and border-radius, we need to make a layer
3570         to clip to the inside of the border radius if necessary.
3571
3572         Existing code simply turned off needsDescendantsClippingLayer for composited scrolling
3573         layers, but now we check to see if the inner border is rounded. If we have both a m_childContainmentLayer
3574         and scrolling layers, we need to adjust the location of the scrolling layers (which are parented
3575         in m_childContainmentLayer).
3576
3577         Also fix offsetFromRenderer for these layers; it's positive for layers inset from the top left
3578         of the border box.
3579
3580         Tests: compositing/clipping/border-radius-async-overflow-clipping-layer.html
3581                compositing/clipping/border-radius-async-overflow-non-stacking.html
3582                compositing/clipping/border-radius-async-overflow-stacking.html
3583
3584         * rendering/RenderLayerBacking.cpp:
3585         (WebCore::RenderLayerBacking::updateConfiguration):
3586         (WebCore::RenderLayerBacking::updateGeometry):
3587         (WebCore::RenderLayerBacking::updateChildClippingStrategy): Layout is always up-to-date now, so remove the comment.
3588
3589 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
3590
3591         PageOverlayController's layers should be created lazily
3592         https://bugs.webkit.org/show_bug.cgi?id=194199
3593
3594         Reviewed by Tim Horton.
3595
3596         Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
3597         and use them to only parent the overlay-hosting layers when necessary.
3598
3599         For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
3600         simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
3601         which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
3602         compositing updates that parents the layerWithDocumentOverlays().
3603
3604         View overlays are added to the layer tree via the DrawingArea. When we go between having
3605         none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
3606         on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
3607         compositing flush (this has to be done manually because view overlay layers are outside the
3608         subtree managed by RenderLayerCompositor).
3609         
3610         Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
3611         there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
3612         overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
3613         having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
3614
3615         * loader/EmptyClients.h:
3616         * page/ChromeClient.h:
3617         * page/FrameView.cpp:
3618         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
3619         because there may be nothing else that does.
3620         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
3621         * page/Page.cpp:
3622         (WebCore::Page::installedPageOverlaysChanged):
3623         * page/Page.h:
3624         * page/PageOverlayController.cpp:
3625         (WebCore::PageOverlayController::hasDocumentOverlays const):
3626         (WebCore::PageOverlayController::hasViewOverlays const):
3627         (WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
3628         might as well be the one to call through the ChromeClient.
3629         (WebCore::PageOverlayController::detachViewOverlayLayers):
3630         (WebCore::PageOverlayController::installPageOverlay):
3631         (WebCore::PageOverlayController::uninstallPageOverlay):
3632         * page/PageOverlayController.h:
3633         * rendering/RenderLayerCompositor.cpp:
3634         (WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
3635         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
3636         (WebCore::RenderLayerCompositor::attachRootLayer):
3637         (WebCore::RenderLayerCompositor::detachRootLayer):
3638
3639 2019-02-04  Eric Liang  <ericliang@apple.com>
3640
3641         When performing Increment or Decrement on sliders, check to see if the slider is disabled.
3642         https://bugs.webkit.org/show_bug.cgi?id=173497
3643
3644         Reviewed by Chris Fleizach.
3645
3646         Test: accessibility/set-value-not-work-for-disabled-sliders.html
3647
3648         * accessibility/AccessibilityNodeObject.cpp:
3649         (WebCore::AccessibilityNodeObject::alterSliderValue):
3650
3651 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
3652
3653         IndexedDB: leak WebIDBConnectionToServer in layout tests
3654         https://bugs.webkit.org/show_bug.cgi?id=193688
3655         <rdar://problem/47353263>
3656
3657         Reviewed by Geoffrey Garen.
3658
3659         Let IDBConnectionToServer keep a WeakPtr of IDBConnectionToServerDelegate.
3660
3661         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3662         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
3663         * Modules/indexeddb/client/IDBConnectionToServer.h:
3664         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3665
3666 2019-02-04  Youenn Fablet  <youenn@apple.com>
3667
3668         Make sure to remove the device observer in AVVideoCaptureSource
3669         https://bugs.webkit.org/show_bug.cgi?id=194181
3670         <rdar://problem/47739247>
3671
3672         Reviewed by Eric Carlson.
3673
3674         Make sure to remove the device observer when the observer is destroyed.
3675         To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor.
3676
3677         Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource.
3678
3679         Covered by manual test.
3680
3681        * platform/mediastream/mac/AVVideoCaptureSource.h:
3682         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3683         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
3684         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
3685         (WebCore::AVVideoCaptureSource::initializeSession):
3686         (WebCore::AVVideoCaptureSource::clearSession):
3687         (WebCore::AVVideoCaptureSource::stopProducingData):
3688         (WebCore::AVVideoCaptureSource::setupSession):
3689
3690 2019-02-04  Antoine Quint  <graouts@apple.com>
3691
3692         Use a dedicated type instead of int32_t for pointer identifiers
3693         https://bugs.webkit.org/show_bug.cgi?id=194217
3694
3695         Reviewed by Antti Koivisto.
3696
3697         * WebCore.xcodeproj/project.pbxproj:
3698         * dom/PointerEvent.h:
3699         * dom/PointerID.h: Added.
3700         * page/PointerCaptureController.cpp:
3701         (WebCore::PointerCaptureController::setPointerCapture):
3702         (WebCore::PointerCaptureController::releasePointerCapture):
3703         (WebCore::PointerCaptureController::hasPointerCapture):
3704         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
3705         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier):
3706         (WebCore::PointerCaptureController::cancelPointer):
3707         * page/PointerCaptureController.h:
3708
3709 2019-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3710
3711         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
3712         Followup to https://bugs.webkit.org/show_bug.cgi?id=193758
3713
3714         Reviewed by Daniel Bates.
3715
3716         Put the iOS-specific behavior behind an EditingBehavior check, rather than a compile-time guard. No change in
3717         behavior.
3718
3719         * editing/EditingBehavior.h:
3720         (WebCore::EditingBehavior::shouldMoveSelectionToEndWhenFocusingTextInput const):
3721         * html/HTMLInputElement.cpp:
3722         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
3723
3724 2019-02-04  Zalan Bujtas  <zalan@apple.com>
3725
3726         [LFC][IFC] Make InlineFormattingContext::collectInlineContent non-recursive.
3727         https://bugs.webkit.org/show_bug.cgi?id=194210
3728
3729         Reviewed by Antti Koivisto.
3730
3731         Use iterative algorithm to collect inline content (and add breaking rules).
3732         This is in preparation for fixing the inline preferred width computation.  
3733
3734         * layout/Verification.cpp:
3735         (WebCore::Layout::resolveForRelativePositionIfNeeded):
3736         * layout/inlineformatting/InlineFormattingContext.cpp:
3737         (WebCore::Layout::addDetachingRules):
3738         (WebCore::Layout::createAndAppendInlineItem):
3739         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
3740         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): Deleted.
3741         * layout/inlineformatting/InlineFormattingContext.h:
3742
3743 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3744
3745         Unreviewed, fix unused variable warnings introduced in r240912
3746         https://bugs.webkit.org/show_bug.cgi?id=194198
3747         <rdar://problem/47776051>
3748
3749         * page/FrameView.cpp:
3750         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
3751         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
3752
3753 2019-02-04  Frederic Wang  <fwang@igalia.com>
3754
3755         [css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow
3756         https://bugs.webkit.org/show_bug.cgi?id=191816
3757
3758         Reviewed by Wenson Hsieh.
3759
3760         This patch fixes a bug that prevents children of a scroll container to create snap positions
3761         when they have non-visible overflow. This happens because for such a child, the function
3762         RenderBox::findEnclosingScrollableContainer() will return the child itself rather than the
3763         scroll container. To address that issue, we introduce a new
3764         RenderObject::enclosingScrollableContainerForSnapping() helper function that ensures that
3765         a real RenderBox ancestor is returned.
3766
3767         Test: css3/scroll-snap/scroll-snap-children-with-overflow.html
3768
3769         * page/scrolling/AxisScrollSnapOffsets.cpp:
3770         (WebCore::updateSnapOffsetsForScrollableArea): Use enclosingScrollableContainerForSnapping()
3771         so that we don't skip children with non-visible overflow.
3772         * rendering/RenderLayerModelObject.cpp:
3773         (WebCore::RenderLayerModelObject::styleDidChange): Ditto. The new function calls
3774         enclosingBox().
3775         * rendering/RenderObject.cpp:
3776         (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Return
3777         the scrollable container of the enclosing box. If it is actually the render object itself
3778         then start the search from the parent box instead.
3779         * rendering/RenderObject.h: Declare enclosingScrollableContainerForSnapping(). 
3780
3781 2019-02-04  Antti Koivisto  <antti@apple.com>
3782
3783         Rename GraphicsLayer and PlatformCALayer scrolling layer type enum values to be less ambiguous
3784         https://bugs.webkit.org/show_bug.cgi?id=194215
3785
3786         Reviewed by Frédéric Wang.
3787
3788         GraphicsLayer::Type::Scrolling -> GraphicsLayer::Type::ScrollContainer
3789         PlatformCALayer::LayerTypeScrollingLayer -> PlatformCALayer::LayerTypeScrollContainerLayer
3790
3791         * platform/graphics/GraphicsLayer.cpp:
3792         (WebCore::GraphicsLayer::supportsLayerType):
3793         * platform/graphics/GraphicsLayer.h:
3794         * platform/graphics/ca/GraphicsLayerCA.cpp:
3795         (WebCore::GraphicsLayer::supportsLayerType):
3796         (WebCore::GraphicsLayerCA::initialize):
3797         * platform/graphics/ca/PlatformCALayer.cpp:
3798         (WebCore::operator<<):
3799         * platform/graphics/ca/PlatformCALayer.h:
3800         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3801         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
3802         (WebCore::PlatformCALayerCocoa::commonInit):
3803         * rendering/RenderLayerBacking.cpp:
3804         (WebCore::RenderLayerBacking::updateScrollingLayers):
3805         * rendering/RenderLayerCompositor.cpp:
3806         (WebCore::RenderLayerCompositor::ensureRootLayer):
3807
3808 2019-02-03  Antti Koivisto  <antti@apple.com>
3809
3810         [iOS] Tiles not created in large scrollable iframes
3811         https://bugs.webkit.org/show_bug.cgi?id=193665
3812
3813         Reviewed by Simon Fraser.
3814
3815         We are not syncing scroll position back to the graphics layer tree correctly.
3816
3817         Test by Frédéric Wang.
3818
3819         * page/scrolling/AsyncScrollingCoordinator.cpp:
3820         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
3821         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
3822         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
3823
3824         Factor setting and syncing scrolling layer positions into a function.
3825         Use bounds.origin scrolling mechanic when scrollContainerLayer is present.
3826
3827         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
3828         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
3829         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.
3830         * page/scrolling/AsyncScrollingCoordinator.h:
3831         * page/scrolling/ScrollingCoordinator.cpp:
3832         (WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
3833         (WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
3834         (WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.
3835         * page/scrolling/ScrollingCoordinator.h:
3836         * rendering/RenderLayerCompositor.cpp:
3837
3838         Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
3839         Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.
3840
3841         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
3842         (WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
3843         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
3844         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
3845         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
3846         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
3847         (WebCore::RenderLayerCompositor::frameViewDidScroll):
3848         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
3849         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
3850         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3851         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3852         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3853         (WebCore::RenderLayerCompositor::ensureRootLayer):
3854         (WebCore::RenderLayerCompositor::destroyRootLayer):
3855         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
3856         * rendering/RenderLayerCompositor.h:
3857
3858 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
3859
3860         Make setNeedsLayout on the root more explicitly about triggering its side-effects
3861         https://bugs.webkit.org/show_bug.cgi?id=194198
3862
3863         Reviewed by Antti Koivisto.
3864
3865         Calling setNeedsLayout() on the FrameView or RenderView is an odd concept; the render tree
3866         generally manages its own dirty state.
3867
3868         Most callers of setNeedsLayout() on the root are really trying to trigger the side-effects
3869         of layout, like compositing updates, which are required when view configuration state, like
3870         headers, footers and transparency, change. These dependencies are currently implicit and
3871         poorly defined.
3872
3873         Renaming "setNeedsLayout" on FrameView is a step towards being more explicit about pure
3874         rendering updates, vs updates of downstream data strutures like compositing. It's now called
3875         setNeedsLayoutAfterViewConfigurationChange(). In addition, expose
3876         setNeedsCompositingConfigurationUpdate() and setNeedsCompositingGeometryUpdate() so callers
3877         can trigger the appropriate types of compositing updates on the root layer.
3878
3879         In addition, FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange() schedules a
3880         layout. Withtout this, some callers would dirty the RenderView's layout but rely on some
3881         other trigger to make the layout happen.
3882
3883         This cleanup was prompted by noticing that FrameView::setHeaderHeight() dirtied layout
3884         but never scheduled it, making banner insertion in MiniBrowser unreliable.
3885
3886         This patch also removes the aliasing of headerHeight/footerHeight between Page and
3887         FrameView. Banners are a property of Page, so FrameView fetches the banner heights
3888         from Page.
3889
3890         * page/FrameView.cpp:
3891         (WebCore::FrameView::headerHeight const):
3892         (WebCore::FrameView::footerHeight const):
3893         (WebCore::FrameView::availableContentSizeChanged):
3894         (WebCore::FrameView::setNeedsLayoutAfterViewConfigurationChange):
3895         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
3896         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
3897         (WebCore::FrameView::scheduleSelectionUpdate):
3898         (WebCore::FrameView::setTransparent):
3899         (WebCore::FrameView::setBaseBackgroundColor):
3900         (WebCore::FrameView::setAutoSizeFixedMinimumHeight):
3901         (WebCore::FrameView::enableAutoSizeMode):
3902         (WebCore::FrameView::setHeaderHeight): Deleted.
3903         (WebCore::FrameView::setFooterHeight): Deleted.
3904         (WebCore::FrameView::setNeedsLayout): Deleted.
3905         * page/FrameView.h:
3906         * page/FrameViewLayoutContext.cpp:
3907         (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange):
3908         (WebCore::FrameViewLayoutContext::setNeedsLayout): Deleted.
3909         * page/FrameViewLayoutContext.h:
3910         * page/Page.cpp:
3911         (WebCore::Page::setPageScaleFactor):
3912         (WebCore::Page::setHeaderHeight):
3913         (WebCore::Page::setFooterHeight):
3914         (WebCore::Page::addHeaderWithHeight): Deleted.
3915         (WebCore::Page::addFooterWithHeight): Deleted.
3916         * page/Page.h:
3917         * rendering/RenderLayerCompositor.cpp:
3918         (WebCore::RenderLayerCompositor::updateBacking):
3919         * testing/Internals.cpp:
3920         (WebCore::Internals::resetToConsistentState):
3921         (WebCore::Internals::setHeaderHeight):
3922         (WebCore::Internals::setFooterHeight):
3923
3924 2019-02-03  John Wilander  <wilander@apple.com>
3925
3926         Parse and handle Ad Click Attribution attributes in HTMLAnchorElement::handleClick()
3927         https://bugs.webkit.org/show_bug.cgi?id=194104
3928         <rdar://problem/47649991>
3929
3930         Reviewed by Chris Dumez, Daniel Bates, and Darin Adler.
3931
3932         Test: http/tests/adClickAttribution/anchor-tag-attributes-validation.html
3933
3934         This patch adds parsing and validation of the two new Ad Click Attribution
3935         attributes in anchor elements: adcampaignid and addestination. The data is
3936         not yet forwarded into the loader.
3937
3938         * html/HTMLAnchorElement.cpp:
3939         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
3940         (WebCore::HTMLAnchorElement::handleClick):
3941             Now calls HTMLAnchorElement::parseAdClickAttribution().
3942         * html/HTMLAnchorElement.h:
3943         * loader/AdClickAttribution.h:
3944             Made WebCore::AdClickAttribution copyable since it's needed to have it be
3945             WTF::Optional. Also made AdClickAttribution::MaxEntropy public. Changed
3946             numeric types from unsigned short to uint32_t.