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