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