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