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