a233e94884de3a02e1b6847470fae359f1666df7
[WebKit.git] / Source / WebCore / ChangeLog
1 2019-12-12  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC][IFC] Fix fast/text/whitespace/023.html
4         https://bugs.webkit.org/show_bug.cgi?id=205170
5         <rdar://problem/57881365>
6
7         Reviewed by Antti Koivisto.
8
9         Do not try to find expansion opportunities in content with preserved whitespace.
10
11         * layout/inlineformatting/InlineLineBuilder.cpp:
12         (WebCore::Layout::LineBuilder::ContinousContent::ContinousContent):
13         (WebCore::Layout::LineBuilder::ContinousContent::append):
14         (WebCore::Layout::LineBuilder::ContinousContent::close):
15
16 2019-12-12  Patrick Griffis  <pgriffis@igalia.com>
17
18         [SOUP] Use new API for strict secure cookies
19         https://bugs.webkit.org/show_bug.cgi?id=169356
20
21         Reviewed by Michael Catanzaro.
22
23         The new soup API implements this spec:
24
25         https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-01
26
27         * platform/network/soup/NetworkStorageSessionSoup.cpp:
28         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
29         (WebCore::NetworkStorageSession::setCookies):
30
31 2019-12-12  Don Olmstead  <don.olmstead@sony.com>
32
33         [CMake] Add LibPSL::LibPSL target
34         https://bugs.webkit.org/show_bug.cgi?id=205149
35
36         Reviewed by Michael Catanzaro.
37
38         Use LibPSL target.
39
40         * platform/Curl.cmake:
41
42 2019-12-12  Zalan Bujtas  <zalan@apple.com>
43
44         [LFC][IFC] Fix fast/text/whitespace/simple-line-layout-tab-position.html
45         https://bugs.webkit.org/show_bug.cgi?id=205160
46         <rdar://problem/57876474>
47
48         Reviewed by Antti Koivisto.
49
50         Use the content box (and not the border box) as the start position when measuring text and also include
51         the not-yet committed content.
52         e.g. <pre style="padding: 100px;">text[tab character]</pre>
53         When we measure the width of the [tab] character, the start position input to the text measuring is
54         1. relative to the content box (0px vs 100px)
55         2. includes the [text] not-yet committed content width
56
57         This patch also ensures that we only fast-path the collapsible whitespace characters.
58
59         * layout/inlineformatting/LineLayoutContext.cpp:
60         (WebCore::Layout::LineLayoutContext::placeInlineItem):
61         * layout/inlineformatting/text/TextUtil.cpp:
62         (WebCore::Layout::TextUtil::width):
63
64 2019-12-12  Antti Koivisto  <antti@apple.com>
65
66         REGRESSION(r252979): Avoid unnecessary work when searching for the flow when constructing line layout iteratorAvoid unnecessary work when searching for the flow when constructing line layout iterator
67         https://bugs.webkit.org/show_bug.cgi?id=205155
68         <rdar://problem/57846936>
69
70         Reviewed by Zalan Bujtas.
71
72         We unecessarily searched the ancestor chain flow the RenderFlow. We can avoid this
73         for now since we know only candidate it the direct parent.
74
75         * rendering/line/LineLayoutTraversal.cpp:
76         (WebCore::LineLayoutTraversal::lineLayoutSystemFlowForRenderer):
77         (WebCore::LineLayoutTraversal::firstTextBoxFor):
78         (WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
79         (WebCore::LineLayoutTraversal::elementBoxFor):
80         (WebCore::LineLayoutTraversal::flowForText): Deleted.
81
82 2019-12-12  youenn fablet  <youenn@apple.com>
83
84         Roll-out part of revision 253275 related to rotation handling
85         https://bugs.webkit.org/show_bug.cgi?id=205156
86
87         Unreviewed.
88
89         These changes only work for a remote source, not a local one.
90         Roll-them out until we have a proper fix.
91
92         * platform/mediastream/RealtimeVideoSource.cpp:
93         (WebCore::m_source):
94         (WebCore::RealtimeVideoSource::sourceSettingsChanged):
95         * platform/mediastream/RealtimeVideoSource.h:
96
97 2019-12-12  youenn fablet  <youenn@apple.com>
98
99         Remove debug ASSERT in PeerConnectionBackend
100         https://bugs.webkit.org/show_bug.cgi?id=205061
101
102         Reviewed by Eric Carlson.
103
104         Remove two wrong debug asserts.
105         Move the isClosed check just before resolving/rejecting the promise since at resume time, a lot might happen,
106         including closing the peer connection.
107         Covered by tests no longer crashing.
108
109         * Modules/mediastream/PeerConnectionBackend.cpp:
110         (WebCore::PeerConnectionBackend::createOfferSucceeded):
111         (WebCore::PeerConnectionBackend::createOfferFailed):
112         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
113         (WebCore::PeerConnectionBackend::createAnswerFailed):
114         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
115         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
116         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
117         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
118         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
119         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
120
121 2019-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
122
123         Add a missing entry in EnumTraits<WebCore::DisplayList::ItemType>
124         https://bugs.webkit.org/show_bug.cgi?id=205154
125         <rdar://problem/57864862>
126
127         Reviewed by Tim Horton.
128
129         Add a missing `ItemType::SetCTM`. This will be tested in a future patch by enabling canvas layout tests with
130         GPU process enabled.
131
132         * platform/graphics/displaylists/DisplayListItems.h:
133
134 2019-12-11  Chris Dumez  <cdumez@apple.com>
135
136         Trying to set toString / valueOf on a cross-origin Location object should throw a SecurityError
137         https://bugs.webkit.org/show_bug.cgi?id=205143
138
139         Reviewed by Ryosuke Niwa.
140
141         Trying to set toString / valueOf on a cross-origin Location object should throw a SecurityError.
142         We previously silently ignored those.
143
144         No new tests, rebaselined existing test.
145
146         fast/dom/Window/Location/location-override-toString.html also makes sure we still cannot override the
147         value to location.toString (same origin).
148
149         * bindings/js/JSLocationCustom.cpp:
150         (WebCore::putCommon):
151
152 2019-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
153
154         Implement DisplayListRecorder::Recorder::getCTM and DisplayListRecorder::Recorder::setCTM
155         https://bugs.webkit.org/show_bug.cgi?id=205139
156
157         Reviewed by Simon Fraser.
158
159         Implements these two methods on Recorder, which are invoked from GraphicsContext::setCTM and
160         GraphicsContext::getCTM, respectively. See below for more details.
161
162         Additionally rebaselines displaylists/extent-includes-transforms.html.
163
164         * platform/graphics/displaylists/DisplayList.h:
165
166         Add a new type to represent the SetCTM display list item.
167
168         (WebCore::DisplayList::Item::isStateItemType):
169         * platform/graphics/displaylists/DisplayListItems.cpp:
170         (WebCore::DisplayList::Item::sizeInBytes):
171         (WebCore::DisplayList::SetCTM::SetCTM):
172         (WebCore::DisplayList::SetCTM::apply const):
173         (WebCore::DisplayList::operator<<):
174         * platform/graphics/displaylists/DisplayListItems.h:
175         (WebCore::DisplayList::SetCTM::create):
176         (WebCore::DisplayList::SetCTM::transform const):
177         (WebCore::DisplayList::SetCTM::encode const):
178         (WebCore::DisplayList::SetCTM::decode):
179         (WebCore::DisplayList::Item::encode const):
180         (WebCore::DisplayList::Item::decode):
181
182         Add DisplayList::SetCTM, which represents a call to set the current transformation matrix on the graphics
183         context. This is very similar to ConcatCTM.
184
185         * platform/graphics/displaylists/DisplayListRecorder.cpp:
186         (WebCore::DisplayList::Recorder::setCTM):
187
188         Set the current state's CTM to the new value. Additionally, update clipBounds by applying the inverse
189         transformation matrix of the inverse of the original CTM, multiplied by the new CTM. This is because setting
190         the CTM from to `B` from `A` is equivalent to multiplying `A` by `A_inverse * B`, so we want to map the clip
191         rect through the inverse of this matrix, `(A_inverse * B)_inverse`.
192
193         (WebCore::DisplayList::Recorder::getCTM):
194
195         Return the current CTM by asking the topmost state on the stack, and ignore the IncludeDeviceScale flag for the
196         time being.
197
198         (WebCore::DisplayList::Recorder::ContextState::setCTM):
199         * platform/graphics/displaylists/DisplayListRecorder.h:
200
201 2019-12-11  Don Olmstead  <don.olmstead@sony.com>
202
203         [CMake] Add OpenJPEG find module
204         https://bugs.webkit.org/show_bug.cgi?id=204657
205
206         Reviewed by Michael Catanzaro.
207
208         Use OpenJPEG target.
209
210         * platform/ImageDecoders.cmake:
211
212 2019-12-11  Jiewen Tan  <jiewen_tan@apple.com>
213
214         [WebAuthn] Combine AuthenticatorResponse and PublicKeyCredentialData
215         https://bugs.webkit.org/show_bug.cgi?id=190783
216         <rdar://problem/57781183>
217
218         Reviewed by Brent Fulgham.
219
220         This patch combines AuthenticatorResponse and PublicKeyCredentialData, and therefore renames
221         PublicKeyCredentialData to AuthenticatorResponseData as well. The complexity of WebKit's CTAP
222         implementation has reached the point that PublicKeyCredentialData is not appropriate to represent
223         all the different type of responses from authenticators anymore. For example, authenticatorGetNextAssertion
224         depends on the numberOfCredentials member from authenticatorGetAssertion response to function, but
225         numberOfCredentials is not used anywhere else. Therefore, a polymorphic type is needed to
226         represent different responses from authenticators instead of an uniform one, i.e., PublicKeyCredentialData.
227
228         AuthenticatorResponse seems to be the best fit. However, there are some limitations:
229         1) it is a WebIDL interface, and therefore is RefCounted. RefCounted objects cannot be serialized through
230         IPC. To solve this, AuthenticatorResponseData (PublicKeyCredentialData) is kept as an intermediate type
231         that is only used during IPC.
232         2) it doesn't contain all the information from an actual authenticator response. To solve this, it
233         has been enlarged to include all members from PublicKeyCredential. After this patch, PublicKeyCredential
234         will be a thin wrapper on top of AuthenticatorResponse.
235
236         Covered by existing tests.
237
238         * CMakeLists.txt:
239         * DerivedSources-input.xcfilelist:
240         * DerivedSources-output.xcfilelist:
241         * DerivedSources.make:
242         * Headers.cmake:
243         * Modules/webauthn/AuthenticationExtensionsClientOutputs.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
244         * Modules/webauthn/AuthenticationExtensionsClientOutputs.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
245         This is separated from PublicKeyCredential such that AuthenticatorResponse can include it.
246         * Modules/webauthn/AuthenticatorAssertionResponse.cpp: Added.
247         (WebCore::AuthenticatorAssertionResponse::create):
248         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
249         (WebCore::AuthenticatorAssertionResponse::data const):
250         * Modules/webauthn/AuthenticatorAssertionResponse.h:
251         (WebCore::AuthenticatorAssertionResponse::create): Deleted.
252         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse): Deleted.
253         * Modules/webauthn/AuthenticatorAttestationResponse.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorAttestationResponse.h.
254         (WebCore::AuthenticatorAttestationResponse::create):
255         (WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
256         (WebCore::AuthenticatorAttestationResponse::data const):
257         * Modules/webauthn/AuthenticatorAttestationResponse.h:
258         (WebCore::AuthenticatorAttestationResponse::create): Deleted.
259         (WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse): Deleted.
260         * Modules/webauthn/AuthenticatorCoordinator.cpp:
261         (WebCore::AuthenticatorCoordinator::create const):
262         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
263         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
264         * Modules/webauthn/AuthenticatorResponse.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
265         (WebCore::AuthenticatorResponse::tryCreate):
266         (WebCore::AuthenticatorResponse::data const):
267         (WebCore::AuthenticatorResponse::extensions const):
268         (WebCore::AuthenticatorResponse::setClientDataJSON):
269         (WebCore::AuthenticatorResponse::clientDataJSON const):
270         (WebCore::AuthenticatorResponse::AuthenticatorResponse):
271         * Modules/webauthn/AuthenticatorResponse.h:
272         (WebCore::AuthenticatorResponse::rawId const):
273         (WebCore::AuthenticatorResponse::setExtensions):
274         (WebCore::AuthenticatorResponse::AuthenticatorResponse): Deleted.
275         (WebCore::AuthenticatorResponse::clientDataJSON const): Deleted.
276         * Modules/webauthn/AuthenticatorResponseData.h: Renamed from Source/WebCore/Modules/webauthn/PublicKeyCredentialData.h.
277         (WebCore::AuthenticatorResponseData::encode const):
278         (WebCore::AuthenticatorResponseData::decode):
279         * Modules/webauthn/PublicKeyCredential.cpp:
280         (WebCore::PublicKeyCredential::create):
281         (WebCore::PublicKeyCredential::rawId const):
282         (WebCore::PublicKeyCredential::getClientExtensionResults const):
283         (WebCore::PublicKeyCredential::PublicKeyCredential):
284         (WebCore::PublicKeyCredential::tryCreate): Deleted.
285         * Modules/webauthn/PublicKeyCredential.h:
286         * Modules/webauthn/PublicKeyCredential.idl:
287         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
288         (fido::readCTAPMakeCredentialResponse):
289         (fido::readCTAPGetAssertionResponse):
290         * Modules/webauthn/fido/DeviceResponseConverter.h:
291         A more appropriate derived type of AuthenticatorResponse is used to replace PublicKeyCredentialData.
292         * Modules/webauthn/fido/U2fResponseConverter.cpp:
293         (fido::readU2fRegisterResponse):
294         (fido::readU2fSignResponse):
295         * Modules/webauthn/fido/U2fResponseConverter.h:
296         A more appropriate derived type of AuthenticatorResponse is used to replace PublicKeyCredentialData.
297         * Sources.txt:
298         * WebCore.xcodeproj/project.pbxproj:
299
300 2019-12-11  Eric Carlson  <eric.carlson@apple.com>
301
302         Add encoders for MediaPlayerEnum enums
303         https://bugs.webkit.org/show_bug.cgi?id=205125
304         <rdar://problem/57842985>
305
306         Reviewed by Dean Jackson.
307
308         No new tests, no functional change.
309
310         * Modules/encryptedmedia/CDM.cpp:
311         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
312         * Modules/mediasource/MediaSource.cpp:
313         (WebCore::MediaSource::setPrivateAndOpen):
314         (WebCore::MediaSource::seekToTime):
315         (WebCore::MediaSource::monitorSourceBuffers):
316         (WebCore::MediaSource::streamEndedWithError):
317         (WebCore::MediaSource::isTypeSupported):
318         * Modules/mediasource/SourceBuffer.cpp:
319         (WebCore::SourceBuffer::removeCodedFrames):
320         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
321         * dom/DOMImplementation.cpp:
322         (WebCore::DOMImplementation::createDocument):
323         * html/HTMLMediaElement.cpp:
324         (WebCore::HTMLMediaElement::parseAttribute):
325         (WebCore::HTMLMediaElement::canPlayType const):
326         (WebCore::HTMLMediaElement::selectMediaResource):
327         (WebCore::HTMLMediaElement::loadResource):
328         (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
329         (WebCore::HTMLMediaElement::mediaLoadingFailed):
330         (WebCore::HTMLMediaElement::setNetworkState):
331         (WebCore::HTMLMediaElement::seekWithTolerance):
332         (WebCore::HTMLMediaElement::movieLoadType const):
333         (WebCore::HTMLMediaElement::preload const):
334         (WebCore::HTMLMediaElement::selectNextSourceChild):
335         (WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported):
336         (WebCore::stringForNetworkState): Deleted.
337         * html/HTMLMediaElement.h:
338         (WebCore::HTMLMediaElement::videoFullscreenGravity const):
339         (WebCore::HTMLMediaElement::preloadValue const):
340         * html/MediaElementSession.cpp:
341         (WebCore::MediaElementSession::effectivePreloadForElement const):
342         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
343         (WebCore::VideoFullscreenModelVideoElement::requestFullscreenMode):
344         (WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity):
345         * platform/graphics/MediaPlayer.cpp:
346         (WebCore::bestMediaEngineForSupportParameters):
347         (WebCore::MediaPlayer::supportsType):
348         (WebCore::MediaPlayer::networkStateChanged):
349         (WebCore::convertEnumerationToString):
350         * platform/graphics/MediaPlayer.h:
351         * platform/graphics/MediaPlayerEnums.h:
352         * platform/graphics/MediaPlayerPrivate.h:
353         (WebCore::MediaPlayerPrivateInterface::hasAvailableVideoFrame const):
354         (WebCore::MediaPlayerPrivateInterface::movieLoadType const):
355         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
356         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
357         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType):
358         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
359         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
360         (WebCore::MediaPlayerPrivateAVFoundation::load):
361         (WebCore::MediaPlayerPrivateAVFoundation::prepareToPlay):
362         (WebCore::MediaPlayerPrivateAVFoundation::isReadyForVideoSetup const):
363         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
364         (WebCore::MediaPlayerPrivateAVFoundation::movieLoadType const):
365         (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
366         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
367         (WebCore::MediaPlayerPrivateAVFoundation::metaDataAvailable const):
368         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
369         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
370         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
371         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
372         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
373         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity):
374         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
375         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
376         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
377         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
378         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
379         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
380         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::movieLoadType const):
381         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
382         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying const):
383         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
384         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
385         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
386         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
387         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
388         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
389         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
390         (WebCore::MediaSourcePrivateAVFObjC::markEndOfStream):
391         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
392         (WebCore::SourceBufferPrivateAVFObjC::readyState const):
393         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
394         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
395         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
396         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
397         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
398         (WebCore::MediaPlayerPrivateGStreamer::load):
399         (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
400         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
401         (WebCore::MediaPlayerPrivateGStreamer::play):
402         (WebCore::MediaPlayerPrivateGStreamer::setPreload):
403         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
404         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
405         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
406         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
407         (WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag):
408         (WebCore::MediaPlayerPrivateGStreamer::movieLoadType const):
409         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
410         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
411         (dumpReadyState):
412         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
413         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
414         (WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
415         (WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
416         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
417         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
418         (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
419         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp:
420         (WebCore::MediaPlayerPrivateHolePunch::supportsType):
421         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h:
422         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
423         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
424         (WebCore::MediaPlayerPrivateMediaFoundation::supportsType):
425         (WebCore::MediaPlayerPrivateMediaFoundation::load):
426         (WebCore::MediaPlayerPrivateMediaFoundation::updateReadyState):
427         (WebCore::MediaPlayerPrivateMediaFoundation::onSessionEnded):
428         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
429         (-[WebAVPlayerLayer setVideoGravity:]):
430         * platform/mac/VideoFullscreenInterfaceMac.mm:
431         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
432         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
433         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
434         (WebCore::MockMediaPlayerMediaSource::supportsType):
435         (WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource):
436         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
437         (WebCore::MockMediaSourcePrivate::addSourceBuffer):
438         (WebCore::MockMediaSourcePrivate::markEndOfStream):
439         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
440         (WebCore::MockSourceBufferPrivate::readyState const):
441         (WebCore::MockSourceBufferPrivate::canSwitchToType):
442
443 2019-12-11  Sihui Liu  <sihui_liu@apple.com>
444
445         IndexedDB: Introduce WebIDBServer class
446         https://bugs.webkit.org/show_bug.cgi?id=205095
447
448         Reviewed by Alex Christensen.
449
450         No behavior change.
451
452         * Modules/indexeddb/server/IDBServer.cpp:
453         (WebCore::IDBServer::IDBServer::create):
454         * Modules/indexeddb/server/IDBServer.h:
455
456 2019-12-11  Don Olmstead  <don.olmstead@sony.com>
457
458         [CMake] Add HarfBuzz targets
459         https://bugs.webkit.org/show_bug.cgi?id=205042
460
461         Reviewed by Konstantin Tokarev.
462
463         Use the HarfBuzz targets directly instead of HARFBUZZ_LIBRARIES and
464         HARFBUZZ_INCLUDE_DIRS.
465
466         * platform/FreeType.cmake:
467
468 2019-12-11  Chris Dumez  <cdumez@apple.com>
469
470         [Bindings] Cross-origin checks happen too late for overloaded methods
471         https://bugs.webkit.org/show_bug.cgi?id=205092
472
473         Reviewed by Sam Weinig.
474
475         Cross-origin checks happen too late for overloaded methods. We're supposed to do the security check
476         and then find the right overload to call [1]. In our bindings, we first find the right overload body
477         to call and then do the security check in the body of the chosen overload. This results in the wrong
478         exception being thrown in some cases (TypeError due to missing arguments instead of a SecurityError).
479
480         [1] https://heycam.github.io/webidl/#dfn-create-operation-function
481
482         No new tests, updated existing tests.
483
484         * bindings/scripts/CodeGeneratorJS.pm:
485         (GenerateOperationBodyDefinition):
486         (GenerateOperationDefinition):
487
488 2019-12-11  Wenson Hsieh  <wenson_hsieh@apple.com>
489
490         Make incremental builds faster after modifying DisplayListItems.h
491         https://bugs.webkit.org/show_bug.cgi?id=205032
492
493         Reviewed by Tim Horton.
494
495         Move the declaration of DisplayList::Item currently in DisplayListItems.h out into DisplayList.h, such that
496         adding or modifying encoding and decoding logic in DisplayListItems.h dirties fewer source files when
497         rebuilding.
498
499         * Headers.cmake:
500         * platform/graphics/displaylists/DisplayList.h:
501         (WebCore::DisplayList::Item::type const):
502         (WebCore::DisplayList::Item::isDrawingItem const):
503         (WebCore::DisplayList::Item::isStateItem const):
504         (WebCore::DisplayList::Item::isStateItemType):
505         * platform/graphics/displaylists/DisplayListItems.h:
506         (WebCore::DisplayList::Item::type const): Deleted.
507         (WebCore::DisplayList::Item::isDrawingItem const): Deleted.
508         (WebCore::DisplayList::Item::isStateItem const): Deleted.
509         (WebCore::DisplayList::Item::isStateItemType): Deleted.
510
511 2019-12-11  Sihui Liu  <sihui_liu@apple.com>
512
513         IndexedDB: export some functions in WebCore
514         https://bugs.webkit.org/show_bug.cgi?id=205081
515
516         Reviewed by Alex Christensen.
517
518         We will need these in https://bugs.webkit.org/show_bug.cgi?id=203690.
519
520         No behavior change.
521
522         * Modules/indexeddb/IDBKeyData.h:
523         * Modules/indexeddb/IDBKeyRangeData.h:
524         * Modules/indexeddb/IDBValue.h:
525         * Modules/indexeddb/shared/IDBCursorInfo.h:
526         * Modules/indexeddb/shared/IDBError.h:
527         * Modules/indexeddb/shared/IDBGetAllRecordsData.h:
528         * Modules/indexeddb/shared/IDBGetRecordData.h:
529         * Modules/indexeddb/shared/IDBIterateCursorData.h:
530         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
531         * Modules/indexeddb/shared/IDBRequestData.h:
532         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
533         * Modules/indexeddb/shared/IDBResultData.h:
534         * Modules/indexeddb/shared/IDBTransactionInfo.h:
535
536 2019-12-11  Sihui Liu  <sihui_liu@apple.com>
537
538         IndexedDB: remove LockHolder parameters
539         https://bugs.webkit.org/show_bug.cgi?id=205076
540
541         Reviewed by Alex Christensen.
542
543         The LockHolder parameters were used to only ensure we have acquired a lock before using IDBBackingStore. To work
544         toward https://bugs.webkit.org/show_bug.cgi?id=203690 we will not need these any more.
545
546         No behavior change.
547
548         * Modules/indexeddb/server/IDBBackingStore.h:
549         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
550         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
551         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
552         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
553         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
554         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
555         (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
556         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
557         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
558         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
559         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
560         (WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
561         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
562         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
563         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
564         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
565         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
566         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
567         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
568         (WebCore::IDBServer::MemoryIDBBackingStore::revertGeneratedKeyNumber):
569         (WebCore::IDBServer::MemoryIDBBackingStore::maybeUpdateKeyGeneratorNumber):
570         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
571         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
572         (WebCore::IDBServer::MemoryIDBBackingStore::infoForObjectStore):
573         (WebCore::IDBServer::MemoryIDBBackingStore::deleteBackingStore):
574         (WebCore::IDBServer::MemoryIDBBackingStore::close):
575         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
576         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
577         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
578         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
579         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
580         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
581         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
582         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
583         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
584         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
585         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
586         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
587         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
588         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
589         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
590         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
591         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
592         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
593         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
594         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
595         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
596         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
597         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
598         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
599         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
600         (WebCore::IDBServer::SQLiteIDBBackingStore::prefetchCursor):
601         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
602         (WebCore::IDBServer::SQLiteIDBBackingStore::close):
603         (WebCore::IDBServer::SQLiteIDBBackingStore::hasTransaction const):
604         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
605         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
606         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
607         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore):
608         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
609         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
610         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
611         (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
612         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore):
613         (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
614         (WebCore::IDBServer::UniqueIDBDatabase::performClearObjectStore):
615         (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
616         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
617         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
618         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
619         (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
620         (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord):
621         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords):
622         (WebCore::IDBServer::UniqueIDBDatabase::performGetCount):
623         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteRecord):
624         (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor):
625         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
626         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
627         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
628         (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
629         (WebCore::IDBServer::UniqueIDBDatabase::performActivateTransactionInBackingStore):
630         (WebCore::IDBServer::UniqueIDBDatabase::abortTransactionOnMainThread):
631         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionOnMainThread):
632         (WebCore::IDBServer::UniqueIDBDatabase::suspend):
633         * Modules/indexeddb/server/UniqueIDBDatabase.h:
634
635 2019-12-11  youenn fablet  <youenn@apple.com>
636
637         (r252889) webrtc/peerconnection-page-cache.html is crashing on iOS Debug
638         https://bugs.webkit.org/show_bug.cgi?id=205017
639         <rdar://problem/57757026>
640
641         Reviewed by Eric Carlson.
642
643         HTMLMediaElement is scheduling some tasks using Timers that are not suspendable.
644         This patch uses task enqueuing through the script execution context event loop which respects page cache suspend/resume logic
645         for the update play state timer.
646         Other timers should follow.
647
648         Covered by tests no longer crashing in Debug mode.
649
650         * dom/ScriptExecutionContext.h:
651         (WebCore::ScriptExecutionContext::enqueueTaskForDispatcher):
652         * dom/TaskSource.h:
653         * html/HTMLMediaElement.cpp:
654         (WebCore::HTMLMediaElement::HTMLMediaElement):
655         (WebCore::HTMLMediaElement::enqueueTaskForDispatcher):
656         * html/HTMLMediaElement.h:
657         * platform/DeferrableTask.h:
658         (WebCore::DeferrableTask::DeferrableTask):
659         * platform/GenericTaskQueue.h:
660         (WebCore::TaskDispatcher::TaskDispatcher):
661         (WebCore::TaskDispatcher::postTask):
662         (WebCore::GenericTaskQueue::GenericTaskQueue):
663
664 2019-12-11  Zalan Bujtas  <zalan@apple.com>
665
666         [LFC][IFC] Fix fast/text/hyphenate-limit-lines.html
667         https://bugs.webkit.org/show_bug.cgi?id=205115
668         <rdar://problem/57837829>
669
670         Reviewed by Antti Koivisto.
671
672         Do not adjust the m_successiveHyphenatedLineCount unless it's the end of the line (either split or push).
673
674         * layout/inlineformatting/LineLayoutContext.cpp:
675         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
676
677 2019-12-11  Zalan Bujtas  <zalan@apple.com>
678
679         [LFC][IFC] Move single whitespace measuring to TextUtil
680         https://bugs.webkit.org/show_bug.cgi?id=205096
681         <rdar://problem/57818442>
682
683         Reviewed by Antti Koivisto.
684
685         If the TextUtil::width() callsites pass in the InlineTextItem, we can fast-path the single whitespace
686         character case (performance) and return width < 0 (correctness) when word-spacing is negative.
687
688         * layout/inlineformatting/InlineLineBreaker.cpp:
689         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
690         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
691         * layout/inlineformatting/LineLayoutContext.cpp:
692         (WebCore::Layout::inlineItemWidth):
693         * layout/inlineformatting/text/TextUtil.cpp:
694         (WebCore::Layout::TextUtil::width):
695         (WebCore::Layout::TextUtil::hyphenPositionBefore): Deleted.
696         * layout/inlineformatting/text/TextUtil.h:
697
698 2019-12-11  Zalan Bujtas  <zalan@apple.com>
699
700         [LFC][IFC] Partial trailing width should include the hyphen when applicable
701         https://bugs.webkit.org/show_bug.cgi?id=205090
702         <rdar://problem/57813491>
703
704         Reviewed by Antti Koivisto.
705
706         In order to properly text-align: justify the content, we need to know the final width of
707         the trailing run including the injected hyphen.
708
709         * layout/inlineformatting/InlineLineBreaker.cpp:
710         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
711
712 2019-12-11  Thibault Saunier  <tsaunier@igalia.com>
713
714         [GStreamer][MediaStream] Fix GStreamer capturer mock
715         https://bugs.webkit.org/show_bug.cgi?id=205066
716
717         - Presets where wrongly generated based on GStreamer capabilities
718         - Audio capturer was not taking into account echo cancellation
719
720         Reviewed by Philippe Normand.
721
722         This fixes a few tests
723
724         * platform/mediastream/RealtimeVideoCaptureSource.h:
725         (WebCore::RealtimeVideoCaptureSource::canResizeVideoFrames const):
726         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
727         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
728         (WebCore::WrappedMockRealtimeAudioSource::addHum):
729         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
730         (WebCore::WrappedMockRealtimeVideoSource::presets):
731         (WebCore::MockGStreamerVideoCaptureSource::generatePresets):
732         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
733         * platform/mock/MockRealtimeVideoSource.h:
734
735 2019-12-11  Charlie Turner  <cturner@igalia.com>
736
737         [GStreamer] Invalid use of UTF-8 validation in ClearKey key data
738         https://bugs.webkit.org/show_bug.cgi?id=205106
739
740         Reviewed by Xabier Rodriguez-Calvar.
741
742         media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
743
744         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
745         (findAndSetKey): Mistakenly was using utf-8 conversions on binary
746         data, which in some cases caused invalid key data being given to
747         GCrypt.
748
749 2019-12-11  Yusuke Suzuki  <ysuzuki@apple.com>
750
751         [JSC] Put all API related JS cells into IsoSubspace
752         https://bugs.webkit.org/show_bug.cgi?id=205097
753
754         Reviewed by Mark Lam.
755
756         * bindings/js/JSDOMGlobalObject.cpp:
757         (WebCore::JSDOMGlobalObject::finishCreation):
758         * bindings/js/JSDOMWrapper.cpp:
759         (WebCore::JSDOMObject::JSDOMObject):
760         * bindings/js/JSWindowProxy.cpp:
761         (WebCore::JSWindowProxy::setWindow):
762
763 2019-12-10  youenn fablet  <youenn@apple.com>
764
765         TrackListBase does not need to be an ActiveDOMObject
766         https://bugs.webkit.org/show_bug.cgi?id=205063
767
768         Reviewed by Eric Carlson.
769
770         Made TrackListBase a ContextDestructrionObserver instead of an ActiveDOMObject.
771         No observable change of behavior.
772
773         * html/track/AudioTrackList.cpp:
774         (WebCore::AudioTrackList::activeDOMObjectName const): Deleted.
775         * html/track/AudioTrackList.h:
776         * html/track/AudioTrackList.idl:
777         * html/track/TextTrackList.cpp:
778         (WebCore::TextTrackList::activeDOMObjectName const): Deleted.
779         * html/track/TextTrackList.h:
780         * html/track/TextTrackList.idl:
781         * html/track/TrackListBase.cpp:
782         (WebCore::TrackListBase::TrackListBase):
783         * html/track/TrackListBase.h:
784         * html/track/VideoTrackList.cpp:
785         (WebCore::VideoTrackList::activeDOMObjectName const): Deleted.
786         * html/track/VideoTrackList.h:
787         * html/track/VideoTrackList.idl:
788
789 2019-12-10  Cathie Chen  <cathiechen@igalia.com>
790
791         Fixed Pattern.h compile error
792         https://bugs.webkit.org/show_bug.cgi?id=205101
793
794         Need to include "Image.h" to use ImageHandle.
795
796         Unreviewed, fixed compile error.
797
798         * platform/graphics/Pattern.h:
799
800 2019-12-10  Fujii Hironori  <Hironori.Fujii@sony.com>
801
802         [Win] Fix MSVC warning C4701: potentially uninitialized local variable 'x' used
803         https://bugs.webkit.org/show_bug.cgi?id=205052
804
805         Reviewed by Don Olmstead.
806
807         * platform/graphics/cairo/CairoOperations.cpp:
808         (WebCore::Cairo::setLineCap): Zero-initialize a local variable cairoCap.
809         (WebCore::Cairo::setLineJoin): Zero-initialize a local variable cairoJoin
810         * platform/network/NetworkStorageSession.cpp:
811         (WebCore::NetworkStorageSession::shouldBlockCookies const): Added
812         ASSERT_NOT_REACHED() and return false at the end of the function.
813
814 2019-12-10  Per Arne Vollan  <pvollan@apple.com>
815
816         [iOS] Calls to the device motion API should be done in the UI process
817         https://bugs.webkit.org/show_bug.cgi?id=204770
818
819         Reviewed by Brent Fulgham.
820
821         The device motion API on iOS is communicating with iohideventsystem. Since mach lookup to this daemon
822         will be closed, the calls to this API should be moved from the WebContent process to the UI process.
823         This patch implements forwarding of the device orientation requests to the UI process through the
824         class, DeviceOrientationUpdateProvider, which is subclassed by WebDeviceOrientationUpdateProvider in
825         modern WebKit. This class implements forwarding of the requests to the UI process, and receives
826         device orientation updates from the UI process. An instance of this class will be shared by all
827         device orientation clients on a page, and passed as part of the page configuration parameters. On
828         the UI process side, the class WebDeviceOrientationUpdateProviderProxy attached to the Web page
829         proxy is taking care of calling the device orientation API through the existing WebCoreMotionManager
830         Objective-C class, and send device orientation updates back to the Web process. Also, use a weak
831         hash set of clients in WebDeviceOrientationUpdateProvider.
832
833         No new tests, covered by existing tests.
834
835         * dom/Document.cpp:
836         * platform/ios/DeviceMotionClientIOS.h:
837         * platform/ios/DeviceMotionClientIOS.mm:
838         (WebCore::DeviceMotionClientIOS::DeviceMotionClientIOS):
839         (WebCore::DeviceMotionClientIOS::startUpdating):
840         (WebCore::DeviceMotionClientIOS::stopUpdating):
841         (WebCore::DeviceMotionClientIOS::deviceMotionControllerDestroyed):
842         * platform/ios/DeviceOrientationClientIOS.mm:
843         (WebCore::DeviceOrientationClientIOS::startUpdating):
844         (WebCore::DeviceOrientationClientIOS::stopUpdating):
845         (WebCore::DeviceOrientationClientIOS::deviceOrientationControllerDestroyed):
846         * platform/ios/DeviceOrientationUpdateProvider.h:
847         * platform/ios/MotionManagerClient.h:
848         (WebCore::MotionManagerClient::orientationChanged):
849         (WebCore::MotionManagerClient::motionChanged):
850         * platform/ios/WebCoreMotionManager.h:
851         * platform/ios/WebCoreMotionManager.mm:
852         (-[WebCoreMotionManager addMotionClient:]):
853         (-[WebCoreMotionManager removeMotionClient:]):
854         (-[WebCoreMotionManager checkClientStatus]):
855         (-[WebCoreMotionManager sendAccelerometerData:]):
856         (-[WebCoreMotionManager sendMotionData:withHeading:]):
857
858 2019-12-10  Per Arne Vollan  <pvollan@apple.com>
859
860         Make it possible to add regression tests for blocked XPC services
861         https://bugs.webkit.org/show_bug.cgi?id=204967
862
863         Reviewed by Brent Fulgham.
864
865         On macOS and iOS, it should be possible to add regression tests for blocked mach services. Add a method
866         to Internals, which checks whether a given process has access to mach lookup for a given global service
867         name. Currently, the only supported process is the WebContent process since the PIDs of other processes
868         are not readily available in Internals, but support for other processes will be added when needed.
869
870         No new tests, since this patch is in preparation for adding regression tests for sandbox changes.
871
872         * testing/Internals.cpp:
873         (WebCore::Internals::hasSandboxMachLookupAccessToGlobalName):
874         * testing/Internals.h:
875         * testing/Internals.idl:
876
877 2019-12-10  Sihui Liu  <sihui_liu@apple.com>
878
879         IndexedDB: remove timer for completed operation in IDBTransaction
880         https://bugs.webkit.org/show_bug.cgi?id=205043
881
882         Reviewed by Brady Eidson.
883
884         Using a zero-delay Timer is slower than executing task immediately, and there is no specific reason to use a 
885         Timer here.
886
887         Covered by existing tests.
888
889         * Modules/indexeddb/IDBTransaction.cpp:
890         (WebCore::IDBTransaction::IDBTransaction):
891         (WebCore::IDBTransaction::operationCompletedOnServer):
892         (WebCore::IDBTransaction::handleOperationsCompletedOnServer):
893         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
894         (WebCore::IDBTransaction::scheduleCompletedOperationTimer): Deleted.
895         (WebCore::IDBTransaction::completedOperationTimerFired): Deleted.
896         * Modules/indexeddb/IDBTransaction.h:
897
898 2019-12-10  Per Arne Vollan  <pvollan@apple.com>
899
900         [iOS] Deny mach lookup access to network extension services in the WebContent sandbox
901         https://bugs.webkit.org/show_bug.cgi?id=203929
902
903         Reviewed by Brent Fulgham.
904
905         Add a global flag to NetworkExtensionContentFilter to indicate whether network extension sandbox extensions have
906         been consumed. If the flag has been set, there is no need to check NEFilterSource.filterRequired, since the flag
907         will tell if filtering is required. Checking NEFilterSource.filterRequired will lead to other mach lookups which
908         we are trying to avoid.
909
910         The test ContentFiltering.LazilyLoadPlatformFrameworks has been modified.
911
912         * WebCore.xcodeproj/project.pbxproj:
913         * platform/cocoa/NetworkExtensionContentFilter.h:
914         * platform/cocoa/NetworkExtensionContentFilter.mm:
915         (WebCore::NetworkExtensionContentFilter::enabled):
916
917 2019-12-10  Commit Queue  <commit-queue@webkit.org>
918
919         Unreviewed, rolling out r253321.
920         https://bugs.webkit.org/show_bug.cgi?id=205084
921
922         1% regression in RAMification (Requested by yusukesuzuki on
923         #webkit).
924
925         Reverted changeset:
926
927         "[JSC] Put JSArray in IsoSubspace"
928         https://bugs.webkit.org/show_bug.cgi?id=205049
929         https://trac.webkit.org/changeset/253321
930
931 2019-12-10  Zalan Bujtas  <zalan@apple.com>
932
933         [LFC][IFC] Call RenderText:text() to get the rendered content instead of ::originalText()
934         https://bugs.webkit.org/show_bug.cgi?id=205079
935         <rdar://problem/57804297>
936
937         Reviewed by Antti Koivisto.
938
939         It fixes the cases when the original text content is different from the rendered content (e.g. Yen symbol).
940
941         * layout/layouttree/LayoutTreeBuilder.cpp:
942         (WebCore::Layout::TreeBuilder::createLayoutBox):
943
944 2019-12-10  Zalan Bujtas  <zalan@apple.com>
945
946         [LFC][IFC][Painting] TextRuns always have 0 left offset
947         https://bugs.webkit.org/show_bug.cgi?id=205071
948         <rdar://problem/57801254>
949
950         Reviewed by Antti Koivisto.
951
952         As the comment indicates TextRun start with the left offset of 0.
953         This patch also removes some FloatRect -> LayoutRect conversions (to match SLL's painting coordinates).
954
955         * layout/displaytree/DisplayInlineContent.cpp:
956         (WebCore::Display:: const):
957         * layout/integration/LayoutIntegrationLineLayout.cpp:
958         (WebCore::LayoutIntegration::computeVisualOverflow):
959         (WebCore::LayoutIntegration::LineLayout::collectOverflow):
960         (WebCore::LayoutIntegration::LineLayout::paint):
961
962 2019-12-10  Antti Koivisto  <antti@apple.com>
963
964         Remove behavior that makes <br> boxes 0-height in quirks mode
965         https://bugs.webkit.org/show_bug.cgi?id=205004
966
967         Reviewed by Zalan Bujtas.
968
969         Implementation of the <br> quirk includes zeroing its height. This has no layout or rendering effects,
970         it exists purely to maintain render tree dump output for tests.
971
972         This patch removes this behavior but maintains the render tree dump output on the RenderTreeAsText
973         level (thus avoiding giant test rebasing), and makes it easier to get the same output from all paths.
974
975         * rendering/InlineBox.cpp:
976         (WebCore::InlineBox::logicalHeight const):
977         (WebCore::InlineBox::baselinePosition const):
978         (WebCore::InlineBox::lineHeight const):
979
980         Remove the hack from line boxes.
981
982         * rendering/RenderLineBreak.cpp:
983         (WebCore::RenderLineBreak::boundingBoxForRenderTreeDump const):
984
985         Add special bounding box code for this case.
986         This can be removed in future with a test rebase.
987
988         * rendering/RenderLineBreak.h:
989         * rendering/RenderTreeAsText.cpp:
990         (WebCore::RenderTreeAsText::writeRenderObject):
991         * rendering/SimpleLineLayoutResolver.cpp:
992         (WebCore::SimpleLineLayout::RunResolver::Run::rect const):
993
994         Remove the hack from simple lines.
995
996         (WebCore::SimpleLineLayout::RunResolver::RunResolver):
997         * rendering/SimpleLineLayoutResolver.h:
998         (WebCore::SimpleLineLayout::RunResolver::Run::baselineOffset const):
999         (WebCore::SimpleLineLayout::RunResolver::Iterator::atBegin const):
1000         * rendering/line/LineLayoutTraversal.h:
1001         (WebCore::LineLayoutTraversal::Box::baselineOffset const):
1002         (WebCore::LineLayoutTraversal::Box::isHorizontal const):
1003         (WebCore::LineLayoutTraversal::Box::useLineBreakBoxRenderTreeDumpQuirk const):
1004         * rendering/line/LineLayoutTraversalComplexPath.h:
1005         (WebCore::LineLayoutTraversal::ComplexPath::isHorizontal const):
1006         (WebCore::LineLayoutTraversal::ComplexPath::baselineOffset const):
1007         (WebCore::LineLayoutTraversal::ComplexPath::useLineBreakBoxRenderTreeDumpQuirk const):
1008         * rendering/line/LineLayoutTraversalDisplayRunPath.h:
1009         (WebCore::LineLayoutTraversal::DisplayRunPath::baselineOffset const):
1010         (WebCore::LineLayoutTraversal::DisplayRunPath::isHorizontal const):
1011         (WebCore::LineLayoutTraversal::DisplayRunPath::useLineBreakBoxRenderTreeDumpQuirk const):
1012         (WebCore::LineLayoutTraversal::DisplayRunPath::isLastOnLine const):
1013         (WebCore::LineLayoutTraversal::DisplayRunPath::lineBox const):
1014         * rendering/line/LineLayoutTraversalSimplePath.h:
1015         (WebCore::LineLayoutTraversal::SimplePath::baselineOffset const):
1016         (WebCore::LineLayoutTraversal::SimplePath::isHorizontal const):
1017         (WebCore::LineLayoutTraversal::SimplePath::useLineBreakBoxRenderTreeDumpQuirk const):
1018
1019 2019-12-10  Antti Koivisto  <antti@apple.com>
1020
1021         [LFC][Integration] Output hyphen strings
1022         https://bugs.webkit.org/show_bug.cgi?id=205058
1023
1024         Reviewed by Zalan Bujtas.
1025
1026         * rendering/line/LineLayoutTraversalDisplayRunPath.h:
1027         (WebCore::LineLayoutTraversal::DisplayRunPath::hasHyphen const):
1028
1029 2019-12-10  Zalan Bujtas  <zalan@apple.com>
1030
1031         [LFC][IFC] Fix fast/text/simple-line-layout-hyphenation-constrains.html
1032         https://bugs.webkit.org/show_bug.cgi?id=205048
1033         <rdar://problem/57780425>
1034
1035         Reviewed by Antti Koivisto.
1036
1037         Remove this hack for now and come up with a more sensible fix later if it breaks some tests.
1038
1039         * layout/inlineformatting/InlineLineBreaker.cpp:
1040         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
1041
1042 2019-12-10  Zalan Bujtas  <zalan@apple.com>
1043
1044         [LFC][IFC] Fix fast/text/basic/005.html
1045         https://bugs.webkit.org/show_bug.cgi?id=205047
1046         <rdar://problem/57780017>
1047
1048         Reviewed by Antti Koivisto.
1049
1050         Remove the code that triggers the assert on negative word-spacing.
1051         Trimming is safe with negative values (and any negative trimmed width special handing should be in LineBreaker).
1052
1053         * layout/inlineformatting/InlineLineBuilder.cpp:
1054         (WebCore::Layout::LineBuilder::TrimmableContent::append):
1055
1056 2019-12-10  Yusuke Suzuki  <ysuzuki@apple.com>
1057
1058         [JSC] Put JSArray in IsoSubspace
1059         https://bugs.webkit.org/show_bug.cgi?id=205049
1060
1061         Reviewed by Mark Lam.
1062
1063         RuntimeArray is inheriting JSArray. We should have separate IsoSubspace for this.
1064
1065         * bindings/js/WebCoreJSClientData.cpp:
1066         (WebCore::JSVMClientData::JSVMClientData):
1067         * bindings/js/WebCoreJSClientData.h:
1068         (WebCore::JSVMClientData::runtimeArraySpace):
1069         * bridge/runtime_array.cpp:
1070         (JSC::RuntimeArray::subspaceForImpl):
1071         * bridge/runtime_array.h:
1072         (JSC::RuntimeArray::create): Deleted.
1073         (JSC::RuntimeArray::getLength const): Deleted.
1074         (JSC::RuntimeArray::getConcreteArray const): Deleted.
1075         (JSC::RuntimeArray::createPrototype): Deleted.
1076         (JSC::RuntimeArray::createStructure): Deleted.
1077
1078 2019-12-09  Eric Carlson  <eric.carlson@apple.com>
1079
1080         Rename media in the GPU process preference
1081         https://bugs.webkit.org/show_bug.cgi?id=205013
1082         <rdar://problem/57755319>
1083
1084         Reviewed by Tim Horton.
1085
1086         * page/Settings.yaml:
1087
1088 2019-12-09  Fujii Hironori  <Hironori.Fujii@sony.com>
1089
1090         [WinCairo] Add support of Unicode surrogate pair for simple texts
1091         https://bugs.webkit.org/show_bug.cgi?id=205003
1092
1093         Reviewed by Don Olmstead.
1094
1095         FontCache::systemFallbackForCharacters of Windows port was working
1096         only for BMP because it's using GetFontUnicodeRanges API which
1097         supports only BMP. Use GetCharacterPlacement API to get glyphs for
1098         non-BMP.
1099
1100         GlyphPage::fill of WinCairo port was working only for BMP because
1101         it's using GetGlyphIndices API which supports only BMP. Use
1102         GetCharacterPlacement API to get glyphs for non-BMP.
1103
1104         This change can be tested by pixel tests, but WinCairo port
1105         doesn't include -expected.png files yet. Tested manually.
1106
1107         * platform/graphics/win/FontCacheWin.cpp:
1108         (WebCore::currentFontContainsCharacterNonBMP): Added.
1109         (WebCore::currentFontContainsCharacter): Changed to take a string
1110         instead of a 16bit character.
1111         (WebCore::FontCache::systemFallbackForCharacters):
1112         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
1113         (WebCore::GlyphPage::fill): Use GetCharacterPlacement for non-BMP.
1114
1115 2019-12-09  Megan Gardner  <megan_gardner@apple.com>
1116
1117         Fill HighlightRangeGroup and HighlightMap with values from JavaScript
1118         https://bugs.webkit.org/show_bug.cgi?id=204934
1119         rdar://problem/57686335
1120
1121         Reviewed by Simon Fraser.
1122
1123         Fillout HighlightMap and HighlightRangeGroup with the information that we're passed from
1124         the JavaScript side. Make sure that the javascript objects are filled out correctly.
1125
1126         Test: highlight/highlight-map-and-group.html
1127
1128         * Modules/highlight/HighlightMap.cpp:
1129         (WebCore::HighlightMap::synchronizeBackingMap):
1130         (WebCore::HighlightMap::setFromMapLike):
1131         (WebCore::HighlightMap::clear):
1132         (WebCore::HighlightMap::remove):
1133         (WebCore::HighlightMap::getGroupForStyle):
1134         (WebCore::HighlightMap::addHighlightGroup): Deleted.
1135         (WebCore::HighlightMap::namedItem const): Deleted.
1136         (WebCore::HighlightMap::setNamedItem): Deleted.
1137         (WebCore::HighlightMap::deleteNamedProperty): Deleted.
1138         * Modules/highlight/HighlightMap.h:
1139         (WebCore::HighlightMap::backingMap):
1140         (WebCore::HighlightMap::synchronizeBackingMap): Deleted.
1141         (WebCore::HighlightMap::clear): Deleted.
1142         * Modules/highlight/HighlightMap.idl:
1143         * Modules/highlight/HighlightRangeGroup.cpp:
1144         (WebCore::HighlightRangeGroup::HighlightRangeGroup):
1145         (WebCore::HighlightRangeGroup::initializeSetLike):
1146         (WebCore::HighlightRangeGroup::removeFromSetLike):
1147         (WebCore::HighlightRangeGroup::clearFromSetLike):
1148         (WebCore::HighlightRangeGroup::addToSetLike):
1149         (WebCore::HighlightRangeGroup::addRange): Deleted.
1150         (WebCore::HighlightRangeGroup::removeRange): Deleted.
1151         (WebCore::HighlightRangeGroup::Iterator::Iterator): Deleted.
1152         (WebCore::HighlightRangeGroup::Iterator::next): Deleted.
1153         * Modules/highlight/HighlightRangeGroup.h:
1154         (WebCore::HighlightRangeGroup::ranges const):
1155         (): Deleted.
1156         (WebCore::HighlightRangeGroup::createIterator): Deleted.
1157         * Modules/highlight/HighlightRangeGroup.idl:
1158         * dom/StaticRange.cpp:
1159         (WebCore::StaticRange::operator== const):
1160         * dom/StaticRange.h:
1161
1162 2019-12-09  Truitt Savell  <tsavell@apple.com>
1163
1164         Unreviewed, rolling out r253299.
1165
1166         Casued 30+ imported/ test failures on Mac wk2
1167
1168         Reverted changeset:
1169
1170         "Throttling requestAnimationFrame should be controlled by
1171         RenderingUpdateScheduler"
1172         https://bugs.webkit.org/show_bug.cgi?id=204713
1173         https://trac.webkit.org/changeset/253299
1174
1175 2019-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1176
1177         Finish encoding/decoding support for DisplayList::SetState
1178         https://bugs.webkit.org/show_bug.cgi?id=205018
1179
1180         Reviewed by Tim Horton.
1181
1182         Finishes encoding and decoding support for the `SetState` display list item. See below for more details.
1183
1184         * platform/graphics/Gradient.h:
1185         (WebCore::Gradient::ColorStop::encode const):
1186         (WebCore::Gradient::ColorStop::decode):
1187         (WebCore::Gradient::LinearData::encode const):
1188         (WebCore::Gradient::LinearData::decode):
1189         (WebCore::Gradient::RadialData::encode const):
1190         (WebCore::Gradient::RadialData::decode):
1191         (WebCore::Gradient::ConicData::encode const):
1192         (WebCore::Gradient::ConicData::decode):
1193         (WebCore::Gradient::encode const):
1194         (WebCore::Gradient::decode):
1195
1196         Introduce encoding and decoding support for WebCore::Gradient, and all of its constituent data members.
1197
1198         * platform/graphics/GraphicsContext.h:
1199
1200         Remove ShadowColorChange, which was unused; instead, shadow color changes are indicated by the ShadowChange
1201         flag, which also encompasses shadow offset and blur.
1202
1203         * platform/graphics/Image.h:
1204
1205         Move DisplayList::ImageHandle to ImageHandle in Image.h, so that it can be referenced in the encode/decode
1206         methods of WebCore::Pattern.
1207
1208         * platform/graphics/Pattern.h:
1209         (WebCore::Pattern::encode const):
1210         (WebCore::Pattern::decode):
1211
1212         Introduce encoding and decoding support for WebCore::Pattern.
1213
1214         * platform/graphics/displaylists/DisplayListItems.cpp:
1215         (WebCore::DisplayList::FillRectWithGradient::FillRectWithGradient):
1216
1217         Implement encode and decode for FillRectWithGradient, now that we're able to encode and decode Gradients.
1218
1219         * platform/graphics/displaylists/DisplayListItems.h:
1220         (WebCore::DisplayList::SetState::encode const):
1221         (WebCore::DisplayList::SetState::decode):
1222
1223         Encode the remaining data members of a GraphicsContextStateChange's state. These are: strokeGradient,
1224         strokePattern, fillGradient, fillPattern, shadowOffset, shadowBlur, shadowColor (which was not previously being
1225         encoded due to ShadowColorChange never being set), strokeThickness, textDrawingMode, strokeStyle, fillRule,
1226         compositeOperator, blendMode, imageInterpolationQuality, shouldAntialias, shouldSmoothFonts,
1227         shouldSubpixelQuantizeFonts and shadowsIgnoreTransforms.
1228
1229         (WebCore::DisplayList::FillRectWithGradient::encode const):
1230         (WebCore::DisplayList::FillRectWithGradient::decode):
1231         (WebCore::DisplayList::Item::encode const):
1232         (WebCore::DisplayList::Item::decode):
1233         (WebCore::DisplayList::FillRectWithGradient::FillRectWithGradient): Deleted.
1234
1235 2019-12-09  Zalan Bujtas  <zalan@apple.com>
1236
1237         [LFC][IFC] Add support for word-break: break-word (and overflow-wrap)
1238         https://bugs.webkit.org/show_bug.cgi?id=205024
1239         <rdar://problem/57766087>
1240
1241         Reviewed by Antti Koivisto.
1242
1243         isTextSplitAtArbitraryPositionAllowed() returns true if the text content can just split anywhere.
1244         word-break: break-word behaves like that unless the line already has breaking opportunity.
1245         See https://www.w3.org/TR/css-text-3/#word-break-property
1246
1247         * layout/inlineformatting/InlineLineBreaker.cpp:
1248         (WebCore::Layout::isTextContentWrappingAllowed):
1249         (WebCore::Layout::isContentSplitAllowed):
1250         (WebCore::Layout::isTextSplitAtArbitraryPositionAllowed):
1251         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
1252         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
1253         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
1254         (WebCore::Layout::isContentWrappingAllowed): Deleted.
1255         * layout/inlineformatting/InlineLineBreaker.h:
1256
1257 2019-12-06  Ryosuke Niwa  <rniwa@webkit.org>
1258
1259         Stop active DOM objects in removedLastRef
1260         https://bugs.webkit.org/show_bug.cgi?id=204975
1261
1262         Reviewed by Antti Koivisto.
1263
1264         Always stop active DOM objects before reaching the destructor.
1265
1266         * dom/Document.cpp:
1267         (WebCore::Document::~Document):
1268         (WebCore::Document::removedLastRef):
1269         (WebCore::Document::commonTeardown):
1270         (WebCore::Document::prepareForDestruction):
1271
1272 2019-12-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1273
1274         Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
1275         https://bugs.webkit.org/show_bug.cgi?id=204713
1276
1277         Reviewed by Simon Fraser.
1278
1279         Test: fast/animation/request-animation-frame-throttling-outside-viewport.html
1280
1281         requestAnimationFrame is throttled by a timer although its callback are
1282         serviced by the page RenderingUpdate. This led to excessive rAF firing
1283         which makes it more than the preferred frame per seconds.
1284
1285         The solution is to have two throttling types:
1286
1287         1) Page throttling (or full throttling) which slows down all the steps of
1288            RenderingUpdate for the main document and all the sub-documents.
1289         2) Document throttling (or partial throttling) which only slows down the
1290            rAF of a certain document.
1291
1292         * Headers.cmake:
1293         * WebCore.xcodeproj/project.pbxproj:
1294
1295         * animation/DocumentTimeline.cpp:
1296         (WebCore::DocumentTimeline::animationInterval const):
1297         (WebCore::DocumentTimeline::updateThrottlingState): Deleted.
1298         * animation/DocumentTimeline.h:
1299         There is no need to have DocumentTimeline throttling. It is throttled 
1300         when the page RenderingUpdate is throttled.
1301
1302         * dom/Document.cpp:
1303         (WebCore::Document::requestAnimationFrame):
1304         (WebCore::Document::updateLastHandledUserGestureTimestamp):
1305         LowPowerMode throttling is now handled by the page. So remove its handling
1306         in the Document side.
1307
1308         * dom/ScriptedAnimationController.cpp:
1309         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
1310         (WebCore::ScriptedAnimationController::page const):
1311         (WebCore::ScriptedAnimationController::interval const):
1312         (WebCore::ScriptedAnimationController::isThrottled const):
1313         (WebCore::ScriptedAnimationController::registerCallback):
1314         (WebCore::ScriptedAnimationController::cancelCallback):
1315         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
1316         (WebCore::ScriptedAnimationController::scheduleAnimation):
1317         (WebCore::throttlingReasonToString): Deleted.
1318         (WebCore::throttlingReasonsToString): Deleted.
1319         (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
1320         (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
1321         (WebCore::ScriptedAnimationController::animationTimerFired): Deleted.
1322         * dom/ScriptedAnimationController.h:
1323         (WebCore::ScriptedAnimationController::addThrottlingReason):
1324         (WebCore::ScriptedAnimationController::removeThrottlingReason):
1325         Get rid of the rAF throttling timer. Service the rAF callback only when
1326         the period from the current time stamp till the last service time stamp
1327         is greater than the preferred rAF interval .
1328
1329         * page/FrameView.cpp:
1330         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
1331         ThrottlingReason is now defined outside ScriptedAnimationController.
1332
1333         * page/Page.cpp:
1334         (WebCore::Page::suspendScriptedAnimations):
1335         (WebCore::Page::resumeScriptedAnimations):
1336         Use forEachDocument().
1337
1338         (WebCore::Page::preferredRenderingUpdateInterval const):
1339         Calculate the preferred RenderingUpdate interval from the throttling
1340         reasons.
1341
1342         (WebCore::Page::setIsVisuallyIdleInternal):
1343         (WebCore::Page::handleLowModePowerChange):
1344         Call adjustRenderingUpdateFrequency() when isLowPowerModeEnabled or 
1345         IsVisuallyIdle is toggled.
1346
1347         (WebCore::updateScriptedAnimationsThrottlingReason): Deleted.
1348         * page/Page.h:
1349         (WebCore::Page::isRenderingUpdateThrottled const):
1350     
1351         * page/RenderingUpdateScheduler.cpp:
1352         (WebCore::RenderingUpdateScheduler::adjustFramesPerSecond):
1353         (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency):
1354         Change the preferredFramesPerSecond of the DisplayRefreshMonitor if the
1355         throttling is not aggressive e.g. 10_s. Otherwise use the timer.
1356
1357         (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
1358         Call adjustFramesPerSecond() when DisplayRefreshMonitor is created.
1359
1360         (WebCore::RenderingUpdateScheduler::startTimer):
1361         * page/RenderingUpdateScheduler.h:
1362
1363         * platform/graphics/AnimationFrameRate.h: Added.
1364         (WebCore::preferredFrameInterval):
1365         (WebCore::preferredFramesPerSecond):
1366         * platform/graphics/DisplayRefreshMonitor.h:
1367         (WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond):
1368     
1369         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1370         (WebCore::DisplayRefreshMonitorManager::monitorForClient):
1371         Rename createMonitorForClient() to monitorForClient() since it may return
1372         a cached DisplayRefreshMonitor.
1373
1374         (WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond):
1375         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
1376         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
1377         No need to call registerClient(). This function was just ensuring the
1378         DisplayRefreshMonitor is created. scheduleAnimation() does the same thing.
1379
1380         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): Deleted.
1381         (WebCore::DisplayRefreshMonitorManager::registerClient): Deleted.
1382         * platform/graphics/DisplayRefreshMonitorManager.h:
1383         (WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager): Deleted.
1384
1385         * platform/graphics/GraphicsLayerUpdater.cpp:
1386         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
1387         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
1388         (-[WebDisplayLinkHandler setPreferredFramesPerSecond:]):
1389         Set the preferredFramesPerSecond of the CADisplayLink.
1390
1391 2019-12-09  Per Arne Vollan  <pvollan@apple.com>
1392
1393         Unreviewed, speculative tvOS build fix after r253231.
1394
1395         * platform/ios/WebCoreMotionManager.mm:
1396         (-[WebCoreMotionManager sendMotionData:withHeading:]):
1397
1398 2019-12-09  Zalan Bujtas  <zalan@apple.com>
1399
1400         [LFC][IFC] fix fast/text/simple-lines-multiple-renderers-break.html
1401         https://bugs.webkit.org/show_bug.cgi?id=205014
1402         <rdar://problem/57756348>
1403
1404         Reviewed by Antti Koivisto.
1405
1406         When dealing with series of runs (<span>text</span><span>content</span>) a partial content does not
1407         necessarily mean partial runs. The content can actually be split right at a run boundary.
1408         In such cases we have a partial trailing content but not a partial trailing run.
1409
1410         This patch also covers the case when the overflown run can't be split and
1411         we attempt to find a previous breakable run (in the list of candidate runs).
1412         Since it's guaranteed (with the FIXME of the extremely long hyphen) that all the previous runs fit the line,
1413         we just pass in an infinite available width to LineBreaker::tryBreakingTextRun indicating that we only look for the last breakable position.
1414
1415         e.g. <span style="word-break: break-all">breakable</span><span>and</span><span>longandunbreakablecontent</span>
1416         [breakable][and][longandunbreakablecontent] <- we try to commit this continuous list of runs
1417         [longandunbreakablecontent] <- does not fit so let's go back to the previous runs to see if any of them can be split -> [breakableand].
1418         result:
1419         breakable
1420         andlongandunbreakablecontent
1421
1422         * layout/inlineformatting/InlineFormattingContext.cpp:
1423         (WebCore::Layout::InlineFormattingContext::lineLayout):
1424         * layout/inlineformatting/InlineLineBreaker.cpp:
1425         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
1426         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
1427         * layout/inlineformatting/LineLayoutContext.cpp:
1428         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
1429         * layout/inlineformatting/LineLayoutContext.h:
1430
1431 2019-12-07  Darin Adler  <darin@apple.com>
1432
1433         Streamline PODIntervalTree code and remove ValueToString
1434         https://bugs.webkit.org/show_bug.cgi?id=199782
1435
1436         Reviewed by Anders Carlsson.
1437
1438         * dom/Element.cpp: Updated includes.
1439
1440         * html/HTMLMediaElement.cpp:
1441         (WebCore::HTMLMediaElement::ignoreTrackDisplayUpdateRequests const): Moved this
1442         function out of line so we don't have to include PODIntervalTree.h in the header.
1443         But also, it's only used inside this file. Also updated for m_cueData.
1444         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): More of the same.
1445         (WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
1446         (WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto.
1447         (WebCore::HTMLMediaElement::currentlyActiveCues const): Ditto.
1448
1449         * html/HTMLMediaElement.h: Changed to not include PODIntervalTree.h, which in turn
1450         includes PODRedBlackTree.h, to significantly cut down how many times we have to
1451         compile those headers. Moved some functions out of line. Made m_cueData to hold the
1452         two cue-related objects so they don't have to be defined in the header. Also
1453         removed ValueToString specializations.
1454
1455         * html/track/TextTrackCue.cpp:
1456         (WebCore::operator<<): Added debug-only overload of TextStream operator.
1457         (WebCore::TextTrackCue::debugString const): Deleted.
1458         * html/track/TextTrackCue.h: Updated for the above.
1459
1460         * html/track/VTTCue.h: Added comments about the incorrect implementation of
1461         isType for VTTCue. Tweaked formatting a bit as well.
1462
1463         * platform/LayoutUnit.h: Removed ValueToString specialization.
1464
1465         * platform/PODInterval.h: Use #pragma once. Removed inaccurate comments
1466         saying this works only with POD. Use TextStream instead of ValueToString.
1467         Added overloads to the constructor so we can do move semantics instead of
1468         copy semantics, slightly better for WeakPtr. Removed the toString function
1469         and added an overload of operator<< with TextStream. Use "{ }" instead of
1470         "0" as the default value for user data.
1471
1472         * platform/PODIntervalTree.h: Removed unneeded includes and unusual default
1473         argument types for the templates. Changed setNeedsFullOrderingComparisons
1474         and node updating to use template arguments instead of virtual functions
1475         and runtime setters. This allowed removal of the constructor and the init
1476         function since the defaults take care of both. Removed the overload of
1477         the allOverlaps function that uses an out argument. Removed unneeded use
1478         of WTF_MAKE_NONCOPYABLE. Use "{ }" instead of 0 for the default value
1479         for user data. Changed the createInterval function to use move semantics.
1480         Changed the nextIntervalAfter function to just take a point, not require
1481         and interval and use its high point. The PODIntervalTree::updateNode
1482         function is replaced with the PODIntervalNodeUpdater::update function.
1483         Removed the ValueToString use and the overriding as well and replaced
1484         with TextStream use.
1485
1486         * platform/PODRedBlackTree.h: Updated comments to reflect the fact
1487         that this is not specific to POD and uses TextStream. Also that the
1488         needsFullOrderingComparisons technique is now a template argument.
1489         Use pragma once. Added FIXME about a few major improvements we should
1490         make.
1491         (WebCore::PODRedBlackTree::~PODRedBlackTree): Made non-virtual since
1492         we use template arguments for polymorphism and don't need virtual
1493         functions too.
1494         (WebCore::PODRedBlackTree::clear): Rewrote to use a non-recursive
1495         algorithm to delete the tree nodes.
1496         (WebCore::PODRedBlackTree::add): Added an overload that takes an
1497         rvalue reference for move semantics.
1498         (WebCore::PODRedBlackTree::visitInorder const): Deleted.
1499         (WebCore::PODRedBlackTree::size const): Deleted.
1500         (WebCore::PODRedBlackTree::isEmpty const): Replaced the inefficiently
1501         implemented size function with this much faster function. Could have
1502         also made a more efficient size function, but no client needs it.
1503         (WebCore::PODRedBlackTree::setNeedsFullOrderingComparisons): Deleted.
1504         (WebCore::PODRedBlackTree::checkInvariants const): Made non-virtual
1505         since there is no need for polymorphism.
1506         (WebCore::PODRedBlackTree::Node::Node): Use rvalue reference and
1507         move semantics.
1508         (WebCore::PODRedBlackTree::Node::copyFrom): Deleted.
1509         (WebCore::PODRedBlackTree::Node::moveDataFrom): Use move instead of
1510         copy. Also removed the gratuitous use of virtual.
1511         (WebCore::PODRedBlackTree::updateNode): Made non-virtual and instead
1512         call through the NodeUpdaterType (actually more like "traits").
1513         (WebCore::PODRedBlackTree::treeSearch const): Use template argument
1514         instead of data member.
1515         (WebCore::PODRedBlackTree::treeSuccessor): Made a static member function.
1516         (WebCore::PODRedBlackTree::treeMinimum): Ditto.
1517         (WebCore::PODRedBlackTree::treeSuccessorInPostOrder): Added. Useful
1518         when deleting the tree so we visit children before deleting the parent.
1519         (WebCore::PODRedBlackTree::deleteNode): Use moveDataFrom when moving
1520         the data from a node that we are about to delete.
1521         (WebCore::PODRedBlackTree::visitInorderImpl const): Deleted.
1522         (WebCore::PODRedBlackTree::markFree): Deleted.
1523         (WebCore::PODRedBlackTree::Counter): Deleted.
1524         (WebCore::PODRedBlackTree::dumpFromNode const): Use TextStream.
1525
1526         * platform/graphics/FloatPolygon.cpp:
1527         (WebCore::FloatPolygon::FloatPolygon): Tweaked coding style a bit.
1528         (WebCore::FloatPolygon::overlappingEdges const): Changed to use a return
1529         value instead of an out argument. Also tweaked coding style a bit.
1530         (WebCore::FloatPolygonEdge::debugString const): Deleted.
1531         (WebCore::ooperator>>): Implemented TextStream overload.
1532
1533         * platform/graphics/FloatPolygon.h: Updated for above, removed
1534         ValueToString specialization.
1535
1536         * rendering/FloatingObjects.cpp:
1537         (WebCore::FloatingObject::debugString const): Deleted.
1538         (WebCore::operator<<): Implemented TextStream overload.
1539         * rendering/FloatingObjects.h: Ditto. Also removed include of
1540         PODIntervalTree.h and used a forward declaration instead.
1541
1542         * rendering/RenderBlock.cpp: Updated includes.
1543
1544         * rendering/RenderFragmentContainer.cpp:
1545         (WebCore::RenderFragmentContainer::debugString const): Deleted.
1546         (WebCore::operator<<): Implemented TextStream overload.
1547         * rendering/RenderFragmentContainer.h: Ditto.
1548
1549         * rendering/RenderFragmentedFlow.cpp:
1550         (WebCore::RenderFragmentedFlow::FragmentSearchAdapter::FragmentSearchAdapter):
1551         Moved this class here from the header, moving the one function body that was
1552         already here up in the file.
1553         (WebCore::RenderFragmentedFlow::fragmentAtBlockOffset const): Refactored and
1554         tweaked code sequence a bit, did not change logic.
1555         (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
1556         Tweaked code style a bit.
1557
1558         * rendering/RenderFragmentedFlow.h: Moved FragmentSearchAdapter out of the
1559         header, and tweaked coding style a bit. Removed ValueToString specialization.
1560
1561         * rendering/shapes/PolygonShape.cpp:
1562         (WebCore::PolygonShape::getExcludedInterval const): Updated to use the
1563         return value from the overlappingEdges function rather than an out argument.
1564
1565         * rendering/updating/RenderTreeBuilder.cpp: Updated includes.
1566         * rendering/updating/RenderTreeBuilderFirstLetter.h: Updated forward declarations.
1567         * rendering/updating/RenderTreeBuilderMultiColumn.cpp: Updated includes.
1568
1569         * rendering/updating/RenderTreePosition.h: Removed includes of
1570         RenderFragmentedFlow.h, RenderText.h, and RenderView.h, since none are
1571         needed by this header.
1572
1573         * rendering/updating/RenderTreeUpdater.cpp: Updated includes.
1574
1575 2019-12-09  Zalan Bujtas  <zalan@apple.com>
1576
1577         [LFC][IFC] Do not create PartialContent for a single character run when it does not fit.
1578         https://bugs.webkit.org/show_bug.cgi?id=205010
1579         <rdar://problem/57752705>
1580
1581         Reviewed by Antti Koivisto.
1582
1583         Use ContentWrappingRule::Keep instead of ContentWrappingRule::Split when dealing with single character overflown runs on empty lines.
1584         <div style="width: 0px; word-break: break-all">text</div> <- produces single character runs.
1585
1586         * layout/inlineformatting/InlineLineBreaker.cpp:
1587         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
1588         * layout/inlineformatting/InlineTextItem.cpp:
1589         (WebCore::Layout::InlineTextItem::left const):
1590         (WebCore::Layout::InlineTextItem::right const):
1591
1592 2019-12-09  youenn fablet  <youenn@apple.com>
1593
1594         Add an option to capture audio in GPU process
1595         https://bugs.webkit.org/show_bug.cgi?id=205007
1596
1597         Reviewed by Eric Carlson.
1598
1599         Add JS console logging of error when trying to create a MediaStream.
1600         Test: fast/mediastream/captureAudioInGPUProcess.html
1601
1602         * Modules/mediastream/UserMediaRequest.cpp:
1603         (WebCore::UserMediaRequest::allow):
1604         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1605         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
1606         * platform/mediastream/RealtimeMediaSourceCenter.h:
1607
1608 2019-12-09  Antti Koivisto  <antti@apple.com>
1609
1610         [LFC][Integration] Hit testing
1611         https://bugs.webkit.org/show_bug.cgi?id=205008
1612
1613         Reviewed by Zalan Bujtas.
1614
1615         * layout/integration/LayoutIntegrationLineLayout.cpp:
1616         (WebCore::LayoutIntegration::LineLayout::paint):
1617         (WebCore::LayoutIntegration::LineLayout::hitTest):
1618
1619         Hit test LFC.
1620
1621         * layout/integration/LayoutIntegrationLineLayout.h:
1622         * layout/layouttree/LayoutTreeBuilder.cpp:
1623         (WebCore::Layout::LayoutTreeContent::addLayoutBoxForRenderer):
1624
1625         Add Layout::Box -> RenderObject map.
1626
1627         * layout/layouttree/LayoutTreeBuilder.h:
1628         (WebCore::Layout::LayoutTreeContent::rendererForLayoutBox const):
1629         (WebCore::Layout::LayoutTreeContent::addLayoutBoxForRenderer): Deleted.
1630         * rendering/RenderBlockFlow.cpp:
1631         (WebCore::RenderBlockFlow::hitTestInlineChildren):
1632
1633         Call into LFC hit test function.
1634
1635 2019-12-09  Zalan Bujtas  <zalan@apple.com>
1636
1637         [LFC][IFC] Fix fast/text/word-break.html
1638         https://bugs.webkit.org/show_bug.cgi?id=204999
1639         <rdar://problem/57736608>
1640
1641         Reviewed by Antti Koivisto.
1642
1643         Keep at least one character on the line when even the first character overflows and the line is empty.
1644
1645         * layout/inlineformatting/InlineLineBreaker.cpp:
1646         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
1647         (WebCore::Layout::LineBreaker::Content::firstTextRunIndex const):
1648         * layout/inlineformatting/InlineLineBreaker.h:
1649
1650 2019-12-09  youenn fablet  <youenn@apple.com>
1651
1652         fast/mediastream/mediastreamtrack-video-clone.html is a flaky failure
1653         https://bugs.webkit.org/show_bug.cgi?id=205006
1654
1655         Reviewed by Eric Carlson.
1656
1657         Covered by test no longer flaky.
1658
1659         * platform/mediastream/RealtimeVideoSource.cpp:
1660         (WebCore::RealtimeVideoSource::clone):
1661         When cloning the source, clone its size in addition to its settings.
1662
1663 2019-12-09  Philippe Normand  <pnormand@igalia.com>
1664
1665         [GStreamer] Crashes in MediaPlayerPrivateGStreamer::ensureGstGLContext
1666         https://bugs.webkit.org/show_bug.cgi?id=204848
1667
1668         Reviewed by Michael Catanzaro.
1669
1670         Make sure the GL video sink uses a valid WebKit shared GL context.
1671
1672         * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
1673         (ensureGstGLContext):
1674         (webKitGLVideoSinkProbePlatform):
1675
1676 2019-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1677
1678         Add encoding and decoding support for more DisplayListItems
1679         https://bugs.webkit.org/show_bug.cgi?id=205001
1680
1681         Reviewed by Tim Horton.
1682
1683         Adds boilerplate code to encode and decode the following display list items: SetLineCap, SetLineDash,
1684         SetLineJoin, SetMiterLimit, ClearShadow, Clip, ClipOut, ClipOutToPath, ClipPath, BeginTransparencyLayer,
1685         EndTransparencyLayer, DrawLine, DrawLinesForText, DrawDotsForDocumentMarker, DrawEllipse, DrawFocusRingPath,
1686         DrawFocusRingRects, FillRectWithRoundedHole, FillEllipse, StrokeRect, StrokePath, StrokeEllipse,
1687         ApplyStrokePattern, ApplyFillPattern, ApplyDeviceScaleFactor, DrawTiledImage, DrawTiledScaledImage, and
1688         DrawPattern.
1689
1690         * platform/graphics/GraphicsContext.h:
1691         (WebCore::DocumentMarkerLineStyle::encode const):
1692         (WebCore::DocumentMarkerLineStyle::decode):
1693         * platform/graphics/GraphicsTypes.h:
1694         * platform/graphics/WindRule.h:
1695         * platform/graphics/displaylists/DisplayListItems.cpp:
1696
1697         Additionally make a few other WebCore classes and enums encodable and decodable.
1698
1699         (WebCore::DisplayList::SetLineCap::SetLineCap):
1700         (WebCore::DisplayList::SetLineDash::SetLineDash):
1701         (WebCore::DisplayList::SetLineJoin::SetLineJoin):
1702         (WebCore::DisplayList::SetMiterLimit::SetMiterLimit):
1703         (WebCore::DisplayList::ClearShadow::ClearShadow):
1704         (WebCore::DisplayList::Clip::Clip):
1705         (WebCore::DisplayList::ClipOut::ClipOut):
1706         (WebCore::DisplayList::ClipOutToPath::ClipOutToPath):
1707         (WebCore::DisplayList::ClipPath::ClipPath):
1708         (WebCore::DisplayList::DrawLine::DrawLine):
1709         (WebCore::DisplayList::DrawLinesForText::DrawLinesForText):
1710         (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker):
1711         (WebCore::DisplayList::DrawEllipse::DrawEllipse):
1712         (WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath):
1713         (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects):
1714         (WebCore::DisplayList::FillRectWithRoundedHole::FillRectWithRoundedHole):
1715         (WebCore::DisplayList::FillEllipse::FillEllipse):
1716         (WebCore::DisplayList::StrokeRect::StrokeRect):
1717         (WebCore::DisplayList::StrokeEllipse::StrokeEllipse):
1718         (WebCore::DisplayList::StrokePath::StrokePath):
1719
1720         Also remove m_blockLocation from StrokePath (this member variable was unused, and seems to have been copied over
1721         from other drawing items).
1722
1723         (WebCore::DisplayList::BeginTransparencyLayer::BeginTransparencyLayer):
1724         (WebCore::DisplayList::EndTransparencyLayer::EndTransparencyLayer):
1725         (WebCore::DisplayList::ApplyStrokePattern::ApplyStrokePattern):
1726         (WebCore::DisplayList::ApplyFillPattern::ApplyFillPattern):
1727         (WebCore::DisplayList::ApplyDeviceScaleFactor::ApplyDeviceScaleFactor):
1728         * platform/graphics/displaylists/DisplayListItems.h:
1729         (WebCore::DisplayList::SetLineCap::encode const):
1730         (WebCore::DisplayList::SetLineCap::decode):
1731         (WebCore::DisplayList::SetLineDash::encode const):
1732         (WebCore::DisplayList::SetLineDash::decode):
1733         (WebCore::DisplayList::SetLineJoin::encode const):
1734         (WebCore::DisplayList::SetLineJoin::decode):
1735         (WebCore::DisplayList::SetMiterLimit::encode const):
1736         (WebCore::DisplayList::SetMiterLimit::decode):
1737         (WebCore::DisplayList::ClearShadow::encode const):
1738         (WebCore::DisplayList::ClearShadow::decode):
1739         (WebCore::DisplayList::Clip::encode const):
1740         (WebCore::DisplayList::Clip::decode):
1741         (WebCore::DisplayList::ClipOut::encode const):
1742         (WebCore::DisplayList::ClipOut::decode):
1743         (WebCore::DisplayList::ClipOutToPath::encode const):
1744         (WebCore::DisplayList::ClipOutToPath::decode):
1745         (WebCore::DisplayList::ClipPath::encode const):
1746         (WebCore::DisplayList::ClipPath::decode):
1747         (WebCore::DisplayList::DrawTiledImage::encode const):
1748         (WebCore::DisplayList::DrawTiledImage::decode):
1749         (WebCore::DisplayList::DrawTiledScaledImage::encode const):
1750         (WebCore::DisplayList::DrawTiledScaledImage::decode):
1751         (WebCore::DisplayList::DrawPattern::DrawPattern):
1752         (WebCore::DisplayList::DrawPattern::encode const):
1753         (WebCore::DisplayList::DrawPattern::decode):
1754         (WebCore::DisplayList::BeginTransparencyLayer::encode const):
1755         (WebCore::DisplayList::BeginTransparencyLayer::decode):
1756         (WebCore::DisplayList::EndTransparencyLayer::encode const):
1757         (WebCore::DisplayList::EndTransparencyLayer::decode):
1758         (WebCore::DisplayList::DrawLine::encode const):
1759         (WebCore::DisplayList::DrawLine::decode):
1760         (WebCore::DisplayList::DrawLinesForText::encode const):
1761         (WebCore::DisplayList::DrawLinesForText::decode):
1762         (WebCore::DisplayList::DrawDotsForDocumentMarker::encode const):
1763         (WebCore::DisplayList::DrawDotsForDocumentMarker::decode):
1764         (WebCore::DisplayList::DrawEllipse::encode const):
1765         (WebCore::DisplayList::DrawEllipse::decode):
1766         (WebCore::DisplayList::DrawFocusRingPath::encode const):
1767         (WebCore::DisplayList::DrawFocusRingPath::decode):
1768         (WebCore::DisplayList::DrawFocusRingRects::encode const):
1769         (WebCore::DisplayList::DrawFocusRingRects::decode):
1770         (WebCore::DisplayList::FillRectWithRoundedHole::encode const):
1771         (WebCore::DisplayList::FillRectWithRoundedHole::decode):
1772         (WebCore::DisplayList::FillEllipse::encode const):
1773         (WebCore::DisplayList::FillEllipse::decode):
1774         (WebCore::DisplayList::StrokeRect::encode const):
1775         (WebCore::DisplayList::StrokeRect::decode):
1776         (WebCore::DisplayList::StrokePath::encode const):
1777         (WebCore::DisplayList::StrokePath::decode):
1778         (WebCore::DisplayList::StrokeEllipse::encode const):
1779         (WebCore::DisplayList::StrokeEllipse::decode):
1780         (WebCore::DisplayList::ApplyStrokePattern::encode const):
1781         (WebCore::DisplayList::ApplyStrokePattern::decode):
1782         (WebCore::DisplayList::ApplyFillPattern::encode const):
1783         (WebCore::DisplayList::ApplyFillPattern::decode):
1784         (WebCore::DisplayList::ApplyDeviceScaleFactor::encode const):
1785         (WebCore::DisplayList::ApplyDeviceScaleFactor::decode):
1786         (WebCore::DisplayList::Item::encode const):
1787         (WebCore::DisplayList::Item::decode):
1788         (WebCore::DisplayList::SetLineCap::SetLineCap): Deleted.
1789         (WebCore::DisplayList::SetLineDash::SetLineDash): Deleted.
1790         (WebCore::DisplayList::SetLineJoin::SetLineJoin): Deleted.
1791         (WebCore::DisplayList::SetMiterLimit::SetMiterLimit): Deleted.
1792         (WebCore::DisplayList::ClearShadow::ClearShadow): Deleted.
1793         (WebCore::DisplayList::Clip::Clip): Deleted.
1794         (WebCore::DisplayList::ClipOut::ClipOut): Deleted.
1795         (WebCore::DisplayList::ClipOutToPath::ClipOutToPath): Deleted.
1796         (WebCore::DisplayList::ClipPath::ClipPath): Deleted.
1797         (WebCore::DisplayList::BeginTransparencyLayer::BeginTransparencyLayer): Deleted.
1798         (WebCore::DisplayList::EndTransparencyLayer::EndTransparencyLayer): Deleted.
1799         (WebCore::DisplayList::DrawLine::DrawLine): Deleted.
1800         (WebCore::DisplayList::DrawLinesForText::DrawLinesForText): Deleted.
1801         (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker): Deleted.
1802         (WebCore::DisplayList::DrawEllipse::DrawEllipse): Deleted.
1803         (WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath): Deleted.
1804         (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects): Deleted.
1805         (WebCore::DisplayList::FillRectWithRoundedHole::FillRectWithRoundedHole): Deleted.
1806         (WebCore::DisplayList::FillEllipse::FillEllipse): Deleted.
1807         (WebCore::DisplayList::StrokeRect::StrokeRect): Deleted.
1808         (WebCore::DisplayList::StrokePath::StrokePath): Deleted.
1809         (WebCore::DisplayList::StrokeEllipse::StrokeEllipse): Deleted.
1810         (WebCore::DisplayList::ApplyStrokePattern::ApplyStrokePattern): Deleted.
1811         (WebCore::DisplayList::ApplyFillPattern::ApplyFillPattern): Deleted.
1812         (WebCore::DisplayList::ApplyDeviceScaleFactor::ApplyDeviceScaleFactor): Deleted.
1813
1814 2019-12-08  Ryosuke Niwa  <rniwa@webkit.org>
1815
1816         There should be one MicrotaskQueue per EventLoop
1817         https://bugs.webkit.org/show_bug.cgi?id=204492
1818         <rdar://problem/57420645>
1819
1820         Reviewed by Antti Koivisto.
1821
1822         This patch makes microtask queue and the microtasks for mutation observers and custom elements
1823         specific to each event loop so that only similar origin windows share the same microtask queue
1824         and mutation observer's compound microtask or custom element's backup element queue.
1825
1826         As a result, we can remove the workaround we added in r247222.
1827
1828         Because microtasks for mutation observers and custom elements are shared across similar origin
1829         window agents, we can't use any one document's task group to schedule these. Instead, we create
1830         a new "perpetual" task group in WindowEventLoop which is never suspended or stopped. It's the
1831         responsibility of mutation observer and custom elements' code to deal with suspened or stopped
1832         documents as it has been the case.
1833
1834         See also: https://dom.spec.whatwg.org/#queue-a-mutation-observer-compound-microtask
1835                   https://html.spec.whatwg.org/multipage/custom-elements.html#backup-element-queue
1836
1837         Test: editing/pasteboard/paste-does-not-fire-promises-while-sanitizing-web-content.html
1838
1839         * dom/CustomElementReactionQueue.cpp:
1840         (WebCore::CustomElementQueue::add): Renamed from CustomElementReactionQueue::ElementQueue to
1841         allow forward declaration in EventLoop.h.
1842         (WebCore::CustomElementQueue::invokeAll): Ditto.
1843         (WebCore::CustomElementQueue::processQueue): Ditto.
1844         (WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue):
1845         (WebCore::CustomElementReactionQueue::processBackupQueue):
1846         (WebCore::CustomElementReactionQueue::ensureBackupQueue): Deleted. Moved to WindowEventLoop.
1847         (WebCore::CustomElementReactionQueue::backupElementQueue): Ditto.
1848         * dom/CustomElementReactionQueue.h:
1849         (WebCore::CustomElementQueue): Renamed from CustomElementReactionQueue::ElementQueue to allow
1850         forward declaration in EventLoop.h.
1851         * dom/Document.cpp:
1852         (WebCore::Document::finishedParsing): Removed the workaround added in r247222.
1853         (WebCore::Document::eventLoop):
1854         (WebCore::Document::windowEventLoop): Added.
1855         * dom/Document.h:
1856         * dom/MutationObserver.cpp:
1857         (WebCore::activeMutationObservers): Deleted. Moved to WindowEventLoop.
1858         (WebCore::suspendedMutationObservers): Ditto.
1859         (WebCore::signalSlotList): Ditto.
1860         (WebCore::MutationObserver::queueMutationObserverCompoundMicrotask): Ditto.
1861         (WebCore::MutationObserver::enqueueMutationRecord):
1862         (WebCore::MutationObserver::enqueueSlotChangeEvent):
1863         (WebCore::MutationObserver::setHasTransientRegistration):
1864         (WebCore::MutationObserver::notifyMutationObservers): Now takes WindowEventLoop since various
1865         lists and hash maps are specific to each WindowEventLoop.
1866         * dom/MutationObserver.h:
1867         * dom/WindowEventLoop.cpp:
1868         (WebCore::WindowEventLoop::WindowEventLoop): Create m_perpetualTaskGroupForSimilarOriginWindowAgents.
1869         (WebCore::WindowEventLoop::microtaskQueue):
1870         (WebCore::WindowEventLoop::queueMutationObserverCompoundMicrotask):
1871         (WebCore::WindowEventLoop::backupElementQueue):
1872         * dom/WindowEventLoop.h:
1873         * editing/markup.cpp:
1874         (WebCore::createPageForSanitizingWebContent): Removed the workaround added in r247222.
1875         * page/Page.h:
1876         (WebCore::Page::setIsForSanitizingWebContent): Ditto.
1877         (WebCore::Page::isForSanitizingWebContent const): Ditto.
1878
1879 2019-12-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1880
1881         Move WebCore::Path encoders and decoders into WebCore from WebCoreArgumentCoders
1882         https://bugs.webkit.org/show_bug.cgi?id=204993
1883
1884         Reviewed by Tim Horton.
1885
1886         Move encoding and decoding logic from WebCoreArgumentCoders into WebCore. The ability to encode or decode Paths
1887         is needed in order to encode or decode DisplayListItems that contain Paths; since these encoders live in
1888         WebCore, the encoders for Paths should live there as well.
1889
1890         No change in behavior.
1891
1892         * platform/graphics/Path.cpp:
1893         * platform/graphics/Path.h:
1894
1895         Also fixes up the indentation of the Path class in this header, such that the class declaration isn't indented
1896         one level past the namespace.
1897
1898         (WebCore::Path::isNull const):
1899         (WebCore::Path::platformPath const):
1900         (WebCore::Path::circleControlPoint):
1901         (WebCore::Path::encode const):
1902         (WebCore::Path::decode):
1903
1904 2019-12-08  youenn fablet  <youenn@apple.com>
1905
1906         Do not use DOMGuarded for maplike
1907         https://bugs.webkit.org/show_bug.cgi?id=204879
1908
1909         Reviewed by Darin Adler.
1910
1911         Update maplike according setlike model where we support syncing at creation of the JS wrapper
1912         and syncing whenever setlike/maplike methods are called.
1913         Removing DOMGuardedObject makes implementation more lightweight, there is less things to implement on DOM side
1914         and it allows collecting the private map to free memory if needed.
1915
1916         Covered by existing tests and rebased binding tests.
1917
1918         * Modules/highlight/HighlightMap.cpp:
1919         (WebCore::HighlightMap::initializeMapLike):
1920         * Modules/highlight/HighlightMap.h:
1921         (WebCore::HighlightMap::synchronizeBackingMap): Deleted.
1922         (WebCore::HighlightMap::backingMap): Deleted.
1923         * Modules/mediastream/RTCStatsReport.h:
1924         (WebCore::RTCStatsReport::create):
1925         (WebCore::RTCStatsReport::initializeMapLike):
1926         (WebCore::RTCStatsReport::RTCStatsReport):
1927         (WebCore::RTCStatsReport::synchronizeBackingMap): Deleted.
1928         (WebCore::RTCStatsReport::backingMap): Deleted.
1929         (WebCore::RTCStatsReport::addStats): Deleted.
1930         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1931         (WebCore::LibWebRTCMediaEndpoint::createStatsCollector):
1932         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
1933         (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
1934         (WebCore::initializeRTCStatsReportBackingMap):
1935         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
1936         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h:
1937         * bindings/js/JSDOMMapLike.cpp:
1938         (WebCore::getBackingMap):
1939         (WebCore::clearBackingMap):
1940         (WebCore::setToBackingMap):
1941         (WebCore::forwardAttributeGetterToBackingMap):
1942         (WebCore::forwardFunctionCallToBackingMap):
1943         (WebCore::forwardForEachCallToBackingMap):
1944         (WebCore::initializeBackingMap): Deleted.
1945         (WebCore::createBackingMap): Deleted.
1946         * bindings/js/JSDOMMapLike.h:
1947         (WebCore::DOMMapAdapter::DOMMapAdapter):
1948         (WebCore::DOMMapAdapter::set):
1949         (WebCore::DOMMapAdapter::clear):
1950         (WebCore::getAndInitializeBackingMap):
1951         (WebCore::forwardSizeToMapLike):
1952         (WebCore::forwardEntriesToMapLike):
1953         (WebCore::forwardKeysToMapLike):
1954         (WebCore::forwardValuesToMapLike):
1955         (WebCore::forwardClearToMapLike):
1956         (WebCore::forwardForEachToMapLike):
1957         (WebCore::forwardGetToMapLike):
1958         (WebCore::forwardHasToMapLike):
1959         (WebCore::forwardSetToMapLike):
1960         (WebCore::forwardDeleteToMapLike):
1961         (): Deleted.
1962         (WebCore::DOMMapLike::set): Deleted.
1963         (WebCore::synchronizeBackingMap): Deleted.
1964         * bindings/js/JSDOMSetLike.cpp:
1965         * bindings/js/JSDOMSetLike.h:
1966         * bindings/scripts/CodeGeneratorJS.pm:
1967         (GenerateImplementation):
1968         * bindings/scripts/test/JS/JSMapLike.cpp:
1969         (WebCore::JSMapLike::finishCreation):
1970         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1971         (WebCore::JSReadOnlyMapLike::finishCreation):
1972         * testing/InternalsMapLike.cpp:
1973         (WebCore::InternalsMapLike::initializeMapLike):
1974         (WebCore::InternalsMapLike::synchronizeBackingMap): Deleted.
1975         * testing/InternalsMapLike.h:
1976         (WebCore::InternalsMapLike::backingMap): Deleted.
1977
1978 2019-12-08  youenn fablet  <youenn@apple.com>
1979
1980         Support different resolutions for video tracks captured from UIProcess
1981         https://bugs.webkit.org/show_bug.cgi?id=204945
1982
1983         Reviewed by Eric Carlson.
1984
1985         Remove whether the a source is remote or not.
1986         Previously we were doing the distinction as resizing would happen in WebProcess and not in UIProcess.
1987         We are now moving away from doing resizing in WebProcess.
1988         Covered by existing tests.
1989
1990         * platform/mediastream/RealtimeMediaSource.h:
1991         * platform/mediastream/RealtimeMediaSourceFactory.h:
1992         * platform/mediastream/RealtimeVideoCaptureSource.cpp:
1993         (WebCore::RealtimeVideoCaptureSource::adaptVideoSample):
1994         For remote tracks, we also update the size for observers.
1995         * platform/mediastream/RealtimeVideoSource.cpp:
1996         (WebCore::m_source):
1997         (WebCore::RealtimeVideoSource::sourceSettingsChanged):
1998         Update computation of size based on rotation.
1999         This makes sure we have resizing done right.
2000         * platform/mediastream/RealtimeVideoSource.h:
2001         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2002         (WebCore::DisplayCaptureSourceCocoa::emitFrame):
2003
2004 2019-12-08  Antti Koivisto  <antti@apple.com>
2005
2006         [LFC][Integration] Collect overflow from lines
2007         https://bugs.webkit.org/show_bug.cgi?id=204994
2008
2009         Reviewed by Zalan Bujtas.
2010
2011         * layout/displaytree/DisplayLineBox.h:
2012         (WebCore::Display::LineBox::logicalRect const):
2013         * layout/integration/LayoutIntegrationLineLayout.cpp:
2014         (WebCore::LayoutIntegration::computeVisualOverflow):
2015         (WebCore::LayoutIntegration::LineLayout::collectOverflow):
2016         * layout/integration/LayoutIntegrationLineLayout.h:
2017         * rendering/RenderBlockFlow.cpp:
2018         (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
2019
2020         Connect to LFC layout.
2021
2022 2019-12-08  Zalan Bujtas  <zalan@apple.com>
2023
2024         [LFC][IFC] Switch over to float based types in inline layout
2025         https://bugs.webkit.org/show_bug.cgi?id=204995
2026         <rdar://problem/57733349>
2027
2028         Reviewed by Antti Koivisto.
2029
2030         Due to the relatively significant difference between float and LayoutUnit's precision, IFC
2031         is unable to produce matching layout under the same constraints.
2032         Let's switch over to float based types until after either CLL switches over to LayoutUnit
2033         or LayoutUnit gains high enough precision.
2034
2035         See webkit.org/b/204986 for more info.
2036
2037         * layout/LayoutUnits.h:
2038         (WebCore::Layout::maxInlineLayoutUnit):
2039         * layout/Verification.cpp:
2040         (WebCore::Layout::areEssentiallyEqual):
2041         * layout/inlineformatting/InlineFormattingContext.cpp:
2042         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2043         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2044         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
2045         * layout/inlineformatting/InlineLineBreaker.cpp:
2046         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
2047         * layout/inlineformatting/InlineLineBuilder.cpp:
2048         (WebCore::Layout::LineBuilder::alignContentHorizontally const):
2049         (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):
2050         (WebCore::Layout::LineBuilder::halfLeadingMetrics):
2051         (WebCore::Layout::LineBuilder::TrimmableContent::append):
2052         * layout/inlineformatting/LineLayoutContext.cpp:
2053         (WebCore::Layout::inlineItemWidth):
2054         * layout/inlineformatting/text/TextUtil.cpp:
2055         (WebCore::Layout::TextUtil::width):
2056         (WebCore::Layout::TextUtil::fixedPitchWidth):
2057         (WebCore::Layout::TextUtil::split):
2058         * layout/integration/LayoutIntegrationLineLayout.cpp:
2059         (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const):
2060         (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const):
2061         (WebCore::LayoutIntegration::LineLayout::paint):
2062
2063 2019-12-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
2064
2065         Make ColorSpace an enum class
2066         https://bugs.webkit.org/show_bug.cgi?id=204970
2067
2068         Reviewed by Sam Weinig.
2069
2070         So it can be encoded and decoded through the IPC messages.
2071
2072         * css/parser/CSSPropertyParserHelpers.cpp:
2073         (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
2074         * html/CustomPaintCanvas.cpp:
2075         (WebCore::CustomPaintCanvas::copiedImage const):
2076         * html/HTMLCanvasElement.cpp:
2077         (WebCore::HTMLCanvasElement::createImageBuffer const):
2078         * html/canvas/CanvasRenderingContext2D.cpp:
2079         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2080         * html/canvas/CanvasRenderingContext2DBase.cpp:
2081         (WebCore::CanvasRenderingContext2DBase::drawImage):
2082         * platform/graphics/BitmapImage.cpp:
2083         (WebCore::BitmapImage::drawPattern):
2084         * platform/graphics/Color.cpp:
2085         (WebCore::operator<<):
2086         * platform/graphics/Color.h:
2087         (WebCore::Color::Color):
2088         * platform/graphics/ColorSpace.h:
2089         (): Deleted.
2090         * platform/graphics/CustomPaintImage.cpp:
2091         (WebCore::CustomPaintImage::drawPattern):
2092         * platform/graphics/ExtendedColor.cpp:
2093         (WebCore::ExtendedColor::create):
2094         (WebCore::ExtendedColor::cssText const):
2095         * platform/graphics/ExtendedColor.h:
2096         * platform/graphics/GradientImage.cpp:
2097         (WebCore::GradientImage::drawPattern):
2098         * platform/graphics/ImageBuffer.cpp:
2099         (WebCore::ImageBuffer::transformColorSpace):
2100         * platform/graphics/ImageBuffer.h:
2101         * platform/graphics/cairo/ImageBufferCairo.cpp:
2102         (WebCore::ImageBuffer::createCompatibleBuffer):
2103         * platform/graphics/cg/ColorCG.cpp:
2104         (WebCore::leakCGColor):
2105         * platform/graphics/cg/GraphicsContextCG.h:
2106         (WebCore::cachedCGColorSpace):
2107         * platform/graphics/filters/FEFlood.h:
2108         * platform/graphics/filters/FELighting.cpp:
2109         (WebCore::FELighting::drawLighting):
2110         * platform/graphics/filters/FETile.cpp:
2111         (WebCore::FETile::platformApplySoftware):
2112         * platform/graphics/filters/FilterEffect.h:
2113         * platform/graphics/filters/SourceGraphic.h:
2114         (WebCore::SourceGraphic::SourceGraphic):
2115         * platform/graphics/win/ImageBufferDirect2D.cpp:
2116         (WebCore::ImageBuffer::createCompatibleBuffer):
2117         * platform/mac/ThemeMac.mm:
2118         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2119         * rendering/CSSFilter.cpp:
2120         (WebCore::CSSFilter::buildReferenceFilter):
2121         (WebCore::CSSFilter::build):
2122         (WebCore::CSSFilter::apply):
2123         * rendering/RenderBoxModelObject.cpp:
2124         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2125         * rendering/RenderLayerBacking.cpp:
2126         (WebCore::patternForTouchAction):
2127         * rendering/RenderThemeMac.mm:
2128         (WebCore::RenderThemeMac::paintProgressBar):
2129         * rendering/svg/RenderSVGResourceClipper.cpp:
2130         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
2131         * rendering/svg/RenderSVGResourceFilter.cpp:
2132         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
2133         (WebCore::RenderSVGResourceFilter::applyResource):
2134         (WebCore::RenderSVGResourceFilter::postApplyResource):
2135         * rendering/svg/RenderSVGResourceGradient.cpp:
2136         (WebCore::createMaskAndSwapContextForTextGradient):
2137         * rendering/svg/RenderSVGResourceMasker.cpp:
2138         (WebCore::RenderSVGResourceMasker::applyResource):
2139         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
2140         * rendering/svg/RenderSVGResourcePattern.cpp:
2141         (WebCore::RenderSVGResourcePattern::createTileImage const):
2142         * rendering/svg/SVGRenderingContext.cpp:
2143         (WebCore::SVGRenderingContext::bufferForeground):
2144         * svg/graphics/SVGImage.cpp:
2145         (WebCore::SVGImage::drawPatternForContainer):
2146         * svg/graphics/filters/SVGFEImage.cpp:
2147         (WebCore::FEImage::platformApplySoftware):
2148
2149 2019-12-07  Zalan Bujtas  <zalan@apple.com>
2150
2151         [LFC][IFC] Convert InlineLayoutUnit/Point/Rect to LayoutUnit/Point/Rect when crossing inline/block boundary
2152         https://bugs.webkit.org/show_bug.cgi?id=204991
2153         <rdar://problem/57730383>
2154
2155         Reviewed by Sam Weinig.
2156
2157         Float -> LayoutUnit requires explicit conversion due to precision loss. Use these functions when
2158         feeding inline box geometry information back to block layout.
2159
2160         Implicit floor will do for now (might need to call round though).
2161
2162         This is in preparation for using float based types in IFC. See webkit.org/b/204986 for more info.
2163
2164         * layout/LayoutUnits.h:
2165         (WebCore::Layout::toLayoutUnit):
2166         (WebCore::Layout::toLayoutPoint):
2167         (WebCore::Layout::toLayoutRect):
2168         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2169         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2170         * layout/displaytree/DisplayInlineContent.cpp:
2171         (WebCore::Display:: const):
2172         * layout/inlineformatting/InlineFormattingContext.cpp:
2173         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2174         (WebCore::Layout::InlineFormattingContext::constraintsForLine):
2175         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
2176         * layout/integration/LayoutIntegrationLineLayout.cpp:
2177         (WebCore::LayoutIntegration::LineLayout::paint):
2178
2179 2019-12-07  Ryosuke Niwa  <rniwa@webkit.org>
2180
2181         Unique origin's window must get its own event loop
2182         https://bugs.webkit.org/show_bug.cgi?id=204978
2183
2184         Reviewed by Antti Koivisto.
2185
2186         This patch fixes the bug that unique origin documents and documents of the same registrable domains
2187         with different schemes / protocols were sharing the same event loop. Note that we continue to share
2188         the event loop across file URI documents.
2189
2190         We now use the agent cluster key to looking up the event loop to better match the HTML5 spec:
2191         https://html.spec.whatwg.org/multipage/webappapis.html#obtain-agent-cluster-key
2192
2193         Tests: fast/eventloop/data-uri-document-has-its-own-event-loop.html
2194                fast/eventloop/queue-task-across-frames-in-file-uri.html
2195                http/tests/eventloop/documents-with-different-protocols-do-not-share-event-loop.html
2196
2197         * dom/Document.cpp:
2198         (WebCore::Document::eventLoop):
2199         * dom/EventLoop.h:
2200         (WebCore::EventLoopTaskGroup::hasSameEventLoopAs): Added for testing purposes.
2201         * dom/WindowEventLoop.cpp:
2202         (WebCore::agentClusterKeyOrNullIfUnique): Added.
2203         (WebCore::WindowEventLoop::eventLoopForSecurityOrigin): Replaced ensureForRegistrableDomain.
2204         (WebCore::WindowEventLoop::create): Added.
2205         (WebCore::WindowEventLoop::WindowEventLoop):
2206         (WebCore::WindowEventLoop::~WindowEventLoop):
2207         * dom/WindowEventLoop.h:
2208         * testing/Internals.cpp:
2209         (WebCore::Internals::hasSameEventLoopAs): Added for testing purposes.
2210         * testing/Internals.h:
2211         * testing/Internals.idl:
2212
2213 2019-12-07  Zalan Bujtas  <zalan@apple.com>
2214
2215         [LFC][IFC] Display::LineBox should adopt to InlineLayoutUnit
2216         https://bugs.webkit.org/show_bug.cgi?id=204990
2217         <rdar://problem/57730105>
2218
2219         Reviewed by Sam Weinig.
2220
2221         This is in preparation for using float based types in IFC. See webkit.org/b/204986 for more info.
2222
2223         * layout/displaytree/DisplayLineBox.h:
2224         (WebCore::Display::LineBox::logicalTopLeft const):
2225         (WebCore::Display::LineBox::setLogicalTopLeft):
2226         * layout/displaytree/DisplayRun.h:
2227         (WebCore::Display::Run::logicalTopLeft const):
2228         (WebCore::Display::Run::logicalLeft const):
2229         (WebCore::Display::Run::logicalRight const):
2230         (WebCore::Display::Run::logicalTop const):
2231         (WebCore::Display::Run::logicalBottom const):
2232         (WebCore::Display::Run::logicalWidth const):
2233         (WebCore::Display::Run::logicalHeight const):
2234         (WebCore::Display::Run::setLogicalWidth):
2235         (WebCore::Display::Run::setLogicalTop):
2236         (WebCore::Display::Run::setLogicalLeft):
2237         (WebCore::Display::Run::moveVertically):
2238         (WebCore::Display::Run::moveHorizontally):
2239         (WebCore::Display::Run::expandVertically):
2240         (WebCore::Display::Run::expandHorizontally):
2241         * layout/inlineformatting/InlineFormattingContext.cpp:
2242         (WebCore::Layout::InlineFormattingContext::constraintsForLine):
2243         * layout/inlineformatting/InlineFormattingContext.h:
2244
2245 2019-12-07  Andres Gonzalez  <andresg_22@apple.com>
2246
2247         Implementation of additional attribute caching in the IsolatedTree.
2248         https://bugs.webkit.org/show_bug.cgi?id=204918
2249
2250         Reviewed by Chris Fleizach.
2251
2252         No new tests, no new functionality. Updated several tests to fixed
2253         expected output.
2254
2255         - Implementation of around 200 methods in the AXIsolatedObject class.
2256         - The pending method implementations have an ASSERT_NOT_REACHED.
2257         - Support for dispatching to the main thread some
2258         WebAccessibilityObjectWrapper methods that cannot be run in the
2259         secondary thread.
2260
2261         * accessibility/AXObjectCache.cpp:
2262         (WebCore::AXObjectCache::createIsolatedTreeHierarchy):
2263         (WebCore::AXObjectCache::generateIsolatedTree):
2264         * accessibility/AXObjectCache.h:
2265         * accessibility/AccessibilityNodeObject.cpp:
2266         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
2267         * accessibility/AccessibilityObject.cpp:
2268         (WebCore::AccessibilityObject::actionVerb const):
2269         (WebCore::AccessibilityObject::datetimeAttributeValue const):
2270         (WebCore::AccessibilityObject::linkRelValue const):
2271         (WebCore::AccessibilityObject::isInlineText const):
2272         (WebCore::AccessibilityObject::identifierAttribute const):
2273         (WebCore::AccessibilityObject::documentURI const):
2274         (WebCore::AccessibilityObject::documentEncoding const):
2275         (WebCore::AccessibilityObject::sessionID const):
2276         (WebCore::AccessibilityObject::tagName const):
2277         * accessibility/AccessibilityObject.h:
2278         (WebCore::AccessibilityText::AccessibilityText):
2279         (WebCore::AccessibilityObject::actionVerb const):
2280         * accessibility/AccessibilityObjectInterface.h: Base implementation for
2281         several isXXX methods that rely on the object roleValue.
2282         (WebCore::AXCoreObject::isImageMap const):
2283         (WebCore::AXCoreObject::isWebArea const):
2284         (WebCore::AXCoreObject::isCheckbox const):
2285         (WebCore::AXCoreObject::isRadioButton const):
2286         (WebCore::AXCoreObject::isListBox const):
2287         (WebCore::AXCoreObject::isSpinButton const):
2288         (WebCore::AXCoreObject::isSwitch const):
2289         (WebCore::AXCoreObject::isToggleButton const):
2290         (WebCore::AXCoreObject::isTabList const):
2291         (WebCore::AXCoreObject::isTabItem const):
2292         (WebCore::AXCoreObject::isRadioGroup const):
2293         (WebCore::AXCoreObject::isComboBox const):
2294         (WebCore::AXCoreObject::isTree const):
2295         (WebCore::AXCoreObject::isTreeGrid const):
2296         (WebCore::AXCoreObject::isTreeItem const):
2297         (WebCore::AXCoreObject::isScrollbar const):
2298         (WebCore::AXCoreObject::isListItem const):
2299         (WebCore::AXCoreObject::isCheckboxOrRadio const):
2300         (WebCore::AXCoreObject::isScrollView const):
2301         (WebCore::AXCoreObject::isCanvas const):
2302         (WebCore::AXCoreObject::isPopUpButton const):
2303         (WebCore::AXCoreObject::isColorWell const):
2304         (WebCore::AXCoreObject::isSplitter const):
2305         (WebCore::AXCoreObject::isToolbar const):
2306         (WebCore::AXCoreObject::isSummary const):
2307         * accessibility/AccessibilityRenderObject.cpp:
2308         (WebCore::AccessibilityRenderObject::accessKey const):
2309         (WebCore::AccessibilityRenderObject::actionVerb const):
2310         * accessibility/AccessibilityRenderObject.h:
2311         * accessibility/AccessibilitySpinButton.h:
2312         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2313         (WebCore::AXIsolatedTree::setRootNode):
2314         (WebCore::AXIsolatedTree::setRoot): Renamed setRootNode.
2315         * accessibility/isolatedtree/AXIsolatedTree.h:
2316         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Implementation of
2317         around 200 methods in the AXIsolatedObject class. The methods that are
2318         pending, have a stub implemetation with an ASSERT_NOT_REACHED.
2319         (WebCore::AXIsolatedObject::AXIsolatedObject):
2320         (WebCore::AXIsolatedObject::create):
2321         (WebCore::AXIsolatedObject::initializeAttributeData):
2322         (WebCore::AXIsolatedObject::setMathscripts):
2323         (WebCore::AXIsolatedObject::setObjectVectorProperty):
2324         (WebCore::AXIsolatedObject::isDetached const):
2325         (WebCore::AXIsolatedObject::isDetachedFromParent):
2326         (WebCore::AXIsolatedObject::accessibilityText const):
2327         (WebCore::AXIsolatedObject::classList const):
2328         (WebCore::AXIsolatedObject::sessionID const):
2329         (WebCore::AXIsolatedObject::documentURI const):
2330         (WebCore::AXIsolatedObject::preventKeyboardDOMEventDispatch const):
2331         (WebCore::AXIsolatedObject::documentEncoding const):
2332         (WebCore::AXIsolatedObject::insertMathPairs):
2333         (WebCore::AXIsolatedObject::mathPrescripts):
2334         (WebCore::AXIsolatedObject::mathPostscripts):
2335         (WebCore::AXIsolatedObject::scrollBar):
2336         (WebCore::AXIsolatedObject::colorValue const):
2337         (WebCore::AXIsolatedObject::intPointAttributeValue const):
2338         (WebCore::AXIsolatedObject::vectorAttributeValue const):
2339         (WebCore::AXIsolatedObject::optionSetAttributeValue const):
2340         (WebCore::AXIsolatedObject::uint64AttributeValue const):
2341         (WebCore::AXIsolatedObject::urlAttributeValue const):
2342         (WebCore::AXIsolatedObject::colorAttributeValue const):
2343         (WebCore::AXIsolatedObject::floatAttributeValue const):
2344         (WebCore::AXIsolatedObject::fillChildrenVectorForProperty const):
2345         (WebCore::AXIsolatedObject::replaceTextInRange):
2346         (WebCore::AXIsolatedObject::insertText):
2347         (WebCore::AXIsolatedObject::press):
2348         (WebCore::AXIsolatedObject::performDefaultAction):
2349         (WebCore::AXIsolatedObject::isAccessibilityObject const):
2350         (WebCore::AXIsolatedObject::isAccessibilityNodeObject const):
2351         (WebCore::AXIsolatedObject::isAccessibilityRenderObject const):
2352         (WebCore::AXIsolatedObject::isAccessibilityScrollbar const):
2353         (WebCore::AXIsolatedObject::isAccessibilityScrollView const):
2354         (WebCore::AXIsolatedObject::isAccessibilitySVGRoot const):
2355         (WebCore::AXIsolatedObject::isAccessibilitySVGElement const):
2356         (WebCore::AXIsolatedObject::containsText const):
2357         (WebCore::AXIsolatedObject::isAttachmentElement const):
2358         (WebCore::AXIsolatedObject::isNativeImage const):
2359         (WebCore::AXIsolatedObject::isImageButton const):
2360         (WebCore::AXIsolatedObject::isContainedByPasswordField const):
2361         (WebCore::AXIsolatedObject::passwordFieldOrContainingPasswordField):
2362         (WebCore::AXIsolatedObject::isNativeTextControl const):
2363         (WebCore::AXIsolatedObject::isNativeListBox const):
2364         (WebCore::AXIsolatedObject::isListBoxOption const):
2365         (WebCore::AXIsolatedObject::isSliderThumb const):
2366         (WebCore::AXIsolatedObject::isInputSlider const):
2367         (WebCore::AXIsolatedObject::isLabel const):
2368         (WebCore::AXIsolatedObject::isDataTable const):
2369         (WebCore::AXIsolatedObject::isImageMapLink const):
2370         (WebCore::AXIsolatedObject::isNativeSpinButton const):
2371         (WebCore::AXIsolatedObject::isSpinButtonPart const):
2372         (WebCore::AXIsolatedObject::isMockObject const):
2373         (WebCore::AXIsolatedObject::isMediaObject const):
2374         (WebCore::AXIsolatedObject::isARIATextControl const):
2375         (WebCore::AXIsolatedObject::isNonNativeTextControl const):
2376         (WebCore::AXIsolatedObject::isBlockquote const):
2377         (WebCore::AXIsolatedObject::isLandmark const):
2378         (WebCore::AXIsolatedObject::isFigureElement const):
2379         (WebCore::AXIsolatedObject::isKeyboardFocusable const):
2380         (WebCore::AXIsolatedObject::isHovered const):
2381         (WebCore::AXIsolatedObject::isIndeterminate const):
2382         (WebCore::AXIsolatedObject::isLoaded const):
2383         (WebCore::AXIsolatedObject::isOnScreen const):
2384         (WebCore::AXIsolatedObject::isOffScreen const):
2385         (WebCore::AXIsolatedObject::isPressed const):
2386         (WebCore::AXIsolatedObject::isUnvisited const):
2387         (WebCore::AXIsolatedObject::isLinked const):
2388         (WebCore::AXIsolatedObject::isVisible const):
2389         (WebCore::AXIsolatedObject::isCollapsed const):
2390         (WebCore::AXIsolatedObject::isSelectedOptionActive const):
2391         (WebCore::AXIsolatedObject::hasBoldFont const):
2392         (WebCore::AXIsolatedObject::hasItalicFont const):
2393         (WebCore::AXIsolatedObject::hasMisspelling const):
2394         (WebCore::AXIsolatedObject::hasPlainText const):
2395         (WebCore::AXIsolatedObject::hasSameFont const):
2396         (WebCore::AXIsolatedObject::hasSameFontColor const):
2397         (WebCore::AXIsolatedObject::hasSameStyle const):
2398         (WebCore::AXIsolatedObject::isStaticText const):
2399         (WebCore::AXIsolatedObject::hasUnderline const):
2400         (WebCore::AXIsolatedObject::hasHighlighting const):
2401         (WebCore::AXIsolatedObject::element const):
2402         (WebCore::AXIsolatedObject::node const):
2403         (WebCore::AXIsolatedObject::renderer const):
2404         (WebCore::AXIsolatedObject::defaultObjectInclusion const):
2405         (WebCore::AXIsolatedObject::accessibilityIsIgnoredByDefault const):
2406         (WebCore::AXIsolatedObject::stepValueForRange const):
2407         (WebCore::AXIsolatedObject::selectedListItem):
2408         (WebCore::AXIsolatedObject::ariaActiveDescendantReferencingElements const):
2409         (WebCore::AXIsolatedObject::ariaControlsReferencingElements const):
2410         (WebCore::AXIsolatedObject::ariaDescribedByElements const):
2411         (WebCore::AXIsolatedObject::ariaDescribedByReferencingElements const):
2412         (WebCore::AXIsolatedObject::ariaDetailsReferencingElements const):
2413         (WebCore::AXIsolatedObject::ariaErrorMessageReferencingElements const):
2414         (WebCore::AXIsolatedObject::ariaFlowToReferencingElements const):
2415         (WebCore::AXIsolatedObject::ariaLabelledByElements const):
2416         (WebCore::AXIsolatedObject::ariaLabelledByReferencingElements const):
2417         (WebCore::AXIsolatedObject::ariaOwnsReferencingElements const):
2418         (WebCore::AXIsolatedObject::hasDatalist const):
2419         (WebCore::AXIsolatedObject::supportsHasPopup const):
2420         (WebCore::AXIsolatedObject::supportsPressed const):
2421         (WebCore::AXIsolatedObject::supportsChecked const):
2422         (WebCore::AXIsolatedObject::ignoredFromModalPresence const):
2423         (WebCore::AXIsolatedObject::isModalDescendant const):
2424         (WebCore::AXIsolatedObject::isModalNode const):
2425         (WebCore::AXIsolatedObject::elementAccessibilityHitTest const):
2426         (WebCore::AXIsolatedObject::firstChild const):
2427         (WebCore::AXIsolatedObject::lastChild const):
2428         (WebCore::AXIsolatedObject::previousSibling const):
2429         (WebCore::AXIsolatedObject::nextSibling const):
2430         (WebCore::AXIsolatedObject::nextSiblingUnignored const):
2431         (WebCore::AXIsolatedObject::previousSiblingUnignored const):
2432         (WebCore::AXIsolatedObject::parentObjectIfExists const):
2433         (WebCore::AXIsolatedObject::isDescendantOfBarrenParent const):
2434         (WebCore::AXIsolatedObject::isDescendantOfRole const):
2435         (WebCore::AXIsolatedObject::observableObject const):
2436         (WebCore::AXIsolatedObject::correspondingLabelForControlElement const):
2437         (WebCore::AXIsolatedObject::correspondingControlForLabelElement const):
2438         (WebCore::AXIsolatedObject::isPresentationalChildOfAriaRole const):
2439         (WebCore::AXIsolatedObject::ariaRoleHasPresentationalChildren const):
2440         (WebCore::AXIsolatedObject::inheritsPresentationalRole const):
2441         (WebCore::AXIsolatedObject::setAccessibleName):
2442         (WebCore::AXIsolatedObject::hasAttributesRequiredForInclusion const):
2443         (WebCore::AXIsolatedObject::accessibilityDescription const):
2444         (WebCore::AXIsolatedObject::title const):
2445         (WebCore::AXIsolatedObject::helpText const):
2446         (WebCore::AXIsolatedObject::isARIAStaticText const):
2447         (WebCore::AXIsolatedObject::stringValue const):
2448         (WebCore::AXIsolatedObject::text const):
2449         (WebCore::AXIsolatedObject::ariaLabeledByAttribute const):
2450         (WebCore::AXIsolatedObject::ariaDescribedByAttribute const):
2451         (WebCore::AXIsolatedObject::accessibleNameDerivesFromContent const):
2452         (WebCore::AXIsolatedObject::elementsFromAttribute const):
2453         (WebCore::AXIsolatedObject::axObjectCache const):
2454         (WebCore::AXIsolatedObject::anchorElement const):
2455         (WebCore::AXIsolatedObject::actionElement const):
2456         (WebCore::AXIsolatedObject::elementPath const):
2457         (WebCore::AXIsolatedObject::supportsPath const):
2458         (WebCore::AXIsolatedObject::textIteratorBehaviorForTextRange const):
2459         (WebCore::AXIsolatedObject::widget const):
2460         (WebCore::AXIsolatedObject::widgetForAttachmentView const):
2461         (WebCore::AXIsolatedObject::page const):
2462         (WebCore::AXIsolatedObject::document const):
2463         (WebCore::AXIsolatedObject::documentFrameView const):
2464         (WebCore::AXIsolatedObject::frame const):
2465         (WebCore::AXIsolatedObject::mainFrame const):
2466         (WebCore::AXIsolatedObject::topDocument const):
2467         (WebCore::AXIsolatedObject::scrollViewAncestor const):
2468         (WebCore::AXIsolatedObject::childrenChanged):
2469         (WebCore::AXIsolatedObject::textChanged):
2470         (WebCore::AXIsolatedObject::updateAccessibilityRole):
2471         (WebCore::AXIsolatedObject::addChildren):
2472         (WebCore::AXIsolatedObject::addChild):
2473         (WebCore::AXIsolatedObject::insertChild):
2474         (WebCore::AXIsolatedObject::shouldIgnoreAttributeRole const):
2475         (WebCore::AXIsolatedObject::canHaveChildren const):
2476         (WebCore::AXIsolatedObject::hasChildren const):
2477         (WebCore::AXIsolatedObject::setNeedsToUpdateChildren):
2478         (WebCore::AXIsolatedObject::setNeedsToUpdateSubtree):
2479         (WebCore::AXIsolatedObject::clearChildren):
2480         (WebCore::AXIsolatedObject::needsToUpdateChildren const):
2481         (WebCore::AXIsolatedObject::detachFromParent):
2482         (WebCore::AXIsolatedObject::shouldFocusActiveDescendant const):
2483         (WebCore::AXIsolatedObject::activeDescendant const):
2484         (WebCore::AXIsolatedObject::handleActiveDescendantChanged):
2485         (WebCore::AXIsolatedObject::handleAriaExpandedChanged):
2486         (WebCore::AXIsolatedObject::isDescendantOfObject const):
2487         (WebCore::AXIsolatedObject::isAncestorOfObject const):
2488         (WebCore::AXIsolatedObject::firstAnonymousBlockChild const):
2489         (WebCore::AXIsolatedObject::hasAttribute const):
2490         (WebCore::AXIsolatedObject::getAttribute const):
2491         (WebCore::AXIsolatedObject::hasTagName const):
2492         (WebCore::AXIsolatedObject::stringValueForMSAA const):
2493         (WebCore::AXIsolatedObject::stringRoleForMSAA const):
2494         (WebCore::AXIsolatedObject::nameForMSAA const):
2495         (WebCore::AXIsolatedObject::descriptionForMSAA const):
2496         (WebCore::AXIsolatedObject::roleValueForMSAA const):
2497         (WebCore::AXIsolatedObject::passwordFieldValue const):
2498         (WebCore::AXIsolatedObject::liveRegionAncestor const):
2499         (WebCore::AXIsolatedObject::hasContentEditableAttributeSet const):
2500         (WebCore::AXIsolatedObject::supportsReadOnly const):
2501         (WebCore::AXIsolatedObject::supportsAutoComplete const):
2502         (WebCore::AXIsolatedObject::supportsARIAAttributes const):
2503         (WebCore::AXIsolatedObject::scrollByPage const):
2504         (WebCore::AXIsolatedObject::scrollPosition const):
2505         (WebCore::AXIsolatedObject::scrollContentsSize const):
2506         (WebCore::AXIsolatedObject::scrollVisibleContentRect const):
2507         (WebCore::AXIsolatedObject::scrollToMakeVisible const):
2508         (WebCore::AXIsolatedObject::lastKnownIsIgnoredValue):
2509         (WebCore::AXIsolatedObject::setLastKnownIsIgnoredValue):
2510         (WebCore::AXIsolatedObject::notifyIfIgnoredValueChanged):
2511         (WebCore::AXIsolatedObject::isMathScriptObject const):
2512         (WebCore::AXIsolatedObject::isMathMultiscriptObject const):
2513         (WebCore::AXIsolatedObject::isAXHidden const):
2514         (WebCore::AXIsolatedObject::isDOMHidden const):
2515         (WebCore::AXIsolatedObject::isHidden const):
2516         (WebCore::AXIsolatedObject::overrideAttachmentParent):
2517         (WebCore::AXIsolatedObject::accessibilityIgnoreAttachment const):
2518         (WebCore::AXIsolatedObject::accessibilityPlatformIncludesObject const):
2519         (WebCore::AXIsolatedObject::hasApplePDFAnnotationAttribute const):
2520         (WebCore::AXIsolatedObject::ancestorAccessibilityScrollView const):
2521         (WebCore::AXIsolatedObject::setIsIgnoredFromParentData):
2522         (WebCore::AXIsolatedObject::clearIsIgnoredFromParentData):
2523         (WebCore::AXIsolatedObject::setIsIgnoredFromParentDataForChild):
2524         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
2525         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Added
2526         dispatching to the main thread some of the methods that cannot be run
2527         in the secondary thread.
2528         (performAccessibilityFunctionOnMainThread):
2529         (retrieveAccessibilityValueFromMainThread):
2530         (-[WebAccessibilityObjectWrapper attachmentView]):
2531         (-[WebAccessibilityObjectWrapper screenToContents:]):
2532         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
2533         (-[WebAccessibilityObjectWrapper remoteAccessibilityParentObject]):
2534         (-[WebAccessibilityObjectWrapper associatedPluginParent]):
2535         (-[WebAccessibilityObjectWrapper subrole]):
2536         (-[WebAccessibilityObjectWrapper scrollViewParent]):
2537         (-[WebAccessibilityObjectWrapper windowElement:]):
2538         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2539         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
2540         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
2541         (-[WebAccessibilityObjectWrapper _accessibilityShowContextMenu]):
2542         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2543         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
2544
2545 2019-12-07  Zalan Bujtas  <zalan@apple.com>
2546
2547         [LFC][IFC] Initialize InlineLayoutUnit variables to 0
2548         https://bugs.webkit.org/show_bug.cgi?id=204989
2549
2550         Reviewed by Antti Koivisto.
2551
2552         This is in preparation for using float based types in IFC. See webkit.org/b/204986 for more info.
2553
2554         * layout/inlineformatting/InlineFormattingContext.cpp:
2555         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
2556         * layout/inlineformatting/InlineLineBreaker.cpp:
2557         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
2558         * layout/inlineformatting/InlineLineBreaker.h:
2559         * layout/inlineformatting/InlineLineBuilder.cpp:
2560         (WebCore::Layout::LineBuilder::initialize):
2561         (WebCore::Layout::LineBuilder::alignContentVertically):
2562         (WebCore::Layout::LineBuilder::justifyRuns const):
2563         (WebCore::Layout::LineBuilder::TrimmableContent::append):
2564         (WebCore::Layout::LineBuilder::TrimmableContent::trim):
2565         (WebCore::Layout::LineBuilder::TrimmableContent::trimTrailingRun):
2566         * layout/inlineformatting/InlineLineBuilder.h:
2567         * layout/inlineformatting/text/TextUtil.h:
2568
2569 2019-12-07  Zalan Bujtas  <zalan@apple.com>
2570
2571         [LFC][IFC] Introduce InlineRect
2572         https://bugs.webkit.org/show_bug.cgi?id=204988
2573         <rdar://problem/57729049>
2574
2575         Reviewed by Antti Koivisto.
2576
2577         This is in preparation for using float based types in IFC. See webkit.org/b/204986 for more info.
2578
2579         * WebCore.xcodeproj/project.pbxproj:
2580         * layout/LayoutUnits.h:
2581         * layout/displaytree/DisplayInlineRect.h: Added.
2582         (WebCore::Display::InlineRect::expandHorizontally):
2583         (WebCore::Display::InlineRect::expandVertically):
2584         (WebCore::Display::InlineRect::invalidateTop):
2585         (WebCore::Display::InlineRect::invalidateLeft):
2586         (WebCore::Display::InlineRect::invalidateWidth):
2587         (WebCore::Display::InlineRect::invalidateHeight):
2588         (WebCore::Display::InlineRect::hasValidPosition const):
2589         (WebCore::Display::InlineRect::hasValidSize const):
2590         (WebCore::Display::InlineRect::hasValidGeometry const):
2591         (WebCore::Display::InlineRect::InlineRect):
2592         (WebCore::Display::InlineRect::invalidatePosition):
2593         (WebCore::Display::InlineRect::setHasValidPosition):
2594         (WebCore::Display::InlineRect::setHasValidSize):
2595         (WebCore::Display::InlineRect::top const):
2596         (WebCore::Display::InlineRect::left const):
2597         (WebCore::Display::InlineRect::bottom const):
2598         (WebCore::Display::InlineRect::right const):
2599         (WebCore::Display::InlineRect::topLeft const):
2600         (WebCore::Display::InlineRect::size const):
2601         (WebCore::Display::InlineRect::width const):
2602         (WebCore::Display::InlineRect::height const):
2603         (WebCore::Display::InlineRect::setTopLeft):
2604         (WebCore::Display::InlineRect::setTop):
2605         (WebCore::Display::InlineRect::setLeft):
2606         (WebCore::Display::InlineRect::setWidth):
2607         (WebCore::Display::InlineRect::setHeight):
2608         (WebCore::Display::InlineRect::moveHorizontally):
2609         (WebCore::Display::InlineRect::moveVertically):
2610         (WebCore::Display::InlineRect::expand):
2611         (WebCore::Display::InlineRect::operator InlineLayoutRect const):
2612         * layout/displaytree/DisplayLineBox.h:
2613         (WebCore::Display::LineBox::LineBox):
2614         * layout/displaytree/DisplayRun.h:
2615         (WebCore::Display::Run::logicalRect const):
2616         (WebCore::Display::Run::setLogicalLeft):
2617         (WebCore::Display::Run::Run):
2618         (WebCore::Display::Run::setLogicalRight): Deleted.
2619         * layout/inlineformatting/InlineLineBuilder.cpp:
2620         (WebCore::Layout::LineBuilder::ContinousContent::close):
2621         (WebCore::Layout::LineBuilder::Run::Run):
2622         (WebCore::Layout::LineBuilder::initialize):
2623         * layout/inlineformatting/InlineLineBuilder.h:
2624         (WebCore::Layout::LineBuilder::Run::logicalRect const):
2625
2626 2019-12-07  Zalan Bujtas  <zalan@apple.com>
2627
2628         [LFC][IFC] Introduce InlineLayoutUnit
2629         https://bugs.webkit.org/show_bug.cgi?id=204986
2630         <rdar://problem/57728333>
2631
2632         Reviewed by Antti Koivisto.
2633
2634         While IFC uses LayoutUnit type solely to compute inline geometry, complex line layout (CLL) has
2635         adopted several different types over time (int, float and LayoutUnit). These types all have different precisions.
2636         In order to match CLL's output (inline tree geometry) IFC needs to use a type that has
2637         roughly the same precision as what CLL uses.
2638         LayoutUnit currently does not have high enough precision (1/64) to produce matching results.
2639         This patch introduces InlineLayoutUnit. It is going to be mapped to 'float' for now (in a subsequent patch).
2640         It helps to keep one uniform type across the IFC codebase and we could also just re-map it to something
2641         more appropriate in the future. 
2642
2643         * layout/LayoutUnits.h:
2644         * layout/displaytree/DisplayLineBox.h:
2645         (WebCore::Display::LineBox::Baseline::height const):
2646         (WebCore::Display::LineBox::logicalLeft const):
2647         (WebCore::Display::LineBox::logicalRight const):
2648         (WebCore::Display::LineBox::logicalTop const):
2649         (WebCore::Display::LineBox::logicalBottom const):
2650         (WebCore::Display::LineBox::logicalWidth const):
2651         (WebCore::Display::LineBox::logicalHeight const):
2652         (WebCore::Display::LineBox::setLogicalHeight):
2653         (WebCore::Display::LineBox::setLogicalWidth):
2654         (WebCore::Display::LineBox::moveHorizontally):
2655         (WebCore::Display::LineBox::expandHorizontally):
2656         (WebCore::Display::LineBox::shrinkHorizontally):
2657         (WebCore::Display::LineBox::expandVertically):
2658         (WebCore::Display::LineBox::shrinkVertically):
2659         (WebCore::Display::LineBox::LineBox):
2660         (WebCore::Display::LineBox::setLogicalHeightIfGreater):
2661         (WebCore::Display::LineBox::setBaselineOffsetIfGreater):
2662         (WebCore::Display::LineBox::setAscentIfGreater):
2663         (WebCore::Display::LineBox::setDescentIfGreater):
2664         (WebCore::Display::LineBox::baselineOffset const):
2665         (WebCore::Display::LineBox::Baseline::Baseline):
2666         (WebCore::Display::LineBox::Baseline::setAscent):
2667         (WebCore::Display::LineBox::Baseline::setDescent):
2668         (WebCore::Display::LineBox::Baseline::ascent const):
2669         (WebCore::Display::LineBox::Baseline::descent const):
2670         * layout/inlineformatting/InlineFormattingContext.cpp:
2671         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2672         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
2673         (WebCore::Layout::InlineFormattingContext::constraintsForLine):
2674         * layout/inlineformatting/InlineFormattingContext.h:
2675         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2676         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
2677         * layout/inlineformatting/InlineLineBreaker.cpp:
2678         (WebCore::Layout::LineBreaker::shouldWrapFloatBox):
2679         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
2680         (WebCore::Layout::LineBreaker::tryBreakingTextRun const):
2681         (WebCore::Layout::LineBreaker::Content::append):
2682         * layout/inlineformatting/InlineLineBreaker.h:
2683         (WebCore::Layout::LineBreaker::Content::width const):
2684         (WebCore::Layout::LineBreaker::Content::nonTrimmableWidth const):
2685         * layout/inlineformatting/InlineLineBuilder.cpp:
2686         (WebCore::Layout::LineBuilder::Run::setComputedHorizontalExpansion):
2687         (WebCore::Layout::LineBuilder::initialize):
2688         (WebCore::Layout::LineBuilder::alignContentVertically):
2689         (WebCore::Layout::LineBuilder::justifyRuns const):
2690         (WebCore::Layout::LineBuilder::alignContentHorizontally const):
2691         (WebCore::Layout::LineBuilder::moveLogicalLeft):
2692         (WebCore::Layout::LineBuilder::moveLogicalRight):
2693         (WebCore::Layout::LineBuilder::append):
2694         (WebCore::Layout::LineBuilder::appendNonBreakableSpace):
2695         (WebCore::Layout::LineBuilder::appendInlineContainerStart):
2696         (WebCore::Layout::LineBuilder::appendInlineContainerEnd):
2697         (WebCore::Layout::LineBuilder::appendTextContent):
2698         (WebCore::Layout::LineBuilder::appendNonReplacedInlineBox):
2699         (WebCore::Layout::LineBuilder::appendReplacedInlineBox):
2700         (WebCore::Layout::LineBuilder::runContentHeight const):
2701         (WebCore::Layout::LineBuilder::halfLeadingMetrics):
2702         (WebCore::Layout::LineBuilder::TrimmableContent::append):
2703         (WebCore::Layout::LineBuilder::TrimmableContent::trim):
2704         (WebCore::Layout::LineBuilder::TrimmableContent::trimTrailingRun):
2705         (WebCore::Layout::LineBuilder::InlineItemRun::InlineItemRun):
2706         (WebCore::Layout::LineBuilder::InlineItemRun::trailingLetterSpacing const):
2707         * layout/inlineformatting/InlineLineBuilder.h:
2708         (WebCore::Layout::LineBuilder::availableWidth const):
2709         (WebCore::Layout::LineBuilder::trailingTrimmableWidth const):
2710         (WebCore::Layout::LineBuilder::Run::adjustLogicalTop):
2711         (WebCore::Layout::LineBuilder::Run::moveHorizontally):
2712         (WebCore::Layout::LineBuilder::Run::moveVertically):
2713         (WebCore::Layout::LineBuilder::Run::setLogicalHeight):
2714         (WebCore::Layout::LineBuilder::logicalTop const):
2715         (WebCore::Layout::LineBuilder::logicalBottom const):
2716         (WebCore::Layout::LineBuilder::logicalLeft const):
2717         (WebCore::Layout::LineBuilder::logicalRight const):
2718         (WebCore::Layout::LineBuilder::logicalWidth const):
2719         (WebCore::Layout::LineBuilder::logicalHeight const):
2720         (WebCore::Layout::LineBuilder::contentLogicalWidth const):
2721         (WebCore::Layout::LineBuilder::contentLogicalRight const):
2722         (WebCore::Layout::LineBuilder::baselineOffset const):
2723         (WebCore::Layout::LineBuilder::InlineItemRun::logicalLeft const):
2724         (WebCore::Layout::LineBuilder::InlineItemRun::logicalWidth const):
2725         (WebCore::Layout::LineBuilder::InlineItemRun::moveHorizontally):
2726         (WebCore::Layout::LineBuilder::TrimmableContent::width const):
2727         * layout/inlineformatting/InlineTextItem.cpp:
2728         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
2729         (WebCore::Layout::InlineTextItem::createWhitespaceItem):
2730         (WebCore::Layout::InlineTextItem::createNonWhitespaceItem):
2731         (WebCore::Layout::InlineTextItem::InlineTextItem):
2732         * layout/inlineformatting/InlineTextItem.h:
2733         (WebCore::Layout::InlineTextItem::width const):
2734         * layout/inlineformatting/LineLayoutContext.cpp:
2735         (WebCore::Layout::inlineItemWidth):
2736         * layout/inlineformatting/text/TextUtil.cpp:
2737         (WebCore::Layout::TextUtil::width):
2738         (WebCore::Layout::TextUtil::fixedPitchWidth):
2739         (WebCore::Layout::TextUtil::split):
2740         * layout/inlineformatting/text/TextUtil.h:
2741
2742 2019-12-07  Antti Koivisto  <antti@apple.com>
2743
2744         [LFC][IFC] Move LineBox to Display namespace
2745         https://bugs.webkit.org/show_bug.cgi?id=204984
2746
2747         Reviewed by Zalan Bujtas.
2748
2749         It is a display type, like Display::Run.
2750
2751         * Sources.txt:
2752         * WebCore.xcodeproj/project.pbxproj:
2753         * layout/displaytree/DisplayInlineContent.cpp: Added.
2754
2755         Also added a cpp for Display::InlineContent.
2756
2757         (WebCore::Display:: const):
2758         * layout/displaytree/DisplayInlineContent.h:
2759         (WebCore::Display::InlineContent::lineBoxForRun const):
2760         (WebCore::Display:: const): Deleted.
2761         * layout/displaytree/DisplayLineBox.h: Renamed from Source/WebCore/layout/inlineformatting/InlineLineBox.h.
2762         (WebCore::Display::LineBox::LineBox):
2763         * layout/inlineformatting/InlineFormattingContext.cpp:
2764         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
2765         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2766         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
2767         * layout/inlineformatting/InlineFormattingState.h:
2768         * layout/inlineformatting/InlineLineBuilder.cpp:
2769         (WebCore::Layout::LineBuilder::initialize):
2770         (WebCore::Layout::LineBuilder::halfLeadingMetrics):
2771         * layout/inlineformatting/InlineLineBuilder.h:
2772         (WebCore::Layout::LineBuilder::lineBox const):
2773         * layout/inlineformatting/LineLayoutContext.h:
2774
2775 2019-12-07  Zalan Bujtas  <zalan@apple.com>
2776
2777         [LFC][IFC] Add support for breaking at previous breaking opportunities when the overflown content is unbreakable
2778         https://bugs.webkit.org/show_bug.cgi?id=204985
2779         <rdar://problem/57727436>
2780
2781         Reviewed by Antti Koivisto.
2782
2783         <span>first</span><span style="word-break: break-all">second</span><span>third</span
2784
2785         In case of multiple runs in one commit content [firstsecondthrid], if the overflown run [thrid] does not have
2786         a breaking opportunity, we need to backtrack the last breakable run [second] and break right there. ->
2787
2788         "firstsecond
2789         third"
2790
2791         * layout/inlineformatting/InlineLineBreaker.cpp:
2792         (WebCore::Layout::isContentWrappingAllowed):
2793         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
2794         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
2795
2796 2019-12-07  Zalan Bujtas  <zalan@apple.com>
2797
2798         [LFC][IFC] Fix css1/formatting_model/floating_elements.html
2799         https://bugs.webkit.org/show_bug.cgi?id=204983
2800         <rdar://problem/57727197>
2801
2802         Reviewed by Antti Koivisto.
2803
2804         Adjacent non-whitespace inline items are guaranteed to be on commit boundary when they both belong
2805         to the same layout box (<div>text-content</div> [text-][content] vs <div>textcontent</div> [textcontent]).
2806
2807         * layout/inlineformatting/InlineLineBreaker.cpp:
2808         (WebCore::Layout::LineBreaker::Content::isAtContentBoundary):
2809
2810 2019-12-07  Antti Koivisto  <antti@apple.com>
2811
2812         [LFC][Integration] Layout test assert and crash fixes
2813         https://bugs.webkit.org/show_bug.cgi?id=204982
2814
2815         Reviewed by Zalan Bujtas.
2816
2817         * layout/integration/LayoutIntegrationLineLayout.cpp:
2818         (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const):
2819         (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const):
2820         (WebCore::LayoutIntegration::LineLayout::textBoxesFor const):
2821
2822         Don't 0-initialize Optional.
2823
2824         * layout/integration/LayoutIntegrationLineLayout.h:
2825         * layout/layouttree/LayoutTreeBuilder.cpp:
2826         (WebCore::Layout::TreeBuilder::createLayoutBox):
2827
2828         Remember to add line break renderer to the renderer->layout box map.
2829
2830         * rendering/RenderBlockFlow.cpp:
2831         (WebCore::RenderBlockFlow::markLinesDirtyInBlockRange):
2832
2833         Invalidate layout path with LFC.
2834
2835         (WebCore::RenderBlockFlow::firstLineBaseline const):
2836         (WebCore::RenderBlockFlow::inlineBlockBaseline const):
2837
2838         Call LFC baseline functions.
2839
2840 2019-12-07  Tim Horton  <timothy_horton@apple.com>
2841
2842         Implement encoding for DrawImage and DrawRoundedRect display list items
2843         https://bugs.webkit.org/show_bug.cgi?id=204881
2844
2845         Reviewed by Simon Fraser.
2846
2847         Make InterpolationQuality an enum class.
2848         Make ImagePaintingOptions and all of its children encodable.
2849         Make DrawImage and DrawRoundedRect encodable.
2850         Add ImageHandle, which right now just wraps WebCore::Image, but
2851         later could carry identifiers. This allows us to implement image encoding
2852         in WebKit code, which can then use ShareableBitmap to A) decode the image
2853         in the Web Content process and B) use shared memory to transmit the
2854         decoded image data to the GPU process.
2855
2856         * html/CanvasBase.cpp:
2857         * html/ImageBitmap.cpp:
2858         (WebCore::interpolationQualityForResizeQuality):
2859         * html/canvas/CanvasRenderingContext2DBase.cpp:
2860         (WebCore::smoothingToInterpolationQuality):
2861         (WebCore::CanvasRenderingContext2DBase::setImageSmoothingEnabled):
2862         * platform/graphics/DecodingOptions.h:
2863         * platform/graphics/GraphicsContext.h:
2864         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
2865         * platform/graphics/GraphicsTypes.h:
2866         * platform/graphics/ImageOrientation.h:
2867         * platform/graphics/ImagePaintingOptions.h:
2868         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
2869         (WebCore::ImagePaintingOptions::encode const):
2870         (WebCore::ImagePaintingOptions::decode):
2871         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2872         (WebCore::MediaPlayerPrivateAVFoundationCF::paint):
2873         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2874         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
2875         * platform/graphics/cairo/CairoOperations.cpp:
2876         (WebCore::Cairo::drawSurface):
2877         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2878         (WebCore::GraphicsContext3D::paintToCanvas):
2879         * platform/graphics/cg/GraphicsContextCG.cpp:
2880         (WebCore::convertInterpolationQuality):
2881         (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
2882         * platform/graphics/displaylists/DisplayListItems.cpp:
2883         (WebCore::DisplayList::FillRoundedRect::FillRoundedRect):
2884         * platform/graphics/displaylists/DisplayListItems.h:
2885         (WebCore::DisplayList::DrawImage::encode const):
2886         (WebCore::DisplayList::DrawImage::decode):
2887         (WebCore::DisplayList::FillRoundedRect::create):
2888         (WebCore::DisplayList::FillRoundedRect::encode const):
2889         (WebCore::DisplayList::FillRoundedRect::decode):
2890         (WebCore::DisplayList::Item::encode const):
2891         (WebCore::DisplayList::Item::decode):
2892         (WebCore::DisplayList::FillRoundedRect::FillRoundedRect): Deleted.
2893         * platform/graphics/ios/IconIOS.mm:
2894         (WebCore::Icon::paint):
2895         * platform/graphics/texmap/BitmapTexture.cpp:
2896         (WebCore::BitmapTexture::updateContents):
2897         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2898         (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
2899         * platform/ios/wak/WAKView.mm:
2900         (toCGInterpolationQuality):
2901         * platform/mock/MockRealtimeVideoSource.cpp:
2902         (WebCore::MockRealtimeVideoSource::imageBuffer const):
2903         * rendering/ImageQualityController.cpp:
2904         (WebCore::ImageQualityController::interpolationQualityFromStyle):
2905         (WebCore::ImageQualityController::chooseInterpolationQuality):
2906         * rendering/RenderImage.cpp:
2907         (WebCore::RenderImage::paintIntoRect):
2908
2909 2019-12-07  Tim Horton  <timothy_horton@apple.com>
2910
2911         macCatalyst: REGRESSION (r251320): WebKit-native media controls do not respond to hover or click
2912         https://bugs.webkit.org/show_bug.cgi?id=204543
2913         <rdar://problem/57208621>
2914
2915         Reviewed by Antoine Quint.
2916
2917         Adopt pointer events for media controls, in order to make them input-device agnostic.
2918
2919         * Modules/modern-media-controls/controls/auto-hide-controller.js:
2920         (AutoHideController):
2921         (AutoHideController.prototype.set fadesWhileIdle):
2922         (AutoHideController.prototype.handleEvent):
2923         (AutoHideController.prototype._autoHideTimerFired):
2924         Instead of tracking state in a single bit (_disableAutoHiding), keep track
2925         of sets of pointers that are active, for hover and for actual touch/click.
2926
2927         * Modules/modern-media-controls/controls/slider.js:
2928         (Slider.prototype.handleEvent):
2929         (Slider.prototype._handlePointerdownEvent):
2930         (Slider.prototype._handlePointerupEvent):
2931         (Slider.prototype._handleMousedownEvent): Deleted.
2932         (Slider.prototype._handleTouchstartEvent): Deleted.
2933         (Slider.prototype._handleMouseupEvent): Deleted.
2934         (Slider.prototype._handleTouchendEvent): Deleted.
2935         Adopt pointer events.
2936
2937         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
2938         (GestureRecognizer):
2939         (GestureRecognizer.prototype.get numberOfTouches):
2940         (GestureRecognizer.prototype.locationInElement):
2941         (GestureRecognizer.prototype.locationInClient):
2942         (GestureRecognizer.prototype.touchesBegan):
2943         (GestureRecognizer.prototype.handleEvent):
2944         (GestureRecognizer.prototype._updateBaseListeners):
2945         (GestureRecognizer.prototype._removeTrackingListeners):
2946         (GestureRecognizer.prototype._updateTargetTouches):
2947         (GestureRecognizer.prototype.locationOfTouchInElement): Deleted.
2948         Instead of keeping track of Touches, keep track of the currently-active set of PointerEvents.
2949         We just store events by pointerId, and update them when they change, so we can
2950         later retrieve e.g. points.
2951         Remove locationOfTouchInElement which seems to not be used.
2952
2953         * html/RangeInputType.cpp:
2954         * html/RangeInputType.h:
2955         * html/shadow/SliderThumbElement.cpp:
2956         (WebCore::SliderThumbElement::dragFrom):
2957         (WebCore::SliderThumbElement::defaultEventHandler):
2958         * html/shadow/SliderThumbElement.h:
2959         Allow range inputs to accept mouse events everywhere.
2960
2961         * WebCore.xcodeproj/project.pbxproj:
2962         Add some missing files to the project.
2963
2964 2019-12-07  Devin Rousso  <drousso@apple.com>
2965
2966         Web Inspector: non-regex Local Overrides and Script Blackboxing shouldn't apply to scripts that just contain the URL
2967         https://bugs.webkit.org/show_bug.cgi?id=204954
2968
2969         Reviewed by Joseph Pecoraro.
2970
2971         If `isRegex` is false, add `^` and `$` to the beginning and end of the search string to
2972         ensure that the search string is exactly matched, not just contained within the potentially
2973         intercepted URL.
2974
2975         This doesn't actually change functionality because the Web Inspector frontend wouldn't
2976         replace the network response for these containing matches, as the frontend JavaScript
2977         already correctly performed this logic, and would therefore `Network.interceptContinue`.
2978
2979         * inspector/agents/InspectorNetworkAgent.cpp:
2980         (WebCore::InspectorNetworkAgent::shouldIntercept):
2981
2982         * inspector/agents/InspectorDOMAgent.cpp:
2983         (WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded):
2984         * inspector/agents/InspectorPageAgent.cpp:
2985         (WebCore::InspectorPageAgent::searchInResources):
2986         Use renamed `ContentSearchUtilities` function.
2987
2988 2019-12-06  Zalan Bujtas  <zalan@apple.com>
2989
2990         [LFC][IFC] Rename ContentBreak to ContentWrappingRule and ContentBreak::wrap to ContentWrappingRule::push
2991         https://bugs.webkit.org/show_bug.cgi?id=204966
2992         <rdar://problem/57717049>
2993
2994         Reviewed by Sam Weinig.
2995
2996         Use the term "push" instead of "wrap" to move a run to the next line without breaking it.
2997         This is mainly to avoid spec term confusion.
2998         ContentWrappingRule::Keep -> keep the run (or continuous runs) on the current line.
2999         ContentWrappingRule::Split -> keep the run (or continuous runs) partially on the current line (see BreakingContext::PartialTrailingContent).
3000         ContentWrappingRule::Push -> move the run (or continuous runs) completely to the next line.
3001
3002         * layout/inlineformatting/InlineLineBreaker.cpp:
3003         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
3004         * layout/inlineformatting/InlineLineBreaker.h:
3005         * layout/inlineformatting/LineLayoutContext.cpp:
3006         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
3007
3008 2019-12-06  Commit Queue  <commit-queue@webkit.org>
3009
3010         Unreviewed, rolling out r253218.
3011         https://bugs.webkit.org/show_bug.cgi?id=204968
3012
3013         Broke the build (Requested by ap on #webkit).
3014
3015         Reverted changeset:
3016
3017         "Remove various .order files."
3018         https://bugs.webkit.org/show_bug.cgi?id=204959
3019         https://trac.webkit.org/changeset/253218
3020
3021 2019-12-06  Per Arne Vollan  <pvollan@apple.com>
3022
3023         [iOS] Calls to device orientation API should be done in the UI process
3024         https://bugs.webkit.org/show_bug.cgi?id=204720
3025
3026         Reviewed by Alex Christensen.
3027
3028         The device orientation API on iOS is communicating with locationd. Since mach lookup to this daemon
3029         will be closed, the calls to this API should be moved from the WebContent process to the UI process.
3030         This patch implements forwarding of the device orientation requests to the UI process through a new
3031         class, DeviceOrientationUpdateProvider, which is subclassed by WebDeviceOrientationUpdateProvider in
3032         modern WebKit. This class implements forwarding of the requests to the UI process, and receives
3033         device orientation updates from the UI process. An instance of this class will be shared by all
3034         device orientation clients on a page, and passed as part of the page configuration parameters. On
3035         the UI process side, a new class WebDeviceOrientationUpdateProviderProxy attached to the Web page
3036         proxy is taking care of calling the device orientation API through the existing WebCoreMotionManager
3037         Objective-C class, and send device orientation updates back to the Web process. Also, use a weak
3038         hash set of orientation clients in WebCoreMotionManager.
3039
3040         * WebCore.xcodeproj/project.pbxproj:
3041         * dom/DeviceOrientationClient.h:
3042         * dom/Document.cpp:
3043         * page/Page.cpp:
3044         (WebCore::m_deviceOrientationUpdateProvider):
3045         (WebCore::m_applicationManifest): Deleted.
3046         * page/Page.h:
3047         (WebCore::Page::deviceOrientationUpdateProvider const):
3048         * page/PageConfiguration.h:
3049         * platform/ios/DeviceOrientationClientIOS.h:
3050         * platform/ios/DeviceOrientationClientIOS.mm:
3051         (WebCore::DeviceOrientationClientIOS::DeviceOrientationClientIOS):
3052         (WebCore::DeviceOrientationClientIOS::startUpdating):
3053         (WebCore::DeviceOrientationClientIOS::stopUpdating):
3054         (WebCore::DeviceOrientationClientIOS::deviceOrientationControllerDestroyed):
3055         * platform/ios/WebCoreMotionManager.h:
3056         * platform/ios/WebCoreMotionManager.mm:
3057         (-[WebCoreMotionManager addOrientationClient:]):
3058         (-[WebCoreMotionManager removeOrientationClient:]):
3059         (-[WebCoreMotionManager checkClientStatus]):
3060         (-[WebCoreMotionManager sendMotionData:withHeading:]):
3061
3062 2019-12-06  Sihui Liu  <sihui_liu@apple.com>
3063
3064         IndexedDB: pass along error of IDBBackingStore::renameIndex
3065         https://bugs.webkit.org/show_bug.cgi?id=204900
3066
3067         Reviewed by Brady Eidson.
3068
3069         We ignored error of IDBBackingStore::renameIndex, so the operation may fail silently. This covered up two bugs 
3070         in our code as we were unaware of the failure.
3071         One was in MemoryIDBBackingStore that we did not update objectStoreInfo properly when createIndex/deleteIndex; 
3072         another was in IDBObjectStoreInfo that we did not copy its members correctly.
3073
3074         Covered by existing test: storage/indexeddb//modern/index-rename-1-private.html
3075
3076         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3077         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
3078         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
3079         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3080         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
3081         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: If some index is deleted from IDBObjectStoreInfo, then
3082         m_maxIndexID could be bigger than maximum index ID in m_indexMap, because we don't decrease m_maxIndexID for
3083         deletion. Therefore, the assertion here is incorrect.
3084         (WebCore::IDBObjectStoreInfo::isolatedCopy const):
3085
3086 2019-12-06  Don Olmstead  <don.olmstead@sony.com>
3087
3088         [MathML] Should support conditional compilation
3089         https://bugs.webkit.org/show_bug.cgi?id=204958
3090
3091         Reviewed by Ross Kirsling.
3092
3093         No new tests. No change in behavior.
3094
3095         Add missing checks for ENABLE_MATHML in the idl and cpp files.
3096
3097         * bindings/js/JSElementCustom.cpp:
3098         (WebCore::createNewElementWrapper):
3099         * bindings/js/JSNodeCustom.cpp:
3100         (WebCore::createWrapperInline):
3101         * mathml/MathMLElement.idl:
3102         * mathml/MathMLMathElement.idl:
3103
3104 2019-12-06  Devin Rousso  <drousso@apple.com>
3105
3106         Web Inspector: add compiler UNLIKELY hints when checking if developer extras are enabled
3107         https://bugs.webkit.org/show_bug.cgi?id=204875
3108
3109         Reviewed by Joseph Pecoraro.
3110
3111         * inspector/InspectorInstrumentation.h:
3112         (WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
3113         (WebCore::InspectorInstrumentation::consoleStopRecordingCanvas): Added.
3114         * inspector/InspectorInstrumentation.cpp:
3115         (WebCore::InspectorInstrumentation::frameWindowDiscardedImpl):
3116         (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
3117         (WebCore::InspectorInstrumentation::didFailLoadingImpl):
3118         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
3119         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
3120         (WebCore::InspectorInstrumentation::consoleCountImpl):
3121         (WebCore::InspectorInstrumentation::consoleCountResetImpl):
3122         (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
3123         (WebCore::InspectorInstrumentation::logConsoleTimingImpl):
3124         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
3125         (WebCore::InspectorInstrumentation::consoleStopRecordingCanvasImpl): Added.
3126
3127         * inspector/agents/WebConsoleAgent.cpp:
3128         (WebCore::WebConsoleAgent::frameWindowDiscarded):
3129         (WebCore::WebConsoleAgent::didReceiveResponse):
3130         (WebCore::WebConsoleAgent::didFailLoading):
3131         Remove the redundant check for whether developer extras are enabled since it's already
3132         checked by `InspectorInstrumentation`.
3133
3134         * page/PageConsoleClient.cpp:
3135         (WebCore::PageConsoleClient::record):
3136         (WebCore::PageConsoleClient::recordEnd):
3137         * inspector/agents/InspectorCanvasAgent.h:
3138         * inspector/agents/InspectorCanvasAgent.cpp:
3139         (WebCore::InspectorCanvasAgent::consoleStopRecordingCanvas): Added.
3140         Add checks for `InspectorInstrumentation::hasFrontends()` to avoid doing extra work when Web
3141         Inspector isn't open.
3142
3143 2019-12-06  Zalan Bujtas  <zalan@apple.com>
3144
3145         [LFC][IFC] Use explicit 0_lu value instead of LayoutUnit { }
3146         https://bugs.webkit.org/show_bug.cgi?id=204964
3147         <rdar://problem/57714095>
3148
3149         Reviewed by Antti Koivisto.
3150
3151         From geometry computation point of view, it is really the 0 value and not an empty value. 
3152
3153         * layout/inlineformatting/InlineFormattingContext.cpp:
3154         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
3155         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3156         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
3157         * layout/inlineformatting/InlineLineBox.h:
3158         (WebCore::Layout::LineBox::resetDescent):
3159         (WebCore::Layout::LineBox::resetBaseline):
3160         (WebCore::Layout::LineBox::Baseline::reset):
3161         * layout/inlineformatting/InlineLineBreaker.cpp:
3162         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
3163         (WebCore::Layout::LineBreaker::Content::reset):
3164         (WebCore::Layout::LineBreaker::Content::TrailingTrimmableContent::reset):
3165         * layout/inlineformatting/InlineLineBuilder.cpp:
3166         (WebCore::Layout::LineBuilder::ContinousContent::close):
3167         (WebCore::Layout::LineBuilder::Run::Run):
3168         (WebCore::Layout::LineBuilder::initialize):
3169         (WebCore::Layout::LineBuilder::close):
3170         (WebCore::Layout::LineBuilder::alignContentVertically):
3171         (WebCore::Layout::LineBuilder::appendLineBreak):
3172         (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):
3173         (WebCore::Layout::LineBuilder::TrimmableContent::trimTrailingRun):
3174         (WebCore::Layout::LineBuilder::InlineItemRun::trailingLetterSpacing const):
3175         (WebCore::Layout::LineBuilder::InlineItemRun::setCollapsesToZeroAdvanceWidth):
3176         * layout/inlineformatting/InlineLineBuilder.h:
3177         (WebCore::Layout::LineBuilder::TrimmableContent::reset):
3178         * layout/inlineformatting/LineLayoutContext.cpp:
3179         (WebCore::Layout::inlineItemWidth):
3180         * layout/inlineformatting/text/TextUtil.h:
3181         (WebCore::Layout::TextUtil::width): Deleted.
3182
3183 2019-12-06  Keith Miller  <keith_miller@apple.com>
3184
3185         Remove various .order files.
3186         https://bugs.webkit.org/show_bug.cgi?id=204959
3187
3188         Reviewed by Yusuke Suzuki.
3189
3190         These files are all super out of date and likely don't do anything anymore.
3191         The signatures of the functions have changed thus the mangled name has changed.
3192
3193         * WebCore.order: Removed.
3194
3195 2019-12-06  Jonathan Bedard  <jbedard@apple.com>
3196
3197         Unreviewed, rolling out r253148.
3198
3199         This caused fast/mediastream/stream-switch.html to timeout on
3200         Mac.
3201
3202         Reverted changeset:
3203
3204         "WPT test MediaStream-MediaElement-srcObject.https.html times
3205         out"
3206         https://bugs.webkit.org/show_bug.cgi?id=204762
3207         https://trac.webkit.org/changeset/253148
3208
3209 2019-12-06  Zalan Bujtas  <zalan@apple.com>
3210
3211         [LFC][IFC] Paint partial trailing run with hyphen when needed
3212         https://bugs.webkit.org/show_bug.cgi?id=204953
3213         <rdar://problem/57705169>
3214
3215         Reviewed by Antti Koivisto.
3216
3217         When LineBreaker comes back with a partial content that needs hyphen, we need to make sure this information
3218         ends up in the final Display::Run so that the rendered content includes the hyphen string. Note that this only needs to
3219         be done when the content does _not_ have the hyphen already (opportunity vs. oppor-tunity).
3220         (This patch also renames trailingPartial to partialTrailing because the fact that it is partial run is more important than that it is trailing run.)
3221
3222         * layout/displaytree/DisplayRun.h:
3223         (WebCore::Display::Run::TextContext::TextContext):
3224         (WebCore::Display::Run::TextContext::needsHyphen const):
3225         (WebCore::Display::Run::TextContext::setNeedsHyphen):
3226         (WebCore::Display::Run::textContext):
3227         * layout/inlineformatting/InlineFormattingContext.cpp:
3228         (WebCore::Layout::InlineFormattingContext::lineLayout):
3229         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
3230         * layout/inlineformatting/InlineLineBreaker.cpp:
3231         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
3232         (WebCore::Layout::LineBreaker::wordBreakingBehavior const):
3233         * layout/inlineformatting/InlineLineBreaker.h:
3234         * layout/inlineformatting/LineLayoutContext.cpp:
3235         (WebCore::Layout::LineLayoutContext::layoutLine):
3236         (WebCore::Layout::LineLayoutContext::close):
3237         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
3238         * layout/inlineformatting/LineLayoutContext.h:
3239         * layout/integration/LayoutIntegrationLineLayout.cpp:
3240         (WebCore::LayoutIntegration::LineLayout::paint):
3241
3242 2019-12-06  Chris Dumez  <cdumez@apple.com>
3243
3244         Prevent synchronous XHR in beforeunload / unload event handlers
3245         https://bugs.webkit.org/show_bug.cgi?id=204912
3246         <rdar://problem/57676394>
3247
3248         Reviewed by Darin Adler.
3249
3250         Prevent synchronous XHR in beforeunload / unload event handlers. They are terrible for performance
3251         and the Beacon API (or Fetch keepalive) are more efficient & supported alternatives.
3252
3253         In particular, this would cause hangs when trying to navigate away from a site or when closing
3254         attempt, which would result in terrible user experience.
3255
3256         Chrome and Edge have expressed public support for this. Chrome has actually been testing this behavior
3257         for a while now:
3258         https://www.chromestatus.com/feature/4664843055398912
3259
3260         I added this new behavior behind an experimental feature flag, enabled by default.
3261
3262         Tests: http/tests/xmlhttprequest/sync-xhr-in-beforeunload.html
3263                http/tests/xmlhttprequest/sync-xhr-in-unload.html
3264
3265         * loader/DocumentThreadableLoader.cpp:
3266         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3267         * loader/FrameLoader.cpp:
3268         (WebCore::PageLevelForbidScope::PageLevelForbidScope):
3269         (WebCore::ForbidPromptsScope::ForbidPromptsScope):
3270         (WebCore::ForbidPromptsScope::~ForbidPromptsScope):
3271         (WebCore::ForbidSynchronousLoadsScope::ForbidSynchronousLoadsScope):
3272         (WebCore::ForbidSynchronousLoadsScope::~ForbidSynchronousLoadsScope):
3273         (WebCore::FrameLoader::dispatchUnloadEvents):
3274         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
3275         * page/Page.cpp:
3276         (WebCore::Page::forbidSynchronousLoads):
3277         (WebCore::Page::allowSynchronousLoads):
3278         (WebCore::Page::areSynchronousLoadsAllowed):
3279         * page/Page.h:
3280
3281 2019-12-06  Antti Koivisto  <antti@apple.com>
3282
3283         Support for resolving highlight pseudo element style
3284         https://bugs.webkit.org/show_bug.cgi?id=204937
3285
3286         Reviewed by Simon Fraser.
3287
3288         Test: highlight/highlight-pseudo-element-style.html
3289
3290         * css/SelectorChecker.cpp:
3291         (WebCore::SelectorChecker::checkOne const):
3292
3293         Returns always true when checked without pseudoId, so it gets added to the set of seen pseudo elements.
3294         Match argument with the provided highlight name otherwise.
3295
3296         * css/SelectorChecker.h:
3297         * css/parser/CSSSelectorParser.cpp:
3298         (WebCore::CSSSelectorParser::consumePseudo):
3299         * rendering/style/RenderStyle.h:
3300         * style/ElementRuleCollector.cpp:
3301         (WebCore::Style::ElementRuleCollector::ruleMatches):
3302         * style/ElementRuleCollector.h:
3303         (WebCore::Style::PseudoElementRequest::PseudoElementRequest):
3304
3305         Add the requested highlight name.
3306
3307         * style/StyleResolver.h:
3308         * style/StyleScope.h:
3309         * testing/Internals.cpp:
3310         (WebCore::Internals::highlightPseudoElementColor):
3311
3312         Testing support.
3313
3314         * testing/Internals.h:
3315         * testing/Internals.idl:
3316
3317 2019-12-06  Antti Koivisto  <antti@apple.com>
3318
3319         [LFC][Integration] Fix DisplayRunPath offsets
3320         https://bugs.webkit.org/show_bug.cgi?id=204949
3321
3322         Reviewed by Zalan Bujtas.
3323
3324         Fixes output of tests like fast/text/system-font-zero-size.html with LFC integration enabled.
3325
3326         * rendering/line/LineLayoutTraversalDisplayRunPath.h:
3327         (WebCore::LineLayoutTraversal::DisplayRunPath::DisplayRunPath):
3328         (WebCore::LineLayoutTraversal::DisplayRunPath::localStartOffset const):
3329         (WebCore::LineLayoutTraversal::DisplayRunPath::localEndOffset const):
3330
3331         Display::Run offsets are already local.
3332
3333         (WebCore::LineLayoutTraversal::DisplayRunPath::length const):
3334         (WebCore::LineLayoutTraversal::DisplayRunPath::runs const):
3335         (WebCore::LineLayoutTraversal::DisplayRunPath::firstRun const): Deleted.
3336
3337 2019-12-05  Chris Dumez  <cdumez@apple.com>
3338
3339         Stop using reserveCapacity() / reserveInitialCapacity() in IPC decoders
3340         https://bugs.webkit.org/show_bug.cgi?id=204930
3341         <rdar://problem/57682737>
3342
3343         Reviewed by Ryosuke Niwa.
3344
3345         This is IPC hardening since the size we use to reserve the capacity is encoded over IPC
3346         and cannot be trusted in some cases.
3347
3348         * page/csp/ContentSecurityPolicyResponseHeaders.h:
3349         (WebCore::ContentSecurityPolicyResponseHeaders::decode):
3350
3351 2019-12-06  Antti Koivisto  <antti@apple.com>
3352
3353         [LFC][Integration] Wire line counting functions in RenderBlockFlow
3354         https://bugs.webkit.org/show_bug.cgi?id=204943
3355
3356         Reviewed by Zalan Bujtas.
3357
3358         * layout/integration/LayoutIntegrationLineLayout.cpp:
3359         (WebCore::LayoutIntegration::LineLayout::lineCount const):
3360         * layout/integration/LayoutIntegrationLineLayout.h:
3361         * rendering/ComplexLineLayout.cpp:
3362         (WebCore::ComplexLineLayout::layoutRunsAndFloatsInRange):
3363         (WebCore::ComplexLineLayout::lineCount const):
3364         (WebCore::ComplexLineLayout::lineCountUntil const):
3365
3366         Move complex path specific code to ComplexLineLayout.
3367
3368         * rendering/ComplexLineLayout.h:
3369         * rendering/RenderBlockFlow.cpp:
3370         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
3371         (WebCore::RenderBlockFlow::lineCount const):
3372         (WebCore::RenderBlockFlow::hasLines const):
3373
3374         Support all paths.
3375
3376         * rendering/RenderBlockFlow.h:
3377
3378 2019-12-06  Antti Koivisto  <antti@apple.com>
3379
3380         [LFC][Integration] Support isLineBreak() in iterator
3381         https://bugs.webkit.org/show_bug.cgi?id=204941
3382
3383         Reviewed by Zalan Bujtas.
3384
3385         * layout/displaytree/DisplayRun.h:
3386         (WebCore::Display::Run::isLineBreak const):
3387         * rendering/line/LineLayoutTraversalDisplayRunPath.h:
3388         (WebCore::LineLayoutTraversal::DisplayRunPath::isLineBreak const):
3389         (WebCore::LineLayoutTraversal::DisplayRunPath::traverseNextTextBoxInVisualOrder):
3390
3391         Also remove unneeded skipping of runs without text context. All runs generated from text nodes now have them.
3392
3393 2019-12-05  Zalan Bujtas  <zalan@apple.com>
3394
3395         [LFC][IFC] Fix css1/basic/containment.html
3396         https://bugs.webkit.org/show_bug.cgi?id=204931
3397         <rdar://problem/57682871>
3398
3399         Reviewed by Simon Fraser.
3400
3401         moveToNextBreakablePosition jumped over all the positions that came back as the current position.
3402         e.g --- <- first 2 breakable positions are at: 1 2 but we skipped over the first one.
3403
3404         * layout/inlineformatting/InlineTextItem.cpp:
3405         (WebCore::Layout::moveToNextBreakablePosition):
3406
3407 2019-12-05  Megan Gardner  <megan_gardner@apple.com>
3408
3409         Move member variable that should be private
3410         https://bugs.webkit.org/show_bug.cgi?id=204913
3411
3412         Reviewed by Wenson Hsieh.
3413
3414         These member variables should be in the correct section.
3415
3416         No changing functionality, no tests needed.
3417
3418         * page/EventHandler.h:
3419
3420 2019-12-05  John Wilander  <wilander@apple.com>
3421
3422         Resource Load Statistics (experimental): Add fast mode for non-cookie website data deletion
3423         https://bugs.webkit.org/show_bug.cgi?id=204858
3424         <rdar://problem/57639851>
3425
3426         Reviewed by Alex Christensen.
3427
3428         This change adds two internal flags:
3429         - "Live-On Testing" with a one hour timeout instead of seven days.
3430         - "Repro Testing" with an instant timeout (bar ITP's regular delays) instead of seven days.
3431
3432         These internal flags should be removed once testing is complete: <rdar://problem/57673418>
3433
3434         No new tests. This change just adds new opt-in settings for manual testing.
3435
3436         * page/Settings.yaml:
3437         * platform/network/NetworkStorageSession.h:
3438             The FirstPartyWebsiteDataRemovalMode enum now has two new values:
3439             - AllButCookiesLiveOnTestingTimeout
3440             - AllButCookiesReproTestingTimeout
3441
3442 2019-12-05  Chris Dumez  <cdumez@apple.com>
3443
3444         PageConfiguration::dragClient should use a smart pointer
3445         https://bugs.webkit.org/show_bug.cgi?id=204816
3446
3447         Reviewed by Alex Christensen.
3448
3449         * loader/EmptyClients.cpp:
3450         (WebCore::pageConfigurationWithEmptyClients):
3451         * page/DragClient.h:
3452         * page/DragController.cpp:
3453         (WebCore::DragController::DragController):
3454         (WebCore::DragController::~DragController):
3455         (WebCore::DragController::dragEnded):
3456         (WebCore::DragController::performDragOperation):
3457         (WebCore::DragController::delegateDragSourceAction):
3458         (WebCore::DragController::concludeEditDrag):
3459         (WebCore::DragController::startDrag):
3460         (WebCore::DragController::beginDrag):
3461         (WebCore::DragController::doSystemDrag):
3462         * page/DragController.h:
3463         (WebCore::DragController::client const):
3464         * page/Page.cpp:
3465         (WebCore::Page::Page):
3466         * page/PageConfiguration.cpp:
3467         * page/PageConfiguration.h:
3468         * page/mac/DragControllerMac.mm:
3469         (WebCore::DragController::declareAndWriteDragImage):
3470
3471 2019-12-05  Chris Dumez  <cdumez@apple.com>
3472
3473         [IPC] Fail BackForwardItemIdentifier decoding if the decoded integer is not a valid ID
3474         https://bugs.webkit.org/show_bug.cgi?id=204920
3475         <rdar://problem/57677453>
3476
3477         Reviewed by Ryosuke Niwa.
3478
3479         * history/BackForwardItemIdentifier.h:
3480         (WebCore::BackForwardItemIdentifier::decode):
3481
3482 2019-12-05  Sihui Liu  <sihui_liu@apple.com>
3483
3484         Move InProcessIDBServer to WebKitLegacy
3485         https://bugs.webkit.org/show_bug.cgi?id=204896
3486
3487         Reviewed by Brady Eidson.
3488
3489         We only use InProcessIDBServer in WebKitLegacy now.
3490
3491         No behavior change.
3492
3493         * Headers.cmake:
3494         * Modules/indexeddb/server/IDBServer.h:
3495         * Modules/indexeddb/shared/IDBRequestData.h:
3496         * Modules/indexeddb/shared/IDBTransactionInfo.h:
3497         * Modules/indexeddb/shared/InProcessIDBServer.h: Removed.
3498         * Modules/mediastream/MediaStreamTrack.cpp:
3499         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:
3500         * Sources.txt:
3501         * WebCore.xcodeproj/project.pbxproj:
3502         * loader/EmptyClients.cpp:
3503         * page/Page.cpp:
3504
3505 2019-12-05  Sihui Liu  <sihui_liu@apple.com>
3506
3507         Rename IDBDatabaseIdentifier::debugString to IDBDatabaseIdentifier::loggingString
3508         https://bugs.webkit.org/show_bug.cgi?id=204898
3509
3510         Reviewed by Brady Eidson.
3511
3512         We use loggingString everywhere in IDB code but IDBDatabaseIdentifier, so rename it for consistency.
3513
3514         No behavior change.
3515
3516         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
3517         (WebCore::IDBDatabaseIdentifier::loggingString const):
3518         (WebCore::IDBDatabaseIdentifier::debugString const): Deleted.
3519         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3520         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3521         (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
3522         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
3523         * Modules/indexeddb/server/IDBServer.cpp:
3524         (WebCore::IDBServer::IDBServer::deleteDatabase):
3525         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3526         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
3527         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
3528         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
3529         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
3530
3531 2019-12-05  Zalan Bujtas  <zalan@apple.com>
3532
3533         [LFC][IFC] Introduce InlineSoftLineBreakItem
3534         https://bugs.webkit.org/show_bug.cgi?id=204905
3535         <rdar://problem/57672472>
3536
3537         Reviewed by Antti Koivisto.
3538
3539         Preserved line breaks apparently require text-line inline boxes with position information.
3540         This patch provides this position information by introducing InlineSoftLineBreakItem.
3541         InlineSoftLineBreakItem is a non-text like subclass of InlineItem which is created when
3542         the text content has a preserved line break.
3543         
3544         <pre>text content
3545         </pre>
3546         -> [InlineTextItem(text)][InlineTextItem( )][InlineTextItem(content)][InlineSoftLineBreakItem]
3547
3548         * WebCore.xcodeproj/project.pbxproj:
3549         * layout/inlineformatting/InlineFormattingContext.cpp:
3550         (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
3551         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
3552         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3553         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3554         * layout/inlineformatting/InlineItem.cpp:
3555         * layout/inlineformatting/InlineItem.h:
3556         (WebCore::Layout::InlineItem::isLineBreak const):
3557         (WebCore::Layout::InlineItem::isSoftLineBreak const):
3558         (WebCore::Layout::InlineItem::isHardLineBreak const):
3559         (WebCore::Layout::InlineItem::isForcedLineBreak const): Deleted.
3560         * layout/inlineformatting/InlineLineBreaker.cpp:
3561         (WebCore::Layout::LineBreaker::Content::isAtContentBoundary):
3562         (WebCore::Layout::LineBreaker::Content::append):
3563         * layout/inlineformatting/InlineLineBuilder.cpp:
3564         (WebCore::Layout::LineBuilder::alignContentVertically):
3565         (WebCore::Layout::LineBuilder::append):
3566         (WebCore::Layout::LineBuilder::appendLineBreak):
3567         (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight):
3568         (WebCore::Layout::LineBuilder::runContentHeight const):
3569         (WebCore::Layout::LineBuilder::isVisuallyNonEmpty const):
3570         (WebCore::Layout::LineBuilder::TrimmableContent::trim):
3571         * layout/inlineformatting/InlineLineBuilder.h:
3572         (WebCore::Layout::LineBuilder::Run::isLineBreak const):
3573         (WebCore::Layout::LineBuilder::InlineItemRun::isLineBreak const):
3574         (WebCore::Layout::LineBuilder::Run::isForcedLineBreak const): Deleted.
3575         (WebCore::Layout::LineBuilder::InlineItemRun::isForcedLineBreak const): Deleted.
3576         * layout/inlineformatting/InlineSoftLineBreakItem.h: Copied from Source/WebCore/layout/inlineformatting/InlineItem.cpp.
3577         (WebCore::Layout::InlineSoftLineBreakItem::position const):
3578         (WebCore::Layout::InlineSoftLineBreakItem::createSoftLineBreakItem):
3579         (WebCore::Layout::InlineSoftLineBreakItem::InlineSoftLineBreakItem):
3580         * layout/inlineformatting/InlineTextItem.cpp:
3581         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
3582         (WebCore::Layout::InlineTextItem::createSegmentBreakItem): Deleted.
3583         * layout/inlineformatting/InlineTextItem.h:
3584         (WebCore::Layout::InlineTextItem::isWhitespace const):
3585         (WebCore::Layout::InlineTextItem::isCollapsible const):
3586         (WebCore::Layout::InlineTextItem::isSegmentBreak const): Deleted.
3587         * layout/inlineformatting/LineLayoutContext.cpp:
3588         (WebCore::Layout::inlineItemWidth):
3589         (WebCore::Layout::LineLayoutContext::placeInlineItem):
3590
3591 2019-12-05  Yury Semikhatsky  <yurys@chromium.org>
3592
3593         Web Inspector: Avoid using Runtime.executionContextCreated to figure out the iframe's contentDocument node.
3594         https://bugs.webkit.org/show_bug.cgi?id=122764
3595         <rdar://problem/15222136>
3596
3597         Reviewed by Devin Rousso.
3598
3599         Force execution context creation on frame navigation similar to what inspector already
3600         does for all known contexts when Runtime.enable is called. This is a prerequisite for
3601         the injected script to work.
3602
3603         Test: inspector/runtime/execution-context-in-scriptless-page.html
3604
3605         * inspector/InspectorInstrumentation.cpp:
3606         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
3607         * inspector/agents/page/PageRuntimeAgent.cpp:
3608         (WebCore::PageRuntimeAgent::frameNavigated):
3609         * inspector/agents/page/PageRuntimeAgent.h:
3610
3611 2019-12-05  Chris Dumez  <cdumez@apple.com>
3612
3613         MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess
3614         https://bugs.webkit.org/show_bug.cgi?id=204899
3615
3616         Reviewed by Ryosuke Niwa.
3617
3618         * Sources.txt:
3619         * history/BackForwardItemIdentifier.cpp: Added.
3620         (WebCore::BackForwardItemIdentifier::isValid const):
3621         * history/BackForwardItemIdentifier.h:
3622         (WebCore::operator!=):
3623
3624 2019-12-05  Simon Fraser  <simon.fraser@apple.com>
3625
3626         Fix inspector/css test assertions after r253158 
3627         https://bugs.webkit.org/show_bug.cgi?id=204924
3628
3629         Reviewed by Devin Rousso.
3630
3631         * inspector/agents/InspectorCSSAgent.cpp:
3632         (WebCore::protocolValueForPseudoId):
3633
3634 2019-12-05  Zalan Bujtas  <zalan@apple.com>
3635
3636         [LFC][IFC] Trim trailing letter-spacing at inline container boundary
3637         https://bugs.webkit.org/show_bug.cgi?id=204895
3638         <rdar://problem/57666898>
3639
3640         Reviewed by Antti Koivisto.
3641
3642         According to https://www.w3.org/TR/css-text-3/#letter-spacing-property, "An inline box only
3643         includes letter spacing between characters completely contained within that element".
3644         This patch enables this behavior by trimming the trailing letter spacing at [container end].
3645
3646         <div>1<span style="letter-spacing: 100px;">2</span>3</div> ->
3647         [1][container start][2][container end][3]
3648         vs.
3649         [1][container start][2<-----100px----->][container end][3]
3650
3651         * layout/inlineformatting/InlineLineBuilder.cpp:
3652         (WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
3653         (WebCore::Layout::LineBuilder::appendInlineContainerEnd):
3654         (WebCore::Layout::LineBuilder::TrimmableContent::trim):
3655         (WebCore::Layout::LineBuilder::TrimmableContent::trimTrailingRun):
3656         * layout/inlineformatting/InlineLineBuilder.h:
3657         (WebCore::Layout::LineBuilder::TrimmableContent::isTrailingRunPartiallyTrimmable const):
3658
3659 2019-12-05  youenn fablet  <youenn@apple.com>
3660
3661         maplike should define a set method
3662         https://bugs.webkit.org/show_bug.cgi?id=204877
3663
3664         Reviewed by Chris Dumez.
3665
3666         maplike implementation was defining an add method instead of a set method.
3667         Update implementation to define and use a set method.
3668         Add an InternalsMapLike to allow testing.
3669
3670         Test: js/dom/maplike.html
3671
3672         * CMakeLists.txt:
3673         * DerivedSources-input.xcfilelist:
3674         * DerivedSources-output.xcfilelist:
3675         * DerivedSources.make:
3676         * Modules/highlight/HighlightMap.cpp:
3677         (WebCore::HighlightMap::addFromMapLike):
3678         * Modules/highlight/HighlightMap.h:
3679         * Modules/highlight/HighlightMap.idl:
3680         * WebCore.xcodeproj/project.pbxproj:
3681         * bindings/js/JSDOMMapLike.h:
3682         (WebCore::DOMMapLike::set):
3683         (WebCore::forwardSetToMapLike):
3684         * bindings/scripts/IDLParser.pm:
3685         (parseMapLikeProperties):
3686         * bindings/scripts/test/JS/JSMapLike.cpp:
3687         (WebCore::jsMapLikePrototypeFunctionSetBody):
3688         (WebCore::jsMapLikePrototypeFunctionSet):
3689         (WebCore::jsMapLikePrototypeFunctionAddBody): Deleted.
3690         (WebCore::jsMapLikePrototypeFunctionAdd): Deleted.
3691         * testing/Internals.cpp:
3692         (WebCore::Internals::createInternalsMapLike):
3693         * testing/Internals.h:
3694         * testing/Internals.idl:
3695         * testing/InternalsMapLike.cpp: Added.
3696         * testing/InternalsMapLike.h: Added.
3697         * testing/InternalsMapLike.idl: Added.
3698
3699 2019-12-05  Antti Koivisto  <antti@apple.com>
3700
3701         [LFC][Integration] Disable LFC when floats are present for now
3702         https://bugs.webkit.org/show_bug.cgi?id=204892
3703
3704         Reviewed by Zalan Bujtas.
3705
3706         Diasable until we start synthesizing the required structures.
3707
3708         * layout/integration/LayoutIntegrationLineLayout.cpp:
3709         (WebCore::LayoutIntegration::LineLayout::canUseFor):
3710
3711 2019-12-05  Antti Koivisto  <antti@apple.com>
3712
3713         [LFC][IFC] Many render tree dump tests show 1px too narrow runs
3714         https://bugs.webkit.org/show_bug.cgi?id=204885
3715
3716         Reviewed by Zalan Bujtas.
3717
3718         Width measurement is currently clamping the measured (float) text widths to layout units. Use rounding instead.
3719
3720         This doesn't solve the fundamental problem of loss of precision but it allows many more render tree dump
3721         based layout tests to pass.
3722
3723         * layout/inlineformatting/text/TextUtil.cpp:
3724         (WebCore::Layout::TextUtil::width):
3725         (WebCore::Layout::TextUtil::fixedPitchWidth):
3726
3727 2019-12-05  youenn fablet  <youenn@apple.com>
3728
3729         inspector/page/overrideSetting-MockCaptureDevicesEnabled.html is failing after removal of internals.setMockMediaCaptureDevicesEnabled API
3730         https://bugs.webkit.org/show_bug.cgi?id=204849
3731
3732         Reviewed by Eric Carlson.
3733
3734         Add API and internals to check which center is used in WebProcess.
3735         Covered by updated test.
3736
3737         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3738         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
3739         (WebCore::MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled):
3740         * platform/mock/MockRealtimeMediaSourceCenter.h:
3741         * testing/Internals.cpp:
3742         (WebCore::Internals::isMockRealtimeMediaSourceCenterEnabled):
3743         * testing/Internals.h:
3744         * testing/Internals.idl:
3745
3746 2019-12-05  Eric Carlson  <eric.carlson@apple.com>
3747
3748         WPT test MediaStream-MediaElement-srcObject.https.html times out
3749         https://bugs.webkit.org/show_bug.cgi?id=204762
3750         <rdar://problem/57567671>
3751
3752         Reviewed by youenn fablet.
3753
3754         No new tests, these changes fix existing tests.
3755
3756         * html/HTMLMediaElement.cpp:
3757         (WebCore::HTMLMediaElement::prepareForLoad): Check hasMediaStreamSrcObject() instead of
3758         m_mediaStreamSrcObject so we behave correctly when a MediaStream is cleared by setting srcObject to null.
3759         (WebCore::HTMLMediaElement::loadResource): Ditto.
3760         (WebCore::HTMLMediaElement::seekWithTolerance): Return early if seeking isn't allowed.
3761         (WebCore::HTMLMediaElement::defaultPlaybackRate const): Check hasMediaStreamSrcObject() instead 
3762         of m_mediaStreamSrcObject.
3763         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Ditto.
3764         (WebCore::HTMLMediaElement::playbackRate const): Ditto.
3765         (WebCore::HTMLMediaElement::setPlaybackRate): Ditto.
3766         (WebCore::HTMLMediaElement::ended const): Ditto.
3767         (WebCore::HTMLMediaElement::preload const): Ditto.
3768         (WebCore::HTMLMediaElement::setPreload): Ditto.
3769         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Don't send an 'ended' event for a MediaStream.
3770         (WebCore::HTMLMediaElement::clearMediaPlayer): Don't check m_settingMediaStreamSrcObject, it 
3771         is never set.
3772         * html/HTMLMediaElement.h:
3773
3774         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Add m_lastReportedTime.
3775         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3776         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::durationMediaTime const): Return last reported
3777         time after the stream ends.
3778         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime const): Ditto. Set m_lastReportedTime.
3779         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): Don't return HaveNothing
3780         for an inactive stream. Return HaveMetadata for an stream that has either ended or is waiting
3781         for the first video frame.
3782         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Send duration changed when
3783         a stream ends.
3784
3785 2019-12-05  Zalan Bujtas  <zalan@apple.com>
3786
3787         [LFC][IFC] Move trailing trimming logic to LineBuilder::TrimmableContent
3788         https://bugs.webkit.org/show_bug.cgi?id=204872
3789         <rdar://problem/57652365>
3790
3791         Reviewed by Antti Koivisto.
3792
3793         Move trimming logic from LineBuilder::removeTrailingTrimmableContent to inside TrimmableContent.
3794         This is also in preparation for adding partial trimming at inline container boundary. 
3795
3796         * layout/inlineformatting/InlineLineBreaker.cpp:
3797         (WebCore::Layout::LineBreaker::breakingContextForInlineContent):
3798         * layout/inlineformatting/InlineLineBreaker.h:
3799         * layout/inlineformatting/InlineLineBuilder.cpp:
3800         (WebCore::Layout::LineBuilder::LineBuilder):
3801         (WebCore::Layout::LineBuilder::initialize):
3802         (WebCore::Layout::LineBuilder::removeTrailingTrimmableContent):
3803         (WebCore::Layout::LineBuilder::appendTextContent):
3804         (WebCore::Layout::LineBuilder::appendNonReplacedInlineBox):
3805         (WebCore::Layout::LineBuilder::TrimmableContent::TrimmableContent):
3806         (WebCore::Layout::LineBuilder::TrimmableContent::append):
3807         (WebCore::Layout::LineBuilder::TrimmableContent::trim):
3808         * layout/inlineformatting/InlineLineBuilder.h:
3809         (WebCore::Layout::LineBuilder::isTrailingRunFullyTrimmable const):
3810         (WebCore::Layout::LineBuilder::TrimmableContent::isTrailingRunFullyTrimmable const):
3811         (WebCore::Layout::LineBuilder::TrimmableContent::reset):
3812         (WebCore::Layout::LineBuilder::isTrailingContentFullyTrimmable const): Deleted.
3813         (WebCore::Layout::LineBuilder::TrimmableContent::isTrailingContentFullyTrimmable const): Deleted.
3814         (WebCore::Layout::LineBuilder::TrimmableContent::clear): Deleted.
3815         * layout/inlineformatting/LineLayoutContext.cpp:
3816         (WebCore::Layout::LineLayoutContext::processUncommittedContent):
3817
3818 2019-12-05  youenn fablet  <youenn@apple.com>
3819
3820         getStats() promise never rejects nor resolves when peer connection state is closed.
3821         https://bugs.webkit.org/show_bug.cgi?id=204842
3822         <rdar://problem/57617107>
3823
3824         Reviewed by Eric Carlson.
3825
3826         Instead of closing and nulling the backend when closing the peer connection,
3827         we only close it. This allows calling getStats to retrieve the last gathered stats from the backend.
3828         Covered by updated test.
3829
3830         * Modules/mediastream/PeerConnectionBackend.h:
3831         * Modules/mediastream/RTCPeerConnection.cpp:
3832         (WebCore::RTCPeerConnection::close):
3833         (WebCore::RTCPeerConnection::stop):
3834         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3835         (WebCore::LibWebRTCMediaEndpoint::close):
3836         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3837         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3838         (WebCore::LibWebRTCPeerConnectionBackend::close):
3839         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3840
3841 2019-12-04  Ryosuke Niwa  <rniwa@webkit.org>
3842
3843         Remove DocumentEventQueue and WorkerEventQueue
3844         https://bugs.webkit.org/show_bug.cgi?id=204841
3845
3846         Reviewed by Sam Weinig.
3847
3848         Delete DocumentEventQueue and WorkerEventQueue since we don't use them after r252824.
3849
3850         * Headers.cmake:
3851         * Sources.txt:
3852         * WebCore.xcodeproj/project.pbxproj:
3853         * dom/Document.h:
3854         * dom/DocumentEventQueue.cpp: Removed.
3855         * dom/DocumentEventQueue.h: Removed.
3856         * page/VisualViewport.cpp:
3857         * rendering/RenderLayer.cpp:
3858         * rendering/RenderListBox.cpp:
3859         * workers/WorkerEventQueue.cpp: Removed.
3860         * workers/WorkerEventQueue.h: Removed.
3861         * worklets/WorkletGlobalScope.h:
3862
3863 2019-12-04  Jack Lee  <shihchieh_lee@apple.com>
3864
3865         Nullptr crash in RenderLayoutState::pageLogicalHeight const via RenderGrid::computeIntrinsicLogicalWidths inside RenderMarquee::updateMarqueePosition
3866         https://bugs.webkit.org/show_bug.cgi?id=204527
3867
3868         Reviewed by Ryosuke Niwa.
3869
3870         Test: fast/table/crash-empty-layoutStateStack.html
3871
3872         * rendering/RenderTable.cpp:
3873         (WebCore::RenderTable::layout):
3874         (WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
3875
3876 2019-12-04  Chris Dumez  <cdumez@apple.com>
3877
3878         PageConfiguration::progressTrackerClient should use a smart pointer
3879         https://bugs.webkit.org/show_bug.cgi?id=204854
3880
3881         Reviewed by Alex Christensen.
3882
3883         * loader/EmptyClients.cpp:
3884         (WebCore::pageConfigurationWithEmptyClients):
3885         * loader/ProgressTracker.cpp:
3886         (WebCore::ProgressTracker::ProgressTracker):
3887         (WebCore::ProgressTracker::progressStarted):
3888         (WebCore::ProgressTracker::progressCompleted):
3889         (WebCore::ProgressTracker::finalProgressComplete):
3890         (WebCore::ProgressTracker::incrementProgress):
3891         (WebCore::ProgressTracker::~ProgressTracker): Deleted.
3892         * loader/ProgressTracker.h:
3893         (WebCore::ProgressTracker::client):
3894         * loader/ProgressTrackerClient.h:
3895         (WebCore::ProgressTrackerClient::progressTrackerDestroyed): Deleted.
3896         * page/Page.cpp:
3897         (WebCore::Page::Page):
3898         * page/PageConfiguration.cpp:
3899         (WebCore::PageConfiguration::PageConfiguration):
3900         * page/PageConfiguration.h:
3901
3902 2019-12-04  Eric Carlson  <eric.carlson@apple.com>
3903
3904         Make MediaPlayer::client() private
3905         https://bugs.webkit.org/show_bug.cgi?id=204856
3906         <rdar://problem/57633186>
3907
3908         Reviewed by Jer Noble.
3909         
3910         Make MediaPlayer::client private and create accessors for all of the client methods
3911         that were being accessed directly. Also remove the MediaPlayer* parameters from
3912         the client methods since none of them were used.
3913
3914         No new tests, no behavioral change.
3915
3916         * html/HTMLMediaElement.cpp:
3917         (WebCore::HTMLMediaElement::mediaPlayerActiveSourceBuffersChanged):
3918         (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
3919         (WebCore::HTMLMediaElement::mediaPlayerReadyStateChanged):
3920         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
3921         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
3922         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
3923         (WebCore::HTMLMediaElement::mediaPlayerMuteChanged):
3924         (WebCore::HTMLMediaElement::mediaPlayerDurationChanged):
3925         (WebCore::HTMLMediaElement::mediaPlayerRateChanged):
3926         (WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
3927         (WebCore::HTMLMediaElement::mediaPlayerSawUnsupportedTracks):
3928         (WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported):
3929         (WebCore::HTMLMediaElement::mediaPlayerRepaint):
3930         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
3931         (WebCore::HTMLMediaElement::mediaPlayerRenderingCanBeAccelerated):
3932         (WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
3933         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
3934         (WebCore::HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable):
3935         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
3936         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
3937         * html/HTMLMediaElement.h:
3938         * platform/graphics/MediaPlayer.cpp:
3939         (WebCore::MediaPlayer::loadWithNextMediaEngine):
3940         (WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
3941         (WebCore::MediaPlayer::networkStateChanged):
3942         (WebCore::MediaPlayer::readyStateChanged):
3943         (WebCore::MediaPlayer::volumeChanged):
3944         (WebCore::MediaPlayer::muteChanged):
3945         (WebCore::MediaPlayer::timeChanged):
3946         (WebCore::MediaPlayer::sizeChanged):
3947         (WebCore::MediaPlayer::repaint):
3948         (WebCore::MediaPlayer::durationChanged):
3949         (WebCore::MediaPlayer::rateChanged):
3950         (WebCore::MediaPlayer::playbackStateChanged):
3951         (WebCore::MediaPlayer::firstVideoFrameAvailable):
3952         (WebCore::MediaPlayer::characteristicChanged):
3953         (WebCore::MediaPlayer::keyNeeded):
3954         (WebCore::MediaPlayer::graphicsDeviceAdapter const):
3955         * platform/graphics/MediaPlayer.h:
3956         (WebCore::MediaPlayerClient::mediaPlayerNetworkStateChanged):
3957         (WebCore::MediaPlayerClient::mediaPlayerReadyStateChanged):
3958         (WebCore::MediaPlayerClient::mediaPlayerVolumeChanged):
3959         (WebCore::MediaPlayerClient::mediaPlayerMuteChanged):
3960         (WebCore::MediaPlayerClient::mediaPlayerTimeChanged):
3961         (WebCore::MediaPlayerClient::mediaPlayerDurationChanged):
3962         (WebCore::MediaPlayerClient::mediaPlayerRateChanged):
3963         (WebCore::MediaPlayerClient::mediaPlayerPlaybackStateChanged):
3964         (WebCore::MediaPlayerClient::mediaPlayerSawUnsupportedTracks):
3965         (WebCore::MediaPlayerClient::mediaPlayerResourceNotSupported):
3966         (WebCore::MediaPlayerClient::mediaPlayerRepaint):
3967         (WebCore::MediaPlayerClient::mediaPlayerSizeChanged):
3968         (WebCore::MediaPlayerClient::mediaPlayerEngineUpdated):
3969         (WebCore::MediaPlayerClient::mediaPlayerFirstVideoFrameAvailable):
3970         (WebCore::MediaPlayerClient::mediaPlayerCharacteristicChanged):
3971         (WebCore::MediaPlayerClient::mediaPlayerRenderingCanBeAccelerated):
3972         (WebCore::MediaPlayerClient::mediaPlayerRenderingModeChanged):
3973         (WebCore::MediaPlayerClient::mediaPlayerActiveSourceBuffersChanged):
3974         (WebCore::MediaPlayerClient::mediaPlayerGraphicsDeviceAdapter const):
3975         (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded):
3976         (WebCore::MediaPlayerClient::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
3977         (WebCore::MediaPlayer::renderingCanBeAccelerated const):
3978         (WebCore::MediaPlayer::renderingModeChanged const):
3979         (WebCore::MediaPlayer::acceleratedCompositingEnabled):
3980         (WebCore::MediaPlayer::activeSourceBuffersChanged):
3981         (WebCore::MediaPlayer::playerContentBoxRect const):
3982         (WebCore::MediaPlayer::playerContentsScale const):
3983         (WebCore::MediaPlayer::shouldUsePersistentCache const):
3984         (WebCore::MediaPlayer::mediaCacheDirectory const):
3985         (WebCore::MediaPlayer::isVideoPlayer const):
3986         (WebCore::MediaPlayer::mediaEngineUpdated):
3987         (WebCore::MediaPlayer::isLooping const):
3988         (WebCore::MediaPlayer::requestInstallMissingPlugins):
3989         (WebCore::MediaPlayer::client const):
3990         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3991         (WebCore::MediaPlayerPrivateAVFoundation::preferredRenderingMode const):
3992         (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
3993         (WebCore::MediaPlayerPrivateAVFoundation::prepareForRendering):
3994         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3995         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
3996         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
3997         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
3998         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3999         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
4000         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::notifyActiveSourceBuffersChanged):
4001         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
4002         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
4003         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureDecompressionSession):
4004         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
4005         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
4006         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateRenderingMode):
4007         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged):
4008         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
4009         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
4010         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
4011         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps):
4012         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
4013         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
4014         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
4015         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
4016         (WebCore::MediaPlayerPrivateGStreamer::acceleratedRenderingStateChanged):
4017
4018 2019-12-04  Alexey Shvayka  <shvaikalesh@gmail.com>
4019
4020         Non-callable "handleEvent" property is silently ignored
4021         https://bugs.webkit.org/show_bug.cgi?id=200066
4022
4023         Reviewed by Ryosuke Niwa.
4024
4025         This patch prevents "handleEvent" property from being looked up on event handlers
4026         and also reports TypeError exception if "handleEvent" value is not callable.
4027         Web IDL spec: https://heycam.github.io/webidl/#call-a-user-objects-operation (step 10.4)
4028
4029         Tests: fast/dom/exception-getting-event-handler.html
4030                imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html
4031                imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception.html
4032                imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception.html
4033                imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html
4034                imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-handleEvent-ignored.html
4035                imported/w3c/web-platform-tests/websockets/interfaces/WebSocket/events/013.html
4036                imported/w3c/web-platform-tests/workers/interfaces/DedicatedWorkerGlobalScope/onmessage.worker.html
4037
4038         * bindings/js/JSEventListener.cpp:
4039         (WebCore::JSEventListener::handleEvent):
4040
4041 2019-12-04  Kate Cheney  <katherine_cheney@apple.com>
4042
4043         Expose basic ITP data from the database for future API/SPI use
4044         https://bugs.webkit.org/show_bug.cgi?id=203432
4045         <rdar://problem/56085040>
4046
4047         Reviewed John Wilander.
4048
4049         Tests: http/tests/resourceLoadStatistics/user-interface-data-no-storage-access-database.html
4050                http/tests/resourceLoadStatistics/user-interface-data-no-storage-access.html
4051                http/tests/storageAccess/user-interface-data-with-storage-access-database.html
4052                http/tests/storageAccess/user-interface-data-with-storage-access.html
4053
4054         Updated the toString() to report only if mostRecentUserInteractionTime
4055         was in the last 24 hours as opposed to reporting an actual time since 
4056         mostRecentUserInteractionTime changes with each test run.
4057
4058         * loader/ResourceLoadStatistics.cpp:
4059         (WebCore::hasHadRecentUserInteraction):
4060         (WebCore::ResourceLoadStatistics::toString const):
4061
4062 2019-12-05  Simon Fraser  <simon.fraser@apple.com>
4063
4064         Add CSS parser support for the highlight pseudoelement
4065         https://bugs.webkit.org/show_bug.cgi?id=204902
4066
4067         Reviewed by Antti Koivisto.
4068
4069         Add basic CSS parsing support for ::highlight(), per
4070         https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/highlight/explainer.md