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