2552c7d792664e9d165a8041a3ad76a87fb28541
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-12-23  Daniel Bates  <dabates@apple.com>
2
3         REGRESSION (r212693): getClientRects(), getBoundingClientRect() for range that spans multi-lines differs depending on whether text is selected
4         https://bugs.webkit.org/show_bug.cgi?id=205527
5         <rdar://problem/58128278>
6
7         Reviewed by Zalan Bujtas.
8
9         Include empty rect when range start position coincides with the end of a simple line layout run.
10         This makes it match the behavior of line box layout, Firefox's behavior, as well as my understanding
11         of Extensions to the Range Interface: <https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface>
12         (Editor's Draft, 10 October 2019).
13
14         At the time of writing, there are two code paths for laying out lines: simple line layout and
15         line box layout. Simple line layout is not enabled when there is a selection at the time of
16         writing. As a result, we use line box layout to answer getClientRects(), getBoundingClientRect()
17         queries.
18
19         Test: fast/dom/Range/mac/getClientRects-and-getBoundingClientRect-before-and-after-selection.html
20
21         * rendering/SimpleLineLayoutResolver.cpp:
22         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const): Do not skip over a run
23         if its end position coincides with the range's start offset. This ensures that we emit an empty rect
24         for this part of the box selection, which matches what we do using the analagous line box layout
25         code path.
26
27 2019-12-23  Carlos Garcia Campos  <cgarcia@igalia.com>
28
29         [GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load
30         https://bugs.webkit.org/show_bug.cgi?id=185248
31
32         Reviewed by Žan Doberšek.
33
34         Notify the editor when a key event handled by input method has been dispatched. This way we can handle the
35         composition results right after the event is dispatched.
36
37         * editing/Editor.cpp:
38         (WebCore::Editor::didDispatchInputMethodKeydown): Notify the client.
39         * editing/Editor.h:
40         * page/EditorClient.h:
41         (WebCore::EditorClient::didDispatchInputMethodKeydown): Added.
42         * page/EventHandler.cpp:
43         (WebCore::EventHandler::internalKeyEvent): Call Editor::didDispatchInputMethodKeydown() for events handled by
44         input method right after the event is dispatched.
45         * platform/PlatformKeyboardEvent.h:
46         (WebCore::PlatformKeyboardEvent::preeditUnderlines const):
47         (WebCore::PlatformKeyboardEvent::preeditSelectionRangeStart const):
48         (WebCore::PlatformKeyboardEvent::preeditSelectionRangeLength const):
49         * platform/gtk/PlatformKeyboardEventGtk.cpp:
50         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
51         method and remove the special case for Char events handled by input method because this is never called with
52         Char type for events handled by input method.
53         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
54         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Return early if the event was handled by input
55         method.
56
57 2019-12-22  Simon Fraser  <simon.fraser@apple.com>
58
59         Very basic <dialog> show/close support
60         https://bugs.webkit.org/show_bug.cgi?id=205543
61
62         Reviewed by Antti Koivisto.
63         
64         Fix HTMLDialogElement.idl for attribute reflection, and showModal() possibly throwing.
65         
66         Have show/showModal() and close() toggle the "open" attribute. Implement parseAttribute()
67         to initialize m_isOpen from the attribute value.
68         
69         Add dialog.css, which is appended to the UA stylesheets if the feature is enabled. Have
70         it set the display value.
71
72         Tested by web-platform-tests.
73
74         * CMakeLists.txt:
75         * DerivedSources-input.xcfilelist:
76         * DerivedSources.make:
77         * WebCore.xcodeproj/project.pbxproj:
78         * css/dialog.css: Added.
79         (dialog):
80         (dialog[open]):
81         * html/HTMLDialogElement.cpp:
82         (WebCore::HTMLDialogElement::isOpen const):
83         (WebCore::HTMLDialogElement::show):
84         (WebCore::HTMLDialogElement::showModal):
85         (WebCore::HTMLDialogElement::close):
86         (WebCore::HTMLDialogElement::parseAttribute):
87         (WebCore::HTMLDialogElement::toggleOpen):
88         (WebCore::HTMLDialogElement::open): Deleted.
89         (WebCore::HTMLDialogElement::setOpen): Deleted.
90         * html/HTMLDialogElement.h:
91         * html/HTMLDialogElement.idl:
92         * style/InspectorCSSOMWrappers.cpp:
93         (WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers):
94         * style/UserAgentStyle.cpp:
95         (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
96         * style/UserAgentStyle.h:
97
98 2019-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>
99
100         [macCatalyst] Mouse clicks dispatch duplicate pointerup and pointerdown events
101         https://bugs.webkit.org/show_bug.cgi?id=205551
102         <rdar://problem/58058268>
103
104         Reviewed by Tim Horton.
105
106         This began occuring after r251320, wherein some mouse event handling codepaths were enabled in macCatalyst.
107         For compatibility, gesture recognizers still fire in the macCatalyst platform. This includes the synthetic click
108         gesture, which will still synthesize and send mouseup and mousedown events to the page. After the change, this
109         results in pointer events being dispatched under the call to `shouldIgnoreMouseEvent()`. However, at the same
110         time, touch event handling codepaths have already dispatched "pointerup" and "pointerdown", so we end up with
111         redundant events.
112
113         To fix this macCatalyst-specific bug, simply avoid dispatching pointer events in the case where the synthetic
114         click type is some kind of tap gesture; in this case, pointer events have already been dispatched, so we don't
115         need to dispatch them again via mouse event handling code.
116
117         Test: pointerevents/ios/pointer-events-with-click-handler.html
118
119         * dom/Element.cpp:
120         (WebCore::dispatchPointerEventIfNeeded):
121
122         Also rename shouldIgnoreMouseEvent to dispatchPointerEventIfNeeded to better reflect that this function's
123         primary purposee is to dispatch pointer events in response to platform mouse events; then, change the return
124         value to an explicit enum class indicating whether the mouse event should be subsequently ignored (as a result
125         of the page preventing the dispatched pointer event).
126
127         (WebCore::Element::dispatchMouseEvent):
128         (WebCore::shouldIgnoreMouseEvent): Deleted.
129
130 2019-12-22  Antti Koivisto  <antti@apple.com>
131
132         Invalidate only affected elements after media query evaluation changes
133         https://bugs.webkit.org/show_bug.cgi?id=205392
134
135         Reviewed by Zalan Bujtas.
136
137         We currently invalidate style of the whole tree when a media query evaluation changes.
138         We can do better by constructing an invalidation RuleSet and invalidating only those
139         elements that are potentially affected.
140
141         * style/RuleSet.cpp:
142         (WebCore::Style::RuleSet::addRule):
143         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
144
145         Construct and cache an invalidation RuleSet and associate with a set of media query changes.
146
147         (WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
148         (WebCore::Style::RuleSet::MediaQueryCollector::pop):
149         (WebCore::Style::RuleSet::MediaQueryCollector::addRuleIfNeeded):
150
151         Collect RuleFeatures which we later use to build invalidation RuleSet.
152
153         (WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded): Deleted.
154         * style/RuleSet.h:
155         (WebCore::Style::DynamicMediaQueryEvaluationChanges::append):
156         * style/StyleResolver.cpp:
157         (WebCore::Style::Resolver::evaluateDynamicMediaQueries):
158         * style/StyleResolver.h:
159         * style/StyleScope.cpp:
160         (WebCore::Style::Scope::evaluateMediaQueries):
161
162         Use the invalidation RuleSet for accurate style invalidation.
163
164         * style/StyleScopeRuleSets.cpp:
165         (WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):
166
167         Collect invalidation RuleSets for author/user/user agent style.
168
169         * style/StyleScopeRuleSets.h:
170
171 2019-12-22  Zalan Bujtas  <zalan@apple.com>
172
173         [LFC][Integration] Do not remove trailing whitespace when it is followed by a line break
174         https://bugs.webkit.org/show_bug.cgi?id=205549
175         <rdar://problem/58139893>
176
177         Reviewed by Antti Koivisto.
178
179         Complex line layout quirk: keep the trailing whitespace aroun
180         when it is followed by a line break, unless the content overflows the line.
181
182         * layout/inlineformatting/InlineLineBuilder.cpp:
183         (WebCore::Layout::LineBuilder::removeTrailingCollapsibleContent):
184
185 2019-12-22  Zalan Bujtas  <zalan@apple.com>
186
187         [LFC][Integration] Do not collapse trailing letter spacing
188         https://bugs.webkit.org/show_bug.cgi?id=205548
189         <rdar://problem/58139872>
190
191         Reviewed by Antti Koivisto.
192
193         Turn off trailing letter-spacing trimming for now.
194
195         * layout/inlineformatting/InlineLineBuilder.cpp:
196         (WebCore::Layout::LineBuilder::InlineItemRun::hasTrailingLetterSpacing const):
197
198 2019-12-21  Brian Burg  <bburg@apple.com>
199
200         Web Inspector: add InspectedTargetTypes diagnostic event and related hooks
201         https://bugs.webkit.org/show_bug.cgi?id=205174
202         <rdar://problem/57887953>
203
204         Reviewed by Devin Rousso.
205
206         Expose debuggable information via InspectorFrontendHost.
207
208         * WebCore.xcodeproj/project.pbxproj: Add new files.
209
210         * inspector/InspectorFrontendClient.h: Add new methods.
211         * testing/Internals.cpp: Implement new methods.
212
213         * inspector/InspectorFrontendHost.idl:
214         * inspector/InspectorFrontendHost.h:
215         * inspector/InspectorFrontendHost.cpp:
216         (WebCore::debuggableTypeToString):
217         (WebCore::InspectorFrontendHost::debuggableInfo const):
218         (WebCore::InspectorFrontendHost::debuggableType): Deleted.
219         Expose a `DebuggableInfo` dictionary via the .debuggableInfo getter.
220
221
222 2019-12-21  Antti Koivisto  <antti@apple.com>
223
224         Move Vector HashTraits to HashTraits.h to fix GCC build
225         https://bugs.webkit.org/show_bug.cgi?id=205540
226
227         Reviewed by Zalan Bujtas.
228
229         * contentextensions/DFAMinimizer.cpp:
230
231         ActionKey HashTrait claims that emptyValueIsZero. Now with Vector HashTrait having emptyValueIsZero too
232         HashMap<ActionKey, Vector<>> started taking the optimized path.
233
234         However ActionKey empty value wasn't actually zero because Empty enum value wasn't 0.
235
236 2019-12-21  Kate Cheney  <katherine_cheney@apple.com>
237
238         Add timeStamp to ITP database
239         https://bugs.webkit.org/show_bug.cgi?id=205121
240         <rdar://problem/57633021>
241
242         Reviewed by John Wilander.
243
244         * loader/ResourceLoadStatistics.h:
245
246 2019-12-20  Eric Carlson  <eric.carlson@apple.com>
247
248         [Media in GPU process] Get audio playing
249         https://bugs.webkit.org/show_bug.cgi?id=205511
250         <rdar://problem/58120354>
251
252         Reviewed by Jer Noble.
253
254         Tested manually with a modified sandbox because it isn't possible to load media
255         in the GPU process yet.
256
257         * platform/graphics/MediaPlayer.cpp:
258         (WebCore::MediaPlayer::bufferedTimeRangesChanged):
259         (WebCore::MediaPlayer::seekableTimeRangesChanged):
260         * platform/graphics/MediaPlayer.h:
261         * platform/graphics/PlatformTimeRanges.cpp:
262         (WebCore::PlatformTimeRanges::PlatformTimeRanges):
263         (WebCore::PlatformTimeRanges::clear):
264         * platform/graphics/PlatformTimeRanges.h:
265
266 2019-12-20  Ryosuke Niwa  <rniwa@webkit.org>
267
268         TextManipulationController should respect new token orders
269         https://bugs.webkit.org/show_bug.cgi?id=205378
270
271         Reviewed by Wenson Hsieh.
272
273         Updated TextManipulationController::replace to remove all existing content and insert new tokens in the order they appear.
274
275         To do this, we first find the common ancestor of all nodes in the paragraph and then remove all nodes in between.
276
277         Then we'd insert the node identified by the token identifier and all its ancestors at where they appear. In the case
278         the same token is used for the second time, we clone its node. For each leaf node, we find the closest ancestor which
279         had already been inserted by the previous token, and append the leaf node along with its ancestors to it.
280
281         I'm expecting to make a lot of refinements & followups to this algorithm in the future but this seems to get basics done.
282
283         Tests: TextManipulation.CompleteTextManipulationReplaceSimpleSingleParagraph
284                TextManipulation.CompleteTextManipulationDisgardsTokens
285                TextManipulation.CompleteTextManipulationReordersContent
286                TextManipulation.CompleteTextManipulationCanSplitContent
287                TextManipulation.CompleteTextManipulationCanMergeContent
288                TextManipulation.CompleteTextManipulationFailWhenContentIsRemoved
289                TextManipulation.CompleteTextManipulationFailWhenExcludedContentAppearsMoreThanOnce
290                TextManipulation.CompleteTextManipulationPreservesExcludedContent
291
292         * editing/TextManipulationController.cpp:
293         (WebCore::TextManipulationController::didCreateRendererForElement):
294         (WebCore::TextManipulationController::completeManipulation):
295         (WebCore::TextManipulationController::replace):
296
297 2019-12-20  Sihui Liu  <sihui_liu@apple.com>
298
299         REGRESSION (r253807): crash in storage/indexeddb/modern/opendatabase-request-private.html
300         https://bugs.webkit.org/show_bug.cgi?id=205515
301
302         Reviewed by Alex Christensen.
303
304         When m_openRequests of IDBTransaction is empty, we expect all requests associated with the transactions should 
305         be completed, but in IDBOpenDBRequest, we removed the request from m_openRequests before 
306         m_currentlyCompletingRequest finished. This is because the order of calling ActiveDOMObject::stop() is random.
307
308         * Modules/indexeddb/IDBOpenDBRequest.cpp:
309         (WebCore::IDBOpenDBRequest::cancelForStop):
310         * Modules/indexeddb/IDBTransaction.cpp:
311         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
312         (WebCore::IDBTransaction::connectionClosedFromServer):
313
314 2019-12-20  Megan Gardner  <megan_gardner@apple.com>
315
316         Paint highlights specified in CSS Highlight API
317         https://bugs.webkit.org/show_bug.cgi?id=205318
318
319         Reviewed by Ryosuke Niwa.
320
321         Render highlights when present, similar to the way we render selection.
322
323         Tests: imported/w3c/web-platform-tests/css/css-highlight-api/highlight-text-across-elements.html
324                imported/w3c/web-platform-tests/css/css-highlight-api/highlight-text.html
325
326         * Modules/highlight/HighlightMap.h:
327         (WebCore::HighlightMap::map const):
328
329         Add a getter for the internal HashMap.
330
331         * rendering/InlineTextBox.cpp:
332         (WebCore::InlineTextBox::selectionState):
333         (WebCore::InlineTextBox::verifySelectionState const):
334         (WebCore::InlineTextBox::paint):
335         (WebCore::InlineTextBox::clampedStartEndForState const):
336         (WebCore::InlineTextBox::selectionStartEnd const):
337         (WebCore::InlineTextBox::highlightStartEnd const):
338         (WebCore::InlineTextBox::resolveStyleForMarkedText):
339
340         Use the highlight name from the HighlightRangeGroup to obtain the style from the renderer.
341
342         (WebCore::InlineTextBox::collectMarkedTextsForHighlights const):
343
344         Render the highlights when painting text. Determine if a highlight is present in the current RenderObject, and
345         add additional MarkedText to be rendered when painting
346
347         * rendering/InlineTextBox.h:
348         * rendering/MarkedText.cpp:
349         (WebCore::subdivide):
350         * rendering/MarkedText.h:
351         (WebCore::MarkedText::operator== const):
352
353         Expand MarkedText to take a style name.
354
355         * rendering/SelectionRangeData.cpp:
356         (WebCore::SelectionRangeData::setContext):
357         (WebCore::SelectionRangeData::selectionStateForRenderer):
358         (WebCore::SelectionRangeData::set):
359         * rendering/SelectionRangeData.h:
360
361         Leverage SelectionRangeData for highlights.
362
363 2019-12-20  Chris Dumez  <cdumez@apple.com>
364
365         [iOS Debug] imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https.html is crashing
366         https://bugs.webkit.org/show_bug.cgi?id=205506
367         <rdar://problem/58118091>
368
369         Reviewed by Darin Adler.
370
371         Drop iOS specific hack in FrameLoader::checkCompleted() that was causing this crash in iOS Debug.
372         This hack was added a long time ago to fix back/forward navigation after clicking an intra PDF
373         document hyperlink. I have verified on iOS 13 that the behavior is unchanged without this code:
374         - Back/forward navigation within a PDF work in UIWebView and do not work in WKWebView
375
376         No new tests, unskipped existing test.
377
378         * loader/FrameLoader.cpp:
379         (WebCore::FrameLoader::checkCompleted):
380
381 2019-12-20  Chris Dumez  <cdumez@apple.com>
382
383         [Bindings] Add @@toStringTag to our iterator prototype object
384         https://bugs.webkit.org/show_bug.cgi?id=205516
385
386         Reviewed by Darin Adler.
387
388         Add @@ toStringTag to our iterator prototype object, as per:
389         - https://heycam.github.io/webidl/#es-iterator-prototype-object
390
391         No new tests, rebaselined existing tests.
392
393         * bindings/js/JSDOMIterator.h:
394         (WebCore::IteratorTraits>::finishCreation):
395
396 2019-12-20  Jer Noble  <jer.noble@apple.com>
397
398         MediaKeySession.load() fails
399         https://bugs.webkit.org/show_bug.cgi?id=205467
400
401         Reviewed by Eric Carlson.
402
403         Invert the storageURL condition in load().
404
405         Drive-by fix: ask the group for it's sessionID, not the session, if it exists.
406
407         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
408         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
409         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
410
411 2019-12-20  Chris Dumez  <cdumez@apple.com>
412
413         sendBeacon on Safari 13 seeing high failure rates
414         https://bugs.webkit.org/show_bug.cgi?id=204665
415         <rdar://problem/57522622>
416
417         Reviewed by Darin Adler.
418
419         Revert r245344 to try and reduce our failure rate for Beacon. This is the only change
420         to our Beacon implementation that I am aware we made in Safari 13. Using a lower priority
421         for Beacon makes it more likely that the Beacon load is still pending when the network
422         process exits, which would interrupt the Beacon.
423
424         Since we're trying to convince developers to move away from synchronous XHR and to using
425         the Beacon API intead, it is important that our Beacon API be as reliable as possible.
426
427         * Modules/beacon/NavigatorBeacon.cpp:
428         (WebCore::NavigatorBeacon::sendBeacon):
429         * loader/PingLoader.cpp:
430         (WebCore::PingLoader::sendPing):
431
432 2019-12-20  Truitt Savell  <tsavell@apple.com>
433
434         Unreviewed, rolling out r253820.
435
436         Broke Mac testing
437
438         Reverted changeset:
439
440         "Invalidate only affected elements after media query
441         evaluation changes"
442         https://bugs.webkit.org/show_bug.cgi?id=205392
443         https://trac.webkit.org/changeset/253820
444
445 2019-12-20  youenn fablet  <youenn@apple.com>
446
447         SWServer can be created without any path to store registrations in non ephemeral sessions
448         https://bugs.webkit.org/show_bug.cgi?id=205500
449
450         Reviewed by Simon Fraser.
451
452         No change of behavior in release.
453         Remove debug assert and log the case of a non ephemeral session without a path.
454
455         * workers/service/server/SWServer.cpp:
456         (WebCore::SWServer::SWServer):
457
458 2019-12-20  Brian Burg  <bburg@apple.com>
459
460         Web Inspector: convert some InspectorFrontendHost methods to getters
461         https://bugs.webkit.org/show_bug.cgi?id=205475
462
463         Reviewed by Devin Rousso.
464
465         No reason for these to be method calls, so expose as getters / attributes instead.
466
467         * inspector/InspectorFrontendClient.h:
468         * inspector/InspectorFrontendHost.cpp:
469         (WebCore::InspectorFrontendHost::isRemote const):
470         (WebCore::debuggableTypeToString):
471         (WebCore::InspectorFrontendHost::localizedStringsURL): Deleted.
472         (WebCore::InspectorFrontendHost::backendCommandsURL): Deleted.
473         (WebCore::InspectorFrontendHost::debuggableType): Deleted.
474         (WebCore::InspectorFrontendHost::inspectionLevel): Deleted.
475         (WebCore::InspectorFrontendHost::platform): Deleted.
476         (WebCore::InspectorFrontendHost::port): Deleted.
477         * inspector/InspectorFrontendHost.h:
478         * inspector/InspectorFrontendHost.idl:
479         * testing/Internals.cpp:
480
481 2019-12-20  Andres Gonzalez  <andresg_22@apple.com>
482
483         IsolatedObject support for multiple parameterized attributes.
484         https://bugs.webkit.org/show_bug.cgi?id=205508
485
486         Reviewed by Chris Fleizach.
487
488         - AXObjectCache now keeps the PageIdentifier so that it is possible to
489         retrieve it on the secondary thread without querying the Document.
490         - isIncrementor is exposed on AXCoreObject for spin button support.
491         - Several parameterized attributes implementation related to
492         TextMarkers are now dispatch to the main thread.
493
494         * accessibility/AXObjectCache.cpp:
495         (WebCore::AXObjectCache::AXObjectCache):
496         (WebCore::AXObjectCache::setIsolatedTreeFocusedObject):
497         (WebCore::AXObjectCache::isolatedTreeRootObject):
498         (WebCore::AXObjectCache::remove):
499         * accessibility/AXObjectCache.h:
500         * accessibility/AccessibilityObject.h:
501         * accessibility/AccessibilityObjectInterface.h:
502         * accessibility/AccessibilitySpinButton.h:
503         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
504         (WebCore::AXIsolatedObject::AXIsolatedObject):
505         (WebCore::AXIsolatedObject::initializeAttributeData):
506         (WebCore::AXIsolatedObject::updateBackingStore):
507         (WebCore::AXIsolatedObject::findTextRanges const):
508         (WebCore::AXIsolatedObject::performTextOperation):
509         (WebCore::AXIsolatedObject::axObjectCache const):
510         (WebCore::AXIsolatedObject::widget const):
511         (WebCore::AXIsolatedObject::document const):
512         (WebCore::AXIsolatedObject::documentFrameView const):
513         (WebCore::AXIsolatedObject::isLoaded const): Implemented in header.
514         (WebCore::AXIsolatedObject::supportsPath const): Implemented in header.
515         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
516         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
517         (-[WebAccessibilityObjectWrapper subrole]):
518         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
519
520 2019-12-20  Daniel Bates  <dabates@apple.com>
521
522         Share code for computing the absolute positioned line boxes for a range
523         https://bugs.webkit.org/show_bug.cgi?id=205510
524
525         Reviewed by Wenson Hsieh.
526
527         Implement RenderTextLineBoxes::absoluteRectsForRange() in terms of absoluteQuadsForRange()
528         to remove almost identical code. This makes absoluteRectsForRange() a tiny bit slower. If
529         it turns out this slowness isn't so tiny then we should use revert this change and implement
530         again using templates to avoid duplication.
531
532         Also moved absoluteQuadsForRange() to be above absoluteRectsForRange() to group these
533         related functions closer together.
534
535         * rendering/RenderTextLineBoxes.cpp:
536         (WebCore::RenderTextLineBoxes::absoluteQuadsForRange const): No change, though I moved it
537         to be above absoluteRectsForRange().
538         (WebCore::RenderTextLineBoxes::absoluteRectsForRange const): Implement in terms of absoluteQuadsForRange().
539         * rendering/RenderTextLineBoxes.h: Group absolute*ForRange() declarations.
540
541 2019-12-20  youenn fablet  <youenn@apple.com>
542
543         Remove the certificate info checks related to getUserMedia
544         https://bugs.webkit.org/show_bug.cgi?id=205493
545
546         Reviewed by Eric Carlson.
547
548         Now that navigator.mediaDevices is SecureContext, we do not need to do the same checks in UserMediaController.
549         UserMediaController was also checking the certificate info which is not necessary for MediaDevices.
550         Covered by manual tests.
551
552         * Modules/mediastream/UserMediaController.cpp:
553         (WebCore::isSecure):
554         (WebCore::isAllowedByFeaturePolicy): Deleted.
555         (WebCore::isAllowedToUse): Deleted.
556         (WebCore::UserMediaController::canCallGetUserMedia const): Deleted.
557         (WebCore::UserMediaController::logGetUserMediaDenial): Deleted.
558
559 2019-12-19  Dean Jackson  <dino@apple.com>
560
561         Build ANGLE as a dynamic library
562         https://bugs.webkit.org/show_bug.cgi?id=204708
563         rdar://57349384
564
565         Reviewed by Tim Horton.
566
567         Weak link against libANGLE-shared.dylib rather than strong link to libANGLE.a.
568
569         * Configurations/WebCore.xcconfig:
570         * Configurations/WebCoreTestSupport.xcconfig:
571         * WebCore.xcodeproj/project.pbxproj:
572         * platform/graphics/ANGLEWebKitBridge.cpp:
573         (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
574         (WebCore::ANGLEWebKitBridge::cleanupCompilers):
575         (WebCore::ANGLEWebKitBridge::compileShaderSource):
576         (WebCore::ANGLEWebKitBridge::angleAvailable):
577         * platform/graphics/ANGLEWebKitBridge.h:
578         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
579         (WebCore::GraphicsContext3D::GraphicsContext3D):
580
581 2019-12-20  Antti Koivisto  <antti@apple.com>
582
583         Invalidate only affected elements after media query evaluation changes
584         https://bugs.webkit.org/show_bug.cgi?id=205392
585
586         Reviewed by Zalan Bujtas.
587
588         We currently invalidate style of the whole tree when a media query evaluation changes.
589         We can do better by constructing an invalidation RuleSet and invalidating only those
590         elements that are potentially affected.
591
592         * style/RuleSet.cpp:
593         (WebCore::Style::RuleSet::addRule):
594         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
595
596         Construct and cache an invalidation RuleSet and associate with a set of media query changes.
597
598         (WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
599         (WebCore::Style::RuleSet::MediaQueryCollector::pop):
600         (WebCore::Style::RuleSet::MediaQueryCollector::addRuleIfNeeded):
601
602         Collect RuleFeatures which we later use to build invalidation RuleSet.
603
604         (WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded): Deleted.
605         * style/RuleSet.h:
606         (WebCore::Style::DynamicMediaQueryEvaluationChanges::append):
607         * style/StyleResolver.cpp:
608         (WebCore::Style::Resolver::evaluateDynamicMediaQueries):
609         * style/StyleResolver.h:
610         * style/StyleScope.cpp:
611         (WebCore::Style::Scope::evaluateMediaQueries):
612
613         Use the invalidation RuleSet for accurate style invalidation.
614
615         * style/StyleScopeRuleSets.cpp:
616         (WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):
617
618         Collect invalidation RuleSets for author/user/user agent style.
619
620         * style/StyleScopeRuleSets.h:
621
622 2019-12-20  Diego Pino Garcia  <dpino@igalia.com>
623
624         [GTK][WPE] Wrong visualization of Conic gradients in high resolution displays
625         https://bugs.webkit.org/show_bug.cgi?id=205444
626
627         Reviewed by Carlos Alberto Lopez Perez.
628
629         Reduce the size of the separation between sections since a separation of
630         1 pixel is too wide in high resolution displays.
631
632         * platform/graphics/cairo/GradientCairo.cpp:
633         (WebCore::addConicSector):
634
635 2019-12-20  Zalan Bujtas  <zalan@apple.com>
636
637         Unreviewed, address review comment missed in the initial commit.
638
639         * layout/inlineformatting/InlineLineBreaker.h:
640         * layout/inlineformatting/LineLayoutContext.cpp:
641         (WebCore::Layout::LineLayoutContext::placeInlineContentOnCurrentLine):
642         (WebCore::Layout::LineLayoutContext::commitContent):
643
644 2019-12-20  Zalan Bujtas  <zalan@apple.com>
645
646         [LFC][IFC] Refactor LineLayoutContext class
647         https://bugs.webkit.org/show_bug.cgi?id=205494
648         <rdar://problem/58109493>
649
650         Reviewed by Antti Koivisto.
651
652         This patch is in preparation for being able to pre-scan the inline content for soft wrap opportunities.
653
654         Currently processing the inline content means pushing the inline items to an uncommitted queue until after
655         we find a soft wrap opportunity and then we ask the LineBreaker whether this uncommitted, "continuous content" can be placed
656         on the current line.
657         while (has unprocessed inline item) {
658             get next inline item
659             if (inline item is at a soft wrap opportunity)
660                 sumbit uncommitted queue to line breaking
661             else
662                 add to uncommitted queue
663         }
664         This patch omits the uncommitted queue by collecting the inline items first. This removes some code complexity and it also
665         helps to be able to pre-scan the content for soft wrap opportunities.
666         while (has unprocessed inline item) {
667             get next continuous content
668             submit content to line breaking
669         }
670
671         * layout/inlineformatting/InlineLineBreaker.cpp:
672         (WebCore::Layout::endsWithSoftWrapOpportunity):
673         (WebCore::Layout::LineBreaker::ContinousContent::ContinousContent):
674         * layout/inlineformatting/InlineLineBreaker.h:
675         (WebCore::Layout::LineBreaker::Run::Run):
676         * layout/inlineformatting/LineLayoutContext.cpp:
677         (WebCore::Layout::ContinousContent::hasIntrusiveFloats const):
678         (WebCore::Layout::ContinousContent::runs const):
679         (WebCore::Layout::ContinousContent::floats const):
680         (WebCore::Layout::ContinousContent::endsWithLineBreak const):
681         (WebCore::Layout::ContinousContent::setEndsWithLineBreak):
682         (WebCore::Layout::ContinousContent::append):
683         (WebCore::Layout::LineLayoutContext::layoutLine):
684         (WebCore::Layout::LineLayoutContext::close):
685         (WebCore::Layout::LineLayoutContext::nextContinousContentForLine):
686         (WebCore::Layout::LineLayoutContext::addFloatItems):
687         (WebCore::Layout::LineLayoutContext::placeInlineContentOnCurrentLine):
688         (WebCore::Layout::LineLayoutContext::commitContent):
689         (WebCore::Layout::LineLayoutContext::commitPendingContent): Deleted.
690         (WebCore::Layout::LineLayoutContext::placeInlineItem): Deleted.
691         (WebCore::Layout::LineLayoutContext::processUncommittedContent): Deleted.
692         (WebCore::Layout::LineLayoutContext::UncommittedContent::append): Deleted.
693         (WebCore::Layout::LineLayoutContext::UncommittedContent::reset): Deleted.
694         (WebCore::Layout::LineLayoutContext::UncommittedContent::shrink): Deleted.
695         * layout/inlineformatting/LineLayoutContext.h:
696         (WebCore::Layout::LineLayoutContext::formattingContext const):
697         (WebCore::Layout::LineLayoutContext::root const):
698         (WebCore::Layout::LineLayoutContext::UncommittedContent::width const): Deleted.
699         (WebCore::Layout::LineLayoutContext::UncommittedContent::size): Deleted.
700         (WebCore::Layout::LineLayoutContext::UncommittedContent::isEmpty): Deleted.
701         (WebCore::Layout::LineLayoutContext::UncommittedContent::runs const): Deleted.
702
703 2019-12-20  Rob Buis  <rbuis@igalia.com>
704
705         Fetch: handle emtpy Location value
706         https://bugs.webkit.org/show_bug.cgi?id=205462
707
708         Reviewed by Youenn Fablet.
709
710         Handle empty Location value on redirect as specified here:
711         https://fetch.spec.whatwg.org/#concept-http-redirect-fetch step 3
712
713         Tests: web-platform-tests/fetch/api/redirect/redirect-empty-location.any.html
714                web-platform-tests/fetch/api/redirect/redirect-empty-location.any.worker.html
715
716         * loader/SubresourceLoader.cpp:
717         (WebCore::SubresourceLoader::didReceiveResponse):
718
719 2019-12-20  youenn fablet  <youenn@apple.com>
720
721         DOMPromise::whenPromiseIsSettled is asserting in service worker
722         https://bugs.webkit.org/show_bug.cgi?id=205440
723
724         Reviewed by Chris Dumez.
725
726         The promise.get(@then) is sometimes throwing an exception probably due to service worker being stopped.
727         We need to catch the JS exception and exit early if the getter fails.
728         Covered by existing service worker tests in debug mode.
729
730         * bindings/js/JSDOMPromise.cpp:
731         (WebCore::DOMPromise::whenPromiseIsSettled):
732
733 2019-12-20  youenn fablet  <youenn@apple.com>
734
735         Make ServiceWorker::postMessage use the exec state from the JS binding layer
736         https://bugs.webkit.org/show_bug.cgi?id=205395
737
738         Reviewed by Chris Dumez.
739
740         Instead of using ScriptExecutionContext::execState, we can ask the JS binding layer to pass the exec state and use it.
741         Since ServiceWorker is an ActiveDOMObject, we use its scriptExecutionContext() to compute the ServiceWorker source identifier.
742         We do the same for ServiceWorkerClient which is a context destruction observer and which only lives in Service Worker scope so calling ScriptExecutionContext::execState is suboptimal.
743
744         No change of behavior.
745
746         * workers/service/ServiceWorker.cpp:
747         (WebCore::ServiceWorker::postMessage):
748         * workers/service/ServiceWorker.h:
749         * workers/service/ServiceWorker.idl:
750         * workers/service/ServiceWorkerClient.cpp:
751         (WebCore::ServiceWorkerClient::postMessage):
752         * workers/service/ServiceWorkerClient.h:
753         * workers/service/ServiceWorkerClient.idl:
754
755 2019-12-20  Jiewen Tan  <jiewen_tan@apple.com>
756
757         [WebAuthn] Implement coders for CTAP ClientPIN requests and responses
758         https://bugs.webkit.org/show_bug.cgi?id=205376
759         <rdar://problem/58034395>
760
761         Reviewed by Brent Fulgham.
762
763         This patch implements coders for authenticatorClientPIN requests and responses
764         following the spec:
765         https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN
766
767         Specifically, it
768         i) implements authenticatorClientPIN subCommand: getRetries, getKeyAgreement and getPINToken;
769         ii) adds pinAuth/pinProtocol to authenticatorMakeCredential/authenticatorGetAssertion.
770
771         The authenticatorClientPIN subCommands are based on a Chromium patch:
772         https://chromium-review.googlesource.com/c/chromium/src/+/1457004 Specifically, it adopts the
773         interfaces from that patch, but rewrites the BoringSSL-based crypto features using WebCore's
774         WebCrypto implementation. This allows us to focus on high level crypto interfaces, and lets
775         WebCrypto handle the underlying crypto library. Also, the original Chromium patch lacks tests.
776         We introduce a large set of API tests to confirm proper function.
777
778         This patch also makes the AES CBC, EDCH, and HMAC platform* implementations public, so that
779         these implementations can be shared by WebAuthentication and test infrastructure.
780
781         Covered by API tests.
782
783         * Modules/webauthn/WebAuthenticationConstants.h:
784         * Modules/webauthn/cbor/CBORReader.cpp:
785         (cbor::CBORReader::readCBORMap):
786         Let CBORReader recognize negative map keys.
787         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
788         (fido::encodeMakeCredenitalRequestAsCBOR):
789         (fido::encodeGetAssertionRequestAsCBOR):
790         * Modules/webauthn/fido/DeviceRequestConverter.h:
791         * Modules/webauthn/fido/Pin.cpp: Added.
792         (fido::pin::hasAtLeastFourCodepoints):
793         (fido::pin::makePinAuth):
794         (fido::pin::encodeRawPublicKey):
795         (fido::pin::validateAndConvertToUTF8):
796         (fido::pin::encodePinCommand):
797         (fido::pin::RetriesResponse::parse):
798         (fido::pin::KeyAgreementResponse::KeyAgreementResponse):
799         (fido::pin::KeyAgreementResponse::parse):
800         (fido::pin::KeyAgreementResponse::parseFromCOSE):
801         (fido::pin::encodeCOSEPublicKey):
802         (fido::pin::TokenResponse::TokenResponse):
803         (fido::pin::TokenResponse::parse):
804         (fido::pin::TokenResponse::pinAuth const):
805         (fido::pin::TokenResponse::token const):
806         (fido::pin::encodeAsCBOR):
807         (fido::pin::TokenRequest::tryCreate):
808         (fido::pin::TokenRequest::TokenRequest):
809         (fido::pin::TokenRequest::sharedKey const):
810         * Modules/webauthn/fido/Pin.h: Added.
811         * Sources.txt:
812         * WebCore.xcodeproj/project.pbxproj:
813         * crypto/CryptoAlgorithm.h:
814         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
815         * crypto/algorithms/CryptoAlgorithmECDH.h:
816         * crypto/algorithms/CryptoAlgorithmHMAC.h:
817         * crypto/keys/CryptoKeyAES.cpp:
818         * crypto/keys/CryptoKeyAES.h:
819         * crypto/keys/CryptoKeyEC.h:
820         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
821         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
822         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
823         * crypto/mac/CryptoKeyRSAMac.cpp:
824         (WebCore::CryptoKeyRSA::algorithm const):
825
826 2019-12-19  Doug Kelly  <dougk@apple.com>
827
828         Update TrackBase to store m_mediaElement as a WeakPtr
829         https://bugs.webkit.org/show_bug.cgi?id=205460
830
831         Reviewed by Eric Carlson.
832
833         Store the HTMLMediaElement in TrackBase and related classes as a WeakPtr to give some proper idea of pointer lifetime, since while the
834         HTMLMediaElement is optional, if set, it should be a valid HTMLMediaElement.
835
836         No new tests since no functionality changed.
837
838         * Modules/mediasource/SourceBuffer.cpp:
839         (WebCore::SourceBuffer::videoTracks):
840         (WebCore::SourceBuffer::audioTracks):
841         (WebCore::SourceBuffer::textTracks):
842         * html/HTMLMediaElement.cpp:
843         (WebCore::HTMLMediaElement::textTrackModeChanged):
844         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
845         (WebCore::HTMLMediaElement::ensureAudioTracks):
846         (WebCore::HTMLMediaElement::ensureTextTracks):
847         (WebCore::HTMLMediaElement::ensureVideoTracks):
848         * html/track/AudioTrack.cpp:
849         (WebCore::AudioTrack::willRemove):
850         (WebCore::AudioTrack::setMediaElement):
851         * html/track/AudioTrack.h:
852         * html/track/AudioTrackList.cpp:
853         (WebCore::AudioTrackList::AudioTrackList):
854         * html/track/AudioTrackList.h:
855         * html/track/InbandTextTrack.cpp:
856         (WebCore::InbandTextTrack::willRemove):
857         (WebCore::InbandTextTrack::setMediaElement):
858         * html/track/InbandTextTrack.h:
859         * html/track/TextTrackList.cpp:
860         (WebCore::TextTrackList::TextTrackList):
861         * html/track/TextTrackList.h:
862         * html/track/TrackBase.cpp:
863         (WebCore::TrackBase::element):
864         (WebCore::TrackBase::setMediaElement):
865         * html/track/TrackBase.h:
866         (WebCore::TrackBase::mediaElement):
867         * html/track/TrackListBase.cpp:
868         (WebCore::TrackListBase::TrackListBase):
869         (WebCore::TrackListBase::element const):
870         * html/track/TrackListBase.h:
871         (WebCore::TrackListBase::mediaElement const):
872         * html/track/VideoTrack.cpp:
873         (WebCore::VideoTrack::willRemove):
874         (WebCore::VideoTrack::setMediaElement):
875         * html/track/VideoTrack.h:
876         * html/track/VideoTrackList.cpp:
877         (WebCore::VideoTrackList::VideoTrackList):
878         * html/track/VideoTrackList.h:
879
880 2019-12-19  Doug Kelly  <dougk@apple.com>
881
882         Invalid assert with tracks not associated to media element
883         https://bugs.webkit.org/show_bug.cgi?id=205360
884
885         Reviewed by Eric Carlson.
886
887         Remove asserts around TextTrack when not attached to a media element and instead return a zero index.
888
889         * html/track/TextTrack.cpp:
890         (WebCore::TextTrack::trackIndex):
891         (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
892
893 2019-12-19  Sihui Liu  <sihui_liu@apple.com>
894
895         IndexedDB: remove timer for pending operations in IDBTransaction
896         https://bugs.webkit.org/show_bug.cgi?id=205312
897
898         Reviewed by Brady Eidson.
899
900         When pendingOperationTimer fired, IDBTransasction would try processing pending operations or commiting 
901         automatically.
902         pendingOperationTimer was scheduled when some conditions changed and IDBTransaction could start processing 
903         pending operations or start commiting, for example, when new pending operations was created.
904
905         For better performance, we may start processing right away after the condition change, without using a Timer.
906         This patch gives us about 10% speed up on test: PerformanceTests/IndexedDB/basic/objectstore-cursor.html.
907
908         * Modules/indexeddb/IDBRequest.cpp:
909         (WebCore::IDBRequest::dispatchEvent):
910         * Modules/indexeddb/IDBTransaction.cpp:
911         (WebCore::IDBTransaction::IDBTransaction):
912         (WebCore::IDBTransaction::abortInProgressOperations):
913         (WebCore::IDBTransaction::removeRequest):
914         (WebCore::IDBTransaction::scheduleOperation):
915         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
916         (WebCore::IDBTransaction::didStart):
917         (WebCore::IDBTransaction::operationCompletedOnClient):
918         (WebCore::IDBTransaction::deactivate):
919         (WebCore::IDBTransaction::connectionClosedFromServer):
920         (WebCore::IDBTransaction::handlePendingOperations):
921         (WebCore::IDBTransaction::autoCommit):
922         (WebCore::IDBTransaction::trySchedulePendingOperationTimer): Deleted.
923         (WebCore::IDBTransaction::pendingOperationTimerFired): Deleted.
924         * Modules/indexeddb/IDBTransaction.h:
925
926 2019-12-19  Jack Lee  <shihchieh_lee@apple.com>
927
928         Nullptr crash in WebCore::RenderTreeBuilder::attach
929         https://bugs.webkit.org/show_bug.cgi?id=205476
930
931         Reviewed by Ryosuke Niwa.
932
933         Test: fast/ruby/crash-insert-duplicate-rt-element.html
934
935         * rendering/updating/RenderTreeBuilderRuby.cpp:
936         (WebCore::RenderTreeBuilder::Ruby::attach):
937
938 2019-12-19  Jack Lee  <shihchieh_lee@apple.com>
939
940         Nullptr crash in WebCore::findPlaceForCounter with display: contents parent
941         https://bugs.webkit.org/show_bug.cgi?id=205290
942
943         Reviewed by Ryosuke Niwa.
944
945         Test: fast/css/counters/findPlaceForCounter-crash.html
946
947         * rendering/RenderCounter.cpp:
948         (WebCore::parentOrPseudoHostElement):
949
950 2019-12-19  Chris Dumez  <cdumez@apple.com>
951
952         REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flaky failure
953         https://bugs.webkit.org/show_bug.cgi?id=205164
954         <rdar://problem/57879042>
955
956         Reviewed by Ryosuke Niwa.
957
958         Submitting a form should cancel any pending navigation scheduled by a previous submission of this form:
959         - https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm (step 22.3)
960
961         No new tests, rebaselined existing tests.
962
963         Test: fast/forms/form-double-submission.html
964
965         * html/HTMLFormElement.cpp:
966         (WebCore::HTMLFormElement::submit):
967         * html/HTMLFormElement.h:
968         * loader/FormSubmission.h:
969         (WebCore::FormSubmission::cancel):
970         (WebCore::FormSubmission::wasCancelled const):
971
972         * loader/FrameLoader.cpp:
973         (WebCore::FrameLoader::submitForm):
974         Drop previous non-standard compliant logic to avoid double-form submission.
975
976         * loader/NavigationScheduler.cpp:
977
978 2019-12-19  Ryosuke Niwa  <rniwa@webkit.org>
979
980         Make ShadowRoot.delegateFocus work in iOS
981         https://bugs.webkit.org/show_bug.cgi?id=202875
982
983         Reviewed by Wenson Hsieh.
984
985         This patch fixes the bug that a shadow tree doesn't recieve focus delegation even if the shadow host
986         had delegateFocus flag set unless the shadow host itself is focusable beacuse Frame's
987         nodeRespondingToClickEvents and friends would return false on the shadow host.
988
989         Test: fast/shadow-dom/delegates-focus-by-activation.html
990
991         * page/ios/FrameIOS.mm:
992         (WebCore::nodeIsMouseFocusable): Added the logic to handle shadow hosts whose shadow root has
993         delegates focus flag set.
994         (WebCore::nodeWillRespondToMouseEvents): Extracted out of approximateNodeAtViewportLocationLegacy.
995         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
996         (WebCore::ancestorRespondingToClickEventsNodeQualifier):
997
998 2019-12-19  Kate Cheney  <katherine_cheney@apple.com>
999
1000         Activate the SQLite database as an on-by-default feature
1001         https://bugs.webkit.org/show_bug.cgi?id=204774
1002         <rdar://problem/57592141>
1003
1004         Reviewed by Brent Fulgham.
1005
1006         The ITP SQLite database should be on by default.
1007
1008         * page/RuntimeEnabledFeatures.h:
1009
1010 2019-12-19  Per Arne Vollan  <pvollan@apple.com>
1011
1012         REGRESSION (r253530): Incorrect colors in Dark Mode
1013         https://bugs.webkit.org/show_bug.cgi?id=205457
1014
1015         Unreviewed rollout of r253530.
1016
1017         * WebCore.xcodeproj/project.pbxproj:
1018         * rendering/CSSValueKey.h: Removed.
1019         * rendering/RenderThemeIOS.h:
1020         * rendering/RenderThemeIOS.mm:
1021         (WebCore::RenderThemeIOS::systemColor const):
1022         (WebCore::cssValueIDSelectorList): Deleted.
1023         (WebCore::systemColorFromCSSValueID): Deleted.
1024         (WebCore::globalCSSValueToSystemColorMap): Deleted.
1025         (WebCore::RenderThemeIOS::getOrCreateCSSValueToSystemColorMap): Deleted.
1026         (WebCore::RenderThemeIOS::setCSSValueToSystemColorMap): Deleted.
1027
1028 2019-12-19  James Darpinian  <jdarpinian@chromium.org>
1029
1030         ANGLE: Fix last WebGL conformance regressions
1031         https://bugs.webkit.org/show_bug.cgi?id=205306
1032
1033         Fixes the last few WebGL conformance regressions when enabling ANGLE on AMD GPUs on Mac.
1034         The combination of alpha:false and antialias:true was broken, and validation of
1035         non-ascii characters in comments was broken by a recent change to the test.
1036
1037         Reviewed by Dean Jackson.
1038
1039         * html/canvas/WebGLRenderingContextBase.cpp:
1040         (WebCore::WebGLRenderingContextBase::shaderSource):
1041         * platform/graphics/angle/GraphicsContext3DANGLE.cpp:
1042         (WebCore::GraphicsContext3D::reshapeFBOs):
1043
1044 2019-12-19  Alan Bujtas  <zalan@apple.com>
1045
1046         Unreviewed, rolling out r253711.
1047
1048         Broke two tests on Mac and iOS
1049
1050         Reverted changeset:
1051
1052         "[LFC][IFC] LineLayoutContext::m_uncommittedList is not always
1053         a continuous list of runs"
1054         https://bugs.webkit.org/show_bug.cgi?id=205404
1055         https://trac.webkit.org/changeset/253711
1056
1057 2019-12-19  Andres Gonzalez  <andresg_22@apple.com>
1058
1059         AXIsolatedObject::findMatchingObjects implementation.
1060         https://bugs.webkit.org/show_bug.cgi?id=205428
1061
1062         Reviewed by Chris Fleizach.
1063
1064         This method is exercised by several layout tests such as
1065         accessibility/mac/search-predicate.html.
1066
1067         - Moved the search algorithm in the implementation of
1068         AccessibilityObject::findMatchingObjects to the Accessibility namespace,
1069         so that it can be used in AXIsolatedObject as well.
1070         - Static helper functions are also moved into the Accessibility
1071         namespace.
1072         - Changed the signature of containsText to be more appropriate and in
1073         line with other methods.
1074
1075         * accessibility/AccessibilityObject.cpp:
1076         (WebCore::AccessibilityObject::containsText const):
1077         (WebCore::AccessibilityObject::findMatchingObjects):
1078         (WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex): Moved from AccessibilityObject.
1079         (WebCore::Accessibility::isAccessibilityObjectSearchMatch): Moved from AccessibilityObject.
1080         (WebCore::Accessibility::isAccessibilityTextSearchMatch): Moved from AccessibilityObject.
1081         (WebCore::Accessibility::objectMatchesSearchCriteriaWithResultLimit): Moved from AccessibilityObject.
1082         (WebCore::Accessibility::findMatchingObjects): Search algorithm to be reused by AccessibilityObject and AXIsolatedObject.
1083         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex): Moved.
1084         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatch): Moved.
1085         (WebCore::AccessibilityObject::isAccessibilityTextSearchMatch): Moved.
1086         (WebCore::AccessibilityObject::objectMatchesSearchCriteriaWithResultLimit): Moved.
1087         * accessibility/AccessibilityObject.h:
1088         * accessibility/AccessibilityObjectInterface.h:
1089         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
1090         (WebCore::AXIsolatedObject::findMatchingObjects):
1091         (WebCore::AXIsolatedObject::containsText const):
1092         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
1093
1094 2019-12-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1095
1096         pal/FileSizeFormatter.h declares fileSizeDescription in the top-level namespace
1097         https://bugs.webkit.org/show_bug.cgi?id=205453
1098
1099         Reviewed by Tim Horton.
1100
1101         Change fileSizeDescription to PAL::fileSizeDescription. No change in behavior.
1102
1103         * html/HTMLAttachmentElement.cpp:
1104         (WebCore::HTMLAttachmentElement::setFile):
1105         (WebCore::HTMLAttachmentElement::updateAttributes):
1106
1107 2019-12-19  Chris Dumez  <cdumez@apple.com>
1108
1109         imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-installed.https.html is flaky
1110         https://bugs.webkit.org/show_bug.cgi?id=205408
1111
1112         Reviewed by Youenn Fablet.
1113
1114         imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-installed.https.html has been
1115         flaky since it was imported. We now queue a task on the HTML event loop to resolve the skipWaiting promise
1116         so that its ordering is correct, between the active event being fired and the service worker state becoming
1117         "activated".
1118
1119         No new tests, upskipped existing test.
1120
1121         * workers/service/ServiceWorkerGlobalScope.cpp:
1122         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
1123         * workers/service/context/SWContextManager.h:
1124         * workers/service/server/SWServerToContextConnection.cpp:
1125         (WebCore::SWServerToContextConnection::skipWaiting):
1126         * workers/service/server/SWServerToContextConnection.h:
1127
1128 2019-12-19  Chris Dumez  <cdumez@apple.com>
1129
1130         Stop blocking the worker thread in WorkerMessagePortChannelProvider::postMessageToRemote()
1131         https://bugs.webkit.org/show_bug.cgi?id=205414
1132
1133         Reviewed by Youenn Fablet.
1134
1135         Stop blocking the worker thread in WorkerMessagePortChannelProvider::postMessageToRemote() as it does not appear
1136         to be needed and it badly impacts performance. This basically replaces a callOnMainThreadAndWait
1137         call (which was added in r249378 as part of a refactoring) with a callOnMainThread call.
1138
1139         This makes fast/workers/worker-cloneport.html runs twice as fast on my machine, which is important
1140         because this test is so slow it is timing out in some configurations.
1141
1142         * dom/MessagePort.cpp:
1143         (WebCore::MessagePort::postMessage):
1144         * dom/messageports/MessagePortChannelProvider.h:
1145         * dom/messageports/MessagePortChannelProviderImpl.cpp:
1146         (WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
1147         * dom/messageports/MessagePortChannelProviderImpl.h:
1148         * dom/messageports/WorkerMessagePortChannelProvider.cpp:
1149         (WebCore::WorkerMessagePortChannelProvider::postMessageToRemote):
1150         * dom/messageports/WorkerMessagePortChannelProvider.h:
1151
1152 2019-12-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1153
1154         REGRESSION (r251015): Hitting return before a space deletes text after the insertion position
1155         https://bugs.webkit.org/show_bug.cgi?id=205425
1156         <rdar://problem/57575960>
1157
1158         Reviewed by Tim Horton.
1159
1160         After r251015, we (rightfully) no longer call ensureLineBoxes() when computing upstream or downstream positions.
1161         However, logic in deleteInsignificantTextDownstream (which is invoked after hitting return before a space in a
1162         text node) assumes that line boxes must be generated for the RenderText of the text node containing the
1163         downstream position. The lack of inline text boxes then causes deleteInsignificantText to always remove the
1164         entire text node.
1165
1166         To fix this, have deleteInsignificantText ensure that line boxes exist for the text node's renderer, right
1167         before asking for the renderer's line boxes.
1168
1169         Test: editing/inserting/insert-paragraph-before-space.html
1170
1171         * editing/CompositeEditCommand.cpp:
1172         (WebCore::CompositeEditCommand::deleteInsignificantText):
1173
1174 2019-12-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1175
1176         [GTK][WPE] Add initial API for input method
1177         https://bugs.webkit.org/show_bug.cgi?id=204679
1178
1179         Reviewed by Žan Doberšek.
1180
1181         * platform/PlatformKeyboardEvent.h: Also define handledByInputMethod() for WPE port.
1182
1183 2019-12-19  Charlie Turner  <cturner@igalia.com>
1184
1185         [GStreamer][EME] Notify all elements waiting for CDM attachment
1186         https://bugs.webkit.org/show_bug.cgi?id=205382
1187
1188         Reviewed by Xabier Rodriguez-Calvar.
1189
1190         When multiple demuxers are in flight asking for a CDM instance,
1191         only one of them was getting woken up when a CDM was attached,
1192         leaving the other(s) blocking their respective streaming threads
1193         and locking the pipeline. Switch back to a condition variable from
1194         a semaphore to fix this issue.
1195
1196         Covered by existing tests.
1197
1198         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1199         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1200         Initialize the new isPlayerShuttingDown predicate to false.
1201         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
1202         Set the new predicate for player shutdown at the start of
1203         destruction, so that background threads can known when the should
1204         abort their operations as a result of being unblocked by the
1205         destructor.
1206         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Go back
1207         to using condition variables, so we can unblock more than one
1208         waiter.
1209         (WebCore::MediaPlayerPrivateGStreamer::cdmInstanceAttached):
1210         Helper predicate to make clear that the presence of a valid
1211         CDMInstance pointer is a sign that it has been attached.
1212         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
1213         an isPlayerShuttingDown method using an Atomic<bool>. We need this
1214         to avoid racing set_context() on a decryptor element with the
1215         pipeline being set to NULL. Before we were using the notifier as a
1216         proxy for player shutdown, since it is invalidated during player
1217         destruction. This is not a maintainable solution, since other
1218         programmers would feel free to reorder the position at which the
1219         notifier is invalidated, and then introduce a very hard to find
1220         bug. By introducing this flag at the start of destruction, we will
1221         always have a known way to check, after a streaming thread has
1222         woken up again, whether we should call any player methods, or
1223         return early due to shutdown in progress.
1224         (WebCore::MediaPlayerPrivateGStreamer::isPlayerShuttingDown
1225         const): Predicate for player in the process of shutdown. This
1226         should be used by background threads, which upon wakeup, may need
1227         to be aware of whether they will be in a race with the pipeline
1228         going to NULL.
1229         (WebCore::MediaPlayerPrivateGStreamer::isCDMAttached const):
1230
1231 2019-12-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1232
1233         [CoordinatedGraphics] ThreadedDisplayRefreshMonitor is never released
1234         https://bugs.webkit.org/show_bug.cgi?id=205387
1235
1236         Reviewed by Žan Doberšek.
1237
1238         The problem is that DisplayRefreshMonitorManager::createMonitorForClient() always creates a new one for
1239         RenderingUpdateScheduler because it's not notified of the window screen change. So,
1240         createDisplayRefreshMonitor() is called every time, which returns a reference of the same object, but it's added
1241         to the monitors vector of DisplayRefreshMonitorManager and never removed from there.
1242
1243         * page/Chrome.cpp:
1244         (WebCore::Chrome::windowScreenDidChange): Notify the RenderingUpdateScheduler about the screen change.
1245         * page/RenderingUpdateScheduler.h: Make windowScreenDidChange public.
1246
1247 2019-12-19  youenn fablet  <youenn@apple.com>
1248
1249         Safari resumes autoplay audio elements after getUserMedia
1250         https://bugs.webkit.org/show_bug.cgi?id=197688
1251         <rdar://problem/57674395>
1252
1253         Reviewed by Eric Carlson.
1254
1255         Covered by updated test.
1256
1257         * html/HTMLMediaElement.cpp:
1258         (WebCore::HTMLMediaElement::mediaStreamCaptureStarted):
1259         Previously, we were piggybacking on resuming autoplay, which happens after interuption.
1260         This is incorrect as it tries to play paused elements.
1261         Instead we just try to play a media element if it can autoplay without changing the m_autoplaying value.
1262         * html/HTMLMediaElement.h:
1263         (WebCore::HTMLMediaElement::mediaStreamCaptureStarted): Deleted.
1264
1265 2019-12-18  Sihui Liu  <sihui_liu@apple.com>
1266
1267         IndexedDB: perform IDBServer work only on background thread
1268         https://bugs.webkit.org/show_bug.cgi?id=203690
1269         <rdar://problem/56908496>
1270
1271         Reviewed by Alex Christensen.
1272
1273         The basic workflow of IDB server side was:
1274         1. IPC thread dispatches IDB messages to main thread
1275         2. main thread handles messages and dispatches database tasks to IDB thread
1276         3. IDB thread finishes work and dispatches task result to main thread
1277         4. main thread sends IPC messages with task results
1278
1279         For better performance, this patch changes the workflow to:
1280         1. IPC thread dispatches IDB messages to IDB thread
1281         2. IDB thread handles messages, perform tasks and sends IPC messages with task results
1282         In this way, we can avoid the cost of thread hopping to main thread.
1283
1284         Previously IDBServer and UniqueIDBDatabase were created on the main thread and may be accessed from IDB 
1285         thread, and now they are created on the IDB thread only. Therefore, we don't need all those variables
1286         used to sync the database status between main thread and background thread, and the logic becomes simpler.
1287
1288         This patch also removes timer in UniqueIDBDatabase for better performance.
1289
1290         Covered by existing tests.
1291
1292         * Modules/indexeddb/IDBDatabase.cpp:
1293         (WebCore::IDBDatabase::didCloseFromServer): IDBClient no longer needs to confirm connection close initiated by
1294         IDBServer. When IDBServer closes the connection, it would remove the connection from the open connection set 
1295         right away.
1296         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1297         (WebCore::IDBClient::IDBConnectionProxy::didCloseFromServer): 
1298         (WebCore::IDBClient::IDBConnectionProxy::confirmDidCloseFromServer): Deleted.
1299         * Modules/indexeddb/client/IDBConnectionProxy.h:
1300         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1301         (WebCore::IDBClient::IDBConnectionToServer::confirmDidCloseFromServer): Deleted.
1302         * Modules/indexeddb/client/IDBConnectionToServer.h:
1303         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1304         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1305         (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
1306         * Modules/indexeddb/server/IDBConnectionToClient.h:
1307         (WebCore::IDBServer::IDBConnectionToClient::clearDelegate):
1308         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
1309
1310         * Modules/indexeddb/server/IDBServer.cpp: Add threading assertions everywhere for safety. Also, as IDBServer
1311         may be accessed on main thread for process suspension, we need to assert lock of IDBServer is held everywhere.
1312         (WebCore::IDBServer::IDBServer::IDBServer):
1313         (WebCore::IDBServer::IDBServer::~IDBServer):
1314         (WebCore::IDBServer::IDBServer::registerConnection):
1315         (WebCore::IDBServer::IDBServer::unregisterConnection):
1316         (WebCore::IDBServer::IDBServer::registerTransaction):
1317         (WebCore::IDBServer::IDBServer::unregisterTransaction):
1318         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
1319         (WebCore::IDBServer::IDBServer::openDatabase):
1320         (WebCore::IDBServer::IDBServer::deleteDatabase):
1321         (WebCore::IDBServer::IDBServer::abortTransaction):
1322         (WebCore::IDBServer::IDBServer::createObjectStore):
1323         (WebCore::IDBServer::IDBServer::deleteObjectStore):
1324         (WebCore::IDBServer::IDBServer::renameObjectStore):
1325         (WebCore::IDBServer::IDBServer::clearObjectStore):
1326         (WebCore::IDBServer::IDBServer::createIndex):
1327         (WebCore::IDBServer::IDBServer::deleteIndex):
1328         (WebCore::IDBServer::IDBServer::renameIndex):
1329         (WebCore::IDBServer::IDBServer::putOrAdd):
1330         (WebCore::IDBServer::IDBServer::getRecord):
1331         (WebCore::IDBServer::IDBServer::getAllRecords):
1332         (WebCore::IDBServer::IDBServer::getCount):
1333         (WebCore::IDBServer::IDBServer::deleteRecord):
1334         (WebCore::IDBServer::IDBServer::openCursor):
1335         (WebCore::IDBServer::IDBServer::iterateCursor):
1336         (WebCore::IDBServer::IDBServer::establishTransaction):
1337         (WebCore::IDBServer::IDBServer::commitTransaction):
1338         (WebCore::IDBServer::IDBServer::didFinishHandlingVersionChangeTransaction):
1339         (WebCore::IDBServer::IDBServer::databaseConnectionPendingClose):
1340         (WebCore::IDBServer::IDBServer::databaseConnectionClosed):
1341         (WebCore::IDBServer::IDBServer::abortOpenAndUpgradeNeeded):
1342         (WebCore::IDBServer::IDBServer::didFireVersionChangeEvent):
1343         (WebCore::IDBServer::IDBServer::openDBRequestCancelled):
1344         (WebCore::IDBServer::IDBServer::getAllDatabaseNames):
1345         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
1346         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
1347         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
1348         (WebCore::IDBServer::IDBServer::requestSpace):
1349         (WebCore::IDBServer::IDBServer::stopDatabaseActivitiesOnMainThread):
1350         (WebCore::IDBServer::IDBServer::create): Deleted.
1351         (WebCore::IDBServer::IDBServer::confirmDidCloseFromServer): Deleted.
1352         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames): Deleted.
1353         (WebCore::IDBServer::IDBServer::didGetAllDatabaseNames): Deleted.
1354         (WebCore::IDBServer::IDBServer::postDatabaseTask): Deleted. IDBServer is on the background thread only. This 
1355         functionality is moved to its parent (WebIDBServer/InProcessIDBServer).
1356         (WebCore::IDBServer::IDBServer::postDatabaseTaskReply): Deleted.
1357         (WebCore::IDBServer::generateDeleteCallbackID): Deleted.
1358         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince): Deleted. Merged to 
1359         closeAndDeleteDatabasesModifiedSince.
1360         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins): Deleted. Merged to 
1361         closeAndDeleteDatabasesForOrigins.
1362         (WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases): Deleted.
1363         (WebCore::IDBServer::IDBServer::tryStop): Deleted.
1364         (WebCore::IDBServer::IDBServer::resume): Deleted.
1365         * Modules/indexeddb/server/IDBServer.h:
1366         (WebCore::IDBServer::IDBServer::lock):
1367
1368         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Biggest changes are:
1369         1. merge all perform[Task] and didPerform[Task] functions into [Task] functions.
1370         2. remove all database members used to track state between main thread and database thread, because the tasks
1371         are executed in order on one background thread.
1372         3. m_operationAndTransactionTimer is removed. operationAndTransactionTimerFired is replaced by two functions:
1373         handleDatabaseOperations and handleTransactions. And these functions are placed at places where we schedule the 
1374         timer.
1375         4. lock is moved to IDBServer because UniqueIDBDatabase will never be accessed from different threads.
1376         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1377         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
1378         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
1379         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1380         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1381         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
1382         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1383         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
1384         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
1385         (WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
1386         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
1387         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
1388         (WebCore::IDBServer::UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent):
1389         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
1390         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
1391         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
1392         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
1393         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
1394         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
1395         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
1396         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
1397         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
1398         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
1399         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
1400         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
1401         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
1402         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
1403         (WebCore::IDBServer::UniqueIDBDatabase::prefetchCursor):
1404         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1405         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
1406         (WebCore::IDBServer::UniqueIDBDatabase::didFinishHandlingVersionChange):
1407         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
1408         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromServer):
1409         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
1410         (WebCore::IDBServer::UniqueIDBDatabase::handleTransactions):
1411         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
1412         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
1413         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
1414         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1415         (WebCore::IDBServer::UniqueIDBDatabase::abortActiveTransactions):
1416         (WebCore::IDBServer::UniqueIDBDatabase::close):
1417         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableRequest):
1418         (WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks const): Deleted.
1419         (WebCore::IDBServer::UniqueIDBDatabase::isVersionChangeInProgress): Deleted.
1420         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore): Deleted.
1421         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose): Deleted.
1422         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose): Deleted.
1423         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose): Deleted.
1424         (WebCore::IDBServer::UniqueIDBDatabase::generateUniqueCallbackIdentifier): Deleted.
1425         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError): Deleted.
1426         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction): Deleted.
1427         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction): Deleted.
1428         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore): Deleted.
1429         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore): Deleted.
1430         (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore): Deleted.
1431         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateObjectStore): Deleted.
1432         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore): Deleted.
1433         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteObjectStore): Deleted.
1434         (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore): Deleted.
1435         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore): Deleted.
1436         (WebCore::IDBServer::UniqueIDBDatabase::performClearObjectStore): Deleted.
1437         (WebCore::IDBServer::UniqueIDBDatabase::didPerformClearObjectStore): Deleted.
1438         (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex): Deleted.
1439         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateIndex): Deleted.
1440         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex): Deleted.
1441         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex): Deleted.
1442         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex): Deleted.
1443         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex): Deleted.
1444         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Deleted.
1445         (WebCore::IDBServer::UniqueIDBDatabase::didPerformPutOrAdd): Deleted.
1446         (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord): Deleted.
1447         (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord): Deleted.
1448         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetRecord): Deleted.
1449         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords): Deleted.
1450         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetAllRecords): Deleted.
1451         (WebCore::IDBServer::UniqueIDBDatabase::performGetCount): Deleted.
1452         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetCount): Deleted.
1453         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteRecord): Deleted.
1454         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteRecord): Deleted.
1455         (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor): Deleted.
1456         (WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor): Deleted.
1457         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor): Deleted.
1458         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor): Deleted.
1459         (WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor): Deleted.
1460         (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction): Deleted.
1461         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction): Deleted.
1462         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction): Deleted.
1463         (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction): Deleted.
1464         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction): Deleted.
1465         (WebCore::IDBServer::UniqueIDBDatabase::transactionDestroyed): Deleted.
1466         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer): Deleted.
1467         (WebCore::IDBServer::UniqueIDBDatabase::isCurrentlyInUse const): Deleted.
1468         (WebCore::IDBServer::UniqueIDBDatabase::hasUnfinishedTransactions const): Deleted.
1469         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer): Deleted.
1470         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired): Deleted.
1471         (WebCore::IDBServer::UniqueIDBDatabase::performActivateTransactionInBackingStore): Deleted.
1472         (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore): Deleted.
1473         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask): Deleted.
1474         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply): Deleted.
1475         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask): Deleted.
1476         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply): Deleted.
1477         (WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose): Deleted.
1478         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose): Deleted.
1479         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback): Deleted.
1480         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback): Deleted.
1481         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback): Deleted.
1482         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback): Deleted.
1483         (WebCore::IDBServer::UniqueIDBDatabase::performCountCallback): Deleted.
1484         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback): Deleted.
1485         (WebCore::IDBServer::UniqueIDBDatabase::abortTransactionOnMainThread): Deleted.
1486         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionOnMainThread): Deleted.
1487         (WebCore::IDBServer::UniqueIDBDatabase::suspend): Deleted.
1488         (WebCore::IDBServer::UniqueIDBDatabase::resume): Deleted.
1489         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1490         (WebCore::IDBServer::UniqueIDBDatabase::server):
1491         (WebCore::IDBServer::UniqueIDBDatabase::hardClosedForUserDelete const): Deleted.
1492         (): Deleted.
1493
1494         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: The callbacks will be called right away, so there
1495         is no need to keep weak pointers.
1496         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
1497         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
1498         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
1499         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
1500         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
1501         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
1502         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
1503         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
1504         (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer): Deleted.
1505         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
1506         (WebCore::IDBServer::UniqueIDBDatabaseConnection::database):
1507         (WebCore::IDBServer::UniqueIDBDatabaseConnection::server):
1508         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1509         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
1510         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
1511         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
1512         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
1513         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
1514         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
1515         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
1516         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
1517         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
1518         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
1519         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
1520         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
1521         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
1522         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
1523         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
1524         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
1525         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
1526         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
1527         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1528         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::databaseConnection):
1529         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setMainThreadAbortResult):
1530         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::mainThreadAbortResult const):
1531         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setState): Deleted.
1532         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::state const): Deleted.
1533         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setResult): Deleted.
1534         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::result const): Deleted.
1535         (): Deleted.
1536         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1537         (WebCore::nextServerResourceNumber):
1538         * loader/EmptyClients.cpp:
1539
1540 2019-12-18  Devin Rousso  <drousso@apple.com>
1541
1542         Web Inspector: Elements: restrict showing paint flashing and compositing borders to the Web Inspector session
1543         https://bugs.webkit.org/show_bug.cgi?id=205201
1544
1545         Reviewed by Timothy Hatcher.
1546
1547         We often get bugs from users who turn on paint flashing or compositing borders, close Web
1548         Inspector, reopen Web Inspector, and are then surprised when the page flashes red or these
1549         borders exist all over the page.
1550
1551         Given that the dark mode and print styles toggles are limited to the Web Inspector session,
1552         we should make these have the same behavior.
1553
1554         * page/Settings.yaml:
1555         * inspector/agents/InspectorPageAgent.h:
1556         * inspector/agents/InspectorPageAgent.cpp:
1557         (WebCore::InspectorPageAgent::getCompositingBordersVisible): Deleted.
1558         (WebCore::InspectorPageAgent::setCompositingBordersVisible): Deleted.
1559         Allow Web Inspector to override the `showDebugBorders` and `showRepaintCounter` settings via
1560         the `inspectorOverride` key, rather than setting them manually via a special `Page` command.
1561
1562 2019-12-18  Tim Horton  <timothy_horton@apple.com>
1563
1564         macCatalyst: Cursor should update when the platform deems it necessary
1565         https://bugs.webkit.org/show_bug.cgi?id=205429
1566         <rdar://problem/57983076>
1567
1568         Reviewed by Wenson Hsieh.
1569
1570         * page/EventHandler.h:
1571         Expose selectCursor for WebKit's use.
1572
1573 2019-12-18  Antoine Quint  <graouts@apple.com>
1574
1575         Animations stop if new tab opened (and closed)
1576         https://bugs.webkit.org/show_bug.cgi?id=202360
1577         <rdar://problem/55923261>
1578
1579         Reviewed by Dean Jackson.
1580
1581         In the case where we would have a fill-forwards software animation when an animation that could be
1582         accelerated started, we would fail to start an accelerated animation because we had no composited
1583         renderer. However, we would still advertise a state of "running accelerated" and the DocumentTimeline
1584         would not schedule ticks to run the animation in software.
1585
1586         We now only schedule accelerated animations once their delay phase is over and the animation is in its
1587         "active" phase, which helps to only schedule accelerated animations once they actually have an effect
1588         that is worth accelerating, and reset pending accelerated actions in case we try to start an accelerated
1589         animation but fail to because we don't have a composited renderer.
1590
1591         Test: webanimations/animation-of-accelerated-property-after-non-accelerated-property.html
1592
1593         * animation/KeyframeEffect.cpp:
1594         (WebCore::KeyframeEffect::apply):
1595         (WebCore::KeyframeEffect::updateAcceleratedAnimationState):
1596         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1597         * animation/KeyframeEffect.h:
1598
1599 2019-12-18  Eric Carlson  <eric.carlson@apple.com>
1600
1601         Remove more unused MediaPlayer methods
1602         https://bugs.webkit.org/show_bug.cgi?id=205405
1603         <rdar://problem/58049744>
1604
1605         Reviewed by Jer Noble.
1606
1607         No new tests, this just removes unused code.
1608
1609         * html/HTMLMediaElement.cpp:
1610         (WebCore::HTMLMediaElement::mediaPlayerIsInMediaDocument const): Deleted.
1611         * html/HTMLMediaElement.h:
1612         * platform/graphics/MediaPlayer.cpp:
1613         (WebCore::MediaPlayer::inMediaDocument const): Deleted.
1614         (WebCore::MediaPlayer::handlePlaybackCommand): Deleted.
1615         * platform/graphics/MediaPlayer.h:
1616         (WebCore::MediaPlayerClient::mediaPlayerPlatformVolumeConfigurationRequired const):
1617         (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand): Deleted.
1618         (WebCore::MediaPlayerClient::mediaPlayerIsInMediaDocument const): Deleted.
1619         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1620         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate const): Deleted.
1621         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1622         (WebCore::MediaPlayerPrivateAVFoundation::metaDataAvailable const):
1623         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1624         (WebCore::MediaPlayerPrivateAVFoundationCF::platformPlay):
1625
1626 2019-12-18  Yury Semikhatsky  <yurys@chromium.org>
1627
1628         Web Inspector: Runtime.enable reports duplicates (non existent) contexts
1629         https://bugs.webkit.org/show_bug.cgi?id=204859
1630
1631         Reviewed by Devin Rousso.
1632
1633         Do not report main world context as non-main world one when Runtime.enable is called.
1634
1635         Test: inspector/runtime/executionContextCreated-onEnable.html
1636
1637         * inspector/agents/page/PageRuntimeAgent.cpp:
1638         (WebCore::PageRuntimeAgent::enable):
1639         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
1640
1641 2019-12-18  Antti Koivisto  <antti@apple.com>
1642
1643         Optimize Style::Invalidator for multiple RuleSet case
1644         https://bugs.webkit.org/show_bug.cgi?id=205406
1645
1646         Reviewed by Zalan Bujtas.
1647
1648         * style/StyleInvalidator.cpp:
1649         (WebCore::Style::m_dirtiesAllStyle):
1650         (WebCore::Style::Invalidator::Invalidator):
1651         (WebCore::Style::Invalidator::collectRuleInformation):
1652
1653         Collect bunch of bits so we don't need to traverse again.
1654
1655         (WebCore::Style::Invalidator::invalidateIfNeeded):
1656
1657         Bail out when we find a reson to invalidate.
1658
1659         (WebCore::Style::Invalidator::invalidateStyle):
1660         (WebCore::Style::Invalidator::invalidateInShadowTreeIfNeeded):
1661         * style/StyleInvalidator.h:
1662
1663 2019-12-18  Andres Gonzalez  <andresg_22@apple.com>
1664
1665         AXIsolatedObject support for spin button increment/decrementButton.
1666         https://bugs.webkit.org/show_bug.cgi?id=205356
1667
1668         Reviewed by Chris Fleizach.
1669
1670         Several LayoutTests exercise this functionality.
1671
1672         - Exposed increment/decrementButton in AXCoreObject in order to
1673         properly support it in AXIsolatedObject.
1674         - Used AXCoreObject::increment/decrementButton in the wrapper instead
1675         of downcasting to an implementation class, which does not work for an
1676         isolated object.
1677         - Implemented AXIsolatedObject::isDetachedFromParent.
1678         - Fixed initialization of AXIsolatedObject::m_parent and m_id.
1679
1680         * accessibility/AccessibilityObject.h:
1681         * accessibility/AccessibilityObjectInterface.h:
1682         * accessibility/AccessibilitySpinButton.h:
1683         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
1684         (WebCore::AXIsolatedObject::initializeAttributeData):
1685         (WebCore::AXIsolatedObject::isDetachedFromParent):
1686         (WebCore::AXIsolatedObject::isAccessibilityScrollView const):
1687         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
1688         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1689         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1690
1691 2019-12-18  Zalan Bujtas  <zalan@apple.com>
1692
1693         [LFC][IFC] LineLayoutContext::m_uncommittedList is not always a continuous list of runs
1694         https://bugs.webkit.org/show_bug.cgi?id=205404
1695         <rdar://problem/58049699>
1696
1697         Reviewed by Antti Koivisto.
1698
1699         Since LineLayoutContext's m_uncommittedList is not necessarily continuous set of runs (continuous in the content of not having a soft wrap opportunity)
1700         we can't use LineBreaker's Content struct anymore to store the uncommitted content.
1701         Let's use a dedicated UncommittedContent struct instead. It also enables us to pass in a const RunList& to the ContinousContent. ContinousContent should never mutate this list.
1702
1703         * layout/inlineformatting/InlineLineBreaker.cpp:
1704         (WebCore::Layout::shouldKeepEndOfLineWhitespace):
1705         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
1706         (WebCore::Layout::LineBreaker::ContinousContent::ContinousContent):
1707         (WebCore::Layout::LineBreaker::ContinousContent::hasTextContentOnly const):
1708         (WebCore::Layout::LineBreaker::ContinousContent::isVisuallyEmptyWhitespaceContentOnly const):
1709         (WebCore::Layout::LineBreaker::ContinousContent::firstTextRunIndex const):
1710         (WebCore::Layout::LineBreaker::ContinousContent::hasNonContentRunsOnly const):
1711         (WebCore::Layout::LineBreaker::ContinousContent::TrailingCollapsibleContent::reset):
1712         (WebCore::Layout::LineBreaker::Content::append): Deleted.
1713         (WebCore::Layout::LineBreaker::Content::reset): Deleted.
1714         (WebCore::Layout::LineBreaker::Content::shrink): Deleted.
1715         (WebCore::Layout::LineBreaker::Content::hasTextContentOnly const): Deleted.
1716         (WebCore::Layout::LineBreaker::Content::isVisuallyEmptyWhitespaceContentOnly const): Deleted.
1717         (WebCore::Layout::LineBreaker::Content::firstTextRunIndex const): Deleted.
1718         (WebCore::Layout::LineBreaker::Content::hasNonContentRunsOnly const): Deleted.
1719         (WebCore::Layout::LineBreaker::Content::TrailingCollapsibleContent::reset): Deleted.
1720         * layout/inlineformatting/InlineLineBreaker.h:
1721         (WebCore::Layout::LineBreaker::ContinousContent::runs const):
1722         (WebCore::Layout::LineBreaker::ContinousContent::isEmpty const):
1723         (WebCore::Layout::LineBreaker::ContinousContent::size const):
1724         (WebCore::Layout::LineBreaker::Content::runs): Deleted.
1725         (WebCore::Layout::LineBreaker::Content::runs const): Deleted.
1726         (WebCore::Layout::LineBreaker::Content::isEmpty const): Deleted.
1727         (WebCore::Layout::LineBreaker::Content::size const): Deleted.
1728         (WebCore::Layout::LineBreaker::Content::width const): Deleted.
1729         (WebCore::Layout::LineBreaker::Content::nonCollapsibleWidth const): Deleted.
1730         (WebCore::Layout::LineBreaker::Content::hasTrailingCollapsibleContent const): Deleted.
1731         (WebCore::Layout::LineBreaker::Content::isTrailingContentFullyCollapsible const): Deleted.
1732         * layout/inlineformatting/LineLayoutContext.cpp:
1733         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
1734         (WebCore::Layout::LineLayoutContext::UncommittedContent::append):
1735         (WebCore::Layout::LineLayoutContext::UncommittedContent::reset):
1736         (WebCore::Layout::LineLayoutContext::UncommittedContent::shrink):
1737         * layout/inlineformatting/LineLayoutContext.h:
1738         (WebCore::Layout::LineLayoutContext::UncommittedContent::width const):
1739         (WebCore::Layout::LineLayoutContext::UncommittedContent::size):
1740         (WebCore::Layout::LineLayoutContext::UncommittedContent::isEmpty):
1741         (WebCore::Layout::LineLayoutContext::UncommittedContent::runs const):
1742
1743 2019-12-18  youenn fablet  <youenn@apple.com>
1744
1745         Protect ServiceWorker::postMessage from a null execState
1746         https://bugs.webkit.org/show_bug.cgi?id=205394
1747         <rdar://problem/57392221>
1748
1749         Reviewed by Chris Dumez.
1750
1751         Crash logs indicate null pointer crashes.
1752         We should return early in that case.
1753
1754         * workers/service/ServiceWorker.cpp:
1755         (WebCore::ServiceWorker::postMessage):
1756
1757 2019-12-18  Zalan Bujtas  <zalan@apple.com>
1758
1759         [LFC][IFC] LineBreaker::lastSoftWrapOpportunity should take a list of runs
1760         https://bugs.webkit.org/show_bug.cgi?id=205402
1761         <rdar://problem/58048310>
1762
1763         Reviewed by Antti Koivisto.
1764
1765         LineBreaker::Content is supposed to hold a continuous set of runs and the input to lastSoftWrapOpportunity is not
1766         necessarily continuous (most of the time it is though). 
1767
1768         * layout/inlineformatting/InlineLineBreaker.cpp:
1769         (WebCore::Layout::isContentSplitAllowed):
1770         (WebCore::Layout::LineBreaker::wrapTextContent const):
1771         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
1772         (WebCore::Layout::LineBreaker::lastSoftWrapOpportunity):
1773         (WebCore::Layout::LineBreaker::Content::lastSoftWrapOpportunity): Deleted.
1774         * layout/inlineformatting/InlineLineBreaker.h:
1775         * layout/inlineformatting/LineLayoutContext.cpp:
1776         (WebCore::Layout::LineLayoutContext::placeInlineItem):
1777
1778 2019-12-18  youenn fablet  <youenn@apple.com>
1779
1780         AppCache should request certificate info when loading resources
1781         https://bugs.webkit.org/show_bug.cgi?id=205393
1782
1783         Reviewed by Anders Carlsson.
1784
1785         Covered by existing tests not crashing in Debug with newly added ASSERT.
1786
1787         * Modules/mediastream/UserMediaController.cpp:
1788         (WebCore::isSecure):
1789         ASSERT that certificate info is there.
1790         * loader/DocumentLoader.cpp:
1791         (WebCore::DocumentLoader::responseReceived):
1792         ASSERT that certificate info is there.
1793         * loader/appcache/ApplicationCacheResourceLoader.cpp:
1794         (WebCore::ApplicationCacheResourceLoader::create):
1795         Request certificate info for all app cache resources.
1796
1797 2019-12-18  youenn fablet  <youenn@apple.com>
1798
1799         Add support for Audio Capture in GPUProcess
1800         https://bugs.webkit.org/show_bug.cgi?id=205056
1801
1802         Reviewed by Eric Carlson.
1803
1804         Export some WebCore headers.
1805         Allow disabling the audio session debug assert in the GPU process.
1806         No change of behavior.
1807
1808         * WebCore.xcodeproj/project.pbxproj:
1809         * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
1810         (WebCore::BaseAudioSharedUnit::startUnit):
1811         * platform/mediastream/mac/BaseAudioSharedUnit.h:
1812         (WebCore::BaseAudioSharedUnit::setDisableAudioSessionCheck):
1813         * platform/mediastream/mac/MockAudioSharedUnit.h:
1814
1815 2019-12-18  Eric Carlson  <eric.carlson@apple.com>
1816
1817         Remove unused MediaPlayer methods
1818         https://bugs.webkit.org/show_bug.cgi?id=205341
1819         <rdar://problem/58006776>
1820
1821         Reviewed by Jer Noble.
1822
1823         No new tests, this just removes unused code.
1824
1825         * html/HTMLMediaElement.cpp:
1826         (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
1827         (WebCore::HTMLMediaElement::mediaPlayerSawUnsupportedTracks): Deleted.
1828         (WebCore::HTMLMediaElement::mediaPlayerSetSize): Deleted.
1829         (WebCore::HTMLMediaElement::mediaPlayerIsPaused const): Deleted.
1830         * html/HTMLMediaElement.h:
1831         * html/HTMLVideoElement.cpp:
1832         (WebCore::HTMLVideoElement::setDisplayMode):
1833         * html/MediaDocument.cpp:
1834         (WebCore::MediaDocument::MediaDocument):
1835         (WebCore::MediaDocument::~MediaDocument):
1836         (WebCore::MediaDocument::mediaElementSawUnsupportedTracks): Deleted.
1837         * html/MediaDocument.h:
1838         * platform/graphics/MediaPlayer.cpp:
1839         (WebCore::MediaPlayer::canLoadPoster const): Deleted.
1840         (WebCore::MediaPlayer::setPoster): Deleted.
1841         * platform/graphics/MediaPlayer.h:
1842         (WebCore::MediaPlayerClient::mediaPlayerContentsScale const):
1843         (WebCore::MediaPlayerClient::mediaPlayerPlatformVolumeConfigurationRequired const):
1844         (WebCore::MediaPlayerClient::mediaPlayerSawUnsupportedTracks): Deleted.
1845         (WebCore::MediaPlayerClient::mediaPlayerSetSize): Deleted.
1846         (WebCore::MediaPlayerClient::mediaPlayerIsPaused const): Deleted.
1847         * platform/graphics/MediaPlayerPrivate.h:
1848         (WebCore::MediaPlayerPrivateInterface::setSize):
1849         (WebCore::MediaPlayerPrivateInterface::canLoadPoster const): Deleted.
1850         (WebCore::MediaPlayerPrivateInterface::setPoster): Deleted.
1851         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1852         (WebCore::MediaPlayerPrivateAVFoundation::setSize): Deleted.
1853         (WebCore::MediaPlayerPrivateAVFoundation::repaint): Deleted.
1854         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1855         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1856         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1857         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1858         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible): Deleted.
1859         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1860         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1861         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setSize): Deleted.
1862         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1863
1864 2019-12-18  Doug Kelly  <dougk@apple.com>
1865
1866         Ensure transparency layers are properly ended when only painting root background
1867         https://bugs.webkit.org/show_bug.cgi?id=205285
1868
1869         Reviewed by Simon Fraser.
1870
1871         Ensure that if we are in a transparency layer and returning early from paintLayerContents() because of PaintLayerPaintingRootBackgroundOnly, we properly
1872         reset the transparency state before returning.
1873
1874         * platform/graphics/GraphicsContext.h:
1875         (WebCore::GraphicsContextStateStackChecker::~GraphicsContextStateStackChecker):
1876         * rendering/RenderLayer.cpp:
1877         (WebCore::RenderLayer::paintLayerContents):
1878
1879 2019-12-18  ChangSeok Oh  <changseok@webkit.org>
1880
1881         [GTK] WebGL backed by ANGLE flickers when USE_OPENGL_ES is enabled.
1882         https://bugs.webkit.org/show_bug.cgi?id=202508
1883
1884         Reviewed by Žan Doberšek.
1885
1886         The color format and internal one of BitmapTextureGL cannot be matched
1887         where USE_ANGLE_WEBGL and USE_OPENGL_ES are enabled simultaneously.
1888         This causes the flickering issue on WebGL scene since it prevents TextureMapper
1889         from recycling available layer buffers due to mismatched color format.
1890         When ANGLE_WEBGL is enabled, the internal color format is set GL_RGBA8.
1891         However, that is not compatible to GLES textures. To address this,
1892         We always make the color format of BitmapTextureGL GL_RGBA,
1893         and only set its internal color format with a given value.
1894
1895         No new tests since no functionality changed.
1896
1897         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
1898         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
1899         * platform/graphics/texmap/BitmapTextureGL.cpp:
1900         (WebCore::BitmapTextureGL::BitmapTextureGL):
1901
1902 2019-12-18  Antti Koivisto  <antti@apple.com>
1903
1904         Style::Invalidator should be able to invalidate using multiple RuleSets in one pass
1905         https://bugs.webkit.org/show_bug.cgi?id=205391
1906
1907         Reviewed by Zalan Bujtas.
1908
1909         It is inefficient to do multiple passes over DOM if there are multiple RuleSets to invalidate with.
1910
1911         * style/AttributeChangeInvalidation.cpp:
1912         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
1913
1914         Collect to a HashMap per MatchElement.
1915
1916         (WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
1917
1918         Call to common invalidation function in Style::Invalidator.
1919
1920         * style/AttributeChangeInvalidation.h:
1921         * style/ClassChangeInvalidation.cpp:
1922         (WebCore::Style::ClassChangeInvalidation::computeInvalidation):
1923         (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
1924
1925         Same for classes.
1926
1927         * style/ClassChangeInvalidation.h:
1928         * style/StyleInvalidator.cpp:
1929         (WebCore::Style::Invalidator::Invalidator):
1930
1931         Take a Vector of RuleSets.
1932
1933         (WebCore::Style::Invalidator::invalidateIfNeeded):
1934
1935         Loop as needed.
1936
1937         (WebCore::Style::Invalidator::invalidateStyle):
1938         (WebCore::Style::Invalidator::invalidateInShadowTreeIfNeeded):
1939         (WebCore::Style::Invalidator::invalidateWithMatchElementRuleSets):
1940
1941         Factor the invalidation loop and HashMap to Invalidator.
1942
1943         * style/StyleInvalidator.h:
1944
1945 2019-12-18  Simon Fraser  <simon.fraser@apple.com>
1946
1947         Move m_exposedContentRect into the DelegatedScrollingGeometry optional
1948         https://bugs.webkit.org/show_bug.cgi?id=205377
1949
1950         Reviewed by Tim Horton.
1951
1952         ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into
1953         DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related
1954         code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions
1955         on TiledCoreAnimationDrawingArea.        
1956
1957         * platform/ScrollView.cpp:
1958         (WebCore::ScrollView::exposedContentRect const):
1959         (WebCore::ScrollView::setExposedContentRect):
1960         (WebCore::ScrollView::platformExposedContentRect const):
1961         * platform/ScrollView.h:
1962         * platform/ios/ScrollViewIOS.mm:
1963         (WebCore::ScrollView::platformExposedContentRect const):
1964         (WebCore::ScrollView::exposedContentRect const): Deleted.
1965         (WebCore::ScrollView::setExposedContentRect): Deleted.
1966
1967 2019-12-18  Chris Dumez  <cdumez@apple.com>
1968
1969         REGRESSION: 32 Tests Crashing on Mac Debug wk2 with ASSERTION FAILED: m_pendingActivityForEventDispatch
1970         https://bugs.webkit.org/show_bug.cgi?id=205397
1971         <rdar://problem/58043626>
1972
1973         Unreviewed, fix debug assertion after r253667. The debug assertion is confused because we now use
1974         the HTML5 event loop, which takes care of taking an ActiveDOMObject PendingActivity whenever we
1975         queue an event.
1976
1977         * workers/service/ServiceWorkerRegistration.cpp:
1978         (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
1979         (WebCore::ServiceWorkerRegistration::getNewestWorker const):
1980         (WebCore::ServiceWorkerRegistration::updateStateFromServer):
1981         (WebCore::ServiceWorkerRegistration::queueTaskToFireUpdateFoundEvent):
1982         (WebCore::ServiceWorkerRegistration::stop):
1983         (WebCore::ServiceWorkerRegistration::hasPendingActivity const):
1984         (WebCore::ServiceWorkerRegistration::getNewestWorker): Deleted.
1985         (WebCore::ServiceWorkerRegistration::updatePendingActivityForEventDispatch): Deleted.
1986         * workers/service/ServiceWorkerRegistration.h:
1987
1988 2019-12-18  Diego Pino Garcia  <dpino@igalia.com>
1989
1990         [GTK][WPE] Renderization of Conic gradients
1991         https://bugs.webkit.org/show_bug.cgi?id=202739
1992
1993         Reviewed by Carlos Alberto Lopez Perez.
1994
1995         * platform/graphics/cairo/GradientCairo.cpp:
1996         (WebCore::Gradient::createPlatformGradient): Add support for conic gradient.
1997         (WebCore::addColorStopRGBA): Refactored code to a function.
1998         (WebCore::createConic): Creates a conic gradient.
1999         (WebCore::addConicSector): Adds a sector to a conic gradient.
2000         (WebCore::setCornerColorRGBA): Sets a RGBA color to mesh patch.
2001         (WebCore::interpolateColorStop): Offset and RGBA color interpolation.
2002
2003 2019-12-18  Zalan Bujtas  <zalan@apple.com>
2004
2005         [LFC][IFC] LineBreaker::isAtSoftWrapOpportunity should return the wrap position
2006         https://bugs.webkit.org/show_bug.cgi?id=205371
2007         <rdar://problem/58029811>
2008
2009         Reviewed by Antti Koivisto.
2010
2011         Rename isAtSoftWrapOpportunity to lastSoftWrapOpportunity to reflect that it returns the last soft wrap
2012         opportunity index.
2013
2014         * layout/inlineformatting/InlineLineBreaker.cpp:
2015         (WebCore::Layout::LineBreaker::Content::lastSoftWrapOpportunity):
2016         (WebCore::Layout::LineBreaker::Content::append):
2017         (WebCore::Layout::LineBreaker::Content::isAtSoftWrapOpportunity): Deleted.
2018         * layout/inlineformatting/InlineLineBreaker.h:
2019         * layout/inlineformatting/LineLayoutContext.cpp:
2020         (WebCore::Layout::LineLayoutContext::placeInlineItem):
2021
2022 2019-12-18  Zalan Bujtas  <zalan@apple.com>
2023
2024         [LFC][IFC] Add lastInlineItemWithContent to LineBreaker::Content::isAtSoftWrapOpportunity
2025         https://bugs.webkit.org/show_bug.cgi?id=205362
2026         <rdar://problem/58025349>
2027
2028         Reviewed by Antti Koivisto.
2029
2030         This is in preparation for being able to return a previous run index as the soft wrapping opportunity.
2031
2032         * layout/inlineformatting/InlineLineBreaker.cpp:
2033         (WebCore::Layout::endsWithSoftWrapOpportunity):
2034         (WebCore::Layout::LineBreaker::Content::isAtSoftWrapOpportunity):
2035
2036 2019-12-18  Dean Jackson  <dino@apple.com>
2037
2038         Reverting libANGLE.a -> libANGLE-shared.dylib.
2039
2040         The internal Apple build systems are still unhappy with
2041         this change, so I'm reverting it until I can be sure
2042         they'll accept it.
2043
2044         * Configurations/WebCore.xcconfig:
2045         * Configurations/WebCoreTestSupport.xcconfig:
2046         * platform/graphics/ANGLEWebKitBridge.cpp:
2047         (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
2048         (WebCore::ANGLEWebKitBridge::cleanupCompilers):
2049         (WebCore::ANGLEWebKitBridge::compileShaderSource):
2050         (WebCore::ANGLEWebKitBridge::angleAvailable): Deleted.
2051         * platform/graphics/ANGLEWebKitBridge.h:
2052         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2053         (WebCore::GraphicsContext3D::GraphicsContext3D):
2054
2055 2019-12-18  Chris Lord  <clord@igalia.com>
2056
2057         Missing headers in worker files cause random build failures when adding new files
2058         https://bugs.webkit.org/show_bug.cgi?id=205385
2059
2060         Reviewed by Youenn Fablet.
2061
2062         No new tests, no behavioral changes.
2063
2064         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2065         * workers/service/server/SWServerRegistration.cpp:
2066
2067 2019-12-18  Chris Lord  <clord@igalia.com>
2068
2069         [GTK][WPE] OffscreenCanvas worker tests that call drawImage crash in debug builds
2070         https://bugs.webkit.org/show_bug.cgi?id=205339
2071
2072         Reviewed by Carlos Garcia Campos.
2073
2074         Don't unnecessarily create an Image object in the Cairo graphics
2075         backend when using drawImage/drawPattern. Doing so calls code that
2076         isn't safe to use off-main-thread and causes OffscreenCanvas worker
2077         tests to crash in debug builds.
2078
2079         No new tests, no behavioral changes.
2080
2081         * platform/graphics/cairo/ImageBufferCairo.cpp:
2082         (WebCore::cairoSurfaceCopy):
2083         (WebCore::cairoSurfaceCoerceToImage):
2084         (WebCore::ImageBuffer::draw):
2085         (WebCore::ImageBuffer::drawPattern):
2086
2087 2019-12-17  Simon Fraser  <simon.fraser@apple.com>
2088
2089         Remove iOS #ifdefs around unobscuredContentSize
2090         https://bugs.webkit.org/show_bug.cgi?id=205372
2091
2092         Reviewed by Tim Horton.
2093
2094         Long-term, all of the ScrollView geometry data related to delegated scrolling
2095         will move to Optional<DelegatedScrollingGeometry> m_delegatedScrollingGeometry
2096         and not be wrapped in platform #ifdefs.
2097
2098         Take the first step of moving unobscuredContentSize into that struct.
2099
2100         I added platformUnobscuredContentRect() to handle the iOS WK1 case, called 
2101         when there is a platform widget.
2102         
2103         m_fixedVisibleContentRect is only used by coördinated graphics.
2104
2105         * page/FrameView.cpp:
2106         (WebCore::FrameView::unobscuredContentSizeChanged):
2107         * page/FrameView.h:
2108         * platform/ScrollView.cpp:
2109         (WebCore::ScrollView::unobscuredContentSize const):
2110         (WebCore::ScrollView::setUnobscuredContentSize):
2111         (WebCore::ScrollView::unobscuredContentRect const):
2112         (WebCore::ScrollView::platformVisibleContentRect const):
2113         (WebCore::ScrollView::platformVisibleContentSize const):
2114         (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea const):
2115         (WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea const):
2116         (WebCore::ScrollView::platformUnobscuredContentRect const):
2117         * platform/ScrollView.h:
2118         (WebCore::ScrollView::unobscuredContentSize const): Deleted.
2119         * platform/ios/ScrollViewIOS.mm:
2120         (WebCore::ScrollView::platformUnobscuredContentRect const):
2121         (WebCore::ScrollView::unobscuredContentRect const): Deleted.
2122         (WebCore::ScrollView::setUnobscuredContentSize): Deleted.
2123         * platform/mac/ScrollViewMac.mm:
2124         (WebCore::ScrollView::platformUnobscuredContentRect const):
2125
2126 2019-12-17  Chris Dumez  <cdumez@apple.com>
2127
2128         Port service worker code to the HTML5 event loop
2129         https://bugs.webkit.org/show_bug.cgi?id=205359
2130
2131         Reviewed by Ryosuke Niwa.
2132
2133         Port service worker code to the HTML5 event loop. We were mixing using the HTML5 event loop and ScriptExecutionContext::postTask().
2134         This would cause test flakiness because tasks posted via thsse 2 mechanisms could get processed out of order, even though the
2135         service worker specification guarantees a specific ordering.
2136
2137         The new pattern is that we only use WorkerRunLoop::postTask() to hop to the worker thread from the main thread, and not for any work
2138         specified in the service workers specification. Whenever the service workers specifications to "queue a task", we now queue a task
2139         on the ScriptExecutionContext's event loop, with the specified TaskSource.
2140
2141         No new tests, updated existing test.
2142
2143         * dom/ScriptExecutionContext.cpp:
2144         * dom/ScriptExecutionContext.h:
2145         * workers/service/SWClientConnection.cpp:
2146         (WebCore::dispatchToContextThreadIfNecessary):
2147         (WebCore::SWClientConnection::postTaskForJob):
2148         (WebCore::SWClientConnection::updateRegistrationState):
2149         (WebCore::SWClientConnection::updateWorkerState):
2150         (WebCore::SWClientConnection::fireUpdateFoundEvent):
2151         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
2152         (WebCore::SWClientConnection::clearPendingJobs):
2153         * workers/service/ServiceWorker.cpp:
2154         (WebCore::ServiceWorker::updateState):
2155         * workers/service/ServiceWorker.h:
2156         * workers/service/ServiceWorkerContainer.cpp:
2157         (WebCore::ServiceWorkerContainer::updateRegistrationState):
2158         (WebCore::ServiceWorkerContainer::updateWorkerState):
2159         (WebCore::ServiceWorkerContainer::queueTaskToFireUpdateFoundEvent):
2160         (WebCore::ServiceWorkerContainer::queueTaskToDispatchControllerChangeEvent):
2161         * workers/service/ServiceWorkerContainer.h:
2162         * workers/service/ServiceWorkerRegistration.cpp:
2163         (WebCore::ServiceWorkerRegistration::queueTaskToFireUpdateFoundEvent):
2164         * workers/service/ServiceWorkerRegistration.h:
2165         * workers/service/context/SWContextManager.cpp:
2166         (WebCore::SWContextManager::postMessageToServiceWorker):
2167         (WebCore::SWContextManager::fireInstallEvent):
2168         (WebCore::SWContextManager::fireActivateEvent):
2169         * workers/service/context/ServiceWorkerThread.cpp:
2170         (WebCore::ServiceWorkerThread::queueTaskToFireFetchEvent):
2171         (WebCore::ServiceWorkerThread::queueTaskToPostMessage):
2172         (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent):
2173         (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent):
2174         * workers/service/context/ServiceWorkerThread.h:
2175         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2176         (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
2177         (WebCore::ServiceWorkerThreadProxy::startFetch):
2178
2179 2019-12-17  Chris Dumez  <cdumez@apple.com>
2180
2181         Unreviewed, revert r253493 because it broke an Apple internal site
2182
2183         * html/HTMLFormElement.cpp:
2184         (WebCore::HTMLFormElement::submit):
2185         * html/HTMLFormElement.h:
2186         * loader/FormSubmission.h:
2187         (WebCore::FormSubmission::cancel): Deleted.
2188         (WebCore::FormSubmission::wasCancelled const): Deleted.
2189         * loader/NavigationScheduler.cpp:
2190
2191 2019-12-17  Fujii Hironori  <fujii.hironori@gmail.com>
2192
2193         [cairo] text-align:justify wrongly expands CJK ideograph characters
2194         https://bugs.webkit.org/show_bug.cgi?id=205321
2195
2196         Reviewed by Carlos Garcia Campos.
2197
2198         Even though canExpandAroundIdeographsInComplexText of
2199         FontCairoHarfbuzzNG.cpp returns false, ComplexTextController
2200         doesn't take it account. It ends up to expanding all ideographs
2201         with a undesired expansion width.
2202
2203         WidthIterator properly checks canExpandAroundIdeographsInComplexText.
2204         ComplexTextController also should do so.
2205
2206         * platform/graphics/ComplexTextController.cpp:
2207         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Check canExpandAroundIdeographsInComplexText.
2208         * platform/graphics/FontCascade.h: Friend with ComplexTextController to allow calling canExpandAroundIdeographsInComplexText.
2209
2210 2019-12-17  Brent Fulgham  <bfulgham@apple.com>
2211
2212         Limit URL to reasonable size
2213         https://bugs.webkit.org/show_bug.cgi?id=203825
2214         <rdar://problem/56878680>
2215
2216         Reviewed by Ryosuke Niwa.
2217
2218         * page/SecurityOrigin.cpp:
2219         (WebCore::SecurityOrigin::canDisplay const): Place an upper bound on the amount of
2220         memory a URL may consume.
2221
2222 2019-12-17  Eric Carlson  <eric.carlson@apple.com>
2223
2224         Add remote media player methods for prepareToPlay, preload, private browsing mode, preserves pitch, and failed to load
2225         https://bugs.webkit.org/show_bug.cgi?id=205351
2226         <rdar://problem/58018451>
2227
2228         Reviewed by Jer Noble.
2229
2230         * platform/graphics/MediaPlayer.cpp:
2231         (WebCore::MediaPlayer::remoteEngineFailedToLoad):
2232         * platform/graphics/MediaPlayer.h:
2233
2234 2019-12-17  Kate Cheney  <katherine_cheney@apple.com>
2235
2236         Add run-time flag for in-app browser privacy
2237         https://bugs.webkit.org/show_bug.cgi?id=205288
2238         <rdar://problem/57569206>
2239
2240         Reviewed by John Wilander.
2241
2242         * page/RuntimeEnabledFeatures.h:
2243         (WebCore::RuntimeEnabledFeatures::setInAppBrowserPrivacyEnabled):
2244         (WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const):
2245         * page/Settings.yaml:
2246
2247 2019-12-17  Ryosuke Niwa  <rniwa@webkit.org>
2248
2249         executeIfJavaScriptURL should check requester's security origin
2250         https://bugs.webkit.org/show_bug.cgi?id=205324
2251
2252         Reviewed by Brent Fulgham.
2253
2254         Don't execute the JavaScript in ScriptController::executeIfJavaScriptURL if the security origin
2255         of the current document is no longer accessible from the request originator's security origin.
2256
2257         * bindings/js/ScriptController.cpp:
2258         (WebCore::ScriptController::executeIfJavaScriptURL): Added a check.
2259         * bindings/js/ScriptController.h:
2260         * loader/FrameLoader.cpp:
2261         (WebCore::FrameLoader::urlSelected): Pass around the security origin of the requester.
2262         (WebCore::FrameLoader::submitForm):
2263
2264 2019-12-16  Ryosuke Niwa  <rniwa@webkit.org>
2265
2266         Document::setFocusedElement should not set m_focusedElement to an element in another document
2267         https://bugs.webkit.org/show_bug.cgi?id=205325
2268
2269         Reviewed by Wenson Hsieh.
2270
2271         Added an early exit for when the newly focused element had moved
2272         while blurring the previously focused element.
2273
2274         * dom/Document.cpp:
2275         (WebCore::Document::setFocusedElement):
2276
2277 2019-12-17  James Darpinian  <jdarpinian@chromium.org>
2278
2279         Fix WebGL conformance test build_177_to_178.html with USE_ANGLE
2280         https://bugs.webkit.org/show_bug.cgi?id=204927
2281
2282         Disable ANGLE_texture_rectangle when compiling user shaders.
2283         This mirrors a change I made to Chromium here:
2284         https://chromium-review.googlesource.com/c/chromium/src/+/1842223
2285
2286         Reviewed by Dean Jackson.
2287
2288         * platform/graphics/angle/GraphicsContext3DANGLE.cpp:
2289         (WebCore::GraphicsContext3D::compileShader):
2290
2291 2019-12-17  Tim Horton  <timothy_horton@apple.com>
2292
2293         macCatalyst: Cursor should update on mouse movement and style change
2294         https://bugs.webkit.org/show_bug.cgi?id=205317
2295         <rdar://problem/46793696>
2296
2297         Reviewed by Anders Carlsson.
2298
2299         * Configurations/WebCore.xcconfig:
2300         Link AppKit for NSCursor.
2301
2302         * SourcesCocoa.txt:
2303         Remove CursorIOS.cpp.
2304         De-unify CursorMac; because it imports AppKit headers, we have to
2305         take care to make sure it doesn't also get WAK (which it does if you
2306         leave it unified).
2307
2308         * WebCore.xcodeproj/project.pbxproj:
2309         Remove CursorIOS.cpp and de-unify CursorMac (by adding it to the target)
2310
2311         * loader/EmptyClients.h:
2312         * page/Chrome.cpp:
2313         (WebCore::Chrome::setCursor):
2314         (WebCore::Chrome::setCursorHiddenUntilMouseMoves):
2315         Unifdef many things.
2316
2317         * page/ChromeClient.h:
2318         (WebCore::ChromeClient::supportsSettingCursor):
2319         Add a ChromeClient bit, supportsSettingCursor, which can be used
2320         to guard work that shouldn't happen if a platform doesn't support
2321         pushing cursor updates out from WebCore. This will be true everywhere
2322         except iOS, and does the work of the old platform ifdefs.
2323
2324         * page/EventHandler.cpp:
2325         (WebCore::EventHandler::EventHandler):
2326         (WebCore::EventHandler::clear):
2327         (WebCore::EventHandler::updateCursor):
2328         (WebCore::EventHandler::selectCursor):
2329         (WebCore::EventHandler::handleMouseMoveEvent):
2330         (WebCore::EventHandler::scheduleCursorUpdate):
2331         * page/EventHandler.h:
2332         * platform/Cursor.cpp:
2333         * platform/Cursor.h:
2334         Unifdef, and use supportsSettingCursor to avoid some unnecessary work.
2335
2336         * platform/ios/CursorIOS.cpp: Removed.
2337         * platform/ios/WidgetIOS.mm:
2338         (WebCore::Widget::setCursor):
2339         Propagate cursor changes upwards.
2340
2341         * platform/mac/CursorMac.mm:
2342         (WebCore::cursor):
2343         (WebCore::Cursor::ensurePlatformCursor const):
2344         CursorMac is now built in macCatalyst. However, parts that depend
2345         on HIServices or NSImage are #ifdeffed out, and fall back to an arrow.
2346
2347 2019-12-17  Antti Koivisto  <antti@apple.com>
2348
2349         REGRESSION: ASSERTION FAILED: FontCache::singleton().generation() == m_generation
2350         https://bugs.webkit.org/show_bug.cgi?id=204933
2351         <rdar://problem/57458432>
2352
2353         Reviewed by Zalan Bujtas.
2354
2355         Test: fast/shadow-dom/font-cache-invalidation.html
2356
2357         When font cache version number is bumped we need to invalidate matches declarations caches because
2358         they may now contain stale font references. The code to do this failed to look into shadow trees.
2359
2360         * dom/Document.cpp:
2361         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
2362         * style/StyleScope.cpp:
2363         (WebCore::Style::Scope::invalidateMatchedDeclarationsCache):
2364
2365         Also invalidate the shadow trees.
2366
2367         * style/StyleScope.h:
2368
2369 2019-12-17  Zalan Bujtas  <zalan@apple.com>
2370
2371         [LFC][Painting] Add basic support for z-index based painting
2372         https://bugs.webkit.org/show_bug.cgi?id=205345
2373         <rdar://problem/58010942>
2374
2375         Reviewed by Antti Koivisto.
2376
2377         This is just a very simple z-index based painting to be able to run WPT where
2378         z-index is heavily used to hide/reveal red/green boxes.
2379
2380         * layout/displaytree/DisplayPainter.cpp:
2381         (WebCore::Display::absoluteDisplayBox):
2382         (WebCore::Display::isPaintRootCandidate):
2383         (WebCore::Display::paintSubtree):
2384         (WebCore::Display::collectPaintRootsAndContentRect):
2385         (WebCore::Display::Painter::paint):
2386         (WebCore::Display::paintBoxDecorationAndChildren): Deleted.
2387
2388 2019-12-17  youenn fablet  <youenn@apple.com>
2389
2390         Update session category in MockAudioSharedUnit as done in CoreAudioSharedUnit
2391         https://bugs.webkit.org/show_bug.cgi?id=205328
2392
2393         Reviewed by Eric Carlson.
2394
2395         We were updating the audio session when starting capturing with the CoreAudioSharedUnit
2396         but not with the MockAudioSharedUnit.
2397         Refactor the code to update the audio session in the base class BaseAudioSharedUnit.
2398         Share more code between start and resume case in BaseAudioSharedUnit.
2399
2400         Covered by platform/ios/mediastream/audio-muted-in-background-tab.html in Debug.
2401
2402         * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
2403         (WebCore::BaseAudioSharedUnit::startProducingData):
2404         (WebCore::BaseAudioSharedUnit::startUnit):
2405         (WebCore::BaseAudioSharedUnit::resume):
2406         * platform/mediastream/mac/BaseAudioSharedUnit.h:
2407         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2408         (WebCore::CoreAudioSharedUnit::startInternal):
2409         * platform/mediastream/mac/MockAudioSharedUnit.mm:
2410         (WebCore::MockAudioSharedUnit::startInternal):
2411
2412 2019-12-17  Thibault Saunier  <tsaunier@igalia.com>
2413
2414         [GStreamer][WPE] Fix regressions related to our 'Fix GStreamer capturer mock' patch
2415         https://bugs.webkit.org/show_bug.cgi?id=205270
2416
2417         MockGStreamerAudioCaptureSource rightfully defaults to echoCancellation=True,
2418         see https://bugs.webkit.org/show_bug.cgi?id=205057
2419
2420         Reviewed by Philippe Normand.
2421
2422         This fixes existing tests
2423
2424         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2425         (WebCore::WrappedMockRealtimeAudioSource::addHum):
2426
2427 2019-12-17  Antti Koivisto  <antti@apple.com>
2428
2429         Resolve dynamic media queries without reconstructing RuleSets
2430         https://bugs.webkit.org/show_bug.cgi?id=205264
2431
2432         Reviewed by Zalan Bujtas.
2433
2434         We currently do a full style resolver reset whenever a media query result changes. This is very inefficient
2435         as we need to reconstuct all RuleSets and optimization structures. We also lose related caches and are forced
2436         to re-resolve full document style. This may happen frequently, for example when resizing window on a responsive
2437         web site.
2438
2439         With this patch we construct RuleDatas also for non-matching dynamic media queries and simply mark them disabled.
2440         We create a data structure that allows enabling and disabling them efficiently as a response to environment changes
2441         (like view resize). This allows us to avoid throwing away anything during common scenarios.
2442
2443         Test: fast/media/media-query-dynamic-with-font-face.html
2444
2445         * css/MediaQueryEvaluator.cpp:
2446         (WebCore::MediaQueryEvaluator::evaluate const):
2447
2448         Add a mode where dynamic media queries all evaluate to true and only static properties can cause the query to fail.
2449
2450         * css/MediaQueryEvaluator.h:
2451         * style/ElementRuleCollector.cpp:
2452         (WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
2453
2454         Skip disabled rules during rule collection.
2455
2456         * style/RuleData.cpp:
2457         (WebCore::Style::RuleData::RuleData):
2458         * style/RuleData.h:
2459         (WebCore::Style::RuleData::isEnabled const):
2460         (WebCore::Style::RuleData::setEnabled):
2461
2462         Add a bit.
2463
2464         * style/RuleSet.cpp:
2465         (WebCore::Style::RuleSet::addRule):
2466
2467         Collect positions of rules affected by dynamic media queries.
2468
2469         (WebCore::Style::RuleSet::addPageRule):
2470         (WebCore::Style::RuleSet::addChildRules):
2471         (WebCore::Style::RuleSet::addRulesFromSheet):
2472
2473         First check for a special case where we have style resolver mutating rules (like @font-face) inside a media query.
2474         In this case we fall back to static resolution.
2475
2476         Then collect the rules. Static media queries (print etc) are evaluated right away, dynamic ones are collected by MediaQueryCollector.
2477
2478         (WebCore::Style::RuleSet::addStyleRule):
2479         (WebCore::Style::RuleSet::traverseRuleDatas):
2480         (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules):
2481
2482         Evaluate media queries for changes and flip the enabled state of the rules if needed.
2483
2484         (WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate):
2485         (WebCore::Style::RuleSet::MediaQueryCollector::pop):
2486         (WebCore::Style::RuleSet::MediaQueryCollector::didMutateResolver):
2487         (WebCore::Style::RuleSet::MediaQueryCollector::addRulePositionIfNeeded):
2488         * style/RuleSet.h:
2489         (WebCore::Style::RuleSet::hasViewportDependentMediaQueries const):
2490         * style/StyleResolver.cpp:
2491         (WebCore::Style::Resolver::hasViewportDependentMediaQueries const):
2492         (WebCore::Style::Resolver::evaluateDynamicMediaQueries):
2493         (WebCore::Style::Resolver::addMediaQueryDynamicResults): Deleted.
2494         (WebCore::Style::Resolver::hasMediaQueriesAffectedByViewportChange const): Deleted.
2495         (WebCore::Style::Resolver::hasMediaQueriesAffectedByAccessibilitySettingsChange const): Deleted.
2496         (WebCore::Style::Resolver::hasMediaQueriesAffectedByAppearanceChange const): Deleted.
2497
2498         Profiling doesn't show any need to handle the cases separately. Replace with single evaluateDynamicMediaQueries path.
2499         We can bring type specific paths back easily if needed.
2500
2501         * style/StyleResolver.h:
2502         (WebCore::Style::Resolver::hasViewportDependentMediaQueries const): Deleted.
2503         (WebCore::Style::Resolver::hasAccessibilitySettingsDependentMediaQueries const): Deleted.
2504         (WebCore::Style::Resolver::hasAppearanceDependentMediaQueries const): Deleted.
2505         * style/StyleScope.cpp:
2506         (WebCore::Style::Scope::evaluateMediaQueriesForViewportChange):
2507         (WebCore::Style::Scope::evaluateMediaQueriesForAccessibilitySettingsChange):
2508         (WebCore::Style::Scope::evaluateMediaQueriesForAppearanceChange):
2509
2510         Call into general evaluateDynamicMediaQueries.
2511
2512         (WebCore::Style::Scope::evaluateMediaQueries):
2513
2514         In normal case we can just invalidate style, not throw everything away.
2515         This can be further improved by adding optimization rule sets.
2516
2517         * style/StyleScopeRuleSets.cpp:
2518         (WebCore::Style::ScopeRuleSets::updateUserAgentMediaQueryStyleIfNeeded const):
2519         (WebCore::Style::ScopeRuleSets::initializeUserStyle):
2520         (WebCore::Style::ScopeRuleSets::collectRulesFromUserStyleSheets):
2521         (WebCore::Style::makeRuleSet):
2522         (WebCore::Style::ScopeRuleSets::hasViewportDependentMediaQueries const):
2523         (WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules):
2524         (WebCore::Style::ScopeRuleSets::appendAuthorStyleSheets):
2525         (WebCore::Style::ensureInvalidationRuleSets):
2526         * style/StyleScopeRuleSets.h:
2527
2528 2019-12-17  youenn fablet  <youenn@apple.com>
2529
2530         FileList should be exposed to workers
2531         https://bugs.webkit.org/show_bug.cgi?id=204074
2532
2533         Reviewed by Chris Dumez.
2534
2535         Covered by rebased test.
2536
2537         * fileapi/FileList.idl:
2538
2539 2019-12-16  Joonghun Park  <jh718.park@samsung.com>
2540
2541         Unreviewed. Remove the build warnings below since r253488.
2542         warning: unused parameter ‘foo’ [-Wunused-parameter]
2543
2544         No new tests, no behavioral changes.
2545
2546         * testing/Internals.cpp:
2547         (WebCore::Internals::hasSandboxMachLookupAccessToXPCServiceName):
2548
2549 2019-12-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2550
2551         WebGLRenderingContext.texImage2D() should respect EXIF orientation
2552         https://bugs.webkit.org/show_bug.cgi?id=205141
2553
2554         Reviewed by Simon Fraser.
2555
2556         If image orientation is not the default, WebGLRenderingContext.texImage2D()
2557         needs to draw this image into an ImageBuffer, makes a temporary Image
2558         from the ImageBuffer then draw this temporary Image to the WebGL texture.
2559
2560         Test: fast/images/exif-orientation-webgl-texture.html
2561
2562         * html/canvas/WebGLRenderingContextBase.cpp:
2563         (WebCore::WebGLRenderingContextBase::texSubImage2D):
2564         (WebCore::WebGLRenderingContextBase::texImage2D):
2565         * platform/graphics/BitmapImage.h:
2566         * platform/graphics/Image.h:
2567         (WebCore::Image::orientation const):
2568
2569 2019-12-16  Simon Fraser  <simon.fraser@apple.com>
2570
2571         Change 'delegatesPageScaling' from a Setting to a flag on ScrollView
2572         https://bugs.webkit.org/show_bug.cgi?id=205319
2573
2574         Reviewed by Tim Horton.
2575
2576         delegatesPageScaling() is never toggled at runtime (even by tests), and it should
2577         be a flag on FrameView just like delegatesScrolling (maybe in future the flags can merge).
2578
2579         So remove the Setting, and have DrawingArea control whether page scaling is delegated.
2580         
2581         In WebKit1, WebFrameLoaderClient::transitionToCommittedForNewPage() turns on delegated
2582         page scaling for iOS.
2583
2584         * page/Frame.cpp:
2585         (WebCore::Frame::frameScaleFactor const):
2586         * page/FrameSnapshotting.cpp:
2587         (WebCore::snapshotFrameRectWithClip):
2588         * page/FrameView.cpp:
2589         (WebCore::FrameView::visibleContentScaleFactor const):
2590         * page/Page.cpp:
2591         (WebCore::Page::setPageScaleFactor):
2592         * page/Settings.yaml:
2593         * platform/ScrollView.cpp:
2594         (WebCore::ScrollView::setDelegatesPageScaling):
2595         * platform/ScrollView.h:
2596         (WebCore::ScrollView::delegatesPageScaling const):
2597         * rendering/RenderLayerCompositor.cpp:
2598         (WebCore::RenderLayerCompositor::addToOverlapMap const):
2599
2600 2019-12-16  Ryosuke Niwa  <rniwa@webkit.org>
2601
2602         TextManipulationController should observe newly inserted or displayed contents
2603         https://bugs.webkit.org/show_bug.cgi?id=205203
2604         <rdar://problem/56567020>
2605
2606         Reviewed by Wenson Hsieh.
2607
2608         This patch makes TextManipulationController detect newly inserted or displayed contents and invoke
2609         the callbacks with the newly found items.
2610
2611         To do this, we add a new WeakHashSet to TextManipulationController to which an element is added
2612         whenever its renderer is created. Because it's expensive (and not safe) to find paragraphs around
2613         a newly inserted content, we schedule a new event loop task to do this work.
2614
2615         To find newly inserted paragraphs, we first expand the element's boundary to its start and end of
2616         paragraphs. Because each element in this paragraph could have been added in the weak hash set, we
2617         use hash map to de-duplicate start and end positions. We also filter out any element whose parent
2618         is also in the weak hash set since they would simply find inner paragraphs.
2619
2620         Tests: TextManipulation.StartTextManipulationFindNewlyInsertedParagraph
2621                TextManipulation.StartTextManipulationFindNewlyDisplayedParagraph
2622                TextManipulation.StartTextManipulationFindSameParagraphWithNewContent
2623
2624         * dom/TaskSource.h:
2625         (WebCore::TaskSource::InternalAsyncTask): Added.
2626         * editing/TextManipulationController.cpp:
2627         (WebCore::TextManipulationController::startObservingParagraphs):
2628         (WebCore::TextManipulationController::observeParagraphs): Extracted out of startObservingParagraphs.
2629         (WebCore::TextManipulationController::didCreateRendererForElement): Added. Gets called whenever
2630         a new RenderElement is created.
2631         (WebCore::makePositionTuple): Added.
2632         (WebCore::makeHashablePositionRange): Added.
2633         (WebCore::TextManipulationController::scheduleObservartionUpdate): Added.
2634         * editing/TextManipulationController.h:
2635         * rendering/updating/RenderTreeUpdater.cpp:
2636         (WebCore::RenderTreeUpdater::createRenderer):
2637
2638 2019-12-16  Daniel Bates  <dabates@apple.com>
2639
2640         Reproducible case of backwards nextParagraph returning a position ahead of the input position
2641         https://bugs.webkit.org/show_bug.cgi?id=196127
2642         <rdar://problem/49135890>
2643
2644         Reviewed by Wenson Hsieh.
2645
2646         Fix up the code to handle:
2647
2648                 1. When the specified position is at a paragraph boundary.
2649                         For this case, we do what we do now for the !withinUnitOfGranularity case.
2650                 2. When the specified position is actually inside a paragraph:
2651                         For this case, we need to return the end of the previous paragraph or the
2652                         start of the next paragraph depending on whether we are selecting forward
2653                         or backwards, respectively.
2654
2655         * editing/VisibleUnits.cpp:
2656         (WebCore::nextParagraphBoundaryInDirection):
2657
2658 2019-12-16  Yusuke Suzuki  <ysuzuki@apple.com>
2659
2660         [JSC] Remove ArrayBufferNeuteringWatchpointSet
2661         https://bugs.webkit.org/show_bug.cgi?id=205194
2662
2663         Reviewed by Saam Barati.
2664
2665         * bindings/js/SerializedScriptValue.h:
2666         (WebCore::SerializedScriptValue::decode):
2667
2668 2019-12-16  Doug Kelly  <dougk@apple.com>
2669
2670         Ensure consistent sorting of identical track names
2671         https://bugs.webkit.org/show_bug.cgi?id=204825
2672
2673         Reviewed by Eric Carlson.
2674
2675         When sorting TextTracks, if the menu text is the same, fall back to the order in which the tracks were added to ensure a consistent sort.
2676
2677         * page/CaptionUserPreferencesMediaAF.cpp:
2678         (WebCore::textTrackCompare):
2679         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu):
2680
2681 2019-12-16  Antti Koivisto  <antti@apple.com>
2682
2683         Remove display:contents feature flag
2684         https://bugs.webkit.org/show_bug.cgi?id=205276
2685
2686         Reviewed by Ryosuke Niwa.
2687
2688         The feature has been enabled for a while. There is no reason to have a flag for it anymore.
2689
2690         * page/RuntimeEnabledFeatures.h:
2691         (WebCore::RuntimeEnabledFeatures::setDisplayContentsEnabled): Deleted.
2692         (WebCore::RuntimeEnabledFeatures::displayContentsEnabled const): Deleted.
2693         * style/StyleAdjuster.cpp:
2694         (WebCore::Style::Adjuster::adjustDisplayContentsStyle const):
2695
2696 2019-12-16  Zalan Bujtas  <zalan@apple.com>
2697
2698         [LFC][IFC] Fix imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
2699         https://bugs.webkit.org/show_bug.cgi?id=205287
2700         <rdar://problem/57976834>
2701
2702         Reviewed by Antti Koivisto.
2703
2704         Consolidate word break rules into a function to be able to make sure "line-break: anywhere" takes priority over word-break values.
2705
2706         * layout/inlineformatting/InlineLineBreaker.cpp:
2707         (WebCore::Layout::LineBreaker::wordBreakBehavior const):
2708         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
2709         (WebCore::Layout::isTextSplitAtArbitraryPositionAllowed): Deleted.
2710         * layout/inlineformatting/InlineLineBreaker.h:
2711
2712 2019-12-16  Andres Gonzalez  <andresg_22@apple.com>
2713
2714         Isolated object implementation of parameterized attribute SelectTextWithCriteria.
2715         https://bugs.webkit.org/show_bug.cgi?id=205210
2716
2717         Reviewed by Chris Fleizach.
2718
2719         LayoutTests/accessibility/mac/find-and-replace-match-capitalization.html exercise this functionality.
2720
2721         Requests for parameterized attributes that require computations in
2722         the WebCore DOM need to be dispatched to the main thread. This
2723         change is the blueprint for all other attributes to follow.
2724
2725         * accessibility/AXObjectCache.cpp:
2726         (WebCore::AXObjectCache::isolatedTreeRootObject): The isolated tree root object is always retrieved in the main thread.
2727         (WebCore::AXObjectCache::generateIsolatedTree): Sets the AXObjectCache for the generated IsolatedTree.
2728         * accessibility/AccessibilityObjectInterface.h: Added the template functions to dispatch to the main thread.
2729         (WebCore::Accessibility::performFunctionOnMainThread):
2730         (WebCore::Accessibility::retrieveValueFromMainThread):
2731         * accessibility/AccessibilityRenderObject.cpp: Removed obsolete asserts.
2732         (WebCore::AccessibilityRenderObject::visibleChildren):
2733         (WebCore::AccessibilityRenderObject::tabChildren):
2734         * accessibility/isolatedtree/AXIsolatedTree.h: It now holds a reference to the AXObjectCache.
2735         (WebCore::AXIsolatedTree::axObjectCache const):
2736         (WebCore::AXIsolatedTree::setAXObjectCache):
2737         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
2738         (WebCore::AXIsolatedObject::findTextRanges const):
2739         (WebCore::AXIsolatedObject::performTextOperation):
2740         (WebCore::AXIsolatedObject::axObjectCache const):
2741         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
2742         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Moved template functions to dispatch to the main thread into the Accessibility namespace to use them in the isolated object implementation.
2743         (-[WebAccessibilityObjectWrapper attachmentView]):
2744         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
2745         (-[WebAccessibilityObjectWrapper associatedPluginParent]):
2746         (-[WebAccessibilityObjectWrapper scrollViewParent]):
2747         (-[WebAccessibilityObjectWrapper windowElement:]):
2748         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
2749         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2750         (performAccessibilityFunctionOnMainThread): Moved.
2751         (retrieveAccessibilityValueFromMainThread): Moved.
2752
2753 2019-12-16  youenn fablet  <youenn@apple.com>
2754
2755         Consider top-level context whose origin is unique as insecure
2756         https://bugs.webkit.org/show_bug.cgi?id=205111
2757
2758         Reviewed by Brent Fulgham.
2759
2760         Tests: http/tests/security/top-level-unique-origin.https.html
2761                http/tests/security/top-level-unique-origin2.https.html
2762
2763         * dom/Document.cpp:
2764         (WebCore::Document::isSecureContext const):
2765         There is no guarantee that top level unique origin contexts like data URL are SecureContext.
2766         This patch makes them no longer SecureContext.
2767         This helps getting closer to https://w3c.github.io/webappsec-secure-contexts/#is-url-trustworthy
2768         which identifies all unique origins as "Not Trustworthy".
2769         Child unique origin contexts will stay SecureContext if their parents are.
2770
2771 2019-12-16  Daniel Bates  <dabates@apple.com>
2772
2773         -requestDocumentContext always returns 1 text unit more granularity than requested
2774         https://bugs.webkit.org/show_bug.cgi?id=205142
2775         <rdar://problem/57858236>
2776
2777         Reviewed by Darin Adler and Wenson Hsieh.
2778
2779         Fix up the code to actually determine if the specified position is at a sentence
2780         boundary. Currently the code will always return false when asking whether the
2781         specified position is at a sentence boundary (i.e. "end of the sentence") because
2782         it compares it to the position of the end of the *next* sentence or the beginning
2783         of the current sentence when selecting forward or backwards, respectively.
2784
2785         * editing/VisibleUnits.cpp:
2786         (WebCore::atBoundaryOfGranularity):
2787
2788 2019-12-16  Zalan Bujtas  <zalan@apple.com>
2789
2790         [LFC][IFC] Add initial support for line-break: anywhere
2791         https://bugs.webkit.org/show_bug.cgi?id=205278
2792         <rdar://problem/57969694>
2793
2794         Reviewed by Antti Koivisto.
2795
2796         1. There is a soft wrap opportunity around every typographic character unit.
2797         2. The different wrapping opportunities must not be prioritized. Hyphenation is not applied.
2798
2799         Fix imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html.
2800
2801         * layout/inlineformatting/InlineLineBreaker.cpp:
2802         (WebCore::Layout::isTextSplitAtArbitraryPositionAllowed):
2803         (WebCore::Layout::LineBreaker::Content::isAtSoftWrapOpportunity):
2804
2805 2019-12-16  Zalan Bujtas  <zalan@apple.com>
2806
2807         [LFC][IFC] Rename LineBuilder::m_skipAlignment to LineBuilder::m_intrinsicWidthLine
2808         https://bugs.webkit.org/show_bug.cgi?id=205257
2809         <rdar://problem/57955958>
2810
2811         Reviewed by Antti Koivisto.
2812
2813         It's going to be used for hanging glyphs.
2814
2815         * layout/inlineformatting/InlineLineBuilder.cpp:
2816         (WebCore::Layout::LineBuilder::LineBuilder):
2817         (WebCore::Layout::LineBuilder::initialize):
2818         (WebCore::Layout::LineBuilder::close):
2819         (WebCore::Layout::LineBuilder::alignContentVertically):
2820         (WebCore::Layout::LineBuilder::alignContentHorizontally const):
2821         (WebCore::Layout::LineBuilder::runContentHeight const):
2822         (WebCore::Layout::LineBuilder::isVisuallyNonEmpty const):
2823         * layout/inlineformatting/InlineLineBuilder.h:
2824
2825 2019-12-16  Zalan Bujtas  <zalan@apple.com>
2826
2827         [LFC][IFC] Should use the term collapsed/collapsible instead of trimmed/trimmable
2828         https://bugs.webkit.org/show_bug.cgi?id=205255
2829         <rdar://problem/57954672>
2830
2831         Reviewed by Antti Koivisto.
2832
2833         While trimming is also a spec term, collapsible is closer to the spec language.
2834
2835         * layout/inlineformatting/InlineLineBreaker.cpp:
2836         (WebCore::Layout::shouldKeepEndOfLineWhitespace):
2837         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
2838         (WebCore::Layout::LineBreaker::Content::append):
2839         (WebCore::Layout::LineBreaker::Content::reset):
2840         (WebCore::Layout::LineBreaker::Content::shrink):
2841         (WebCore::Layout::LineBreaker::Content::TrailingCollapsibleContent::reset):
2842         (WebCore::Layout::LineBreaker::Content::trim): Deleted.
2843         (WebCore::Layout::LineBreaker::Content::TrailingTrimmableContent::reset): Deleted.
2844         * layout/inlineformatting/InlineLineBreaker.h:
2845         (WebCore::Layout::LineBreaker::Content::nonCollapsibleWidth const):
2846         (WebCore::Layout::LineBreaker::Content::hasTrailingCollapsibleContent const):
2847         (WebCore::Layout::LineBreaker::Content::isTrailingContentFullyCollapsible const):
2848         (WebCore::Layout::LineBreaker::Content::nonTrimmableWidth const): Deleted.
2849         (WebCore::Layout::LineBreaker::Content::hasTrailingTrimmableContent const): Deleted.
2850         (WebCore::Layout::LineBreaker::Content::isTrailingContentFullyTrimmable const): Deleted.
2851         * layout/inlineformatting/InlineLineBuilder.cpp:
2852         (WebCore::Layout::LineBuilder::LineBuilder):
2853         (WebCore::Layout::LineBuilder::initialize):
2854         (WebCore::Layout::LineBuilder::close):
2855         (WebCore::Layout::LineBuilder::removeTrailingCollapsibleContent):
2856         (WebCore::Layout::LineBuilder::collectHangingContent):
2857         (WebCore::Layout::LineBuilder::appendInlineContainerEnd):
2858         (WebCore::Layout::LineBuilder::appendTextContent):
2859         (WebCore::Layout::LineBuilder::appendNonReplacedInlineBox):
2860         (WebCore::Layout::LineBuilder::CollapsibleContent::CollapsibleContent):
2861         (WebCore::Layout::LineBuilder::CollapsibleContent::append):
2862         (WebCore::Layout::LineBuilder::CollapsibleContent::collapse):
2863         (WebCore::Layout::LineBuilder::CollapsibleContent::collapseTrailingRun):
2864         (WebCore::Layout::LineBuilder::InlineItemRun::isCollapsibleWhitespace const):
2865         (WebCore::Layout::LineBuilder::removeTrailingTrimmableContent): Deleted.
2866         (WebCore::Layout::LineBuilder::TrimmableContent::TrimmableContent): Deleted.
2867         (WebCore::Layout::LineBuilder::TrimmableContent::append): Deleted.
2868         (WebCore::Layout::LineBuilder::TrimmableContent::trim): Deleted.
2869         (WebCore::Layout::LineBuilder::TrimmableContent::trimTrailingRun): Deleted.
2870         (WebCore::Layout::LineBuilder::InlineItemRun::isTrimmableWhitespace const): Deleted.
2871         * layout/inlineformatting/InlineLineBuilder.h:
2872         (WebCore::Layout::LineBuilder::trailingCollapsibleWidth const):
2873         (WebCore::Layout::LineBuilder::isTrailingRunFullyCollapsible const):
2874         (WebCore::Layout::LineBuilder::CollapsibleContent::isTrailingRunFullyCollapsible const):
2875         (WebCore::Layout::LineBuilder::CollapsibleContent::isTrailingRunPartiallyCollapsible const):
2876         (WebCore::Layout::LineBuilder::CollapsibleContent::reset):
2877         (WebCore::Layout::LineBuilder::trailingTrimmableWidth const): Deleted.
2878         (WebCore::Layout::LineBuilder::isTrailingRunFullyTrimmable const): Deleted.
2879         (WebCore::Layout::LineBuilder::TrimmableContent::width const): Deleted.
2880         (WebCore::Layout::LineBuilder::TrimmableContent::firstRunIndex): Deleted.
2881         (WebCore::Layout::LineBuilder::TrimmableContent::isEmpty const): Deleted.
2882         (WebCore::Layout::LineBuilder::TrimmableContent::isTrailingRunFullyTrimmable const): Deleted.
2883         (WebCore::Layout::LineBuilder::TrimmableContent::isTrailingRunPartiallyTrimmable const): Deleted.
2884         (WebCore::Layout::LineBuilder::TrimmableContent::reset): Deleted.
2885         * layout/inlineformatting/LineLayoutContext.cpp:
2886         (WebCore::Layout::LineLayoutContext::placeInlineItem):
2887         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
2888
2889 2019-12-16  youenn fablet  <youenn@apple.com>
2890
2891         SecurityOrigin should be unique for null blob URLs that have been unregistered
2892         https://bugs.webkit.org/show_bug.cgi?id=205169
2893
2894         Reviewed by Darin Adler.
2895
2896         In case we cannot retrieve a cached origin for a null origin, just create a unique one.
2897         This is better than having an origin with an empty host and empty scheme.
2898
2899         Test: http/tests/security/blob-null-url-location-origin.html
2900
2901         * fileapi/ThreadableBlobRegistry.cpp:
2902         (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
2903         (WebCore::ThreadableBlobRegistry::getCachedOrigin):
2904
2905 2019-12-15  Emilio Cobos Álvarez  <emilio@crisal.io>
2906
2907         CSSParserMode::HTMLAttributeMode is unused.
2908         https://bugs.webkit.org/show_bug.cgi?id=205247
2909
2910         Reviewed by Antti Koivisto.
2911
2912         We parse HTML attributes with regular quirks mode parsing mode.
2913         Internal properties work anyway as we pass CSSPropertyID directly.
2914
2915         No new tests, no behavior change.
2916
2917         * css/parser/CSSParserMode.h:
2918         (WebCore::isQuirksModeBehavior):
2919         (WebCore::isUnitLessValueParsingEnabledForMode):
2920
2921 2019-12-15  Emilio Cobos Álvarez  <emilio@crisal.io>
2922
2923         Remove -webkit-marquee.
2924         https://bugs.webkit.org/show_bug.cgi?id=117769
2925
2926         Reviewed by Simon Fraser.
2927
2928         This doesn't simplify the code so much yet but makes the CSS properties not
2929         accessible by web content, which means that how marquee is implemented is now an
2930         implementation detail that WebKit can change.
2931
2932         Had to keep some of parsing code because addHTMLLengthToStyle uses the
2933         CSS parser, which is a bit unfortunate. But we can avoid dealing with
2934         identifiers so it can be simplified a bit, and similarly we can avoid
2935         having a shorthand altogether.
2936
2937         Covered by existing tests that are being modified to reflect the
2938         change.
2939
2940         * css/CSSComputedStyleDeclaration.cpp:
2941         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
2942         * css/CSSProperties.json:
2943         * css/StyleProperties.cpp:
2944         (WebCore::StyleProperties::getPropertyValue const):
2945         * css/parser/CSSPropertyParser.cpp:
2946         (WebCore::CSSPropertyParser::parseSingleValue):
2947         (WebCore::CSSPropertyParser::parseShorthand):
2948
2949 2019-12-14  Adrian Perez de Castro  <aperez@igalia.com>
2950
2951         [GTK][WPE] Fix various non-unified build issues introduced since r251698
2952         https://bugs.webkit.org/show_bug.cgi?id=204891
2953
2954         Reviewed by Alex Christensen.
2955
2956         No new tests needed.
2957
2958         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: Add missing inclusion of
2959         markup.h
2960         * accessibility/AccessibilityObject.cpp: Add missing inclusion of RenderInline.h
2961         * animation/WebAnimationUtilities.cpp: Add missing inclusion of Animation.h
2962         * animation/WebAnimationUtilities.h: Add inclusion of wtf/Forward.h to ensure that
2963         WTF::String is declared.
2964         * css/DOMCSSNamespace.cpp: Add missing inclusion of Document.h
2965         * dom/WindowEventLoop.cpp: Add missing inclusion of SecurityOrigin.h
2966         * dom/WindowEventLoop.h: Add forward declaration of SecurityOrigin
2967         * layout/displaytree/DisplayInlineContent.cpp: Move ENABLE(LAYOUT_FORMATTING_CONTEXT) guard
2968         after inclusion of config.h, to ensure that the ENABLE() macro is defined before being used.
2969         * loader/ProgressTracker.h: Add missing inclusion of wtf/UniqueRef.h
2970         * page/LoggedInStatus.cpp: Add missing inclusion of wtf/text/StringConcatenateNumbers.h
2971         * page/PageConfiguration.cpp: Add missing inclusions of AlternativeTextClient.h and
2972         PlugInClient.h
2973         * rendering/RenderFlexibleBox.cpp: Add missing inclusion of wtf/SetForScope.h
2974         * rendering/updating/RenderTreeBuilderBlock.h: Add missing forward declaration of
2975         RenderBlockFlow.
2976         * rendering/updating/RenderTreeBuilderBlockFlow.h: Add missing forward declaration of
2977         RenderBlockFlow.
2978         * rendering/updating/RenderTreeBuilderMultiColumn.h: Add missing forward declaration of
2979         RenderMultiColumnFlow.
2980         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: Add missin inclusion of
2981         RenderView.h
2982         * style/StyleBuilder.cpp: Add missing inclusion of HTMLElement.h
2983         * style/StyleBuilderState.cpp: Ditto.
2984         * style/StyleScopeRuleSets.h: Move forward declaration of InspectorCSSOMWrappers into the
2985         Style namespace, where it belongs; add missing namespace prefix in appendAuthorStyleSheets()
2986         declaration.
2987
2988 2019-12-15  Zalan Bujtas  <zalan@apple.com>
2989
2990         [LFC][IFC] Add basic support for hanging content
2991         https://bugs.webkit.org/show_bug.cgi?id=205252
2992         <rdar://problem/57947773>
2993
2994         Reviewed by Antti Koivisto.
2995
2996         Collect the hanging content after collapsing trailing whitespace and adjust
2997         the available space when computing the extra width for horizontal alignment.
2998
2999         IFC passes imported/w3c/web-platform-tests/css/css-text/ directory now.
3000
3001         * layout/inlineformatting/InlineLineBuilder.cpp:
3002         (WebCore::Layout::LineBuilder::initialize):
3003         (WebCore::Layout::LineBuilder::close):
3004         (WebCore::Layout::LineBuilder::alignContentHorizontally const):
3005         (WebCore::Layout::LineBuilder::collectHangingContent):
3006         (WebCore::Layout::LineBuilder::appendTextContent):
3007         * layout/inlineformatting/InlineLineBuilder.h:
3008         (WebCore::Layout::LineBuilder::HangingContent::width const):
3009         (WebCore::Layout::LineBuilder::HangingContent::isConditional const):
3010         (WebCore::Layout::LineBuilder::HangingContent::setIsConditional):
3011         (WebCore::Layout::LineBuilder::HangingContent::expand):
3012         (WebCore::Layout::LineBuilder::HangingContent::reset):
3013
3014 2019-12-15  Emilio Cobos Álvarez  <emilio@crisal.io>
3015
3016         [GStreamer] Fix silly bug in GStreamerVideoFrameLibWebRTC.
3017         https://bugs.webkit.org/show_bug.cgi?id=205248
3018
3019         Reviewed by Philippe Normand.
3020
3021         Binary operators in C++ don't work like in JavaScript, so this was always
3022         passing 1.
3023
3024         No new tests, no observable behavior change.
3025
3026         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
3027         (WebCore::GStreamerVideoFrameLibWebRTC::ToI420):
3028
3029 2019-12-15  Zalan Bujtas  <zalan@apple.com>
3030
3031         [LFC][IFC] Fix imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-009.html
3032         https://bugs.webkit.org/show_bug.cgi?id=205246
3033         <rdar://problem/57944015>
3034
3035         Reviewed by Antti Koivisto.
3036
3037         Fix the "soft wrap opportunity" case when both the incoming and the previous runs are whitespace.
3038
3039         * layout/inlineformatting/InlineLineBreaker.cpp:
3040         (WebCore::Layout::LineBreaker::Content::isAtSoftWrapOpportunity):
3041
3042 2019-12-15  Zalan Bujtas  <zalan@apple.com>
3043
3044         Unreviewed, address review comments missed in the initial commit.
3045
3046         * layout/inlineformatting/InlineLineBreaker.cpp:
3047         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
3048         (WebCore::Layout::LineBreaker::wrapTextContent const):
3049         * layout/inlineformatting/InlineLineBreaker.h:
3050
3051 2019-12-15  Zalan Bujtas  <zalan@apple.com>
3052
3053         [LFC][IFC] Fix imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-006.html
3054         https://bugs.webkit.org/show_bug.cgi?id=205245
3055         <rdar://problem/57943885>
3056
3057         Reviewed by Antti Koivisto.
3058
3059         Line breaking should be able to differentiate 
3060         1. the case when the candidate content's first character does not fit the line
3061         2. and when the candidate content has multiple runs and 
3062           (a) the overflow run is not the first one
3063           (b) it can't be wrapped and we fall back to the first run in the list
3064         In both cases wordBreakingBehavior returns { 0, { } }, where 0 is the trailing run index (first run) and the nullopt indicates
3065         that there's no partial content.
3066
3067         Introduce TextWrappingContext to be able to tell these cases apart. 
3068
3069         * layout/inlineformatting/InlineLineBreaker.cpp:
3070         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
3071         (WebCore::Layout::LineBreaker::wrapTextContent const):
3072         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
3073         (WebCore::Layout::LineBreaker::wordBreakingBehavior const): Deleted.
3074         * layout/inlineformatting/InlineLineBreaker.h:
3075
3076 2019-12-15  Zalan Bujtas  <zalan@apple.com>
3077
3078         [LFC][IFC] Introduce LineBreaker::PartialRun
3079         https://bugs.webkit.org/show_bug.cgi?id=205244
3080         <rdar://problem/57943825>
3081
3082         Reviewed by Antti Koivisto.
3083
3084         Use PartialRun instead of LeftSide and also use it as optional in PartialTrailingContent.
3085         This is in preparation for fixing "break-spaces" failing cases.
3086
3087         * layout/inlineformatting/InlineLineBreaker.cpp:
3088         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
3089         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
3090         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
3091         * layout/inlineformatting/InlineLineBreaker.h:
3092         * layout/inlineformatting/LineLayoutContext.cpp:
3093         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
3094
3095 2019-12-14  Per Arne Vollan  <pvollan@apple.com>
3096
3097         Map CSS value ID to system color in the UI process
3098         https://bugs.webkit.org/show_bug.cgi?id=204314
3099         <rdar://problem/57295392>
3100
3101         Reviewed by Brent Fulgham.
3102
3103         Currently, RenderThemeIOS is mapping CSS value IDs to system colors in the WebContent process. This mapping leads to
3104         invoking selectors on UITraitCollection and UIColor, which will send messages to the runningboard daemon. Since we
3105         will be blocking access to this daemon in the WebContent process, this mapping should be moved to the UI process.
3106         The UI process will create a mapping between CSS value IDs and system colors, and pass it to the WebContent process.
3107
3108         No new tests, covered by existing tests.
3109
3110         * WebCore.xcodeproj/project.pbxproj:
3111         * rendering/CSSValueKey.h: Added.
3112         (WebCore::operator==):
3113         (WebCore::CSSValueKey::encode const):
3114         (WebCore::CSSValueKey::decode):
3115         (WebCore::CSSValueKey::hash const):
3116         (WTF::CSSValueKeyHash::hash):
3117         (WTF::CSSValueKeyHash::equal):
3118         (WTF::HashTraits<WebCore::CSSValueKey>::emptyValue):
3119         (WTF::HashTraits<WebCore::CSSValueKey>::constructDeletedValue):
3120         (WTF::HashTraits<WebCore::CSSValueKey>::isDeletedValue):
3121         * rendering/RenderThemeIOS.h:
3122         * rendering/RenderThemeIOS.mm:
3123         (WebCore::cssValueIDSelectorList):
3124         (WebCore::systemColorFromCSSValueID):
3125         (WebCore::globalCSSValueToSystemColorMap):
3126         (WebCore::RenderThemeIOS::createCSSValueToSystemColorMap):
3127         (WebCore::RenderThemeIOS::setCSSValueToSystemColorMap):
3128         (WebCore::RenderThemeIOS::systemColor const):
3129
3130 2019-12-14  Zalan Bujtas  <zalan@apple.com>
3131
3132         [LFC][IFC] Fix imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-003.html
3133         https://bugs.webkit.org/show_bug.cgi?id=205237
3134         <rdar://problem/57940108>
3135
3136         Reviewed by Antti Koivisto.
3137
3138         "white-space: break-spaces" : A line breaking opportunity exists after every preserved white space character,
3139         including between white space characters.
3140
3141         * layout/inlineformatting/InlineLineBreaker.cpp:
3142         (WebCore::Layout::LineBreaker::Content::isAtSoftWrapOpportunity):
3143
3144 2019-12-14  Zalan Bujtas  <zalan@apple.com>
3145
3146         [LFC][IFC] Rename LineBreaker::Content::isAtContentBoundary to isAtSoftWrapOpportunity
3147         https://bugs.webkit.org/show_bug.cgi?id=205235
3148         <rdar://problem/57939955>
3149
3150         Reviewed by Antti Koivisto.
3151
3152         The "soft wrap opportunity" is closer to the spec term.
3153
3154         * layout/inlineformatting/InlineLineBreaker.cpp:
3155         (WebCore::Layout::endsWithSoftWrapOpportunity):
3156         (WebCore::Layout::LineBreaker::Content::isAtSoftWrapOpportunity):
3157         (WebCore::Layout::LineBreaker::Content::append):
3158         (WebCore::Layout::endsWithBreakingOpportunity): Deleted.
3159         (WebCore::Layout::LineBreaker::Content::isAtContentBoundary): Deleted.
3160         * layout/inlineformatting/InlineLineBreaker.h:
3161         * layout/inlineformatting/LineLayoutContext.cpp:
3162         (WebCore::Layout::LineLayoutContext::placeInlineItem):
3163
3164 2019-12-14  Zalan Bujtas  <zalan@apple.com>
3165
3166         [LFC][IFC] Add support for white-space: break-spaces
3167         https://bugs.webkit.org/show_bug.cgi?id=205234
3168         <rdar://problem/57938253>
3169
3170         Reviewed by Antti Koivisto.
3171
3172         "For break-spaces, a soft wrap opportunity exists after every space and every tab."
3173         There are a few different ways to deal with breakable whitespace content.
3174         The current approach is to split them into individual InlineTextItems so that
3175         line breaking sees them as individual runs so that it never needs to split them in
3176         case of overflow.
3177
3178         * layout/inlineformatting/InlineTextItem.cpp:
3179         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
3180         * layout/inlineformatting/text/TextUtil.cpp:
3181         (WebCore::Layout::TextUtil::shouldPreserveTrailingWhitespace):
3182
3183 2019-12-14  David Kilzer  <ddkilzer@apple.com>
3184
3185         Add release assert for selectedIndex in WebKit::WebPopupMenu::show()
3186         <https://webkit.org/b/205223>
3187         <rdar://problem/57929078>
3188
3189         Reviewed by Wenson Hsieh.
3190
3191         * platform/PopupMenu.h:
3192         (WebCore::PopupMenu::show):
3193         - Rename `index` parameter to `selectedIndex`.
3194
3195 2019-12-14  Zalan Bujtas  <zalan@apple.com>
3196
3197         [LFC][IFC] Add text-indent support
3198         https://bugs.webkit.org/show_bug.cgi?id=205231
3199         <rdar://problem/57932746>
3200
3201         Reviewed by Antti Koivisto.
3202
3203         This property specifies the indentation applied to lines of inline content in a block.
3204         The indent is treated as a margin applied to the start edge of the line box.
3205
3206         * layout/inlineformatting/InlineFormattingContext.cpp:
3207         (WebCore::Layout::InlineFormattingContext::lineLayout):
3208         (WebCore::Layout::InlineFormattingContext::constraintsForLine):
3209         * layout/inlineformatting/InlineFormattingContext.h:
3210         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3211         (WebCore::Layout::InlineFormattingContext::Geometry::computedTextIndent const):
3212         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3213         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
3214         * layout/inlineformatting/LineLayoutContext.cpp:
3215         (WebCore::Layout::LineLayoutContext::placeInlineItem):
3216
3217 2019-12-13  Sunny He  <sunny_he@apple.com>
3218
3219         Nullptr crash if SVG element if element parent becomes document node
3220         https://bugs.webkit.org/show_bug.cgi?id=205217
3221
3222         Reviewed by Ryosuke Niwa.
3223
3224         Test: svg/dom/replaceChild-document-crash.html
3225
3226         * rendering/RenderBox.cpp:
3227         (WebCore::RenderBox::layoutOverflowRectForPropagation const):
3228         * rendering/svg/RenderSVGText.cpp:
3229         (WebCore::RenderSVGText::layout):
3230
3231 2019-12-13  Brady Eidson  <beidson@apple.com>
3232
3233         Refactor ScriptController's proliferation of ExceptionDetails*.
3234         https://bugs.webkit.org/show_bug.cgi?id=205151
3235
3236         Reviewed by Alex Christensen.
3237
3238         No new tests (Refactor, no behavior change).
3239
3240         There's so many ExceptionDetails* null pointers being passed around in the ScriptController
3241         family of functions.
3242
3243         Let's make it a little more explicit which callers get exceptions and which don't.
3244
3245
3246         * Modules/plugins/QuickTimePluginReplacement.mm:
3247         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
3248
3249         * bindings/js/ScheduledAction.cpp:
3250         (WebCore::ScheduledAction::execute):
3251
3252         * bindings/js/ScriptController.cpp:
3253         (WebCore::ScriptController::evaluateInWorldIgnoringException):
3254         (WebCore::ScriptController::evaluateInWorld):
3255         (WebCore::ScriptController::evaluateIgnoringException):
3256         (WebCore::ScriptController::executeScriptInWorldIgnoringException):
3257         (WebCore::ScriptController::executeScriptInWorld):
3258         (WebCore::ScriptController::executeUserAgentScriptInWorld):
3259         (WebCore::ScriptController::executeScriptIgnoringException):
3260         (WebCore::ScriptController::executeIfJavaScriptURL):
3261         (WebCore::ScriptController::evaluate): Deleted.
3262         (WebCore::ScriptController::executeScript): Deleted.
3263         * bindings/js/ScriptController.h:
3264         
3265         * contentextensions/ContentExtensionsBackend.cpp:
3266         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
3267         
3268         * dom/Document.cpp:
3269         (WebCore::Document::ensurePlugInsInjectedScript):
3270         
3271         * dom/ScriptElement.cpp:
3272         (WebCore::ScriptElement::executeClassicScript):
3273         
3274         * html/HTMLMediaElement.cpp:
3275         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
3276         
3277         * inspector/InspectorFrontendClientLocal.cpp:
3278         (WebCore::InspectorFrontendClientLocal::evaluateAsBoolean):
3279         (WebCore::InspectorFrontendClientLocal::evaluateOnLoad):
3280         
3281         * inspector/agents/InspectorPageAgent.cpp:
3282         (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
3283         
3284         * loader/ContentFilter.cpp:
3285         (WebCore::ContentFilter::didDecide):
3286         
3287         * page/Frame.cpp:
3288         (WebCore::Frame::injectUserScriptImmediately):
3289         
3290         * xml/XMLTreeViewer.cpp:
3291         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
3292
3293 2019-12-13  Eric Carlson  <eric.carlson@apple.com>
3294
3295         Add remote media player message to load and play
3296         https://bugs.webkit.org/show_bug.cgi?id=205220
3297         <rdar://problem/57927486>
3298
3299         Reviewed by Jer Noble.
3300
3301         No new tests. Tested manually because it is not possible to test on a bot yet.
3302
3303         * platform/graphics/MediaPlayer.cpp:
3304         (WebCore::MediaPlayer::loadWithNextMediaEngine): Call the new method prepareForPlayback
3305         instead of making four calls to set properties on a new player.
3306         * platform/graphics/MediaPlayerPrivate.h:
3307         (WebCore::MediaPlayerPrivateInterface::load): Add a load variant that takes a URL,
3308         contentType, and keySystem.
3309         (WebCore::MediaPlayerPrivateInterface::prepareForPlayback):
3310
3311 2019-12-13  James Darpinian  <jdarpinian@chromium.org>
3312
3313         ANGLE: fix blending with alpha:false context
3314         https://bugs.webkit.org/show_bug.cgi?id=205218
3315
3316         Fixes WebGL conformance test context-hidden-alpha.html.
3317
3318         Reviewed by Alex Christensen.
3319
3320         * platform/graphics/cocoa/WebGLLayer.mm:
3321         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
3322             Specify internalformat GL_RGB instead of GL_BGRA_EXT when alpha is disabled.
3323
3324 2019-12-13  Jer Noble  <jer.noble@apple.com>
3325
3326         Unreviewed 32-bit build fix: explicitly cast the bitrate to an int when creating a JSON
3327         object for logging purposes.
3328
3329         * platform/mediacapabilities/MediaCapabilitiesLogging.cpp:
3330         (WebCore::toJSONObject):
3331
3332 2019-12-13  Dean Jackson  <dino@apple.com>
3333
3334         MacCatalyst build of libANGLE is installed in the incorrect location
3335         https://bugs.webkit.org/show_bug.cgi?id=205219
3336         <rdar://problem/57713353>
3337
3338         Reviewed by Simon Fraser.
3339
3340         The location that WebCore was looking for embedded libraries was
3341         incorrect for Catalyst builds. We never noticed because until now
3342         there were no embedded libraries, and local builds all go into
3343         the same location so this would only happen on Production builds.
3344
3345         Also, libANGLE became libANGLE-shared.
3346
3347         * Configurations/WebCore.xcconfig: Link with libANGLE's new name, and
3348         look in the correct directory.
3349
3350 2019-12-13  Myles C. Maxfield  <mmaxfield@apple.com>
3351
3352         [watchOS] Apple.com is rendered in Times New Roman
3353         https://bugs.webkit.org/show_bug.cgi?id=205179
3354         <rdar://problem/57233936>
3355
3356         Reviewed by Tim Horton.
3357
3358         We should just make watchOS use the same font lookup attributes as iOS and macOS.
3359
3360         Test: fast/text/smiley-local-font-src.html
3361
3362         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3363         (WebCore::FontDatabase::fontForPostScriptName):
3364
3365 2019-12-13  Chris Dumez  <cdumez@apple.com>
3366
3367         Implement PostMessageOptions for postMessage
3368         https://bugs.webkit.org/show_bug.cgi?id=191028
3369
3370         Reviewed by Alex Christensen.
3371
3372         Implement PostMessageOptions dictionary parameter for postMessage:
3373         - https://github.com/whatwg/html/issues/3799
3374         - https://github.com/w3c/ServiceWorker/pull/1344
3375
3376         Blink and Gecko already support this.
3377
3378         No new tests, rebaselined existing tests.
3379
3380         * CMakeLists.txt:
3381         * DerivedSources-input.xcfilelist:
3382         * DerivedSources-output.xcfilelist:
3383         * DerivedSources.make:
3384         * Headers.cmake:
3385         * Sources.txt:
3386         * WebCore.xcodeproj/project.pbxproj:
3387         * dom/MessagePort.cpp:
3388         (WebCore::MessagePort::postMessage):
3389         * dom/MessagePort.h:
3390         * dom/MessagePort.idl:
3391         * page/DOMWindow.cpp:
3392         (WebCore::DOMWindow::postMessage):
3393         * page/DOMWindow.h:
3394         (WebCore::WindowPostMessageOptions::WindowPostMessageOptions):
3395         * page/DOMWindow.idl:
3396         * page/PostMessageOptions.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
3397         (WebCore::PostMessageOptions::PostMessageOptions):
3398         * page/PostMessageOptions.idl: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
3399         * workers/DedicatedWorkerGlobalScope.cpp:
3400         (WebCore::DedicatedWorkerGlobalScope::postMessage):
3401         * workers/DedicatedWorkerGlobalScope.h:
3402         * workers/DedicatedWorkerGlobalScope.idl:
3403         * workers/Worker.cpp:
3404         (WebCore::Worker::postMessage):
3405         * workers/Worker.h:
3406         * workers/Worker.idl:
3407         * workers/service/ServiceWorker.cpp:
3408         (WebCore::ServiceWorker::postMessage):
3409         * workers/service/ServiceWorker.h:
3410         * workers/service/ServiceWorker.idl:
3411         * workers/service/ServiceWorkerClient.cpp:
3412         (WebCore::ServiceWorkerClient::postMessage):
3413         * workers/service/ServiceWorkerClient.h:
3414         * workers/service/ServiceWorkerClient.idl:
3415
3416 2019-12-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3417
3418         Implement encoding/decoding for DisplayList::DrawNativeImage
3419         https://bugs.webkit.org/show_bug.cgi?id=205200
3420
3421         Reviewed by Simon Fraser.
3422
3423         Implements basic encoding and decoding for the DrawNativeImage drawing item, such that it can be sent and
3424         replayed in the GPU process. See WebKit ChangeLogs for more details. Eventually, we should avoid calling into
3425         drawNativeImage in the web process altogether, but for now, both DrawNativeImage and DrawImage drawing items
3426         rely on drawing native images into ImageBuffers. See: <https://webkit.org/b/205213>.
3427
3428         * platform/graphics/NativeImage.h:
3429
3430         Add a NativeImageHandle wrapper around a NativeImagePtr to make it simpler to decode and encode NativeImagePtrs
3431         using << and >> operators.
3432
3433         * platform/graphics/displaylists/DisplayListItems.cpp:
3434         * platform/graphics/displaylists/DisplayListItems.h:
3435         (WebCore::DisplayList::DrawNativeImage::encode const):
3436         (WebCore::DisplayList::DrawNativeImage::decode):
3437         (WebCore::DisplayList::Item::encode const):
3438         (WebCore::DisplayList::Item::decode):
3439
3440 2019-12-13  youenn fablet  <youenn@apple.com>
3441
3442         Add support for WebIDL set-like forEach
3443         https://bugs.webkit.org/show_bug.cgi?id=204847
3444
3445         Reviewed by Chris Dumez.
3446
3447         Add support to setlike forEach as done for maplike.
3448         Covered by rebased binding tests and updated layout test.
3449
3450         * bindings/js/JSDOMBindingInternals.js:
3451         (forEachWrapper):
3452         * bindings/js/JSDOMMapLike.cpp:
3453         (WebCore::forwardForEachCallToBackingMap):
3454         * bindings/js/JSDOMSetLike.cpp:
3455         (WebCore::DOMSetAdapter::clear):
3456         (WebCore::forwardForEachCallToBackingSet):
3457         * bindings/js/JSDOMSetLike.h:
3458         (WebCore::DOMSetAdapter::add):
3459         (WebCore::getAndInitializeBackingSet):
3460         (WebCore::forwardSizeToSetLike):
3461         (WebCore::forwardEntriesToSetLike):
3462         (WebCore::forwardKeysToSetLike):
3463         (WebCore::forwardValuesToSetLike):
3464         (WebCore::forwardForEachToSetLike):
3465         (WebCore::forwardClearToSetLike):
3466         (WebCore::forwardHasToSetLike):
3467         (WebCore::forwardAddToSetLike):
3468         (WebCore::forwardDeleteToSetLike):
3469         * bindings/scripts/IDLParser.pm:
3470         (parseSetLikeProperties):
3471         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
3472         (WebCore::jsReadOnlySetLikePrototypeFunctionForEachBody):
3473         (WebCore::jsReadOnlySetLikePrototypeFunctionForEach):
3474         * bindings/scripts/test/JS/JSSetLike.cpp:
3475         (WebCore::jsSetLikePrototypeFunctionForEachBody):
3476         (WebCore::jsSetLikePrototypeFunctionForEach):
3477
3478 2019-12-13  Chris Dumez  <cdumez@apple.com>
3479
3480         REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flaky failure
3481         https://bugs.webkit.org/show_bug.cgi?id=205164
3482         <rdar://problem/57879042>
3483
3484         Reviewed by Alex Christensen.
3485
3486         Submitting a form should cancel any pending navigation scheduled by a previous submission of this form:
3487         - https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm (step 22.3)
3488
3489         No new tests, rebaselined existing tests.
3490
3491         * html/HTMLFormElement.cpp:
3492         (WebCore::HTMLFormElement::submit):
3493         * html/HTMLFormElement.h:
3494         * loader/FormSubmission.h:
3495         (WebCore::FormSubmission::cancel):
3496         (WebCore::FormSubmission::wasCancelled const):
3497         * loader/NavigationScheduler.cpp:
3498
3499 2019-12-13  John Wilander  <wilander@apple.com>
3500
3501         IsLoggedIn: Abstract data type for IsLoggedIn state
3502         https://bugs.webkit.org/show_bug.cgi?id=205041
3503         <rdar://problem/56723904>
3504
3505         Reviewed by Chris Dumez.
3506
3507         New API tests added.
3508
3509         * Sources.txt:
3510         * WebCore.xcodeproj/project.pbxproj:
3511         * page/LoggedInStatus.cpp: Added.
3512         (WebCore::LoggedInStatus::create):
3513         (WebCore::LoggedInStatus::LoggedInStatus):
3514         (WebCore::LoggedInStatus::setTimeToLive):
3515         (WebCore::LoggedInStatus::hasExpired const):
3516         (WebCore::LoggedInStatus::expiry const):
3517         * page/LoggedInStatus.h: Added.
3518         (WebCore::LoggedInStatus::registrableDomain const):
3519         (WebCore::LoggedInStatus::username const):
3520         (WebCore::LoggedInStatus::credentialTokenType const):
3521         (WebCore::LoggedInStatus::authenticationType const):
3522         (WebCore::LoggedInStatus::loggedInTime const):
3523
3524 2019-12-13  Per Arne Vollan  <pvollan@apple.com>
3525
3526         [iOS] Deny mach lookup access to "*.apple-extension-service" in the WebContent process
3527         https://bugs.webkit.org/show_bug.cgi?id=205134
3528         <rdar://problem/56984257>
3529
3530         Reviewed by Brent Fulgham.
3531
3532         Add method to Internals checking mach lookup access to a given XPC service name.
3533
3534         Test: fast/sandbox/ios/sandbox-mach-lookup.html
3535
3536         * testing/Internals.cpp:
3537         (WebCore::Internals::hasSandboxMachLookupAccessToXPCServiceName):
3538         * testing/Internals.h:
3539         * testing/Internals.idl:
3540
3541 2019-12-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3542
3543         [Clipboard API] Sanitize HTML and image data written using clipboard.write
3544         https://bugs.webkit.org/show_bug.cgi?id=205188
3545         <rdar://problem/57612968>
3546
3547         Reviewed by Darin Adler.
3548
3549         Sanitizes HTML ("text/html") and image ("image/png") content when writing to the platform pasteboard using the
3550         clipboard API. See below for more details.
3551
3552         Tests: editing/async-clipboard/sanitize-when-reading-markup.html
3553                editing/async-clipboard/sanitize-when-writing-image.html
3554                ClipboardTests.WriteSanitizedMarkup
3555
3556         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
3557         (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
3558
3559         Add a new helper method to sanitize `m_data` after loading finishes, but before invoking the completion handler
3560         to notify the data source about the clipboard data. Currently, we support writing "text/plain", "text/uri-list",
3561         "text/html" and "image/png"; we sanitize HTML by stripping away hidden content such as comments, script, and
3562         event listeners, and sanitize image data by painting it into a new graphics context and re-encoding the rendered
3563         contents as an image.
3564
3565         (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::invokeCompletionHandler):
3566         * Modules/async-clipboard/ClipboardItemBindingsDataSource.h:
3567         * platform/PlatformPasteboard.h:
3568         * platform/cocoa/PasteboardCocoa.mm:
3569         (WebCore::cocoaTypeToImageType):
3570         * platform/ios/PlatformPasteboardIOS.mm:
3571         (WebCore::PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite):
3572
3573         Adjust these helpers to map "image/png" to the platform PNG type on iOS ("public.png"). The extra
3574         IncludeImageTypes argument was added to avoid considering "image/png" a web-safe type for writing and reading
3575         when exercising DataTransfer APIs, which currently don't support reading the "image/png" MIME type. In the
3576         future, we should consider adding support for image sanitization when using DataTransfer.setData or
3577         DataTransferItemList.add, and then remove this flag.
3578
3579         (WebCore::createItemProviderRegistrationList):
3580         * platform/mac/LegacyNSPasteboardTypes.h:
3581
3582         Add an entry for legacyPNGPasteboardType on macOS, and replace one use of it in PasteboardCocoa.mm.
3583
3584         (WebCore::legacyPNGPasteboardType):
3585         * platform/mac/PlatformPasteboardMac.mm:
3586         (WebCore::PlatformPasteboard::write):
3587         (WebCore::PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite):
3588
3589         Likewise, map "image/png" to legacyPNGPasteboardType() on macOS, which was added above.
3590
3591         (WebCore::createPasteboardItem):
3592
3593 2019-12-13  Chris Dumez  <cdumez@apple.com>
3594
3595         Behavior of [[GetOwnProperty]] for cross-origin windows is not spec-compliant
3596         https://bugs.webkit.org/show_bug.cgi?id=205184
3597
3598         Reviewed by Darin Adler.
3599
3600         Behavior of [[GetOwnProperty]] for cross-origin windows is not spec-compliant:
3601         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
3602
3603         We should be able to return frames by name, even if their name conflict with the name of a
3604         same-origin window property (e.g. "close"). Previously, we would throw a SecurityError in
3605         this case.
3606
3607         No new tests, rebaselined existing test.
3608
3609         * bindings/js/JSDOMWindowCustom.cpp:
3610         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3611
3612 2019-12-13  Eric Carlson  <eric.carlson@apple.com>
3613
3614         Add infrastructure needed for playing media player in the GPU process
3615         https://bugs.webkit.org/show_bug.cgi?id=205094
3616         <rdar://problem/57815393>
3617
3618         Reviewed by Youenn Fablet.
3619
3620         No new tests, no functional change yet.
3621
3622         * WebCore.xcodeproj/project.pbxproj:
3623         * platform/ContentType.h:
3624         (WebCore::ContentType::encode const):
3625         (WebCore::ContentType::decode):
3626         * platform/graphics/MediaPlayer.cpp:
3627         (WebCore::nullLogger):
3628         (WebCore::nullContentTypeVector):
3629         (WebCore::mutableInstalledMediaEnginesVector):
3630         (WebCore::registerRemotePlayerCallback):
3631         (WebCore::RemoteMediaPlayerSupport::setRegisterRemotePlayerCallback):
3632         (WebCore::buildMediaEnginesVector):
3633         (WebCore::installedMediaEngines):
3634         (WebCore::addMediaEngine):
3635         (WebCore::MediaPlayer::mediaEngine):
3636         (WebCore::bestMediaEngineForSupportParameters):
3637         (WebCore::MediaPlayer::nextMediaEngine):
3638         (WebCore::MediaPlayer::create):
3639         (WebCore::MediaPlayer::MediaPlayer):
3640         (WebCore::MediaPlayer::nextBestMediaEngine):
3641         (WebCore::MediaPlayer::loadWithNextMediaEngine):
3642         (WebCore::MediaPlayer::getSupportedTypes):
3643         (WebCore::MediaPlayer::originsInMediaCache):
3644         (WebCore::MediaPlayer::clearMediaCache):
3645         (WebCore::MediaPlayer::clearMediaCacheForOrigins):
3646         (WebCore::MediaPlayer::supportsKeySystem):
3647         (WebCore::MediaPlayer::networkStateChanged):
3648         (WebCore::nextMediaEngine): Deleted.
3649         (WebCore::MediaPlayer::nextBestMediaEngine const): Deleted.
3650         * platform/graphics/MediaPlayer.h:
3651         (WebCore::MediaEngineSupportParameters::encode const):
3652         (WebCore::MediaEngineSupportParameters::decode):
3653         (WebCore::MediaPlayerFactory::~MediaPlayerFactory):
3654         (WebCore::MediaPlayerFactory::originsInMediaCache const):
3655         (WebCore::MediaPlayerFactory::clearMediaCache const):
3656         (WebCore::MediaPlayerFactory::clearMediaCacheForOrigins const):
3657         (WebCore::MediaPlayerFactory::supportsKeySystem const):
3658         (WebCore::MediaPlayer::setVideoFullscreenLayer): Deleted.
3659         (WebCore::MediaPlayer::size const): Deleted.
3660         (WebCore::MediaPlayer::invalidTime): Deleted.
3661         (WebCore::MediaPlayer::platformVolumeConfigurationRequired const): Deleted.
3662         (WebCore::MediaPlayer::contentMIMEType const): Deleted.
3663         (WebCore::MediaPlayer::contentTypeCodecs const): Deleted.
3664         (WebCore::MediaPlayer::contentMIMETypeWasInferredFromExtension const): Deleted.
3665         (WebCore::MediaPlayer::mediaPlayerLogIdentifier): Deleted.
3666         (WebCore::MediaPlayer::renderingCanBeAccelerated const): Deleted.
3667         (WebCore::MediaPlayer::renderingModeChanged const): Deleted.
3668         (WebCore::MediaPlayer::acceleratedCompositingEnabled): Deleted.
3669         (WebCore::MediaPlayer::activeSourceBuffersChanged): Deleted.
3670         (WebCore::MediaPlayer::playerContentBoxRect const): Deleted.
3671         (WebCore::MediaPlayer::playerContentsScale const): Deleted.
3672         (WebCore::MediaPlayer::shouldUsePersistentCache const): Deleted.
3673         (WebCore::MediaPlayer::mediaCacheDirectory const): Deleted.
3674         (WebCore::MediaPlayer::isVideoPlayer const): Deleted.
3675         (WebCore::MediaPlayer::mediaEngineUpdated): Deleted.
3676         (WebCore::MediaPlayer::isLooping const): Deleted.
3677         (WebCore::MediaPlayer::requestInstallMissingPlugins): Deleted.
3678         (WebCore::MediaPlayer::client const): Deleted.
3679         * platform/graphics/MediaPlayerEngineIdentifiers.h: Copied from Source/WebCore/platform/ContentType.h.
3680         (WebCore::MediaPlayerEngineIdentifiers::avFoundationEngineIdentifier):
3681         (WebCore::MediaPlayerEngineIdentifiers::avFoundationMSEEngineIdentifier):
3682         (WebCore::MediaPlayerEngineIdentifiers::avFoundationMediaStreamEngineIdentifier):
3683         (WebCore::MediaPlayerEngineIdentifiers::GStreamerMediaEngineIdentifier):
3684         (WebCore::MediaPlayerEngineIdentifiers::GStreamerMSEMediaEngineIdentifier):
3685         (WebCore::MediaPlayerEngineIdentifiers::holePunchMediaEngineIdentifier):
3686         (WebCore::MediaPlayerEngineIdentifiers::MediaFoundationMediaEngineIdentifier):
3687         * platform/graphics/PlatformTimeRanges.h:
3688         (WebCore::PlatformTimeRanges::PlatformTimeRanges): Deleted.
3689         (WebCore::PlatformTimeRanges::length const): Deleted.
3690         (WebCore::PlatformTimeRanges::Range::Range): Deleted.
3691         (WebCore::PlatformTimeRanges::Range::isPointInRange const): Deleted.
3692         (WebCore::PlatformTimeRanges::Range::isOverlappingRange const): Deleted.
3693         (WebCore::PlatformTimeRanges::Range::isContiguousWithRange const): Deleted.
3694         (WebCore::PlatformTimeRanges::Range::unionWithOverlappingOrContiguousRange const): Deleted.
3695         (WebCore::PlatformTimeRanges::Range::isBeforeRange const): Deleted.
3696         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3697         (WebCore::MediaPlayerPrivateAVFoundationCF::registerMediaEngine):
3698         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3699         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3700         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
3701         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3702         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
3703         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3704         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::registerMediaEngine):
3705         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3706         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
3707         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3708         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
3709         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp:
3710         (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
3711         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3712         (WebCore::MediaPlayerPrivateMediaFoundation::registerMediaEngine):
3713         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3714         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine):
3715
3716 2019-12-13  Cathie Chen  <cathiechen@igalia.com>
3717
3718         Fixed compile error in BaseAudioSharedUnit.h
3719         https://bugs.webkit.org/show_bug.cgi?id=205205
3720
3721         Need to include some headers and put "#pragma once" in front.
3722
3723         Unreviewed, fixed compile error.
3724
3725         * platform/mediastream/mac/BaseAudioSharedUnit.h:
3726
3727 2019-12-13  Zalan Bujtas  <zalan@apple.com>
3728
3729         [LFC][IFC] Fix fast/text/simple-line-with-br.html
3730         https://bugs.webkit.org/show_bug.cgi?id=205207
3731         <rdar://problem/57913504>
3732
3733         Reviewed by Antti Koivisto.
3734
3735         Apply https://www.w3.org/TR/css-text-3/#white-space-property's matrix to end-of-the-line whitespace.
3736         (Keep white-space: mormal no-wrap pre-wrap and pre-line content)
3737
3738         * layout/inlineformatting/InlineLineBreaker.cpp:
3739         (WebCore::Layout::shouldKeepEndOfLineWhitespace):
3740         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
3741         (WebCore::Layout::LineBreaker::Content::isVisuallyEmptyWhitespaceContentOnly const):
3742         (WebCore::Layout::isTrailingWhitespaceWithPreWrap): Deleted.
3743         * layout/inlineformatting/InlineLineBreaker.h:
3744         * layout/inlineformatting/InlineLineBuilder.cpp:
3745         (WebCore::Layout::LineBuilder::InlineItemRun::isTrimmableWhitespace const):
3746         * layout/inlineformatting/LineLayoutContext.cpp:
3747         (WebCore::Layout::LineLayoutContext::placeInlineItem):
3748
3749 2019-12-13  Chris Lord  <clord@igalia.com>
3750
3751         Implement OffscreenCanvas.convertToBlob
3752         https://bugs.webkit.org/show_bug.cgi?id=202573
3753
3754         Reviewed by Darin Adler.
3755
3756         Implement OffscreenCanvas.convertToBlob. This also involves making
3757         isSupportedImageMIMETypeForEncoding safe to use off the main thread,
3758         and implementing OffscreenCanvas.securityOrigin.
3759
3760         No new tests, these changes fix existing tests.
3761
3762         * html/OffscreenCanvas.cpp:
3763         (WebCore::toEncodingMimeType):
3764         (WebCore::qualityFromDouble):
3765         (WebCore::OffscreenCanvas::convertToBlob):
3766         (WebCore::OffscreenCanvas::securityOrigin const):
3767         * html/OffscreenCanvas.h:
3768         * html/OffscreenCanvas.idl:
3769         * platform/MIMETypeRegistry.cpp:
3770         (WebCore::MIMETypeRegistry::createMIMETypeRegistryThreadGlobalData):
3771         (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
3772         * platform/MIMETypeRegistry.h:
3773         (WebCore::MIMETypeRegistryThreadGlobalData::MIMETypeRegistryThreadGlobalData):
3774         (WebCore::MIMETypeRegistryThreadGlobalData::supportedImageMIMETypesForEncoding const):
3775         * platform/ThreadGlobalData.cpp:
3776         (WebCore::ThreadGlobalData::mimeTypeRegistryThreadGlobalData):
3777         * platform/ThreadGlobalData.h:
3778         * workers/WorkerGlobalScope.h:
3779
3780 2019-12-13  youenn fablet  <youenn@apple.com>
3781
3782         Make DOMCacheStorage::retrieveCaches take a CompletionHandler
3783         https://bugs.webkit.org/show_bug.cgi?id=205204
3784
3785         Reviewed by Chris Dumez.
3786
3787         Covered by existing tests.
3788
3789         * Modules/cache/DOMCacheEngine.cpp:
3790         (WebCore::DOMCacheEngine::errorToException):
3791         This will improve logging and will make sure we do not crash in debug in case of stopped error.
3792         * Modules/cache/DOMCacheStorage.cpp:
3793         (WebCore::DOMCacheStorage::retrieveCaches):
3794         Use of a completion handler to make sure we answer the caller, even with an error case.
3795         * Modules/cache/DOMCacheStorage.h:
3796
3797 2019-12-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3798
3799         [HarfBuzz] WebKitWebProcess crashes when displaying a KaTeX formula
3800         https://bugs.webkit.org/show_bug.cgi?id=204689
3801
3802         Reviewed by Carlos Alberto Lopez Perez.
3803
3804         We are creating and caching an hb_font_t for the given FontPlatformData's FT_Face, but the face is not
3805         referenced so it is destroyed eventually while the hb_font_t is still alive. We need to keep a reference of the
3806         FT_Face while the hb_font_t is alive.
3807
3808         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3809         (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Create the hb_face_t with
3810         hb_ft_face_create_referenced() instead of hb_ft_face_create_cached().
3811
3812 2019-12-13  Ali Juma  <ajuma@chromium.org>
3813
3814         Crash in RenderLayerBacking::updateCompositedBounds from using cleared WeakPtr from m_backingSharingLayers
3815         https://bugs.webkit.org/show_bug.cgi?id=204648
3816
3817         Reviewed by Simon Fraser.
3818
3819         RenderLayerBacking's clearBackingSharingProviders clears layers'
3820         backingSharingProviders unconditionally, even when a layer's
3821         backingSharingProvider is some other RenderLayerBacking's owning
3822         layer. This leaves the layer in a state where its backingProviderLayer
3823         is null, even though it appears in the other RenderLayerBacking's
3824         m_backingSharingLayers, which leads to a crash if this layer is destroyed
3825         and the other RenderLayerBacking tries to use its pointer to this
3826         layer.
3827
3828         Avoid this inconsistency by making clearBackingSharingProviders check
3829         whether a layer's backingSharingProvider is the current RenderLayerBacking's
3830         owner, before clearing it.
3831
3832         Test: compositing/shared-backing/move-sharing-child.html
3833
3834         * rendering/RenderLayerBacking.cpp:
3835         (WebCore::clearBackingSharingLayerProviders):
3836         (WebCore::RenderLayerBacking::setBackingSharingLayers):
3837         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
3838
3839 2019-12-13  Zalan Bujtas  <zalan@apple.com>
3840
3841         [LFC][IFC] Fix fast/text/simple-line-with-multiple-renderers.html
3842         https://bugs.webkit.org/show_bug.cgi?id=205193
3843         <rdar://problem/57900709>
3844
3845         Reviewed by Antti Koivisto.
3846
3847         Use LazyLineBreakIterator to find out if 2 (visually)adjacent non-whitespace inline items are
3848         on a soft breaking opportunity.
3849
3850         * layout/inlineformatting/InlineLineBreaker.cpp:
3851         (WebCore::Layout::endsWithBreakingOpportunity):
3852         (WebCore::Layout::LineBreaker::Content::isAtContentBoundary):
3853         * layout/inlineformatting/InlineTextItem.cpp:
3854         (WebCore::Layout::moveToNextBreakablePosition):
3855         * layout/inlineformatting/text/TextUtil.cpp:
3856         (WebCore::Layout::TextUtil::findNextBreakablePosition):
3857         * layout/inlineformatting/text/TextUtil.h:
3858
3859 2019-12-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3860
3861         Uninitialized variables in RenderLayer
3862         https://bugs.webkit.org/show_bug.cgi?id=205165
3863
3864         Reviewed by Simon Fraser.
3865
3866         * rendering/RenderLayer.cpp:
3867         (WebCore::RenderLayer::RenderLayer): Initialize m_isNormalFlowOnly and m_isCSSStackingContext.
3868
3869 2019-12-12  Joonghun Park  <jh718.park@samsung.com>
3870
3871         Unreviewed. Fix the build warnings below since r253353.
3872         warning: unused parameter 'foo' [-Wunused-parameter]
3873
3874         Also, remove unnecessary tab spaces from Internals.h.
3875
3876         No new tests, no new behavioral changes.
3877
3878         * testing/Internals.cpp:
3879         (WebCore::Internals::hasSandboxMachLookupAccessToGlobalName):
3880         * testing/Internals.h:
3881
3882 2019-12-12  Jack Lee  <shihchieh_lee@apple.com>
3883
3884         Protect lifetime of frame and frameView objects
3885         https://bugs.webkit.org/show_bug.cgi?id=205128
3886
3887         Reviewed by Ryosuke Niwa.
3888
3889         Could not write a reproducible test case for this.
3890
3891         * page/DOMWindow.cpp:
3892         (WebCore::DOMWindow::focus):
3893         * page/ios/EventHandlerIOS.mm:
3894         (WebCore::EventHandler::focusDocumentView):
3895         * page/mac/EventHandlerMac.mm:
3896         (WebCore::EventHandler::focusDocumentView):
3897
3898 2019-12-12  Jer Noble  <jer.noble@apple.com>
3899
3900         Add logging for MediaCapabilities.decodeInfo()
3901         https://bugs.webkit.org/show_bug.cgi?id=205172
3902
3903         Reviewed by Eric Carlson.
3904
3905         Add logging for decodingInfo() that can emit string versions of both the input
3906         MediaConfiguration and the output MediaCapabilitiesInfo objects.
3907
3908         * Modules/mediacapabilities/MediaCapabilities.cpp:
3909         (WebCore::MediaCapabilities::decodingInfo):
3910         * Sources.txt:
3911         * WebCore.xcodeproj/project.pbxproj:
3912         * platform/mediacapabilities/MediaCapabilitiesLogging.cpp: Added.
3913         (WebCore::toJSONObject):
3914         (WebCore::toJSONString):
3915         (WTF::LogArgument<WebCore::VideoConfiguration>::toString):
3916         (WTF::LogArgument<WebCore::AudioConfiguration>::toString):
3917         (WTF::LogArgument<WebCore::MediaConfiguration>::toString):
3918         (WTF::LogArgument<WebCore::MediaDecodingConfiguration>::toString):
3919         (WTF::LogArgument<WebCore::MediaEncodingConfiguration>::toString):
3920         (WTF::LogArgument<WebCore::MediaCapabilitiesInfo>::toString):
3921         (WTF::LogArgument<WebCore::MediaCapabilitiesDecodingInfo>::toString):
3922         (WTF::LogArgument<WebCore::MediaCapabilitiesEncodingInfo>::toString):
3923         (WTF::LogArgument<WebCore::ColorGamut>::toString):
3924         (WTF::LogArgument<WebCore::HdrMetadataType>::toString):
3925         (WTF::LogArgument<WebCore::TransferFunction>::toString):
3926         (WTF::LogArgument<WebCore::MediaDecodingType>::toString):
3927         (WTF::LogArgument<WebCore::MediaEncodingType>::toString):
3928         * platform/mediacapabilities/MediaCapabilitiesLogging.h: Added.
3929
3930 2019-12-12  David Kilzer  <ddkilzer@apple.com>
3931
3932         REGRESSION (r172814): Don't export inline SQLiteDatabase::disableThreadingChecks() method
3933         <https://webkit.org/b/205140>
3934
3935         Reviewed by Alex Christensen.
3936
3937         * platform/sql/SQLiteDatabase.h:
3938         (WebCore::SQLiteDatabase::disableThreadingChecks):
3939         Remove WEBCORE_EXPORT macro from inline method. This only seems
3940         to occur on Release builds with compiler optimizations disabled.
3941
3942 2019-12-12  Yusuke Suzuki  <ysuzuki@apple.com>
3943
3944         [JSC] Lock-down JSGlobalObject and derived classes in IsoSubspace
3945         https://bugs.webkit.org/show_bug.cgi?id=205108
3946
3947         Reviewed by Mark Lam.
3948
3949         We put derived classes of JSGlobalObject in IsoSubspace in WebCore side too.
3950
3951         * bindings/js/JSDOMGlobalObject.h:
3952         * bindings/js/JSDOMWindowBase.h:
3953         * bindings/js/JSDOMWrapper.cpp:
3954         (WebCore::globalObjectOutputConstraintSubspaceFor): Deleted.
3955         * bindings/js/JSDOMWrapper.h:
3956         * bindings/js/JSRemoteDOMWindowBase.h:
3957         * bindings/js/JSWindowProxy.h:
3958         * bindings/js/JSWorkerGlobalScopeBase.h:
3959         (WebCore::JSWorkerGlobalScopeBase::subspaceFor):
3960         * bindings/js/JSWorkletGlobalScopeBase.h:
3961         (WebCore::JSWorkletGlobalScopeBase::subspaceFor):
3962         * bindings/js/WebCoreJSClientData.cpp:
3963         (WebCore::JSVMClientData::JSVMClientData):
3964         * bindings/js/WebCoreJSClientData.h:
3965         (WebCore::JSVMClientData::subspaceForJSDOMWindow):
3966         (WebCore::JSVMClientData::subspaceForJSDedicatedWorkerGlobalScope):
3967         (WebCore::JSVMClientData::subspaceForJSRemoteDOMWindow):
3968         (WebCore::JSVMClientData::subspaceForJSWorkerGlobalScope):
3969         (WebCore::JSVMClientData::subspaceForJSServiceWorkerGlobalScope):
3970         (WebCore::JSVMClientData::subspaceForJSPaintWorkletGlobalScope):
3971         (WebCore::JSVMClientData::subspaceForJSWorkletGlobalScope):
3972         (WebCore::JSVMClientData::forEachOutputConstraintSpace):
3973         (WebCore::JSVMClientData::globalObjectOutputConstraintSpace): Deleted.
3974         * bindings/scripts/CodeGeneratorJS.pm:
3975         (GenerateHeader):
3976         (GenerateImplementation):
3977         (GeneratePrototypeDeclaration):
3978         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3979         * bindings/scripts/test/JS/JSMapLike.cpp:
3980         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3981         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
3982         * bindings/scripts/test/JS/JSSetLike.cpp:
3983         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3984         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3985         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3986         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3987         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3988         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3989         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3990         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
3991         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3992         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3993         * bindings/scripts/test/JS/JSTestException.cpp:
3994         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3995         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3996         (WebCore::JSTestGlobalObject::subspaceForImpl):
3997         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3998         (WebCore::JSTestGlobalObject::subspaceFor):
3999         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
4000         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
4001         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
4002         * bindings/scripts/test/JS/JSTestInterface.cpp:
4003