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