IndexedDB: leak UniqueIDBDatabase in layout tests
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-21  Sihui Liu  <sihui_liu@apple.com>
2
3         IndexedDB: leak UniqueIDBDatabase in layout tests
4         https://bugs.webkit.org/show_bug.cgi?id=194870
5         <rdar://problem/48163812>
6
7         Reviewed by Geoffrey Garen.
8
9         UniqueIDBDatabase owns a pointer to itself after it is hard closed. It should release the pointer when it 
10         receives confirmation from clients and all pending tasks are done. UniqueIDBDatabase already checks whether the
11         pointer should be released when a database task finishes, but it didn't perform a check when a confirm message 
12         is received. 
13
14         No new test as the order of task completion and confirmation arrival is uncertain.
15
16         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
17         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
18
19 2019-02-21  Andy Estes  <aestes@apple.com>
20
21         contentfiltering tests leak documents
22         https://bugs.webkit.org/show_bug.cgi?id=189434
23         <rdar://44239943>
24
25         Reviewed by Simon Fraser.
26
27         Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.
28
29         This fixes world leaks in several tests in LayoutTests/contentfiltering/.
30
31         * bindings/js/ScriptController.h:
32         * loader/ContentFilter.cpp:
33         (WebCore::ContentFilter::didDecide):
34
35 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
36
37         [CMake][Win] Fix !USE(CF) build of WebCore
38         https://bugs.webkit.org/show_bug.cgi?id=194879
39
40         Reviewed by Konstantin Tokarev.
41
42         * PlatformAppleWin.cmake:
43         * PlatformWin.cmake:
44         * PlatformWinCairo.cmake:
45
46 2019-02-21  Zalan Bujtas  <zalan@apple.com>
47
48         [LFC][Floats] Add support for placing formatting roots in-between floats.
49         https://bugs.webkit.org/show_bug.cgi?id=194902
50
51         Reviewed by Antti Koivisto.
52
53         This patch add support for placing a formatting root box in-between existing floats.
54         The initial vertical position of a formatting root is its static position which can make the box
55         placed above exsiting floats (whereas we can never place a regular float above existing floats.)
56
57         Test: fast/block/block-only/floats-and-block-formatting-roots.html
58
59         * layout/blockformatting/BlockFormattingContext.cpp:
60         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
61         * layout/floats/FloatingContext.cpp:
62         (WebCore::Layout::FloatPair::LeftRightIndex::isEmpty const):
63         (WebCore::Layout::FloatPair::isEmpty const):
64         (WebCore::Layout::FloatPair::operator* const):
65         (WebCore::Layout::Iterator::operator* const):
66         (WebCore::Layout::begin):
67         (WebCore::Layout::end):
68         (WebCore::Layout::FloatingContext::positionForFloat const):
69         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
70         (WebCore::Layout::findAvailablePosition):
71         (WebCore::Layout::FloatingContext::findPositionForFloatBox const):
72         (WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const):
73         (WebCore::Layout::FloatPair::FloatPair):
74         (WebCore::Layout::FloatPair::left const):
75         (WebCore::Layout::FloatPair::right const):
76         (WebCore::Layout::FloatPair::intersects const):
77         (WebCore::Layout::FloatPair::operator == const):
78         (WebCore::Layout::FloatPair::horizontalConstraints const):
79         (WebCore::Layout::FloatPair::bottom const):
80         (WebCore::Layout::Iterator::operator++):
81         (WebCore::Layout::Iterator::set):
82         (WebCore::Layout::FloatingPair::isEmpty const): Deleted.
83         (WebCore::Layout::FloatingPair::verticalConstraint const): Deleted.
84         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): Deleted.
85         (WebCore::Layout::FloatingContext::floatingPosition const): Deleted.
86         (WebCore::Layout::FloatingPair::FloatingPair): Deleted.
87         (WebCore::Layout::FloatingPair::left const): Deleted.
88         (WebCore::Layout::FloatingPair::right const): Deleted.
89         (WebCore::Layout::FloatingPair::intersects const): Deleted.
90         (WebCore::Layout::FloatingPair::operator == const): Deleted.
91         (WebCore::Layout::FloatingPair::horizontalConstraints const): Deleted.
92         (WebCore::Layout::FloatingPair::bottom const): Deleted.
93         * layout/floats/FloatingContext.h:
94
95 2019-02-21  Rob Buis  <rbuis@igalia.com>
96
97         Update MIME type parser
98         https://bugs.webkit.org/show_bug.cgi?id=180526
99
100         Reviewed by Darin Adler.
101
102         Further testing showed the MIME parser needs these fixes:
103         - stripWhitespace is wrong for removing HTTP whitespace, use
104           stripLeadingAndTrailingHTTPSpaces instead.
105         - HTTP Token code points checking for Rfc2045 and Mimesniff were
106           mixed up, use the dedicated isValidHTTPToken for Mimesniff mode.
107         - Quoted Strings were not unescaped/escaped, this seems ok for
108           serializing but is wrong when gettings individual parameter values.
109           Implement [1] and [2] Step 2.4 to properly unescape and escape.
110
111         This change also tries to avoid hard to read uses of find.
112
113         Test: ParsedContentType.Serialize
114
115         [1] https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
116         [2] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
117
118         * platform/network/ParsedContentType.cpp:
119         (WebCore::skipSpaces):
120         (WebCore::parseToken):
121         (WebCore::isNotQuoteOrBackslash):
122         (WebCore::collectHTTPQuotedString):
123         (WebCore::containsNonTokenCharacters):
124         (WebCore::parseQuotedString):
125         (WebCore::ParsedContentType::parseContentType):
126         (WebCore::ParsedContentType::create):
127         (WebCore::ParsedContentType::setContentType):
128         (WebCore::containsNonQuoteStringTokenCharacters):
129         (WebCore::ParsedContentType::setContentTypeParameter):
130         (WebCore::ParsedContentType::serialize const):
131         (WebCore::substringForRange): Deleted.
132         (WebCore::isNonTokenCharacter): Deleted.
133         (WebCore::isNonQuotedStringTokenCharacter): Deleted.
134         * platform/network/ParsedContentType.h:
135
136 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
137
138         REGRESSION (240698): Fixed position banners flicker and move when scrolling on iOS
139         https://bugs.webkit.org/show_bug.cgi?id=194889
140         rdar://problem/47755552
141
142         Reviewed by Tim Horton.
143         
144         After r240698 we could commit scrolling changes for a fixed node where the "viewportRectAtLastLayout" and the layer
145         position were mismatched; this happened when AsyncScrollingCoordinator::reconcileScrollingState() came back from the UI process
146         with an unstable update and set a new layoutViewport, then some other layout triggered a compositing tree update. During the tree
147         update, we'd update the fixed scrolling node with the new viewport, and an old layer position.
148         
149         Fix by ensuring that we only update the geometry info for a scrolling tree node when we update layer geometry for the corresponding
150         layer.
151
152         Not currently testable.
153
154         * rendering/RenderLayerCompositor.cpp:
155         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
156
157 2019-02-20  Dean Jackson  <dino@apple.com>
158
159         Rotation animations sometimes use the wrong origin (affects apple.com)
160         https://bugs.webkit.org/show_bug.cgi?id=194878
161         <rdar://problem/43908047>
162
163         Reviewed by Simon Fraser.
164
165         Some versions of CoreAnimation apply additive animations in reverse
166         order. Detect this and reverse the list of animations we provide.
167
168         Update the existing animations/additive-transform-animations.html test to
169         be a ref-test that would identify this failure. Previously it relied on
170         a pixel test.
171
172         * platform/graphics/ca/GraphicsLayerCA.cpp: Use 
173             HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
174             not to flip the list of animations (and mark the correct ones as
175             additive).
176         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
177         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
178
179 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
180
181         [Win] Guard CF usage in RenderThemeWin
182         https://bugs.webkit.org/show_bug.cgi?id=194875
183
184         Reviewed by Alex Christensen.
185
186         No new tests. No change in behavior.
187
188         Add #if USE(CF) checks to RenderThemeWin so it can compile without CF support.
189
190         * rendering/RenderThemeWin.cpp:
191         (WebCore::RenderThemeWin::stringWithContentsOfFile):
192         (WebCore::RenderThemeWin::mediaControlsStyleSheet):
193         (WebCore::RenderThemeWin::mediaControlsScript):
194         * rendering/RenderThemeWin.h:
195
196 2019-02-20  Ryosuke Niwa  <rniwa@webkit.org>
197
198         Crash in DOMWindowExtension::suspendForPageCache
199         https://bugs.webkit.org/show_bug.cgi?id=194871
200
201         Reviewed by Chris Dumez.
202
203         This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache.
204
205         We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via
206         dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's.
207         Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache
208         to avoid the crash.
209
210         * page/DOMWindow.cpp:
211         (WebCore::DOMWindow::willDestroyCachedFrame):
212         (WebCore::DOMWindow::willDestroyDocumentInFrame):
213         (WebCore::DOMWindow::willDetachDocumentFromFrame):
214         (WebCore::DOMWindow::suspendForPageCache):
215         (WebCore::DOMWindow::resumeFromPageCache):
216         * page/DOMWindowExtension.cpp:
217         (WebCore::DOMWindowExtension::suspendForPageCache):
218
219 2019-02-20  Alex Christensen  <achristensen@webkit.org>
220
221         Always call CompletionHandlers after r240909
222         https://bugs.webkit.org/show_bug.cgi?id=194823
223
224         Reviewed by Ryosuke Niwa.
225
226         * loader/PolicyChecker.cpp:
227         (WebCore::PolicyChecker::checkNavigationPolicy):
228         (WebCore::PolicyChecker::checkNewWindowPolicy):
229
230 2019-02-20  Andy Estes  <aestes@apple.com>
231
232         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
233         https://bugs.webkit.org/show_bug.cgi?id=194869
234
235         Rubber-stamped by Jer Noble.
236
237         * WebCore.xcodeproj/project.pbxproj:
238
239 2019-02-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
240
241         drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
242         https://bugs.webkit.org/show_bug.cgi?id=194746
243
244         Reviewed by Dean Jackson.
245
246         Test: fast/canvas/canvas-drawImage-composite-copy.html
247
248         If the source canvas of drawImage() is the same as the destination and
249         globalCompositeOperation is set to "copy", copy the srcRect from the 
250         canvas to a temporary buffer before calling clearCanvas() then drawImage
251         from this temporary buffer.
252
253         * html/canvas/CanvasRenderingContext2DBase.cpp:
254         (WebCore::CanvasRenderingContext2DBase::drawImage):
255         * platform/graphics/ImageBuffer.cpp:
256         (WebCore::ImageBuffer::copyRectToBuffer):
257         * platform/graphics/ImageBuffer.h:
258
259 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
260
261         REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test
262         https://bugs.webkit.org/show_bug.cgi?id=194866
263
264         Reviewed by Antti Koivisto.
265
266         r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing
267         a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating
268         the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places.
269
270         * rendering/RenderLayerCompositor.cpp:
271         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
272
273 2019-02-20  Daniel Bates  <dabates@apple.com>
274
275         [iOS] Tweak UI for focus rings
276         https://bugs.webkit.org/show_bug.cgi?id=194864
277         <rdar://problem/47831886>
278
279         Reviewed by Brent Fulgham.
280
281         Make use of UIKit constants to make focus rings pretty.
282
283         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
284         (WebCore::drawFocusRingAtTime):
285
286 2019-02-20  Timothy Hatcher  <timothy@apple.com>
287
288         RenderThemeIOS should use RenderTheme's color cache instead of its own.
289         https://bugs.webkit.org/show_bug.cgi?id=194822
290         rdar://problem/48208296
291
292         Reviewed by Tim Horton.
293
294         Tested by fast/css/apple-system-colors.html.
295
296         * css/CSSValueKeywords.in:
297         * css/parser/CSSPropertyParser.cpp:
298         (WebCore::isAppleLegacyCssValueKeyword):
299         * platform/graphics/Color.h:
300         * platform/graphics/cg/ColorCG.cpp:
301         (WebCore::makeRGBAFromCGColor):
302         (WebCore::Color::Color):
303         * rendering/RenderThemeIOS.h:
304         * rendering/RenderThemeIOS.mm:
305         (WebCore::RenderThemeIOS::systemColor const):
306         * rendering/RenderThemeMac.mm:
307         (WebCore::RenderThemeMac::systemColor const):
308
309 2019-02-20  Loïc Yhuel  <loic.yhuel@softathome.com>
310
311         Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
312         https://bugs.webkit.org/show_bug.cgi?id=194819
313
314         Reviewed by Joseph Pecoraro.
315
316         Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html
317
318         * Modules/websockets/WebSocketChannel.h:
319         (WebCore::WebSocketChannel::hasCreatedHandshake):
320         * inspector/agents/page/PageNetworkAgent.cpp:
321         Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.
322
323 2019-02-20  Zalan Bujtas  <zalan@apple.com>
324
325         [LFC][Floats] Make FloatAvoider::resetPosition implicit
326         https://bugs.webkit.org/show_bug.cgi?id=194855
327
328         Reviewed by Antti Koivisto.
329
330         Let's compute the initial top/left position during c'tor time.
331         This is in preparation for fixing formatting root box placement in a float context.
332
333         * layout/floats/FloatAvoider.cpp:
334         (WebCore::Layout::FloatAvoider::resetPosition): Deleted.
335         * layout/floats/FloatAvoider.h:
336         (WebCore::Layout::FloatAvoider::displayBox):
337         (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
338         * layout/floats/FloatBox.cpp:
339         (WebCore::Layout::FloatBox::FloatBox):
340         (WebCore::Layout::FloatBox::initialVerticalPosition const):
341         * layout/floats/FloatBox.h:
342         * layout/floats/FloatingContext.cpp:
343         (WebCore::Layout::FloatingContext::floatingPosition const):
344
345 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
346
347         [MSVC] Fix compilation errors with lambdas in Service Workers
348         https://bugs.webkit.org/show_bug.cgi?id=194841
349
350         Reviewed by Alex Christensen.
351
352         No new tests. No change in behavior.
353
354         MSVC has problems with the scoping of `this` within a nested lambda. In these cases `this` is
355         referring to the enclosing lambda according to MSVC. This patch works around this behavior
356         through by using the `protectedThis` pattern in WebKit code.
357
358         * workers/service/server/RegistrationDatabase.cpp:
359         (WebCore::RegistrationDatabase::openSQLiteDatabase):
360
361 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
362
363         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
364         https://bugs.webkit.org/show_bug.cgi?id=167941
365
366         Reviewed by Carlos Garcia Campos.
367
368         * platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp
369         to the list of files with translatable strings.
370
371 2019-02-19  Simon Fraser  <simon.fraser@apple.com>
372
373         REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
374         https://bugs.webkit.org/show_bug.cgi?id=194827
375         rdar://problem/47620594
376
377         Reviewed by Antti Koivisto.
378
379         Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
380         layer configurations, since a repaint implies that a layer gains painted content. This is done
381         via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
382         The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
383         for the root. The configuration state that matters here is whether the layer contains painted content,
384         and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
385         and feeds into GraphicsLayer::drawsContent().
386
387         However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
388         then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
389         causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.
390
391         Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
392         the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
393         to always return false for the RenderView's layer (the root).
394         
395         Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
396         properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
397         LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
398         respect it.
399
400         Test: compositing/visibility/root-visibility-toggle.html
401
402         * page/Frame.h:
403         * platform/graphics/GraphicsLayer.cpp:
404         (WebCore::GraphicsLayer::dumpProperties const):
405         * platform/graphics/GraphicsLayerClient.h:
406         (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):
407         * rendering/RenderLayerBacking.cpp:
408         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
409         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):
410         * rendering/RenderLayerBacking.h:
411         * rendering/RenderLayerCompositor.cpp:
412         (WebCore::RenderLayerCompositor::layerTreeAsText):
413         * testing/Internals.cpp:
414         (WebCore::toLayerTreeFlags):
415         * testing/Internals.h:
416         * testing/Internals.idl:
417
418 2019-02-19  Ryosuke Niwa  <rniwa@webkit.org>
419
420         REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
421         https://bugs.webkit.org/show_bug.cgi?id=194820
422
423         Reviewed by Geoffrey Garen.
424
425         This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
426         doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
427         continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
428         and we don't rely on PolicyChecker's load type until then.
429
430         Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.
431
432         This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
433         invoking checkNewWindowPolicy which is not the right assumption.
434
435         Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html
436
437         * loader/FrameLoader.cpp:
438         (WebCore::FrameLoader::loadURL):
439         (WebCore::FrameLoader::load):
440         (WebCore::FrameLoader::loadPostRequest):
441
442 2019-02-19  Zalan Bujtas  <zalan@apple.com>
443
444         Fix post-commit feedback.
445
446         Unreviewed. 
447
448         * layout/floats/FloatingContext.cpp:
449         (WebCore::Layout::FloatingPair::intersects const):
450
451 2019-02-19  Zalan Bujtas  <zalan@apple.com>
452
453         [LFC][Floats] Remove redundant intersecting logic
454         https://bugs.webkit.org/show_bug.cgi?id=194804
455
456         Reviewed by Antti Koivisto.
457
458         floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
459
460         * layout/floats/FloatingContext.cpp:
461         (WebCore::Layout::FloatingContext::floatingPosition const):
462         (WebCore::Layout::FloatingPair::intersects const):
463
464 2019-02-19  Commit Queue  <commit-queue@webkit.org>
465
466         Unreviewed, rolling out r241722.
467         https://bugs.webkit.org/show_bug.cgi?id=194801
468
469         Causing time outs and EWS failures after expectation file was
470         added. (Requested by ShawnRoberts on #webkit).
471
472         Reverted changeset:
473
474         "IndexedDB: leak IDBDatabase and IDBTransacstion in layout
475         tests"
476         https://bugs.webkit.org/show_bug.cgi?id=194709
477         https://trac.webkit.org/changeset/241722
478
479 2019-02-16  Darin Adler  <darin@apple.com>
480
481         Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
482         https://bugs.webkit.org/show_bug.cgi?id=194752
483
484         Reviewed by Daniel Bates.
485
486         * Modules/websockets/WebSocket.cpp: Added an include of HexNumber.h. This previously
487         got included because of Logger.h, but that no longer pulls in HexNumber.h.
488
489         * css/CSSMarkup.cpp: Removed unneeded include of StringBuffer.h.
490         * css/CSSPrimitiveValue.cpp: Ditto.
491
492         * css/CSSUnicodeRangeValue.cpp:
493         (WebCore::CSSUnicodeRangeValue::customCSSText const): Use makeString and hex instead
494         of String::format and "%x".
495
496         * html/HTMLMediaElement.h:
497         (WTF::ValueToString<WebCore::TextTrackCue::string): Use a non-template function,
498         TextTrackCure::debugString, so we don't need to use HextNumber.h in a header.
499
500         * html/canvas/WebGLRenderingContextBase.cpp:
501         (GetErrorString): Use makeString and hex instead of String::format and "%04x".
502
503         * html/track/TextTrackCue.cpp:
504         (WebCore::TextTrackCue::debugString const): Added. Moved string conversion here
505         from HTMLMediaElement.h and use makeString instead of String::format. Also use
506         the word "debug" to make it clear that it's not OK to use this string, with a
507         pointer value serialized into it, outside of debugging.
508         * html/track/TextTrackCue.h: Added TextTrackCue::debugString.
509
510         * page/linux/ResourceUsageOverlayLinux.cpp:
511         (WebCore::formatByteNumber): Use makeString and FormattedNumber::fixedWidth
512         instead of String::format and "%.1f" etc.
513
514         * platform/cocoa/KeyEventCocoa.mm:
515         (WebCore::keyIdentifierForCharCode): Use the new hex function here instead of
516         the old code that did each of the four characters explicitly.
517
518         * platform/gamepad/mac/HIDGamepad.cpp:
519         (WebCore::HIDGamepad::HIDGamepad): Use makeString instead of String::format.
520
521         * platform/graphics/Color.cpp:
522         (WebCore::Color::nameForRenderTreeAsText const): Use hex instead of doing each
523         digit separately.
524
525         * platform/graphics/FloatPolygon.cpp:
526         (WebCore::FloatPolygonEdge::debugString const): Added. Moved string conversion here
527         from the header and use makeString instead of String::format. Also use
528         the word "debug" to make it clear that it's not OK to use this string, with a
529         pointer value serialized into it, outside of debugging.
530         * platform/graphics/FloatPolygon.h: Updated for the above.
531
532         * platform/graphics/ca/GraphicsLayerCA.cpp:
533         (WebCore::GraphicsLayerCA::setName): Use makeString instead of String::format.
534         (WebCore::GraphicsLayerCA::recursiveCommitChanges): DItto.
535         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
536         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
537         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Ditto.
538         * platform/gtk/PlatformKeyboardEventGtk.cpp:
539         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Ditto.
540         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
541         (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.
542         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
543         (WebCore::GStreamerVideoEncoder::makeElement): Ditto.
544         (WebCore::GStreamerVideoEncoder::InitEncode): Ditto.
545
546         * platform/text/TextCodecLatin1.cpp: Removed unneeded include of StringBuffer.h
547         and "using namespace WTF".
548
549         * platform/win/GDIObjectCounter.cpp:
550         (WebCore::GDIObjectCounter::GDIObjectCounter): Use makeString instead of String::format.
551         * platform/win/KeyEventWin.cpp:
552         (WebCore::keyIdentifierForWindowsKeyCode): Ditto.
553
554         * rendering/FloatingObjects.cpp:
555         (WebCore::FloatingObject::debugString const): Added. Moved string conversion here
556         from the header and use makeString instead of String::format. Also use
557         the word "debug" to make it clear that it's not OK to use this string, with a
558         pointer value serialized into it, outside of debugging.
559         * rendering/FloatingObjects.h: Updated for the above.
560
561         * rendering/RenderFragmentContainer.cpp:
562         (WebCore::RenderFragmentContainer::debugString const): Added. Moved string
563         conversion here from the header and use makeString instead of String::format.
564         Also use the word "debug" to make it clear that it's not OK to use this string,
565         with a pointer value serialized into it, outside of debugging.
566         * rendering/RenderFragmentContainer.h: Updated for the above.
567         * rendering/RenderFragmentedFlow.h: Ditto.
568
569         * testing/Internals.cpp:
570         (WebCore::Internals::address): Use makeString instead of String::format.
571
572 2019-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>
573
574         [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
575         https://bugs.webkit.org/show_bug.cgi?id=194670
576         <rdar://problem/39066529>
577
578         Reviewed by Tim Horton.
579
580         Adds support for pasting files on the pasteboard as attachment elements, if the attachment element runtime
581         switch is enabled. Currently, the only types of data that can be pasted as attachments are images, which take a
582         special codepath in WebContentReader::readImage.
583
584         This patch adds a readDataBuffer method that converts a given blob of data from the pasteboard into an
585         attachment-element-backed representation in the DOM (i.e. either an attachment element or image element that
586         contains an attachment element). In the case where the given pasteboard item has been explicitly marked as an
587         attachment (via the preferredPresentationStyle hint) and the item has at least one type representation that
588         conforms to "public.content", we take this codepath instead of first attempting the web content reading types
589         supported by default in WebKit.
590
591         See below for more detail.
592
593         Test: WKAttachmentTestsIOS.InsertPastedFilesAsAttachments
594
595         * editing/Editor.cpp:
596         (WebCore::Editor::clientReplacementURLForResource): Deleted.
597         * editing/Editor.h:
598         * editing/WebContentReader.h:
599         * editing/cocoa/WebContentReaderCocoa.mm:
600         (WebCore::mimeTypeFromContentType):
601         (WebCore::contentTypeIsSuitableForInlineImageRepresentation):
602         (WebCore::createFragmentAndAddResources):
603         (WebCore::sanitizeMarkupWithArchive):
604
605         Remove all logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
606
607         (WebCore::WebContentReader::readImage):
608         (WebCore::attachmentForFilePath):
609         (WebCore::attachmentForData):
610
611         Add a helper that creates an attachment element for a given blob of data and content type. The logic here is
612         quite similar to that of attachmentForFilePath, and we should find a way to either merge them, or pull out more
613         of their similarities into helper functions.
614
615         (WebCore::WebContentReader::readDataBuffer):
616         (WebCore::replaceSubresourceURLsWithURLsFromClient): Deleted.
617
618         Remove more logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
619
620         * loader/EmptyClients.cpp:
621         * page/EditorClient.h:
622         * platform/Pasteboard.h:
623         * platform/PasteboardItemInfo.h:
624         (WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
625         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
626         (WebCore::PasteboardItemInfo::encode const):
627         (WebCore::PasteboardItemInfo::decode):
628
629         Add contentTypesByFidelity to PasteboardItemInfo, instead of requesting this information using a separate IPC
630         message. This means we can also remove getTypesByFidelityForItemAtIndex, and just use the item's types in
631         fidelity order instead.
632
633         * platform/PasteboardStrategy.h:
634         * platform/PlatformPasteboard.h:
635         * platform/ios/AbstractPasteboard.h:
636         * platform/ios/PasteboardIOS.mm:
637         (WebCore::Pasteboard::read):
638
639         Shave off (potentially many) sync IPC messages to the UI process by pulling each call to
640         informationForItemAtIndex out of the inner loop when reading web content.
641
642         (WebCore::Pasteboard::readRespectingUTIFidelities):
643
644         Shave off one extraneous sync IPC message by rolling the types in fidelity order into the request for
645         PasteboardItemInfo, instead of being sent in a separate message.
646
647         * platform/ios/PlatformPasteboardIOS.mm:
648         (WebCore::PlatformPasteboard::informationForItemAtIndex):
649
650         Populate contentTypesForFileUpload in the case where UIPasteboard is used (i.e. copy and paste).
651
652         (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex): Deleted.
653         * platform/ios/WebItemProviderPasteboard.h:
654         * platform/ios/WebItemProviderPasteboard.mm:
655         (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]): Deleted.
656
657 2019-02-18  Daniel Bates  <dabates@apple.com>
658
659         Clean up and modernize RenderThemeIOS::paintCheckboxDecorations()
660         https://bugs.webkit.org/show_bug.cgi?id=194785
661
662         Reviewed by Simon Fraser.
663
664         Change from early return to else-clause to make the states clearer and make it more straightforward
665         to share more common code. Use constexpr, allocate temporary vectors with inline capacity, and
666         switch to uniform initializer syntax.
667
668         * rendering/RenderThemeIOS.mm:
669         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
670
671 2019-02-18  Daniel Bates  <dabates@apple.com>
672
673         [iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour
674         https://bugs.webkit.org/show_bug.cgi?id=193599
675         <rdar://problem/47399602>
676
677         Reviewed by Simon Fraser.
678
679         For now, iOS uses a 3px outline width for its focus rings. Do not inset the focus ring on iOS
680         for text fields, textareas, keygens, and selects so as to match the visual appearance of all
681         the other controls.
682
683         Tests: fast/forms/ios/focus-button.html
684                fast/forms/ios/focus-checkbox.html
685                fast/forms/ios/focus-checked-checkbox.html
686                fast/forms/ios/focus-checked-radio.html
687                fast/forms/ios/focus-radio.html
688                fast/forms/ios/focus-reset-button.html
689                fast/forms/ios/focus-search-field.html
690                fast/forms/ios/focus-submit-button.html
691                fast/forms/ios/focus-text-field.html
692                fast/forms/ios/focus-textarea.html
693
694         * css/html.css:
695         (:focus): Use 3px outline width.
696         (input:focus, textarea:focus, keygen:focus, select:focus): Guard this code to exclude it when building for iOS.
697         * rendering/RenderBox.cpp:
698         (WebCore::RenderBox::paintBoxDecorations): Add FIXME comment.
699         * rendering/RenderElement.cpp:
700         (WebCore::RenderElement::paintOutline): Call RenderTheme::adjustPaintRect() to adjust the paint rect.
701         Otherwise, the focus rings for radios and checkboxes are drawn at the wrong y-coordinate and are not snug.
702
703 2019-02-18  Oriol Brufau  <obrufau@igalia.com>
704
705         [css-grid] Handle indefinite percentages in fit-content()
706         https://bugs.webkit.org/show_bug.cgi?id=194509
707
708         Reviewed by Javier Fernandez.
709
710         Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html
711
712         If the size of the grid container depends on the size of its tracks,
713         a percentage in fit-content() is indefinite. Without this patch, some
714         places treated this case as fit-content(0), which prevented the grid
715         container from growing enough to contain the max-content contribution
716         of its grid items.
717
718         This patch treats such fit-content() as minmax(auto, max-content),
719         but once the size of the grid container is known and it is laid out
720         "for real", then the percentage is definite and it's used.
721
722         * rendering/GridTrackSizingAlgorithm.cpp:
723         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
724         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
725
726 2019-02-18  John Wilander  <wilander@apple.com>
727
728         Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
729         https://bugs.webkit.org/show_bug.cgi?id=194777
730         <rdar://problem/47731945>
731
732         Reviewed by Geoffrey Garen and Chris Dumez.
733
734         Test: http/tests/storageAccess/remove-requesting-iframe.html
735
736         * dom/Document.cpp:
737         (WebCore::Document::hasFrameSpecificStorageAccess const):
738             Now checks for the existence of the frame.
739         (WebCore::Document::setHasFrameSpecificStorageAccess):
740             Now checks for the existence of the frame.
741         * loader/ResourceLoadObserver.cpp:
742         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
743             Now checks that the session ID is valid.
744
745 2019-02-18  Jer Noble  <jer.noble@apple.com>
746
747         -[AVSampleBufferDisplayLayer player]: Unrecognized selector crash
748         https://bugs.webkit.org/show_bug.cgi?id=194790
749         <rdar://problem/33866742>
750
751         Reviewed by Jon Lee.
752
753         Ensure that a WebVideoContainerLayer's sole sublayer is actually an AVPlayerLayer (and not
754         an AVSampleBufferDisplayLayer) before reporting that the layer type is LayerTypeAVPlayerLayer.
755
756         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
757         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
758
759 2019-02-18  Joseph Pecoraro  <pecoraro@apple.com>
760
761         Web Inspector: Better categorize CPU usage per-thread / worker
762         https://bugs.webkit.org/show_bug.cgi?id=194564
763
764         Reviewed by Devin Rousso.
765
766         Test: inspector/cpu-profiler/threads.html
767
768         * workers/WorkerThread.cpp:
769         (WebCore::WorkerThread::workerThreadsMutex):
770         (WebCore::WorkerThread::workerThreadCount):
771         (WebCore::WorkerThread::WorkerThread):
772         (WebCore::WorkerThread::~WorkerThread):
773         (WebCore::WorkerThread::workerThread):
774         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
775         * workers/WorkerThread.h:
776         (WebCore::WorkerThread::identifier const):
777         Expose the set of all WorkerThreads.
778
779         * inspector/agents/InspectorCPUProfilerAgent.cpp:
780         (WebCore::InspectorCPUProfilerAgent::collectSample):
781         Send inspector additional per-thread data.
782
783         * page/ResourceUsageData.h:
784         (WebCore::WorkerCPUInfo::WorkerCPUInfo):
785         * page/cocoa/ResourceUsageThreadCocoa.mm:
786         (WebCore::ThreadInfo::ThreadInfo):
787         (WebCore::threadInfos):
788         (WebCore::ResourceUsageThread::platformCollectCPUData):
789         (WebCore::threadSendRights): Deleted.
790         (WebCore::cpuUsage): Deleted.
791         Compute per-thread values on cocoa ports.
792
793         * page/linux/ResourceUsageThreadLinux.cpp:
794         (WebCore::ResourceUsageThread::platformCollectCPUData):
795         Stub per-thread values on linux ports.
796
797 2019-02-18  Jer Noble  <jer.noble@apple.com>
798
799         Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus()
800         https://bugs.webkit.org/show_bug.cgi?id=194786
801
802         Reviewed by Eric Carlson.
803
804         Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:]
805         in an exception handler.
806
807         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
808         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
809
810 2019-02-18  Daniel Bates  <dabates@apple.com>
811
812         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
813         https://bugs.webkit.org/show_bug.cgi?id=192824
814         <rdar://problem/47100332>
815
816         Reviewed by Wenson Hsieh.
817
818         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
819         now that hardware key events to non-editable elements use the same code path as for editable elements. 
820
821         * platform/ios/KeyEventIOS.mm:
822         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
823         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
824         (WebCore::isFunctionKey): Ditto.
825         * platform/ios/WebEvent.mm:
826         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
827         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
828
829 2019-02-18  Eric Carlson  <eric.carlson@apple.com>
830
831         Add MSE logging configuration
832         https://bugs.webkit.org/show_bug.cgi?id=194719
833         <rdar://problem/48122151>
834
835         Reviewed by Joseph Pecoraro.
836
837         No new tests, updated inspector/console/webcore-logging.html.
838
839         * dom/Document.cpp:
840         (WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.
841
842         * inspector/agents/WebConsoleAgent.cpp:
843         (WebCore::WebConsoleAgent::getLoggingChannels): Ditto.
844
845 2019-02-18  Antoine Quint  <graouts@apple.com>
846
847         [iOS] Dispatch additional events along with pointerdown and pointerup
848         https://bugs.webkit.org/show_bug.cgi?id=194776
849         <rdar://problem/48164284>
850
851         Reviewed by Brent Fulgham.
852
853         The Pointer Events specification mandates that "pointerover" and "pointerenter" events precede a "pointerdown" event and that "pointerout"
854         and "pointerleave" events follow a "pointerup" event. We remove the EventHandler::dispatchPointerEventForTouchAtIndex() method and replace
855         it with a PointerCaptureController::dispatchEventForTouchAtIndex() that can handle the dispatch of such additional events correctly, also
856         allowing for two PointerCaptureController methods (pointerEventWillBeDispatched and pointerEventWasDispatched) to become private.
857
858         Test: pointerevents/ios/over-enter-out-leave.html
859
860         * dom/EventNames.h: Add the new "pointerover", "pointerenter", "pointerout" and "pointerleave" event types.
861         * dom/PointerEvent.h:
862         * dom/ios/PointerEventIOS.cpp:
863         (WebCore::PointerEvent::create):
864         * page/EventHandler.cpp:
865         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex): Deleted.
866         * page/EventHandler.h:
867         * page/PointerCaptureController.cpp:
868         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Take the existing code from EventHandler::dispatchPointerEventForTouchAtIndex()
869         and extend it to dispatch additional events as mandated. Since several events may be dispatched we check whether the dispatch of any of those events
870         had defaultPrevented() or defaultHanded() return true and return those values as a pair.
871         (WebCore::PointerCaptureController::pointerEventWasDispatched):
872         * page/PointerCaptureController.h:
873
874 2019-02-18  Sihui Liu  <sihui_liu@apple.com>
875
876         IndexedDB: leak IDBDatabase and IDBTransacstion in layout tests
877         https://bugs.webkit.org/show_bug.cgi?id=194709
878
879         Reviewed by Geoffrey Garen.
880
881         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
882         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
883
884         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
885         between IDBOpenDBRequest and IDBTransaction.
886
887         Test: storage/indexeddb/IDBObject-leak.html
888
889         * Modules/indexeddb/IDBDatabase.cpp:
890         (WebCore::IDBDatabase::connectionToServerLost):
891         * Modules/indexeddb/IDBTransaction.cpp:
892         (WebCore::IDBTransaction::IDBTransaction):
893         (WebCore::IDBTransaction::~IDBTransaction):
894         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
895         (WebCore::IDBTransaction::connectionClosedFromServer):
896         * Modules/indexeddb/IDBTransaction.h:
897         * testing/Internals.cpp:
898         (WebCore::Internals::numberOfIDBTransactions const):
899         * testing/Internals.h:
900         * testing/Internals.idl:
901
902 2019-02-18  Chris Fleizach  <cfleizach@apple.com>
903
904         AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
905         https://bugs.webkit.org/show_bug.cgi?id=194742
906
907         Reviewed by Chris Dumez.
908
909         With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
910         had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
911
912         This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
913         receive notifications.
914
915         It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
916         page load.
917
918         * accessibility/mac/AXObjectCacheMac.mm:
919         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
920
921 2019-02-18  Megan Gardner  <megan_gardner@apple.com>
922
923         Turn On Smart Delete
924         https://bugs.webkit.org/show_bug.cgi?id=194320
925
926         Reviewed by Ryosuke Niwa.
927
928         Updated the following tests to work with iOS:
929         * editing/deleting/smart-delete-001.html:
930         * editing/deleting/smart-delete-002.html:
931         * editing/deleting/smart-delete-003.html:
932         * editing/deleting/smart-delete-004.html:
933         * editing/deleting/smart-delete-across-editable-boundaries-2.html:
934         * editing/selection/delete-word-granularity-text-control.html:
935
936         Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other 
937         platforms to turn on smart delete when desired.
938
939         * editing/Editor.cpp:
940         (WebCore::Editor::shouldSmartDelete):
941         Allow platfroms to determine if smart delete should be on.
942         On mac, this is via word granularity, on iOS this is just on all the time.
943         (WebCore::Editor::canSmartCopyOrDelete):
944         (WebCore::Editor::performCutOrCopy):
945         * editing/Editor.h:
946         * editing/EditorCommand.cpp:
947         (WebCore::executeDelete):
948         * editing/ios/EditorIOS.mm:
949         (WebCore::Editor::shouldSmartDelete):
950         * editing/mac/EditorMac.mm:
951         (WebCore::Editor::shouldSmartDelete):
952
953 2019-02-17  David Kilzer  <ddkilzer@apple.com>
954
955         Unreviewed, rolling out r241620.
956
957         "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
958         (Requested by ddkilzer on #webkit.)
959
960         Reverted changeset:
961
962         "[WTF] Add environment variable helpers"
963         https://bugs.webkit.org/show_bug.cgi?id=192405
964         https://trac.webkit.org/changeset/241620
965
966 2019-02-16  Zalan Bujtas  <zalan@apple.com>
967
968         [LFC] RenderImage's default intrinsic size is 0.
969         https://bugs.webkit.org/show_bug.cgi?id=194745
970
971         Reviewed by Antti Koivisto.
972
973         While the images are being loaded, their intrinsic size is set to 0 (RenderImage c'tor). Note that this code is temporary.
974         * layout/layouttree/LayoutTreeBuilder.cpp:
975         (WebCore::Layout::TreeBuilder::createSubTree):
976
977 2019-02-16  Zalan Bujtas  <zalan@apple.com>
978
979         [LFC][BFC] Add support for block replaced intrinsic width.
980         https://bugs.webkit.org/show_bug.cgi?id=194705
981
982         Reviewed by Simon Fraser.
983
984         Replaced boxes should report their intrinsic width as preferred widths.
985
986         Test: fast/block/block-only/replaced-intrinsic-width-simple.html
987
988         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
989         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
990
991 2019-02-16  Zalan Bujtas  <zalan@apple.com>
992
993         [LFC] Apply min/max width constraints to preferred width computation
994         https://bugs.webkit.org/show_bug.cgi?id=194739
995
996         Reviewed by Simon Fraser.
997
998         Ensure that both min-height and max-height are taken into account while computing the preferred width.
999
1000         Test: fast/block/block-only/min-max-and-preferred-width-simple.html
1001
1002         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1003         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
1004
1005 2019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
1006
1007         [JSC] Make builtin objects more lazily initialized under non-JIT mode
1008         https://bugs.webkit.org/show_bug.cgi?id=194727
1009
1010         Reviewed by Saam Barati.
1011
1012         * Modules/streams/ReadableByteStreamInternals.js:
1013         (privateInitializeReadableByteStreamController):
1014         (readableByteStreamControllerRespond):
1015
1016 2019-02-15  Dean Jackson  <dino@apple.com>
1017
1018         Allow emulation of user gestures from Web Inspector console
1019         https://bugs.webkit.org/show_bug.cgi?id=194725
1020         <rdar://problem/48126604>
1021
1022         Reviewed by Joseph Pecoraro and Devin Rousso.
1023
1024         Test: inspector/runtime/evaluate-userGestureEmulation.html
1025
1026         * inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
1027         a UserGestureIndicator based on the emulateUserGesture option.
1028         (WebCore::PageRuntimeAgent::evaluate):
1029         * inspector/agents/page/PageRuntimeAgent.h:
1030
1031 2019-02-15  Chris Dumez  <cdumez@apple.com>
1032
1033         Sample domainsVisited diagnostic logging
1034         https://bugs.webkit.org/show_bug.cgi?id=194657
1035
1036         Reviewed by Ryosuke Niwa.
1037
1038         Sample domainsVisited diagnostic logging, we are getting a lot of data from
1039         this key and this is hurting our other keys.
1040
1041         * page/Page.cpp:
1042         (WebCore::Page::logNavigation):
1043
1044 2019-02-15  Ryosuke Niwa  <rniwa@webkit.org>
1045
1046         Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
1047         https://bugs.webkit.org/show_bug.cgi?id=194691
1048
1049         Reviewed by Simon Fraser.
1050
1051         The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document
1052         without updating the layout of ancestor documents (i.e. documents in which frame owner
1053         elements appear) even though it hit-tests against the top-level document's RenderView.
1054
1055         Fixed the bug by updating the layout of the top-level document as needed.
1056
1057         Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html
1058
1059         * html/HTMLPlugInElement.cpp:
1060         (WebCore::HTMLPlugInElement::isReplacementObscured):
1061
1062 2019-02-15  Ross Kirsling  <ross.kirsling@sony.com>
1063
1064         [WTF] Add environment variable helpers
1065         https://bugs.webkit.org/show_bug.cgi?id=192405
1066
1067         Reviewed by Michael Catanzaro.
1068
1069         * platform/NotImplemented.h:
1070         * platform/cocoa/SystemVersion.mm:
1071         (WebCore::createSystemMarketingVersion):
1072         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1073         (WebCore::initializeGStreamer):
1074         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1075         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1076         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
1077         (Nicosia::PaintingEngine::create):
1078         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
1079         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
1080         * platform/graphics/x11/PlatformDisplayX11.cpp:
1081         (WebCore::PlatformDisplayX11::create):
1082         * platform/gtk/RenderThemeWidget.cpp:
1083         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
1084         * platform/gtk/ScrollbarThemeGtk.cpp:
1085         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
1086         * platform/network/curl/CurlContext.cpp:
1087         (WebCore::CurlContext::CurlContext):
1088         (WebCore::EnvironmentVariableReader::read): Deleted.
1089         (WebCore::EnvironmentVariableReader::defined): Deleted.
1090         (WebCore::EnvironmentVariableReader::readAs): Deleted.
1091         (WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
1092         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
1093         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
1094         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1095         (WebCore::defaultCookieJarPath):
1096         * platform/network/playstation/CurlSSLHandlePlayStation.cpp:
1097         (WebCore::getCACertPathEnv):
1098         * platform/network/win/CurlSSLHandleWin.cpp:
1099         (WebCore::getCACertPathEnv):
1100         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1101         (WebCore::topLevelPath):
1102         (WebCore::webkitBuildDirectory):
1103         * platform/unix/LoggingUnix.cpp:
1104         (WebCore::logLevelString):
1105         * platform/win/LoggingWin.cpp:
1106         (WebCore::logLevelString):
1107         Utilize WTF::Environment where possible.
1108
1109 2019-02-15  Antoine Quint  <graouts@apple.com>
1110
1111         Add a method to dispatch a PointerEvent based on a PlatformTouchEvent
1112         https://bugs.webkit.org/show_bug.cgi?id=194702
1113         <rdar://problem/48109355>
1114
1115         Reviewed by Dean Jackson.
1116
1117         * page/EventHandler.cpp:
1118         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex):
1119         * page/EventHandler.h:
1120
1121 2019-02-15  Per Arne Vollan  <pvollan@apple.com>
1122
1123         [WebVTT] Inline WebVTT styles should start with '::cue'
1124         https://bugs.webkit.org/show_bug.cgi?id=194227
1125
1126         Reviewed by Eric Carlson.
1127
1128         The original fix in r241203 is not sufficient, since it only checks if the CSS string starts
1129         with '::cue'. Before accepting a CSS string from a WebVTT file, it should be checked that
1130         all selectors starts with '::cue'.
1131
1132         Test: media/track/track-cue-css.html
1133
1134         * html/track/WebVTTParser.cpp:
1135         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
1136
1137 2019-02-15  Youenn Fablet  <youenn@apple.com>
1138
1139         Add binding tests for ContextAllowsMediaDevices and ContextHasServiceWorkerScheme
1140         https://bugs.webkit.org/show_bug.cgi?id=194713
1141
1142         Reviewed by Eric Carlson.
1143
1144         Binding tests covering mediaDevices and serviceWorker attributes.
1145
1146         * bindings/scripts/test/JS/JSTestObj.cpp:
1147         (WebCore::JSTestObjPrototype::finishCreation):
1148         (WebCore::jsTestObjMediaDevices1Getter):
1149         (WebCore::jsTestObjMediaDevices1):
1150         (WebCore::jsTestObjMediaDevices2Getter):
1151         (WebCore::jsTestObjMediaDevices2):
1152         (WebCore::jsTestObjServiceWorkers1Getter):
1153         (WebCore::jsTestObjServiceWorkers1):
1154         (WebCore::jsTestObjServiceWorkers2Getter):
1155         (WebCore::jsTestObjServiceWorkers2):
1156         * bindings/scripts/test/TestObj.idl:
1157
1158 2019-02-15  Beth Dakin  <bdakin@apple.com>
1159
1160         Build fix.
1161
1162         * rendering/RenderThemeIOS.mm:
1163         (WebCore::iconForAttachment):
1164
1165 2019-02-15  Youenn Fablet  <youenn@apple.com>
1166
1167         Make ServiceWorkerClientFetch closer to WebResourceLoader
1168         https://bugs.webkit.org/show_bug.cgi?id=194651
1169
1170         Reviewed by Alex Christensen.
1171
1172         Check for redirection response and if so call a specific client API.
1173         Ensure ServiceWorkerFetch::Client gets called in the service worker thread proxy
1174         so that its m_connection is only accessed on that thread.
1175
1176         Covered by existing tests.
1177
1178         * platform/network/FormData.h:
1179         * platform/network/ResourceErrorBase.h:
1180         * workers/service/context/ServiceWorkerFetch.cpp:
1181         (WebCore::ServiceWorkerFetch::processResponse):
1182         * workers/service/context/ServiceWorkerFetch.h:
1183         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1184         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
1185         (WebCore::ServiceWorkerThreadProxy::continueDidReceiveFetchResponse):
1186         * workers/service/context/ServiceWorkerThreadProxy.h:
1187
1188 2019-02-15  Youenn Fablet  <youenn@apple.com>
1189
1190         Make navigator.mediaDevices SecureContext
1191         https://bugs.webkit.org/show_bug.cgi?id=194666
1192
1193         Reviewed by Eric Carlson.
1194
1195         Make navigator.mediaDevices SecureContext.
1196         This can still be enabled for unsecure context using the existing page settings.
1197         To cover that case, introduce ContextHasMediaDevices custom IDL keyword.
1198
1199         Covered by API test.
1200
1201         * Modules/mediastream/NavigatorMediaDevices.idl:
1202         * bindings/scripts/CodeGeneratorJS.pm:
1203         (GenerateRuntimeEnableConditionalString):
1204         * bindings/scripts/IDLAttributes.json:
1205         * dom/ScriptExecutionContext.cpp:
1206         (WebCore::ScriptExecutionContext::hasMediaDevices const):
1207         (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
1208         * dom/ScriptExecutionContext.h:
1209
1210 2019-02-15  Youenn Fablet  <youenn@apple.com>
1211
1212         WebSocket should not fire events after being stopped
1213         https://bugs.webkit.org/show_bug.cgi?id=194690
1214
1215         Reviewed by Geoffrey Garen.
1216
1217         dispatchOrQueueErrorEvent is scheduled using RunLoop::main().dispatch or dispatch_async.
1218         This makes it possible to dispatch an event while WebSocket is already stopped.
1219         Instead, use Document::postTask so that the task is only executed if WebSocket is not stopped.
1220
1221         As a refactoring, make use of PendingActivity to keep track of setPendingActivity/unsetPendingActivity more easily.
1222
1223         * Modules/websockets/WebSocket.cpp:
1224         (WebCore::WebSocket::stop):
1225         (WebCore::WebSocket::connect):
1226         * Modules/websockets/WebSocket.h:
1227
1228 2019-02-15  Youenn Fablet  <youenn@apple.com>
1229
1230         Performance should not fire events when its context is stopped
1231         https://bugs.webkit.org/show_bug.cgi?id=194689
1232
1233         Reviewed by Alex Christensen.
1234
1235         Stop the timer when its context is destroyed.
1236         Add an assertion to ensure the timer does not fire after context is destroyed.
1237
1238         * page/Performance.cpp:
1239         (WebCore::Performance::stop):
1240
1241 2019-02-15  Alex Christensen  <achristensen@webkit.org>
1242
1243         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
1244         https://bugs.webkit.org/show_bug.cgi?id=194523
1245
1246         Reviewed by Geoffrey Garen.
1247
1248         The scope of the FormCreationContext was limited to the scope of createHTTPBodyCFReadStream,
1249         so when it was used in formCreate it was lucky to get the same context if the stack hadn't been overwritten
1250         and if the FormData hadn't been freed.  Instead, keep it alive with new/delete like we do the FormStreamFields.
1251         A younger me should've noticed this when reviewing r218517.
1252
1253         * platform/network/cf/FormDataStreamCFNet.cpp:
1254         (WebCore::formCreate):
1255         (WebCore::createHTTPBodyCFReadStream):
1256
1257 2019-02-15  Commit Queue  <commit-queue@webkit.org>
1258
1259         Unreviewed, rolling out r241559 and r241566.
1260         https://bugs.webkit.org/show_bug.cgi?id=194710
1261
1262         Causes layout test crashes under GuardMalloc (Requested by
1263         ryanhaddad on #webkit).
1264
1265         Reverted changesets:
1266
1267         "[WTF] Add environment variable helpers"
1268         https://bugs.webkit.org/show_bug.cgi?id=192405
1269         https://trac.webkit.org/changeset/241559
1270
1271         "Unreviewed build fix for WinCairo Debug after r241559."
1272         https://trac.webkit.org/changeset/241566
1273
1274 2019-02-15  Youenn Fablet  <youenn@apple.com>
1275
1276         Stop the endpoint synchronously in RTCPeerConnection::close
1277         https://bugs.webkit.org/show_bug.cgi?id=194688
1278
1279         Reviewed by Eric Carlson.
1280
1281         In the case where the peer connection is being closed, it was asynchronously stopping the endpoint.
1282         But the endpoint, before being stopped, could try to fire an event.
1283         If the context is gone in between, we end up with a null pointer dereference.
1284
1285         * Modules/mediastream/RTCPeerConnection.cpp:
1286         (WebCore::RTCPeerConnection::close):
1287
1288 2019-02-15  Zalan Bujtas  <zalan@apple.com>
1289
1290         [LFC] Out-of-flow box is never a float box
1291         https://bugs.webkit.org/show_bug.cgi?id=194704
1292
1293         Reviewed by Antti Koivisto.
1294
1295         We can't have it both ways. Absolute positioning wins.
1296
1297         Test: fast/block/block-only/out-of-flow-is-never-float-box.html
1298
1299         * layout/layouttree/LayoutBox.cpp:
1300         (WebCore::Layout::Box::isFloatingPositioned const):
1301         (WebCore::Layout::Box::isLeftFloatingPositioned const):
1302         (WebCore::Layout::Box::isRightFloatingPositioned const):
1303
1304 2019-02-15  Philippe Normand  <pnormand@igalia.com>
1305
1306         [GStreamer] Simplify GObject class name check
1307         https://bugs.webkit.org/show_bug.cgi?id=194537
1308
1309         Reviewed by Michael Catanzaro.
1310
1311         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1312         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
1313         Use G_OBJECT_TYPE_NAME() to filter out uridecodebin child
1314         elements.
1315
1316 2019-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1317
1318         Refactor EditingStyle::textDirection to return an Optional<WritingDirection> instead of a bool
1319         https://bugs.webkit.org/show_bug.cgi?id=194686
1320
1321         Reviewed by Ryosuke Niwa.
1322
1323         Changes EditingStyle::textDirection to return an Optional<WritingDirection>, instead of taking a reference to
1324         the resulting WritingDirection. No change in behavior.
1325
1326         * editing/ApplyStyleCommand.cpp:
1327         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
1328         (WebCore::ApplyStyleCommand::applyInlineStyle):
1329         * editing/EditingStyle.cpp:
1330         (WebCore::EditingStyle::textDirection const):
1331         (WebCore::EditingStyle::textDirectionForSelection):
1332         * editing/EditingStyle.h:
1333
1334 2019-02-10  Darin Adler  <darin@apple.com>
1335
1336         Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
1337         https://bugs.webkit.org/show_bug.cgi?id=194487
1338
1339         Reviewed by Daniel Bates.
1340
1341         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
1342         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue): Use makeString
1343         instead of String::format.
1344
1345         * page/linux/ResourceUsageOverlayLinux.cpp:
1346         (WebCore::formatByteNumber): Use String::number instead of String::format.
1347
1348         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
1349         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
1350         Use makeString instead of String::format.
1351         * platform/glib/UserAgentGLib.cpp:
1352         (WebCore::platformVersionForUAString): Ditto.
1353         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1354         (WebCore::simpleBusMessageCallback): Ditto.
1355         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1356         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ditto.
1357         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1358         (WebCore::AppendPipeline::AppendPipeline): Ditto.
1359         (WebCore::AppendPipeline::handleStateChangeMessage): Ditto.
1360         (WebCore::AppendPipeline::resetParserState): Ditto.
1361         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1362         (WebCore::MediaPlayerPrivateGStreamerMSE::load): Ditto.
1363         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Ditto.
1364
1365         * platform/graphics/gtk/ImageBufferGtk.cpp:
1366         (WebCore::encodeImage): Use String::number instead of String::format.
1367
1368         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1369         (WebCore::GStreamerAudioCaptureSource::create): Use makeString instead of
1370         String::format.
1371         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
1372         (WebCore::GStreamerCaptureDeviceManager::addDevice): Ditto.
1373         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
1374         (WebCore::webkitMediaStreamSrcAddPad): Ditto.
1375         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1376         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
1377         * platform/network/curl/CookieJarDB.cpp:
1378         (WebCore::CookieJarDB::verifySchemaVersion): Ditto.
1379         * platform/win/SearchPopupMenuDB.cpp:
1380         (WebCore::SearchPopupMenuDB::verifySchemaVersion): Ditto.
1381
1382 2019-02-15  Philippe Normand  <pnormand@igalia.com>
1383
1384         [GStreamer] Decoding media-capabilities configuration initial support
1385         https://bugs.webkit.org/show_bug.cgi?id=191191
1386
1387         Reviewed by Xabier Rodriguez-Calvar.
1388
1389         This patch enables basic platform probing for GStreamer decoders,
1390         optionally using Hardware decoding capabilities. The previous code
1391         for decoders/demuxers probing partially duplicated between the MSE
1392         player and its parent class was moved to a new module called
1393         GStreamerRegistryScanner. There is one instance of it for the MSE player
1394         and one for the parent class.
1395
1396         The scanner can check for the presence of the GstElement Hardware
1397         metadata classifier in decoders and thus advise the
1398         MediaEngineConfigurationFactoryGStreamer that hardware decoding is
1399         supported or not. This is only a first step though. The scanner
1400         should also probably attempt a NULL->READY transition on decoders
1401         to validate specific input caps are supported. As this might
1402         require changes in GStreamer, this part of the patch wasn't
1403         included.
1404
1405         This patch is covered by the existing media tests.
1406
1407         * platform/GStreamer.cmake: New files.
1408         * platform/graphics/MediaPlayer.cpp: Add support for converting
1409         SupportsType enum to string.
1410         (WebCore::convertEnumerationToString):
1411         * platform/graphics/MediaPlayer.h: Ditto.
1412         * platform/graphics/MediaPlayerEnums.h: Ditto.
1413         * platform/graphics/gstreamer/GStreamerCommon.cpp: Move
1414         gstRegistryHasElementForMediaType to GStreamerRegistryScanner.
1415         * platform/graphics/gstreamer/GStreamerCommon.h: Ditto.
1416         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Added.
1417         (WebCore::GStreamerRegistryScanner::singleton):
1418         (WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): Initialize
1419         supported mime-types and codecs from the GStreamer registry.
1420         (WebCore::GStreamerRegistryScanner::~GStreamerRegistryScanner): Free the element factories.
1421         (WebCore::GStreamerRegistryScanner::gstRegistryHasElementForMediaType):
1422         Check the input caps are supported, optionally using hardware
1423         device.
1424         (WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping):
1425         Moved from MediaPlayerPrivateGStreamer{,MSE}.
1426         (WebCore::GStreamerRegistryScanner::initialize): Ditto.
1427         (WebCore::GStreamerRegistryScanner::supportsCodec const): Ditto.
1428         (WebCore::GStreamerRegistryScanner::supportsAllCodecs const): Ditto.
1429         (WebCore::GStreamerRegistryScanner::isDecodingSupported const): Check
1430         the given configuration is supported. For now hardware support is
1431         checked for video configurations only as it is quite uncommon
1432         anyway to have hardware-enabled audio decoders.
1433         * platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added.
1434         (WebCore::GStreamerRegistryScanner::mimeTypeSet):
1435         (WebCore::GStreamerRegistryScanner::supportsContainerType const):
1436         (WebCore::GStreamerRegistryScanner::RegistryLookupResult::operator bool const):
1437         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp: Added.
1438         (WebCore::createMediaPlayerDecodingConfigurationGStreamer):
1439         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h: Added.
1440         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1441         Rely on new GStreamerRegistryScanner and add some debugging macros.
1442         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
1443         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
1444         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Ditto. Also
1445         plug qtdemux for AAC containers, this is an explicit consequence
1446         of finer-grained codecs probing.
1447         (WebCore::AppendPipeline::AppendPipeline):
1448         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1449         * platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.cpp: Added.
1450         (WebCore::GStreamerRegistryScannerMSE::singleton):
1451         (WebCore::GStreamerRegistryScannerMSE::GStreamerRegistryScannerMSE):
1452         * platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.h: Added.
1453         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1454         Rely on new GStreamerRegistryScanner and add some debugging macros.
1455         (WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
1456         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
1457         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1458         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
1459         (WebCore::factories): GStreamer support.
1460
1461 2019-02-14  Joseph Pecoraro  <pecoraro@apple.com>
1462
1463         Web Inspector: Occasional crash under WebCore::CSSStyleSheet::item called from Inspector
1464         https://bugs.webkit.org/show_bug.cgi?id=194671
1465         <rdar://problem/47628191>
1466
1467         Reviewed by Devin Rousso.
1468
1469         * css/CSSStyleSheet.cpp:
1470         (WebCore::CSSStyleSheet::item):
1471         A crash may happen if the m_childRuleCSSOMWrappers Vector gets out of
1472         sync with the m_contents list of rules. In particular if the wrappers
1473         vector is shorter than the rule list. We tried exercising code paths
1474         that modify these lists but were not able to reproduce the crash.
1475         To avoid a crash we can make this access safer and avoid the original
1476         overflow. At the same time we will keep and promote the assertion that
1477         would catch the lists getting out of sync in debug builds.
1478
1479 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
1480
1481         Unreviewed build fix for WinCairo Debug after r241559.
1482
1483         * platform/network/curl/CurlContext.cpp:
1484         (WebCore::CurlContext::CurlContext):
1485
1486 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
1487
1488         [WTF] Add environment variable helpers
1489         https://bugs.webkit.org/show_bug.cgi?id=192405
1490
1491         Reviewed by Michael Catanzaro.
1492
1493         * platform/NotImplemented.h:
1494         * platform/cocoa/SystemVersion.mm:
1495         (WebCore::createSystemMarketingVersion):
1496         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1497         (WebCore::initializeGStreamer):
1498         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1499         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1500         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
1501         (Nicosia::PaintingEngine::create):
1502         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
1503         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
1504         * platform/graphics/x11/PlatformDisplayX11.cpp:
1505         (WebCore::PlatformDisplayX11::create):
1506         * platform/gtk/RenderThemeWidget.cpp:
1507         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
1508         * platform/gtk/ScrollbarThemeGtk.cpp:
1509         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
1510         * platform/network/curl/CurlContext.cpp:
1511         (WebCore::CurlContext::CurlContext):
1512         (WebCore::EnvironmentVariableReader::read): Deleted.
1513         (WebCore::EnvironmentVariableReader::defined): Deleted.
1514         (WebCore::EnvironmentVariableReader::readAs): Deleted.
1515         (WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
1516         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
1517         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
1518         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1519         (WebCore::defaultCookieJarPath):
1520         * platform/network/playstation/CurlSSLHandlePlayStation.cpp:
1521         (WebCore::getCACertPathEnv):
1522         * platform/network/win/CurlSSLHandleWin.cpp:
1523         (WebCore::getCACertPathEnv):
1524         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1525         (WebCore::topLevelPath):
1526         (WebCore::webkitBuildDirectory):
1527         * platform/unix/LoggingUnix.cpp:
1528         (WebCore::logLevelString):
1529         * platform/win/LoggingWin.cpp:
1530         (WebCore::logLevelString):
1531         Utilize WTF::Environment where possible.
1532
1533 2019-02-14  Chris Dumez  <cdumez@apple.com>
1534
1535         [PSON] Introduce a WebContent Process cache
1536         https://bugs.webkit.org/show_bug.cgi?id=194594
1537         <rdar://problem/46793397>
1538
1539         Reviewed by Geoff Garen.
1540
1541         Update localizable strings.
1542
1543         * en.lproj/Localizable.strings:
1544
1545 2019-02-14  Commit Queue  <commit-queue@webkit.org>
1546
1547         Unreviewed, rolling out r241486.
1548         https://bugs.webkit.org/show_bug.cgi?id=194655
1549
1550         causing API failures in builds (Requested by ShawnRoberts on
1551         #webkit).
1552
1553         Reverted changeset:
1554
1555         "[Cocoa] Media elements will restart network buffering just
1556         before suspending"
1557         https://bugs.webkit.org/show_bug.cgi?id=193691
1558         https://trac.webkit.org/changeset/241486
1559
1560 2019-02-13  Brian Burg  <bburg@apple.com>
1561
1562         Web Inspector: don't include accessibility role in DOM.Node object payloads
1563         https://bugs.webkit.org/show_bug.cgi?id=194623
1564         <rdar://problem/36384037>
1565
1566         Reviewed by Devin Rousso.
1567
1568         Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
1569         Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
1570         first place due to a DOM node tree update (i.e., NodeInserted).
1571
1572         It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
1573         the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
1574         necessary to collect this information in a problematic way when initially pushing the node, as
1575         it will be updated anyway.
1576
1577         No new tests, no change in behavior.
1578
1579         * inspector/agents/InspectorDOMAgent.cpp:
1580         (WebCore::InspectorDOMAgent::buildObjectForNode):
1581
1582 2019-02-14  Zalan Bujtas  <zalan@apple.com>
1583
1584         [LFC][BFC][MarginCollapse] Replaced boxes don't collapse through their margins
1585         https://bugs.webkit.org/show_bug.cgi?id=194622
1586
1587         Reviewed by Antti Koivisto.
1588
1589         Ensure that block replaced boxes don't collapse through their vertical margins. 
1590
1591         Test: fast/block/block-only/block-replaced-with-vertical-margins.html
1592
1593         * layout/blockformatting/BlockMarginCollapse.cpp:
1594         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
1595         * page/FrameViewLayoutContext.cpp:
1596         (WebCore::layoutUsingFormattingContext):
1597
1598 2019-02-14  Zalan Bujtas  <zalan@apple.com>
1599
1600         [LFC] Shrink-to-fit-width should be constrained by min/max width
1601         https://bugs.webkit.org/show_bug.cgi?id=194653
1602
1603         Reviewed by Antti Koivisto.
1604
1605         Use the fixed value of min-width/max-width to constrain the computed preferred width.
1606
1607         * layout/FormattingContext.h:
1608         * layout/FormattingContextGeometry.cpp:
1609         (WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth):
1610         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1611         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
1612         * layout/inlineformatting/InlineFormattingContext.cpp:
1613         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1614
1615 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
1616
1617         Crash in DOMTimer::fired
1618         https://bugs.webkit.org/show_bug.cgi?id=194638
1619
1620         Reviewed by Brent Fulgham.
1621
1622         This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934.
1623
1624         The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer
1625         is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired).
1626
1627         Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit
1628         from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map
1629         we would not leak these DOM timers.
1630
1631         We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the
1632         size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier.
1633         Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code,
1634         and is no longer the preferred approach when dealing with these classes of bugs in WebKit.
1635
1636         Test: fast/dom/timer-destruction-during-firing.html
1637
1638         * page/DOMTimer.cpp:
1639         (WebCore::NestedTimersMap::add):
1640         (WebCore::DOMTimer::install):
1641         (WebCore::DOMTimer::fired):
1642
1643 2019-02-13  Joseph Pecoraro  <pecoraro@apple.com>
1644
1645         Web Inspector: Crash when inspecting an element that constantly changes visibility
1646         https://bugs.webkit.org/show_bug.cgi?id=194632
1647         <rdar://problem/48060258>
1648
1649         Reviewed by Matt Baker and Devin Rousso.
1650
1651         * inspector/agents/InspectorDOMAgent.h:
1652         * inspector/agents/InspectorDOMAgent.cpp:
1653         (WebCore::InspectorDOMAgent::processAccessibilityChildren):
1654         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1655         Don't use rvalue-references as that was taking ownership and deleting
1656         the object we want to keep around. Instead simplify this to just use
1657         references so no ref counting changes happen.
1658
1659 2019-02-13  Chris Fleizach  <cfleizach@apple.com>
1660
1661         AX: Crash in handleMenuOpen
1662         https://bugs.webkit.org/show_bug.cgi?id=194627
1663
1664         Reviewed by Zalan Bujtas.
1665
1666         Tests run under libGuardMalloc will cause crashes.
1667
1668         This list of objects is a Node list, not an Element list, so we were
1669         not removing some nodes when they were being deallocated.
1670
1671         * accessibility/AXObjectCache.cpp:
1672         (WebCore::AXObjectCache::remove):
1673
1674 2019-02-13  Jer Noble  <jer.noble@apple.com>
1675
1676         [Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized.
1677         https://bugs.webkit.org/show_bug.cgi?id=194621
1678         <rdar://problem/48002560>
1679
1680         Reviewed by Eric Carlson.
1681
1682         When Safari is minimized, no rAF() requests are executed. Don't gate responding to presentation
1683         change events in the media-controller.js on rAF().
1684
1685         * Modules/modern-media-controls/media/media-controller.js:
1686         (MediaController.prototype._returnMediaLayerToInlineIfNeeded):
1687
1688 2019-02-13  John Wilander  <wilander@apple.com>
1689
1690         Ignore Ad Click Attribution where source and destination are same-site
1691         https://bugs.webkit.org/show_bug.cgi?id=194620
1692         <rdar://problem/47890018>
1693
1694         Reviewed by Jiewen Tan.
1695
1696         Updated the existing test.
1697
1698         We should not accept Ad Click Attribution requests where the site of the
1699         anchor tag and its addestination attribute are same-site. Such attributions
1700         don’t make sense (the site can track intra-site clicks through better means)
1701         and would just lead to increased memory use where are the pending
1702         attributions are stored.
1703
1704         For ports that don't have access to the Public Suffix List, this patch
1705         only checks that the hosts don't match, i.e. not just eTLD+1.
1706
1707         * html/HTMLAnchorElement.cpp:
1708         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1709             Now returns WTF::nullopt if the current document and the
1710             addestination are same site. Also fixed a console message
1711             typo.
1712
1713 2019-02-13  Eric Carlson  <eric.carlson@apple.com> and Youenn Fablet  <youenn@apple.com>
1714
1715         getUserMedia with an ideal deviceId constraint doesn't always select the correct device
1716         https://bugs.webkit.org/show_bug.cgi?id=193614
1717
1718         Reviewed by Eric Carlson.
1719
1720         Compute a fitness score based on constraints.
1721         For each constraint, a fitness score is computed from the distance.
1722         The smaller the distance, the higher the score.
1723         Fitness scores are then summed to give a device fitness score.
1724         Matching devices are then sorted according the fitness score.
1725
1726         For important constraints, deviceId and facingMode, add a more important weight.
1727         This ensures that should any of these ideal constraints are set, they will be respected.
1728
1729         Restrict our automatic setting of default constraints to not add a default ideal facingMode in case of existing deviceId constraint.
1730         Do not set a default ideal frameRate if width and height are already set.
1731
1732         Covered by updated test.
1733
1734         * platform/mediastream/MediaConstraints.cpp:
1735         (WebCore::FlattenedConstraint::set):
1736         (WebCore::MediaConstraints::setDefaultVideoConstraints):
1737         * platform/mediastream/RealtimeMediaSource.cpp:
1738         (WebCore::RealtimeMediaSource::fitnessDistance):
1739         (WebCore::RealtimeMediaSource::selectSettings):
1740         (WebCore::RealtimeMediaSource::supportsConstraints):
1741         (WebCore::RealtimeMediaSource::applyConstraints):
1742         * platform/mediastream/RealtimeMediaSource.h:
1743         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1744         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
1745
1746 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
1747
1748         [iOS] Add a hack to work around buggy video control library
1749         https://bugs.webkit.org/show_bug.cgi?id=194615
1750         <rdar://problem/46146946>
1751
1752         Reviewed by Jer Noble.
1753
1754         Test: media/ios/video-volume-ios-quirk.html
1755
1756         * html/HTMLMediaElement.cpp:
1757         (WebCore::HTMLMediaElement::setVolume): Change m_volume for one turn of the runloop.
1758         (WebCore::HTMLMediaElement::cancelPendingTasks): Clear the task queue used to restore m_volume.
1759         (WebCore::HTMLMediaElement::closeTaskQueues): Close it.
1760         * html/HTMLMediaElement.h:
1761
1762 2019-02-13  Jer Noble  <jer.noble@apple.com>
1763
1764         [Cocoa] Media elements will restart network buffering just before suspending
1765         https://bugs.webkit.org/show_bug.cgi?id=193691
1766
1767         Reviewed by Eric Carlson.
1768
1769         API Test: WebKit.ProcessSuspendMediaBuffering
1770
1771         Allow the Page to suspend all media buffering in its child Documents.
1772
1773         * dom/Document.cpp:
1774         (WebCore::Document::suspendAllMediaBuffering):
1775         (WebCore::Document::resumeAllMediaBuffering):
1776         * dom/Document.h:
1777         * html/MediaElementSession.cpp:
1778         (WebCore::MediaElementSession::dataBufferingPermitted const):
1779         (WebCore::MediaElementSession::suspendBuffering):
1780         (WebCore::MediaElementSession::resumeBuffering):
1781         (WebCore::MediaElementSession::bufferingSuspended const):
1782         * html/MediaElementSession.h:
1783         * page/Page.cpp:
1784         (WebCore::Page::suspendAllMediaBuffering):
1785         (WebCore::Page::resumeAllMediaBuffering):
1786         * page/Page.h:
1787         (WebCore::Page::mediaPlaybackIsSuspended const):
1788         (WebCore::Page::mediaBufferingIsSuspended const):
1789         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
1790         * platform/audio/PlatformMediaSession.h:
1791         (WebCore::PlatformMediaSession::suspendBuffering):
1792         (WebCore::PlatformMediaSession::resumeBuffering):
1793         * platform/audio/PlatformMediaSessionManager.cpp:
1794         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
1795         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
1796         * platform/audio/PlatformMediaSessionManager.h:
1797
1798 2019-02-13  Jer Noble  <jer.noble@apple.com>
1799
1800         Entering fullscreen inside a shadow root will not set fullscreen pseudoclasses outside of root
1801         https://bugs.webkit.org/show_bug.cgi?id=194516
1802         <rdar://problem/44678353>
1803
1804         Reviewed by Antoine Quint.
1805
1806         Test: fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html
1807
1808         When walking up the element ancestor chain, use parentElementInComposedTree() to
1809         walk past the shadow root boundary.
1810
1811         * dom/Element.cpp:
1812         (WebCore::parentCrossingFrameBoundaries):
1813
1814 2019-02-13  Chris Dumez  <cdumez@apple.com>
1815
1816         Unreviewed, update localizable strings.
1817
1818         * en.lproj/Localizable.strings:
1819
1820 2019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
1821
1822         Further restricting webarchive loads
1823         https://bugs.webkit.org/show_bug.cgi?id=194567
1824         <rdar://problem/47610130>
1825
1826         Reviewed by Youenn Fablet.
1827
1828         This patch futher restricts main frame webarchive loads to the followings:
1829         1) loaded by clients;
1830         2) loaded by drag;
1831         3) reloaded from any of the previous two.
1832
1833         It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document
1834         to FrameLoader such that the option is remembered during redirections.
1835
1836         Covered by API tests.
1837
1838         * dom/Document.h:
1839         (WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted.
1840         (WebCore::Document::alwaysAllowLocalWebarchive const): Deleted.
1841         * loader/DocumentLoader.cpp:
1842         (WebCore::DocumentLoader::disallowWebArchive const):
1843         * loader/DocumentLoader.h:
1844         (WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame):
1845         (WebCore::DocumentLoader::allowsWebArchiveForMainFrame):
1846         * loader/FrameLoadRequest.h:
1847         (WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput):
1848         (WebCore::FrameLoadRequest::isRequestFromClientOrUserInput):
1849         * loader/FrameLoader.cpp:
1850         (WebCore::FrameLoader::load):
1851         (WebCore::FrameLoader::reload):
1852         * loader/FrameLoader.h:
1853         (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive):
1854         (WebCore::FrameLoader::alwaysAllowLocalWebarchive const):
1855         * page/DragController.cpp:
1856         (WebCore::DragController::performDragOperation):
1857         * testing/Internals.cpp:
1858         (WebCore::Internals::setAlwaysAllowLocalWebarchive const):
1859         * testing/Internals.h:
1860         * testing/Internals.idl:
1861
1862 2019-02-13  Jer Noble  <jer.noble@apple.com>
1863
1864         Null-deref crash at SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged()
1865         https://bugs.webkit.org/show_bug.cgi?id=194613
1866         <rdar://problem/48023912>
1867
1868         Reviewed by Eric Carlson.
1869
1870         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1871         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1872
1873 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
1874
1875         Unreviewed, fix unused variable warnings after r241148/r241251
1876         https://bugs.webkit.org/show_bug.cgi?id=194348
1877         <rdar://problem/47566449>
1878
1879         * Modules/mediasource/SourceBuffer.cpp:
1880         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
1881         (WebCore::SourceBuffer::evictCodedFrames):
1882         (WebCore::SourceBuffer::provideMediaData):
1883
1884 2019-02-13  Sihui Liu  <sihui_liu@apple.com>
1885
1886         REGRESSION: [ Mac Debug WK2 ] Layout Test storage/indexeddb/key-type-infinity-private.html is a flaky crash
1887         https://bugs.webkit.org/show_bug.cgi?id=194413
1888         <rdar://problem/47897254>
1889
1890         Reviewed by Brady Eidson.
1891
1892         IDB clients expected transaction operations to be executed in order, but in 
1893         UniqueIDBDatabase::immediateCloseForUserDelete, callbacks in callback map were errored out randomly.
1894         This patch added a callback queue to UniqueIDBDatabase to make sure callbacks will be called in the same order
1895         as IDB Server receives the request.
1896
1897         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1898         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
1899         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1900         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
1901         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
1902         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
1903         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
1904         (WebCore::IDBServer::UniqueIDBDatabase::performCountCallback):
1905         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
1906         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1907
1908 2019-02-13  John Wilander  <wilander@apple.com>
1909
1910         Store Ad Click Attribution requests in the network process
1911         https://bugs.webkit.org/show_bug.cgi?id=194510
1912         <rdar://problem/47650118>
1913
1914         Reviewed by Alex Christensen and Daniel Bates.
1915
1916         Test: http/tests/adClickAttribution/store-ad-click-attribution.html
1917
1918         This patch adds support functions for validation and storage of
1919         WebCore::AdClickAttribution objects. It also adds WTF::HashTraits so that
1920         WebCore::AdClickAttribution::Source and WebCore::AdClickAttribution::Destination
1921         can be used in a HashMap.
1922
1923         * loader/AdClickAttribution.cpp:
1924         (WebCore::AdClickAttribution::toString const):
1925         * loader/AdClickAttribution.h:
1926         (WebCore::AdClickAttribution::Source::operator== const):
1927         (WebCore::AdClickAttribution::Source::deletedValue):
1928         (WebCore::AdClickAttribution::Source::constructDeletedValue):
1929         (WebCore::AdClickAttribution::Source::deleteValue):
1930         (WebCore::AdClickAttribution::Source::isDeletedValue const):
1931         (WebCore::AdClickAttribution::SourceHash::hash):
1932         (WebCore::AdClickAttribution::SourceHash::equal):
1933         (WebCore::AdClickAttribution::Destination::operator== const):
1934         (WebCore::AdClickAttribution::Destination::matches const):
1935             This convenience function allows matching of a WTF::URL object.
1936         (WebCore::AdClickAttribution::Destination::deletedValue):
1937         (WebCore::AdClickAttribution::Destination::constructDeletedValue):
1938         (WebCore::AdClickAttribution::Destination::deleteValue):
1939         (WebCore::AdClickAttribution::Destination::isDeletedValue const):
1940         (WebCore::AdClickAttribution::DestinationHash::hash):
1941         (WebCore::AdClickAttribution::DestinationHash::equal):
1942         (WebCore::AdClickAttribution::source const):
1943         (WebCore::AdClickAttribution::destination const):
1944             Getters added to support mapped storage based on source and destination.
1945         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::emptyValue):
1946         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::constructDeletedValue):
1947         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::isDeletedValue):
1948         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::emptyValue):
1949         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::constructDeletedValue):
1950         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::isDeletedValue):
1951         * loader/NavigationAction.h:
1952         (WebCore::NavigationAction::adClickAttribution const):
1953         (WebCore::NavigationAction::adClickAttribution): Deleted.
1954             Corrected the constness of this function.
1955
1956 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
1957
1958         Revert r240434
1959         https://bugs.webkit.org/show_bug.cgi?id=194600
1960         <rdar://problem/48044566>
1961
1962         Reviewed by Brent Fulgham.
1963
1964         * html/HTMLMediaElement.cpp:
1965         (WebCore::HTMLMediaElement::setVolume):
1966         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
1967         (WebCore::HTMLMediaElement::updateVolume):
1968         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1969         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
1970
1971 2019-02-13  Alex Christensen  <achristensen@webkit.org>
1972
1973         Stop using setDefersLoading from WebCore
1974         https://bugs.webkit.org/show_bug.cgi?id=194315
1975
1976         Reviewed by Jer Noble.
1977
1978         That is what CompletionHandlers are for.
1979
1980         * loader/MediaResourceLoader.cpp:
1981         (WebCore::MediaResource::responseReceived):
1982         (WebCore::MediaResource::setDefersLoading): Deleted.
1983         * loader/MediaResourceLoader.h:
1984         * platform/graphics/PlatformMediaResourceLoader.h:
1985         (WebCore::PlatformMediaResourceClient::responseReceived):
1986         (WebCore::PlatformMediaResource::stop):
1987         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
1988         * platform/network/cocoa/WebCoreNSURLSession.mm:
1989         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1990         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
1991         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
1992         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
1993
1994 2019-02-13  Jer Noble  <jer.noble@apple.com>
1995
1996         [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
1997         https://bugs.webkit.org/show_bug.cgi?id=194580
1998         <rdar://problem/42727739>
1999
2000         Reviewed by Eric Carlson.
2001
2002         * platform/cocoa/CoreVideoSoftLink.cpp:
2003         * platform/cocoa/CoreVideoSoftLink.h:
2004         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2005         (WebCore::CVPixelBufferGetBytePointerCallback):
2006         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2007
2008 2019-02-13  Antoine Quint  <graouts@apple.com>
2009
2010         Support simulated mouse events on iOS based on a PlatformTouchEvent
2011         https://bugs.webkit.org/show_bug.cgi?id=194501
2012         <rdar://problem/46910790>
2013
2014         Reviewed by Dean Jackson.
2015
2016         Add support for two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and
2017         whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. To facilitate
2018         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
2019         EventTarget::innerInvokeEventListeners() to see whether any page code has been evaluated as a result of a mousemove event being dispatched.
2020         Finally, we also track mouse events when invalidating touch regions provided the required internal runtime flag is on.
2021
2022         Test: fast/events/touch/ios/mouse-events-dispatch-with-touch.html
2023
2024         * SourcesCocoa.txt:
2025         * WebCore.xcodeproj/project.pbxproj:
2026         * dom/Event.cpp:
2027         * dom/Event.h:
2028         (WebCore::Event::hasEncounteredListener const):
2029         (WebCore::Event::setHasEncounteredListener):
2030         * dom/EventNames.h:
2031         (WebCore::EventNames::isTouchRelatedEventType const):
2032         (WebCore::EventNames::touchRelatedEventNames const):
2033         (WebCore::EventNames::extendedTouchRelatedEventNames const):
2034         (WebCore::EventNames::isTouchEventType const): Deleted.
2035         (WebCore::EventNames::touchAndPointerEventNames const): Deleted.
2036         * dom/EventTarget.cpp:
2037         (WebCore::EventTarget::innerInvokeEventListeners):
2038         * dom/MouseEvent.h:
2039         * dom/Node.cpp:
2040         (WebCore::Node::moveNodeToNewDocument):
2041         (WebCore::tryAddEventListener):
2042         (WebCore::tryRemoveEventListener):
2043         (WebCore::Node::defaultEventHandler):
2044         * dom/ios/MouseEventIOS.cpp: Added.
2045         (WebCore::mouseEventType):
2046         (WebCore::MouseEvent::create):
2047         * dom/ios/PointerEventIOS.cpp:
2048         (WebCore::pointerEventType):
2049         (WebCore::PointerEvent::create):
2050         (WebCore::eventType): Deleted.
2051         * page/DOMWindow.cpp:
2052         (WebCore::DOMWindow::addEventListener):
2053         (WebCore::DOMWindow::removeEventListener):
2054         * page/EventHandler.h:
2055         * page/RuntimeEnabledFeatures.h:
2056         (WebCore::RuntimeEnabledFeatures::mouseEventsSimulationEnabled const):
2057         (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
2058         (WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const):
2059         (WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled):
2060
2061 2019-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2062
2063         [FreeType] Unable to render some Hebrew characters
2064         https://bugs.webkit.org/show_bug.cgi?id=194498
2065
2066         Reviewed by Michael Catanzaro.
2067
2068         We are failing to find a font for some of the combining character sequences because normalization is failing due
2069         to overflow error. In case of overflow, normalize returns the required length for the normalized characters, so
2070         we should handle that case to resize the output buffer and try again.
2071
2072         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2073         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
2074
2075 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
2076
2077         Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
2078         https://bugs.webkit.org/show_bug.cgi?id=194582
2079
2080         Reviewed by Antti Koivisto.
2081
2082         Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
2083         from the non-generated identifier being sent to us as it was the case in this failure.
2084
2085         * loader/PolicyChecker.cpp:
2086         (WebCore::PolicyCheckIdentifier::isValidFor):
2087
2088 2019-02-13  Commit Queue  <commit-queue@webkit.org>
2089
2090         Unreviewed, rolling out r241273.
2091         https://bugs.webkit.org/show_bug.cgi?id=194579
2092
2093         This change is causing a flaky assertion failure crash in High
2094         Sierra Debug (Requested by ShawnRoberts on #webkit).
2095
2096         Reverted changeset:
2097
2098         "Stop using setDefersLoading from WebCore"
2099         https://bugs.webkit.org/show_bug.cgi?id=194315
2100         https://trac.webkit.org/changeset/241273
2101
2102 2019-02-12  Mark Lam  <mark.lam@apple.com>
2103
2104         Remove unnecessary null check in bindings.
2105         https://bugs.webkit.org/show_bug.cgi?id=194581
2106
2107         Reviewed by Yusuke Suzuki.
2108
2109         It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
2110         It will just return false.  Since we don't expect the root pointer to be null in
2111         the common case, having a null check here is also not optimal.  We'll remove this
2112         unneeded null check.
2113
2114         * bindings/scripts/CodeGeneratorJS.pm:
2115         (GenerateImplementation):
2116         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2117         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2118
2119 2019-02-12  Rob Buis  <rbuis@igalia.com>
2120
2121         Align with Fetch on data: URLs
2122         https://bugs.webkit.org/show_bug.cgi?id=182325
2123
2124         Reviewed by Alex Christensen.
2125
2126         The MIME type part of the data url should be serialized as
2127         specified in step 3 under "data" [1].
2128
2129         Test: web-platform-tests/fetch/data-urls/processing.any.js
2130
2131         [1] https://fetch.spec.whatwg.org/#concept-scheme-fetch 
2132
2133         * platform/network/DataURLDecoder.cpp:
2134         (WebCore::DataURLDecoder::parseMediaType):
2135
2136 2019-02-12  Alex Christensen  <achristensen@webkit.org>
2137
2138         Build fix after r241320
2139         https://bugs.webkit.org/show_bug.cgi?id=194271
2140
2141         * page/Frame.cpp:
2142         (WebCore::Frame::requestDOMPasteAccess):
2143
2144 2019-02-12  Justin Fan  <justin_fan@apple.com>
2145
2146         [WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
2147         https://bugs.webkit.org/show_bug.cgi?id=194552
2148
2149         Reviewed by Dean Jackson.
2150
2151         WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
2152         Consolidate the two versions of these classes in our implementation.
2153
2154         Affected layout tests updated with new names. No change in behavior.
2155
2156         * CMakeLists.txt:
2157         * DerivedSources-input.xcfilelist:
2158         * DerivedSources-output.xcfilelist:
2159         * DerivedSources.make:
2160         * Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
2161         * Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
2162         * Modules/webgpu/WebGPUBufferUsage.h: Removed.
2163         * Modules/webgpu/WebGPUDevice.cpp:
2164         (WebCore::WebGPUDevice::createBuffer const):
2165         * Modules/webgpu/WebGPUDevice.h:
2166         * Modules/webgpu/WebGPUDevice.idl:
2167         * Sources.txt:
2168         * WebCore.xcodeproj/project.pbxproj:
2169         * bindings/js/WebCoreBuiltinNames.h:
2170         * platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
2171         * platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.
2172
2173 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2174
2175         Unreviewed, try to fix the internal iOS build after r241321
2176
2177         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2178
2179 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2180
2181         Allow pages to trigger programmatic paste from script on iOS
2182         https://bugs.webkit.org/show_bug.cgi?id=194271
2183         <rdar://problem/47808810>
2184
2185         Reviewed by Tim Horton.
2186
2187         Tests: editing/pasteboard/ios/dom-paste-confirmation.html
2188                editing/pasteboard/ios/dom-paste-consecutive-confirmations.html
2189                editing/pasteboard/ios/dom-paste-rejection.html
2190                editing/pasteboard/ios/dom-paste-requires-user-gesture.html
2191
2192         * dom/UserGestureIndicator.cpp:
2193         (WebCore::UserGestureIndicator::~UserGestureIndicator):
2194
2195         Reset a gesture token's DOM paste access when exiting the scope of a user gesture. This prevents DOM paste
2196         access permissions from leaking into `setTimeout()` callbacks when we forward user gesture tokens.
2197
2198         * dom/UserGestureIndicator.h:
2199         (WebCore::UserGestureToken::resetDOMPasteAccess):
2200
2201 2019-02-12  Chris Fleizach  <cfleizach@apple.com>
2202
2203         AX: IsolatedTree: Implement more attributes
2204         https://bugs.webkit.org/show_bug.cgi?id=193911
2205         <rdar://problem/47599217>
2206
2207         Reviewed by Daniel Bates.
2208
2209         Make use of new HIServices SPI to use a secondary AX thread.
2210         Store root node/focused node status in IsolatedTree rather than on the element.
2211         Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description.
2212         Implement hit-testing using relative-frames.
2213         Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to.
2214
2215         * SourcesCocoa.txt:
2216         * WebCore.xcodeproj/project.pbxproj:
2217         * accessibility/AXObjectCache.cpp:
2218         (WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
2219         * accessibility/AXObjectCache.h:
2220         (WebCore::AXObjectCache::focusedUIElementForPage):
2221         * accessibility/AccessibilityAttachment.cpp:
2222         (WebCore::AccessibilityAttachment::accessibilityText const):
2223         (WebCore::AccessibilityAttachment::accessibilityText): Deleted.
2224         * accessibility/AccessibilityAttachment.h:
2225         * accessibility/AccessibilityImageMapLink.cpp:
2226         (WebCore::AccessibilityImageMapLink::accessibilityText const):
2227         (WebCore::AccessibilityImageMapLink::accessibilityText): Deleted.
2228         * accessibility/AccessibilityImageMapLink.h:
2229         * accessibility/AccessibilityMediaControls.cpp:
2230         (WebCore::AccessibilityMediaControl::accessibilityText const):
2231         (WebCore::AccessibilityMediaControl::accessibilityText): Deleted.
2232         * accessibility/AccessibilityMediaControls.h:
2233         * accessibility/AccessibilityNodeObject.cpp:
2234         (WebCore::AccessibilityNodeObject::accessibilityText const):
2235         (WebCore::AccessibilityNodeObject::accessibilityText): Deleted.
2236         * accessibility/AccessibilityNodeObject.h:
2237         * accessibility/AccessibilityObject.cpp:
2238         (WebCore::AccessibilityObject::convertFrameToSpace const):
2239         (WebCore::AccessibilityObject::relativeFrame const):
2240         (WebCore::AccessibilityObject::elementAccessibilityHitTest const):
2241         (WebCore::AccessibilityObject::focusedUIElement const):
2242         * accessibility/AccessibilityObject.h:
2243         (WebCore::AccessibilityObject::accessibilityText const):
2244         (WebCore::AccessibilityObject::isLink const): Deleted.
2245         (WebCore::AccessibilityObject::isImage const): Deleted.
2246         (WebCore::AccessibilityObject::isAttachment const): Deleted.
2247         (WebCore::AccessibilityObject::isFileUploadButton const): Deleted.
2248         (WebCore::AccessibilityObject::isImageMapLink const): Deleted.
2249         (WebCore::AccessibilityObject::isMediaControlLabel const): Deleted.
2250         (WebCore::AccessibilityObject::isTree const): Deleted.
2251         (WebCore::AccessibilityObject::isTreeItem const): Deleted.
2252         (WebCore::AccessibilityObject::isScrollbar const): Deleted.
2253         (WebCore::AccessibilityObject::accessibilityHitTest const): Deleted.
2254         (WebCore::AccessibilityObject::accessibilityText): Deleted.
2255         (WebCore::AccessibilityObject::roleValue const): Deleted.
2256         (WebCore::AccessibilityObject::wrapper const): Deleted.
2257         * accessibility/AccessibilityObjectInterface.h: Replaced.
2258         * accessibility/AccessibilityRenderObject.cpp:
2259         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
2260         (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const):
2261         (WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const):
2262         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
2263         (WebCore::AccessibilityRenderObject::selectedChildren):
2264         * accessibility/AccessibilityRenderObject.h:
2265         * accessibility/AccessibilitySVGElement.cpp:
2266         (WebCore::AccessibilitySVGElement::accessibilityText const):
2267         (WebCore::AccessibilitySVGElement::accessibilityText): Deleted.
2268         * accessibility/AccessibilitySVGElement.h:
2269         * accessibility/AccessibilityScrollView.cpp:
2270         (WebCore::AccessibilityScrollView::accessibilityHitTest const):
2271         * accessibility/AccessibilityScrollView.h:
2272         * accessibility/ios/AccessibilityObjectIOS.mm:
2273         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
2274         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2275         (-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted.
2276         * accessibility/isolatedtree: Replaced.
2277         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
2278         (WebCore::AXIsolatedTree::treePageCache):
2279         (WebCore::AXIsolatedTree::AXIsolatedTree):
2280         (WebCore::AXIsolatedTree::nodeInTreeForID):
2281         (WebCore::AXIsolatedTree::nodeForID const):
2282         (WebCore::AXIsolatedTree::focusedUIElement):
2283         (WebCore::AXIsolatedTree::setRootNodeID):
2284         (WebCore::AXIsolatedTree::setFocusedNodeID):
2285         (WebCore::AXIsolatedTree::setInitialRequestInProgress):
2286         (WebCore::AXIsolatedTree::applyPendingChanges):
2287         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
2288         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
2289         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
2290         (WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode):
2291         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
2292         (WebCore::AXIsolatedTreeNode::setProperty):
2293         (WebCore::AXIsolatedTreeNode::setParent):
2294         (WebCore::AXIsolatedTreeNode::setTreeIdentifier):
2295         (WebCore::AXIsolatedTreeNode::focusedUIElement const):
2296         (WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const):
2297         (WebCore::AXIsolatedTreeNode::accessibilityHitTest const):
2298         (WebCore::AXIsolatedTreeNode::tree const):
2299         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
2300         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
2301         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
2302         * accessibility/mac/AXObjectCacheMac.mm:
2303         (WebCore::AXObjectCache::associateIsolatedTreeNode):
2304         * accessibility/mac/AccessibilityObjectBase.mm: Added.
2305         (WebCore::AccessibilityObject::speechHintAttributeValue const):
2306         (WebCore::AccessibilityObject::descriptionAttributeValue const):
2307         (WebCore::AccessibilityObject::titleAttributeValue const):
2308         (WebCore::AccessibilityObject::helpTextAttributeValue const):
2309         * accessibility/mac/AccessibilityObjectMac.mm:
2310         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
2311         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2312         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2313         (addChildToArray):
2314         (convertToNSArray):
2315         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
2316         (-[WebAccessibilityObjectWrapperBase detach]):
2317         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
2318         (-[WebAccessibilityObjectWrapperBase accessibilityObject]):
2319         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
2320         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
2321         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
2322         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
2323         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
2324         (convertPathToScreenSpaceFunction):
2325         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
2326         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
2327         (-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted.
2328         (-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted.
2329         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2330         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
2331         (-[WebAccessibilityObjectWrapper childrenVectorSize]):
2332         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
2333         (-[WebAccessibilityObjectWrapper position]):
2334         (-[WebAccessibilityObjectWrapper subrole]):
2335         (-[WebAccessibilityObjectWrapper roleDescription]):
2336         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2337         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
2338         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
2339         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
2340         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
2341         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
2342
2343 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2344
2345         Allow pages to trigger programmatic paste from script on iOS
2346         https://bugs.webkit.org/show_bug.cgi?id=194271
2347         <rdar://problem/47808810>
2348
2349         Reviewed by Ryosuke Niwa.
2350
2351         Add support for allowing script to trigger programmatic paste commands. Currently on macOS and iOS, the ability
2352         to trigger programmatic paste (i.e. `document.execCommand('Paste');`) is disabled by default, such that
2353         execCommand is simply a no-op that returns false. This policy is a privacy measure (common among other major
2354         browsers) that prevents untrusted web content from sniffing content from the system pasteboard (even on user
2355         interaction, since unintended user interaction occasionally happens as well!).
2356
2357         In order to make it possible for web pages to programmatically paste without opening the door to privacy and
2358         security issues, we make paste commands triggered from bindings present platform UI on iOS, in the form of a
2359         callout bar with the single option to paste. This UI is dismissed upon any user interaction; furthermore, any
2360         user interaction short of explicitly triggering the "Paste" action subsequently prevents the page from executing
2361         the paste (and causes execCommand to return false). However, if the paste action is chosen by the user, we
2362         instead follow through with the programmatic paste command.
2363
2364         New tests to come in a followup patch.
2365
2366         * WebCore.xcodeproj/project.pbxproj:
2367         * dom/DOMPasteAccessPolicy.h: Added.
2368         * dom/UserGestureIndicator.h:
2369         (WebCore::UserGestureToken::domPasteAccessPolicy const):
2370         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
2371
2372         Add helpers on UserGestureToken to update and query the current DOM paste access policy. The access policies are
2373         "NotRequestedYet" (i.e. pending a response from the user), "Granted" (the user has granted DOM paste access to
2374         the page), or "Denied" (the user has prevented the page from reading the contents of the clipboard). When DOM
2375         paste access is granted or rejected, make this decision sticky until the end of the current user gesture.
2376
2377         * editing/EditorCommand.cpp:
2378         (WebCore::executePaste):
2379         (WebCore::executePasteAndMatchStyle):
2380         (WebCore::executePasteAsPlainText):
2381         (WebCore::executePasteAsQuotation):
2382
2383         When executing a paste command where the source is DOM bindings, request DOM paste if needed before proceeding
2384         with the paste.
2385
2386         (WebCore::supportedPaste):
2387         * loader/EmptyClients.cpp:
2388         * page/EditorClient.h:
2389         * page/Frame.cpp:
2390         (WebCore::Frame::requestDOMPasteAccess):
2391
2392         Add a helper method that requests access to the clipboard on behalf of script when pasting.
2393
2394         * page/Frame.h:
2395         * page/Settings.yaml:
2396
2397         Introduce a new WebCore setting, used to gate DOM paste access requests.
2398
2399 2019-02-12  Alex Christensen  <achristensen@webkit.org>
2400
2401         Remove setDefersLoading infrastructure from WebKit2
2402         https://bugs.webkit.org/show_bug.cgi?id=194506
2403
2404         Reviewed by Brady Eidson.
2405
2406         setDefersLoading is inherently racy from WebCore to the NetworkProcess,
2407         it adds unwanted complexity to the initialization and use of network objects,
2408         and it has led to many unrecoverable hang bugs over the years.
2409         We needed to force it into WebKit2 to transition some existing clients who relied on it,
2410         but we have recently finished transitioning those clients to other solutions, mostly
2411         completion handlers.
2412
2413         * inspector/PageScriptDebugServer.cpp:
2414         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
2415
2416 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2417
2418         Unreviewed, fix build warnings after content extensions enablement
2419         https://bugs.webkit.org/show_bug.cgi?id=193622
2420         <rdar://problem/47982850>
2421
2422         * contentextensions/DFABytecode.h:
2423         (WebCore::ContentExtensions::instructionSizeWithArguments):
2424         * contentextensions/DFABytecodeCompiler.h:
2425         * contentextensions/URLFilterParser.cpp:
2426         (WebCore::ContentExtensions::URLFilterParser::statusString):
2427
2428 2019-02-12  Justin Fan  <justin_fan@apple.com>
2429
2430         [Web GPU] DepthStencilAttachment implementation
2431         https://bugs.webkit.org/show_bug.cgi?id=194458
2432         <rdar://problem/47932446>
2433
2434         Reviewed by Dean Jackson.
2435
2436         Implement ability to provide a depth attachment to the render pass encoder. Also implement
2437         GPULoad/StoreOp and update color attachments' implementation for full functionality.
2438
2439         Test: webgpu/depth-enabled-triangle-strip.html
2440
2441         Update project files for new symbols:
2442         * CMakeLists.txt:
2443         * DerivedSources-input.xcfilelist:
2444         * DerivedSources-output.xcfilelist:
2445         * DerivedSources.make:
2446         * Sources.txt:
2447         * WebCore.xcodeproj/project.pbxproj:
2448
2449         * Modules/webgpu/GPUColor.idl: Renamed from WebGPUColor.idl
2450         * Modules/webgpu/GPULoadOp.idl: Added. Interface for attachment operation enum.
2451         * Modules/webgpu/GPUStoreOp.idl: Ditto.
2452         * Modules/webpug/WebGPUColor.h: Removed.
2453         * Modules/webgpu/WebGPUCommandBuffer.cpp: Refactored descriptor validation logic out of this file.
2454         (WebCore::WebGPUCommandBuffer::beginRenderPass):
2455         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Added. Now owns code for validating descriptors.
2456         (WebCore::WebGPURenderPassDescriptor::validateAndConvertToGPUVersion const):
2457         * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h/idl: Removed. Code moved into WebGPURenderPassDescriptor.
2458         * Modules/webgpu/WebGPURenderPassDescriptor.h: Move sub-descriptor definitions into this file.
2459         * Modules/webgpu/WebGPURenderPassDescriptor.idl: Ditto.
2460         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Make depthStencilState optional to match API update.
2461         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
2462         * Modules/webgpu/WebGPUTextureView.h:
2463         * platform/graphics/gpu/GPULoadOp.h: Added.
2464         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Removed (moved into GPURenderPassDescriptor).
2465         * platform/graphics/gpu/GPURenderPassDescriptor.h: Mirror WebGPU* changes.
2466         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Make depthStencilState optional.
2467         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
2468         * platform/graphics/gpu/GPUStoreOp.h: Added.
2469         * platform/graphics/gpu/GPUTexture.h:
2470         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2471         (WebCore::loadActionForGPULoadOp): Added.
2472         (WebCore::storeActionForGPUStoreOp): Added.
2473         (WebCore::populateMtlColorAttachmentsArray): Added. Create all expected color attachments, rather than just the first.
2474         (WebCore::populateMtlDepthStencilAttachment): Added.
2475         (WebCore::GPURenderPassEncoder::create):
2476         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Make depthStencilState optional.
2477         (WebCore::GPURenderPipeline::create):
2478
2479 2019-02-12  David Kilzer  <ddkilzer@apple.com>
2480
2481         REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
2482         <https://webkit.org/b/194529>
2483         <rdar://problem/47924449>
2484
2485         Reviewed by Eric Carlson.
2486
2487         * SourcesCocoa.txt:
2488         - Do not include DataDetectorsCoreSoftLink.mm in unified
2489           sources.
2490         * WebCore.xcodeproj/project.pbxproj:
2491         - Add DataDetectorsCoreSoftLink.mm to the WebCore target now
2492           that it isn't part of the unifed sources.
2493         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
2494         - Switch from using SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL() to
2495           SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE() when linking
2496           DataDetectorsCore.framework. None of the other macros assume
2497           this framework is optional, and it was likely made optional
2498           originally because the framework was new to iOS and thus
2499           didn't exist on older versions.
2500         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2501         - Change use of SOFT_LINK_CLASS_FOR_SOURCE() macros to
2502           SOFT_LINK_CLASS() since the latter can only be used with
2503           SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation).  This broke after
2504           the fix for <wtf/SoftLinking.h> was applied.
2505
2506 2019-02-12  Youenn Fablet  <youenn@apple.com>
2507
2508         Make use of is<SubresourceLoader>
2509         https://bugs.webkit.org/show_bug.cgi?id=194541
2510
2511         Reviewed by Alex Christensen.
2512
2513         No change of behavior.
2514
2515         * inspector/agents/InspectorNetworkAgent.cpp:
2516         (WebCore::InspectorNetworkAgent::didReceiveResponse):
2517         * loader/SubresourceLoader.h:
2518         (isType):
2519
2520 2019-02-12  Mark Lam  <mark.lam@apple.com>
2521
2522         Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions.
2523         https://bugs.webkit.org/show_bug.cgi?id=194530
2524         <rdar://problem/47973274>
2525
2526         Reviewed by Chris Dumez.
2527
2528         This is needed to fix a null pointer dereference that arises from the following scenario:
2529         1. a Document detaches from its StyleSheetList.
2530         2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet
2531            to be scanned and collected by the GC.
2532         3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and
2533            discovers a null owner pointer.
2534
2535         This patch fixes this issue by applying the following null checks:
2536
2537         1. Add a null check in JSNodeCustom.h's root().
2538
2539            root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm.
2540            isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result
2541            to root().  However, depending on which class the ownerNode() method belongs to,
2542            it can either return a pointer or a reference.  The null check only makes sense
2543            in the pointer case.
2544
2545            To accommodate the 2 forms, root() itself is has an overload that takes a
2546            reference instead of a pointer.
2547
2548            Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode()
2549            returns, it can't discern when the result is a pointer and apply the null check.
2550            Instead, we just add the null check to the version of root() that takes a
2551            pointer.  If the node pointer is null, we'll return a null opaque root.
2552
2553         2. Fix CodeGeneratorJS.pm to null check the opaque root before using it.
2554
2555         * bindings/js/JSNodeCustom.h:
2556         (WebCore::root):
2557         * bindings/scripts/CodeGeneratorJS.pm:
2558         (GenerateImplementation):
2559         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2560         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2561
2562 2019-02-12  Andy Estes  <aestes@apple.com>
2563
2564         [iOSMac] Enable Parental Controls Content Filtering
2565         https://bugs.webkit.org/show_bug.cgi?id=194521
2566         <rdar://39732376>
2567
2568         Reviewed by Tim Horton.
2569
2570         * Configurations/FeatureDefines.xcconfig:
2571         * platform/ContentFilterUnblockHandler.h:
2572         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2573         * platform/cocoa/ParentalControlsContentFilter.mm:
2574
2575 2019-02-11  Jer Noble  <jer.noble@apple.com>
2576
2577         Unreviewed build fix; add a HAVE_CELESTIAL guard around Celestial framework usage.
2578
2579         * platform/audio/ios/MediaSessionManagerIOS.h:
2580         * platform/audio/ios/MediaSessionManagerIOS.mm:
2581         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
2582
2583 2019-02-12  Antti Koivisto  <antti@apple.com>
2584
2585         Crash in WebCore::ScrollingTree::updateTreeFromStateNode
2586         https://bugs.webkit.org/show_bug.cgi?id=194538
2587         <rdar://problem/47841926>
2588
2589         Reviewed by Zalan Bujtas.
2590
2591         * page/scrolling/ScrollingTree.cpp:
2592         (WebCore::ScrollingTree::updateTreeFromStateNode):
2593
2594         Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent.
2595
2596 2019-02-12  Zalan Bujtas  <zalan@apple.com>
2597
2598         [LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
2599         https://bugs.webkit.org/show_bug.cgi?id=194540
2600
2601         Reviewed by Antti Koivisto.
2602
2603         Use FormattingContext::computeBorderAndPadding instead.
2604
2605         * layout/FormattingContext.cpp:
2606         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2607         * layout/FormattingContext.h:
2608         * layout/inlineformatting/InlineFormattingContext.cpp:
2609         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
2610         * layout/inlineformatting/InlineFormattingContext.h:
2611
2612 2019-02-12  Zalan Bujtas  <zalan@apple.com>
2613
2614         [LFC][IFC] Add intrinsic width support for float boxes.
2615         https://bugs.webkit.org/show_bug.cgi?id=194528
2616
2617         Reviewed by Antti Koivisto.
2618
2619         This patch implements a very simple float box support for intrinsic width.
2620
2621         * layout/inlineformatting/InlineFormattingContext.cpp:
2622         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2623         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
2624         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
2625         (WebCore::Layout::InlineFormattingContext::computeMargin const):
2626         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const): Deleted.
2627         * layout/inlineformatting/InlineFormattingContext.h:
2628
2629 2019-02-12  Rob Buis  <rbuis@igalia.com>
2630
2631         Implement serializing in MIME type parser
2632         https://bugs.webkit.org/show_bug.cgi?id=193909
2633
2634         Reviewed by Darin Adler.
2635
2636         Implement serializing in MIME type parser [1], to preserve the parameter
2637         order the Vector m_parameterNames is introduced, since HashMaps do not
2638         guarantee any order.
2639
2640         Test: ParsedContentType.Serialize
2641
2642         [1] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
2643
2644         * platform/network/ParsedContentType.cpp:
2645         (WebCore::skipSpaces):
2646         (WebCore::parseQuotedString):
2647         (WebCore::ParsedContentType::parseContentType):
2648         (WebCore::ParsedContentType::parameterValueForName const):
2649         (WebCore::ParsedContentType::parameterCount const):
2650         (WebCore::ParsedContentType::setContentType):
2651         (WebCore::ParsedContentType::setContentTypeParameter):
2652         (WebCore::ParsedContentType::serialize const):
2653         * platform/network/ParsedContentType.h:
2654
2655 2019-02-08  Chris Fleizach  <cfleizach@apple.com>
2656
2657         AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc
2658         https://bugs.webkit.org/show_bug.cgi?id=182280
2659         <rdar://problem/37018386>
2660
2661         Reviewed by Alan Bujtas.
2662
2663         Remove the possibility that changing children calls back into updating layout by
2664         handling children changes in a deferred manner.
2665
2666         This follows the same architecture as many other deferred changes, but also requires us to check deferred changes
2667         in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children.
2668
2669         A few tests had to be modified to no longer change the tree and then check the children immediately. 
2670
2671         * accessibility/AXObjectCache.cpp:
2672         (WebCore::AXObjectCache::remove):
2673         (WebCore::AXObjectCache::childrenChanged):
2674         (WebCore::AXObjectCache::prepareForDocumentDestruction):
2675         (WebCore::AXObjectCache::performDeferredCacheUpdate):
2676         * accessibility/AXObjectCache.h:
2677         * accessibility/AccessibilityObject.cpp:
2678         (WebCore::AccessibilityObject::updateBackingStore):
2679         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2680         (convertToNSArray):
2681         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
2682
2683 2019-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
2684
2685         [Cocoa] Ask platform for generic font family mappings
2686         https://bugs.webkit.org/show_bug.cgi?id=187723
2687         <rdar://problem/41892438>
2688
2689         Reviewed by Brent Fulgham.
2690
2691         WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
2692         When trying to style a character with a generic font family, we first look to see if
2693         we have a mapping for the particular script the character is rendered with, and if we
2694         don't find a match, we then check USCRIPT_COMMON.
2695
2696         In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
2697         the only scripts which won't use the API families) is in
2698         SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
2699         for the CJK scripts.
2700
2701         The mappings inside SettingsBase are incorrect and conflict with our policy regarding
2702         user-installed fonts. Instead, we should be consulting with the platform for some of
2703         these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
2704         API still has to work to set the mappings for untagged content. Therefore, we use the
2705         system mappings for language-tagged content, and the API mappings for non-language-tagged
2706         content. This is a good balance that makes sure we always have a good mapping for every
2707         language, but API clients can still set the mappings, too.
2708
2709         Test: fast/text/ja-sans-serif.html
2710
2711         * css/CSSComputedStyleDeclaration.cpp:
2712         * css/CSSFontSelector.cpp:
2713         (WebCore::resolveGenericFamily):
2714         * css/parser/CSSPropertyParser.cpp:
2715         (WebCore::consumeFontFamily):
2716         * page/cocoa/SettingsBaseCocoa.mm:
2717         (WebCore::SettingsBase::initializeDefaultFontFamilies):
2718         (WebCore::osakaMonoIsInstalled): Deleted.
2719         * platform/graphics/FontDescription.cpp:
2720         (WebCore::FontDescription::platformResolveGenericFamily):
2721         * platform/graphics/FontDescription.h:
2722         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2723         (WebCore::computeSpecializedChineseLocale):
2724         (WebCore::cachedSpecializedChineseLocale):
2725         (WebCore::languageChanged):
2726         (WebCore::FontDescription::platformResolveGenericFamily):
2727         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
2728         (WebCore::SystemFontDatabaseCoreText::clear):
2729         (WebCore::genericFamily):
2730         (WebCore::SystemFontDatabaseCoreText::serifFamily):
2731         (WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
2732         (WebCore::SystemFontDatabaseCoreText::cursiveFamily):
2733         (WebCore::SystemFontDatabaseCoreText::fantasyFamily):
2734         (WebCore::SystemFontDatabaseCoreText::monospaceFamily):
2735         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
2736
2737 2019-02-11  Adrian Perez de Castro  <aperez@igalia.com>
2738
2739         [GTK][WPE] Add content extensions support in WKTR and unskip layout tests
2740         https://bugs.webkit.org/show_bug.cgi?id=193622
2741
2742         Reviewed by Michael Catanzaro.
2743
2744         No new tests needed.
2745
2746         * SourcesCocoa.txt: Remove loader/ResourceLoadInfo.cpp, it's not Cocoa-specific anymore.
2747         * Sources.txt: Add loader/ResourceLoadInfo.cpp, all ports use it now.
2748
2749 2019-02-11  Daniel Bates  <dabates@apple.com>
2750
2751         [iOS] Mouse/Touch/Pointer events are missing modifier keys
2752         https://bugs.webkit.org/show_bug.cgi?id=191446
2753         <rdar://problem/45929460>
2754
2755         Reviewed by Tim Horton.
2756
2757         Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
2758         on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
2759         to be passed to WebKit.
2760
2761         Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
2762                fast/events/touch/ios/pointer-events-with-modifiers.html
2763                fast/events/touch/ios/touch-events-with-modifiers.html
2764
2765         * platform/ios/PlatformEventFactoryIOS.mm:
2766         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2767         * platform/ios/WebEvent.h:
2768         * platform/ios/WebEvent.mm:
2769         (-[WebEvent initWithMouseEventType:timeStamp:location:]):
2770         (-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
2771
2772 2019-02-11  Jer Noble  <jer.noble@apple.com>
2773
2774         [Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
2775         https://bugs.webkit.org/show_bug.cgi?id=194504
2776
2777         Reviewed by Eric Carlson.
2778
2779         This allows the MediaRemote framework to associate the WebContent process with its host application.
2780
2781         * Modules/mediastream/UserMediaRequest.cpp:
2782         (WebCore::UserMediaRequest::start):
2783         * platform/audio/PlatformMediaSessionManager.h:
2784         (WebCore::PlatformMediaSessionManager::prepareToSendUserMediaPermissionRequest):
2785         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
2786         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
2787         (MediaSessionManagerCocoa::prepareToSendUserMediaPermissionRequest):
2788         (MediaSessionManagerCocoa::providePresentingApplicationPIDIfNecessary):
2789         (MediaSessionManagerCocoa::updateNowPlayingInfo):
2790
2791 2019-02-11  Commit Queue  <commit-queue@webkit.org>
2792
2793         Unreviewed, rolling out r241272 and r241276.
2794         https://bugs.webkit.org/show_bug.cgi?id=194514
2795
2796         Broke the Apple Internal build and the fix requires human
2797         intervention :( (Requested by dydz on #webkit).
2798
2799         Reverted changesets:
2800
2801         "[iOS] Mouse/Touch/Pointer events are missing modifier keys"
2802         https://bugs.webkit.org/show_bug.cgi?id=191446
2803         https://trac.webkit.org/changeset/241272
2804
2805         "Fix internal iOS build after r241272"
2806         https://bugs.webkit.org/show_bug.cgi?id=191446
2807         https://trac.webkit.org/changeset/241276
2808
2809 2019-02-11  Alex Christensen  <achristensen@webkit.org>
2810
2811         Stop using setDefersLoading from WebCore
2812         https://bugs.webkit.org/show_bug.cgi?id=194315
2813
2814         Reviewed by Jer Noble.
2815
2816         That is what CompletionHandlers are for.
2817
2818         * loader/MediaResourceLoader.cpp:
2819         (WebCore::MediaResource::responseReceived):
2820         (WebCore::MediaResource::setDefersLoading): Deleted.
2821         * loader/MediaResourceLoader.h:
2822         * platform/graphics/PlatformMediaResourceLoader.h:
2823         (WebCore::PlatformMediaResourceClient::responseReceived):
2824         (WebCore::PlatformMediaResource::stop):
2825         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
2826         * platform/network/cocoa/WebCoreNSURLSession.mm:
2827         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
2828         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
2829         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
2830         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
2831
2832 2019-02-11  Daniel Bates  <dabates@apple.com>
2833
2834         [iOS] Mouse/Touch/Pointer events are missing modifier keys
2835         https://bugs.webkit.org/show_bug.cgi?id=191446
2836         <rdar://problem/45929460>
2837
2838         Reviewed by Tim Horton.
2839
2840         Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
2841         on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
2842         to be passed to WebKit.
2843
2844         Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
2845                fast/events/touch/ios/pointer-events-with-modifiers.html
2846                fast/events/touch/ios/touch-events-with-modifiers.html
2847
2848         * platform/ios/PlatformEventFactoryIOS.mm:
2849         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2850         * platform/ios/WebEvent.h:
2851         * platform/ios/WebEvent.mm:
2852         (-[WebEvent initWithMouseEventType:timeStamp:location:]):
2853         (-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
2854
2855 2019-02-11  Daniel Bates  <dabates@apple.com>
2856
2857         Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing
2858         https://bugs.webkit.org/show_bug.cgi?id=193591
2859
2860         Reviewed by Simon Fraser.
2861
2862         Untangle the Mac-specific concept of animated focus ring drawing from the concepts of using
2863         the fancy shrink-wrapped focus ring appearance and using the platform focus ring color when
2864         outline-style: auto.
2865
2866         No functionality changed. So, no new tests.
2867
2868         * platform/graphics/GraphicsContext.h:
2869         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
2870         (WebCore::drawFocusRing):
2871         (WebCore::drawFocusRingToContextAtTime):
2872         Change some macro guards.
2873
2874         * rendering/RenderElement.cpp:
2875         (WebCore::usePlatformFocusRingColorForOutlineStyleAuto): Added.
2876         (WebCore::useShrinkWrappedFocusRingForOutlineStyleAuto): Added.
2877         (WebCore::drawFocusRing): Added.
2878         (WebCore::RenderElement::paintFocusRing): Write in terms of drawFocusRing().
2879
2880 2019-02-11  Truitt Savell  <tsavell@apple.com>
2881
2882         Unreviewed, rolling out r241229.
2883
2884         Revision broke internal builds for watchOS.
2885
2886         Reverted changeset:
2887
2888         "[Cocoa] Ask platform for generic font family mappings"
2889         https://bugs.webkit.org/show_bug.cgi?id=187723
2890         https://trac.webkit.org/changeset/241229
2891
2892 2019-02-11  Youenn Fablet  <youenn@apple.com>
2893
2894         Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
2895         https://bugs.webkit.org/show_bug.cgi?id=194404
2896         <rdar://problem/47891915>
2897
2898         Reviewed by Geoffrey Garen.
2899
2900         Align with the spec, except for known problematic web sites.
2901         Covered by updated test.
2902
2903         * Modules/fetch/FetchRequest.cpp:
2904         (WebCore::needsSignalQuirk):
2905         (WebCore::processInvalidSignal):
2906         (WebCore::FetchRequest::initializeWith):
2907
2908 2019-02-11  Zalan Bujtas  <zalan@apple.com>
2909
2910         [LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues
2911         https://bugs.webkit.org/show_bug.cgi?id=194490
2912
2913         Reviewed by Antti Koivisto.
2914
2915         This is in preparation for adding floating preferred width computation support. It requires height computaiton
2916         which uses containing block width to resolve vertical margins.
2917
2918         * layout/FormattingContext.cpp:
2919         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2920         * layout/FormattingContext.h:
2921         * layout/FormattingContextGeometry.cpp:
2922         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2923         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2924         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2925         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2926         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2927         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
2928         * layout/FormattingContextQuirks.cpp:
2929         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
2930         * layout/LayoutUnits.h:
2931         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
2932         * layout/blockformatting/BlockFormattingContext.cpp:
2933         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2934         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2935         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2936         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2937         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2938         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2939         * layout/blockformatting/BlockMarginCollapse.cpp:
2940         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
2941         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
2942         * layout/inlineformatting/InlineFormattingContext.cpp:
2943         (WebCore::Layout::InlineFormattingContext::layout const):
2944         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2945         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2946         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2947
2948 2019-02-11  Zalan Bujtas  <zalan@apple.com>
2949
2950         [LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrinsic widths consistently.
2951         https://bugs.webkit.org/show_bug.cgi?id=194483
2952
2953         Reviewed by Antti Koivisto.
2954
2955         Rename intrinsicWidthConstraints to computeIntrinsicWidthConstraints (it does not return the width values anymore).
2956
2957         * layout/FormattingContext.h:
2958         * layout/FormattingContextGeometry.cpp:
2959         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2960         * layout/blockformatting/BlockFormattingContext.cpp:
2961         (WebCore::Layout::BlockFormattingContext::computeIntrinsicWidthConstraints const):
2962         (WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const): Deleted.
2963         * layout/blockformatting/BlockFormattingContext.h:
2964         * layout/inlineformatting/InlineFormattingContext.cpp:
2965         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2966         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
2967         (WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const): Deleted.
2968         * layout/inlineformatting/InlineFormattingContext.h:
2969
2970 2019-02-10  Zalan Bujtas  <zalan@apple.com>
2971
2972         [LFC] Fix spelling error.
2973         https://bugs.webkit.org/show_bug.cgi?id=194489
2974
2975         Reviewed by Simon Fraser.
2976
2977         instrinsic -> intrinsic
2978
2979         * layout/FormattingContext.h:
2980         * layout/FormattingContextGeometry.cpp:
2981         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2982         * layout/FormattingState.h:
2983         (WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
2984         (WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
2985         (WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
2986         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): Deleted.
2987         (WebCore::Layout::FormattingState::clearInstrinsicWidthConstraints): Deleted.
2988         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const): Deleted.
2989         * layout/blockformatting/BlockFormattingContext.cpp:
2990         (WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const):
2991         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): Deleted.
2992         * layout/blockformatting/BlockFormattingContext.h:
2993         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2994         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth):
2995         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2996         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth): Deleted.
2997         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): Deleted.
2998         * layout/inlineformatting/InlineFormattingContext.cpp:
2999         (WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const):
3000         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
3001         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): Deleted.
3002         * layout/inlineformatting/InlineFormattingContext.h:
3003
3004 2019-02-10  Darin Adler  <darin@apple.com>
3005
3006         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
3007         https://bugs.webkit.org/show_bug.cgi?id=194485
3008
3009         Reviewed by Daniel Bates.
3010
3011         * Modules/websockets/WebSocket.cpp:
3012         (WebCore::encodeProtocolString): Use appendUnsignedAsHexFixedSize instead of String::format.
3013
3014         * css/parser/CSSParserToken.cpp:
3015         (WebCore::CSSParserToken::serialize const): Fixed style of many return statements
3016         that called a function returning void; doesn't match WebKit's prevailing style.
3017         Also use break instead of return. Used appendLiteral instead of append in many
3018         cases, and append character instead of single-character literal in others.
3019         Use appendUnsignedAsHex instead of String::format.
3020
3021         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3022         (WebCore::generateHashedName): Use appendUnsignedAsHex instad of appendUnsigned64AsHex.
3023         Should come back here and use makeString once we make HexNumber.h work with that.
3024
3025         * platform/mac/WebCoreNSURLExtras.mm: Removed unnecessary include of HexNumber.h.
3026
3027         * rendering/RenderTreeAsText.cpp:
3028         (WebCore::quoteAndEscapeNonPrintables): Use appendLiteral instead of multiple calls
3029         to character append. Touched because it was next to a call to appendUnsignedAsHex.
3030
3031 2019-02-10  Pablo Saavedra  <psaavedra@igalia.com>
3032
3033         libWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
3034         https://bugs.webkit.org/show_bug.cgi?id=194484
3035
3036         Reviewed by Darin Adler.
3037
3038         * bindings/js/JSUndoItemCustom.cpp:
3039
3040 2019-02-10  Philippe Normand  <pnormand@igalia.com>
3041
3042         Unreviewed, GTK Debug build fix after r241148.
3043
3044         * Modules/mediasource/SourceBuffer.cpp:
3045         (WebCore::removeSamplesFromTrackBuffer):
3046         SourceBuffer::logClassName and friends are declared for
3047         !RELEASE_LOG_DISABLED builds so adapt calling sites accordingly.
3048
3049 2019-02-10  Zalan Bujtas  <zalan@apple.com>
3050
3051         [LFC][IFC] Add intrinsic width support for inline-block boxes
3052         https://bugs.webkit.org/show_bug.cgi?id=194479
3053
3054         Reviewed by Antti Koivisto.
3055
3056         Compute the intrinsic width for the inline-block (formatting context root) and set it as the content box width while
3057         laying out the content for the min/max width.
3058
3059         <div style="position: absolute">before<span id=inline-block style="display: inline-block">inline_block content<span>after</div>
3060
3061         The "inline-block" formatting root returns "inline_block" width for the minimum and "inline_block width" for
3062         the maximum width. These min/max values are used to figure out the intrinsic width for the parent <div>.
3063
3064         * layout/inlineformatting/InlineFormattingContext.cpp:
3065         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
3066         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
3067         (WebCore::Layout::InlineFormattingContext::computeMargin const):
3068         * layout/inlineformatting/InlineFormattingContext.h:
3069         * page/FrameViewLayoutContext.cpp:
3070         (WebCore::layoutUsingFormattingContext):
3071
3072 2019-02-10  Zalan Bujtas  <zalan@apple.com>
3073
3074         [LFC][IFC] Add intrinsic width support for replaced boxes
3075         https://bugs.webkit.org/show_bug.cgi?id=194478
3076
3077         Reviewed by Antti Koivisto.
3078
3079         * layout/inlineformatting/InlineFormattingContext.cpp:
3080         (WebCore::Layout::InlineFormattingContext::layout const):
3081         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
3082         (WebCore::Layout::InlineFormattingContext::computeMargin const):
3083         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
3084         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3085         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
3086         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const): Deleted.
3087         * layout/inlineformatting/InlineFormattingContext.h:
3088
3089 2019-02-10  Alicia Boya García  <aboya@igalia.com>
3090
3091         [MSE][GStreamer] Add missing return type to lambda
3092         https://bugs.webkit.org/show_bug.cgi?id=194414
3093
3094         Reviewed by Darin Adler.
3095
3096         Since g_signal_connect() is untyped, a compiler error was not
3097         generated when a lambda with a missing GstFlowReturn return type was
3098         provided for a signal that expects it.
3099
3100         This used to work before r240784 because a recent function call had
3101         set GST_FLOW_OK in the return value register and it happened to
3102         survive until the lambda function call ended. Starting on that commit
3103         such return value was removed and it stopped working on debug.
3104
3105         Of course, the actual problem is in the signature of the lambda
3106         function, and this patch fixes that.
3107
3108         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3109         (WebCore::AppendPipeline::AppendPipeline):
3110
3111 2019-02-09  Darin Adler  <darin@apple.com>
3112
3113         Eliminate unnecessary String temporaries by using StringConcatenateNumbers
3114         https://bugs.webkit.org/show_bug.cgi?id=194021
3115
3116         Reviewed by Geoffrey Garen.
3117
3118         For floating point numbers, String::number gives a fixed precision result,
3119         stripping trailing zeroes. When possible, I changed the code to instead use the
3120         equivalent of String::numberToStringECMAScript, which is what makeString does by
3121         default for floating point, gives the same results for many cases, and gives
3122         better results in many others. However, for floats, we do not yet have a good
3123         implementation, so instead I used FormattedNumber::fixedPrecision to match
3124         the old behavior.
3125
3126         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
3127         (WebCore::IDBTransactionInfo::loggingString const): Remove String::number and let
3128         makeString do the conversion without allocating/destroying a String.
3129         * Modules/websockets/ThreadableWebSocketChannel.cpp:
3130         (WebCore::ThreadableWebSocketChannel::create): Ditto.
3131         * Modules/websockets/WebSocket.cpp:
3132         (WebCore::WebSocket::connect): Ditto. Added a cast to "unsigned" to sidestep the
3133         ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
3134         and sometimes used for UTF-16 code units (UChar) and can be the same type.
3135
3136         * Modules/websockets/WebSocketChannel.cpp:
3137         (WebCore::WebSocketChannel::didFailSocketStream): Use ASCIILiteral when intializing
3138         a string instead of just a normal C literal. Switched to makeString so we could
3139         remove String::number and do the conversion without allocating/destroying a String.
3140         (WebCore::WebSocketChannel::didFail): Ditto.
3141         (WebCore::WebSocketChannel::processFrame): Ditto.
3142         * Modules/websockets/WebSocketFrame.cpp:
3143         (WebCore::WebSocketFrame::parseFrame): Ditto.
3144         * Modules/websockets/WebSocketHandshake.cpp:
3145         (WebCore::WebSocketHandshake::readServerHandshake): Ditto.
3146         * accessibility/AccessibilityRenderObject.cpp:
3147         (WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA const): Ditto.
3148         * bindings/js/JSDOMConvertNumbers.cpp:
3149         (WebCore::rangeErrorString): Ditto.
3150         * css/CSSAspectRatioValue.cpp:
3151         (WebCore::CSSAspectRatioValue::customCSSText const): Ditto. Used
3152         FormattedNumber::fixedPrecision since these are floats.
3153
3154         * css/DOMMatrixReadOnly.cpp:
3155         (WebCore::DOMMatrixReadOnly::toString const): Use
3156         StringBuilder::builder.appendECMAScriptNumber instead of
3157         String::numberToStringECMAScript so we can do it without allocating/destroying
3158         a String.
3159         * css/WebKitCSSMatrix.cpp:
3160         (WebCore::WebKitCSSMatrix::toString const): Ditto.
3161
3162         * dom/MessagePortIdentifier.h:
3163         (WebCore::MessagePortIdentifier::logString const): Remove String::number and let
3164         makeString do the conversion without allocating/destroying a String.
3165
3166         * editing/cocoa/DataDetection.mm:
3167         (WebCore::dataDetectorStringForPath): Remove unnecessary type casts on values
3168         passed to String::number and to StringBuilder::appendNumber. These could do
3169         harm if the values were out of range, and should not be necessary.
3170
3171         * history/BackForwardItemIdentifier.h:
3172         (WebCore::BackForwardItemIdentifier::logString const): Remove String::number
3173         and let makeString do the conversion without allocating/destroying a String.
3174         * html/FTPDirectoryDocument.cpp:
3175         (WebCore::processFileDateString): Ditto.
3176         * html/canvas/WebGLRenderingContextBase.cpp:
3177         (WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
3178         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Ditto.
3179         * inspector/agents/WebConsoleAgent.cpp:
3180         (WebCore::WebConsoleAgent::didReceiveResponse): Ditto.
3181         * loader/WorkerThreadableLoader.cpp:
3182         (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
3183         * loader/appcache/ApplicationCacheGroup.cpp:
3184         (WebCore::ApplicationCacheGroup::didFailLoadingManifest): Ditto.
3185         * page/PageSerializer.cpp:
3186         (WebCore::PageSerializer::urlForBlankFrame): Ditto.
3187         * page/PrintContext.cpp:
3188         (WebCore::PrintContext::pageProperty): Ditto.
3189         (WebCore::PrintContext::pageSizeAndMarginsInPixels): Ditto.
3190
3191         * page/WheelEventTestTrigger.cpp:
3192         (WebCore::dumpState): Use StringBuilder::appendNumber instead of
3193         String::number so we can do it without allocating/destroying a String.
3194         Also use StringBuilder::appendLiteral on a literal.
3195
3196         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3197         (WebCore::ResourceUsageOverlay::platformDraw): Pass explicit
3198         KeepTrailingZeros to FormattedNumber::fixedPrecision to preserve behavior,
3199         since default is now to truncate trailing zeros.
3200
3201         * platform/graphics/Color.cpp:
3202         (WebCore::Color::cssText): Use StringBuilder::appendNumber instead of
3203         calling numberToFixedPrecisionString to do the same thing.
3204         * platform/graphics/ExtendedColor.cpp:
3205         (WebCore::ExtendedColor::cssText): Ditto.
3206
3207         * platform/graphics/ca/GraphicsLayerCA.cpp:
3208         (WebCore::animationIdentifier): Remove String::number and let makeString
3209         do the conversion without allocating/destroying a String. Had to add
3210         a typecast to convert the enumeration into an integer.
3211         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
3212         (WebCore::PlatformCAFilters::setFiltersOnLayer): Ditto.
3213         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3214         (WebCore::FontPlatformData::description const): Ditto.
3215
3216         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3217         (WebCore::MockMediaSample::MockMediaSample): Use AtomicString::number
3218         instead of String::number to avoid unneccessarily allocating an additional
3219         temporary String when an AtomicString already exists.
3220
3221         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3222         (WebCore::SocketStreamHandleImpl::reportErrorToClient): Remove String::number
3223         and let makeString do the conversion without allocating/destroying a String.
3224         * platform/sql/SQLiteDatabase.cpp:
3225         (WebCore::SQLiteDatabase::setMaximumSize): Ditto.
3226         (WebCore::SQLiteDatabase::setSynchronous): Ditto. Had to add a typecast to
3227         convert the enumeration into an integer.
3228         * svg/SVGAngleValue.cpp:
3229         (WebCore::SVGAngleValue::valueAsString const): Ditto.
3230         * svg/SVGLengthValue.cpp:
3231         (WebCore::SVGLengthValue::valueAsString const): Ditto.
3232         * testing/Internals.cpp:
3233         (WebCore::Internals::configurationForViewport): Ditto. Used
3234         FormattedNumber::fixedPrecision since these are floats.
3235         (WebCore::Internals::getCurrentCursorInfo): Use StringBuilder::appendNumber
3236         instead of calling numberToFixedPrecisionString to do the same thing.
3237         (WebCore::Internals::queueMicroTask): Remove String::number and let makeString
3238         do the conversion without allocating/destroying a String.
3239         (WebCore::appendOffsets): Use StringBuilder::appendNumber instead of
3240         String::number so we can do it without allocating/destroying a String.
3241
3242         * workers/service/ServiceWorkerClientIdentifier.h:
3243         (WebCore::ServiceWorkerClientIdentifier::toString const): Remove String::number
3244         and let makeString do the conversion without allocating/destroying a String.
3245         * workers/service/server/RegistrationDatabase.cpp:
3246         (WebCore::databaseFilenameFromVersion): Ditto.
3247
3248 2019-02-09  Zalan Bujtas  <zalan@apple.com>
3249
3250         [LFC][IFC] Add intrinsic width support for basic inline containers
3251         https://bugs.webkit.org/show_bug.cgi?id=194473
3252
3253         Reviewed by Antti Koivisto.
3254
3255         Preferred width computation logic is very similar to normal layout.
3256         One of the main difference is that the preferred width codepath does not provide valid containing block width.
3257         This patch implement basic inline container support by passing nullopt containing block width in UsedHorizontalValues. 
3258
3259         * layout/inlineformatting/InlineFormattingContext.cpp:
3260         (WebCore::Layout::InlineFormattingContext::layout const):
3261         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
3262         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
3263         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
3264         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
3265         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3266         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
3267         * layout/inlineformatting/InlineFormattingContext.h:
3268
3269 2019-02-08  Myles C. Maxfield  <mmaxfield@apple.com>
3270
3271         [Cocoa] CTLineGetGlyphRuns() might return nullptr
3272         https://bugs.webkit.org/show_bug.cgi?id=194467
3273         <rdar://problem/42423999>
3274
3275         Reviewed by Simon Fraser.
3276
3277         Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.
3278
3279         Covered by find/text/find-backwards.html
3280
3281         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3282         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3283
3284 2019-02-08  Myles C. Maxfield  <mmaxfield@apple.com>
3285
3286         [Cocoa] Ask platform for generic font family mappings
3287         https://bugs.webkit.org/show_bug.cgi?id=187723
3288         <rdar://problem/41892438>
3289
3290         Reviewed by Brent Fulgham.
3291
3292         WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
3293         When trying to style a character with a generic font family, we first look to see if
3294         we have a mapping for the particular script the character is rendered with, and if we
3295         don't find a match, we then check USCRIPT_COMMON.
3296
3297         In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
3298         the only scripts which won't use the API families) is in
3299         SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
3300         for the CJK scripts.
3301
3302         The mappings inside SettingsBase are incorrect and conflict with our policy regarding
3303         user-installed fonts. Instead, we should be consulting with the platform for some of
3304         these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
3305         API still has to work to set the mappings for untagged content. Therefore, we use the
3306         system mappings for language-tagged content, and the API mappings for non-language-tagged
3307         content. This is a good balance that makes sure we always have a good mapping for every
3308         language, but API clients can still set the mappings, too.
3309
3310         Test: fast/text/ja-sans-serif.html
3311
3312         * css/CSSComputedStyleDeclaration.cpp:
3313         * css/CSSFontSelector.cpp:
3314         (WebCore::resolveGenericFamily):
3315         * css/parser/CSSPropertyParser.cpp:
3316         (WebCore::consumeFontFamily):
3317         * page/cocoa/SettingsBaseCocoa.mm:
3318         (WebCore::SettingsBase::initializeDefaultFontFamilies):
3319         (WebCore::osakaMonoIsInstalled): Deleted.
3320         * platform/graphics/FontDescription.cpp:
3321         (WebCore::FontDescription::platformResolveGenericFamily):
3322         * platform/graphics/FontDescription.h:
3323         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3324         (WebCore::computeSpecializedChineseLocale):
3325         (WebCore::cachedSpecializedChineseLocale):
3326         (WebCore::languageChanged):
3327         (WebCore::FontDescription::platformResolveGenericFamily):
3328         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3329         (WebCore::SystemFontDatabaseCoreText::clear):
3330         (WebCore::SystemFontDatabaseCoreText::serifFamily):
3331         (WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
3332         (WebCore::SystemFontDatabaseCoreText::cursiveFamily):
3333         (WebCore::SystemFontDatabaseCoreText::fantasyFamily):
3334         (WebCore::SystemFontDatabaseCoreText::monospaceFamily):
3335         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
3336
3337 2019-02-08  Yusuke Suzuki  <ysuzuki@apple.com>
3338
3339         [JSC] Shrink sizeof(CodeBlock) more
3340         https://bugs.webkit.org/show_bug.cgi?id=194419
3341
3342         Reviewed by Mark Lam.
3343
3344         * testing/Internals.cpp:
3345         (WebCore::Internals::parserMetaData):
3346
3347 2019-02-08  Chris Dumez  <cdumez@apple.com>
3348
3349         [Cocoa] Optimize ResourceResponse::platformLazyInit()
3350         https://bugs.webkit.org/show_bug.cgi?id=194438
3351
3352         Reviewed by Alex Christensen.
3353
3354         Optimize ResourceResponse::platformLazyInit(). Most of the CPU time currently goes into getting the
3355         HTTP headers from CFNetwork:
3356         """
3357         Sample Count, Samples %, CPU %, Symbol
3358         46, 0.0%, 0.0%, WebCore::initializeHTTPHeaders(WebCore::OnlyCommonHeaders, NSHTTPURLResponse*, WebCore::HTTPHeaderMap&) (in WebCore)
3359         34, 0.0%, 0.0%,     HTTPHeaderDict::copyAsOrdinaryDict(__CFAllocator const*) const (in CFNetwork)
3360         11, 0.0%, 0.0%,     CFDictionaryApplyFunction (in CoreFoundation)
3361         """
3362
3363         We currently have 2 levels of initialization: CommonFieldsOnly & AllFields. With WebKit2, most ResourceResponses get sent over IPC
3364         and thus end up getting initialized twice, once with CommonFieldsOnly and then with AllFields.
3365         This would cause us to call the expensive HTTPHeaderDict::copyAsOrdinaryDict() twice instead of once, simply to initialize the common
3366         HTTP headers first and then the uncommon ones later.
3367
3368         This patch updates ResourceResponse::platformLazyInit() to initialize all HTTP headers at once, as soon as CommonFieldsOnly
3369         initialization is requested, so that we no longer copy all HTTP headers twice.
3370
3371         * platform/network/cocoa/ResourceResponseCocoa.mm:
3372         (WebCore::initializeHTTPHeaders):
3373         (WebCore::ResourceResponse::platformLazyInit):
3374
3375 2019-02-08  Justin Fan  <justin_fan@apple.com>
3376
3377         [Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
3378         https://bugs.webkit.org/show_bug.cgi?id=194443
3379
3380         Unreviewed build fix.
3381
3382         For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
3383         if not using MTLStorageModePrivate, must use MTLStorageModeShared.
3384
3385         Behavior unchanged.
3386
3387         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
3388         (WebCore::storageModeForPixelFormatAndSampleCount):
3389
3390 2019-02-08  Per Arne Vollan  <pvollan@apple.com>
3391
3392         [WebVTT] Inline WebVTT styles should start with '::cue'
3393         https://bugs.webkit.org/show_bug.cgi?id=194227
3394         <rdar://problem/47791087>
3395
3396         Reviewed by Eric Carlson.
3397
3398         Check that the CSS string starts with '::cue' and is successfully parsed before adding it
3399         to the CSS stylesheet list. Also, the caption preferences CSS string should start with
3400         '::cue', since it is added inside the video shadow root element.
3401
3402         Test: media/track/track-cue-css.html
3403
3404         * html/track/WebVTTParser.cpp:
3405         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
3406         * page/CaptionUserPreferencesMediaAF.cpp:
3407         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
3408
3409 2019-02-08  Youenn Fablet  <youenn@apple.com>
3410
3411         Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
3412         https://bugs.webkit.org/show_bug.cgi?id=194380
3413         <rdar://problem/47916514>
3414
3415         Reviewed by Eric Carlson.
3416
3417         Set whether VP8 is supported at creation of the page.
3418         This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.
3419
3420         Add internal API to enable resetting the factory to enable proper testing.
3421
3422         Covered by updated test.
3423
3424         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3425         (WebCore::createLibWebRTCPeerConnectionBackend):
3426         * page/Page.cpp:
3427         (WebCore::m_applicationManifest):
3428         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3429         * testing/Internals.cpp:
3430         (WebCore::Internals::clearPeerConnectionFactory):
3431         * testing/Internals.h:
3432         * testing/Internals.idl:
3433
3434 2019-02-08  Andy Estes  <aestes@apple.com>
3435
3436         [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces
3437         https://bugs.webkit.org/show_bug.cgi?id=190997
3438         <rdar://problem/35983035>
3439
3440         Reviewed by Brent Fulgham.
3441
3442         Support serializing sequences and FrozenArrays of types that aren't interfaces. This is
3443         needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings.
3444
3445         We should support serializing sequences of interfaces too, but that's slightly more
3446         complicated since it involves iterating the sequence and serializing each of its items. I
3447         left that as a follow-up task, since I don't see any IDLs that currently need this.
3448
3449         We also don't support serializing sequences with the CachedAttribute or CustomGetter
3450         extended attributes, because WebIDL specifies that a new array should be created when
3451         converting an IDL sequence into an ECMAScript value.
3452
3453         Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to
3454         http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html.
3455
3456         * bindings/scripts/CodeGenerator.pm:
3457         (GetInterfaceForType): Renamed from GetInterfaceForAttribute.
3458         (IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types.
3459         (hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an
3460         attribute has the CachedAttribute or CustomGetter extended attributes.
3461         (IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter
3462         extended attributes before calling IsSerializableType.
3463         (GetInterfaceForAttribute): Renamed to GetInterfaceForType.
3464         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3465         * bindings/scripts/test/TestSerialization.idl:
3466
3467 2019-02-08  Sihui Liu  <sihui_liu@apple.com>
3468
3469         IndexedDB tests leak documents
3470         https://bugs.webkit.org/show_bug.cgi?id=189435
3471         <rdar://problem/44240043>
3472
3473         Reviewed by Geoffrey Garen.
3474
3475         Remove use of JSC::Strong in IndexedDatabase.
3476
3477         * Modules/indexeddb/IDBCursor.cpp:
3478         (WebCore::IDBCursor::update):
3479         (WebCore::IDBCursor::continuePrimaryKey):
3480         (WebCore::IDBCursor::continueFunction):
3481         (WebCore::IDBCursor::deleteFunction):
3482         (WebCore::IDBCursor::setGetResult):
3483         * Modules/indexeddb/IDBCursor.h:
3484         (WebCore::IDBCursor::key):
3485         (WebCore::IDBCursor::primaryKey):
3486         (WebCore::IDBCursor::value):
3487         (WebCore::IDBCursor::keyWrapper):
3488         (WebCore::IDBCursor::primaryKeyWrapper):
3489         (WebCore::IDBCursor::valueWrapper):
3490         (WebCore::IDBCursor::key const): Deleted.
3491         (WebCore::IDBCursor::primaryKey const): Deleted.
3492         (WebCore::IDBCursor::value const): Deleted.
3493         * Modules/indexeddb/IDBCursor.idl:
3494         * Modules/indexeddb/IDBCursorWithValue.idl:
3495         * Modules/indexeddb/IDBObjectStore.cpp:
3496         (WebCore::IDBObjectStore::putForCursorUpdate):
3497         * Modules/indexeddb/IDBObjectStore.h:
3498         * Modules/indexeddb/IDBRequest.cpp:
3499         (WebCore::IDBRequest::IDBRequest):
3500         (WebCore::IDBRequest::~IDBRequest):
3501         (WebCore::IDBRequest::result const):
3502         (WebCore::IDBRequest::setResult):
3503         (WebCore::IDBRequest::setResultToStructuredClone):
3504         (WebCore::IDBRequest::setResultToUndefined):
3505         (WebCore::IDBRequest::resultCursor):
3506         (WebCore::IDBRequest::willIterateCursor):
3507         (WebCore::IDBRequest::didOpenOrIterateCursor):
3508         * Modules/indexeddb/IDBRequest.h:
3509         (WebCore::IDBRequest::resultWrapper):
3510         * Modules/indexeddb/IDBRequest.idl:
3511         * Sources.txt:
3512         * WebCore.xcodeproj/project.pbxproj:
3513         * bindings/js/JSIDBCursorCustom.cpp:
3514         (WebCore::JSIDBCursor::key const):
3515         (WebCore::JSIDBCursor::primaryKey const):
3516         (WebCore::JSIDBCursor::visitAdditionalChildren):
3517         * bindings/js/JSIDBCursorWithValueCustom.cpp:
3518         (WebCore::JSIDBCursorWithValue::value const):
3519         (WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
3520         * bindings/js/JSIDBRequestCustom.cpp: Added.
3521         (WebCore::JSIDBRequest::result const):
3522         (WebCore::JSIDBRequest::visitAdditionalChildren):
3523         * inspector/agents/InspectorIndexedDBAgent.cpp:
3524
3525 2019-02-08  Zalan Bujtas  <zalan@apple.com>
3526
3527         [LFC] The used containing block width value is optional
3528         https://bugs.webkit.org/show_bug.cgi?id=194428
3529
3530         Reviewed by Antti Koivisto.
3531
3532         The preferred width codepath cannot provide a valid used containing block width value.
3533
3534         "The percentage is calculated with respect to the width of the generated box's containing block.
3535         If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.2."
3536
3537         Let's use 0 as used value for now.
3538
3539         * layout/FormattingContextGeometry.cpp:
3540         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
3541         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3542         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3543         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3544         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3545         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3546         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
3547         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
3548         * layout/LayoutUnits.h:
3549         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
3550         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3551         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3552         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3553         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
3554         * page/FrameViewLayoutContext.cpp:
3555
3556 2019-02-08  Zalan Bujtas  <zalan@apple.com>
3557
3558         [LFC] Horizontal geometry compute functions should take the containing block's width as a used value
3559         https://bugs.webkit.org/show_bug.cgi?id=194424
3560
3561         Reviewed by Antti Koivisto.
3562
3563         This is in preparation for passing optional containing block width for the preferred with codepath. 
3564
3565         * layout/FormattingContext.cpp:
3566         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
3567         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
3568         * layout/FormattingContext.h:
3569         * layout/FormattingContextGeometry.cpp:
3570         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
3571         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3572         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3573         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3574         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3575         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3576         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
3577         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
3578         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
3579         * layout/LayoutUnits.h:
3580         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
3581         * layout/blockformatting/BlockFormattingContext.cpp:
3582         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3583         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3584         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3585         * layout/inlineformatting/InlineFormattingContext.cpp:
3586         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
3587         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
3588         * layout/inlineformatting/InlineFormattingContext.h:
3589         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3590         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
3591
3592 2019-02-08  Benjamin Poulain  <benjamin@webkit.org>
3593
3594         clampTo(): do not convert the input to double when dealing with integers
3595         https://bugs.webkit.org/show_bug.cgi?id=194263
3596         <rdar://problem/47692312>
3597
3598         Reviewed by Darin Adler.
3599
3600         Make the calls to clampTo<float>() unambiguous.
3601
3602         * page/FrameView.cpp:
3603         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
3604         * rendering/style/RenderStyle.h:
3605         (WebCore::RenderStyle::setOpacity):
3606         (WebCore::RenderStyle::setShapeImageThreshold):
3607
3608 2019-02-08  Eric Liang  <ericliang@apple.com>
3609
3610         When performing AXPress, check to see if the menu list is disabled.
3611         https://bugs.webkit.org/show_bug.cgi?id=193878
3612
3613         Reviewed by Chris Fleizach.
3614
3615         Test: accessibility/mac/press-not-work-for-disabled-menu-list.html
3616
3617         * accessibility/AXObjectCache.h:
3618         * accessibility/AccessibilityMenuList.cpp:
3619         (WebCore::AccessibilityMenuList::press):
3620         * accessibility/mac/AXObjectCacheMac.mm:
3621         (WebCore::AXObjectCache::postPlatformNotification):
3622
3623 2019-02-07  Devin Rousso  <drousso@apple.com>
3624
3625         PseudoElement created for any ::before/::after selector regardless of whether a content property exists
3626         https://bugs.webkit.org/show_bug.cgi?id=194423
3627         <rdar://problem/46787260>
3628
3629         Reviewed by Antti Koivisto.
3630
3631         Test: inspector/css/pseudo-creation.html
3632
3633         * style/StyleTreeResolver.cpp:
3634         (WebCore::Style::TreeResolver::resolvePseudoStyle):
3635         We should only be creating `PseudoElement`s if we actually have a `content` proprety in the
3636         `PseudoElement`'s style. Otherwise, we end up creating `PseudoElement`s for every CSS rule
3637         that has a `::before`/`::after`, only to immediately destroy them as there is nothing to show.
3638
3639 2019-02-07  Chris Dumez  <cdumez@apple.com>
3640
3641         Mark more heap-allocated classes as fast allocated
3642         https://bugs.webkit.org/show_bug.cgi?id=194422
3643
3644         Reviewed by Ryosuke Niwa.
3645
3646         * Modules/applepay/PaymentCoordinator.h:
3647         * Modules/beacon/NavigatorBeacon.h:
3648         * Modules/cache/DOMWindowCaches.h:
3649         * Modules/cache/WorkerGlobalScopeCaches.h:
3650         * Modules/credentialmanagement/NavigatorCredentials.h:
3651         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
3652         * Modules/gamepad/NavigatorGamepad.h:
3653         * Modules/indexeddb/IDBGetAllResult.h:
3654         * Modules/indexeddb/IDBGetResult.h:
3655         * Modules/indexeddb/IDBKeyData.h:
3656         * Modules/indexeddb/IDBValue.h:
3657         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
3658         * Modules/indexeddb/server/IndexValueEntry.h:
3659         * Modules/indexeddb/server/IndexValueStore.h:
3660         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
3661         * Modules/indexeddb/server/MemoryCursor.h:
3662         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3663         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3664         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3665         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
3666         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3667         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
3668         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
3669         * Modules/indexeddb/shared/IDBTransactionInfo.h:
3670         * Modules/mediacapabilities/NavigatorMediaCapabilities.h:
3671         * Modules/mediasession/WebMediaSessionManager.cpp:
3672         * Modules/mediastream/NavigatorMediaDevices.h:
3673         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
3674         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
3675         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
3676         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
3677         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
3678         * Modules/quota/DOMWindowQuota.h:
3679         * Modules/quota/NavigatorStorageQuota.h:
3680         * Modules/quota/WorkerNavigatorStorageQuota.h:
3681         * Modules/speech/DOMWindowSpeechSynthesis.h:
3682         * Modules/webaudio/BiquadProcessor.h:
3683         * Modules/webaudio/DelayProcessor.h:
3684         * Modules/webauthn/fido/FidoHidPacket.h:
3685         * Modules/webdriver/NavigatorWebDriver.h:
3686         * Modules/webgpu/DOMWindowWebGPU.h:
3687         * Modules/websockets/WebSocketChannel.h:
3688         * Modules/webvr/NavigatorWebVR.h:
3689         * accessibility/AXObjectCache.h:
3690         * bindings/js/DOMGCOutputConstraint.h:
3691         * bindings/js/DOMPromiseProxy.h:
3692         * bridge/c/c_runtime.h:
3693         * contentextensions/CombinedURLFilters.cpp:
3694         * crypto/CryptoAlgorithmParameters.h:
3695         * css/CSSComputedStyleDeclaration.h:
3696         * css/CSSRegisteredCustomProperty.h:
3697         * css/DOMCSSPaintWorklet.h:
3698         * css/DOMCSSRegisterCustomProperty.h:
3699         * css/StyleRule.h:
3700         * dom/ConstantPropertyMap.h:
3701         * dom/CustomElementReactionQueue.h:
3702         * dom/Document.h:
3703         * dom/GenericEventQueue.h:
3704         * dom/RejectedPromiseTracker.h:
3705         * dom/UserGestureIndicator.h:
3706         * editing/ReplaceSelectionCommand.cpp:
3707         * editing/SelectionRectGatherer.h:
3708         * editing/TextIterator.h:
3709         * editing/cocoa/HTMLConverter.mm:
3710         * fileapi/AsyncFileStream.cpp:
3711         * fileapi/AsyncFileStream.h:
3712         * html/forms/FileIconLoader.h:
3713         * html/parser/HTMLTreeBuilder.h:
3714         * html/track/WebVTTParser.h:
3715         * inspector/DOMPatchSupport.cpp:
3716         * loader/FrameLoaderClient.h:
3717         * loader/WorkerThreadableLoader.cpp:
3718         * page/IntersectionObserver.h:
3719         * page/PerformanceMonitor.h:
3720         * page/PerformanceUserTiming.h:
3721         * page/PrintContext.h:
3722         * page/ValidationMessageClient.h:
3723         * platform/ColorChooser.h:
3724         * platform/ControlStates.h:
3725         * platform/DataListSuggestionPicker.h:
3726         * platform/FileStream.h:
3727         * platform/KeyedCoding.h:
3728         * platform/LowPowerModeNotifier.h:
3729         * platform/PlatformSpeechSynthesizer.h:
3730         * platform/WebGLStateTracker.h:
3731         * platform/audio/AudioArray.h:
3732         * platform/audio/AudioDestination.h:
3733         * platform/audio/DownSampler.h:
3734         * platform/audio/DynamicsCompressor.h:
3735         * platform/audio/FFTFrame.h:
3736         * platform/audio/HRTFDatabase.h:
3737         * platform/audio/MultiChannelResampler.h:
3738         * platform/audio/Panner.h:
3739         * platform/audio/Reverb.h:
3740         * platform/audio/ReverbConvolver.h:
3741         * platform/audio/ReverbConvolverStage.h:
3742         * platform/audio/UpSampler.h:
3743         * platform/audio/mac/AudioSessionMac.cpp:
3744         * platform/audio/mac/CAAudioStreamDescription.h:
3745         * platform/audio/mac/CARingBuffer.h:
3746         * platform/cocoa/ScrollSnapAnimatorState.h:
3747         * platform/gamepad/PlatformGamepad.h:
3748         * platform/graphics/GraphicsLayer.cpp:
3749         * platform/graphics/GraphicsLayerFactory.h:
3750         * platform/graphics/PlatformTimeRanges.h:
3751         * platform/graphics/TextTrackRepresentation.h:
3752         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
3753         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
3754         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
3755         * platform/graphics/displaylists/DisplayListRecorder.h:
3756         * platform/network/cocoa/WebCoreNSURLSession.mm:
3757         * platform/sql/SQLiteDatabase.h:
3758         * platform/text/TextCodecICU.h:
3759         * rendering/GridBaselineAlignment.h:
3760         * rendering/GridTrackSizingAlgorithm.h:
3761         * rendering/RenderObject.h:
3762         * rendering/style/GridArea.h:
3763         * workers/service/context/SWContextManager.h:
3764
3765 2019-02-07  Justin Fan  <justin_fan@apple.com>
3766
3767         [Web GPU] GPUDevice::createTexture implementation prototype
3768         https://bugs.webkit.org/show_bug.cgi?id=194409
3769         <rdar://problem/47894312>
3770
3771         Reviewed by Myles C. Maxfield.
3772
3773         Test: textures-textureviews.html updated to test new functionality.
3774
3775         Implement GPUDevice::createTexture():
3776         * Modules/webgpu/WebGPUDevice.cpp:
3777         (WebCore::WebGPUDevice::createTexture const):
3778         * Modules/webgpu/WebGPUDevice.h:
3779         * Modules/webgpu/WebGPUDevice.idl:
3780         * Modules/webgpu/WebGPUTexture.cpp:
3781         (WebCore::WebGPUTexture::create): Modified to return non-nullable to match direction of API.
3782         (WebCore::WebGPUTexture::WebGPUTexture):
3783         * Modules/webgpu/WebGPUTexture.h:
3784
3785         Metal backend MTLTextureDescriptor and MTLTexture creation:
3786         * platform/graphics/gpu/GPUDevice.cpp:
3787         (WebCore::GPUDevice::tryCreateTexture const):
3788         * platform/graphics/gpu/GPUDevice.h:
3789         * platform/graphics/gpu/GPUTexture.h:
3790         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
3791         (WebCore::mtlTextureTypeForGPUTextureDescriptor):
3792         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
3793         (WebCore::storageModeForPixelFormatAndSampleCount):
3794         (WebCore::tryCreateMtlTextureDescriptor):
3795         (WebCore::GPUTexture::tryCreate):
3796         (WebCore::GPUTexture::createDefaultTextureView): Add ObjC try/catch guards.
3797
3798         Add GPUUtils.h/cpp for shared utility functions:
3799         * SourcesCocoa.txt:
3800         * WebCore.xcodeproj/project.pbxproj:
3801         * platform/graphics/gpu/GPUUtils.h: Added. Moved platformTextureFormatForGPUTextureFormat here.
3802         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
3803         (WebCore::GPUSwapChain::setFormat):
3804         (WebCore::platformTextureFormatForGPUTextureFormat): Moved to GPUUtils.
3805         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Added.
3806         (WebCore::platformTextureFormatForGPUTextureFormat): Moved here to be referenced by multiple files.
3807
3808 2019-02-07  Sihui Liu  <sihui_liu@apple.com>
3809
3810         REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&)
3811         https://bugs.webkit.org/show_bug.cgi?id=194402
3812         <rdar://problem/47858241>
3813
3814         Reviewed by Geoffrey Garen.
3815
3816         r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be
3817         around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it
3818         is valid during access.
3819
3820         * Modules/indexeddb/server/ServerOpenDBRequest.cpp:
3821         (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
3822         (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
3823         * Modules/indexeddb/server/ServerOpenDBRequest.h:
3824
3825 2019-02-07  Timothy Hatcher  <timothy@apple.com>
3826
3827         Overflow element scrollbar is light for dark mode content.
3828         https://bugs.webkit.org/show_bug.cgi?id=194407
3829         rdar://problem/45991585
3830
3831         Reviewed by Beth Dakin.
3832
3833         Tested by css-dark-mode/supported-color-schemes-scrollbar.html.
3834
3835         * page/ChromeClient.h:
3836         (WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
3837         short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
3838         that do not implement preferredScrollbarOverlayStyle().
3839         * page/FrameView.cpp:
3840         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
3841         to auto detect overlay style when page() is null.
3842         * rendering/RenderLayer.cpp:
3843         (WebCore::RenderLayer::useDarkAppearance const): Added.
3844         * rendering/RenderLayer.h:
3845         * testing/Internals.cpp:
3846         (WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
3847         (WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
3848         * testing/Internals.h:
3849         * testing/Internals.idl:
3850
3851 2019-02-07  Eric Carlson  <eric.carlson@apple.com>
3852
3853         [MSE] Convert debug-only logging to runtime logging
3854         https://bugs.webkit.org/show_bug.cgi?id=194348
3855         <rdar://problem/47566449>
3856
3857         Reviewed by Jer Noble.
3858
3859         No new tests, this just changes existing logging.
3860
3861         * Modules/mediasource/MediaSource.cpp:
3862         (WebCore::convertEnumerationToString):
3863         (WebCore::MediaSource::MediaSource):
3864         (WebCore::MediaSource::~MediaSource):
3865         (WebCore::MediaSource::setPrivateAndOpen):
3866         (WebCore::MediaSource::addedToRegistry):
3867         (WebCore::MediaSource::removedFromRegistry):
3868         (WebCore::MediaSource::durationChanged):
3869         (WebCore::MediaSource::seekToTime):
3870         (WebCore::MediaSource::completeSeek):
3871         (WebCore::MediaSource::setLiveSeekableRange):
3872         (WebCore::MediaSource::clearLiveSeekableRange):
3873         (WebCore::MediaSource::setDuration):
3874         (WebCore::MediaSource::setDurationInternal):
3875         (WebCore::MediaSource::setReadyState):
3876         (WebCore::MediaSource::endOfStream):
3877         (WebCore::MediaSource::streamEndedWithError):
3878         (WebCore::MediaSource::addSourceBuffer):
3879         (WebCore::MediaSource::removeSourceBuffer):
3880         (WebCore::MediaSource::isTypeSupported):
3881         (WebCore::MediaSource::detachFromElement):
3882         (WebCore::MediaSource::attachToElement):
3883         (WebCore::MediaSource::openIfInEndedState):
3884         (WebCore::MediaSource::suspend):
3885         (WebCore::MediaSource::resume):
3886         (WebCore::MediaSource::stop):
3887         (WebCore::MediaSource::onReadyStateChange):
3888         (WebCore::MediaSource::scheduleEvent):
3889         (WebCore::MediaSource::logChannel const):
3890         (WebCore::MediaSourceInternal::toString): Deleted.
3891         * Modules/mediasource/MediaSource.h:
3892         (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString):
3893         (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString):
3894         * Modules/mediasource/SourceBuffer.cpp:
3895         (WebCore::SourceBuffer::SourceBuffer):
3896         (WebCore::SourceBuffer::~SourceBuffer):
3897         (WebCore::SourceBuffer::remove):
3898         (WebCore::SourceBuffer::seekToTime):
3899         (WebCore::SourceBuffer::appendBufferInternal):
3900         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
3901         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
3902         (WebCore::removeSamplesFromTrackBuffer):
3903         (WebCore::SourceBuffer::removeCodedFrames):
3904         (WebCore::SourceBuffer::evictCodedFrames):
3905         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
3906         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3907         (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples):
3908         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
3909         (WebCore::SourceBuffer::provideMediaData):
3910         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
3911         (WebCore::SourceBuffer::monitorBufferingRate):
3912         (WebCore::SourceBuffer::logChannel const):
3913         * Modules/mediasource/SourceBuffer.h:
3914         * dom/Document.cpp:
3915         (WebCore::messageSourceForWTFLogChannel):
3916         (WebCore::Document::didLogMessage):
3917         * html/HTMLMediaElement.cpp:
3918         (WebCore::convertEnumerationToString):
3919         (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
3920         (WebCore::HTMLMediaElement::selectMediaResource):
3921         (WebCore::HTMLMediaElement::loadResource):
3922         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3923         (WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
3924         (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
3925         (WebCore::HTMLMediaElement::scheduleUpdatePlayState):
3926         (WebCore::HTMLMediaElement::scheduleUpdateMediaState):
3927         * platform/ContentType.cpp:
3928         (WebCore::ContentType::toJSONString const):
3929         * platform/ContentType.h:
3930         (WTF::LogArgument<WebCore::ContentType>::toString):
3931         * platform/MediaSample.h:
3932         (WebCore::MediaSample::toJSONString const):
3933         (WTF::LogArgument<WebCore::MediaSample>::toString):
3934         * platform/graphics/FloatSize.cpp:
3935         (WebCore::FloatSize::toJSONObject const):
3936         (WebCore::FloatSize::toJSONString const):
3937         * platform/graphics/FloatSize.h:
3938         (WTF::LogArgument<WebCore::FloatSize>::toString):
3939         * platform/graphics/MediaSourcePrivate.h:
3940         (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier):
3941         (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString):
3942         (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString):
3943         * platform/graphics/SourceBufferPrivate.h:
3944         (WebCore::SourceBufferPrivate::sourceBufferLogger const):
3945         (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier):
3946         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3947         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
3948         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
3949         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
3950         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
3951         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
3952         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
3953         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
3954         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3955         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier):
3956         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
3957         (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString):
3958         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3959         (WebCore::convertEnumerationToString):
3960         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
3961         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
3962         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
3963         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
3964         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
3965         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
3966         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
3967         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
3968         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
3969         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
3970         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
3971         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
3972         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted):
3973         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
3974         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
3975         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
3976         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):