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