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