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