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