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