[WTF] Move ValueToString into WTF
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-11  Don Olmstead  <don.olmstead@sony.com>
2
3         [WTF] Move ValueToString into WTF
4         https://bugs.webkit.org/show_bug.cgi?id=175469
5
6         Reviewed by Sam Weinig.
7
8         No new tests. No change in behavior.
9
10         * WebCore.xcodeproj/project.pbxproj:
11         * html/HTMLMediaElement.h:
12         (WTF::ValueToString<WebCore::TextTrackCue::string):
13         (WebCore::ValueToString<TextTrackCue::string): Deleted.
14         (WebCore::ValueToString<MediaTime>::string): Deleted.
15         * platform/LayoutUnit.h:
16         (WTF::ValueToString<WebCore::LayoutUnit>::string):
17         (WebCore::ValueToString<LayoutUnit>::string): Deleted.
18         * platform/PODInterval.h:
19         * platform/PODIntervalTree.h:
20         * platform/PODRedBlackTree.h:
21         * platform/graphics/FloatPolygon.h:
22         (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
23         (WebCore::ValueToString<FloatPolygonEdge::string): Deleted.
24         * rendering/FloatingObjects.h:
25         (WTF::ValueToString<WebCore::FloatingObject::string):
26         (WebCore::ValueToString<FloatingObject::string): Deleted.
27         * rendering/RenderFlowThread.h:
28         (WTF::ValueToString<WebCore::RenderRegion::string):
29         (WebCore::ValueToString<RenderRegion::string): Deleted.
30
31 2017-08-11  Sam Weinig  <sam@webkit.org>
32
33         [Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references
34         https://bugs.webkit.org/show_bug.cgi?id=175394
35
36         Reviewed by Chris Dumez.
37
38         * bindings/IDLTypes.h:
39         (WebCore::IDLWrapper::convertToParameterType): Deleted.
40
41             Remove no longer used convertToParameterType.
42
43         * bindings/js/DOMPromiseProxy.h:
44
45             - Replace Variant<Value, Exception> with ExceptionOr<Value> / ExceptionOr<void>.
46             - Update ResolveCallback to have a return type of IDLType::ParameterType, rather than
47               IDLType::ImplementationType, now that WTF::Function supports references as the 
48               return type. This is needed, since the IDLType::ParameterType for an interface T
49               is T&.
50
51         * css/FontFace.cpp:
52         * css/FontFace.h:
53         * css/FontFaceSet.cpp:
54         * css/FontFaceSet.h:
55
56             Update resolve callbacks to return a reference rather than a RefPtr, matching
57             the new signature requirement.
58
59 2017-08-11  Sam Weinig  <sam@webkit.org>
60
61         [WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
62         https://bugs.webkit.org/show_bug.cgi?id=175457
63
64         Reviewed by Chris Dumez.
65
66         * CMakeLists.txt:
67         * DerivedSources.make:
68         * WebCore.xcodeproj/project.pbxproj:
69         * bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed.
70         * bindings/js/JSCryptoAlgorithmBuilder.h: Removed.
71         * bindings/js/JSCryptoKeyCustom.cpp: Removed.
72
73             Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm
74             IDLs and headers.
75
76         * crypto/CryptoKey.cpp:
77         * crypto/CryptoKey.h:
78         * crypto/CryptoKey.idl:
79         
80             Replace custom algorithm attribute with a union of the supported key algorithms.
81         
82         * crypto/keys/CryptoAesKeyAlgorithm.h: Added.
83         * crypto/keys/CryptoAesKeyAlgorithm.idl: Added.
84         * crypto/keys/CryptoEcKeyAlgorithm.h: Added.
85         * crypto/keys/CryptoEcKeyAlgorithm.idl: Added.
86         * crypto/keys/CryptoHmacKeyAlgorithm.h: Added.
87         * crypto/keys/CryptoHmacKeyAlgorithm.idl: Added.
88         * crypto/keys/CryptoKeyAlgorithm.h: Added.
89         * crypto/keys/CryptoKeyAlgorithm.idl: Added.
90         * crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added.
91         * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added.
92         * crypto/keys/CryptoRsaKeyAlgorithm.h: Added.
93         * crypto/keys/CryptoRsaKeyAlgorithm.idl: Added.
94
95             Add IDLs and headers fo the supported key algorithms.
96
97         * crypto/keys/CryptoKeyAES.h:
98         * crypto/keys/CryptoKeyEC.h:
99         * crypto/keys/CryptoKeyHMAC.h:
100         * crypto/keys/CryptoKeyRSA.h:
101         * crypto/keys/CryptoKeyRaw.h:
102
103             Give each of the existing KeyAlgorithm subclasses a dictionary() function
104             that returns the populated corresponding spec'd dictionary.
105
106 2017-08-11  Simon Fraser  <simon.fraser@apple.com>
107
108         Some RenderSVGResource cleanup
109         https://bugs.webkit.org/show_bug.cgi?id=175494
110
111         Reviewed by Zalan Bujtas.
112
113         Use more initializers. Remove spurious use of bitfields that didn't save any space at all.
114         0 -> nullptr.
115
116         No behavior change.
117
118         * rendering/svg/RenderSVGResourceContainer.cpp:
119         (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer):
120         * rendering/svg/RenderSVGResourceContainer.h:
121         * rendering/svg/RenderSVGResourceGradient.cpp:
122         (WebCore::RenderSVGResourceGradient::RenderSVGResourceGradient):
123         (WebCore::RenderSVGResourceGradient::applyResource):
124         * rendering/svg/RenderSVGResourceGradient.h:
125         * rendering/svg/RenderSVGResourcePattern.cpp:
126         (WebCore::RenderSVGResourcePattern::RenderSVGResourcePattern):
127         * rendering/svg/RenderSVGResourcePattern.h:
128         * rendering/svg/RenderSVGShape.cpp:
129         (WebCore::RenderSVGShape::fillShape):
130         (WebCore::RenderSVGShape::strokeShape):
131         * rendering/svg/SVGRenderingContext.cpp:
132         (WebCore::SVGRenderingContext::~SVGRenderingContext):
133         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
134         * rendering/svg/SVGRenderingContext.h:
135         (WebCore::SVGRenderingContext::SVGRenderingContext):
136
137 2017-08-11  Tim Horton  <timothy_horton@apple.com>
138
139         Fix the build with modern Clang's -Wexpansion-to-defined
140         https://bugs.webkit.org/show_bug.cgi?id=175467
141         <rdar://problem/33667497>
142
143         Reviewed by Simon Fraser.
144
145         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
146
147 2017-08-11  Brady Eidson  <beidson@apple.com>
148
149         Crash under ServiceWorkerJob::failedWithException.
150         https://bugs.webkit.org/show_bug.cgi?id=175488
151
152         Reviewed by Tim Horton.
153
154         Covered by existing tests.
155
156         * workers/ServiceWorkerJob.cpp:
157         (WebCore::ServiceWorkerJob::failedWithException): jobDidFinish might cause the Job to be deleted, so make it last.
158
159 2017-08-10  Sam Weinig  <sam@webkit.org>
160
161         WTF::Function does not allow for reference / non-default constructible return types
162         https://bugs.webkit.org/show_bug.cgi?id=175244
163
164         Reviewed by Chris Dumez.
165
166         * bindings/js/JSCustomElementInterface.h:
167         (WebCore::JSCustomElementInterface::invokeCallback):
168         Update the default value for the addArguments parameter to be an empty lambda, rather than
169         default initialization, which leads to a null WTF::Function. This allows us to remove support
170         for calling null WTF::Function. No change in behavior.
171
172 2017-08-11  Antti Koivisto  <antti@apple.com>
173
174         Remove RenderQuote collection from RenderView
175         https://bugs.webkit.org/show_bug.cgi?id=175479
176
177         Reviewed by Andreas Kling.
178
179         We can do it well enough without maintaining this pointer structure.
180
181         Global updating doesn't work well with future direction for first-letter and similar anyway.
182         We need to update quote immediately when updating its style.
183
184         * rendering/RenderQuote.cpp:
185         (WebCore::RenderQuote::insertedIntoTree):
186         (WebCore::RenderQuote::willBeRemovedFromTree):
187
188             Just tell the view that there are renderers to update.
189
190         (WebCore::RenderQuote::styleDidChange):
191         (WebCore::RenderQuote::isOpen const):
192         (WebCore::RenderQuote::updateRenderer):
193         (WebCore::RenderQuote::updateRenderers): Deleted.
194
195             Update single renderer only. RenderTreeUpdater provides the previous renderer to compute the depth.
196
197         * rendering/RenderQuote.h:
198         * rendering/RenderView.cpp:
199         (WebCore::RenderView::registerQuote): Deleted.
200         (WebCore::RenderView::unregisterQuote): Deleted.
201         (WebCore::RenderView::updateSpecialRenderers): Deleted.
202
203             Remove the quote list.
204
205         * rendering/RenderView.h:
206         * style/RenderTreeUpdater.cpp:
207         (WebCore::RenderTreeUpdater::commit):
208
209             Ensure that all quotes are updated.
210
211         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
212         (WebCore::RenderTreeUpdater::updateQuotesUpTo):
213
214             Traverse render tree to find quotes to update starting from the previous updated quote.
215
216         * style/RenderTreeUpdater.h:
217
218 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
219
220         [CMake] Many warning about missing “override” keywords in ANGLE with Clang
221         https://bugs.webkit.org/show_bug.cgi?id=175475
222
223         Reviewed by Michael Catanzaro.
224
225         * CMakeLists.txt: Add "-Wno-inconsistent-missing-override" to the
226         compiler flags using for building the ANGLE sources.
227
228 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
229
230         [GTK][WPE] Overriden virtual function not marked “override” in ImageBufferDataCairo.h
231         https://bugs.webkit.org/show_bug.cgi?id=175476
232
233         Reviewed by Carlos Garcia Campos.
234
235         * platform/graphics/cairo/ImageBufferDataCairo.h: Add missing "override" qualifier.
236
237 2017-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
238
239         [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication
240         https://bugs.webkit.org/show_bug.cgi?id=175378
241
242         Reviewed by Sergio Villar Senin.
243
244         Bring back part of the code removed in r206732, to keep a reference to the SoupMessage in the
245         AuthenticationChallenge since it can be different to the resource message.
246
247         * platform/network/soup/AuthenticationChallenge.h:
248         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted.
249         (WebCore::AuthenticationChallenge::authenticationClient const): Deleted.
250         (WebCore::AuthenticationChallenge::soupAuth const): Deleted.
251         (WebCore::AuthenticationChallenge::setProposedCredential): Deleted.
252         * platform/network/soup/AuthenticationChallengeSoup.cpp:
253         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
254         (WebCore::AuthenticationChallenge::platformCompare):
255
256 2017-08-10  Dan Bernstein  <mitz@apple.com>
257
258         Fixed building for macOS 10.12 with the macOS 10.13 SDK.
259
260         Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
261         and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
262         starting in that release, they have been available as SPI earlier.
263
264         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
265         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
266         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
267         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
268         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
269         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
270         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
271         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
272         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
273         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
274         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
275         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
276         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
277         (WebCore::SourceBufferPrivateAVFObjC::flush):
278
279 2017-08-10  Brady Eidson  <beidson@apple.com>
280
281         Rename the source files for the WTF persistent coders.
282         https://bugs.webkit.org/show_bug.cgi?id=175441
283
284         Reviewed by Tim Horton.
285
286         * platform/network/NetworkLoadMetrics.h:
287
288 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
289
290         Make ThreadGlobalData RefCounted for web thread
291         https://bugs.webkit.org/show_bug.cgi?id=175439
292
293         Reviewed by Mark Lam.
294
295         When the web thread is enabled, we share ThreadGlobalData between the web thread and the main thread.
296         The problem happens when the main thread is dying. It could start deallocating TLS and the web
297         thread may see the destructed ThreadGlobalData.
298
299         Even though, the current implementation is safe because the main thread do not perform TLS deallocation
300         in the Darwin environment. But this is not true in Windows. And we should not rely on this condition
301         that depends on the platforms.
302
303         In this patch, we make ThreadGlobalData ThreadSafeRefCounted. This type verbosely describes that
304         ThreadGlobalData could be shared between threads when the web thread enabled. And make the life time
305         management simple instead of relying on the platform dependent TLS implementation.
306
307         * platform/ThreadGlobalData.cpp:
308         (WebCore::ThreadGlobalData::setWebCoreThreadData):
309         (WebCore::threadGlobalData):
310         * platform/ThreadGlobalData.h:
311         (WebCore::ThreadGlobalData::cachedResourceRequestInitiators): Deleted.
312         (WebCore::ThreadGlobalData::eventNames): Deleted.
313         (WebCore::ThreadGlobalData::threadTimers): Deleted.
314         (WebCore::ThreadGlobalData::qualifiedNameCache): Deleted.
315         (WebCore::ThreadGlobalData::cachedConverterICU): Deleted.
316         (WebCore::ThreadGlobalData::cachedConverterTEC): Deleted.
317
318 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
319
320         [JSC] Use @toNumber in builtins
321         https://bugs.webkit.org/show_bug.cgi?id=172692
322
323         Reviewed by Sam Weinig.
324
325         Use @toNumber bytecode intrinsic. It emits op_to_number, which efficiently converts
326         a given argument to a number.
327
328         * Modules/streams/ReadableByteStreamInternals.js:
329         (privateInitializeReadableByteStreamController):
330         (readableByteStreamControllerRespond):
331         * Modules/streams/StreamInternals.js:
332         (validateAndNormalizeQueuingStrategy):
333         (enqueueValueWithSize):
334
335 2017-08-10  Nan Wang  <n_wang@apple.com>
336
337         AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
338         https://bugs.webkit.org/show_bug.cgi?id=175340
339         <rdar://problem/33782159>
340
341         Reviewed by Chris Fleizach.
342
343         The issue here is that we manualy set the parent object of the AccessibilitySVGRoot object
344         and there are chances that the parent doesn't detach it properly during the parent's destroying
345         process. Accessing the stale parent object will lead to a crash.
346         Fixed this by making the parent object a weak pointer so we don't access an invalid memory. 
347
348         Test: accessibility/add-children-pseudo-element.html
349
350         * accessibility/AccessibilityRenderObject.cpp:
351         (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
352         * accessibility/AccessibilityRenderObject.h:
353         (WebCore::AccessibilityRenderObject::createWeakPtr):
354         * accessibility/AccessibilitySVGRoot.cpp:
355         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
356         (WebCore::AccessibilitySVGRoot::setParent):
357         (WebCore::AccessibilitySVGRoot::parentObject const):
358         * accessibility/AccessibilitySVGRoot.h:
359
360 2017-08-10  Chris Dumez  <cdumez@apple.com>
361
362         [Beacon] Do connect-src CSP check on redirects as well
363         https://bugs.webkit.org/show_bug.cgi?id=175410
364         <rdar://problem/33815470>
365
366         Reviewed by Youenn Fablet.
367
368         Pass ContentSecurityPolicy object to createPingHandle so that we can send
369         enough data to the NetworkProcess so do CSP checks for Ping loads such
370         as Beacon. For the IPC, we serialize the ContentSecurityPolicy's response
371         headers. Those headers are now cached in ContentSecurityPolicy for
372         performance reasons. CSP headers are rarely updated in practice but
373         sendBeacon() may get called repeatedly for a given document.
374
375         Tests: http/wpt/beacon/connect-src-beacon-redirect-allowed.sub.html
376                http/wpt/beacon/connect-src-beacon-redirect-blocked.sub.html
377
378         * loader/LoaderStrategy.h:
379         * loader/PingLoader.cpp:
380         (WebCore::PingLoader::loadImage):
381         (WebCore::PingLoader::sendPing):
382         (WebCore::PingLoader::sendViolationReport):
383         (WebCore::PingLoader::startPingLoad):
384         * loader/PingLoader.h:
385         * loader/cache/CachedResource.cpp:
386         (WebCore::CachedResource::load):
387         * page/csp/ContentSecurityPolicy.cpp:
388         (WebCore::ContentSecurityPolicy::responseHeaders const):
389         (WebCore::ContentSecurityPolicy::didReceiveHeader):
390         * page/csp/ContentSecurityPolicy.h:
391         * page/csp/ContentSecurityPolicyResponseHeaders.h:
392         (WebCore::ContentSecurityPolicyResponseHeaders::encode const):
393         (WebCore::ContentSecurityPolicyResponseHeaders::decode):
394
395 2017-08-09  Yusuke Suzuki  <utatane.tea@gmail.com>
396
397         [WTF] ThreadSpecific should not introduce additional indirection
398         https://bugs.webkit.org/show_bug.cgi?id=175187
399
400         Reviewed by Mark Lam.
401
402         We drop ThreadSpecific::replace feature which is only used by
403         Web thread. Instead, we use ThreadSpecific<std::unique_ptr<T>> here.
404
405         While this std::unique_ptr<T> shares one instance between main thread
406         and web thread, this is the same to the current implementation. It is
407         safe because the web thread never finishes.
408
409         And for non-web thread implementation, we just use ThreadSpecific<T>,
410         since it is the most efficient.
411
412         * platform/ThreadGlobalData.cpp:
413         (WebCore::ThreadGlobalData::ThreadGlobalData):
414         (WebCore::ThreadGlobalData::setWebCoreThreadData):
415         (WebCore::threadGlobalData):
416         We also drop StringImpl::empty() call since it is not necessary now:
417         StringImpl::empty data is statically initialized by using constexpr.
418
419         * platform/ThreadGlobalData.h:
420         We make it FAST_ALLOCATED since it is previously allocated by fast malloc
421         in ThreadSpecific.
422
423 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
424
425         REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie
426         https://bugs.webkit.org/show_bug.cgi?id=175426
427
428         Reviewed by Carlos Alberto Lopez Perez.
429
430         Also stop using GEOCLUE_LIBRARIES and GEOCLUE_INCLUDE_DIRS, since they are empty. Apparently
431         we have not actually been using the client library at all this whole time, only the D-Bus
432         interface.
433
434         * PlatformGTK.cmake:
435
436 2017-08-10  Brady Eidson  <beidson@apple.com>
437
438         Add ServiceWorkerJob.
439         https://bugs.webkit.org/show_bug.cgi?id=175241
440
441         Reviewed by Tim Horton.
442
443         Test: http/tests/workers/service/basic-register.html
444
445         This patch does a few things:
446         - Adds the spec concept of a ServiceWorkerJob (in the WebProcess, at least)
447         - Adds a ServiceWorkerProvider interface for WebKit to implement
448         - Actually creates a job for service worker registration and "schedules" it,
449           though it always immediately errors out the promise.
450
451         Actually queuing jobs and executing asynchronously is coming up soon.
452
453         * CMakeLists.txt:
454         * WebCore.xcodeproj/project.pbxproj:
455
456         * dom/Document.cpp:
457         (WebCore::Document::sessionID const):
458         * dom/Document.h:
459
460         * workers/ServiceWorkerContainer.cpp:
461         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
462         (WebCore::ServiceWorkerContainer::addRegistration):
463         (WebCore::ServiceWorkerContainer::scheduleJob):
464         (WebCore::ServiceWorkerContainer::jobDidFinish):
465         * workers/ServiceWorkerContainer.h:
466
467         * workers/ServiceWorkerJob.cpp: Added.
468         (WebCore::ServiceWorkerJob::ServiceWorkerJob):
469         (WebCore::ServiceWorkerJob::~ServiceWorkerJob):
470         (WebCore::ServiceWorkerJob::failedWithException):
471         * workers/ServiceWorkerJob.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h.
472         (WebCore::ServiceWorkerJob::createRegisterJob):
473         (WebCore::ServiceWorkerJob::identifier const):
474
475         * workers/ServiceWorkerJobClient.h: Added.
476         (WebCore::ServiceWorkerJobClient::~ServiceWorkerJobClient):
477
478         * workers/ServiceWorkerProvider.cpp: Added.
479         (WebCore::ServiceWorkerProvider::singleton):
480         (WebCore::ServiceWorkerProvider::setSharedProvider):
481         * workers/ServiceWorkerProvider.h: Added.
482         * workers/ServiceWorkerRegistrationOptions.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h.
483         * workers/ServiceWorkerRegistrationParameters.cpp: Added.
484         * workers/ServiceWorkerRegistrationParameters.h: Added.
485
486 2017-08-10  Tim Horton  <timothy_horton@apple.com>
487
488         Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture
489         https://bugs.webkit.org/show_bug.cgi?id=175436
490         <rdar://problem/33667497>
491
492         Reviewed by Simon Fraser.
493
494         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
495         (PlatformMediaSessionManager::updateSessionState):
496         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
497         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
498
499 2017-08-10  Commit Queue  <commit-queue@webkit.org>
500
501         Unreviewed, rolling out r220463.
502         https://bugs.webkit.org/show_bug.cgi?id=175435
503
504         unaccepted fix (Requested by n_wang on #webkit).
505
506         Reverted changeset:
507
508         "AX: crash at
509         WebCore::AccessibilityObject::supportsARIALiveRegion() const +
510         24"
511         https://bugs.webkit.org/show_bug.cgi?id=175340
512         http://trac.webkit.org/changeset/220463
513
514 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
515
516         Remove ENABLE_GAMEPAD_DEPRECATED
517         https://bugs.webkit.org/show_bug.cgi?id=175361
518
519         Reviewed by Carlos Garcia Campos.
520
521         * CMakeLists.txt:
522         * Configurations/FeatureDefines.xcconfig:
523         * PlatformGTK.cmake:
524         * PlatformWPE.cmake:
525         * platform/Linux.cmake: Removed.
526         * platform/gamepad/deprecated/Gamepads.h: Removed.
527         * platform/gamepad/glib/GamepadsGlib.cpp: Removed.
528         * platform/gamepad/linux/GamepadDeviceLinux.cpp: Removed.
529         * platform/gamepad/linux/GamepadDeviceLinux.h: Removed.
530
531 2017-08-10  Myles C. Maxfield  <mmaxfield@apple.com>
532
533         Addressing post-review comments after r219173.
534         https://bugs.webkit.org/show_bug.cgi?id=174149
535
536         Unreviewed.
537
538         * css/CSSFontStyleValue.h:
539         * editing/EditingStyle.cpp:
540         (WebCore::identifierForStyleProperty):
541
542 2017-08-10  Antti Koivisto  <antti@apple.com>
543
544         Try to fix windows build.
545
546         * style/StyleUpdate.h:
547         (WebCore::Style::TextUpdate::TextUpdate):
548
549 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
550
551         [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
552         https://bugs.webkit.org/show_bug.cgi?id=174161
553
554         Reviewed by Xabier Rodriguez-Calvar.
555
556         In r219385 we changed the early return in fillSelectionData() to check the selection data length instead of the
557         data pointer. However, the gtk_selection_data_get_length() can return -1, so we need to check also if the value
558         less than 0. The case of setting an empty string could be valid depending on the target type, so it's better to
559         return early only when data lenght is less than 0 and handle the 0 length case in each target.
560
561         * platform/gtk/PasteboardHelper.cpp:
562         (WebCore::PasteboardHelper::fillSelectionData):
563
564 2017-08-10  Antti Koivisto  <antti@apple.com>
565
566         Text renderer updates should be done by RenderTreeUpdater
567         https://bugs.webkit.org/show_bug.cgi?id=175417
568
569         Reviewed by Andreas Kling.
570
571         All render tree mutations should be done by RenderTreeUpdater. Currently
572         Text::updateRendererAfterContentChange calls RenderText::setTextWithOffset directly.
573
574         * dom/Document.cpp:
575         (WebCore::Document::updateTextRenderer):
576
577             Add range argument.
578
579         * dom/Document.h:
580         * dom/Text.cpp:
581         (WebCore::Text::updateRendererAfterContentChange):
582
583             Remove call to setTextWithOffset and pass the range to updateTextRenderer
584
585         * style/RenderTreeUpdater.cpp:
586         (WebCore::RenderTreeUpdater::updateRenderTree):
587         (WebCore::RenderTreeUpdater::updateTextRenderer):
588
589             Call setTextWithOffset here.
590
591         * style/RenderTreeUpdater.h:
592         * style/StyleTreeResolver.cpp:
593         (WebCore::Style::TreeResolver::resolveComposedTree):
594         * style/StyleUpdate.cpp:
595         (WebCore::Style::Update::textUpdate const):
596         (WebCore::Style::Update::addText):
597
598             Add TextUpdate struct similar to ElementUpdate to pass the range to the RenderTreeUpdater.
599
600         * style/StyleUpdate.h:
601
602 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
603
604         Unreviewed GTK+ build fix for ENABLE_GLES2=ON.
605
606         * platform/graphics/texmap/TextureMapperGLHeaders.h:
607         Define various GL constants that are not provided in GLES2 headers
608         but are only leveraged in OpenGL calls if at runtime the underlying
609         OpenGL is GLES2-capable.
610
611 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
612
613         [TexMap] Remove GraphicsContext3D usage from BitmapTexturePool
614         https://bugs.webkit.org/show_bug.cgi?id=175319
615
616         Reviewed by Carlos Garcia Campos.
617
618         Drop the GraphicsContext3D reference in BitmapTexturePool now
619         that the BitmapTextureGL doesn't require it anymore.
620
621         No new tests -- no change in behavior.
622
623         * platform/graphics/texmap/BitmapTexturePool.cpp:
624         (WebCore::BitmapTexturePool::BitmapTexturePool):
625         * platform/graphics/texmap/BitmapTexturePool.h:
626         * platform/graphics/texmap/TextureMapperGL.cpp:
627         (WebCore::TextureMapperGL::TextureMapperGL):
628
629 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
630
631         [TexMap] Drop GraphicsContext3D usage from BitmapTextureGL
632         https://bugs.webkit.org/show_bug.cgi?id=175317
633
634         Reviewed by Carlos Garcia Campos.
635
636         Have BitmapTextureGL use direct OpenGL API entrypoints and constants
637         instead of leveraging the GraphicsContext3D class. Any GraphicsContext3D
638         object passed to BitmapTextureGL would assume rendering to the GL context
639         that's current on that thread, translating method invocations to the
640         OpenGL API. We can do this by ourselves and benefit by avoiding allocating
641         GraphicsContext3D resources like the ANGLE compiler that are by most useful
642         for WebGL.
643
644         BitmapTextureGL::create() call sites are adjusted to stop passing a
645         GraphicsContext3D reference. BitmapTextureGL::bindAsSurface() doesn't need
646         a replacement for the passed-in GraphicsContext3D object since that object
647         originated from the TextureMapperGL instance, whose GraphicsContext3D is by
648         default of the render-to-current-context nature. Other changes are direct
649         translations of GraphicsContext3D methods to OpenGL API calls, or of
650         GraphicsContext3D values to OpenGL API constants.
651
652         No new tests -- no change in behavior.
653
654         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
655         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
656         * platform/graphics/texmap/BitmapTextureGL.cpp:
657         Also remove an unnecessary GraphicsContext.h header inclusion.
658         (WebCore::BitmapTextureGL::BitmapTextureGL):
659         (WebCore::BitmapTextureGL::didReset):
660         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
661         (WebCore::BitmapTextureGL::updateContents):
662         (WebCore::BitmapTextureGL::initializeStencil):
663         (WebCore::BitmapTextureGL::initializeDepthBuffer):
664         (WebCore::BitmapTextureGL::clearIfNeeded):
665         (WebCore::BitmapTextureGL::createFboIfNeeded):
666         (WebCore::BitmapTextureGL::bindAsSurface):
667         (WebCore::BitmapTextureGL::~BitmapTextureGL):
668         (WebCore::BitmapTextureGL::copyFromExternalTexture):
669         * platform/graphics/texmap/BitmapTextureGL.h:
670         (WebCore::BitmapTextureGL::create):
671         (WebCore::BitmapTextureGL::textureTarget const):
672         (WebCore::BitmapTextureGL::internalFormat const):
673         * platform/graphics/texmap/BitmapTexturePool.cpp:
674         (WebCore::BitmapTexturePool::createTexture):
675         * platform/graphics/texmap/TextureMapperGL.cpp:
676         (WebCore::TextureMapperGL::bindSurface):
677         (WebCore::TextureMapperGL::createTexture):
678
679 2017-08-09  Michael Catanzaro  <mcatanzaro@igalia.com>
680
681         [GTK] Remove support for geoclue1
682         https://bugs.webkit.org/show_bug.cgi?id=164205
683
684         Reviewed by Carlos Garcia Campos.
685
686         * PlatformGTK.cmake:
687         * platform/geoclue/GeolocationProviderGeoclue.h:
688         * platform/geoclue/GeolocationProviderGeoclue1.cpp: Removed.
689         * platform/geoclue/GeolocationProviderGeoclue2.cpp: Removed.
690
691 2017-08-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
692
693         [PAL] Move spi/cocoa and spi/cg directories into PAL
694         https://bugs.webkit.org/show_bug.cgi?id=175175
695
696         Reviewed by Myles C. Maxfield.
697
698         * Modules/applepay/cocoa/PaymentCocoa.mm:
699         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
700         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
701         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
702         * PlatformAppleWin.cmake:
703         * WebCore.xcodeproj/project.pbxproj:
704         * editing/cocoa/EditorCocoa.mm:
705         * editing/cocoa/HTMLConverter.mm:
706         * editing/ios/EditorIOS.mm:
707         * page/cocoa/ResourceUsageThreadCocoa.mm:
708         * page/mac/TextIndicatorWindow.mm:
709         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
710         * platform/cocoa/DataDetectorsCoreSoftLink.h:
711         * platform/cocoa/MIMETypeRegistryCocoa.mm:
712         * platform/cocoa/NetworkExtensionContentFilter.mm:
713         * platform/cocoa/ParentalControlsContentFilter.mm:
714         * platform/cocoa/SleepDisablerCocoa.cpp:
715         * platform/graphics/Font.cpp:
716         * platform/graphics/Font.h:
717         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
718         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
719         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
720         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
721         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
722         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
723         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
724         * platform/graphics/cg/ColorCG.cpp:
725         * platform/graphics/cg/GraphicsContextCG.cpp:
726         * platform/graphics/cg/ImageBufferCG.cpp:
727         * platform/graphics/cg/ImageBufferDataCG.cpp:
728         * platform/graphics/cg/ImageDecoderCG.cpp:
729         * platform/graphics/cg/NativeImageCG.cpp:
730         * platform/graphics/cocoa/FontCacheCoreText.cpp:
731         * platform/graphics/cocoa/FontCascadeCocoa.mm:
732         * platform/graphics/cocoa/FontCocoa.mm:
733         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
734         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
735         * platform/graphics/cocoa/IOSurface.mm:
736         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
737         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
738         * platform/graphics/ios/FontAntialiasingStateSaver.h:
739         * platform/graphics/ios/FontCacheIOS.mm:
740         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
741         * platform/graphics/mac/FontCacheMac.mm:
742         * platform/graphics/mac/GlyphPageMac.cpp:
743         * platform/graphics/win/FontCacheWin.cpp:
744         * platform/ios/LegacyTileCache.mm:
745         * platform/ios/LegacyTileGrid.mm:
746         * platform/ios/LegacyTileGridTile.mm:
747         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
748         * platform/ios/QuickLook.mm:
749         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
750         * platform/ios/WebAVPlayerController.h:
751         * platform/ios/WebAVPlayerController.mm:
752         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
753         * platform/ios/wak/WKGraphics.mm:
754         * platform/mac/DragImageMac.mm:
755         * platform/mac/PlatformScreenMac.mm:
756         * platform/mac/PlaybackSessionInterfaceMac.mm:
757         * platform/mac/ThemeMac.mm:
758         * platform/mac/VideoFullscreenInterfaceMac.mm:
759         * platform/mac/WebPlaybackControlsManager.h:
760         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
761         * platform/network/cocoa/CookieStorageObserver.mm:
762         * platform/network/cocoa/NetworkLoadMetrics.mm:
763         * platform/network/mac/AuthenticationMac.mm:
764         * platform/network/mac/ResourceHandleMac.mm:
765         * platform/spi/ios/DataDetectorsUISPI.h:
766         * platform/spi/mac/DataDetectorsSPI.h:
767         * platform/spi/mac/NSViewSPI.h:
768         * rendering/RenderThemeCocoa.mm:
769         * rendering/RenderThemeIOS.mm:
770         * rendering/RenderThemeMac.mm:
771
772 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
773
774         [WTF] Move TextStream into WTF
775         https://bugs.webkit.org/show_bug.cgi?id=175211
776
777         Reviewed by Myles C. Maxfield.
778
779         No new tests. No change in behavior.
780
781         * CMakeLists.txt:
782         * WebCore.xcodeproj/project.pbxproj:
783         * dom/ComposedTreeIterator.cpp:
784         * dom/Position.cpp:
785         * dom/Position.h:
786         * dom/Range.cpp:
787         (WebCore::operator<<):
788         * dom/Range.h:
789         * dom/ViewportArguments.cpp:
790         * dom/ViewportArguments.h:
791         * editing/VisiblePosition.cpp:
792         * editing/VisiblePosition.h:
793         * editing/VisibleSelection.cpp:
794         * editing/VisibleSelection.h:
795         * html/HTMLVideoElement.cpp:
796         * html/canvas/CanvasRenderingContext2D.cpp:
797         * page/FrameView.cpp:
798         * page/ViewportConfiguration.cpp:
799         * page/ViewportConfiguration.h:
800         * page/WheelEventDeltaFilter.cpp:
801         * page/animation/CSSPropertyAnimation.cpp:
802         * page/scrolling/AsyncScrollingCoordinator.cpp:
803         * page/scrolling/ScrollingConstraints.cpp:
804         * page/scrolling/ScrollingConstraints.h:
805         * page/scrolling/ScrollingCoordinator.cpp:
806         * page/scrolling/ScrollingCoordinator.h:
807         * page/scrolling/ScrollingStateFixedNode.cpp:
808         * page/scrolling/ScrollingStateFixedNode.h:
809         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
810         * page/scrolling/ScrollingStateFrameScrollingNode.h:
811         * page/scrolling/ScrollingStateNode.cpp:
812         * page/scrolling/ScrollingStateNode.h:
813         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
814         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
815         * page/scrolling/ScrollingStateScrollingNode.cpp:
816         * page/scrolling/ScrollingStateScrollingNode.h:
817         * page/scrolling/ScrollingStateStickyNode.cpp:
818         * page/scrolling/ScrollingStateStickyNode.h:
819         * page/scrolling/ScrollingTree.cpp:
820         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
821         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
822         * page/scrolling/ScrollingTreeNode.cpp:
823         * page/scrolling/ScrollingTreeNode.h:
824         * page/scrolling/ScrollingTreeScrollingNode.cpp:
825         * page/scrolling/ScrollingTreeScrollingNode.h:
826         * page/scrolling/mac/ScrollingTreeFixedNode.h:
827         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
828         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
829         * page/scrolling/mac/ScrollingTreeStickyNode.h:
830         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
831         * platform/CalculationValue.cpp:
832         * platform/CalculationValue.h:
833         * platform/LayoutUnit.cpp:
834         * platform/LayoutUnit.h:
835         * platform/Length.cpp:
836         * platform/Length.h:
837         * platform/LengthBox.cpp:
838         * platform/LengthBox.h:
839         * platform/LengthPoint.cpp:
840         * platform/LengthPoint.h:
841         * platform/LengthSize.cpp:
842         * platform/LengthSize.h:
843         * platform/LogMacros.h:
844         * platform/ScrollView.cpp:
845         * platform/ScrollableArea.cpp:
846         * platform/animation/TimingFunction.cpp:
847         * platform/animation/TimingFunction.h:
848         * platform/graphics/BitmapImage.cpp:
849         * platform/graphics/BitmapImage.h:
850         * platform/graphics/Color.cpp:
851         * platform/graphics/Color.h:
852         * platform/graphics/CrossfadeGeneratedImage.cpp:
853         * platform/graphics/CrossfadeGeneratedImage.h:
854         * platform/graphics/FloatPoint.cpp:
855         * platform/graphics/FloatPoint.h:
856         * platform/graphics/FloatPoint3D.cpp:
857         * platform/graphics/FloatPoint3D.h:
858         * platform/graphics/FloatRect.cpp:
859         * platform/graphics/FloatRect.h:
860         * platform/graphics/FloatRoundedRect.cpp:
861         * platform/graphics/FloatRoundedRect.h:
862         * platform/graphics/FloatSize.cpp:
863         * platform/graphics/FloatSize.h:
864         * platform/graphics/FontTaggedSettings.cpp:
865         * platform/graphics/FontTaggedSettings.h:
866         * platform/graphics/GradientImage.cpp:
867         (WebCore::GradientImage::dump const):
868         * platform/graphics/GradientImage.h:
869         * platform/graphics/GraphicsContext.cpp:
870         * platform/graphics/GraphicsContext.h:
871         * platform/graphics/GraphicsLayer.cpp:
872         * platform/graphics/GraphicsLayer.h:
873         (WebCore::GraphicsLayer::dumpAdditionalProperties const):
874         * platform/graphics/GraphicsTypes.cpp:
875         * platform/graphics/GraphicsTypes.h:
876         * platform/graphics/Image.cpp:
877         * platform/graphics/Image.h:
878         * platform/graphics/ImageSource.h:
879         * platform/graphics/IntPoint.cpp:
880         * platform/graphics/IntPoint.h:
881         * platform/graphics/IntRect.cpp:
882         * platform/graphics/IntRect.h:
883         * platform/graphics/IntSize.cpp:
884         * platform/graphics/IntSize.h:
885         * platform/graphics/LayoutPoint.cpp:
886         * platform/graphics/LayoutPoint.h:
887         * platform/graphics/LayoutRect.cpp:
888         * platform/graphics/LayoutRect.h:
889         * platform/graphics/LayoutSize.cpp:
890         * platform/graphics/LayoutSize.h:
891         * platform/graphics/NamedImageGeneratedImage.cpp:
892         * platform/graphics/NamedImageGeneratedImage.h:
893         * platform/graphics/Path.cpp:
894         * platform/graphics/Path.h:
895         * platform/graphics/ca/GraphicsLayerCA.cpp:
896         * platform/graphics/ca/GraphicsLayerCA.h:
897         * platform/graphics/ca/PlatformCAAnimation.cpp:
898         * platform/graphics/ca/PlatformCAAnimation.h:
899         * platform/graphics/ca/PlatformCALayer.cpp:
900         * platform/graphics/ca/PlatformCALayer.h:
901         * platform/graphics/ca/TileController.cpp:
902         * platform/graphics/ca/TileGrid.cpp:
903         * platform/graphics/cg/GraphicsContextCG.cpp:
904         * platform/graphics/cg/PDFDocumentImage.cpp:
905         * platform/graphics/cg/PDFDocumentImage.h:
906         * platform/graphics/cocoa/IOSurface.h:
907         * platform/graphics/cocoa/IOSurface.mm:
908         * platform/graphics/displaylists/DisplayList.cpp:
909         (WebCore::DisplayList::DisplayList::description const):
910         * platform/graphics/displaylists/DisplayList.h:
911         * platform/graphics/displaylists/DisplayListItems.cpp:
912         * platform/graphics/displaylists/DisplayListItems.h:
913         * platform/graphics/displaylists/DisplayListRecorder.cpp:
914         * platform/graphics/displaylists/DisplayListReplayer.cpp:
915         * platform/graphics/filters/DistantLightSource.cpp:
916         * platform/graphics/filters/DistantLightSource.h:
917         * platform/graphics/filters/FEBlend.cpp:
918         * platform/graphics/filters/FEBlend.h:
919         * platform/graphics/filters/FEColorMatrix.cpp:
920         * platform/graphics/filters/FEColorMatrix.h:
921         * platform/graphics/filters/FEComponentTransfer.cpp:
922         * platform/graphics/filters/FEComponentTransfer.h:
923         * platform/graphics/filters/FEComposite.cpp:
924         * platform/graphics/filters/FEComposite.h:
925         * platform/graphics/filters/FEConvolveMatrix.cpp:
926         * platform/graphics/filters/FEConvolveMatrix.h:
927         * platform/graphics/filters/FEDiffuseLighting.cpp:
928         * platform/graphics/filters/FEDiffuseLighting.h:
929         * platform/graphics/filters/FEDisplacementMap.cpp:
930         * platform/graphics/filters/FEDisplacementMap.h:
931         * platform/graphics/filters/FEDropShadow.cpp:
932         * platform/graphics/filters/FEDropShadow.h:
933         * platform/graphics/filters/FEFlood.cpp:
934         * platform/graphics/filters/FEFlood.h:
935         * platform/graphics/filters/FEGaussianBlur.cpp:
936         * platform/graphics/filters/FEGaussianBlur.h:
937         * platform/graphics/filters/FEMerge.cpp:
938         * platform/graphics/filters/FEMerge.h:
939         * platform/graphics/filters/FEMorphology.cpp:
940         * platform/graphics/filters/FEMorphology.h:
941         * platform/graphics/filters/FEOffset.cpp:
942         * platform/graphics/filters/FEOffset.h:
943         * platform/graphics/filters/FESpecularLighting.cpp:
944         * platform/graphics/filters/FESpecularLighting.h:
945         * platform/graphics/filters/FETile.cpp:
946         * platform/graphics/filters/FETile.h:
947         * platform/graphics/filters/FETurbulence.cpp:
948         * platform/graphics/filters/FETurbulence.h:
949         * platform/graphics/filters/FilterEffect.cpp:
950         * platform/graphics/filters/FilterEffect.h:
951         * platform/graphics/filters/FilterOperation.cpp:
952         * platform/graphics/filters/FilterOperation.h:
953         * platform/graphics/filters/FilterOperations.cpp:
954         * platform/graphics/filters/FilterOperations.h:
955         * platform/graphics/filters/LightSource.h:
956         * platform/graphics/filters/PointLightSource.cpp:
957         * platform/graphics/filters/PointLightSource.h:
958         * platform/graphics/filters/SourceAlpha.cpp:
959         * platform/graphics/filters/SourceAlpha.h:
960         * platform/graphics/filters/SourceGraphic.cpp:
961         * platform/graphics/filters/SourceGraphic.h:
962         * platform/graphics/filters/SpotLightSource.cpp:
963         * platform/graphics/filters/SpotLightSource.h:
964         * platform/graphics/transforms/AffineTransform.cpp:
965         * platform/graphics/transforms/AffineTransform.h:
966         * platform/graphics/transforms/IdentityTransformOperation.h:
967         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
968         * platform/graphics/transforms/Matrix3DTransformOperation.h:
969         * platform/graphics/transforms/MatrixTransformOperation.cpp:
970         * platform/graphics/transforms/MatrixTransformOperation.h:
971         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
972         * platform/graphics/transforms/PerspectiveTransformOperation.h:
973         * platform/graphics/transforms/RotateTransformOperation.cpp:
974         * platform/graphics/transforms/RotateTransformOperation.h:
975         * platform/graphics/transforms/ScaleTransformOperation.cpp:
976         * platform/graphics/transforms/ScaleTransformOperation.h:
977         * platform/graphics/transforms/SkewTransformOperation.cpp:
978         * platform/graphics/transforms/SkewTransformOperation.h:
979         * platform/graphics/transforms/TransformOperation.cpp:
980         * platform/graphics/transforms/TransformOperation.h:
981         * platform/graphics/transforms/TransformOperations.cpp:
982         * platform/graphics/transforms/TransformOperations.h:
983         * platform/graphics/transforms/TransformationMatrix.cpp:
984         * platform/graphics/transforms/TransformationMatrix.h:
985         * platform/graphics/transforms/TranslateTransformOperation.cpp:
986         * platform/graphics/transforms/TranslateTransformOperation.h:
987         * platform/ios/SelectionRect.cpp:
988         (WebCore::operator<<):
989         * platform/ios/SelectionRect.h:
990         * platform/mac/ScrollAnimatorMac.mm:
991         * platform/text/TextAllInOne.cpp:
992         * rendering/InlineBox.cpp:
993         * rendering/InlineBox.h:
994         * rendering/InlineFlowBox.cpp:
995         (WebCore::InlineFlowBox::outputLineTreeAndMark const):
996         * rendering/InlineFlowBox.h:
997         * rendering/InlineTextBox.cpp:
998         * rendering/InlineTextBox.h:
999         * rendering/RenderBlockFlow.cpp:
1000         (WebCore::RenderBlockFlow::outputLineTreeAndMark const):
1001         * rendering/RenderBlockFlow.h:
1002         * rendering/RenderLayer.cpp:
1003         * rendering/RenderLayerCompositor.cpp:
1004         * rendering/RenderObject.cpp:
1005         * rendering/RenderObject.h:
1006         * rendering/RenderTreeAsText.cpp:
1007         * rendering/RenderTreeAsText.h:
1008         * rendering/ScrollAlignment.cpp:
1009         * rendering/ScrollAlignment.h:
1010         * rendering/SimpleLineLayoutCoverage.cpp:
1011         * rendering/SimpleLineLayoutFunctions.cpp:
1012         * rendering/SimpleLineLayoutFunctions.h:
1013         * rendering/style/FillLayer.cpp:
1014         * rendering/style/FillLayer.h:
1015         * rendering/style/NinePieceImage.cpp:
1016         * rendering/style/NinePieceImage.h:
1017         * rendering/style/RenderStyleConstants.cpp:
1018         * rendering/style/RenderStyleConstants.h:
1019         * rendering/svg/SVGRenderTreeAsText.cpp:
1020         (WebCore::operator<<):
1021         * rendering/svg/SVGRenderTreeAsText.h:
1022         (WebCore::operator<<):
1023         * svg/SVGLengthValue.cpp:
1024         * svg/SVGLengthValue.h:
1025         * svg/graphics/SVGImage.cpp:
1026         * svg/graphics/SVGImage.h:
1027         * svg/graphics/filters/SVGFEImage.cpp:
1028         * svg/graphics/filters/SVGFEImage.h:
1029
1030 2017-08-09  Commit Queue  <commit-queue@webkit.org>
1031
1032         Unreviewed, rolling out r220466, r220477, and r220487.
1033         https://bugs.webkit.org/show_bug.cgi?id=175411
1034
1035         This change broke existing API tests and follow up fixes did
1036         not resolve all the issues. (Requested by ryanhaddad on
1037         #webkit).
1038
1039         Reverted changesets:
1040
1041         https://bugs.webkit.org/show_bug.cgi?id=175244
1042         http://trac.webkit.org/changeset/220466
1043
1044         "WTF::Function does not allow for reference / non-default
1045         constructible return types"
1046         https://bugs.webkit.org/show_bug.cgi?id=175244
1047         http://trac.webkit.org/changeset/220477
1048
1049         https://bugs.webkit.org/show_bug.cgi?id=175244
1050         http://trac.webkit.org/changeset/220487
1051
1052 2017-08-09  Chris Dumez  <cdumez@apple.com>
1053
1054         [Beacon][NetworkSession] Support CORS-preflighting on redirects
1055         https://bugs.webkit.org/show_bug.cgi?id=175386
1056         <rdar://problem/33801370>
1057
1058         Reviewed by Youenn Fablet.
1059
1060         Export a couple of WebCore symbols so I can use them in WebKit2.
1061
1062         Tests: http/wpt/beacon/cors/cors-preflight-redirect-failure.html
1063                http/wpt/beacon/cors/cors-preflight-redirect-from-crossorigin-to-sameorigin.html
1064                http/wpt/beacon/cors/cors-preflight-redirect-success.html
1065
1066         * loader/CrossOriginAccessControl.h:
1067         * page/SecurityOrigin.h:
1068
1069 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
1070
1071         Use MPAVRoutingController instead of deprecated versions.
1072         https://bugs.webkit.org/show_bug.cgi?id=175063
1073
1074         Reviewed by Tim Horton.
1075
1076         No new tests because no behavior change. This uses a different platform class to present
1077         an interface.
1078
1079         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
1080         Add MPMediaControlsViewController.
1081
1082         * platform/spi/ios/MediaPlayerSPI.h:
1083
1084 2017-08-09  Myles C. Maxfield  <mmaxfield@apple.com>
1085
1086         Mark font-display as in development
1087         https://bugs.webkit.org/show_bug.cgi?id=175387
1088
1089         Unreviewed.
1090
1091         * features.json:
1092
1093 2017-08-09  Commit Queue  <commit-queue@webkit.org>
1094
1095         Unreviewed, rolling out r219334.
1096         https://bugs.webkit.org/show_bug.cgi?id=175398
1097
1098         Caused bug 175023 (Requested by ap on #webkit).
1099
1100         Reverted changeset:
1101
1102         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1103         https://bugs.webkit.org/show_bug.cgi?id=172545
1104         http://trac.webkit.org/changeset/219334
1105
1106 2017-08-09  Dave Hyatt  <hyatt@apple.com>
1107
1108         [Repaint from Layout Removal] Move layer repaint rects into a map
1109         https://bugs.webkit.org/show_bug.cgi?id=175393
1110
1111         Reviewed by Zalan Bujtas.
1112
1113         Move the two repaint rects held by RenderLayer into a RenderLayerModelObject -> RepaintLayoutRects hash map.
1114         RepaintLayoutRects is a new struct that holds both rects.
1115
1116         Eventually more objects than just self painting layers will be caching repaint rects, so this takes a first
1117         step towards having a common cache for these repaint rects. In addition this change saves memory, since
1118         layers that aren't self-painting no longer have empty repaint rects taking up space in RenderLayer.
1119
1120         * rendering/RenderBlockLineLayout.cpp:
1121         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
1122         * rendering/RenderLayer.cpp:
1123         (WebCore::RenderLayer::RenderLayer):
1124         (WebCore::RenderLayer::updateLayerPositions):
1125         (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants):
1126         (WebCore::RenderLayer::computeRepaintRects):
1127         (WebCore::RenderLayer::clearRepaintRects):
1128         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
1129         (WebCore::RenderLayer::scrollTo):
1130         * rendering/RenderLayer.h:
1131         * rendering/RenderLayerModelObject.cpp:
1132         (WebCore::RepaintLayoutRects::RepaintLayoutRects):
1133         (WebCore::RenderLayerModelObject::willBeDestroyed):
1134         (WebCore::RenderLayerModelObject::destroyLayer):
1135         (WebCore::RenderLayerModelObject::styleDidChange):
1136         (WebCore::RenderLayerModelObject::hasRepaintLayoutRects):
1137         (WebCore::RenderLayerModelObject::setRepaintLayoutRects):
1138         (WebCore::RenderLayerModelObject::clearRepaintLayoutRects):
1139         (WebCore::RenderLayerModelObject::repaintLayoutRects):
1140         (WebCore::RenderLayerModelObject::computeRepaintLayoutRects):
1141         * rendering/RenderLayerModelObject.h:
1142         (WebCore::RepaintLayoutRects::RepaintLayoutRects):
1143
1144 2017-08-09  Sam Weinig  <sam@webkit.org>
1145
1146         WTF::Function does not allow for reference / non-default constructible return types
1147         https://bugs.webkit.org/show_bug.cgi?id=175244
1148
1149         Reviewed by Chris Dumez.
1150
1151         * bindings/js/JSCustomElementInterface.h:
1152         (WebCore::JSCustomElementInterface::invokeCallback):
1153         Update the default value for the addArguments parameter to be an empty lambda, rather than
1154         default initialization, which leads to a null WTF::Function. This allows us to remove support
1155         for calling null WTF::Function. No change in behavior.
1156
1157 2017-08-09  Brady Eidson  <beidson@apple.com>
1158
1159         Teach ScriptExecutionContexts about their SessionID.
1160         https://bugs.webkit.org/show_bug.cgi?id=175391
1161
1162         Reviewed by Andy Estes.
1163
1164         No new tests (No current change in behavior).
1165
1166         Turns out that Workers need to know their SessionID for future feature development.
1167         So let's teach it to them.
1168
1169         * dom/ScriptExecutionContext.h: Expose a pure virtual SessionID accessor.
1170
1171         * dom/Document.cpp:
1172         (WebCore::Document::sessionID const):
1173         * dom/Document.h:
1174
1175         * page/SessionID.cpp:
1176         (WebCore::SessionID::isolatedCopy const):
1177         * page/SessionID.h:
1178
1179         * workers/DedicatedWorkerGlobalScope.cpp:
1180         (WebCore::DedicatedWorkerGlobalScope::create):
1181         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1182         * workers/DedicatedWorkerGlobalScope.h:
1183
1184         * workers/DedicatedWorkerThread.cpp:
1185         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1186         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1187         * workers/DedicatedWorkerThread.h:
1188
1189         * workers/Worker.cpp:
1190         (WebCore::Worker::notifyFinished):
1191
1192         * workers/WorkerGlobalScope.cpp:
1193         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1194         * workers/WorkerGlobalScope.h:
1195
1196         * workers/WorkerGlobalScopeProxy.h:
1197
1198         * workers/WorkerMessagingProxy.cpp:
1199         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1200         * workers/WorkerMessagingProxy.h:
1201
1202         * workers/WorkerThread.cpp:
1203         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1204         (WebCore::WorkerThread::WorkerThread):
1205         (WebCore::WorkerThread::workerThread):
1206         * workers/WorkerThread.h:
1207
1208 2017-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1209
1210         [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default
1211         https://bugs.webkit.org/show_bug.cgi?id=175392
1212         <rdar://problem/33783207>
1213
1214         Reviewed by Tim Horton and Megan Gardner.
1215
1216         Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10).
1217         No change in behavior.
1218
1219         * Configurations/FeatureDefines.xcconfig:
1220
1221 2017-08-09  Kirill Ovchinnikov  <kirill.ovchinnikov@lge.com>
1222
1223         Old subtitle track is not deleted on 'src' attribute change event
1224         https://bugs.webkit.org/show_bug.cgi?id=175031
1225
1226         Reviewed by Eric Carlson.
1227
1228         Test: media/track/text-track-src-change.html
1229
1230         * html/HTMLMediaElement.cpp:
1231         (WebCore::HTMLMediaElement::textTrackReadyStateChanged):
1232         * html/HTMLTrackElement.cpp:
1233         (WebCore::HTMLTrackElement::loadTimerFired):
1234         * html/shadow/MediaControls.cpp:
1235         (WebCore::MediaControls::clearTextDisplayContainer):
1236         * html/shadow/MediaControls.h:
1237
1238 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
1239
1240         Unreviewed, rolling out r220457.
1241
1242         This change introduced API test failures.
1243
1244         Reverted changeset:
1245
1246         "WTF::Function does not allow for reference / non-default
1247         constructible return types"
1248         https://bugs.webkit.org/show_bug.cgi?id=175244
1249         http://trac.webkit.org/changeset/220457
1250
1251 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
1252
1253         [WinCairo] Fix build after rev 220399
1254         https://bugs.webkit.org/show_bug.cgi?id=175360
1255
1256         Reviewed by Žan Doberšek.
1257
1258         No new tests. No change in behavior.
1259
1260         * platform/graphics/texmap/TextureMapperGLHeaders.h:
1261
1262 2017-08-09  Nan Wang  <n_wang@apple.com>
1263
1264         AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
1265         https://bugs.webkit.org/show_bug.cgi?id=175340
1266         <rdar://problem/33782159>
1267
1268         Reviewed by Chris Fleizach.
1269
1270         When adding a psuedo element child to a RenderBlockFlow element, there might be a chance where
1271         the element has already been layed out but we are still holding onto its stale children. Fixed it
1272         by notifying AX correctly when inserting/removing children during layout.
1273
1274         Test: accessibility/add-children-pseudo-element.html
1275
1276         * rendering/RenderBlockFlow.cpp:
1277         (WebCore::RenderBlockFlow::insertFloatingObject):
1278         (WebCore::RenderBlockFlow::removeFloatingObject):
1279
1280 2017-08-09  Charlie Turner  <cturner@igalia.com>
1281
1282         [GStreamer][MSE] Add missing lock around getStreamByTrackId
1283         https://bugs.webkit.org/show_bug.cgi?id=175323
1284
1285         Reviewed by Xabier Rodriguez-Calvar.
1286
1287         Covered by existing tests.
1288
1289         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1290         (WebCore::PlaybackPipeline::enqueueSample): Ensure the media source
1291         lock is taken before modifiying the track queues indirectly via the
1292         iterator use in getTrackId.
1293
1294 2017-08-09  Daniel Bates  <dabates@apple.com>
1295
1296         REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication
1297         https://bugs.webkit.org/show_bug.cgi?id=175247
1298         <rdar://problem/33679804>
1299
1300         Reviewed by Brady Eidson.
1301
1302         Add SPI so that Safari can differentiate between a form submission and a redirected form submission
1303         and have PolicyCheck notify the frame loader client if the navigation was in response to receiving a
1304         redirect response. This is the WebKit portion to fix an issue when a native app makes use of an OAuth
1305         OAuth flow that bounces to Safari for user login and then bounce back to the app. Microsoft Graph's
1306         OAuth flow is one example.
1307
1308         Safari was differentiating between a form submission and a redirected form submission based on the
1309         nullity of WKNavigationAction.sourceFrame because in both cases the navigation type was WKNavigationTypeFormSubmitted.
1310         The navigation type is the same for both navigations because WebKit always used the navigation
1311         action from the original request for the redirect request when the original request redirected.
1312         Prior to r219013, WKNavigationAction.sourceFrame would be nil for a form submission that redirects.
1313         Following r219013, WKNavigationAction.sourceFrame is non-nil unless the navigation was initiated by
1314         API. In particular, WKNavigationAction.sourceFrame is non-nil for the redirect navigation corresponding
1315         to a form submission that redirects.
1316
1317         * loader/EmptyClients.cpp:
1318         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1319         * loader/FrameLoaderClient.h:
1320         Have dispatchDecidePolicyForNavigationAction() take a boolean as to whether the navigation was in
1321         response to receiving a redirect response.
1322         * loader/PolicyChecker.cpp:
1323         (WebCore::PolicyChecker::checkNavigationPolicy): Notify the frame loader client whether the navigation
1324         is in response to receiving a redirect response.
1325
1326 2017-08-09  Sam Weinig  <sam@webkit.org>
1327
1328         WTF::Function does not allow for reference / non-default constructible return types
1329         https://bugs.webkit.org/show_bug.cgi?id=175244
1330
1331         Reviewed by Chris Dumez.
1332
1333         * bindings/js/JSCustomElementInterface.h:
1334         (WebCore::JSCustomElementInterface::invokeCallback):
1335         Update the default value for the addArguments parameter to be an empty lambda, rather than
1336         default initialization, which leads to a null WTF::Function. This allows us to remove support
1337         for calling null WTF::Function. No change in behavior.
1338
1339 2017-08-09  Andy Estes  <aestes@apple.com>
1340
1341         [QuickLook] Use case-insensitive comparison of preview MIME types
1342         https://bugs.webkit.org/show_bug.cgi?id=175350
1343         <rdar://problem/33761159>
1344
1345         Reviewed by Brady Eidson.
1346
1347         MIME types are case-insensitive, but PreviewLoader was using a case-sensitive comparison to
1348         determine if a MIME type was supported by QLPreviewConverter. As a result we would fail to
1349         preview Excel macro-enabled workbooks, since CFNetwork would sniff a MIME type of
1350         "application/vnd.ms-excel.sheet.macroEnabled.12" but QuickLook contained
1351         "application/vnd.ms-excel.sheet.macroenabled.12" in its set of supported MIME type strings.
1352
1353         Fix this by copying the QuickLook supported MIME type set into a HashSet using
1354         ASCIICaseInsensitiveHash and using that HashSet for MIME type checks.
1355
1356         Test: quicklook/excel-macro-enabled.html
1357
1358         * loader/ios/PreviewLoader.mm:
1359         (WebCore::PreviewLoader::shouldCreateForMIMEType):
1360
1361 2017-08-09  Ms2ger  <Ms2ger@igalia.com>
1362
1363         Remove unnecessary copies of PlatformMediaSessionManager::m_sessions
1364         https://bugs.webkit.org/show_bug.cgi?id=175375
1365
1366         Reviewed by Sam Weinig.
1367
1368         Remove unnecessary copies of PlatformMediaSessionManager::m_sessions.
1369
1370         These should have been removed in r207688.
1371
1372         No new tests: no behavior change.
1373
1374         * platform/audio/PlatformMediaSessionManager.cpp:
1375         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
1376         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
1377         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
1378         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
1379
1380 2017-08-09  Chris Dumez  <cdumez@apple.com>
1381
1382         Reinstate active flag for iterators
1383         https://bugs.webkit.org/show_bug.cgi?id=175312
1384
1385         Reviewed by Sam Weinig.
1386
1387         NodeIterator / TreeWalker should no longer allow recursive filters
1388         after the following change to the DOM specification:
1389         - https://github.com/whatwg/dom/pull/359
1390
1391         This patch aligns our behavior with the latest specification.
1392
1393         No new tests, updated existing tests.
1394
1395         * dom/NodeIterator.cpp:
1396         (WebCore::NodeIterator::nextNode):
1397         (WebCore::NodeIterator::previousNode):
1398         Note that we now also call m_candidateNode.clear() before returning an
1399         exception. This was a pre-existing bug that we failed to do so in the
1400         exception case but it became more obvious after this change now that
1401         we throw. This was causing traversal/moz-bug559526.html to fail
1402         otherwise (the filter was called one too many times). The test case
1403         is passing in Firefox (The filter is called 4 times and they throw
1404         each time).
1405
1406         * dom/Traversal.cpp:
1407         (WebCore::NodeIteratorBase::NodeIteratorBase):
1408         (WebCore::NodeIteratorBase::acceptNode):
1409         * dom/Traversal.h:
1410         * dom/TreeWalker.cpp:
1411
1412 2017-08-09  Antti Koivisto  <antti@apple.com>
1413
1414         RenderQuote should not mutate render tree
1415         https://bugs.webkit.org/show_bug.cgi?id=175328
1416
1417         Reviewed by Zalan Bujtas.
1418
1419         RenderQuote text renderers are currently created and deleted in a quirky fashion using a linked list.
1420         This patch moves to a simpler model that guarantees the mutations are always done in controlled fashion
1421         during render tree update.
1422
1423         * dom/Document.cpp:
1424         (WebCore::Document::updateTextRenderer):
1425
1426             Move text renderer updating to Document so we can set the inRenderTreeUpdate bit for it too.
1427
1428         * dom/Document.h:
1429         * dom/Text.cpp:
1430         (WebCore::Text::updateRendererAfterContentChange):
1431         * rendering/RenderDescendantIterator.h:
1432         (WebCore::RenderDescendantIteratorAdapter<T>::at):
1433         (WebCore::RenderDescendantConstIteratorAdapter<T>::at const):
1434
1435             Add at() function for starting iteration from a specified renderer.
1436
1437         * rendering/RenderQuote.cpp:
1438         (WebCore::RenderQuote::insertedIntoTree):
1439         (WebCore::RenderQuote::willBeRemovedFromTree):
1440
1441             Register and unregister quotes to RenderView.
1442             Don't do any mutations.
1443
1444         (WebCore::RenderQuote::styleDidChange):
1445
1446             Invalidate the text renderer but don't mutate it.
1447
1448         (WebCore::RenderQuote::updateTextRenderer):
1449         (WebCore::RenderQuote::computeText const):
1450         (WebCore::RenderQuote::updateRenderers):
1451
1452             Compute depth of all render quotes and update the text renderer as needed.
1453
1454         (WebCore::RenderQuote::willBeDestroyed): Deleted.
1455         (WebCore::RenderQuote::attachQuote): Deleted.
1456         (WebCore::RenderQuote::detachQuote): Deleted.
1457         (WebCore::RenderQuote::updateDepth): Deleted.
1458
1459             Get rid of the linked list.
1460
1461         * rendering/RenderQuote.h:
1462         * rendering/RenderView.cpp:
1463         (WebCore::RenderView::registerQuote):
1464         (WebCore::RenderView::unregisterQuote):
1465
1466             Maintain a render tree order ListHashSet of RenderQuotes.
1467
1468         (WebCore::RenderView::updateSpecialRenderers):
1469
1470             Add a function for making additional render tree mutations at the end of a render tree update.
1471             Currently this just invokes RenderQuote::updateRenderers.
1472
1473         * rendering/RenderView.h:
1474         * style/RenderTreeUpdater.cpp:
1475         (WebCore::RenderTreeUpdater::commit):
1476
1477             Call RenderView::updateSpecialRenderers after committing all other changes.
1478
1479 2017-08-09  Zan Dobersek  <zdobersek@igalia.com>
1480
1481         [Soup] Incorrect conversion in msToSoupDate()
1482         https://bugs.webkit.org/show_bug.cgi?id=175320
1483
1484         Reviewed by Carlos Garcia Campos.
1485
1486         Original patch by VaL Doroshchuk.
1487
1488         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1489         (WebCore::msToSoupDate): monthFromDayInYear() returns a value in the [0,11] range,
1490         while soup_date_new() expects a month value in the [1,12] range. The return value
1491         must be thus incremented by one to match that expectation.
1492
1493 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1494
1495         Unreviewed, rolling out r220393.
1496
1497         This patch regresses the performance of WebPage::editorState.
1498
1499         Reverted changeset:
1500
1501         "[iOS WK2] WKWebView schedules nonstop layout after pressing
1502         cmb+b,i,u inside a contenteditable div"
1503         https://bugs.webkit.org/show_bug.cgi?id=175116
1504         http://trac.webkit.org/changeset/220393
1505
1506 2017-08-08  Chris Dumez  <cdumez@apple.com>
1507
1508         [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION
1509         https://bugs.webkit.org/show_bug.cgi?id=175264
1510         <rdar://problem/33547793>
1511
1512         Reviewed by Youenn Fablet.
1513
1514         Pass additional information when creating a PingHandle so that the PingLoad
1515         can deal with CORS-preflighting on Network process side.
1516
1517         Tests: http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html
1518                http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html
1519                http/wpt/beacon/cors/cors-preflight-blob-failure.html
1520                http/wpt/beacon/cors/cors-preflight-blob-success.html
1521                http/wpt/beacon/cors/cors-preflight-cookie.html
1522
1523         * WebCore.xcodeproj/project.pbxproj:
1524         * loader/CrossOriginAccessControl.cpp:
1525         (WebCore::validatePreflightResponse):
1526         * loader/CrossOriginAccessControl.h:
1527         * loader/CrossOriginPreflightChecker.cpp:
1528         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
1529         * loader/CrossOriginPreflightResultCache.h:
1530         * loader/LoaderStrategy.h:
1531         * loader/PingLoader.cpp:
1532         (WebCore::PingLoader::loadImage):
1533         (WebCore::PingLoader::sendPing):
1534         (WebCore::PingLoader::sendViolationReport):
1535         (WebCore::PingLoader::startPingLoad):
1536         * loader/PingLoader.h:
1537         * loader/cache/CachedResource.cpp:
1538         (WebCore::CachedResource::load):
1539         * page/SecurityOrigin.h:
1540
1541 2017-08-08  Sam Weinig  <sam@webkit.org>
1542
1543         Address review feedback from https://bugs.webkit.org/show_bug.cgi?id=175246.
1544
1545         * bindings/js/DOMPromiseProxy.h:
1546         * css/FontFaceSet.cpp:
1547         * css/FontFaceSet.h:
1548
1549 2017-08-08  Devin Rousso  <drousso@apple.com>
1550
1551         Web Inspector: Canvas: support editing WebGL shaders
1552         https://bugs.webkit.org/show_bug.cgi?id=124211
1553         <rdar://problem/15448958>
1554
1555         Reviewed by Matt Baker.
1556
1557         Test: inspector/canvas/updateShader.html
1558
1559         * inspector/InspectorCanvasAgent.h:
1560         * inspector/InspectorCanvasAgent.cpp:
1561         (WebCore::InspectorCanvasAgent::updateShader):
1562
1563         * html/canvas/WebGLRenderingContextBase.h:
1564         * html/canvas/WebGLRenderingContextBase.cpp:
1565         (WebCore::WebGLRenderingContextBase::linkProgram):
1566         (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
1567         Normally, when a program is linked, it invalidates any WebGLUniformLocation associated with
1568         the program by incrementing its `linkCount`. In order to allow live editing of shaders, we
1569         need to be able to compile and link a shader without invalidating these locations. This
1570         patch moves the shader linking logic to its own function that is called by `linkProgram` so
1571         that InspectorCanvasAgent can compile and link without invalidation.
1572
1573 2017-08-08  Sam Weinig  <sam@webkit.org>
1574
1575         [WebIDL] Add support for Promise<> attributes
1576         https://bugs.webkit.org/show_bug.cgi?id=175246
1577
1578         Reviewed by Yusuke Suzuki.
1579
1580         Introduces and adopts DOMPromiseProxy, a new class for binding promises in a more
1581         straightforward and safe (from a wrapper world perspective) way.
1582
1583         * CMakeLists.txt:
1584         * WebCore.xcodeproj/project.pbxproj:
1585         * bindings/js/JSFontFaceCustom.cpp: Removed.
1586         * bindings/js/JSFontFaceSetCustom.cpp: Removed.
1587         * bindings/js/JSMediaKeySessionCustom.cpp: Removed.
1588         * bindings/js/JSServiceWorkerContainerCustom.cpp: Removed.
1589         * bindings/js/JSWebGPUCommandBufferCustom.cpp: Removed.
1590
1591             Remove custom bindings only needed for promise attributes. Add DOMPromiseProxy.h
1592
1593         * Modules/encryptedmedia/MediaKeySession.cpp:
1594         (WebCore::MediaKeySession::sessionClosed):
1595         (WebCore::MediaKeySession::registerClosedPromise): Deleted.
1596         * Modules/encryptedmedia/MediaKeySession.h:
1597         * Modules/encryptedmedia/MediaKeySession.idl:
1598
1599             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
1600
1601         * bindings/IDLTypes.h:
1602
1603             Add StorageType type alias to allow specifying a specific form for storage. This allows
1604             use to use Ref<> for interfaces in DOMPromiseProxy.
1605
1606         (WebCore::IDLWrapper::convertToParameterType):
1607             
1608             Also add convertToParameterType, an annoying hack to workaround the fact WTF::Function
1609             can't return references / no
1610
1611         * bindings/js/DOMPromiseProxy.h: Added.
1612         (WebCore::DOMPromiseProxy<IDLType>):
1613         
1614             DOMPromiseProxy is a new class (set of classes) to represent promises that works with the 
1615             standard toJS<> / JSDOMConvert infrastructure used by the bindings generator. From the
1616             implementation perspective, it is similar to DOMPromiseDeferred, but instead of receiving
1617             one as a parameter, you can initialize it directly in your constructor and start using it.
1618
1619             From the bindings perspective, a DOMPromiseProxy can be converted into a JS Promise by calling
1620             its promise function, which will either create a new promise, or return a cached one.
1621
1622             To make this work, DOMPromiseProxy maintains a Vector of DeferredPromises that hold onto those
1623             actualized promises. The reason it has a Vector, is that we need one DeferredPromises per
1624             DOMWrapperWorld, just like we need one wrapper for an interface per DOMWrapperWorld in the 
1625             wrapper cache. In most cases, only the normal world will be in play, so the Vector has an inline
1626             capacity of one.
1627             
1628             In addition, DOMPromiseProxy maintains a Variant of either an Exception or the result value type.
1629             This allows the DOMPromiseProxy to be resolved or rejected at anytime. Then, when the bindings
1630             request the promise, the stored result / exception can be resolved / rejected into the promise.
1631
1632         (WebCore::DOMPromiseProxy<IDLVoid>):
1633
1634             For void promises, we need slightly different semantics (resolve takes no parameters, Value is
1635             a bit indicating resolved state), so it is specialized.
1636
1637         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>):
1638
1639             In addition to the void specialization, we have DOMPromiseProxyWithResolveCallback. Instead of
1640             storing the value of the resolution directly, this specialization allows the owner to specify
1641             callback to be called when the resolved value is needed. This is needed to avoid reference
1642             cycles when the resolved value is the owner such as is the case with FontFace and FontFaceSet.
1643
1644         * bindings/js/JSDOMConvertPromise.h:
1645         (WebCore::JSConverter<IDLPromise<T>>::convert):
1646         Add converter that calls through to the DOMPromiseProxy function promise.
1647
1648         * bindings/js/JSDOMPromiseDeferred.cpp:
1649         (WebCore::DeferredPromise::callFunction):
1650         (WebCore::DeferredPromise::reject):
1651         * bindings/js/JSDOMPromiseDeferred.h:
1652         (WebCore::DeferredPromise::create):
1653         (WebCore::DeferredPromise::DeferredPromise):
1654
1655             Add a new create function for DeferredPromise that creates the JSPromiseDeferred for you.
1656             Also adds a mode to DeferredPromise to allow keeping the promise after resolution. Maintain
1657             the old behavior as the default.
1658
1659             Change reject to take an Exception as sink rather than an r-value, to allow DOMPromiseProxy
1660             to copy a Exception into multiple DeferredPromises. For callers already moving into reject,
1661             this should be no change.
1662
1663         * bindings/scripts/CodeGeneratorJS.pm:
1664         (AddToIncludesForIDLType):
1665         (GenerateParametersCheck):
1666         (GenerateImplementationFunctionCall):
1667         (NativeToJSValueDOMConvertNeedsState):
1668         (NativeToJSValueDOMConvertNeedsGlobalObject):
1669
1670             Add support DOMPromiseProxy. For now, this means a new extended attribute, [PromiseProxy],
1671             but once I convert all the existing promises over to using DOMPromiseProxy, it will be removed.
1672             
1673             Also specify the right #includes for promises and necessary parameters for conversion.
1674
1675         * bindings/scripts/IDLAttributes.json:
1676         
1677             Add [PromiseProxy], a temporary extended attribute for using DOMPromiseProxy.
1678
1679         * css/FontFace.cpp:
1680         * css/FontFace.h:
1681         * css/FontFace.idl:
1682         * css/FontFaceSet.cpp:
1683         * css/FontFaceSet.h:
1684         * css/FontFaceSet.idl:
1685
1686             Replace custom promise code using the registerPromise idiom with DOMPromiseProxyWithResolveCallback.
1687             The callback is necessary for these two classes since the value the resolve is themselves, and using
1688             a normal resolve would create a cycle.
1689
1690         * html/canvas/WebGPUCommandBuffer.cpp:
1691         * html/canvas/WebGPUCommandBuffer.h:
1692         * html/canvas/WebGPUCommandBuffer.idl:
1693         * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
1694         * platform/graphics/gpu/GPUCommandBuffer.cpp:
1695         * platform/graphics/gpu/GPUCommandBuffer.h:
1696
1697             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
1698
1699         * page/NavigatorBase.cpp:
1700         (WebCore::NavigatorBase::NavigatorBase):
1701         * page/NavigatorBase.h:
1702
1703             Forward declare ServiceWorkerContainer and add an explicit constructor to allow
1704             removing #include of ServiceWorkerContainer.h in the header, avoiding an #include cycle.
1705
1706         * workers/ServiceWorkerContainer.cpp:
1707         * workers/ServiceWorkerContainer.h:
1708         * workers/ServiceWorkerContainer.idl:
1709
1710             Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
1711
1712         * bindings/scripts/test/JS/JSTestObj.cpp:
1713         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1714         * bindings/scripts/test/TestObj.idl:
1715
1716             Add / update tests.
1717
1718 2017-08-08  John Wilander  <wilander@apple.com>
1719
1720         Resource Load Statistics: Merge of dataRecordsRemoved should use std::max()
1721         https://bugs.webkit.org/show_bug.cgi?id=175348
1722         <rdar://problem/33785695>
1723
1724         Reviewed by Chris Dumez.
1725
1726         No new tests. Online change of a statistic that doesn't affect logic flow.
1727
1728         * loader/ResourceLoadStatistics.cpp:
1729         (WebCore::ResourceLoadStatistics::merge):
1730             Now uses std::max() instead of addition.
1731
1732 2017-08-08  Brent Fulgham  <bfulgham@apple.com>
1733
1734         Sandbox flags do not support document.domain control
1735         https://bugs.webkit.org/show_bug.cgi?id=175281
1736         <rdar://problem/33778936>
1737
1738         Reviewed by Chris Dumez.
1739
1740         Update the 'setDomain' logic to honor the sandbox properties as defined in the current
1741         HTML5 specification. This brings us in line with how Chrome and other browsers have
1742         worked for some time.
1743
1744         Test: fast/frames/sandboxed-iframe-domain.html
1745
1746         * dom/Document.cpp:
1747         (WebCore::Document::setDomain): Add check for sandbox flag (with appropriate error message)
1748         * dom/SecurityContext.h:
1749
1750 2017-08-08  Jeremy Jones  <jeremyj@apple.com>
1751
1752         Change fast seek logic to prevent ping-ponging.
1753         https://bugs.webkit.org/show_bug.cgi?id=175167
1754         rdar://problem/32936116
1755
1756         Reviewed by Jer Noble.
1757
1758         Updated test: media/video-fast-seek.html
1759
1760         Changed fast seek behavior to always seek early than seek time; and after current time when seeking forward.
1761         This prevents ping-ponging, where a fast seek overshoots the target looking for a keyframe.
1762         A subsequent seek will suddenly be on the other side of current time and
1763         will search in the opposite direction for a key frame; repeat.
1764
1765         * html/HTMLMediaElement.cpp:
1766         (WebCore::HTMLMediaElement::fastSeek):
1767
1768 2017-08-08  Ms2ger  <Ms2ger@igalia.com>
1769
1770         Unreviewed. Correct the function name in a debug message.
1771         https://bugs.webkit.org/show_bug.cgi?id=175262
1772
1773         No new tests: debug logs are not tested.
1774
1775         * platform/audio/PlatformMediaSessionManager.cpp:
1776         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
1777
1778 2017-08-08  Brent Fulgham  <bfulgham@apple.com>
1779
1780         Unreviewed build fix after r220376.
1781
1782         Don't attempt to use isPublicSuffix when building without that
1783         feature enabled.
1784
1785         * dom/Document.cpp:
1786         (WebCore::Document::domainIsRegisterable const):
1787
1788 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
1789
1790         [CMake] Properly test if compiler supports compiler flags
1791         https://bugs.webkit.org/show_bug.cgi?id=174490
1792
1793         Reviewed by Konstantin Tokarev.
1794
1795         * CMakeLists.txt:
1796         * PlatformGTK.cmake:
1797         * PlatformWPE.cmake:
1798
1799 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
1800
1801         [GStreamer] Don't use GraphicsContext3D in VideoTextureCoperGStreamer
1802         https://bugs.webkit.org/show_bug.cgi?id=174774
1803
1804         Reviewed by Carlos Garcia Campos.
1805
1806         VideoTextureCoperGStreamer class creates a new GraphicsContext3D internally
1807         that's used to render to whichever OpenGL context is current. Such usage
1808         doesn't add anything to the user since there's no underlying offscreen-based
1809         OpenGL context created, and instead all GraphicsContext3D calls are directly
1810         translated to usual OpenGL API calls. We should avoid using GraphicsContext3D
1811         in such cases and instead use direct OpenGL API calls.
1812
1813         This patch achieves that for the VideoTextureCoperGStreamer class. A
1814         GraphicsContext3D object is still created because it's needed to construct an
1815         instance of the TextureMapperShaderProgram class, but this will be removed as
1816         soon as TextureMapperShaderProgram drops the GraphicsContext3D dependence.
1817
1818         No new tests -- no change in behavior.
1819
1820         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
1821         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
1822         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
1823         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
1824         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
1825         (WebCore::VideoTextureCopierGStreamer::resultTexture):
1826
1827 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
1828
1829         [TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy}
1830         https://bugs.webkit.org/show_bug.cgi?id=175314
1831
1832         Reviewed by Carlos Garcia Campos.
1833
1834         Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and
1835         TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D*
1836         types provided in the GraphicsTypes3D.h header.
1837
1838         No new tests -- no change in behavior.
1839
1840         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1841         (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
1842         (WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset):
1843         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
1844         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1845         (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
1846         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
1847
1848 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
1849
1850         [TexMap] Don't use GraphicsContext3D in ClipStack
1851         https://bugs.webkit.org/show_bug.cgi?id=174776
1852
1853         Reviewed by Carlos Garcia Campos.
1854
1855         Any GraphicsContext3D object that's passed to ClipStack methods is of the
1856         render-to-current-context nature, meaning there's no internally owned GL
1857         context that has to be properly handled and all calls are simply passed to
1858         OpenGL APIs. We should drop such (non-)usage of GraphicsContext3D in favor
1859         of direct OpenGL API invocations.
1860
1861         This patch covers TextureMapper's ClipStack. Call sites to the apply() and
1862         applyIfNeeded() are modified to not pass a reference to any
1863         GraphicsContext3D object. Internally, OpenGL API entrypoints and constants
1864         are used instead of GraphicsContext3D invocations.
1865
1866         No new tests -- no change in behavior.
1867
1868         * platform/graphics/texmap/BitmapTextureGL.cpp:
1869         (WebCore::BitmapTextureGL::clearIfNeeded):
1870         (WebCore::BitmapTextureGL::bindAsSurface):
1871         * platform/graphics/texmap/ClipStack.cpp:
1872         (WebCore::ClipStack::apply):
1873         (WebCore::ClipStack::applyIfNeeded):
1874         * platform/graphics/texmap/ClipStack.h:
1875         * platform/graphics/texmap/TextureMapperGL.cpp:
1876         (WebCore::TextureMapperGL::bindDefaultSurface):
1877         (WebCore::TextureMapperGL::beginScissorClip):
1878         (WebCore::TextureMapperGL::beginClip):
1879         (WebCore::TextureMapperGL::endClip):
1880
1881 2017-08-08  Javier Fernandez  <jfernandez@igalia.com>
1882
1883         Not possible to remove the 'li' element inside the table cell
1884         https://bugs.webkit.org/show_bug.cgi?id=173148
1885
1886         Reviewed by Ryosuke Niwa.
1887
1888         We need to add a new case for breaking out empty list items when they are
1889         at the start of an editable area. Since list items can be also inside
1890         table cells, we need to consider this kind of elements as well.
1891
1892         Tests: editing/deleting/delete-list-items-in-table-cell-1.html
1893                editing/deleting/delete-list-items-in-table-cell-2.html
1894                editing/deleting/delete-list-items-in-table-cell-3.html
1895                editing/deleting/delete-list-items-in-table-cell-4.html
1896                editing/deleting/delete-list-items-in-table-cell-5.html
1897                editing/deleting/delete-list-items-in-table-cell-6.html
1898                editing/deleting/delete-list-items-in-table-cell-7.html
1899                editing/deleting/delete-list-items-in-table-cell-8.html
1900
1901         * editing/TypingCommand.cpp:
1902         (WebCore::TypingCommand::deleteKeyPressed):
1903
1904 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
1905
1906         [TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class
1907         https://bugs.webkit.org/show_bug.cgi?id=175316
1908
1909         Reviewed by Carlos Garcia Campos.
1910
1911         Move the TextureMapperPlatformLayerProxyProvider class (which is the type
1912         aliased to PlatformLayer for threaded CoordGraphics) into its own header
1913         file. This prevents including the TextureMapperPlatformLayerProxy.h header
1914         file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types
1915         and function declarations before the GStreamer GL headers include them
1916         later in the MediaPlayerPrivateGStreamerBase implementation file.
1917
1918         In the MediaPlayerPrivateGStreamerBase.h header file, only the new header
1919         is included, and a forward declaration of the TextureMapperPlatformLayerProxy
1920         class is used. proxy() and swapBuffersIfNeeded() methods are moved into
1921         the implementation file to avoid requiring the full definition of the
1922         TextureMapperPlatformLayerProxy class.
1923
1924         Similar is done for the TextureMapperGC3DPlatformLayer class and the
1925         Cairo-specific implementation of the ImageBufferData class. The
1926         CoordinatedGraphicsLayer implementation file also gains an include of the
1927         TextureMapperPlatformLayerProxyProvider.h header since it requires the full
1928         definition of that class.
1929
1930         No new tests -- no change in behavior.
1931
1932         * platform/graphics/cairo/ImageBufferCairo.cpp:
1933         (WebCore::ImageBufferData::proxy const):
1934         * platform/graphics/cairo/ImageBufferDataCairo.h:
1935         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1936         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
1937         (WebCore::MediaPlayerPrivateGStreamerBase::proxy const):
1938         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
1939         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1940         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
1941         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
1942         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
1943         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added.
1944         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1945
1946 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
1947
1948         Unreviewed. Follow-up to r220392 that fixes build on configurations
1949         that disable USE(GSTREAMER_GL).
1950
1951         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1952         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1953         When creating the BitmapTextureGL object, also provide an initialized
1954         TextureMapperContextAttributes object.
1955
1956 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
1957
1958         [TexMap] Group GL header file inclusions in a single header file
1959         https://bugs.webkit.org/show_bug.cgi?id=175313
1960
1961         Reviewed by Carlos Garcia Campos.
1962
1963         Add a helper header file to the TextureMapper subsystem that includes
1964         the OpenGL headers, properly addressing the build configuration to
1965         include headers as provided by either libepoxy, the OpenGL ES library,
1966         or the OpenGL library.
1967
1968         TextureMapperContextAttributes implementation file is the only one
1969         that can leverage the header at the moment, but more will follow.
1970
1971         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
1972         * platform/graphics/texmap/TextureMapperGLHeaders.h: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp.
1973
1974 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1975
1976         [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
1977         https://bugs.webkit.org/show_bug.cgi?id=175116
1978         <rdar://problem/28279301>
1979
1980         Reviewed by Darin Adler and Ryosuke Niwa.
1981
1982         WebCore support for WebPage::editorState refactoring. See WebKit ChangeLogs for more detail.
1983
1984         Tests: EditorStateTests.TypingAttributesBold
1985                EditorStateTests.TypingAttributesItalic
1986                EditorStateTests.TypingAttributesUnderline
1987                EditorStateTests.TypingAttributesTextAlignmentAbsoluteAlignmentOptions
1988                EditorStateTests.TypingAttributesTextAlignmentStartEnd
1989                EditorStateTests.TypingAttributesTextAlignmentDirectionalText
1990                EditorStateTests.TypingAttributesTextColor
1991                EditorStateTests.TypingAttributesMixedStyles
1992                EditorStateTests.TypingAttributesLinkColor
1993
1994         * css/StyleProperties.cpp:
1995         (WebCore::StyleProperties::propertyAsColor const):
1996         (WebCore::StyleProperties::propertyAsValueID const):
1997
1998         Introduces some helper functions in StyleProperties to convert CSS property values to Color or a CSSValueID.
1999
2000         * css/StyleProperties.h:
2001         * editing/EditingStyle.cpp:
2002         (WebCore::EditingStyle::hasStyle):
2003
2004         Pull out logic in selectionStartHasStyle that asks for a style TriState into EditingStyle::hasStyle. This is
2005         because WebPage::editorState will now query for multiple styles at the selection start, but
2006         selectionStartHasStyle currently recomputes styleAtSelectionStart every time it is called. To prevent extra work
2007         from being done, we can just call selectionStartHasStyle once and use ask for EditingStyle::hasStyle on the
2008         computed EditingStyle at selection start.
2009
2010         * editing/EditingStyle.h:
2011         * editing/Editor.cpp:
2012         (WebCore::Editor::selectionStartHasStyle const):
2013
2014 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2015
2016         [TexMap] Add TextureMapperContextAttributes
2017         https://bugs.webkit.org/show_bug.cgi?id=175311
2018
2019         Reviewed by Carlos Garcia Campos.
2020
2021         Add and use TextureMapperContextAttributes, a slim struct that holds
2022         information about the type and extensions supported by the OpenGL
2023         context that's being used for one specific TextureMapperGL instance.
2024
2025         This struct is initialized in the TextureMapperGL constructor for the
2026         OpenGL context that's been made current on that thread, and that will
2027         be used for that TextureMapperGL instance through its lifetime. The
2028         struct is then also copied into any BitmapTextureGL objects that have
2029         been created through this TextureMapperGL (or its texture pool).
2030
2031         The struct is initialized with information about GLES2 support (which
2032         is at this point done through the USE_OPENGL_ES_2 macro) and about
2033         specific OpenGL extensions that are supported. These are then used in
2034         TextureMapperGL (NPOT textures) and BitmapTextureGL (BGRA support,
2035         sub-image unpacking) to deploy specific optimizations or workarounds.
2036
2037         This ultimately serves as a replacement for clunky static functions
2038         that need to operate on GraphicsContext3D objects to retrieve this
2039         information.
2040
2041         No new tests -- no change in behavior.
2042
2043         * platform/TextureMapper.cmake:
2044         * platform/graphics/texmap/BitmapTextureGL.cpp:
2045         (WebCore::BitmapTextureGL::BitmapTextureGL):
2046         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
2047         (WebCore::BitmapTextureGL::updateContents):
2048         (WebCore::driverSupportsSubImage): Deleted.
2049         * platform/graphics/texmap/BitmapTextureGL.h:
2050         (WebCore::BitmapTextureGL::create):
2051         * platform/graphics/texmap/BitmapTexturePool.cpp:
2052         (WebCore::BitmapTexturePool::BitmapTexturePool):
2053         (WebCore::BitmapTexturePool::createTexture):
2054         * platform/graphics/texmap/BitmapTexturePool.h:
2055         * platform/graphics/texmap/TextureMapperContextAttributes.cpp: Added.
2056         (WebCore::TextureMapperContextAttributes::initialize):
2057         * platform/graphics/texmap/TextureMapperContextAttributes.h: Added.
2058         * platform/graphics/texmap/TextureMapperGL.cpp:
2059         (WebCore::TextureMapperGL::TextureMapperGL):
2060         (WebCore::TextureMapperGL::drawTexture):
2061         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
2062         (WebCore::TextureMapperGL::createTexture):
2063         (WebCore::driverSupportsNPOTTextures): Deleted.
2064         * platform/graphics/texmap/TextureMapperGL.h:
2065
2066 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2067
2068         [TexMap] Don't expose GraphicsContext3D object
2069         https://bugs.webkit.org/show_bug.cgi?id=175310
2070
2071         Reviewed by Carlos Garcia Campos.
2072
2073         Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead,
2074         the clearColor() method is added that's to be used by the CoordinatedGraphicsScene
2075         class which was accessing the GraphicsContext3D object for this purpose.
2076
2077         * platform/graphics/texmap/TextureMapper.h:
2078         * platform/graphics/texmap/TextureMapperGL.cpp:
2079         (WebCore::TextureMapperGL::clearColor):
2080         * platform/graphics/texmap/TextureMapperGL.h:
2081         (WebCore::TextureMapperGL::graphicsContext3D const): Deleted.
2082
2083 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2084
2085         RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc
2086         https://bugs.webkit.org/show_bug.cgi?id=175304
2087
2088         Reviewed by Tim Horton.
2089
2090         r210758 changed DataRef::get() from returning a pointer to a reference. This caused all the places
2091         in RenderStyle::diff() and related functions, where we intended to do a quick pointer comparison,
2092         to doing deep compares via operator!=. This made the code slightly slower.
2093
2094         Fix by exposing ptr() on DataRef and using it wherever we wish to do pointer comparison.
2095
2096         * rendering/style/DataRef.h:
2097         (WebCore::DataRef::ptr const):
2098         * rendering/style/RenderStyle.cpp:
2099         (WebCore::RenderStyle::inheritedDataShared const):
2100         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
2101         (WebCore::RenderStyle::changeRequiresLayout const):
2102         (WebCore::RenderStyle::changeRequiresRecompositeLayer const):
2103         (WebCore::RenderStyle::listStyleImage const): Expand the function onto multiple lines.
2104
2105 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2106
2107         Add a fast path for rotate() and rotateZ() transform parsing
2108         https://bugs.webkit.org/show_bug.cgi?id=175308
2109
2110         Reviewed by Zalan Bujtas.
2111
2112         Fast paths only existed for translate-related functions, matrix3d() and scale3d(). Add
2113         rotate() and rotateX(), which gives a small boost to one of the MotionMark tests.
2114
2115         * css/parser/CSSParserFastPaths.cpp:
2116         (WebCore::parseSimpleAngle):
2117         (WebCore::parseTransformAngleArgument):
2118         (WebCore::parseSimpleTransformValue):
2119         (WebCore::transformCanLikelyUseFastPath):
2120
2121 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2122
2123         Re-order the tests in RenderLayerCompositor::requiresCompositingLayer() for performance
2124         https://bugs.webkit.org/show_bug.cgi?id=175306
2125
2126         Reviewed by Tim Horton.
2127
2128         Re-order the tests for compositing reasons so that reasons more likely to happen are higher in the list.
2129
2130         * rendering/RenderLayerCompositor.cpp:
2131         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2132         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2133
2134 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2135
2136         Avoid a hash lookup in FilterInfo::remove()
2137         https://bugs.webkit.org/show_bug.cgi?id=175301
2138
2139         Reviewed by Sam Weinig.
2140
2141         FilterInfo::remove() always called map().remove(&layer)), even when layer.m_hasFilterInfo
2142         was false (and even asserted that layer.m_hasFilterInfo == map().contains(&layer)).
2143
2144         So we can early return if layer.m_hasFilterInfo is false.
2145
2146         * rendering/RenderLayerFilterInfo.cpp:
2147         (WebCore::RenderLayer::FilterInfo::getIfExists):
2148         (WebCore::RenderLayer::FilterInfo::remove):
2149
2150 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2151
2152         Make TransformOperation::type() non-virtual
2153         https://bugs.webkit.org/show_bug.cgi?id=175297
2154
2155         Reviewed by Sam Weinig.
2156
2157         Store the OperationType in the base class so that type() and isSameType() can
2158         be non-virtual.
2159
2160         Small perf win on some benchmarks.
2161
2162         * platform/graphics/transforms/IdentityTransformOperation.h:
2163         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2164         * platform/graphics/transforms/MatrixTransformOperation.h:
2165         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2166         * platform/graphics/transforms/RotateTransformOperation.cpp:
2167         (WebCore::RotateTransformOperation::blend):
2168         * platform/graphics/transforms/RotateTransformOperation.h:
2169         * platform/graphics/transforms/ScaleTransformOperation.cpp:
2170         (WebCore::ScaleTransformOperation::blend):
2171         * platform/graphics/transforms/ScaleTransformOperation.h:
2172         * platform/graphics/transforms/SkewTransformOperation.cpp:
2173         (WebCore::SkewTransformOperation::blend):
2174         * platform/graphics/transforms/SkewTransformOperation.h:
2175         * platform/graphics/transforms/TransformOperation.h:
2176         (WebCore::TransformOperation::TransformOperation):
2177         (WebCore::TransformOperation::type const):
2178         (WebCore::TransformOperation::isSameType const):
2179         * platform/graphics/transforms/TranslateTransformOperation.cpp:
2180         (WebCore::TranslateTransformOperation::blend):
2181         * platform/graphics/transforms/TranslateTransformOperation.h:
2182
2183 2017-08-07  Simon Fraser  <simon.fraser@apple.com>
2184
2185         Inline ~Color and Color::isExtended()
2186         https://bugs.webkit.org/show_bug.cgi?id=175293
2187
2188         Reviewed by Zalan Bujtas.
2189
2190         The Color destructor and Color::isExtended() show up on profiles, so inline them.
2191         Before r207265 the destructor was inlined.
2192         
2193         Also make sure that LengthSize::operator== is inlined, which it was not (according
2194         to profiles).
2195
2196         * platform/LengthSize.h:
2197         (WebCore::operator==):
2198         * platform/graphics/Color.cpp:
2199         (WebCore::Color::~Color): Deleted.
2200         (WebCore::Color::isExtended const): Deleted.
2201         * platform/graphics/Color.h:
2202         (WebCore::Color::~Color):
2203         (WebCore::Color::isExtended const):
2204
2205 2017-08-04  Brent Fulgham  <bfulgham@apple.com>
2206
2207         Implement the HTML5 same-origin restriction specification
2208         https://bugs.webkit.org/show_bug.cgi?id=175226
2209         <rdar://problem/11079948>
2210
2211         Reviewed by Chris Dumez.
2212
2213         Follow the algorithms defined in the HTML5 specification for relaxing
2214         the same-origin restriction. We were missing a few steps related to
2215         checking for public suffix and presence of a browsing context.
2216
2217         Tested by new TestWebKitAPI tests.
2218
2219         * dom/Document.cpp:
2220         (WebCore::Document::domainIsRegisterable): Added helper function.
2221         (WebCore::Document::setDomain):
2222
2223 2017-08-07  Devin Rousso  <drousso@apple.com>
2224
2225         Web Inspector: Preview Canvas path when viewing a recording
2226         https://bugs.webkit.org/show_bug.cgi?id=174967
2227
2228         Reviewed by Brian Burg.
2229
2230         Tests: fast/canvas/2d.currentPoint.html
2231                fast/canvas/2d.getPath.modification.html
2232                fast/canvas/2d.getPath.newobject.html
2233                fast/canvas/2d.setPath.html
2234
2235         * html/canvas/CanvasPath.idl:
2236         * html/canvas/CanvasPath.h:
2237         * html/canvas/CanvasPath.cpp:
2238         (WebCore::CanvasPath::currentX const):
2239         (WebCore::CanvasPath::currentY const):
2240
2241         * html/canvas/CanvasRenderingContext2D.idl:
2242         * html/canvas/CanvasRenderingContext2D.h:
2243         * html/canvas/CanvasRenderingContext2D.cpp:
2244         (WebCore::CanvasRenderingContext2D::setPath):
2245         (WebCore::CanvasRenderingContext2D::getPath const):
2246
2247         * page/RuntimeEnabledFeatures.h:
2248         (WebCore::RuntimeEnabledFeatures::setInspectorAdditionsEnabled):
2249         (WebCore::RuntimeEnabledFeatures::inspectorAdditionsEnabled const):
2250         Add runtime flag for added IDL items above so that they are only usable within the inspector
2251         process. The runtime flag is not enabled from anywhere else as of now.
2252
2253         * inspector/InspectorCanvas.cpp:
2254         (WebCore::InspectorCanvas::buildInitialState):
2255         Send current path as part of the InitialState.
2256         Drive-by: deduplicate more string values.
2257
2258 2017-08-07  Chris Dumez  <cdumez@apple.com>
2259
2260         Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest
2261         https://bugs.webkit.org/show_bug.cgi?id=175280
2262
2263         Reviewed by Youenn Fablet.
2264
2265         Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest. FetchBody
2266         for data extraction is really the only thing we need at the moment.
2267         The new code also properly sets the CORS mode, which will be needed for Bug 175264.
2268
2269         * Modules/beacon/NavigatorBeacon.cpp:
2270         (WebCore::NavigatorBeacon::sendBeacon):
2271
2272 2017-08-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2273
2274         -Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue
2275         https://bugs.webkit.org/show_bug.cgi?id=174469
2276         <rdar://problem/33311638>
2277
2278         Reviewed by Simon Fraser.
2279
2280         Add a RELEASE_ASSERT_NOT_REACHED to silence this warning.
2281
2282         * css/CSSComputedStyleDeclaration.cpp:
2283         (WebCore::ComputedStyleExtractor::propertyValue):
2284
2285 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
2286
2287         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
2288         https://bugs.webkit.org/show_bug.cgi?id=174919
2289
2290         Reviewed by Keith Miller.
2291
2292         No new tests because no change in behavior.
2293         
2294         Adapting to API changes - we now specify the AlignedMemoryAllocator differently and we need to be
2295         specific about which Gigacage we're using.
2296
2297         * bindings/js/WebCoreJSClientData.cpp:
2298         (WebCore::JSVMClientData::JSVMClientData):
2299         * platform/graphics/cocoa/GPUBufferMetal.mm:
2300         (WebCore::GPUBuffer::GPUBuffer):
2301
2302 2017-08-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2303
2304         [Curl] Add abstraction layer of cookie jar implementation for Curl port
2305         https://bugs.webkit.org/show_bug.cgi?id=174943
2306
2307         Reviewed by Brent Fulgham.
2308
2309         * platform/network/curl/CookieJarCurl.cpp:
2310         (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM):
2311         (WebCore::CookieJarCurlFileSystem::cookiesForDOM):
2312         (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue):
2313         (WebCore::CookieJarCurlFileSystem::cookiesEnabled):
2314         (WebCore::CookieJarCurlFileSystem::getRawCookies):
2315         (WebCore::CookieJarCurlFileSystem::deleteCookie):
2316         (WebCore::CookieJarCurlFileSystem::getHostnamesWithCookies):
2317         (WebCore::CookieJarCurlFileSystem::deleteCookiesForHostnames):
2318         (WebCore::CookieJarCurlFileSystem::deleteAllCookies):
2319         (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
2320         (WebCore::cookiesForDOM):
2321         (WebCore::setCookiesFromDOM):
2322         (WebCore::cookieRequestHeaderFieldValue):
2323         (WebCore::cookiesEnabled):
2324         (WebCore::getRawCookies):
2325         (WebCore::deleteCookie):
2326         (WebCore::getHostnamesWithCookies):
2327         (WebCore::deleteCookiesForHostnames):
2328         (WebCore::deleteAllCookies):
2329         (WebCore::deleteAllCookiesModifiedSince):
2330         * platform/network/curl/CookieJarCurl.h: Added.
2331         * platform/network/curl/CurlContext.cpp:
2332         * platform/network/curl/CurlContext.h:
2333         (WebCore::CurlContext::cookieJar):
2334
2335 2017-08-07  Brady Eidson  <beidson@apple.com>
2336
2337         Implement most of ServiceWorkerContainer::addRegistration.
2338         https://bugs.webkit.org/show_bug.cgi?id=175237
2339
2340         Reviewed by Andy Estes.
2341
2342         No new tests (Covered by changes to existing tests).
2343
2344         There's still so much supporting infrastructure to add with these early patches
2345         that I'm still moving them in baby steps for now, hence not implementing
2346         register() all in one shot.
2347         
2348         Things will start moving very quickly once we no longer need to add lots of new
2349         primitives in each change.
2350         
2351         * CMakeLists.txt:
2352         * DerivedSources.make:
2353         * WebCore.xcodeproj/project.pbxproj:
2354         
2355         * page/DOMWindow.cpp:
2356         (WebCore::DOMWindow::navigator const):
2357         
2358         * page/Navigator.cpp:
2359         (WebCore::Navigator::Navigator): Make the constructor take a ScriptExecutionContext for 
2360           creation of objects where its import (e.g. ServiceWorkerContainer).
2361         * page/Navigator.h:
2362
2363         * page/WorkerNavigator.cpp:
2364         (WebCore::WorkerNavigator::WorkerNavigator): Ditto.
2365         * page/WorkerNavigator.h:
2366
2367         * page/NavigatorBase.cpp:
2368         (WebCore::NavigatorBase::NavigatorBase): Create the ServiceWorkerContainer upfront with
2369           the passed-in ScriptExecutionContext.
2370         (WebCore::NavigatorBase::serviceWorker):
2371         * page/NavigatorBase.h:
2372         
2373         Make ServiceWorkerContainer into an ActiveDOMObject. This will eventually be necessary for
2374         Document suspension reasons, but is also necessary because it also needs to be a
2375         ContextDestructionObserver (which ActiveDOMObject is):
2376         * workers/ServiceWorkerContainer.cpp:
2377         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2378         (WebCore::ServiceWorkerContainer::ready):
2379         (WebCore::ServiceWorkerContainer::addRegistration):
2380         (WebCore::ServiceWorkerContainer::getRegistration):
2381         (WebCore::ServiceWorkerContainer::getRegistrations):
2382         (WebCore::ServiceWorkerContainer::activeDOMObjectName const):
2383         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
2384         (WebCore::rejectLater): Deleted.
2385         (WebCore::ServiceWorkerContainer::eventTargetInterface const): Deleted.
2386         (WebCore::ServiceWorkerContainer::scriptExecutionContext const): Deleted.
2387         * workers/ServiceWorkerContainer.h:
2388         * workers/ServiceWorkerContainer.idl:
2389
2390         Add updateViaCache, etc:
2391         * workers/ServiceWorkerRegistration.cpp:
2392         (WebCore::ServiceWorkerRegistration::updateViaCache const):
2393         (WebCore::ServiceWorkerRegistration::update):
2394         (WebCore::ServiceWorkerRegistration::unregister):
2395         * workers/ServiceWorkerRegistration.h:
2396         * workers/ServiceWorkerRegistration.idl:
2397
2398         * workers/ServiceWorkerUpdateViaCache.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2399         * workers/ServiceWorkerUpdateViaCache.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2400
2401         * workers/WorkerGlobalScope.cpp:
2402         (WebCore::WorkerGlobalScope::navigator):
2403         (WebCore::WorkerGlobalScope::navigator const): Deleted.
2404         * workers/WorkerGlobalScope.h:
2405
2406         * workers/WorkerType.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2407         * workers/WorkerType.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
2408
2409 2017-08-07  Ryan Haddad  <ryanhaddad@apple.com>
2410
2411         Unreviewed, rolling out r220299.
2412
2413         This change caused LayoutTest inspector/dom-debugger/dom-
2414         breakpoints.html to fail.
2415
2416         Reverted changeset:
2417
2418         "Web Inspector: capture async stack trace when workers/main
2419         context posts a message"
2420         https://bugs.webkit.org/show_bug.cgi?id=167084
2421         http://trac.webkit.org/changeset/220299
2422
2423 2017-08-07  Brian Burg  <bburg@apple.com>
2424
2425         Cleanup: simplify WebSockets code for RuntimeEnabledFeatures
2426         https://bugs.webkit.org/show_bug.cgi?id=175190
2427
2428         Reviewed by Sam Weinig.
2429
2430         This runtime enabled flag is not used by anything. It was added
2431         for V8 in <https://bugs.webkit.org/show_bug.cgi?id=29896>.
2432
2433         * Modules/websockets/WebSocket.cpp:
2434         (WebCore::WebSocket::setIsAvailable): Deleted.
2435         (WebCore::WebSocket::isAvailable): Deleted.
2436         * Modules/websockets/WebSocket.h:
2437         * Modules/websockets/WebSocket.idl:
2438         * page/RuntimeEnabledFeatures.cpp:
2439         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): Deleted.
2440         * page/RuntimeEnabledFeatures.h:
2441
2442 2017-08-07  Brian Burg  <bburg@apple.com>
2443
2444         Remove CANVAS_PATH compilation guard
2445         https://bugs.webkit.org/show_bug.cgi?id=175207
2446
2447         Reviewed by Sam Weinig.
2448
2449         * Configurations/FeatureDefines.xcconfig:
2450         * html/canvas/DOMPath.h:
2451         * html/canvas/DOMPath.idl:
2452
2453 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2454
2455         [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy.
2456         https://bugs.webkit.org/show_bug.cgi?id=175125
2457
2458         Reviewed by Michael Catanzaro.
2459
2460         No change of behavior, covered by existing tests.
2461
2462         * CMakeLists.txt: Instead of negating 3 times the use of libepoxy
2463         move the logic for (E)GL detection inside an else() block.
2464
2465 2017-08-07  Antti Koivisto  <antti@apple.com>
2466
2467         REGRESSION (r219121): Airmail 3 prints header part only.
2468         https://bugs.webkit.org/show_bug.cgi?id=175258
2469         <rdar://problem/33601173>
2470
2471         Reviewed by Andreas Kling.
2472
2473         When a WK1 WebViw is printed via AppKit view hierarchy it won't explictly set the page width
2474         but uses the existing width. r219121 assumes that all printing code paths set the page width.
2475
2476         No test, there appears to be no good way to test AppKit printing behaviors without adding complicated
2477         new testing infrastructure.
2478
2479         * rendering/RenderView.cpp:
2480         (WebCore::RenderView::layout):
2481
2482             If we are in printing layout and don't have page width set yet then use the current view width.
2483             This matches the behavior prior r219121.
2484
2485 2017-08-05  Youenn Fablet  <youenn@apple.com>
2486
2487         [Fetch API] Response should keep all ResourceResponse information
2488         https://bugs.webkit.org/show_bug.cgi?id=175099
2489
2490         Reviewed by Sam Weinig.
2491
2492         No change of behavior, covered by existing tests.
2493
2494         Disabling filtering of resource response at DocumentThreadableLoader for fetch API and doing the filtering at FetchResponse level.
2495         This requires passing the tainting parameter to FetchResponse. For that purpose, we store the tainting on the ResourceResponse itself.
2496         This allows mimicking the concept of internal response from the fetch spec.
2497         This might be useful for future developments related to caching the responses.
2498
2499         The body is now also stored in FetchResponse so a flag is added to ensure we only expose the body if allowed.
2500
2501         Changing storage of opaque redirect information to keep the redirection information in the response.
2502
2503         * Modules/fetch/FetchBodyOwner.cpp:
2504         (WebCore::FetchBodyOwner::blob):
2505         (WebCore::FetchBodyOwner::consumeNullBody):
2506         * Modules/fetch/FetchBodyOwner.h:
2507         * Modules/fetch/FetchLoader.cpp:
2508         (WebCore::FetchLoader::start):
2509         * Modules/fetch/FetchResponse.cpp:
2510         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
2511         (WebCore::FetchResponse::consume):
2512         (WebCore::FetchResponse::consumeBodyAsStream):
2513         (WebCore::FetchResponse::createReadableStreamSource):
2514         * Modules/fetch/FetchResponse.h:
2515         * loader/DocumentThreadableLoader.cpp:
2516         (WebCore::DocumentThreadableLoader::responseReceived):
2517         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2518         (WebCore::DocumentThreadableLoader::didFinishLoading):
2519         (WebCore::DocumentThreadableLoader::loadRequest):
2520         * loader/DocumentThreadableLoader.h:
2521         * loader/SubresourceLoader.cpp:
2522         (WebCore::SubresourceLoader::willSendRequestInternal):
2523         * loader/cache/CachedResource.cpp:
2524         (WebCore::CachedResource::setBodyDataFrom):
2525         (WebCore::CachedResource::setResponse):
2526         * platform/network/ResourceResponseBase.cpp:
2527         (WebCore::ResourceResponseBase::crossThreadData const):
2528         (WebCore::ResourceResponseBase::fromCrossThreadData):
2529         (WebCore::ResourceResponseBase::filter):
2530         * platform/network/ResourceResponseBase.h:
2531         (WebCore::ResourceResponseBase::setTainting):
2532         (WebCore::ResourceResponseBase::tainting const):
2533         (WebCore::ResourceResponseBase::encode const):
2534         (WebCore::ResourceResponseBase::decode):
2535
2536 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2537
2538         WebDriver: use in-view center point for clicks instead of bounding box center point
2539         https://bugs.webkit.org/show_bug.cgi?id=174863
2540
2541         Reviewed by Simon Fraser.
2542
2543         Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add
2544         FrameView::clientToDocumentPoint().
2545
2546         * WebCore.xcodeproj/project.pbxproj:
2547         * dom/Element.h:
2548         * page/FrameView.h:
2549         * platform/graphics/FloatPoint.h:
2550
2551 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2552
2553         getClientRects doesn't work with list box option elements
2554         https://bugs.webkit.org/show_bug.cgi?id=175016
2555
2556         Reviewed by Darin Adler.
2557
2558         Since HTMLOptionElement and HTMLOptGroupElement don't have a renderer, we are always returning an empty list
2559         from getClientRects. This is working fine in both chromium and firefox, option elements return its own bounding
2560         box and group elements return the bounding box of the group label and all its children items.
2561
2562         Test: fast/dom/HTMLSelectElement/listbox-items-client-rects.html
2563
2564         * dom/Element.cpp:
2565         (WebCore::listBoxElementBoundingBox): Helper function to return the bounding box of a HTMLOptionElement or
2566         HTMLOptGroupElement element.
2567         (WebCore::Element::getClientRects): Use listBoxElementBoundingBox() in case of HTMLOptionElement or
2568         HTMLOptGroupElement.
2569         (WebCore::Element::boundingClientRect): Ditto.
2570
2571 2017-08-04  Youenn Fablet  <youenn@apple.com>
2572
2573         [Cache API] Add Cache and CacheStorage IDL definitions
2574         https://bugs.webkit.org/show_bug.cgi?id=175201
2575
2576         Reviewed by Brady Eidson.
2577
2578         Covered by activated tests.
2579         Adding IDLs as per https://www.w3.org/TR/service-workers-1/#idl-index.
2580         Implementation is guarded by a runtime flag which is off by default.
2581         It is off for DRT but on for WTR.
2582
2583         * CMakeLists.txt:
2584         * DerivedSources.make:
2585         * Modules/cache/Cache.cpp: Added.
2586         (WebCore::Cache::match):
2587         (WebCore::Cache::matchAll):
2588         (WebCore::Cache::add):
2589         (WebCore::Cache::addAll):
2590         (WebCore::Cache::put):
2591         (WebCore::Cache::remove):
2592         (WebCore::Cache::keys):
2593         * Modules/cache/Cache.h: Added.
2594         (WebCore::Cache::create):
2595         (WebCore::Cache::Cache):
2596         * Modules/cache/Cache.idl: Added.
2597         * Modules/cache/CacheQueryOptions.h: Added.
2598         * Modules/cache/CacheQueryOptions.idl: Added.
2599         * Modules/cache/CacheStorage.cpp: Added.
2600         (WebCore::CacheStorage::match):
2601         (WebCore::CacheStorage::has):
2602         (WebCore::CacheStorage::open):
2603         (WebCore::CacheStorage::remove):
2604         (WebCore::CacheStorage::keys):
2605         * Modules/cache/CacheStorage.h: Added.
2606         (WebCore::CacheStorage::create):
2607         * Modules/cache/CacheStorage.idl: Added.
2608         * Modules/cache/DOMWindowCaches.cpp: Added.
2609         (WebCore::DOMWindowCaches::DOMWindowCaches):
2610         (WebCore::DOMWindowCaches::supplementName):
2611         (WebCore::DOMWindowCaches::from):
2612         (WebCore::DOMWindowCaches::caches):
2613         (WebCore::DOMWindowCaches::caches const):
2614         * Modules/cache/DOMWindowCaches.h: Added.
2615         * Modules/cache/DOMWindowCaches.idl: Added.
2616         * Modules/cache/WorkerGlobalScopeCaches.cpp: Added.
2617         (WebCore::WorkerGlobalScopeCaches::supplementName):
2618         (WebCore::WorkerGlobalScopeCaches::from):
2619         (WebCore::WorkerGlobalScopeCaches::caches):
2620         (WebCore::WorkerGlobalScopeCaches::caches const):
2621         * Modules/cache/WorkerGlobalScopeCaches.h: Added.
2622         * Modules/cache/WorkerGlobalScopeCaches.idl: Added.
2623         * WebCore.xcodeproj/project.pbxproj:
2624         * page/RuntimeEnabledFeatures.h:
2625         (WebCore::RuntimeEnabledFeatures::setCacheAPIEnabled):
2626         (WebCore::RuntimeEnabledFeatures::cacheAPIEnabled const):
2627
2628 2017-08-04  Brady Eidson  <beidson@apple.com>
2629
2630         Have navigator.serviceWorker() actually return a ServiceWorkerContainer object.
2631         https://bugs.webkit.org/show_bug.cgi?id=175215
2632
2633         Reviewed by Youenn Fablet.
2634
2635         * page/NavigatorBase.cpp:
2636         (WebCore::NavigatorBase::serviceWorker): Actually create and remember an object.
2637         * page/NavigatorBase.h:
2638
2639         * workers/ServiceWorkerContainer.cpp:
2640         (WebCore::rejectLater): Asynchronously reject the given promise with an error message.
2641         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2642         (WebCore::ServiceWorkerContainer::refEventTarget): Ref the underlying Navigator.
2643         (WebCore::ServiceWorkerContainer::derefEventTarget): Deref the underlying Navigator.
2644         (WebCore::ServiceWorkerContainer::ready): rejectLater the promise.
2645         (WebCore::ServiceWorkerContainer::addRegistration): Ditto.
2646         (WebCore::ServiceWorkerContainer::getRegistration): Ditto.
2647         (WebCore::ServiceWorkerContainer::getRegistrations): Ditto.
2648         * workers/ServiceWorkerContainer.h:
2649
2650 2017-08-04  Chris Dumez  <cdumez@apple.com>
2651
2652         [Beacon] Update sendBeacon to use the CachedResourceLoader
2653         https://bugs.webkit.org/show_bug.cgi?id=175192
2654         <rdar://problem/33725923>
2655
2656         Reviewed by Youenn Fablet.
2657
2658         Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of
2659         the PingLoader. This gets us closer to the specification which is based on
2660         Fetch and reduces code duplication. This also fixes an issue where our
2661         Origin header was not properly set on Beacon resquests.
2662
2663         In a follow-up, we will implement in CachedResourceLoader Fetch's quota for
2664         inflight keepalive requests which is needed to fully support sendBeacon().
2665
2666         * Modules/beacon/NavigatorBeacon.cpp:
2667         (WebCore::NavigatorBeacon::sendBeacon):
2668         * Modules/beacon/NavigatorBeacon.h:
2669         * loader/LinkLoader.cpp:
2670         (WebCore::createLinkPreloadResourceClient):
2671         * loader/PingLoader.cpp:
2672         * loader/PingLoader.h:
2673         * loader/ResourceLoadInfo.cpp:
2674         (WebCore::toResourceType):
2675         * loader/SubresourceLoader.cpp:
2676         (WebCore::logResourceLoaded):
2677         * loader/cache/CachedResource.cpp:
2678         (WebCore::CachedResource::defaultPriorityForResourceType):
2679         (WebCore::CachedResource::load):
2680         * loader/cache/CachedResource.h:
2681         * loader/cache/CachedResourceLoader.cpp:
2682         (WebCore::createResource):
2683         (WebCore::CachedResourceLoader::requestBeaconResource):
2684         (WebCore::contentTypeFromResourceType):
2685         (WebCore::CachedResourceLoader::checkInsecureContent const):
2686         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
2687         (WebCore::isResourceSuitableForDirectReuse):
2688         * loader/cache/CachedResourceLoader.h:
2689
2690 2017-08-04  John Wilander  <wilander@apple.com>
2691
2692         Resource Load Statistics: Report user interaction immediately, but only when needed
2693         https://bugs.webkit.org/show_bug.cgi?id=175090
2694         <rdar://problem/33685546>
2695
2696         Reviewed by Chris Dumez.
2697
2698         Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
2699
2700         * loader/ResourceLoadObserver.cpp:
2701         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
2702         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2703             Now tells the UI process immediately but also records that it has
2704             done so to avoid doing it when not needed.
2705         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
2706             Conditional throttling gone, now always throttles.
2707         (WebCore::ResourceLoadObserver::notifyObserver):
2708             Renamed from ResourceLoadObserver::notificationTimerFired().
2709         (WebCore::ResourceLoadObserver::clearState):
2710             New function to allow the test runner to reset the web process'
2711             statistics state now that we keep track of whether or not we've
2712             reported user interaction to the UI process.
2713         (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
2714         (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
2715         * loader/ResourceLoadObserver.h:
2716         (): Deleted.
2717         * testing/Internals.cpp:
2718         (WebCore::Internals::resetToConsistentState):
2719         (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
2720             No longer needed since user interaction is always communicated
2721             immediately.
2722         * testing/Internals.h:
2723         * testing/Internals.idl:
2724
2725 2017-08-04  Matt Baker  <mattbaker@apple.com>
2726
2727         Web Inspector: capture async stack trace when workers/main context posts a message
2728         https://bugs.webkit.org/show_bug.cgi?id=167084
2729         <rdar://problem/30033673>
2730
2731         Reviewed by Brian Burg.
2732
2733         Add instrumentation to DOMWindow to support showing asynchronous
2734         stack traces when the debugger pauses in a MessageEvent handler.
2735
2736         Test: inspector/debugger/async-stack-trace.html
2737
2738         * inspector/InspectorInstrumentation.cpp:
2739         (WebCore::InspectorInstrumentation::didPostMessageImpl):
2740         (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
2741         (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
2742         (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
2743
2744         * inspector/InspectorInstrumentation.h:
2745         (WebCore::InspectorInstrumentation::didPostMessage):
2746         (WebCore::InspectorInstrumentation::didFailPostMessage):
2747         (WebCore::InspectorInstrumentation::willDispatchPostMessage):
2748         (WebCore::InspectorInstrumentation::didDispatchPostMessage):
2749
2750         * inspector/PageDebuggerAgent.cpp:
2751         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
2752         (WebCore::PageDebuggerAgent::didPostMessage):
2753         (WebCore::PageDebuggerAgent::didFailPostMessage):
2754         (WebCore::PageDebuggerAgent::willDispatchPostMessage):
2755         (WebCore::PageDebuggerAgent::didDispatchPostMessage):
2756         * inspector/PageDebuggerAgent.h:
2757
2758         * page/DOMWindow.cpp:
2759         (WebCore::DOMWindow::postMessage):
2760         (WebCore::DOMWindow::postMessageTimerFired):
2761
2762 2017-08-04  Devin Rousso  <drousso@apple.com>
2763
2764         Web Inspector: add source view for WebGL shader programs
2765         https://bugs.webkit.org/show_bug.cgi?id=138593
2766         <rdar://problem/18936194>
2767
2768         Reviewed by Matt Baker.
2769
2770         Test: inspector/canvas/requestShaderSource.html
2771
2772         * inspector/InspectorCanvasAgent.h:
2773         * inspector/InspectorCanvasAgent.cpp:
2774         (WebCore::InspectorCanvasAgent::requestShaderSource):
2775
2776         * inspector/InspectorShaderProgram.h:
2777         * inspector/InspectorShaderProgram.cpp:
2778         (WebCore::InspectorShaderProgram::shaderForType):
2779
2780 2017-08-04  Matt Lewis  <jlewis3@apple.com>
2781
2782         Unreviewed, rolling out r220288.
2783
2784         This broke multiple builds.
2785
2786         Reverted changeset:
2787
2788         "Use MPAVRoutingController instead of deprecated versions."
2789         https://bugs.webkit.org/show_bug.cgi?id=175063
2790         http://trac.webkit.org/changeset/220288
2791
2792 2017-08-03  Filip Pizlo  <fpizlo@apple.com>
2793
2794         The allocator used to allocate memory for MarkedBlocks and LargeAllocations should not be the Subspace itself
2795         https://bugs.webkit.org/show_bug.cgi?id=175141
2796
2797         Reviewed by Mark Lam.
2798
2799         No new tests because no new behavior.
2800         
2801         Just adapting to an API change.
2802
2803         * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Added.
2804         * bindings/js/WebCoreJSClientData.cpp:
2805         (WebCore::JSVMClientData::JSVMClientData):
2806
2807 2017-08-04  Chris Dumez  <cdumez@apple.com>
2808
2809         Match newly-clarified spec on textarea defaultValue/value/child text content
2810         https://bugs.webkit.org/show_bug.cgi?id=173878
2811
2812         Reviewed by Darin Adler.
2813
2814         Update HTMLTextArea.defaultValue to match align with other browsers and match the
2815         latest HTML specification:
2816         - https://html.spec.whatwg.org/#dom-textarea-defaultvalue
2817
2818         The defaultValue getter should return the child text content:
2819         - https://dom.spec.whatwg.org/#concept-child-text-content
2820         Our code was traversing all Text descendants, not just the children.
2821
2822         The defaultValue setter should act as the setter of the Element's textContent
2823         IDL attribute. Previously, we had a custom logic that was only removing the
2824         text children.
2825
2826         Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html
2827
2828         * dom/ScriptElement.cpp:
2829         (WebCore::ScriptElement::scriptContent const):
2830         * dom/TextNodeTraversal.cpp:
2831         (WebCore::TextNodeTraversal::childTextContent):
2832         * dom/TextNodeTraversal.h:
2833         * html/HTMLTextAreaElement.cpp:
2834         (WebCore::HTMLTextAreaElement::defaultValue const):
2835         (WebCore::HTMLTextAreaElement::setDefaultValue):
2836         * html/HTMLTitleElement.cpp:
2837         (WebCore::HTMLTitleElement::text const):
2838
2839 2017-08-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2840
2841         RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
2842         https://bugs.webkit.org/show_bug.cgi?id=174874
2843         <rdar://problem/33530130>
2844
2845         Reviewed by Simon Fraser.
2846
2847         If an <img> element has a non-CachedImage content data, e.g. -webkit-named-image,
2848         RenderImageResourceStyleImage will be created and  attached to the RenderImage.
2849         RenderImageResourceStyleImage::m_cachedImage will be set to null at the 
2850         beginning because the m_styleImage->isCachedImage() is false in this case.
2851         When ImageLoader finishes loading the url of the src attribute,
2852         RenderImageResource::setCachedImage() will be called to set m_cachedImage.
2853
2854         A crash will happen when the RenderImage is destroyed. Destroying the 
2855         RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
2856         m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
2857         which ends up calling CSSNamedImageValue::image() which returns a null pointer
2858         because the size is empty. RenderImageResourceStyleImage::shutdown() calls
2859         image()->stopAnimation() without checking the return value of image().
2860
2861         Another crash will happen later when deleting the CachedImage from the memory
2862         cache if CachedImage::canDestroyDecodedData() is called because the client
2863         it gets from m_clients is a freed pointer. This happens because RenderImageResourceStyleImage
2864         has m_styleImage of type StyleGeneratedImage but its m_cachedImage is set
2865         by RenderImageResource::setCachedImage(). When RenderImageResourceStyleImage::shutdown()
2866         is called, it calls  StyleGeneratedImage::removeClient() which does not 
2867         know anything about RenderImageResourceStyleImage::m_cachedImage. So we 
2868         end up having a freed pointer in the m_clients of the CachedImage.
2869
2870         Test: fast/images/image-element-image-content-data.html
2871
2872         * rendering/RenderImageResourceStyleImage.cpp:
2873         (WebCore::RenderImageResourceStyleImage::shutdown):  Revert back the changes
2874         of r208511 in this function. Add a call to image()->stopAnimation() without
2875         checking the return of image() since it will return the nullImage() if
2876         the image not available. There is no need to check m_cachedImage before 
2877         calling image() because image() does not check or access m_cachedImage.
2878
2879         If m_styleImage is not a CachedStyleImage but m_cachedImage is not null,
2880         we need to remove m_renderer from the set of the clients of this m_cachedImage.
2881
2882         (WebCore::RenderImageResourceStyleImage::image const): The base class method
2883         RenderImageResource::image() returns the nullImage() if the image not
2884         available. This is because CachedImage::imageForRenderer() returns
2885         the nullImage() if the image is not available; see CachedImage.h. We should
2886         do the same for the derived class for consistency.
2887
2888 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
2889
2890         Use MPAVRoutingController instead of deprecated versions.
2891         https://bugs.webkit.org/show_bug.cgi?id=175063
2892
2893         Reviewed by Tim Horton.
2894
2895         No new tests because no behavior change. This uses a different platform class to present
2896         an interface.
2897
2898         Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
2899         Add MPMediaControlsViewController.
2900
2901         * platform/spi/ios/MediaPlayerSPI.h:
2902
2903 2017-08-04  Matt Baker  <mattbaker@apple.com>
2904
2905         Web Inspector: REGRESSION (r220233): Check for null pointer passed to WebGLRenderingContextBase::deleteProgram
2906         https://bugs.webkit.org/show_bug.cgi?id=175196
2907         <rdar://problem/33727603>
2908
2909         Reviewed by Devin Rousso.
2910
2911         * html/canvas/WebGLRenderingContextBase.cpp:
2912         (WebCore::WebGLRenderingContextBase::deleteProgram):
2913
2914 2017-08-04  Matt Lewis  <jlewis3@apple.com>
2915
2916         Unreviewed, rolling out r220271.
2917
2918         Rolling out due to Layout Test failing on iOS Simulator.
2919
2920         Reverted changeset:
2921
2922         "Remove STREAMS_API compilation guard"
2923         https://bugs.webkit.org/show_bug.cgi?id=175165
2924         http://trac.webkit.org/changeset/220271
2925
2926 2017-08-03  Sam Weinig  <sam@webkit.org>
2927
2928         [Cleanup] Remove ScriptGlobalObject
2929         https://bugs.webkit.org/show_bug.cgi?id=175173
2930
2931         Reviewed by Darin Adler.
2932
2933         ScriptGlobalObject's two functions were only being used in
2934         four places. Three of those uses (ScriptGlobalObject::set in 
2935         InspectorFrontendClientLocal, WebInspectorUI, and RemoteWebInspectorUI)
2936         were merged into the new function addSelfToGlobalObjectInWorld on
2937         InspectorFrontendHost. The remaining function (ScriptGlobalObject::get
2938         in InspectorFrontendHost) was easily inlined.
2939
2940         * CMakeLists.txt:
2941         * WebCore.xcodeproj/project.pbxproj:
2942         * bindings/js/JSBindingsAllInOne.cpp:
2943         * bindings/js/ScriptGlobalObject.cpp: Removed.
2944         * bindings/js/ScriptGlobalObject.h: Removed.
2945         Removed ScriptGlobalObject.
2946
2947         * inspector/InspectorFrontendClientLocal.cpp:
2948         (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
2949         Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.
2950
2951         * inspector/InspectorFrontendHost.h:
2952         * inspector/InspectorFrontendHost.cpp:
2953         (WebCore::InspectorFrontendHost::showContextMenu):
2954         Inline ScriptGlobalObject::get.
2955
2956         (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
2957         Add helper which inlines ScriptGlobalObject::set and works
2958         as a helper for the three inspector frontends.
2959
2960 2017-08-04  Ryan Haddad  <ryanhaddad@apple.com>
2961
2962         Unreviewed, rolling out r220268.
2963
2964         This change caused assertion failures on macOS and iOS Debug
2965         WK2.
2966
2967         Reverted changeset:
2968
2969         "Resource Load Statistics: Report user interaction
2970         immediately, but only when needed"
2971         https://bugs.webkit.org/show_bug.cgi?id=175090
2972         http://trac.webkit.org/changeset/220268
2973
2974 2017-08-04  Youenn Fablet  <youenn@apple.com>
2975
2976         Remove STREAMS_API compilation guard
2977         https://bugs.webkit.org/show_bug.cgi?id=175165
2978
2979         Reviewed by Darin Adler.
2980
2981         No change of behavior.
2982
2983         * Configurations/FeatureDefines.xcconfig:
2984         * Modules/fetch/FetchBody.cpp:
2985         (WebCore::FetchBody::consumeAsStream):
2986         * Modules/fetch/FetchBody.h:
2987         * Modules/fetch/FetchBodyOwner.cpp:
2988         (WebCore::FetchBodyOwner::isDisturbedOrLocked const):
2989         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
2990         (WebCore::FetchBodyOwner::blobLoadingFailed):
2991         (WebCore::FetchBodyOwner::blobChunk):
2992         * Modules/fetch/FetchBodyOwner.h:
2993         * Modules/fetch/FetchResponse.cpp:
2994         (WebCore::FetchResponse::BodyLoader::didSucceed):
2995         (WebCore::FetchResponse::BodyLoader::didFail):
2996         (WebCore::FetchResponse::BodyLoader::didReceiveData):
2997         * Modules/fetch/FetchResponse.h:
2998         * Modules/fetch/FetchResponse.idl:
2999         * Modules/fetch/FetchResponse.js:
3000         (initializeFetchResponse):
3001         * Modules/fetch/FetchResponseSource.cpp:
3002         * Modules/fetch/FetchResponseSource.h:
3003         * Modules/streams/ByteLengthQueuingStrategy.idl:
3004         * Modules/streams/ByteLengthQueuingStrategy.js:
3005         * Modules/streams/CountQueuingStrategy.idl:
3006         * Modules/streams/CountQueuingStrategy.js:
3007         * Modules/streams/ReadableByteStreamController.idl:
3008         * Modules/streams/ReadableByteStreamController.js:
3009         * Modules/streams/ReadableByteStreamInternals.js:
3010         * Modules/streams/ReadableStream.idl:
3011         * Modules/streams/ReadableStream.js:
3012         * Modules/streams/ReadableStreamBYOBReader.idl:
3013         * Modules/streams/ReadableStreamBYOBReader.js:
3014         * Modules/streams/ReadableStreamBYOBRequest.idl:
3015         * Modules/streams/ReadableStreamBYOBRequest.js:
3016         * Modules/streams/ReadableStreamDefaultController.idl:
3017         * Modules/streams/ReadableStreamDefaultController.js:
3018         * Modules/streams/ReadableStreamDefaultReader.idl:
3019         * Modules/streams/ReadableStreamDefaultReader.js:
3020         * Modules/streams/ReadableStreamInternals.js:
3021         * Modules/streams/ReadableStreamSource.h:
3022         * Modules/streams/ReadableStreamSource.idl:
3023         * Modules/streams/StreamInternals.js:
3024         * Modules/streams/WritableStream.idl:
3025         * Modules/streams/WritableStream.js:
3026         * Modules/streams/WritableStreamInternals.js:
3027         * bindings/js/JSDOMGlobalObject.cpp:
3028         (WebCore::isReadableByteStreamAPIEnabled):
3029         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3030         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
3031         * bindings/js/JSReadableStreamPrivateConstructors.h:
3032         * bindings/js/JSReadableStreamSourceCustom.cpp:
3033         * bindings/js/ReadableStreamDefaultController.cpp:
3034         * bindings/js/ReadableStreamDefaultController.h:
3035         * page/RuntimeEnabledFeatures.h:
3036         * testing/Internals.cpp:
3037         * testing/Internals.h:
3038         * testing/Internals.idl:
3039
3040 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
3041
3042         [EME][GStreamer] Register ClearKey CDMFactory
3043         https://bugs.webkit.org/show_bug.cgi?id=175136
3044
3045         Reviewed by Xabier Rodriguez-Calvar.
3046
3047         Register the ClearKey CDM factory in CDMFactoryGStreamer. A CDMFactoryClearKey
3048         singleton object is introduced and used for that registration.
3049
3050         The basic CDMFactoryClearKey and CDMPrivateClearKey methods are implemented,
3051         marking `org.w3.clearkey` as the supported key system and `keyids` as the
3052         supported init data type. Additional logic around key system configurations,
3053         distinctive identifiers, persistent state and related restrictions and
3054         requirements is implemented.
3055
3056         This improves the ClearKey EME tests a bit, now progressing to the point of
3057         failing with a NotAllowedError exception due to the CDMInstance object failing
3058         to properly initialize because of missing implementation.
3059
3060         No new tests -- relevant tests have underlying baselines updated to reflect
3061         changes in behavior.
3062
3063         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3064         (WebCore::CDMFactoryClearKey::singleton):
3065         (WebCore::CDMFactoryClearKey::supportsKeySystem):
3066         (WebCore::CDMPrivateClearKey::supportsInitDataType const):
3067         (WebCore::CDMPrivateClearKey::supportsConfiguration const):
3068         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
3069         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
3070         (WebCore::CDMPrivateClearKey::supportsRobustness const):
3071         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement const):
3072         (WebCore::CDMPrivateClearKey::persistentStateRequirement const):
3073         * platform/encryptedmedia/clearkey/CDMClearKey.h:
3074         * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp:
3075         (WebCore::CDMFactory::platformRegisterFactories):
3076
3077 2017-08-04  John Wilander  <wilander@apple.com>
3078
3079         Resource Load Statistics: Report user interaction immediately, but only when needed
3080         https://bugs.webkit.org/show_bug.cgi?id=175090
3081         <rdar://problem/33685546>
3082
3083         Reviewed by Chris Dumez.
3084
3085         Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
3086
3087         * loader/ResourceLoadObserver.cpp:
3088         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
3089         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3090             Now tells the UI process immediately but also records that it has
3091             done so to avoid doing it when not needed.
3092         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
3093             Conditional throttling gone, now always throttles.
3094         (WebCore::ResourceLoadObserver::notifyObserver):
3095             Renamed from ResourceLoadObserver::notificationTimerFired().
3096         (WebCore::ResourceLoadObserver::clearState):
3097             New function to allow the test runner to reset the web process'
3098             statistics state now that we keep track of whether or not we've
3099             reported user interaction to the UI process.
3100         (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
3101         (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
3102         * loader/ResourceLoadObserver.h:
3103         (): Deleted.
3104         * testing/Internals.cpp:
3105         (WebCore::Internals::resetToConsistentState):
3106         (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
3107             No longer needed since user interaction is always communicated
3108             immediately.
3109         * testing/Internals.h:
3110         * testing/Internals.idl:
3111
3112 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
3113
3114         [EME] Push CDMFactory into the platform layer
3115         https://bugs.webkit.org/show_bug.cgi?id=175129
3116
3117         Reviewed by Xabier Rodriguez-Calvar.
3118
3119         This is a follow-up to r219678 that moved the majority of CDM abstraction
3120         classes into the platform layer, but missed the CDMFactory class.
3121
3122         The CDMFactory abstraction is now also placed in the platform layer. Only
3123         change to the interface is that the createCDM() method can't accept a CDM
3124         object reference anymore since that class is cemented into the WebCore
3125         layer, and no current implementation used it anyway.
3126
3127         Additionally, the static Vector object of registered factories is moved
3128         under the CDMFactory class, along with the register and unregister
3129         functions. The platformRegisterFactories() function is added to allow for
3130         platform-specific factory registrations to occur when the registered
3131         factories are queried for the first time. Empty implementation for this
3132         function is provided for non-GStreamer platforms, while for GStreamer
3133         the implementation is kept in CDMFactoryGStreamer.cpp. It's still empty
3134         for now, but it will register the ClearKey factory there in the near
3135         future.
3136
3137         No new tests -- none affected, only refactoring.
3138
3139         * CMakeLists.txt:
3140         * Modules/encryptedmedia/CDM.cpp:
3141         (WebCore::createCDMPrivateForKeySystem):
3142         (WebCore::CDM::supportsKeySystem):
3143         (WebCore::CDM::CDM):
3144         (): Deleted.
3145         (WebCore::CDM::registerCDMFactory): Deleted.
3146         (WebCore::CDM::unregisterCDMFactory): Deleted.
3147         * Modules/encryptedmedia/CDM.h:
3148         (WebCore::CDMFactory::~CDMFactory): Deleted.
3149         * PlatformWPE.cmake:
3150         * platform/GStreamer.cmake:
3151         * platform/encryptedmedia/CDMFactory.cpp: Added.
3152         (WebCore::CDMFactory::registerFactory):
3153         (WebCore::CDMFactory::unregisterFactory):
3154         (WebCore::CDMFactory::platformRegisterFactories):
3155         * platform/encryptedmedia/CDMFactory.h: Added.
3156         (WebCore::CDMFactory::~CDMFactory):
3157         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3158         (WebCore::CDMFactoryClearKey::createCDM):
3159         * platform/encryptedmedia/clearkey/CDMClearKey.h:
3160         * platform/encryptedmedia/gstreamer/CDMFactoryGStreamer.cpp: Added.
3161         (WebCore::CDMFactory::platformRegisterFactories):
3162         * testing/MockCDMFactory.cpp:
3163         (WebCore::m_weakPtrFactory):
3164         (WebCore::MockCDMFactory::unregister):
3165         (WebCore::MockCDMFactory::createCDM):
3166         * testing/MockCDMFactory.h:
3167
3168 2017-08-04  Frederic Wang  <fwang@igalia.com>
3169
3170         ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle
3171         https://bugs.webkit.org/show_bug.cgi?id=175135
3172
3173         Reviewed by Simon Fraser.
3174
3175         This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so
3176         that it uses the fixed position rectangle relative of the first frame ancestor instead of
3177         the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS
3178         and RenderLayerCompositor. This fixes some flickering issues on iOS.
3179
3180         Test: fast/scrolling/ios/fixed-inside-overflow-inside-iframe.html
3181
3182         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3183         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Helper function to get the
3184         fixed position rect to use for that frame.
3185         * page/scrolling/ScrollingTreeNode.cpp:
3186         (WebCore::ScrollingTreeNode::enclosingFrameNode const): Helper function to get the enclosing
3187         frame for this scrolling node or null if there is none.
3188         * page/scrolling/ScrollingTreeNode.h: Declare enclosingFrameNode.
3189
3190 2017-08-04  Zan Dobersek  <zdobersek@igalia.com>
3191
3192         Unreviewed. Removing redundant NotImplemented.h header inclusions
3193         and cleaning up whitespace issues in libgcrypt-specific CryptoKeyEC
3194         and CryptoKeyRSA implementation files.
3195
3196         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
3197         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
3198
3199 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
3200
3201         Remove unnecesary call to status bar SPI.
3202         https://bugs.webkit.org/show_bug.cgi?id=175176
3203         rdar://problem/20887306
3204
3205         Reviewed by Darin Adler.
3206
3207         No new tests because no behavior change.
3208
3209         This removes an obsolete call to SPI.
3210
3211         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3212         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
3213
3214 2017-08-03  Zan Dobersek  <zdobersek@igalia.com>
3215
3216         [GCrypt] Implement CryptoKeyEC PKCS#8 imports
3217         https://bugs.webkit.org/show_bug.cgi?id=173647
3218
3219         Reviewed by Jiewen Tan.
3220
3221         No new tests -- affected tests are now passing and are unskipped.
3222
3223         Implement libgcrypt-based support for PKCS#8 imports of EC keys.
3224
3225         Existing libtasn1 utilities are used to achieve this. First, the provided key data
3226         is decoded against the PrivateKeyInfo ASN.1 definition. First, the version member
3227         of that structure is validated, followed by the algorithm member. The latter is
3228         also properly tested depending on this being an import of an ECDSA or ECDH key.
3229
3230         Data of the parameters member is decoded against the ECParameters ASN.1 definition,
3231         and the namedCurve object identifier is validated, making sure it represents a
3232         valid EC curve and that this curve maches the one specified for the import
3233         operation.
3234
3235         Data of the privateKey member is decoded against the ECPrivateKey ASN.1 definition.
3236         The version member of that structure is properly validated. The optional parameters
3237         member of that structure is already decoded against the ECParameters ASN.1
3238         definition. If present, it is checked to contain a valid EC curve identifier that
3239         matches the specified curve.
3240
3241         The optional publicKey member of the ECPrivateKey structure is validated, testing
3242         that its data matches in size an uncompressed EC point, and that the first byte
3243         of this data is 0x04, as expected for an uncompressed EC point.
3244
3245         What's left is the private key data on the initial ECPrivateKey structure. That
3246         data is retrieved and validated, making sure its size matches the size of the
3247         specified curve. The `private-key` s-expression is then constructed, embedding
3248         the curve name and the validated private key data. This s-expression is then used
3249         to construct an EC context.
3250
3251         If the optional publicKey data was provided, it's used to set the `q` parameter
3252         for this EC context. Otherwise, the value for `q` is computed on-the-fly for the
3253         specified EC and the provided private key. The `q` point is then tested through
3254         the gcry_mpi_ec_curve_point() function, making sure that the derived point is
3255         indeed located on the given EC.
3256
3257         Finally, with the private key properly validated, a new CryptoKeyEC object is
3258         constructed, using the `private-key` s-expression and the parameters that were
3259         specified for this import operation.
3260
3261         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
3262         (WebCore::CryptoKeyEC::platformImportPkcs8):
3263         * crypto/gcrypt/GCryptUtilities.h:
3264
3265 2017-08-03  Chris Dumez  <cdumez@apple.com>
3266
3267         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
3268         https://bugs.webkit.org/show_bug.cgi?id=175132
3269
3270         Reviewed by Darin Adler.
3271
3272         Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.', without
3273         a leading 0. This is as per https://github.com/whatwg/html/pull/2852.
3274
3275         The latest spec is at:
3276         - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
3277
3278         Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
3279
3280         * html/parser/HTMLParserIdioms.cpp:
3281         (WebCore::parseHTTPRefreshInternal):
3282
3283 2017-08-03  Brian Burg  <bburg@apple.com>
3284
3285         Remove ENABLE(WEB_SOCKET) guards
3286         https://bugs.webkit.org/show_bug.cgi?id=167044
3287
3288         Reviewed by Joseph Pecoraro.
3289
3290         * Configurations/FeatureDefines.xcconfig:
3291         * Modules/websockets/ThreadableWebSocketChannel.cpp:
3292         * Modules/websockets/ThreadableWebSocketChannel.h:
3293         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
3294         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
3295         * Modules/websockets/WebSocket.cpp:
3296         * Modules/websockets/WebSocket.h:
3297         * Modules/websockets/WebSocket.idl:
3298         * Modules/websockets/WebSocketChannel.cpp:
3299         * Modules/websockets/WebSocketChannel.h:
3300         * Modules/websockets/WebSocketChannelClient.h:
3301         * Modules/websockets/WebSocketDeflateFramer.cpp:
3302         * Modules/websockets/WebSocketDeflateFramer.h:
3303         * Modules/websockets/WebSocketDeflater.cpp:
3304         * Modules/websockets/WebSocketDeflater.h:
3305         * Modules/websockets/WebSocketExtensionDispatcher.cpp:
3306         * Modules/websockets/WebSocketExtensionDispatcher.h:
3307         * Modules/websockets/WebSocketExtensionParser.cpp:
3308         * Modules/websockets/WebSocketExtensionParser.h:
3309         * Modules/websockets/WebSocketExtensionProcessor.h:
3310         * Modules/websockets/WebSocketFrame.cpp:
3311         * Modules/websockets/WebSocketFrame.h:
3312         * Modules/websockets/WebSocketHandshake.cpp:
3313         * Modules/websockets/WebSocketHandshake.h:
3314         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3315         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
3316         * dom/Document.cpp:
3317         (WebCore::Document::Document):
3318         (WebCore::Document::idbConnectionProxy):
3319         (WebCore::Document::socketProvider):
3320         * dom/Document.h:
3321         * dom/ScriptExecutionContext.h:
3322         * inspector/InspectorInstrumentation.cpp:
3323         (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl):
3324         * inspector/InspectorInstrumentation.h:
3325         (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
3326         * inspector/InspectorNetworkAgent.cpp:
3327         * inspector/InspectorNetworkAgent.h:
3328         * page/RuntimeEnabledFeatures.cpp:
3329         (WebCore::RuntimeEnabledFeatures::webSocketEnabled const):
3330         * page/RuntimeEnabledFeatures.h:
3331         * page/SocketProvider.cpp:
3332         * page/SocketProvider.h:
3333         * workers/WorkerGlobalScope.cpp:
3334         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3335         * workers/WorkerGlobalScope.h:
3336         * workers/WorkerMessagingProxy.cpp:
3337         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3338         * workers/WorkerThread.cpp:
3339         (WebCore::WorkerThread::WorkerThread):
3340         (WebCore::WorkerThread::socketProvider):
3341         * workers/WorkerThread.h:
3342
3343 2017-08-03  Don Olmstead  <don.olmstead@sony.com>
3344
3345         Remove LayoutUnit dependency in TextStream
3346         https://bugs.webkit.org/show_bug.cgi?id=175110
3347
3348         Reviewed by Zalan Bujtas.
3349
3350         No new tests. No change in behavior.
3351
3352         * CMakeLists.txt:
3353         * WebCore.xcodeproj/project.pbxproj:
3354         * platform/LayoutUnit.cpp: Added.
3355         (WebCore::operator<<):
3356         * platform/LayoutUnit.h:
3357         * platform/text/TextStream.cpp:
3358         * platform/text/TextStream.h:
3359
3360 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
3361
3362         Improve WebKitLegacy video fullscreen animation begin and end rects.
3363         https://bugs.webkit.org/show_bug.cgi?id=175152
3364         rdar://problem/32840576
3365
3366         Reviewed by Eric Carlson.
3367
3368         No new tests, becuase this change has no effect on the DOM.
3369
3370         This change uses different rects for fullscreen animation to prevent the animation
3371         from failing, and to improve the aesthetics of the animation.
3372
3373         * platform/mac/WebVideoFullscreenController.mm:
3374         (frameExpandedToRatioOfFrame):
3375         (-[WebVideoFullscreenController enterFullscreen:]):
3376         (-[WebVideoFullscreenController exitFullscreen]):
3377         (-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]):
3378         (constrainFrameToRatioOfFrame): Deleted.
3379
3380 2017-08-03  Jer Noble  <jer.noble@apple.com>
3381
3382         [EME][Mac] SecureStop left on disk in Private Browsing mode.
3383         https://bugs.webkit.org/show_bug.cgi?id=175162
3384
3385         Reviewed by Eric Carlson.
3386
3387         Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should
3388         be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat
3389         an empty string as valid, and do not try to store or retrieve session information to disk in that case.
3390
3391         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
3392         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
3393         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3394         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
3395         (WebCore::CDMSessionAVContentKeySession::update):
3396         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
3397         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
3398         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
3399         (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const):
3400
3401 2017-08-03  Youenn Fablet  <youenn@apple.com>
3402
3403         [Fetch API] Add support for Request keepalive getter
3404         https://bugs.webkit.org/show_bug.cgi?id=175151
3405
3406         Reviewed by Chris Dumez.
3407
3408         Test: imported/w3c/web-platform-tests/fetch/api/request/request-keepalive.html
3409
3410         Adding keepalive as a fetch option.
3411         Adding initialization and getter of keepalive into FetchRequest.
3412
3413         * Modules/fetch/FetchRequest.cpp:
3414         (WebCore::buildOptions):
3415         * Modules/fetch/FetchRequest.h:
3416         * Modules/fetch/FetchRequest.idl:
3417         * loader/FetchOptions.h:
3418
3419 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
3420
3421         [PAL] Move spi/cf directory into PAL
3422         https://bugs.webkit.org/show_bug.cgi?id=175057
3423
3424         Reviewed by Antti Koivisto.
3425
3426         * WebCore.xcodeproj/project.pbxproj:
3427         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3428         * loader/cocoa/SubresourceLoaderCocoa.mm:
3429         * loader/mac/ResourceLoaderMac.mm:
3430         * platform/cf/CoreMediaSoftLink.cpp:
3431         * platform/cf/CoreMediaSoftLink.h:
3432         * platform/mac/PluginBlacklist.mm:
3433         * platform/mac/WebCoreNSStringExtras.mm:
3434         * platform/mac/WebGLBlacklist.mm:
3435         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3436         * platform/network/NetworkStorageSession.h:
3437         * platform/network/cf/CookieJarCFNet.cpp:
3438         * platform/network/cf/CredentialStorageCFNet.cpp:
3439         * platform/network/cf/ResourceHandleCFNet.cpp:
3440         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
3441         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3442         * platform/network/cf/ResourceRequestCFNet.cpp:
3443         * platform/network/cf/ResourceRequestCFNet.h:
3444         * platform/network/cf/ResourceResponse.h:
3445         * platform/network/cf/ResourceResponseCFNet.cpp:
3446         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3447         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3448         * platform/network/cocoa/CookieStorageObserver.h:
3449         * platform/network/cocoa/CredentialCocoa.h:
3450         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3451         * platform/network/cocoa/ResourceRequestCocoa.mm:
3452         * platform/network/cocoa/ResourceResponseCocoa.mm:
3453  &