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