[WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-07-24  Zan Dobersek  <zdobersek@igalia.com>
2
3         [WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h
4         https://bugs.webkit.org/show_bug.cgi?id=174780
5
6         Reviewed by Carlos Garcia Campos.
7
8         Newer versions of libepoxy provide EGL definitions that already use the EGL_CAST macro.
9         We'd like to compile on systems where the eglplatform.h header doesn't yet provide
10         that macro that was added only recently (e.g. it's available in Mesa 17.1, but not
11         before).
12
13         To address that, the EpoxyEGL.h header is added that first includes the libepoxy's EGL
14         header and then provides the EGL_CAST definition in case the eglplatform.h header doesn't.
15         This header should be included in place of <epoxy/egl.h> (which is included in this new
16         header).
17
18         The EpoxyEGL.h and EpoxyShims.h headers are also moved under the platform/graphics/epoxy/
19         directory, with the new directory added to the list of inclusion paths for WPE.
20
21         * PlatformWPE.cmake:
22         * platform/graphics/PlatformDisplay.cpp:
23         * platform/graphics/cairo/CairoUtilities.cpp:
24         * platform/graphics/cairo/ImageBufferCairo.cpp:
25         * platform/graphics/egl/GLContextEGL.cpp:
26         * platform/graphics/egl/GLContextEGLWPE.cpp:
27         * platform/graphics/epoxy/EpoxyEGL.h: Added.
28         * platform/graphics/epoxy/EpoxyShims.h: Renamed from Source/WebCore/platform/graphics/EpoxyShims.h.
29         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
30         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
31
32 2017-07-24  Zan Dobersek  <zdobersek@igalia.com>
33
34         [CoordinatedGraphics] Remove unused GLDefs.h header
35         https://bugs.webkit.org/show_bug.cgi?id=174712
36
37         Reviewed by Michael Catanzaro.
38
39         * platform/graphics/opengl/GLDefs.h: Remove this unused header.
40         As far as my recollection goes it was used in the IPC-based
41         CoordinatedGraphics subsystem, which has been removed already.
42
43 2017-07-11  Frederic Wang  <fwang@igalia.com>
44
45         Add attribute allow-top-navigation-by-user-activation to iframe sandbox
46         https://bugs.webkit.org/show_bug.cgi?id=171327
47
48         Reviewed by Chris Dumez.
49
50         Tests: http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html
51                http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2.html
52                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture-expected.txt
53                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-3-expected.txt
54
55         * dom/Document.cpp:
56         (WebCore::Document::canNavigate): Case 2 of conformance verification is refined to match the
57         current specification: Top navigation is allowed when it is triggered by user activation and
58         when allow-top-navigation-by-user-activation is set. Because we have additional "security
59         origin" rules with respect to the specification we also add some early return to ensure that
60         navigation is really allowed for this new case.
61         * dom/SecurityContext.cpp:
62         (WebCore::SecurityContext::isSupportedSandboxPolicy): Add allow-top-navigation-by-user-activation flag.
63         (WebCore::SecurityContext::parseSandboxPolicy): Parse the new flag to allow top user
64         navigation by user activation. Also, make sure that allow-top-navigation allows such
65         navigation as defined by the specification.
66         * dom/SecurityContext.h: Declare new sandboxing flag.
67
68 2017-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
69
70         [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values
71         https://bugs.webkit.org/show_bug.cgi?id=174769
72         <rdar://problem/33478864>
73
74         Reviewed by Tim Horton.
75
76         These tests began failing after r219541, due to a change in behavior of whether or not we call
77         setIgnoreSelectionChanges(false, RevealSelection::No) or setIgnoreSelectionChanges(false, RevealSelection::Yes)
78         when performing a text editing drop.
79
80         Before r219541, we would not reveal the selection when performing an edit drag operation. This is because in
81         WebPage::performDragControllerAction, we would begin ignoring selection changes by calling
82         setIgnoreSelectionChanges(true). However, while taking a text indicator snapshot, we would stop ignoring
83         selection in TextIndicator::createWithRange due to us calling setIgnoreSelectionChanges(false,
84         RevealSelection::No) at the end of the function. Then, when we return to the scope of
85         WebPage::performDragControllerAction and try to setIgnoreSelectionChanges(false), this is a no-op because we've
86         already stopped ignoring selection changes.
87
88         After r219541, switching to using TemporarySelectionChange means that TextIndicator::createWithRange now means
89         we respect whether or not we were already ignoring selection before taking the snapshot, so we won't always
90         setIgnoreSelectionChanges(false) at the end. This means that selection changes will now be correctly ignored
91         when performing a drag operation, but this also means that we'll try to reveal the selection, since
92         WebPage::performDragControllerAction calls setIgnoreSelectionChanges(false), for which RevealSelection::Yes
93         is used by default.
94
95         Revealing the selection in WebPage::performDragControllerAction was unintended in the first place, so we should
96         revert to calling setIgnoreSelectionChanges(false, RevealSelection::No). To ensure this, we adopt
97         TemporarySelectionChange here and pass only TemporarySelectionOptionIgnoreSelectionChanges, so that we won't
98         additionally try to reveal selection after the drop. This is consistent with behavior prior to macOS 10.13 and
99         iOS 11. Additionally, this patch also moves the call to ignore selection change from WebKit into WebCore, so
100         that whether we ignore selection is consistent across both WebKit1 and WebKit2.
101
102         * page/DragController.cpp:
103         (WebCore::DragController::performDragOperation):
104
105 2017-07-23  Chris Dumez  <cdumez@apple.com>
106
107         Drop ExceptionCodeDescription class
108         https://bugs.webkit.org/show_bug.cgi?id=174757
109
110         Reviewed by Darin Adler.
111
112         Drop ExceptionCodeDescription class now that there is only one exception
113         type: DOMException. Instead, we now have static methods on DOMException
114         to get the name / message for a given exception code.
115
116         * CMakeLists.txt:
117         * Modules/indexeddb/shared/IDBError.cpp:
118         (WebCore::IDBError::name):
119         (WebCore::IDBError::message):
120         * Modules/quota/StorageErrorCallback.cpp:
121         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
122         * WebCore.xcodeproj/project.pbxproj:
123         * bindings/js/JSDOMExceptionHandling.cpp:
124         (WebCore::createDOMException):
125         * dom/DOMAllInOne.cpp:
126         * dom/DOMException.cpp:
127         (WebCore::errorCodeFromName):
128         (WebCore::DOMException::create):
129         (WebCore::DOMException::DOMException):
130         (WebCore::DOMException::name):
131         (WebCore::DOMException::message):
132         * dom/DOMException.h:
133         * dom/ExceptionCodeDescription.cpp: Removed.
134         * dom/ExceptionCodeDescription.h: Removed.
135         * inspector/DOMEditor.cpp:
136         (WebCore::populateErrorString):
137         * inspector/InspectorDOMAgent.cpp:
138         (WebCore::InspectorDOMAgent::toErrorString):
139         * inspector/InspectorDOMStorageAgent.cpp:
140         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
141
142 2017-07-22  Dan Bernstein  <mitz@apple.com>
143
144         Fixed building for macOS 10.12 with the macOS 10.13 SDK after r219644.
145
146         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
147         (WebCore::CDMSessionAVStreamSession::update): Suppress the objc-literal-conversion warning
148           in one place where we are calling a class method on a Class and the compiler can’t tell
149           which class it is, so it chooses wrong and emits a warning.
150
151 2017-07-22  Chris Dumez  <cdumez@apple.com>
152
153         Merge ExceptionBase into DOMException and drop custom toString
154         https://bugs.webkit.org/show_bug.cgi?id=174755
155
156         Reviewed by Sam Weinig.
157
158         Merge ExceptionBase into DOMException and drop custom toString, now that DOMException
159         is the only remaining exception type.
160
161         * CMakeLists.txt:
162         * Modules/mediastream/MediaStream.h:
163         * WebCore.xcodeproj/project.pbxproj:
164         * bindings/js/JSDOMExceptionHandling.cpp:
165         (WebCore::retrieveErrorMessage):
166         * dom/DOMAllInOne.cpp:
167         * dom/DOMException.cpp:
168         (WebCore::DOMException::DOMException):
169         (WebCore::DOMException::initializeDescription):
170         * dom/DOMException.h:
171         (WebCore::DOMException::code):
172         (WebCore::DOMException::name):
173         (WebCore::DOMException::message):
174         * dom/ExceptionBase.cpp: Removed.
175         * dom/ExceptionBase.h: Removed.
176
177 2017-07-14  Filip Pizlo  <fpizlo@apple.com>
178
179         It should be easy to decide how WebKit yields
180         https://bugs.webkit.org/show_bug.cgi?id=174298
181
182         Reviewed by Saam Barati.
183
184         No new tests because the WebCore change is just a change to how we #include things.
185
186         * inspector/InspectorPageAgent.h:
187         * inspector/TimelineRecordFactory.h:
188         * workers/Worker.h:
189         * workers/WorkerGlobalScopeProxy.h:
190         * workers/WorkerMessagingProxy.h:
191
192 2017-07-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
193
194         REGRESSION(r219045): A partially loaded image may not be repainted when its complete frame finishes decoding
195         https://bugs.webkit.org/show_bug.cgi?id=174230
196
197         Reviewed by Simon Fraser.
198
199         Because of r219045, we now only repaint the CachedImageClinets which tried
200         to draw the image but they could not because they have to wait for the image
201         decoding to finish. This was done by keeping a HashSet of these clients 
202         and make CachedImage own it. This HashSet is cleared once the image frame
203         finishes decoding and all the waited clients are repainted.
204
205         But Multiple asynchronous image decoding requests are allowed for the same
206         frame if new data is added to the image source. If we tried to draw the 
207         same image twice before it finishes decoding the first request, we will
208         not be to record this second request since the HashSet will not add the
209         same client twice. When he second request finishes decoding, CachedImage
210         will not repaint any client since its HashSet is empty.
211
212         To fix this problem we can do the following. When an image frame finishes
213         decoding, CachedImage will keep its HashSet of pending drawing clients as
214         long as the image frame is a partially loaded frame.
215
216         * loader/cache/CachedImage.cpp:
217         (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
218         (WebCore::CachedImage::imageFrameAvailable):
219         * loader/cache/CachedImage.h:
220         * platform/graphics/BitmapImage.cpp:
221         (WebCore::BitmapImage::destroyDecodedData):
222         (WebCore::BitmapImage::dataChanged):
223         (WebCore::BitmapImage::setCurrentFrameDecodingStatusIfNecessary):
224         (WebCore::BitmapImage::draw):
225         (WebCore::BitmapImage::internalStartAnimation):
226         (WebCore::BitmapImage::internalAdvanceAnimation):
227         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
228         * platform/graphics/BitmapImage.h:
229         * platform/graphics/ImageFrame.cpp:
230         (WebCore::ImageFrame::decodingStatus):
231         * platform/graphics/ImageFrame.h: Move DecodingStatus out of this class
232         to ImageTypes.h to avoid adding other header files to ImageObvsever.h
233         * platform/graphics/ImageFrameCache.cpp:
234         (WebCore::ImageFrameCache::setNativeImage):
235         (WebCore::ImageFrameCache::cacheMetadataAtIndex):
236         (WebCore::ImageFrameCache::cacheNativeImageAtIndex):
237         (WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync):
238         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
239         (WebCore::ImageFrameCache::frameDecodingStatusAtIndex):
240         * platform/graphics/ImageFrameCache.h:
241         * platform/graphics/ImageObserver.h:
242         * platform/graphics/ImageSource.h:
243         (WebCore::ImageSource::frameDecodingStatusAtIndex):
244         * platform/graphics/ImageTypes.h:
245         * platform/image-decoders/bmp/BMPImageReader.cpp:
246         (WebCore::BMPImageReader::decodeBMP):
247         * platform/image-decoders/gif/GIFImageDecoder.cpp:
248         (WebCore::GIFImageDecoder::frameComplete):
249         (WebCore::GIFImageDecoder::initFrameBuffer):
250         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
251         (WebCore::JPEGImageDecoder::outputScanlines):
252         (WebCore::JPEGImageDecoder::jpegComplete):
253         * platform/image-decoders/png/PNGImageDecoder.cpp:
254         (WebCore::PNGImageDecoder::rowAvailable):
255         (WebCore::PNGImageDecoder::pngComplete):
256         (WebCore::PNGImageDecoder::frameComplete):
257         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
258         (WebCore::WEBPImageDecoder::decode):
259         * rendering/RenderBoxModelObject.cpp:
260         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
261
262 2017-07-22  Timothy Horton  <timothy_horton@apple.com>
263
264         Drag and Drop preview image for Twitter link is the wrong shape
265         ​https://bugs.webkit.org/show_bug.cgi?id=174731
266         <rdar://problem/33335616>
267
268         * dom/Range.cpp:
269         (WebCore::Range::absoluteRectsForRangeInText):
270         * page/TextIndicator.cpp:
271         (WebCore::initializeIndicator):
272         Apply some post-landing review feedback for r219756.
273
274 2017-07-21  Chris Dumez  <cdumez@apple.com>
275
276         Drop IDBDatabaseException class
277         https://bugs.webkit.org/show_bug.cgi?id=174743
278
279         Reviewed by Darin Adler.
280
281         Drop IDBDatabaseException class and use DOMException directly. IDBDatabaseException was
282         only an internal concept and was already exposed to the Web as a DOMException. This
283         simplifies the code a bit and will allow for further simplification in a follow-up patch.
284
285         No new tests, no Web-facing behavior change, except for some exception messages
286         being slightly different.
287
288         * CMakeLists.txt:
289         * Modules/indexeddb/IDBCursor.cpp:
290         (WebCore::IDBCursor::update):
291         (WebCore::IDBCursor::advance):
292         (WebCore::IDBCursor::continuePrimaryKey):
293         (WebCore::IDBCursor::continueFunction):
294         (WebCore::IDBCursor::deleteFunction):
295         * Modules/indexeddb/IDBDatabase.cpp:
296         (WebCore::IDBDatabase::createObjectStore):
297         (WebCore::IDBDatabase::transaction):
298         (WebCore::IDBDatabase::deleteObjectStore):
299         * Modules/indexeddb/IDBDatabaseError.h: Removed.
300         * Modules/indexeddb/IDBDatabaseException.cpp: Removed.
301         * Modules/indexeddb/IDBDatabaseException.h: Removed.
302         * Modules/indexeddb/IDBFactory.cpp:
303         (WebCore::IDBFactory::cmp):
304         * Modules/indexeddb/IDBIndex.cpp:
305         (WebCore::IDBIndex::setName):
306         (WebCore::IDBIndex::openCursor):
307         (WebCore::IDBIndex::openKeyCursor):
308         (WebCore::IDBIndex::count):
309         (WebCore::IDBIndex::doCount):
310         (WebCore::IDBIndex::get):
311         (WebCore::IDBIndex::doGet):
312         (WebCore::IDBIndex::getKey):
313         (WebCore::IDBIndex::doGetKey):
314         (WebCore::IDBIndex::getAll):
315         (WebCore::IDBIndex::getAllKeys):
316         * Modules/indexeddb/IDBKeyRange.cpp:
317         (WebCore::IDBKeyRange::only):
318         (WebCore::IDBKeyRange::lowerBound):
319         (WebCore::IDBKeyRange::upperBound):
320         (WebCore::IDBKeyRange::bound):
321         (WebCore::IDBKeyRange::includes):
322         * Modules/indexeddb/IDBObjectStore.cpp:
323         (WebCore::IDBObjectStore::setName):
324         (WebCore::IDBObjectStore::openCursor):
325         (WebCore::IDBObjectStore::openKeyCursor):
326         (WebCore::IDBObjectStore::get):
327         (WebCore::IDBObjectStore::getKey):
328         (WebCore::IDBObjectStore::putOrAdd):
329         (WebCore::IDBObjectStore::doDelete):
330         (WebCore::IDBObjectStore::deleteFunction):
331         (WebCore::IDBObjectStore::clear):
332         (WebCore::IDBObjectStore::createIndex):
333         (WebCore::IDBObjectStore::index):
334         (WebCore::IDBObjectStore::deleteIndex):
335         (WebCore::IDBObjectStore::count):
336         (WebCore::IDBObjectStore::doCount):
337         (WebCore::IDBObjectStore::getAll):
338         (WebCore::IDBObjectStore::getAllKeys):
339         * Modules/indexeddb/IDBOpenDBRequest.cpp:
340         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
341         * Modules/indexeddb/IDBRequest.cpp:
342         (WebCore::IDBRequest::result):
343         (WebCore::IDBRequest::error):
344         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
345         * Modules/indexeddb/IDBTransaction.cpp:
346         (WebCore::IDBTransaction::objectStore):
347         (WebCore::IDBTransaction::abort):
348         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
349         (WebCore::IDBTransaction::didCreateIndexOnServer):
350         (WebCore::IDBTransaction::putOrAddOnServer):
351         * Modules/indexeddb/server/IndexValueStore.cpp:
352         (WebCore::IDBServer::IndexValueStore::addRecord):
353         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
354         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
355         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
356         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
357         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
358         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
359         (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
360         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
361         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
362         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
363         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
364         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
365         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
366         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
367         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
368         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
369         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
370         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
371         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
372         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
373         * Modules/indexeddb/server/MemoryIndex.cpp:
374         (WebCore::IDBServer::MemoryIndex::putIndexKey):
375         * Modules/indexeddb/server/MemoryObjectStore.cpp:
376         (WebCore::IDBServer::MemoryObjectStore::createIndex):
377         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
378         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
379         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
380         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
381         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
382         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
383         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
384         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
385         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
386         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
387         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
388         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
389         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
390         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
391         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
392         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
393         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
394         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
395         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
396         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
397         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
398         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
399         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
400         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
401         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
402         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
403         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
404         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
405         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
406         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
407         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
408         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
409         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
410         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
411         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
412         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
413         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
414         (WebCore::IDBServer::SQLiteIDBTransaction::begin):
415         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
416         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
417         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
418         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
419         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
420         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
421         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
422         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
423         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
424         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
425         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
426         * Modules/indexeddb/shared/IDBError.cpp:
427         (WebCore::IDBError::name):
428         (WebCore::IDBError::message):
429         (WebCore::IDBError::toDOMError):
430         * Modules/indexeddb/shared/IDBError.h:
431         (WebCore::IDBError::userDeleteError):
432         (WebCore::IDBError::isNull):
433         * WebCore.xcodeproj/project.pbxproj:
434         * bindings/js/JSDOMExceptionHandling.cpp:
435         (WebCore::createDOMException):
436
437         * dom/DOMException.cpp:
438         (WebCore::DOMException::initializeDescription):
439         Initialize description->code from using the actual error codes in the
440         coreExceptions table, instead of initializing it using |ec|. |ec| is
441         the index in the ExceptionCode enumeration and it matches the error
442         code only for legacy exceptions. New exceptions such as DataError
443         should have a code of 0. Without this change, w3c for IDB would start
444         failing.
445
446         * dom/ExceptionCodeDescription.cpp:
447         (WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
448         * dom/ExceptionCodeDescription.h:
449
450 2017-07-21  Sam Weinig  <sam@webkit.org>
451
452         [WebIDL] Simplify XMLHttpRequest bindings by removing built-ins
453         https://bugs.webkit.org/show_bug.cgi?id=174740
454
455         Reviewed by Chris Dumez.
456
457         The behavior we were getting from XMLHttpRequest.js can be implemented
458         with the [CachedAttribute] extended attribute. This reduces the number
459         of JS -> C++ jumps required and makes the code more similar to other
460         bindings that need caching of an IDL any value.
461
462         * CMakeLists.txt:
463         * DerivedSources.make:
464         * xml/XMLHttpRequest.js: Removed.
465         Remove XMLHttpRequest.js.
466
467         * bindings/js/JSXMLHttpRequestCustom.cpp:
468         (WebCore::JSXMLHttpRequest::response):
469         (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
470         * xml/XMLHttpRequest.idl:
471         Replace builtin with a [CachedAttribute] and [CustomGetter]
472         for the response property.
473
474 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
475
476         Drag and Drop preview image for Twitter link is the wrong shape
477         https://bugs.webkit.org/show_bug.cgi?id=174731
478         <rdar://problem/33335616>
479
480         Reviewed by Zalan Bujtas.
481
482         TextIndicator uses Range::borderAndTextQuads and ::absoluteTextRects
483         in order to get the rects of the indicated text. Currently, these
484         functions do not respect clipping, so clipped-out text (e.g. as seen
485         inside links on Twitter) generates lots of meaningless indicated rects.
486
487         * page/TextIndicator.cpp:
488         (WebCore::estimatedBackgroundColorForRange):
489         (WebCore::hasAnyIllegibleColors):
490         Change adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary
491         to instead be hasAnyIllegibleColors, and referred to in the same place
492         as hasNonInlineOrReplacedElements, so that it follows the same
493         upgrade path (leaving textRects empty, so that it is later filled in
494         with the absoluteBoundingRect). This was a mistake in r219033, which
495         instead would end up painting all content, but filling in textRects
496         with the actual individual text rects.
497
498         This alone changes the behavior on Twitter from lots of jagged misplaced
499         rects to a too-large bounding rect. Combined with the following changes,
500         the bounding rect is reduced to the right size:
501
502         (WebCore::initializeIndicator):
503         Adopt the new Range::borderAndTextQuads and ::absoluteTextRects parameter
504         and opt-in to respecting clipping for text rects.
505
506         * dom/DOMRectList.cpp:
507         (WebCore::DOMRectList::DOMRectList):
508         * dom/DOMRectList.h:
509         (WebCore::DOMRectList::create):
510         Add a DOMRectList constructor and create() that take FloatRects, similar
511         to the one that takes FloatQuads, but without the boundingRect() calls.
512
513         * dom/Document.h:
514         * dom/Document.cpp:
515         (WebCore::Document::convertAbsoluteToClientRects):
516         Add convertAbsoluteToClientRects, similar to covertAbsoluteToClientQuads,
517         except acting on rects instead of quads.
518
519         * dom/Range.cpp:
520         (WebCore::Range::absoluteRectsForRangeInText):
521         (WebCore::Range::absoluteTextRects):
522         (WebCore::Range::getClientRects):
523         (WebCore::Range::borderAndTextRects):
524         (WebCore::Range::boundingRect):
525         (WebCore::Range::absoluteBoundingRect):
526         (WebCore::Range::borderAndTextQuads): Deleted.
527         * dom/Range.h:
528         Replace borderAndTextQuads with borderAndTextRects, because all callers
529         just ended up calling boundingBox() on the quads.
530
531         Factor absoluteRectsForRangeInText out of absoluteTextRects and
532         borderAndTextQuads, and teach it to optionally intersect the text rects
533         with their renderer's absoluteClippedOverflowRect.
534
535 2017-07-21  Per Arne Vollan  <pvollan@apple.com>
536
537         Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke.
538         https://bugs.webkit.org/show_bug.cgi?id=174701
539         <rdar://problem/32903679>
540
541         Reviewed by Simon Fraser.
542
543         The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color.
544         Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible.
545
546         Test: fast/css/round-trip-stroke-width-using-computed-style.html
547
548         * rendering/TextPaintStyle.cpp:
549         (WebCore::updateGraphicsContext):
550         * rendering/style/RenderStyle.h:
551         (WebCore::RenderStyle::initialStrokeWidth):
552         (WebCore::RenderStyle::initialStrokeColor):
553         * rendering/style/StyleRareInheritedData.cpp:
554         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
555
556 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
557
558         Remove an inaccurate comment from RenderTextLineBoxes
559
560         * rendering/RenderTextLineBoxes.cpp:
561         (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
562         This comment has been wrong for at least 4 years.
563
564 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
565
566         TextIndicator::estimatedTextColorsForRange asserts inside HashSet code (inserting reserved value)
567         https://bugs.webkit.org/show_bug.cgi?id=174733
568
569         Reviewed by Wenson Hsieh.
570
571         * page/TextIndicator.cpp:
572         (WebCore::estimatedTextColorsForRange):
573         (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
574         RGBA32 isn't a valid hash key, because we have no traits that define the
575         empty or deleted values, nor do we have any bits we could feasibly
576         use -- the full range of RGBA32 is easy to reach with various colors.
577
578         Instead, hash Color directly.
579
580 2017-07-21  Nan Wang  <n_wang@apple.com>
581
582         AX: Expose form validation on iOS as hint
583         https://bugs.webkit.org/show_bug.cgi?id=174722
584         <rdar://problem/33459761>
585
586         Reviewed by Chris Fleizach.
587
588         Adding the validation message to the hint of the form control element.
589
590         Test: accessibility/ios-simulator/form-control-validation-message.html
591
592         * accessibility/AccessibilityObject.cpp:
593         (WebCore::AccessibilityObject::isShowingValidationMessage):
594         (WebCore::AccessibilityObject::validationMessage):
595         * accessibility/AccessibilityObject.h:
596         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
597         (-[WebAccessibilityObjectWrapper accessibilityHint]):
598         (-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]):
599         * html/HTMLFormControlElement.cpp:
600         (WebCore::HTMLFormControlElement::isShowingValidationMessage):
601         * html/HTMLFormControlElement.h:
602
603 2017-07-21  Konstantin Tokarev  <annulen@yandex.ru>
604
605         [cmake][Mac] Unreviewed, fix linking WebKitSystemInterface
606
607         After r219560 link_directories() in PlatformXXX.cmake files does not
608         affect corresponding targets.
609
610         * PlatformMac.cmake:
611
612 2017-07-21  Sam Weinig  <sam@webkit.org>
613
614         [WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots
615         https://bugs.webkit.org/show_bug.cgi?id=174713
616
617         Reviewed by Andreas Kling.
618
619         We used to not want to bloat the size of CSSValues with a pointer to the
620         owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of
621         them on DOMWrapperWorld that only got set if a wrapper was made. Now that
622         we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created
623         for the bindings, we no longer need the side table, and simply have the
624         DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration.
625
626         * bindings/js/DOMWrapperWorld.h:
627         (WebCore::DOMWrapperWorld::wrappers):
628         Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter.
629
630         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
631         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted.
632         Remove custom implementation of getPropertyCSSValue, now that it no longer
633         needs to update m_deprecatedCSSOMValueRoots.
634
635         * bindings/js/JSDOMWindowBase.cpp:
636         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
637         * bindings/js/JSDOMWrapperCache.h:
638         (WebCore::getCachedWrapper):
639         (WebCore::cacheWrapper):
640         (WebCore::uncacheWrapper):
641         * bindings/js/JSNodeCustom.cpp:
642         (WebCore::getOutOfLineCachedWrapper):
643         Use wrappers getter rather than direct member variable.
644
645         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
646         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
647         Rather than checking the side table for roots, now get the root
648         via the reference CSSStyleDeclaration.
649
650         (WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted.
651         Remove custom finalize now that we don't have to remove ourself
652         from m_deprecatedCSSOMValueRoots.
653
654         * css/CSSStyleDeclaration.idl:
655         Remove [Custom] from getPropertyCSSValue.
656
657         * css/DeprecatedCSSOMValue.idl:
658         Remove [JSCustomFinalize].
659
660         * css/CSSComputedStyleDeclaration.cpp:
661         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
662         * css/CSSImageValue.cpp:
663         (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
664         * css/CSSImageValue.h:
665         * css/CSSPrimitiveValue.cpp:
666         (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
667         * css/CSSPrimitiveValue.h:
668         * css/CSSStyleDeclaration.h:
669         * css/CSSValue.cpp:
670         (WebCore::CSSValue::createDeprecatedCSSOMWrapper):
671         * css/CSSValue.h:
672         * css/DeprecatedCSSOMCounter.h:
673         * css/DeprecatedCSSOMPrimitiveValue.cpp:
674         (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
675         (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
676         (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
677         * css/DeprecatedCSSOMPrimitiveValue.h:
678         (WebCore::DeprecatedCSSOMPrimitiveValue::create):
679         (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
680         * css/DeprecatedCSSOMRGBColor.h:
681         * css/DeprecatedCSSOMRect.h:
682         * css/DeprecatedCSSOMValue.h:
683         (WebCore::DeprecatedCSSOMValue::owner):
684         (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
685         (WebCore::DeprecatedCSSOMComplexValue::create):
686         (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
687         * css/DeprecatedCSSOMValueList.h:
688         (WebCore::DeprecatedCSSOMValueList::create):
689         (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
690         * css/PropertySetCSSStyleDeclaration.cpp:
691         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
692         * css/PropertySetCSSStyleDeclaration.h:
693         * svg/SVGElement.cpp:
694         (WebCore::SVGElement::getPresentationAttribute):
695         Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes.
696
697 2017-07-21  Andreas Kling  <akling@apple.com>
698
699         Use more references in event dispatch code
700         https://bugs.webkit.org/show_bug.cgi?id=174681
701
702         Reviewed by Geoffrey Garen.
703
704         Make EventListener::handleEvent() take a ScriptExecutionContext&, Event&.
705         Then make everything build again. Various null checks and assertions
706         disappear in the process.
707
708         * bindings/js/JSErrorHandler.cpp:
709         (WebCore::JSErrorHandler::handleEvent):
710         * bindings/js/JSErrorHandler.h:
711         * bindings/js/JSEventListener.cpp:
712         (WebCore::JSEventListener::initializeJSFunction):
713         (WebCore::JSEventListener::handleEvent):
714         (WebCore::eventHandlerAttribute):
715         * bindings/js/JSEventListener.h:
716         (WebCore::JSEventListener::jsFunction):
717         * bindings/js/JSLazyEventListener.cpp:
718         (WebCore::JSLazyEventListener::initializeJSFunction):
719         * bindings/js/JSLazyEventListener.h:
720         * dom/EventListener.h:
721         * dom/EventTarget.cpp:
722         (WebCore::EventTarget::fireEventListeners):
723         * html/HTMLPlugInElement.cpp:
724         (WebCore::HTMLPlugInElement::defaultEventHandler):
725         * html/ImageDocument.cpp:
726         (WebCore::ImageEventListener::handleEvent):
727         * inspector/CommandLineAPIHost.cpp:
728         (WebCore::listenerEntriesFromListenerInfo):
729         * inspector/InspectorDOMAgent.cpp:
730         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
731         * inspector/InspectorIndexedDBAgent.cpp:
732         * platform/Widget.h:
733         (WebCore::Widget::handleEvent):
734         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
735         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
736         (WebCore::WebPlaybackSessionModelMediaElement::handleEvent):
737         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
738         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
739         (WebVideoFullscreenModelVideoElement::handleEvent):
740         * svg/SVGTRefElement.cpp:
741         (WebCore::SVGTRefTargetEventListener::handleEvent):
742         * svg/animation/SVGSMILElement.cpp:
743         (WebCore::ConditionEventListener::handleEvent):
744         (WebCore::SVGSMILElement::handleConditionEvent):
745         * svg/animation/SVGSMILElement.h:
746
747 2017-07-21  Zalan Bujtas  <zalan@apple.com>
748
749         iBooks: Overlapping/missing content at beginning/end of paragraph.
750         https://bugs.webkit.org/show_bug.cgi?id=174717
751         <rdar://problem/33117912>
752
753         Reviewed by Simon Fraser.
754
755         By definiton simple and normal line layout should always produce the exact same lineboxes. It enables us not
756         to force repaint while swapping between these 2 line layouts.
757         However in certain cases (font size pixel rounding as an example) they don't agree on how much content fits the line and
758         that could result in missing/overlapping content due to the lack of repaint. 
759
760         Unable to test.
761
762         * rendering/RenderBlockFlow.cpp:
763         (WebCore::RenderBlockFlow::ensureLineBoxes):
764
765 2017-07-21  Chris Dumez  <cdumez@apple.com>
766
767         Drop make_dom_exceptions.pl script that we only have DOMException
768         https://bugs.webkit.org/show_bug.cgi?id=174699
769
770         Reviewed by Darin Adler.
771
772         Drop make_dom_exceptions.pl script that we only have DOMException.
773
774         * CMakeLists.txt:
775         * DerivedSources.make:
776         * WebCore.xcodeproj/project.pbxproj:
777         * WebCoreMacros.cmake:
778         * bindings/js/JSDOMExceptionHandling.cpp:
779         * css/FontFaceSet.cpp:
780         * dom/DOMAllInOne.cpp:
781         * dom/DOMExceptions.in: Removed.
782         * dom/ExceptionCodeDescription.cpp: Added.
783         (WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
784         * dom/ExceptionCodeDescription.h: Added.
785         * dom/make_dom_exceptions.pl: Removed.
786         * inspector/WebInjectedScriptHost.cpp:
787         (WebCore::WebInjectedScriptHost::subtype):
788
789 2017-07-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
790
791         [CG] An image should not invoke many system calls before confirming its format is supported
792         https://bugs.webkit.org/show_bug.cgi?id=174692
793
794         Reviewed by Tim Horton.
795
796         We should be careful when invoking system calls before confirming that the
797         image type is available and it is one of the whitelist formats. Otherwise
798         we will be calling the parsers of the unsupported formats.
799
800         * loader/cache/CachedImage.cpp:
801         (WebCore::CachedImage::setImageDataBuffer): The check isAllowedImageUTI()
802         is now done in ImageDecoder::encodedDataStatus() which will return Error
803         if there is an error in the data or "isAllowedImageUTI() returns false."
804
805         * platform/graphics/BitmapImage.cpp:
806         (WebCore::BitmapImage::dataChanged): Avoid calling canUseAsyncDecodingForLargeImages()
807         before confirming the image type is available and it's supported by WebKit.
808         canUseAsyncDecodingForLargeImages() tries to cache the first frame of the
809         image to know its size. Asking the ImageFrameCache to destroy its decoded
810         frames is not needed unless ImageFrameCache::decodedSize() is not zero.
811
812         * platform/graphics/cg/ImageDecoderCG.cpp:
813         (WebCore::ImageDecoder::encodedDataStatus): Avoid calling CGImageSourceGetStatus()
814         before knowing the UTI of the image. When knowing it, we call CGImageSourceGetStatus()
815         and if it returns kCGImageStatusIncomplete or kCGImageStatusComplete, we
816         check whether isAllowedImageUTI() or not. If isAllowedImageUTI() returns
817         false, return Error which will make the CachedImage cancel loading the 
818         rest of the image.
819
820 2017-07-21  Jeremy Jones  <jeremyj@apple.com>
821
822         AudioTrackPrivateMediaStreamCocoa shouldn't set AudioSession::setPreferredBufferSize
823         https://bugs.webkit.org/show_bug.cgi?id=174707
824         rdar://problem/33446809
825
826         Reviewed by Eric Carlson.
827
828         Manually tested for audio side effects.
829
830         AudioChannel::copyFrom fails when AudioChannel lengths don't match.
831
832         This happens because PlatformMediaSessionManager::updateSessionState() owns and sets
833         AudioSession::setPreferredBufferSize().
834
835         However, AudioTrackPrivateMediaStreamCocoa::createAudioUnit, when it creates an input
836         audio unit is setting AudioSession::setPreferredBufferSize() directly to its own arbitrary value.
837
838         AudioSession::setPreferredBufferSize() should be managed by the higher level 
839         PlatformMediaSessionManager, and not modified by audio unit creation, in order to keep harmony
840         within the audio pipeline.
841
842         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
843         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
844
845 2017-07-21  Jeremy Jones  <jeremyj@apple.com>
846
847         Noise when AudioChannel lengths don't match.
848         https://bugs.webkit.org/show_bug.cgi?id=174706
849         rdar://problem/33389856
850
851         Reviewed by Eric Carlson.
852
853         When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer.
854         This change zeros out the data, so there isn't objectionable noise sent to the speaker.
855
856         * platform/audio/AudioChannel.cpp:
857         (WebCore::AudioChannel::copyFrom):
858
859 2017-07-21  Sam Weinig  <sam@webkit.org>
860
861         [WebIDL] Make a few parameters non-nullable in inspector IDL files
862         https://bugs.webkit.org/show_bug.cgi?id=174719
863
864         Reviewed by Joseph Pecoraro.
865
866         * inspector/CommandLineAPIHost.cpp:
867         (WebCore::CommandLineAPIHost::databaseId):
868         (WebCore::CommandLineAPIHost::storageId):
869         * inspector/CommandLineAPIHost.h:
870         * inspector/CommandLineAPIHost.idl:
871         * inspector/InspectorDOMStorageAgent.cpp:
872         (WebCore::InspectorDOMStorageAgent::storageId):
873         * inspector/InspectorDOMStorageAgent.h:
874         * inspector/InspectorDatabaseAgent.cpp:
875         (WebCore::InspectorDatabaseAgent::databaseId):
876         * inspector/InspectorDatabaseAgent.h:
877         * inspector/InspectorFrontendHost.cpp:
878         (WebCore::InspectorFrontendHost::showContextMenu):
879         (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
880         * inspector/InspectorFrontendHost.h:
881         * inspector/InspectorFrontendHost.idl:
882         Remove nullability from arguments that should never be null.
883
884 2017-07-21  Brady Eidson  <beidson@apple.com>
885
886         Get rid of WebCore IconDatabase code.
887         https://bugs.webkit.org/show_bug.cgi?id=174700
888
889         Reviewed by Tim Horton.
890
891         No new tests (No behavior change).
892         
893         Tons of red.
894         Very little green.
895         No further explanation.
896
897         * CMakeLists.txt:
898         * WebCore.xcodeproj/project.pbxproj:
899         * dom/Document.cpp:
900         (WebCore::Document::implicitClose):
901         * history/HistoryItem.cpp:
902         (WebCore::HistoryItem::HistoryItem):
903         (WebCore::HistoryItem::~HistoryItem):
904         (WebCore::HistoryItem::reset):
905         (WebCore::HistoryItem::setURLString):
906         * inspector/InspectorNetworkAgent.cpp:
907         (WebCore::InspectorNetworkAgent::willSendRequest):
908         * loader/DocumentLoader.cpp:
909         (WebCore::DocumentLoader::~DocumentLoader):
910         (WebCore::DocumentLoader::startIconLoading):
911         (WebCore::DocumentLoader::iconLoadDecisionAvailable): Deleted.
912         (WebCore::iconLoadDecisionCallback): Deleted.
913         (WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Deleted.
914         (WebCore::DocumentLoader::continueIconLoadWithDecision): Deleted.
915         (WebCore::iconDataCallback): Deleted.
916         (WebCore::DocumentLoader::getIconDataForIconURL): Deleted.
917         * loader/DocumentLoader.h:
918         (WebCore::DocumentLoader::linkIcons):
919         * loader/FrameLoader.cpp:
920         (WebCore::FrameLoader::FrameLoader):
921         (WebCore::FrameLoader::stop):
922         * loader/FrameLoader.h:
923         (WebCore::FrameLoader::subframeLoader):
924         (WebCore::FrameLoader::icon): Deleted.
925         * loader/FrameLoaderClient.h:
926         * loader/archive/cf/LegacyWebArchive.cpp:
927         (WebCore::LegacyWebArchive::create):
928         * loader/icon/IconController.cpp: Removed.
929         * loader/icon/IconController.h: Removed.
930         * loader/icon/IconDatabase.cpp: Removed.
931         * loader/icon/IconDatabase.h: Removed.
932         * loader/icon/IconDatabaseBase.cpp: Removed.
933         * loader/icon/IconDatabaseBase.h: Removed.
934         * loader/icon/IconDatabaseClient.h: Removed.
935         * loader/icon/IconLoader.cpp:
936         (WebCore::IconLoader::IconLoader):
937         (WebCore::IconLoader::startLoading):
938         (WebCore::IconLoader::notifyFinished):
939         * loader/icon/IconLoader.h:
940         * loader/icon/IconRecord.cpp: Removed.
941         * loader/icon/IconRecord.h: Removed.
942         * loader/icon/PageURLRecord.cpp: Removed.
943         * loader/icon/PageURLRecord.h: Removed.
944         * testing/Internals.cpp:
945         (WebCore::Internals::shortcutIconURLs):
946
947 2017-07-21  Chris Dumez  <cdumez@apple.com>
948
949         Rename DOMCoreException class to DOMException
950         https://bugs.webkit.org/show_bug.cgi?id=174698
951
952         Reviewed by Darin Adler.
953
954         Rename DOMCoreException class to DOMException to match its Web-exposed name.
955
956         * CMakeLists.txt:
957         * DerivedSources.cpp:
958         * DerivedSources.make:
959         * Modules/quota/StorageErrorCallback.cpp:
960         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
961         * Modules/quota/StorageErrorCallback.h:
962         * Modules/quota/StorageErrorCallback.idl:
963         * WebCore.xcodeproj/project.pbxproj:
964         * bindings/js/JSDOMExceptionHandling.cpp:
965         (WebCore::retrieveErrorMessage):
966         (WebCore::createDOMException):
967         * bindings/scripts/CodeGeneratorJS.pm:
968         (GenerateOverloadDispatcher):
969         * css/FontFaceSet.cpp:
970         * css/FontFaceSet.h:
971         * dom/DOMAllInOne.cpp:
972         * dom/DOMException.cpp: Renamed from Source/WebCore/dom/DOMCoreException.cpp.
973         (WebCore::DOMException::create):
974         (WebCore::DOMException::DOMException):
975         (WebCore::DOMException::initializeDescription):
976         * dom/DOMException.h: Renamed from Source/WebCore/dom/DOMCoreException.h.
977         (WebCore::DOMException::create):
978         (WebCore::DOMException::DOMException):
979         * dom/DOMException.idl: Renamed from Source/WebCore/dom/DOMCoreException.idl.
980         * dom/DOMExceptions.in:
981         * dom/make_dom_exceptions.pl:
982         (generateImplementation):
983
984 2017-07-21  Sam Weinig  <sam@webkit.org>
985
986         Follow up to https://bugs.webkit.org/show_bug.cgi?id=174659.
987
988         * inspector/InspectorFrontendHost.idl:
989         Remove unnecessary JSGenerateToJSObject noticed in review.
990
991 2017-07-20  Chris Dumez  <cdumez@apple.com>
992
993         Drop legacy SVGException type
994         https://bugs.webkit.org/show_bug.cgi?id=174695
995
996         Reviewed by Darin Adler.
997
998         Drop legacy SVGException type and use DOMException instead, as per the latest
999         SVG specification. Both Chrome and Firefox no longer expose the SVGException
1000         type.
1001
1002         * CMakeLists.txt:
1003         * DerivedSources.cpp:
1004         * DerivedSources.make:
1005         * WebCore.xcodeproj/project.pbxproj:
1006         * bindings/js/JSDOMExceptionHandling.cpp:
1007         (WebCore::createDOMException):
1008         * bindings/js/JSExceptionBase.cpp:
1009         (WebCore::toExceptionBase):
1010         * dom/DOMExceptions.in:
1011         * svg/SVGAllInOne.cpp:
1012         * svg/SVGCircleElement.cpp:
1013         * svg/SVGException.cpp: Removed.
1014         * svg/SVGException.h: Removed.
1015         * svg/SVGException.idl: Removed.
1016         * svg/SVGGraphicsElement.idl:
1017         * svg/SVGLocatable.cpp:
1018         (WebCore::SVGLocatable::getTransformToElement):
1019         * svg/SVGMatrixValue.h:
1020         * svg/SVGPathSegList.cpp:
1021         (WebCore::SVGPathSegList::getItem):
1022         (WebCore::SVGPathSegList::replaceItem):
1023         (WebCore::SVGPathSegList::removeItem):
1024         * svg/SVGPathSegList.h:
1025         * svg/SVGPathSegList.idl:
1026         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
1027         * svg/properties/SVGListProperty.h:
1028
1029 2017-07-20  Chris Dumez  <cdumez@apple.com>
1030
1031         Hook up ITP quirks to the needsSiteSpecificQuirks setting
1032         https://bugs.webkit.org/show_bug.cgi?id=174691
1033
1034         Reviewed by Darin Adler.
1035
1036         Hook up ITP quirks to the needsSiteSpecificQuirks setting to make it easier for
1037         Web-developers to test their fixes.
1038
1039         * loader/ResourceLoadObserver.cpp:
1040         (WebCore::shouldEnableSiteSpecificQuirks):
1041         (WebCore::areDomainsAssociated):
1042         (WebCore::ResourceLoadObserver::logFrameNavigation):
1043         (WebCore::resourceNeedsSSOQuirk):
1044         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1045         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1046
1047 2017-07-20  Matt Lewis  <jlewis3@apple.com>
1048
1049         Unreviewed, rolling out r219700.
1050
1051         This revision caused consistent timouts on iOS.
1052
1053         Reverted changeset:
1054
1055         "Turn tests at media/modern-media-controls/start-support back
1056         on"
1057         https://bugs.webkit.org/show_bug.cgi?id=174683
1058         http://trac.webkit.org/changeset/219700
1059
1060 2017-07-20  David Quesada  <david_quesada@apple.com>
1061
1062         Add SPI to notify WKNavigationDelegate about client redirects
1063         https://bugs.webkit.org/show_bug.cgi?id=174680
1064         rdar://problem/33184886
1065
1066         Reviewed by Brady Eidson.
1067
1068         * loader/FrameLoader.cpp:
1069         (WebCore::FrameLoader::performClientRedirect):
1070         * loader/FrameLoader.h:
1071         Add a convenience method for NavigationScheduler that handles a FrameLoadRequest
1072         as a client redirect. Currently this means loading the request and informing the
1073         client about it.
1074
1075         * loader/FrameLoaderClient.h:
1076         Add FrameLoaderClient::dispatchDidPerformClientRedirect() to inform the client when
1077         a client redirect occurs.
1078
1079         * loader/NavigationScheduler.cpp:
1080         Removed ScheduledURLNavigation::fire(). This class was never instantiated directly,
1081         and all subclasses override fire(), so this was unused code.
1082         For ScheduledRedirects and ScheduledLocationChange, use FrameLoader's new method to
1083         load the request as a client redirect.
1084
1085 2017-07-20  Chris Dumez  <cdumez@apple.com>
1086
1087         Drop legacy XPathException type
1088         https://bugs.webkit.org/show_bug.cgi?id=174679
1089
1090         Reviewed by Sam Weinig.
1091
1092         Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
1093         no longer expose XPathException.
1094
1095         Test: fast/dom/DOMException/XPathException-obsolete.html
1096
1097         * CMakeLists.txt:
1098         * DerivedSources.cpp:
1099         * DerivedSources.make:
1100         * WebCore.xcodeproj/project.pbxproj:
1101         * bindings/js/JSDOMExceptionHandling.cpp:
1102         (WebCore::createDOMException):
1103         * bindings/js/JSExceptionBase.cpp:
1104         (WebCore::toExceptionBase):
1105         * dom/DOMExceptions.in:
1106         * xml/XPathException.cpp: Removed.
1107         * xml/XPathException.h: Removed.
1108         * xml/XPathException.idl: Removed.
1109         * xml/XPathExpression.cpp:
1110         (WebCore::XPathExpression::evaluate):
1111         * xml/XPathParser.cpp:
1112         (WebCore::XPath::Parser::parseStatement):
1113         * xml/XPathResult.cpp:
1114         (WebCore::XPathResult::convertTo):
1115         (WebCore::XPathResult::numberValue):
1116         (WebCore::XPathResult::stringValue):
1117         (WebCore::XPathResult::booleanValue):
1118         (WebCore::XPathResult::singleNodeValue):
1119         (WebCore::XPathResult::snapshotLength):
1120         (WebCore::XPathResult::iterateNext):
1121         (WebCore::XPathResult::snapshotItem):
1122
1123 2017-07-20  Chris Dumez  <cdumez@apple.com>
1124
1125         Unreviewed, rolling out r219706.
1126
1127         Broke iOS build
1128
1129         Reverted changeset:
1130
1131         "Drop legacy XPathException type"
1132         https://bugs.webkit.org/show_bug.cgi?id=174679
1133         http://trac.webkit.org/changeset/219706
1134
1135 2017-07-20  Chris Dumez  <cdumez@apple.com>
1136
1137         Drop legacy XPathException type
1138         https://bugs.webkit.org/show_bug.cgi?id=174679
1139
1140         Reviewed by Sam Weinig.
1141
1142         Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
1143         no longer expose XPathException.
1144
1145         Test: fast/dom/DOMException/XPathException-obsolete.html
1146
1147         * CMakeLists.txt:
1148         * DerivedSources.cpp:
1149         * DerivedSources.make:
1150         * WebCore.xcodeproj/project.pbxproj:
1151         * bindings/js/JSDOMExceptionHandling.cpp:
1152         (WebCore::createDOMException):
1153         * bindings/js/JSExceptionBase.cpp:
1154         (WebCore::toExceptionBase):
1155         * dom/DOMExceptions.in:
1156         * xml/XPathException.cpp: Removed.
1157         * xml/XPathException.h: Removed.
1158         * xml/XPathException.idl: Removed.
1159         * xml/XPathExpression.cpp:
1160         (WebCore::XPathExpression::evaluate):
1161         * xml/XPathParser.cpp:
1162         (WebCore::XPath::Parser::parseStatement):
1163         * xml/XPathResult.cpp:
1164         (WebCore::XPathResult::convertTo):
1165         (WebCore::XPathResult::numberValue):
1166         (WebCore::XPathResult::stringValue):
1167         (WebCore::XPathResult::booleanValue):
1168         (WebCore::XPathResult::singleNodeValue):
1169         (WebCore::XPathResult::snapshotLength):
1170         (WebCore::XPathResult::iterateNext):
1171         (WebCore::XPathResult::snapshotItem):
1172
1173 2017-07-20  Chris Dumez  <cdumez@apple.com>
1174
1175         Regression(ITP): May get frequently logged out of wsj.com
1176         https://bugs.webkit.org/show_bug.cgi?id=174661
1177         <rdar://problem/32343256>
1178
1179         Reviewed by Geoffrey Garen.
1180
1181         Add the concept of associated domains in the ResourceLoadObserver. We
1182         previously ignore loads to and from the same domains. We now do the same
1183         if the to and from domains are associated (i.e. owned by the same entity).
1184
1185         For now, only add domains owned by Dow Jones & Company, Inc. to the list,
1186         to address login issues on wsj.com.
1187
1188         No new tests, verified manually on wsj.com.
1189
1190         * loader/ResourceLoadObserver.cpp:
1191         (WebCore::areDomainsAssociated):
1192         (WebCore::ResourceLoadObserver::logFrameNavigation):
1193         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1194         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1195
1196 2017-07-20  Chris Dumez  <cdumez@apple.com>
1197
1198         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
1199         https://bugs.webkit.org/show_bug.cgi?id=174660
1200
1201         Reviewed by Geoffrey Garen.
1202
1203         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
1204         This essentially replaces a branch to figure out if the new size is less or greater than the
1205         current size by an assertion.
1206
1207         * Modules/gamepad/Gamepad.cpp:
1208         (WebCore::Gamepad::Gamepad):
1209         * Modules/webaudio/AudioContext.cpp:
1210         (WebCore::AudioContext::addReaction):
1211         * Modules/websockets/WebSocketChannel.cpp:
1212         (WebCore::WebSocketChannel::skipBuffer):
1213         * Modules/websockets/WebSocketDeflater.cpp:
1214         (WebCore::WebSocketDeflater::finish):
1215         * contentextensions/ContentExtensionCompiler.cpp:
1216         (WebCore::ContentExtensions::serializeSelector):
1217         * contentextensions/DFABytecodeCompiler.cpp:
1218         (WebCore::ContentExtensions::append):
1219         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
1220         (WebCore::gcryptEncrypt):
1221         (WebCore::gcryptDecrypt):
1222         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
1223         (WebCore::gcryptDerive):
1224         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
1225         (WebCore::GameControllerGamepadProvider::controllerDidConnect):
1226         * platform/gamepad/mac/HIDGamepadProvider.cpp:
1227         (WebCore::HIDGamepadProvider::deviceAdded):
1228         * platform/graphics/ImageBackingStore.h:
1229         (WebCore::ImageBackingStore::setSize):
1230         * platform/graphics/WOFFFileFormat.cpp:
1231         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
1232         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
1233         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
1234         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1235         (WebCore::InbandTextTrackPrivateAVF::resetCueValues):
1236         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
1237         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
1238         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer):
1239         * platform/graphics/cg/ImageBufferCG.cpp:
1240         (WebCore::cfData):
1241         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1242         (WebCore::BMPImageDecoder::frameBufferAtIndex):
1243         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1244         (WebCore::ICOImageDecoder::decode):
1245         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1246         (WebCore::JPEGImageDecoder::frameBufferAtIndex):
1247         * platform/image-decoders/png/PNGImageDecoder.cpp:
1248         (WebCore::PNGImageDecoder::frameBufferAtIndex):
1249         (WebCore::PNGImageDecoder::readChunks):
1250         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1251         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
1252         * platform/image-encoders/JPEGImageEncoder.cpp:
1253         (WebCore::compressRGBABigEndianToJPEG):
1254         * platform/text/DecodeEscapeSequences.h:
1255         (WebCore::URLEscapeSequence::decodeRun):
1256         * platform/text/SuffixTree.h:
1257         (WebCore::SuffixTree::Node::Node):
1258         * rendering/Grid.cpp:
1259         (WebCore::Grid::setNeedsItemsPlacement):
1260         * rendering/RenderTable.cpp:
1261         (WebCore::RenderTable::invalidateCachedColumns):
1262
1263 2017-07-20  Chris Dumez  <cdumez@apple.com>
1264
1265         Regression(ITP): Can no longer log in on abc.go.com
1266         https://bugs.webkit.org/show_bug.cgi?id=174533
1267         <rdar://problem/33325881>
1268
1269         Reviewed by Geoffrey Garen.
1270
1271         Add quirk for sp.auth.adobe.com which is used for SSO by web sites such as
1272         abc.go.com. This would otherwise cause adobe.com to be identified as a
1273         tracker and log in on abc.go.com would break.
1274
1275         No new tests, tested manually on abc.go.com.
1276
1277         * loader/ResourceLoadObserver.cpp:
1278         (WebCore::resourceNeedsSSOQuirk):
1279         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1280
1281 2017-07-20  Antoine Quint  <graouts@apple.com>
1282
1283         Turn tests at media/modern-media-controls/start-support back on
1284         https://bugs.webkit.org/show_bug.cgi?id=174683
1285
1286         Reviewed by Dean Jackson.
1287
1288         Turning those tests back on revealed a small bug that is unlikely to really affect content
1289         on the Web. In the case where the size of the video is known right away, without the need
1290         for loading its metadata, as is the case in the start-support-click-to-start.html test with
1291         a local media resource, all queued layouts are flushed at once and we may call the layout()
1292         method of the left ButtonsContainer which originally is set to contain the play/pause button,
1293         which would remove the play/pause button from the center of the media. So before we potentially
1294         set the play/pause button as the central button, we first assign the default button set for
1295         the two ButtonsContainer instances and only add the play/pause button when we're not showing
1296         the prominent play/pause button.
1297
1298         * Modules/modern-media-controls/controls/inline-media-controls.js:
1299         (InlineMediaControls.prototype.layout):
1300         (InlineMediaControls.prototype._leftContainerButtons):
1301
1302 2017-07-20  Chris Dumez  <cdumez@apple.com>
1303
1304         Drop legacy FileException type
1305         https://bugs.webkit.org/show_bug.cgi?id=174676
1306
1307         Reviewed by Alex Christensen.
1308
1309         Drop legacy FileException type and use DOMException instead, as per the latest
1310         File API specification:
1311         - https://w3c.github.io/FileAPI/#ErrorAndException
1312
1313         Both Firefox and Chrome no longer expose FileException.
1314
1315         * CMakeLists.txt:
1316         * DerivedSources.cpp:
1317         * DerivedSources.make:
1318         * WebCore.xcodeproj/project.pbxproj:
1319         * bindings/js/JSDOMExceptionHandling.cpp:
1320         (WebCore::createDOMException):
1321         * dom/DOMExceptions.in:
1322         * fileapi/FileException.cpp: Removed.
1323         * fileapi/FileException.h: Removed.
1324         * fileapi/FileException.idl: Removed.
1325         * fileapi/FileReaderLoader.cpp:
1326         (WebCore::FileReaderLoader::FileReaderLoader):
1327         (WebCore::FileReaderLoader::failed):
1328         * fileapi/FileReaderLoader.h:
1329         (WebCore::FileReaderLoader::errorCode):
1330         * fileapi/FileReaderSync.cpp:
1331         (WebCore::errorCodeToExceptionCode):
1332         (WebCore::FileReaderSync::startLoading):
1333
1334 2017-07-20  Sam Weinig  <sam@webkit.org>
1335
1336         [WebIDL] Remove custom bindings for InspectorFrontendHost
1337         https://bugs.webkit.org/show_bug.cgi?id=174659
1338
1339         Reviewed by Chris Dumez.
1340
1341         * CMakeLists.txt:
1342         * WebCore.xcodeproj/project.pbxproj:
1343         * bindings/js/JSBindingsAllInOne.cpp:
1344         * bindings/js/JSInspectorFrontendHostCustom.cpp: Removed.
1345         Remove JSInspectorFrontendHostCustom.cpp.
1346
1347         * inspector/InspectorFrontendHost.cpp:
1348         (WebCore::populateContextMenu):
1349         (WebCore::InspectorFrontendHost::showContextMenu):
1350         * inspector/InspectorFrontendHost.h:
1351         * inspector/InspectorFrontendHost.idl:
1352         Re-implement showContextMenu by using an IDL defined ContextMenuItem dictionary
1353         and converting from that to a WebCore::ContextMenu in the implementation.
1354
1355 2017-07-20  Charlie Turner  <cturner@igalia.com>
1356
1357         [GTK] Layout Test http/tests/media/hls/hls-progress.html is failing
1358         https://bugs.webkit.org/show_bug.cgi?id=141469
1359
1360         Reviewed by Xabier Rodriguez-Calvar.
1361
1362         A work-around for getting progress information in a timely manner from
1363         live pipelines. We cannot rely on getting BUFFERING messages within
1364         the stalled time window (3s), so we have to poll for progress
1365         information somehow.
1366
1367         Makes the following pass reliably
1368          http/tests/media/hls/hls-audio-tracks-has-audio.html passed unexpectedly
1369          http/tests/media/hls/hls-audio-tracks.html passed unexpectedly
1370          http/tests/media/hls/hls-progress.html passed unexpectedly
1371
1372         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1373         (WebCore::findHLSQueue):
1374         (WebCore::isHLSProgressing):
1375         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
1376
1377 2017-07-20  Andreas Kling  <akling@apple.com>
1378
1379         Minor Node->Element type tightening fixes
1380         https://bugs.webkit.org/show_bug.cgi?id=174651
1381
1382         Reviewed by Sam Weinig.
1383
1384         Tighten up some Node* into Element* or even better, Element&.
1385
1386         * dom/Document.cpp:
1387         (WebCore::acceptsEditingFocus): Take a const Element&.
1388         (WebCore::Document::setFocusedElement):
1389         * editing/Editor.cpp:
1390         (WebCore::Editor::findEventTargetFrom): Return an Element*.
1391         (WebCore::Editor::findEventTargetFromSelection): Ditto.
1392         (WebCore::Editor::pasteAsPlainText):
1393         (WebCore::Editor::pasteAsFragment):
1394         (WebCore::Editor::dispatchCPPEvent):
1395         * editing/Editor.h:
1396         * page/DragController.cpp:
1397         (WebCore::DragController::dispatchTextInputEventFor):
1398
1399 2017-07-20  Brady Eidson  <beidson@apple.com>
1400
1401         WKHTTPCookieStore API tests fail on High Sierra.
1402         <rdar://problem/33410271> and https://bugs.webkit.org/show_bug.cgi?id=174666
1403
1404         Reviewed by Andy Estes.
1405
1406         Covered by existing API tests.
1407
1408         In r219567 I'd moved cookie storage observation off of NSHTTPCookieStorage and NSNotificationCenter
1409         to CFHTTPCookieStorage observation callbacks.
1410         
1411         This is because notifications were only sent for the default [NSHTTPCookieStorage sharedHTTPCookieStorage]
1412         and not any of the other ones we keep in flight.
1413         
1414         Unfortunately that SPI has been disabled in High Sierra.
1415         Fortunately we found a way we can get non-shared NSHTTPCookieStorages to send notifications that works everywhere.
1416         
1417         * platform/network/cocoa/CookieStorageObserver.h:
1418         * platform/network/cocoa/CookieStorageObserver.mm:
1419         (-[WebCookieObserverAdapter initWithObserver:]):
1420         (-[WebCookieObserverAdapter cookiesChangedNotificationHandler:]):
1421         (WebCore::CookieStorageObserver::create):
1422         (WebCore::CookieStorageObserver::CookieStorageObserver):
1423         (WebCore::CookieStorageObserver::~CookieStorageObserver):
1424         (WebCore::CookieStorageObserver::startObserving): Use a trick to call some SPI on non-shared NSHTTPCookieStorages
1425           to get them to send notifications.
1426         (WebCore::CookieStorageObserver::stopObserving):
1427         (WebCore::cookiesChanged): Deleted.
1428
1429         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1430         (WebCore::NetworkStorageSession::cookieStorageObserver):
1431
1432 2017-07-20  Miguel Gomez  <magomez@igalia.com>
1433
1434         [GStreamer] Some layout tests issue "g_mutex_clear() called on uninitialised or locked mutex" and flaky crash in ~MediaPlayerPrivateGStreamerBase
1435         https://bugs.webkit.org/show_bug.cgi?id=173952
1436
1437         Reviewed by Carlos Garcia Campos.
1438
1439         Adjust MediaPlayerPrivateGStreamerBase to avoid concurrence problems with the GStreamer thread when
1440         destroying the object.
1441
1442         Covered by existent tests.
1443
1444         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1445         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1446         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
1447         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
1448
1449 2017-07-19  Zan Dobersek  <zdobersek@igalia.com>
1450
1451         [EME] Push CDMInstance, CDMPrivate and associated types into the Platform layer
1452         https://bugs.webkit.org/show_bug.cgi?id=174496
1453
1454         Reviewed by Xabier Rodriguez-Calvar.
1455
1456         Move the CDMInstance and CDMPrivate interfaces into the platform layer, enabling
1457         implementations of specific key systems at that level, as well as integration with
1458         the MediaPlayerPrivate stack without any layering violations.
1459
1460         While the platform layer still uses the WebCore namespace, the two interface files
1461         have now been moved under the platform/encryptedmedia/ directory and out of the
1462         Modules/encryptedmedia/ directory where the Web-facing API implementation resides.
1463
1464         The two interfaces integrated closely with the Web-facing enumerations and
1465         dictionaries: MediaKeyMessageType, MediaKeySessionType, MediaKeyStatus,
1466         MediaKeySystemConfiguration, MediaKeySystemCapability, MediaKeysRequirement
1467         and MediaKeysRestrictions. Definitions of these types are also moved to the
1468         platform layer without any changes (apart from renaming), and the previous
1469         types now alias against the types now located in the platform layer.
1470
1471         No new tests -- no change in behavior.
1472
1473         * CMakeLists.txt:
1474         * Modules/encryptedmedia/CDM.cpp:
1475         * Modules/encryptedmedia/CDM.h:
1476         * Modules/encryptedmedia/MediaKeyMessageType.h:
1477         * Modules/encryptedmedia/MediaKeySessionType.h:
1478         * Modules/encryptedmedia/MediaKeyStatus.h:
1479         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
1480         * Modules/encryptedmedia/MediaKeySystemAccess.h:
1481         * Modules/encryptedmedia/MediaKeySystemConfiguration.h:
1482         * Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
1483         * Modules/encryptedmedia/MediaKeysRequirement.h:
1484         * Modules/encryptedmedia/MediaKeysRestrictions.h:
1485         * platform/encryptedmedia/CDMInstance.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMInstance.h.
1486         * platform/encryptedmedia/CDMKeyStatus.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h.
1487         * platform/encryptedmedia/CDMKeySystemConfiguration.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h.
1488         * platform/encryptedmedia/CDMMediaCapability.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h.
1489         * platform/encryptedmedia/CDMMessageType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h.
1490         * platform/encryptedmedia/CDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
1491         * platform/encryptedmedia/CDMRequirement.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h.
1492         * platform/encryptedmedia/CDMRestrictions.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h.
1493         * platform/encryptedmedia/CDMSessionType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h.
1494
1495 2017-07-19  Zan Dobersek  <zdobersek@igalia.com>
1496
1497         Unreviewed follow-up to r219674.
1498
1499         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
1500         Remove the AsyncScrollingCoordinator.h header include that was added by accident.
1501
1502 2017-07-19  Zan Dobersek  <zdobersek@igalia.com>
1503
1504         [CMake] Clean up Web Crypto build targets
1505         https://bugs.webkit.org/show_bug.cgi?id=174253
1506
1507         Reviewed by Alex Christensen.
1508
1509         Gather the common WebCrypto source files in CMakeLists.txt, including them
1510         in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
1511         build guards to exclude the code from compilation if the feature is disabled.
1512
1513         PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
1514         duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
1515         Web Crypto build targets.
1516
1517         PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the
1518         USE_GCRYPT variable is enabled. Both ports at the moment enable that variable
1519         though as they by default leverage a libgcrypt-based CrpytoDigest implementation
1520         in the PAL library.
1521
1522         The new GCrypt.cmake file adds the libgcrypt-specific Web Crypto build targets to
1523         the build and also sets up libgcrypt include directiories and libraries.
1524
1525         No new tests -- no change in behavior.
1526
1527         * CMakeLists.txt:
1528         * PlatformGTK.cmake:
1529         * PlatformMac.cmake:
1530         * PlatformWPE.cmake:
1531         * platform/GCrypt.cmake: Added.
1532
1533 2017-07-19  Sam Weinig  <sam@webkit.org>
1534
1535         [WebIDL] Remove custom bindings for CommandLineAPIHost
1536         https://bugs.webkit.org/show_bug.cgi?id=174642
1537
1538         Reviewed by Joseph Pecoraro.
1539
1540         * CMakeLists.txt:
1541         * WebCore.xcodeproj/project.pbxproj:
1542         * bindings/js/JSBindingsAllInOne.cpp:
1543         * bindings/js/JSCommandLineAPIHostCustom.cpp: Removed.
1544         Remove JSCommandLineAPIHostCustom.cpp.
1545
1546         * bindings/js/JSDOMConvertObject.h:
1547         (WebCore::JSConverter<IDLObject>::convert):
1548         Add missing JSConverter specialization for IDLObject.
1549
1550         * inspector/CommandLineAPIHost.cpp:
1551         (WebCore::CommandLineAPIHost::inspect):
1552         (WebCore::listenerEntriesFromListenerInfo):
1553         (WebCore::CommandLineAPIHost::inspectedObject):
1554         (WebCore::CommandLineAPIHost::databaseId):
1555         (WebCore::CommandLineAPIHost::storageId):
1556         (WebCore::CommandLineAPIHost::inspectImpl): Deleted.
1557         (WebCore::CommandLineAPIHost::getEventListenersImpl): Deleted.
1558         (WebCore::CommandLineAPIHost::databaseIdImpl): Deleted.
1559         (WebCore::CommandLineAPIHost::storageIdImpl): Deleted.
1560         * inspector/CommandLineAPIHost.h:
1561         * inspector/CommandLineAPIHost.idl:
1562         Replace custom bindings with modern bindings affordances: dictionaries, records and sequences.
1563
1564 2017-07-19  Zan Dobersek  <zdobersek@igalia.com>
1565
1566         Unreviewed CoordGraphics build fix.
1567
1568         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
1569         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
1570         This should be defined for the ScrollingCoordinatorCoordinatedGraphics class.
1571         Also fix the setFixedToViewport() call, fishing out the GraphicsLayer object from
1572         the ScrollingStateNode's LayerRepresentation.
1573         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
1574
1575 2017-07-19  Chris Dumez  <cdumez@apple.com>
1576
1577         Drop SQLException type
1578         https://bugs.webkit.org/show_bug.cgi?id=174665
1579
1580         Reviewed by Sam Weinig.
1581
1582         Drop SQLException type. We never throw such exception. Also, Firefox
1583         and Chrome no longer expose this type.
1584
1585         * CMakeLists.txt:
1586         * DerivedSources.cpp:
1587         * DerivedSources.make:
1588         * Modules/webdatabase/SQLException.cpp: Removed.
1589         * Modules/webdatabase/SQLException.h: Removed.
1590         * Modules/webdatabase/SQLException.idl: Removed.
1591         * WebCore.xcodeproj/project.pbxproj:
1592         * bindings/js/JSDOMExceptionHandling.cpp:
1593         (WebCore::createDOMException):
1594         * bindings/js/JSExceptionBase.cpp:
1595         (WebCore::toExceptionBase):
1596         * dom/DOMExceptions.in:
1597
1598 2017-07-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1599
1600         Unreviewed, tweak a comment above TemporarySelectionOptionIgnoreSelectionChanges in Editor.cpp.
1601
1602         The comment references the UI process, but it describes an entity in WebCore. This should have been generalized
1603         to instead refer to the client layer in general (i.e. WebKit1 or WebKit2).
1604
1605         * editing/Editor.h:
1606
1607 2017-07-19  Simon Fraser  <simon.fraser@apple.com>
1608
1609         getBoundingClientRects not updated for programmatic scrolls
1610         https://bugs.webkit.org/show_bug.cgi?id=174538
1611         rdar://problem/33049012
1612
1613         Reviewed by Tim Horton.
1614
1615         Baidu.com has two event handlers on its <input>, and both query the input location with getBoundingClientRect()
1616         and the current pageYOffset (via jQuery), then try to scroll the input to the top of the screen. The bug is that
1617         programmatic scrolls did not immediately update the layout viewport rect, so the second call to
1618         getBoundingClientRect() would return stale coordinates, triggering an extra scroll.
1619
1620         To fix this, undo the fix for r219320 which tried to keep getBoundingClientRect() current during unstable scroll
1621         updates by adding a shadow layout viewport rect. Instead, almost always update the layout viewport rect on
1622         FrameView, even during unstable visible rect updates, but not if content insets are being changed interactively,
1623         since changing viewport heights cause problems with bottom-fixed elements. Also, we need to compute a new layout
1624         viewport rect in FrameView::updateLayoutViewport() for programmatic scrolls.
1625
1626         However, always updating the layout viewport triggered issues with the scrolling tree. The scrolling state tree
1627         fossilizes layer positions relative to a specific viewport rect, and that relationship has to be maintained.
1628         There are code paths that recompute fixed/sticky viewport constraints when the layout viewport has changed but
1629         we haven't done layout or recomputed layer positions (e.g. updating viewport-constrained layers via
1630         updateScrollCoordinatedLayersAfterFlush()) and in these cases using a new layout viewport for those computations
1631         results in an inconsistent scrolling tree.
1632
1633         Fix this by not updating scrolling constraints every time we have to re-register scrolling nodes.
1634         updateScrollCoordinatedLayersAfterFlush() only needs to update the layer on the scrolling node (to handle
1635         tiled/non-tiled switches), so make updateScrollCoordinatedLayer() a little more fine-grained, and only update
1636         constraints when we've just computed layer geometry. This allows for different scrolling nodes to have
1637         constraints computed at different times, with different layout viewports, which happens.
1638
1639         Two additional fixes were required to make bottom-fixed bars behave correctly.
1640
1641         First, FrameView::computeLayoutViewportOrigin() had a bug where rounding of half-pixel values would cause it to
1642         fall into the if (visualViewport.height() > layoutViewport.height()) clause, but then fail to clamp for
1643         rubber-banding.
1644         
1645         Second, the FrameView::unscaledMaximumScrollPosition() was wrong after zooming on iOS, since it uses visibleSize()
1646         which is affected by page scale on iOS only (and the function wants scale-independent values). Fix with a hack that
1647         should be cleaned up via webkit.org/b/174648.
1648
1649         Tested by existing tests.
1650
1651         * page/FrameView.cpp:
1652         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
1653         (WebCore::FrameView::computeLayoutViewportOrigin):
1654         (WebCore::FrameView::setLayoutViewportOverrideRect):
1655         (WebCore::FrameView::updateLayoutViewport):
1656         (WebCore::FrameView::unscaledMaximumScrollPosition):
1657         (WebCore::FrameView::documentToClientOffset):
1658         (WebCore::FrameView::setUnstableLayoutViewportRect): Deleted.
1659         * page/FrameView.h:
1660         * page/scrolling/AsyncScrollingCoordinator.cpp:
1661         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1662         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1663         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
1664         (WebCore::AsyncScrollingCoordinator::updateNodeLayer):
1665         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
1666         (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode): Deleted.
1667         * page/scrolling/AsyncScrollingCoordinator.h:
1668         * page/scrolling/ScrollingCoordinator.cpp:
1669         (WebCore::operator<<):
1670         * page/scrolling/ScrollingCoordinator.h:
1671         (WebCore::ScrollingCoordinator::reconcileScrollingState):
1672         (WebCore::ScrollingCoordinator::updateNodeLayer):
1673         (WebCore::ScrollingCoordinator::updateNodeViewportConstraints):
1674         (WebCore::ScrollingCoordinator::updateViewportConstrainedNode): Deleted.
1675         * page/scrolling/ScrollingStateFixedNode.cpp:
1676         (WebCore::ScrollingStateFixedNode::updateConstraints):
1677         * page/scrolling/ScrollingStateStickyNode.cpp:
1678         (WebCore::ScrollingStateStickyNode::updateConstraints):
1679         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
1680         * page/scrolling/ScrollingTree.cpp:
1681         (WebCore::ScrollingTree::commitTreeState):
1682         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1683         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
1684         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
1685         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
1686         * rendering/RenderLayerBacking.cpp:
1687         (WebCore::RenderLayerBacking::updateGeometry):
1688         * rendering/RenderLayerCompositor.cpp:
1689         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
1690         (WebCore::RenderLayerCompositor::updateBacking):
1691         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged):
1692         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1693         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
1694         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
1695         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints):
1696         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1697         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
1698         * rendering/RenderLayerCompositor.h:
1699
1700 2017-07-19  Megan Gardner  <megan_gardner@apple.com>
1701
1702         Don't write file URLs to iOS Pasteboard
1703         https://bugs.webkit.org/show_bug.cgi?id=174647
1704         <rdar://problem/33199730>
1705
1706         Reviewed by Wenson Hsieh.
1707
1708         Tests updated to reflect the changes. We are no longer vending file URLs in Drag & Drop and Copy/Paste.
1709
1710         * editing/ios/EditorIOS.mm:
1711         (WebCore::Editor::writeImageToPasteboard):
1712         * platform/ios/PlatformPasteboardIOS.mm:
1713         (WebCore::PlatformPasteboard::write):
1714
1715 2017-07-19  Myles C. Maxfield  <mmaxfield@apple.com>
1716
1717         Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
1718         https://bugs.webkit.org/show_bug.cgi?id=174406
1719
1720         Reviewed by Simon Fraser.
1721         <rdar://problem/10139227>
1722
1723         Reviewed by NOBODY.
1724
1725         When the minimumFontSize API preference is set, we will increase the font size without increasing
1726         the line height. If the content specifies line-height as an absolute value, there can be two
1727         unfortunate results:
1728
1729         - Adjacent lines in a paragraph can overlap
1730         - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
1731         can be cut off and potentially indecipherable.
1732
1733         Instead, we should use the minimum font size preference as a signal that we should increase the
1734         line-height as well as the font-size. Eventually, we will want to increase it by an amount
1735         proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
1736         text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
1737         a behavior change on many webpages which use small text, so such a change would be too risky right now.
1738         Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
1739         only signal to boost the corresponding line-height.
1740
1741         Tests: fast/text/line-height-minimumFontSize-text-zoom.html
1742                fast/text/line-height-minimumFontSize-visual.html
1743                fast/text/line-height-minimumFontSize-zoom.html
1744                fast/text/line-height-minimumFontSize.html
1745                fast/text/line-height-minimumFontSize-autosize.html
1746
1747         * css/StyleBuilderCustom.h:
1748         (WebCore::computeBaseSpecifiedFontSize):
1749         (WebCore::computeLineHeightMultiplierDueToFontSize):
1750         (WebCore::StyleBuilderCustom::applyValueLineHeight):
1751         (WebCore::StyleBuilderCustom::applyValueFill):
1752         (WebCore::StyleBuilderCustom::applyValueStroke):
1753         (WebCore::StyleBuilderCustom::applyValueContent):
1754         * rendering/TextAutoSizing.cpp:
1755
1756 2017-07-18  Myles C. Maxfield  <mmaxfield@apple.com>
1757
1758         Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
1759         https://bugs.webkit.org/show_bug.cgi?id=174406
1760         <rdar://problem/10139227>
1761
1762         Reviewed by Simon Fraser.
1763
1764         When the minimumFontSize API preference is set, we will increase the font size without increasing
1765         the line height. If the content specifies line-height as an absolute value, there can be two
1766         unfortunate results:
1767
1768         - Adjacent lines in a paragraph can overlap
1769         - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
1770         can be cut off and potentially indecipherable.
1771
1772         Instead, we should use the minimum font size preference as a signal that we should increase the
1773         line-height as well as the font-size. Eventually, we will want to increase it by an amount
1774         proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
1775         text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
1776         a behavior change on many webpages which use small text, so such a change would be too risky right now.
1777         Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
1778         only signal to boost the corresponding line-height.
1779
1780         Tests: fast/text/line-height-minimumFontSize-text-zoom.html
1781                fast/text/line-height-minimumFontSize-visual.html
1782                fast/text/line-height-minimumFontSize-zoom.html
1783                fast/text/line-height-minimumFontSize.html
1784                fast/text/line-height-minimumFontSize-autosize.html
1785
1786         * css/StyleBuilderCustom.h:
1787         (WebCore::computeBaseSpecifiedFontSize):
1788         (WebCore::computeLineHeightMultiplierDueToFontSize):
1789         (WebCore::StyleBuilderCustom::applyValueLineHeight):
1790         (WebCore::StyleBuilderCustom::applyValueFill):
1791         (WebCore::StyleBuilderCustom::applyValueStroke):
1792         (WebCore::StyleBuilderCustom::applyValueContent):
1793         * rendering/TextAutoSizing.cpp:
1794
1795 2017-07-19  Chris Dumez  <cdumez@apple.com>
1796
1797         DOMException should not have its own toString()
1798         https://bugs.webkit.org/show_bug.cgi?id=174630
1799
1800         Reviewed by Sam Weinig.
1801
1802         DOMException should not have its own toString() and should use the one from Error.prototype.toString()
1803         instead:
1804         - https://heycam.github.io/webidl/#idl-DOMException
1805
1806         No new tests, rebaselined existing tests.
1807
1808         * dom/DOMCoreException.idl:
1809
1810 2017-07-19  Antoine Quint  <graouts@apple.com>
1811
1812         [iOS] REGRESSION: Scrubbing media using built-in controls does not pause media
1813         https://bugs.webkit.org/show_bug.cgi?id=174650
1814         <rdar://problem/33401877>
1815
1816         Reviewed by Dean Jackson.
1817
1818         We would only pause when scrubbing on macOS because we only listened to "mousedown" events on the
1819         scrubber's backing <input> element to identify that the user had started interacting with the
1820         scrubber.
1821
1822         Implementing the same technique on iOS required a little more work than just listening to "touchstart"
1823         events on the same element. On top of that, we needed to make sure that we would only respond to
1824         "touchstart" events on the slider's thumb, and not on the track, since only on macOS should the user
1825         be able to click anywhere on the track to scrub. So we turn off pointer-events for the <input> on iOS
1826         only, and turn them back on specifically for the thumb.
1827
1828         There is also some finessing when dealing with touch events where we need to track the identifier of
1829         the touch that started the user interaction. So we keep track of it in an ivar and wait until we get
1830         a "touchend" event where the changedTouches list contains a touch with that same identifier to ensure
1831         the same touch that initiates and ends the scrubbing interaction.
1832
1833         Finally, we fix another issue that was uncovered while turning back on the ScrubbingSupport tests
1834         where we would not trash the cached _value ivar when we initiated scrubbing, which was important since
1835         we would mistakenly use the pre-srubbing value during a scrub.
1836
1837         * Modules/modern-media-controls/controls/slider.css:
1838         (.ios .slider > input):
1839         (.slider > input::-webkit-slider-thumb):
1840         * Modules/modern-media-controls/controls/slider.js:
1841         (Slider.prototype.handleEvent):
1842         (Slider.prototype._handleMousedownEvent):
1843         (Slider.prototype._interactionEndTarget):
1844         (Slider.prototype._handleTouchstartEvent):
1845         (Slider.prototype._valueWillStartChanging):
1846         (Slider.prototype._valueDidStopChanging):
1847         (Slider.prototype._handleMouseupEvent):
1848         (Slider.prototype._handleTouchendEvent):
1849
1850 2017-07-19  Nan Wang  <n_wang@apple.com>
1851
1852         AX: Web page reloaded when a node is labelling multiple childnodes
1853         https://bugs.webkit.org/show_bug.cgi?id=174655
1854
1855         Reviewed by Chris Fleizach.
1856
1857         When we are asking for the aria-labelledby attribute of a node and its
1858         sibling is also labelled by the same node, we get into an infinite loop
1859         in textUnderElement since we only ignore one child. Added checks for 
1860         siblings to avoid such loop.
1861
1862         Test: accessibility/mac/aria-labelledby-multiple-child-crash.html
1863
1864         * accessibility/AccessibilityNodeObject.cpp:
1865         (WebCore::AccessibilityNodeObject::textUnderElement):
1866
1867 2017-07-19  Andy Estes  <aestes@apple.com>
1868
1869         Use a cast to work around clang's false -Wobjc-literal-conversion warnings
1870         https://bugs.webkit.org/show_bug.cgi?id=174631
1871
1872         Reviewed by Dan Bernstein.
1873
1874         Instead of ignoring -Wobjc-literal-conversion, use a cast to work around rdar://problem/33383354.
1875
1876         * platform/ios/PlatformPasteboardIOS.mm:
1877         (WebCore::PlatformPasteboard::write):
1878
1879 2017-07-19  Chris Dumez  <cdumez@apple.com>
1880
1881         Make cross-origin properties enumerable
1882         https://bugs.webkit.org/show_bug.cgi?id=174576
1883
1884         Reviewed by Darin Adler.
1885
1886         Makes cross-origin properties enumerable on Window and Location objects
1887         as per:
1888         - https://github.com/whatwg/html/pull/2777
1889
1890         This simplifies our code quite a bit.
1891
1892         No new tests, updated existing tests.
1893
1894         * bindings/js/JSDOMWindowCustom.cpp:
1895         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1896         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1897         (WebCore::JSDOMWindow::getOwnPropertyNames):
1898         * bindings/js/JSLocationCustom.cpp:
1899         (WebCore::getOwnPropertySlotCommon):
1900         (WebCore::JSLocation::getOwnPropertyNames):
1901         * bindings/scripts/CodeGeneratorJS.pm:
1902         (GenerateHeader):
1903
1904 2017-07-18  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1905
1906         [EME] Build failure with Clang-3.8 on InitDataRegistry.cpp
1907         https://bugs.webkit.org/show_bug.cgi?id=174628
1908
1909         Reviewed by Žan Doberšek.
1910
1911         * Modules/encryptedmedia/InitDataRegistry.cpp:
1912         (WebCore::extractKeyIDsKeyids): Add an explicit cast to unsigned.
1913
1914 2017-07-19  Matt Lewis  <jlewis3@apple.com>
1915
1916         Unreviewed, rolling out r219646.
1917
1918         The test added are failing on all platforms
1919
1920         Reverted changeset:
1921
1922         "Setting the minimum font size preference doesn’t affect
1923         absolute line-height values, so lines overlap"
1924         https://bugs.webkit.org/show_bug.cgi?id=174406
1925         http://trac.webkit.org/changeset/219646
1926
1927 2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>
1928
1929         [WTF] Implement WTF::ThreadGroup
1930         https://bugs.webkit.org/show_bug.cgi?id=174081
1931
1932         Reviewed by Mark Lam.
1933
1934         * page/ResourceUsageThread.h:
1935
1936 2017-07-18  Andy Estes  <aestes@apple.com>
1937
1938         [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
1939         https://bugs.webkit.org/show_bug.cgi?id=174631
1940
1941         Reviewed by Tim Horton.
1942
1943         * Configurations/Base.xcconfig:
1944         * rendering/Grid.cpp:
1945         (WebCore::Grid::insert):
1946         * rendering/RenderTreeAsText.cpp:
1947         (WebCore::write):
1948         * rendering/SimpleLineLayoutCoverage.cpp:
1949         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
1950
1951 2017-07-18  Yusuke Suzuki  <utatane.tea@gmail.com>
1952
1953         WTF::Thread should have the threads stack bounds.
1954         https://bugs.webkit.org/show_bug.cgi?id=173975
1955
1956         Reviewed by Mark Lam.
1957
1958         When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread
1959         and share it with WebThread.
1960         The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators.
1961         It allocates AtomicString, which requires WTFThreadData.
1962
1963         In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData.
1964         And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since
1965         WebCore::ThreadGlobalData allocates AtomicString.
1966
1967         * platform/ios/wak/WebCoreThread.mm:
1968         (StartWebThread):
1969
1970 2017-07-18  Myles C. Maxfield  <mmaxfield@apple.com>
1971
1972         Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
1973         https://bugs.webkit.org/show_bug.cgi?id=174406
1974         <rdar://problem/10139227>
1975
1976         Reviewed by Simon Fraser.
1977
1978         When the minimumFontSize API preference is set, we will increase the font size without increasing
1979         the line height. If the content specifies line-height as an absolute value, there can be two
1980         unfortunate results:
1981
1982         - Adjacent lines in a paragraph can overlap
1983         - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
1984         can be cut off and potentially indecipherable.
1985
1986         Instead, we should use the minimum font size preference as a signal that we should increase the
1987         line-height as well as the font-size. Eventually, we will want to increase it by an amount
1988         proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
1989         text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
1990         a behavior change on many webpages which use small text, so such a change would be too risky right now.
1991         Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
1992         only signal to boost the corresponding line-height.
1993
1994         Tests: fast/text/line-height-minimumFontSize-text-zoom.html
1995                fast/text/line-height-minimumFontSize-visual.html
1996                fast/text/line-height-minimumFontSize-zoom.html
1997                fast/text/line-height-minimumFontSize.html
1998                fast/text/line-height-minimumFontSize-autosize.html
1999
2000         * css/StyleBuilderCustom.h:
2001         (WebCore::computeBaseSpecifiedFontSize):
2002         (WebCore::computeLineHeightMultiplierDueToFontSize):
2003         (WebCore::StyleBuilderCustom::applyValueLineHeight):
2004         (WebCore::StyleBuilderCustom::applyValueFill):
2005         (WebCore::StyleBuilderCustom::applyValueStroke):
2006         (WebCore::StyleBuilderCustom::applyValueContent):
2007         * rendering/TextAutoSizing.cpp:
2008
2009 2017-07-18  Zalan Bujtas  <zalan@apple.com>
2010
2011         Media controls are missing content in fullscreen when document has scroll offset.
2012         https://bugs.webkit.org/show_bug.cgi?id=174644
2013         <rdar://problem/32415323>
2014
2015         Reviewed by Simon Fraser.
2016
2017         If a non-user initiated scrolling (result of resize for example) is processed asynchronously, it might
2018         leapfrog other, programatic scrollings and trigger unintentional scroll offsets (and turn into unwanted clippings). 
2019         This patch ensures that both resize and top content inset change are translated into programatic scrolling. 
2020
2021         Unable to test full screen video.
2022
2023         * page/FrameView.cpp:
2024         (WebCore::FrameView::setFrameRect):
2025         (WebCore::FrameView::topContentInsetDidChange):
2026
2027 2017-07-18  Andy Estes  <aestes@apple.com>
2028
2029         [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
2030         https://bugs.webkit.org/show_bug.cgi?id=174631
2031
2032         Reviewed by Sam Weinig.
2033
2034         * Configurations/Base.xcconfig:
2035         * platform/ios/PlatformPasteboardIOS.mm:
2036         (WebCore::PlatformPasteboard::write):
2037
2038 2017-07-18  Ali Juma  <ajuma@chromium.org>
2039
2040         Align quirky number parsing with other browsers
2041         https://bugs.webkit.org/show_bug.cgi?id=155874
2042
2043         Reviewed by Simon Fraser.
2044
2045         Parse unit-less non-zero values for animation-duration and transition-duration
2046         as invalid time values in quirks mode.
2047
2048         Test: fast/css/animation-transition-duration-quirksmode.html
2049
2050         * css/parser/CSSPropertyParser.cpp:
2051         (WebCore::consumeAnimationValue):
2052
2053 2017-07-18  Chris Dumez  <cdumez@apple.com>
2054
2055         HysteresisActivity cannot be used in the UIProcess
2056         https://bugs.webkit.org/show_bug.cgi?id=174643
2057         <rdar://problem/33086442>
2058
2059         Reviewed by Tim Horton.
2060
2061         Port HysteresisActivity to RunLoop::Timer so that it can safely be used in
2062         the UIProcess as well.
2063
2064         * platform/HysteresisActivity.h:
2065
2066 2017-07-18  Joseph Pecoraro  <pecoraro@apple.com>
2067
2068         Web Inspector: Modernize InjectedScriptSource
2069         https://bugs.webkit.org/show_bug.cgi?id=173890
2070
2071         Reviewed by Brian Burg.
2072
2073         Covered by existing tests.
2074
2075         * inspector/CommandLineAPIModuleSource.js:
2076         (CommandLineAPIImpl.prototype.copy):
2077         (CommandLineAPIImpl.prototype._inspect):
2078         Use RemoteObject, a new parameter.
2079
2080 2017-07-18  Ryosuke Niwa  <rniwa@webkit.org>
2081
2082         REGRESSION(r218910): Crash when password field changes to text field
2083         https://bugs.webkit.org/show_bug.cgi?id=174560
2084
2085         Reviewed by Zalan Bujtas.
2086
2087         The crash was caused by textMarkerDataForFirstPositionInTextControl accessing a nullptr returned by getOrCreate.
2088         Unfortunately, in order to this fix bug while preserving the exact behavior would require synchronously creating
2089         a renderer for the editing host when the input type changed since we can't create an accessbility object out of
2090         a renderer-less node.
2091
2092         Instead, revert back to pre-r218910 behavior of always using the text control element's axID when notifying
2093         the value change. While this is inconsistent with the way editing commands report content changes, I've since
2094         learned that VoiceOver has code to deal with this exact situation.
2095
2096         Test: accessibility/mac/input-type-change-crash-2.html
2097
2098         * accessibility/AXObjectCache.cpp:
2099         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
2100
2101 2017-07-18  Matt Baker  <mattbaker@apple.com>
2102
2103         Web Inspector: Refactoring: replace InspectorCanvasAgent::CanvasEntry with a helper class
2104         https://bugs.webkit.org/show_bug.cgi?id=174311
2105
2106         Reviewed by Devin Rousso.
2107
2108         This patch adds a helper class for tracking canvases and their data. The
2109         current approach of defining a helper structure in the agent's header is
2110         awkward to use and maintain, and won't scale well as more canvas instrumentation
2111         points and data are added.
2112
2113         * CMakeLists.txt:
2114         * WebCore.xcodeproj/project.pbxproj:
2115         New file.
2116
2117         * inspector/InspectorCanvas.cpp: Added.
2118         (WebCore::InspectorCanvas::create):
2119         (WebCore::InspectorCanvas::InspectorCanvas):
2120         (WebCore::InspectorCanvas::buildObjectForCanvas):
2121         * inspector/InspectorCanvas.h: Added.
2122
2123         * inspector/InspectorCanvasAgent.cpp:
2124         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
2125         (WebCore::InspectorCanvasAgent::enable):
2126         (WebCore::InspectorCanvasAgent::requestNode):
2127         (WebCore::InspectorCanvasAgent::requestContent):
2128         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
2129         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
2130         (WebCore::InspectorCanvasAgent::frameNavigated):
2131         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
2132         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
2133         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
2134         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
2135         (WebCore::InspectorCanvasAgent::canvasDestroyed):
2136         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
2137         (WebCore::InspectorCanvasAgent::clearCanvasData):
2138         (WebCore::InspectorCanvasAgent::unbindCanvas):
2139         (WebCore::InspectorCanvasAgent::assertInspectorCanvas):
2140         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
2141         (WebCore::InspectorCanvasAgent::getCanvasEntry): Deleted.
2142         (WebCore::InspectorCanvasAgent::buildObjectForCanvas): Deleted.
2143         * inspector/InspectorCanvasAgent.h:
2144
2145         * inspector/InspectorController.cpp:
2146         (WebCore::InspectorController::InspectorController):
2147         Remove unused constructor argument.
2148
2149 2017-07-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2150
2151         [Curl] Move detail implementation from ResourceHandle to ResourceHandleInternal
2152         https://bugs.webkit.org/show_bug.cgi?id=174641
2153
2154         After moving stuff from ResourceHandleManager to ResourceHandle on 
2155         https://bugs.webkit.org/show_bug.cgi?id=173630, still there're many violation
2156         remains between ResourceHandle and ResourceHandleInternal classes.
2157         Many of implementation detail should be move to ResourceHandleInternal
2158         to improve build speed.
2159
2160         Reviewed by Alex Christensen.
2161
2162         * platform/network/ResourceHandle.h:
2163         * platform/network/ResourceHandleInternal.h:
2164         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2165         * platform/network/curl/ResourceHandleCurl.cpp:
2166         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
2167         (WebCore::ResourceHandle::start):
2168         (WebCore::ResourceHandle::cancel):
2169         (WebCore::ResourceHandleInternal::initialize):
2170         (WebCore::ResourceHandleInternal::applyAuthentication):
2171         (WebCore::ResourceHandleInternal::setupPUT):
2172         (WebCore::ResourceHandleInternal::setupPOST):
2173         (WebCore::ResourceHandleInternal::setupFormData):
2174         (WebCore::ResourceHandle::platformSetDefersLoading):
2175         (WebCore::ResourceHandleInternal::didFinish):
2176         (WebCore::ResourceHandleInternal::didFail):
2177         (WebCore::ResourceHandleInternal::calculateWebTimingInformations):
2178         (WebCore::ResourceHandleInternal::handleLocalReceiveResponse):
2179         (WebCore::ResourceHandleInternal::willPrepareSendData):
2180         (WebCore::ResourceHandleInternal::didReceiveHeaderLine):
2181         (WebCore::ResourceHandleInternal::didReceiveAllHeaders):
2182         (WebCore::ResourceHandleInternal::didReceiveContentData):
2183         (WebCore::ResourceHandleInternal::readCallback):
2184         (WebCore::ResourceHandleInternal::headerCallback):
2185         (WebCore::ResourceHandleInternal::writeCallback):
2186         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2187         (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
2188         (WebCore::ResourceHandleInternal::handleDataURL):
2189         (WebCore::ResourceHandle::initialize): Deleted.
2190         (WebCore::ResourceHandle::applyAuthentication): Deleted.
2191         (WebCore::ResourceHandle::setupPUT): Deleted.
2192         (WebCore::ResourceHandle::setupPOST): Deleted.
2193         (WebCore::ResourceHandle::setupFormData): Deleted.
2194         (WebCore::ResourceHandle::didFinish): Deleted.
2195         (WebCore::ResourceHandle::didFail): Deleted.
2196         (WebCore::ResourceHandle::calculateWebTimingInformations): Deleted.
2197         (WebCore::ResourceHandle::handleLocalReceiveResponse): Deleted.
2198         (WebCore::ResourceHandle::willPrepareSendData): Deleted.
2199         (WebCore::ResourceHandle::didReceiveHeaderLine): Deleted.
2200         (WebCore::ResourceHandle::didReceiveAllHeaders): Deleted.
2201         (WebCore::ResourceHandle::didReceiveContentData): Deleted.
2202         (WebCore::ResourceHandle::readCallback): Deleted.
2203         (WebCore::ResourceHandle::headerCallback): Deleted.
2204         (WebCore::ResourceHandle::writeCallback): Deleted.
2205         (WebCore::ResourceHandle::dispatchSynchronousJob): Deleted.
2206         (WebCore::ResourceHandle::handleDataURL): Deleted.
2207
2208 2017-07-18  Andy Estes  <aestes@apple.com>
2209
2210         [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
2211         https://bugs.webkit.org/show_bug.cgi?id=174631
2212
2213         Reviewed by Dan Bernstein.
2214
2215         * Configurations/Base.xcconfig:
2216
2217 2017-07-18  Antoine Quint  <graouts@apple.com>
2218
2219         [macOS] Mouse pointer does not hide during fullscreen playback
2220         https://bugs.webkit.org/show_bug.cgi?id=174638
2221         <rdar://problem/33244399>
2222
2223         Reviewed by Dean Jackson.
2224
2225         Test: media/modern-media-controls/css/webkit-cursor-visibility-auto-hide.html
2226
2227         The user-agent stylesheet sets the "-webkit-cursor-visibility" to "auto-hide" for fullscreen <video>
2228         elements. Since we reset the page styles, including UA styles, on .media-controls-container, we need
2229         to explicitly inherit this style property from the page to ensure the mouse pointer automatically
2230         hides in fullscreen.
2231
2232         * Modules/modern-media-controls/controls/media-controls.css:
2233         (.media-controls-container):
2234
2235 2017-07-18  Sam Weinig  <sam@webkit.org>
2236
2237         [WebIDL] Remove custom bindings for MockContentFilterSettings
2238         https://bugs.webkit.org/show_bug.cgi?id=174606
2239
2240         Reviewed by Andy Estes.
2241
2242         * PlatformMac.cmake:
2243         * WebCore.xcodeproj/project.pbxproj:
2244         * bindings/js/JSMockContentFilterSettingsCustom.cpp: Removed.
2245         Remove JSMockContentFilterSettingsCustom.
2246
2247         * testing/MockContentFilterSettings.h:
2248         * testing/MockContentFilterSettings.idl:
2249         Switch from constants to IDL enums to make the bindings and tests simpler.
2250
2251 2017-07-18  Sam Weinig  <sam@webkit.org>
2252
2253         [WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp with named getters/setters
2254         https://bugs.webkit.org/show_bug.cgi?id=174529
2255
2256         Reviewed by Chris Dumez.
2257
2258         * CMakeLists.txt:
2259         * WebCore.xcodeproj/project.pbxproj:
2260         * css/CSSAllInOne.cpp:
2261         Add CSSStyleDeclaration.cpp
2262
2263         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2264         Move getter / setter / getOwnProperties logic from here to CSSStyleDeclaration.cpp.
2265
2266         * bindings/scripts/CodeGeneratorJS.pm:
2267         (GenerateGetOwnPropertySlot):
2268         (GenerateGetOwnPropertySlotByIndex):
2269         (InstanceOverridesGetOwnPropertySlot):
2270         (GenerateHeader):
2271         Remove support for no longer needed [CustomGetOwnPropertySlotAndDescriptor].
2272         Add support for [PutOnlyForSupportedProperties], which allows named setters to behave
2273         a bit more like normal setters by allowing the implementation to note which properties
2274         are supported which in turn, allows the bindings to continue down the normal put path
2275         for unsupported properties. This is necessary to mimic the behavior of CSSStyleDeclaration
2276         which is using named setters in place hundreds of additional properties.
2277
2278         (InstanceOverridesDefineOwnProperty):
2279         Add [DefaultDefineOwnProperty] to allow disabling defineOwnProperty overriding that comes
2280         automatically with named setters. We need this for CSSStyleDeclaration since the named
2281         setter usage modeling real properties, not a dictionary style setter. We may want to 
2282         revisit this, and add support for DefineOwnProperty here, but this allows us to maintain
2283         the status quo.
2284
2285         (GenerateDefineOwnProperty):
2286         Fix the case when you have a named setter, an indexed getter, but no indexed setter. In that
2287         case, we would get a compile error, due to the index variable being unused.
2288
2289         * bindings/scripts/IDLAttributes.json:
2290         Remove support for no longer needed [CustomGetOwnPropertySlotAndDescriptor], add
2291         [PutOnlyForSupportedProperties] and [DefaultDefineOwnProperty].
2292
2293         * css/CSSStyleDeclaration.h:
2294         * css/CSSStyleDeclaration.cpp: Added.
2295         (WebCore::CSSStyleDeclaration::namedItem):
2296         (WebCore::CSSStyleDeclaration::setNamedItem):
2297         (WebCore::CSSStyleDeclaration::isSupportedPropertyName):
2298         (WebCore::CSSStyleDeclaration::supportedPropertyNames):
2299         Use standard getter / setter functions to implement CSS property name getting and setting.
2300         Convert from Identifier to AtomicString, which are now bridgeable.
2301
2302         * css/CSSStyleDeclaration.idl:
2303         Add named getter and setter. Remove [CustomGetOwnPropertyNames], [CustomGetOwnPropertySlotAndDescriptor]
2304         and [CustomPut], add [DefaultDefineOwnProperty].
2305
2306         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: Added.
2307         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: Added.
2308         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: Added.
2309         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: Added.
2310         * bindings/scripts/test/TestNamedSetterWithIndexedGetter.idl: Added.
2311         * bindings/scripts/test/TestNamedSetterWithIndexedGetterAndSetter.idl: Added.
2312         Add tests for improved behavior when using named setters with variations of indexed getters and setters as well.
2313
2314 2017-07-18  Antoine Quint  <graouts@apple.com>
2315
2316         [iOS] WebKit media controls are sometimes shown after exiting full screen on vimeo.com
2317         https://bugs.webkit.org/show_bug.cgi?id=174627
2318         <rdar://problem/33301005>
2319
2320         Reviewed by Dean Jackson, provisionally reviewed by Jeremy Jones.
2321
2322         On iOS 11, both the WebKit media controls and the Vimeo custom controls would appear sometimes when exiting
2323         from fullscreen when the video was playing and the user would tap the X button, which would pause the video
2324         as well as exit fullscreen.
2325
2326         The reason this happens is that the ControlsVisibilitySupport object, which governs whether the WebKit media
2327         controls should be displayed for a given video, woud listen to "pause" and "webkitfullscreenchange" events
2328         and determine whether to show the WebKit media controls. We listen to the "pause" event because when media
2329         pauses, and the video has the "controls" attribute set, we should show the controls and suspend the controls
2330         auto-hide timer. And we're interested in knowing when we enter and exit fullscreen because we want to override
2331         the "controls" attribute not being set when we enter fullscreen.
2332
2333         However, on iOS 11, it appears that the "webkitfullscreenchange" event is not reliably fired as the user enters
2334         and exits fullscreen, which is tracked by webkit.org/b/174626. So, when the user exits fullscreen, we would be
2335         informed of the video being paused via a "pause" event, but not of the video exiting fullscreen. And because
2336         media events are asynchronous, the "pause" event would sometimes be fired before we exited fullscreen, and when
2337         the _updateControls() would run, we would sometimes determine that we are in fullscreen still and determine
2338         that the WebKit media controls should be shown.
2339
2340         Of course, on iOS, the WebKit media controls are not shown and instead we delegate to AVKit to display media controls.
2341         So we could simply disregard this whole logic in iOS. But we choose to instead use the "webkitpresentationmodechanged"
2342         when the presentation mode API is supported, as is the case on iOS 11, to determine changes of media fullscreen state.
2343         This way, should we ever choose to support fullscreen media controls provided by WebKit on iOS, this logic is already
2344         correct and we write less platform-specific code.
2345
2346         This, alas, cannot be tested since we can't force the X button to be tapped within the AVKit fullscreen controls.
2347
2348         * Modules/modern-media-controls/media/controls-visibility-support.js:
2349         (ControlsVisibilitySupport.prototype.get mediaEvents):
2350         * Modules/modern-media-controls/media/media-controller.js:
2351         (MediaController):
2352         * Modules/modern-media-controls/media/start-support.js:
2353         (StartSupport.prototype.get mediaEvents):
2354
2355 2017-07-18  Matt Lewis  <jlewis3@apple.com>
2356
2357         Unreviewed, rolling out r219610.
2358
2359         This caused an api failure on all platforms for the test
2360         SnapshotImageLargeAsyncDecoding
2361
2362         Reverted changeset:
2363
2364         "Async image decoding for large images should be disabled
2365         after the first time a tile is painted"
2366         https://bugs.webkit.org/show_bug.cgi?id=174451
2367         http://trac.webkit.org/changeset/219610
2368
2369 2017-07-18  Devin Rousso  <drousso@apple.com>
2370
2371         Add CanvasRenderingContext2D::getTransform
2372         https://bugs.webkit.org/show_bug.cgi?id=174278
2373
2374         Reviewed by Dean Jackson.
2375
2376         Tests: fast/canvas/2d.getTransform.modification.html
2377                fast/canvas/2d.getTransform.newobject.html
2378                fast/canvas/2d.setTransform.matrix.html
2379
2380         * css/DOMMatrixReadOnly.h:
2381         Make DOMMatrixReadOnly::validateAndFixup public so that values of DOMMatrixInit are still
2382         usable without having to construct a DOMMatrixReadOnly. This is beneficial in the case that
2383         an exception is thrown, as the validateAndFixup check can happen without any allocations.
2384
2385         * html/canvas/CanvasRenderingContext2D.idl:
2386         * html/canvas/CanvasRenderingContext2D.h:
2387         * html/canvas/CanvasRenderingContext2D.cpp:
2388         (WebCore::CanvasRenderingContext2D::getTransform):
2389         (WebCore::CanvasRenderingContext2D::setTransform):
2390
2391 2017-07-18  Andy Estes  <aestes@apple.com>
2392
2393         [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
2394         https://bugs.webkit.org/show_bug.cgi?id=174631
2395
2396         Reviewed by Darin Adler.
2397
2398         * Configurations/Base.xcconfig:
2399
2400 2017-07-18  Jonathan Bedard  <jbedard@apple.com>
2401
2402         Unreviewed build fix after r219595
2403
2404         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2405         (WebCore::makeNeverDestroyed): Remove duplicate makeNeverDestroyed definition.
2406         * platform/ios/DragImageIOS.mm:
2407         (WebCore::cascadeForSystemFont): Return correct FontCascade object.
2408         (WebCore::createDragImageForLink): Fix compiler error.
2409
2410 2017-07-18  Daniel Bates  <dabates@apple.com>
2411
2412         Cleanup: Remove AlternativeTextInfo and use Variant to represent alternative text info details
2413         https://bugs.webkit.org/show_bug.cgi?id=174604
2414
2415         I inadvertently did not commit some of my local changes.
2416
2417         * editing/AlternativeTextController.cpp:
2418         (WebCore::AlternativeTextController::startAlternativeTextUITimer):
2419         (WebCore::AlternativeTextController::stopAlternativeTextUITimer):
2420         (WebCore::AlternativeTextController::applyPendingCorrection):
2421         (WebCore::AlternativeTextController::hasPendingCorrection):
2422         (WebCore::AlternativeTextController::show):
2423         (WebCore::AlternativeTextController::handleCancelOperation):
2424         (WebCore::AlternativeTextController::dismiss):
2425         (WebCore::AlternativeTextController::dismissSoon):
2426         (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
2427         (WebCore::AlternativeTextController::timerFired):
2428         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
2429         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
2430         (WebCore::AlternativeTextController::markerDescriptionForAppliedAlternativeText):
2431
2432 2017-07-17  Daniel Bates  <dabates@apple.com>
2433
2434         Cleanup: Remove AlternativeTextInfo and use Variant to represent alternative text info details
2435         https://bugs.webkit.org/show_bug.cgi?id=174604
2436
2437         Reviewed by Darin Adler.
2438
2439         Remove struct AlternativeTextInfo and represent the alternative text info as instance variables
2440         using Variant to hold either an autocorrection replacement string or the alternative dictation
2441         context.
2442
2443         Not functionality changed. So, no new tests.
2444
2445         * editing/AlternativeTextController.cpp: Remove header Event.h as it is ultimately included by TextEvent.h.
2446         (WebCore::AlternativeTextController::show): Update code as needed.
2447         (WebCore::AlternativeTextController::timerFired): Ditto.
2448         (WebCore::AlternativeTextController::alternativeTextClient): Substitute nullptr for 0.
2449         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Update code as needed.
2450         (WebCore::AutocorrectionAlternativeDetails::create): Deleted.
2451         (WebCore::AutocorrectionAlternativeDetails::replacementString): Deleted.
2452         (WebCore::AutocorrectionAlternativeDetails::AutocorrectionAlternativeDetails): Deleted.
2453         (WebCore::DictationAlternativeDetails::create): Deleted.
2454         (WebCore::DictationAlternativeDetails::dictationContext): Deleted.
2455         (WebCore::DictationAlternativeDetails::DictationAlternativeDetails): Deleted.
2456         * editing/AlternativeTextController.h: Remove header Range.h and forward declare Range. Include header
2457         Position.h and wtf/Variant.h. Sort forward declarations.
2458         (WebCore::AlternativeTextDetails::~AlternativeTextDetails): Deleted.
2459
2460 2017-07-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2461
2462         Async image decoding for large images should be disabled after the first time a tile is painted
2463         https://bugs.webkit.org/show_bug.cgi?id=174451
2464
2465         Reviewed by Simon Fraser.
2466
2467         Flashing because of DOM mutation can be fixed by disabling the asynchronous
2468         image decoding after the first time a tile was painted.
2469
2470         We can detect this by consulting the tile repaintCount. If it is zero, then
2471         it is safe to use asynchronous image decoded. If the tile repaintCount is
2472         greater than zero, we are not sure if the renderer rectangle has an image
2473         drawn in it already or not. In this case we have to use the synchronous
2474         image decoding to avoid causing a flash.
2475
2476         Tests: fast/images/async-image-background-change.html
2477                fast/images/async-image-src-change.html
2478                http/tests/multipart/multipart-async-image.html
2479
2480         * page/PageOverlayController.cpp:
2481         (WebCore::PageOverlayController::paintContents):
2482         * page/PageOverlayController.h:
2483         * page/linux/ResourceUsageOverlayLinux.cpp:
2484         * page/mac/ServicesOverlayController.h:
2485         * page/mac/ServicesOverlayController.mm:
2486         (WebCore::ServicesOverlayController::Highlight::paintContents):
2487         * platform/graphics/BitmapImage.h:
2488         * platform/graphics/GraphicsLayer.cpp:
2489         (WebCore::GraphicsLayer::paintGraphicsLayerContents):
2490         * platform/graphics/GraphicsLayer.h:
2491         * platform/graphics/GraphicsLayerClient.h:
2492         (WebCore::GraphicsLayerClient::paintContents):
2493         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2494         (WebCore::LayerClient::platformCALayerPaintContents):
2495         * platform/graphics/ca/GraphicsLayerCA.cpp:
2496         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
2497         * platform/graphics/ca/GraphicsLayerCA.h:
2498         * platform/graphics/ca/PlatformCALayer.h:
2499         * platform/graphics/ca/PlatformCALayerClient.h:
2500         (WebCore::PlatformCALayerClient::platformCALayerRepaintCount):
2501         * platform/graphics/ca/TileCoverageMap.cpp:
2502         (WebCore::TileCoverageMap::platformCALayerPaintContents):
2503         * platform/graphics/ca/TileCoverageMap.h:
2504         * platform/graphics/ca/TileGrid.cpp:
2505         (WebCore::TileGrid::platformCALayerPaintContents):
2506         (WebCore::TileGrid::platformCALayerRepaintCount):
2507         * platform/graphics/ca/TileGrid.h:
2508         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2509         (PlatformCALayer::drawLayerContents):
2510         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2511         (PlatformCALayer::drawLayerContents):
2512         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2513         (PlatformCALayerWinInternal::displayCallback):
2514         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
2515         (WebTiledBackingLayerWin::displayCallback):
2516         * platform/graphics/mac/WebLayer.mm:
2517         (-[WebLayer drawInContext:]):
2518         (-[WebSimpleLayer drawInContext:]):
2519         * rendering/RenderBoxModelObject.cpp:
2520         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
2521         * rendering/RenderElement.h:
2522         * rendering/RenderLayerBacking.cpp:
2523         (WebCore::RenderLayerBacking::paintContents):
2524         * rendering/RenderLayerBacking.h:
2525         * rendering/RenderLayerCompositor.cpp:
2526         (WebCore::RenderLayerCompositor::paintContents):
2527         * rendering/RenderLayerCompositor.h:
2528         * testing/Internals.cpp:
2529         (WebCore::imageFromImageElement):
2530         (WebCore::bitmapImageFromImageElement):
2531         (WebCore::Internals::imageFrameIndex):
2532         (WebCore::Internals::setImageFrameDecodingDuration):
2533         (WebCore::Internals::resetImageAnimation):
2534         (WebCore::Internals::isImageAnimating):
2535         (WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
2536         (WebCore::Internals::imageDecodeCount):
2537         (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting):
2538         * testing/Internals.h:
2539         * testing/Internals.idl:
2540
2541 2017-07-18  Chris Dumez  <cdumez@apple.com>
2542
2543         DOMException should have its properties on the prototype
2544         https://bugs.webkit.org/show_bug.cgi?id=174597
2545
2546         Reviewed by Alex Christensen.
2547
2548         DOMException should have its properties on the prototype, as other interfaces:
2549         - https://heycam.github.io/webidl/#idl-DOMException
2550
2551         No new tests, rebaselined existing tests.
2552
2553         * bindings/scripts/CodeGeneratorJS.pm:
2554         (InterfaceRequiresAttributesOnInstance):
2555
2556 2017-07-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2557
2558         [Curl] Unify ResourceHandleManager into CurlJobManager.
2559         https://bugs.webkit.org/show_bug.cgi?id=173991
2560
2561         Use CurlJobManager to make ResourceHandle run in background.
2562         CurlJobManager::start() now accept callback to manage life cycle
2563         of the resource easily in a same context.
2564         Actual management tasks of CurlJobManager is now private class
2565         in CurlJobManager which is better thread safeness.
2566         ResourceHandleManager is deleted at all.
2567
2568         Reviewed by Alex Christensen.
2569
2570         * platform/Curl.cmake:
2571         * platform/network/ResourceHandle.h:
2572         * platform/network/curl/CookieJarCurl.cpp:
2573         (WebCore::cookiesForSession):
2574         * platform/network/curl/CurlContext.cpp:
2575         (WebCore::CurlHandle::CurlHandle):
2576         (WebCore::CurlHandle::~CurlHandle):
2577         (WebCore::CurlHandle::errorDescription):
2578         (WebCore::CurlHandle::perform):
2579         (WebCore::CurlHandle::pause):
2580         (WebCore::CurlHandle::appendRequestHeaders):
2581         (WebCore::CurlHandle::appendRequestHeader):
2582         (WebCore::CurlHandle::enableRequestHeaders):
2583         (WebCore::CurlHandle::fetchCookieList):
2584         (WebCore::CurlHandle::getEffectiveURL):
2585         (WebCore::CurlHandle::setPrivateData): Deleted.
2586         (WebCore::CurlHandle::clearRequestHeaders): Deleted.
2587         (WebCore::CurlHandle::getCookieList): Deleted.
2588         (WebCore::CurlHandle::clearCookieList): Deleted.
2589         * platform/network/curl/CurlContext.h:
2590         (WebCore::CurlSList::CurlSList):
2591         (WebCore::CurlSList::~CurlSList):
2592         (WebCore::CurlSList::operator struct curl_slist** ):
2593         (WebCore::CurlSList::head):
2594         (WebCore::CurlSList::isEmpty):
2595         (WebCore::CurlSList::clear):
2596         (WebCore::CurlSList::append):
2597         (WebCore::CurlHandle::errorCode):
2598         (WebCore::CurlHandle::setErrorCode):
2599         (WebCore::CurlHandle::privateData):
2600         (WebCore::CurlHandle::setPrivateData):
2601         * platform/network/curl/CurlDownload.cpp:
2602         (WebCore::CurlDownload::start):
2603         (WebCore::CurlDownload::cancel):
2604         (WebCore::CurlDownload::addHeaders):
2605         (WebCore::CurlDownload::didReceiveData):
2606         (WebCore::CurlDownload::didFail):
2607         (WebCore::CurlDownload::handleCurlMsg): Deleted.
2608         * platform/network/curl/CurlDownload.h:
2609         * platform/network/curl/CurlJobManager.cpp:
2610         (WebCore::CurlJobList::append):
2611         (WebCore::CurlJobList::cancel):
2612         (WebCore::CurlJobList::complete):
2613         (WebCore::CurlJobList::isEmpty):
2614         (WebCore::CurlJobList::withJob):
2615         (WebCore::CurlJobList::withCurlHandle):
2616         (WebCore::CurlJob::invoke):
2617         (WebCore::CurlJobManager::add):
2618         (WebCore::CurlJobManager::cancel):
2619         (WebCore::CurlJobManager::callOnJobThread):
2620         (WebCore::CurlJobManager::startThreadIfNeeded):
2621         (WebCore::CurlJobManager::stopThreadIfNoMoreJobRunning):
2622         (WebCore::CurlJobManager::stopThread):
2623         (WebCore::CurlJobManager::updateJobs):
2624         (WebCore::CurlJobManager::workerThread):
2625         (WebCore::CurlJobManager::CurlJobManager): Deleted.
2626         (WebCore::CurlJobManager::~CurlJobManager): Deleted.
2627         (WebCore::CurlJobManager::remove): Deleted.
2628         (WebCore::CurlJobManager::getActiveCount): Deleted.
2629         (WebCore::CurlJobManager::getPendingCount): Deleted.
2630         (WebCore::CurlJobManager::stopThreadIfIdle): Deleted.
2631         (WebCore::CurlJobManager::updateHandleList): Deleted.
2632         (WebCore::CurlJobManager::addToCurl): Deleted.
2633         (WebCore::CurlJobManager::removeFromCurl): Deleted.
2634         * platform/network/curl/CurlJobManager.h:
2635         (WebCore::CurlJob::CurlJob):
2636         (WebCore::CurlJob::~CurlJob):
2637         (WebCore::CurlJob::operator=):
2638         (WebCore::CurlJob::curlHandle):
2639         (WebCore::CurlJob::ticket):
2640         (WebCore::CurlJob::finished):
2641         (WebCore::CurlJob::error):
2642         (WebCore::CurlJob::cancel):
2643         (WebCore::CurlJobManager::singleton):
2644         (WebCore::CurlJobManager::~CurlJobManager):
2645         (WebCore::CurlJobManager::isActiveJob):
2646         (WebCore::CurlJobManager::runThread): Deleted.
2647         (WebCore::CurlJobManager::setRunThread): Deleted.
2648         * platform/network/curl/ResourceError.h:
2649         (WebCore::ResourceError::ResourceError):
2650         * platform/network/curl/ResourceHandleCurl.cpp:
2651         (WebCore::ResourceHandle::~ResourceHandle):
2652         (WebCore::ResourceHandle::start):
2653         (WebCore::ResourceHandle::cancel):
2654         (WebCore::ResourceHandle::initialize):
2655         (WebCore::ResourceHandle::applyAuthentication):
2656         (WebCore::getFormElementsCount):
2657         (WebCore::ResourceHandle::setupPUT):
2658         (WebCore::ResourceHandle::setupPOST):
2659         (WebCore::ResourceHandle::setupFormData):
2660         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
2661         (WebCore::ResourceHandle::setClientCertificateInfo):
2662         (WebCore::ResourceHandle::platformSetDefersLoading):
2663         (WebCore::ResourceHandle::didFinish):
2664         (WebCore::ResourceHandle::didFail):
2665         (WebCore::ResourceHandle::shouldUseCredentialStorage):
2666         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2667         (WebCore::ResourceHandle::receivedCredential):
2668         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
2669         (WebCore::ResourceHandle::receivedCancellation):
2670         (WebCore::ResourceHandle::calculateWebTimingInformations):
2671         (WebCore::ResourceHandle::handleLocalReceiveResponse):
2672         (WebCore::ResourceHandle::willPrepareSendData):
2673         (WebCore::ResourceHandle::didReceiveHeaderLine):
2674         (WebCore::ResourceHandle::didReceiveAllHeaders):
2675         (WebCore::ResourceHandle::didReceiveContentData):
2676         (WebCore::ResourceHandle::readCallback):
2677         (WebCore::ResourceHandle::headerCallback):
2678         (WebCore::ResourceHandle::writeCallback):
2679         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2680         (WebCore::ResourceHandle::dispatchSynchronousJob):
2681         (WebCore::calculateWebTimingInformations): Deleted.
2682         (WebCore::handleLocalReceiveResponse): Deleted.
2683         (WebCore::writeCallback): Deleted.
2684         (WebCore::headerCallback): Deleted.
2685         (WebCore::readCallback): Deleted.
2686         (WebCore::setupFormData): Deleted.
2687         (WebCore::ResourceHandle::handleCurlMsg): Deleted.
2688         * platform/network/curl/ResourceHandleManager.cpp: Removed.
2689         * platform/network/curl/ResourceHandleManager.h: Removed.
2690
2691 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
2692
2693         Unreviewed fix to Mac CMake build after r219474.
2694
2695         * PlatformMac.cmake:
2696
2697 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
2698
2699         [cmake] Set library types before their targets are created
2700         https://bugs.webkit.org/show_bug.cgi?id=174600
2701
2702         Reviewed by Michael Catanzaro.
2703
2704         Since r219560 library targets are created before PlatformXXX.cmake
2705         files are processed, however library type must be passed in
2706         add_library() call and cannot be changed afterwards. Set these
2707         variables in OptionsXXX.cmake.
2708
2709         No new tests needed.
2710
2711         * PlatformMac.cmake:
2712
2713 2017-07-17  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2714
2715         Move USE_AVFOUNDATION definition on Windows to wtf/Platform.h
2716         https://bugs.webkit.org/show_bug.cgi?id=174356
2717
2718         Reviewed by Brent Fulgham.
2719
2720         Move the definition of USE_AVFOUNDATION on Windows to wtf/platform.h
2721
2722         Rename WebCoreHeaderDetection.h to AVFoundationHeaderDetection.h
2723
2724         * AVFoundationSupport.py: Moved to Source/WTF/AVFoundationSupport.py.
2725         * DerivedSources.make:
2726         * PlatformWin.cmake:
2727         * config.h:
2728         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2729         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2730
2731 2017-07-17  Sam Weinig  <sam@webkit.org>
2732
2733         [WebIDL] Remove custom bindings that require non-caching JS strings
2734         https://bugs.webkit.org/show_bug.cgi?id=174552
2735
2736         Reviewed by Darin Adler.
2737
2738         Adds two new types, UncachedString and OwnedString (both of which
2739         are simple structs that wrap a String) to communicate to the bindings
2740         layer which function to use when converting to a JS string.
2741
2742         * bindings/IDLTypes.h:
2743         (WebCore::IDLString::isNullValue):
2744         Add overloads of isNullValue for UncachedString and OwnedString.
2745
2746         * bindings/js/JSDOMConvertStrings.h:
2747         (WebCore::JSConverter<IDLDOMString>::convert):
2748         (WebCore::JSConverter<IDLByteString>::convert):
2749         (WebCore::JSConverter<IDLUSVString>::convert):
2750         Add overloads of convert for UncachedString that uses JSC::jsString 
2751         and for OwnedString that uses JSC::jsOwnedString.
2752
2753         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2754         (WebCore::JSHTMLCanvasElement::toDataURL): Deleted.
2755         Remove custom binding for toDataURL.
2756
2757         * bindings/js/JSXMLHttpRequestCustom.cpp:
2758         (WebCore::JSXMLHttpRequest::retrieveResponse):
2759         (WebCore::JSXMLHttpRequest::responseText): Deleted.
2760         Remove custom binding for responseText. Replace the caller of the 
2761         binding function with a simple conversion that will do the same thing.
2762
2763         * bindings/js/StringAdaptors.h: Added.
2764         Add UncachedString and OwnedString adaptors.
2765
2766         * html/HTMLCanvasElement.cpp:
2767         (WebCore::HTMLCanvasElement::toDataURL):
2768         Move quality conversion here, matching toBlob and the spec. Return a UncachedString
2769         to instruct the bindings to use JSC::jsString and not JSC::jsStringWithCache.
2770
2771         (WebCore::HTMLCanvasElement::toBlob):
2772         Use asNumber() rather than toNumber(), since we just checked that it is a number.
2773
2774         * html/HTMLCanvasElement.h:
2775         Update header to account for returning an UncachedString.
2776
2777         * html/HTMLCanvasElement.idl:
2778         Remove [Custom] and make the signature of toDataURL match the spec (and what we have been doing).
2779
2780         * inspector/InspectorCanvasAgent.cpp:
2781         (WebCore::InspectorCanvasAgent::requestContent):
2782         Update to account for UncachedString.
2783
2784         * xml/XMLHttpRequest.cpp:
2785         (WebCore::XMLHttpRequest::responseText):
2786         * xml/XMLHttpRequest.h:
2787         Update responseText to return OwnedString. OwnedString instruct the bindings to 
2788         use JSC::jsOwnedString and not JSC::jsStringWithCache.
2789
2790         * xml/XMLHttpRequest.idl:
2791         Remove [CustomGetter].
2792
2793 2017-07-17  Daniel Bates  <dabates@apple.com>
2794
2795         Cleanup: Use OptionSet to represent marker types
2796         https://bugs.webkit.org/show_bug.cgi?id=174594
2797
2798         Reviewed by Darin Adler.
2799
2800         Remove class DocumentMarker::MarkerTypes that duplicates most of functionality of OptionSet
2801         and use OptionSet directly to represent a set of marker types.
2802
2803         No functionality changed. So, no new tests.
2804
2805         * dom/Document.cpp:
2806         (WebCore::Document::updateLayout):
2807         * dom/DocumentMarker.h:
2808         (WebCore::DocumentMarker::MarkerTypes::MarkerTypes): Deleted.
2809         (WebCore::DocumentMarker::MarkerTypes::contains): Deleted.
2810         (WebCore::DocumentMarker::MarkerTypes::intersects): Deleted.
2811         (WebCore::DocumentMarker::MarkerTypes::operator==): Deleted.
2812         (WebCore::DocumentMarker::MarkerTypes::add): Deleted.
2813         (WebCore::DocumentMarker::MarkerTypes::remove): Deleted.
2814         (WebCore::DocumentMarker::AllMarkers::AllMarkers): Deleted.
2815         * dom/DocumentMarkerController.cpp:
2816         (WebCore::DocumentMarkerController::possiblyHasMarkers):
2817         (WebCore::DocumentMarkerController::detach):
2818         (WebCore::DocumentMarkerController::removeMarkers):
2819         (WebCore::DocumentMarkerController::addMarker):
2820         (WebCore::DocumentMarkerController::copyMarkers):
2821         (WebCore::DocumentMarkerController::markersFor):
2822         (WebCore::DocumentMarkerController::markersInRange):
2823         (WebCore::DocumentMarkerController::removeMarkersFromList):
2824         (WebCore::DocumentMarkerController::repaintMarkers):
2825         (WebCore::DocumentMarkerController::shiftMarkers):
2826         (DocumentMarkerController::setMarkersActive):
2827         (DocumentMarkerController::hasMarkers):
2828         (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
2829         Update code as needed.
2830
2831         * dom/DocumentMarkerController.h:
2832         (WebCore::DocumentMarkerController::hasMarkers):
2833         Update code as needed.
2834
2835         * editing/AlternativeTextController.cpp:
2836         (WebCore::markerTypesForAutocorrection):
2837         (WebCore::markerTypesForReplacement):
2838         (WebCore::markerTypesForAppliedDictationAlternative):
2839         Marked as inline and returns an OptionSet<DocumentMarker::MarkerType>. It is unnecessary to use NeverDestroyed
2840         in these functions as constructing an OptionSet and copying/moving it is very efficient. Such operations are
2841         effectively equivalent to an integral assignment and copy of an integral value, respectively.
2842
2843         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2844         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
2845         (WebCore::AlternativeTextController::markCorrection):
2846         Update code as needed.
2847
2848         * editing/AlternativeTextController.h: While I am here, remove some unnecessary #includes and group
2849         forward declarations of structs.
2850         * editing/CompositeEditCommand.cpp:
2851         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Update code as needed.
2852         * editing/Editor.cpp:
2853         (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto.
2854         * editing/SpellChecker.cpp:
2855         (WebCore::SpellChecker::didCheckSucceed): Ditto.
2856         * page/ios/FrameIOS.mm:
2857         (WebCore::Frame::interpretationsForCurrentRoot): Ditto.
2858         * testing/Internals.cpp:
2859         (WebCore::markerTypesFrom): Ditto.
2860         (WebCore::Internals::markerCountForNode): Ditto.
2861         (WebCore::Internals::markerAt): Ditto.
2862
2863 2017-07-17  Devin Rousso  <drousso@apple.com>
2864
2865         Web Inspector: overlay page highlight doesn't disappear when a page is constantly updating
2866         https://bugs.webkit.org/show_bug.cgi?id=174468
2867
2868         Reviewed by Simon Fraser.
2869
2870         Do not allow the PageOverlay to start another fade animation of the same type if one has
2871         already started. As an example, if the PageOverlay is fading out, startFadeOutAnimation
2872         should just return.
2873
2874         * page/PageOverlay.cpp:
2875         (WebCore::PageOverlay::startFadeInAnimation):
2876         (WebCore::PageOverlay::startFadeOutAnimation):
2877
2878 2017-07-17  Darin Adler  <darin@apple.com>
2879
2880         Improve use of NeverDestroyed
2881         https://bugs.webkit.org/show_bug.cgi?id=174348
2882
2883         Reviewed by Sam Weinig.
2884
2885         * Modules/encryptedmedia/MediaKeySession.cpp: Removed unneeded include of
2886         NeverDestroyed.h.
2887
2888         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
2889         (WebCore::installedCDMFactories): Use makeNeverDestroyed and a lambda rather
2890         than a separate boolean for initialization.
2891
2892         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
2893         (WebCore::clearKeyVM): Removed unneeded use of NeverDestroyed to hold a
2894         RefPtr. Simple to just use leakRef instead.
2895
2896         * Modules/gamepad/GamepadManager.cpp: Added an include of NeverDestroyed.h.
2897
2898         * Modules/indexeddb/IDBTransaction.cpp: Removed unneeded include of
2899         NeverDestroyed.h.
2900         * Modules/indexeddb/server/MemoryObjectStore.cpp: Ditto.
2901
2902         * Modules/mediasession/MediaSessionManager.cpp: Moved include of
2903         NeverDestroyed.h here ...
2904         * Modules/mediasession/MediaSessionManager.h: ... from here.
2905
2906         * Modules/mediasource/MediaSourceRegistry.cpp: Moved include of
2907         NeverDestroyed.h here ...
2908         * Modules/mediasource/MediaSourceRegistry.h: ... from here.
2909
2910         * Modules/mediasource/SourceBuffer.cpp: Removed unneeded include of
2911         NeverDestroyed.h.
2912
2913         * Modules/plugins/QuickTimePluginReplacement.h: Initialize
2914         m_scriptObject in the class definition.
2915
2916         * Modules/plugins/QuickTimePluginReplacement.mm:
2917         (WebCore::QuickTimePluginReplacement::supportsMimeType): Use
2918         makeNeverDestroyed and the HashSet constructor instead of a loop.
2919         (WebCore::QuickTimePluginReplacement::supportsFileExtension): Ditto.
2920         (WebCore::QuickTimePluginReplacement::QuickTimePluginReplacement): Did a
2921         slight cleanup of the initializers.
2922         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement): Added
2923         a FIXME; unclear why there is code here at all.
2924
2925         * accessibility/AccessibilityRenderObject.cpp:
2926         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole): Use
2927         makeNeverDestroyed and the Vector constructor instead of using empty
2928         vector checks and Vector::add. Use std::any_of rather than Vector::contains
2929         since we now are matching against pointers.
2930
2931         * bindings/scripts/CodeGeneratorJS.pm:
2932         (GenerateEnumerationImplementationContent): Use const NeverDestroyed.
2933
2934         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2935         * bindings/scripts/test/JS/JSTestObj.cpp:
2936         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2937         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
2938         Regenerated.
2939
2940         * css/CSSProperty.cpp:
2941         (WebCore::borderDirections): Removed unnecesssary use of NeverDestroyed
2942         for a global object that has a trivial destructor.
2943
2944         * css/ElementRuleCollector.cpp:
2945         (WebCore::leftToRightDeclaration): Removed unneeded use of NeverDestroyed to hold a
2946         Ref. Simple to just use leakRef instead. Also use a lambda instead of an explicit
2947         isEmpty check each time this is called.
2948         (WebCore::rightToLeftDeclaration): Ditto.
2949
2950         * css/makeprop.pl: Removed unneeded include of NeverDestroyed.h and the
2951         uneeded global emptyShorthand. Constructing an empty StylePropertyShorthand
2952         is no less efficient than copying a global empty one was.
2953
2954         * dom/CustomElementReactionQueue.cpp: Added an include of NeverDestroyed.h.
2955
2956         * dom/DOMImplementation.cpp: Removed unneeded include of NeverDestroyed.h.
2957         * dom/InputEvent.cpp: Ditto.
2958
2959         * dom/Microtasks.cpp: Moved include of NeverDestroyed.h here ...
2960         * dom/Microtasks.h: ... from here.
2961
2962         * dom/MutationObserver.cpp: Added an include of NeverDestroyed.h.
2963
2964         * dom/ScopedEventQueue.cpp: Moved include of NeverDestroyed.h here ...
2965         * dom/ScopedEventQueue.h: ... from here. Added Forward.h.
2966
2967         * dom/ScriptElement.cpp:
2968         (WebCore::isLegacySupportedJavaScriptLanguage): Use makeNeverDestroyed
2969         and the HashSet constructor rather than an isEmpty check and a lot of
2970         add function calls. Also removed comments that don't have value any more,
2971         with dubious no longer relevant claims about the behavior of old web browsers.
2972         The function that calls this one already has sufficient comments about why we
2973         hope some day this function can be eliminated.
2974
2975         * dom/SecurityContext.cpp: Removed unneeded include of NeverDestroyed.h.
2976
2977         * dom/make_names.pl:
2978         (printFactoryCppFile): Instead of using a "populate" function, use a function
2979         that creates as HashMap. Then use const auto and makeNeverDestroyed.
2980         (printWrapperFactoryCppFile): Ditto.
2981
2982         * editing/AlternativeTextController.cpp:
2983         (WebCore::markerTypesForAutocorrection): Use makeNeverDestroyed
2984         and the Vector constructor rather than an isEmpty check and a lot of
2985         append function calls.
2986         (WebCore::markerTypesForReplacement): Ditto.
2987         (WebCore::markerTypesForAppliedDictationAlternative): Ditto.
2988
2989         * editing/EditingStyle.cpp:
2990         (WebCore::htmlElementEquivalents): Use const auto, makeNeverDestroyed,
2991         the Vector constructor, and new rather than make_unique. Changed return
2992         type to use const pointers rather than unique_ptr with non-const type.
2993         (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement): Updated
2994         for the above change to htmlElementEquivalents.
2995         (WebCore::htmlAttributeEquivalents): Same approach as above.
2996         (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes): Ditto.
2997         (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): Take
2998         references instead of pointers.
2999         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement): Updated
3000         for the above.
3001
3002         * editing/FormatBlockCommand.cpp:
3003         (WebCore::isElementForFormatBlock): Use const auto, makeNeverDestroyed,
3004         and the HashSet constructor rather than isEmpty and a lot of calls to add.
3005         * editing/RemoveFormatCommand.cpp:
3006         (WebCore::isElementForRemoveFormatCommand): Ditto.
3007
3008         * editing/ReplaceSelectionCommand.cpp:
3009         (WebCore::isProhibitedParagraphChild): Use const auto, makeNeverDestroyed,
3010         and a lambda, rather than isEmpty and a lot of calls to add.
3011
3012         * html/Autofill.cpp:
3013         (WebCore::fieldNameMap): Changed return type to be const. Use const auto,
3014         makeNeverDestroyed, a lambda, and an array of values rather than isEmpty
3015         and a lot of calls to add. Stopped doing the ConstructFromLiteral
3016         optimization here. (Easy to add it back if that is a mistake.)
3017
3018         * html/HTMLObjectElement.cpp:
3019         (WebCore::isRecognizedTagName): Use const auto, makeNeverDestroyed, and
3020         a lambda rather than isEmpty.
3021
3022         * html/HTMLStyleElement.cpp: Added include of NeverDestroyed.h.
3023
3024         * html/HTMLVideoElement.cpp: Removed uneeded include of NeverDestroyed.h.
3025
3026         * html/InputType.cpp:
3027         (WebCore::createInputTypeFactoryMap): Replaced the populate function
3028         with this create function.
3029         (WebCore::InputType::create): Use const auto and makeNeverDestroyed
3030         istead of isEmpty. Also put the map right where it is used so it's
3031         not initialized in code path where not needed.
3032
3033         * html/parser/HTMLParserIdioms.cpp: Removed uneeded include of
3034         NeverDestroyed.h.
3035
3036         * inspector/InspectorApplicationCacheAgent.cpp:
3037         (WebCore::InspectorApplicationCacheAgent::networkStateChanged):
3038         Merged into a single line.
3039
3040         * loader/ContentFilter.cpp:
3041         (WebCore::blockedPageURL): Use const auto and makeNeverDestroyed
3042         rather than std::call_once. Since this is a URL and has a non-thread-safe
3043         reference count, this was not thread safe before, so no need to use the
3044         more roundabout and less efficient idiom for its thread safety.
3045
3046         * loader/CrossOriginAccessControl.cpp:
3047         (WebCore::isOnAccessControlResponseHeaderWhitelist): Deleted.
3048         * loader/CrossOriginAccessControl.h: Deleted unused function
3049         isOnAccessControlResponseHeaderWhitelist.
3050
3051         * loader/EmptyClients.cpp: Use leakRef instead of NeverDestroyed<Ref>.
3052
3053         * loader/appcache/ApplicationCacheStorage.cpp: Removed unneeded include of
3054         NeverDestroyed.h.
3055         * page/CaptionUserPreferences.cpp: Ditto.
3056
3057         * page/DebugPageOverlays.cpp:
3058         (WebCore::touchEventRegionColors): Changed the return type to const, since
3059         the callers do not modify the map. Use const auto, makeNeverDestroyed, and
3060         a lambda rather than isEmpty and repeated calls to add.
3061
3062         * page/MainFrame.cpp: Removed unneeded include of NeverDestroyed.h.
3063
3064         * page/MemoryRelease.cpp:
3065         (WebCore::releaseMemory): Use a function directly instead of calling it
3066         inside a lambda.
3067
3068         * page/NavigatorBase.cpp:
3069         (WebCore::NavigatorBase::onLine): Updated to call
3070         NetworkStateNotifier::singleton.
3071
3072         * page/Page.cpp:
3073         (WebCore::allPages): Made this a function instead of a global to use the
3074         normal idiom for such globals.
3075         (WebCore::Page::forEachPage): Updated for change to allPages.
3076         (WebCore::networkStateChanged): Ditto. Also removed a bit of unnecessary
3077         churn by using const AtomicString& instead of AtomicString.
3078         (WebCore::Page::Page): Moved initialization of most data members to the
3079         class definition. Removed initialiation of allPages. Updated the use of
3080         NetworkStateNotifier for its new slightly changed  interface.
3081         (WebCore::Page::~Page): Updated for change to allPages.
3082         (WebCore::Page::clearPreviousItemFromAllPages): Ditto.
3083         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment): Ditto.
3084         (WebCore::Page::refreshPlugins): Ditto.
3085
3086         * page/Page.h: Moved initialization of most data members here.
3087
3088         * page/PerformanceUserTiming.cpp: Removed many unneded includes.
3089         (WebCore::restrictedMarkFunction): Use const auto, makeNeverDestroyed, and
3090         a lambda instead of isEmpty. Also use an array rather than std::array and
3091         got rid fo the unneeded use of anonymous namespace since this is fine in
3092         the top level WebCore namespace.
3093         (WebCore::clearPerformanceEntries): Tweaked coding style.
3094         (WebCore::UserTiming::mark): Ditto.
3095         (WebCore::UserTiming::findExistingMarkStartTime): Got rid of double hash
3096         table lookup by using find instead of using contains followed by get.
3097         removed unneeded explicit cast to double. Tweaked coding style.
3098         (WebCore::convertToEntrySequence): Tweaked coding style.
3099         (WebCore::getEntrySequenceByName): Deleted.
3100         (WebCore::UserTiming::getMarks): Call get directly instead of getEntrySequenceByName.
3101         (WebCore::UserTiming::getMeasures): Ditto.
3102
3103         * page/RuntimeEnabledFeatures.cpp: Moved include of NeverDestroyed.h here ...
3104         * page/RuntimeEnabledFeatures.h: ... from here. Added Forward.h and Noncopyable.h.
3105
3106         * platform/LocalizedStrings.cpp: Removed unneeded include of NeverDestroyed.h.
3107
3108         * platform/MIMETypeRegistry.cpp:
3109         (WebCore::initializeSupportedImageMIMETypes): Added a missing const for a global
3110         constant array.
3111         (WebCore::initializeSupportedJavaScriptMIMETypes): Ditto.
3112         (WebCore::initializeSupportedNonImageMimeTypes): Ditto.
3113         (WebCore::typesForCommonExtension): Replaced the old mediaMIMETypeMap function
3114         with this one. Moved the common media types array here since it's only used here.
3115         Use const auto, makeNeverDestroyed, and a lambda instead of using an isEmpty check.
3116         Iterate the array using a mdoern for loop. Use HashMap::ensure to avoid the
3117         double hashing that the old code was doing. And moved the code to find an entry
3118         in the map in here from the client functions.
3119         (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): Updated to use the
3120         typesForCommonExtension, and changed logic to use this first, and only call
3121         getMIMETypeForExtension for extensions not in the map. This gives the same
3122         result but should be slightly more efficient.
3123         (WebCore::MIMETypeRegistry::getMediaMIMETypesForExtension): Updated to use the
3124         typesForCommonExtension function. Comment about strategy is now in there.
3125         (WebCore::initializeUnsupportedTextMIMETypes): Added a missing const for a global
3126         constant array. Also started using ASCIILiteral.
3127
3128         * platform/MainThreadSharedTimer.cpp: Moved include of NeverDestroyed.h here ...
3129         * platform/MainThreadSharedTimer.h: ... from here. Added Forward.h.
3130
3131         * platform/SchemeRegistry.cpp:
3132         (WebCore::add): Added helper functions to keep code below simpler.
3133         (WebCore::makeNeverDestroyedSchemeSet): Ditto.
3134         (WebCore::allBuiltinSchemes): Use const auto, makeNeverDestroyed, a lambda,
3135         and the helper functions above, rather than isEmpty.
3136         (WebCore::builtinLocalURLSchemes): Use const auto, makeNeverDestroyed, and
3137         the HashSet constructor instead of isEmpty and add calls. Also changed the
3138         return type to be const.
3139         (WebCore::localURLSchemes): Copy the map using assignment instead of an
3140         isEmpty function and a loop with calls to add.
3141         (WebCore::builtinSecureSchemes): Use const auto, makeNeverDestroyed, and
3142         the Vector constructor rather than isEmpty, repeated calls to append,
3143         and shrinkToFit.
3144         (WebCore::secureSchemes): Use auto and makeNeverDestroyedSchemeSet rather
3145         than isEmpty and repeated calls to add.
3146         (WebCore::builtinSchemesWithUniqueOrigins): More of the same.
3147         (WebCore::schemesWithUniqueOrigins): Ditto.
3148         (WebCore::builtinEmptyDocumentSchemes): Ditto.
3149         (WebCore::emptyDocumentSchemes): Ditto.
3150         (WebCore::schemesForbiddenFromDomainRelaxation): Ditto.
3151         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes): Ditto.
3152         (WebCore::canDisplayOnlyIfCanRequestSchemes): Ditto.
3153         (WebCore::builtinCORSEnabledSchemes): Ditto.
3154         (WebCore::CORSEnabledSchemes): Ditto.
3155         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): Replaced check for
3156         empty string with check for null string, since that's slightly more efficient
3157         for non-null, non-empty strings, and the hash table can handle empty strings
3158         just fine.
3159         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): Added null check here.
3160         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): Ditto.
3161         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated): Ditto.
3162         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): Ditto.
3163         (WebCore::SchemeRegistry::registerURLSchemeAsSecure): Ditto.
3164         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): Ditto.
3165         (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): Ditto.
3166         (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): Ditto.
3167         (WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme): Ditto.
3168         (WebCore::SchemeRegistry::isDomainRelaxationForbiddenForURLScheme): Ditto.
3169         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest): Ditto.
3170         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): Ditto.
3171         (WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs): Ditto.
3172         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs): Ditto.
3173         (WebCore::SchemeRegistry::registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing): Ditto.
3174         (WebCore::SchemeRegistry::allowsLocalStorageAccessInPrivateBrowsing): Ditto.
3175         (WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing): Ditto.
3176         (WebCore::SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing): Ditto.
3177         (WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled): Ditto.
3178         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): Ditto.
3179         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): Ditto.
3180         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): Ditto.
3181         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy): Ditto.
3182         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated): Ditto.
3183         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme): Ditto.
3184         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): Ditto.
3185         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): Ditto.
3186         (WebCore::SchemeRegistry::isUserExtensionScheme): Tweaked #if a bit.
3187         (WebCore::SchemeRegistry::isBuiltinScheme): Added null check.
3188
3189         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
3190         (WebVideoFullscreenModelVideoElement::observedEventNames): Use const auto,
3191         makeNeverDestroyed, and the Vector constructor rather than a call to size
3192         and then append eacn time this funciton is called.
3193
3194         * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Moved include of
3195         NeverDestroyed.h from here ...
3196         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: ... to here.
3197
3198         * platform/gamepad/mac/HIDGamepadProvider.cpp: Moved include of
3199         NeverDestroyed.h here ...
3200         * platform/gamepad/mac/HIDGamepadProvider.h: ... from here.
3201
3202         * platform/graphics/FontCascade.cpp:
3203         (WebCore::FontCascade::hasValidAverageCharWidth): Use const auto,
3204         makeNeverDestroyed, and the HashSet constructor.
3205
3206         * platform/graphics/ImageBuffer.cpp:
3207         (WebCore::ImageBuffer::transformColorSpace): Removed unneeded use of
3208         NeverDestroyed<Vector<int>> here, instead using const std::array.
3209
3210         * platform/graphics/ImageBuffer.h: Changed platformTransformColorSpace to take
3211         const std::array<uint8_t, 256>& instead of const Vector<int>&, since the whole
3212         pointer of the argument is that it's a table to map bytes onto other bytes.
3213
3214         * platform/graphics/MediaPlaybackTarget.h: Removed unneeded include of
3215         NeverDestroyed.h, unneeded unused noMediaPlaybackTargetContext function,
3216         and unneeded include of MediaPlaybackTargetContext.h, forward declaring instead.
3217         Made most functions in this class pure virtual instead of having default
3218         implementations.
3219
3220         * platform/graphics/avfoundation/MediaPlaybackTargetMac.h: Added include
3221         of MediaPlaybackTargetContext.h now that it was removed above.
3222
3223         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3224         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList): Use const auto,
3225         makeNeverDestroyed, and the HashSet constructor.
3226
3227         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3228         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Reversed the sense
3229         of the boolean logic here to make this simpler and easier to read.
3230         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes): Changed
3231         the implementation here, which empties out the passed in hash set, to use
3232         the clear function rather than assignment from a global empty hash set. Added
3233         a FIXME because it seems peculiar that this would be considered OK.
3234         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType): Used ? : to make
3235         this a little more terse; I think it's clearer.
3236
3237         * platform/graphics/cairo/ImageBufferCairo.cpp:
3238         (WebCore::ImageBuffer::platformTransformColorSpace): Updated for change to
3239         argument type.
3240
3241         * platform/graphics/cg/ImageDecoderCG.cpp: Removed unneeded include of
3242         NeverDestroyed.h.
3243         (WebCore::appendImageSourceOption): Streamlined code using auto with
3244         adoptCF; there is no need to write out the type of the RetainPtr.
3245         (WebCore::imageSourceOptions): Instead of NeverDestroyed<RetainPtr>, just use
3246         const auto and leakRef.
3247         (WebCore::imageSourceAsyncOptions): Ditto.
3248
3249         * platform/graphics/gtk/GdkCairoUtilities.cpp:
3250         (WebCore::getDefaultCairoFontOptions): Instead of using LazyNeverDestroyed
3251         on a pointer, just use a global pointer. There is no need to use any kind
3252         of NeverDestroyed on a type with a trivial destructor such as a pointer.
3253
3254         * platform/graphics/ios/FontCacheIOS.mm:
3255         (WebCore::platformFontWithFamilySpecialCase): Instead of using
3256         NeverDestroyed<RetainPtr> just use a raw pointer global.
3257         * platform/graphics/mac/FontCacheMac.mm:
3258         (WebCore::platformFontWithFamilySpecialCase): Ditto.
3259
3260         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3261         (WebCore::createFileTypesSet): Return the HashSet instead of adding to it.
3262         Use Objective-C for/in syntax for an NSArray, not C++ for syntax, although
3263         it seems the C++ syntax was working fine.
3264         (WebCore::mimeCommonTypesCache): Fixed return type so we won't copy the
3265         HashMap every time this function is called. Use const auto and makeNeverDestroyed
3266         instead of using a boolean to do one time initialization.
3267         (WebCore::mimeModernTypesCache): Ditto.
3268         (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Marked a
3269         constant array const.
3270
3271         * platform/ios/Device.cpp:
3272         (WebCore::deviceClass): Use a lambda to initialize a variable here instead
3273         of using std::call_once. This function does not need to be thread safe.
3274         (WebCore::deviceName): Use const NeverDestroyed instead of LazyNeverDestroyed
3275         and std::call_once. This function does not need to be thread safe.
3276
3277         * platform/ios/DragImageIOS.mm: Make defaultLinkIndicatorOptions be a
3278         constant instead of a variable.
3279         (WebCore::cascadeForSystemFont): Added helper function.
3280         (WebCore::createDragImageForLink): Use const auto and makeNeverDestroyed
3281         instead of LazyNeverDestroyed and dispatch_once. This code does not need
3282         to be thread safe since its arguments include, for example, a DOM element.
3283
3284         * platform/ios/LegacyTileLayerPool.h: Removed unneeded include of
3285         NeverDestroyed.h.
3286
3287         * platform/ios/QuickLook.mm:
3288         (WebCore::QLPreviewGetSupportedMIMETypesSet): Use a global raw pointer
3289         instead of NeverDestroyed<RetainPtr<NSSet>>.
3290         (WebCore::createQLPreviewProtocol): Deleted.
3291         (WebCore::QLPreviewProtocol): Use a global raw pointer instead of
3292         a NeverDestroyed<Vector<char>>. It's cleaner to use fastStrdup instead
3293         of appending to an array, and less wasteful of memory too.
3294
3295         * platform/ios/WebCoreMotionManager.mm: Removed unneeded include of
3296         NeverDestroyed.h.
3297         * platform/ios/WebSQLiteDatabaseTrackerClient.h: Ditto.
3298         * platform/mac/DragImageMac.mm: Ditto.
3299         * platform/mediastream/CaptureDeviceManager.cpp: Ditto.
3300         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: Ditto.
3301
3302         * platform/mock/MockRealtimeMediaSource.cpp:
3303         (WebCore::MockRealtimeMediaSource::audioDevices): Use auto,
3304         makeNeverDestroyed, and a lambda instead of checking size each time.
3305         (WebCore::MockRealtimeMediaSource::videoDevices): Ditto.
3306
3307         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3308         (WebCore::mimeTypeCache): Use const auto, makeNeverDestroyed, and the
3309         HashSet constructor instead of an explicit boolean to initialize.
3310
3311         * platform/network/BlobRegistryImpl.cpp:
3312         (WebCore::blobUtilityQueue): Use a global with a raw reference instead
3313         of a NeverDestroyed<Ref>.
3314
3315         * platform/network/NetworkStateNotifier.cpp:
3316         (WebCore::NetworkStateNotifier::singleton): Renamed this from
3317         networkStateNotifier. We must have missed this when we changed to use the
3318         singleton idiom consistently. Also changed to use normal NeverDestroyed
3319         rather than using LazyNeverDestroyed and call_once, because this is not
3320         used from multiple threads and has no special thread safety requirements.
3321         (WebCore::NetworkStateNotifier::NetworkStateNotifier): Moved the constructor
3322         here and construct the timer. Before the timer was used only on the Mac
3323         platform but now it is there for all platforms.
3324         (WebCore::NetworkStateNotifier::onLine): Moved function here from the header.
3325         It's a littlel less trivial than before because it now triggers a call to
3326         updateState as needed.
3327         (WebCore::NetworkStateNotifier::addListener): Renamed from
3328         addNetworkStateChangeListener since there is only one kind of listener and
3329         the old name was too wordy. Changed to call the new startObserving function,
3330         and guaranteed to call it onlh once. The platform-specific logic for iOS is
3331         now inside the iOS version of that function instead of here.
3332         (WebCore::NetworkStateNotifier::updateState): Moved here now that it is the
3333         same for all platforms. The actual state updating is done in a function named
3334         updateStateWithoutNotifying, which is implemented for each platform.
3335         (WebCore::NetworkStateNotifier::updateStateSoon): New function which takes
3336         advantage of the timer to coalesce network state updates.
3337         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): Empty stub
3338         version of this function.
3339         (WebCore::NetworkStateNotifier::startObserving): Ditto.
3340         (WebCore::NetworkStateNotifier::notifyNetworkStateChange): Deleted. Code from
3341         this has moved into updateState.
3342
3343         * platform/network/NetworkStateNotifier.h: Greatly cut down what part of this
3344         class is platform-specific.
3345
3346         * platform/network/ios/NetworkStateNotifierIOS.mm:
3347         (-[WebNetworkStateObserver initWithBlock:]): Simplified this class so it
3348         takes a block, rather than using a pointer to the C++ notifier and doing
3349         WebThreadRun.
3350         (-[WebNetworkStateObserver dealloc]): Ditto.
3351         (-[WebNetworkStateObserver networkStateChanged:]): Ditto.
3352         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
3353         This now calls isNetworkReachable.
3354         (WebCore::NetworkStateNotifier::startObserving): Check the
3355         Settings::shouldOptOutOfNetworkStateObservation function, and if it's OK
3356         to observe, then create the observer. This code now takes care of the
3357         WebThreadRun and calls updateStateSoon.
3358         (WebCore::NetworkStateNotifier::NetworkStateNotifier): Deleted. The
3359         constructor is now platform independent.
3360         (WebCore::NetworkStateNotifier::~NetworkStateNotifier): Deleted. This
3361         object is never destroyed so we should not write a destructor for it.
3362         (WebCore::NetworkStateNotifier::registerObserverIfNecessary): Deleted.
3363         Replaced by startObserving.
3364         (WebCore::NetworkStateNotifier::onLine): Deleted. This function is now
3365         platform-independent.
3366         (WebCore::setOnLine): Deleted. The logic from this is now in
3367         updateState and updateStateWithoutNotifying.
3368
3369         * platform/network/mac/NetworkStateNotifierMac.cpp:
3370         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): Renamed
3371         this from updateState and tightened up the code a bit. Also changed
3372         to not assume anything. If there is an error, we leave m_isOnLine alone.
3373         Default behavior is now in the platform-independent code, and the default
3374         is to treat things as on-line if updateStateWithoutNotifying was called
3375         and it was never able to update the state even once.
3376         (WebCore::NetworkStateNotifier::startObserving): Moved most of the code