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