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