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