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