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