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