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