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