Clean-up some things in GraphicsContext3D
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-07-12  Dean Jackson  <dino@apple.com>
2
3         Clean-up some things in GraphicsContext3D
4         https://bugs.webkit.org/show_bug.cgi?id=174452
5         <rdar://problem/33281257>
6
7         Reviewed by Simon Fraser.
8
9         General clean-up in GC3D.
10
11         Covered by existing tests.
12
13         * platform/graphics/GraphicsContext3D.h: Use initial values where possible.
14         (WebCore::GraphicsContext3D::GraphicsContext3DState::GraphicsContext3DState): Deleted.
15         * platform/graphics/mac/GraphicsContext3DMac.mm:
16         (WebCore::GraphicsContext3D::GraphicsContext3D): Nearly everything can come from the
17         initial values now.
18         (WebCore::GraphicsContext3D::~GraphicsContext3D): Remove code that won't be enabled
19         on this platform.
20         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
21         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): While unlikely to happen,
22         and possibly harmless in this case, add some checked arithmetic to make sure we don't overflow
23         when working out how big a buffer to create.
24         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData): Ditto.
25         (WebCore::GraphicsContext3D::reshape): Do nothing if we are ever given negative
26         width or height. Again unlikely.
27
28 2017-07-13  Dean Jackson  <dino@apple.com>
29
30         Avoid unnecessary copy of framebuffer into WebGL Layer
31         https://bugs.webkit.org/show_bug.cgi?id=174345
32         <rdar://problem/33228950>
33
34         Reviewed by Sam Weinig.
35
36         On macOS, we're unnecessarily copying the framebuffer into another
37         texture before pushing it into the compositing layer. Instead we
38         should simply render the FBO into the CALayer we use to draw on
39         the screen.
40
41         Covered by the existing WebGL tests.
42
43         * platform/graphics/GraphicsContext3D.h:
44         (WebCore::GraphicsContext3D::platformTexture): Return the FBO texture instead.
45         * platform/graphics/mac/GraphicsContext3DMac.mm:
46         (WebCore::GraphicsContext3D::GraphicsContext3D): No need to have a compositing
47         texture.
48         (WebCore::GraphicsContext3D::~GraphicsContext3D):
49         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
50         (WebCore::GraphicsContext3D::reshapeFBOs):
51         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
52         (WebCore::GraphicsContext3D::prepareTexture): Don't copy the pixels from
53         the FBO into the compositing texture
54
55 2017-07-13  Mark Lam  <mark.lam@apple.com>
56
57         Implementors of memoryCost() need to be thread-safe.
58         https://bugs.webkit.org/show_bug.cgi?id=172738
59         <rdar://problem/32474881>
60
61         Reviewed by Keith Miller.
62
63         No new tests. This patch fixes a race condition bug that can result in random
64         crashes (and other unpredictable behavior), and is very difficult to test for.
65
66         * Modules/webaudio/AudioBuffer.cpp:
67         (WebCore::AudioBuffer::releaseMemory):
68         (WebCore::AudioBuffer::memoryCost):
69         * Modules/webaudio/AudioBuffer.h:
70         * dom/ChildNodeList.h:
71         * dom/CollectionIndexCache.h:
72         (WebCore::CollectionIndexCache::memoryCost):
73         * dom/LiveNodeList.h:
74         * html/CachedHTMLCollection.h:
75         * html/HTMLCanvasElement.cpp:
76         (WebCore::HTMLCanvasElement::memoryCost):
77         (WebCore::HTMLCanvasElement::externalMemoryCost):
78         (WebCore::HTMLCanvasElement::setImageBuffer):
79         * html/HTMLCanvasElement.h:
80         * html/HTMLCollection.cpp:
81         (WebCore::HTMLCollection::invalidateNamedElementCache):
82         * html/HTMLCollection.h:
83         (WebCore::CollectionNamedElementCache::memoryCost):
84         (WebCore::HTMLCollection::memoryCost):
85         (WebCore::HTMLCollection::setNamedItemCache):
86         * platform/graphics/ImageBuffer.cpp:
87         (WebCore::ImageBuffer::memoryCost):
88         * platform/graphics/cg/ImageBufferCG.cpp:
89         (WebCore::ImageBuffer::memoryCost):
90         (WebCore::ImageBuffer::externalMemoryCost):
91
92 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
93
94         Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
95         https://bugs.webkit.org/show_bug.cgi?id=174448
96
97         Reviewed by Eric Carlson.
98
99         No behavior change.
100
101         * platform/cocoa/WebPlaybackSessionInterface.h:
102         * platform/cocoa/WebVideoFullscreenChangeObserver.h:
103         * platform/cocoa/WebVideoFullscreenModel.h:
104         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
105         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
106         * platform/ios/WebVideoFullscreenControllerAVKit.h:
107         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
108         * platform/mac/WebVideoFullscreenInterfaceMac.h:
109
110 2017-07-13  Alex Christensen  <achristensen@webkit.org>
111
112         Deleting last URLSearchParams key should remove trailing ? in associated URL
113         https://bugs.webkit.org/show_bug.cgi?id=174465
114
115         Reviewed by Chris Dumez.
116
117         This makes us match the behavior of Chrome and Firefox, and the spec after https://github.com/whatwg/url/issues/332 is approved.
118         This will be covered by an upcoming web platform test, and I updated fast/dom/DOMURL/searchparams.html to cover it now.
119
120         * platform/URLParser.cpp:
121         (WebCore::URLParser::serialize):
122         If there are no tuples, serialize to the null string instead of a non-null empty string.
123         This makes it so URL::setQuery removes the ?
124
125 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
126
127         Style fix. Replace strongThis with protectedThis.
128         https://bugs.webkit.org/show_bug.cgi?id=174444
129
130         Reviewed by Eric Carlson.
131
132         Rename, no behavior change.
133
134         * Modules/webaudio/AudioScheduledSourceNode.cpp:
135         (WebCore::AudioScheduledSourceNode::finish):
136         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
137         (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
138         (WebCore::WebCoreDecompressionSession::enqueueSample):
139         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
140         (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
141         (WebCore::WebCoreDecompressionSession::requestMediaDataWhenReady):
142         (WebCore::WebCoreDecompressionSession::flush):
143
144 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
145
146         Fix block style in WebVideoFullscreen classes.
147         https://bugs.webkit.org/show_bug.cgi?id=174446
148
149         Reviewed by Eric Carlson.
150
151         No behavior change.
152
153         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
154         (WebVideoFullscreenControllerContext::setVideoLayerFrame):
155         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
156         (-[WebAVPlayerLayer layoutSublayers]):
157         (getWebAVPictureInPicturePlayerLayerViewClass):
158         (getWebAVPlayerLayerViewClass):
159
160 2017-07-13  Joseph Pecoraro  <pecoraro@apple.com>
161
162         Web Inspector: Remove unused and untested Page domain commands
163         https://bugs.webkit.org/show_bug.cgi?id=174429
164
165         Reviewed by Timothy Hatcher.
166
167         * inspector/InspectorPageAgent.cpp:
168         (WebCore::InspectorPageAgent::disable):
169         (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
170         (WebCore::InspectorPageAgent::addScriptToEvaluateOnLoad): Deleted.
171         (WebCore::InspectorPageAgent::removeScriptToEvaluateOnLoad): Deleted.
172         * inspector/InspectorPageAgent.h:
173
174 2017-07-13  Zan Dobersek  <zdobersek@igalia.com>
175
176         [GCrypt] Implement CryptoKeyRSA SPKI exports
177         https://bugs.webkit.org/show_bug.cgi?id=173695
178
179         Reviewed by Jiewen Tan.
180
181         Implement the SPKI export operation for RSA keys for platforms that use
182         libgcrypt.
183
184         In CryptoKeyRSA::exportSpki(), we bail early with an invalid access exception if
185         this export is not being done for a public key. Otherwise, we start with creating
186         the `RSAPublicKey` ASN.1 structure, filling in the modulus and public exponent
187         data that's retrieved from the `public-key` s-expression in the signed MPI format.
188
189         We then create the `SubjectPublicKeyInfo` ASN.1 structure and fill it out with
190         the necessary data. The id-rsaEncryption object identifier is written out under
191         the `algorithm.algorithm` element, and a null value is written out under the
192         `algorithm.parameters` element. This doesn't follow the specification at the
193         moment, since id-RSASSA-PSS would have to be written for the RSA-PSS algorithm,
194         and id-RSAES-OAEP for the RSA-OAEP algorithm, along with specific parameter
195         structures. But no test in WebKit or the web-platform-tests suite covers this,
196         so this deviation should be addressed later.
197
198         Data of the previously-constructed `RSAPublicKey` structure is retrieved and
199         written out under the `subjectPublicKey` element, before finally retrieving
200         data of the `SubjectPublicKeyInfo` structure and returning that to the caller.
201
202         A helper mpiSignedData() function is added, providing overloads for gcry_mpi_t
203         and gcry_sexp_t parameters. MPI data for that parameter is retrieved and the
204         first byte of that data is tested, inserting an additional 0x00 byte at the
205         beginning of the Vector if that first byte has the first bit set, avoiding this
206         data accidentally being interpreted as a signed integer.
207
208         No new tests -- related tests are now passing and are unskipped.
209
210         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
211         (WebCore::CryptoKeyRSA::exportSpki):
212         * crypto/gcrypt/GCryptUtilities.h:
213         (WebCore::mpiSignedData):
214
215 2017-07-13  Zan Dobersek  <zdobersek@igalia.com>
216
217         [GCrypt] Implement CryptoKeyRSA SPKI imports
218         https://bugs.webkit.org/show_bug.cgi?id=173694
219
220         Reviewed by Jiewen Tan.
221
222         Implement the SPKI import operation for RSA keys for platforms that use
223         libgcrypt.
224
225         The passed-in key data is decoded against the `SubjectPublicKeyInfo` ASN.1
226         structure. We then validate the `algorithm.algorithm` element, ensuring that
227         the value under that represents a supported object identifier. This check is
228         for now mostly superficial, only ensuring that the object identifier is either
229         id-rsaEncryption, id-RSAES-OAEP or id-RSASSA-PSS. This has to be further extended
230         to also check the id-sha{1,256,384,512}WithRSAEncryption identifiers as well as
231         decoding the `algorithm.parameters` element against a specific ASN.1 structure,
232         if necessary (RSASSA-PSS-params or RSAES-OAEP-params), and cross-checking the
233         specified digest algorithm with the algorithm that's specified through the main
234         object identifier or the structure contained in `algorithm.parameters`. This is
235         avoided for now because no test in WebKit or the web-platform-tests suite covers
236         this detail of the specification.
237
238         After the algorithm is identified as supported, we proceed with decoding the
239         `subjectPublicKey` data against the `RSAPublicKey` ASN.1 structure. From there,
240         we retrieve the `modulus` and `publicExponent` data from which we can construct
241         an RSA `public-key` s-expression that can be used through libgcrypt. A new
242         CryptoKeyRSA object is then created, taking over ownership of the `public-key`
243         s-expression, and returned.
244
245         No new tests -- related tests are now passing and are unskipped.
246
247         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
248         (WebCore::supportedAlgorithmIdentifier):
249         (WebCore::CryptoKeyRSA::importSpki):
250
251 2017-07-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
252
253         REGRESSION(r219332): [GTK] 9 new failures on fast/forms spinbutton related tests
254         https://bugs.webkit.org/show_bug.cgi?id=174395
255
256         Reviewed by Carlos Garcia Campos.
257
258         Covered by existing tests.
259
260         Before r219332 the height of the spin button widget was
261         calculated as the maximum value between the individual button
262         ( the [+] or [-] ) width (33 pixels) and height (16 pixels).
263         And r219332 caused the height of the widget to be calculated as
264         the height of the button (16 pixels), which was incorrect as
265         each button should be first expanded vertically to fit the
266         preferred size of the widget.
267
268         Fix this by making the calculations about the spin button widget
269         on a new function spinButtonSize() that takes this into account,
270         and use this values both for adjusting the style of the input
271         field and the spin button widget itself.
272
273         * rendering/RenderThemeGtk.cpp:
274         (WebCore::spinButtonSize):
275         (WebCore::RenderThemeGtk::adjustTextFieldStyle):
276         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
277
278 2017-07-13  Miguel Gomez  <magomez@igalia.com>
279
280         [GTK][WPE] border-radius with non visible border doesn't work on images that have their own RenderLayer
281         https://bugs.webkit.org/show_bug.cgi?id=174157
282
283         Reviewed by Carlos Garcia Campos.
284
285         Do not allow direct compositing of images when they have a border-radius property on WebKitGTK+ and WPE.
286         These platforms don't support clipping using rounded rectangles during composition, which is required
287         when using border-radius and the border is not visible. Due to this, they need to perform the clippping
288         with cairo.
289
290         This is a temporal fix, until appropriate clipping is implemented in the TextureMapper.
291
292         No new tests.
293
294         * rendering/RenderLayerBacking.cpp:
295         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
296
297 2017-07-13  Chris Fleizach  <cfleizach@apple.com>
298
299         AX: WebView crashes app after opening VoiceOver context box menu from modal dialog
300         https://bugs.webkit.org/show_bug.cgi?id=163999
301         <rdar://problem/28949013>
302
303         Reviewed by Joanmarie Diggs.
304
305         Protect when m_object goes away.
306
307         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
308         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
309
310 2017-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
311
312         Async image decoding for large images should be disabled by default
313         https://bugs.webkit.org/show_bug.cgi?id=174432
314
315         Reviewed by Simon Fraser.
316
317         -- Rename GraphicsLayerPaintFlags::Snapshotting to AllowAsyncImageDecoding.
318         -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by
319            GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None
320            by AllowAsyncImageDecoding.
321         -- Rename PaintBehaviorSnapshotting to PaintBehaviorAllowAsyncImageDecoding.
322         -- Propagate PaintBehaviorAllowAsyncImageDecoding from a parent view to 
323            a child view instead of propagating PaintBehaviorSnapshotting.
324         -- Remove setting the bit PaintBehaviorSnapshotting in any new PaintBehavoir.
325         -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir
326            by resetting the bit PaintBehaviorAllowAsyncImageDecoding.
327
328         * html/shadow/MediaControlElements.cpp:
329         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
330         * page/FrameView.cpp:
331         (WebCore::FrameView::willPaintContents):
332         (WebCore::FrameView::paintContentsForSnapshot):
333         * platform/graphics/GraphicsLayer.h:
334         * platform/graphics/GraphicsLayerClient.h:
335         * platform/graphics/mac/WebLayer.mm:
336         (-[WebLayer drawInContext:]):
337         (-[WebSimpleLayer drawInContext:]):
338         * rendering/PaintPhase.h:
339         * rendering/RenderBoxModelObject.cpp:
340         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
341         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
342         * rendering/RenderBoxModelObject.h:
343         * rendering/RenderImage.cpp:
344         (WebCore::RenderImage::paintIntoRect):
345         * rendering/RenderLayer.cpp:
346         (WebCore::RenderLayer::paintLayerContents):
347         (WebCore::RenderLayer::paintForegroundForFragments):
348         * rendering/RenderLayerBacking.cpp:
349         (WebCore::RenderLayerBacking::paintContents):
350         * rendering/RenderWidget.cpp:
351         (WebCore::RenderWidget::paintContents): We need to propagate the 
352         PaintBehaviorAllowAsyncImageDecoding from RenderWidget to the FrameView.
353         We did not need to do that for PaintBehaviorSnapshotting because 
354         FrameView was setting it in its m_paintBehavior if (document->printing())
355         in FrameView::willPaintContents().
356
357 2017-07-12  Timothy Hatcher  <timothy@hatcher.name>
358
359         REGRESSION(r219391): Broke the USE(OPENGL_ES_2) build
360         https://bugs.webkit.org/show_bug.cgi?id=174442
361
362         Unreviewed build fix.
363
364         * platform/graphics/egl/GLContextEGL.cpp: Fix typo of OPENGL_ES2.
365
366 2017-07-12  Youenn Fablet  <youenn@apple.com>
367
368         Recreate the AudioUnit when restarting capture
369         https://bugs.webkit.org/show_bug.cgi?id=174439
370
371         Reviewed by Jer Noble.
372
373         Sometimes other applications in the system like FaceTime may make the audio unit not functional.
374         Reloading the tab capturing audio will trigger a call to stop the audio shared unit.
375         When the tab requests again audio, the shared unit will restart.
376         At that time, the AudioUnit shared unit will be fully recreated.
377
378         Manually tested by doing a webrtc call and then doing a FaceTime call.
379         Remote WebRTC endpoints may not receive any audio.
380         With the patch, reloading the web page will get back the audio.
381         Previously, restarting the UIProcess was the only way.
382
383         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
384         (WebCore::CoreAudioSharedUnit::startProducingData): Cleaning the audio unit when starting to produce data if there is a preexisting audio unit.
385
386 2017-07-12  Youenn Fablet  <youenn@apple.com>
387
388         Accessing localDescription, remoteDescription, etc. after setTimeout raises EXC_BAD_ACCESS
389         https://bugs.webkit.org/show_bug.cgi?id=174323
390         <rdar://problem/33267876>
391
392         Reviewed by Eric Carlson.
393
394         Test: webrtc/calling-peerconnection-once-closed.html
395
396         In case the libwebrtc backend is null, we should not use it to get description from it.
397         Return null in that case.
398
399         Adding ASSERT to other calls where the layer above LibWebRTCMediaEndpoint should protect
400         from calling a function on a null libwebrtc backend.
401
402         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
403         (WebCore::LibWebRTCMediaEndpoint::currentLocalDescription):
404         (WebCore::LibWebRTCMediaEndpoint::currentRemoteDescription):
405         (WebCore::LibWebRTCMediaEndpoint::pendingLocalDescription):
406         (WebCore::LibWebRTCMediaEndpoint::pendingRemoteDescription):
407         (WebCore::LibWebRTCMediaEndpoint::localDescription):
408         (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
409         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
410         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
411         (WebCore::LibWebRTCMediaEndpoint::addTrack):
412         (WebCore::LibWebRTCMediaEndpoint::removeTrack):
413         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
414         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
415         (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
416
417 2017-07-12  Commit Queue  <commit-queue@webkit.org>
418
419         Unreviewed, rolling out r219176.
420         https://bugs.webkit.org/show_bug.cgi?id=174436
421
422         "Can cause infinite recursion on iOS" (Requested by mlam on
423         #webkit).
424
425         Reverted changeset:
426
427         "WTF::Thread should have the threads stack bounds."
428         https://bugs.webkit.org/show_bug.cgi?id=173975
429         http://trac.webkit.org/changeset/219176
430
431 2017-07-12  Nan Wang  <n_wang@apple.com>
432
433         AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
434         https://bugs.webkit.org/show_bug.cgi?id=174393
435         <rdar://problem/33248006>
436
437         Reviewed by Chris Fleizach.
438
439         Used the existing findClosestPlainText function to search the range on iOS.
440         Also exposed a function on the iOS wrapper to return the selection rects of
441         the result range from the searching. 
442
443         Test: accessibility/ios-simulator/text-marker-range-matches-text.html
444
445         * accessibility/AXObjectCache.cpp:
446         (WebCore::visiblePositionForPositionWithOffset):
447         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
448         * accessibility/AXObjectCache.h:
449         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
450         (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
451         (-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
452         (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
453         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
454
455 2017-07-12  Matt Lewis  <jlewis3@apple.com>
456
457         Unreviewed, rolling out r219409.
458
459         The revision caused the Windows builds to fail.
460
461         Reverted changeset:
462
463         "AX: [iOS] Implement a way to retrieve a text marker range
464         with desired text that is closest to a position"
465         https://bugs.webkit.org/show_bug.cgi?id=174393
466         http://trac.webkit.org/changeset/219409
467
468 2017-07-12  Alicia Boya GarcĂ­a  <aboya@igalia.com>
469
470         [FreeType] Enable BCI on webfonts
471         https://bugs.webkit.org/show_bug.cgi?id=174403
472
473         Reviewed by Michael Catanzaro.
474
475         The FreeType BCI hinter used to be disabled on webfonts in favor of
476         the autohinter.
477
478         FreeType BCI hinter has improved considerably in the past and now most
479         other browsers enable it too. Given the old reasons no longer apply,
480         the BCI has now been enabled in order to get better text rendering when
481         embedded hints are available.
482
483         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
484         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
485
486 2017-07-12  Commit Queue  <commit-queue@webkit.org>
487
488         Unreviewed, rolling out r219361.
489         https://bugs.webkit.org/show_bug.cgi?id=174434
490
491         Huge PLUM memory regression on iOS (Requested by kling on
492         #webkit).
493
494         Reverted changeset:
495
496         "[WebIDL] Convert MutationCallback to be a normal generate
497         callback"
498         https://bugs.webkit.org/show_bug.cgi?id=174140
499         http://trac.webkit.org/changeset/219361
500
501 2017-07-12  Eric Carlson  <eric.carlson@apple.com>
502
503         [MediaStream] a capture source failure should end the MediaStreamTrack
504         https://bugs.webkit.org/show_bug.cgi?id=174375
505
506         Reviewed by Youenn Fablet.
507
508         Test: fast/mediastream/media-stream-track-source-failure.html
509
510         * platform/mediastream/RealtimeMediaSource.cpp:
511         (WebCore::RealtimeMediaSource::captureFailed): New, signal observers that the source has ended.
512         * platform/mediastream/RealtimeMediaSource.h:
513
514         * platform/mediastream/mac/AVMediaCaptureSource.h:
515         * platform/mediastream/mac/AVMediaCaptureSource.mm:
516         (WebCore::AVMediaCaptureSource::setupSession): Call captureFailed if setupCaptureSession fails.
517
518         * platform/mediastream/mac/AVVideoCaptureSource.h:
519         * platform/mediastream/mac/AVVideoCaptureSource.mm:
520         (WebCore::AVVideoCaptureSource::setupCaptureSession): Return false on failure.
521         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete unused instance variable.
522         (WebCore::AVVideoCaptureSource::processNewFrame): Ditto.
523
524         * testing/Internals.cpp:
525         (WebCore::Internals::endMediaStreamTrackCaptureSource): Call track.source.captureFailed().
526         * testing/Internals.h:
527         * testing/Internals.idl:
528
529 2017-07-12  Timothy Hatcher  <timothy@hatcher.name>
530
531         Improve font matching with FontConfig and FreeType
532         https://bugs.webkit.org/show_bug.cgi?id=174374
533
534         Reviewed by Michael Catanzaro.
535
536         * platform/graphics/freetype/FontCacheFreeType.cpp:
537         (WebCore::FontCache::createFontPlatformData): Loop through all family name matches from FcFontMatch.
538
539 2017-07-12  Youenn Fablet  <youenn@apple.com>
540
541         Reactivate audio ducking when restarting the shared unit
542         https://bugs.webkit.org/show_bug.cgi?id=174428
543
544         Reviewed by Eric Carlson.
545
546         Currently, when another application ducks WebKit, there is no other way than to quit the UIProcess and restart it.
547         By again audio ducking when starting the audio unit, reloading the page will be enough.
548         Testing by launching a tab with audio capture and audio playing.
549         Then make a FaceTime call and hear the tab volume go down.
550         End the call to FaceTime and the tab volume remains low.
551         Reload the tab and the volume has a normal level.
552
553         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
554         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
555         (WebCore::CoreAudioSharedUnit::startInternal):
556
557 2017-07-12  Antoine Quint  <graouts@apple.com>
558
559         Playback controls should not hide while AirPlay is active
560         https://bugs.webkit.org/show_bug.cgi?id=174422
561         <rdar://problem/33011477>
562
563         Reviewed by Eric Carlson.
564
565         We now also track changes in AirPlay playback status and account for it when identifying whether we
566         ought to let media controls automatically hide, which should only happen if the media is playing and
567         not playing back through AirPlay.
568
569         * Modules/modern-media-controls/media/controls-visibility-support.js:
570         (ControlsVisibilitySupport.prototype.get mediaEvents):
571         (ControlsVisibilitySupport.prototype._updateControls):
572         (ControlsVisibilitySupport):
573
574 2017-07-12  Daniel Bates  <dabates@apple.com>
575
576         Attempt to fix the build following <https://trac.webkit.org/changeset/219407>
577         (https://bugs.webkit.org/show_bug.cgi?id=174386)
578
579         Fix bad merge after <https://trac.webkit.org/changeset/219404>.
580
581         * loader/FrameLoader.cpp:
582         (WebCore::FrameLoader::loadURL):
583         (WebCore::FrameLoader::loadWithNavigationAction):
584         (WebCore::FrameLoader::loadPostRequest):
585         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
586         (WebCore::FrameLoader::loadDifferentDocumentItem):
587         * loader/FrameLoader.h:
588
589 2017-07-12  Nan Wang  <n_wang@apple.com>
590
591         AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
592         https://bugs.webkit.org/show_bug.cgi?id=174393
593         <rdar://problem/33248006>
594
595         Reviewed by Chris Fleizach.
596
597         Used the existing findClosestPlainText function to search the range on iOS.
598         Also exposed a function on the iOS wrapper to return the selection rects of
599         the result range from the searching. 
600
601         Test: accessibility/ios-simulator/text-marker-range-matches-text.html
602
603         * accessibility/AXObjectCache.cpp:
604         (WebCore::visiblePositionForPositionWithOffset):
605         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
606         * accessibility/AXObjectCache.h:
607         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
608         (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
609         (-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
610         (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
611         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
612
613 2017-07-12  Daniel Bates  <dabates@apple.com>
614
615         NavigationAction should track whether the navigation was initiated by the main frame
616         https://bugs.webkit.org/show_bug.cgi?id=174386
617         <rdar://problem/33245267>
618
619         Reviewed by Brady Eidson.
620
621         Although we added state to NavigationAction to track whether the navigation was
622         initiated by the main frame in r219170 it is not possible to initialize this state
623         when instantiating a NavigationAction. Having NavigationAction track this state
624         will be useful to ensure that we can always compute the source frame information
625         when asking the embedding client whether to allow a navigation. We will make use
626         of it in the fix for <https://bugs.webkit.org/show_bug.cgi?id=174385>.
627
628         No behavior changed. So, no new tests.
629
630         * loader/FrameLoader.cpp:
631         (WebCore::FrameLoader::loadURL): Pass whether the load was initiated by the main frame
632         when instantiating the NavigationAction.
633         (WebCore::FrameLoader::load): For now, pass InitiatedByMainFrame::Unknown when instantiating
634         the NavigationAction as we do not know if the load was initiated by the main frame.
635         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
636         (WebCore::FrameLoader::reload): Ditto
637         (WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
638         (WebCore::createWindow): Pass whether the load was initiated by the main frame when
639         instantiating the NavigationAction.
640         * loader/NavigationAction.cpp:
641         (WebCore::NavigationAction::NavigationAction): Modified to take argument of type InitiatedByMainFrame
642         that indicates whether the navigation was initiated by the main frame.
643         * loader/NavigationAction.h:
644         * loader/PolicyChecker.cpp:
645         (WebCore::PolicyChecker::checkNavigationPolicy): For now, pass InitiatedByMainFrame::Unknown
646         when instantiating the NavigationAction as we do not know if the load was initiated by the
647         main frame.
648         * page/ContextMenuController.cpp:
649         (WebCore::openNewWindow): Pass whether the load was initiated by the main frame when
650         instantiating the NavigationAction.
651
652 2017-07-12  Daniel Bates  <dabates@apple.com>
653
654         Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame
655         https://bugs.webkit.org/show_bug.cgi?id=174427
656
657         Rubber-stamped by Brady Eidson.
658
659         * inspector/InspectorFrontendClientLocal.cpp:
660         (WebCore::InspectorFrontendClientLocal::openInNewTab):
661         * inspector/InspectorPageAgent.cpp:
662         (WebCore::InspectorPageAgent::navigate):
663         * loader/FrameLoadRequest.cpp:
664         (WebCore::FrameLoadRequest::FrameLoadRequest):
665         * loader/FrameLoadRequest.h:
666         (WebCore::FrameLoadRequest::FrameLoadRequest):
667         (WebCore::FrameLoadRequest::initiatedByMainFrame):
668         (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame): Deleted.
669         * loader/FrameLoader.cpp:
670         (WebCore::FrameLoader::urlSelected):
671         (WebCore::FrameLoader::loadURLIntoChildFrame):
672         (WebCore::shouldOpenExternalURLsPolicyToApply):
673         (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
674         (WebCore::FrameLoader::loadURL):
675         (WebCore::FrameLoader::loadWithNavigationAction):
676         (WebCore::FrameLoader::reloadWithOverrideEncoding):
677         (WebCore::FrameLoader::reload):
678         (WebCore::FrameLoader::loadPostRequest):
679         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
680         (WebCore::FrameLoader::loadDifferentDocumentItem):
681         * loader/FrameLoader.h:
682         * loader/FrameLoaderTypes.h:
683         * loader/NavigationAction.h:
684         (WebCore::NavigationAction::initiatedByMainFrame):
685         (WebCore::NavigationAction::navigationInitiatedByMainFrame): Deleted.
686         * loader/NavigationScheduler.cpp:
687         (WebCore::ScheduledNavigation::ScheduledNavigation):
688         (WebCore::ScheduledNavigation::initiatedByMainFrame):
689         (WebCore::NavigationScheduler::scheduleLocationChange):
690         (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame): Deleted.
691         * page/ContextMenuController.cpp:
692         (WebCore::openNewWindow):
693         (WebCore::ContextMenuController::contextMenuItemSelected):
694         * page/DOMWindow.cpp:
695         (WebCore::DOMWindow::createWindow):
696
697 2017-07-12  Matt Lewis  <jlewis3@apple.com>
698
699         Unreviewed, rolling out r219401.
700
701         This revision rolled out the previous patch, but after talking
702         with reviewer, a rebaseline is what was needed.Rolling back in
703         before rebaseline.
704
705         Reverted changeset:
706
707         "Unreviewed, rolling out r219379."
708         https://bugs.webkit.org/show_bug.cgi?id=174400
709         http://trac.webkit.org/changeset/219401
710
711 2017-07-12  Matt Lewis  <jlewis3@apple.com>
712
713         Unreviewed, rolling out r219379.
714
715         This revision caused a consistent failure in the test
716         fast/dom/Window/property-access-on-cached-window-after-frame-
717         removed.html.
718
719         Reverted changeset:
720
721         "Remove NAVIGATOR_HWCONCURRENCY"
722         https://bugs.webkit.org/show_bug.cgi?id=174400
723         http://trac.webkit.org/changeset/219379
724
725 2017-07-12  Zalan Bujtas  <zalan@apple.com>
726
727         Paginated mode: Infinite recursion in RenderTable::layout
728         https://bugs.webkit.org/show_bug.cgi?id=174413
729
730         Reviewed by Simon Fraser.
731
732         This patch is a workaround for avoiding infinite recursion when the table layout does not stabilize.
733         Apparently we leak some context (computed padding in this case) from the current to the subsequent layout.
734         The subsequent layouts always end up producing different line heights for some of the cells in the <thead>.
735         In paginated mode, when the section moves (<thead>, <tbody> etc) we call layout again recursively.
736         This could lead to infinite recursion for unstable table layout.
737
738         Unable to come up with a reduction yet.
739
740         * rendering/RenderTable.cpp:
741         (WebCore::RenderTable::layout):
742         * rendering/RenderTable.h:
743
744 2017-07-12  Youenn Fablet  <youenn@apple.com>
745
746         WebRTC: Incorrect sdpMLineIndex for video breaks Firefox interop
747         https://bugs.webkit.org/show_bug.cgi?id=173530
748
749         Reviewed by Alex Christensen.
750
751         Test: webrtc/ice-candidate-sdpMLineIndex.html
752
753         Reading missing parameter from libwebrtc backend and setting it when firing the RTCIceCandidate event.
754
755         * Modules/mediastream/PeerConnectionBackend.cpp:
756         (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
757         (WebCore::PeerConnectionBackend::newICECandidate):
758         * Modules/mediastream/PeerConnectionBackend.h:
759         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
760         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
761
762 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
763
764         [GCrypt] Implement CryptoKeyEC PKCS#8 exports
765         https://bugs.webkit.org/show_bug.cgi?id=173648
766
767         Reviewed by Jiewen Tan.
768
769         Implement the PKCS#8 export operation for EC keys for platforms that use
770         libgcrypt.
771
772         First, the `ECParameters` and the `ECPrivateKey` ASN.1 structures are created
773         and filled out accordingly. For the former, the appropriate object identifier
774         is written under the `namedCurve` element of the structure. For the latter, we
775         write out '1' under `version`, and eliminate the optional `parameters` element.
776         An libgcrypt EC context is then used to retrieve the private and public key
777         MPIs that are then written out under the `privateKey` and `publicKey` elements,
778         respectively.
779
780         After that, we can proceed to create and fill out the `PrivateKeyInfo` structure.
781         0 is written out under the `version` element, and the id-ecPublicKey object
782         identifier is written out under the `privateKeyAlgorithm.algorithm` element. This
783         doesn't strictly follow the specification, since the id-ecDH identifier should be
784         used for ECDH keys, but no test in WebKit or the web-platform-tests suite covers
785         this, so this specific detail should be revisited later.
786
787         Data of the previously-constructed `ECParameters` structure is retrieved and
788         written out under the `privateKeyAlgorithm.parameters` element. Similarly is done
789         for the `ECPrivateKey` structure, writing out its data under the `privateKey`
790         element. Finally, the optional `attributes` element of the `PrivateKeyInfo`
791         structure is eliminated, and the encoded data of this structure is retrieved and
792         returned.
793
794         No new tests -- relevant tests are now passing and are unskipped.
795
796         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
797         (WebCore::CryptoKeyEC::platformExportPkcs8):
798
799 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
800
801         [WPE] Use libepoxy
802         https://bugs.webkit.org/show_bug.cgi?id=172104
803
804         Reviewed by Michael Catanzaro.
805
806         No new tests -- no changes in behavior.
807
808         Implement the proper libepoxy header inclusion for ports that enable it.
809
810         The library acts as a loading facility working on top of the system-provided
811         OpenGL and EGL libraries, with the headers providing a complete collection of
812         specification-defined OpenGL and EGL types, constants and entrypoints.
813
814         Support is added through the USE(LIBEPOXY) build guard. Note that this guard
815         isn't exclusive with USE(OPENGL), USE(OPENGL_ES_2) or USE(EGL), so the
816         USE(LIBEPOXY) condition is tested before those.
817
818         In case of OpenGL headers, the <epoxy/gl.h> header is included, and in
819         case of EGL headers, the <epoxy/egl.h> header. <epoxy/egl.h> includes
820         <epoxy/gl.h> on its own, so in some cases the inclusion of the latter is
821         omitted.
822
823         EpoxyShims.h header is added, doing a job similar to OpenGLESShims.h. The
824         EXT-suffixed GL entrypoints are redefined to the non-suffixed versions.
825         No suffixed constants are defined because those are defined by the libepoxy
826         headers to the well-known values.
827
828         * CMakeLists.txt:
829         * PlatformWPE.cmake:
830         * platform/graphics/ANGLEWebKitBridge.h:
831         * platform/graphics/EpoxyShims.h: Added.
832         * platform/graphics/GLContext.cpp:
833         (WebCore::initializeOpenGLShimsIfNeeded):
834         * platform/graphics/GraphicsContext3DPrivate.cpp:
835         * platform/graphics/PlatformDisplay.cpp:
836         * platform/graphics/cairo/CairoUtilities.cpp:
837         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
838         (WebCore::GraphicsContext3D::create):
839         * platform/graphics/cairo/ImageBufferCairo.cpp:
840         * platform/graphics/egl/GLContextEGL.cpp:
841         * platform/graphics/egl/GLContextEGLWPE.cpp:
842         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
843         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
844         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
845         * platform/graphics/opengl/Extensions3DOpenGLES.h:
846         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
847         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
848         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
849         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
850
851 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
852
853         ImageDecoder: Gifs with infinite animation only play once very often
854         https://bugs.webkit.org/show_bug.cgi?id=173403
855
856         Reviewed by Michael Catanzaro.
857
858         It doesn't always happen, it's easier to reproduce when loading big files from the network, but it also depends
859         on every file. The problem is that ImageFrameCache is caching the repetition count value always when the size is
860         already available. In the case of gif files, the loop count value can be at any point of the image stream, so
861         having the size available doesn't mean we also have the loop count. So, if the value is queried before it's
862         available, the default value is cached (repeat once) and then always used. We should clear the cached value when
863         new data is added to the decoder, like we do with other cached values that can change when more data is decoded.
864
865         * platform/graphics/ImageFrameCache.cpp:
866         (WebCore::ImageFrameCache::clearMetadata): Clear m_repetitionCount.
867
868 2017-07-12  Adrian Perez de Castro  <aperez@igalia.com>
869
870         [SOUP] Do not use C linkage for functions using C++ features
871         https://bugs.webkit.org/show_bug.cgi?id=174392
872
873         Reviewed by Michael Catanzaro.
874
875         No new tests because there is no behavior change.
876
877         * platform/network/soup/WebKitSoupRequestGeneric.h: Move G_END_DECLS
878         to leave functions which use C++ features outside of the block it
879         delimits.
880
881 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
882
883         [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
884         https://bugs.webkit.org/show_bug.cgi?id=174161
885
886         Reviewed by Michael Catanzaro.
887
888         It seems selection data could contain an empty string, in which case gtk_selection_data_get_data() returns a
889         valid pointer, but gtk_selection_data_get_length() returns 0. When this happens we end up trying to split an
890         empty string resulting in an empty vector, but we unconditionally access the first element of the vector.
891
892         * platform/gtk/PasteboardHelper.cpp:
893         (WebCore::selectionDataToUTF8String): Return a null string in case selection data length is 0.
894         (WebCore::PasteboardHelper::fillSelectionData): Return early if selection data length is 0, instead of checking
895         the selection data pointer.
896
897 2017-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
898
899         [GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
900         https://bugs.webkit.org/show_bug.cgi?id=174357
901
902         Reviewed by Michael Catanzaro.
903
904         Implement lockFile and unlockFile using flock().
905
906         * PlatformWPE.cmake:
907         * platform/glib/FileSystemGlib.cpp:
908         (WebCore::lockFile):
909         (WebCore::unlockFile):
910
911 2017-07-11  Yusuke Suzuki  <utatane.tea@gmail.com>
912
913         Use FastAllocator in STL containers
914         https://bugs.webkit.org/show_bug.cgi?id=174366
915
916         Rubber stamped by Sam Weinig.
917
918         This patch uses FastAllocator for STL containers including std::set and std::map.
919         STL can take a template parameter to be used as allocator for containers.
920         We prepare FastAllocator, which uses fastMalloc for allocation.
921         This allows us to use bmalloc (if supported) for STL containers which offers
922         functionalities that is not supported in WTF containers.
923
924         * Modules/indexeddb/IDBKeyData.h:
925         * Modules/indexeddb/server/IndexValueEntry.cpp:
926         (WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
927         (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
928         (WebCore::IDBServer::IndexValueEntry::reverseFind):
929         * Modules/indexeddb/server/IndexValueEntry.h:
930         * Modules/indexeddb/server/IndexValueStore.cpp:
931         (WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
932         (WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
933         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
934         * Modules/indexeddb/server/IndexValueStore.h:
935         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
936         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
937         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
938         * Modules/indexeddb/server/MemoryObjectStore.cpp:
939         (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
940         (WebCore::IDBServer::MemoryObjectStore::addRecord):
941         (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
942         * Modules/indexeddb/server/MemoryObjectStore.h:
943         (WebCore::IDBServer::MemoryObjectStore::orderedKeys):
944         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
945         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
946         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
947         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
948         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
949         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
950         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
951         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
952         * Modules/mediasource/SampleMap.h:
953         * page/WheelEventTestTrigger.cpp:
954         (WebCore::WheelEventTestTrigger::deferTestsForReason):
955         (WebCore::dumpState):
956         * page/WheelEventTestTrigger.h:
957         * platform/graphics/cv/VideoTextureCopierCV.cpp:
958         (WebCore::enumToStringMap):
959         * rendering/OrderIterator.h:
960
961 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
962
963         [Win] Build error when building WebKit.dll from WebKit.proj project file.
964         https://bugs.webkit.org/show_bug.cgi?id=174410
965
966         Reviewed by Brent Fulgham.
967
968         Copy required header files to forwarding headers folder.
969
970         * PlatformWin.cmake:
971
972 2017-07-11  Dean Jackson  <dino@apple.com>
973
974         Remove NAVIGATOR_HWCONCURRENCY
975         https://bugs.webkit.org/show_bug.cgi?id=174400
976
977         Reviewed by Sam Weinig.
978
979         * Configurations/FeatureDefines.xcconfig:
980         * WebCore.xcodeproj/project.pbxproj:
981         * page/NavigatorBase.cpp:
982         (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
983         * page/NavigatorBase.h:
984         * page/NavigatorConcurrentHardware.idl: Removed.
985
986 2017-07-11  Youenn Fablet  <youenn@apple.com>
987
988         RealtimeOutgoingAudioSource should not push more audio data if the WebRTC thread is not able to process it
989         https://bugs.webkit.org/show_bug.cgi?id=174383
990
991         Reviewed by Eric Carlson.
992
993         This patch adds support to check for pending-processing audio data.
994         If the amount of audio data is bigger than a high water mark of 0.5 seconds,
995         we stop pushing new audio data until buffered audio data is lower than a low water mark of 0.1 seconds.
996         Patch is tested by adding breakpoints to trigger the high water mark, verifying that low water mark is triggered
997         and receiving audio is fine on the other connection endpoint.
998
999         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1000         (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit):
1001         (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataLowLimit):
1002         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1003         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1004
1005 2017-07-11  Dean Jackson  <dino@apple.com>
1006
1007         Rolling out r219372.
1008
1009         * Configurations/FeatureDefines.xcconfig:
1010         * WebCore.xcodeproj/project.pbxproj:
1011         * page/NavigatorBase.cpp:
1012         (WebCore::NavigatorBase::hardwareConcurrency):
1013         * page/NavigatorBase.h:
1014         * page/NavigatorConcurrentHardware.idl: Added.
1015
1016 2017-07-11  Dean Jackson  <dino@apple.com>
1017
1018         Remove NAVIGATOR_HWCONCURRENCY
1019         https://bugs.webkit.org/show_bug.cgi?id=174400
1020
1021         Reviewed by Sam Weinig.
1022
1023         * Configurations/FeatureDefines.xcconfig:
1024         * WebCore.xcodeproj/project.pbxproj:
1025         * page/NavigatorBase.cpp:
1026         (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
1027         * page/NavigatorBase.h:
1028         * page/NavigatorConcurrentHardware.idl: Removed.
1029
1030 2017-07-11  Jiewen Tan  <jiewen_tan@apple.com>
1031
1032         [WebCrypto] CryptoKeyECMac::Custom OpenSSL tag is actually tagged type [1]
1033         https://bugs.webkit.org/show_bug.cgi?id=174382
1034         <rdar://problem/33244871>
1035
1036         Reviewed by Brent Fulgham.
1037
1038         No change of behaviour.
1039
1040         * crypto/mac/CryptoKeyECMac.cpp:
1041         (WebCore::CryptoKeyEC::platformImportPkcs8):
1042         (WebCore::CryptoKeyEC::platformExportPkcs8):
1043         Replace CustomECParameters with TaggedType1 according to X.690(08/2015) section 8.14:
1044         https://www.itu.int/rec/T-REC-X.690-201508-I/en
1045         and RFC 5915 Appendix A:
1046         http://www.ietf.org/rfc/rfc5915.txt.
1047
1048 2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1049
1050         REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
1051         https://bugs.webkit.org/show_bug.cgi?id=174376
1052
1053         Reviewed by Simon Fraser.
1054
1055         When adding a CachedImageClient to CachedImage::m_pendingImageDrawingClients
1056         and the CachedImageClient is not one of the CachedImage::m_clients, we
1057         should cancel the repaint optimization in CachedImage::imageFrameAvailable().
1058         This can be done by adding all the CachedImage::m_clients to CachedImage::
1059         m_pendingImageDrawingClients.
1060
1061         Test: fast/images/async-image-body-background-image.html
1062
1063         * loader/cache/CachedImage.cpp:
1064         (WebCore::CachedImage::addPendingImageDrawingClient):
1065
1066 2017-07-11  Chris Dumez  <cdumez@apple.com>
1067
1068         Unreviewed, fix Windows build after r219355.
1069
1070         * bindings/js/JSDOMWindowCustom.cpp:
1071         (WebCore::addCrossOriginWindowPropertyNames):
1072         (WebCore::addCrossOriginWindowOwnPropertyNames):
1073         (WebCore::JSDOMWindow::getOwnPropertyNames):
1074         (WebCore::addCrossOriginPropertyNames): Deleted.
1075         (WebCore::addCrossOriginOwnPropertyNames): Deleted.
1076         * bindings/js/JSLocationCustom.cpp:
1077         (WebCore::addCrossOriginLocationPropertyNames):
1078         (WebCore::addCrossOriginLocationOwnPropertyNames):
1079         (WebCore::JSLocation::getOwnPropertyNames):
1080         (WebCore::addCrossOriginPropertyNames): Deleted.
1081         (WebCore::addCrossOriginOwnPropertyNames): Deleted.
1082
1083 2017-07-10  Sam Weinig  <sam@webkit.org>
1084
1085         [WebIDL] Convert MutationCallback to be a normal generate callback
1086         https://bugs.webkit.org/show_bug.cgi?id=174140
1087
1088         Reviewed by Chris Dumez.
1089
1090         To make this work more nicely, I:
1091         - Added the ability to for non-nullable interfaces in sequences to be passed
1092           via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
1093           (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
1094           signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
1095           than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
1096         - Added a new extended attribute for callback functions called [CallbackNeedsCanInvoke]
1097           that adds a virtual function called canInvoke() to the generated callback.
1098           All it does is forward to ActiveDOMCallback's canInvokeCallback, but it
1099           allows the implementation to get to it. We may one day want to move the 
1100           inheritance of ActiveDOMCallback from the generated source to the base class.
1101         - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
1102           which allows you to specify that the callback needs a this object in addition
1103           to its arguments. When specified, the first argument of the C++ implementation
1104           function will now correspond to the this object, with the remaining arguments
1105           shifted over one.
1106
1107         * DerivedSources.make:
1108         Add MutationCallback.
1109
1110         * WebCore.xcodeproj/project.pbxproj:
1111         Remove non-generated JSMutationCallback.cpp, and add generated JSMutationCallback.cpp.
1112
1113         * Modules/mediastream/MediaDevicesRequest.cpp:
1114         (WebCore::MediaDevicesRequest::filterDeviceList):
1115         (WebCore::MediaDevicesRequest::start):
1116         * Modules/mediastream/MediaDevicesRequest.h:
1117         Switch to using Ref.
1118
1119         * bindings/IDLTypes.h:
1120         Add InnerParameterType and NullableInnerParameterType type hooks
1121         and specialize wrappers to use Ref for InnerParameterType, and RefPtr
1122         for NullableInnerParameterType.
1123
1124         * bindings/js/JSCallbackData.cpp:
1125         * bindings/js/JSCallbackData.h:
1126         Add support for passing a this object.
1127
1128         * bindings/js/JSMutationCallback.cpp: Removed.
1129         * bindings/js/JSMutationCallback.h: Removed.
1130         Remove custom callback code.
1131
1132         * bindings/js/JSMutationObserverCustom.cpp:
1133         (WebCore::constructJSMutationObserver): Deleted.
1134         Remove no longer needed custom constructor.
1135
1136         * bindings/scripts/CodeGenerator.pm:
1137         (ParseType):
1138         Add helper to parse a type and cache the result.
1139
1140         * bindings/scripts/CodeGeneratorJS.pm:
1141         (GenerateCallbackHeaderContent):
1142         (GenerateCallbackImplementationContent):
1143         Add support for [CallbackNeedsCanInvoke] and [CallbackThisObject]. When [CallbackThisObject]
1144         is not specified, use jsUndefined() as the this object as specified by WebIDL.
1145
1146         * bindings/scripts/IDLAttributes.json:
1147         Add [CallbackNeedsCanInvoke] and [CallbackThisObject].
1148
1149         * bindings/scripts/IDLParser.pm:
1150         (ParseType):
1151         Add entry point to parse a single type.
1152
1153         * css/FontFaceSet.h:
1154         Switch to using Ref.
1155
1156         * dom/MutationCallback.h:
1157         Update signatures.
1158
1159         * dom/MutationCallback.idl: Added.
1160     
1161         * dom/MutationObserver.cpp:
1162         (WebCore::MutationObserver::canDeliver):
1163         (WebCore::MutationObserver::deliver):
1164         Switch to new signatures.
1165
1166         * dom/MutationObserver.idl:
1167         Remove CustomConstructor.
1168
1169         * page/IntersectionObserverCallback.h:
1170         Switch to using Ref.
1171
1172         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1173         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
1174         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
1175         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
1176         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
1177         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1178         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
1179         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
1180         Add / update bindings tests.
1181
1182 2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1183
1184         RenderImage should not add itself as a RelevantRepaintedObject if its image frame is being decoded
1185         https://bugs.webkit.org/show_bug.cgi?id=174336
1186
1187         Reviewed by Simon Fraser.
1188
1189         Since nothing will be drawn till the image frame finishes decoding we should
1190         treat returning ImageDrawResult::DidRequestDecoding from BitmapImage::draw
1191         the same as we do when the image is still loading.
1192
1193         * rendering/RenderImage.cpp:
1194         (WebCore::RenderImage::paintReplaced):
1195         (WebCore::RenderImage::paintIntoRect):
1196         * rendering/RenderImage.h:
1197
1198 2017-07-11  Youenn Fablet  <youenn@apple.com>
1199
1200         [WebRTC] Hanging under LibWebRTCMediaEndpoint::getStats
1201         https://bugs.webkit.org/show_bug.cgi?id=174377
1202
1203         Reviewed by Eric Carlson.
1204
1205         No change of behavior.
1206         Moving calls to libwebrtc getStats in the signalling thread since doing it in the main thread
1207         would block the main thread until the signalling thread is ready to handle getStats.
1208         Reducing stat logging since this may be too much for some devices.
1209
1210         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1211         (WebCore::LibWebRTCMediaEndpoint::getStats):
1212         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
1213         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
1214         (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
1215
1216 2017-07-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1217
1218         Remove unused OpenGL files
1219         https://bugs.webkit.org/show_bug.cgi?id=174371
1220
1221         Reviewed by Timothy Hatcher.
1222
1223         * platform/graphics/opengl/GLPlatformContext.cpp: Removed.
1224         * platform/graphics/opengl/GLPlatformContext.h: Removed.
1225         * platform/graphics/opengl/GLPlatformSurface.h: Removed.
1226
1227 2017-07-11  Chris Dumez  <cdumez@apple.com>
1228
1229         Window's [[OwnPropertyKeys]] is wrong for cross origin windows
1230         https://bugs.webkit.org/show_bug.cgi?id=174364
1231         <rdar://problem/33238056>
1232
1233         Reviewed by Brent Fulgham.
1234
1235         Window's [[OwnPropertyKeys]] should not list descendant frame names
1236         when the window is cross-origin:
1237         - https://github.com/whatwg/html/pull/2777
1238
1239         This aligns our behavior with Firefox and Chrome.
1240
1241         No new tests, updated existing test.
1242
1243         * bindings/js/JSDOMWindowCustom.cpp:
1244         (WebCore::addCrossOriginPropertyNames):
1245         (WebCore::addCrossOriginOwnPropertyNames):
1246         (WebCore::JSDOMWindow::getOwnPropertyNames):
1247
1248 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
1249
1250         Fix broken build when ENABLE_VIDEO is disabled.
1251         https://bugs.webkit.org/show_bug.cgi?id=174368
1252
1253         Reviewed by Alex Christensen.
1254
1255         * dom/Document.cpp:
1256         * html/canvas/WebGLRenderingContextBase.cpp:
1257         (WebCore::WebGLRenderingContextBase::texSubImage2D):
1258         (WebCore::WebGLRenderingContextBase::texImage2D):
1259         * html/canvas/WebGLRenderingContextBase.h:
1260         * html/canvas/WebGLRenderingContextBase.idl:
1261         * testing/Internals.cpp:
1262         (WebCore::Internals::mediaResponseSources):
1263         (WebCore::Internals::mediaResponseContentRanges):
1264         * testing/Internals.h:
1265         * testing/Internals.idl:
1266
1267 2017-07-11  Ali Juma  <ajuma@chromium.org>
1268
1269         elementFromPoint() should consider x and y to be in client (layout viewport) coordinates
1270         https://bugs.webkit.org/show_bug.cgi?id=172019
1271
1272         Reviewed by Simon Fraser.
1273
1274         When visual viewports are enabled, this makes TreeScope::nodeFromPoint consider its
1275         input to be in client coordinates, and clips this input to the layout viewport. This change
1276         affects the behavior of document.elementFromPoint() and document.caretRangeFromPoint.
1277
1278         No new tests. Modified an existing test, and made a previously-failing test pass on ios.
1279
1280         * dom/TreeScope.cpp:
1281         (WebCore::TreeScope::nodeFromPoint):
1282         * page/FrameView.cpp:
1283         (WebCore::FrameView::layoutViewportToAbsoluteRect):
1284         (WebCore::FrameView::layoutViewportToAbsolutePoint):
1285         (WebCore::FrameView::clientToLayoutViewportPoint):
1286         * page/FrameView.h:
1287         * rendering/RenderLayer.cpp:
1288         (WebCore::RenderLayer::hitTest):
1289
1290 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
1291
1292         Broken build when !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
1293         https://bugs.webkit.org/show_bug.cgi?id=174369
1294
1295         Reviewed by Alex Christensen.
1296
1297         * dom/ScriptedAnimationController.h: Include PlatformScreen.h.
1298
1299 2017-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1300
1301         Address post-review feedback after http://trac.webkit.org/r219310
1302         https://bugs.webkit.org/show_bug.cgi?id=174300
1303         <rdar://problem/33030639>
1304
1305         Reviewed by Simon Fraser.
1306
1307         Removes pan-gesture-related plumbing introduced in r219310 that is no longer necessary.
1308
1309         * page/scrolling/ScrollingTree.h:
1310         (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
1311         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
1312
1313 2017-07-11  Alex Christensen  <achristensen@webkit.org>
1314
1315         Reduce URL size
1316         https://bugs.webkit.org/show_bug.cgi?id=174319
1317
1318         Reviewed by Andreas Kling.
1319
1320         m_fragmentEnd is redundant information. If a URL is valid, then it is always m_string.length().
1321         If a URL is not valid, then it is always 0. Rather than storing additional information,
1322         deduce the fragment end from the validity of the URL and the String's length.
1323
1324         No change in behavior.  This reduces sizeof(URL) from 56 to 48 and reduces operations when parsing.
1325
1326         * platform/URL.cpp:
1327         (WebCore::URL::invalidate):
1328         (WebCore::URL::fragmentIdentifier):
1329         (WebCore::URL::hasFragmentIdentifier):
1330         (WebCore::URL::removeFragmentIdentifier):
1331         * platform/URL.h:
1332         (WebCore::URL::encode):
1333         (WebCore::URL::decode):
1334         (WebCore::URL::hasFragment):
1335         * platform/URLParser.cpp:
1336         (WebCore::URLParser::urlLengthUntilPart):
1337         (WebCore::URLParser::copyURLPartsUntil):
1338         (WebCore::URLParser::parse):
1339         (WebCore::URLParser::allValuesEqual):
1340         (WebCore::URLParser::internalValuesConsistent):
1341
1342 2017-07-11  Alex Christensen  <achristensen@webkit.org>
1343
1344         SharedBuffer::size should return a size_t
1345         https://bugs.webkit.org/show_bug.cgi?id=174328
1346
1347         Reviewed by Andreas Kling.
1348
1349         No change in behaviour.
1350
1351         * html/FTPDirectoryDocument.cpp:
1352         (WebCore::createTemplateDocumentData):
1353         * loader/ContentFilter.cpp:
1354         (WebCore::ContentFilter::handleProvisionalLoadFailure):
1355         * loader/ResourceLoader.cpp:
1356         (WebCore::ResourceLoader::loadDataURL):
1357         * loader/ResourceLoader.h:
1358         * loader/appcache/ApplicationCacheStorage.cpp:
1359         (WebCore::ApplicationCacheStorage::store):
1360         * loader/cache/CachedScript.cpp:
1361         (WebCore::CachedScript::script):
1362         * platform/SharedBuffer.cpp:
1363         (WebCore::SharedBuffer::tryCreateArrayBuffer):
1364         * platform/SharedBuffer.h:
1365
1366 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
1367
1368         [Win] Build error when building WebCore from WebCore.proj project file.
1369         https://bugs.webkit.org/show_bug.cgi?id=174330
1370
1371         Reviewed by Brent Fulgham.
1372
1373         The CMake variable PAL_DIR should be set in the project file.
1374
1375         * WebCore.vcxproj/WebCore.proj:
1376
1377 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
1378
1379         [SVG] Leak in SVGAnimatedListPropertyTearOff
1380         https://bugs.webkit.org/show_bug.cgi?id=172545
1381
1382         Reviewed by Said Abou-Hallawa.
1383
1384         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
1385         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
1386         reference to SVGAnimatedProperty.
1387
1388         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
1389         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
1390         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
1391         is going to be added to. This effectively creates a reference cycle between the
1392         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
1393
1394         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
1395
1396         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1397
1398 2017-07-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1399
1400         [GTK] Spin buttons on input type number appear over the value itself for small widths
1401         https://bugs.webkit.org/show_bug.cgi?id=173572
1402
1403         Reviewed by Carlos Garcia Campos.
1404
1405         When drawing the spin buttons, override the width of the input
1406         element to increment it with the width of the spin button.
1407         This ensures that we don't end up covering the input values with
1408         the spin buttons.
1409
1410         Do this also for user controlled styles, because most web authors
1411         won't test how their site renders on WebKitGTK+, and they will
1412         assume spin buttons in the order of 13 pixels wide (that is what
1413         most browsers use), but the GTK+ spin button is much wider (66 pixels).
1414
1415         Test: platform/gtk/fast/forms/number/number-size-spinbutton-nocover.html
1416
1417         * rendering/RenderTheme.cpp:
1418         (WebCore::RenderTheme::adjustStyle):
1419         * rendering/RenderThemeGtk.cpp:
1420         (WebCore::RenderThemeGtk::adjustTextFieldStyle): Call the theme's adjustTextFieldStyle() also for user controlled styles.
1421         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
1422
1423 2017-07-11  Youenn Fablet  <youenn@apple.com>
1424
1425         We should do ICE candidate filtering at the Document level
1426         https://bugs.webkit.org/show_bug.cgi?id=173861
1427         <rdar://problem/33122058>
1428
1429         Reviewed by Eric Carlson.
1430
1431         Tests: http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html
1432                http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html
1433                http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html
1434                webrtc/filtering-ice-candidate-after-reload.html
1435
1436         Making UserMediaRequest disable the ICE candidate filtering for the page RTCController.
1437         All RTCPeerConnection of the page that are created on a document that are same-origin as the top document
1438         are now registered to the RTCController.
1439         This allows disabling filtering to only these RTCPeerConnection.
1440
1441         The page keeps the default ICE candidate filtering policy.
1442         This policy allows disabling ICE candidate filtering for all RTCPeerConnection.
1443
1444         When the top document is changing, the RTCController filtering policy is reset
1445         and its list of RTCPeerConnection is emptied.
1446
1447         Internals no longer disables ICE candidate filtering by default.
1448         This allows finer grained testing.
1449         ICE candidate filtering is disabled for tests including testharnessreport.js
1450         to enable web-platform-tests to run without modifications.
1451
1452         * Modules/mediastream/RTCController.cpp:
1453         (WebCore::RTCController::reset):
1454         * Modules/mediastream/RTCController.h:
1455         * Modules/mediastream/UserMediaRequest.cpp:
1456         (WebCore::UserMediaRequest::allow):
1457         * page/Frame.cpp:
1458         (WebCore::Frame::setDocument):
1459         * page/Page.cpp:
1460         (WebCore::Page::disableICECandidateFiltering):
1461         * page/Page.h:
1462         (WebCore::Page::shouldEnableICECandidateFilteringByDefault):
1463         (WebCore::Page::disableICECandidateFiltering): Deleted.
1464         (WebCore::Page::enableICECandidateFiltering): Deleted.
1465         (WebCore::Page::isICECandidateFilteringEnabled): Deleted.
1466         * testing/Internals.cpp:
1467         (WebCore::Internals::Internals):
1468         (WebCore::Internals::setICECandidateFiltering):
1469         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
1470         (WebCore::Internals::isICECandidateFilteringEnabled): Deleted.
1471         * testing/Internals.h:
1472         * testing/Internals.idl:
1473
1474 2017-07-11  Sergio Villar Senin  <svillar@igalia.com>
1475
1476         Unreviewed, rolling out r219325.
1477
1478         The test is still flaky
1479
1480         Reverted changeset:
1481
1482         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1483         https://bugs.webkit.org/show_bug.cgi?id=172545
1484         http://trac.webkit.org/changeset/219325
1485
1486 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
1487
1488         [SVG] Leak in SVGAnimatedListPropertyTearOff
1489         https://bugs.webkit.org/show_bug.cgi?id=172545
1490
1491         Reviewed by Said Abou-Hallawa.
1492
1493         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
1494         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
1495         reference to SVGAnimatedProperty.
1496
1497         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
1498         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
1499         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
1500         is going to be added to. This effectively creates a reference cycle between the
1501         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
1502
1503         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
1504
1505         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1506
1507 2017-07-10  Simon Fraser  <simon.fraser@apple.com>
1508
1509         [WK2 iOS] REGRESSION (r216803) During momentum scroll, getBoundingClientRect returns wrong coordinates (missing images on pinterest, elle.com and many other sites)
1510         https://bugs.webkit.org/show_bug.cgi?id=174286
1511         rdar://problem/32864180
1512
1513         Reviewed by Dean Jackson.
1514
1515         r216803 made getBoundingClientRects relative to the layout viewport, but when scrolling we
1516         only update that on stable viewport updates (at the end of the scroll). This meant that during
1517         unstable updates, getBoundingClientRects() used a "frozen" viewport origin so things on-screen
1518         would appear to be off-screen, causing sites to fail to dynamically load images etc. when
1519         scrolling.
1520
1521         Fix by pushing an optional "unstable" layout viewport rect onto FrameView, which gets used by
1522         FrameView::documentToClientOffset(). This is cleared when we do a stable update.
1523
1524         This is a short-term solution. Longer term, I would prefer to always call setLayoutViewportOverrideRect(),
1525         but fix the scrolling tree logic to work correctly in this case.
1526
1527         Add a bit more scrolling logging.
1528
1529         Test: fast/visual-viewport/ios/get-bounding-client-rect-unstable.html
1530
1531         * page/FrameView.cpp:
1532         (WebCore::FrameView::setUnstableLayoutViewportRect):
1533         (WebCore::FrameView::documentToClientOffset):
1534         * page/FrameView.h:
1535         * page/scrolling/AsyncScrollingCoordinator.cpp:
1536         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1537         * page/scrolling/ScrollingStateFixedNode.cpp:
1538         (WebCore::ScrollingStateFixedNode::updateConstraints):
1539         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
1540
1541 2017-07-10  John Wilander  <wilander@apple.com>
1542
1543         Resource Load Statistics: Prune statistics in orders of importance
1544         https://bugs.webkit.org/show_bug.cgi?id=174215
1545         <rdar://problem/33164403>
1546
1547         Reviewed by Chris Dumez.
1548
1549         Test: http/tests/loading/resourceLoadStatistics/prune-statistics.html
1550
1551         * loader/ResourceLoadObserver.cpp:
1552         (WebCore::reduceTimeResolution):
1553         (WebCore::ResourceLoadObserver::logFrameNavigation):
1554         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1555         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1556         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1557             Now all set the new statistics field lastSeen.
1558         * loader/ResourceLoadStatistics.cpp:
1559         (WebCore::ResourceLoadStatistics::encode):
1560         (WebCore::ResourceLoadStatistics::decode):
1561         (WebCore::ResourceLoadStatistics::toString):
1562         (WebCore::ResourceLoadStatistics::merge):
1563             Handling of the new statistics field lastSeen.
1564         * loader/ResourceLoadStatistics.h:
1565
1566 2017-07-10  Devin Rousso  <drousso@apple.com>
1567
1568         Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab
1569         https://bugs.webkit.org/show_bug.cgi?id=174279
1570
1571         Reviewed by Matt Baker.
1572
1573         Test: inspector/dom/highlightNodeList.html
1574
1575         * inspector/InspectorDOMAgent.h:
1576         * inspector/InspectorDOMAgent.cpp:
1577         (WebCore::InspectorDOMAgent::highlightNodeList):
1578
1579 2017-07-10  Javier Fernandez  <jfernandez@igalia.com>
1580
1581         [css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved
1582         https://bugs.webkit.org/show_bug.cgi?id=172707
1583
1584         Reviewed by Antti Koivisto.
1585
1586         The CSS Box Alignment specification has been changed recently so that
1587         now all the propeties have the specificed value as computed value. The
1588         rationale of this change are at the associated W3C github issue [1].
1589
1590         This change implies that we don't need to execute the StyleAdjuter
1591         logic we implemented specifically for supporting 'auto' values
1592         resolution for computed style. We can live now with resolution at
1593         layout time only.
1594
1595         [1] https://github.com/w3c/csswg-drafts/issues/440
1596
1597         No new tests, just updating the already defined tests.
1598
1599         * css/CSSComputedStyleDeclaration.cpp:
1600         (WebCore::ComputedStyleExtractor::propertyValue):
1601         * css/StyleResolver.cpp:
1602         (WebCore::StyleResolver::adjustRenderStyle): Removed
1603         * css/StyleResolver.h:
1604         * html/shadow/TextControlInnerElements.cpp:
1605         (WebCore::TextControlInnerElement::resolveCustomStyle):
1606         * rendering/RenderBox.cpp:
1607         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
1608         (WebCore::RenderBox::hasStretchedLogicalWidth):
1609         * rendering/RenderFlexibleBox.cpp:
1610         (WebCore::RenderFlexibleBox::styleDidChange): Added
1611         (WebCore::RenderFlexibleBox::alignmentForChild):
1612         * rendering/RenderFlexibleBox.h:
1613
1614 2017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1615
1616         [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
1617         https://bugs.webkit.org/show_bug.cgi?id=174300
1618         <rdar://problem/33030639>
1619
1620         Reviewed by Simon Fraser.
1621
1622         See Source/WebKit2/ChangeLog for more detail.
1623
1624         Tests: fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html
1625                fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-overflow.html
1626                fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html
1627
1628         * page/scrolling/ScrollingTree.h:
1629         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture):
1630
1631 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
1632
1633         Captions and subtitles not showing up in picture-in-picture for MSE content
1634         https://bugs.webkit.org/show_bug.cgi?id=174317
1635         rdar://problem/33188591
1636
1637         Reviewed by Eric Carlson.
1638
1639         Reverts a regression created by r218403.
1640
1641         * html/shadow/MediaControlElements.cpp:
1642         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
1643
1644 2017-07-10  Per Arne Vollan  <pvollan@apple.com>
1645
1646         [Win] Link error when building WTF from WTF.proj project file.
1647         https://bugs.webkit.org/show_bug.cgi?id=174316
1648         <rdar://problem/33178200>
1649
1650         Reviewed by Brent Fulgham.
1651
1652         WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.
1653
1654         * WebCore.vcxproj/WebCore.proj:
1655
1656 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
1657
1658         media element handle adding source immediately before src.
1659         https://bugs.webkit.org/show_bug.cgi?id=174284
1660         rdar://problem/33115439
1661
1662         Reviewed by David Kilzer.
1663
1664         Test: media/video-source-before-src.html
1665
1666         Adding a source causes a selectMediaResource block to be enqueued.
1667         If dataLoadingPermitted prevents creating the m_player but sets the srcAttr, then
1668         the enqueued selectMediaResource will be in a bad state, with a srcAttr but no m_player.
1669
1670         This fix prevents selectMediaResource from being called, if data loading is not permitted
1671         when adding a source element, to match how it prevents player creation when setting srcAttr.
1672
1673         This fix also adds a debug assert to catch the problem earlier and adds an early return to
1674         prevent the crash in release builds.
1675
1676         * html/HTMLMediaElement.cpp:
1677         (WebCore::HTMLMediaElement::selectMediaResource):
1678         (WebCore::HTMLMediaElement::sourceWasAdded):
1679
1680 2017-07-10  Megan Gardner  <megan_gardner@apple.com>
1681
1682         Add location to NavigationActionData
1683         https://bugs.webkit.org/show_bug.cgi?id=174233
1684         <rdar://problem/29165518>
1685
1686         Reviewed by Simon Fraser.
1687         
1688         Add the root view location of a tap to a NavigationAction to vend to Safari.
1689
1690         Test: small enough change to not be tested alone.
1691
1692         * dom/MouseRelatedEvent.cpp:
1693         (WebCore::MouseRelatedEvent::absoluteLocationConvertedToRootView):
1694         * dom/MouseRelatedEvent.h:
1695
1696 2017-07-10  Sam Weinig  <sam@webkit.org>
1697
1698         [WebIDL] Move plugin object customization into the generator
1699         https://bugs.webkit.org/show_bug.cgi?id=174238
1700
1701         Reviewed by Chris Dumez.
1702
1703         - Added [Plugin] extended attribute to forward the necessary hooks
1704           for get/set/delete to the plugin code.
1705         - Removed [CustomNamedSetter] and replaced it's remaining uses
1706           [CustomPut] (formally called [CustomPutFunction]).
1707         - Renamed [CustomNamedGetterOnPrototype] to [CustomPutOnPrototype]
1708           because that is actually what it does.
1709         - Removed [CustomGetOwnPropertySlotByIndex] and made 
1710           [CustomGetOwnPropertySlot] imply it, as the other custom hooks
1711           do.
1712         - Renamed [CustomEnumerateProperty] to [CustomGetOwnPropertyNames]
1713           to conform with other attribute names.
1714         - Renamed [CustomCall] to [CustomGetCallData] to conform with other 
1715           attribute names.
1716
1717         * CMakeLists.txt:
1718         * WebCore.xcodeproj/project.pbxproj:
1719         * bindings/js/JSBindingsAllInOne.cpp:
1720         * bindings/js/JSHTMLAppletElementCustom.cpp: Removed.
1721         * bindings/js/JSHTMLEmbedElementCustom.cpp: Removed.
1722         * bindings/js/JSHTMLObjectElementCustom.cpp: Removed.
1723         Remove custom bindings.
1724
1725         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1726         (WebCore::putCommon):
1727         (WebCore::JSCSSStyleDeclaration::put):
1728         (WebCore::JSCSSStyleDeclaration::putByIndex):
1729         (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
1730         Use [CustomPut] rather than [CustomNamedSetter] to allow us
1731         to get rid of [CustomNamedSetter]. Reuse put delegate as
1732         common code to share between put and putByIndex.
1733
1734         * bindings/js/JSLocationCustom.cpp:
1735         (WebCore::getOwnPropertySlotCommon):
1736         (WebCore::JSLocation::getOwnPropertySlot):
1737         (WebCore::JSLocation::getOwnPropertySlotByIndex):
1738         Replace [CustomGetOwnPropertySlotAndDescriptor] with [CustomGetOwnPropertySlot]
1739         which is more clear and reduces the number of variants of this hook override
1740         we need.
1741
1742         (WebCore::putCommon):
1743         (WebCore::JSLocation::put):
1744         (WebCore::JSLocation::putByIndex):
1745         Use [CustomPut] rather than [CustomNamedSetter] to allow us
1746         to get rid of [CustomNamedSetter]. Reuse put delegate as
1747         common code to share between put and putByIndex.
1748
1749         (WebCore::JSLocationPrototype::put):
1750         [CustomPutOnPrototype] (which weirdly used incorrectly be called 
1751         [CustomNamedGetterOnPrototype]) now works like [CustomPut] meaning
1752         you need to call Base.
1753
1754         * bindings/js/JSPluginElementFunctions.cpp:
1755         (WebCore::pluginElementPropertyGetter):
1756         (WebCore::pluginElementCustomGetOwnPropertySlot):
1757         (WebCore::pluginElementCustomPut):
1758         * bindings/js/JSPluginElementFunctions.h:
1759         (WebCore::pluginElementCustomGetOwnPropertySlot): Deleted.
1760         Remove templatized pluginElementCustomGetOwnPropertySlot, which was 
1761         completely unnecessary and merge its functionality into the out of
1762         line overload. Remove pluginElementPropertyGetter from the header,
1763         since it is only used in implementation, and unify the naming and
1764         argument position (JSHTMLElement* comes first) of the hooks.
1765
1766         * bindings/scripts/CodeGeneratorJS.pm:
1767         (GenerateIndexedGetter):
1768         (GenerateNamedGetter):
1769         (GenerateGetOwnPropertySlot):
1770         (GenerateGetOwnPropertySlotByIndex):
1771         (GenerateGetOwnPropertyNames):
1772         (GeneratePut):
1773         (GeneratePutByIndex):
1774         (GenerateDeleteProperty):
1775         (GenerateDeletePropertyByIndex):
1776         (GenerateNamedDeleterDefinition):
1777         (InstanceOverridesGetOwnPropertySlot):
1778         (InstanceOverridesGetOwnPropertyNames):
1779         (InstanceOverridesPut):
1780         (InstanceOverridesDeleteProperty):
1781         (GenerateHeader):
1782         (GenerateImplementation):
1783         (GenerateGetCallData):
1784         (GeneratePluginCall):
1785         (GenerateLegacyCallerDefinitions):
1786         (GenerateLegacyCallerDefinition):
1787         (GeneratePrototypeDeclaration):
1788         (InstanceOverridesGetCallData):
1789         (HeaderNeedsPrototypeDeclaration):
1790         - Add support for [Plugin]
1791         - Remove support for [CustomNamedSetter]
1792         - Replace [CustomGetOwnPropertySlotByIndex] with [CustomGetOwnPropertySlot]
1793         - Replace [CustomEnumerateProperty] with [CustomGetOwnPropertyNames]
1794         - Replace [CustomPutFunction] with [CustomPut].
1795         - Make subroutine names more consistent (remove a few Definition suffixes)
1796
1797         * bindings/scripts/IDLAttributes.json:
1798         Update for new / removed attributes.
1799
1800         * bindings/scripts/test/JS/JSTestInterface.cpp:
1801         * bindings/scripts/test/JS/JSTestInterface.h:
1802         * bindings/scripts/test/JS/JSTestPluginInterface.cpp: Added.
1803         * bindings/scripts/test/JS/JSTestPluginInterface.h: Added.
1804         * bindings/scripts/test/TestInterface.idl:
1805         * bindings/scripts/test/TestPluginInterface.idl: Added.
1806         Update / add tests.
1807
1808         * css/CSSStyleDeclaration.idl:
1809         * html/HTMLAppletElement.idl:
1810         * html/HTMLEmbedElement.idl:
1811         * html/HTMLObjectElement.idl:
1812         * page/DOMWindow.idl:
1813         * page/Location.idl:
1814         * storage/Storage.idl:
1815         Update for new / renamed attributes.
1816
1817 2017-07-03  Brian Burg  <bburg@apple.com>
1818
1819         Web Replay: remove some unused code
1820         https://bugs.webkit.org/show_bug.cgi?id=173903
1821
1822         Rubber-stamped by Joseph Pecoraro.
1823
1824         * CMakeLists.txt:
1825         * Configurations/FeatureDefines.xcconfig:
1826         * DerivedSources.make:
1827         * PlatformMac.cmake:
1828         * WebCore.xcodeproj/project.pbxproj:
1829         * dom/Document.cpp:
1830         (WebCore::Document::Document):
1831         (WebCore::Document::lastModified):
1832         (WebCore::Document::inputCursor): Deleted.
1833         (WebCore::Document::setInputCursor): Deleted.
1834         * dom/Document.h:
1835         * inspector/InspectorController.cpp:
1836         (WebCore::InspectorController::InspectorController):
1837         * inspector/InspectorInstrumentation.cpp:
1838         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
1839         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
1840         (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
1841         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1842         (WebCore::InspectorInstrumentation::sessionCreatedImpl): Deleted.
1843         (WebCore::InspectorInstrumentation::sessionLoadedImpl): Deleted.
1844         (WebCore::InspectorInstrumentation::sessionModifiedImpl): Deleted.
1845         (WebCore::InspectorInstrumentation::segmentCreatedImpl): Deleted.
1846         (WebCore::InspectorInstrumentation::segmentCompletedImpl): Deleted.
1847         (WebCore::InspectorInstrumentation::segmentLoadedImpl): Deleted.
1848         (WebCore::InspectorInstrumentation::segmentUnloadedImpl): Deleted.
1849         (WebCore::InspectorInstrumentation::captureStartedImpl): Deleted.
1850         (WebCore::InspectorInstrumentation::captureStoppedImpl): Deleted.
1851         (WebCore::InspectorInstrumentation::playbackStartedImpl): Deleted.
1852         (WebCore::InspectorInstrumentation::playbackPausedImpl): Deleted.
1853         (WebCore::InspectorInstrumentation::playbackHitPositionImpl): Deleted.
1854         (WebCore::InspectorInstrumentation::playbackFinishedImpl): Deleted.
1855         (WebCore::InspectorInstrumentation::replayAgentEnabled): Deleted.
1856         * inspector/InspectorInstrumentation.h:
1857         (WebCore::InspectorInstrumentation::sessionCreated): Deleted.
1858         (WebCore::InspectorInstrumentation::sessionLoaded): Deleted.
1859         (WebCore::InspectorInstrumentation::sessionModified): Deleted.
1860         (WebCore::InspectorInstrumentation::segmentCreated): Deleted.
1861         (WebCore::InspectorInstrumentation::segmentCompleted): Deleted.
1862         (WebCore::InspectorInstrumentation::segmentLoaded): Deleted.
1863         (WebCore::InspectorInstrumentation::segmentUnloaded): Deleted.
1864         (WebCore::InspectorInstrumentation::captureStarted): Deleted.
1865         (WebCore::InspectorInstrumentation::captureStopped): Deleted.
1866         (WebCore::InspectorInstrumentation::playbackStarted): Deleted.
1867         (WebCore::InspectorInstrumentation::playbackPaused): Deleted.
1868         (WebCore::InspectorInstrumentation::playbackFinished): Deleted.
1869         (WebCore::InspectorInstrumentation::playbackHitPosition): Deleted.
1870         * inspector/InspectorReplayAgent.cpp: Removed.
1871         * inspector/InspectorReplayAgent.h: Removed.
1872         * inspector/InstrumentingAgents.cpp:
1873         (WebCore::InstrumentingAgents::reset):
1874         * inspector/InstrumentingAgents.h:
1875         (WebCore::InstrumentingAgents::inspectorReplayAgent): Deleted.
1876         (WebCore::InstrumentingAgents::setInspectorReplayAgent): Deleted.
1877         * page/EventHandler.h:
1878         * page/Page.cpp:
1879         (WebCore::Page::Page):
1880         * page/Page.h:
1881         (WebCore::Page::replayController): Deleted.
1882         * page/scrolling/ScrollingCoordinator.cpp:
1883         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
1884         (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Deleted.
1885         * page/scrolling/ScrollingCoordinator.h:
1886         * platform/Logging.h:
1887         * plugins/DOMMimeTypeArray.cpp:
1888         (WebCore::DOMMimeTypeArray::getPluginData):
1889         * plugins/DOMPluginArray.cpp:
1890         (WebCore::DOMPluginArray::pluginData):
1891         * replay/AllReplayInputs.h: Removed.
1892         * replay/CapturingInputCursor.cpp: Removed.
1893         * replay/CapturingInputCursor.h: Removed.
1894         * replay/EventLoopInput.cpp: Removed.
1895         * replay/EventLoopInput.h: Removed.
1896         * replay/EventLoopInputDispatcher.cpp: Removed.
1897         * replay/EventLoopInputDispatcher.h: Removed.
1898         * replay/FunctorInputCursor.h: Removed.
1899         * replay/MemoizedDOMResult.cpp: Removed.
1900         * replay/MemoizedDOMResult.h: Removed.
1901         * replay/ReplayController.cpp: Removed.
1902         * replay/ReplayController.h: Removed.
1903         * replay/ReplayInputCreationMethods.cpp: Removed.
1904         * replay/ReplayInputDispatchMethods.cpp: Removed.
1905         * replay/ReplaySession.cpp: Removed.
1906         * replay/ReplaySession.h: Removed.
1907         * replay/ReplaySessionSegment.cpp: Removed.
1908         * replay/ReplaySessionSegment.h: Removed.
1909         * replay/ReplayingInputCursor.cpp: Removed.
1910         * replay/ReplayingInputCursor.h: Removed.
1911         * replay/SegmentedInputStorage.cpp: Removed.
1912         * replay/SegmentedInputStorage.h: Removed.
1913         * replay/SerializationMethods.cpp: Removed.
1914         * replay/SerializationMethods.h: Removed.
1915         * replay/WebInputs.json: Removed.
1916
1917 2017-07-10  Brady Eidson  <beidson@apple.com>
1918
1919         Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
1920         <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244
1921
1922         Reviewed by David Kilzer and Alex Christensen. 
1923
1924         No targeted test possible, implicitly covered by all IDB tests.
1925
1926         The original idea behind UniqueIDBDatabase lifetime was that they are ThreadSafeRefCounted and
1927         we take protector Refs when any operation that needs it alive is in flight.
1928         
1929         This added variability to their lifetime which made it difficult to enforce a few different 
1930         design invariants, namely:
1931             - UniqueIBDDatabase objects are always created and destroyed only on the main thread.
1932             - IDBBackingStore objects are always created and destroyed only on the database thread.
1933         
1934         This patch removes the ref counting and instead ties UniqueIDBDatabase lifetime to a
1935         std::unique_ptr that is owned by the IDBServer.
1936         
1937         Whenever any operations on the UniqueIDBDatabase are in flight it is kept alive by virtue
1938         of that unique_ptr in the IDBServer. Once a UniqueIDBDatabase is completely done with all of
1939         its work, the following happens:
1940             - On the main thread the IDBServer removes the unique_ptr owning the UniqueIDBDatabase
1941               from its map.
1942             - It hands the unique_ptr to the UniqueIDBDatabase itself, which schedules one final 
1943               database thread task.
1944             - That database thread task is to destroy the IDBBackingStore, kill its message queues,
1945               and then message back to the main thread for one final task.
1946             - That main thread task is to release the unique_ptr, resulting in destruction of the
1947               UniqueIDBDatabase object.
1948         
1949         This is safe, predictable, solves the lifetime issues that r218516 originally tried to solve,
1950         and solves the lifetime issues that r218516 introduced.
1951
1952         (This patch also adds many more assertions to cover various design invariants throughout the
1953         lifecycle of a particular UniqueIDBDatabase)
1954
1955         ASSERT that IDBBackingStores are only ever created and destroyed on the background thread:
1956         * Modules/indexeddb/server/IDBBackingStore.h:
1957         (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
1958         (WebCore::IDBServer::IDBBackingStore::IDBBackingStore):
1959         
1960         Transition UniqueIDBDatabase ownership from a RefPtr to a std::unique_ptr:
1961         * Modules/indexeddb/server/IDBServer.cpp:
1962         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
1963         (WebCore::IDBServer::IDBServer::closeAndTakeUniqueIDBDatabase):
1964         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
1965         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
1966         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase): Deleted.
1967         * Modules/indexeddb/server/IDBServer.h:
1968         
1969         Make all the other changes mentioned above:
1970         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1971         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Bulk up on ASSERTs
1972         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): 
1973         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore):
1974         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1975         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
1976         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
1977         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1978         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
1979         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
1980         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
1981         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
1982         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
1983         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
1984         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
1985         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
1986         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
1987         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
1988         (WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose):
1989         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
1990         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1991         (WebCore::IDBServer::UniqueIDBDatabase::didPerformUnconditionalDeleteBackingStore): Deleted.
1992         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1993         (WebCore::IDBServer::UniqueIDBDatabase::create): Deleted.
1994
1995 2017-07-10  Chris Dumez  <cdumez@apple.com>
1996
1997         Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
1998         https://bugs.webkit.org/show_bug.cgi?id=174301
1999
2000         Reviewed by Brent Fulgham.
2001
2002         Moved some generic file system utility functions down to platform's FileSystem.h.
2003
2004         * platform/FileSystem.cpp:
2005         (WebCore::openAndLockFile):
2006         (WebCore::unlockAndCloseFile):
2007         * platform/FileSystem.h:
2008
2009 2017-07-10  Andreas Kling  <akling@apple.com>
2010
2011         REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
2012         https://bugs.webkit.org/show_bug.cgi?id=174302
2013         <rdar://problem/33204273>
2014
2015         Reviewed by Antti Koivisto.
2016
2017         Don't clear the active/hovered/focused elements when destroying the render tree,
2018         since we might need to reconstruct it later, and would like to remember which
2019         elements those were.
2020
2021         Only the focused state actually stuck when going in and out of the page cache,
2022         but this patch removes all the element pointer clearing for consistency.
2023
2024         Test: fast/history/page-cache-element-state-focused.html
2025
2026         * dom/Document.cpp:
2027         (WebCore::Document::destroyRenderTree):
2028
2029 2017-07-10  Daniel Bates  <dabates@apple.com>
2030
2031         REGRESSION (r218616): Cannot build WebCore for macOS 10.12 with macOS 10.13 SDK
2032         https://bugs.webkit.org/show_bug.cgi?id=173939
2033
2034         Reviewed by Dan Bernstein.
2035
2036         (The code in this change was either suggested or written by Dan Bernstein with a very
2037         minor adjustment to get it to build).
2038
2039         Allow WebCore to link even though CTFontCreatePhysicalFontForCharactersWithLanguage() is
2040         undefined when building against the macOS 10.13 SDK targeting macOS 10.12. Let the dynamic
2041         linker resolve the undefined symbol.
2042
2043         For completeness the SPI CTFontCreatePhysicalFontForCharactersWithLanguage() was removed
2044         from the macOS 10.13 SDK.
2045
2046         * Configurations/WebCore.xcconfig: Tell the linker that CTFontCreatePhysicalFontForCharactersWithLanguage()
2047         can be undefined when building against macOS 10.13 or later SDK.
2048         * platform/spi/cocoa/CoreTextSPI.h: Annotate CTFontCreatePhysicalFontForCharactersWithLanguage()
2049         with its availability information.
2050
2051 2017-07-10  Zalan Bujtas  <zalan@apple.com>
2052
2053         Block of text is missing in iBooks sample books.
2054         https://bugs.webkit.org/show_bug.cgi?id=174295
2055         <rdar://problem/32955620>
2056
2057         Reviewed by Antti Koivisto.
2058
2059         In the simple line layout context, translating y coordinate to a line index is
2060         normally just a (y / line height) operation. However in case of strut offsets (pagination)
2061         we need to take these extra paddings into account while resolving the line index.
2062         This patch fixes the boundary checking for a given line by using the font size only
2063         when the font is taller than the line.
2064
2065         * rendering/SimpleLineLayoutResolver.cpp:
2066         (WebCore::SimpleLineLayout::RunResolver::adjustLineIndexForStruts):
2067
2068 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2069
2070         [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
2071         https://bugs.webkit.org/show_bug.cgi?id=166029
2072
2073         Reviewed by Michael Catanzaro.
2074
2075         Add clearSoupNetworkSessionAndCookieStorage() to clear the SoupNetworkSession and cookie storage of the main
2076         network session, ensuring the cookies database is properly closed.
2077
2078         * platform/network/NetworkStorageSession.h:
2079         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2080         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
2081
2082 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2083
2084         Move make-js-file-arrays.py from WebCore to JavaScriptCore
2085         https://bugs.webkit.org/show_bug.cgi?id=174024
2086
2087         Reviewed by Michael Catanzaro.
2088
2089         * CMakeLists.txt: Explicitly add files generated by MAKE_JS_FILE_ARRAYS to the build, since the macro no longer
2090         does it.
2091         * DerivedSources.make: Updated to use make-js-file-arrays.py from JavaScriptCore. It's no longer needed to set
2092         PYTHON_PATH to find jsmin.py.
2093
2094 2017-07-10  Charlie Turner  <cturner@igalia.com>
2095
2096         [GTK] http/tests/media/video-redirect.html is failing
2097         https://bugs.webkit.org/show_bug.cgi?id=174260
2098
2099         Reviewed by Carlos Garcia Campos.
2100
2101         Make sure we're testing new URLs within the same security origin.
2102
2103         Covered by existing tests.
2104
2105         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2106         (WebCore::convertToInternalProtocol): Factor out setting our
2107         internal URL schema.
2108         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Use the
2109         refactored helper.
2110         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Use
2111         refactored helper to ensure both URLs have the same origin.
2112
2113 2017-07-08  John Wilander  <wilander@apple.com>
2114
2115         Resource Load Statistics: User interaction should always go to top document
2116         https://bugs.webkit.org/show_bug.cgi?id=174120
2117         <rdar://problem/33117899>
2118
2119         Reviewed by Chris Dumez.
2120
2121         Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html
2122
2123         * dom/UserGestureIndicator.cpp:
2124         (WebCore::UserGestureIndicator::UserGestureIndicator):
2125             Now logs user interaction for the top document.
2126         * loader/ResourceLoadObserver.cpp:
2127         (WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
2128             Test infrastructure.
2129         (WebCore::ResourceLoadObserver::setNotificationCallback):
2130             Callback now takes a ResourceLoadObserver::NotificationType.
2131         (WebCore::ResourceLoadObserver::logFrameNavigation):
2132             Submits the configured ResourceLoadObserver::NotificationType.
2133         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2134             Submits the configured ResourceLoadObserver::NotificationType.
2135         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2136             Submits the configured ResourceLoadObserver::NotificationType.
2137         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2138             Submits the configured ResourceLoadObserver::NotificationType.
2139         * loader/ResourceLoadObserver.h:
2140         * testing/Internals.cpp:
2141         (WebCore::Internals::resetToConsistentState):
2142             Resets to throttled notifications.
2143         (WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
2144             Test infrastructure.
2145         * testing/Internals.h:
2146         * testing/Internals.idl:
2147             Added internals.setResourceLoadStatisticsThrottledObserverNotifications().
2148
2149 2017-07-09  Brady Eidson  <beidson@apple.com>
2150
2151         Remove some obsolete WebKitVersionChecks.
2152         https://bugs.webkit.org/show_bug.cgi?id=174294
2153
2154         Reviewed by Dan Bernstein.
2155
2156         No new tests (No change to testable behavior)
2157
2158         * dom/ScriptExecutionContext.cpp:
2159         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
2160         
2161         * page/Settings.in:
2162         
2163         * platform/RuntimeApplicationChecks.h:
2164         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2165         (WebCore::IOSApplication::isOkCupid): Deleted.
2166         (WebCore::IOSApplication::isFacebook): Deleted.
2167         
2168         * rendering/RenderBox.cpp:
2169         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2170
2171 2017-07-08  Brady Eidson  <beidson@apple.com>
2172
2173         Remove some obsolete RuntimeApplicationChecks.
2174         https://bugs.webkit.org/show_bug.cgi?id=174293
2175
2176         Reviewed by Dan Bernstein.
2177
2178         No new tests (No change to testable behavior)
2179
2180         * html/HTMLObjectElement.cpp:
2181         (WebCore::HTMLObjectElement::parametersForPlugin):
2182         (WebCore::shouldNotPerformURLAdjustment): Deleted.
2183
2184         * platform/RuntimeApplicationChecks.h:
2185         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2186         (WebCore::IOSApplication::isDaijisenDictionary): Deleted.
2187         (WebCore::IOSApplication::isNASAHD): Deleted.
2188         (WebCore::IOSApplication::isTheEconomistOnIphone): Deleted.
2189
2190         * platform/ios/wak/WebCoreThread.h:
2191         * platform/ios/wak/WebCoreThread.mm:
2192         (StartWebThread):
2193         (WebThreadSetDelegateSourceRunLoopMode): Deleted.
2194
2195 2017-07-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2196
2197         [Curl] Safe access and life cycle management of bare Curl handle
2198         by wrapping with C++ class
2199         https://bugs.webkit.org/show_bug.cgi?id=174002
2200
2201         Reviewed by Alex Christensen.
2202
2203         * platform/network/ResourceHandle.h:
2204         * platform/network/ResourceHandleInternal.h:
2205         * platform/network/curl/CookieJarCurl.cpp:
2206         (WebCore::setCookiesFromDOM):
2207         (WebCore::cookiesForSession):
2208         * platform/network/curl/CurlContext.cpp:
2209         (WebCore::CurlContext::CurlContext):
2210         (WebCore::CurlContext::~CurlContext):
2211         (WebCore::CurlContext::initCookieSession):
2212         (WebCore::CurlShareHandle::CurlShareHandle):
2213         (WebCore::CurlShareHandle::~CurlShareHandle):
2214         (WebCore::CurlShareHandle::lockCallback):
2215         (WebCore::CurlShareHandle::unlockCallback):
2216         (WebCore::CurlShareHandle::mutexFor):
2217         (WebCore::CurlMultiHandle::CurlMultiHandle):
2218         (WebCore::CurlMultiHandle::~CurlMultiHandle):
2219         (WebCore::CurlMultiHandle::addHandle):
2220         (WebCore::CurlMultiHandle::removeHandle):
2221         (WebCore::CurlMultiHandle::getFdSet):
2222         (WebCore::CurlMultiHandle::perform):
2223         (WebCore::CurlMultiHandle::readInfo):
2224         (WebCore::CurlHandle::CurlHandle):
2225         (WebCore::CurlHandle::~CurlHandle):
2226         (WebCore::CurlHandle::perform):
2227         (WebCore::CurlHandle::pause):
2228         (WebCore::CurlHandle::enableShareHandle):
2229         (WebCore::CurlHandle::setPrivateData):
2230         (WebCore::CurlHandle::setUrl):
2231         (WebCore::CurlHandle::clearUrl):
2232         (WebCore::CurlHandle::clearRequestHeaders):
2233         (WebCore::CurlHandle::appendRequestHeader):
2234         (WebCore::CurlHandle::enableRequestHeaders):
2235         (WebCore::CurlHandle::enableHttpGetRequest):
2236         (WebCore::CurlHandle::enableHttpHeadRequest):
2237         (WebCore::CurlHandle::enableHttpPostRequest):
2238         (WebCore::CurlHandle::setPostFields):
2239         (WebCore::CurlHandle::setPostFieldLarge):
2240         (WebCore::CurlHandle::enableHttpPutRequest):
2241         (WebCore::CurlHandle::setInFileSizeLarge):
2242         (WebCore::CurlHandle::setHttpCustomRequest):
2243         (WebCore::CurlHandle::enableAcceptEncoding):
2244         (WebCore::CurlHandle::enableAllowedProtocols):
2245         (WebCore::CurlHandle::enableFollowLocation):
2246         (WebCore::CurlHandle::enableAutoReferer):
2247         (WebCore::CurlHandle::enableHttpAuthentication):
2248         (WebCore::CurlHandle::setHttpAuthUserPass):
2249         (WebCore::CurlHandle::enableCAInfoIfExists):
2250         (WebCore::CurlHandle::setSslVerifyPeer):
2251         (WebCore::CurlHandle::setSslVerifyHost):
2252         (WebCore::CurlHandle::setSslCert):
2253         (WebCore::CurlHandle::setSslCertType):
2254         (WebCore::CurlHandle::setSslKeyPassword):
2255         (WebCore::CurlHandle::enableCookieJarIfExists):
2256         (WebCore::CurlHandle::setCookieList):
2257         (WebCore::CurlHandle::getCookieList):
2258         (WebCore::CurlHandle::clearCookieList):
2259         (WebCore::CurlHandle::enableProxyIfExists):
2260         (WebCore::CurlHandle::enableTimeout):
2261         (WebCore::CurlHandle::setHeaderCallbackFunction):
2262         (WebCore::CurlHandle::setWriteCallbackFunction):
2263         (WebCore::CurlHandle::setReadCallbackFunction):
2264         (WebCore::CurlHandle::setSslCtxCallbackFunction):
2265         (WebCore::CurlHandle::getEffectiveURL):
2266         (WebCore::CurlHandle::getPrimaryPort):
2267         (WebCore::CurlHandle::getResponseCode):
2268         (WebCore::CurlHandle::getContentLenghtDownload):
2269         (WebCore::CurlHandle::getHttpAuthAvail):
2270         (WebCore::CurlHandle::getTimes):
2271         (WebCore::CurlHandle::maxCurlOffT):
2272         (WebCore::CurlHandle::expectedSizeOfCurlOffT):
2273         (WebCore::CurlHandle::enableVerboseIfUsed):
2274         (WebCore::CurlHandle::enableStdErrIfUsed):
2275         (WebCore::CurlContext::getEffectiveURL): Deleted.
2276         (WebCore::CurlContext::createMultiHandle): Deleted.
2277         (WebCore::CurlContext::mutexFor): Deleted.
2278         (WebCore::CurlContext::lock): Deleted.
2279         (WebCore::CurlContext::unlock): Deleted.
2280         * platform/network/curl/CurlContext.h:
2281         (WebCore::CurlGlobal::CurlGlobal):
2282         (WebCore::CurlGlobal::~CurlGlobal):
2283         (WebCore::CurlShareHandle::handle):
2284         (WebCore::CurlContext::shareHandle):
2285         (WebCore::CurlHandle::handle):
2286         (WebCore::CurlHandle::url):
2287         (WebCore::CurlContext::curlShareHandle): Deleted.
2288         * platform/network/curl/CurlDownload.cpp:
2289         (WebCore::CurlDownload::~CurlDownload):
2290         (WebCore::CurlDownload::init):
2291         (WebCore::CurlDownload::start):
2292         (WebCore::CurlDownload::cancel):
2293         (WebCore::CurlDownload::getUrl):
2294         (WebCore::CurlDownload::addHeaders):
2295         (WebCore::CurlDownload::didReceiveHeader):
2296         (WebCore::CurlDownload::writeCallback):
2297         * platform/network/curl/CurlDownload.h:
2298         * platform/network/curl/CurlJobManager.cpp:
2299         (WebCore::CurlJobManager::CurlJobManager):
2300         (WebCore::CurlJobManager::~CurlJobManager):
2301         (WebCore::CurlJobManager::addToCurl):
2302         (WebCore::CurlJobManager::removeFromCurl):
2303         (WebCore::CurlJobManager::workerThread):
2304         * platform/network/curl/CurlJobManager.h:
2305         (WebCore::CurlJobManager::getMultiHandle): Deleted.
2306         * platform/network/curl/ResourceHandleCurl.cpp:
2307         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
2308         (WebCore::ResourceHandle::platformSetDefersLoading):
2309         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2310         (WebCore::ResourceHandle::receivedCredential):
2311         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
2312         (WebCore::calculateWebTimingInformations):
2313         (WebCore::handleLocalReceiveResponse):
2314         (WebCore::writeCallback):
2315         (WebCore::getProtectionSpace):
2316         (WebCore::headerCallback):
2317         (WebCore::readCallback):
2318         (WebCore::setupFormData):
2319         (WebCore::ResourceHandle::setupPUT):
2320         (WebCore::ResourceHandle::setupPOST):
2321         (WebCore::ResourceHandle::dispatchSynchronousJob):
2322         (WebCore::ResourceHandle::applyAuthentication):
2323         (WebCore::ResourceHandle::initialize):
2324         (WebCore::ResourceHandle::handleCurlMsg):
2325         * platform/network/curl/ResourceHandleManager.cpp:
2326         (WebCore::ResourceHandleManager::ResourceHandleManager):
2327         (WebCore::ResourceHandleManager::~ResourceHandleManager):
2328         (WebCore::ResourceHandleManager::downloadTimerCallback):
2329         (WebCore::ResourceHandleManager::removeFromCurl):
2330         (WebCore::ResourceHandleManager::startJob):
2331         * platform/network/curl/ResourceHandleManager.h:
2332         * platform/network/curl/SSLHandle.cpp:
2333         (WebCore::setSSLClientCertificate):
2334         (WebCore::certVerifyCallback):
2335         (WebCore::setSSLVerifyOptions):
2336
2337 2017-07-08  Antoine Quint  <graouts@apple.com>
2338
2339         REGRESSION: "visibility:hidden" does not hide play button for video elements
2340         https://bugs.webkit.org/show_bug.cgi?id=174258
2341         <rdar://problem/33181452>
2342
2343         Reviewed by Dean Jackson.
2344
2345         In order to not have most styles from the page affect the shadow root, we set "all: initial" on the
2346         media controls container. However, we need to still make the "visibility" property inherit from its
2347         host such that "visibility: hidden" on the host won't be overridden by setting the property back to
2348         its initial value, which is "visible".
2349
2350         Test: media/modern-media-controls/css/visibility-hidden.html
2351
2352         * Modules/modern-media-controls/controls/media-controls.css:
2353         (.media-controls-container):
2354
2355 2017-07-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2356
2357         Drop NOSNIFF compile flag
2358         https://bugs.webkit.org/show_bug.cgi?id=174289
2359
2360         Reviewed by Michael Catanzaro.
2361
2362         * Configurations/FeatureDefines.xcconfig:
2363         * css/StyleSheetContents.cpp:
2364         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2365         (WebCore::StyleSheetContents::notifyLoadedSheet):
2366         * dom/LoadableClassicScript.cpp:
2367         (WebCore::LoadableClassicScript::notifyFinished):
2368         * loader/cache/CachedCSSStyleSheet.cpp:
2369         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff):
2370         (WebCore::CachedCSSStyleSheet::canUseSheet):
2371         * loader/cache/CachedCSSStyleSheet.h:
2372         * platform/network/HTTPParsers.cpp:
2373         (WebCore::parseContentTypeOptionsHeader):
2374         * platform/network/HTTPParsers.h:
2375         * platform/network/ResourceResponseBase.cpp:
2376         (WebCore::isScriptAllowedByNosniff):
2377         * platform/network/ResourceResponseBase.h:
2378         * workers/WorkerScriptLoader.cpp:
2379         (WebCore::WorkerScriptLoader::didReceiveResponse):
2380
2381 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
2382
2383         [WK2] Use a rolling 30-day uptime for processing statistics
2384         https://bugs.webkit.org/show_bug.cgi?id=174235
2385         <rdar://problem/33164381>
2386
2387         Reviewed by Chris Dumez.
2388
2389         Add a KeyedDecoder specialization for Deque.
2390
2391         * platform/KeyedCoding.h:
2392         (WebCore::KeyedDecoder::decodeObjects):
2393
2394 2017-07-07  Daniel Bates  <dabates@apple.com>
2395
2396         [AppCache] Ignore fallback entries whose namespace is not prefixed with manifest path
2397         https://bugs.webkit.org/show_bug.cgi?id=174273
2398         <rdar://problem/33011682>
2399
2400         Reviewed by Brent Fulgham.
2401
2402         As per <https://html.spec.whatwg.org/multipage/offline.html#parsing-cache-manifests> (07/06/2017)
2403         we should ignore fallback entires whose fallback namespace URL is not prefixed with
2404         the manifest path. For now we only apply this policy when the manifest is served with
2405         a non-standard Content-Type to minimize web compatibility risk.
2406
2407         Test: http/tests/appcache/fallback-namespace-outside-manifest-path.html
2408
2409         * loader/appcache/ApplicationCacheGroup.cpp:
2410         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Pass the MIME type of the manifest.
2411         * loader/appcache/ManifestParser.cpp:
2412         (WebCore::manifestPath): Computes the manifest path from a manifest URL.
2413         (WebCore::parseManifest): Modified to take the MIME type of the manifest. If the MIME type is
2414         non-standard (i.e. not text/cached-manifest) then skip fallback entries whose namespace is not
2415         prefixed with the manifest path. Otherwise, process fallback entries as we do now. Also cleaned
2416         up the code a bit while I was here, including renaming a local variable to be more descriptive
2417         and using a const character array for the manifest signature to avoid the need to document the
2418         length of the manifest signature in a comment.
2419         * loader/appcache/ManifestParser.h:
2420
2421 2017-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2422
2423         [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
2424         https://bugs.webkit.org/show_bug.cgi?id=174219
2425         <rdar://problem/32083177>
2426
2427         Reviewed by Ryosuke Niwa.
2428
2429         Currently, in DragController.cpp, defaultOperationForDrag maps a drag source operation mask of
2430         DragOperationGeneric to DragOperationMove across all platforms. However, on iOS, where cross-app drag moves do
2431         not trigger a drop, this means drop handlers won't fire unless the dropEffect is explicitly set to copy.
2432
2433         To fix this, we introduce DragController::platformGenericDragOperation(), which returns DragOperationCopy on iOS
2434         and DragOperationMove (the existing behavior) elsewhere. defaultOperationForDrag then maps a drag source
2435         operation mask of DragOperationGeneric to platformGenericDragOperation().
2436
2437         Tests:  DataInteractionTests.ExternalSourceHTMLToUploadArea
2438                 DataInteractionTests.ExternalSourceImageAndHTMLToUploadArea
2439                 DataInteractionTests.ExternalSourceMoveOperationNotAllowed
2440
2441         * page/DragController.cpp:
2442         (WebCore::DragController::platformGenericDragOperation):
2443         (WebCore::defaultOperationForDrag):
2444         * page/DragController.h:
2445         * page/mac/DragControllerMac.mm:
2446         (WebCore::DragController::platformGenericDragOperation):
2447
2448 2017-07-07  Devin Rousso  <drousso@apple.com>
2449
2450         Web Inspector: Show all elements currently using a given CSS Canvas
2451         https://bugs.webkit.org/show_bug.cgi?id=173965
2452
2453         Reviewed by Joseph Pecoraro.
2454
2455         Test: inspector/canvas/css-canvas-clients.html
2456
2457         * css/CSSImageGeneratorValue.cpp:
2458         (WebCore::CSSImageGeneratorValue::addClient):
2459         (WebCore::CSSImageGeneratorValue::removeClient):
2460         * css/CSSImageGeneratorValue.h:
2461         (WebCore::CSSImageGeneratorValue::clients):
2462         * html/HTMLCanvasElement.cpp:
2463         (WebCore::HTMLCanvasElement::addObserver):
2464         (WebCore::HTMLCanvasElement::removeObserver):
2465         (WebCore::HTMLCanvasElement::cssCanvasClients):
2466         Each time an observer is added/removed for a given HTMLCanvasElement, send an event to the
2467         inspector frontend that the CSS canvas client nodes have changed. Additionally, anytime a
2468         client/use is added/removed from one of the observing CSSCanvasValue, fire the same event.
2469
2470         * css/CSSCanvasValue.h:
2471         (isType):
2472         * html/HTMLCanvasElement.h:
2473         (WebCore::CanvasObserver::isCSSCanvasValueObserver):
2474         Allows type traits to distinguish CanvasObserver from CSSCanvasValue::CanvasObserverProxy.
2475
2476         * inspector/InspectorCanvasAgent.h:
2477         * inspector/InspectorCanvasAgent.cpp:
2478         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
2479         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
2480         * inspector/InspectorInstrumentation.h:
2481         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
2482         * inspector/InspectorInstrumentation.cpp:
2483         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
2484         Notify the frontend that the list of client nodes has changed for the given canvas. Let the
2485         frontend request the actual list of node IDs when it needs, possibly at a later time.
2486
2487 2017-07-07  Jer Noble  <jer.noble@apple.com>
2488
2489         AVPlayer can continue to be active after released by MediaPlayerPrivateAVFoundationObjC.
2490         https://bugs.webkit.org/show_bug.cgi?id=174264
2491
2492         Reviewed by Eric Carlson.
2493
2494         If the AVPlayer is retained (by an autorelease pool, or internally by other objects in
2495         AVFoundation), releasing the AVPlayer is not enough to cancel loading or playback. So before
2496         releasing the AVPlayer, make sure to disassociate the current AVPlayerItem, which should
2497         cancel all activity in the AVPlayer.
2498
2499         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2500         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2501
2502 2017-07-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2503
2504         [Curl] Remove data url handler for async load
2505         https://bugs.webkit.org/show_bug.cgi?id=174263
2506
2507         data url is handled by ResourceLoader. No need for specific handling
2508         in platform dependent layer.
2509
2510         Reviewed by Alex Christensen.
2511
2512         * platform/network/curl/ResourceHandleManager.cpp:
2513         (WebCore::ResourceHandleManager::startJob):
2514
2515 2017-07-07  Matt Lewis  <jlewis3@apple.com>
2516
2517         Unreviewed, rolling out r219257.
2518
2519         The test added in the revision was still extreamly flaky on
2520         all testers.
2521
2522         Reverted changeset:
2523
2524         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
2525         https://bugs.webkit.org/show_bug.cgi?id=172545
2526         http://trac.webkit.org/changeset/219257
2527
2528 2017-07-07  Commit Queue  <commit-queue@webkit.org>
2529
2530         Unreviewed, rolling out r219238, r219239, and r219241.
2531         https://bugs.webkit.org/show_bug.cgi?id=174265
2532
2533         "fast/workers/dedicated-worker-lifecycle.html is flaky"
2534         (Requested by yusukesuzuki on #webkit).
2535
2536         Reverted changesets:
2537
2538         "[WTF] Implement WTF::ThreadGroup"
2539         https://bugs.webkit.org/show_bug.cgi?id=174081
2540         http://trac.webkit.org/changeset/219238
2541
2542         "Unreviewed, build fix after r219238"
2543         https://bugs.webkit.org/show_bug.cgi?id=174081
2544         http://trac.webkit.org/changeset/219239
2545
2546         "Unreviewed, CLoop build fix after r219238"
2547         https://bugs.webkit.org/show_bug.cgi?id=174081
2548         http://trac.webkit.org/changeset/219241
2549
2550 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
2551
2552         [SVG] Leak in SVGAnimatedListPropertyTearOff
2553         https://bugs.webkit.org/show_bug.cgi?id=172545
2554
2555         Reviewed by Said Abou-Hallawa.
2556
2557         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
2558         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
2559         reference to SVGAnimatedProperty.
2560
2561         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
2562         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
2563         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
2564         is going to be added to. This effectively creates a reference cycle between the
2565         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
2566
2567         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
2568
2569         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2570
2571 2017-07-07  Charlie Turner  <cturner@igalia.com>
2572
2573         [GStreamer] vid.me videos do not play
2574         https://bugs.webkit.org/show_bug.cgi?id=172240
2575
2576         Reviewed by Xabier Rodriguez-Calvar.
2577
2578         In r142251, code to hide the WK HTTP source elements from elsewhere in
2579         the pipeline was removed. This has the nasty side-effect of
2580         auto-plugging the WK HTTP source into things it really should not be
2581         used in, especially the adaptive streaming demuxers. The reasons this
2582         is bad are documented in several places on Bugzilla, see the parent
2583         bug report for more details. The high-level issue is that the WK HTTP
2584         source and its use of WebCore is not thread-safe. Although work has
2585         been recently done to improve this situation, it's still not perfect.
2586
2587         Another issue is the interface hlsdemux expects its HTTP source to
2588         implement, specifically seeking in READY.
2589
2590         This does rely on HTTP context sharing being available in GStreamer,
2591         upstream bug is here:
2592         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
2593         can be demonstrated with
2594         https://github.com/thiagoss/adaptive-test-server but manual testing on
2595         popular video hosting sites, including vid.me, shows that this doesn't
2596         bite us at the moment, just something else to fix in the future.
2597
2598         There are some QoS issues with the adaptive streaming code in
2599         GStreamer, but it seems much better to offer a below par QoS in lieu
2600         of crashing/livelocking when playing certain streams, and issues can be
2601         raised upstream when they arise.
2602
2603         This patch does take us further away from the future goal of having all
2604         networking operations go through the network process, but in return it
2605         solves some nasty crashes and livelocks that have been irritating
2606         users for some time. With the pressure off on this issue, work can be
2607         planned to consider how to make the WK HTTP source a better citizen
2608         inside the GStreamer pipeline when we migrate the netcode to go
2609         through the network process.
2610
2611         A new test is added to check that the single file HLS playlists
2612         (new in version 4) can be played, which was the primary cause of
2613         this bug report.
2614
2615         Test: http/tests/media/hls/range-request.html
2616
2617         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2618         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
2619         some trickery to make sure that we only ever fetch URLs handed to
2620         us by WebCore. Any further URLs discovered inside the pipeline
2621         will not get WKWS auto-plugged, since they'll be plain https?
2622         schemas.
2623         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
2624         setPlaybinURL helper method.
2625         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
2626         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
2627         the setPlaybinURL helper method.
2628         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2629         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
2630         ensures we won't get auto-plugged by pipeline elements asking for
2631         an element to fetch https? resources (like adaptive demuxers).
2632         (convertPlaybinURI): Undo the trick when another element asks us
2633         for our URI.
2634
2635 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2636
2637         [WTF] Implement WTF::ThreadGroup
2638         https://bugs.webkit.org/show_bug.cgi?id=174081
2639
2640         Reviewed by Mark Lam.
2641
2642         * page/ResourceUsageThread.h:
2643
2644 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
2645
2646         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
2647         https://bugs.webkit.org/show_bug.cgi?id=174150
2648
2649         Reviewed by Mark Lam.
2650
2651         * Modules/mediacontrols/MediaControlsHost.cpp:
2652         (WebCore::MediaControlsHost::captionDisplayMode):
2653         * Modules/mediastream/RTCDataChannel.cpp:
2654         (WebCore::RTCDataChannel::binaryType):
2655         * accessibility/AXObjectCache.cpp:
2656         (WebCore::createFromRenderer):
2657         * accessibility/AccessibilityMediaControls.cpp:
2658         (WebCore::AccessibilityMediaControl::controlTypeName):
2659         * accessibility/AccessibilityObject.cpp:
2660         (WebCore::AccessibilityObject::language):
2661         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
2662         (WebCore::AccessibilityObject::actionVerb):
2663         (WebCore::AccessibilityObject::getAttribute):
2664         (WebCore::AccessibilityObject::placeholderValue):
2665         * accessibility/AccessibilityObject.h:
2666         (WebCore::AccessibilityObject::accessKey):
2667         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
2668         * accessibility/AccessibilityRenderObject.cpp:
2669         (WebCore::AccessibilityRenderObject::accessKey):
2670         (WebCore::AccessibilityRenderObject::actionVerb):
2671         * bindings/js/JSCustomElementInterface.cpp:
2672         (WebCore::JSCustomElementInterface::constructElementWithFallback):
2673         * bindings/js/JSCustomElementRegistryCustom.cpp:
2674         (WebCore::JSCustomElementRegistry::define):
2675         * bindings/scripts/CodeGeneratorJS.pm:
2676         (GenerateDefaultValue):
2677         * bindings/scripts/test/JS/JSTestObj.cpp:
2678         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
2679         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
2680         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
2681         * css/CSSPageRule.cpp:
2682         (WebCore::CSSPageRule::selectorText):
2683         * css/CSSPrimitiveValue.cpp:
2684         (WebCore::valueName):
2685         * css/CSSSelector.cpp:
2686         (WebCore::simpleSelectorSpecificityInternal):
2687         (WebCore::CSSSelector::specificityForPage):
2688         (WebCore::CSSSelector::RareData::RareData):
2689         * css/CSSSelector.h:
2690         (WebCore::CSSSelector::argument):
2691         * css/CSSSelectorList.cpp:
2692         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
2693         * css/PageRuleCollector.cpp:
2694         (WebCore::checkPageSelectorComponents):
2695         * css/RuleSet.cpp:
2696         (WebCore::computeMatchBasedOnRuleHash):
2697         (WebCore::RuleSet::addRule):
2698         * css/SelectorChecker.cpp:
2699         (WebCore::tagMatches):
2700         * css/SelectorFilter.cpp:
2701         (WebCore::collectDescendantSelectorIdentifierHashes):
2702         * css/StyleBuilderConverter.h:
2703         (WebCore::StyleBuilderConverter::convertStringOrAuto):
2704         (WebCore::StyleBuilderConverter::convertStringOrNone):
2705         * css/StyleBuilderCustom.h:
2706         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
2707         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
2708         (WebCore::StyleBuilderCustom::applyValueContent):
2709         (WebCore::StyleBuilderCustom::applyValueAlt):
2710         * css/StyleSheetContents.cpp:
2711         (WebCore::StyleSheetContents::StyleSheetContents):
2712         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
2713         * css/makeprop.pl:
2714         * css/parser/CSSParserImpl.cpp:
2715         (WebCore::CSSParserImpl::parsePageSelector):
2716         * css/parser/CSSSelectorParser.cpp:
2717         (WebCore::CSSSelectorParser::consumeCompoundSelector):
2718         (WebCore::CSSSelectorParser::consumeName):
2719         (WebCore::CSSSelectorParser::consumeAttribute):
2720         (WebCore::CSSSelectorParser::defaultNamespace):
2721         (WebCore::CSSSelectorParser::determineNamespace):
2722         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
2723         * cssjit/SelectorCompiler.cpp:
2724         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
2725         (WebCore::SelectorCompiler::equalTagNames):
2726         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
2727         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
2728         * dom/Attr.cpp:
2729         (WebCore::Attr::setPrefix):
2730         (WebCore::Attr::attachToElement):
2731         * dom/Attribute.h:
2732         (WebCore::Attribute::nameMatchesFilter):
2733         * dom/ConstantPropertyMap.cpp:
2734         (WebCore::ConstantPropertyMap::nameForProperty):
2735         * dom/ContainerNode.cpp:
2736         (WebCore::ContainerNode::getElementsByTagName):
2737         (WebCore::ContainerNode::getElementsByTagNameNS):
2738         * dom/CustomElementReactionQueue.cpp:
2739         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
2740         * dom/DatasetDOMStringMap.cpp:
2741         (WebCore::convertPropertyNameToAttributeName):
2742         * dom/Document.cpp:
2743         (WebCore::createUpgradeCandidateElement):
2744         (WebCore::Document::createElementForBindings):
2745         (WebCore::Document::importNode):
2746         (WebCore::Document::hasValidNamespaceForElements):
2747         (WebCore::Document::processBaseElement):
2748         (WebCore::Document::dir):
2749         (WebCore::Document::bgColor):
2750         (WebCore::Document::fgColor):
2751         (WebCore::Document::alinkColor):
2752         (WebCore::Document::linkColorForBindings):
2753         (WebCore::Document::vlinkColor):
2754         * dom/Document.h:
2755         * dom/Element.cpp:
2756         (WebCore::Element::setBooleanAttribute):
2757         (WebCore::Element::synchronizeAttribute):
2758         (WebCore::Element::getAttribute):
2759         (WebCore::Element::getAttributeNS):
2760         (WebCore::Element::setAttribute):
2761         (WebCore::Element::parserSetAttributes):
2762         (WebCore::Element::didMoveToNewDocument):
2763         (WebCore::Element::setPrefix):
2764         (WebCore::Element::insertedInto):
2765         (WebCore::Element::removedFrom):
2766         (WebCore::Element::removeAttributeInternal):
2767         (WebCore::Element::addAttributeInternal):
2768         (WebCore::Element::removeAttributeNS):
2769         (WebCore::Element::getAttributeNodeNS):
2770         (WebCore::Element::hasAttributeNS):
2771         (WebCore::Element::computeInheritedLanguage):
2772         (WebCore::Element::updateNameForDocument):
2773         (WebCore::Element::updateIdForDocument):
2774         (WebCore::Element::didAddAttribute):
2775         (WebCore::Element::didRemoveAttribute):
2776         (WebCore::Element::cloneAttributesFromElement):
2777         * dom/Element.h:
2778         (WebCore::Element::attributeWithoutSynchronization):
2779         (WebCore::Element::idForStyleResolution):
2780         (WebCore::Element::getIdAttribute):
2781         (WebCore::Element::getNameAttribute):
2782         * dom/EventTarget.cpp:
2783         (WebCore::legacyType):
2784         * dom/MutationRecord.h:
2785         (WebCore::MutationRecord::attributeName):
2786         (WebCore::MutationRecord::attributeNamespace):
2787         * dom/NamedNodeMap.cpp:
2788         (WebCore::NamedNodeMap::removeNamedItemNS):
2789         * dom/Node.cpp:
2790         (WebCore::Node::prefix):
2791         (WebCore::Node::localName):
2792         (WebCore::Node::namespaceURI):
2793         (WebCore::Node::checkSetPrefix):
2794         (WebCore::locateDefaultNamespace):
2795         (WebCore::Node::isDefaultNamespace):
2796         (WebCore::Node::lookupNamespaceURI):
2797         (WebCore::locateNamespacePrefix):
2798         (WebCore::Node::lookupPrefix):
2799         * dom/NodeRareData.h:
2800         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
2801         (WebCore::NodeListsNodeData::addCachedCollection):
2802         (WebCore::NodeListsNodeData::cachedCollection):
2803         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
2804         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
2805         (WebCore::NodeListsNodeData::removeCachedCollection):
2806         * dom/PseudoElement.cpp:
2807         (WebCore::pseudoElementTagName):
2808         * dom/QualifiedName.cpp:
2809         (WebCore::QualifiedName::init):
2810         (WebCore::nullQName):
2811         (WebCore::createQualifiedName):
2812         * dom/QualifiedName.h:
2813         (WebCore::QualifiedName::hasPrefix):
2814         * dom/SelectorQuery.cpp:
2815         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
2816         * dom/SlotAssignment.cpp:
2817         (WebCore::slotNameFromAttributeValue):
2818         * dom/SlotAssignment.h:
2819         (WebCore::SlotAssignment::defaultSlotName):
2820         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
2821         (WebCore::ShadowRoot::didChangeDefaultSlot):
2822         * dom/TagCollection.cpp:
2823         (WebCore::TagCollection::TagCollection):
2824         (WebCore::HTMLTagCollection::HTMLTagCollection):
2825         * dom/TagCollection.h:
2826         (WebCore::TagCollectionNS::elementMatches):
2827         * dom/make_names.pl:
2828         (printNamesCppFile):
2829         (printDefinitions):
2830         (printFactoryCppFile):
2831         * editing/CompositeEditCommand.cpp:
2832         (WebCore::CompositeEditCommand::removeNodeAttribute):
2833         * editing/Editing.cpp:
2834         (WebCore::createHTMLElement):
2835         * editing/MarkupAccumulator.cpp:
2836         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
2837         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
2838         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
2839         (WebCore::MarkupAccumulator::appendNamespace):
2840         (WebCore::MarkupAccumulator::appendOpenTag):
2841         (WebCore::MarkupAccumulator::appendAttribute):
2842         * editing/gtk/EditorGtk.cpp:
2843         (WebCore::elementURL):
2844         * editing/markup.cpp:
2845         (WebCore::AttributeChange::AttributeChange):
2846         * html/Autocapitalize.cpp:
2847         (WebCore::stringForAutocapitalizeType):
2848         * html/Autofill.cpp:
2849         (WebCore::AutofillData::createFromHTMLFormControlElement):
2850         * html/DOMTokenList.h:
2851         (WebCore::DOMTokenList::item):
2852         * html/FormAssociatedElement.cpp:
2853         (WebCore::FormAssociatedElement::name):
2854         * html/HTMLButtonElement.cpp:
2855         (WebCore::HTMLButtonElement::formControlType):
2856         * html/HTMLDetailsElement.cpp:
2857         (WebCore::HTMLDetailsElement::toggleOpen):
2858         * html/HTMLDocument.cpp:
2859         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
2860         * html/HTMLElement.cpp:
2861         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
2862         (WebCore::toValidDirValue):
2863         * html/HTMLImageElement.cpp:
2864         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2865         * html/HTMLInputElement.cpp:
2866         (WebCore::HTMLInputElement::name):
2867         (WebCore::HTMLInputElement::updateType):
2868         * html/HTMLMediaElement.cpp:
2869         (WebCore::HTMLMediaElement::doesHaveAttribute):
2870         * html/HTMLOptionElement.cpp:
2871         (WebCore::HTMLOptionElement::createForJSConstructor):
2872         * html/HTMLParamElement.cpp:
2873         (WebCore::HTMLParamElement::name):
2874         * html/HTMLSelectElement.cpp:
2875         (WebCore::HTMLSelectElement::setMultiple):
2876         * html/HTMLTableCellElement.cpp:
2877         (WebCore::HTMLTableCellElement::scope):
2878         * html/HTMLTrackElement.cpp:
2879         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
2880         * html/LabelableElement.cpp:
2881         (WebCore::LabelableElement::labels):
2882         * html/LabelsNodeList.cpp:
2883         (WebCore::LabelsNodeList::~LabelsNodeList):
2884         * html/MediaController.cpp:
2885         (MediaController::playbackState):
2886         (eventNameForReadyState):
2887         * html/MediaDocument.cpp:
2888         (WebCore::MediaDocumentParser::createDocumentStructure):
2889         * html/parser/AtomicHTMLToken.h:
2890         (WebCore::AtomicHTMLToken::initializeAttributes):
2891         * html/parser/HTMLConstructionSite.cpp:
2892         (WebCore::HTMLConstructionSite::createElement):
2893         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2894         * html/parser/HTMLParserIdioms.cpp:
2895         (WebCore::stripLeadingAndTrailingHTMLSpaces):
2896         (WebCore::parseHTMLHashNameReference):
2897         * html/parser/HTMLTreeBuilder.cpp:
2898         (WebCore::createForeignAttributesMap):
2899         * html/track/InbandTextTrack.cpp:
2900         (WebCore::InbandTextTrack::InbandTextTrack):
2901         * html/track/LoadableTextTrack.cpp:
2902         (WebCore::LoadableTextTrack::id):
2903         * html/track/TextTrack.cpp:
2904         (WebCore::TextTrack::captionMenuOffItem):
2905         (WebCore::TextTrack::captionMenuAutomaticItem):
2906         * html/track/TrackBase.cpp:
2907         (WebCore::MediaTrackBase::setKindInternal):
2908         * html/track/VTTRegion.cpp:
2909         (WebCore::VTTRegion::scroll):
2910         * html/track/WebVTTElement.cpp:
2911         (WebCore::nodeTypeToTagName):
2912         * html/track/WebVTTElement.h:
2913         * html/track/WebVTTToken.h:
2914         (WebCore::WebVTTToken::StartTag):
2915         * loader/FrameLoader.cpp:
2916         (WebCore::FrameLoader::clear):
2917         * loader/FrameLoader.h:
2918         * loader/ImageLoader.cpp:
2919         (WebCore::ImageLoader::clearFailedLoadURL):
2920         * loader/NavigationAction.h:
2921         * loader/PolicyChecker.cpp:
2922         (WebCore::PolicyChecker::checkNavigationPolicy):
2923         * page/DOMWindow.cpp:
2924         (WebCore::DOMWindow::showModalDialog):
2925         * page/EventHandler.cpp:
2926         (WebCore::eventNameForTouchPointState):
2927         * page/FrameTree.cpp:
2928         (WebCore::FrameTree::setName):
2929         (WebCore::FrameTree::clearName):
2930         * page/Page.cpp:
2931         (WebCore::Page::groupName):
2932         * platform/graphics/ComplexTextController.cpp:
2933         (WebCore::ComplexTextController::offsetForPosition):
2934         * platform/graphics/FontCache.cpp:
2935         (WebCore::FontCache::alternateFamilyName):
2936         * platform/graphics/FontDescription.h:
2937         (WebCore::FontCascadeDescription::initialLocale):
2938         * platform/graphics/FontGenericFamilies.cpp:
2939         (WebCore::genericFontFamilyForScript):
2940         * platform/graphics/InbandTextTrackPrivate.h:
2941         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
2942         * platform/graphics/TrackPrivateBase.h:
2943         (WebCore::TrackPrivateBase::id):
2944         (WebCore::TrackPrivateBase::label):
2945         (WebCore::TrackPrivateBase::language):
2946         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2947         (WebCore::AVTrackPrivateAVFObjCImpl::id):
2948         (WebCore::AVTrackPrivateAVFObjCImpl::label):
2949         (WebCore::AVTrackPrivateAVFObjCImpl::language):
2950         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
2951         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
2952         (WebCore::InbandTextTrackPrivateAVCF::label):
2953         (WebCore::InbandTextTrackPrivateAVCF::language):
2954         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
2955         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
2956         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
2957         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
2958         (WebCore::InbandTextTrackPrivateAVFObjC::label):
2959         (WebCore::InbandTextTrackPrivateAVFObjC::language):
2960         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
2961         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
2962         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
2963         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2964         (WebCore::metadataType):
2965         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2966         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2967         (WebCore::FontCache::platformAlternateFamilyName):
2968         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2969         (WebCore::FontCascadeDescription::effectiveFamilyAt):
2970         * platform/graphics/freetype/FontCacheFreeType.cpp:
2971         (WebCore::FontCache::platformAlternateFamilyName):
2972         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
2973         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
2974         * platform/graphics/win/FontCacheWin.cpp:
2975         (WebCore::FontCache::platformAlternateFamilyName):
2976         * platform/mediastream/AudioTrackPrivateMediaStream.h:
2977         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
2978         (WebCore::RealtimeMediaSourceSettings::facingMode):
2979         * platform/mediastream/VideoTrackPrivateMediaStream.h:
2980         * rendering/HitTestResult.cpp:
2981         (WebCore::HitTestResult::linkSuggestedFilename):
2982         * rendering/InlineTextBox.cpp:
2983         (WebCore::InlineTextBox::paint):
2984         * rendering/RenderListItem.cpp:
2985         (WebCore::RenderListItem::markerText):
2986         * rendering/RenderText.cpp:
2987         (WebCore::RenderText::previousOffset):
2988         (WebCore::RenderText::nextOffset):
2989         * rendering/RenderTreeAsText.cpp:
2990         (WebCore::RenderTreeAsText::writeRenderObject):
2991         * rendering/TextPainter.cpp:
2992         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
2993         * rendering/style/RenderStyle.cpp:
2994         (WebCore::RenderStyle::textEmphasisMarkString):
2995         * rendering/style/RenderStyle.h:
2996         (WebCore::RenderStyle::initialHyphenationString):
2997         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
2998         (WebCore::RenderStyle::initialContentAltText):
2999         (WebCore::RenderStyle::initialLineGrid):
3000         (WebCore::RenderStyle::initialFlowThread):
3001         (WebCore::RenderStyle::initialRegionThread):
3002         * style/StyleScope.cpp:
3003         (WebCore::Style::Scope::collectActiveStyleSheets):
3004         * svg/SVGElement.cpp:
3005         (WebCore::SVGElement::getPresentationAttribute):
3006         * svg/SVGElement.h:
3007         (WebCore::SVGAttributeHashTranslator::hash):
3008         * svg/SVGUseElement.cpp:
3009         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
3010         * svg/animation/SVGSMILElement.cpp:
3011         (WebCore::SVGSMILElement::constructAttributeName):
3012         * testing/MockCDMFactory.cpp:
3013         (WebCore::MockCDMInstance::requestLicense):
3014         * xml/XMLErrors.cpp:
3015         (WebCore::createXHTMLParserErrorHeader):
3016         * xml/XPathStep.cpp:
3017         (WebCore::XPath::nodeMatchesBasicTest):
3018         (WebCore::XPath::Step::nodesInAxis):
3019         * xml/parser/XMLDocumentParserLibxml2.cpp:
3020         (WebCore::XMLDocumentParser::XMLDocumentParser):
3021         (WebCore::handleNamespaceAttributes):
3022         (WebCore::handleElementAttributes):
3023
3024 2017-07-06  Chris Dumez  <cdumez@apple.com>
3025
3026         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
3027         https://bugs.webkit.org/show_bug.cgi?id=174234
3028
3029         Reviewed by Brent Fulgham.
3030
3031         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
3032         always 0 since this member is only initialized later on, in the UIProcess.
3033
3034         * loader/ResourceLoadObserver.cpp:
3035         (WebCore::ResourceLoadObserver::logFrameNavigation):
3036         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3037         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3038
3039 2017-07-06  Yoav Weiss  <yoav@yoav.ws>
3040
3041         [preload] Avoid reflecting "video" and "audio" when they are not supported `as` value
3042         https://bugs.webkit.org/show_bug.cgi?id=174199
3043
3044         Reviewed by Youenn Fablet.
3045
3046         No new tests as video/audio is supported in tests. I tested this manually.
3047
3048         * html/HTMLLinkElement.cpp:
3049         (WebCore::HTMLLinkElement::as): Make sure "video" and "audio" will not be reflected when they are not supported.
3050
3051 2017-07-06  Chris Dumez  <cdumez@apple.com>
3052
3053         Drop unused ResourceLoadStatistics members
3054         https://bugs.webkit.org/show_bug.cgi?id=174226
3055
3056         Reviewed by Brent Fulgham.
3057
3058         * loader/ResourceLoadObserver.cpp:
3059         (WebCore::ResourceLoadObserver::logFrameNavigation):
3060         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3061         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3062         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
3063         * loader/ResourceLoadObserver.h:
3064         * loader/ResourceLoadStatistics.cpp:
3065         (WebCore::ResourceLoadStatistics::encode):
3066         (WebCore::ResourceLoadStatistics::decode):
3067         (WebCore::ResourceLoadStatistics::toString):
3068         (WebCore::ResourceLoadStatistics::merge):
3069         * loader/ResourceLoadStatistics.h:
3070
3071 2017-07-06  Youenn Fablet  <youenn@apple.com>
3072
3073         Rendering of WebRTC audio in AudioSampleDataSource may trigger crackles
3074         https://bugs.webkit.org/show_bug.cgi?id=174223
3075
3076         Reviewed by Eric Carlson.
3077
3078         We try reading too quickly and need to back off a little bit if we do not enough data.
3079         This only affects real audio and not web audio, hence validated through manual testing only.
3080
3081         * platform/audio/mac/AudioSampleDataSource.mm:
3082         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3083
3084 2017-07-06  Sam Weinig  <sam@webkit.org>
3085
3086         [WebIDL] Remove custom bindings for WebGL code dealing with WebGL extensions
3087         https://bugs.webkit.org/show_bug.cgi?id=174186
3088
3089         Reviewed by Alex Christensen.
3090
3091         * CMakeLists.txt:
3092         * WebCore.xcodeproj/project.pbxproj:
3093         Update files. Categorize some of the remaining custom bindings into groups.
3094
3095         * bindings/IDLTypes.h:
3096         Add a IDLWebGLExtension type, to model the special WebGLExtension type. In
3097         the future, WebGLExtension can probably be replaced by a Variant.
3098         
3099         * bindings/js/JSDOMConvertWebGL.cpp: Added.
3100         Move WebGLAny's convertToJSValue and add a convertToJSValue for WebGLExtension.
3101
3102         * bindings/js/JSDOMConvertWebGL.h:
3103         (WebCore::convertToJSValue):
3104         Since WebGLExtension is a wrapper type, we need both a pointer and reference variant
3105         of the conversion.
3106
3107         (WebCore::JSConverter<IDLWebGLExtension>::convert):
3108         Added.
3109
3110         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
3111         (WebCore::toJS): Deleted.
3112         (WebCore::JSWebGL2RenderingContext::getExtension): Deleted.
3113         Remove custom operation and converter.
3114
3115         * bindings/js/JSWebGLRenderingContextCustom.cpp:
3116         (WebCore::toJS): Deleted.
3117         (WebCore::JSWebGLRenderingContext::getExtension): Deleted.
3118         Remove custom operation and converter.
3119
3120         * bindings/scripts/CodeGeneratorJS.pm:
3121         (AddToIncludesForIDLType):
3122         (NativeToJSValueDOMConvertNeedsState):
3123         (NativeToJSValueDOMConvertNeedsGlobalObject):
3124         Add support for IDLWebGLExtension.
3125
3126         * html/canvas/WebGLAny.cpp: Removed.
3127         * html/canvas/WebGLAny.h:
3128         Moved convertToJSValue to the bindings where it belongs.
3129
3130         * html/canvas/WebGLRenderingContextBase.idl:
3131         Annotate getExtension with [OverrideIDLType=IDLWebGLExtension].
3132
3133 2017-07-06  Joseph Pecoraro  <pecoraro@apple.com>
3134
3135         [Cocoa] CTParagraphStyle leak under WebCore::LinkImageLayout::LinkImageLayout
3136         https://bugs.webkit.org/show_bug.cgi?id=174228
3137
3138         Reviewed by Andreas Kling.
3139
3140         * platform/mac/DragImageMac.mm:
3141         (WebCore::LinkImageLayout::LinkImageLayout):
3142
3143 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
3144
3145         [Cocoa] Improve performance of font lookups
3146         https://bugs.webkit.org/show_bug.cgi?id=173960
3147         <rdar://problem/31996891>
3148
3149         Reviewed by Darin Adler.
3150
3151         Looking up kCTFontPostScriptNameAttribute is faster than kCTFontNameAttribute.
3152
3153         No new tests because there is no behavior change.
3154
3155         * platform/spi/cocoa/CoreTextSPI.h:
3156         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3157         (WebCore::FontDatabase::fontForPostScriptName):
3158
3159 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
3160
3161         REGRESSION(r216944): Font loads can cause Chinese characters to draw as .notdef
3162         https://bugs.webkit.org/show_bug.cgi?id=173962
3163         <rdar://problem/32925318>
3164
3165         Reviewed by Simon Fraser.
3166
3167         Previously, there was no signalling between our font loading code
3168         which determined whether or not a font should be invisible (because
3169         its in the middle of loading) and our system fallback code which
3170         created fonts when we fall off the end of the fallback list. Because
3171         of this, we were doing two things wrong:
3172
3173         1. When we started downloading a font, we would try to use a fallback
3174         font. However, if the fallback font didn't suppor the character we're
3175         trying to render, we would just bail and draw .notdef
3176         2. Even if we continued down the fallback list, and fell of the end,
3177         we wouldn't realize that the system fallback font should also be drawn
3178         as invisible.
3179
3180         This patch solves these two problems by:
3181         1. Performing a search to find the best (local) fallback font with
3182         which to fall systemFallbackFontForCharacter(). This way, if you say
3183         "font-family: 'RemoteFont', 'Helvetica'" we will use Helvetica as
3184         the lookup to ask the system to search for.
3185         2. Give the Font class an accessor which can create a duplicate, but
3186         invisible font. Give FontCascadeFonts::glyphDataForVariant() the
3187         correct tracking to know when to use this invisible duplicate.
3188
3189         Tests: fast/text/font-loading-system-fallback.html
3190                http/tests/webfont/font-loading-system-fallback-visibility.html
3191
3192         * platform/graphics/Font.cpp:
3193         (WebCore::Font::invisibleFont):
3194         * platform/graphics/Font.h:
3195         * platform/graphics/FontCascadeFonts.cpp:
3196         (WebCore::findBestFallbackFont):
3197         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
3198         (WebCore::FontCascadeFonts::glyphDataForVariant):
3199         * platform/graphics/FontCascadeFonts.h:
3200
3201 2017-07-06  Chris Dumez  <cdumez@apple.com>
3202
3203         FileMonitor should not be ref counted
3204         https://bugs.webkit.org/show_bug.cgi?id=174166
3205
3206         Reviewed by Brent Fulgham.
3207
3208         Update FileMonitor to no longer be refcounted. It was previously easy to leak it
3209         because the object would ref itself in various lambdas. The client would have to
3210         explicitely call FileMonitor::stopMonitoring() which was fragile.
3211
3212         This patch also simplifies the code and API a bit since no longer actually
3213         requires startMonitoring() / stopMonitoring() API.
3214
3215         No new tests, covered by API tests.
3216
3217         * platform/FileMonitor.cpp:
3218         (WebCore::FileMonitor::FileMonitor):
3219         (WebCore::FileMonitor::~FileMonitor):
3220         (WebCore::FileMonitor::create): Deleted.
3221         (WebCore::FileMonitor::startMonitoring): Deleted.
3222         (WebCore::FileMonitor::stopMonitoring): Deleted.
3223         * platform/FileMonitor.h:
3224         * platform/cocoa/FileMonitorCocoa.mm:
3225         (WebCore::FileMonitor::FileMonitor):
3226         (WebCore::FileMonitor::~FileMonitor):
3227         (WebCore::FileMonitor::startMonitoring): Deleted.
3228         (WebCore::FileMonitor::stopMonitoring): Deleted.
3229
3230 2017-07-06  Matt Rajca  <mrajca@apple.com>
3231
3232         Fix build with VIDEO support disabled.
3233         https://bugs.webkit.org/show_bug.cgi?id=174217
3234
3235         Unreviewed build fix.
3236
3237         * page/Page.cpp:
3238
3239 2017-07-06  Matt Lewis  <jlewis3@apple.com>
3240
3241         Unreviewed, rolling out r219193.
3242
3243         The tests added with this revision were extreamly flaky on all
3244         platforms.
3245
3246         Reverted changeset:
3247
3248         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
3249         https://bugs.webkit.org/show_bug.cgi?id=172545
3250         http://trac.webkit.org/changeset/219193
3251
3252 2017-07-06  Zalan Bujtas  <zalan@apple.com>
3253
3254         Use WTFLogAlways for debug logging so that it shows up in device system logs
3255         https://bugs.webkit.org/show_bug.cgi?id=173450
3256
3257         Reviewed by Simon Fraser.
3258
3259         If you want to showRenderTree() on-device, the result doesn't show in system log so you can't see it.
3260         Switch to WTFLogAlways to fix this, for showRenderTree and its dependencies.
3261         
3262         * platform/text/TextStream.cpp:
3263         (WebCore::writeIndent):
3264         * rendering/InlineBox.cpp:
3265         (WebCore::InlineBox::showLineTreeAndMark):
3266         (WebCore::InlineBox::showLineBox):
3267         * rendering/InlineBox.h:
3268         * rendering/InlineFlowBox.cpp:
3269         (WebCore::InlineFlowBox::showLineTreeAndMark):
3270         * rendering/InlineFlowBox.h:
3271         * rendering/InlineTextBox.cpp:
3272         (WebCore::InlineTextBox::showLineBox):
3273         * rendering/InlineTextBox.h:
3274         * rendering/RenderBlockFlow.cpp:
3275         (WebCore::RenderBlockFlow::showLineTreeAndMark):
3276         * rendering/RenderBlockFlow.h:
3277         * rendering/RenderObject.cpp:
3278         (WebCore::showRenderTreeLegend):
3279         (WebCore::RenderObject::showRenderTreeForThis):
3280         (WebCore::RenderObject::showLineTreeForThis):
3281         (WebCore::RenderObject::showRegionsInformation):
3282         (WebCore::RenderObject::showRenderObject):
3283         (WebCore::RenderObject::showRenderSubTreeAndMark):
3284         * rendering/RenderObject.h:
3285         * rendering/SimpleLineLayoutFunctions.cpp:
3286         (WebCore::SimpleLineLayout::printPrefix):
3287         (WebCore::SimpleLineLayout::showLineLayoutForFlow):
3288         * rendering/SimpleLineLayoutFunctions.h:
3289
3290 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
3291
3292         Unify FontCascadeFonts::glyphDataForVariant() and FontCascadeFonts::glyphDataForNormalVariant()
3293         https://bugs.webkit.org/show_bug.cgi?id=174213
3294
3295         Reviewed by Zalan Bujtas.
3296
3297         They have almost identical code. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=173962
3298
3299         No new tests because there is no behavior change.
3300
3301         * platform/graphics/FontCascadeFonts.cpp:
3302         (WebCore::FontCascadeFonts::glyphDataForVariant):
3303         (WebCore::FontCascadeFonts::glyphDataForCharacter):
3304         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Deleted.
3305         * platform/graphics/FontCascadeFonts.h:
3306
3307 2017-07-06  Don Olmstead  <don.olmstead@sony.com>
3308
3309         [PAL] Move KillRing into PAL
3310         https://bugs.webkit.org/show_bug.cgi?id=173900
3311
3312         Reviewed by Myles C. Maxfield.
3313
3314         No new tests. No change in functionality.
3315
3316         * Configurations/WebCore.xcconfig:
3317         * PlatformGTK.cmake:
3318         * PlatformMac.cmake:
3319         * PlatformWPE.cmake:
3320         * PlatformWin.cmake:
3321         * WebCore.xcodeproj/project.pbxproj:
3322         * editing/Editor.cpp:
3323         (WebCore::Editor::Editor):
3324         * editing/Editor.h:
3325         (WebCore::Editor::killRing):
3326         * editing/EditorCommand.cpp:
3327
3328 2017-07-06  Devin Rousso  <drousso@apple.com>
3329
3330         Web Inspector: Support getting the content of WebGL/WebGL2 contexts
3331         https://bugs.webkit.org/show_bug.cgi?id=173569
3332         <rdar://problem/33112420>
3333
3334         Reviewed by Joseph Pecoraro.
3335
3336         Tests: inspector/canvas/requestContent-2d.html
3337                inspector/canvas/requestContent-webgl.html
3338                inspector/canvas/requestContent-webgl2.html
3339
3340         * html/canvas/WebGLRenderingContextBase.cpp:
3341         (WebCore::WebGLRenderingContextBase::clearIfComposited):
3342         * html/canvas/WebGLRenderingContextBase.h:
3343         (WebCore::WebGLRenderingContextBase::preventBufferClearForInspector):
3344         (WebCore::WebGLRenderingContextBase::setPreventBufferClearForInspector):
3345         Add a flag that will prevent the context buffer from being cleared, allowing it to be copied
3346         within a toDataURL call. This is currently only used by InspectorCanvasAgent::requestContent.
3347
3348         * inspector/InspectorCanvasAgent.cpp:
3349         (WebCore::InspectorCanvasAgent::requestContent):
3350         Since toDataURL attempts to force the canvas to redraw, we can preserve the buffer after it
3351         finishes drawing so that it can be copied, instead of it normally being swapped out.
3352
3353 2017-07-06  Chris Dumez  <cdumez@apple.com>
3354
3355         Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver
3356         https://bugs.webkit.org/show_bug.cgi?id=174194
3357
3358         Reviewed by Brent Fulgham.
3359
3360         Move ResourceLoadObserver notification throttling logic from WebProcess class to
3361         ResourceLoadObserver. This makes more sense and decreases the complexity of the
3362         WebProcess class.
3363
3364         * loader/ResourceLoadObserver.cpp:
3365         (WebCore::ResourceLoadObserver::setNotificationCallback):
3366         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
3367         (WebCore::ResourceLoadObserver::logFrameNavigation):
3368         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3369         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3370         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3371         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
3372         (WebCore::ResourceLoadObserver::notificationTimerFired):
3373         * loader/ResourceLoadObserver.h:
3374
3375 2017-07-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
3376
3377         REGRESSION(r208511): RenderImageResourceStyleImage should not assume image() won't return null if its m_cachedImage is valid
3378         https://bugs.webkit.org/show_bug.cgi?id=174168
3379
3380         Reviewed by Simon Fraser.
3381
3382         RenderImageResourceStyleImage::image() may return a null pointer even if
3383         its m_cachedImage is not null. The revision r208511, changed the function
3384         RenderImageResourceStyleImage::shutdown() so it calls Image::stopAnimation().
3385         But this change assumes that if m_cachedImage is not null then image() will
3386         return a valid pointer. This is not true because StyleCachedImage::isPending()
3387         can return true and hence, RenderImageResourceStyleImage::image() will return
3388         a null pointer.
3389
3390         * rendering/RenderImageResourceStyleImage.cpp:
3391         (WebCore::RenderImageResourceStyleImage::image): Like what RenderImageResource
3392         does, return Image::nullImage() if m_styleImage->isPending().
3393
3394 2017-07-06  Commit Queue  <commit-queue@webkit.org>
3395
3396         Unreviewed, rolling out r219201.
3397         https://bugs.webkit.org/show_bug.cgi?id=174211
3398
3399         "Causes crashes on Release builds and API tests" (Requested by
3400         ddkilzer on #webkit).
3401
3402         Reverted changeset:
3403
3404         "Add release assert to explore crash for
3405         <rdar://problem/32908525>"
3406         http://trac.webkit.org/changeset/219201
3407
3408 2017-07-06  Commit Queue  <commit-queue@webkit.org>
3409
3410         Unreviewed, rolling out r219194.
3411         https://bugs.webkit.org/show_bug.cgi?id=174207
3412
3413         it broke some layout tests (Requested by clopez on #webkit).
3414
3415         Reverted changeset:
3416
3417         "[GStreamer] vid.me videos do not play"
3418         https://bugs.webkit.org/show_bug.cgi?id=172240
3419         http://trac.webkit.org/changeset/219194
3420
3421 2017-07-06  David Kilzer  <ddkilzer@apple.com>
3422
3423         Add release assert to explore crash for <rdar://problem/32908525>
3424
3425         Reviewed by Brady Eidson.
3426
3427         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3428         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Add
3429         release assert to catch cases when the IDBBackingStore is not
3430         deleted before the UniqueIDBDatabase is destroyed.  The
3431         IDBBackingStore should always be released on the database
3432         thread.
3433
3434 2017-07-06  Matt Lewis  <jlewis3@apple.com>
3435
3436         Unreviewed, rolling out r219178.
3437
3438         This caused a consistent failure with the API test
3439         StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.
3440
3441         Reverted changeset:
3442
3443         "[WTF] Clean up StringStatics.cpp by using
3444         LazyNeverDestroyed<> for Atoms"
3445         https://bugs.webkit.org/show_bug.cgi?id=174150
3446         http://trac.webkit.org/changeset/219178
3447
3448 2017-07-06  Charlie Turner  <cturner@igalia.com>
3449
3450         [GStreamer] vid.me videos do not play
3451         https://bugs.webkit.org/show_bug.cgi?id=172240
3452
3453         Reviewed by Xabier Rodriguez-Calvar.
3454
3455         In r142251, code to hide the WK HTTP source elements from elsewhere in
3456         the pipeline was removed. This has the nasty side-effect of
3457         auto-plugging the WK HTTP source into things it really should not be
3458         used in, especially the adaptive streaming demuxers. The reasons this
3459         is bad are documented in several places on Bugzilla, see the parent
3460         bug report for more details. The high-level issue is that the WK HTTP
3461         source and its use of WebCore is not thread-safe. Although work has
3462         been recently done to improve this situation, it's still not perfect.
3463
3464         Another issue is the interface hlsdemux expects its HTTP source to
3465         implement, specifically seeking in READY.
3466
3467         This does rely on HTTP context sharing being available in GStreamer,
3468         upstream bug is here:
3469         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
3470         can be demonstrated with
3471         https://github.com/thiagoss/adaptive-test-server but manual testing on
3472         popular video hosting sites, including vid.me, shows that this doesn't
3473         bite us at the moment, just something else to fix in the future.
3474
3475         There are some QoS issues with the adaptive streaming code in
3476         GStreamer, but it seems much better to offer a below par QoS in lieu
3477         of crashing/livelocking when playing certain streams, and issues can be
3478         raised upstream when they arise.
3479
3480         This patch does take us further away from the future goal of having all
3481         networking operations go through the network process, but in return it
3482         solves some nasty crashes and livelocks that have been irritating
3483         users for some time. With the pressure off on this issue, work can be
3484         planned to consider how to make the WK HTTP source a better citizen
3485         inside the GStreamer pipeline when we migrate the netcode to go
3486         through the network process.
3487
3488         A new test is added to check that the single file HLS playlists
3489         (new in version 4) can be played, which was the primary cause of
3490         this bug report.
3491
3492         Test: http/tests/media/hls/range-request.html
3493
3494         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3495         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
3496         some trickery to make sure that we only ever fetch URLs handed to
3497         us by WebCore. Any further URLs discovered inside the pipeline
3498         will not get WKWS auto-plugged, since they'll be plain https?
3499         schemas.
3500         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
3501         setPlaybinURL helper method.
3502         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
3503         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
3504         the setPlaybinURL helper method.
3505         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3506         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
3507         ensures we won't get auto-plugged by pipeline elements asking for
3508         an element to fetch https? resources (like adaptive demuxers).
3509         (convertPlaybinURI): Undo the trick when another element asks us
3510         for our URI.
3511
3512 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
3513
3514         [SVG] Leak in SVGAnimatedListPropertyTearOff
3515         https://bugs.webkit.org/show_bug.cgi?id=172545
3516
3517         Reviewed by Said Abou-Hallawa.
3518
3519         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
3520         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
3521         reference to SVGAnimatedProperty.
3522
3523         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
3524         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
3525         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
3526         is going to be added to. This effectively creates a reference cycle between the
3527         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
3528
3529         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
3530
3531         * svg/properties/SVGAnimatedListPropertyTearOff.h:
3532
3533 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
3534
3535         [WTF] Move SoftLinking.h into WTF
3536         https://bugs.webkit.org/show_bug.cgi?id=174000
3537
3538         Reviewed by Alex Christensen.
3539
3540         No new tests. No change in functionality
3541
3542         * Modules/applepay/PaymentRequest.cpp:
3543         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3544         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
3545         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
3546         * WebCore.xcodeproj/project.pbxproj:
3547         * editing/cocoa/EditorCocoa.mm:
3548         * editing/cocoa/HTMLConverter.mm:
3549         * editing/ios/EditorIOS.mm:
3550         * page/CaptionUserPreferencesMediaAF.cpp:
3551         * page/cocoa/SettingsCocoa.mm:
3552         * page/ios/UserAgentIOS.mm:
3553         * page/mac/ServicesOverlayController.mm:
3554         * platform/audio/ios/AudioDestinationIOS.cpp:
3555         * platform/audio/ios/AudioFileReaderIOS.cpp:
3556         * platform/audio/ios/AudioSessionIOS.mm:
3557         * platform/audio/ios/MediaSessionManagerIOS.mm:
3558         * platform/cf/CoreMediaSoftLink.cpp:
3559         * platform/cf/CoreMediaSoftLink.h:
3560         * platform/cf/MediaAccessibilitySoftLink.cpp:
3561         * platform/cf/MediaAccessibilitySoftLink.h:
3562         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3563         * platform/cocoa/CoreVideoSoftLink.cpp:
3564         * platform/cocoa/CoreVideoSoftLink.h:
3565         * platform/cocoa/DataDetectorsCoreSoftLink.h:
3566         * platform/cocoa/NetworkExtensionContentFilter.mm:
3567         * platform/cocoa/ParentalControlsContentFilter.mm:
3568         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
3569         * platform/cocoa/VideoToolboxSoftLink.cpp:
3570         * platform/cocoa/VideoToolboxSoftLink.h:
3571         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
3572         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
3573         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
3574         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3575         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
3576         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3577         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3578         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
3579         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
3580         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
3581         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
3582         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3583         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3584         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3585         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3586         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
3587         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
3588         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3589         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
3590         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3591         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3592         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3593         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
3594         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3595         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
3596         * platform/graphics/cv/PixelBufferConformerCV.cpp:
3597         * platform/graphics/ios/FontCacheIOS.mm:
3598         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3599         * platform/graphics/mac/FontCacheMac.mm:
3600         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3601         * platform/graphics/mac/MediaTimeQTKit.mm:
3602         * platform/graphics/mac/PDFDocumentImageMac.mm:
3603         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3604         * platform/ios/DragImageIOS.mm:
3605         * platform/ios/PlatformPasteboardIOS.mm:
3606         * platform/ios/PlatformScreenIOS.mm:
3607         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
3608         * platform/ios/QuickLookSoftLink.h:
3609         * platform/ios/QuickLookSoftLink.mm:
3610         * platform/ios/RemoteCommandListenerIOS.mm:
3611         * platform/ios/ThemeIOS.mm:
3612         * platform/ios/ValidationBubbleIOS.mm:
3613         * platform/ios/WebCoreMotionManager.mm:
3614         * platform/ios/WebItemProviderPasteboard.mm:
3615         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3616         * platform/mac/DragImageMac.mm:
3617         * platform/mac/MediaRemoteSoftLink.cpp:
3618         * platform/mac/MediaRemoteSoftLink.h:
3619         * platform/mac/SerializedPlatformRepresentationMac.mm:
3620         * platform/mac/WebPlaybackControlsManager.mm:
3621         * platform/mac/WebVideoFullscreenController.mm:
3622         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
3623         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
3624         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
3625         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3626         * platform/network/cf/CookieJarCFNet.cpp:
3627         * platform/network/ios/NetworkStateNotifierIOS.mm:
3628         * platform/network/ios/PreviewConverter.mm:
3629         * platform/network/mac/BlobDataFileReferenceMac.mm:
3630         * platform/spi/cocoa/AVKitSPI.h:
3631         (-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Deleted.
3632         * platform/spi/cocoa/NSAttributedStringSPI.h:
3633         * platform/spi/ios/DataDetectorsUISPI.h:
3634         * platform/spi/mac/AVFoundationSPI.h:
3635         * platform/spi/mac/DataDetectorsSPI.h:
3636         * platform/spi/mac/LookupSPI.h:
3637         * platform/spi/mac/TUCallSPI.h:
3638         * platform/win/ScrollbarThemeWin.cpp:
3639         * rendering/RenderThemeCocoa.mm:
3640         * rendering/RenderThemeIOS.mm:
3641         * rendering/RenderThemeWin.cpp:
3642         * testing/Internals.mm:
3643         * xml/XSLStyleSheetLibxslt.cpp:
3644         * xml/XSLTExtensions.cpp:
3645         * xml/XSLTProcessorLibxslt.cpp:
3646         * xml/XSLTUnicodeSort.cpp:
3647
3648 2017-07-05  Zalan Bujtas  <zalan@apple.com>
3649
3650         REGRESSION: Stack overflow in RenderBlockFlow::layoutBlock after increasing the font size to max in some RTL vertical books.
3651         https://bugs.webkit.org/show_bug.cgi?id=174144
3652         <rdar://problem/32781038>
3653
3654         Reviewed by Simon Fraser.
3655
3656         We set the start/end margin on the ruby renderer to support overhanging content. The margins ensure that
3657         adjacent boxes on the line are placed properly respecting the overhanging content.
3658         The line breaking algorithm also takes this value into account as it affects the line's available width.
3659         We need to reset this value before laying out the lines, otherwise we might end up using this value on the line twice;
3660         first as the renderer's margins (as the result of the previous layout) and second as the renderer's overhanging value.
3661         Since this is not strictly part of the renderer's layout context (i.e. we set them during the line layout and not at
3662         RenderRubyRun::layout) we can't rely on the ruby's layout logic to reset them.
3663
3664         Test: fast/ruby/ruby-overhang-margin-crash.html
3665
3666         * rendering/RenderBlockLineLayout.cpp:
3667         (WebCore::RenderBlockFlow::layoutLineBoxes):
3668
3669 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3670
3671         Upgrade GCC baseline
3672         https://bugs.webkit.org/show_bug.cgi?id=174155
3673
3674         Reviewed by Michael Catanzaro.
3675
3676         Remove workaround for old GCC.
3677
3678         * CMakeLists.txt:
3679
3680 2017-07-05  Chris Dumez  <cdumez@apple.com>
3681
3682         Unreviewed attempt to fix iOS build after r219177.
3683
3684         * page/ios/UserAgentIOS.mm:
3685         * platform/spi/ios/UIKitSPI.h:
3686
3687 2017-07-05  Chris Dumez  <cdumez@apple.com>
3688
3689         Unreviewed attempt to fix iOS build after r219177.
3690
3691         * page/ios/UserAgentIOS.mm:
3692         * platform/spi/ios/UIKitSPI.h:
3693
3694 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3695
3696         Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
3697         https://bugs.webkit.org/show_bug.cgi?id=174148
3698
3699         Reviewed by Mark Lam.
3700
3701         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3702         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC):
3703
3704 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3705
3706         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
3707         https://bugs.webkit.org/show_bug.cgi?id=174150
3708
3709         Reviewed by Mark Lam.
3710
3711         * Modules/mediacontrols/MediaControlsHost.cpp:
3712         (WebCore::MediaControlsHost::captionDisplayMode):
3713         * Modules/mediastream/RTCDataChannel.cpp:
3714         (WebCore::RTCDataChannel::binaryType):
3715         * accessibility/AXObjectCache.cpp:
3716         (WebCore::createFromRenderer):
3717         * accessibility/AccessibilityMediaControls.cpp:
3718         (WebCore::AccessibilityMediaControl::controlTypeName):
3719         * accessibility/AccessibilityObject.cpp:
3720         (WebCore::AccessibilityObject::language):
3721         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
3722         (WebCore::AccessibilityObject::actionVerb):
3723         (WebCore::AccessibilityObject::getAttribute):
3724         (WebCore::AccessibilityObject::placeholderValue):
3725         * accessibility/AccessibilityObject.h:
3726         (WebCore::AccessibilityObject::accessKey):
3727         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
3728         * accessibility/AccessibilityRenderObject.cpp:
3729         (WebCore::AccessibilityRenderObject::accessKey):
3730         (WebCore::AccessibilityRenderObject::actionVerb):
3731         * bindings/js/JSCustomElementInterface.cpp:
3732         (WebCore::JSCustomElementInterface::constructElementWithFallback):
3733         * bindings/js/JSCustomElementRegistryCustom.cpp:
3734         (WebCore::JSCustomElementRegistry::define):
3735         * bindings/scripts/CodeGeneratorJS.pm:
3736         (GenerateDefaultValue):
3737         * bindings/scripts/test/JS/JSTestObj.cpp:
3738         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
3739         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
3740         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
3741         * css/CSSPageRule.cpp:
3742         (WebCore::CSSPageRule::selectorText):
3743         * css/CSSPrimitiveValue.cpp:
3744         (WebCore::valueName):
3745         * css/CSSSelector.cpp:
3746         (WebCore::simpleSelectorSpecificityInternal):
3747         (WebCore::CSSSelector::specificityForPage):
3748         (WebCore::CSSSelector::RareData::RareData):
3749         * css/CSSSelector.h:
3750         (WebCore::CSSSelector::argument):
3751         * css/CSSSelectorList.cpp:
3752         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
3753         * css/PageRuleCollector.cpp:
3754         (WebCore::checkPageSelectorComponents):
3755         * css/RuleSet.cpp:
3756         (WebCore::computeMatchBasedOnRuleHash):
3757         (WebCore::RuleSet::addRule):
3758         * css/SelectorChecker.cpp:
3759         (WebCore::tagMatches):
3760         * css/SelectorFilter.cpp:
3761         (WebCore::collectDescendantSelectorIdentifierHashes):
3762         * css/StyleBuilderConverter.h:
3763         (WebCore::StyleBuilderConverter::convertStringOrAuto):
3764         (WebCore::StyleBuilderConverter::convertStringOrNone):
3765         * css/StyleBuilderCustom.h:
3766         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
3767         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
3768         (WebCore::StyleBuilderCustom::applyValueContent):
3769         (WebCore::StyleBuilderCustom::applyValueAlt):
3770         * css/StyleSheetContents.cpp:
3771         (WebCore::StyleSheetContents::StyleSheetContents):
3772         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
3773         * css/makeprop.pl:
3774         * css/parser/CSSParserImpl.cpp:
3775         (WebCore::CSSParserImpl::parsePageSelector):
3776         * css/parser/CSSSelectorParser.cpp:
3777         (WebCore::CSSSelectorParser::consumeCompoundSelector):
3778         (WebCore::CSSSelectorParser::consumeName):
3779         (WebCore::CSSSelectorParser::consumeAttribute):
3780         (WebCore::CSSSelectorParser::defaultNamespace):
3781         (WebCore::CSSSelectorParser::determineNamespace):
3782         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
3783         * cssjit/SelectorCompiler.cpp:
3784         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
3785         (WebCore::SelectorCompiler::equalTagNames):
3786         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
3787         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
3788         * dom/Attr.cpp:
3789         (WebCore::Attr::setPrefix):
3790         (WebCore::Attr::attachToElement):
3791         * dom/Attribute.h:
3792         (WebCore::Attribute::nameMatchesFilter):
3793         * dom/ConstantPropertyMap.cpp:
3794         (WebCore::ConstantPropertyMap::nameForProperty):
3795         * dom/ContainerNode.cpp:
3796         (WebCore::ContainerNode::getElementsByTagName):
3797         (WebCore::ContainerNode::getElementsByTagNameNS):
3798         * dom/CustomElementReactionQueue.cpp:
3799         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
3800         * dom/DatasetDOMStringMap.cpp:
3801         (WebCore::convertPropertyNameToAttributeName):
3802         * dom/Document.cpp:
3803         (WebCore::createUpgradeCandidateElement):
3804         (WebCore::Document::createElementForBindings):
3805         (WebCore::Document::importNode):
3806         (WebCore::Document::hasValidNamespaceForElements):
3807         (WebCore::Document::processBaseElement):
3808         (WebCore::Document::dir):
3809         (WebCore::Document::bgColor):
3810         (WebCore::Document::fgColor):
3811         (WebCore::Document::alinkColor):
3812         (WebCore::Document::linkColorForBindings):
3813         (WebCore::Document::vlinkColor):
3814         * dom/Document.h:
3815         * dom/Element.cpp:
3816         (WebCore::Element::setBooleanAttribute):
3817         (WebCore::Element::synchronizeAttribute):
3818         (WebCore::Element::getAttribute):
3819         (WebCore::Element::getAttributeNS):
3820         (WebCore::Element::setAttribute):
3821         (WebCore::Element::parserSetAttributes):
3822         (WebCore::Element::didMoveToNewDocument):
3823         (WebCore::Element::setPrefix):
3824         (WebCore::Element::insertedInto):
3825         (WebCore::Element::removedFrom):
3826         (WebCore::Element::removeAttributeInternal):
3827         (WebCore::Element::addAttributeInternal):
3828         (WebCore::Element::removeAttributeNS):
3829         (WebCore::Element::getAttributeNodeNS):
3830         (WebCore::Element::hasAttributeNS):
3831         (WebCore::Element::computeInheritedLanguage):
3832         (WebCore::Element::updateNameForDocument):
3833         (WebCore::Element::updateIdForDocument):
3834         (WebCore::Element::didAddAttribute):
3835         (WebCore::Element::didRemoveAttribute):
3836         (WebCore::Element::cloneAttributesFromElement):
3837         * dom/Element.h:
3838         (WebCore::Element::attributeWithoutSynchronization):
3839         (WebCore::Element::idForStyleResolution):
3840         (WebCore::Element::getIdAttribute):
3841         (WebCore::Element::getNameAttribute):
3842         * dom/EventTarget.cpp:
3843         (WebCore::legacyType):
3844         * dom/MutationRecord.h:
3845         (WebCore::MutationRecord::attributeName):
3846         (WebCore::MutationRecord::attributeNamespace):
3847         * dom/NamedNodeMap.cpp:
3848         (WebCore::NamedNodeMap::removeNamedItemNS):
3849         * dom/Node.cpp:
3850         (WebCore::Node::prefix):
3851         (WebCore::Node::localName):
3852         (WebCore::Node::namespaceURI):
3853         (WebCore::Node::checkSetPrefix):
3854         (WebCore::locateDefaultNamespace):
3855         (WebCore::Node::isDefaultNamespace):
3856         (WebCore::Node::lookupNamespaceURI):
3857         (WebCore::locateNamespacePrefix):
3858         (WebCore::Node::lookupPrefix):
3859         * dom/NodeRareData.h:
3860         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
3861         (WebCore::NodeListsNodeData::addCachedCollection):
3862         (WebCore::NodeListsNodeData::cachedCollection):
3863         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
3864         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
3865         (WebCore::NodeListsNodeData::removeCachedCollection):
3866         * dom/PseudoElement.cpp:
3867         (WebCore::pseudoElementTagName):
3868         * dom/QualifiedName.cpp:
3869         (WebCore::QualifiedName::init):
3870         (WebCore::nullQName):
3871         (WebCore::createQualifiedName):
3872         * dom/QualifiedName.h:
3873         (WebCore::QualifiedName::hasPrefix):
3874         * dom/SelectorQuery.cpp:
3875         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
3876         * dom/SlotAssignment.cpp:
3877         (WebCore::slotNameFromAttributeValue):
3878         * dom/SlotAssignment.h:
3879         (WebCore::SlotAssignment::defaultSlotName):
3880         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
3881         (WebCore::ShadowRoot::didChangeDefaultSlot):
3882         * dom/TagCollection.cpp:
3883         (WebCore::TagCollection::TagCollection):
3884         (WebCore::HTMLTagCollection::HTMLTagCollection):
3885         * dom/TagCollection.h:
3886         (WebCore::TagCollectionNS::elementMatches):
3887         * dom/make_names.pl:
3888         (printNamesCppFile):
3889         (printDefinitions):
3890         (printFactoryCppFile):
3891         * editing/CompositeEditCommand.cpp:
3892         (WebCore::CompositeEditCommand::removeNodeAttribute):
3893         * editing/Editing.cpp:
3894         (WebCore::createHTMLElement):
3895         * editing/MarkupAccumulator.cpp:
3896         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
3897         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
3898         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
3899         (WebCore::MarkupAccumulator::appendNamespace):
3900         (WebCore::MarkupAccumulator::appendOpenTag):
3901         (WebCore::MarkupAccumulator::appendAttribute):
3902         * editing/gtk/EditorGtk.cpp:
3903         (WebCore::elementURL):
3904         * editing/markup.cpp:
3905         (WebCore::AttributeChange::AttributeChange):
3906         * html/Autocapitalize.cpp:
3907         (WebCore::stringForAutocapitalizeType):
3908         * html/Autofill.cpp:
3909         (WebCore::AutofillData::createFromHTMLFormControlElement):
3910         * html/DOMTokenList.h:
3911         (WebCore::DOMTokenList::item):
3912         * html/FormAssociatedElement.cpp:
3913         (WebCore::FormAssociatedElement::name):
3914         * html/HTMLButtonElement.cpp:
3915         (WebCore::HTMLButtonElement::formControlType):
3916         * html/HTMLDetailsElement.cpp:
3917         (WebCore::HTMLDetailsElement::toggleOpen):
3918         * html/HTMLDocument.cpp:
3919         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
3920         * html/HTMLElement.cpp:
3921         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
3922         (WebCore::toValidDirValue):
3923         * html/HTMLImageElement.cpp:
3924         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3925         * html/HTMLInputElement.cpp:
3926         (WebCore::HTMLInputElement::name):
3927         (WebCore::HTMLInputElement::updateType):
3928         * html/HTMLMediaElement.cpp:
3929         (WebCore::HTMLMediaElement::doesHaveAttribute):
3930         * html/HTMLOptionElement.cpp:
3931         (WebCore::HTMLOptionElement::createForJSConstructor):
3932         * html/HTMLParamElement.cpp:
3933         (WebCore::HTMLParamElement::name):
3934         * html/HTMLSelectElement.cpp:
3935         (WebCore::HTMLSelectElement::setMultiple):
3936         * html/HTMLTableCellElement.cpp:
3937         (WebCore::HTMLTableCellElement::scope):
3938         * html/HTMLTrackElement.cpp:
3939         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
3940         * html/LabelableElement.cpp:
3941         (WebCore::LabelableElement::labels):
3942         * html/LabelsNodeList.cpp:
3943         (WebCore::LabelsNodeList::~LabelsNodeList):
3944         * html/MediaController.cpp:
3945         (MediaController::playbackState):
3946         (eventNameForReadyState):
3947         * html/MediaDocument.cpp:
3948         (WebCore::MediaDocumentParser::createDocumentStructure):
3949         * html/parser/AtomicHTMLToken.h:
3950         (WebCore::AtomicHTMLToken::initializeAttributes):
3951         * html/parser/HTMLConstructionSite.cpp:
3952         (WebCore::HTMLConstructionSite::createElement):
3953         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
3954         * html/parser/HTMLParserIdioms.cpp:
3955         (WebCore::stripLeadingAndTrailingHTMLSpaces):
3956         (WebCore::parseHTMLHashNameReference):
3957         * html/parser/HTMLTreeBuilder.cpp:
3958         (WebCore::createForeignAttributesMap):
3959         * html/track/InbandTextTrack.cpp:
3960         (WebCore::InbandTextTrack::InbandTextTrack):
3961         * html/track/LoadableTextTrack.cpp:
3962         (WebCore::LoadableTextTrack::id):
3963         * html/track/TextTrack.cpp:
3964         (WebCore::TextTrack::captionMenuOffItem):
3965         (WebCore::TextTrack::captionMenuAutomaticItem):
3966         * html/track/TrackBase.cpp:
3967         (WebCore::MediaTrackBase::setKindInternal):
3968         * html/track/VTTRegion.cpp:
3969         (WebCore::VTTRegion::scroll):
3970         * html/track/WebVTTElement.cpp:
3971         (WebCore::nodeTypeToTagName):
3972         * html/track/WebVTTElement.h:
3973         * html/track/WebVTTToken.h:
3974         (WebCore::WebVTTToken::StartTag):
3975         * loader/FrameLoader.cpp:
3976         (WebCore::FrameLoader::clear):
3977         * loader/FrameLoader.h:
3978         * loader/ImageLoader.cpp:
3979         (WebCore::ImageLoader::clearFailedLoadURL):
3980         * loader/NavigationAction.h:
3981         * loader/PolicyChecker.cpp:
3982         (WebCore::PolicyChecker::checkNavigationPolicy):
3983         * page/DOMWindow.cpp:
3984         (WebCore::DOMWindow::showModalDialog):
3985         * page/EventHandler.cpp:
3986         (WebCore::eventNameForTouchPointState):
3987         * page/FrameTree.cpp:
3988         (WebCore::FrameTree::setName):
3989         (WebCore::FrameTree::clearName):
3990         * page/Page.cpp:
3991         (WebCore::Page::groupName):
3992         * platform/graphics/ComplexTextController.cpp:
3993         (WebCore::ComplexTextController::offsetForPosition):
3994         * platform/graphics/FontCache.cpp:
3995         (WebCore::FontCache::alternateFamilyName):
3996         * platform/graphics/FontDescription.h:
3997         (WebCore::FontCascadeDescription::