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