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