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