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