3a90565161ee27c300336d768ed95d4716ee4302
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-08-01  Joseph Pecoraro  <pecoraro@apple.com>
2
3         CFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRepresentations
4         https://bugs.webkit.org/show_bug.cgi?id=175064
5
6         Reviewed by Tim Horton.
7
8         * platform/ios/PlatformPasteboardIOS.mm:
9         (WebCore::PlatformPasteboard::writeObjectRepresentations):
10         Adopt a created string into the RetainPtr.
11
12         * platform/ios/WebItemProviderPasteboard.h:
13         * platform/ios/WebItemProviderPasteboard.mm:
14         (-[WebItemProviderRegistrationInfoList dealloc]):
15         Release suggestedName and switch from -strong to -copy.
16
17 2017-08-01  Chris Dumez  <cdumez@apple.com>
18
19         Unreviewed, update Beacon API status to "In Development".
20
21         * features.json:
22
23 2017-08-01  Chris Dumez  <cdumez@apple.com>
24
25         Add initial support for navigator.sendBeacon
26         https://bugs.webkit.org/show_bug.cgi?id=175007
27         <rdar://problem/33547728>
28
29         Reviewed by Sam Weinig.
30
31         Add initial support for navigator.sendBeacon behind an experimental
32         feature runtime flag. The specification is available at:
33         - https://w3c.github.io/beacon/
34
35         The current implementation supports sending beacons with all types of
36         payloads except for ReadableStream. Some functionality is incomplete
37         and will be taken care of in follow-up patches:
38         - Support for CORS preflight for the cases where it is required. We currently
39           return false and do not send the beacon in such cases.
40         - Better support for redirects.
41         - Use a more power-friendly network priority for beacon requests.
42
43         Tests: http/tests/blink/sendbeacon/*
44                http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html
45                http/wpt/beacon/*
46                imported/blink/fast/beacon/*
47                imported/w3c/web-platform-tests/beacon/*
48
49         * CMakeLists.txt:
50         * DerivedSources.make:
51         * Modules/beacon/NavigatorBeacon.cpp: Added.
52         (WebCore::NavigatorBeacon::sendBeacon):
53         * Modules/beacon/NavigatorBeacon.h: Added.
54         * Modules/beacon/NavigatorBeacon.idl: Added.
55         * WebCore.xcodeproj/project.pbxproj:
56         * loader/PingLoader.cpp:
57         (WebCore::PingLoader::sendBeacon):
58         * loader/PingLoader.h:
59
60 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
61
62         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
63         https://bugs.webkit.org/show_bug.cgi?id=174727
64
65         Reviewed by Mark Lam.
66
67         No new tests because no change in behavior.
68         
69         Needed to teach Metal how to allocate in the Gigacage.
70
71         * platform/graphics/cocoa/GPUBufferMetal.mm:
72         (WebCore::GPUBuffer::GPUBuffer):
73         (WebCore::GPUBuffer::contents):
74
75 2017-08-01  Fujii Hironori  <Hironori.Fujii@sony.com>
76
77         [WinCairo] Implement Font::platformBoundsForGlyph
78         https://bugs.webkit.org/show_bug.cgi?id=174813
79
80         Reviewed by Alex Christensen.
81
82         Test: fast/text/emphasis.html
83
84         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
85         (WebCore::Font::platformBoundsForGlyph): Implemented by copying
86         the code from Font::boundsForGDIGlyph().
87
88 2017-08-01  Zalan Bujtas  <zalan@apple.com>
89
90         REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles
91         https://bugs.webkit.org/show_bug.cgi?id=175009
92         <rdar://problem/33505791>
93
94         Reviewed by Simon Fraser.
95
96         This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes.
97         Some websites don't expect the iframes to be expanded to the size of the content and when the media query
98         callback mutates the content (triggering frame resize), they might end up getting into a never ending layout.
99
100         Test: fast/frames/flattening/media-query-growing-content.html
101
102         * css/MediaQueryEvaluator.cpp:
103         (WebCore::orientationEvaluate):
104         (WebCore::aspectRatioEvaluate):
105         (WebCore::heightEvaluate):
106         (WebCore::widthEvaluate):
107         * page/FrameView.cpp:
108         (WebCore::FrameView::layout):
109         (WebCore::FrameView::layoutSizeForMediaQuery const):
110         (WebCore::FrameView::evaluateMediaQueryList):
111         * page/FrameView.h:
112
113 2017-07-26  Jiewen Tan  <jiewen_tan@apple.com>
114
115         Add tests to detect mistakes in backward compatibility when the structured clone algorithm is changed in the future
116         https://bugs.webkit.org/show_bug.cgi?id=173998
117
118         Reviewed by Darin Adler.
119
120         * bindings/js/SerializedScriptValue.cpp:
121         Add a comment.
122
123 2017-08-01  Matt Lewis  <jlewis3@apple.com>
124
125         Unreviewed, rolling out r220089.
126
127         This caused multiple crashes on macOS Debug testers.
128
129         Reverted changeset:
130
131         "Use LazyNeverDestroyed instead of DEFINE_GLOBAL for
132         QualifiedName"
133         https://bugs.webkit.org/show_bug.cgi?id=175010
134         http://trac.webkit.org/changeset/220089
135
136 2017-08-01  Sam Weinig  <sam@webkit.org>
137
138         [WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
139         https://bugs.webkit.org/show_bug.cgi?id=175006
140
141         Reviewed by Chris Dumez.
142
143         Use the standard way of augmenting GC, visitAdditionalChildren, rather
144         than using a private name to create ownership.
145
146         * bindings/js/JSHTMLTemplateElementCustom.cpp:
147         (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
148         (WebCore::JSHTMLTemplateElement::content const): Deleted.
149         * html/HTMLTemplateElement.idl:
150
151 2017-08-01  Zan Dobersek  <zdobersek@igalia.com>
152
153         [GCrypt] Gather crypto constants in a single location
154         https://bugs.webkit.org/show_bug.cgi?id=174091
155
156         Reviewed by Jiewen Tan.
157
158         Gather common constants used across the libgcrypt-specific Web Crypto
159         implementations in a single place -- in the GCryptUtilities.h header,
160         inside the CryptoConstants namespace. The various ASN.1 object identifiers
161         and other helper values are placed inside, in the std::array<uint8_t, N>
162         container.
163
164         Additionally, CryptoConstants::matches() helper function is provided. It
165         compares the provided data-and-size pair with the given std::array
166         container and returns true if the std::memcmp() call returns 0.
167
168         Changes in CryptoKeyEC and CryptoKeyRSA consist mostly of switching to the
169         use of CryptoConstants::matches() and the CryptoConstants data arrays, as
170         well as some whitespace cleanup.
171
172         Additionallity in CryptoKeyEC, the helper functions covering various curve
173         attributes are reordered, renamed and reorganized for simplicity.
174
175         No new tests -- no changes in behavior.
176
177         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
178         (WebCore::curveIdentifier):
179         (WebCore::curveSize):
180         (WebCore::curveUncompressedFieldElementSize):
181         (WebCore::curveUncompressedPointSize):
182         (WebCore::CryptoKeyEC::platformImportRaw):
183         (WebCore::CryptoKeyEC::platformImportJWKPublic):
184         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
185         (WebCore::supportedAlgorithmIdentifier):
186         (WebCore::curveForIdentifier):
187         (WebCore::CryptoKeyEC::platformImportSpki):
188         (WebCore::CryptoKeyEC::platformExportRaw):
189         (WebCore::CryptoKeyEC::platformAddFieldElements):
190         (WebCore::CryptoKeyEC::platformExportSpki):
191         (WebCore::CryptoKeyEC::platformExportPkcs8):
192         (WebCore::uncompressedPointSizeForCurve): Deleted.
193         (WebCore::uncompressedFieldElementSizeForCurve): Deleted.
194         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
195         (WebCore::supportedAlgorithmIdentifier):
196         (WebCore::CryptoKeyRSA::importPkcs8):
197         (WebCore::CryptoKeyRSA::exportSpki):
198         (WebCore::CryptoKeyRSA::exportPkcs8):
199         * crypto/gcrypt/GCryptUtilities.h:
200         (WebCore::CryptoConstants::matches):
201
202 2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>
203
204         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames
205         https://bugs.webkit.org/show_bug.cgi?id=175008
206
207         Reviewed by Alex Christensen.
208
209         No new tests because no behavior change.
210
211         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
212
213         * css/MediaFeatureNames.cpp:
214         (WebCore::MediaFeatureNames::init): Do not include
215         <wtf/StaticConstructors.h>. Use LazyNeverDestroyed instead of
216         DEFINE_GLOBAL. Call LazyNeverDestroyed::construct instead of
217         placement new.
218         * css/MediaFeatureNames.h: Use LazyNeverDestroyed.
219         * css/MediaQueryEvaluator.cpp:
220         (WebCore::MediaQueryEvaluator::evaluate const): Dereference with ->.
221
222 2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>
223
224         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
225         https://bugs.webkit.org/show_bug.cgi?id=175010
226
227         Reviewed by Alex Christensen.
228
229         No new tests because no behavior change.
230
231         Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
232
233         * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
234         * dom/QualifiedName.cpp:
235         (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
236         instead of placement new.
237         * dom/QualifiedName.h: Use LazyNeverDestroyed.
238
239 2017-07-31  Matt Rajca  <mrajca@apple.com>
240
241         Support quirk for letting media autoplay if the user interacted with at least one media element.
242         https://bugs.webkit.org/show_bug.cgi?id=175005
243         <rdar://problem/33476038>
244
245         Reviewed by Eric Carlson.
246
247         If the user has interacted with at least one media element, let other media elements auto-play
248         as a quirk.
249
250         * dom/Document.cpp:
251         (WebCore::Document::updateIsPlayingMedia):
252         * dom/Document.h:
253         (WebCore::Document::noteUserInteractionWithMediaElement):
254         * html/HTMLMediaElement.cpp:
255         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
256         * html/MediaElementSession.cpp:
257         (WebCore::needsDocumentLevelMediaUserGestureQuirk):
258         (WebCore::MediaElementSession::playbackPermitted const):
259         * page/MediaProducer.h:
260
261 2017-07-31  Nan Wang  <n_wang@apple.com>
262
263         AX: CFEqual is failing on text markers with exact same data
264         https://bugs.webkit.org/show_bug.cgi?id=175002
265         <rdar://problem/33636985>
266
267         Reviewed by Chris Fleizach.
268
269         We should zero the memory of the TextMarkerData instance so that it
270         can be tested for byte-equivalence.
271
272         Made sure this change won't break any of the existing tests.
273
274         * accessibility/AXObjectCache.cpp:
275         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
276         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
277
278 2017-07-28  Matt Rajca  <mrajca@apple.com>
279
280         Propagate user gesture tokens when script elements are loaded.
281         https://bugs.webkit.org/show_bug.cgi?id=174959
282
283         Reviewed by Eric Carlson.
284
285         Propagate user gesture tokens when script elements are loaded (i.e. between the time an
286         element is created and its onload handler is invoked).
287
288         * dom/ScriptElement.cpp:
289         (WebCore::ScriptElement::ScriptElement):
290         (WebCore::ScriptElement::dispatchLoadEventRespectingUserGestureIndicator):
291         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
292         (WebCore::ScriptElement::executePendingScript):
293         * dom/ScriptElement.h:
294
295 2017-07-31  Matt Lewis  <jlewis3@apple.com>
296
297         Unreviewed, rolling out r220048.
298
299         This revision caused multiple crashes in fast/images. See
300         webkit.org/b/174990
301
302         Reverted changeset:
303
304         "RenderImageResourceStyleImage::image() should return the
305         nullImage() if the image is not available"
306         https://bugs.webkit.org/show_bug.cgi?id=174874
307         http://trac.webkit.org/changeset/220048
308
309 2017-07-31  Sam Weinig  <sam@webkit.org>
310
311         Remove unnecessary exceptions from storage code
312         https://bugs.webkit.org/show_bug.cgi?id=174572
313
314         Reviewed by Chris Dumez.
315
316         Remove checks for canAccessStorage() and the exceptions they would cause.
317         These were used for Storage in ephemeral sessions, but they are now supported.
318         Add checks for a null frame to functions that can mutate the storage, as the
319         frame is needed for that, and it retains our existing behavior for disconnected
320         frames. By removing these checks / exceptions, we can fully generate Storage.idl.
321
322         * CMakeLists.txt:
323         * WebCore.xcodeproj/project.pbxproj:
324         * bindings/js/JSBindingsAllInOne.cpp:
325         * bindings/js/JSStorageCustom.cpp: Removed.
326         Remove JSStorageCustom.cpp
327
328         * loader/EmptyClients.cpp:
329         * page/DOMWindow.cpp:
330         (WebCore::DOMWindow::sessionStorage):
331         (WebCore::DOMWindow::localStorage):
332         * storage/StorageArea.h:
333         Remove canAccessStorage.
334
335         * storage/Storage.cpp:
336         (WebCore::Storage::length):
337         (WebCore::Storage::key):
338         (WebCore::Storage::getItem):
339         (WebCore::Storage::setItem):
340         (WebCore::Storage::removeItem):
341         (WebCore::Storage::clear):
342         (WebCore::Storage::contains):
343         (WebCore::Storage::isSupportedPropertyName):
344         (WebCore::Storage::supportedPropertyNames):
345         * storage/Storage.h:
346         * storage/Storage.idl:
347         Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames
348         to allow the removal of the [CustomGetOwnPropertyNames].
349
350 2017-07-31  Matt Lewis  <jlewis3@apple.com>
351
352         Unreviewed, rolling out r220060.
353
354         This broke our internal builds. Contact reviewer of patch for
355         more information.
356
357         Reverted changeset:
358
359         "Merge WTFThreadData to Thread::current"
360         https://bugs.webkit.org/show_bug.cgi?id=174716
361         http://trac.webkit.org/changeset/220060
362
363 2017-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
364
365         Merge WTFThreadData to Thread::current
366         https://bugs.webkit.org/show_bug.cgi?id=174716
367
368         Reviewed by Sam Weinig.
369
370         Use Thread::current() instead.
371
372         * fileapi/AsyncFileStream.cpp:
373         * platform/ThreadGlobalData.cpp:
374         (WebCore::ThreadGlobalData::ThreadGlobalData):
375         * platform/graphics/cocoa/WebCoreDecompressionSession.h:
376         * platform/ios/wak/WebCoreThread.mm:
377         (StartWebThread):
378         * workers/WorkerThread.cpp:
379         (WebCore::WorkerThread::workerThread):
380
381 2017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
382
383         Created a bool pretty printer at WTF for debugging purposes
384         https://bugs.webkit.org/show_bug.cgi?id=174893
385
386         Reviewed by Darin Adler.
387
388         Use WTF::boolPrettyPrinter in debugging messages.
389
390         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
391         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
392         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
393         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
394
395 2017-07-30  Zan Dobersek  <zdobersek@igalia.com>
396
397         Unreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0,
398         explicitly initializing the RefCounted<> base class in the
399         FetchHeaders(const FetchHeaders&) constructor.
400
401         Note that while that's the signature of the copy constructor for the FetchHeaders
402         class, the base RefCounted<> class is not copyable, so the default RefCounted<>
403         constructor is used, but the FetchHeaders resources are normally copied into the
404         new object from the one that's passed in.
405
406         * Modules/fetch/FetchHeaders.h:
407         (WebCore::FetchHeaders::FetchHeaders):
408
409 2017-07-30  Darin Adler  <darin@apple.com>
410
411         Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
412         https://bugs.webkit.org/show_bug.cgi?id=130653
413
414         Reviewed by Antti Koivisto.
415
416         Also fixes a bug where load events are delivered prematurely in some cases
417         when an object, embed, frame, or iframe element is still loading.
418
419         * dom/Document.cpp:
420         (WebCore::Document::loadEventDelayTimerFired): Added a call to
421         FrameLoader::checkLoadComplete. Goes along with the change to
422         FrameLoader::checkLoadCompleteForThisFrame, which now respects the
423         isDelayingLoadEvent flag.
424
425         * html/HTMLAppletElement.cpp:
426         (WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument,
427         no longer needed by the base class.
428         (WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of
429         the process of creating any object in a class derived from HTMLPlugInImageElement.
430         (WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
431         is only called when it's becoming false; avoids a false/true/false round trip that can
432         cause trouble.
433         * html/HTMLAppletElement.h: Updated for the above.
434
435         * html/HTMLEmbedElement.cpp:
436         (WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument,
437         no longer needed by the base class.
438         (WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of
439         the process of creating any object in a class derived from HTMLPlugInImageElement.
440         (WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call
441         updateImageLoaderWithNewURLSoon to do the image loading logic.
442         (WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
443         is only called when it's becoming false; avoids a false/true/false round trip that can
444         cause trouble.
445         * html/HTMLEmbedElement.h: Updated for the above.
446
447         * html/HTMLMediaElement.cpp:
448         (WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when
449         transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata
450         event in the past. This matches what the HTML specification calls for, but only if you
451         read it carefully. Without this change, and with the more complete implementation of
452         load event delay below, one of the regression tests hangs because are permanently stuck
453         dealying load events. Also added a FIXME about other code that likely has a similar
454         problem; the symptom is likely to be subtle and minor, though.
455
456         * html/HTMLObjectElement.cpp:
457         (WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument,
458         no longer needed by the base class.
459         (WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of
460         the process of creating any object in a class derived from HTMLPlugInImageElement.
461         (WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use
462         updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution
463         since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient.
464         (WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
465         is only called when it's becoming false; avoids a false/true/false round trip that can
466         cause trouble.
467         (WebCore::HTMLObjectElement::childrenChanged): Added calls to the new
468         scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
469         (WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to
470         updateStyleIfNeeded. This is the main change that the title of this bug refers to.
471         * html/HTMLObjectElement.h: Updated for the above. Also removed the
472         clearUseFallbackContent function because it's clearer to set the data member in
473         line at the single call site in HTMLObjectElement::parseAttribute.
474
475         * html/HTMLPlugInImageElement.cpp:
476         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser
477         argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now.
478         (WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating
479         an element to do work that can't be done in a constructor.
480         (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new
481         scheduleUpdateForAfterStyleResolution function.
482         (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this
483         function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base
484         class; cleans things up, even though it's just an assertion.
485         (WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to
486         setNeedsWidgetUpdate(true) here; no longer needed because the new logic already
487         does the right thing in this case.
488         (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by
489         updateAfterStyleResolution instead.
490         (WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates
491         after parsing all the children now comes naturally out of the new implementation.
492         (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added.
493         Schedules a call to updateAfterStyleResolution when needed, and equally importantly,
494         increments the load event delay count to make sure that loads that are part of that
495         update can participate in decision about whether it's time for the load event.
496         (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added.
497         Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new
498         m_needsImageReload boolean in cases where no actual loading is done.
499         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay
500         count when moving an element that is in the middle of loading. This lets the
501         updateAfterStyleResolution function do the right thing even when the element is
502         moved without leaving anything stuck in a strange state.
503         (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new
504         scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
505         (WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by
506         updateAfterStyleResolution instead.
507         (WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all
508         the right things for when an image URL is changed; for use by the concrete derived classes.
509         * html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader
510         private rather than protected, and added the two new boolean data members.
511
512         * html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for
513         applet, embed, and object.
514
515         * loader/DocumentLoader.cpp:
516         (WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is
517         delaying a load event.
518
519         * loader/FrameLoader.cpp:
520         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if
521         isDelayingLoadEvent is true; otherwise this function can have a side effect of
522         triggering the load event.
523         (WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not
524         just a checkCompleted. This is relevant if the frame we are detaching was delaying
525         a load event because it no longer will be and so the load might be complete.
526
527 2017-07-30  Sam Weinig  <sam@webkit.org>
528
529         [WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobalScopeFetch
530         https://bugs.webkit.org/show_bug.cgi?id=174974
531
532         Reviewed by Darin Adler.
533
534         * CMakeLists.txt:
535         * DerivedSources.make:
536         * WebCore.xcodeproj/project.pbxproj:
537         * Modules/fetch/DOMWindowFetch.js: Removed.
538         * Modules/fetch/FetchRequest.js: Removed.
539         * Modules/fetch/WorkerGlobalScopeFetch.js: Removed.
540         Remove builtin files.
541
542         * Modules/fetch/DOMWindowFetch.cpp:
543         (WebCore::DOMWindowFetch::fetch):
544         * Modules/fetch/DOMWindowFetch.h:
545         * Modules/fetch/DOMWindowFetch.idl:
546         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
547         (WebCore::WorkerGlobalScopeFetch::fetch):
548         * Modules/fetch/WorkerGlobalScopeFetch.h:
549         * Modules/fetch/WorkerGlobalScopeFetch.idl:
550         Remove builtin and instead create FetchRequest in the implementation.
551
552         * Modules/fetch/FetchBody.cpp:
553         (WebCore::FetchBody::extract):
554         * Modules/fetch/FetchBody.h:
555         * Modules/fetch/FetchBodyOwner.cpp:
556         (WebCore::FetchBodyOwner::extractBody):
557         * Modules/fetch/FetchBodyOwner.h:
558         * Modules/fetch/FetchResponse.cpp:
559         * Modules/fetch/FetchResponse.h:
560         Rename FetchBody::BindingDataType to FetchBody::Init to match its IDL naming.
561
562         * Modules/fetch/FetchHeaders.cpp:
563         (WebCore::appendToHeaderMap):
564         (WebCore::fillHeaderMap):
565         (WebCore::FetchHeaders::create):
566         (WebCore::FetchHeaders::fill):
567         * Modules/fetch/FetchHeaders.h:
568         Add helpers to implement the fill algorithm for various input types.
569         Leave the existing fill for now, as it is still used by the FetchResponse
570         builtin, but will eventually be removed.
571
572         * Modules/fetch/FetchRequest.cpp:
573         (WebCore::FetchRequest::initializeOptions):
574         (WebCore::FetchRequest::initializeWith):
575         (WebCore::FetchRequest::setBody):
576         (WebCore::FetchRequest::create):
577         (WebCore::FetchRequest::setBodyFromInputRequest): Deleted.
578         * Modules/fetch/FetchRequest.h:
579         Migrate builtin code to the implementation. This is 1-to-1 re-implementation,
580         so I did not attempt to fix any conformance issues. That will come in follow up.
581
582         * Modules/fetch/FetchRequest.idl:
583         Replace builtins with an IDL constructor.
584
585         * Modules/fetch/FetchRequestInit.h:
586         * Modules/fetch/FetchRequestInit.idl:
587         Add missing headers and body to FetchRequestInit.
588
589 2017-07-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
590
591         RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
592         https://bugs.webkit.org/show_bug.cgi?id=174874
593         <rdar://problem/33530130>
594
595         Reviewed by Darin Adler.
596
597         If an <img> element has image content data for a none cached image, e.g.
598         -webkit-named-image, RenderImageResourceStyleImage will be created and 
599         attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage
600         will be set to null because the m_styleImage->isCachedImage() is false in
601         this case. When ImageLoader finishes loading the url of the src attribute, 
602         RenderImageResource::setCachedImage() will be called to set m_cachedImage.
603
604         A crash will happen when the RenderImage is destroyed. Destroying the 
605         RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
606         m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
607         which ends up calling CSSNamedImageValue::image() which returns a null pointer
608         because the size is empty. RenderImageResourceStyleImage::shutdown() calls
609         image()->stopAnimation() without checking the return value of image().
610
611         Like the base class virtual method RenderImageResource::image(), 
612         RenderImageResourceStyleImage::image() should return the nullImage() if
613         the image is not available.
614
615         Test: fast/images/image-element-image-content-data.html
616
617         * css/CSSCrossfadeValue.cpp:
618         * css/CSSFilterImageValue.cpp:
619         * page/EventHandler.cpp:
620         * page/PageSerializer.cpp:
621         * rendering/RenderElement.cpp:
622         * rendering/RenderImageResource.cpp:
623         * rendering/RenderImageResourceStyleImage.cpp:
624         (WebCore::RenderImageResourceStyleImage::initialize):
625
626         (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes
627         of r208511 in this function. Add a call to image()->stopAnimation() without
628         checking the return of image() since it will return the nullImage() if
629         the image not available. There is no need to check m_cachedImage before 
630         calling image() because image() does not check or access m_cachedImage.
631
632         (WebCore::RenderImageResourceStyleImage::image): The base class method
633         RenderImageResource::image() returns the nullImage() if the image not
634         available. This is because CachedImage::imageForRenderer() returns
635         the nullImage() if the image is not available; see CachedImage.h. We should
636         do the same for the derived class for consistency.
637
638         * rendering/style/ContentData.cpp:
639         * rendering/style/StyleCachedImage.cpp:
640         * style/StylePendingResources.cpp:
641
642 2017-07-29  Filip Pizlo  <fpizlo@apple.com>
643
644         Unreviewed, rollout r220044 because it set the bots on fire.
645         
646         It seems that the "-Wunguarded-availability-new" pragma is not widely supported. So, a bunch of the
647         Mac bots are now unable to build and that includes EWS.
648         
649         Fixing by rolling it out.
650
651         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
652         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
653         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
654         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
655         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
656         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
657         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
658         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
659         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
660         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
661         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
662         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
663         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
664         (WebCore::SourceBufferPrivateAVFObjC::flush):
665
666 2017-07-29  Dan Bernstein  <mitz@apple.com>
667
668         Fixed building for macOS 10.12 with the macOS 10.13 SDK.
669
670         Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
671         and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
672         starting in that release, they have been available as SPI earlier.
673
674         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
675         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
676         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
677         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
678         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
679         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
680         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
681         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
682         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
683         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
684         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
685         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
686         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
687         (WebCore::SourceBufferPrivateAVFObjC::flush):
688
689 2017-07-29  Nan Wang  <n_wang@apple.com>
690
691         AX: findMatchingObjects doesn't work when the startObject is ignored
692         https://bugs.webkit.org/show_bug.cgi?id=174965
693
694         Reviewed by Chris Fleizach.
695
696         findMatchingObjects would return a wrong element if we pass in an ignored
697         start object. To fix this, we should use the closest accessible sibling as 
698         the start object.
699
700         Test: accessibility/mac/search-predicate-from-ignored-element.html
701
702         * accessibility/AccessibilityObject.cpp:
703         (WebCore::appendChildrenToArray):
704
705 2017-07-29  Aaron Chu  <aaron_chu@apple.com>
706
707         AX: FKA: Buttons need a visible focus indicator
708         https://bugs.webkit.org/show_bug.cgi?id=171040
709         <rdar://problem/30922548>
710
711         Reviewed by Antoine Quint.
712
713         Added a background color for the focus state of the icon buttons in modern media controls.
714
715         Test: media/modern-media-controls/button/button-focus-state.html
716
717         * Modules/modern-media-controls/controls/button.css:
718         (button:focus):
719         (button:focus > picture):
720         * Modules/modern-media-controls/controls/slider.css:
721         (.slider > input):
722
723 2017-07-28  Sam Weinig  <sam@webkit.org>
724
725         [WebIDL] Remove JS builtin bindings for FetchHeaders
726         https://bugs.webkit.org/show_bug.cgi?id=174905
727
728         Reviewed by Alex Christensen.
729
730         * CMakeLists.txt:
731         * DerivedSources.make:
732         * WebCore.xcodeproj/project.pbxproj:
733         * Modules/fetch/FetchHeaders.js: Removed.
734         Remove FetchHeaders.js
735
736         * Modules/fetch/FetchHeaders.cpp:
737         (WebCore::appendToHeaderMap):
738         (WebCore::FetchHeaders::create):
739         (WebCore::FetchHeaders::append):
740         * Modules/fetch/FetchHeaders.h:
741         (WebCore::FetchHeaders::FetchHeaders):
742         Add create function for generated constructor.
743         Add appendToHeaderMap static function which takes the functionality
744         from the existing append function, and makes it useable in create.
745
746         * Modules/fetch/FetchHeaders.idl:
747         Replace [JSBuiltinConstructor] with real constructor. Keep other builtin
748         attributes as they are still used by other Fetch code.
749
750         * bindings/js/JSDOMConvertRecord.h:
751         Fix record conversion to work with proxies by changing to use the method table
752         for getOwnPropertyNames, and undefined values by not excluding undefined values. 
753
754 2017-07-28  Matt Baker  <mattbaker@apple.com>
755
756         Web Inspector: capture an async stack trace when web content calls addEventListener
757         https://bugs.webkit.org/show_bug.cgi?id=174739
758         <rdar://problem/33468197>
759
760         Reviewed by Brian Burg.
761
762         Test: inspector/debugger/async-stack-trace.html
763
764         Add instrumentation to EventTarget to support showing asynchronous
765         stack traces when the debugger breaks in a script event listener.
766
767         * dom/EventTarget.cpp:
768         (WebCore::EventTarget::addEventListener):
769         (WebCore::EventTarget::removeEventListener):
770         (WebCore::EventTarget::fireEventListeners):
771         * inspector/InspectorInstrumentation.cpp:
772         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
773         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
774         (WebCore::InspectorInstrumentation::willHandleEventImpl):
775         (WebCore::InspectorInstrumentation::didHandleEventImpl):
776         * inspector/InspectorInstrumentation.h:
777         (WebCore::InspectorInstrumentation::didAddEventListener):
778         (WebCore::InspectorInstrumentation::willRemoveEventListener):
779         (WebCore::InspectorInstrumentation::willHandleEvent):
780         (WebCore::InspectorInstrumentation::didHandleEvent):
781         * inspector/PageDebuggerAgent.cpp:
782         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
783         (WebCore::PageDebuggerAgent::didAddEventListener):
784         (WebCore::PageDebuggerAgent::willRemoveEventListener):
785         (WebCore::PageDebuggerAgent::willHandleEvent):
786         * inspector/PageDebuggerAgent.h:
787
788 2017-07-28  Matt Rajca  <mrajca@apple.com>
789
790         Don't add autoplay restrictions to media elements created in response to user gestures.
791         https://bugs.webkit.org/show_bug.cgi?id=174947
792
793         Reviewed by Eric Carlson.
794
795         Test: media/video-create-with-user-gesture.html
796
797         * html/HTMLMediaElement.cpp:
798         (WebCore::HTMLMediaElement::HTMLMediaElement):
799
800 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
801
802         WebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from WebThread
803         https://bugs.webkit.org/show_bug.cgi?id=174934
804         rdar://problem/33586772
805
806         Reviewed by Eric Carlson.
807
808         No new tests because no effect on DOM.
809
810         This dispatches a UIKit call to the main thread since it might happen on WebThread in WK1.
811
812         * platform/audio/ios/MediaSessionManagerIOS.mm:
813         (-[WebMediaSessionHelper initWithCallback:]):
814
815 2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
816
817         [macOS] Reeder's defaults font is Times instead of San Francisco
818         https://bugs.webkit.org/show_bug.cgi?id=174885
819         <rdar://problem/33462483>
820
821         Reviewed by Simon Fraser.
822
823         Reeder uses explicit dot-prefixed names in its source code. Within Core Text,
824         dot-prefixed names cannot be matched case insensitively. The solution is to
825         not case-fold these family names, and to make our caches case sensitive for
826         these special names.
827
828         Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html
829                fast/text/font-lookup-dot-prefix-case-sensitive.html
830
831         * platform/graphics/FontCache.cpp:
832         (WebCore::FontPlatformDataCacheKey::operator==):
833         (WebCore::FontPlatformDataCacheKeyHash::hash):
834         * platform/graphics/FontCascade.cpp:
835         (WebCore::keysMatch):
836         (WebCore::computeFontCascadeCacheHash):
837         * platform/graphics/FontDescription.cpp:
838         (WebCore::FontCascadeDescription::familyNamesAreEqual):
839         (WebCore::FontCascadeDescription::familyNameHash):
840         (WebCore::FontCascadeDescription::foldedFamilyName):
841         * platform/graphics/FontDescription.h:
842         * platform/graphics/cocoa/FontCacheCoreText.cpp:
843         (WebCore::FontDatabase::fontForPostScriptName):
844
845 2017-07-28  Devin Rousso  <drousso@apple.com>
846
847         Web Inspector: Record actions performed on CanvasRenderingContext2D
848         https://bugs.webkit.org/show_bug.cgi?id=174482
849
850         Reviewed by Joseph Pecoraro.
851
852         Tests: inspector/canvas/recording-2d.html
853                inspector/canvas/recording.html
854
855         * html/canvas/CanvasRenderingContext2D.idl:
856         Add CallTracingCallback to interface to record all API calls.
857
858         * html/HTMLCanvasElement.cpp:
859         (WebCore::HTMLCanvasElement::paint):
860         If a recording is active, mark the current frame as completed.
861
862         * bindings/scripts/CodeGeneratorJS.pm:
863         (GenerateAttributeGetterBodyDefinition):
864         (GenerateAttributeSetterBodyDefinition):
865         (GenerateImplementationFunctionCall):
866         (GenerateCallTracerParameter):
867         (GenerateCallTracer):
868         * bindings/scripts/test/TestCallTracer.idl:
869         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
870         (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
871         (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
872         (WebCore::jsTestCallTracerTestAttributeWithVariantGetter):
873         (WebCore::jsTestCallTracerTestAttributeWithVariant):
874         (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
875         (WebCore::setJSTestCallTracerTestAttributeWithVariant):
876         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody):
877         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody):
878         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody):
879         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
880         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody):
881         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument):
882         * inspector/InspectorCanvas.h:
883         * inspector/InspectorCanvas.cpp:
884         (WebCore::InspectorCanvas::recordAction):
885         (WebCore::InspectorCanvas::buildAction):
886         Change CallTracer IDL generation to flatten any variants so that all types for the
887         parameters of an action are able to be listed in a single variant. This prevents possible
888         ambiguity when constructing the variant, as they require that exactly one type be
889         constructible and a sub-variant might not satisfy that condition. This was only an issue for
890         older mac SDKs.
891
892         * bindings/js/CallTracer.h:
893         * bindings/js/CallTracer.cpp:
894         (WebCore::CallTracer::recordCanvasAction):
895         * bindings/js/CallTracerTypes.h:
896         * inspector/InspectorCanvasAgent.h:
897         * inspector/InspectorCanvasAgent.cpp:
898         (WebCore::InspectorCanvasAgent::recordCanvasAction):
899         * inspector/InspectorInstrumentation.h:
900         * inspector/InspectorInstrumentation.cpp:
901         (WebCore::InspectorInstrumentation::recordCanvasAction):
902         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
903         Rename CanvasActionParameterVariant to RecordCanvasActionVariant to match what is expected by
904         the IDL generator. Also remove unnecessary includes now that they are in CallTracerTypes.h.
905
906         * CMakeLists.txt:
907         * bindings/js/JSBindingsAllInOne.cpp:
908         Add CallTracer for CMake builds.
909
910 2017-07-28  Sam Weinig  <sam@webkit.org>
911
912         [WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary js builtins
913         https://bugs.webkit.org/show_bug.cgi?id=174915
914
915         Reviewed by Alex Christensen.
916
917         - Split FetchRequest enums and Init dictionary out of FetchRequest so they
918           can be used from other files like WorkerGlobalScopeFetch and DOMWindowFetch.
919         - Add missing FetchResponseInit. Currently unused but will be in a subsequent patch.
920         - Add and update comments about missing properties and functions.
921
922         * CMakeLists.txt:
923         * DerivedSources.make:
924         * WebCore.xcodeproj/project.pbxproj:
925         * Modules/fetch/DOMWindowFetch.idl:
926         * Modules/fetch/FetchBody.idl:
927         * Modules/fetch/FetchBodyOwner.h:
928         * Modules/fetch/FetchHeaders.h:
929         * Modules/fetch/FetchHeaders.idl:
930         * Modules/fetch/FetchReferrerPolicy.h: Added.
931         * Modules/fetch/FetchReferrerPolicy.idl: Added.
932         * Modules/fetch/FetchRequest.h:
933         * Modules/fetch/FetchRequest.idl:
934         * Modules/fetch/FetchRequestCache.h: Added.
935         * Modules/fetch/FetchRequestCache.idl: Added.
936         * Modules/fetch/FetchRequestCredentials.h: Added.
937         * Modules/fetch/FetchRequestCredentials.idl: Added.
938         * Modules/fetch/FetchRequestInit.h: Added.
939         * Modules/fetch/FetchRequestInit.idl: Added.
940         * Modules/fetch/FetchRequestMode.h: Added.
941         * Modules/fetch/FetchRequestMode.idl: Added.
942         * Modules/fetch/FetchRequestRedirect.h: Added.
943         * Modules/fetch/FetchRequestRedirect.idl: Added.
944         * Modules/fetch/FetchResponse.h:
945         * Modules/fetch/FetchResponse.idl:
946         * Modules/fetch/WorkerGlobalScopeFetch.idl:
947
948 2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
949
950         REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
951         https://bugs.webkit.org/show_bug.cgi?id=174772
952         <rdar://problem/33267643>
953
954         Reviewed by Simon Fraser.
955
956         During a font load, we try pretty hard to find a font to use that isn't the
957         last resort font (which happens to be Times). We do this by iterating through
958         all the fonts in the font-family list, as well as through all the relevant
959         @font-face blocks which share the requested font family name. 
960
961         Unfortunately, if we find one of these fallback fonts, we were simply using it
962         directly, which means that it was being drawn as visible (because the
963         visibility setting lives inside the Font object). Instead, we should carry the
964         invisibility setting from the interstitial font to this used fallback font.
965
966         This patch is an extension of r219221, which fixed the problem only for system
967         fallback fonts. This patch adopts the same methodology to all fallback fonts.
968
969         Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html
970
971         * platform/graphics/FontCascadeFonts.cpp:
972         (WebCore::FontCascadeFonts::glyphDataForVariant):
973         (WebCore::glyphPageFromFontRanges):
974         * platform/graphics/FontRanges.cpp:
975         (WebCore::FontRanges::glyphDataForCharacter):
976
977 2017-07-28  Frederic Wang  <fwang@igalia.cpm>
978
979         Fix typo in scrollPositionChangedViaDelegatedScrolling
980         https://bugs.webkit.org/show_bug.cgi?id=174937
981
982         Reviewed by Wenson Hsieh.
983
984         No new tests, fix typo in the inUserInteraction parameter.
985
986         * page/scrolling/ScrollingTree.cpp:
987         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
988         * page/scrolling/ScrollingTree.h:
989
990 2017-07-28  Wenson Hsieh  <wenson_hsieh@apple.com>
991
992         [iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down
993         https://bugs.webkit.org/show_bug.cgi?id=174928
994         <rdar://problem/33584280>
995
996         Reviewed by Tim Horton.
997
998         Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a
999         snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same
1000         way as snapshotting a dragged selection.
1001
1002         No way of testing TextIndicator-based snapshotting yet.
1003
1004         * platform/DragImage.cpp:
1005
1006         Guard createDragImageForRange for !PLATFORM(IOS).
1007
1008         * platform/ios/DragImageIOS.mm:
1009         (WebCore::createDragImageForSelection):
1010
1011         Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results
1012         in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere
1013         in drag initiation code, which eventually results in the correct orientation; we'll need further investigation
1014         to remove this extraneous flip.
1015
1016         (WebCore::createDragImageForRange):
1017
1018 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
1019
1020         Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
1021         https://bugs.webkit.org/show_bug.cgi?id=174437
1022
1023         Reviewed by Darin Adler.
1024
1025         No new tests because no behavior change.
1026
1027         Remove redundant Web- prefix from classes in WebCore namespace.
1028
1029         * WebCore.xcodeproj/project.pbxproj:
1030         * html/HTMLMediaElement.cpp:
1031         * html/HTMLVideoElement.cpp:
1032         * platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h.
1033         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
1034         * platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h.
1035         (WebCore::PlaybackSessionModel::~PlaybackSessionModel):
1036         (WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient):
1037         (WebCore::PlaybackSessionModelClient::externalPlaybackChanged):
1038         * platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h.
1039         * platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm.
1040         * platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h.
1041         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver):
1042         * platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h.
1043         (WebCore::VideoFullscreenModel::~VideoFullscreenModel):
1044         (WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient):
1045         * platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h.
1046         (WebCore::VideoFullscreenModelVideoElement::create):
1047         * platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
1048         * platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h.
1049         * platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm.
1050         * platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h.
1051         * platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm.
1052         * platform/ios/WebAVPlayerController.h:
1053         * platform/ios/WebAVPlayerController.mm:
1054         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1055         * platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h.
1056         * platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm.
1057         * platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h.
1058         * platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
1059         * platform/mac/WebPlaybackControlsManager.h:
1060         * platform/mac/WebPlaybackControlsManager.mm:
1061
1062 2017-07-27  Jeremy Jones  <jeremyj@apple.com>
1063
1064         Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
1065         https://bugs.webkit.org/show_bug.cgi?id=174850
1066         rdar://problem/33449903
1067
1068         Reviewed by Jon Lee.
1069
1070         This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting
1071         from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback
1072         that implements the details of exactly which media documents are still allowed to play inlne.
1073
1074         Media documents always use a video element; but when there are no video tracks, it has behavior like 
1075         an audio element. See media-controller.js isAudio().
1076
1077         This change preserves this behavior with respect to fullscreen requirements for media document by
1078         mirroring the isAudio() check in requiresFullscreenForVideoPlayback.
1079
1080         * html/MediaDocument.cpp:
1081         (WebCore::MediaDocumentParser::createDocumentStructure):
1082         * html/MediaElementSession.cpp:
1083         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
1084
1085 2017-07-27  Jeremy Jones  <jeremyj@apple.com>
1086
1087         MediaDocument fullscreen pinch gesture should trigger navigate back.
1088         https://bugs.webkit.org/show_bug.cgi?id=174914
1089
1090         Reviewed by Jon Lee.
1091
1092         No new tests because only effect is from interaction with platform.
1093
1094         For media documents, pressing the "done" button on fullscreen video navigates back
1095         to the previous page. The same should happen for other gestures that pause playback
1096         when returning to inline. This allows the gesture to have the same behavior as the
1097         button.
1098
1099         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1100         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1101
1102 2017-07-27  Aaron Chu  <aaron_chu@apple.com>
1103
1104         AX: VoiceOver silent or skipping over time values on media player.
1105         https://bugs.webkit.org/show_bug.cgi?id=174324
1106         <rdar://problem/32021784>
1107
1108         Reviewed by Antoine Quint.
1109
1110         Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.
1111
1112         Test Updated: media/modern-media-controls/time-label/time-label.html
1113         Test Added: media/modern-media-controls/time-label/ios-time-label.html
1114         
1115         * Modules/modern-media-controls/controls/time-label.js:
1116
1117 2017-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
1118
1119         Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass
1120         https://bugs.webkit.org/show_bug.cgi?id=171637
1121
1122         Reviewed by Darin Adler.
1123
1124         We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side.
1125         So, we can drop ClassInfo check from the actual function.
1126
1127         We also simplify DOMJIT::GetterSetter to make it smaller size.
1128
1129         WebCore size comparison
1130             Before: 48443292
1131             After:  48087800 (0.7% reduction)
1132
1133         Speedometer Scores show 0.8% improvement.
1134             Before: 158.9 +- 0.46
1135             After:  160.2 +- 0.36
1136
1137         Dromaeo DOM core Scores show 5.8% improvement.
1138                                         Before                   After
1139             Total Score:         8424.12runs/s ±1.38%     8911.60runs/s ±1.47%
1140               DOM Attributes    12627.27runs/s ±1.87%    14023.17runs/s ±1.87%
1141               DOM Modification   1207.82runs/s ±2.48%     1204.21runs/s ±3.05%
1142               DOM Query         68068.82runs/s ±0.63%    74273.38runs/s ±0.69%
1143               DOM Traversal      1240.07runs/s ±1.96%     1256.64runs/s ±1.77%
1144
1145         Performance improvement can be explained by the following optimizations.
1146
1147         1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can
1148            drop type checks since get_by_id operation already performs a structure check
1149            which subsumes this type check.
1150         2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL.
1151
1152         * bindings/js/JSDOMAttribute.h:
1153         (WebCore::IDLAttribute::get):
1154         Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast.
1155
1156         * bindings/scripts/CodeGeneratorJS.pm:
1157         (IsAcceleratedDOMAttribute):
1158         (GetJSCAttributesForAttribute):
1159         (GenerateHeader):
1160         (GeneratePropertiesHashTable):
1161         (GenerateImplementation):
1162         (GenerateAttributeGetterTrampolineDefinition):
1163         (GenerateAttributeGetterDefinition):
1164         (GenerateCallbackImplementationContent):
1165         (GenerateHashTableValueArray):
1166         (GenerateHashTable):
1167         (GenerateConstructorHelperMethods):
1168         Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size.
1169
1170         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1171         (WebCore::JSInterfaceNamePrototype::finishCreation):
1172         * bindings/scripts/test/JS/JSMapLike.cpp:
1173         (WebCore::JSMapLikePrototype::finishCreation):
1174         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1175         (WebCore::JSReadOnlyMapLikePrototype::finishCreation):
1176         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1177         (WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
1178         (WebCore::jsTestActiveDOMObjectExcitingAttr):
1179         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1180         (WebCore::JSTestCEReactionsPrototype::finishCreation):
1181         (WebCore::jsTestCEReactionsAttributeWithCEReactions):
1182         (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions):
1183         (WebCore::jsTestCEReactionsStringifierAttribute):
1184         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1185         (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation):
1186         (WebCore::jsTestCEReactionsStringifierValue):
1187         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1188         (WebCore::JSTestCallTracerPrototype::finishCreation):
1189         (WebCore::jsTestCallTracerTestAttributeInterface):
1190         (WebCore::jsTestCallTracerTestAttributeSpecified):
1191         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1192         (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
1193         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1194         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
1195         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1196         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
1197         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1198         (WebCore::JSTestDOMJITPrototype::finishCreation):
1199         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted.
1200         (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted.
1201         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted.
1202         (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted.
1203         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted.
1204         (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted.
1205         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted.
1206         (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted.
1207         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted.
1208         (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted.
1209         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted.
1210         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted.
1211         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted.
1212         (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted.
1213         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted.
1214         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted.
1215         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted.
1216         (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted.
1217         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted.
1218         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted.
1219         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted.
1220         (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted.
1221         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted.
1222         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted.
1223         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted.
1224         (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted.
1225         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted.
1226         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted.
1227         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted.
1228         (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted.
1229         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted.
1230         (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted.
1231         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted.
1232         (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted.
1233         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted.
1234         (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted.
1235         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted.
1236         (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted.
1237         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted.
1238         (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted.
1239         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted.
1240         (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted.
1241         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted.
1242         (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted.
1243         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted.
1244         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted.
1245         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted.
1246         (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted.
1247         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted.
1248         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted.
1249         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted.
1250         (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted.
1251         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted.
1252         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted.
1253         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted.
1254         (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted.
1255         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted.
1256         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted.
1257         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted.
1258         (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted.
1259         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted.
1260         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted.
1261         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted.
1262         (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted.
1263         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted.
1264         (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted.
1265         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted.
1266         (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted.
1267         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted.
1268         (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted.
1269         * bindings/scripts/test/JS/JSTestDOMJIT.h:
1270         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1271         (WebCore::JSTestEventConstructorPrototype::finishCreation):
1272         (WebCore::jsTestEventConstructorAttr1):
1273         (WebCore::jsTestEventConstructorAttr2):
1274         (WebCore::jsTestEventConstructorAttr3):
1275         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1276         (WebCore::JSTestEventTargetPrototype::finishCreation):
1277         * bindings/scripts/test/JS/JSTestException.cpp:
1278         (WebCore::JSTestExceptionPrototype::finishCreation):
1279         (WebCore::jsTestExceptionName):
1280         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1281         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
1282         (WebCore::jsTestGenerateIsReachableASecretAttribute):
1283         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1284         (WebCore::jsTestGlobalObjectRegularAttribute):
1285         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1286         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation):
1287         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1288         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation):
1289         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1290         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation):
1291         * bindings/scripts/test/JS/JSTestInterface.cpp:
1292         (WebCore::JSTestInterfaceConstructor::initializeProperties):
1293         (WebCore::JSTestInterfacePrototype::finishCreation):
1294         (WebCore::jsTestInterfaceImplementsStr1):
1295         (WebCore::jsTestInterfaceImplementsStr2):
1296         (WebCore::jsTestInterfaceImplementsStr3):
1297         (WebCore::jsTestInterfaceImplementsNode):
1298         (WebCore::jsTestInterfaceSupplementalStr1):
1299         (WebCore::jsTestInterfaceSupplementalStr2):
1300         (WebCore::jsTestInterfaceSupplementalStr3):
1301         (WebCore::jsTestInterfaceSupplementalNode):
1302         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1303         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
1304         (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
1305         * bindings/scripts/test/JS/JSTestIterable.cpp:
1306         (WebCore::JSTestIterablePrototype::finishCreation):
1307         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1308         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
1309         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
1310         (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
1311         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1312         (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
1313         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1314         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation):
1315         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1316         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation):
1317         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1318         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation):
1319         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1320         (WebCore::JSTestNamedConstructorPrototype::finishCreation):
1321         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1322         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation):
1323         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1324         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation):
1325         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1326         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation):
1327         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1328         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation):
1329         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1330         (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation):
1331         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1332         (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation):
1333         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1334         (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation):
1335         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1336         (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation):
1337         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1338         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation):
1339         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1340         (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation):
1341         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1342         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation):
1343         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1344         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation):
1345         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1346         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation):
1347         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1348         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation):
1349         (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute):
1350         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1351         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation):
1352         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute):
1353         * bindings/scripts/test/JS/JSTestNode.cpp:
1354         (WebCore::JSTestNodePrototype::finishCreation):
1355         (WebCore::jsTestNodeName):
1356         * bindings/scripts/test/JS/JSTestObj.cpp:
1357         (WebCore::JSTestObjConstructor::initializeProperties):
1358         (WebCore::JSTestObjPrototype::finishCreation):
1359         (WebCore::jsTestObjReadOnlyLongAttr):
1360         (WebCore::jsTestObjReadOnlyStringAttr):
1361         (WebCore::jsTestObjReadOnlyTestObjAttr):
1362         (WebCore::jsTestObjEnumAttr):
1363         (WebCore::jsTestObjByteAttr):
1364         (WebCore::jsTestObjOctetAttr):
1365         (WebCore::jsTestObjShortAttr):
1366         (WebCore::jsTestObjClampedShortAttr):
1367         (WebCore::jsTestObjEnforceRangeShortAttr):
1368         (WebCore::jsTestObjUnsignedShortAttr):
1369         (WebCore::jsTestObjLongAttr):
1370         (WebCore::jsTestObjLongLongAttr):
1371         (WebCore::jsTestObjUnsignedLongLongAttr):
1372         (WebCore::jsTestObjStringAttr):
1373         (WebCore::jsTestObjUsvstringAttr):
1374         (WebCore::jsTestObjTestObjAttr):
1375         (WebCore::jsTestObjTestNullableObjAttr):
1376         (WebCore::jsTestObjUnforgeableAttr):
1377         (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
1378         (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
1379         (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString):
1380         (WebCore::jsTestObjStringLongRecordAttr):
1381         (WebCore::jsTestObjUsvstringLongRecordAttr):
1382         (WebCore::jsTestObjStringObjRecordAttr):
1383         (WebCore::jsTestObjStringNullableObjRecordAttr):
1384         (WebCore::jsTestObjDictionaryAttr):
1385         (WebCore::jsTestObjNullableDictionaryAttr):
1386         (WebCore::jsTestObjAnnotatedTypeInUnionAttr):
1387         (WebCore::jsTestObjAnnotatedTypeInSequenceAttr):
1388         (WebCore::jsTestObjImplementationEnumAttr):
1389         (WebCore::jsTestObjXMLObjAttr):
1390         (WebCore::jsTestObjCreate):
1391         (WebCore::jsTestObjReflectedStringAttr):
1392         (WebCore::jsTestObjReflectedUSVStringAttr):
1393         (WebCore::jsTestObjReflectedIntegralAttr):
1394         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
1395         (WebCore::jsTestObjReflectedBooleanAttr):
1396         (WebCore::jsTestObjReflectedURLAttr):
1397         (WebCore::jsTestObjReflectedUSVURLAttr):
1398         (WebCore::jsTestObjReflectedCustomIntegralAttr):
1399         (WebCore::jsTestObjReflectedCustomBooleanAttr):
1400         (WebCore::jsTestObjReflectedCustomURLAttr):
1401         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
1402         (WebCore::jsTestObjEnabledBySettingAttribute):
1403         (WebCore::jsTestObjTypedArrayAttr):
1404         (WebCore::jsTestObjAttributeWithGetterException):
1405         (WebCore::jsTestObjAttributeWithSetterException):
1406         (WebCore::jsTestObjStringAttrWithGetterException):
1407         (WebCore::jsTestObjStringAttrWithSetterException):
1408         (WebCore::jsTestObjCustomAttr):
1409         (WebCore::jsTestObjOnfoo):
1410         (WebCore::jsTestObjOnwebkitfoo):
1411         (WebCore::jsTestObjWithScriptStateAttribute):
1412         (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
1413         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
1414         (WebCore::jsTestObjWithScriptStateAttributeRaises):
1415         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
1416         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
1417         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
1418         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
1419         (WebCore::jsTestObjConditionalAttr1):
1420         (WebCore::jsTestObjConditionalAttr2):
1421         (WebCore::jsTestObjConditionalAttr3):
1422         (WebCore::jsTestObjCachedAttribute1):
1423         (WebCore::jsTestObjCachedAttribute2):
1424         (WebCore::jsTestObjAnyAttribute):
1425         (WebCore::jsTestObjObjectAttribute):
1426         (WebCore::jsTestObjContentDocument):
1427         (WebCore::jsTestObjMutablePoint):
1428         (WebCore::jsTestObjStrawberry):
1429         (WebCore::jsTestObjDescription):
1430         (WebCore::jsTestObjId):
1431         (WebCore::jsTestObjHash):
1432         (WebCore::jsTestObjReplaceableAttribute):
1433         (WebCore::jsTestObjNullableDoubleAttribute):
1434         (WebCore::jsTestObjNullableLongAttribute):
1435         (WebCore::jsTestObjNullableBooleanAttribute):
1436         (WebCore::jsTestObjNullableStringAttribute):
1437         (WebCore::jsTestObjNullableLongSettableAttribute):
1438         (WebCore::jsTestObjNullableStringSettableAttribute):
1439         (WebCore::jsTestObjNullableUSVStringSettableAttribute):
1440         (WebCore::jsTestObjNullableByteStringSettableAttribute):
1441         (WebCore::jsTestObjNullableStringValue):
1442         (WebCore::jsTestObjAttribute):
1443         (WebCore::jsTestObjAttributeWithReservedEnumType):
1444         (WebCore::jsTestObjPutForwardsAttribute):
1445         (WebCore::jsTestObjPutForwardsNullableAttribute):
1446         (WebCore::jsTestObjStringifierAttribute):
1447         (WebCore::jsTestObjConditionallyReadWriteAttribute):
1448         (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute):
1449         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1450         (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
1451         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1452         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation):
1453         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1454         (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
1455         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1456         (WebCore::JSTestPluginInterfacePrototype::finishCreation):
1457         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1458         (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
1459         (WebCore::jsTestPromiseRejectionEventReason):
1460         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1461         (WebCore::JSTestSerializationPrototype::finishCreation):
1462         (WebCore::jsTestSerializationFirstStringAttribute):
1463         (WebCore::jsTestSerializationSecondLongAttribute):
1464         (WebCore::jsTestSerializationThirdUnserializableAttribute):
1465         (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute):
1466         (WebCore::jsTestSerializationFifthLongAttribute):
1467         (WebCore::jsTestSerializationSixthTypedefAttribute):
1468         (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute):
1469         (WebCore::jsTestSerializationEighthIndirectlyAttribute):
1470         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1471         (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation):
1472         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1473         (WebCore::JSTestSerializationInheritPrototype::finishCreation):
1474         (WebCore::jsTestSerializationInheritInheritLongAttribute):
1475         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1476         (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation):
1477         (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo):
1478         (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar):
1479         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1480         (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
1481         (WebCore::jsTestSerializedScriptValueInterfaceValue):
1482         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
1483         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
1484         (WebCore::jsTestSerializedScriptValueInterfacePorts):
1485         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
1486         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1487         (WebCore::JSTestStringifierPrototype::finishCreation):
1488         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1489         (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation):
1490         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1491         (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation):
1492         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1493         (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation):
1494         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1495         (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation):
1496         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1497         (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation):
1498         (WebCore::jsTestStringifierReadOnlyAttributeIdentifier):
1499         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1500         (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation):
1501         (WebCore::jsTestStringifierReadWriteAttributeIdentifier):
1502         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1503         (WebCore::JSTestTypedefsConstructor::initializeProperties):
1504         (WebCore::JSTestTypedefsPrototype::finishCreation):
1505         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
1506         (WebCore::jsTestTypedefsSerializedScriptValue):
1507         (WebCore::jsTestTypedefsAttributeWithClamp):
1508         (WebCore::jsTestTypedefsAttributeWithClampInTypedef):
1509         (WebCore::jsTestTypedefsAttrWithGetterException):
1510         (WebCore::jsTestTypedefsAttrWithSetterException):
1511         (WebCore::jsTestTypedefsStringAttrWithGetterException):
1512         (WebCore::jsTestTypedefsStringAttrWithSetterException):
1513         (WebCore::jsTestTypedefsBufferSourceAttr):
1514         (WebCore::jsTestTypedefsDomTimeStampAttr):
1515         They are binding test rebaselines.
1516
1517         * domjit/DOMJITIDLTypeFilter.h:
1518         * domjit/JSDocumentDOMJIT.cpp:
1519         (WebCore::compileDocumentDocumentElementAttribute):
1520         (WebCore::compileDocumentBodyAttribute):
1521         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted.
1522         (WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted.
1523         * domjit/JSNodeDOMJIT.cpp:
1524         (WebCore::compileNodeFirstChildAttribute):
1525         (WebCore::compileNodeLastChildAttribute):
1526         (WebCore::compileNodeNextSiblingAttribute):
1527         (WebCore::compileNodePreviousSiblingAttribute):
1528         (WebCore::compileNodeParentNodeAttribute):
1529         (WebCore::compileNodeNodeTypeAttribute):
1530         (WebCore::compileNodeOwnerDocumentAttribute):
1531         (WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted.
1532         (WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted.
1533         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted.
1534         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted.
1535         (WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted.
1536         (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted.
1537         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
1538         DOMJIT::GetterSetter becomes smaller constexpr data.
1539
1540 2017-07-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1541
1542         [GStreamer][EME] Not having a key id buffer should not always error
1543         https://bugs.webkit.org/show_bug.cgi?id=174889
1544
1545         Reviewed by Žan Doberšek.
1546
1547         In r219946 we introduced a hard requirement for a key id buffer
1548         that does not happen for all CDMs.
1549
1550         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1551         (webKitMediaClearKeyDecryptorSetupCipher): Check for key id buffer
1552         and error if we didn't get it.
1553         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1554         (webkitMediaCommonEncryptionDecryptTransformInPlace): Soften the
1555         requirement for key id buffer.
1556
1557 2017-07-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1558
1559         [GStreamer][EME] Fix phony debug output in player base for supported key system
1560         https://bugs.webkit.org/show_bug.cgi?id=174888
1561
1562         Reviewed by Žan Doberšek.
1563
1564         The debug output was returning always false because that method
1565         was not checking anything before. Now it is and should reflect it.
1566
1567         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1568         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
1569
1570 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
1571
1572         [EME][GStreamer] Add barebones CDM interface implementations for ClearKey
1573         https://bugs.webkit.org/show_bug.cgi?id=174887
1574
1575         Reviewed by Xabier Rodriguez-Calvar.
1576
1577         Add empty ClearKey derivations of CDMFactory, CDMPrivate and CDMInstance
1578         classes. These will be enhanced as the implementation progresses.
1579
1580         ClearKey is added to CDMInstance::ImplementationType, and the
1581         CDMInstanceClearKey::implementationType() override returns that value.
1582         Type traits specialization for the CDMInstanceClearKey class is also
1583         added, utilizing the CDMInstance::ImplementationType::ClearKey value.
1584
1585         The implementation file is added to the WPE build, along with the
1586         necessary inclusion directory.
1587
1588         * PlatformWPE.cmake:
1589         * platform/encryptedmedia/CDMInstance.h:
1590         * platform/encryptedmedia/clearkey/CDMClearKey.cpp: Added.
1591         (WebCore::CDMFactoryClearKey::createCDM):
1592         (WebCore::CDMFactoryClearKey::supportsKeySystem):
1593         (WebCore::CDMPrivateClearKey::supportsInitDataType):
1594         (WebCore::CDMPrivateClearKey::supportsConfiguration):
1595         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions):
1596         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration):
1597         (WebCore::CDMPrivateClearKey::supportsRobustness):
1598         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement):
1599         (WebCore::CDMPrivateClearKey::persistentStateRequirement):
1600         (WebCore::CDMPrivateClearKey::distinctiveIdentifiersAreUniquePerOriginAndClearable):
1601         (WebCore::CDMPrivateClearKey::createInstance):
1602         (WebCore::CDMPrivateClearKey::loadAndInitialize):
1603         (WebCore::CDMPrivateClearKey::supportsServerCertificates):
1604         (WebCore::CDMPrivateClearKey::supportsSessions):
1605         (WebCore::CDMPrivateClearKey::supportsInitData):
1606         (WebCore::CDMPrivateClearKey::sanitizeResponse):
1607         (WebCore::CDMPrivateClearKey::sanitizeSessionId):
1608         (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
1609         (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
1610         (WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
1611         (WebCore::CDMInstanceClearKey::setServerCertificate):
1612         (WebCore::CDMInstanceClearKey::requestLicense):
1613         (WebCore::CDMInstanceClearKey::updateLicense):
1614         (WebCore::CDMInstanceClearKey::loadSession):
1615         (WebCore::CDMInstanceClearKey::closeSession):
1616         (WebCore::CDMInstanceClearKey::removeSessionData):
1617         (WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage):
1618         * platform/encryptedmedia/clearkey/CDMClearKey.h: Added.
1619
1620 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
1621
1622         [EME] Allow CDMInstance type traits specialization
1623         https://bugs.webkit.org/show_bug.cgi?id=174886
1624
1625         Reviewed by Xabier Rodriguez-Calvar.
1626
1627         Allow using the trait-based type casting for the CDMInstance class and its
1628         derivatives. ImplementationType enumeration values are to be used and
1629         returned from the new implementationType() virtual method. This method is
1630         leveraged in the type trait specialization that enables using is<>() and
1631         downcast<>() helpers for CDMInstance objects.
1632
1633         This will allow differentiating between CDMInstance implementations once
1634         the media playback pipeline has to retrieve any key information that's
1635         necessary for playback of encrypted content.
1636
1637         MockCDMInstance class overrides the implementationType() method, returning
1638         the ImplementationType::Mock value. Type trait specializations for this
1639         class aren't added since they're not needed anywhere at this point.
1640
1641         * platform/encryptedmedia/CDMInstance.h:
1642         * testing/MockCDMFactory.h:
1643
1644 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
1645
1646         [GCrypt] Key serialization support
1647         https://bugs.webkit.org/show_bug.cgi?id=173883
1648
1649         Reviewed by Jiewen Tan.
1650
1651         Implement crypto key serialization for platforms that use libgcrypt.
1652
1653         Despite the function names and the existing implementation for the Mac port,
1654         we don't perform the KEK wrapping and unwrapping due to the review feedback
1655         advising against it.
1656
1657         Instead the passed-in key data is simply copied and returned as the result of
1658         the 'wrapping' operation, and similarly the passed-in serialized data is simply
1659         copied and returned as the result of the 'unwrapping' operation.
1660
1661         No new tests -- related tests are now passing and are unskipped.
1662
1663         * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
1664         (WebCore::getDefaultWebCryptoMasterKey):
1665         (WebCore::wrapSerializedCryptoKey):
1666         (WebCore::unwrapSerializedCryptoKey):
1667
1668 2017-07-26  Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
1669
1670         Implement new TextMetrics, returned by canvas measureText()
1671         https://bugs.webkit.org/show_bug.cgi?id=82798
1672         <rdar://problem/11159332>
1673
1674         Reviewed by Dean Jackson.
1675
1676         The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext
1677
1678         Add new attributes to TextMetrics.
1679
1680         Add a new method textOffset() of CanvasRenderingContext2D by
1681         extracting from drawTextInternal() to use the same horizontal and
1682         vertical offsets of a text in both drawTextInternal() and
1683         measureText().
1684
1685         Test: fast/canvas/canvas-measureText-2.html
1686
1687         * html/TextMetrics.h:
1688         (WebCore::TextMetrics::actualBoundingBoxLeft):
1689         (WebCore::TextMetrics::setActualBoundingBoxLeft):
1690         (WebCore::TextMetrics::actualBoundingBoxRight):
1691         (WebCore::TextMetrics::setActualBoundingBoxRight):
1692         (WebCore::TextMetrics::fontBoundingBoxAscent):
1693         (WebCore::TextMetrics::setFontBoundingBoxAscent):
1694         (WebCore::TextMetrics::fontBoundingBoxDescent):
1695         (WebCore::TextMetrics::setFontBoundingBoxDescent):
1696         (WebCore::TextMetrics::actualBoundingBoxAscent):
1697         (WebCore::TextMetrics::setActualBoundingBoxAscent):
1698         (WebCore::TextMetrics::actualBoundingBoxDescent):
1699         (WebCore::TextMetrics::setActualBoundingBoxDescent):
1700         (WebCore::TextMetrics::emHeightAscent):
1701         (WebCore::TextMetrics::setEmHeightAscent):
1702         (WebCore::TextMetrics::emHeightDescent):
1703         (WebCore::TextMetrics::setEmHeightDescent):
1704         (WebCore::TextMetrics::hangingBaseline):
1705         (WebCore::TextMetrics::setHangingBaseline):
1706         (WebCore::TextMetrics::alphabeticBaseline):
1707         (WebCore::TextMetrics::setAlphabeticBaseline):
1708         (WebCore::TextMetrics::ideographicBaseline):
1709         (WebCore::TextMetrics::setIdeographicBaseline):
1710         Added getters and setters.
1711         (WebCore::TextMetrics::TextMetrics): Deleted.
1712         * html/TextMetrics.idl: Added new attributes.
1713         * html/canvas/CanvasRenderingContext2D.cpp:
1714         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
1715         Changed the return value type to a const reference of FontMetrics
1716         not to copy it.
1717         (WebCore::CanvasRenderingContext2D::FontProxy::width):
1718         Added the second arguemnt of GlyphOverflow type.
1719         (WebCore::CanvasRenderingContext2D::measureText): Calculate and
1720         set the new attributes of TextMetrics.
1721         (WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal.
1722         (WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the
1723         offset calculation code and call textOffset.
1724         * html/canvas/CanvasRenderingContext2D.h: Added the method
1725         declaration of textOffset. Change types of fontMetrics and width
1726         methods.
1727         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1728         (WebCore::FontCascade::floatWidthForComplexText): Added a dummy
1729         implementation of calculating GlyphOverflow.
1730
1731 2017-07-26  Devin Rousso  <drousso@apple.com>
1732
1733         Web Inspector: create protocol for recording Canvas contexts
1734         https://bugs.webkit.org/show_bug.cgi?id=174481
1735
1736         Reviewed by Joseph Pecoraro.
1737
1738         Currently, a recording doesn't actually "start" until an action is performed on the context.
1739         This change adds the recording logic, but it does not use it anywhere. Additonal tests will
1740         be added in the patches that add uses:
1741          - <https://webkit.org/b/174482> Web Inspector: Record actions performed on CanvasRenderingContext2D
1742          - <https://webkit.org/b/174483> Web Inspector: Record actions performed on WebGLRenderingContext
1743
1744         Test: inspector/model/recording.html
1745
1746         * bindings/scripts/IDLAttributes.json:
1747         * bindings/scripts/CodeGeneratorJS.pm:
1748         (GenerateAttributeGetterBodyDefinition):
1749         (GenerateAttributeSetterBodyDefinition):
1750         (GenerateImplementationFunctionCall):
1751         * WebCore.xcodeproj/project.pbxproj:
1752         * bindings/js/CallTracer.h: Added.
1753         * bindings/js/CallTracer.cpp: Added.
1754         (WebCore::CallTracer::recordCanvasAction):
1755         * bindings/js/CallTracerTypes.h: Added.
1756         * bindings/scripts/test/TestCallTracer.idl: Added.
1757         * bindings/scripts/test/JS/JSTestCallTracer.h: Added.
1758         * bindings/scripts/test/JS/JSTestCallTracer.cpp: Added.
1759
1760         Create new IDL extended attribute called "CallTracingCallback" that will add code to call a
1761         static function on CallTracer with the given extended attribute value as the function name,
1762         the `impl` object as the first parameter, the name of the attribute/operation as the second,
1763         and an optional object that accepts an initializer list of all the parameters as the third.
1764
1765         This function will not be called, however, unless a `callTracingActive` function on the
1766         `impl` object returns true, and this is marked as UNLIKELY.
1767
1768         "CallTracingCallback" can be added to an Interface, in which case it will apply to all
1769         attributes/operations of the generated class, or an individual Attribute/Operation.
1770
1771         * html/canvas/CanvasRenderingContext.h:
1772         (WebCore::CanvasRenderingContext::callTracingActive):
1773         (WebCore::CanvasRenderingContext::setCallTracingActive):
1774
1775         * inspector/InspectorCanvas.h:
1776         * inspector/InspectorCanvas.cpp:
1777         (WebCore::InspectorCanvas::~InspectorCanvas):
1778         (WebCore::InspectorCanvas::resetRecordingData):
1779         (WebCore::InspectorCanvas::hasRecordingData):
1780         (WebCore::InspectorCanvas::recordAction):
1781         (WebCore::InspectorCanvas::releaseInitialState):
1782         (WebCore::InspectorCanvas::releaseFrames):
1783         (WebCore::InspectorCanvas::releaseData):
1784         (WebCore::InspectorCanvas::markNewFrame):
1785         (WebCore::InspectorCanvas::markCurrentFrameIncomplete):
1786         (WebCore::InspectorCanvas::setBufferLimit):
1787         (WebCore::InspectorCanvas::hasBufferSpace):
1788         (WebCore::InspectorCanvas::singleFrame):
1789         (WebCore::InspectorCanvas::setSingleFrame):
1790         (WebCore::InspectorCanvas::indexForData):
1791         (WebCore::buildArrayForAffineTransform):
1792         (WebCore::buildArrayForVector):
1793         (WebCore::InspectorCanvas::buildInitialState):
1794         (WebCore::InspectorCanvas::buildAction):
1795         (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
1796         (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
1797         (WebCore::InspectorCanvas::buildArrayForImageData):
1798
1799         Hold the recording data on the corresponding InspectorCanvas. Recording Frames are
1800         completed when the HTMLCanvasElement paints or a  0_s timer is fired. A recording is not
1801         considered valid until at least one action is performed on the canvas context. Once that
1802         condition is satisfied, canceling the recording will flush the data.
1803
1804         * inspector/InspectorCanvasAgent.h:
1805         * inspector/InspectorCanvasAgent.cpp:
1806         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
1807         (WebCore::InspectorCanvasAgent::disable):
1808         (WebCore::InspectorCanvasAgent::requestRecording):
1809         (WebCore::InspectorCanvasAgent::cancelRecording):
1810         (WebCore::InspectorCanvasAgent::recordCanvasAction):
1811         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1812         (WebCore::InspectorCanvasAgent::canvasDestroyed):
1813         (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
1814         (WebCore::InspectorCanvasAgent::clearCanvasData):
1815
1816         * inspector/InspectorInstrumentation.h:
1817         * inspector/InspectorInstrumentation.cpp:
1818         (WebCore::InspectorInstrumentation::recordCanvasAction):
1819         (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
1820         (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
1821
1822         * html/canvas/CanvasRenderingContext2D.h:
1823         * html/canvas/CanvasRenderingContext2D.cpp:
1824         (WebCore::CanvasRenderingContext2D::stringForWindingRule):
1825         (WebCore::CanvasRenderingContext2D::stringForImageSmoothingQuality):
1826
1827         * platform/graphics/Gradient.h:
1828         (WebCore::Gradient::stops):
1829
1830         * svg/SVGPathUtilities.h:
1831         * svg/SVGPathUtilities.cpp:
1832         (WebCore::buildStringFromPath):
1833
1834 2017-07-26  Ali Juma  <ajuma@chromium.org>
1835
1836         Implement document.elementsFromPoint
1837         https://bugs.webkit.org/show_bug.cgi?id=153137
1838
1839         Reviewed by Simon Fraser.
1840
1841         This ports Blink's implementation of elementsFromPoint, from the
1842         following patches by Philip Rogers (pdr@chromium.org):
1843         -https://src.chromium.org/viewvc/blink?revision=190686&view=revision
1844         -https://src.chromium.org/viewvc/blink?revision=191240&view=revision
1845         -https://src.chromium.org/viewvc/blink?revision=199214&view=revision
1846
1847         Tests: imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-iframes.html
1848                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html
1849                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html
1850                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-simple.html
1851                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-svg.html
1852                imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-table.html
1853
1854         * dom/DocumentOrShadowRoot.idl:
1855         * dom/TreeScope.cpp:
1856         (WebCore::absolutePointIfNotClipped):
1857         (WebCore::TreeScope::nodeFromPoint):
1858         (WebCore::TreeScope::elementFromPoint):
1859         (WebCore::TreeScope::elementsFromPoint):
1860         * dom/TreeScope.h:
1861         * page/EventHandler.cpp:
1862         (WebCore::EventHandler::hitTestResultAtPoint):
1863         * rendering/EllipsisBox.cpp:
1864         (WebCore::EllipsisBox::nodeAtPoint):
1865         * rendering/HitTestRequest.h:
1866         (WebCore::HitTestRequest::HitTestRequest):
1867         (WebCore::HitTestRequest::resultIsElementList):
1868         (WebCore::HitTestRequest::includesAllElementsUnderPoint):
1869         * rendering/HitTestResult.cpp:
1870         (WebCore::HitTestResult::HitTestResult):
1871         (WebCore::HitTestResult::operator=):
1872         (WebCore::HitTestResult::addNodeToListBasedTestResult):
1873         (WebCore::HitTestResult::append):
1874         (WebCore::HitTestResult::listBasedTestResult):
1875         (WebCore::HitTestResult::mutableListBasedTestResult):
1876         (WebCore::HitTestResult::addNodeToRectBasedTestResult): Deleted.
1877         (WebCore::HitTestResult::rectBasedTestResult): Deleted.
1878         (WebCore::HitTestResult::mutableRectBasedTestResult): Deleted.
1879         * rendering/HitTestResult.h:
1880         * rendering/InlineFlowBox.cpp:
1881         (WebCore::InlineFlowBox::nodeAtPoint):
1882         * rendering/InlineTextBox.cpp:
1883         (WebCore::InlineTextBox::nodeAtPoint):
1884         * rendering/RenderBlock.cpp:
1885         (WebCore::RenderBlock::nodeAtPoint):
1886         * rendering/RenderBox.cpp:
1887         (WebCore::RenderBox::nodeAtPoint):
1888         * rendering/RenderImage.cpp:
1889         (WebCore::RenderImage::nodeAtPoint):
1890         * rendering/RenderInline.cpp:
1891         (WebCore::RenderInline::hitTestCulledInline):
1892         * rendering/RenderLayer.cpp:
1893         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
1894         (WebCore::RenderLayer::hitTestLayer):
1895         (WebCore::RenderLayer::hitTestContents):
1896         (WebCore::RenderLayer::hitTestList):
1897         (WebCore::RenderLayer::calculateClipRects):
1898         * rendering/RenderTable.cpp:
1899         (WebCore::RenderTable::nodeAtPoint):
1900         * rendering/RenderTableSection.cpp:
1901         (WebCore::RenderTableSection::nodeAtPoint):
1902         * rendering/RenderWidget.cpp:
1903         (WebCore::RenderWidget::nodeAtPoint):
1904         * rendering/SimpleLineLayoutFunctions.cpp:
1905         (WebCore::SimpleLineLayout::hitTestFlow):
1906         * rendering/svg/RenderSVGContainer.cpp:
1907         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
1908         * rendering/svg/RenderSVGImage.cpp:
1909         (WebCore::RenderSVGImage::nodeAtFloatPoint):
1910         * rendering/svg/RenderSVGRoot.cpp:
1911         (WebCore::RenderSVGRoot::nodeAtPoint):
1912         * rendering/svg/RenderSVGShape.cpp:
1913         (WebCore::RenderSVGShape::nodeAtFloatPoint):
1914         * rendering/svg/SVGInlineTextBox.cpp:
1915         (WebCore::SVGInlineTextBox::nodeAtPoint):
1916         * testing/Internals.cpp:
1917         (WebCore::Internals::nodesFromRect):
1918
1919 2017-07-26  Charlie Turner  <cturner@igalia.com>
1920
1921         [GStreamer] Review WebKitWebSource after r219252.
1922         https://bugs.webkit.org/show_bug.cgi?id=174415
1923
1924         Reviewed by Carlos Garcia Campos.
1925
1926         Remove ResourceHandleStreamingClient, and flatten the StreamingClient
1927         into CachedResourceStreamingClient (the only implemetation left). They
1928         are no longer required after r219252.
1929
1930         Also remove the locking code. It's not needed now, and what existed
1931         was heavy-handed and missed several cases it was supposed to protect
1932
1933         Covered by existing tests.
1934
1935         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1936         (webkit_web_src_init):
1937         (webKitWebSrcDispose):
1938         (webKitWebSrcStop):
1939         (webKitWebSrcStart):
1940         (webKitWebSrcNeedData):
1941         (webKitWebSrcEnoughData):
1942         (webKitWebSrcSeek):
1943         (webKitWebSrcSetMediaPlayer):
1944         (CachedResourceStreamingClient::CachedResourceStreamingClient):
1945         (CachedResourceStreamingClient::~CachedResourceStreamingClient):
1946         (CachedResourceStreamingClient::getOrCreateReadBuffer):
1947         (CachedResourceStreamingClient::responseReceived):
1948         (CachedResourceStreamingClient::dataReceived):
1949         (CachedResourceStreamingClient::loadFinished):
1950         (ResourceHandleStreamingClient::create): Deleted.
1951         (): Deleted.
1952         (StreamingClient::StreamingClient): Deleted.
1953         (StreamingClient::~StreamingClient): Deleted.
1954         (StreamingClient::createReadBuffer): Deleted.
1955         (StreamingClient::handleResponseReceived): Deleted.
1956         (StreamingClient::handleDataReceived): Deleted.
1957         (StreamingClient::handleNotifyFinished): Deleted.
1958         (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Deleted.
1959         (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Deleted.
1960         (ResourceHandleStreamingClient::cleanupAndStopRunLoop): Deleted.
1961         (ResourceHandleStreamingClient::invalidate): Deleted.
1962         (ResourceHandleStreamingClient::loadFailed): Deleted.
1963         (ResourceHandleStreamingClient::setDefersLoading): Deleted.
1964         (ResourceHandleStreamingClient::getOrCreateReadBuffer): Deleted.
1965         (ResourceHandleStreamingClient::willSendRequest): Deleted.
1966         (ResourceHandleStreamingClient::didReceiveResponse): Deleted.
1967         (ResourceHandleStreamingClient::didReceiveData): Deleted.
1968         (ResourceHandleStreamingClient::didReceiveBuffer): Deleted.
1969         (ResourceHandleStreamingClient::didFinishLoading): Deleted.
1970         (ResourceHandleStreamingClient::didFail): Deleted.
1971         (ResourceHandleStreamingClient::wasBlocked): Deleted.
1972         (ResourceHandleStreamingClient::cannotShowURL): Deleted.
1973
1974 2017-07-26  Brian Burg  <bburg@apple.com>
1975
1976         Remove WEB_TIMING feature flag
1977         https://bugs.webkit.org/show_bug.cgi?id=174795
1978
1979         Reviewed by Alex Christensen.
1980
1981         * Configurations/FeatureDefines.xcconfig:
1982         * bindings/js/JSPerformanceEntryCustom.cpp:
1983         * dom/Document.cpp:
1984         (WebCore::Document::setReadyState):
1985         (WebCore::Document::finishedParsing):
1986         * dom/Document.h:
1987         (WebCore::Document::timing):
1988         * dom/DocumentTiming.h:
1989         * dom/EventTargetFactory.in:
1990         * loader/DocumentThreadableLoader.cpp:
1991         (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
1992         (WebCore::DocumentThreadableLoader::loadRequest):
1993         * loader/DocumentThreadableLoader.h:
1994         * loader/ResourceTimingInformation.cpp:
1995         * loader/ResourceTimingInformation.h:
1996         * loader/SubresourceLoader.cpp:
1997         (WebCore::SubresourceLoader::didFinishLoading):
1998         (WebCore::SubresourceLoader::reportResourceTiming):
1999         * loader/SubresourceLoader.h:
2000         * loader/ThreadableLoaderClient.h:
2001         (WebCore::ThreadableLoaderClient::didFail):
2002         (WebCore::ThreadableLoaderClient::didFinishTiming):
2003         * loader/WorkerThreadableLoader.cpp:
2004         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
2005         * loader/WorkerThreadableLoader.h:
2006         * loader/cache/CachedResourceLoader.cpp:
2007         (WebCore::CachedResourceLoader::requestResource):
2008         (WebCore::CachedResourceLoader::revalidateResource):
2009         (WebCore::CachedResourceLoader::loadResource):
2010         * loader/cache/CachedResourceLoader.h:
2011         (WebCore::CachedResourceLoader::resourceTimingInformation):
2012         * page/DOMWindow.cpp:
2013         (WebCore::DOMWindow::~DOMWindow):
2014         (WebCore::DOMWindow::resetDOMWindowProperties):
2015         (WebCore::DOMWindow::nowTimestamp):
2016         (WebCore::DOMWindow::removeAllEventListeners):
2017         * page/DOMWindow.h:
2018         * page/GlobalPerformance.idl:
2019         * page/Performance.cpp:
2020         * page/Performance.h:
2021         * page/Performance.idl:
2022         * page/PerformanceEntry.cpp:
2023         * page/PerformanceEntry.h:
2024         * page/PerformanceEntry.idl:
2025         * page/PerformanceMark.h:
2026         * page/PerformanceMark.idl:
2027         * page/PerformanceMeasure.h:
2028         * page/PerformanceMeasure.idl:
2029         * page/PerformanceNavigation.cpp:
2030         * page/PerformanceNavigation.h:
2031         * page/PerformanceNavigation.idl:
2032         * page/PerformanceObserver.cpp:
2033         * page/PerformanceObserver.h:
2034         * page/PerformanceObserver.idl:
2035         * page/PerformanceObserverCallback.h:
2036         * page/PerformanceObserverCallback.idl:
2037         * page/PerformanceObserverEntryList.cpp:
2038         * page/PerformanceObserverEntryList.h:
2039         * page/PerformanceObserverEntryList.idl:
2040         * page/PerformanceResourceTiming.cpp:
2041         * page/PerformanceResourceTiming.h:
2042         * page/PerformanceResourceTiming.idl:
2043         * page/PerformanceTiming.cpp:
2044         * page/PerformanceTiming.h:
2045         * page/PerformanceTiming.idl:
2046         * page/PerformanceUserTiming.cpp:
2047         * page/PerformanceUserTiming.h:
2048         * platform/network/ResourceHandle.h:
2049         * platform/network/ResourceHandleInternal.h:
2050         * platform/network/cf/ResourceHandleCFNet.cpp:
2051         (WebCore::ResourceHandle::start):
2052         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2053         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2054         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2055         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2056         * platform/network/curl/ResourceHandleCurl.cpp:
2057         (WebCore::ResourceHandleInternal::didFinish):
2058         (WebCore::ResourceHandleInternal::calculateWebTimingInformations):
2059         (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
2060         * platform/network/mac/ResourceHandleMac.mm:
2061         (WebCore::ResourceHandle::createNSURLConnection):
2062         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2063         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
2064         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2065         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
2066         * platform/network/soup/ResourceHandleSoup.cpp:
2067         (WebCore::restartedCallback):
2068         (WebCore::sendRequestCallback):
2069         (WebCore::createSoupMessageForHandleAndRequest):
2070         (WebCore::ResourceHandle::sendPendingRequest):
2071         * platform/network/soup/SoupNetworkSession.cpp:
2072         (WebCore::SoupNetworkSession::SoupNetworkSession):
2073         * workers/WorkerGlobalScope.cpp:
2074         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2075         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
2076         (WebCore::WorkerGlobalScope::removeAllEventListeners):
2077         * workers/WorkerGlobalScope.h:
2078
2079 2017-07-26  Chris Dumez  <cdumez@apple.com>
2080
2081         Pressing the Escape key should not be a valid user gesture to enter fullscreen
2082         https://bugs.webkit.org/show_bug.cgi?id=174864
2083         <rdar://problem/33009088>
2084
2085         Reviewed by Geoffrey Garen.
2086
2087         Pressing the Escape key should not be a valid user gesture to enter fullscreen since this
2088         is the gesture to exit fullscreen already.
2089
2090         Test: fullscreen/requestFullscreen-escape-key.html
2091
2092         * dom/Document.cpp:
2093         (WebCore::Document::requestFullScreenForElement):
2094         * dom/UserGestureIndicator.cpp:
2095         (WebCore::UserGestureIndicator::UserGestureIndicator):
2096         * dom/UserGestureIndicator.h:
2097         (WebCore::UserGestureToken::create):
2098         (WebCore::UserGestureToken::gestureType):
2099         (WebCore::UserGestureToken::UserGestureToken):
2100         * page/EventHandler.cpp:
2101         (WebCore::EventHandler::internalKeyEvent):
2102
2103 2017-07-26  Nan Wang  <n_wang@apple.com>
2104
2105         AX: Incorrect range from index and length in contenteditable with <p> tags
2106         https://bugs.webkit.org/show_bug.cgi?id=174856
2107
2108         Reviewed by Chris Fleizach.
2109
2110         When asking for the string inside a text control with a given range, we sometimes get
2111         a wrong string at the line boundary due to a bad plain range to text marker conversion.
2112         To fix this, we should use the exsisting method on text controls to avoid this issue. 
2113
2114         Updated the test to test the problematic case.
2115
2116         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2117         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2118
2119 2017-07-26  Daewoong Jang  <daewoong.jang@navercorp.com>
2120
2121         [Curl] Bug fix after r219606
2122         https://bugs.webkit.org/show_bug.cgi?id=174845
2123
2124         Reviewed by Alex Christensen.
2125
2126         * platform/network/curl/CurlContext.h:
2127         (WebCore::CurlSList::isEmpty):
2128         * platform/network/curl/ResourceHandleCurl.cpp:
2129         (WebCore::ResourceHandleInternal::didReceiveHeaderLine):
2130         (WebCore::ResourceHandleInternal::headerCallback):
2131
2132 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
2133
2134         [EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
2135         https://bugs.webkit.org/show_bug.cgi?id=174779
2136
2137         Reviewed by Xabier Rodriguez-Calvar.
2138
2139         In the CENC decryptor, the key ID value is retrieved from the info structure
2140         on the GstProtectionMeta object. GstBuffer for that value is retrieved and
2141         passed to the setupCipher() function.
2142
2143         In the ClearKey decryptor (which extends the CENC decryptor), the single
2144         GstBuffer object on the private instance that holds the key value is replaced
2145         with a Vector object that holds pairs of key ID and value GstBuffers. In the
2146         handleKeyResponse() implementation that Vector is emptied and then refilled
2147         with key ID and value pairs that are passed in through the drm-cipher-clearkey
2148         structure that's attached to the GstEvent that signalled new key information.
2149
2150         In the ClearKey decryptor's setupCipher() implementation the passed-in key ID
2151         buffer is used to find a matching key ID and value pair stored on the private
2152         instance. If not found, an error is thrown. If found, the matching key value
2153         is used for decryption.
2154
2155         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2156         (webKitMediaClearKeyDecryptorHandleKeyResponse):
2157         (webKitMediaClearKeyDecryptorSetupCipher):
2158         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2159         (webkitMediaCommonEncryptionDecryptTransformInPlace):
2160         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
2161         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
2162
2163 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
2164
2165         [EME][GStreamer] Handle ClearKey as a supported key system
2166         https://bugs.webkit.org/show_bug.cgi?id=174778
2167
2168         Reviewed by Xabier Rodriguez-Calvar.
2169
2170         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2171         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
2172         Return true for the 'org.w3.clearkey' key system when building with
2173         ENCRYPTED_MEDIA enabled. The underlying implementation will follow.
2174
2175 2017-07-26  Claudio Saavedra  <csaavedra@igalia.com>
2176
2177         [WPE] Fix a potential crash in the platform pasteboard when reading a string
2178         https://bugs.webkit.org/show_bug.cgi?id=174859
2179
2180         Reviewed by Žan Doberšek.
2181
2182         We shouldn't assume that the wpe_pasteboard_string struct will be
2183         filled in, so initialize it.
2184
2185         * platform/wpe/PlatformPasteboardWPE.cpp:
2186         (WebCore::PlatformPasteboard::readString): Initialize the struct
2187         before passing it to wpe and early return if it's still empty.
2188
2189 2017-07-26  Javier Fernandez  <jfernandez@igalia.com>
2190
2191         InsertOrderedList command applied to table cells inserts an extra BR before the table
2192         https://bugs.webkit.org/show_bug.cgi?id=174593
2193
2194         Reviewed by Darin Adler.
2195
2196         Don't add BR when pruning empty blocks if it's the start of a paragraph.
2197
2198         The function MoveParagraph is used for several operations and editing
2199         commands, like 'insertOrderedList'. When moving paragraphs we check out
2200         whether we should add a 'br' element to avoid undesired block collapse.
2201
2202         However, we shouldn't do this when destination is the start of a
2203         paragraph.
2204
2205         Tests: editing/inserting/insert-list-in-table-cell-01.html
2206                editing/inserting/insert-list-in-table-cell-02.html
2207                editing/inserting/insert-list-in-table-cell-03.html
2208                editing/inserting/insert-list-in-table-cell-04.html
2209                editing/inserting/insert-list-in-table-cell-05.html
2210                editing/inserting/insert-list-in-table-cell-06.html
2211                editing/inserting/insert-list-in-table-cell-07.html
2212                editing/inserting/insert-list-in-table-cell-08.html
2213
2214         * editing/CompositeEditCommand.cpp:
2215         (WebCore::CompositeEditCommand::moveParagraphs):
2216
2217 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
2218
2219         [WPE] WebGL2 support
2220         https://bugs.webkit.org/show_bug.cgi?id=174249
2221
2222         Reviewed by Alex Christensen.
2223
2224         Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep
2225         the implementation specific to libepoxy (which WPE leverages by default).
2226
2227         In the GraphicsContext3D::create() method, we first construct the
2228         GraphicsContext3D object that also ensures a current GL context on this thread.
2229         Only then can we determine through libepoxy whether the underlying GL library
2230         is able to support WebGL2.
2231
2232         For WebGL2, the GLES3 support is required. The initial libepoxy implementation
2233         ensures this only in case of 'non-desktop GL' library of minimum version 3.0.
2234         This effectively translates to the only supported configuration being the
2235         EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we
2236         discard the existing GraphicsContext3D object and return null.
2237
2238         WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't
2239         been tested yet. Implementation will in the future be extended to support that
2240         as required.
2241
2242         In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor
2243         has to now receive the second argument, the desired shader specification that's
2244         used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1,
2245         and SH_WEBGL2_SPEC for WebGL2.
2246
2247         No new tests -- a small set of existing WebGL2 tests is unskipped and passing.
2248
2249         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2250         (WebCore::GraphicsContext3D::create):
2251         (WebCore::GraphicsContext3D::GraphicsContext3D):
2252         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2253         Add WebGL2-specific methods to the build.
2254
2255 2017-07-26  Nan Wang  <n_wang@apple.com>
2256
2257         AX: should dispatch accessibilityPerformPressAction async on MacOS
2258         https://bugs.webkit.org/show_bug.cgi?id=174849
2259
2260         Reviewed by Chris Fleizach.
2261
2262         If performing the accessibility press action results in a modal alert being displayed,
2263         it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously.
2264
2265         Updated tests to adapt to this change.
2266
2267         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2268         (-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]):
2269         (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
2270
2271 2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2272
2273         Icon loader error on startup
2274         https://bugs.webkit.org/show_bug.cgi?id=174787
2275
2276         Reviewed by Brady Eidson.
2277
2278         This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about
2279         pages. IconController::startLoader() did several checks before starting the load that
2280         DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have
2281         an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the
2282         same checks now before starting to load icons.
2283
2284         * loader/DocumentLoader.cpp:
2285         (WebCore::DocumentLoader::startIconLoading):
2286
2287 2017-07-25  Sam Weinig  <sam@webkit.org>
2288
2289         [WebIDL] Remove custom bindings for HTMLCanvasElement
2290         https://bugs.webkit.org/show_bug.cgi?id=174847
2291
2292         Reviewed by Darin Adler.
2293
2294         * CMakeLists.txt:
2295         * WebCore.xcodeproj/project.pbxproj:
2296         * bindings/js/JSBindingsAllInOne.cpp:
2297         * bindings/js/JSHTMLCanvasElementCustom.cpp: Removed.
2298         Remove JSHTMLCanvasElementCustom.
2299
2300         * html/HTMLCanvasElement.cpp:
2301         (WebCore::HTMLCanvasElement::getContext):
2302         (WebCore::HTMLCanvasElement::getContext2d):
2303         (WebCore::HTMLCanvasElement::getContextWebGL):
2304         (WebCore::HTMLCanvasElement::getContextWebGPU):
2305         * html/HTMLCanvasElement.h:
2306         * html/HTMLCanvasElement.idl:
2307         Move context picking code to HTMLCanvasElement. Give more
2308         exact types to remaining context getters.
2309
2310 2017-07-25  Chris Dumez  <cdumez@apple.com>
2311
2312         Clean up ExceptionCode enumeration
2313         https://bugs.webkit.org/show_bug.cgi?id=174812
2314
2315         Reviewed by Darin Adler.
2316
2317         Clean up ExceptionCode enumeration:
2318         - Updated comments to reflect the latest WebIDL specification
2319         - Drop special values given to some exception codes. Those legacy codes are already in the
2320           table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException
2321           table
2322         - Drop NoException value in the enumeration and use std::optional<ExceptionCode> when needed
2323           instead.
2324
2325         * Modules/indexeddb/shared/IDBError.cpp:
2326         (WebCore::IDBError::IDBError):
2327         (WebCore::IDBError::name):
2328         (WebCore::IDBError::message):
2329         * Modules/indexeddb/shared/IDBError.h:
2330         (WebCore::IDBError::code):
2331         (WebCore::IDBError::encode):
2332         (WebCore::IDBError::decode):
2333         * dom/DOMException.cpp:
2334         * dom/ExceptionCode.h:
2335         * fileapi/FileReaderSync.cpp:
2336         (WebCore::errorCodeToException):
2337         (WebCore::FileReaderSync::startLoading):
2338         * xml/XMLHttpRequest.cpp:
2339         (WebCore::XMLHttpRequest::createRequest):
2340         * xml/XMLHttpRequest.h:
2341
2342 2017-07-25  Andy Estes  <aestes@apple.com>
2343
2344         [Apple Pay] Add "carteBancaire" as a supported payment network
2345         https://bugs.webkit.org/show_bug.cgi?id=174841
2346         <rdar://problem/31935596>
2347
2348         Reviewed by Alex Christensen.
2349
2350         Tests: http/tests/ssl/applepay/ApplePaySession.html
2351                http/tests/ssl/applepay/ApplePaySessionV3.html
2352
2353         * Modules/applepay/PaymentRequest.cpp:
2354         (WebCore::PaymentRequest::isValidSupportedNetwork):
2355
2356 2017-07-25  Daniel Bates  <dabates@apple.com>
2357
2358         Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions
2359         https://bugs.webkit.org/show_bug.cgi?id=174827
2360
2361         Reviewed by Simon Fraser.
2362
2363         StyleResolver::isValid{Cue, Region}StyleProperty() access neither instance nor
2364         class data. Moreover, they are private member functions and hence cannot be
2365         used outside of StyleResolver's implementation. So, make these static, inline,
2366         non-member functions.
2367
2368         * css/StyleResolver.cpp:
2369         (WebCore::isValidRegionStyleProperty):
2370         (WebCore::isValidCueStyleProperty):
2371         (WebCore::StyleResolver::CascadedProperties::addMatch):
2372         (WebCore::StyleResolver::isValidRegionStyleProperty): Deleted.
2373         (WebCore::StyleResolver::isValidCueStyleProperty): Deleted.
2374         * css/StyleResolver.h:
2375
2376 2017-07-25  Per Arne Vollan  <pvollan@apple.com>
2377
2378         Dragged links are blurry on 1x displays.
2379         https://bugs.webkit.org/show_bug.cgi?id=174831
2380         <rdar://problem/33519698>
2381
2382         Reviewed by Simon Fraser.
2383
2384         When the width and height of the drag image is a multiple of 2, the drag image is not blurry
2385         on a 1x display. This is a workaround which should be removed when <rdar://problem/33059739>
2386         is fixed.
2387
2388         No new tests, since this is not straightforward to test with a layout test.
2389
2390         * platform/mac/DragImageMac.mm:
2391         (WebCore::LinkImageLayout::LinkImageLayout):
2392
2393 2017-07-25  Matt Baker  <mattbaker@apple.com>
2394
2395         Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation
2396         https://bugs.webkit.org/show_bug.cgi?id=174738
2397
2398         Reviewed by Brian Burg.
2399
2400         Relocate AsyncCallType from InspectorInstrumentation to the debugger
2401         agent. Plumbing for `requestAnimationFrame` notifications has been added
2402         to PageDebuggerAgent, which is responsible for managing async stack traces. 
2403
2404         * dom/ScriptedAnimationController.cpp:
2405         (WebCore::ScriptedAnimationController::registerCallback):
2406         (WebCore::ScriptedAnimationController::cancelCallback):
2407         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
2408
2409         * inspector/InspectorInstrumentation.cpp:
2410         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
2411         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
2412         (WebCore::InspectorInstrumentation::willFireTimerImpl):
2413         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
2414         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
2415         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
2416         (): Deleted.
2417         (WebCore::didScheduleAsyncCall): Deleted.
2418
2419         * inspector/InspectorInstrumentation.h:
2420         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
2421         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
2422         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
2423         Replaced Frame and Document pointers with references and moved
2424         pointer validation upstream.
2425
2426         * inspector/PageDebuggerAgent.cpp:
2427         (WebCore::PageDebuggerAgent::didRequestAnimationFrame):
2428         (WebCore::PageDebuggerAgent::willFireAnimationFrame):
2429         (WebCore::PageDebuggerAgent::didCancelAnimationFrame):
2430         * inspector/PageDebuggerAgent.h:
2431
2432 2017-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
2433
2434         Async image decoding for large images should be disabled after the first time a tile is painted
2435         https://bugs.webkit.org/show_bug.cgi?id=174451
2436         <rdar://problem/31246421>
2437
2438         Reviewed by Simon Fraser.
2439
2440         Flashing because of DOM mutation can be fixed by disabling the asynchronous
2441         image decoding after the first time a tile was painted.
2442
2443         We can detect this by consulting the tile repaintCount. If it is zero, then
2444         it is safe to use asynchronous image decoded. If the tile repaintCount is
2445         greater than zero, we are not sure if the renderer rectangle has an image
2446         drawn in it already or not. In this case we have to use the synchronous
2447         image decoding to avoid causing a flash.
2448
2449         Tests: fast/images/async-image-background-change.html
2450                fast/images/async-image-src-change.html
2451                http/tests/multipart/multipart-async-image.html
2452
2453         * html/shadow/MediaControlElements.cpp:
2454         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
2455         * page/FrameView.cpp:
2456         (WebCore::FrameView::willPaintContents):
2457         (WebCore::FrameView::paintContentsForSnapshot):
2458         * page/PageOverlayController.cpp:
2459         (WebCore::PageOverlayController::paintContents):
2460         * page/PageOverlayController.h:
2461         * page/linux/ResourceUsageOverlayLinux.cpp:
2462         * page/mac/ServicesOverlayController.h:
2463         * page/mac/ServicesOverlayController.mm:
2464         (WebCore::ServicesOverlayController::Highlight::paintContents):
2465         * platform/graphics/BitmapImage.cpp:
2466         (WebCore::BitmapImage::draw):
2467         * platform/graphics/BitmapImage.h:
2468         * platform/graphics/GraphicsLayer.cpp:
2469         (WebCore::GraphicsLayer::paintGraphicsLayerContents):
2470         * platform/graphics/GraphicsLayer.h:
2471         * platform/graphics/GraphicsLayerClient.h:
2472         (WebCore::GraphicsLayerClient::paintContents):
2473         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2474         (WebCore::LayerClient::platformCALayerPaintContents):
2475         * platform/graphics/ca/GraphicsLayerCA.cpp:
2476         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
2477         * platform/graphics/ca/GraphicsLayerCA.h:
2478         * platform/graphics/ca/PlatformCALayer.h:
2479         * platform/graphics/ca/PlatformCALayerClient.h:
2480         (WebCore::PlatformCALayerClient::platformCALayerRepaintCount):
2481         * platform/graphics/ca/TileCoverageMap.cpp:
2482         (WebCore::TileCoverageMap::platformCALayerPaintContents):
2483         * platform/graphics/ca/TileCoverageMap.h:
2484         * platform/graphics/ca/TileGrid.cpp:
2485         (WebCore::TileGrid::platformCALayerPaintContents):
2486         (WebCore::TileGrid::platformCALayerRepaintCount):
2487         * platform/graphics/ca/TileGrid.h:
2488         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2489         (PlatformCALayer::drawLayerContents):
2490         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2491         (PlatformCALayer::drawLayerContents):
2492         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2493         (PlatformCALayerWinInternal::displayCallback):
2494         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
2495         (WebTiledBackingLayerWin::displayCallback):
2496         * platform/graphics/mac/WebLayer.mm:
2497         (-[WebLayer drawInContext:]):
2498         (-[WebSimpleLayer drawInContext:]):
2499         * rendering/PaintPhase.h:
2500         * rendering/RenderBoxModelObject.cpp:
2501         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
2502         * rendering/RenderElement.h:
2503         * rendering/RenderLayer.cpp:
2504         (WebCore::RenderLayer::paintLayerContents):
2505         (WebCore::RenderLayer::paintForegroundForFragments):
2506         * rendering/RenderLayerBacking.cpp:
2507         (WebCore::RenderLayerBacking::paintContents):
2508         * rendering/RenderLayerBacking.h:
2509         * rendering/RenderLayerCompositor.cpp:
2510         (WebCore::RenderLayerCompositor::paintContents):
2511         * rendering/RenderLayerCompositor.h:
2512         * rendering/RenderWidget.cpp:
2513         (WebCore::RenderWidget::paintContents):
2514         * testing/Internals.cpp:
2515         (WebCore::imageFromImageElement):
2516         (WebCore::bitmapImageFromImageElement):
2517         (WebCore::Internals::imageFrameIndex):
2518         (WebCore::Internals::setImageFrameDecodingDuration):
2519         (WebCore::Internals::resetImageAnimation):
2520         (WebCore::Internals::isImageAnimating):
2521         (WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
2522         (WebCore::Internals::imageDecodeCount):
2523         (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting):
2524         * testing/Internals.h:
2525         * testing/Internals.idl:
2526
2527 2017-07-23  Sam Weinig  <sam@webkit.org>
2528
2529         [WebIDL] Add support for generating timer bindings
2530         https://bugs.webkit.org/show_bug.cgi?id=174766
2531
2532         Reviewed by Darin Adler.
2533
2534         Adds a new non-standard type, ScheduledAction, which stands in for the
2535         standard (DOMString or Function). It would be good to move to that in
2536         future, but for now, this allows for forward momentum on removing custom
2537         bindings.
2538
2539         * WebCore.xcodeproj/project.pbxproj:
2540         Add JSDOMConvertScheduledAction.h.
2541
2542         * bindings/IDLTypes.h:
2543         Add IDLScheduledAction.
2544
2545         * bindings/js/JSDOMConvertScheduledAction.h: Added.
2546         (WebCore::Converter<IDLScheduledAction>::convert):
2547         Add conversion from JSValue -> ScheduledAction. This is moved from the old ScheduledAction
2548         create function.
2549
2550         * bindings/js/JSDOMConvertVariadic.h:
2551         (WebCore::convertVariadicArguments):
2552         (WebCore::Detail::VariadicConverterBase::convert): Deleted.
2553         (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert): Deleted.
2554         * bindings/js/JSDOMConvertBase.h:
2555         * bindings/js/JSDOMConvertAny.h:
2556         (WebCore::VariadicConverter<IDLAny>::convert):
2557         * bindings/js/JSDOMConvertInterface.h:
2558         (WebCore::VariadicConverter<IDLInterface<T>>::convert):
2559         Rename VariadicConverter to VariadicConverterDetails, and remove base class. Rename 
2560         VariadicConverterBase to VariadicConverter, and move specializations to the file
2561         containing the base converter for that IDL type 
2562
2563         * bindings/js/JSDOMWindowCustom.cpp:
2564         (WebCore::JSDOMWindow::setTimeout): Deleted.
2565         (WebCore::JSDOMWindow::setInterval): Deleted.
2566         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2567         (WebCore::JSWorkerGlobalScope::setTimeout): Deleted.
2568         (WebCore::JSWorkerGlobalScope::setInterval): Deleted.
2569         Remove custom implementations of setTimeout and setInterval.
2570
2571         * bindings/js/ScheduledAction.cpp:
2572         (WebCore::ScheduledAction::create):
2573         (WebCore::ScheduledAction::ScheduledAction):
2574         (WebCore::ScheduledAction::~ScheduledAction):
2575         (WebCore::ScheduledAction::addArguments):
2576         (WebCore::ScheduledAction::executeFunctionInContext):
2577         * bindings/js/ScheduledAction.h:
2578         (WebCore::ScheduledAction::ScheduledAction): Deleted.
2579         Rework ScheduledAction. Now has two create functions, one for the function
2580         form, one for the string form. These are now called by the Converter. Also,
2581         rather than extracting the arguments directly from the ExecState, allow the
2582         bindings to work as designed, and have the arguments come in as variadic 
2583         arguments to setTimeout/setInterval and get added to the ScheduledAction if
2584         needed. Also, move ContentSecurityPolicy check out of construction, and into
2585         setTimeout/setInterval.
2586
2587         * bindings/scripts/CodeGenerator.pm:
2588         (IsBuiltinType):
2589         Add ScheduledAction to the builtin list.
2590
2591         * bindings/scripts/CodeGeneratorJS.pm:
2592         (AddToIncludesForIDLType):
2593         Add the correct include when ScheduledAction is used.
2594
2595         (GenerateParametersCheck):
2596         Remove rule disallowing optional arguments before variadic arguments. That works
2597         just fine.
2598
2599         (GetBaseIDLType):
2600         Add mapping of ScheduledAction -> IDLScheduledAction.
2601
2602         (JSValueToNativeDOMConvertNeedsGlobalObject):
2603         Add ScheduledAction to the list of types that need a global object
2604         for conversion.
2605
2606         * page/WindowOrWorkerGlobalScope.idl:
2607         Update interface to match spec and add FIXMEs for moving to TimerHandler.
2608
2609         * page/DOMWindow.cpp:
2610         (WebCore::DOMWindow::setTimeout):
2611         (WebCore::DOMWindow::setInterval):
2612         * page/DOMWindow.h:
2613         * workers/WorkerGlobalScope.cpp:
2614         (WebCore::WorkerGlobalScope::setTimeout):
2615         (WebCore::WorkerGlobalScope::setInterval):
2616         * workers/WorkerGlobalScope.h:
2617         Update for new signatures. WorkerGlobalScope now has to return ExceptionOr<int>
2618         even though it never throws, due to having one IDL file defining these. This is 
2619         unfortunate and something we should look at addressing the future.
2620
2621 2017-07-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2622
2623         [WinCairo] Fix build with AllInOnes disabled
2624         https://bugs.webkit.org/show_bug.cgi?id=174784
2625         <rdar://problem/33488914>
2626
2627         Reviewed by Alex Christensen.
2628
2629         * PlatformWin.cmake:
2630         Add RenderThemeWin.cpp to WebCore_SOURCES
2631
2632         * rendering/RenderingAllInOne.cpp:
2633         Remove #include "RenderThemeWin.cpp"
2634
2635         * testing/MemoryInfo.h:
2636         Remove #include "JSDomWindow.h"
2637
2638         * bindings/js/JSDOMGlobalObject.cpp:
2639         * bindings/js/JSDOMPromiseDeferred.cpp:
2640         * bindings/js/JSDOMWrapper.cpp:
2641         * bindings/js/JSImageDataCustom.cpp:
2642         * bindings/scripts/CodeGeneratorJS.pm:
2643         (GenerateCallWith):
2644         * dom/ScriptExecutionContext.cpp:
2645         * inspector/InspectorController.cpp:
2646         * inspector/InspectorTimelineAgent.cpp:
2647         * rendering/RenderMediaControls.cpp:
2648         * rendering/RenderMediaControls.h:
2649         * rendering/RenderThemeWin.cpp:
2650
2651         * bindings/scripts/test/JS/JSTestObj.cpp:
2652         Update test results.
2653
2654 2017-07-25  Konstantin Tokarev  <annulen@yandex.ru>
2655
2656         Unreviewed, fix Mac CMake build after r219567
2657
2658         * PlatformMac.cmake:
2659
2660 2017-07-23  Darin Adler  <darin@apple.com>
2661
2662         More NeverDestroyed and related cleanup
2663         https://bugs.webkit.org/show_bug.cgi?id=174745
2664
2665         Reviewed by Alex Christensen.
2666
2667         * bindings/js/JSCustomElementInterface.cpp:
2668         (WebCore::JSCustomElementInterface::constructElementWithFallback):
2669         Use isNull() rather than comparing against nullAtom() since it's
2670         slightly more efficient.
2671
2672         * css/MediaQueryEvaluator.cpp:
2673         (WebCore::prefersReducedMotionEvaluate): Use a switch statement for the
2674         three states of forcedPrefersReducedMotionAccessibilityValue. Also update
2675         to use Theme::singleton() instead of platformTheme().
2676
2677         * dom/QualifiedName.h: Removed some unneeded includes, minor style tweaks,
2678         and use isNull() rather than comparing against nullAtom() since it's
2679         slightly more efficient.
2680
2681         * html/Autofill.cpp:
2682         (WebCore::AutofillData::createFromHTMLFormControlElement): Use isNull()
2683         rather than comparing against nullAtom() since it's slightly more efficient.
2684
2685         * html/HTMLDocument.cpp:
2686         (WebCore::addLocalNameToSet): Deleted.
2687         (WebCore::createHtmlCaseInsensitiveAttributesSet): Deleted.
2688         (WebCore::HTMLDocument::isCaseSensitiveAttribute): Moved the case-sensitive
2689         attribute set in here and made it use makeNeverDestroyed.
2690
2691         * html/HTMLNameCollection.cpp:
2692         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
2693         Formatted vertically and sorted so it's easier to see what it does.
2694         (WebCore::WindowNameCollection::elementMatches): Use boolean logic instead
2695         of multiple return statements to make this a little more straightforward.
2696         (WebCore::isObjectElementForDocumentNameCollection): Added. Calls the new
2697         isExposed function. The old code called this isDocNamedItem.
2698         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
2699         Use isObjectElementForDocumentNameCollection to clean up logic. Also
2700         sorted classes.
2701         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
2702         Use isObjectElementForDocumentNameCollection to clean up logic. Also
2703         sorted classes and formatted vertically.
2704         (WebCore::DocumentNameCollection::elementMatches): Write in terms of
2705         above functions for clarity. Efficiency is roughly the same.
2706
2707         * html/HTMLObjectElement.cpp:
2708         (WebCore::HTMLObjectElement::HTMLObjectElement): Initialize data members
2709         in class definition instead of here.
2710         (WebCore::HTMLObjectElement::childrenChanged): Update for name change;
2711         function is now called updateExposedState rather than updateDocNamedItem.
2712         Also use m_useFallbackContent directly instead of through a function.
2713         (WebCore::HTMLObjectElement::renderFallbackContent): Ditto.
2714         (WebCore::preventsParentObjectFromExposure): Added. Replaces the old
2715         isRecognizedTagName function, and does almost the same thing, but the
2716         argument type is different and the param tag is now one of the tags
2717         exempted here. Also broke up into two overloads so we can handle the
2718         Element, Text, and other Node cases.
2719         (WebCore::shouldBeExposed): Added. Helper for the updateExposedState
2720         function that handles the logic of when the element should be exposed,
2721         separating it from what to do when the state changes.
2722         (WebCore::HTMLObjectElement::updateExposedState): Renamed from
2723         updateDocNamedItem.
2724
2725         * html/HTMLObjectElement.h: Renamed isDocNamedItem -> isExposed,
2726         m_docNamedItem -> m_isExposed, updateDocNamedItem -> updateExposedState,
2727         stopped using bit fields for the two boolean data members, and
2728         initialized those data members here in the class definition.
2729
2730         * platform/Theme.cpp:
2731         (WebCore::Theme::baselinePositionAdjustment): Moved here from header.
2732         (WebCore::Theme::controlFont): Ditto.
2733         (WebCore::Theme::controlSize): Ditto.
2734         (WebCore::Theme::minimumControlSize): Ditto.
2735         (WebCore::Theme::controlRequiresPreWhiteSpace): Ditto.
2736         (WebCore::Theme::paint): Ditto.
2737         (WebCore::Theme::inflateControlPaintRect): Ditto.
2738         (WebCore::Theme::userPrefersReducedMotion): Ditto.
2739         (WebCore::Theme::controlBorder): Fixed switch statement indentation.
2740         (WebCore::Theme::controlPadding): Ditto.
2741
2742         * platform/Theme.h: Removed the many unnecessary includes. The one
2743         I was really after here was FontCascade.h. Replaced the platformTheme
2744         function with a singleton function, following our normal style. Also
2745         changed the return type to a reference rather than a pointer.
2746         Removed many unused function and data members.
2747
2748         * platform/cocoa/ThemeCocoa.h: Tightened up implementation, removing
2749         unnecessary members and making overrides private.
2750         * platform/cocoa/ThemeCocoa.mm: Moved include in here.
2751
2752         * platform/gamepad/glib/GamepadsGlib.cpp:
2753         (WebCore::sampleGamepads): Use NeverDestroyed instead of
2754         DEPRECATED_DEFINE_STATIC_LOCAL.
2755
2756         * platform/graphics/FontCascade.cpp:
2757         (WebCore::useBackslashAsYenSignForFamily): Build the set in a cleaner
2758         way and use a NeverDestroyed set instead of a heap-allocated one.
2759         (WebCore::FontCascade::FontCascade): Moved initialization of data members
2760         to the class definition.
2761
2762         * platform/graphics/FontCascade.h: Initialize GlyphOverflow and
2763         FonstCascade data members in the class definition. Remove the constructor
2764         for GlyphOverflow entirely. Added FIXME about the peculiar != operator we
2765         defined for GlyphOverflow.
2766
2767         * platform/graphics/NamedImageGeneratedImage.cpp:
2768         (WebCore::NamedImageGeneratedImage::draw): Use Theme::singleton() instead
2769         of platformTheme().
2770         (WebCore::NamedImageGeneratedImage::drawPattern): Ditto.
2771
2772         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2773         (WebCore::CMTimeRangeStartKey): Use CFSTR directly instead of using
2774         DEPRECATED_DEFINE_STATIC_LOCAL.
2775         (WebCore::CMTimeRangeDurationKey): Ditto.
2776         (WebCore::CACFContextNeedsFlushNotification): Ditto.
2777
2778         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
2779         (WebCore::LayerChangesFlusher::singleton): Use NeverDestroyed instead of
2780         DEPRECATED_DEFINE_STATIC_LOCAL.
2781         * platform/graphics/ca/win/LayerChangesFlusher.h: Ditto.
2782
2783         * platform/graphics/cg/ImageSourceCGWin.cpp:
2784         (WebCore::preferredExtensionForImageSourceType): Use HashMap constructor
2785         instead of writing out a lot of add calls.
2786
2787         * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
2788         (WebCore::harfBuzzFaceCache): Use NeverDestroyed instead of
2789         DEPRECATED_DEFINE_STATIC_LOCAL.
2790         * platform/graphics/win/FontCacheWin.cpp:
2791         (WebCore::FontCache::lastResortFallbackFont): Ditto.
2792
2793         * platform/ios/ThemeIOS.h: Tightened up implementation, removing
2794         unnecessary members and making overrides private.
2795         * platform/ios/ThemeIOS.mm:
2796         (WebCore::Theme::singleton): Renamed from platformTheme.
2797
2798         * platform/mac/ThemeMac.h: Tightened up implementation, removing
2799         unnecessary members and making overrides private. Removed unneeded
2800         WTF_MAKE_FAST_ALLOCATED since this is never allocated on the heap.
2801         Removed unused -[NSFont webCoreFamilyName] method.
2802         * platform/mac/ThemeMac.mm:
2803         (-[NSFont webCoreFamilyName]): Deleted.
2804         (WebCore::Theme::singleton): Renamed from platformTheme.
2805
2806         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
2807         Removed unneeded include of FontCascade.h.
2808         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
2809         Ditto.
2810         * platform/mock/MockRealtimeAudioSource.h: Ditto.
2811
2812         * platform/network/win/DownloadBundleWin.cpp:
2813         (WebCore::DownloadBundle::fileExtension): Use NeverDestroyed
2814         instead of DEPRECATED_DEFINE_STATIC_LOCAL.
2815
2816         * platform/win/ClipboardUtilitiesWin.cpp:
2817         (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use
2818         appendLiteral instead of DEPRECATED_DEFINE_STATIC_LOCAL.
2819
2820         * platform/win/FileSystemWin.cpp:
2821         (WebCore::bundleName): Use NeverDestroyed instead of
2822         DEPRECATED_DEFINE_STATIC_LOCAL, and used a lambda to initialize
2823         rather than a boolean to control one-time code.
2824         (WebCore::storageDirectory): Removed unneeded use of
2825         DEPRECATED_DEFINE_STATIC_LOCAL for a prefix we are appending to
2826         a String. The + operator can handle a literal just as efficiently
2827         without first storing it in a String.
2828
2829         * platform/wpe/ThemeWPE.cpp:
2830         (WebCore::Theme::singleton): Renamed from platformTheme.
2831         * platform/wpe/ThemeWPE.h: Tightened up implementation, removing
2832         unnecessary members and making overrides private.
2833
2834         * rendering/RenderTheme.cpp:
2835         (WebCore::RenderTheme::RenderTheme): No need to initialize m_theme.
2836         (WebCore::RenderTheme::adjustStyle): Use Theme::singleton() instead
2837         of accessing it through m_theme.
2838         (WebCore::RenderTheme::paint): Ditto.
2839         (WebCore::RenderTheme::baselinePosition): Ditto.
2840         (WebCore::RenderTheme::adjustRepaintRect): Ditto.
2841         (WebCore::RenderTheme::setCustomFocusRingColor): Ditto.
2842         (WebCore::RenderTheme::platformTapHighlightColor): Ditto.
2843
2844         * rendering/RenderTheme.h: Removed unneded m_theme and unneeded
2845         inclusion of Theme.h.
2846
2847         * rendering/line/LineBreaker.h: Removed unneeded include of
2848         FontCascade.h.
2849
2850 2017-07-24  Chris Dumez  <cdumez@apple.com>
2851
2852         ExceptionCode enumeration should use modern exception names
2853         https://bugs.webkit.org/show_bug.cgi?id=174794
2854
2855         Reviewed by Geoffrey Garen.
2856
2857         ExceptionCode enumeration should use modern exception names consistently.
2858         This makes the code nicer and closer to the text of the specification.
2859
2860 2017-07-24  Andy Estes  <aestes@apple.com>
2861
2862         Consider implementing W3C Payment Request API
2863         https://bugs.webkit.org/show_bug.cgi?id=174796
2864
2865         Reviewed by Daniel Bates.
2866
2867         Add Payment Request to features.json as "Under Consideration".
2868
2869         * features.json:
2870
2871 2017-07-24  Konstantin Tokarev  <annulen@yandex.ru>
2872
2873         Unreviewed attempt to fix Mac cmake build
2874
2875         * PlatformMac.cmake:
2876
2877 2017-07-24  Chris Dumez  <cdumez@apple.com>
2878
2879         Make ExceptionCode a proper enumeration
2880         https://bugs.webkit.org/show_bug.cgi?id=174771
2881
2882         Reviewed by Sam Weinig.
2883
2884         Make ExceptionCode a proper enumeration instead of a typedef to uint8_t.
2885
2886         * Modules/fetch/FetchBody.h:
2887         (WebCore::FetchBody::formData):
2888         * Modules/indexeddb/shared/IDBError.h:
2889         (WebCore::IDBError::encode):
2890         (WebCore::IDBError::decode):
2891         * bindings/js/JSSubtleCryptoCustom.cpp:
2892         (WebCore::rejectWithException):
2893         * dom/Exception.h:
2894         * dom/ExceptionCode.h:
2895         * fileapi/FileReaderSync.cpp:
2896         (WebCore::errorCodeToExceptionCode):
2897         * html/canvas/WebGLRenderingContextBase.cpp:
2898         (WebCore::WebGLRenderingContextBase::texSubImage2D):
2899         (WebCore::WebGLRenderingContextBase::texImage2D):
2900         * xml/XMLHttpRequest.cpp:
2901         (WebCore::XMLHttpRequest::createRequest):
2902         * xml/XMLHttpRequest.h:
2903
2904 2017-07-24  Simon Fraser  <simon.fraser@apple.com>
2905
2906         Change "client" coordinates back to match scrolling coordinates
2907         https://bugs.webkit.org/show_bug.cgi?id=174734
2908         rdar://problem/33336930
2909
2910         Reviewed by Tim Horton.
2911
2912         Baidu.com (which uses jQuery), and various iOS apps make the assumption that getBoundingClientRect() returns a rectangle
2913         that can be used to set or compare with the scroll position. With visual viewports, that assumption is no longer valid
2914         when the page is zoomed, or when the keyboard has caused the visual viewport to detach from the layout viewport.
2915
2916         At this point the compatibility cost of shipping layout viewport-based client rects seems higher than the gain, so revert
2917         to the shipping behavior. This reverts r216803, and will re-introduce bugs that occurred on zoomed pages on macOS,
2918         many of which are noted in webkit.org/b/170981.
2919
2920         * page/FrameView.cpp:
2921         (WebCore::FrameView::documentToClientOffset):
2922
2923 2017-07-24  Zan Dobersek  <zdobersek@igalia.com>
2924
2925         [WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h
2926         https://bugs.webkit.org/show_bug.cgi?id=174780
2927
2928         Reviewed by Carlos Garcia Campos.
2929
2930         Newer versions of libepoxy provide EGL definitions that already use the EGL_CAST macro.
2931         We'd like to compile on systems where the eglplatform.h header doesn't yet provide
2932         that macro that was added only recently (e.g. it's available in Mesa 17.1, but not
2933         before).
2934
2935         To address that, the EpoxyEGL.h header is added that first includes the libepoxy's EGL
2936         header and then provides the EGL_CAST definition in case the eglplatform.h header doesn't.
2937         This header should be included in place of <epoxy/egl.h> (which is included in this new
2938         header).
2939
2940         The EpoxyEGL.h and EpoxyShims.h headers are also moved under the platform/graphics/epoxy/
2941         directory, with the new directory added to the list of inclusion paths for WPE.
2942
2943         * PlatformWPE.cmake:
2944         * platform/graphics/PlatformDisplay.cpp:
2945         * platform/graphics/cairo/CairoUtilities.cpp:
2946         * platform/graphics/cairo/ImageBufferCairo.cpp:
2947         * platform/graphics/egl/GLContextEGL.cpp:
2948         * platform/graphics/egl/GLContextEGLWPE.cpp:
2949         * platform/graphics/epoxy/EpoxyEGL.h: Added.
2950         * platform/graphics/epoxy/EpoxyShims.h: Renamed from Source/WebCore/platform/graphics/EpoxyShims.h.
2951         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2952         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
2953
2954 2017-07-24  Zan Dobersek  <zdobersek@igalia.com>
2955
2956         [CoordinatedGraphics] Remove unused GLDefs.h header
2957         https://bugs.webkit.org/show_bug.cgi?id=174712
2958
2959         Reviewed by Michael Catanzaro.
2960
2961         * platform/graphics/opengl/GLDefs.h: Remove this unused header.
2962         As far as my recollection goes it was used in the IPC-based
2963         CoordinatedGraphics subsystem, which has been removed already.
2964
2965 2017-07-11  Frederic Wang  <fwang@igalia.com>
2966
2967         Add attribute allow-top-navigation-by-user-activation to iframe sandbox
2968         https://bugs.webkit.org/show_bug.cgi?id=171327
2969
2970         Reviewed by Chris Dumez.
2971
2972         Tests: http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html
2973                http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2.html
2974                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
2975                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-3-expected.txt
2976
2977         * dom/Document.cpp:
2978         (WebCore::Document::canNavigate): Case 2 of conformance verification is refined to match the
2979         current specification: Top navigation is allowed when it is triggered by user activation and
2980         when allow-top-navigation-by-user-activation is set. Because we have additional "security
2981         origin" rules with respect to the specification we also add some early return to ensure that
2982         navigation is really allowed for this new case.
2983         * dom/SecurityContext.cpp:
2984         (WebCore::SecurityContext::isSupportedSandboxPolicy): Add allow-top-navigation-by-user-activation flag.
2985         (WebCore::SecurityContext::parseSandboxPolicy): Parse the new flag to allow top user
2986         navigation by user activation. Also, make sure that allow-top-navigation allows such
2987         navigation as defined by the specification.
2988         * dom/SecurityContext.h: Declare new sandboxing flag.
2989
2990 2017-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2991
2992         [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values
2993         https://bugs.webkit.org/show_bug.cgi?id=174769
2994         <rdar://problem/33478864>
2995
2996         Reviewed by Tim Horton.
2997
2998         These tests began failing after r219541, due to a change in behavior of whether or not we call
2999         setIgnoreSelectionChanges(false, RevealSelection::No) or setIgnoreSelectionChanges(false, RevealSelection::Yes)
3000         when performing a text editing drop.
3001
3002         Before r219541, we would not reveal the selection when performing an edit drag operation. This is because in
3003         WebPage::performDragControllerAction, we would begin ignoring selection changes by calling
3004         setIgnoreSelectionChanges(true). However, while taking a text indicator snapshot, we would stop ignoring
3005         selection in TextIndicator::createWithRange due to us calling setIgnoreSelectionChanges(false,
3006         RevealSelection::No) at the end of the function. Then, when we return to the scope of
3007         WebPage::performDragControllerAction and try to setIgnoreSelectionChanges(false), this is a no-op because we've
3008         already stopped ignoring selection changes.
3009
3010         After r219541, switching to using TemporarySelectionChange means that TextIndicator::createWithRange now means
3011         we respect whether or not we were already ignoring selection before taking the snapshot, so we won't always
3012         setIgnoreSelectionChanges(false) at the end. This means that selection changes will now be correctly ignored
3013         when performing a drag operation, but this also means that we'll try to reveal the selection, since
3014         WebPage::performDragControllerAction calls setIgnoreSelectionChanges(false), for which RevealSelection::Yes
3015         is used by default.
3016
3017         Revealing the selection in WebPage::performDragControllerAction was unintended in the first place, so we should
3018         revert to calling setIgnoreSelectionChanges(false, RevealSelection::No). To ensure this, we adopt
3019         TemporarySelectionChange here and pass only TemporarySelectionOptionIgnoreSelectionChanges, so that we won't
3020         additionally try to reveal selection after the drop. This is consistent with behavior prior to macOS 10.13 and
3021         iOS 11. Additionally, this patch also moves the call to ignore selection change from WebKit into WebCore, so
3022         that whether we ignore selection is consistent across both WebKit1 and WebKit2.
3023
3024         * page/DragController.cpp:
3025         (WebCore::DragController::performDragOperation):
3026
3027 2017-07-23  Chris Dumez  <cdumez@apple.com>
3028
3029         Drop ExceptionCodeDescription class
3030         https://bugs.webkit.org/show_bug.cgi?id=174757
3031
3032         Reviewed by Darin Adler.
3033
3034         Drop ExceptionCodeDescription class now that there is only one exception
3035         type: DOMException. Instead, we now have static methods on DOMException
3036         to get the name / message for a given exception code.
3037
3038         * CMakeLists.txt:
3039         * Modules/indexeddb/shared/IDBError.cpp:
3040         (WebCore::IDBError::name):
3041         (WebCore::IDBError::message):
3042         * Modules/quota/StorageErrorCallback.cpp:
3043         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
3044         * WebCore.xcodeproj/project.pbxproj:
3045         * bindings/js/JSDOMExceptionHandling.cpp:
3046         (WebCore::createDOMException):
3047         * dom/DOMAllInOne.cpp:
3048         * dom/DOMException.cpp:
3049         (WebCore::errorCodeFromName):
3050         (WebCore::DOMException::create):
3051         (WebCore::DOMException::DOMException):
3052         (WebCore::DOMException::name):
3053         (WebCore::DOMException::message):
3054         * dom/DOMException.h:
3055         * dom/ExceptionCodeDescription.cpp: Removed.
3056         * dom/ExceptionCodeDescription.h: Removed.
3057         * inspector/DOMEditor.cpp:
3058         (WebCore::populateErrorString):
3059         * inspector/InspectorDOMAgent.cpp:
3060         (WebCore::InspectorDOMAgent::toErrorString):
3061         * inspector/InspectorDOMStorageAgent.cpp:
3062         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
3063
3064 2017-07-22  Dan Bernstein  <mitz@apple.com>
3065
3066         Fixed building for macOS 10.12 with the macOS 10.13 SDK after r219644.
3067
3068         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3069         (WebCore::CDMSessionAVStreamSession::update): Suppress the objc-literal-conversion warning
3070           in one place where we are calling a class method on a Class and the compiler can’t tell
3071           which class it is, so it chooses wrong and emits a warning.
3072
3073 2017-07-22  Chris Dumez  <cdumez@apple.com>
3074
3075         Merge ExceptionBase into DOMException and drop custom toString
3076         https://bugs.webkit.org/show_bug.cgi?id=174755
3077
3078         Reviewed by Sam Weinig.
3079
3080         Merge ExceptionBase into DOMException and drop custom toString, now that DOMException
3081         is the only remaining exception type.
3082
3083         * CMakeLists.txt:
3084         * Modules/mediastream/MediaStream.h:
3085         * WebCore.xcodeproj/project.pbxproj:
3086         * bindings/js/JSDOMExceptionHandling.cpp:
3087         (WebCore::retrieveErrorMessage):
3088         * dom/DOMAllInOne.cpp:
3089         * dom/DOMException.cpp:
3090         (WebCore::DOMException::DOMException):
3091         (WebCore::DOMException::initializeDescription):
3092         * dom/DOMException.h:
3093         (WebCore::DOMException::code):
3094         (WebCore::DOMException::name):
3095         (WebCore::DOMException::message):
3096         * dom/ExceptionBase.cpp: Removed.
3097         * dom/ExceptionBase.h: Removed.
3098
3099 2017-07-14  Filip Pizlo  <fpizlo@apple.com>
3100
3101         It should be easy to decide how WebKit yields
3102         https://bugs.webkit.org/show_bug.cgi?id=174298
3103
3104         Reviewed by Saam Barati.
3105
3106         No new tests because the WebCore change is just a change to how we #include things.
3107
3108         * inspector/InspectorPageAgent.h:
3109         * inspector/TimelineRecordFactory.h:
3110         * workers/Worker.h:
3111         * workers/WorkerGlobalScopeProxy.h:
3112         * workers/WorkerMessagingProxy.h:
3113
3114 2017-07-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
3115
3116         REGRESSION(r219045): A partially loaded image may not be repainted when its complete frame finishes decoding
3117         https://bugs.webkit.org/show_bug.cgi?id=174230
3118
3119         Reviewed by Simon Fraser.
3120
3121         Because of r219045, we now only repaint the CachedImageClinets which tried
3122         to draw the image but they could not because they have to wait for the image
3123         decoding to finish. This was done by keeping a HashSet of these clients 
3124         and make CachedImage own it. This HashSet is cleared once the image frame
3125         finishes decoding and all the waited clients are repainted.
3126
3127         But Multiple asynchronous image decoding requests are allowed for the same
3128         frame if new data is added to the image source. If we tried to draw the 
3129         same image twice before it finishes decoding the first request, we will
3130         not be to record this second request since the HashSet will not add the
3131         same client twice. When he second request finishes decoding, CachedImage
3132         will not repaint any client since its HashSet is empty.
3133
3134         To fix this problem we can do the following. When an image frame finishes
3135         decoding, CachedImage will keep its HashSet of pending drawing clients as
3136         long as the image frame is a partially loaded frame.
3137
3138         * loader/cache/CachedImage.cpp:
3139         (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
3140         (WebCore::CachedImage::imageFrameAvailable):
3141         * loader/cache/CachedImage.h:
3142         * platform/graphics/BitmapImage.cpp:
3143         (WebCore::BitmapImage::destroyDecodedData):
3144         (WebCore::BitmapImage::dataChanged):
3145         (WebCore::BitmapImage::setCurrentFrameDecodingStatusIfNecessary):
3146         (WebCore::BitmapImage::draw):
3147         (WebCore::BitmapImage::internalStartAnimation):
3148         (WebCore::BitmapImage::internalAdvanceAnimation):
3149         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
3150         * platform/graphics/BitmapImage.h:
3151         * platform/graphics/ImageFrame.cpp:
3152         (WebCore::ImageFrame::decodingStatus):
3153         * platform/graphics/ImageFrame.h: Move DecodingStatus out of this class
3154         to ImageTypes.h to avoid adding other header files to ImageObvsever.h
3155         * platform/graphics/ImageFrameCache.cpp:
3156         (WebCore::ImageFrameCache::setNativeImage):
3157         (WebCore::ImageFrameCache::cacheMetadataAtIndex):
3158         (WebCore::ImageFrameCache::cacheNativeImageAtIndex):
3159         (WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync):
3160         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
3161         (WebCore::ImageFrameCache::frameDecodingStatusAtIndex):
3162         * platform/graphics/ImageFrameCache.h:
3163         * platform/graphics/ImageObserver.h:
3164         * platform/graphics/ImageSource.h:
3165         (WebCore::ImageSource::frameDecodingStatusAtIndex):
3166         * platform/graphics/ImageTypes.h:
3167         * platform/image-decoders/bmp/BMPImageReader.cpp:
3168         (WebCore::BMPImageReader::decodeBMP):
3169         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3170         (WebCore::GIFImageDecoder::frameComplete):
3171         (WebCore::GIFImageDecoder::initFrameBuffer):
3172         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
3173         (WebCore::JPEGImageDecoder::outputScanlines):
3174         (WebCore::JPEGImageDecoder::jpegComplete):
3175         * platform/image-decoders/png/PNGImageDecoder.cpp:
3176         (WebCore::PNGImageDecoder::rowAvailable):
3177         (WebCore::PNGImageDecoder::pngComplete):
3178         (WebCore::PNGImageDecoder::frameComplete):
3179         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3180         (WebCore::WEBPImageDecoder::decode):
3181         * rendering/RenderBoxModelObject.cpp:
3182         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
3183
3184 2017-07-22  Timothy Horton  <timothy_horton@apple.com>
3185
3186         Drag and Drop preview image for Twitter link is the wrong shape
3187         ​https://bugs.webkit.org/show_bug.cgi?id=174731
3188         <rdar://problem/33335616>
3189
3190         * dom/Range.cpp:
3191         (WebCore::Range::absoluteRectsForRangeInText):
3192         * page/TextIndicator.cpp:
3193         (WebCore::initializeIndicator):
3194         Apply some post-landing review feedback for r219756.
3195
3196 2017-07-21  Chris Dumez  <cdumez@apple.com>
3197
3198         Drop IDBDatabaseException class
3199         https://bugs.webkit.org/show_bug.cgi?id=174743
3200
3201         Reviewed by Darin Adler.
3202
3203         Drop IDBDatabaseException class and use DOMException directly. IDBDatabaseException was
3204         only an internal concept and was already exposed to the Web as a DOMException. This
3205         simplifies the code a bit and will allow for further simplification in a follow-up patch.
3206
3207         No new tests, no Web-facing behavior change, except for some exception messages
3208         being slightly different.
3209
3210         * CMakeLists.txt:
3211         * Modules/indexeddb/IDBCursor.cpp:
3212         (WebCore::IDBCursor::update):
3213         (WebCore::IDBCursor::advance):
3214         (WebCore::IDBCursor::continuePrimaryKey):
3215         (WebCore::IDBCursor::continueFunction):
3216         (WebCore::IDBCursor::deleteFunction):
3217         * Modules/indexeddb/IDBDatabase.cpp:
3218         (WebCore::IDBDatabase::createObjectStore):
3219         (WebCore::IDBDatabase::transaction):
3220         (WebCore::IDBDatabase::deleteObjectStore):
3221         * Modules/indexeddb/IDBDatabaseError.h: Removed.
3222         * Modules/indexeddb/IDBDatabaseException.cpp: Removed.
3223         * Modules/indexeddb/IDBDatabaseException.h: Removed.
3224         * Modules/indexeddb/IDBFactory.cpp:
3225         (WebCore::IDBFactory::cmp):
3226         * Modules/indexeddb/IDBIndex.cpp:
3227         (WebCore::IDBIndex::setName):
3228         (WebCore::IDBIndex::openCursor):
3229         (WebCore::IDBIndex::openKeyCursor):
3230         (WebCore::IDBIndex::count):
3231         (WebCore::IDBIndex::doCount):
3232         (WebCore::IDBIndex::get):
3233         (WebCore::IDBIndex::doGet):
3234         (WebCore::IDBIndex::getKey):
3235         (WebCore::IDBIndex::doGetKey):
3236         (WebCore::IDBIndex::getAll):
3237         (WebCore::IDBIndex::getAllKeys):
3238         * Modules/indexeddb/IDBKeyRange.cpp:
3239         (WebCore::IDBKeyRange::only):
3240         (WebCore::IDBKeyRange::lowerBound):
3241         (WebCore::IDBKeyRange::upperBound):
3242         (WebCore::IDBKeyRange::bound):
3243         (WebCore::IDBKeyRange::includes):
3244         * Modules/indexeddb/IDBObjectStore.cpp:
3245         (WebCore::IDBObjectStore::setName):
3246         (WebCore::IDBObjectStore::openCursor):
3247         (WebCore::IDBObjectStore::openKeyCursor):
3248         (WebCore::IDBObjectStore::get):
3249         (WebCore::IDBObjectStore::getKey):
3250         (WebCore::IDBObjectStore::putOrAdd):
3251         (WebCore::IDBObjectStore::doDelete):
3252         (WebCore::IDBObjectStore::deleteFunction):
3253         (WebCore::IDBObjectStore::clear):
3254         (WebCore::IDBObjectStore::createIndex):
3255         (WebCore::IDBObjectStore::index):
3256         (WebCore::IDBObjectStore::deleteIndex):
3257         (WebCore::IDBObjectStore::count):
3258         (WebCore::IDBObjectStore::doCount):
3259         (WebCore::IDBObjectStore::getAll):
3260         (WebCore::IDBObjectStore::getAllKeys):
3261         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3262         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
3263         * Modules/indexeddb/IDBRequest.cpp:
3264         (WebCore::IDBRequest::result):
3265         (WebCore::IDBRequest::error):
3266         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
3267         * Modules/indexeddb/IDBTransaction.cpp:
3268         (WebCore::IDBTransaction::objectStore):
3269         (WebCore::IDBTransaction::abort):
3270         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
3271         (WebCore::IDBTransaction::didCreateIndexOnServer):
3272         (WebCore::IDBTransaction::putOrAddOnServer):
3273         * Modules/indexeddb/server/IndexValueStore.cpp:
3274         (WebCore::IDBServer::IndexValueStore::addRecord):
3275         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3276         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
3277         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
3278         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
3279         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
3280         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
3281         (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
3282         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
3283         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
3284         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
3285         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
3286         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
3287         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
3288         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
3289         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
3290         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
3291         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
3292         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
3293         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
3294         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
3295         * Modules/indexeddb/server/MemoryIndex.cpp:
3296         (WebCore::IDBServer::MemoryIndex::putIndexKey):
3297         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3298         (WebCore::IDBServer::MemoryObjectStore::createIndex):
3299         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
3300         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3301         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
3302         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
3303         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
3304         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
3305         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
3306         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
3307         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
3308         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
3309         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3310         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
3311         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
3312         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
3313         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
3314         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
3315         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
3316         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
3317         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
3318         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
3319         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
3320         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
3321         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
3322         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
3323         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
3324         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
3325         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
3326         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
3327         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
3328         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
3329         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
3330         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
3331         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
3332         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
3333         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
3334         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
3335         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3336         (WebCore::IDBServer::SQLiteIDBTransaction::begin):
3337         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
3338         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
3339         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3340         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
3341         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
3342         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
3343         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
3344         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
3345         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
3346         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
3347         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
3348         * Modules/indexeddb/shared/IDBError.cpp:
3349         (WebCore::IDBError::name):
3350         (WebCore::IDBError::message):
3351         (WebCore::IDBError::toDOMError):
3352         * Modules/indexeddb/shared/IDBError.h:
3353         (WebCore::IDBError::userDeleteError):
3354         (WebCore::IDBError::isNull):
3355         * WebCore.xcodeproj/project.pbxproj:
3356         * bindings/js/JSDOMExceptionHandling.cpp:
3357         (WebCore::createDOMException):
3358
3359         * dom/DOMException.cpp:
3360         (WebCore::DOMException::initializeDescription):
3361         Initialize description->code from using the actual error codes in the
3362         coreExceptions table, instead of initializing it using |ec|. |ec| is
3363         the index in the ExceptionCode enumeration and it matches the error
3364         code only for legacy exceptions. New exceptions such as DataError
3365         should have a code of 0. Without this change, w3c for IDB would start
3366         failing.
3367
3368         * dom/ExceptionCodeDescription.cpp:
3369         (WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
3370         * dom/ExceptionCodeDescription.h:
3371
3372 2017-07-21  Sam Weinig  <sam@webkit.org>
3373
3374         [WebIDL] Simplify XMLHttpRequest bindings by removing built-ins
3375         https://bugs.webkit.org/show_bug.cgi?id=174740
3376
3377         Reviewed by Chris Dumez.
3378
3379         The behavior we were getting from XMLHttpRequest.js can be implemented
3380         with the [CachedAttribute] extended attribute. This reduces the number
3381         of JS -> C++ jumps required and makes the code more similar to other
3382         bindings that need caching of an IDL any value.
3383
3384         * CMakeLists.txt:
3385         * DerivedSources.make:
3386         * xml/XMLHttpRequest.js: Removed.
3387         Remove XMLHttpRequest.js.
3388
3389         * bindings/js/JSXMLHttpRequestCustom.cpp:
3390         (WebCore::JSXMLHttpRequest::response):
3391         (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
3392         * xml/XMLHttpRequest.idl:
3393         Replace builtin with a [CachedAttribute] and [CustomGetter]
3394         for the response property.
3395
3396 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
3397
3398         Drag and Drop preview image for Twitter link is the wrong shape
3399         https://bugs.webkit.org/show_bug.cgi?id=174731
3400         <rdar://problem/33335616>
3401
3402         Reviewed by Zalan Bujtas.
3403
3404         TextIndicator uses Range::borderAndTextQuads and ::absoluteTextRects
3405         in order to get the rects of the indicated text. Currently, these
3406         functions do not respect clipping, so clipped-out text (e.g. as seen
3407         inside links on Twitter) generates lots of meaningless indicated rects.
3408
3409         * page/TextIndicator.cpp:
3410         (WebCore::estimatedBackgroundColorForRange):
3411         (WebCore::hasAnyIllegibleColors):
3412         Change adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary
3413         to instead be hasAnyIllegibleColors, and referred to in the same place
3414         as hasNonInlineOrReplacedElements, so that it follows the same
3415         upgrade path (leaving textRects empty, so that it is later filled in
3416         with the absoluteBoundingRect). This was a mistake in r219033, which
3417         instead would end up painting all content, but filling in textRects
3418         with the actual individual text rects.
3419
3420         This alone changes the behavior on Twitter from lots of jagged misplaced
3421         rects to a too-large bounding rect. Combined with the following changes,
3422         the bounding rect is reduced to the right size:
3423
3424         (WebCore::initializeIndicator):
3425         Adopt the new Range::borderAndTextQuads and ::absoluteTextRects parameter
3426         and opt-in to respecting clipping for text rects.
3427
3428         * dom/DOMRectList.cpp:
3429         (WebCore::DOMRectList::DOMRectList):
3430         * dom/DOMRectList.h:
3431         (WebCore::DOMRectList::create):
3432         Add a DOMRectList constructor and create() that take FloatRects, similar
3433         to the one that takes FloatQuads, but without the boundingRect() calls.
3434
3435         * dom/Document.h:
3436         * dom/Document.cpp:
3437         (WebCore::Document::convertAbsoluteToClientRects):
3438         Add convertAbsoluteToClientRects, similar to covertAbsoluteToClientQuads,
3439         except acting on rects instead of quads.
3440
3441         * dom/Range.cpp:
3442         (WebCore::Range::absoluteRectsForRangeInText):
3443         (WebCore::Range::absoluteTextRects):
3444         (WebCore::Range::getClientRects):
3445         (WebCore::Range::borderAndTextRects):
3446         (WebCore::Range::boundingRect):
3447         (WebCore::Range::absoluteBoundingRect):
3448         (WebCore::Range::borderAndTextQuads): Deleted.
3449         * dom/Range.h:
3450         Replace borderAndTextQuads with borderAndTextRects, because all callers
3451         just ended up calling boundingBox() on the quads.
3452
3453         Factor absoluteRectsForRangeInText out of absoluteTextRects and
3454         borderAndTextQuads, and teach it to optionally intersect the text rects
3455         with their renderer's absoluteClippedOverflowRect.
3456
3457 2017-07-21  Per Arne Vollan  <pvollan@apple.com>
3458
3459         Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke.
3460         https://bugs.webkit.org/show_bug.cgi?id=174701
3461         <rdar://problem/32903679>
3462
3463         Reviewed by Simon Fraser.
3464
3465         The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color.
3466         Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible.
3467
3468         Test: fast/css/round-trip-stroke-width-using-computed-style.html
3469
3470         * rendering/TextPaintStyle.cpp:
3471         (WebCore::updateGraphicsContext):
3472         * rendering/style/RenderStyle.h:
3473         (WebCore::RenderStyle::initialStrokeWidth):
3474         (WebCore::RenderStyle::initialStrokeColor):
3475         * rendering/style/StyleRareInheritedData.cpp:
3476         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3477
3478 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
3479
3480         Remove an inaccurate comment from RenderTextLineBoxes
3481
3482         * rendering/RenderTextLineBoxes.cpp:
3483         (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
3484         This comment has been wrong for at least 4 years.
3485
3486 2017-07-21  Timothy Horton  <timothy_horton@apple.com>
3487
3488         TextIndicator::estimatedTextColorsForRange asserts inside HashSet code (inserting reserved value)
3489         https://bugs.webkit.org/show_bug.cgi?id=174733
3490
3491         Reviewed by Wenson Hsieh.
3492
3493         * page/TextIndicator.cpp:
3494         (WebCore::estimatedTextColorsForRange):
3495         (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
3496         RGBA32 isn't a valid hash key, because we have no traits that define the
3497         empty or deleted values, nor do we have any bits we could feasibly
3498         use -- the full range of RGBA32 is easy to reach with various colors.
3499
3500         Instead, hash Color directly.
3501
3502 2017-07-21  Nan Wang  <n_wang@apple.com>
3503
3504         AX: Expose form validation on iOS as hint
3505         https://bugs.webkit.org/show_bug.cgi?id=174722
3506         <rdar://problem/33459761>
3507
3508         Reviewed by Chris Fleizach.
3509
3510         Adding the validation message to the hint of the form control element.
3511
3512         Test: accessibility/ios-simulator/form-control-validation-message.html
3513
3514         * accessibility/AccessibilityObject.cpp:
3515         (WebCore::AccessibilityObject::isShowingValidationMessage):
3516         (WebCore::AccessibilityObject::validationMessage):
3517         * accessibility/AccessibilityObject.h:
3518         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3519         (-[WebAccessibilityObjectWrapper accessibilityHint]):
3520         (-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]):
3521         * html/HTMLFormControlElement.cpp:
3522         (WebCore::HTMLFormControlElement::isShowingValidationMessage):
3523         * html/HTMLFormControlElement.h:
3524
3525 2017-07-21  Konstantin Tokarev  <annulen@yandex.ru>
3526
3527         [cmake][Mac] Unreviewed, fix linking WebKitSystemInterface
3528
3529         After r219560 link_directories() in PlatformXXX.cmake files does not
3530         affect corresponding targets.
3531
3532         * PlatformMac.cmake:
3533
3534 2017-07-21  Sam Weinig  <sam@webkit.org>
3535
3536         [WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots
3537         https://bugs.webkit.org/show_bug.cgi?id=174713
3538
3539         Reviewed by Andreas Kling.
3540
3541         We used to not want to bloat the size of CSSValues with a pointer to the
3542         owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of
3543         them on DOMWrapperWorld that only got set if a wrapper was made. Now that
3544         we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created
3545         for the bindings, we no longer need the side table, and simply have the
3546         DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration.
3547
3548         * bindings/js/DOMWrapperWorld.h:
3549         (WebCore::DOMWrapperWorld::wrappers):
3550         Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter.
3551
3552         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3553         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted.
3554         Remove custom implementation of getPropertyCSSValue, now that it no longer
3555         needs to update m_deprecatedCSSOMValueRoots.
3556
3557         * bindings/js/JSDOMWindowBase.cpp:
3558         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
3559         * bindings/js/JSDOMWrapperCache.h:
3560         (WebCore::getCachedWrapper):
3561         (WebCore::cacheWrapper):
3562         (WebCore::uncacheWrapper):
3563         * bindings/js/JSNodeCustom.cpp:
3564         (WebCore::getOutOfLineCachedWrapper):
3565         Use wrappers getter rather than direct member variable.
3566
3567         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
3568         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
3569         Rather than checking the side table for roots, now get the root
3570         via the reference CSSStyleDeclaration.
3571
3572         (WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted.
3573         Remove custom finalize now that we don't have to remove ourself
3574         from m_deprecatedCSSOMValueRoots.
3575
3576         * css/CSSStyleDeclaration.idl:
3577         Remove [Custom] from getPropertyCSSValue.
3578
3579         * css/DeprecatedCSSOMValue.idl:
3580         Remove [JSCustomFinalize].
3581
3582         * css/CSSComputedStyleDeclaration.cpp:
3583         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3584         * css/CSSImageValue.cpp:
3585         (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
3586         * css/CSSImageValue.h:
3587         * css/CSSPrimitiveValue.cpp:
3588         (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
3589         * css/CSSPrimitiveValue.h:
3590         * css/CSSStyleDeclaration.h:
3591         * css/CSSValue.cpp:
3592         (WebCore::CSSValue::createDeprecatedCSSOMWrapper):
3593         * css/CSSValue.h:
3594         * css/DeprecatedCSSOMCounter.h:
3595         * css/DeprecatedCSSOMPrimitiveValue.cpp:
3596         (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
3597         (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
3598         (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
3599         * css/DeprecatedCSSOMPrimitiveValue.h:
3600         (WebCore::DeprecatedCSSOMPrimitiveValue::create):
3601         (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
3602         * css/DeprecatedCSSOMRGBColor.h:
3603         * css/DeprecatedCSSOMRect.h:
3604         * css/DeprecatedCSSOMValue.h:
3605         (WebCore::DeprecatedCSSOMValue::owner):
3606         (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
3607         (WebCore::DeprecatedCSSOMComplexValue::create):
3608         (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
3609         * css/DeprecatedCSSOMValueList.h:
3610         (WebCore::DeprecatedCSSOMValueList::create):
3611         (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
3612         * css/PropertySetCSSStyleDeclaration.cpp:
3613         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
3614         * css/PropertySetCSSStyleDeclaration.h:
3615         * svg/SVGElement.cpp:
3616         (WebCore::SVGElement::getPresentationAttribute):
3617         Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes.
3618
3619 2017-07-21  Andreas Kling  <akling@apple.com>
3620
3621         Use more references in event dispatch code
3622         https://bugs.webkit.org/show_bug.cgi?id=174681
3623
3624         Reviewed by Geoffrey Garen.
3625
3626         Make EventListener::handleEvent() take a ScriptExecutionContext&, Event&.
3627         Then make everything build again. Various null checks and assertions
3628         disappear in the process.
3629
3630         * bindings/js/JSErrorHandler.cpp:
3631         (WebCore::JSErrorHandler::handleEvent):
3632         * bindings/js/JSErrorHandler.h:
3633         * bindings/js/JSEventListener.cpp:
3634         (WebCore::JSEventListener::initializeJSFunction):
3635         (WebCore::JSEventListener::handleEvent):
3636         (WebCore::eventHandlerAttribute):
3637         * bindings/js/JSEventListener.h:
3638         (WebCore::JSEventListener::jsFunction):
3639         * bindings/js/JSLazyEventListener.cpp:
3640         (WebCore::JSLazyEventListener::initializeJSFunction):
3641         * bindings/js/JSLazyEventListener.h:
3642         * dom/EventListener.h:
3643         * dom/EventTarget.cpp:
3644         (WebCore::EventTarget::fireEventListeners):
3645         * html/HTMLPlugInElement.cpp:
3646         (WebCore::HTMLPlugInElement::defaultEventHandler):
3647         * html/ImageDocument.cpp:
3648         (WebCore::ImageEventListener::handleEvent):
3649         * inspector/CommandLineAPIHost.cpp:
3650         (WebCore::listenerEntriesFromListenerInfo):
3651         * inspector/InspectorDOMAgent.cpp:
3652         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
3653         * inspector/InspectorIndexedDBAgent.cpp:
3654         * platform/Widget.h:
3655         (WebCore::Widget::handleEvent):
3656         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
3657         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
3658         (WebCore::WebPlaybackSessionModelMediaElement::handleEvent):
3659         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
3660         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
3661         (WebVideoFullscreenModelVideoElement::handleEvent):
3662         * svg/SVGTRefElement.cpp:
3663         (WebCore::SVGTRefTargetEventListener::handleEvent):
3664         * svg/animation/SVGSMILElement.cpp:
3665         (WebCore::ConditionEventListener::handleEvent):
3666         (WebCore::SVGSMILElement::handleConditionEvent):
3667         * svg/animation/SVGSMILElement.h:
3668
3669 2017-07-21  Zalan Bujtas  <zalan@apple.com>
3670
3671         iBooks: Overlapping/missing content at beginning/end of paragraph.
3672         https://bugs.webkit.org/show_bug.cgi?id=174717
3673         <rdar://problem/33117912>
3674
3675         Reviewed by Simon Fraser.
3676
3677         By definiton simple and normal line layout should always produce the exact same lineboxes. It enables us not
3678         to force repaint while swapping between these 2 line layouts.
3679         However in certain cases (font size pixel rounding as an example) they don't agree on how much content fits the line and
3680         that could result in missing/overlapping content due to the lack of repaint. 
3681
3682         Unable to test.
3683
3684         * rendering/RenderBlockFlow.cpp:
3685         (WebCore::RenderBlockFlow::ensureLineBoxes):
3686
3687 2017-07-21  Chris Dumez  <cdumez@apple.com>
3688
3689         Drop make_dom_exceptions.pl script that we only have DOMException
3690         https://bugs.webkit.org/show_bug.cgi?id=174699
3691
3692         Reviewed by Darin Adler.
3693
3694         Drop make_dom_exceptions.pl script that we only have DOMException.
3695
3696         * CMakeLists.txt:
3697         * DerivedSources.make:
3698         * WebCore.xcodeproj/project.pbxproj:
3699         * WebCoreMacros.cmake:
3700         * bindings/js/JSDOMExceptionHandling.cpp:
3701         * css/FontFaceSet.cpp:
3702         * dom/DOMAllInOne.cpp:
3703         * dom/DOMExceptions.in: Removed.
3704         * dom/ExceptionCodeDescription.cpp: Added.
3705         (WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
3706         * dom/ExceptionCodeDescription.h: Added.
3707         * dom/make_dom_exceptions.pl: Removed.
3708         * inspector/WebInjectedScriptHost.cpp:
3709         (WebCore::WebInjectedScriptHost::subtype):
3710
3711 2017-07-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
3712
3713         [CG] An image should not invoke many system calls before confirming its format is supported
3714         https://bugs.webkit.org/show_bug.cgi?id=174692
3715
3716         Reviewed by Tim Horton.
3717
3718         We should be careful when invoking system calls before confirming that the
3719         image type is available and it is one of the whitelist formats. Otherwise
3720         we will be calling the parsers of the unsupported formats.
3721
3722         * loader/cache/CachedImage.cpp:
3723         (WebCore::CachedImage::setImageDataBuffer): The check isAllowedImageUTI()
3724         is now done in ImageDecoder::encodedDataStatus() which will return Error
3725         if there is an error in the data or "isAllowedImageUTI() returns false."
3726
3727         * platform/graphics/BitmapImage.cpp:
3728         (WebCore::BitmapImage::dataChanged): Avoid calling canUseAsyncDecodingForLargeImages()
3729         before confirming the image type is available and it's supported by WebKit.
3730         canUseAsyncDecodingForLargeImages() tries to cache the first frame of the
3731         image to know its size. Asking the ImageFrameCache to destroy its decoded
3732         frames is not needed unless ImageFrameCache::decodedSize() is not zero.
3733
3734         * platform/graphics/cg/ImageDecoderCG.cpp:
3735         (WebCore::ImageDecoder::encodedDataStatus): Avoid calling CGImageSourceGetStatus()
3736         before knowing the UTI of the image. When knowing it, we call CGImageSourceGetStatus()
3737         and if it returns kCGImageStatusIncomplete or kCGImageStatusComplete, we
3738         check whether isAllowedImageUTI() or not. If isAllowedImageUTI() returns
3739         false, return Error which will make the CachedImage cancel loading the 
3740         rest of the image.
3741
3742 2017-07-21  Jeremy Jones  <jeremyj@apple.com>
3743
3744         AudioTrackPrivateMediaStreamCocoa shouldn't set AudioSession::setPreferredBufferSize
3745         https://bugs.webkit.org/show_bug.cgi?id=174707
3746         rdar://problem/33446809
3747
3748         Reviewed by Eric Carlson.
3749
3750         Manually tested for audio side effects.
3751
3752         AudioChannel::copyFrom fails when AudioChannel lengths don't match.
3753
3754         This happens because PlatformMediaSessionManager::updateSessionState() owns and sets
3755         AudioSession::setPreferredBufferSize().
3756
3757         However, AudioTrackPrivateMediaStreamCocoa::createAudioUnit, when it creates an input
3758         audio unit is setting AudioSession::setPreferredBufferSize() directly to its own arbitrary value.
3759
3760         AudioSession::setPreferredBufferSize() should be managed by the higher level 
3761         PlatformMediaSessionManager, and not modified by audio unit creation, in order to keep harmony
3762         within the audio pipeline.
3763
3764         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3765         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
3766
3767 2017-07-21  Jeremy Jones  <jeremyj@apple.com>
3768
3769         Noise when AudioChannel lengths don't match.
3770         https://bugs.webkit.org/show_bug.cgi?id=174706
3771         rdar://problem/33389856
3772
3773         Reviewed by Eric Carlson.
3774
3775         When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer.
3776         This change zeros out the data, so there isn't objectionable noise sent to the speaker.
3777
3778         * platform/audio/AudioChannel.cpp:
3779         (WebCore::AudioChannel::copyFrom):
3780
3781 2017-07-21  Sam Weinig  <sam@webkit.org>
3782
3783         [WebIDL] Make a few parameters non-nullable in inspector IDL files
3784         https://bugs.webkit.org/show_bug.cgi?id=174719
3785
3786         Reviewed by Joseph Pecoraro.
3787
3788         * inspector/CommandLineAPIHost.cpp:
3789         (WebCore::CommandLineAPIHost::databaseId):
3790         (WebCore::CommandLineAPIHost::storageId):
3791         * inspector/CommandLineAPIHost.h:
3792         * inspector/CommandLineAPIHost.idl:
3793         * inspector/InspectorDOMStorageAgent.cpp:
3794         (WebCore::InspectorDOMStorageAgent::storageId):
3795         * inspector/InspectorDOMStorageAgent.h:
3796         * inspector/InspectorDatabaseAgent.cpp:
3797         (WebCore::InspectorDatabaseAgent::databaseId):
3798         * inspector/InspectorDatabaseAgent.h:
3799         * inspector/InspectorFrontendHost.cpp:
3800         (WebCore::InspectorFrontendHost::showContextMenu):
3801         (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
3802         * inspector/InspectorFrontendHost.h:
3803         * inspector/InspectorFrontendHost.idl:
3804         Remove nullability from arguments that should never be null.
3805
3806 2017-07-21  Brady Eidson  <beidson@apple.com>
3807
3808         Get rid of WebCore IconDatabase code.
3809         https://bugs.webkit.org/show_bug.cgi?id=174700
3810
3811         Reviewed by Tim Horton.
3812
3813         No new tests (No behavior change).
3814         
3815         Tons of red.
3816         Very little green.
3817         No further explanation.
3818
3819         * CMakeLists.txt:
3820         * WebCore.xcodeproj/project.pbxproj:
3821         * dom/Document.cpp:
3822         (WebCore::Document::implicitClose):
3823         * history/HistoryItem.cpp:
3824         (WebCore::HistoryItem::HistoryItem):
3825         (WebCore::HistoryItem::~HistoryItem):
3826         (WebCore::HistoryItem::reset):
3827         (WebCore::HistoryItem::setURLString):
3828         * inspector/InspectorNetworkAgent.cpp:
3829         (WebCore::InspectorNetworkAgent::willSendRequest):
3830         * loader/DocumentLoader.cpp:
3831         (WebCore::DocumentLoader::~DocumentLoader):
3832         (WebCore::DocumentLoader::startIconLoading):
3833         (WebCore::DocumentLoader::iconLoadDecisionAvailable): Deleted.
3834         (WebCore::iconLoadDecisionCallback): Deleted.
3835         (WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Deleted.
3836         (WebCore::DocumentLoader::continueIconLoadWithDecision): Deleted.
3837         (WebCore::iconDataCallback): Deleted.
3838         (WebCore::DocumentLoader::getIconDataForIconURL): Deleted.
3839         * loader/DocumentLoader.h:
3840         (WebCore::DocumentLoader::linkIcons):
3841         * loader/FrameLoader.cpp:
3842         (WebCore::FrameLoader::FrameLoader):
3843         (WebCore::FrameLoader::stop):
3844         * loader/FrameLoader.h:
3845         (WebCore::FrameLoader::subframeLoader):
3846         (WebCore::FrameLoader::icon): Deleted.
3847         * loader/FrameLoaderClient.h:
3848         * loader/archive/cf/LegacyWebArchive.cpp:
3849         (WebCore::LegacyWebArchive::create):
3850         * loader/icon/IconController.cpp: Removed.
3851         * loader/icon/IconController.h: Removed.
3852         * loader/icon/IconDatabase.cpp: Removed.
3853         * loader/icon/IconDatabase.h: Removed.
3854         * loader/icon/IconDatabaseBase.cpp: Removed.
3855         * loader/icon/IconDatabaseBase.h: Removed.
3856         * loader/icon/IconDatabaseClient.h: Removed.
3857         * loader/icon/IconLoader.cpp:
3858         (WebCore::IconLoader::IconLoader):
3859         (WebCore::IconLoader::startLoading):
3860         (WebCore::IconLoader::notifyFinished):
3861         * loader/icon/IconLoader.h:
3862         * loader/icon/IconRecord.cpp: Removed.
3863         * loader/icon/IconRecord.h: Removed.
3864         * loader/icon/PageURLRecord.cpp: Removed.
3865         * loader/icon/PageURLRecord.h: Removed.
3866         * testing/Internals.cpp:
3867         (WebCore::Internals::shortcutIconURLs):
3868
3869 2017-07-21  Chris Dumez  <cdumez@apple.com>
3870
3871         Rename DOMCoreException class to DOMException
3872         https://bugs.webkit.org/show_bug.cgi?id=174698
3873
3874         Reviewed by Darin Adler.
3875
3876         Rename DOMCoreException class to DOMException to match its Web-exposed name.
3877
3878         * CMakeLists.txt:
3879         * DerivedSources.cpp:
3880         * DerivedSources.make:
3881         * Modules/quota/StorageErrorCallback.cpp:
3882         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
3883         * Modules/quota/StorageErrorCallback.h:
3884         * Modules/quota/StorageErrorCallback.idl:
3885         * WebCore.xcodeproj/project.pbxproj:
3886         * bindings/js/JSDOMExceptionHandling.cpp:
3887         (WebCore::retrieveErrorMessage):
3888         (WebCore::createDOMException):
3889         * bindings/scripts/CodeGeneratorJS.pm:
3890         (GenerateOverloadDispatcher):
3891         * css/FontFaceSet.cpp:
3892         * css/FontFaceSet.h:
3893         * dom/DOMAllInOne.cpp:
3894         * dom/DOMException.cpp: Renamed from Source/WebCore/dom/DOMCoreException.cpp.
3895         (WebCore::DOMException::create):
3896         (WebCore::DOMException::DOMException):
3897         (WebCore::DOMException::initializeDescription):
3898         * dom/DOMException.h: Renamed from Source/WebCore/dom/DOMCoreException.h.
3899         (WebCore::DOMException::create):
3900         (WebCore::DOMException::DOMException):
3901         * dom/DOMException.idl: Renamed from Source/WebCore/dom/DOMCoreException.idl.
3902         * dom/DOMExceptions.in:
3903         * dom/make_dom_exceptions.pl:
3904         (generateImplementation):
3905
3906 2017-07-21  Sam Weinig  <sam@webkit.org>
3907
3908         Follow up to https://bugs.webkit.org/show_bug.cgi?id=174659.
3909
3910         * inspector/InspectorFrontendHost.idl:
3911         Remove unnecessary JSGenerateToJSObject noticed in review.
3912
3913 2017-07-20  Chris Dumez  <cdumez@apple.com>
3914
3915         Drop legacy SVGException type
3916         https://bugs.webkit.org/show_bug.cgi?id=174695
3917
3918         Reviewed by Darin Adler.
3919
3920         Drop legacy SVGException type and use DOMException instead, as per the latest
3921         SVG specification. Both Chrome and Firefox no longer expose the SVGException
3922         type.
3923
3924         * CMakeLists.txt:
3925         * DerivedSources.cpp:
3926         * DerivedSources.make:
3927         * WebCore.xcodeproj/project.pbxproj:
3928         * bindings/js/JSDOMExceptionHandling.cpp:
3929         (WebCore::createDOMException):
3930         * bindings/js/JSExceptionBase.cpp:
3931         (WebCore::toExceptionBase):
3932         * dom/DOMExceptions.in:
3933         * svg/SVGAllInOne.cpp:
3934         * svg/SVGCircleElement.cpp:
3935         * svg/SVGException.cpp: Removed.
3936         * svg/SVGException.h: Removed.
3937         * svg/SVGException.idl: Removed.
3938         * svg/SVGGraphicsElement.idl:
3939         * svg/SVGLocatable.cpp:
3940         (WebCore::SVGLocatable::getTransformToElement):
3941         * svg/SVGMatrixValue.h:
3942         * svg/SVGPathSegList.cpp:
3943         (WebCore::SVGPathSegList::getItem):
3944         (WebCore::SVGPathSegList::replaceItem):
3945         (WebCore::SVGPathSegList::removeItem):
3946         * svg/SVGPathSegList.h:
3947         * svg/SVGPathSegList.idl:
3948         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
3949         * svg/properties/SVGListProperty.h:
3950
3951 2017-07-20  Chris Dumez  <cdumez@apple.com>
3952
3953         Hook up ITP quirks to the needsSiteSpecificQuirks setting
3954   &n