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