:active pseudo class doesn't deactivate when using pressure sensitive trackpad
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-04-18  Antti Koivisto  <antti@apple.com>
2
3         :active pseudo class doesn't deactivate when using pressure sensitive trackpad
4         https://bugs.webkit.org/show_bug.cgi?id=181680
5
6         Reviewed by Beth Dakin.
7
8         Trackpad sends a mouse force event with force of zero after mouse up event. This causes the element under cursor
9         activate again.
10
11         Even a fake event test doesn't appear to be currently possible as TestRunner crashes if you try to send mouseForceChanged.
12         All the tests using it are skipped.
13
14         * page/EventHandler.cpp:
15         (WebCore::EventHandler::handleMouseForceEvent):
16
17         Don't add HitTestRequest::Active if the force of the force event is zero.
18
19 2018-04-18  Megan Gardner  <megan_gardner@apple.com>
20
21         Ensure correct screen sizes
22         https://bugs.webkit.org/show_bug.cgi?id=184757
23         
24         Reviewed by Wenson Hsieh.
25         
26         Make sure that the screen sizes are actually correct.
27
28         Not currently testable, will add tests when it is.
29
30         * platform/ios/PlatformScreenIOS.mm:
31
32 2018-04-18  Nan Wang  <n_wang@apple.com>
33
34         AX: [macOS] WebKit hangs when triggering an alert from an AOM increment event
35         https://bugs.webkit.org/show_bug.cgi?id=184742
36
37         Reviewed by Chris Fleizach.
38
39         Made increment and decrement actions on the macOS to be async. So that VoiceOver
40         won't hang indefinitely if performing the actions causes an alert or other modal
41         behaviors.
42
43         Test: accessibility/mac/async-increment-decrement-action.html
44
45         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
46         (-[WebAccessibilityObjectWrapper accessibilityPerformIncrementAction]):
47         (-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
48         (-[WebAccessibilityObjectWrapper accessibilityPerformDecrementAction]):
49         (-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
50         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
51
52 2018-04-18  Youenn Fablet  <youenn@apple.com>
53
54         MediaResourceLoader should set its fetch destination
55         https://bugs.webkit.org/show_bug.cgi?id=184746
56
57         Reviewed by Eric Carlson.
58
59         Covered by updated test.
60
61         * loader/MediaResourceLoader.cpp:
62         (WebCore::MediaResourceLoader::requestResource):
63
64 2018-04-18  Jer Noble  <jer.noble@apple.com>
65
66         Fix runtime errors in simulator while playing media
67         https://bugs.webkit.org/show_bug.cgi?id=184751
68
69         Reviewed by Eric Carlson.
70
71         AVURLAssetHTTPCookiesKey may not be present, and AVPlayer may not respond to certain methods.
72
73         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
74         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
75         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
76         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
77         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
78
79 2018-04-18  Jer Noble  <jer.noble@apple.com>
80
81         Ignore ASSERT when setting AVAudioSessionCategory returns an error on simulator.
82         https://bugs.webkit.org/show_bug.cgi?id=184698
83
84         Reviewed by Eric Carlson.
85
86         * platform/audio/ios/AudioSessionIOS.mm:
87         * platform/audio/mac/AudioSessionMac.cpp:
88
89 2018-04-18  Sihui Liu  <sihui_liu@apple.com>
90
91         REGRESSION: Using the reload button while offline pushes identical pages onto the back/forward list
92         https://bugs.webkit.org/show_bug.cgi?id=184570
93         <rdar://problem/34807323>
94
95         Reviewed by Chris Dumez.
96
97         Set FrameLoadType properly when error occurs in reload.
98
99         tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm
100
101         * loader/FrameLoader.cpp:
102         (WebCore::FrameLoader::load):
103
104 2018-04-18  Chris Dumez  <cdumez@apple.com>
105
106         Add support for converting a local window to a remote window
107         https://bugs.webkit.org/show_bug.cgi?id=184515
108         <rdar://problem/39011318>
109
110         Reviewed by Ryosuke Niwa.
111
112         Add initial support for process-swapping when navigating cross-origin as a result
113         of a window.open(). The window object returned by window.open() is initially same
114         origin and is for about:blank. The navigation cross-origin then happens and the
115         JS wrappers for the window then point to a cross-origin window which is remote (i.e.
116         hosted in another WebProcess).
117
118         The RemoteDOMWindow exposed to JS looks like a regular cross-origin Window with a few
119         exceptions due to our incomplete implementation (e.g. w.location returns null) and 
120         most of its API is currently not functional. The RemoteDOMWindow API will be implemented
121         in a follow-up by relying on IPC.
122
123         Test: http/tests/navigation/process-swap-window-open.html
124
125         * bindings/js/JSDOMGlobalObject.cpp:
126         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
127         * bindings/js/JSDOMPromiseDeferred.h:
128         * bindings/js/JSDOMWindowProperties.cpp:
129         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
130         * bindings/js/JSDOMWindowProxy.cpp:
131         (WebCore::JSDOMWindowProxy::finishCreation):
132         (WebCore::JSDOMWindowProxy::create):
133         * bindings/js/JSDOMWindowProxy.h:
134         * bindings/js/JSDOMWrapper.cpp:
135         (WebCore::JSDOMObject::JSDOMObject):
136         * bindings/js/JSDOMWrapper.h:
137         * bindings/js/WindowProxyController.cpp:
138         (WebCore::WindowProxyController::createWindowProxy):
139         (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
140         * bridge/objc/WebScriptObject.mm:
141         (-[WebScriptObject _isSafeScript]):
142         Teach more of our bindings code about RemoteDOMWindows.
143
144         * dom/Document.cpp:
145         (WebCore::Document::createDOMWindow):
146         * loader/FrameLoaderClient.h:
147         Add FrameLoaderClient function to notify the client when a DOMWindow is constructed in
148         the frame. This is needed for WebKit2 to link the old window to its new representation
149         in the new WebProcess.
150
151 2018-04-17  Zan Dobersek  <zdobersek@igalia.com>
152
153         [CMake] Add and enable the ENABLE_CSS_ANIMATIONS_LEVEL_2 feature define
154         https://bugs.webkit.org/show_bug.cgi?id=184681
155
156         Reviewed by Carlos Garcia Campos.
157
158         * Sources.txt: Include CSSAnimationTriggerScrollValue.cpp in the build.
159         * WebCore.xcodeproj/project.pbxproj: Remove CSSAnimationTriggerScrollValue.cpp
160         build target now that it's built via Sources.txt.
161
162 2018-04-17  Zan Dobersek  <zdobersek@igalia.com>
163
164         [CoordGraphics] CoordinatedImageBacking can simplify image drawing
165         https://bugs.webkit.org/show_bug.cgi?id=183986
166
167         Reviewed by Michael Catanzaro.
168
169         In CoordinatedImageBacking::update(), when drawing the image into a
170         freshly-created image backing, we can avoid save-and-restoring the
171         painting context. We also don't have to clip it, since the clipping area
172         is the same as the image (and buffer) bounds. Since the buffer is
173         initialized to transparent color, we can use the CompositeCopy operator
174         to just copy image data into the destination since there's nothing to
175         paint the source over.
176
177         No new tests -- no change in functionality.
178
179         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
180         (WebCore::CoordinatedImageBacking::update):
181
182 2018-04-17  Michael Catanzaro  <mcatanzaro@igalia.com>
183
184         [GTK] Webkit should spoof as Safari on a Mac for Outlook.com
185         https://bugs.webkit.org/show_bug.cgi?id=184573
186
187         Reviewed by Carlos Alberto Lopez Perez.
188
189         Add quirk for outlook.live.com.
190
191         * platform/UserAgentQuirks.cpp:
192         (WebCore::urlRequiresMacintoshPlatform):
193
194 2018-04-17  Mark Lam  <mark.lam@apple.com>
195
196         Templatize CodePtr/Refs/FunctionPtrs with PtrTags.
197         https://bugs.webkit.org/show_bug.cgi?id=184702
198         <rdar://problem/35391681>
199
200         Reviewed by Filip Pizlo and Saam Barati.
201
202         No new tests. This is covered by existing tests.
203
204         * WebCore.xcodeproj/project.pbxproj:
205         * css/ElementRuleCollector.cpp:
206         (WebCore::ElementRuleCollector::ruleMatches):
207         * cssjit/CSSPtrTag.h: Added.
208         * cssjit/CompiledSelector.h:
209         * cssjit/FunctionCall.h:
210         (WebCore::FunctionCall::FunctionCall):
211         (WebCore::FunctionCall::setFunctionAddress):
212         (WebCore::FunctionCall::prepareAndCall):
213         * cssjit/SelectorCompiler.cpp:
214         (WebCore::SelectorCompiler::compileSelector):
215         (WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext):
216         (WebCore::SelectorCompiler::addPseudoClassType):
217         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
218         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
219         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
220         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest):
221         * cssjit/SelectorCompiler.h:
222         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
223         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
224         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
225         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
226         * dom/SelectorQuery.cpp:
227         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
228         (WebCore::SelectorDataList::execute const):
229         * dom/SelectorQuery.h:
230
231 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
232
233         Retain MessagePortChannel for transfer when disentangling ports
234         https://bugs.webkit.org/show_bug.cgi?id=184502
235         <rdar://problem/39372771>
236
237         Reviewed by Geoffrey Garen.
238
239         MessagePortChannels should be retained while ports are being transferred, but that was only
240         happening when sending a port through another port, but not when sending it through a worker.
241
242         Test: workers/worker-to-worker.html
243
244         * dom/messageports/MessagePortChannel.cpp:
245         (WebCore::MessagePortChannel::entanglePortWithProcess):
246         (WebCore::MessagePortChannel::disentanglePort):
247         (WebCore::MessagePortChannel::postMessageToRemote):
248         (WebCore::MessagePortChannel::takeAllMessagesForPort):
249
250 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
251
252         References from CSSStyleDeclaration to CSSValues should be weak
253         https://bugs.webkit.org/show_bug.cgi?id=180280
254         <rdar://problem/35804869>
255
256         Reviewed by Geoffrey Garen.
257
258         No new tests - used the existing test to verify the leak
259
260         * css/DeprecatedCSSOMValue.h:
261         (WebCore::DeprecatedCSSOMValue::weakPtrFactory):
262         * css/PropertySetCSSStyleDeclaration.cpp:
263         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
264         * css/PropertySetCSSStyleDeclaration.h:
265
266 2018-04-17  Jonathan Bedard  <jbedard@apple.com>
267
268         Unreviewed rollout of r230632. Regression in memory usage.
269
270         That bug tracked in https://bugs.webkit.org/show_bug.cgi?id=184569.
271
272         Tests: animations/animation-internals-api-multiple-keyframes.html
273                animations/animation-internals-api.html
274                transitions/transition-drt-api-delay.html
275                transitions/transition-drt-api.html
276
277         * page/RuntimeEnabledFeatures.h:
278         * testing/Internals.cpp:
279         (WebCore::Internals::pseudoElement): Deleted.
280         * testing/Internals.h:
281         * testing/Internals.idl:
282
283 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
284
285         Do not unregister MessagePorts on deallocation if it has been disentangled
286         https://bugs.webkit.org/show_bug.cgi?id=184285
287         <rdar://problem/39256714>
288
289         Reviewed by Darin Adler.
290
291         Test: workers/message-port-gc.html
292
293         * dom/MessagePort.cpp:
294         (WebCore::MessagePort::deref const):
295
296 2018-04-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
297
298         [Curl] Fix timing of reporting error to the client
299         https://bugs.webkit.org/show_bug.cgi?id=184707
300
301         Before checking the result code, check the status of callback invocation and
302         do the right thing.
303
304         Reviewed by Youenn Fablet.
305
306         No new tests because there's no new behavior.
307
308         * platform/network/curl/CurlRequest.cpp:
309         (WebCore::CurlRequest::didCompleteTransfer):
310         * platform/network/curl/CurlRequest.h:
311         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
312
313 2018-04-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
314
315         [Curl] Export authentication information to be used by the client.
316         https://bugs.webkit.org/show_bug.cgi?id=184709
317
318         Just added getters for username and password member variables.
319
320         Reviewed by Alex Christensen.
321
322         No new tests because there's no new behavior.
323
324         * platform/network/curl/CurlRequest.h:
325         (WebCore::CurlRequest::user const):
326         (WebCore::CurlRequest::password const):
327
328 2018-04-17  Chris Dumez  <cdumez@apple.com>
329
330         REGRESSION (r229831): CMD-clicking an iCloud web app link unexpectedly opens that link in a new tab and the current tab
331         https://bugs.webkit.org/show_bug.cgi?id=184678
332         <rdar://problem/39422122>
333
334         Reviewed by Alex Christensen.
335
336         Frament navigations need to happen synchronously for Web-compatibility. Because of this,
337         r225657 added code to make sure that if the client does not make the navigation policy
338         decision synchronously for frament navigations, then we'll stop waiting for the client
339         and proceed with the navigation. However, r229831 make the navigation policy decision
340         IPC decision, meaning that even if the client responds synchronously, it would be
341         asynchronously from WebCore's point of view. As a result, we would always ignore the
342         client's policy decision when doing a fragment navigation.
343
344         This is an issue on iclould.com because the web-app links are fragment URLs. When you
345         CMD+click one of these link, we do the navigation policy check. As a result of this
346         check, Safari responds IGNORE to the policy decision and instead decides to load the
347         link in a new tab (because CMD key is pressed). Due to the bug mentioned above, we
348         would not obey the IGNORE policy decision from Safari and load the link in the current
349         tab, even though Safari would already be loading it in a new tab.
350
351         To address the issue, I reintroduced a synchronous code path for navigation policy
352         decision making, backed by synchronous IPC. This synchronous code path is now used for
353         fragment navigations to restore pre-r229831 behavior. If the client does not answer
354         synchronously, we'll proceed with the navigation anyway, as was happening pre-r229831.
355
356         Test: http/tests/navigation/fragment-navigation-policy-ignore.html
357
358         * loader/EmptyClients.cpp:
359         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
360         * loader/EmptyFrameLoaderClient.h:
361         * loader/FrameLoader.cpp:
362         (WebCore::FrameLoader::loadURL):
363         (WebCore::FrameLoader::loadWithDocumentLoader):
364         * loader/FrameLoaderClient.h:
365         * loader/PolicyChecker.cpp:
366         (WebCore::PolicyChecker::checkNavigationPolicy):
367         * loader/PolicyChecker.h:
368
369 2018-04-17  Matt Lewis  <jlewis3@apple.com>
370
371         Unreviewed, rolling out r230713.
372
373         This caused internal build failures.
374
375         Reverted changeset:
376
377         "Implement checked cast for DDResultRef once
378         DDResultGetTypeID() is available"
379         https://bugs.webkit.org/show_bug.cgi?id=184554
380         https://trac.webkit.org/changeset/230713
381
382 2018-04-17  Chris Dumez  <cdumez@apple.com>
383
384         Add bindings code for RemoteDOMWindow
385         https://bugs.webkit.org/show_bug.cgi?id=184653
386
387         Reviewed by Ryosuke Niwa.
388
389         Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin
390         DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since
391         a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings
392         code is identical to the DOMWindow code paths from cross-origin handling.
393
394         No new tests, this code will be used and tested via Bug 184515.
395
396         * CMakeLists.txt:
397         * DerivedSources.make:
398         * Sources.txt:
399         * WebCore.xcodeproj/project.pbxproj:
400         * bindings/js/JSBindingsAllInOne.cpp:
401         * bindings/js/JSDOMWindowCustom.cpp:
402         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
403         (WebCore::JSDOMWindow::getOwnPropertySlot):
404         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
405         (WebCore::addCrossOriginWindowOwnPropertyNames):
406         * bindings/js/JSDOMWindowCustom.h:
407
408         * bindings/js/JSRemoteDOMWindowBase.cpp: Added.
409         (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
410         (WebCore::JSRemoteDOMWindowBase::destroy):
411         (WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags):
412         (WebCore::toJS):
413         (WebCore::toJSRemoteDOMWindow):
414         * bindings/js/JSRemoteDOMWindowBase.h: Added.
415         JSRemoteDOMWindow unfortunately currently needs to be a global object because of:
416         1. a JSProxy's target needs to be a JSGlobalObject currently
417         2. The 'structure()->setGlobalObject(vm, &window);' call in
418            JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject.
419         Ideally, this wouldn't be the case in the future but this would require some code refactoring.
420         Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject,
421         which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is
422         problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all
423         our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the
424         m_wrapped implementation pointer. I followed the same pattern here.
425
426         (WebCore::toJS):
427         * bindings/js/JSRemoteDOMWindowCustom.cpp: Added.
428         (WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
429         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
430         (WebCore::JSRemoteDOMWindow::put):
431         (WebCore::JSRemoteDOMWindow::putByIndex):
432         (WebCore::JSRemoteDOMWindow::deleteProperty):
433         (WebCore::JSRemoteDOMWindow::deletePropertyByIndex):
434         (WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
435         (WebCore::JSRemoteDOMWindow::defineOwnProperty):
436         (WebCore::JSRemoteDOMWindow::getPrototype):
437         (WebCore::JSRemoteDOMWindow::preventExtensions):
438         (WebCore::JSRemoteDOMWindow::toStringName):
439         * bindings/scripts/CodeGeneratorJS.pm:
440         (IsDOMGlobalObject):
441         (GenerateHeader):
442         (GenerateOverloadDispatcher):
443         (GenerateImplementation):
444         * page/RemoteDOMWindow.idl: Added.
445
446 2018-04-17  David Kilzer  <ddkilzer@apple.com>
447
448         Implement checked cast for DDResultRef once DDResultGetTypeID() is available
449         <https://webkit.org/b/184554>
450         <rdar://problem/36241894>
451
452         Reviewed by Brent Fulgham.
453
454         * editing/cocoa/DataDetection.mm:
455         (WebCore::detectItemAtPositionWithRange): Implement checked cast
456         for DDResultRef.
457
458 2018-04-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
459
460         Animated GIF imagery with finite looping are falling one loop short
461         https://bugs.webkit.org/show_bug.cgi?id=183153
462
463         Reviewed by Simon Fraser.
464
465         The Netscape Looping Application Extension is a block which may be added
466         to a GIF file to tell the viewer to loop through the entire GIF frames.
467         This is communicated through two bytes designated for the "loopCount" in
468         this block.
469
470         The entire block may not be found in the GIF, in which case the GIF is 
471         supposed to animate its entire frames only once.
472
473         If the block exists and loopCount = 0, this means the image has to loop
474         through its frames indefinitely.
475
476         If the block exist and loopCount > 0, this should mean the image has to
477         loop through its frames loopCount + 1 times. The extra loop seems to be
478         the consensus among most of the GIF generators and viewers. For example,
479         if the image designer wants the image to loop through its frames n times:
480         -- The GIF generator (e.g. Adobe Photoshop and https://ezgif.com/maker) 
481            will write n - 1 for loopCount. However http://gifmaker.me and 
482            http://gifmaker.org write n for loopCount.
483         -- The browser (e.g. Chrome 65.0.3325 181 and FireFox Quantum 59.0.2) will
484            translate loopCount = n - 1 to: animate GIF once + loop n - 1, which 
485            means loop the GIF n times.
486
487         Because the specs are not really clear about this, we are going to consider
488         the agreed-upon behavior among most of the web browsers the specs here.
489
490         * platform/graphics/cg/ImageDecoderCG.cpp:
491         (WebCore::ImageDecoderCG::repetitionCount const):
492         * platform/image-decoders/gif/GIFImageDecoder.cpp:
493         (WebCore::GIFImageDecoder::repetitionCount const):
494
495 2018-04-17  Saam Barati  <sbarati@apple.com>
496
497         Add system trace points for process launch and for initializeWebProcess
498         https://bugs.webkit.org/show_bug.cgi?id=184669
499
500         Reviewed by Simon Fraser.
501
502         No testing needed because there is no new functionality here.
503
504         * loader/FrameLoader.cpp:
505         (WebCore::FrameLoader::provisionalLoadStarted):
506         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
507         * loader/SubresourceLoader.cpp:
508         (WebCore::SubresourceLoader::willSendRequestInternal):
509         (WebCore::SubresourceLoader::didFinishLoading):
510         (WebCore::SubresourceLoader::didFail):
511         (WebCore::SubresourceLoader::didCancel):
512
513 2018-04-17  Eric Carlson  <eric.carlson@apple.com>
514
515         [iOS] AirPlay device name is sometimes wrong
516         https://bugs.webkit.org/show_bug.cgi?id=184543
517         <rdar://problem/39105498>
518
519         Reviewed by Jer Noble.
520
521         No new tests, this can only be tested with a specific hardware setup.
522
523         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
524         (WebCore::exernalDeviceDisplayNameForPlayer): Get the device name from the AVOutputContext
525         when possible.
526
527 2018-04-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
528
529         [GTK] Build fix after r230529 (WaylandCompositorDisplay leaks its wl_display)
530         https://bugs.webkit.org/show_bug.cgi?id=184406
531
532         Rubber-stamped by Michael Catanzaro.
533
534         Fix build with clang 3.8
535
536         No new tests, it is a build fix.
537
538         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
539         (WebCore::PlatformDisplayWayland::create):
540
541 2018-04-16  Antoine Quint  <graouts@apple.com>
542
543         Layout Test animations/needs-layout.html is a flaky Image Failure.
544         https://bugs.webkit.org/show_bug.cgi?id=172397
545
546         Reviewed by Dean Jackson.
547
548         Animations that animate a transform and uses a relative value for either the x or y components
549         require a layout before starting, which CSSAnimationController would perform in the call to
550         CSSAnimationControllerPrivate::animationTimerFired() made immediately after a CSS animation was
551         created.
552
553         We now perform a similar task where upon setting new blending keyframes we compute a flag indicating
554         if the keyframe effect is animating a transform with relative x or y components. Then, when we perform
555         the first invalidation task, which runs in the next run loop after a change to the timing model has
556         been made, such as a call to play() on a CSSAnimation made in the TreeResolver::createAnimatedElementUpdate()
557         where the CSSAnimation was created, we call forceLayout() on this element's FrameView. We also ensure
558         we commit animations on the compositor immediately after that too, instead of waiting until the next
559         DisplayRefreshMonitor callback.
560
561         * animation/DocumentTimeline.cpp:
562         (WebCore::DocumentTimeline::performInvalidationTask):
563         (WebCore::DocumentTimeline::updateAnimations):
564         * animation/KeyframeEffectReadOnly.cpp:
565         (WebCore::KeyframeEffectReadOnly::forceLayoutIfNeeded):
566         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
567         (WebCore::KeyframeEffectReadOnly::computedNeedsForcedLayout):
568         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
569         * animation/KeyframeEffectReadOnly.h:
570
571 2018-04-16  Pablo Saavedra  <psaavedra@igalia.com>
572
573         Inconsistent EGL defines in ImageBufferCairo
574         https://bugs.webkit.org/show_bug.cgi?id=184661
575
576         Reviewed by Žan Doberšek.
577
578         On revision r219391 libepoxy is added. The headers in
579         ImageBufferCairo.cpp become inconsistent when 2D canvas is enabled
580         (-DENABLE_ACCELERATED_2D_CANVAS=ON) due to a redefinition error during
581         the Webkit build:
582
583             ...
584             /usr/include/GLES2/gl2.h:503:82: error: 'voi
585             epoxy_glAttachShader(GLuint, GLuint)' redeclared as different kind
586             of symbol
587             GL_APICALL void         GL_APIENTRY glAttachShader (GLuint
588             program, GLuint shader);
589
590         No new tests.
591
592         * platform/graphics/cairo/ImageBufferCairo.cpp:
593
594 2018-04-16  Filip Pizlo  <fpizlo@apple.com>
595
596         MutationObserver should be in an IsoHeap
597         https://bugs.webkit.org/show_bug.cgi?id=184671
598         <rdar://problem/36081981>
599
600         Reviewed by Sam Weinig.
601
602         No new tests because no new behavior.
603
604         * dom/MutationObserver.cpp:
605         * dom/MutationObserver.h:
606
607 2018-04-16  Youenn Fablet  <youenn@apple.com>
608
609         Use NetworkLoadChecker to handle synchronous HTTP loads
610         https://bugs.webkit.org/show_bug.cgi?id=184240
611
612         Reviewed by Chris Dumez.
613
614         Update LoaderStrategy::loadResourceSynchronously to pass FetchOptions directly.
615         Update various call sites accordingly. This allows NetworkProcess to do all necessary checks.
616         Add an option to disable security checks if NetworkProcess does it for WebProcess.
617         This option will be also used for regular asynchronous loads in future patches.
618
619         Update DocumentThreadableLoader to bypass preflighting and response validation checks in case they are done in NetworkProcess.
620
621         Covered by existing and rebased tests.
622
623         * loader/CrossOriginPreflightChecker.cpp:
624         (WebCore::CrossOriginPreflightChecker::doPreflight):
625         * loader/DocumentThreadableLoader.cpp:
626         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
627         (WebCore::DocumentThreadableLoader::loadRequest):
628         * loader/FrameLoader.cpp:
629         (WebCore::FrameLoader::loadResourceSynchronously):
630         * loader/FrameLoader.h:
631         * loader/LoaderStrategy.h:
632         * xml/XSLTProcessorLibxslt.cpp:
633         (WebCore::docLoaderFunc):
634         * xml/parser/XMLDocumentParserLibxml2.cpp:
635         (WebCore::openFunc):
636
637 2018-04-16  Christopher Reid  <chris.reid@sony.com>
638
639         [WinCairo] Media elements should be enabled by default
640         https://bugs.webkit.org/show_bug.cgi?id=184597
641
642         Reviewed by Per Arne Vollan.
643
644         Enabling media elements by default with media foundation.
645
646         * page/SettingsDefaultValues.h:
647
648 2018-04-16  Christopher Reid  <chris.reid@sony.com>
649
650         [Curl] Add the Accept-Language field to curl request headers
651         https://bugs.webkit.org/show_bug.cgi?id=184605
652
653         Reviewed by Alex Christensen.
654
655         Add Accept-Language field to curl request headers
656
657         * platform/network/curl/CurlRequest.cpp:
658         * platform/network/curl/CurlRequest.h:
659
660 2018-04-16  Chris Dumez  <cdumez@apple.com>
661
662         Move more WindowProxy-related logic from ScriptController to WindowProxyController
663         https://bugs.webkit.org/show_bug.cgi?id=184640
664
665         Reviewed by Ryosuke Niwa.
666
667         Move more WindowProxy-related logic from ScriptController to WindowProxyController,
668         for clarity.
669
670         * bindings/js/JSDOMWindowProxy.cpp:
671         (WebCore::JSDOMWindowProxy::attachDebugger):
672         * bindings/js/JSDOMWindowProxy.h:
673         * bindings/js/ScriptCachedFrameData.cpp:
674         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
675         (WebCore::ScriptCachedFrameData::restore):
676         * bindings/js/ScriptController.cpp:
677         (WebCore::ScriptController::~ScriptController):
678         (WebCore::ScriptController::initScriptForWindowProxy):
679         * bindings/js/ScriptController.h:
680         (WebCore::ScriptController::existingCacheableBindingRootObject const):
681         * bindings/js/WindowProxyController.cpp:
682         (WebCore::collectGarbageAfterWindowProxyDestruction):
683         (WebCore::WindowProxyController::~WindowProxyController):
684         (WebCore::WindowProxyController::clearWindowProxiesNotMatchingDOMWindow):
685         (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
686         (WebCore::WindowProxyController::attachDebugger):
687         * bindings/js/WindowProxyController.h:
688         * loader/FrameLoader.cpp:
689         (WebCore::FrameLoader::clear):
690         * page/Page.cpp:
691         (WebCore::Page::setDebugger):
692
693 2018-04-16  Thibault Saunier  <tsaunier@igalia.com>
694
695         [GStreamer] Set *TrackPrivateGStreamer::active based on GstStream default select in constructor
696         https://bugs.webkit.org/show_bug.cgi?id=184652
697
698         Reviewed by Philippe Normand.
699
700         In the constructor we should mark selected streams based on the default values from GstStream,
701         if the user changes them, they will be updated as required later on.
702
703         No new tests are added as we already have a few ones that are currently disabled in
704         the mediastream testsuite. This patch is part of the work to enable them.
705
706         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
707         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
708         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
709         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
710
711 2018-04-16  Thibault Saunier  <tsaunier@igalia.com>
712
713         [GStreamer] Set TrackPrivateBaseGStreamer metadata information even if no client is avalaible
714         https://bugs.webkit.org/show_bug.cgi?id=184651
715
716         Reviewed by Philippe Normand.
717
718         We can't notify the client if none is connected, but still we need to fill our metadatas from
719         the provided GstTagList, especially in the case of playbin3 where the client is not set yet
720         at construct time but the metadata might already be preset (and won't be updated later on).
721
722         No new tests are added as we already have a few ones that are currently disabled in
723         the mediastream testsuite. This patch is part of the work to enable them.
724
725         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
726         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
727
728 2018-04-16  Antoine Quint  <graouts@apple.com>
729
730         [Web Animations] Ensure we never return -0 through the API
731         https://bugs.webkit.org/show_bug.cgi?id=184644
732
733         Reviewed by Dean Jackson.
734
735         We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
736         This would happen when playbackRate < 0.
737
738         * animation/WebAnimationUtilities.h:
739         (WebCore::secondsToWebAnimationsAPITime):
740
741 2018-04-15  Antoine Quint  <graouts@apple.com>
742
743         [Web Animations] Animations do not naturally get a finish event
744         https://bugs.webkit.org/show_bug.cgi?id=184639
745         <rdar://problem/39397649>
746
747         Reviewed by Jon Lee.
748
749         We must call updateFinishedState() when an animation gets sampled as it means its timeline's time has progressed
750         and it may have crossed to a finished state. Calling updateFinishedState() when sampling means that we'll correctly
751         set the animation's hold time to its end value, which means that currentTime() will now always be clamped to return
752         the end time once its has reached it, so we must not schedule animations to resolve immediately anymore since otherwise
753         they will keep being scheduled in a loop.
754
755         * animation/WebAnimation.cpp:
756         (WebCore::WebAnimation::timeToNextRequiredTick const):
757         (WebCore::WebAnimation::resolve):
758
759 2018-04-15  Chris Dumez  <cdumez@apple.com>
760
761         Change Event's returnValue so it doesn't expose a new primitive
762         https://bugs.webkit.org/show_bug.cgi?id=184415
763
764         Reviewed by Darin Adler.
765
766         Update Event.returnValue setter to match the latest DOM specification after:
767         - https://github.com/whatwg/dom/pull/626
768
769         In particular, the returnValue setter is now a no-op if the new flag value
770         is true. If the input flag value is false, it only sets the 'canceled' flag
771         if the event is cancelable and the event’s in passive listener flag is unset.
772
773         Test: imported/w3c/web-platform-tests/dom/events/Event-returnValue.html
774
775         * dom/Event.cpp:
776         (WebCore::Event::setLegacyReturnValue):
777         (WebCore::Event::setCanceledFlagIfPossible):
778         (WebCore::Event::preventDefault):
779         * dom/Event.h:
780
781 2018-04-14  Thibault Saunier  <tsaunier@igalia.com>
782
783         [GStreamer] Expose a method to retrieve the GstStream from a TrackPrivateBaseGStreamer
784         https://bugs.webkit.org/show_bug.cgi?id=184620
785
786         Reviewed by Philippe Normand.
787
788         This is a minor change, a dedicated test doesn't really make sense here.
789
790         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
791         (WebCore::TrackPrivateBaseGStreamer::stream):
792
793 2018-04-13  Ryosuke Niwa  <rniwa@webkit.org>
794
795         WebKit crashes when libwebrtc.dylib is missing
796         https://bugs.webkit.org/show_bug.cgi?id=184607
797
798         Rubber-stamped by Jer Noble.
799
800         Don't call LibWebRTC related code when libwebrtc is not available.
801
802         * dom/Document.cpp:
803         (WebCore::Document::prepareForDestruction):
804         (WebCore::Document::suspend):
805
806 2018-04-13  Chris Dumez  <cdumez@apple.com>
807
808         Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame
809         https://bugs.webkit.org/show_bug.cgi?id=184591
810
811         Reviewed by Sam Weinig.
812
813         Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
814         RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
815         This is work towards fixing Bug 184515.
816
817         * Sources.txt:
818         * WebCore.xcodeproj/project.pbxproj:
819         * bindings/js/DOMWrapperWorld.cpp:
820         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
821         (WebCore::DOMWrapperWorld::clearWrappers):
822         * bindings/js/DOMWrapperWorld.h:
823         (WebCore::DOMWrapperWorld::didCreateWindowProxy):
824         (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
825         * bindings/js/JSBindingsAllInOne.cpp:
826         * bindings/js/JSDOMWindowBase.cpp:
827         (WebCore::toJSDOMWindow):
828         * bindings/js/JSDOMWindowProxy.cpp:
829         (WebCore::toJS):
830         (WebCore::toJSDOMWindowProxy):
831         * bindings/js/ScriptCachedFrameData.cpp:
832         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
833         (WebCore::ScriptCachedFrameData::restore):
834         * bindings/js/ScriptController.cpp:
835         (WebCore::ScriptController::~ScriptController):
836         (WebCore::ScriptController::evaluateInWorld):
837         (WebCore::ScriptController::loadModuleScriptInWorld):
838         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
839         (WebCore::ScriptController::evaluateModule):
840         (WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
841         (WebCore::ScriptController::setDOMWindowForWindowProxy):
842         (WebCore::ScriptController::initScriptForWindowProxy):
843         (WebCore::ScriptController::setupModuleScriptHandlers):
844         (WebCore::ScriptController::windowProxyController):
845         (WebCore::ScriptController::enableEval):
846         (WebCore::ScriptController::enableWebAssembly):
847         (WebCore::ScriptController::disableEval):
848         (WebCore::ScriptController::disableWebAssembly):
849         (WebCore::ScriptController::attachDebugger):
850         (WebCore::ScriptController::updateDocument):
851         (WebCore::ScriptController::collectIsolatedContexts):
852         (WebCore::ScriptController::windowScriptNPObject):
853         (WebCore::ScriptController::executeIfJavaScriptURL):
854         * bindings/js/ScriptController.h:
855         (WebCore::ScriptController::globalObject):
856         * bindings/js/ScriptControllerMac.mm:
857         (WebCore::ScriptController::windowScriptObject):
858         * bindings/js/ScriptState.cpp:
859         (WebCore::mainWorldExecState):
860         * bindings/js/WindowProxyController.cpp: Added.
861         (WebCore::WindowProxyController::WindowProxyController):
862         (WebCore::WindowProxyController::destroyWindowProxy):
863         (WebCore::WindowProxyController::createWindowProxy):
864         (WebCore::WindowProxyController::windowProxies):
865         (WebCore::WindowProxyController::createWindowProxyWithInitializedScript):
866         * bindings/js/WindowProxyController.h: Added.
867         (WebCore::WindowProxyController::releaseWindowProxies):
868         (WebCore::WindowProxyController::setWindowProxies):
869         (WebCore::WindowProxyController::windowProxy):
870         (WebCore::WindowProxyController::existingWindowProxy const):
871         (WebCore::WindowProxyController::globalObject):
872         * loader/FrameLoader.cpp:
873         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
874         * page/AbstractFrame.cpp:
875         (WebCore::AbstractFrame::AbstractFrame):
876         * page/AbstractFrame.h:
877         (WebCore::AbstractFrame::windowProxyController):
878         (WebCore::AbstractFrame::windowProxyController const):
879
880 2018-04-13  Brady Eidson  <beidson@apple.com>
881
882         Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one.
883         https://bugs.webkit.org/show_bug.cgi?id=184559
884
885         Reviewed by Alex Christensen.
886
887         Covered by new API test.
888
889         WebCore changes rework the meaning of a "ForSuspension" policy to simply navigate the page to about:blank.
890
891         * loader/DocumentLoader.cpp:
892         (WebCore::DocumentLoader::redirectReceived):
893         (WebCore::DocumentLoader::willSendRequest):
894         (WebCore::DocumentLoader::startLoadingMainResource):
895         * loader/DocumentLoader.h:
896
897         * loader/FrameLoader.cpp:
898         (WebCore::FrameLoader::init):
899         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
900
901 2018-04-13  Chris Dumez  <cdumez@apple.com>
902
903         input.webkitEntries does not work as expected when folder contains accented chars
904         https://bugs.webkit.org/show_bug.cgi?id=184517
905         <rdar://problem/39265537>
906
907         Reviewed by Alex Christensen.
908
909         Use String::fromUTF8() to construct a WTF String from the char* returned by
910         dirname() in FileSystem::directoryName(). Previously, we were just calling
911         the String constructor, which would treat the input as latin 1 instead of
912         UTF-8.
913
914         Change is covered by an API test rather than a layout test due to file versioning
915         limitations.
916
917         * platform/posix/FileSystemPOSIX.cpp:
918         (WebCore::FileSystem::directoryName):
919
920 2018-04-13  Yusuke Suzuki  <utatane.tea@gmail.com>
921
922         [WebCore] Use @getByIdDirectPrivate / @putByIdDirectPrivate in WebCore JS
923         https://bugs.webkit.org/show_bug.cgi?id=184401
924
925         Rubber stamped by Saam Barati.
926
927         Apply bug 183970 changes to WebCore JS too. This offers solid type checking
928         with @getByIdDirectPrivate().
929
930         * Modules/mediastream/RTCPeerConnection.js:
931         (initializeRTCPeerConnection):
932         (getLocalStreams):
933         (getStreamById):
934         (addStream):
935         * Modules/mediastream/RTCPeerConnectionInternals.js:
936         (isRTCPeerConnection):
937         * Modules/streams/ReadableByteStreamController.js:
938         (enqueue):
939         (error):
940         (close):
941         (getter.byobRequest):
942         * Modules/streams/ReadableByteStreamInternals.js:
943         (privateInitializeReadableStreamBYOBReader):
944         (privateInitializeReadableByteStreamController):
945         (privateInitializeReadableStreamBYOBRequest):
946         (isReadableByteStreamController):
947         (isReadableStreamBYOBRequest):
948         (isReadableStreamBYOBReader):
949         (readableByteStreamControllerCancel):
950         (readableByteStreamControllerError):
951         (readableByteStreamControllerClose):
952         (readableByteStreamControllerClearPendingPullIntos):
953         (readableByteStreamControllerGetDesiredSize):
954         (readableStreamHasBYOBReader):
955         (readableStreamHasDefaultReader):
956         (readableByteStreamControllerHandleQueueDrain):
957         (readableByteStreamControllerPull):
958         (readableByteStreamControllerShouldCallPull):
959         (readableByteStreamControllerCallPullIfNeeded):
960         (readableByteStreamControllerEnqueue):
961         (readableByteStreamControllerEnqueueChunk):
962         (readableByteStreamControllerRespondWithNewView):
963         (readableByteStreamControllerRespond):
964         (readableByteStreamControllerRespondInternal):
965         (readableByteStreamControllerRespondInReadableState):
966         (readableByteStreamControllerRespondInClosedState):
967         (readableByteStreamControllerProcessPullDescriptors):
968         (readableByteStreamControllerFillDescriptorFromQueue):
969         (readableByteStreamControllerShiftPendingDescriptor):
970         (readableByteStreamControllerInvalidateBYOBRequest):
971         (readableByteStreamControllerCommitDescriptor):
972         (readableStreamFulfillReadIntoRequest):
973         (readableByteStreamControllerPullInto):
974         (readableStreamAddReadIntoRequest):
975         * Modules/streams/ReadableStream.js:
976         (initializeReadableStream):
977         (pipeThrough):
978         * Modules/streams/ReadableStreamBYOBReader.js:
979         (cancel):
980         (read):
981         (releaseLock):
982         (getter.closed):
983         * Modules/streams/ReadableStreamBYOBRequest.js:
984         (respond):
985         (respondWithNewView):
986         (getter.view):
987         * Modules/streams/ReadableStreamDefaultController.js:
988         (error):
989         * Modules/streams/ReadableStreamDefaultReader.js:
990         (cancel):
991         (read):
992         (releaseLock):
993         (getter.closed):
994         * Modules/streams/ReadableStreamInternals.js:
995         (privateInitializeReadableStreamDefaultReader):
996         (readableStreamReaderGenericInitialize):
997         (readableStreamDefaultControllerError):
998         (readableStreamPipeTo):
999         (readableStreamTee):
1000         (isReadableStream):
1001         (isReadableStreamDefaultReader):
1002         (isReadableStreamDefaultController):
1003         (readableStreamError):
1004         (readableStreamDefaultControllerCallPullIfNeeded):
1005         (readableStreamDefaultControllerGetDesiredSize):
1006         (readableStreamReaderGenericCancel):
1007         (readableStreamCancel):
1008         (readableStreamDefaultControllerCancel):
1009         (readableStreamDefaultControllerPull):
1010         (readableStreamDefaultControllerClose):
1011         (readableStreamClose):
1012         (readableStreamFulfillReadRequest):
1013         (readableStreamDefaultReaderRead):
1014         (readableStreamAddReadRequest):
1015         (isReadableStreamDisturbed):
1016         (readableStreamReaderGenericRelease):
1017         (readableStreamDefaultControllerCanCloseOrEnqueue):
1018         (privateInitializeReadableStreamDefaultController): Deleted.
1019         * Modules/streams/StreamInternals.js:
1020         (validateAndNormalizeQueuingStrategy):
1021         * Modules/streams/WritableStream.js:
1022         (initializeWritableStream):
1023         (abort):
1024         (close):
1025         (write):
1026         (getter.closed):
1027         (getter.ready):
1028         (getter.state):
1029         * Modules/streams/WritableStreamInternals.js:
1030         (isWritableStream):
1031         (syncWritableStreamStateWithQueue):
1032         (errorWritableStream):
1033         (callOrScheduleWritableStreamAdvanceQueue):
1034         * bindings/js/JSDOMBindingInternals.js:
1035         (mapLikeForEach):
1036
1037 2018-04-12  Antoine Quint  <graouts@apple.com>
1038
1039         [Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default
1040         https://bugs.webkit.org/show_bug.cgi?id=184569
1041         <rdar://problem/38671301>
1042
1043         Reviewed by Jon Lee.
1044
1045         We now set the CSS Animations and CSS Transitions as Web Animations flag on by default. To ensure that some remaining
1046         tests pass with this flag on, we expose a way to get to a PseudoElement via a new internals.pseudoElement() method. This
1047         allows tests that used internals.pauseAnimationAtTimeOnPseudoElement() and internals.pauseTransitionAtTimeOnPseudoElement()
1048         to now work with the Web Animations API.
1049
1050         * page/RuntimeEnabledFeatures.h:
1051         * testing/Internals.cpp:
1052         (WebCore::Internals::pseudoElement):
1053         * testing/Internals.h:
1054         * testing/Internals.idl:
1055
1056 2018-04-13  Sergio Villar Senin  <svillar@igalia.com>
1057
1058         [WebVR][OpenVR] Implement requestPresent()/exitPresent() and getLayers()
1059         https://bugs.webkit.org/show_bug.cgi?id=184530
1060
1061         Reviewed by Žan Doberšek.
1062
1063         WebVR apps should invoke requestPresent() to start presenting contents of a VRLayerInit
1064         (right now a HTML canvas with a WebGL context) on the VRDisplay. This request might fail for
1065         a variety of reasons and can be eventually cancelled with exitPresent(). Once we are
1066         presenting we could access the presenting layers (right now just one) with getLayers().
1067
1068         Note that we are not presenting anything to the HMD yet, that will be done later in a follow
1069         up patch.
1070
1071         I took the chance to correct a mistak in the VRDisplayCapabilities object which has a method
1072         that should be called maxLayers instead of maxLayer.
1073
1074         * Modules/webvr/VRDisplay.cpp:
1075         (WebCore::VRDisplay::requestPresent):
1076         (WebCore::VRDisplay::stopPresenting):
1077         (WebCore::VRDisplay::exitPresent):
1078         (WebCore::VRDisplay::getLayers const):
1079         (WebCore::VRDisplay::isPresenting const): Deleted. Implemented in the header file.
1080         * Modules/webvr/VRDisplay.h:
1081         (WebCore::VRDisplay::isPresenting const):
1082         * Modules/webvr/VRDisplayCapabilities.h:
1083         (WebCore::VRDisplayCapabilities::maxLayers const): Renamed from maxLayer().
1084         (WebCore::VRDisplayCapabilities::maxLayer const): Deleted.
1085         * Modules/webvr/VRDisplayCapabilities.idl:
1086
1087 2018-04-13  Miguel Gomez  <magomez@igalia.com>
1088
1089         REGRESSION(r230627): [GTK][WPE] Possible deadlock when destroying the player in non AC mode
1090         https://bugs.webkit.org/show_bug.cgi?id=184583
1091
1092         Reviewed by Carlos Garcia Campos.
1093
1094         In non AC mode, ensure that a deadlock can't happen when destroying MediaPlayerPrivateGStreamerBase.
1095
1096         Covered by existent tests.
1097
1098         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1099         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1100         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1101         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
1102         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1103
1104 2018-04-13  Miguel Gomez  <magomez@igalia.com>
1105
1106         [GTK] [gstreamer] video won't unpause when built with -DUSE_GSTREAMER_GL=OFF
1107         https://bugs.webkit.org/show_bug.cgi?id=183362
1108
1109         Reviewed by Carlos Garcia Campos.
1110
1111         Remove the drawCancelled flag and use a new one to indicate that the player is being destroyed.
1112         That new flag is only enabled on destruction and it's not modified by cancelRepaint(), which
1113         can be used to handle the pause event without avoiding future renderings. Also cancelRepaint()
1114         has only effect when not in AC mode.
1115
1116         Covered by existent tests.
1117
1118         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1119         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1120         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1121         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
1122         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1123
1124 2018-04-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1125
1126         [GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits
1127         https://bugs.webkit.org/show_bug.cgi?id=184533
1128
1129         Reviewed by Philippe Normand.
1130
1131         Renamed GStreamerUtilities* files into GStreamerCommon* and
1132         modified files including them accordingly. Include
1133         GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h
1134         to avoid problems destroying objects when those files are
1135         forgotten to be included.
1136
1137         * Modules/webaudio/AudioContext.cpp:
1138         * platform/GStreamer.cmake:
1139         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1140         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
1141         * platform/graphics/gstreamer/GStreamerCommon.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp.
1142         * platform/graphics/gstreamer/GStreamerCommon.h: Renamed from Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h.
1143         * platform/graphics/gstreamer/ImageGStreamer.h:
1144         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
1145         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
1146         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
1147         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1148         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1149         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1150         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1151         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
1152         * platform/graphics/gstreamer/MediaSampleGStreamer.h:
1153         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
1154         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1155         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
1156         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1157         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
1158         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1159         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
1160         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
1161         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1162         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1163         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1164         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1165         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp:
1166         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.h:
1167         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1168         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1169         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
1170         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1171         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
1172         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1173         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
1174
1175 2018-04-12  Christopher Reid  <chris.reid@sony.com>
1176
1177         [Curl] Fix clang build error in CurlContext.cpp
1178         https://bugs.webkit.org/show_bug.cgi?id=184561
1179
1180         Reviewed by Darin Adler.
1181
1182         MSVC allows explicit template specialization in classes but gcc/clang do not.
1183
1184         * platform/network/curl/CurlContext.cpp:
1185
1186 2018-04-12  Christopher Reid  <chris.reid@sony.com>
1187
1188         [Curl] Cookie Database on memory path should be :memory:
1189         https://bugs.webkit.org/show_bug.cgi?id=184572
1190
1191         Reviewed by Alex Christensen.
1192
1193         CookieJarDB::isOnMemory is comparing the database path with :onmemory: but it should be using :memory:
1194         For reference, see: https://www.sqlite.org/inmemorydb.html
1195
1196         * platform/network/curl/CookieJarDB.h:
1197
1198 2018-04-12  Daniel Bates  <dabates@apple.com>
1199
1200         Attmept to fix the Windows build following <https://trac.webkit.org/changeset/230602/>
1201         (https://bugs.webkit.org/show_bug.cgi?id=184386)
1202
1203         Visual Studio cannot prove that all cases in the switch are covered :(
1204         So, add an ASSERT_NOT_REACHED() and a return a value outside of the switch block. 
1205
1206         * loader/cache/CachedResourceLoader.cpp:
1207         (WebCore::destinationForType):
1208
1209 2018-04-12  Chris Dumez  <cdumez@apple.com>
1210
1211         Introduce remote variants of Frame / DOMWindow classes
1212         https://bugs.webkit.org/show_bug.cgi?id=184467
1213         <rdar://problem/39011267>
1214
1215         Reviewed by Ryosuke Niwa.
1216
1217         Introduce remote variants of Frame / DOMWindow classes, for when these frames / windows
1218         are hosted on another WebProcess. Those will be used in a follow-up patch.
1219
1220         The hierarchy is as follows (class naming will be improved in a follow-up patch to minimise
1221         patch size):
1222         - AbstractFrame: A frame that can be either local or remote (hosted on another WebProcess)
1223             - Frame: A local frame
1224             - RemoteFrame: A frame hosted on another WebProcess. A RemoteFrame's window is also remote.
1225         - AbstractDOMWindow: A window that be either local or remote (hosted on another WebProcess)
1226             - DOMWindow: A local DOMWindow
1227             - RemoteDOMWindow: A window hosted on another WebProcess. A RemoteDOMWindow's frame is also
1228               remote. A RemoteDOMWindow is always cross-origin.
1229
1230         This patch introduces global identifiers (unique across all WebProcesses) for both Frames and
1231         Windows. This is useful as we need to know which Frame / DOMWindow a particular RemoteFrame /
1232         RemoteDOMWindow is pointing to.
1233
1234         Follow-up patch will add support for converting a local DOMWindow / Frame into a remote ones,
1235         when a newly opened window (via window.open) is navigated cross-origin (Bug 184515).
1236
1237         Other things we'll need to implement in follow-ups:
1238         - RemoteDOMWindow will need to know about its opener in order to support the window.opener
1239           API. Internally, the opener will be stored as a RemoteFrame so that window.opener always
1240           returns the current window in the opener frame (which changes upon navigation).
1241         - Nullify a RemoteDOMWindow's frame whenever the window it is pointing to becomes frameless.
1242           A frameless window behaves very differently (e.g. very little API is exposed to the Web).
1243           This happens when either the newly opened window is either closed or navigated.
1244
1245         * Sources.txt:
1246         * WebCore.xcodeproj/project.pbxproj:
1247         * loader/ContentFilter.cpp:
1248         (WebCore::ContentFilter::didDecide):
1249         * page/AbstractDOMWindow.cpp: Added.
1250         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
1251         (WebCore::AbstractDOMWindow::~AbstractDOMWindow):
1252         * page/AbstractDOMWindow.h: Added.
1253         (WebCore::AbstractDOMWindow::identifier const):
1254         * page/AbstractFrame.cpp: Added.
1255         (WebCore::AbstractFrame::AbstractFrame):
1256         (WebCore::AbstractFrame::~AbstractFrame):
1257         * page/AbstractFrame.h: Added.
1258         (WebCore::AbstractFrame::window const):
1259         * page/DOMWindow.cpp:
1260         (WebCore::DOMWindow::DOMWindow):
1261         * page/DOMWindow.h:
1262         (isType):
1263         * page/Frame.cpp:
1264         (WebCore::Frame::window const):
1265         (WebCore::Frame::virtualWindow const):
1266         * page/Frame.h:
1267         (isType):
1268         * page/GlobalFrameIdentifier.h: Added.
1269         (WebCore::GlobalFrameIdentifier::encode const):
1270         (WebCore::GlobalFrameIdentifier::decode):
1271         * page/GlobalWindowIdentifier.h: Added.
1272         (WebCore::operator==):
1273         (WebCore::GlobalWindowIdentifier::hash const):
1274         (WebCore::GlobalWindowIdentifier::encode const):
1275         (WebCore::GlobalWindowIdentifier::decode):
1276         (WTF::GlobalWindowIdentifierHash::hash):
1277         (WTF::GlobalWindowIdentifierHash::equal):
1278         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::emptyValue):
1279         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::constructDeletedValue):
1280         (WTF::HashTraits<WebCore::GlobalWindowIdentifier>::isDeletedValue):
1281
1282         * page/RemoteDOMWindow.cpp: Added.
1283         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
1284         (WebCore::RemoteDOMWindow::~RemoteDOMWindow):
1285         (WebCore::RemoteDOMWindow::self const):
1286         (WebCore::RemoteDOMWindow::location const):
1287         (WebCore::RemoteDOMWindow::close):
1288         (WebCore::RemoteDOMWindow::closed const):
1289         (WebCore::RemoteDOMWindow::focus):
1290         (WebCore::RemoteDOMWindow::blur):
1291         (WebCore::RemoteDOMWindow::length const):
1292         (WebCore::RemoteDOMWindow::top const):
1293         (WebCore::RemoteDOMWindow::opener const):
1294         (WebCore::RemoteDOMWindow::parent const):
1295         (WebCore::RemoteDOMWindow::postMessage):
1296         The DOM API exposed on RemoteDOMWindow is only the subset of the DOMWindow API that is exposed cross origin,
1297         since remote DOMWindow are always from a different origin. The short-term plan is to implement these in a
1298         follow-up by relying on IPC (synchronous when necessary) to fetch the information from the real window in
1299         the WebProcess where it lives. Longer term, we should probably keep RemoteDOMWindow members in sync with the
1300         DOMWindow they're pointing to, so we do not have to rely on synchronous IPC.
1301
1302         * page/RemoteDOMWindow.h: Added.
1303         (isType):
1304         * page/RemoteFrame.cpp: Added.
1305         (WebCore::RemoteFrame::RemoteFrame):
1306         (WebCore::RemoteFrame::~RemoteFrame):
1307         (WebCore::RemoteFrame::virtualWindow const):
1308         * page/RemoteFrame.h: Added.
1309         (isType):
1310
1311 2018-04-12  Daniel Bates  <dabates@apple.com>
1312
1313         Content-Type not enforced for <script> allows for XSS
1314         https://bugs.webkit.org/show_bug.cgi?id=184386
1315         <rdar://problem/39112268>
1316
1317         Reviewed by Brady Eidson.
1318
1319         As per the Fetch standard, <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-mime-type?> (16 March 2018),
1320         we should block JavaScript scripts that are served with MIME type text/csv, or a MIME type
1321         that begins with "audio/", "image/" or "video/".
1322
1323         As a side benefit of this change we now set the destination property [1] on preload requests.
1324
1325         [1] <https://fetch.spec.whatwg.org/#concept-request-destination>
1326
1327         Tests: http/tests/security/script-with-banned-mimetype.html
1328                http/tests/workers/worker-importScripts-banned-mimetype.html
1329
1330         * Sources.txt: Add file FetchIdioms.cpp.
1331         * WebCore.xcodeproj/project.pbxproj: Add files FetchIdioms.{cpp, h}.
1332         * dom/LoadableClassicScript.cpp:
1333         (WebCore::LoadableClassicScript::notifyFinished): Check the MIME type of the response and
1334         block the script if applicable.
1335         * dom/LoadableScript.h: Add error type MIMEType.
1336         * loader/FetchIdioms.cpp: Added.
1337         (WebCore::shouldBlockResponseDueToMIMEType): Implements the "Should response to request be blocked
1338         due to its MIME type?" algorithm from the Fetch standard.
1339         * loader/FetchIdioms.h: Added.
1340         * loader/FetchOptions.h:
1341         (WebCore::isScriptLikeDestination): Implements the definition of "script like" as per <https://fetch.spec.whatwg.org/#request-destination-script-like>.
1342         * loader/cache/CachedResourceLoader.cpp:
1343         (WebCore::CachedResourceLoader::requestImage): Removed logic to set the destination property as
1344         CachedResourceLoader::requestResource() is now responsible for doing this.
1345         (WebCore::CachedResourceLoader::requestFont): Ditto.
1346         (WebCore::CachedResourceLoader::requestTextTrack): Ditto.
1347         (WebCore::CachedResourceLoader::requestCSSStyleSheet): Ditto.
1348         (WebCore::CachedResourceLoader::requestScript): Ditto.
1349         (WebCore::CachedResourceLoader::requestXSLStyleSheet): Ditto.
1350         (WebCore::CachedResourceLoader::requestMedia): Update comment to express that we should assert
1351         that the destination property is either video or audio.
1352         (WebCore::CachedResourceLoader::requestIcon): Remove logic to set the destination property as
1353         CachedResourceLoader::requestResource() is now responsible for doing this.
1354         (WebCore::CachedResourceLoader::requestRawResource): Removed assertion as this function is used to
1355         load many kinds of requests that have different destination properties. The caller is responsible
1356         for setting the appropriate destintion property.
1357         (WebCore::CachedResourceLoader::requestMainResource): Remove logic to set the destination property
1358         as CachedResourceLoader::requestResource() is now responsible for doing this.
1359         (WebCore::destinationForType): Helper function that maps CachedResource::Type to FetchOptions::Destination.
1360         (WebCore::CachedResourceLoader::requestResource): Set the destination property on the request if not
1361         already set.
1362         * loader/cache/CachedResourceLoader.h: Segregate requestRawResource() from the other request functions
1363         and add a comment to explain what it is used for.
1364         * workers/Worker.cpp:
1365         (WebCore::Worker::create):
1366         * workers/WorkerScriptLoader.cpp:
1367         (WebCore::WorkerScriptLoader::loadSynchronously): Set the destination property to FetchOptions::Destination::Script
1368         and store it in an instance variable as we will need to reference it once we receive the HTTP response.
1369         Note that this function is only used to support the Web API importScripts().
1370         (WebCore::WorkerScriptLoader::loadAsynchronously): Store the passed destination property in an
1371         instance as we will need to reference it once we receive the HTTP response.
1372         (WebCore::WorkerScriptLoader::didReceiveResponse): Check the MIME type of the response and
1373         block the script if applicable.
1374         * workers/WorkerScriptLoader.h:
1375         * workers/service/ServiceWorkerJob.cpp:
1376         (WebCore::ServiceWorkerJob::fetchScriptWithContext): Set the destination property to FetchOptions::Destination::Serviceworker.
1377
1378 2018-04-12  Antoine Quint  <graouts@apple.com>
1379
1380         [Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
1381         https://bugs.webkit.org/show_bug.cgi?id=184555
1382
1383         Reviewed by Dean Jackson.
1384
1385         A series of small and intertwined issues were preventing a number of CSS Animations and CSS Trantions
1386         tests to fail when expressed as Web Animations.
1387
1388         * animation/AnimationTimeline.cpp:
1389         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Pass the old and new RenderStyles to CSSAnimation::create()
1390         since we're refactoring DeclarativeAnimation to create blending keyframes in initialize(), no longer requiring each subclass
1391         to create them.
1392         (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): Return the animation, if any, for a property animated by
1393         a CSS animation, so that we can determine if a property is already being animated when running a CSS Transition.
1394         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Since a property can be specified twice in a "transition" property,
1395         once via "all" and once explicitly, ensure we look at all currently running transitions for the currently-processed property to
1396         see if we need to cancel this transition. Previously, we used to only see if it had been transitioned in the old style. We also
1397         start transitions even if the duration is 0 provided the delay is a positive, non-zero value. Then, if there is a CSS Animation
1398         for this property already running, use that animation's original unanimated style as the from value.
1399         * animation/AnimationTimeline.h:
1400         * animation/CSSAnimation.cpp:
1401         (WebCore::CSSAnimation::create): The animation name is now set in the CSSAnimation constructor.
1402         (WebCore::CSSAnimation::CSSAnimation): Set the animation name and keep a copy of the unanimated style such that we can
1403         get it when a CSS Transition is created and takes precedence over this CSS Animation.
1404         (WebCore::CSSAnimation::initialize): Deleted.
1405         * animation/CSSAnimation.h:
1406         * animation/CSSTransition.cpp:
1407         (WebCore::CSSTransition::create):
1408         (WebCore::CSSTransition::initialize):
1409         * animation/CSSTransition.h:
1410         * animation/DeclarativeAnimation.cpp:
1411         (WebCore::DeclarativeAnimation::initialize): Call the new computeDeclarativeAnimationBlendingKeyframes() on the KeyframeEffect
1412         directly in this method so that subclasses don't need to create it manually, but most important so that keyframes are created
1413         before timing properties are set based on the backing animation.
1414         * animation/DeclarativeAnimation.h:
1415         * animation/KeyframeEffectReadOnly.cpp:
1416         (WebCore::KeyframeEffectReadOnly::getKeyframes): Ensure we have a CSSValue before trying to serialize it.
1417         (WebCore::KeyframeEffectReadOnly::computeDeclarativeAnimationBlendingKeyframes):
1418         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Use the animation's unanimated style to compute keyframes,
1419         instead of a default RenderStyle which would not use the right values for implicit keyframes.
1420         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Look at the property used to create
1421         the transition rather than that specified on the backing Animation object since it can be CSSPropertyInvalid in the case of
1422         "transition: all".
1423         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): If we're dealing with a CSS animation, we consider the first and
1424         last keyframes to always have the property listed since the underlying style was provided and should be captured.
1425         * animation/KeyframeEffectReadOnly.h:
1426         * style/StyleTreeResolver.cpp:
1427         (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Apply CSS Animations after CSS Trasitions since they take precedence.
1428
1429 2018-04-12  Antoine Quint  <graouts@apple.com>
1430
1431         [Web Animations] Only cancel declarative animations upon element removal
1432         https://bugs.webkit.org/show_bug.cgi?id=184553
1433
1434         Reviewed by Dean Jackson.
1435
1436         Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
1437         the ready promise and produce spurious logging from WPT tests.
1438
1439         * animation/AnimationTimeline.cpp:
1440         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
1441         (WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
1442         * animation/AnimationTimeline.h:
1443         * dom/Element.cpp:
1444         (WebCore::Element::removedFromAncestor):
1445         * dom/PseudoElement.cpp:
1446         (WebCore::PseudoElement::clearHostElement):
1447         * rendering/updating/RenderTreeUpdater.cpp:
1448         (WebCore::RenderTreeUpdater::tearDownRenderers):
1449
1450 2018-04-12  Ryan Haddad  <ryanhaddad@apple.com>
1451
1452         Unreviewed, rolling out r230554.
1453
1454         The non-ASCII character in the filename causes issues with SVN
1455
1456         Reverted changeset:
1457
1458         "input.webkitEntries does not work as expected when folder
1459         contains accented chars"
1460         https://bugs.webkit.org/show_bug.cgi?id=184517
1461         https://trac.webkit.org/changeset/230554
1462
1463 2018-04-12  Alicia Boya García  <aboya@igalia.com>
1464
1465         [MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
1466         https://bugs.webkit.org/show_bug.cgi?id=180253
1467
1468         Right now it's checked that start <= end but it's not checked that
1469         neither of them is undefined.
1470
1471         When this happens, the bug can be hard to track down.
1472
1473         The assertion is not enabled for Mac because there is currently a test
1474         that is hitting it.
1475
1476         Reviewed by Jer Noble.
1477
1478         * platform/graphics/PlatformTimeRanges.cpp:
1479         (WebCore::PlatformTimeRanges::add):
1480
1481 2018-04-12  Chris Dumez  <cdumez@apple.com>
1482
1483         Process::setIdentifier() / Process::identifier() do not need a lock
1484         https://bugs.webkit.org/show_bug.cgi?id=184544
1485
1486         Reviewed by Brady Eidson.
1487
1488         Process::setIdentifier() / Process::identifier() do not need a lock.
1489         Process::setIdentifier() gets called in ChildProcess::initialize(),
1490         before we start any background threads. It is then safe to query
1491         this process identifier later on from background threads without
1492         locks.
1493
1494         * platform/Process.cpp:
1495         (WebCore::Process::setIdentifier):
1496         (WebCore::Process::identifier):
1497
1498 2018-04-12  Antoine Quint  <graouts@apple.com>
1499
1500         Unreviewed, fix the Windows build.
1501
1502         * animation/DocumentTimeline.cpp:
1503         (WebCore::DocumentTimeline::computeExtentOfAnimation const):
1504
1505 2018-04-12  Antoine Quint  <graouts@apple.com>
1506
1507         [Web Animations] Suspend animations when required
1508         https://bugs.webkit.org/show_bug.cgi?id=184541
1509
1510         Reviewed by Jon Lee.
1511
1512         Animations managed by CSSAnimationController get suspended under a number of scenarios, we now add the possibility
1513         to suspend animations on a DocumentTimeline as well such that Web Animations and CSS Animations and CSS Transitions
1514         implemented as Web Animations get suspended under the same conditions as well. We also update the implementation for
1515         Internals::numberOfActiveAnimations() such that tests checking that animations get suspended pass.
1516
1517         * animation/DocumentTimeline.cpp:
1518         (WebCore::DocumentTimeline::suspendAnimations): When asked to be suspended, the DocumentTimeline cancels pending
1519         invalidation tasks and updates all of the animations it manages, including those running on the compositor.
1520         (WebCore::DocumentTimeline::resumeAnimations): When asked to be resumed, the DocumentTimeline resumes animations
1521         it manages and rewinds its invalidation timer.
1522         (WebCore::DocumentTimeline::animationsAreSuspended):
1523         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const): Called by Internals::numberOfActiveAnimations(),
1524         this returns the number of animations managed by this timeline that are not suspended.
1525         (WebCore::DocumentTimeline::currentTime):
1526         (WebCore::DocumentTimeline::timingModelDidChange): Ensure the invalidation timer is not rewound if the timeline
1527         is suspended.
1528         * animation/DocumentTimeline.h:
1529         * animation/WebAnimation.cpp:
1530         (WebCore::WebAnimation::setTimeline): When moving to a new timeline, ensure we match the new timeline's animation state.
1531         (WebCore::WebAnimation::setSuspended): Toggle the accelerated running state of any backing hardware animations when
1532         the suspension state of an animation changes.
1533         * animation/WebAnimation.h:
1534         (WebCore::WebAnimation::isSuspended const):
1535         * dom/Document.cpp:
1536         (WebCore::Document::didBecomeCurrentDocumentInFrame):
1537         (WebCore::Document::resume):
1538         * dom/Document.h:
1539         * history/CachedFrame.cpp:
1540         (WebCore::CachedFrameBase::restore):
1541         * page/Frame.cpp:
1542         (WebCore::Frame::clearTimers):
1543         * page/Page.cpp:
1544         (WebCore::Page::setIsVisibleInternal):
1545         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
1546         * testing/Internals.cpp:
1547         (WebCore::Internals::numberOfActiveAnimations const):
1548         (WebCore::Internals::animationsAreSuspended const):
1549         (WebCore::Internals::suspendAnimations const):
1550         (WebCore::Internals::resumeAnimations const):
1551
1552 2018-04-12  Antoine Quint  <graouts@apple.com>
1553
1554         [Web Animations] Throttle animations when lowPowerMode is on
1555         https://bugs.webkit.org/show_bug.cgi?id=184540
1556
1557         Reviewed by Jon Lee.
1558
1559         Ensure animations are sampled at a lower frequency when lowPowerMode is on.
1560
1561         * animation/DocumentTimeline.cpp:
1562         (WebCore::DocumentTimeline::updateThrottlingState):
1563         (WebCore::DocumentTimeline::animationInterval const):
1564         (WebCore::DocumentTimeline::updateAnimationSchedule):
1565         (WebCore::DocumentTimeline::scheduleAnimationResolution):
1566         * animation/DocumentTimeline.h:
1567         * page/Page.cpp:
1568         (WebCore::Page::handleLowModePowerChange):
1569         * testing/Internals.cpp:
1570         (WebCore::Internals::animationsInterval const):
1571
1572 2018-04-12  Antoine Quint  <graouts@apple.com>
1573
1574         [Web Animations] Ensure elements overlapping with elements animating also get composited
1575         https://bugs.webkit.org/show_bug.cgi?id=184539
1576
1577         Reviewed by Jon Lee.
1578
1579         A number of compositing tests failed because we didn't call into the Web Animations engine while various calls
1580         on RenderLayer and RenderLayerBacking were made. We bring the functionality over from CSSAnimationController to
1581         DocumentTimeline and KeyframeAnimation to KeyframeEffectReadOnly.
1582
1583         * animation/AnimationTimeline.cpp:
1584         (WebCore::AnimationTimeline::animationsForElement const): Update this method's signature to be const since it
1585         should be callable by other const method.
1586         (WebCore::AnimationTimeline::animationsForElement): Deleted.
1587         * animation/AnimationTimeline.h:
1588         * animation/DocumentTimeline.cpp:
1589         (WebCore::DocumentTimeline::computeExtentOfAnimation const): Adapt this method from CSSAnimationController.
1590         (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): Adapt this method from CSSAnimationController.
1591         (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Adapt this method from CSSAnimationController.
1592         * animation/DocumentTimeline.h:
1593         * animation/KeyframeEffectReadOnly.cpp:
1594         (WebCore::KeyframeEffectReadOnly::computeExtentOfTransformAnimation const): Bring this method over from KeyframeAnimation.
1595         (WebCore::containsRotation): Bring this method over from KeyframeAnimation.
1596         (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaTransformList const): Bring this method over from KeyframeAnimation.
1597         (WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaMatrix const): Bring this method over from KeyframeAnimation.
1598         * animation/KeyframeEffectReadOnly.h:
1599         (WebCore::KeyframeEffectReadOnly::animatedProperties const): DocumentTimeline::computeExtentOfAnimation() needs to get a list
1600         of all animated properties to see if a transform is animated, so we now expose such a list.
1601         * rendering/RenderLayer.cpp:
1602         (WebCore::RenderLayer::currentTransform const): Update this method to call into DocumentTimeline if the CSS Animations
1603         and CSS Transitions as Web Animations flag is on.
1604         (WebCore::RenderLayer::calculateClipRects const): Update this method to call into DocumentTimeline if the CSS Animations
1605         and CSS Transitions as Web Animations flag is on.
1606         * rendering/RenderLayerBacking.cpp:
1607         (WebCore::RenderLayerBacking::updateGeometry): Update this method to call into DocumentTimeline if the CSS Animations
1608         and CSS Transitions as Web Animations flag is on.
1609         * rendering/RenderLayerCompositor.cpp:
1610         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Update this method to call into DocumentTimeline
1611         if the CSS Animations and CSS Transitions as Web Animations flag is on.
1612         * rendering/RenderObject.h:
1613         (WebCore::RenderObject::documentTimeline const):
1614
1615 2018-04-11  Antoine Quint  <graouts@apple.com>
1616
1617         [Web Animations] Enable seeking for hardware animations
1618         https://bugs.webkit.org/show_bug.cgi?id=184518
1619
1620         Reviewed by Dean Jackson.
1621
1622         Hardware animations had lagged behind software animations in support and this patch bring their respective level
1623         of support closer to one another. Importantly, we add the ability to seek an animation added to a GraphicsLayerCA
1624         since many tests pause and seek animations to test their state. Animations may also have their playback state changed
1625         along with their current time in the same run loop, so we now maintain a list of pending processing actions for
1626         hardware animations.
1627
1628         * animation/DocumentTimeline.cpp:
1629         (WebCore::DocumentTimeline::updateAnimationSchedule): If we have animations queued up for updates to their accelerated
1630         state we can schedule animation resolution immediately since we've already established we'll have work to do.
1631         (WebCore::DocumentTimeline::updateAnimations): Factor the updates of pending accelerated animations out in a dedicated
1632         method.
1633         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): Go through all pending accelerated animations and update
1634         their state.
1635         * animation/KeyframeEffectReadOnly.cpp:
1636         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes): Update the m_shouldRunAccelerated flag when setting blending keyframes.
1637         (WebCore::KeyframeEffectReadOnly::apply): Ensure we finish accelerated animations if the progress is 1 or null (no longer active).
1638         start accelerated animations if the animation is starting and always resolve styles in software as well to ensure that
1639         hit testing will work as expected.
1640         (WebCore::KeyframeEffectReadOnly::computeShouldRunAccelerated):
1641         (WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Called by WebAnimation when play() or pause() is called
1642         with the appropriate flag.
1643         (WebCore::KeyframeEffectReadOnly::animationDidSeek): Called by WebAnimation when the currentTime property is set.
1644         (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Add the provided action to the list of pending accelerated
1645         actions and notify the animation that the accelerated state needs changing.
1646         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Called by DocumentTimeline, through WebAnimation, to apply
1647         all pending accelerated actions.
1648         (WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const): If we're dealing with a declarative animation,
1649         we already have a backing Animation object, so use it directly. Otherwise, create one and ensure it reflects all timing properties
1650         for the animation.
1651         (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): Deleted.
1652         (WebCore::KeyframeEffectReadOnly::startOrStopAccelerated): Deleted.
1653         * animation/WebAnimation.cpp:
1654         (WebCore::WebAnimation::setCurrentTime): Call animationDidSeek() on the effect to ensure its accelerated animation gets seeked.
1655         (WebCore::WebAnimation::play): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation is started or resumed.
1656         (WebCore::WebAnimation::pause): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation gets paused.
1657         (WebCore::WebAnimation::acceleratedStateDidChange): 
1658         (WebCore::WebAnimation::applyPendingAcceleratedActions):
1659         (WebCore::WebAnimation::acceleratedRunningStateDidChange): Deleted.
1660         (WebCore::WebAnimation::startOrStopAccelerated): Deleted.
1661         * platform/graphics/GraphicsLayer.h:
1662         (WebCore::GraphicsLayer::seekAnimation):
1663         * platform/graphics/ca/GraphicsLayerCA.cpp:
1664         (WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Add an AnimationProcessingAction to the list of such actions for a
1665         given animation name. In case we already have a Remove action, we ignore the action since the hardware animation will have been
1666         removed by the time we try to apply this processing action.
1667         (WebCore::GraphicsLayerCA::pauseAnimation): Add a Pause processing action.
1668         (WebCore::GraphicsLayerCA::seekAnimation): Add a Seek processing action.
1669         (WebCore::GraphicsLayerCA::removeAnimation): Add a Remove processing action.
1670         (WebCore::GraphicsLayerCA::updateAnimations): First ensure that all animations pending commit are committed and then update
1671         all animations based on the actions added through addProcessingActionForAnimation().
1672         (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Generate a new animation based on the new seek time provided.
1673         * platform/graphics/ca/GraphicsLayerCA.h:
1674         (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
1675         * rendering/RenderBoxModelObject.cpp:
1676         (WebCore::RenderBoxModelObject::animationSeeked):
1677         * rendering/RenderLayerBacking.cpp:
1678         (WebCore::RenderLayerBacking::animationSeeked):
1679         * rendering/RenderLayerCompositor.cpp:
1680         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Fix an issue where we would run the CSSAnimationController
1681         logic even when the legacy animation engine was disabled.
1682
1683 2018-04-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1684
1685         Unreviewed, fix GStreamer builds
1686
1687         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1688         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): We were
1689         passing a String to a GST_WARNING call.
1690
1691 2018-04-11  Chris Dumez  <cdumez@apple.com>
1692
1693         input.webkitEntries does not work as expected when folder contains accented chars
1694         https://bugs.webkit.org/show_bug.cgi?id=184517
1695         <rdar://problem/39265537>
1696
1697         Reviewed by Ryosuke Niwa.
1698
1699         Use String::fromUTF8() to construct a WTF String from the char* returned by
1700         dirname() in FileSystem::directoryName(). Previously, we were just calling
1701         the String constructor, which would treat the input as latin 1 instead of
1702         UTF-8.
1703
1704         Test: fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html
1705
1706         * platform/posix/FileSystemPOSIX.cpp:
1707         (WebCore::FileSystem::directoryName):
1708
1709 2018-04-11  Youenn Fablet  <youenn@apple.com>
1710
1711         Preventively expect UTF8 strings from libwebrtc SDP and error messages
1712         https://bugs.webkit.org/show_bug.cgi?id=184509
1713
1714         Reviewed by Eric Carlson.
1715
1716         Make WebCore code expect any libwebrtc string to contain UTF-8.
1717         Currently SDPs do not contain any UTF-8 specific character
1718         but https://tools.ietf.org/html/rfc4566 allows it.
1719
1720         Add Internals API to set track id so that we can inject UTF-8 inside some WebRTC tests.
1721         Test: webrtc/utf8-sdp.html
1722
1723         * Modules/mediastream/MediaStreamTrack.h:
1724         (WebCore::MediaStreamTrack::setIdForTesting):
1725         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1726         (WebCore::fromStdString):
1727         (WebCore::fromSessionDescription):
1728         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
1729         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
1730         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
1731         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
1732         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
1733         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
1734         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1735         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
1736         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
1737         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
1738         (WebCore::trackId): Deleted.
1739         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1740         (WebCore::fromStdString):
1741         (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
1742         (WebCore::createReceiverForSource):
1743         * platform/mediastream/MediaStreamTrackPrivate.h:
1744         (WebCore::MediaStreamTrackPrivate::setIdForTesting):
1745         * testing/Internals.cpp:
1746         (WebCore::Internals::setMediaStreamTrackIdentifier):
1747         * testing/Internals.h:
1748         * testing/Internals.idl:
1749
1750 2018-04-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1751
1752         Cache glyphs (using display lists) when painting at high frequency
1753         https://bugs.webkit.org/show_bug.cgi?id=178750
1754         <rdar://problem/35201729>
1755
1756         Reviewed by Antti Koivisto.
1757
1758         This patch adds support for caching of glyph drawing commands when painting
1759         at high frequency. Caching the glyph drawing will be done using DisplayLists.
1760
1761         GlyphDisplayListCache is basically a hash map which maps InlineTextBox
1762         or SimpleLineLayout::Run to DisplayList. Before adding a new entry to it
1763         we have to check whether the conditions for caching the glyph DisplayList
1764         are met or not. If no entry is found for a given run, a new DisplayList
1765         is created and a new entry is add to the cache.
1766
1767         * WebCore.xcodeproj/project.pbxproj:
1768         * page/MemoryRelease.cpp:
1769         (WebCore::releaseNoncriticalMemory): Make GlyphDisplayListCache respond
1770         to memory pressure.
1771
1772         * platform/graphics/FontCascade.cpp:
1773         (WebCore::FontCascade::displayListForTextRun const):
1774         * platform/graphics/FontCascade.h:
1775         (WebCore::FontCascade::displayListForTextRun):
1776         Record the drawing of a glyph run into a DisplayList.
1777
1778         * rendering/GlyphDisplayListCache.h: Added.
1779         (WebCore::GlyphDisplayListCache::singleton):
1780         (WebCore::GlyphDisplayListCache::get):
1781         (WebCore::GlyphDisplayListCache::remove):
1782         (WebCore::GlyphDisplayListCache::clear):
1783         (WebCore::GlyphDisplayListCache::size const):
1784         (WebCore::GlyphDisplayListCache::sizeInBytes const):
1785         A simple cache for the TextRun DisplayList. Adding a new entry in the
1786         cache happens under restricted conditions. So this cache is not expected
1787         to grow much.
1788
1789         * rendering/InlineTextBox.cpp:
1790         (WebCore::InlineTextBox::~InlineTextBox):
1791         (WebCore::InlineTextBox::paint):
1792         (WebCore::InlineTextBox::paintMarkedTexts):
1793         (WebCore::InlineTextBox::paintMarkedTextBackground):
1794         (WebCore::InlineTextBox::paintMarkedTextForeground):
1795         (WebCore::InlineTextBox::paintMarkedTextDecoration):
1796         (WebCore::InlineTextBox::paintCompositionBackground):
1797         (WebCore::InlineTextBox::paintCompositionUnderlines const):
1798         (WebCore::InlineTextBox::paintCompositionUnderline const):
1799         * rendering/InlineTextBox.h:
1800         (WebCore::InlineTextBox::paintMarkedTexts):
1801         InlineTextBox::paintMarkedTextForeground() now requires PaintInfo to know
1802         whether the entry in the GlyphDisplayListCache should be removed or not.
1803         Change all the GraphicsContext arguments to be PaintInfo.
1804
1805         * rendering/SimpleLineLayout.cpp:
1806         (WebCore::SimpleLineLayout::Layout::~Layout):
1807         * rendering/SimpleLineLayout.h:
1808         * rendering/SimpleLineLayoutFunctions.cpp:
1809         (WebCore::SimpleLineLayout::paintFlow):
1810         (WebCore::SimpleLineLayout::simpleLineLayoutWillBeDeleted):
1811         * rendering/SimpleLineLayoutFunctions.h:
1812         * rendering/SimpleLineLayoutResolver.h:
1813         (WebCore::SimpleLineLayout::RunResolver::Run::simpleRun const):
1814         Implement the glyph caching for SimpleLineLayout::Run.
1815
1816         * rendering/TextPainter.cpp:
1817         (WebCore::TextPainter::paintTextOrEmphasisMarks): If the DisplayList is
1818         available, replay it back into the GraphicsContext. Make sure to reset to
1819         the DisplayList pointer to nullptr after painting.
1820
1821         (WebCore::TextPainter::clearGlyphDisplayLists):
1822         (WebCore::TextPainter::shouldUseGlyphDisplayList): Check whether we should
1823         use DisplayList to the draw glyph run.
1824
1825         * rendering/TextPainter.h:
1826         (WebCore::TextPainter::setGlyphDisplayListIfNeeded): Check whether we should
1827         should use DisplayList to the draw glyph run and if we should, ensure first
1828         the DisplayList is cached and set it in the TextPainter so it uses it when
1829         the run is painted.
1830
1831         (WebCore::TextPainter::removeGlyphDisplayList): Remove the cached DisplayList
1832         entry for a glyph layout run.
1833
1834 2018-04-11  Brent Fulgham  <bfulgham@apple.com>
1835
1836         GraphicsLayerCA::createPlatformCALayer always disables extended color in its backing store
1837         https://bugs.webkit.org/show_bug.cgi?id=184367
1838         <rdar://problem/39249074>
1839
1840         Reviewed by Simon Fraser.
1841
1842         'createPlatformCALayer' always passes a nil widget, which early returns from 'screenSupportsExtendedColor'
1843         with false. Instead, we should just pass the widget (nil or not) to the screen properties methods,
1844         which will use the primary screen if no screen is specified. I.e., we shouldn't do an early return
1845         here if the passed widget is nil.
1846
1847         * platform/mac/PlatformScreenMac.mm:
1848         (WebCore::screenSupportsExtendedColor):
1849
1850 2018-04-11  Youenn Fablet  <youenn@apple.com>
1851
1852         Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
1853         https://bugs.webkit.org/show_bug.cgi?id=184374
1854
1855         Reviewed by Chris Dumez.
1856
1857         Add support for SecurityOrigin encode/decode routines.
1858
1859         * page/SecurityOrigin.h:
1860
1861 2018-04-11  Thibault Saunier  <tsaunier@igalia.com>
1862
1863         [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
1864         https://bugs.webkit.org/show_bug.cgi?id=184498
1865
1866         Reviewed by Philippe Normand.
1867
1868         [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
1869
1870         This is the same behaviour as with playbin itself.
1871
1872         Make sure to keep using "playbin" for MediaSource.
1873
1874         No test added as this is basically a small rework of the way we expose a feature.
1875
1876         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1877         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
1878         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1879         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1880         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
1881         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
1882         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1883         (WebCore::MediaPlayerPrivateGStreamer::load):
1884         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
1885         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1886         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1887         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1888         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1889         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1890         (WebCore::TrackPrivateBaseGStreamer::disconnect):
1891         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
1892         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
1893         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1894         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
1895
1896 2018-04-10  Alex Christensen  <achristensen@webkit.org>
1897
1898         IDN spoofing with Hebrew combining characters
1899         https://bugs.webkit.org/show_bug.cgi?id=184472
1900         <rdar://problem/39148687>
1901
1902         Reviewed by Brent Fulgham.
1903
1904         Covered by new API tests.
1905
1906         * platform/mac/WebCoreNSURLExtras.mm:
1907         (WebCore::isLookalikeCharacter):
1908         Punycode-encode hosts with Hebrew combining marks that look like dots
1909         and Vav with a combining dot above like we do with dotless i and j.
1910
1911 2018-04-11  Brent Fulgham  <bfulgham@apple.com>
1912
1913         Show punycode if URL contains Latin dum character
1914         https://bugs.webkit.org/show_bug.cgi?id=184477
1915         <rdar://problem/39121999>
1916
1917         Reviewed by David Kilzer.
1918
1919         Revise our "lookalike character" logic to include the small
1920         Latin dum character.
1921
1922         Test: fast/url/host.html
1923
1924         * platform/mac/WebCoreNSURLExtras.mm:
1925         (WebCore::isLookalikeCharacter):
1926
1927 2018-04-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1928
1929         [GTK] WaylandCompositorDisplay leaks its wl_display
1930         https://bugs.webkit.org/show_bug.cgi?id=184406
1931
1932         Reviewed by Carlos Garcia Campos.
1933
1934         Well, this was harder than expected. We really just want to fix a small leak in the WebKit
1935         layer, but that requires a change in how WaylandCompositorDisplay calls the
1936         PlatformDisplayWayland constructor, to pass NativeDisplayOwned::Yes. That means
1937         WaylandCompositorDisplay can no longer use PlatformDisplayWayland's protected default
1938         constructor. Problem is that the normal PlatformDisplayWayland constructor calls
1939         PlatformDisplayWayland::initialize, which calls PlatformDisplayWayland::registryGlobal,
1940         which is a virtual function. The WaylandCompositorDisplay portion of the object is not
1941         constructed yet at this point, so WaylandCompositorDisplay::registryGlobal will never be
1942         called if we do that. I had to revert the previous version of this fix due to this problem.
1943         It had broken accelerated compositing.
1944
1945         I'm reminded of Effective C++ item #9: Never call virtual functions during construction or
1946         destruction ("because such calls will never go to a more derived class than that of the
1947         currently executing constructor or destructor"). This code is fragile and likely to break
1948         again in the future, so let's refactor it a bit. Instead of calling initialize in the
1949         constructor, we'll call it from create functions. We'll have to add a couple create
1950         functions, and make the constructor protected to ensure it's not possible to create a
1951         PlatformDisplayWayland without initializing it. For good parallelism, do the same for the
1952         other PlatformDisplay classes.
1953
1954         This commit additionally removes PlatformDisplayWayland's protected default constructor,
1955         since it's not needed anymore.
1956
1957         The NativeDisplayOwned arguments to the PlatformDisplay constructors are now mandatory,
1958         instead of using NativeDisplayOwned::No as the default value, since that was dangerously
1959         close to being the cause of this leak, and the constructors are now accessed from private
1960         create functions anyway. Some more caution when using default parameter values is warranted
1961         in the future.
1962
1963         Lastly, since we have to change PlatformDisplay::createPlatformDisplay to use the new create
1964         functions, take the opportunity to move things around a bit for clarity. There should be no
1965         change in behavior. I was just disappointed that the PlatformDisplayWPE creation was at the
1966         bottom of the function, after a comment indicating that normal display creation has failed,
1967         which is not the case for WPE.
1968
1969         This all might have been a bit overkill, since the leak could probably have been fixed by
1970         passing nullptr to the PlatformDisplayWayland constructor for the wl_display and not
1971         removing WaylandCompositorDisplay's call to PlatformDisplayWayland::initialize. But the
1972         correctness of that code would then rely on implementation details of initialize, so this
1973         refactor seems better.
1974
1975         No new tests since there *should* be no behavior change. Then again, I'm touching
1976         PlatformDisplay, and history shows we don't have the greatest track record of touching this
1977         code without introducing problems.
1978
1979         * platform/graphics/PlatformDisplay.cpp:
1980         (WebCore::PlatformDisplay::createPlatformDisplay):
1981         * platform/graphics/PlatformDisplay.h:
1982         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1983         (WebCore::PlatformDisplayWayland::create):
1984         (WebCore::PlatformDisplayWayland::create):
1985         (WebCore::PlatformDisplayWayland::createHeadless):
1986         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
1987         (WebCore::PlatformDisplayWayland::initialize):
1988         * platform/graphics/wayland/PlatformDisplayWayland.h:
1989         * platform/graphics/win/PlatformDisplayWin.h:
1990         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
1991         (WebCore::create):
1992         * platform/graphics/wpe/PlatformDisplayWPE.h:
1993         * platform/graphics/x11/PlatformDisplayX11.cpp:
1994         (WebCore::PlatformDisplayX11::create):
1995         (WebCore::PlatformDisplayX11::create):
1996         (WebCore::PlatformDisplayX11::createHeadless):
1997         * platform/graphics/x11/PlatformDisplayX11.h:
1998
1999 2018-04-11  Jianjun Zhu  <jianjun.zhu@intel.com>
2000
2001         Fix a WebRTC data channel issue for non-ASCII characters.
2002
2003         At the sender side, buffer size are calulcated after UTF8 encoding. At the
2004         receiver side, strings are constructed with UTF8 data.
2005
2006         https://bugs.webkit.org/show_bug.cgi?id=184481
2007
2008         Reviewed by Youenn Fablet.
2009
2010         Updated test:
2011         LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-expected.txt
2012
2013         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
2014         (WebCore::LibWebRTCDataChannelHandler::sendStringData):
2015         (WebCore::LibWebRTCDataChannelHandler::OnMessage):
2016
2017 2018-04-11  Antti Koivisto  <antti@apple.com>
2018
2019         ImageFrame type used by non-Cocoa image decoder should not be the same as that used by ImageSource
2020         https://bugs.webkit.org/show_bug.cgi?id=184418
2021
2022         Reviewed by Said Abou-Hallawa.
2023
2024         ScalableImageDecoder uses ImageFrame class which is meant to be an implementation detail of ImageSource.
2025         There are bunch of fields and methods in the type that are only used by one or the other client. For hackability
2026         there should be an unrelated frame type for ScalableImageDecoder.
2027
2028         This patch adds ScalableImageDecoderFrame type used in ScalableImageDecoder only. It then cleans up
2029         unneeded things from both ImageFrame and ScalableImageDecoderFrame.
2030
2031         * platform/ImageDecoders.cmake:
2032         * platform/graphics/ImageFrame.cpp:
2033         (WebCore::ImageFrame::operator=):
2034         (WebCore::ImageFrame::clearImage):
2035         (WebCore::ImageFrame::size const):
2036         (WebCore::ImageFrame::initialize): Deleted.
2037         * platform/graphics/ImageFrame.h:
2038         (WebCore::ImageFrame::setDisposalMethod): Deleted.
2039         (WebCore::ImageFrame::disposalMethod const): Deleted.
2040         (WebCore::ImageFrame::backingStore const): Deleted.
2041         (WebCore::ImageFrame::hasBackingStore const): Deleted.
2042         * platform/image-decoders/ScalableImageDecoder.cpp:
2043         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
2044         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2045         (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
2046         * platform/image-decoders/ScalableImageDecoder.h:
2047         * platform/image-decoders/ScalableImageDecoderFrame.cpp: Copied from Source/WebCore/platform/graphics/ImageFrame.cpp.
2048         (WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
2049         (WebCore::ScalableImageDecoderFrame::~ScalableImageDecoderFrame):
2050         (WebCore::ScalableImageDecoderFrame::operator=):
2051         (WebCore::ScalableImageDecoderFrame::setDecodingStatus):
2052         (WebCore::ScalableImageDecoderFrame::decodingStatus const):
2053         (WebCore::ScalableImageDecoderFrame::clearImage):
2054         (WebCore::ScalableImageDecoderFrame::clear):
2055         (WebCore::ScalableImageDecoderFrame::initialize):
2056         (WebCore::ScalableImageDecoderFrame::size const):
2057         (WebCore::ImageFrame::ImageFrame): Deleted.
2058         (WebCore::ImageFrame::~ImageFrame): Deleted.
2059         (WebCore::ImageFrame::defaultFrame): Deleted.
2060         (WebCore::ImageFrame::operator=): Deleted.
2061         (WebCore::ImageFrame::setDecodingStatus): Deleted.
2062         (WebCore::ImageFrame::decodingStatus const): Deleted.
2063         (WebCore::ImageFrame::clearImage): Deleted.
2064         (WebCore::ImageFrame::clear): Deleted.
2065         (WebCore::ImageFrame::initialize): Deleted.
2066         (WebCore::ImageFrame::size const): Deleted.
2067         (WebCore::ImageFrame::hasNativeImage const): Deleted.
2068         (WebCore::ImageFrame::hasFullSizeNativeImage const): Deleted.
2069         (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions const): Deleted.
2070         (WebCore::ImageFrame::singlePixelSolidColor const): Deleted.
2071         * platform/image-decoders/ScalableImageDecoderFrame.h: Copied from Source/WebCore/platform/graphics/ImageFrame.h.
2072         (WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
2073         (WebCore::ScalableImageDecoderFrame::disposalMethod const):
2074         (WebCore::ScalableImageDecoderFrame::hasAlpha const):
2075         (WebCore::ScalableImageDecoderFrame::hasBackingStore const):
2076         (WebCore::ImageFrame::ImageFrame): Deleted.
2077         (WebCore::ImageFrame::isInvalid const): Deleted.
2078         (WebCore::ImageFrame::isPartial const): Deleted.
2079         (WebCore::ImageFrame::isComplete const): Deleted.
2080         (WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
2081         (WebCore::ImageFrame::frameBytes const): Deleted.
2082         (WebCore::ImageFrame::subsamplingLevel const): Deleted.
2083         (WebCore::ImageFrame::setDisposalMethod): Deleted.
2084         (WebCore::ImageFrame::disposalMethod const): Deleted.
2085         (WebCore::ImageFrame::nativeImage const): Deleted.
2086         (WebCore::ImageFrame::setOrientation): Deleted.
2087         (WebCore::ImageFrame::orientation const): Deleted.
2088         (WebCore::ImageFrame::setDuration): Deleted.
2089         (WebCore::ImageFrame::duration const): Deleted.
2090         (WebCore::ImageFrame::setHasAlpha): Deleted.
2091         (WebCore::ImageFrame::hasAlpha const): Deleted.
2092         (WebCore::ImageFrame::hasNativeImage): Deleted.
2093         (WebCore::ImageFrame::hasFullSizeNativeImage): Deleted.
2094         (WebCore::ImageFrame::hasMetadata const): Deleted.
2095         (WebCore::ImageFrame::backingStore const): Deleted.
2096         (WebCore::ImageFrame::hasBackingStore const): Deleted.
2097         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
2098         (WebCore::BMPImageDecoder::frameBufferAtIndex):
2099         * platform/image-decoders/bmp/BMPImageDecoder.h:
2100         * platform/image-decoders/bmp/BMPImageReader.h:
2101         (WebCore::BMPImageReader::setBuffer):
2102         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2103         (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
2104         (WebCore::GIFImageDecoder::frameBufferAtIndex):
2105         (WebCore::GIFImageDecoder::clearFrameBufferCache):
2106         (WebCore::GIFImageDecoder::haveDecodedRow):
2107         (WebCore::GIFImageDecoder::frameComplete):
2108         (WebCore::GIFImageDecoder::initFrameBuffer):
2109         * platform/image-decoders/gif/GIFImageDecoder.h:
2110         * platform/image-decoders/gif/GIFImageReader.cpp:
2111         (GIFImageReader::parse):
2112         * platform/image-decoders/gif/GIFImageReader.h:
2113         (GIFFrameContext::GIFFrameContext):
2114         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2115         (WebCore::ICOImageDecoder::frameBufferAtIndex):
2116         * platform/image-decoders/ico/ICOImageDecoder.h:
2117         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2118         (WebCore::JPEGImageDecoder::frameBufferAtIndex):
2119         (WebCore::setPixel):
2120         (WebCore::JPEGImageDecoder::outputScanlines):
2121         (WebCore::JPEGImageDecoder::jpegComplete):
2122         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2123         * platform/image-decoders/png/PNGImageDecoder.cpp:
2124         (WebCore::PNGImageDecoder::frameBufferAtIndex):
2125         (WebCore::PNGImageDecoder::rowAvailable):
2126         (WebCore::PNGImageDecoder::readChunks):
2127         (WebCore::PNGImageDecoder::clearFrameBufferCache):
2128         (WebCore::PNGImageDecoder::initFrameBuffer):
2129         (WebCore::PNGImageDecoder::frameComplete):
2130         * platform/image-decoders/png/PNGImageDecoder.h:
2131         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2132         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
2133         (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
2134         (WebCore::WEBPImageDecoder::decodeFrame):
2135         (WebCore::WEBPImageDecoder::initFrameBuffer):
2136         (WebCore::WEBPImageDecoder::applyPostProcessing):
2137         (WebCore::WEBPImageDecoder::clearFrameBufferCache):
2138         * platform/image-decoders/webp/WEBPImageDecoder.h:
2139
2140 2018-04-11  Antoine Quint  <graouts@apple.com>
2141
2142         [Web Animations] Turn Web Animations on by default
2143         https://bugs.webkit.org/show_bug.cgi?id=184491
2144
2145         Reviewed by Simon Fraser.
2146
2147         * page/RuntimeEnabledFeatures.h:
2148
2149 2018-04-11  Ryosuke Niwa  <rniwa@webkit.org>
2150
2151         Fix warning in HashTools.h for newer versions of clang
2152         https://bugs.webkit.org/show_bug.cgi?id=184489
2153
2154         Reviewed by Alexey Proskuryakov.
2155
2156         Removed "register" storage class specififer as it has been deprecated in C++11.
2157
2158         * platform/HashTools.h:
2159
2160 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2161
2162         FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
2163         https://bugs.webkit.org/show_bug.cgi?id=183395
2164         <rdar://problem/38055732>
2165
2166         Reviewed by Zalan Bujtas.
2167
2168         In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
2169         FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
2170         mitigation by wrapping the Frame in a Ref when firing the appearance update timer.
2171
2172         Test: editing/selection/iframe-update-selection-appearance.html
2173
2174         * editing/FrameSelection.cpp:
2175         (WebCore::FrameSelection::appearanceUpdateTimerFired):
2176
2177 2018-04-10  Brent Fulgham  <bfulgham@apple.com>
2178
2179         Unreviewed follow-up to r230468.
2180
2181         Switch some RELEASE_ASSERTs in hot codepaths to normal DEBUG asserts.
2182
2183         * page/mac/EventHandlerMac.mm:
2184         (WebCore::lastEventIsMouseUp):
2185         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
2186         * platform/mac/EventLoopMac.mm:
2187         (WebCore::EventLoop::cycle):
2188
2189 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2190
2191         Unreviewed, fix the iOS build
2192
2193         I accidentally exported an inline function in r230506.
2194
2195         * page/ViewportConfiguration.h:
2196         (WebCore::ViewportConfiguration::viewSize const):
2197
2198 2018-04-10  Nan Wang  <n_wang@apple.com>
2199
2200         AX: Expose strong password fields on iOS
2201         https://bugs.webkit.org/show_bug.cgi?id=184465
2202         <rdar://problem/39325104>
2203
2204         Reviewed by Chris Fleizach.
2205
2206         Exposed the strong password field on iOS. And made sure
2207         we are returning its actual value in accessibilityValue.
2208
2209         Test: accessibility/ios-simulator/strong-password-field.html
2210
2211         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2212         (-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
2213         (-[WebAccessibilityObjectWrapper accessibilityValue]):
2214
2215 2018-04-10  Fujii Hironori  <Hironori.Fujii@sony.com>
2216
2217         [Win] Add UserAgentWin.cpp
2218         https://bugs.webkit.org/show_bug.cgi?id=184438
2219
2220         Reviewed by Michael Catanzaro.
2221
2222         No new tests (No behavior change).
2223
2224         * PlatformWin.cmake:
2225         * platform/win/UserAgentWin.cpp: Added.
2226         (WebCore::standardUserAgent):
2227         (WebCore::standardUserAgentForURL):
2228
2229 2018-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2230
2231         [Extra zoom mode] Add a mechanism to zoom to fixed scales when double tapping in extra zoom mode
2232         https://bugs.webkit.org/show_bug.cgi?id=184435
2233         <rdar://problem/38726260>
2234
2235         Reviewed by Dean Jackson.
2236
2237         Expose the size of the platform view. By default, in extra zoom mode, this *not* the same as the minimum layout
2238         size, since we lay out at a large width and then shrink down to real device dimensions when computing the
2239         initial scale (see r229063).
2240
2241         ViewGestureGeometryCollector uses this in the process of computing a target zoom scale when double tapping.
2242
2243         * page/ViewportConfiguration.h:
2244         (WebCore::ViewportConfiguration::viewSize const):
2245
2246 2018-04-10  Fujii Hironori  <Hironori.Fujii@sony.com>
2247
2248         [Win][WebKit] LibWebRTCProvider::webRTCAvailable is an undefined symbol
2249         https://bugs.webkit.org/show_bug.cgi?id=184437
2250
2251         Reviewed by Michael Catanzaro.
2252
2253         No new tests (No behavior change).
2254
2255         * PlatformWin.cmake: Added LibWebRTCProviderWin.cpp.
2256         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Added.
2257         (WebCore::LibWebRTCProvider::webRTCAvailable):
2258
2259 2018-04-10  Chris Dumez  <cdumez@apple.com>
2260
2261         Unreviewed build fix.
2262
2263         Those enum value names were too generic and would cause conflicts.
2264
2265         * Modules/webvr/VRDisplayCapabilities.h:
2266         (WebCore::VRDisplayCapabilities::hasPosition const):
2267         (WebCore::VRDisplayCapabilities::hasOrientation const):
2268         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
2269         (WebCore::VRDisplayCapabilities::canPresent const):
2270         * platform/vr/VRPlatformDisplay.h:
2271         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
2272         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2273
2274 2018-04-10  Chris Dumez  <cdumez@apple.com>
2275
2276         Avoid constructing a service worker RegistrationStore for private sessions
2277         https://bugs.webkit.org/show_bug.cgi?id=184463
2278         <rdar://problem/36613948>
2279
2280         Reviewed by Youenn Fablet.
2281
2282         Avoid constructing a service worker RegistrationStore for private sessions since there
2283         is no need for persistence and the registrationDatabaseDirectory is the empty string in
2284         such cases.
2285
2286         * workers/service/server/SWServer.cpp:
2287         (WebCore::SWServer::removeRegistration):
2288         (WebCore::SWServer::clearAll):
2289         (WebCore::SWServer::clear):
2290         (WebCore::SWServer::SWServer):
2291         (WebCore::SWServer::didFinishActivation):
2292         * workers/service/server/SWServer.h:
2293
2294 2018-04-10  Chris Dumez  <cdumez@apple.com>
2295
2296         Unreviewed build fix.
2297
2298         * page/LayoutContext.cpp:
2299         (WebCore::LayoutContext::~LayoutContext):
2300         * page/LayoutContext.h:
2301
2302 2018-04-10  Jeremy Jones  <jeremyj@apple.com>
2303
2304         MediaSessionManageriOS should defer creation of MPVolumeView until it needs to monitor AirPlay routes
2305         https://bugs.webkit.org/show_bug.cgi?id=184373
2306         <rdar://problem/35177606>
2307
2308         Reviewed by Eric Carlson.
2309
2310         No change of behavior.
2311
2312         This delays the creation of MPVolumeView until airplay routes are monitored.
2313         MPVolumeView is now also released when monitoring ends. 
2314         This makes sure the MP* objects are only accessed from a UI safe thread. WebCore's "MainThread" may be different that the UI thread.
2315         Since this state change is necessarily asynchronous, starting and stopping must prevent races to keep state coherent.
2316
2317         * platform/audio/ios/MediaSessionManagerIOS.mm:
2318         (-[WebMediaSessionHelper initWithCallback:]):
2319         (-[WebMediaSessionHelper dealloc]):
2320         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
2321         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
2322         (-[WebMediaSessionHelper allocateVolumeView]): Deleted.
2323         (-[WebMediaSessionHelper setVolumeView:]): Deleted.
2324
2325 2018-04-10  Sihui Liu  <sihui_liu@apple.com>
2326
2327         Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
2328         https://bugs.webkit.org/show_bug.cgi?id=184268
2329         <rdar://problem/39144446>
2330
2331         Reviewed by Chris Dumez.
2332
2333         The assertion is no longer true after the change, because multiple resources could have same
2334         url. Used if condition here to make sure we only delete specified resource.
2335
2336         No new tests. Updated an existing test to test the stop loading case by not using injected 
2337         bundle policy: http/tests/multipart/multipart-html.php.
2338
2339         * loader/cache/CachedResourceLoader.cpp:
2340         (WebCore::CachedResourceLoader::removeCachedResource):
2341
2342 2018-04-10  Zalan Bujtas  <zalan@apple.com>
2343
2344         Do not layout images when we only need the overflow information.
2345         https://bugs.webkit.org/show_bug.cgi?id=175331
2346
2347         Reviewed by Simon Fraser.
2348
2349         This improves MotionMark's Simple Leaves by ~10%. 
2350
2351         Covered by existing tests.
2352
2353         * rendering/RenderImage.cpp:
2354         (WebCore::RenderImage::layout):
2355
2356 2018-04-10  Zan Dobersek  <zdobersek@igalia.com>
2357
2358         [TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform
2359         https://bugs.webkit.org/show_bug.cgi?id=183868
2360
2361         Reviewed by Carlos Garcia Campos.
2362
2363         Drop the GraphicsLayerTransform member variable from TextureMapperLayer
2364         and instead compute all the required transform information in the
2365         computeTransformsRecursive() method. These computations are not too
2366         expensive, and in turn we can drop an object from this class' state that
2367         was only duplicating a bunch of state variables.
2368
2369         No new tests -- no change in functionality.
2370
2371         * platform/graphics/texmap/TextureMapperLayer.cpp:
2372         (WebCore::TextureMapperLayer::computeTransformsRecursive):
2373         (WebCore::TextureMapperLayer::paintSelf):
2374         (WebCore::TextureMapperLayer::paintSelfAndChildren):
2375         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
2376         (WebCore::TextureMapperLayer::replicaTransform):
2377         (WebCore::TextureMapperLayer::computeOverlapRegions):
2378         (WebCore::TextureMapperLayer::setPosition):
2379         (WebCore::TextureMapperLayer::setSize):
2380         (WebCore::TextureMapperLayer::setAnchorPoint):
2381         (WebCore::TextureMapperLayer::setPreserves3D):
2382         (WebCore::TextureMapperLayer::setTransform):
2383         (WebCore::TextureMapperLayer::setChildrenTransform):
2384         (WebCore::TextureMapperLayer::syncAnimations):
2385         (WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded):
2386         * platform/graphics/texmap/TextureMapperLayer.h:
2387
2388 2018-04-09  Brent Fulgham  <bfulgham@apple.com>
2389
2390         Add ProcessPrivilege assertions to places that access NSApp
2391         https://bugs.webkit.org/show_bug.cgi?id=184322
2392         <rdar://problem/39194560>
2393
2394         Reviewed by Per Arne Vollan.
2395
2396         Add ProcessPrivilege assertions to places where we interact with NSApp so
2397         that we can prevent accidentally using them in the WebContent process.
2398
2399         * page/mac/EventHandlerMac.mm:
2400         (WebCore::lastEventIsMouseUp):
2401         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
2402         * platform/mac/EventLoopMac.mm:
2403         (WebCore::EventLoop::cycle):
2404         * platform/mac/PasteboardMac.mm:
2405         (WebCore::Pasteboard::setDragImage):
2406
2407 2018-04-09  John Wilander  <wilander@apple.com>
2408
2409         Refactor Ignore HSTS code
2410         https://bugs.webkit.org/show_bug.cgi?id=184433
2411         <rdar://problem/39298238>
2412
2413         Reviewed by Darin Adler.
2414
2415         This patch refactors our ignore HSTS code. The convenience functions are moved
2416         out of CFNetwork SPI in PAL, and into where they are used. It also switches
2417         from performSelector: calls to straight function calls, after checking that
2418         there is a responder.
2419
2420         * platform/network/mac/WebCoreURLResponse.mm:
2421         (WebCore::schemeWasUpgradedDueToDynamicHSTS):
2422             Add convenience function here since it was moved out of
2423             CFNetworkSPI.h.
2424
2425 2018-04-09  Brady Eidson  <beidson@apple.com>
2426
2427         Expand WebCore policy concept of "shouldContinue" to allow for more than true/false
2428         https://bugs.webkit.org/show_bug.cgi?id=184424
2429
2430         Reviewed by Alex Christensen.
2431
2432         No new tests (No behavior change, refactor only)
2433
2434         Specifically this expands the "shouldContinue" bool to be an enum class with:
2435         -Yes
2436         -No
2437         -ForSuspension
2438
2439         * loader/DocumentLoader.cpp:
2440         (WebCore::DocumentLoader::willSendRequest):
2441         * loader/FrameLoader.cpp:
2442         (WebCore::FrameLoader::loadURL):
2443         (WebCore::FrameLoader::load):
2444         (WebCore::FrameLoader::loadWithDocumentLoader):
2445         (WebCore::FrameLoader::loadPostRequest):
2446         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2447         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2448         * loader/FrameLoader.h:
2449         * loader/PolicyChecker.cpp:
2450         (WebCore::PolicyChecker::checkNavigationPolicy):
2451         (WebCore::PolicyChecker::checkNewWindowPolicy):
2452         * loader/PolicyChecker.h:
2453
2454 2018-04-09  Sihui Liu  <sihui_liu@apple.com>
2455
2456         REGRESSION(r229929): localStorage is broken for WebInspector
2457         https://bugs.webkit.org/show_bug.cgi?id=184382
2458         <rdar://problem/39257355>
2459
2460         Reviewed by Chris Dumez.
2461
2462         Removed an if condition that caused false positive cases of database error. As per 
2463         https://www.sqlite.org/c3ref/errcode.html, return value of sqlite3_errcode() is undefined
2464         on successful API call, so we should not use the code to check if there is an error. We
2465         should only use it when there is an error.
2466         After moving this condition, LocalStorage might return empty string instead of NULL on
2467         sqlite3_column_blob() error.
2468
2469         Modified a test to cover this case: 
2470         TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm.
2471
2472         * platform/sql/SQLiteStatement.cpp:
2473         (WebCore::SQLiteStatement::getColumnBlobAsString):
2474
2475 2018-04-09  Brent Fulgham  <bfulgham@apple.com>
2476
2477         WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll is directly accessing NSScreen
2478         https://bugs.webkit.org/show_bug.cgi?id=184344
2479         <rdar://problem/39224969>
2480
2481         Reviewed by Per Arne Vollan.
2482
2483         The implementation of targetPositionInWindowForSelectionAutoscroll uses the display ID to get the
2484         screen boundaries of the current display. This causes a bunch of interaction with NSScreen that
2485         we do not want to allow in the WebContent process.
2486
2487         Instead, we should just use the cached screen information the WebContent process already possesses.
2488
2489         This patch makes the following changes:
2490         1. We now retrieve the screen rect of the page's display from the cache, rather than interacting with
2491            the WindowServer directly.
2492         2. Add a new 'toUserSpaceForPrimaryScreen' so we don't have to deal with a nil NSWindow when computing
2493            the user space version of the coordinates. A nil Window just means we want to get coordinates in
2494            terms of the primary display.
2495         3. Keep track of the primary display so we can refer to it later.
2496         4. Modify the IPC messages to include the primary display's ID so we can easily access it later.
2497         5. Modify the PlatformScreen methods to actually use the primary display when appropriate, rather
2498            than whichever screen happened to hash to the lowest value.
2499
2500         * page/mac/EventHandlerMac.mm:
2501         (WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const): Use new methods that
2502         don't require WindowServer access.
2503         * platform/PlatformScreen.h:
2504         * platform/mac/PlatformScreenMac.mm:
2505         (WebCore::displayID): Assert if we hit this code in the WebContent process.
2506         (WebCore::firstScreen): Ditto.
2507         (WebCore::window): Ditto.
2508         (WebCore::screen): Ditto.
2509         (WebCore::primaryScreenID): Added.
2510         (WebCore::getScreenProperties): Modify to return a pair consisting of the primary display ID and
2511         the HashSet of screen settings.
2512         (WebCore::setScreenProperties): Update to also track the primary display ID.
2513         (WebCore::screenProperties): Update to use the primary display ID.
2514         (WebCore::screenHasInvertedColors): Ditto.
2515         (WebCore::toUserSpaceForPrimaryScreen): Added.
2516
2517 2018-04-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
2518
2519         Make InlineTextBox::createTextRun() take a const lvalue reference String
2520         https://bugs.webkit.org/show_bug.cgi?id=184182
2521
2522         Reviewed by Zalan Bujtas.
2523
2524         InlineTextBox::createTextRun() takes a non-const lvalue reference String.
2525         It is tempting to change the signature of this method to take a const lvalue 
2526         reference. But this was done intentionally. TextRun is effectively a StringView:
2527         it does not own the passed string. Having the argument a non-const lvalue
2528         reference makes the compiler prevent calls like createTextRun("abc").
2529
2530         To have a better way to express the lifetime of TextRun, this patch does
2531         the following:
2532
2533         -- It makes TextRun::m_text of type String instead of StringView.
2534         -- It adds a new constructor which takes const String&. This constructor
2535            will addRef the underlying StringImpl when assigning it to m_text.
2536         -- It keeps the constructor which takes a StringView. The caller of this
2537            constructor still has to make sure the underlying String outlives the
2538            TextRun. To avoid copying the underlying buffer of the StringView, we
2539            will not use  StringView::toString(). Instead we will use
2540            StringView::toStringWithoutCopying() which makes the returned String 
2541            accesses the same buffer the StringView uses. In this case, the returned
2542            String is effectively a StringView.
2543
2544         * page/DebugPageOverlays.cpp:
2545         (WebCore::drawRightAlignedText):
2546         * platform/graphics/TextRun.cpp:
2547         * platform/graphics/TextRun.h:
2548         (WebCore::TextRun::TextRun):
2549         (WebCore::TextRun::subRun const):
2550         (WebCore::TextRun::length const):
2551         (WebCore::TextRun::setText):
2552         (WebCore::TextRun::string const): Deleted.
2553         * rendering/InlineTextBox.cpp:
2554         (WebCore::InlineTextBox::localSelectionRect const):
2555         (WebCore::InlineTextBox::paint):
2556         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
2557         (WebCore::InlineTextBox::paintMarkedTextBackground):
2558         (WebCore::InlineTextBox::paintMarkedTextForeground):
2559         (WebCore::InlineTextBox::paintMarkedTextDecoration):
2560         (WebCore::InlineTextBox::offsetForPosition const):
2561         (WebCore::InlineTextBox::positionForOffset const):
2562         (WebCore::InlineTextBox::createTextRun const):
2563         There is no need for this function to take a String argument anymore. The
2564         reason for passing the String was to guarantee its lifetime by keeping
2565         a copy of it in the caller side. Now there is no need for that. The TextRun
2566         itself will keep this copy.
2567
2568         * rendering/InlineTextBox.h:
2569         * rendering/RenderText.cpp:
2570         (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
2571         RenderText::text() returns StringImpl. The compiler wants us to be more
2572         explicit about which constructor of TextRun to call.
2573
2574         * rendering/SimpleLineLayout.cpp:
2575         (WebCore::SimpleLineLayout::canUseForFontAndText):
2576         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2577         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2578         RenderStyle::hyphenString() returns an AtomicString.
2579
2580 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2581
2582         Unreviewed, rolling out r230390.
2583
2584         Broke accelerated compositing
2585
2586         Reverted changeset:
2587
2588         "[GTK] WaylandCompositorDisplay leaks its wl_display"
2589         https://bugs.webkit.org/show_bug.cgi?id=184406
2590         https://trac.webkit.org/changeset/230390
2591
2592 2018-04-03  Sergio Villar Senin  <svillar@igalia.com>
2593
2594         [OpenVR][WebVR] Retrieve FrameData in WebVR's rAF
2595         https://bugs.webkit.org/show_bug.cgi?id=184265
2596
2597         Reviewed by Žan Doberšek.
2598
2599         VRFrameData contains all the required information to properly render a VR scene like view
2600         and projection matrices, pose data (position & orientation) and linear & angular velocity
2601         among others. The getFrameData() call must be issued inside a WebVR's own
2602         requestAnimationFrame.
2603
2604         * Modules/webvr/VRDisplay.cpp:
2605         (WebCore::VRDisplay::getFrameData const):
2606         (WebCore::VRDisplay::getPose const):
2607         (WebCore::VRDisplay::requestAnimationFrame):
2608         (WebCore::VRDisplay::cancelAnimationFrame):
2609         * Modules/webvr/VRDisplay.h:
2610         * Modules/webvr/VREyeParameters.h:
2611         (WebCore::VREyeParameters::rawOffset const): Required to compute view matrices.
2612         * Modules/webvr/VRFrameData.cpp:
2613         (WebCore::matrixToArray):
2614         (WebCore::VRFrameData::leftProjectionMatrix const):
2615         (WebCore::VRFrameData::leftViewMatrix const):
2616         (WebCore::VRFrameData::rightProjectionMatrix const):
2617         (WebCore::VRFrameData::rightViewMatrix const):
2618         (WebCore::projectionMatrixFromFieldOfView):
2619         (WebCore::rotationMatrixFromQuaternion):
2620         (WebCore::applyHeadToEyeTransform):
2621         (WebCore::VRFrameData::update):
2622         (WebCore::VRFrameData::timestamp const): Deleted.
2623         * Modules/webvr/VRFrameData.h:
2624         (WebCore::VRFrameData::timestamp const):
2625         * Modules/webvr/VRPose.cpp:
2626         (WebCore::optionalFloat3ToJSCArray):
2627         (WebCore::VRPose::position const):
2628         (WebCore::VRPose::linearVelocity const):
2629         (WebCore::VRPose::linearAcceleration const):
2630         (WebCore::VRPose::orientation const):
2631         (WebCore::VRPose::angularVelocity const):
2632         (WebCore::VRPose::angularAcceleration const):
2633         * Modules/webvr/VRPose.h:
2634         (WebCore::VRPose::create):
2635         (WebCore::VRPose::update):
2636         (WebCore::VRPose::VRPose):
2637         * platform/vr/VRPlatformDisplay.h:
2638         (WebCore::VRPlatformTrackingInfo::Quaternion::Quaternion):
2639         (WebCore::VRPlatformTrackingInfo::Quaternion::conjugate):
2640         (WebCore::VRPlatformTrackingInfo::Quaternion::operator*):
2641         (WebCore::VRPlatformTrackingInfo::Float3::Float3): Just a group of 3 floats used to store
2642         both velocity and acceleration in a format which is very convenient to later generate JSC
2643         arrays.
2644         (WebCore::VRPlatformTrackingInfo::clear):
2645         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
2646         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
2647         (WebCore::rotationMatrixToQuaternion):
2648         (WebCore::VRPlatformDisplayOpenVR::getTrackingInfo):
2649         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
2650
2651 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2652
2653         [GTK] WaylandCompositorDisplay leaks its wl_display
2654         https://bugs.webkit.org/show_bug.cgi?id=184406
2655
2656         Reviewed by Carlos Garcia Campos.
2657
2658         Remove the protected default constructor, for good measure.
2659
2660         * platform/graphics/wayland/PlatformDisplayWayland.h:
2661
2662 2018-04-08  Fujii Hironori  <Hironori.Fujii@sony.com>
2663
2664         [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
2665         https://bugs.webkit.org/show_bug.cgi?id=184127
2666
2667         Reviewed by Konstantin Tokarev.
2668
2669         No new tests (No behaviour changes).
2670
2671         * CMakeLists.txt: Added a interface library WebCoreHeaderInterface.
2672
2673 2018-04-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2674
2675         Use alignas instead of compiler-specific attributes
2676         https://bugs.webkit.org/show_bug.cgi?id=183508
2677
2678         Reviewed by Mark Lam.
2679
2680         Use alignas instead of aligned.
2681
2682         * platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
2683         * platform/graphics/cpu/arm/filters/FELightingNEON.h:
2684         (WebCore::FELighting::platformApplyNeon):
2685
2686 2018-04-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2687
2688         [WPE][GTK] Remove applicationDirectoryPath() and sharedResourcePath()
2689         https://bugs.webkit.org/show_bug.cgi?id=184381
2690
2691         Reviewed by Carlos Garcia Campos.
2692
2693         These are unused.
2694
2695         * platform/FileSystem.h:
2696         * platform/glib/FileSystemGlib.cpp:
2697         (WebCore::FileSystem::applicationDirectoryPath): Deleted.
2698         (WebCore::FileSystem::sharedResourcesPath): Deleted.
2699
2700 2018-04-07  Daniel Bates  <dabates@apple.com>
2701
2702         Have WorkerScriptLoader::loadAsynchronously() take a FetchOptions
2703         https://bugs.webkit.org/show_bug.cgi?id=184385
2704
2705         Reviewed by Youenn Fablet.
2706
2707         Currently we pass various FetchOptions to WorkerScriptLoader::loadAsynchronously()
2708         so that it can build up a ThreadableLoaderOptions structure to pass to the loader.
2709         Each time we want to set another FetchOptions option we need to add a new parameter.
2710         Instead we should have WorkerScriptLoader::loadAsynchronously() take a FetchOptions.
2711         This will make it straightforward for a caller to set new loader options as needed.
2712         In particular, this will make it straightforward to support setting the request's
2713         destination flag (i.e. FetchOptions::destination) to support blocking scripts with
2714         a non-JavaScript MIME type in a subsequent commit.
2715
2716         No functionality changed. So, no new tests.
2717
2718         * loader/ResourceLoaderOptions.h:
2719         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Modified to take a FetchOptions
2720         by value so as to support both move and copy semantics.
2721         * loader/ThreadableLoader.cpp:
2722         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):  Added helper constructor
2723         that takes a FetchOptions.
2724         * loader/ThreadableLoader.h:
2725         * workers/Worker.cpp:
2726         (WebCore::Worker::create): Instantiate and pass a FetchOptions to the loader for the mode,
2727         cache policy, and redirect policy.
2728         * workers/WorkerScriptLoader.cpp:
2729         (WebCore::WorkerScriptLoader::loadAsynchronously): Modified to take a FetchOptions and
2730         instantiate a ThreadableLoaderOptions from it.
2731         * workers/WorkerScriptLoader.h:
2732         * workers/WorkerScriptLoaderClient.h:
2733         (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const): Deleted. This function
2734         is no longer needed because the Service Worker client now passes the service worker mode
2735         directly to the loader.
2736         * workers/service/ServiceWorkerJob.cpp:
2737         (WebCore::ServiceWorkerJob::fetchScriptWithContext): Instantiate and pass a FetchOptions
2738         to the loader.
2739         * workers/service/ServiceWorkerJob.h:
2740
2741 2018-04-07  Timothy Hatcher  <timothy@apple.com>
2742
2743         Use the system's link color when system appearance is desired for a WebView.
2744
2745         https://bugs.webkit.org/show_bug.cgi?id=184353
2746         rdar://problem/9420053
2747
2748         Reviewed by Wenson Hsieh.
2749
2750         Have Document consult RenderTheme via StyleColor for the various link colors.
2751         This allows the system to have different colors than the standard hardcoded ones.
2752         This adds StyleColor::Options, to avoid multiple booleans being passed around,
2753         since the "for visited link" state is now needed in RenderTheme.
2754
2755         * WebCore.xcodeproj/project.pbxproj: Made StyleColor.h private, since RenderTheme.h includes it.
2756         * css/StyleColor.cpp:
2757         (WebCore::StyleColor::colorFromKeyword): Use options instead of a bool.
2758         (WebCore::StyleColor::isSystemColor): Consider CSSValueWebkitLink the start of system colors.
2759         * css/StyleColor.h:
2760         * css/StyleResolver.cpp:
2761         (WebCore::StyleResolver::colorFromPrimitiveValue const): Use StyleColor::Options.
2762         * css/parser/CSSParser.cpp:
2763         (WebCore::CSSParser::parseSystemColor): Use StyleColor::Options.
2764         * dom/Document.cpp:
2765         (WebCore::Document::resetLinkColor): Ask StyleColor for the link color instead of hardcoding it.
2766         (WebCore::Document::resetVisitedLinkColor): Ditto.
2767         (WebCore::Document::resetActiveLinkColor): Ditto.
2768         (WebCore::Document::styleColorOptions const): Added. Helper to get the options used.
2769         * dom/Document.h:
2770         * html/canvas/CanvasRenderingContext2D.cpp:
2771         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Use StyleColor::Options.
2772         * rendering/RenderTheme.cpp:
2773         (WebCore::RenderTheme::systemColor const): Add default values here, moved from Document.
2774         (WebCore::RenderTheme::focusRingColor): Use StyleColor::Options.
2775         * rendering/RenderTheme.h:
2776         (WebCore::RenderTheme::platformFocusRingColor const): Use StyleColor::Options.
2777         * rendering/RenderThemeGtk.cpp:
2778         (WebCore::RenderThemeGtk::systemColor const): Use StyleColor::Options.
2779         * rendering/RenderThemeGtk.h:
2780         * rendering/RenderThemeIOS.h:
2781         * rendering/RenderThemeIOS.mm:
2782         (WebCore::RenderThemeIOS::systemColor const): Use StyleColor::Options.
2783         * rendering/RenderThemeMac.h:
2784         * rendering/RenderThemeMac.mm:
2785         (WebCore::RenderThemeMac::platformFocusRingColor const): Use StyleColor::Options.
2786         (WebCore::RenderThemeMac::platformColorsDidChange): Clear m_systemVisitedLinkColor.
2787         (WebCore::RenderThemeMac::systemColor const): Use StyleColor::Options.
2788         (WebCore::RenderThemeMac::adjustMenuListStyle const): Ditto.
2789         * rendering/RenderThemeWin.cpp:
2790         (WebCore::RenderThemeWin::systemColor const): Use StyleColor::Options.
2791         * rendering/RenderThemeWin.h:
2792         * rendering/TextPaintStyle.cpp:
2793         (WebCore::computeTextPaintStyle): Use StyleColor::Options.
2794
2795 2018-04-06  Youenn Fablet  <youenn@apple.com>
2796
2797         Response headers should be filtered when sent from NetworkProcess to WebProcess
2798         https://bugs.webkit.org/show_bug.cgi?id=184310
2799
2800         Reviewed by Ryosuke Niwa.
2801
2802         Did some refactoring to allow ResourceResponse to use header value parsing routines.
2803         We add sanitization levels for regular responses in case responses might be exposed to scripts or not.
2804         If not exposed to scripts, additional filtering is done.
2805
2806         Add internal API to get unfiltered response headers from a fetch response.
2807         Test: http/wpt/service-workers/header-filtering.https.html
2808
2809         * Modules/fetch/FetchResponse.h:
2810         * loader/CrossOriginPreflightResultCache.cpp:
2811         (WebCore::CrossOriginPreflightResultCacheItem::parse):
2812         * platform/network/HTTPParsers.h:
2813         (WebCore::addToAccessControlAllowList):
2814         (WebCore::parseAccessControlAllowList):
2815         * platform/network/ResourceResponseBase.cpp:
2816         (WebCore::isSafeToKeepRedirectionResponseHeader):
2817         (WebCore::isCrossOriginSafeToKeepResponseHeader):
2818         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
2819         * platform/network/ResourceResponseBase.h:
2820         * testing/ServiceWorkerInternals.cpp:
2821         (WebCore::ServiceWorkerInternals::fetchResponseHeaderList):
2822         * testing/ServiceWorkerInternals.h:
2823         * testing/ServiceWorkerInternals.idl:
2824
2825 2018-04-06  Michael Catanzaro  <mcatanzaro@igalia.com>
2826
2827         Unreviewed, fix unused parameter warning when credential storage is disabled
2828
2829         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2830         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2831
2832 2018-04-06  Eric Carlson  <eric.carlson@apple.com>
2833
2834         [Extra zoom mode] Block playback until fullscreen begins
2835         https://bugs.webkit.org/show_bug.cgi?id=184371
2836         <rdar://problem/39250891>
2837
2838         Reviewed by Youenn Fablet.
2839
2840         * html/HTMLMediaElement.cpp:
2841         (WebCore::HTMLMediaElement::updatePlayState): Return early when waiting to enter fullscreen.
2842         (WebCore::HTMLMediaElement::enterFullscreen): Set m_waitingToEnterFullscreen.
2843         (WebCore::HTMLMediaElement::exitFullscreen): Clear m_waitingToEnterFullscreen.
2844         (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto.
2845         * html/HTMLMediaElement.h:
2846
2847 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
2848
2849         WebCore::screenSupportsExtendedColor improperly calls NSScreen functions in the WebContent process
2850         https://bugs.webkit.org/show_bug.cgi?id=184364
2851         <rdar://problem/39246314>
2852
2853         Reviewed by Per Arne Vollan.
2854
2855         The WebContent process is interacting directly with NSScreen to determine if the current screen
2856         has extended color support. This should be brokered from the UIProcess.
2857         
2858         Tested by fast/media/mq-color-gamut.html.
2859
2860         * platform/ScreenProperties.h:
2861         (WebCore::ScreenProperties::encode const): Add screenSupportsExtendedColor.
2862         (WebCore::ScreenProperties::decode): Ditto.
2863         * platform/mac/PlatformScreenMac.mm:
2864         (WebCore::getScreenProperties): Retrieve extended color support.
2865         (WebCore::screenSupportsExtendedColor): Retrieve cached version when in the WebContent
2866         process. Assert that NSScreen is not accessed in the WebContent process.
2867
2868 2018-04-06  Fujii Hironori  <Hironori.Fujii@sony.com>
2869
2870         [Win][WebCore] Expose a constant for scrollbar pixels per line (cScrollbarPixelsPerLine)
2871         https://bugs.webkit.org/show_bug.cgi?id=184296
2872
2873         Reviewed by Alex Christensen.
2874
2875         No new tests (No behavior changes).
2876
2877         * platform/PlatformWheelEvent.h: Placed cScrollbarPixelsPerLine definition.
2878         * platform/win/WheelEventWin.cpp:
2879         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Removed cScrollbarPixelsPerLine definition.
2880
2881 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
2882
2883         Unreviewed test fix after r230323
2884
2885         * platform/mac/PlatformScreenMac.mm:
2886         (WebCore::screenSupportsExtendedColor): Remove assertion hit during test runs.
2887
2888 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
2889
2890         WebCore::screenColorSpace is retrieving CGColorSpace from NSScreen directly
2891         https://bugs.webkit.org/show_bug.cgi?id=184343
2892         <rdar://problem/39224881>
2893
2894         Reviewed by Per Arne Vollan.
2895
2896         Revise ScreenProperties to serialize the screen's color space, and later
2897         retrieve that in the WebContent process. This allows us to close off
2898         the CGSWindowServer connection.
2899
2900         * platform/ScreenProperties.h:
2901         (WebCore::ScreenProperties::encode const): Add CGColorSpaceRef support.
2902         (WebCore::ScreenProperties::decode): Ditto.
2903         * platform/mac/PlatformScreenMac.mm:
2904         (WebCore::displayID): Add assertion to prevent use in WebContent process.
2905         (WebCore::firstScreen): Ditto.
2906         (WebCore::getScreenProperties): Add support for CGColorSpaceRef.
2907         (WebCore::screenColorSpace): Retrieve cached version when in WebContent process.
2908         Assert that NSScreen is not accessed in WebContent process.
2909
2910 2018-04-06  Ms2ger  <Ms2ger@igalia.com>
2911
2912         Implement createImageBitmap(Blob)
2913         https://bugs.webkit.org/show_bug.cgi?id=183247
2914
2915         Reviewed by Dean Jackson.
2916
2917         Tests:
2918             - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
2919             - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
2920
2921         * fileapi/FileReaderLoader.h:
2922         (WebCore::FileReaderLoader::url): expose the Blob's URL.
2923         * html/ImageBitmap.cpp: implement createImageBitmap(Blob).
2924         * html/ImageBitmap.h: allow the BlobImageObserver class access to the creation function.
2925         * loader/cache/CachedImage.cpp: reuse extracted code.
2926         (WebCore::CachedImage::isPDFResource const):
2927         (WebCore::CachedImage::isPostScriptResource const):
2928         (WebCore::CachedImage::createImage):
2929         * platform/graphics/Image.cpp: extract some code from CachedImage to reuse.
2930         (WebCore::Image::create):
2931         (WebCore::Image::isPDFResource):
2932         (WebCore::Image::isPostScriptResource):
2933         * platform/graphics/Image.h: add declarations.
2934
2935 2018-04-06  Zalan Bujtas  <zalan@apple.com>
2936
2937         Flex child does not get repainted when it is inserted back to the render tree.
2938         https://bugs.webkit.org/show_bug.cgi?id=184361
2939         <rdar://problem/34528716>
2940
2941         Reviewed by Antti Koivisto.
2942
2943         As with any regular block children, we should issue full repaint for flexbox items on their
2944         first layout (see RenderBlockFlow::layoutBlockChild()).
2945
2946         Test: fast/flexbox/missing-repaint-when-flext-item-never-had-layout.html
2947
2948         * rendering/RenderFlexibleBox.cpp:
2949         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
2950
2951 2018-04-06  Ms2ger  <Ms2ger@igalia.com>
2952
2953         Support transferring ImageBitmap objects
2954         https://bugs.webkit.org/show_bug.cgi?id=183131
2955
2956         Reviewed by Dean Jackson.
2957
2958         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html
2959
2960         * bindings/js/SerializedScriptValue.cpp:
2961         (WebCore::CloneSerializer::serialize): thread through ImageBitmaps.
2962         (WebCore::CloneSerializer::CloneSerializer): thread through ImageBitmaps.
2963         (WebCore::CloneSerializer::fillTransferMap): don't require a mutable reference.
2964         (WebCore::CloneSerializer::dumpImageBitmap): add.
2965         (WebCore::CloneSerializer::dumpIfTerminal): check for ImageBitmap.
2966         (WebCore::CloneDeserializer::deserialize): thread through ImageBitmaps.
2967         (WebCore::CloneDeserializer::CloneDeserializer): thread through ImageBitmaps.
2968         (WebCore::CloneDeserializer::readImageBitmap): add.
2969         (WebCore::CloneDeserializer::readTerminal): check for ImageBitmap.
2970         (WebCore::SerializedScriptValue::SerializedScriptValue): thread through ImageBitmaps.
2971         (WebCore::SerializedScriptValue::create): thread through ImageBitmaps.
2972         (WebCore::containsDuplicates): add.
2973         (WebCore::SerializedScriptValue::deserialize): handle ImageBitmap arguments.
2974         * bindings/js/SerializedScriptValue.h: update signatures, add member.
2975         * html/ImageBitmap.cpp:
2976         (WebCore::ImageBitmap::create): add.
2977         (WebCore::ImageBitmap::detachBitmaps): add.
2978         * html/ImageBitmap.h: add signatures.
2979
2980 2018-04-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2981
2982         When recording the drawing, the DisplayList should be initialized with the GraphicsContextState of the underlying GraphicsContext
2983         https://bugs.webkit.org/show_bug.cgi?id=184336
2984
2985         Reviewed by Antti Koivisto.
2986
2987         The state of the drawing context has to be transfered to the recording 
2988         DisplayList before recording. Many recording GraphicsContext functions 
2989         will behave wrongly if it gets the default state.
2990
2991         * html/canvas/CanvasRenderingContext2DBase.cpp:
2992         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
2993         (WebCore::CanvasRenderingContext2DBase::drawingContext const):
2994         * platform/graphics/ca/GraphicsLayerCA.cpp:
2995         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2996         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2997         (WebCore::DisplayList::Recorder::Recorder):
2998         * platform/graphics/displaylists/DisplayListRecorder.h:
2999         (WebCore::DisplayList::Recorder::ContextState::ContextState):
3000         (WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
3001         * platform/graphics/displaylists/DisplayListReplayer.cpp:
3002         (WebCore::DisplayList::Replayer::replay):
3003         * platform/graphics/displaylists/DisplayListReplayer.h:
3004         (WebCore::DisplayList::Replayer::replay): If we do not have a clipping
3005         rectangle and we want to record all the drawing, we need a default value
3006         for the clipping rectangle and we want no clipping to happen.
3007
3008 2018-04-06  Daniel Bates  <dabates@apple.com>
3009
3010         Emit a more informative message when a script is blocked due to "X-Content-Type: nosniff"
3011         https://bugs.webkit.org/show_bug.cgi?id=184359
3012
3013         Reviewed by Per Arne Vollan.
3014
3015         Emphasize in the message that the script was blocked from executing.
3016
3017         Test: http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html
3018
3019         * dom/LoadableClassicScript.cpp:
3020         (WebCore::LoadableClassicScript::notifyFinished):
3021         * workers/WorkerScriptLoader.cpp:
3022         (WebCore::WorkerScriptLoader::didReceiveResponse):
3023
3024 2018-04-06  Daniel Bates  <dabates@apple.com>
3025
3026         importScripts() should throw exception with a reason when it fails to load a script from the network
3027         https://bugs.webkit.org/show_bug.cgi?id=184345
3028
3029         Reviewed by Alexey Proskuryakov.
3030
3031         Currently importScripts() throws a NetworkError exception without a reason when
3032         it fails to load a script from the network. It is ambiguous whether the load failed
3033         due to an access control failure or some other error. Instead we should include
3034         the reason the load failed in the thrown exception.
3035
3036         * workers/WorkerGlobalScope.cpp:
3037         (WebCore::WorkerGlobalScope::importScripts):
3038
3039 2018-04-06  Daniel Bates  <dabates@apple.com>
3040
3041         Attempt to fix the build after <https://trac.webkit.org/changeset/230338>
3042         (https://bugs.webkit.org/show_bug.cgi?id=184360)
3043
3044         Make lambdas mutable so that we can WTFMove() their captured arguments.
3045
3046         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3047         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
3048         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
3049         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
3050
3051 2018-04-06  Daniel Bates  <dabates@apple.com>
3052
3053         Have class Exception take String by value instead of a String&&
3054         https://bugs.webkit.org/show_bug.cgi?id=184360
3055
3056         Reviewed by Alexey Proskuryakov.
3057
3058         For convenience support instantiating an Exception with either an lvalue String or
3059         rvalue String.
3060
3061         Although it can be argued that having Exception take a String by value instead of String&&
3062         can lead to missed opportunities to WTFMove() a String object into Exception such mistakes
3063         are just that, missed opportunities. That is, correctness is not affected and we may perform
3064         an unnecessary ref/deref of the underlying StringImpl when instantiating an Exception. If
3065         such missed opportunities show up in profiles and such mistakes happen often then we can
3066         re-evaluate the decision to have Exception take a String by value.
3067
3068         * Modules/cache/DOMCache.cpp:
3069         (WebCore::DOMCache::put): Simplify code now that Exception takes a String by value.
3070         * Modules/fetch/FetchResponse.cpp:
3071         (WebCore::FetchResponse::BodyLoader::didFail): Ditto.
3072         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3073         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed): Move String into Exception to avoid an
3074         unnecessary ref/de-ref.
3075         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed): Ditto.
3076         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed): Ditto.
3077         * dom/Exception.h:
3078         (WebCore::Exception::Exception): Take String by value. Also use uniform initializer syntax.
3079
3080 2018-04-06  Antti Koivisto  <antti@apple.com>
3081
3082         Tighten ImageSource to have BitmapImage pointer instead of Image
3083         https://bugs.webkit.org/show_bug.cgi?id=184356
3084
3085         Reviewed by Said Abou-Hallawa.
3086
3087         ImageSource is an implementation detail of BitmapImage, not a generic type.
3088
3089         * loader/ImageLoader.cpp:
3090         (WebCore::ImageLoader::decode):
3091         * platform/graphics/BitmapImage.h:
3092         * platform/graphics/Image.h:
3093         (WebCore::Image::decode): Deleted.
3094         (WebCore::Image::imageFrameAvailableAtIndex): Deleted.
3095
3096         Also make some BitmapImage specific functions non-virtual and remove them from Image.
3097
3098         * platform/graphics/ImageSource.cpp:
3099         (WebCore::ImageSource::ImageSource):
3100         * platform/graphics/ImageSource.h:
3101         (WebCore::ImageSource::create):
3102
3103         Make constructors private.
3104
3105         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3106         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3107
3108 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
3109
3110         Unreviewed test fix after r230323
3111
3112         * platform/mac/PlatformScreenMac.mm:
3113         (WebCore::screen): Remove assertion we still hit due to event handling code.
3114
3115 2018-04-05  Youenn Fablet  <youenn@apple.com>
3116
3117         REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
3118         https://bugs.webkit.org/show_bug.cgi?id=184306
3119
3120         Reviewed by Ryosuke Niwa.
3121
3122         Add an option to not compile CSS rules since they are not useful in NetworkProcess.
3123         Covered by tests no longer crashing in Debug WK2 bots.
3124
3125         * contentextensions/ContentExtension.cpp:
3126         (WebCore::ContentExtensions::ContentExtension::create):
3127         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
3128         * contentextensions/ContentExtension.h:
3129         * contentextensions/ContentExtensionsBackend.cpp:
3130         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
3131         * contentextensions/ContentExtensionsBackend.h:
3132
3133 2018-04-05  Brent Fulgham  <bfulgham@apple.com>
3134
3135         WebContent process is calling CGDisplayUsesInvertedPolarity
3136         https://bugs.webkit.org/show_bug.cgi?id=184337
3137         <rdar://problem/39215702>
3138
3139         Reviewed by Zalan Bujtas.
3140
3141         The PlatformScreenMac code is still calling display-related routines directly, specifically
3142         CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray. These should be brokered from
3143         the UIProcess.
3144         
3145         There's also no reason to avoid the brokering behavior on current WebKit builds. Remove
3146         the compile guards so all macOS builds use this behavior.
3147         
3148         Finally, add some ProcessPrivilege assertions to guard against accidentally calling these
3149         routines in the future.
3150
3151         Tested by existing regression tests.
3152
3153         * platform/PlatformScreen.h:
3154         * platform/ScreenProperties.h:
3155         (WebCore::ScreenProperties::encode const): Add new values.
3156         (WebCore::ScreenProperties::decode):
3157         * platform/mac/PlatformScreenMac.mm:
3158         (WebCore::displayID): Add assertion that this is not calling display-related routines in
3159         the WebContent process.
3160         (WebCore::firstScreen): Ditto.
3161         (WebCore::screenProperties): Moved higher in the file so it can be reused. Add calls to
3162         CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray.
3163         (WebCore::getScreenProperties): Moved higher in the file so it can be reused. Stop
3164         double-hashing displayID.
3165         (WebCore::screenIsMonochrome): Use cached values in WebContent process. Assert if this
3166         code attempts a display-related routine in the WebContent process.
3167         (WebCore::screenHasInvertedColors): Ditto.
3168         (WebCore::screenDepth): Add assertion that this is not calling display-related routines in
3169         the WebContent process.
3170         (WebCore::screenDepthPerComponent): Ditto.
3171         (WebCore::screenRect): Ditto.
3172         (WebCore::screenAvailableRect): Ditto.
3173         (WebCore::screen): Ditto.
3174         (WebCore::screenColorSpace): Ditto.
3175         (WebCore::screenSupportsExtendedColor): Ditto.
3176
3177 2018-04-05  John Wilander  <wilander@apple.com>
3178
3179         Resource Load Statistics: Apply cookie blocking to setCookiesFromDOM()
3180         https://bugs.webkit.org/show_bug.cgi?id=184346
3181         <rdar://problem/39226036>
3182
3183         Reviewed by Brent Fulgham.
3184
3185         Since these cookies can't be seen and are not sent in requests, I
3186         can't write an automated test for them. This really should have been
3187         done as part of: https://bugs.webkit.org/show_bug.cgi?id=180682.
3188         That said, I have tested this manually.
3189
3190         * platform/network/mac/CookieJarMac.mm:
3191         (WebCore::setCookiesFromDOM):
3192
3193 2018-04-05  Zalan Bujtas  <zalan@apple.com>
3194
3195         Folding anonymous blocks should not result in deleting content.
3196         https://bugs.webkit.org/show_bug.cgi?id=184339
3197         <rdar://problem/37327428>
3198
3199         Reviewed by Antti Koivisto.
3200
3201         While folding multiple anonymous blocks (moving the children from next sibling over to previous sibling)
3202         we should ensure that the block we are about to destroy does not gain new descendants.
3203         In case of 4 sibling anonymous blocks (A B C D), while destroying B
3204         1. we move C's children to A and destroy C.
3205         2. While destroying C, we notice B and C as sibling anonymous blocks and we move
3206         D's children over to B (even though B is going to be destroyed as we climb back on the stack).
3207         
3208         In this patch, B is detached from the tree before we start moving renderers around so that a subsequent folding won't
3209         find B anymore as a candidate.
3210
3211         Test: fast/block/crash-while-folding-anonymous-blocks.html
3212
3213         * rendering/updating/RenderTreeBuilderBlock.cpp:
3214         (WebCore::RenderTreeBuilder::Block::detach):
3215
3216 2018-04-05  Andy Estes  <aestes@apple.com>
3217
3218         Mark Payment Request as "Supported" in features.json
3219         https://bugs.webkit.org/show_bug.cgi?id=184338
3220
3221         Reviewed by Anders Carlsson.
3222
3223         * features.json:
3224
3225 2018-04-05  Chris Dumez  <cdumez@apple.com>
3226
3227         Unreviewed, rolling out r230042.
3228
3229         It is no longer needed now that it is safe to construct a
3230         SecurityOrigin from an on-main thread
3231
3232         Reverted changeset:
3233
3234         "WebSocket::didReceiveMessage() may construct a SecurityOrigin
3235         object on a non-main thread"
3236         https://bugs.webkit.org/show_bug.cgi?id=184068
3237         https://trac.webkit.org/changeset/230042
3238
3239 2018-04-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3240
3241         [WTF] Remove StaticLock
3242         https://bugs.webkit.org/show_bug.cgi?id=184332
3243
3244         Reviewed by Mark Lam.
3245
3246         No behavior change.
3247
3248         * Modules/webdatabase/Database.cpp:
3249         (WebCore::Database::Database):
3250         (WebCore::Database::performOpenAndVerify):
3251         (WebCore::Database::closeDatabase):
3252         (WebCore::Database::getCachedVersion const):
3253         (WebCore::Database::setCachedVersion):
3254         * Modules/webdatabase/DatabaseTracker.cpp:
3255         (WebCore::DatabaseTracker::openDatabaseMutex):
3256         * Modules/webdatabase/DatabaseTracker.h:
3257         * Modules/websockets/WebSocket.cpp:
3258         (WebCore::WebSocket::allActiveWebSocketsMutex):
3259         * Modules/websockets/WebSocket.h:
3260         * bridge/objc/WebScriptObject.mm:
3261         * crypto/CryptoAlgorithmRegistry.cpp:
3262         (WebCore::CryptoAlgorithmRegistry::identifier):
3263         (WebCore::CryptoAlgorithmRegistry::name):
3264         (WebCore::CryptoAlgorithmRegistry::create):
3265         (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
3266         * dom/Node.cpp:
3267         * platform/URL.cpp:
3268         * platform/graphics/FontCache.cpp:
3269         * platform/graphics/MediaPlayer.cpp:
3270         * platform/ios/QuickLook.mm:
3271         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
3272         * platform/ios/wak/WebCoreThread.mm:
3273         * platform/ios/wak/WebCoreThreadRun.cpp:
3274         * platform/network/cf/LoaderRunLoopCF.cpp:
3275         (WebCore::loaderRunLoop):
3276         * platform/network/curl/CurlContext.cpp:
3277         (WebCore::CurlShareHandle::mutexFor):
3278         * platform/network/curl/CurlContext.h:
3279         * platform/sql/SQLiteDatabaseTracker.cpp:
3280         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
3281         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
3282         * platform/text/TextEncodingRegistry.cpp:
3283         (WebCore::buildBaseTextCodecMaps):
3284         (WebCore::newTextCodec):
3285         (WebCore::atomicCanonicalTextEncodingName):
3286         * workers/WorkerThread.cpp:
3287         (WebCore::WorkerThread::workerThreadCount):
3288         (WebCore::WorkerThread::WorkerThread):
3289         (WebCore::WorkerThread::~WorkerThread):
3290         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
3291
3292 2018-04-04  Youenn Fablet  <youenn@apple.com>
3293
3294         WebRTC data channel only applications require capture permissions for direct connections
3295         https://bugs.webkit.org/show_bug.cgi?id=174500
3296         <rdar://problem/34134281>
3297
3298         Reviewed by Eric Carlson.
3299
3300         Test: webrtc/datachannel/mdns-ice-candidates.html
3301
3302         Add support at PeerConnectionBackend to obfuscate any gathered host candidate
3303         by replacing the IP address with an opaque name that can be resolved by MDNS.
3304         An opaque name is generated for each IP address and is scoped by the document owning the peer connection object.
3305
3306         Add support to resolve any such MDNS ICE candidate.
3307         A limit of 250 ms is fixed for the resolution to happen.
3308         After 250 ms, the candidate is discarded.
3309
3310         Add an experimental flag around this feature, off by default.
3311
3312         * Modules/mediastream/PeerConnectionBackend.cpp:
3313         (WebCore::extractIPAddres):
3314         (WebCore::PeerConnectionBackend::addIceCandidate):
3315         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
3316         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
3317         (WebCore::PeerConnectionBackend::newICECandidate):
3318         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
3319         (WebCore::PeerConnectionBackend::registerMDNSName):
3320         (WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
3321         * Modules/mediastream/PeerConnectionBackend.h:
3322         * Modules/mediastream/RTCIceCandidate.h:
3323         (WebCore::RTCIceCandidate::setCandidate):
3324         * Modules/mediastream/RTCPeerConnection.h:
3325         * dom/Document.cpp:
3326         (WebCore::Document::prepareForDestruction):
3327         (WebCore::Document::suspend):
3328         * page/RuntimeEnabledFeatures.h:
3329         (WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const):
3330         (WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled):
3331         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3332
3333 2018-04-04  Brian Burg  <bburg@apple.com>
3334
3335         [Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_non_session_cookie fails
3336         https://bugs.webkit.org/show_bug.cgi?id=184314
3337         <rdar://problem/39186578>
3338
3339         Reviewed by Timothy Hatcher.
3340
3341         Covered by several tests in add_cookie.py per the bug title.
3342
3343         * platform/network/cocoa/CookieCocoa.mm:
3344         (WebCore::Cookie::operator NSHTTPCookie * const):
3345         By converting an integral UNIX timestamp to |maxAge| fractional seconds into the future, we introduce unwanted
3346         precision that is truncated when switching back to a UNIX timestamp later. Always round up maxAge so that
3347         the truncated value and actual value are the same.
3348
3349 2018-04-04  Alex Christensen  <achristensen@webkit.org>
3350
3351         Move PingHandle to WebKitLegacy
3352         https://bugs.webkit.org/show_bug.cgi?id=184145
3353
3354         Reviewed by Youenn Fablet.
3355
3356         * WebCore.xcodeproj/project.pbxproj:
3357         * platform/network/PingHandle.h: Removed.
3358
3359 2018-04-04  Per Arne Vollan  <pvollan@apple.com>
3360
3361         The layout test fast/canvas/canvas-blending-global-alpha.html is failing when the WebContent process does not have WindowServer access.
3362         https://bugs.webkit.org/show_bug.cgi?id=183752
3363         <rdar://problem/38635731>
3364
3365         The test is failing because the system is only providing software rendering when there is no access
3366         to the WindowServer, and software rendering is producing slightly different results than hardware
3367         rendering. To enable accelerated rendering, the GPU to be used for IOSurface rendering needs to be
3368         selected by handing over the OpenGL display mask to the IOSurface CGContext.
3369
3370         Reviewed by Brent Fulgham.
3371
3372         No new tests, covered by existing tests.
3373
3374         * platform/graphics/GraphicsContext3D.h:
3375         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3376         (WebCore::GraphicsContext3D::getOpenGLDisplayMask):
3377         * platform/graphics/cocoa/IOSurface.mm:
3378         (WebCore::IOSurface::ensurePlatformContext):
3379
3380 2018-04-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
3381
3382         Track the paint frequency through a new class named PaintFrequencyTracker
3383         https://bugs.webkit.org/show_bug.cgi?id=184311
3384
3385         Reviewed by Antti Koivisto.
3386
3387         PaintFrequencyTracker is a class which detects when a layer is painted 
3388         frequently. SinglePaintFrequencyTracking is used in conjunction with
3389         PaintFrequencyTracker to recored a single paint timing.
3390
3391         * rendering/PaintFrequencyTracker.h: Added.
3392         (WebCore::PaintFrequencyTracker::begin):
3393         (WebCore::PaintFrequencyTracker::end):
3394         (WebCore::PaintFrequencyTracker::paintingFrequently const):
3395         Simplify the logic for tracking the paint frequency and move it from
3396         RenderLayer.cpp.
3397
3398         (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking):
3399         (WebCore::SinglePaintFrequencyTracking::~SinglePaintFrequencyTracking):
3400         A convenient way to bracket the begin() and the end() methods of
3401         PaintFrequencyTracker.
3402
3403         * rendering/RenderLayer.cpp:
3404         (WebCore::RenderLayer::paintLayerContents):
3405         (WebCore::RenderLayer::calculateClipRects const):
3406         (WebCore::PaintFrequencyInfo::PaintFrequencyInfo): Deleted.
3407         (WebCore::PaintFrequencyInfo::setPaintedCacheableResource): Deleted.
3408         (WebCore::PaintFrequencyInfo::paintingFrequently const): Deleted.
3409         (WebCore::PaintFrequencyInfo::updatePaintFrequency): Deleted.
3410         (WebCore::PaintFrequencyInfo::paintingCacheableResource): Deleted.
3411         * rendering/RenderLayer.h:
3412         Rename PaintFrequencyInfo to PaintFrequencyTracker and move it a separate
3413         header file.
3414
3415 2018-04-04  Jer Noble  <jer.noble@apple.com>
3416
3417         RELEASE_ASSERT in CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF() when MediaToolbox.framework missing
3418         https://bugs.webkit.org/show_bug.cgi?id=184247
3419         <rdar://problem/39007591>
3420
3421         Rubber-stamped by Eric Carlson.
3422
3423         Use SOFT_LINK_FRAMEWORK_OPTIONAL for frameworks which are not guaranteed to be present.
3424
3425         * page/CaptionUserPreferencesMediaAF.cpp:
3426         (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF):
3427
3428 2018-04-04  Brent Fulgham  <bfulgham@apple.com>
3429
3430         Failures from mach port reference handling should be fatal
3431         https://bugs.webkit.org/show_bug.cgi?id=184202
3432         <rdar://problem/37771114>
3433
3434         Reviewed by Anders Carlsson.
3435
3436         We may corrupt the Mach port space by improperly matching the equivalent of reference counting
3437         retains (mach_port_mod_refs) with releases (mach_port_deallocate).
3438
3439         Our current implementation of MachSendRights::create does not grab a reference if the passed
3440         port is MACH_PORT_DEAD, but we unconditionally call mach_port_deallocate on the port, which
3441         could lead to a reference count mismatch.
3442
3443         Likewise, our MachSendRight destructor does not release the port if it has changed to MACH_PORT_DEAD
3444         (e.g., if a child process dies), again leading to a mismatch in retain/releases.
3445
3446         Finally, failures in mach_port_deallocate should be fatal because they indicate that the
3447         application was attempting to remove an unowned right. This is a fatal condition for Mach, and
3448         should lead to an abort. 
3449
3450         This patch does the following:
3451
3452         1. It creates a helper function that does the right thing for safely deallocating a mach port.
3453         2. It uses it in multiple places.
3454         3. It revises 'MachSendRight::create" so that it properly handles the condition of a dead port.
3455         4. It revises the MachSendRight destructor to properly handle the condition of a dead port.
3456
3457         No new tests, no change in behavior expected.
3458
3459         * SourcesCocoa.txt: Update for move of MachSendRight files.
3460         * WebCore.xcodeproj/project.pbxproj: Ditto.
3461         * page/cocoa/ResourceUsageThreadCocoa.mm:
3462         (WebCore::getMachThreads): Added.
3463         (WebCore::cpuUsage): Use the new cleanup helper function.
3464         * platform/cocoa/MachSendRight.cpp: Removed.
3465         * platform/cocoa/MachSendRight.h: Removed.
3466         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
3467         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
3468         * platform/graphics/cocoa/IOSurface.h:
3469         * platform/graphics/cocoa/IOSurface.mm:
3470
3471 2018-04-04  Youenn Fablet  <youenn@apple.com>
3472
3473         Remove unused HTTP header names
3474         https://bugs.webkit.org/show_bug.cgi?id=184272
3475
3476         Reviewed by Alex Christensen.
3477
3478         No change of behavior.
3479         Removed some names that are not used in the code base.
3480         This allows to strengthen filtering of responses sent to WebProcess.
3481         Added two headers used by web inspector.
3482         Updated existing code to use indexed HTTP header names.
3483
3484         * html/parser/XSSAuditor.cpp:
3485         (WebCore::XSSAuditor::init):
3486         * inspector/agents/InspectorPageAgent.cpp:
3487         (WebCore::InspectorPageAgent::sourceMapURLForResource):
3488         * platform/network/HTTPHeaderNames.in:
3489
3490 2018-04-04  Beth Dakin  <bdakin@apple.com>
3491
3492         Fix the !HAVE(AVFOUNDATION_VIDEO_OUTPUT) build
3493         https://bugs.webkit.org/show_bug.cgi?id=184309
3494         -and corresponding-
3495         rdar://problem/39179126
3496
3497         Reviewed by Jer Noble.
3498
3499         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3500         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
3501         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
3502
3503 2018-04-04  Youenn Fablet  <youenn@apple.com>
3504
3505         MockRealtimeVideoSourceMac should produce kCVPixelFormatType_420YpCbCr8Planar buffers
3506         https://bugs.webkit.org/show_bug.cgi?id=184304
3507
3508         Reviewed by Eric Carlson.
3509
3510         Allows covering RealtimeOutgoingVideoSourceMac code path handling native buffers produced by capture video sources.
3511         ARGB buffer coverage is done through canvas capture streams.
3512
3513         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
3514         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3515         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
3516
3517 2018-04-04  Youenn Fablet  <youenn@apple.com>
3518
3519         Introduce a ThreadSafeRefCounted parameter to ensure being destroyed on the main thread
3520         https://bugs.webkit.org/show_bug.cgi?id=183988
3521
3522         Reviewed by Darin Adler.
3523
3524         No change of behavior, TrackPrivate remains destroyed on the main thread.
3525
3526         * platform/graphics/TrackPrivateBase.h:
3527         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3528         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3529         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
3530
3531 2018-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3532
3533         Unreviewed. Fix the build with libsoup < 2.49.91 after r230251.
3534
3535         Stop using ResourceHandle in SoupNetworkSession.
3536
3537         * platform/network/soup/SoupNetworkSession.cpp:
3538         (WebCore::SoupNetworkSession::SoupNetworkSession):
3539         (WebCore::authenticateCallback): Deleted.
3540         (WebCore::requestStartedCallback): Deleted.
3541
3542 2018-04-03  Alex Christensen  <achristensen@webkit.org>
3543
3544         Remove unused libsoup ResourceHandle implementation
3545         https://bugs.webkit.org/show_bug.cgi?id=184048
3546
3547         Reviewed by Michael Catanzaro.
3548
3549         This code is unused since r228901 so let's remove it!
3550
3551         * platform/network/ResourceHandle.h:
3552         * platform/network/ResourceHandleInternal.h:
3553         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3554         * platform/network/soup/ResourceHandleSoup.cpp:
3555         (WebCore::ResourceHandle::~ResourceHandle):
3556         (WebCore::ResourceHandleInternal::soupSession):
3557         (WebCore::ResourceHandle::cancelledOrClientless):
3558         (WebCore::ResourceHandle::ensureReadBuffer):
3559         (WebCore::ResourceHandle::currentStreamPosition const):
3560         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
3561         (WebCore::ResourceHandle::didStartRequest):
3562         (WebCore::ResourceHandle::start):
3563         (WebCore::ResourceHandle::releaseForDownload):
3564         (WebCore::ResourceHandle::sendPendingRequest):
3565         (WebCore::ResourceHandle::cancel):
3566         (WebCore::ResourceHandle::shouldUseCredentialStorage):
3567         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
3568         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3569         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3570         (WebCore::ResourceHandle::receivedCredential):
3571         (WebCore::ResourceHandle::receivedCancellation):
3572         (WebCore::ResourceHandle::receivedChallengeRejection):
3573         (WebCore::ResourceHandle::platformSetDefersLoading):
3574         (WebCore::sessionFromContext): Deleted.
3575         (WebCore::ResourceHandle::create): Deleted.
3576         (WebCore::ResourceHandle::ResourceHandle): Deleted.
3577         (WebCore::isAuthenticationFailureStatusCode): Deleted.
3578         (WebCore::tlsErrorsChangedCallback): Deleted.
3579         (WebCore::gotHeadersCallback): Deleted.
3580         (WebCore::applyAuthenticationToRequest): Deleted.
3581         (WebCore::restartedCallback): Deleted.
3582         (WebCore::shouldRedirect): Deleted.
3583         (WebCore::shouldRedirectAsGET): Deleted.
3584         (WebCore::continueAfterWillSendRequest): Deleted.
3585         (WebCore::doRedirect): Deleted.
3586         (WebCore::redirectSkipCallback): Deleted.
3587         (WebCore::wroteBodyDataCallback): Deleted.
3588         (WebCore::cleanupSoupRequestOperation): Deleted.
3589         (WebCore::nextMultipartResponsePartCallback): Deleted.
3590         (WebCore::sendRequestCallback): Deleted.
3591         (WebCore::continueAfterDidReceiveResponse): Deleted.
3592         (WebCore::startingCallback): Deleted.
3593         (WebCore::networkEventCallback): Deleted.
3594         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
3595         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
3596         (WebCore::ResourceHandle::timeoutFired): Deleted.
3597         (WebCore::waitingToSendRequest): Deleted.
3598         (WebCore::readCallback): Deleted.
3599
3600 2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>
3601
3602         Add missing WEBCORE_EXPORTs (for Windows shared library build)
3603         https://bugs.webkit.org/show_bug.cgi?id=184279
3604
3605         Reviewed by Alex Christensen.
3606
3607         * dom/Element.h:
3608         * dom/Node.h:
3609         * editing/FrameSelection.h:
3610         * html/DOMURL.h:
3611         * html/HTMLFormElement.h:
3612         * html/canvas/CanvasRenderingContext.h:
3613         * platform/graphics/GraphicsContext.h:
3614         * platform/graphics/PlatformDisplay.h:
3615         * platform/graphics/cairo/CairoOperations.h:
3616         * platform/graphics/cairo/GraphicsContextImplCairo.h:
3617         * platform/graphics/texmap/TextureMapperLayer.h:
3618         * platform/network/HTTPHeaderMap.h:
3619         * platform/network/ResourceRequestBase.h:
3620         * platform/network/ResourceResponseBase.h:
3621         * platform/network/curl/AuthenticationChallenge.h:
3622         * platform/network/curl/CurlFormDataStream.h:
3623         * platform/network/curl/CurlRequest.h:
3624         * platform/network/curl/CurlSSLHandle.h:
3625         * platform/network/curl/ResourceError.h:
3626         * platform/network/curl/ResourceResponse.h:
3627
3628 2018-04-03  Youenn Fablet  <youenn@apple.com>
3629
3630         RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
3631         https://bugs.webkit.org/show_bug.cgi?id=184281
3632         rdar://problem/39153262
3633
3634         Reviewed by Jer Noble.
3635
3636         Covered by manual testing by going to WebRTC web sites.
3637
3638         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
3639         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
3640
3641 2018-04-03  Filip Pizlo  <fpizlo@apple.com>
3642
3643         GC shouldn't do object distancing
3644         https://bugs.webkit.org/show_bug.cgi?id=184195
3645
3646         Reviewed by Saam Barati.
3647
3648         No new tests because no change in behavior.
3649
3650         * Sources.txt:
3651         * WebCore.xcodeproj/project.pbxproj:
3652         * bindings/js/JSDOMGlobalObject.cpp:
3653         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
3654         * bindings/js/JSDOMGlobalObject.h:
3655         * bindings/js/JSDOMWindowBase.cpp:
3656         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
3657         * dom/Document.cpp:
3658         (WebCore::Document::threadLocalCache): Deleted.
3659         * dom/Document.h:
3660         * page/OriginThreadLocalCache.cpp: Removed.
3661         * page/OriginThreadLocalCache.h: Removed.
3662
3663 2018-04-03  Brent Fulgham  <bfulgham@apple.com>
3664
3665         Guard against keychain/certificate access outside the network process
3666         https://bugs.webkit.org/show_bug.cgi?id=184214
3667         <rdar://problem/38734795>
3668
3669         Reviewed by Youenn Fablet.
3670
3671         Use the ProcessPrivilege assertions to guard against accessing the Keychain from
3672         a non-Networking process.
3673
3674         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
3675         (WebCore::LocalAuthenticator::makeCredential): Assert if we access the keychain from
3676         a proces other than the Network or UI process.
3677         (WebCore::LocalAuthenticator::getAssertion): Ditto.
3678         (WebCore::LocalAuthenticator::issueClientCertificate const): Ditto.
3679         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3680         (WebCore::createAndStoreMasterKey): Ditto.
3681         (WebCore::findMasterKey): Ditto.
3682         (WebCore::deleteDefaultWebCryptoMasterKey): Ditto.
3683         * platform/mac/SSLKeyGeneratorMac.mm:
3684         (WebCore::signedPublicKeyAndChallengeString): Ditto.
3685         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3686         (WebCore::createPrivateStorageSession): Ditto.
3687         * platform/network/mac/ResourceHandleMac.mm:
3688         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto.
3689
3690 2018-04-03  Youenn Fablet  <youenn@apple.com>
3691
3692         NetworkResourceLoader does not need to expose all redirect response headers
3693         https://bugs.webkit.org/show_bug.cgi?id=184114
3694         <rdar://problem/39010557>
3695
3696         Reviewed by Ryosuke Niwa.
3697
3698         No JS observable change of behavior.
3699         Behavior change is observable for injected bundles since they will no longer get access to the full response.
3700         List of response headers correspond to the one currently being used/exposed for redirections.
3701
3702         Test: http/wpt/loading/redirect-headers.html
3703
3704         * page/RuntimeEnabledFeatures.h:
3705         (WebCore::RuntimeEnabledFeatures::setRestrictedHTTPResponseAccess):
3706         (WebCore::RuntimeEnabledFeatures::restrictedHTTPResponseAccess const):
3707         * platform/network/ResourceResponseBase.cpp:
3708         (WebCore::isSafeToKeepRedirectionHeader):
3709         (WebCore::ResourceResponseBase::sanitizeRedirectionHTTPHeaderFields):
3710         * platform/network/ResourceResponseBase.h:
3711
3712 2018-04-03  Andy Estes  <aestes@apple.com>
3713
3714         [Mac] Prioritize file promises over filenames during drag and drop
3715         https://bugs.webkit.org/show_bug.cgi?id=184237
3716         <rdar://problem/38278076>
3717
3718         Reviewed by Wenson Hsieh.
3719
3720         When performing a drag operation where the pasteboard contains both a file path and a file
3721         promise, we have historically preferred to accept the file path. Some versions of Photos.app
3722         will provide both a low-resolution thumbnail as a file path and its high-resolution
3723         counterpart as a file promise when dragging a photo, and our current logic leads us to
3724         choose the low-quality thumbnail.
3725
3726         This patch changes our logic to prefer file promises over file paths. This matches the
3727         behavior of Finder and ensures we accept high-resolution assets from Photos.app.
3728
3729         Covered by existing file promise drag tests. beginDragWithFilePromises() was updated to
3730         write a bogus file path to the pasteboard along with the legitimate file promise.
3731
3732         * platform/mac/DragDataMac.mm:
3733         (WebCore::DragData::asFilenames const):
3734         * platform/mac/PasteboardMac.mm:
3735         (WebCore::Pasteboard::read):
3736         (WebCore::Pasteboard::readFilePaths):
3737         * platform/mac/PlatformPasteboardMac.mm:
3738         (WebCore::PlatformPasteboard::numberOfFiles const):
3739
3740 2018-04-03  Mark Lam  <mark.lam@apple.com>
3741
3742         Fix mis-application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION macro.
3743         https://bugs.webkit.org/show_bug.cgi?id=184276
3744         <rdar://problem/39109543>
3745
3746         Rubber-stamped by Michael Saboff.
3747
3748         * bindings/scripts/CodeGeneratorJS.pm:
3749         (GenerateImplementation):
3750         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3751         (WebCore::toJSNewlyCreated):
3752         * bindings/scripts/test/JS/JSMapLike.cpp:
3753         (WebCore::toJSNewlyCreated):
3754         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3755         (WebCore::toJSNewlyCreated):
3756         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3757         (WebCore::toJSNewlyCreated):
3758         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3759         (WebCore::toJSNewlyCreated):
3760         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3761         (WebCore::toJSNewlyCreated):
3762         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3763         (WebCore::toJSNewlyCreated):
3764         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3765         (WebCore::toJSNewlyCreated):
3766         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3767         (WebCore::toJSNewlyCreated):
3768         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3769         (WebCore::toJSNewlyCreated):
3770         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3771         (WebCore::toJSNewlyCreated):
3772         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3773         (WebCore::toJSNewlyCreated):
3774         * bindings/scripts/test/JS/JSTestException.cpp:
3775         (WebCore::toJSNewlyCreated):
3776         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3777         (WebCore::toJSNewlyCreated):
3778         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3779         (WebCore::toJSNewlyCreated):
3780         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3781         (WebCore::toJSNewlyCreated):
3782         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3783         (WebCore::toJSNewlyCreated):
3784         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3785         (WebCore::toJSNewlyCreated):
3786         * bindings/scripts/test/JS/JSTestIterable.cpp:
3787         (WebCore::toJSNewlyCreated):
3788         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3789         (WebCore::toJSNewlyCreated):
3790         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3791         (WebCore::toJSNewlyCreated):
3792         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3793         (WebCore::toJSNewlyCreated):
3794         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3795         (WebCore::toJSNewlyCreated):
3796         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3797         (WebCore::toJSNewlyCreated):
3798         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3799         (WebCore::toJSNewlyCreated):
3800         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3801         (WebCore::toJSNewlyCreated):
3802         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3803         (WebCore::toJSNewlyCreated):
3804         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3805         (WebCore::toJSNewlyCreated):
3806         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3807         (WebCore::toJSNewlyCreated):
3808         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3809         (WebCore::toJSNewlyCreated):
3810         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3811         (WebCore::toJSNewlyCreated):
3812         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3813         (WebCore::toJSNewlyCreated):
3814         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3815         (WebCore::toJSNewlyCreated):
3816         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3817         (WebCore::toJSNewlyCreated):
3818         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3819         (WebCore::toJSNewlyCreated):
3820         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3821         (WebCore::toJSNewlyCreated):
3822         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3823         (WebCore::toJSNewlyCreated):
3824         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3825         (WebCore::toJSNewlyCreated):
3826         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3827         (WebCore::toJSNewlyCreated):
3828         * bindings/scripts/test/JS/JSTestNode.cpp:
3829         (WebCore::toJSNewlyCreated):
3830         * bindings/scripts/test/JS/JSTestObj.cpp:
3831         (WebCore::toJSNewlyCreated):
3832         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3833         (WebCore::toJSNewlyCreated):
3834         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3835         (WebCore::toJSNewlyCreated):
3836         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3837         (WebCore::toJSNewlyCreated):
3838         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3839         (WebCore::toJSNewlyCreated):
3840         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3841         (WebCore::toJSNewlyCreated):
3842         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3843         (WebCore::toJSNewlyCreated):
3844         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3845         (WebCore::toJSNewlyCreated):
3846         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3847         (WebCore::toJSNewlyCreated):
3848         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3849         (WebCore::toJSNewlyCreated):
3850         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3851         (WebCore::toJSNewlyCreated):
3852         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3853         (WebCore::toJSNewlyCreated):
3854         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3855         (WebCore::toJSNewlyCreated):
3856         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3857         (WebCore::toJSNewlyCreated):
3858         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3859         (WebCore::toJSNewlyCreated):
3860         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3861         (WebCore::toJSNewlyCreated):
3862
3863 2018-04-03  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3864
3865         [CMake] gperf path should be given when WebCore/css/makevalues.pl is executed
3866         https://bugs.webkit.org/show_bug.cgi?id=184224
3867
3868         Reviewed by Konstantin Tokarev.
3869
3870         When a building evironment doens't include a path to gperf,
3871         WebCore/css/makevalue.pl failes due to failing to execute gperf,
3872         so the full path to gperf should be given like WebCore/css/makeprop.pl.
3873
3874         No new tests, no Web-facing behavior change.
3875
3876         * CMakeLists.txt: gperf path is given to css/makevalues.pl.
3877         * css/makevalues.pl: Add an argument to handle a given gperf path.
3878
3879 2018-04-03  Chris Dumez  <cdumez@apple.com>
3880
3881         Drop MainFrame class
3882         https://bugs.webkit.org/show_bug.cgi?id=184191
3883
3884         Reviewed by Darin Adler.
3885
3886         Drop MainFrame class and move contents into Page / Frame since there is a 1:1
3887         relationship between the Page and the MainFrame.
3888
3889         This is ground work for introducing LocalFrame / RemoteFrame concepts.
3890
3891         * Modules/applepay/ApplePaySession.cpp:
3892         (WebCore::ApplePaySession::create):
3893         (WebCore::ApplePaySession::supportsVersion):
3894         (WebCore::ApplePaySession::canMakePayments):
3895         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
3896         (WebCore::ApplePaySession::openPaymentSetup):
3897         (WebCore::ApplePaySession::paymentCoordinator const):
3898         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3899         (WebCore::paymentCoordinator):
3900         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
3901         * Modules/mediastream/UserMediaRequest.cpp:
3902         * Modules/plugins/QuickTimePluginReplacement.mm:
3903         * Sources.txt:
3904         * WebCore.xcodeproj/project.pbxproj:
3905         * accessibility/AccessibilityObject.cpp:
3906         (WebCore::AccessibilityObject::mainFrame const):
3907         (WebCore::AccessibilityObject::visiblePositionForBounds const):
3908         * accessibility/AccessibilityObject.h:
3909         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3910         * bindings/js/ScriptController.cpp:
3911         * bindings/js/ScriptState.cpp:
3912         * contentextensions/ContentExtensionsBackend.cpp:
3913         * css/MediaQueryEvaluator.cpp:
3914         (WebCore::displayModeEvaluate):
3915         * dom/DOMImplementation.cpp:
3916         * dom/Document.cpp:
3917         * dom/DocumentMarkerController.cpp:
3918         * dom/Element.cpp:
3919         (WebCore::Element::removedFromAncestor):
3920         * dom/EventDispatcher.cpp:
3921         * dom/ScriptedAnimationController.cpp:
3922         * editing/Editor.cpp:
3923         (WebCore::Editor::scanSelectionForTelephoneNumbers):
3924         * editing/EditorCommand.cpp:
3925         * editing/SelectionRectGatherer.cpp:
3926         (WebCore::SelectionRectGatherer::Notifier::~Notifier):
3927         * editing/cocoa/WebContentReaderCocoa.mm:
3928         * editing/markup.cpp:
3929         * history/CachedFrame.cpp:
3930         * history/CachedPage.cpp:
3931         * history/PageCache.cpp:
3932         (WebCore::destroyRenderTree):
3933         * html/HTMLMediaElement.cpp:
3934         * html/HTMLPlugInImageElement.cpp:
3935         * html/ImageDocument.cpp:
3936         * html/MediaElementSession.cpp:
3937         (WebCore::isMainContentForPurposesOfAutoplay):
3938         * html/canvas/WebGLRenderingContextBase.cpp:
3939         * inspector/InspectorClient.cpp:
3940         * inspector/InspectorController.cpp:
3941         * inspector/InspectorFrontendClientLocal.cpp:
3942         * inspector/InspectorFrontendHost.cpp:
3943         * inspector/InspectorInstrumentation.cpp:
3944         * inspector/InspectorOverlay.cpp:
3945         * inspector/PageScriptDebugServer.cpp:
3946         * inspector/agents/InspectorApplicationCacheAgent.cpp:
3947         * inspector/agents/InspectorCanvasAgent.cpp:
3948         * inspector/agents/InspectorDOMAgent.cpp:
3949         * inspector/agents/InspectorPageAgent.cpp:
3950         (WebCore::InspectorPageAgent::mainFrame):
3951         * inspector/agents/InspectorPageAgent.h:
3952         * inspector/agents/page/PageDebuggerAgent.cpp:
3953         * inspector/agents/page/PageRuntimeAgent.cpp: