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