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