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