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