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