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