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