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