ASSERTION FAILED: !canAnimate() && !m_currentFrame
[WebKit.git] / Source / WebCore / ChangeLog
1 2017-06-30  Fujii Hironori  <Hironori.Fujii@sony.com>
2
3         ASSERTION FAILED: !canAnimate() && !m_currentFrame
4         https://bugs.webkit.org/show_bug.cgi?id=173089
5
6         Reviewed by Said Abou-Hallawa.
7
8         WebCore::BitmapImage::draw() has an assertion which ensures
9         m_currentFrame is zero in case of async decoding. But, this
10         assertion failed if an GIF animation image which have finished its
11         animation was repainted. In that time, m_currentFrame was the last
12         frame index of the image.
13
14         Test: fast/images/animated-gif-paint-after-animation.html
15
16         * platform/graphics/BitmapImage.cpp:
17         (WebCore::BitmapImage::draw): Assert m_currentFrame is zero or the animation finished.
18         Call requestFrameAsyncDecodingAtIndex with m_currentFrame instead of zero.
19
20 2017-06-30  Ross Kirsling  <ross.kirsling@sony.com>
21
22         [PAL] Move Sound into PAL
23         https://bugs.webkit.org/show_bug.cgi?id=173999
24
25         Reviewed by Alex Christensen.
26
27         * Configurations/WebCore.xcconfig:
28         * PlatformGTK.cmake:
29         * PlatformMac.cmake:
30         * PlatformWPE.cmake:
31         * PlatformWin.cmake:
32         * WebCore.xcodeproj/project.pbxproj:
33         * editing/Editor.cpp:
34         (WebCore::Editor::cut):
35         (WebCore::Editor::copy):
36         (WebCore::Editor::performDelete):
37         * editing/EditorCommand.cpp:
38         (WebCore::executeSelectToMark):
39         (WebCore::executeSwapWithMark):
40         * editing/mac/EditorMac.mm:
41         (WebCore::Editor::takeFindStringFromSelection):
42         * inspector/InspectorFrontendHost.cpp:
43         (WebCore::InspectorFrontendHost::beep):
44         * platform/Sound.h: Removed.
45
46 2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>
47
48         [iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes
49         https://bugs.webkit.org/show_bug.cgi?id=174017
50         <rdar://problem/32959782>
51
52         Reviewed by Simon Fraser.
53
54         We're currenly computing the drag caret rect (for the purposes of presentation at the client layers)
55         incorrectly, in per-frame document coordinates instead of root view coordinates in the mainframe. This means
56         drag caret geometry from embedded iframes in the document will show up in the content view with a rect in the
57         coordinate space of the iframe.
58
59         To fix this, we need to convert the drag caret rect to root view coordinates. This patch teaches
60         DragCaretController to do this, and tweaks WebKit/WebKit2 to use caretRectInRootViewCoordinates.
61
62         Test: DataInteractionTests.ExternalSourcePlainTextToIFrame
63
64         * editing/FrameSelection.cpp:
65         (WebCore::DragCaretController::caretRectInRootViewCoordinates):
66         * editing/FrameSelection.h:
67
68 2017-06-30  Sam Weinig  <sam@webkit.org>
69
70         [WebIDL] Replace use of __is_polymorphic with standard std::is_polymorphic<>::value
71         https://bugs.webkit.org/show_bug.cgi?id=174012
72
73         Reviewed by Alex Christensen.
74
75         * bindings/scripts/CodeGeneratorJS.pm:
76         (GenerateImplementation):
77         Replace __is_polymorphic with standard std::is_polymorphic<>::value. Remove clang
78         specific guard now that we are using something other compilers support.
79
80         * bindings/scripts/test/JS/JSInterfaceName.cpp:
81         * bindings/scripts/test/JS/JSMapLike.cpp:
82         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
83         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
84         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
85         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
86         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
87         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
88         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
89         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
90         * bindings/scripts/test/JS/JSTestException.cpp:
91         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
92         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
93         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
94         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
95         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
96         * bindings/scripts/test/JS/JSTestInterface.cpp:
97         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
98         * bindings/scripts/test/JS/JSTestIterable.cpp:
99         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
100         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
101         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
102         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
103         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
104         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
105         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
106         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
107         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
108         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
109         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
110         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
111         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
112         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
113         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
114         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
115         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
116         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
117         * bindings/scripts/test/JS/JSTestNode.cpp:
118         * bindings/scripts/test/JS/JSTestObj.cpp:
119         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
120         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
121         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
122         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
123         * bindings/scripts/test/JS/JSTestSerialization.cpp:
124         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
125         * bindings/scripts/test/JS/JSTestStringifier.cpp:
126         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
127         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
128         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
129         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
130         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
131         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
132         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
133         Update test results.
134
135 2017-06-30  Youenn Fablet  <youenn@apple.com>
136
137        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
138        https://bugs.webkit.org/show_bug.cgi?id=169389
139
140        Reviewed by Alex Christensen.
141
142        Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
143        Updated test is showing some more failing but this is due to the fact that we are no longer totally lying on the configuration of the
144         underlying libwebrtc backend.
145
146         Previously, we were creating a libwebrtc peer connection and then setting its configuration.
147         libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
148         Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.
149
150         ICE candidate pool size is disabled as it is creating issues with running tests on bots.
151
152         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
153         (WebCore::MediaEndpointPeerConnection::setConfiguration):
154         * Modules/mediastream/MediaEndpointPeerConnection.h:
155         * Modules/mediastream/PeerConnectionBackend.h:
156         * Modules/mediastream/RTCPeerConnection.cpp:
157         (WebCore::RTCPeerConnection::initializeWith):
158         (WebCore::iceServersFromConfiguration):
159         (WebCore::RTCPeerConnection::initializeConfiguration):
160         (WebCore::RTCPeerConnection::setConfiguration):
161         * Modules/mediastream/RTCPeerConnection.h:
162         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
163         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
164         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
165         (WebCore::LibWebRTCMediaEndpoint::stop):
166         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
167         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
168         (WebCore::configurationFromMediaEndpointConfiguration):
169         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
170         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
171         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
172         (WebCore::createActualPeerConnection):
173         (WebCore::LibWebRTCProvider::createPeerConnection):
174         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
175
176
177 2017-06-30  Antoine Quint  <graouts@apple.com>
178
179         Top controls bars should invert with right-to-left user interface layout direction locale
180         https://bugs.webkit.org/show_bug.cgi?id=173989
181         <rdar://problem/32863552>
182
183         Reviewed by Dean Jackson.
184
185         When the user interface layout direction is set by the locale to be right-to-left, we now:
186
187             - invert the two top controls bars
188             - invert the layout order for the fullscreen / PiP controls bar
189             - orient the volume button the opposite direction when presented in a top controls bar
190
191         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html
192
193         * Modules/modern-media-controls/controls/icon-service.js: Add new RTL variants for the mute and unmute icons.
194         * Modules/modern-media-controls/controls/inline-media-controls.css: Invert the position of the two top controls
195         bars when we switch user interface layout direction.
196         (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-left,):
197         (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-right,):
198         (.media-controls.inline > .controls-bar.top-left): Deleted.
199         (.media-controls.inline > .controls-bar.top-right): Deleted.
200         * Modules/modern-media-controls/controls/inline-media-controls.js:
201         (InlineMediaControls.prototype.layout): Default to using the LTR variant for the mute button icon since
202         it should only use the RTL variant in case the locale requires it *and* we display the mute button in a
203         top controls bar rather than the bottom controls bar (ie. when width becomes constrained).
204         (InlineMediaControls.prototype._topLeftContainerButtons): Invert the order of the fullscreen and PiP
205         buttons based on the user interface layout direction.
206         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
207         (InlineMediaControls):
208         * Modules/modern-media-controls/controls/media-controls.js:
209         (MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection): Schedule a layout when the user interface
210         layout direction changes.
211         * Modules/modern-media-controls/controls/mute-button.js: Add a new "usesRTLIconVariant" property, false by
212         default, to indicate we want to use the RTL variant of the button's icon.
213         (MuteButton):
214         (MuteButton.prototype.get muted):
215         (MuteButton.prototype.set muted):
216         (MuteButton.prototype.set usesRTLIconVariant):
217         (MuteButton.prototype.layout):
218         * Modules/modern-media-controls/images/iOS/Mute-RTL.svg: Added.
219         * Modules/modern-media-controls/images/iOS/VolumeHi-RTL.svg: Added.
220         * Modules/modern-media-controls/images/macOS/Mute-RTL.svg: Added.
221         * Modules/modern-media-controls/images/macOS/VolumeHi-RTL.svg: Added.
222         * Modules/modern-media-controls/media/media-controller.js: Use an ivar to track when it's worth notifying the
223         media controls that the user interface layout direction has changed. This means we won't need to schedule a
224         layout in case it's set to the current value.
225         (MediaController):
226         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
227
228 2017-06-29  Zalan Bujtas  <zalan@apple.com>
229
230         BreakingContext::handleReplaced() should use replacedBox instead of m_current.renderer().
231         https://bugs.webkit.org/show_bug.cgi?id=174011
232
233         Reviewed by Simon Fraser.
234
235         No change in functionality.
236
237         * rendering/line/BreakingContext.h:
238         (WebCore::BreakingContext::handleReplaced):
239         * rendering/line/LineWidth.cpp:
240         (WebCore::LineWidth::applyOverhang):
241         * rendering/line/LineWidth.h:
242
243 2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>
244
245         [iOS DnD] Web content process crashes when the selection is moved far offscreen in dragstart
246         https://bugs.webkit.org/show_bug.cgi?id=174010
247         <rdar://problem/32597802>
248
249         Reviewed by Tim Horton.
250
251         The TextIndicator snapshot generated in createDragImageForSelection is not guaranteed to succeed; this patch
252         adds a null check following TextIndicator::createWithSelectionInFrame and bails early if the snapshot was not
253         successful.
254
255         Test: DataInteractionTests.DoNotCrashWhenSelectionMovesOffscreenAfterDragStart
256
257         * platform/ios/DragImageIOS.mm:
258         (WebCore::createDragImageForSelection):
259
260 2017-06-29  Chris Fleizach  <cfleizach@apple.com>
261
262         AX: Cannot call setValue() on contenteditable or ARIA text controls
263         https://bugs.webkit.org/show_bug.cgi?id=173520
264
265         Reviewed by Ryosuke Niwa.
266
267         Add support for changing the value of a contenteditable and any other aria text control in setValue().
268  
269         Test: accessibility/mac/set-value-editable-types.html
270
271         * accessibility/AccessibilityRenderObject.cpp:
272         (WebCore::AccessibilityRenderObject::setValue):
273
274 2017-06-28  Simon Fraser  <simon.fraser@apple.com>
275
276         getBoundingClientRect returns wrong value for combination of page zoom and scroll
277         https://bugs.webkit.org/show_bug.cgi?id=173841
278         rdar://problem/32983841
279
280         Reviewed by Dean Jackson.
281
282         The layout viewport returned by FrameView::layoutViewportRect() is affected by page (Command-+) zooming,
283         since it's computed using scroll positions, so when we use its origin to convert into client coordinates
284         (which are zoom-agnostic), we need to account for page zoom, so fix FrameView::documentToClientOffset()
285         to do this.
286
287         Callers of documentToClientOffset() were checked, revealing that event client coordinates were also
288         wrong with page zoom and are fixed in the same way. It was found that SimulatedClick was using an
289         entirely wrong rect to compute its location: Element::clientRect() is NOT in client coordinates,
290         so change this code to use getBoundingClientRect() instead.
291
292         Minor refactoring in MouseRelatedEvent to make getting to the FrameView cleaner.
293
294         Some geometry types enhanced to have non-mutating scale functions.
295
296         Tests: fast/events/simulated-click-zoomed.html
297                fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html
298
299         * dom/MouseRelatedEvent.cpp:
300         (WebCore::MouseRelatedEvent::init):
301         (WebCore::MouseRelatedEvent::initCoordinates):
302         (WebCore::MouseRelatedEvent::frameView):
303         (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor):
304         (WebCore::MouseRelatedEvent::computePageLocation):
305         (WebCore::MouseRelatedEvent::computeRelativePosition):
306         (WebCore::pageZoomFactor): Deleted.
307         (WebCore::frameScaleFactor): Deleted.
308         * dom/MouseRelatedEvent.h:
309         (WebCore::MouseRelatedEvent::absoluteLocation):
310         (WebCore::MouseRelatedEvent::setAbsoluteLocation): Deleted.
311         * dom/SimulatedClick.cpp:
312         * page/FrameView.cpp:
313         (WebCore::FrameView::layoutViewportRect): baseLayoutViewportSize() is the same as the old code.
314         (WebCore::FrameView::documentToAbsoluteScaleFactor):
315         (WebCore::FrameView::absoluteToDocumentScaleFactor):
316         (WebCore::FrameView::absoluteToDocumentPoint):
317         (WebCore::FrameView::documentToClientOffset):
318         * page/FrameView.h:
319         * platform/graphics/FloatPoint.h:
320         (WebCore::FloatPoint::scale):
321         (WebCore::FloatPoint::scaled):
322         * platform/graphics/FloatSize.h:
323         (WebCore::FloatSize::scaled):
324         * platform/graphics/LayoutPoint.h:
325         (WebCore::LayoutPoint::scaled):
326
327 2017-06-29  Megan Gardner  <megan_gardner@apple.com>
328
329         Unreviewed, fixing Window's build after r218976
330
331         * rendering/ScrollAlignment.cpp:
332         (WebCore::operator<<):
333
334 2017-06-29  Megan Gardner  <megan_gardner@apple.com>
335
336         Add TextStream operators for Range, VisiblePosition, VisibleSelection, and ScrollAlignment
337         https://bugs.webkit.org/show_bug.cgi?id=173997
338
339         Reviewed by Simon Fraser.
340
341         Adding logging that can be used with TextStream-based LOG_WITH_STREAM.
342
343         * dom/Range.cpp:
344         (WebCore::operator<<):
345         * dom/Range.h:
346         * editing/VisiblePosition.h:
347         * editing/VisibleSelection.cpp:
348         (WebCore::operator<<):
349         * editing/VisibleSelection.h:
350         * rendering/ScrollAlignment.cpp:
351         (WebCore::operator<<):
352         * rendering/ScrollAlignment.h:
353
354 2017-06-29  Matt Lewis  <jlewis3@apple.com>
355
356         Unreviewed, rolling out r218903.
357
358         This patch and its fix cause immediate flakiness on all WK2
359         testers
360
361         Reverted changeset:
362
363         "Support PeerConnectionStates::BundlePolicy::MaxBundle when
364         setting rtc configuration"
365         https://bugs.webkit.org/show_bug.cgi?id=169389
366         http://trac.webkit.org/changeset/218903
367
368 2017-06-29  Matt Lewis  <jlewis3@apple.com>
369
370         Unreviewed, rolling out r218963.
371
372         This patch and its fix cause immediate flakiness on all WK2
373         testers
374
375         Reverted changeset:
376
377         "Support PeerConnectionStates::BundlePolicy::MaxBundle when
378         setting rtc configuration"
379         https://bugs.webkit.org/show_bug.cgi?id=169389
380         http://trac.webkit.org/changeset/218963
381
382 2017-06-29  Chris Dumez  <cdumez@apple.com>
383
384         Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess
385         https://bugs.webkit.org/show_bug.cgi?id=173990
386
387         Reviewed by Brent Fulgham.
388
389         Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess.
390         They really have different API and there is therefore close to no code duplication.
391
392         * loader/ResourceLoadObserver.cpp:
393         (WebCore::primaryDomain):
394         (WebCore::ResourceLoadObserver::setStatisticsQueue):
395         (WebCore::ResourceLoadObserver::shouldLog):
396         * loader/ResourceLoadObserver.h:
397         * loader/ResourceLoadStatisticsStore.cpp:
398         (WebCore::ResourceLoadStatisticsStore::primaryDomain):
399         * loader/ResourceLoadStatisticsStore.h:
400         * platform/URL.h:
401
402 2017-06-29  Sam Weinig  <sam@webkit.org>
403
404         [WebIDL] Remove custom binding for UserMessageHandlersNamespace
405         https://bugs.webkit.org/show_bug.cgi?id=173956
406
407         Reviewed by Darin Adler.
408
409         * CMakeLists.txt:
410         * WebCore.xcodeproj/project.pbxproj:
411         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp: Removed.
412         Remove JSUserMessageHandlersNamespaceCustom.cpp
413
414         * bindings/scripts/CodeGeneratorJS.pm:
415         (GenerateNamedGetterLambda):
416         Add support for calling named getters with additional arguments from [CallWith].
417
418         (GenerateAttributeGetterBodyDefinition):
419         (GenerateAttributeSetterBodyDefinition):
420         (GenerateCallWithUsingReferences):
421         (GenerateCallWithUsingPointers):
422         (GenerateConstructorCallWithUsingPointers):
423         (GenerateCallWith):
424         (GenerateParametersCheck):
425         Update arguments to GenerateCallWith(Using...) to no longer pass an operation,
426         which was only needed for the no longer used ScriptArguments, pass a thisObject
427         reference, and optionally pass an indentation.
428
429         * bindings/scripts/IDLAttributes.json:
430         Remove no longer used ScriptArguments and CallStack, add World.
431
432         * bindings/scripts/test/JS/JSTestObj.cpp:
433         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttributeGetter): Deleted.
434         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
435         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttributeSetter): Deleted.
436         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
437         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackBody): Deleted.
438         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack): Deleted.
439         * bindings/scripts/test/TestObj.idl:
440         Remove tests of ScriptArguments and CallStack.
441
442         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: Added.
443         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: Added.
444         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: Added.
445         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: Added.
446         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: Added.
447         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: Added.
448         * bindings/scripts/test/TestNamedGetterCallWith.idl: Added.
449         * bindings/scripts/test/TestNamedGetterNoIdentifier.idl: Added.
450         * bindings/scripts/test/TestNamedGetterWithIdentifier.idl: Added.
451         Add basic named getter tests and a specific test of named getters using CallWith.
452
453         * page/UserMessageHandlersNamespace.cpp:
454         (WebCore::UserMessageHandlersNamespace::supportedPropertyNames):
455         (WebCore::UserMessageHandlersNamespace::namedItem):
456         (WebCore::UserMessageHandlersNamespace::handler): Deleted.
457         * page/UserMessageHandlersNamespace.h:
458         Rename handler to namedItem, matching convention and the expectations of the
459         bindings generator and swap the order of the arguments for the same reason.
460
461         * page/UserMessageHandlersNamespace.idl:
462         Remove CustomGetOwnPropertySlotAndDescriptor, and add the anonymous named getter.
463
464 2017-06-29  Chris Dumez  <cdumez@apple.com>
465
466         Avoid copying ResourceLoadStatistics objects
467         https://bugs.webkit.org/show_bug.cgi?id=173972
468
469         Reviewed by Brent Fulgham.
470
471         Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
472         to avoid such mistakes in the future.
473
474         * loader/ResourceLoadObserver.cpp:
475         (WebCore::ResourceLoadObserver::logFrameNavigation):
476         * loader/ResourceLoadStatistics.h:
477         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
478
479 2017-06-29  John Wilander  <wilander@apple.com>
480
481         Fix for intermittent Layout Test fail http/tests/loading/resourceLoadStatistics/telemetry-generation.html
482         https://bugs.webkit.org/show_bug.cgi?id=173940
483         <rdar://problem/33018125>
484
485         Reviewed by Brent Fulgham.
486
487         No new tests. This change enables the exiting test to pass.
488
489         * loader/ResourceLoadStatisticsStore.cpp:
490         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
491             Added an assert.
492
493 2017-06-29  Youenn Fablet  <youenn@apple.com>
494
495         Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
496         https://bugs.webkit.org/show_bug.cgi?id=169389
497
498         Unreviewed.
499
500         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
501         (WebCore::configurationFromMediaEndpointConfiguration): Reactivating CPU overuse detection as it might be the cause of the bots regressions.
502
503 2017-06-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
504
505         [Curl] ResourceHandleManager violate the class responsibility of ResourceHandle
506         https://bugs.webkit.org/show_bug.cgi?id=173630
507
508         Reviewed by Alex Christensen.
509
510         * platform/network/ResourceHandle.h:
511         * platform/network/curl/ResourceHandleCurl.cpp:
512         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
513         (WebCore::calculateWebTimingInformations):
514         (WebCore::handleLocalReceiveResponse):
515         (WebCore::writeCallback):
516         (WebCore::isHttpInfo):
517         (WebCore::isHttpRedirect):
518         (WebCore::isHttpAuthentication):
519         (WebCore::isHttpNotModified):
520         (WebCore::isAppendableHeader):
521         (WebCore::removeLeadingAndTrailingQuotes):
522         (WebCore::getProtectionSpace):
523         (WebCore::headerCallback):
524         (WebCore::readCallback):
525         (WebCore::getFormElementsCount):
526         (WebCore::setupFormData):
527         (WebCore::ResourceHandle::setupPUT):
528         (WebCore::ResourceHandle::setupPOST):
529         (WebCore::ResourceHandle::handleDataURL):
530         (WebCore::ResourceHandle::dispatchSynchronousJob):
531         (WebCore::ResourceHandle::applyAuthentication):
532         (WebCore::ResourceHandle::initialize):
533         (WebCore::ResourceHandle::handleCurlMsg):
534         * platform/network/curl/ResourceHandleManager.cpp:
535         (WebCore::ResourceHandleManager::downloadTimerCallback):
536         (WebCore::ResourceHandleManager::startJob):
537         (WebCore::calculateWebTimingInformations): Deleted.
538         (WebCore::isHttpInfo): Deleted.
539         (WebCore::isHttpRedirect): Deleted.
540         (WebCore::isHttpAuthentication): Deleted.
541         (WebCore::isHttpNotModified): Deleted.
542         (WebCore::handleLocalReceiveResponse): Deleted.
543         (WebCore::writeCallback): Deleted.
544         (WebCore::isAppendableHeader): Deleted.
545         (WebCore::removeLeadingAndTrailingQuotes): Deleted.
546         (WebCore::getProtectionSpace): Deleted.
547         (WebCore::headerCallback): Deleted.
548         (WebCore::readCallback): Deleted.
549         (WebCore::getFormElementsCount): Deleted.
550         (WebCore::setupFormData): Deleted.
551         (WebCore::ResourceHandleManager::setupPUT): Deleted.
552         (WebCore::ResourceHandleManager::setupPOST): Deleted.
553         (WebCore::handleDataURL): Deleted.
554         (WebCore::ResourceHandleManager::dispatchSynchronousJob): Deleted.
555         (WebCore::ResourceHandleManager::applyAuthenticationToRequest): Deleted.
556         (WebCore::ResourceHandleManager::initializeHandle): Deleted.
557         * platform/network/curl/ResourceHandleManager.h:
558
559 2017-06-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
560
561         Async image decoding should be disabled for iBooks on tvOS
562         https://bugs.webkit.org/show_bug.cgi?id=173945
563
564         Reviewed by Simon Fraser.
565
566         The iBooks on tvOS is an AppStore application. We need to disable async
567         image decoding for iBooks on tvOS permanently through WebKit.
568
569         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
570         (WebCore::IOSApplication::isIBooks):
571         * platform/graphics/BitmapImage.cpp:
572         (WebCore::BitmapImage::updateFromSettings):
573
574 2017-06-29  Sam Weinig  <sam@webkit.org>
575
576         [WebIDL] Add a new extended attribute to model the forced return value optimization used on Node and Crypto
577         https://bugs.webkit.org/show_bug.cgi?id=173961
578
579         Reviewed by Darin Adler.
580
581         Node and Crypto were both using custom bindings to implement an optimization
582         for operations that always returned one one of the arguments passed in. The
583         optimization directly returns the JSValue argument, avoiding wrapping and 
584         unwrapping, and all the cache lookups that might entail. This allows that 
585         optimization to work without custom bindings by adding a new extended attribute
586         [ReturnValue] that can annotate an argument. When used, the implementation
587         function is expected to return either void or ExceptionOr<void>.
588
589         * CMakeLists.txt:
590         * WebCore.xcodeproj/project.pbxproj:
591         * bindings/js/JSBindingsAllInOne.cpp:
592         * bindings/js/JSCryptoCustom.cpp: Removed.
593         Remove JSCryptoCustom.cpp.
594
595         * bindings/js/JSNodeCustom.cpp:
596         (WebCore::JSNode::insertBefore): Deleted.
597         (WebCore::JSNode::replaceChild): Deleted.
598         (WebCore::JSNode::removeChild): Deleted.
599         (WebCore::JSNode::appendChild): Deleted.
600         Remove custom functions.
601
602         * bindings/scripts/CodeGeneratorJS.pm:
603         (OperationHasForcedReturnValue):
604         Add helper to determine if an operation has [ReturnValue] on any argument.
605
606         (NeedsExplicitPropagateExceptionCall):
607         We must treat operations with a [ReturnValue] argument like we do operations
608         returning void, and explicitly check for exceptions.
609
610         (GenerateParametersCheck):
611         Pull out the argument in a variable called 'returnValue' if it is annotated
612         with [ReturnValue].
613
614         (GenerateImplementationFunctionCall):
615         Special case operations with a [ReturnValue] argument to return the previously
616         set aside 'returnValue' variable.
617
618         * bindings/scripts/IDLAttributes.json:
619         Add [ReturnValue].
620
621         * bindings/scripts/test/JS/JSTestObj.cpp:
622         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationBody):
623         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimization):
624         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithExceptionBody):
625         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithException):
626         * bindings/scripts/test/TestObj.idl:
627         Add tests for [ReturnValue].
628
629         * dom/Node.idl:
630         * page/Crypto.idl:
631         Add [ReturnValue] annotations and remove [Custom] annotations.
632
633 2017-06-29  Chris Dumez  <cdumez@apple.com>
634
635         Unreviewed, rolling out r218944.
636
637         Optimization is incorrect
638
639         Reverted changeset:
640
641         "Avoid copying ResourceLoadStatistics objects"
642         https://bugs.webkit.org/show_bug.cgi?id=173972
643         http://trac.webkit.org/changeset/218944
644
645 2017-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
646
647         REGRESSION(r218896): ASSERT in WebPageProxy::dataCallback
648         https://bugs.webkit.org/show_bug.cgi?id=173968
649
650         Reviewed by Michael Catanzaro.
651
652         The problem is that WebPageProxy::getLoadDecisionForIcon() sends 0 as callback ID when the decision is to not
653         load the icon. Since r218896 we always notify the client even when the decision is to not load the icon, in
654         which case the UI doesn't really expect a callback. When WebPageProxy::dataCallback is called with a 0 callback ID,
655         CallbackMap::take() crashes in RELEASE_ASSERT(callbackID).
656
657         Fixes several GTK+ unit tests that are crashing.
658
659         * loader/DocumentLoader.cpp:
660         (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Return earlier if decision is false or frame is nullptr.
661         (WebCore::DocumentLoader::finishedLoadingIcon): Move RELEASE_ASSERT to notifyFinishedLoadingIcon().
662         (WebCore::DocumentLoader::notifyFinishedLoadingIcon): Assert if callbackIdentifier is 0 or m_frame is nullptr,
663         since it's no longer expected to happen.
664
665 2017-06-29  Chris Dumez  <cdumez@apple.com>
666
667         statistics.mostRecentUserInteraction should be of type WallTime
668         https://bugs.webkit.org/show_bug.cgi?id=173974
669
670         Reviewed by Brent Fulgham.
671
672         statistics.mostRecentUserInteraction should be of type WallTime for clarity.
673
674         * loader/ResourceLoadObserver.cpp:
675         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
676         (WebCore::ResourceLoadObserver::logUserInteraction):
677         (WebCore::ResourceLoadObserver::clearUserInteraction):
678         * loader/ResourceLoadStatistics.cpp:
679         (WebCore::ResourceLoadStatistics::encode):
680         (WebCore::ResourceLoadStatistics::decode):
681         (WebCore::ResourceLoadStatistics::toString):
682         (WebCore::ResourceLoadStatistics::merge):
683         * loader/ResourceLoadStatistics.h:
684         (WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime): Deleted.
685         * loader/ResourceLoadStatisticsStore.cpp:
686         (WebCore::shouldPartitionCookies):
687         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
688         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
689
690 2017-06-29  JF Bastien  <jfbastien@apple.com>
691
692         WebAssembly: disable some APIs under CSP
693         https://bugs.webkit.org/show_bug.cgi?id=173892
694         <rdar://problem/32914613>
695
696         Reviewed by Daniel Bates.
697
698         This does the basic separation of eval-blocked and
699         WebAssembly-blocked, but currently only blocks neither or both. I
700         think we'll eventually consider allowing one to be blocked but not
701         the other, so this separation makes sense and means that when we
702         want to do the change it'll be tiny. At a minimum we want a
703         different error message, which this patch provides (a lot of the
704         code ties blocking to the error message).
705
706         Tests: http/tests/security/contentSecurityPolicy/WebAssembly-allowed.html
707                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-about-blank-iframe.html
708                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-external-script.html
709                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-subframe.html
710                http/tests/security/contentSecurityPolicy/WebAssembly-blocked.html
711
712         * bindings/js/ScriptController.cpp:
713         (WebCore::ScriptController::enableWebAssembly):
714         (WebCore::ScriptController::disableWebAssembly):
715         * bindings/js/ScriptController.h:
716         * bindings/js/WorkerScriptController.cpp:
717         (WebCore::WorkerScriptController::disableWebAssembly):
718         * bindings/js/WorkerScriptController.h:
719         * dom/Document.cpp:
720         (WebCore::Document::disableWebAssembly):
721         * dom/Document.h:
722         * dom/ScriptExecutionContext.h:
723         * page/csp/ContentSecurityPolicy.cpp:
724         (WebCore::ContentSecurityPolicy::didCreateWindowProxy):
725         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext):
726         * page/csp/ContentSecurityPolicy.h:
727         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
728         (WebCore::ContentSecurityPolicyDirectiveList::create):
729         * page/csp/ContentSecurityPolicyDirectiveList.h:
730         (WebCore::ContentSecurityPolicyDirectiveList::webAssemblyDisabledErrorMessage):
731         (WebCore::ContentSecurityPolicyDirectiveList::setWebAssemblyDisabledErrorMessage):
732         * workers/WorkerGlobalScope.cpp:
733         (WebCore::WorkerGlobalScope::disableWebAssembly):
734         * workers/WorkerGlobalScope.h:
735
736 2017-06-29  Zalan Bujtas  <zalan@apple.com>
737
738         Make InlineBox::m_topLeft and m_logicalWidth protected.
739         https://bugs.webkit.org/show_bug.cgi?id=173973
740
741         Reviewed by Simon Fraser.
742
743         I don't think this reasoning from 10 years ago is valid anymore -> 
744           "FIXME: Would like to make this protected, but methods are accessing these members over in the part."
745         (comment was conveniently removed in a later commit).
746
747         No change in functionality.
748
749         * rendering/InlineBox.h:
750         (WebCore::InlineBox::InlineBox):
751
752 2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>
753
754         [iOS DnD] Adopt +objectWithItemProviderData: for serializing NSItemProviderReading-conformant objects
755         https://bugs.webkit.org/show_bug.cgi?id=173971
756         <rdar://problem/33006605>
757
758         Reviewed by Tim Horton.
759
760         Moves off of a very-recently-deprecated API, in favor of its replacement. Guarded by a runtime check and staging
761         declarations. No change in behavior.
762
763         * platform/ios/WebItemProviderPasteboard.mm:
764         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
765
766 2017-06-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
767
768         [Curl] Separate global curl settings from ResourceHandleManager as CurlContext class
769         https://bugs.webkit.org/show_bug.cgi?id=173629
770
771         Reviewed by Alex Christensen.
772
773         * PlatformWinCairo.cmake:
774         * platform/network/curl/CookieJarCurl.cpp:
775         (WebCore::setCookiesFromDOM):
776         (WebCore::cookiesForSession):
777         * platform/network/curl/CurlContext.cpp: Added.
778         (WebCore::certificatePath):
779         (WebCore::cookieJarPath):
780         (WebCore::CurlContext::CurlContext):
781         (WebCore::CurlContext::~CurlContext):
782         (WebCore::CurlContext::initCookieSession):
783         (WebCore::CurlContext::ProxyInfo::url):
784         (WebCore::CurlContext::setProxyInfo):
785         (WebCore::CurlContext::getEffectiveURL):
786         (WebCore::CurlContext::createMultiHandle):
787         (WebCore::CurlContext::mutexFor):
788         (WebCore::CurlContext::lock):
789         (WebCore::CurlContext::unlock):
790         * platform/network/curl/CurlContext.h: Added.
791         (WebCore::CurlContext::singleton):
792         (WebCore::CurlContext::curlShareHandle):
793         (WebCore::CurlContext::getCookieJarFileName):
794         (WebCore::CurlContext::setCookieJarFileName):
795         (WebCore::CurlContext::getCertificatePath):
796         (WebCore::CurlContext::shouldIgnoreSSLErrors):
797         (WebCore::CurlContext::proxyInfo):
798         (WebCore::CurlContext::setProxyInfo):
799         (WebCore::CurlContext::getLogFile):
800         (WebCore::CurlContext::isVerbose):
801         * platform/network/curl/CurlDownload.cpp:
802         (WebCore::CurlDownload::init):
803         (WebCore::CurlDownload::start):
804         (WebCore::CurlDownload::cancel):
805         (WebCore::CurlDownload::didReceiveHeader):
806         * platform/network/curl/CurlDownload.h:
807         * platform/network/curl/CurlJobManager.cpp: Renamed from Source/WebCore/platform/network/curl/CurlManager.cpp.
808         (WebCore::CurlJobManager::CurlJobManager):
809         (WebCore::CurlJobManager::~CurlJobManager):
810         (WebCore::CurlJobManager::add):
811         (WebCore::CurlJobManager::remove):
812         (WebCore::CurlJobManager::getActiveCount):
813         (WebCore::CurlJobManager::getPendingCount):
814         (WebCore::CurlJobManager::startThreadIfNeeded):
815         (WebCore::CurlJobManager::stopThread):
816         (WebCore::CurlJobManager::stopThreadIfIdle):
817         (WebCore::CurlJobManager::updateHandleList):
818         (WebCore::CurlJobManager::addToCurl):
819         (WebCore::CurlJobManager::removeFromCurl):
820         (WebCore::CurlJobManager::workerThread):
821         * platform/network/curl/CurlJobManager.h: Renamed from Source/WebCore/platform/network/curl/CurlManager.h.
822         (WebCore::CurlJobManager::singleton):
823         * platform/network/curl/ResourceHandleManager.cpp:
824         (WebCore::ResourceHandleManager::ResourceHandleManager):
825         (WebCore::ResourceHandleManager::~ResourceHandleManager):
826         (WebCore::handleLocalReceiveResponse):
827         (WebCore::getProtectionSpace):
828         (WebCore::headerCallback):
829         (WebCore::ResourceHandleManager::downloadTimerCallback):
830         (WebCore::ResourceHandleManager::initializeHandle):
831         (WebCore::certificatePath): Deleted.
832         (WebCore::cookieJarPath): Deleted.
833         (WebCore::ResourceHandleManager::setCookieJarFileName): Deleted.
834         (WebCore::ResourceHandleManager::getCookieJarFileName): Deleted.
835         (WebCore::ResourceHandleManager::setProxyInfo): Deleted.
836         (WebCore::ResourceHandleManager::initCookieSession): Deleted.
837         * platform/network/curl/ResourceHandleManager.h:
838         (): Deleted.
839
840 2017-06-29  Chris Dumez  <cdumez@apple.com>
841
842         Avoid copying ResourceLoadStatistics objects
843         https://bugs.webkit.org/show_bug.cgi?id=173972
844
845         Reviewed by Geoffrey Garen.
846
847         Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
848         to avoid such mistakes in the future.
849
850         * loader/ResourceLoadObserver.cpp:
851         (WebCore::ResourceLoadObserver::logFrameNavigation):
852         * loader/ResourceLoadStatistics.h:
853         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
854
855 2017-06-29  Antoine Quint  <graouts@apple.com>
856
857         Full stop shows to the right of the picture-in-picture localised string in Hebrew
858         https://bugs.webkit.org/show_bug.cgi?id=173966
859         <rdar://problem/32847376>
860
861         Reviewed by Dean Jackson.
862
863         We manually set the CSS "direction" property to "rtl" when we're not using an LTR language for a placard.
864
865         Test: media/modern-media-controls/placard/placard-ltr.html
866
867         * Modules/modern-media-controls/controls/placard.css:
868         (.media-controls:not(.uses-ltr-user-interface-layout-direction) .placard):
869
870 2017-06-29  Brent Fulgham  <bfulgham@apple.com>
871
872         Unreviewed Apple CMake build after r218901
873
874         I did not add 'cocoa/FileMonitorCocoa.mm' to the PlatformMac.cmake file as part of r218901.):
875
876         * PlatformMac.cmake:
877
878 2017-06-29  Frederic Wang  <fwang@igalia.com>
879
880         Small improvement of calls to RenderLayerBacking members
881         https://bugs.webkit.org/show_bug.cgi?id=173969
882
883         Reviewed by Simon Fraser.
884
885         No new tests, behavior unchanged.
886
887         * page/FrameView.cpp:
888         (WebCore::FrameView::tiledBacking): Access the member with RenderLayerBacking::tiledBacking.
889         (WebCore::FrameView::updateTilesForExtendedBackgroundMode): Ditto.
890         * rendering/RenderLayer.cpp:
891         (WebCore::RenderLayer::usesCompositedScrolling): Use RenderLayerBacking::hasScrollingLayer as
892         it better matches the intention of the check here.
893
894 2017-06-29  Romain Bellessort  <romain.bellessort@crf.canon.fr>
895
896         [Readable Streams API] Fix ReadableStream "strategy" argument handling
897         https://bugs.webkit.org/show_bug.cgi?id=172716
898
899         Reviewed by Xabier Rodriguez-Calvar.
900
901         Aligned default strategy parameter with spec, as defined in [1].
902         
903         [1] https://streams.spec.whatwg.org/#rs-constructor
904
905         Added new tests and updated some existing ones based on the newly
906         expected behavior. Also updated expectations for WPT streams tests.
907
908         * Modules/streams/ReadableStream.js:
909         (initializeReadableStream): Fixed initialization of strategy.
910
911 2017-06-29  Antti Koivisto  <antti@apple.com>
912
913         REGRESSION(r215347): NAS4Free Pop-down menus fail to appear
914         https://bugs.webkit.org/show_bug.cgi?id=173967
915         <rdar://problem/32690114>
916
917         Reviewed by Andreas Kling.
918
919         Menus on this configuration page operate by mutating visibility. We fail to trigger required
920         compositing updates when visibility changes on non-composited layer. Visibility of a non-composited
921         descendant may affect geometry of the composited ancestor layer.
922
923         Test: compositing/backing/non-composited-visibility-change.html
924
925         * rendering/RenderLayerCompositor.cpp:
926         (WebCore::RenderLayerCompositor::layerStyleChanged):
927         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer): Added.
928
929             Trigger compositing update for non-composited layers on visibility change.
930             Factor tests into function.
931
932         * rendering/RenderLayerCompositor.h:
933
934 2017-06-28  Frederic Wang  <fwang@igalia.com>
935
936         Align Document::canNavigate on the HTM5 specification
937         https://bugs.webkit.org/show_bug.cgi?id=173162
938
939         Reviewed by Chris Dumez.
940
941         Currently when a frame A with a sandboxed navigation flag tries and navigates another frame B
942         then Document::canNavigate verifies the cases where we try to navigate A's top frame (in
943         that case the allow-top-navigation flag is needed) or not (in that case, B must be a
944         descendant of A). This patch refines that a bit to check the case where B is a popup (in that
945         case navigation is permitted if A is the opener of B). This change aligns on the HTML5
946         specification and allows to pass more W3C Web Platform tests.
947         See https://html.spec.whatwg.org/multipage/browsers.html#allowed-to-navigate
948
949         Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html
950                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html
951
952         * dom/Document.cpp:
953         (WebCore::Document::canNavigate): This refines the case where the document's frame has the
954         sandbox navigation flag set in order to handle popup navigation. New comments referring to
955         the HTML5 specification are also added.
956
957 2017-06-28  Myles C. Maxfield  <mmaxfield@apple.com>
958
959         Only apply font features for the particular type of font they are being applied to
960         https://bugs.webkit.org/show_bug.cgi?id=172661
961         <rdar://problem/31534119>
962         <rdar://problem/32799624>
963
964         Reviewed by Simon Fraser.
965
966         There are two types of font formats which support features: AAT and OTF. Each of them has
967         a different idea about what the identity of a feature is. We were specifying both types
968         of feature identities to Core Text; however, this is causing Core Text to get confused.
969         Instead, we should only apply AAT features to AAT fonts and OTF features to OTF fonts.
970
971         Test: Un-marking these tests as failure on High Sierra:
972               css3/font-variant-petite-caps-synthesis-coverage.html
973               css3/font-variant-small-caps-synthesis-coverage.html
974
975         * platform/graphics/cocoa/FontCacheCoreText.cpp:
976         (WebCore::FontType::FontType):
977         (WebCore::preparePlatformFont):
978         (WebCore::variationCapabilitiesForFontDescriptor):
979         (WebCore::isGXVariableFont): Deleted.
980
981 2017-06-28  Chris Dumez  <cdumez@apple.com>
982
983         [ResourceLoadStatistics] Simplify PrevalentResourceTelemetry struct
984         https://bugs.webkit.org/show_bug.cgi?id=173953
985
986         Reviewed by Sam Weinig.
987
988         * loader/ResourceLoadStatisticsStore.cpp:
989         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
990         * loader/ResourceLoadStatisticsStore.h:
991         (WebCore::PrevalentResourceTelemetry::PrevalentResourceTelemetry): Deleted.
992
993 2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>
994
995         Crash in WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange
996         https://bugs.webkit.org/show_bug.cgi?id=173958
997
998         Reviewed by Simon Fraser.
999
1000         The crashed is most likely caused by updateLayersAfterAncestorChange calling [CALayer setPosition]
1001         with a CGPoint which contains the x coordinate or the y coordinate of NaN.
1002
1003         Simon and I inpected the code but we couldn't figure out how we get there. Detect this case and bail out.
1004         Also log the relevant values and debug assert when this condition is hit to help identifying the root cause.
1005
1006         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1007         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
1008
1009 2017-06-28  Chris Dumez  <cdumez@apple.com>
1010
1011         ResourceLoadObserver clean up
1012         https://bugs.webkit.org/show_bug.cgi?id=173955
1013
1014         Reviewed by Sam Weinig and Brent Fulgham.
1015
1016         ResourceLoadObserver clean up: Modernize code a bit and get rid of unused variables.
1017
1018         * loader/ResourceLoadObserver.cpp:
1019         (WebCore::ResourceLoadObserver::clearInMemoryStore):
1020         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
1021         (WebCore::ResourceLoadObserver::shouldLog):
1022         (WebCore::ResourceLoadObserver::logFrameNavigation):
1023         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1024         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1025         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1026         (WebCore::ResourceLoadObserver::logUserInteraction):
1027         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
1028         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
1029         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
1030         (WebCore::ResourceLoadObserver::fireDataModificationHandler):
1031         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
1032         (WebCore::ResourceLoadObserver::primaryDomain):
1033         (WebCore::ResourceLoadObserver::statisticsForOrigin):
1034
1035 2017-06-28  Zalan Bujtas  <zalan@apple.com>
1036
1037         Move RenderEmbeddedObject::isReplacementObscured to HTMLPlugInElement
1038         https://bugs.webkit.org/show_bug.cgi?id=173802
1039         <rdar://problem/32884389>
1040
1041         Reviewed by Simon Fraser.
1042
1043         Hittesting could potentially destroy "this" renderer so calling it inside RenderEmbeddedObject
1044         could leave the caller with a stale pointer.
1045         This patch protects the plugin element from getting destroyed and checks if the renderer got
1046         deleted during the hittest to avoid nullptr dereference.
1047
1048         Speculative fix.
1049
1050         * html/HTMLPlugInElement.cpp:
1051         (WebCore::HTMLPlugInElement::isReplacementObscured):
1052         * html/HTMLPlugInElement.h:
1053         * rendering/RenderEmbeddedObject.cpp:
1054         (WebCore::RenderEmbeddedObject::isReplacementObscured): Deleted.
1055         * rendering/RenderEmbeddedObject.h:
1056         * testing/Internals.cpp:
1057         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured):
1058
1059 2017-06-28  Chris Dumez  <cdumez@apple.com>
1060
1061         Avoid copying statistics in ResourceLoadStatisticsStore::readDataFromDecoder()
1062         https://bugs.webkit.org/show_bug.cgi?id=173951
1063
1064         Reviewed by Ryosuke Niwa.
1065
1066         * loader/ResourceLoadStatisticsStore.cpp:
1067         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
1068
1069 2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>
1070
1071         Safari's Speedometer score massively regresses when accessibility is enabled
1072         https://bugs.webkit.org/show_bug.cgi?id=173912
1073
1074         Reviewed by Chris Fleizach.
1075
1076         The bug was caused by HTMLTextFormControlElement::setInnerTextValue triggering a synchronous layout
1077         via constructing VisiblePosition when the accessibility tree is present.
1078
1079         Added AXObjectCache::postTextReplacementNotificationForTextControl which avoids the construction of
1080         VisiblePosition and other means of triggering a synchronous layout. This patch also fixes a subtle bug
1081         that HTMLTextFormControlElement was creating TextMarkerData with axID set to that of the text control
1082         element instead of the root editable element inside its shadow tree even though the typing command uses
1083         axID of the root editable element. While I couldn't find any user-visible behavioral change from this
1084         code change, new code is more self-consistent.
1085
1086         Also added LayoutDisallowedScope which asserts that no synchronous layout happens in setInnerTextValue
1087         so that we don't introduce a new performance regression like this in the future.
1088
1089         No new tests. Existing tests in accessibility directory covers this.
1090
1091         * CMakeLists.txt: Added LayoutDisallowedScope.cpp.
1092         * WebCore.xcodeproj/project.pbxproj: Ditto.
1093
1094         * accessibility/AXObjectCache.cpp:
1095         (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl): Added.
1096         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): Modernized. Returns optional<TextMarkerData>
1097         instead of taking TextMarkerData as an out-argument, and returning with axID of 0.
1098         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl): Added. This specialized version
1099         constructs TextMarkerData for the first position inside the editable region in a text control without
1100         triggering a synchronous layout.
1101
1102         * accessibility/AXObjectCache.h:
1103         (WebCore::TextMarkerData): Initialize each member automatically.
1104         (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl):
1105
1106         * accessibility/ios/AXObjectCacheIOS.mm:
1107         (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl): Added.
1108
1109         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1110         (+[WebAccessibilityTextMarker textMarkerWithVisiblePosition:cache:]):
1111
1112         * accessibility/mac/AXObjectCacheMac.mm:
1113         (WebCore::addTextMarkerFor): Extracted from textReplacementChangeDictionary. Added a new variant which
1114         takes a text form control instead.
1115         (WebCore::textReplacementChangeDictionary): Templatized this function to either take VisiblePosition
1116         and call textMarkerForVisiblePosition or take HTMLTextFormControlElement and call
1117         textMarkerForFirstPositionInTextControl.
1118         (WebCore::postUserInfoForChanges): Extracted from postTextReplacementPlatformNotification.
1119         (WebCore::AXObjectCache::postTextReplacementPlatformNotification): 
1120         (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl): Added.
1121
1122         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1123         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
1124
1125         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1126         (textMarkerForVisiblePosition):
1127         (-[WebAccessibilityObjectWrapper textMarkerForFirstPositionInTextControl:]): Added.
1128
1129         * dom/Document.cpp:
1130         (WebCore::Document::updateLayout): Assert that LayoutDisallowedScope is not in the stack frame.
1131
1132         * html/HTMLTextFormControlElement.cpp:
1133         (WebCore::HTMLTextFormControlElement::setInnerTextValue): Call postTextReplacementNotificationForTextControl
1134         to avoid triggering a synchronous layout. Also create LayoutDisallowedScope to avoid a similar performance
1135         regression from being introduced in the future in this function. Finally, made innerText a RefPtr for extra
1136         safety since we're using it after updating the DOM tree.
1137
1138         * rendering/LayoutDisallowedScope.cpp: Added.
1139         * rendering/LayoutDisallowedScope.h: Added.
1140         (WebCore::LayoutDisallowedScope::LayoutDisallowedScope):
1141         (WebCore::LayoutDisallowedScope::~LayoutDisallowedScope):
1142         (WebCore::LayoutDisallowedScope::isLayoutAllowed):
1143
1144 2017-06-27  Myles C. Maxfield  <mmaxfield@apple.com>
1145
1146         [iOS] Cannot italicize or bold text rendered with text styles
1147         https://bugs.webkit.org/show_bug.cgi?id=173634
1148
1149         Reviewed by Darin Adler.
1150
1151         r218616 enabled the new cascade list codepath for "system-ui," but didn't do it for the named
1152         text styles (like "font: -apple-system-tall-body;"). This new codepath is better because it
1153         correctly specifies weights and italics (using kCTFontWeightTrait and kCTFontSlantTrait) instead
1154         of using symbolic traits, and because it correctly handles fonts in the Core Text fallback chain.
1155         This patch migrates the named text styles to this new codepath.
1156
1157         Test: fast/text/ipad/bold-tall-body-text-style.html
1158
1159         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1160         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
1161         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
1162         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
1163         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
1164         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash):
1165         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal):
1166         (WebCore::SystemFontDatabase::systemFontCascadeList):
1167         (WebCore::convertArray):
1168         (WebCore::convertArray):
1169         (WebCore::makeNeverDestroyed):
1170         (WebCore::isUIFontTextStyle):
1171         (WebCore::systemFontParameters):
1172         (WebCore::FontCascadeDescription::effectiveFamilyCount):
1173         (WebCore::FontCascadeDescription::effectiveFamilyAt):
1174         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash): Deleted.
1175         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal): Deleted.
1176         * platform/graphics/ios/FontCacheIOS.mm:
1177         (WebCore::platformFontWithFamilySpecialCase):
1178
1179 2017-06-28  Devin Rousso  <drousso@apple.com>
1180
1181         Web Inspector: Instrument active pixel memory used by canvases
1182         https://bugs.webkit.org/show_bug.cgi?id=173087
1183         <rdar://problem/32719261>
1184
1185         Reviewed by Joseph Pecoraro.
1186
1187         Test: inspector/canvas/memory.html
1188
1189         * html/HTMLCanvasElement.cpp:
1190         (WebCore::HTMLCanvasElement::setImageBuffer):
1191         * inspector/InspectorCanvasAgent.h:
1192         * inspector/InspectorCanvasAgent.cpp:
1193         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
1194         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
1195         * inspector/InspectorInstrumentation.h:
1196         * inspector/InspectorInstrumentation.cpp:
1197         (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
1198         (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
1199
1200 2017-06-28  Alex Christensen  <achristensen@webkit.org>
1201
1202         Prevent displaying URLs with small capital letters
1203         https://bugs.webkit.org/show_bug.cgi?id=173949
1204         <rdar://problem/32952058>
1205
1206         Reviewed by Brent Fulgham.
1207
1208         Covered by new API tests.
1209
1210         * platform/mac/WebCoreNSURLExtras.mm:
1211         (WebCore::isLookalikeCharacter):
1212
1213 2017-06-28  Youenn Fablet  <youenn@apple.com>
1214
1215         Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
1216         https://bugs.webkit.org/show_bug.cgi?id=169389
1217
1218         Reviewed by Alex Christensen.
1219
1220         Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
1221         Previously, we were creating a libwebrtc peer connection and then setting its configuration.
1222         libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
1223         Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.
1224
1225         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1226         (WebCore::MediaEndpointPeerConnection::setConfiguration):
1227         * Modules/mediastream/MediaEndpointPeerConnection.h:
1228         * Modules/mediastream/PeerConnectionBackend.h:
1229         * Modules/mediastream/RTCPeerConnection.cpp:
1230         (WebCore::RTCPeerConnection::initializeWith):
1231         (WebCore::iceServersFromConfiguration):
1232         (WebCore::RTCPeerConnection::initializeConfiguration):
1233         (WebCore::RTCPeerConnection::setConfiguration):
1234         * Modules/mediastream/RTCPeerConnection.h:
1235         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1236         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1237         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
1238         (WebCore::LibWebRTCMediaEndpoint::stop):
1239         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1240         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1241         (WebCore::configurationFromMediaEndpointConfiguration):
1242         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
1243         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1244         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1245         (WebCore::createActualPeerConnection):
1246         (WebCore::LibWebRTCProvider::createPeerConnection):
1247         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1248
1249 2017-06-28  Brent Fulgham  <bfulgham@apple.com>
1250
1251         Teach ResourceLoadStatistics to recognize changes in the file system
1252         https://bugs.webkit.org/show_bug.cgi?id=173800
1253         <rdar://problem/32937842>
1254
1255         Reviewed by Chris Dumez.
1256
1257         We want to support the case where multiple UI processes choose to share the same
1258         statistics file. To support this, update the ResourceLoadStatistics logic to be aware
1259         that the statistics data file might change underneath it, and to take appropriate
1260         action when it does.
1261
1262         * WebCore.xcodeproj/project.pbxproj: Update for new sources.
1263         * WebCore/CMakeLists.txt: Update for new FileMonitor source file.
1264         * loader/ResourceLoadStatisticsStore.cpp:
1265         (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Use the new deletion
1266         handler for the data file instead of writing out an empty file.
1267         (WebCore::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Added.
1268         * loader/ResourceLoadStatisticsStore.h:
1269         * platform/FileMonitor.cpp: Added.
1270         (WebCore::FileMonitor::create):
1271         (WebCore::FileMonitor::FileMonitor): Register handlers and begin monitoring file.
1272         (WebCore::FileMonitor::~FileMonitor): Stop any active file monitoring.
1273         (WebCore::FileMonitor::startMonitoringPath): Stub implementation.
1274         (WebCore::FileMonitor::stopMonitoring): Ditto.
1275         * platform/FileMonitor.h: Added.
1276         * platform/FileSystem.h: Export files needed by WebKit2. Add support for O_EVTONLY
1277         Darwin file handles.
1278         * platform/Logging.h: Add 'ResourceLoadStatistics' category.
1279         * platform/cocoa/FileMonitorCocoa.mm: Added.
1280         (WebCore::FileMonitor::startMonitoringPath): Create a new VNODE type dispatch_source
1281         to receive notifications when the specified file changes.
1282         (WebCore::FileMonitor::stopMonitoring): Cancel the dispatch_source when we are done
1283         monitoring the file.
1284         * platform/posix/FileSystemPOSIX.cpp: Update 'openFile' to understand the O_EVTONLY
1285         mode of file handles (Darwin-only). 
1286
1287 2017-06-28  Brady Eidson  <beidson@apple.com>
1288
1289         DocumentLoader should always notify the client if there are pending icon loads when the load is stopped.
1290         https://bugs.webkit.org/show_bug.cgi?id=173874
1291
1292         Reviewed by Alex Christensen.
1293
1294         Covered by API tests.
1295
1296         Patch started by Carlos Garcia Campos, finished by me.
1297         
1298         * loader/DocumentLoader.cpp:
1299         (WebCore::DocumentLoader::stopLoading): Make all of the callbacks for cancelled IconLoaders.
1300         (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Make the callback even if there's no IconLoader.
1301         (WebCore::DocumentLoader::finishedLoadingIcon):
1302         (WebCore::DocumentLoader::notifyFinishedLoadingIcon):
1303         * loader/DocumentLoader.h:
1304
1305 2017-06-28  Antoine Quint  <graouts@apple.com>
1306
1307         Volume controls should be hidden when AirPlay is active
1308         https://bugs.webkit.org/show_bug.cgi?id=173933
1309         <rdar://problem/33011931>
1310
1311         Reviewed by Dean Jackson.
1312
1313         Ensure we don't show any volume controls during AirPlay. We set the mute button's enabled state to "false"
1314         when AirPlay is active and key off this enabled stated to control the display of all volume-related controls
1315         throughout the UI.
1316
1317         Tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-controls-hidden-when-mute-button-disabled.html
1318                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled.html
1319
1320         * Modules/modern-media-controls/controls/inline-media-controls.js:
1321         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
1322         (InlineMediaControls):
1323         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1324         (MacOSFullscreenMediaControls.prototype.layout):
1325         * Modules/modern-media-controls/media/airplay-support.js:
1326         (AirplaySupport.prototype.syncControl):
1327         (AirplaySupport):
1328
1329 2017-06-28  Konstantin Tokarev  <annulen@yandex.ru>
1330
1331         Remove excessive includes from WebCore/css sources
1332         https://bugs.webkit.org/show_bug.cgi?id=173919
1333
1334         Reviewed by Simon Fraser.
1335
1336         No new tests needed.
1337
1338         * css/CSSCanvasValue.cpp:
1339         * css/CSSComputedStyleDeclaration.cpp:
1340         * css/CSSContentDistributionValue.cpp:
1341         * css/CSSCrossfadeValue.cpp:
1342         * css/CSSCursorImageValue.cpp:
1343         * css/CSSCustomPropertyValue.cpp:
1344         * css/CSSDefaultStyleSheets.cpp:
1345         * css/CSSFilterImageValue.cpp:
1346         * css/CSSFontFace.cpp:
1347         * css/CSSFontFaceSet.cpp:
1348         * css/CSSFontFaceSource.cpp:
1349         * css/CSSFontFaceSrcValue.cpp:
1350         * css/CSSFontFeatureValue.cpp:
1351         * css/CSSFontSelector.cpp:
1352         * css/CSSFontValue.cpp:
1353         * css/CSSImageGeneratorValue.cpp:
1354         * css/CSSImageSetValue.cpp:
1355         * css/CSSImageValue.cpp:
1356         * css/CSSImportRule.cpp:
1357         * css/CSSKeyframesRule.cpp:
1358         * css/CSSMediaRule.cpp:
1359         * css/CSSNamedImageValue.cpp:
1360         * css/CSSPrimitiveValue.cpp:
1361         * css/CSSProperty.cpp:
1362         * css/CSSPropertySourceData.cpp:
1363         * css/CSSReflectValue.cpp:
1364         * css/CSSRuleList.cpp:
1365         * css/CSSSegmentedFontFace.cpp:
1366         * css/CSSSelector.cpp:
1367         * css/CSSStyleRule.cpp:
1368         * css/CSSStyleSheet.cpp:
1369         * css/CSSSupportsRule.cpp:
1370         * css/CSSToStyleMap.cpp:
1371         * css/CSSValueList.cpp:
1372         * css/CSSValuePool.cpp:
1373         * css/CSSVariableData.cpp:
1374         * css/ElementRuleCollector.cpp:
1375         * css/InspectorCSSOMWrappers.cpp:
1376         * css/MediaList.cpp:
1377         * css/MediaQueryEvaluator.cpp:
1378         * css/MediaQueryExpression.cpp:
1379         * css/PropertySetCSSStyleDeclaration.cpp:
1380         * css/RGBColor.cpp:
1381         * css/SelectorChecker.cpp:
1382         * css/StyleProperties.cpp:
1383         * css/StyleResolver.cpp:
1384         * css/StyleRule.cpp:
1385         * css/StyleSheetContents.cpp:
1386         * css/TransformFunctions.cpp:
1387         * css/ViewportStyleResolver.cpp:
1388         * css/WebKitCSSRegionRule.cpp:
1389         * css/parser/CSSParser.cpp:
1390         * css/parser/CSSParserFastPaths.cpp:
1391         * css/parser/CSSParserIdioms.cpp:
1392         * css/parser/CSSParserSelector.cpp:
1393         * css/parser/CSSParserToken.cpp:
1394         * css/parser/CSSPropertyParser.cpp:
1395         * css/parser/CSSSelectorParser.cpp:
1396         * css/parser/MediaQueryParser.cpp:
1397
1398 2017-06-28  Alex Christensen  <achristensen@webkit.org>
1399
1400         Fix CMake build.
1401
1402         * PlatformMac.cmake:
1403
1404 2017-06-28  Antoine Quint  <graouts@apple.com>
1405
1406         Remove unnecessary `const double` method arguments
1407         https://bugs.webkit.org/show_bug.cgi?id=173925
1408
1409         Reviewed by Dean Jackson.
1410
1411         Addressing post-landing feedback from webkit.org/b/173858.
1412
1413         * Modules/mediacontrols/MediaControlsHost.cpp:
1414         (WebCore::MediaControlsHost::formattedStringForDuration):
1415         * Modules/mediacontrols/MediaControlsHost.h:
1416         * rendering/RenderTheme.h:
1417         (WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
1418         * rendering/RenderThemeCocoa.h:
1419
1420 2017-06-28  Zalan Bujtas  <zalan@apple.com>
1421
1422         Unreviewed, rolling out r218373.
1423
1424         Output is not right
1425
1426         Reverted changeset:
1427
1428         "Use WTFLogAlways for debug logging so that it shows up in
1429         device system logs"
1430         https://bugs.webkit.org/show_bug.cgi?id=173450
1431         http://trac.webkit.org/changeset/218373
1432
1433 2017-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1434
1435         [GTK] Some web pages disappear immediately after rendering
1436         https://bugs.webkit.org/show_bug.cgi?id=173768
1437
1438         Reviewed by Xabier Rodriguez-Calvar.
1439
1440         This is happening with websites having a "hidden" class in HTML tag when a media element is added. In the GTK+
1441         port the media controls CSS contains the following code:
1442
1443         .hidden {
1444             display: none !important;
1445         }
1446
1447         That causes the whole HTML document to become display: none. That's why we just render a white page, and also
1448         the reason why it only happens with the GTK+ port and only with some specific websites. We should limit the
1449         scope of the hidden class to the media control elements.
1450
1451         * css/mediaControlsGtk.css:
1452         (audio::-webkit-media-controls-panel.hidden,):
1453         (audio::-webkit-media-controls-panel div.mute-box.hidden,):
1454         (audio::-webkit-media-controls-current-time-display.hidden,):
1455         (audio::-webkit-media-controls-timeline.hidden,):
1456         (audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button):
1457         (audio::-webkit-media-controls-toggle-closed-captions-button.hidden,):
1458         (video::-webkit-media-controls-closed-captions-container.hidden):
1459         (audio::-webkit-media-controls-fullscreen-button.hidden,):
1460         (.hidden): Deleted.
1461
1462 2017-06-28  Antoine Quint  <graouts@apple.com>
1463
1464         Media controls volume glyph does not have the correct material
1465         https://bugs.webkit.org/show_bug.cgi?id=173918
1466         <rdar://problem/33012697>
1467
1468         Reviewed by Eric Carlson.
1469
1470         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-mute-button-in-bottom-or-top-right-controls-bar.html
1471
1472         All buttons were hosted in a ControlsBar save for the MuteButton, so we now host it in a controls bar as well
1473         to ensure compositing is similar to all other buttons.
1474
1475         * Modules/modern-media-controls/controls/inline-media-controls.css:
1476         (.media-controls.inline > .controls-bar.top-right):
1477         (.media-controls.inline > button.mute): Deleted.
1478         * Modules/modern-media-controls/controls/inline-media-controls.js:
1479         (InlineMediaControls):
1480         (InlineMediaControls.prototype.layout):
1481         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
1482         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1483         (MacOSInlineMediaControls.prototype.handleEvent):
1484
1485 2017-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1486
1487         REGRESSION(r218799): [GTK][WPE] Critical warning at exit
1488         https://bugs.webkit.org/show_bug.cgi?id=173907
1489
1490         Reviewed by Konstantin Tokarev.
1491
1492         GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
1493
1494         This is now always happening when closing the MeiniBrowser and it's causing a lot of unit tests to fail. In
1495         r218799, GRefPtrGtk.h include was removed from PasteboardHelper.h that contains a GRefPtr<GtkTargetList>. The
1496         targets are destroyed at exit, but now trying to use g_object_unref instead of gtk_target_list_unref(). I've
1497         found two more cases like this in r218799, that removes GUniquePtrSoup.h from ResourceHandleInternal.h and
1498         ResourceRequest.h that have GUniquePtr<SoupBuffer> and GUniquePtr<SoupURI>.
1499
1500         Fixes several GTK+ and WPE unit tests.
1501
1502         * platform/gtk/PasteboardHelper.h: Bring back GRefPtrGtk.h.
1503         * platform/network/ResourceHandleInternal.h: Bring back GUniquePtrSoup.h.
1504         * platform/network/soup/ResourceRequest.h: Ditto.
1505
1506 2017-06-27  Chris Dumez  <cdumez@apple.com>
1507
1508         [ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute
1509         https://bugs.webkit.org/show_bug.cgi?id=173895
1510         <rdar://problem/32984366>
1511
1512         Reviewed by Brent Fulgham.
1513
1514         Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute to save battery.
1515         Also port code to modern time types.
1516
1517         * loader/ResourceLoadObserver.cpp:
1518         (WebCore::reduceTimeResolution):
1519         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1520         (WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
1521         (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
1522         (WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval):
1523         (WebCore::ResourceLoadObserver::setReducedTimestampResolution):
1524         (WebCore::ResourceLoadObserver::setGrandfatheringTime):
1525         * loader/ResourceLoadObserver.h:
1526         * loader/ResourceLoadStatistics.h:
1527         (WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime):
1528         * loader/ResourceLoadStatisticsStore.cpp:
1529         (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
1530         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
1531         (WebCore::shouldPartitionCookies):
1532         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1533         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
1534         (WebCore::ResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
1535         (WebCore::ResourceLoadStatisticsStore::setGrandfatheringTime):
1536         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
1537         (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1538         (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
1539         (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
1540         (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
1541         * loader/ResourceLoadStatisticsStore.h:
1542
1543 2017-06-27  Chris Dumez  <cdumez@apple.com>
1544
1545         Port HysteresisActivity to Seconds type
1546         https://bugs.webkit.org/show_bug.cgi?id=173902
1547
1548         Reviewed by Simon Fraser.
1549
1550         * platform/HysteresisActivity.h:
1551         (WebCore::HysteresisActivity::HysteresisActivity):
1552         (WebCore::HysteresisActivity::stop):
1553         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
1554
1555 2017-06-27  Jeremy Jones  <jeremyj@apple.com>
1556
1557         MediaPlayerPrivate m_private may not yet be created when setPrivateBrowsingMode is called.
1558         https://bugs.webkit.org/show_bug.cgi?id=173893
1559         rdar://problem/32986872
1560         
1561         Reviewed by Ryosuke Niwa.
1562
1563         No new tests because no reproducable case.
1564
1565         setPrivateBrowsingMode can be called on MediaPlayer before the MediaPlayerPrivate is created.
1566         The value should only be pushed down the m_private if it has been created.
1567
1568         * platform/graphics/MediaPlayer.cpp:
1569         (WebCore::MediaPlayer::setPrivateBrowsingMode):
1570
1571 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1572
1573         [iOS DnD] Support dragging out of contenteditable areas without a prior selection
1574         https://bugs.webkit.org/show_bug.cgi?id=173854
1575         <rdar://problem/32236827>
1576
1577         Reviewed by Ryosuke Niwa and Tim Horton.
1578
1579         Allows elements to be dragged from contenteditable areas for both WebKit1 and WebKit2 iOS. There are two main
1580         changes in WebCore: move the touch point adjustment code into EventHandler::tryToBeginDataInteractionAtPoint, so
1581         that the clientPosition specified will be adjusted to an appropriate clickable node if needed. This is necessary
1582         because UIWebDocumentView and WKContentView no longer send adjusted points to WebCore when requesting drag
1583         start. See <https://bugs.webkit.org/show_bug.cgi?id=173855> for a followup regarding the globalPosition and
1584         clientPositions passed in to the MouseEvents when performing a drag or synthetic click.
1585
1586         Secondly, image elements in Mail's contenteditable area are not draggable unless the heuristic in
1587         DragController::draggableElement is tweaked to not reject image dragging across the board if the
1588         loadsImagesAutomatically setting is turned off. Instead, even if images are not automatically loaded, allow the
1589         image drag to commence if the image renderer already has a cached image.
1590
1591         Test: DataInteractionTests.DragImageFromContentEditable
1592
1593         * page/DragController.cpp:
1594         (WebCore::imageElementIsDraggable):
1595         (WebCore::DragController::draggableElement):
1596         * page/ios/EventHandlerIOS.mm:
1597         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
1598
1599 2017-06-27  Antoine Quint  <graouts@apple.com>
1600
1601         [Modern Media Controls] Accessibility labels should be formatted using NSDateComponentsFormatter
1602         https://bugs.webkit.org/show_bug.cgi?id=173858
1603         <rdar://problem/32643171>
1604
1605         Reviewed by Dean Jackson.
1606
1607         We shouldn't be manually trying to create a formatted string for media controls and instead rely
1608         on NSDateComponentsFormatter to perform this task for us. So we remove the ad-hoc code in the JS
1609         media controls code and instead add a new MediaControlsHost method to format durations which calls
1610         into RenderTheme to provide a formatted duration string relevant to the current platform and locale.
1611
1612         * English.lproj/modern-media-controls-localized-strings.js:
1613         * Modules/mediacontrols/MediaControlsHost.cpp:
1614         (WebCore::MediaControlsHost::formattedStringForDuration):
1615         * Modules/mediacontrols/MediaControlsHost.h:
1616         * Modules/mediacontrols/MediaControlsHost.idl:
1617         * Modules/modern-media-controls/controls/slider.js:
1618         (Slider.prototype.set inputAccessibleLabel):
1619         * Modules/modern-media-controls/controls/time-label.js:
1620         (TimeLabel.prototype.commitProperty):
1621         * Modules/modern-media-controls/main.js:
1622         (createControls):
1623         (formattedStringForDuration):
1624         (formatTimeToString): Deleted.
1625         * rendering/RenderTheme.h:
1626         (WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
1627         * rendering/RenderThemeCocoa.h:
1628         * rendering/RenderThemeCocoa.mm:
1629         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
1630
1631 2017-06-27  Eric Carlson  <eric.carlson@apple.com>
1632
1633         r218647 causes getUserMedia to fail on some machines
1634         https://bugs.webkit.org/show_bug.cgi?id=173894
1635
1636         Reviewed by Youenn Fablet.
1637
1638         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1639         (WebCore::AVVideoCaptureSource::isFrameRateSupported): Change frame rate epsilon from 0.00001
1640         to 0.001.
1641
1642 2017-06-27  Antoine Quint  <graouts@apple.com>
1643
1644         Placard icons act like buttons (can get keyboard focus and shows up in VoiceOver)
1645         https://bugs.webkit.org/show_bug.cgi?id=173891
1646         <rdar://problem/33011855>
1647
1648         Reviewed by Dean Jackson.
1649
1650         Ensure that we disable buttons inside placards as they're only decorative and should
1651         not be interactive.
1652
1653         * Modules/modern-media-controls/controls/placard.js:
1654         (Placard.):
1655
1656 2017-06-27  Jeremy Jones  <jeremyj@apple.com>
1657
1658         Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
1659         https://bugs.webkit.org/show_bug.cgi?id=173843
1660         rdar://problem/32982431
1661
1662         Reviewed by Eric Carlson.
1663
1664         Test: media/media-fullscreen-pause-inline.html
1665
1666         Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.
1667
1668         * html/HTMLMediaElement.cpp:
1669         (WebCore::HTMLMediaElement::pause):
1670
1671 2017-06-27  Chris Dumez  <cdumez@apple.com>
1672
1673         [iOS] Avoid taking / releasing process assertions too quickly due to database activity
1674         https://bugs.webkit.org/show_bug.cgi?id=173879
1675         <rdar://problem/32412701>
1676
1677         Reviewed by Antti Koivisto.
1678
1679         Add HysteresisActivity to WebSQLiteDatabaseTrackerClient to avoid taking / releasing
1680         process assertion too quickly due to database activity.
1681
1682         * platform/ios/WebSQLiteDatabaseTrackerClient.h:
1683         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
1684         (WebCore::WebSQLiteDatabaseTrackerClient::WebSQLiteDatabaseTrackerClient):
1685         (WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction):
1686         (WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction):
1687         (WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):
1688
1689 2017-06-27  Youenn Fablet  <youenn@apple.com>
1690
1691         Using public logging for WebRTC release logging
1692         https://bugs.webkit.org/show_bug.cgi?id=173881
1693
1694         Reviewed by Eric Carlson.
1695
1696         No change of behavior.
1697
1698         * Modules/mediastream/PeerConnectionBackend.cpp:
1699         (WebCore::PeerConnectionBackend::createOfferSucceeded):
1700         (WebCore::PeerConnectionBackend::createOfferFailed):
1701         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
1702         (WebCore::PeerConnectionBackend::createAnswerFailed):
1703         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
1704         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
1705         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1706         (WebCore::PeerConnectionBackend::newICECandidate):
1707         * Modules/mediastream/RTCPeerConnection.cpp:
1708         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
1709         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
1710         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
1711         (WebCore::RTCPeerConnection::updateIceGatheringState):
1712         (WebCore::RTCPeerConnection::updateIceConnectionState):
1713         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1714         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
1715
1716 2017-06-27  Don Olmstead  <don.olmstead@sony.com>
1717
1718         [PAL] Add symbol export macros for PAL
1719         https://bugs.webkit.org/show_bug.cgi?id=171519
1720
1721         Reviewed by Konstantin Tokarev.
1722
1723         No new tests. No change in behavior.
1724
1725         * CMakeLists.txt:
1726         * config.h:
1727         * platform/PlatformExportMacros.h:
1728
1729 2017-06-27  John Wilander  <wilander@apple.com>
1730
1731         Resource Load Statistics: Add telemetry
1732         https://bugs.webkit.org/show_bug.cgi?id=173499
1733         <rdar://problem/32826094>
1734
1735         Reviewed by Brent Fulgham.
1736
1737         Test: http/tests/loading/resourceLoadStatistics/telemetry-generation.html
1738
1739         * loader/ResourceLoadObserver.cpp:
1740         (WebCore::ResourceLoadObserver::fireTelemetryHandler):
1741             Test infrastructure.
1742         * loader/ResourceLoadObserver.h:
1743         * loader/ResourceLoadStatisticsStore.cpp:
1744         (WebCore::ResourceLoadStatisticsStore::setFireTelemetryCallback):
1745         (WebCore::ResourceLoadStatisticsStore::fireTelemetryHandler):
1746             Test infrastructure.
1747         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
1748             Convenience function for telemetry.
1749         * loader/ResourceLoadStatisticsStore.h:
1750             Added struct WebCore::PrevalentResourceTelemetry.
1751         * page/DiagnosticLoggingKeys.cpp:
1752         (WebCore::DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey):
1753             Added.
1754         * page/DiagnosticLoggingKeys.h:
1755
1756 2017-06-27  Ting-Wei Lan  <lantw44@gmail.com>
1757
1758         Add missing includes to fix compilation error on FreeBSD
1759         https://bugs.webkit.org/show_bug.cgi?id=172919
1760
1761         Reviewed by Mark Lam.
1762
1763         No new tests needed.
1764
1765         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1766         * platform/audio/ReverbAccumulationBuffer.cpp:
1767
1768 2017-06-27  Zalan Bujtas  <zalan@apple.com>
1769
1770         Add RenderEmbeddedObject::getReplacementTextGeometry helper.
1771         https://bugs.webkit.org/show_bug.cgi?id=173847
1772
1773         Reviewed by Simon Fraser.
1774
1775         ...and remove getReplacementTextGeometry's redundant return value. 
1776
1777         No change in functionality.
1778
1779         * rendering/RenderEmbeddedObject.cpp:
1780         (WebCore::RenderEmbeddedObject::paintReplaced):
1781         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
1782         (WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
1783         (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
1784         * rendering/RenderEmbeddedObject.h:
1785
1786 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1787
1788         Refactor drag start codepaths to plumb a DragItem to client layers
1789         https://bugs.webkit.org/show_bug.cgi?id=173832
1790         Work towards <rdar://problem/32236827>
1791
1792         Reviewed by Ryosuke Niwa and Tim Horton.
1793
1794         Refactor drag start logic in WebCore to set up a DragItem and propagate it to WebDragClient. No change in behavior.
1795
1796         * loader/EmptyClients.cpp:
1797         * page/DragClient.h:
1798         * page/DragController.cpp:
1799         (WebCore::DragController::startDrag):
1800         (WebCore::DragController::doImageDrag):
1801         (WebCore::DragController::doSystemDrag):
1802
1803         Refactor to pass along a DragItem. Also, remove unused drag image anchor computation.
1804
1805         * page/DragController.h:
1806         * platform/DragImage.h:
1807         * platform/DragItem.h:
1808
1809         Add additional information needed to begin a drag on iOS.
1810
1811         (WebCore::DragItem::encode):
1812         (WebCore::DragItem::decode):
1813
1814         Add IPC serialization/deserialization support for DragItem.
1815
1816         * platform/PasteboardWriterData.cpp:
1817         (WebCore::PasteboardWriterData::isEmpty):
1818         * platform/PasteboardWriterData.h:
1819
1820 2017-06-27  Frederic Wang  <fwang@igalia.com>
1821
1822         Some tests to verify forbidden frame navigation time out
1823         https://bugs.webkit.org/show_bug.cgi?id=173657
1824
1825         Reviewed by Chris Dumez.
1826
1827         Currently some tests try and perform a forbidden frame navigation and verify the
1828         corresponding console error. However, WebKit does not raise any exception for such error so
1829         the tests have to wait until the timeout limit to complete, which makes execution slow.
1830         This patch modifies the setters of window.location for which such error may happen in order
1831         to raise an exception so the tests behave as expected.
1832
1833         No new tests, already covered by existing tests.
1834
1835         * page/Location.cpp: Adjust Location::setLocation to return a security exception and pass it
1836         to the callers.
1837         (WebCore::Location::setHref): Adjust function to possibly return an exception.
1838         (WebCore::Location::setProtocol): Ditto.
1839         (WebCore::Location::setHost): Ditto.
1840         (WebCore::Location::setHostname): Ditto.
1841         (WebCore::Location::setPort): Ditto.
1842         (WebCore::Location::setPathname): Ditto.
1843         (WebCore::Location::setSearch): Ditto.
1844         (WebCore::Location::setHash): Ditto.
1845         (WebCore::Location::assign): Ditto.
1846         (WebCore::Location::setLocation): FrameLoader::findFrameForNavigation is really only used
1847         to verify whether navigating m_frame is permitted so it is more simple and clearer to do it
1848         directly. When navigation is not permitted, this function now raises a security exception.
1849         * page/Location.h: Modify some setters to return an ExceptionOr<void>.
1850         * page/Location.idl: Allow some setters to raise an exception.
1851
1852 2017-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>
1853
1854         [GTK] Layout Test webrtc/video.html issues "stack smashing detected"
1855         https://bugs.webkit.org/show_bug.cgi?id=173862
1856
1857         Reviewed by Carlos Garcia Campos.
1858
1859         Tests: webrtc/video.html
1860
1861         Passing a bool variable to g_object_get causes out-of-bound write.
1862         gboolean should be used, which is 4 bytes while bool is one byte.
1863
1864         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1865         (WebCore::MediaPlayerPrivateGStreamerBase::muted): Use gboolean instead of bool.
1866         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1867         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): Ditto.
1868
1869 2017-06-26  Chris Dumez  <cdumez@apple.com>
1870
1871         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient
1872         https://bugs.webkit.org/show_bug.cgi?id=173850
1873
1874         Reviewed by Ryosuke Niwa.
1875
1876         * loader/ResourceLoadStatisticsStore.cpp:
1877         (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
1878         * loader/ResourceLoadStatisticsStore.h:
1879
1880 2017-06-26  Antti Koivisto  <antti@apple.com>
1881
1882         REGRESSION (AsyncImageDecoding): A tab with the WWDC keynote paused is killed for using excessive power (Image thrashing)
1883         https://bugs.webkit.org/show_bug.cgi?id=173804
1884         <rdar://problem/32623745>
1885
1886         Reviewed by Simon Fraser.
1887
1888         When under memory pressure MemoryCache::singleton().pruneLiveResources(true) is called inFrameView::didPaintContents()
1889         after top level paint. We end up decoding and pruning bitmaps repeatedly for each tile, which is not great.
1890
1891         Situation gets worse with async decoding. Painting now doesn’t actually decode the image, it just starts the decoding.
1892         When it completes we trigger another paint to get the bits to the tiles. The paint for the first tile then calls
1893         pruneLiveResources and loses the bitmap and the second tile triggers another round of async decoding. We have code
1894         that prevents pruning of visible images but non-visible images in tiling area can hit this bug easily.
1895
1896         Test: fast/images/low-memory-decode.html
1897
1898         * page/FrameView.cpp:
1899         (WebCore::FrameView::willPaintContents):
1900         (WebCore::FrameView::didPaintContents):
1901
1902             Eliminate synchronous pruning during painting. This is an obsolete mechanism from early iOS times.
1903
1904         * platform/graphics/BitmapImage.cpp:
1905         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
1906         (WebCore::BitmapImage::decodeCountForTesting):
1907
1908             Testing support.
1909
1910         * platform/graphics/BitmapImage.h:
1911         * testing/Internals.cpp:
1912         (WebCore::Internals::imageDecodeCount):
1913         * testing/Internals.h:
1914         * testing/Internals.idl:
1915
1916 2017-06-26  Chris Dumez  <cdumez@apple.com>
1917
1918         ImageFrameCache::startAsyncDecodingQueue() unsafely passes Strings across threads
1919         https://bugs.webkit.org/show_bug.cgi?id=173842
1920
1921         Reviewed by Simon Fraser.
1922
1923         The URL string was passed across thread without isolated copy.
1924
1925         * platform/graphics/ImageFrameCache.cpp:
1926         (WebCore::ImageFrameCache::startAsyncDecodingQueue):
1927
1928 2017-06-26  Jonathan Bedard  <jbedard@apple.com>
1929
1930         Unreviewed, rolling out r218783.
1931
1932         Causing accessibility/mac/setting-attributes-is-
1933         asynchronous.html to crash consistently on mac-wk2 Debug
1934
1935         Reverted changeset:
1936
1937         "AX: Cannot call setValue() on contenteditable or ARIA text
1938         controls"
1939         https://bugs.webkit.org/show_bug.cgi?id=173520
1940         http://trac.webkit.org/changeset/218783
1941
1942 2017-06-26  Yusuke Suzuki  <utatane.tea@gmail.com>
1943
1944         [WTF] Drop Thread::create(obsolete things) API since we can use lambda
1945         https://bugs.webkit.org/show_bug.cgi?id=173825
1946
1947         Reviewed by Saam Barati.
1948
1949         No behavior change.
1950
1951         * Modules/indexeddb/server/IDBServer.cpp:
1952         (WebCore::IDBServer::IDBServer::IDBServer):
1953         (WebCore::IDBServer::IDBServer::databaseThreadEntry): Deleted.
1954         * Modules/indexeddb/server/IDBServer.h:
1955         * Modules/webaudio/AsyncAudioDecoder.cpp:
1956         (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
1957         (WebCore::AsyncAudioDecoder::threadEntry): Deleted.
1958         * Modules/webaudio/AsyncAudioDecoder.h:
1959         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1960         (WebCore::OfflineAudioDestinationNode::startRendering):
1961         (WebCore::OfflineAudioDestinationNode::offlineRenderEntry): Deleted.
1962         * Modules/webaudio/OfflineAudioDestinationNode.h:
1963         * Modules/webdatabase/DatabaseThread.cpp:
1964         (WebCore::DatabaseThread::start):
1965         (WebCore::DatabaseThread::databaseThreadStart): Deleted.
1966         * Modules/webdatabase/DatabaseThread.h:
1967         * bindings/js/GCController.cpp:
1968         (WebCore::collect):
1969         (WebCore::GCController::gcTimerFired):
1970         (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
1971         * loader/icon/IconDatabase.cpp:
1972         (WebCore::IconDatabase::open):
1973         (WebCore::IconDatabase::iconDatabaseSyncThreadStart): Deleted.
1974         * loader/icon/IconDatabase.h:
1975         * page/ResourceUsageThread.cpp:
1976         (WebCore::ResourceUsageThread::createThreadIfNeeded):
1977         (WebCore::ResourceUsageThread::threadCallback): Deleted.
1978         * page/ResourceUsageThread.h:
1979         * page/scrolling/ScrollingThread.cpp:
1980         (WebCore::ScrollingThread::createThreadIfNeeded):
1981         (WebCore::ScrollingThread::threadCallback): Deleted.
1982         (WebCore::ScrollingThread::threadBody): Deleted.
1983         * page/scrolling/ScrollingThread.h:
1984         * platform/audio/HRTFDatabaseLoader.cpp:
1985         (WebCore::HRTFDatabaseLoader::loadAsynchronously):
1986         (WebCore::databaseLoaderEntry): Deleted.
1987         * platform/audio/HRTFDatabaseLoader.h:
1988         * platform/audio/ReverbConvolver.cpp:
1989         (WebCore::ReverbConvolver::ReverbConvolver):
1990         (WebCore::backgroundThreadEntry): Deleted.
1991         * platform/audio/ReverbConvolver.h:
1992         (WebCore::ReverbConvolver::useBackgroundThreads):
1993         * platform/network/cf/LoaderRunLoopCF.cpp:
1994         (WebCore::loaderRunLoop):
1995         (WebCore::runLoaderThread): Deleted.
1996         * platform/network/curl/CurlManager.cpp:
1997         (WebCore::CurlManager::startThreadIfNeeded):
1998         (WebCore::CurlManager::workerThread):
1999         * platform/network/curl/CurlManager.h:
2000         * workers/WorkerThread.cpp:
2001         (WebCore::WorkerThread::start):
2002         (WebCore::WorkerThread::workerThreadStart): Deleted.
2003         * workers/WorkerThread.h:
2004
2005 2017-06-26  Joanmarie Diggs  <jdiggs@igalia.com>
2006
2007         [ATK] Add support for aria-details and aria-errormessage
2008         https://bugs.webkit.org/show_bug.cgi?id=172588
2009
2010         Reviewed by Chris Fleizach.
2011
2012         Add methods to retrieve elements referenced by or referencing the new
2013         aria-details and aria-errormessage attributes. Include aria-details and
2014         aria-errormessage in AccessibilityObject::supportsARIAAttributes() to ensure
2015         elements with these attributes will be included in the accessibility tree.
2016
2017         New test cases added to accessibility/gtk/relation-types.html.
2018
2019         * accessibility/AccessibilityObject.cpp:
2020         (WebCore::AccessibilityObject::supportsARIAAttributes):
2021         (WebCore::AccessibilityObject::ariaDetailsElements):
2022         (WebCore::AccessibilityObject::ariaDetailsReferencingElements):
2023         (WebCore::AccessibilityObject::ariaErrorMessageElements):
2024         (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements):
2025         * accessibility/AccessibilityObject.h:
2026         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2027         (setAtkRelationSetFromCoreObject):
2028         * html/HTMLAttributeNames.in:
2029
2030 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
2031
2032         Remove excessive headers from WebCore/{Modules,animation,crypto,domjit}
2033         https://bugs.webkit.org/show_bug.cgi?id=173824
2034
2035         Reviewed by Darin Adler.
2036
2037         No new tests needed.
2038
2039         * Modules/credentials/CredentialCreationOptions.h:
2040         * Modules/credentials/PasswordCredential.h:
2041         * Modules/fetch/FetchBody.h:
2042         * Modules/fetch/FetchBodyOwner.h:
2043         * Modules/gamepad/GamepadManager.h:
2044         * Modules/geolocation/Coordinates.h:
2045         * Modules/geolocation/Geoposition.h:
2046         * Modules/indexeddb/IDBActiveDOMObject.h:
2047         * Modules/indexeddb/IDBCursor.h:
2048         * Modules/indexeddb/IDBDatabase.h:
2049         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2050         * Modules/indexeddb/IDBObjectStore.cpp:
2051         * Modules/indexeddb/IDBObjectStore.h:
2052         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2053         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2054         * Modules/indexeddb/shared/InProcessIDBServer.h:
2055         * Modules/indexeddb/shared/IndexKey.h:
2056         * Modules/mediacontrols/MediaControlsHost.h:
2057         * Modules/mediasession/WebMediaSessionManager.h:
2058         * Modules/mediasource/SourceBufferList.h:
2059         * Modules/mediasource/VideoPlaybackQuality.h:
2060         * Modules/notifications/Notification.h:
2061         * Modules/quota/WorkerNavigatorStorageQuota.h:
2062         * Modules/webaudio/AudioBasicProcessorNode.h:
2063         * Modules/webaudio/AudioContext.h:
2064         * Modules/webaudio/AudioDestinationNode.h:
2065         * Modules/webaudio/AudioParamTimeline.h:
2066         * Modules/webaudio/ConvolverNode.cpp:
2067         * Modules/webaudio/MediaStreamAudioSource.h:
2068         * Modules/webaudio/MediaStreamAudioSourceNode.h:
2069         * Modules/webaudio/PannerNode.h:
2070         * Modules/webaudio/PeriodicWave.h:
2071         * Modules/webaudio/ScriptProcessorNode.h:
2072         * Modules/webdatabase/DatabaseManager.h:
2073         * Modules/webdatabase/DatabaseTask.h:
2074         * Modules/webdatabase/SQLTransaction.h:
2075         * Modules/webdatabase/SQLTransactionBackend.h:
2076         * Modules/webdatabase/SQLTransactionStateMachine.h:
2077         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
2078         * Modules/websockets/WebSocketDeflater.h:
2079         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
2080         * animation/AnimationEffect.h:
2081         * crypto/CryptoKeyPair.h:
2082         * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h:
2083         * dom/ScriptExecutionContext.h:
2084         * domjit/DOMJITHelpers.h:
2085         * domjit/DOMJITIDLConvert.h:
2086         * domjit/DOMJITIDLType.h:
2087
2088 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
2089
2090         [GTK] Unreviewed, added missing includes to fix debug build
2091
2092         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2093
2094 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
2095
2096         Remove excessive headers from WebCore/platform
2097         https://bugs.webkit.org/show_bug.cgi?id=173822
2098
2099         Reviewed by Tim Horton.
2100
2101         No new tests needed.
2102
2103         * html/ColorInputType.h:
2104         * html/MediaElementSession.h:
2105         * page/SecurityOriginData.cpp:
2106         * platform/CalculationValue.cpp:
2107         * platform/CalculationValue.h:
2108         * platform/ColorChooserClient.h:
2109         * platform/ContentType.h:
2110         * platform/LogMacros.h:
2111         * platform/PODRedBlackTree.h:
2112         * platform/PasteboardStrategy.h:
2113         * platform/PlatformPasteboard.h:
2114         * platform/PopupMenuStyle.h:
2115         * platform/ScrollAnimator.h:
2116         * platform/Theme.h:
2117         * platform/ThreadGlobalData.h:
2118         * platform/animation/AnimationList.h:
2119         * platform/audio/AudioArray.h:
2120         * platform/audio/AudioChannel.h:
2121         * platform/audio/DynamicsCompressor.h:
2122         * platform/audio/DynamicsCompressorKernel.h:
2123         * platform/audio/FFTFrame.h:
2124         * platform/audio/HRTFDatabaseLoader.cpp:
2125         * platform/audio/HRTFDatabaseLoader.h:
2126         * platform/audio/HRTFElevation.h:
2127         * platform/audio/MultiChannelResampler.h:
2128         * platform/audio/PlatformMediaSession.h:
2129         * platform/audio/ReverbConvolver.h:
2130         * platform/audio/ReverbConvolverStage.cpp:
2131         * platform/graphics/ANGLEWebKitBridge.h:
2132         * platform/graphics/BitmapImage.h:
2133         * platform/graphics/CrossfadeGeneratedImage.h:
2134         * platform/graphics/FloatPolygon.h:
2135         * platform/graphics/FloatSizeHash.h:
2136         * platform/graphics/Font.h:
2137         * platform/graphics/FontMetrics.h:
2138         * platform/graphics/FontPlatformData.h:
2139         * platform/graphics/FontRanges.h:
2140         * platform/graphics/FontTaggedSettings.h:
2141         * platform/graphics/GraphicsContext3D.h:
2142         * platform/graphics/GraphicsContext3DPrivate.h:
2143         * platform/graphics/GraphicsLayerClient.h:
2144         * platform/graphics/Image.cpp:
2145         * platform/graphics/ImageFrame.h:
2146         * platform/graphics/ImageFrameCache.h:
2147         * platform/graphics/ImageSource.h:
2148         * platform/graphics/IntRectHash.h:
2149         * platform/graphics/IntSizeHash.h:
2150         * platform/graphics/MediaPlaybackTargetClient.h:
2151         * platform/graphics/Pattern.h:
2152         * platform/graphics/PlatformTimeRanges.h:
2153         * platform/graphics/TextRun.h:
2154         * platform/graphics/TiledBacking.h:
2155         * platform/graphics/cairo/FontCustomPlatformData.h:
2156         * platform/graphics/filters/FEConvolveMatrix.h:
2157         * platform/graphics/filters/FELighting.h:
2158         * platform/graphics/filters/SourceAlpha.h:
2159         * platform/graphics/gstreamer/GStreamerUtilities.h:
2160         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
2161         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2162         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2163         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2164         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
2165         * platform/graphics/opengl/Extensions3DOpenGL.h:
2166         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2167         * platform/graphics/texmap/TextureMapperBackingStore.h:
2168         * platform/graphics/texmap/TextureMapperGL.cpp:
2169         * platform/graphics/texmap/TextureMapperGL.h:
2170         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2171         * platform/graphics/texmap/TextureMapperTile.h:
2172         * platform/graphics/texmap/coordinated/Tile.h:
2173         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2174         * platform/graphics/transforms/TransformState.h:
2175         * platform/gtk/PasteboardHelper.h:
2176         * platform/gtk/ScrollbarThemeGtk.h:
2177         * platform/image-decoders/ImageDecoder.h:
2178         * platform/network/BlobData.h:
2179         * platform/network/BlobDataFileReference.h:
2180         * platform/network/ResourceHandle.h:
2181         * platform/network/ResourceHandleInternal.h:
2182         * platform/network/SocketStreamHandleClient.h:
2183         * platform/network/soup/ResourceRequest.h:
2184         * platform/network/soup/SocketStreamHandleImpl.h:
2185         * platform/network/soup/SoupNetworkSession.h:
2186         * platform/sql/SQLiteFileSystem.h:
2187         * platform/text/LocaleICU.h:
2188
2189 2017-06-25  Youenn Fablet  <youenn@apple.com>
2190
2191         Remove use of mock webrtc backend factory at injected bundle reset time
2192         https://bugs.webkit.org/show_bug.cgi?id=173817
2193
2194         Reviewed by Darin Adler.
2195
2196         * testing/Internals.cpp:
2197         (WebCore::Internals::resetToConsistentState): Resetting the peer connection backend.
2198         * testing/MockLibWebRTCPeerConnection.cpp: Doing some clean-up
2199         (WebCore::useRealRTCPeerConnectionFactory):
2200         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
2201         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
2202         (WebCore::MockLibWebRTCPeerConnectionFactory::CreateVideoTrack):
2203         (WebCore::MockLibWebRTCPeerConnectionFactory::CreateAudioTrack):
2204         * testing/MockLibWebRTCPeerConnection.h:
2205
2206 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
2207
2208         Remove excessive headers from JavaScriptCore
2209         https://bugs.webkit.org/show_bug.cgi?id=173812
2210
2211         Reviewed by Darin Adler.
2212
2213         No new tests needed.
2214
2215         * Modules/indexeddb/IDBObjectStore.cpp:
2216         * bindings/js/JSDOMPromiseDeferred.h:
2217         * bindings/js/JSLazyEventListener.cpp:
2218         * bindings/js/JSMainThreadExecState.h:
2219         * bindings/js/ReadableStreamDefaultController.cpp:
2220         * bindings/js/ScriptGlobalObject.cpp:
2221         * bindings/js/SerializedScriptValue.cpp:
2222         * bridge/NP_jsobject.cpp:
2223         * dom/ScriptExecutionContext.cpp:
2224         * html/HTMLPlugInImageElement.cpp:
2225
2226 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
2227
2228         Remove excessive headers from WebCore/{rendering,style,svg}
2229         https://bugs.webkit.org/show_bug.cgi?id=173773
2230
2231         Reviewed by Darin Adler.
2232
2233         No new tests needed.
2234
2235         * css/StyleBuilderConverter.h:
2236         * editing/TextIterator.cpp:
2237         * rendering/CounterNode.h:
2238         * rendering/FlexibleBoxAlgorithm.h:
2239         * rendering/HitTestLocation.h:
2240         * rendering/HitTestResult.h:
2241         * rendering/HitTestingTransformState.h:
2242         * rendering/OrderIterator.h:
2243         * rendering/RenderButton.h:
2244         * rendering/RenderCombineText.h:
2245         * rendering/RenderFlowThread.h:
2246         * rendering/RenderFullScreen.h:
2247         * rendering/RenderGeometryMap.h:
2248         * rendering/RenderListItem.h:
2249         * rendering/RenderMediaControlElements.cpp:
2250         * rendering/RenderMediaControlElements.h:
2251         * rendering/RenderMediaControls.h:
2252         * rendering/RenderMeter.h:
2253         * rendering/RenderMultiColumnSet.cpp:
2254         * rendering/RenderObject.h:
2255         * rendering/RenderRegion.h:
2256         * rendering/RenderRegionSet.cpp:
2257         * rendering/RenderRegionSet.h:
2258         * rendering/RenderTheme.h:
2259         * rendering/RenderVTTCue.cpp:
2260         * rendering/RenderVTTCue.h:
2261         * rendering/SimpleLineLayoutFunctions.h:
2262         * rendering/SimpleLineLayoutResolver.h:
2263         * rendering/line/BreakingContext.h:
2264         * rendering/line/LineBreaker.h:
2265         * rendering/mathml/MathMLStyle.h:
2266         * rendering/mathml/RenderMathMLOperator.h:
2267         * rendering/mathml/RenderMathMLRoot.h:
2268         * rendering/shapes/RectangleShape.h:
2269         * rendering/style/BasicShapes.h:
2270         * rendering/style/BorderData.h:
2271         * rendering/style/CounterDirectives.h:
2272         * rendering/style/GridArea.h:
2273         * rendering/style/KeyframeList.h:
2274         * rendering/style/RenderStyle.h:
2275         * rendering/style/SVGRenderStyle.h:
2276         * rendering/style/ShapeValue.h:
2277         * rendering/style/StyleCachedImage.h:
2278         * rendering/style/StyleMultiColData.h:
2279         * rendering/style/StyleRareNonInheritedData.h:
2280         * rendering/style/WillChangeData.h:
2281         * rendering/svg/RenderSVGBlock.h:
2282         * rendering/svg/RenderSVGRect.h:
2283         * rendering/svg/RenderSVGResource.h:
2284         * rendering/svg/RenderSVGResourceContainer.h:
2285         * rendering/svg/RenderSVGResourceMarker.h:
2286         * rendering/svg/RenderSVGResourceMasker.h:
2287         * rendering/svg/RenderSVGResourcePattern.h:
2288         * rendering/svg/SVGInlineFlowBox.cpp:
2289         * rendering/svg/SVGInlineTextBox.h:
2290         * rendering/svg/SVGRootInlineBox.h:
2291         * rendering/svg/SVGTextChunk.cpp:
2292         * rendering/svg/SVGTextChunk.h:
2293         * rendering/svg/SVGTextChunkBuilder.cpp:
2294         * rendering/svg/SVGTextLayoutEngine.cpp:
2295         * rendering/svg/SVGTextLayoutEngineSpacing.h:
2296         * style/RenderTreePosition.cpp:
2297         * style/RenderTreePosition.h:
2298         * style/RenderTreeUpdater.h:
2299         * style/StyleFontSizeFunctions.h:
2300         * style/StyleInvalidator.h:
2301         * style/StyleResolveForDocument.h:
2302         * style/StyleScope.h:
2303         * style/StyleTreeResolver.cpp:
2304         * style/StyleTreeResolver.h:
2305         * style/StyleUpdate.h:
2306         * svg/SVGAnimationElement.h:
2307         * svg/SVGFEBlendElement.cpp:
2308         * svg/SVGFEBlendElement.h:
2309         * svg/SVGFEComponentTransferElement.h:
2310         * svg/SVGFEFloodElement.cpp:
2311         * svg/SVGFEFloodElement.h:
2312         * svg/SVGFEImageElement.h:
2313         * svg/SVGFEMergeElement.cpp:
2314         * svg/SVGFEMergeElement.h:
2315         * svg/SVGFEOffsetElement.cpp:
2316         * svg/SVGFEOffsetElement.h:
2317         * svg/SVGFETileElement.cpp:
2318         * svg/SVGFETileElement.h:
2319         * svg/SVGParserUtilities.h:
2320         * svg/SVGPathByteStream.h:
2321         * svg/SVGPathElement.cpp:
2322         * svg/SVGPolyElement.cpp:
2323         * svg/SVGSVGElement.cpp:
2324         * svg/SVGTRefElement.cpp:
2325         * svg/SVGTextPathElement.cpp:
2326         * svg/SVGUseElement.cpp:
2327         * svg/animation/SMILTimeContainer.h:
2328         * svg/graphics/SVGImageCache.h:
2329         * svg/graphics/filters/SVGFilter.h:
2330
2331 2017-06-25  Antoine Quint  <graouts@apple.com>
2332
2333         Remove rAf suspension logging
2334         https://bugs.webkit.org/show_bug.cgi?id=173821
2335
2336         Reviewed by Tim Horton.
2337
2338         Now that webkit.org/b/173628 is fixed, we can remove the logging code we added.
2339
2340         * dom/Document.cpp:
2341         (WebCore::Document::requestAnimationFrame):
2342         * dom/ScriptedAnimationController.cpp:
2343         (WebCore::ScriptedAnimationController::suspend):
2344         (WebCore::ScriptedAnimationController::resume):
2345         * page/Page.cpp:
2346         (WebCore::Page::suspendScriptedAnimations):
2347         (WebCore::Page::resumeScriptedAnimations):
2348         (WebCore::Page::setIsVisibleInternal):
2349         * platform/RuntimeApplicationChecks.h:
2350         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2351         (WebCore::MacApplication::isDumpRenderTree): Deleted.
2352
2353 2017-06-24  Sam Weinig  <sam@webkit.org>
2354
2355         [WebIDL] Add complete support for stringifier
2356         https://bugs.webkit.org/show_bug.cgi?id=173724
2357
2358         Reviewed by Darin Adler.
2359
2360         * bindings/scripts/CodeGeneratorJS.pm:
2361         (AddStringifierOperationIfNeeded):
2362         Update AddStringifierOperationIfNeeded to support stringifier on operations and be more
2363         strict about the allowed types. Also copies over all extended attributes to the synthetic
2364         operation.
2365
2366         * bindings/scripts/IDLParser.pm:
2367         (parseInterfaceMember):
2368         (parseOperationOrReadWriteAttributeOrMaplike):
2369         (parseReadOnlyMember):
2370         (parseStringifier):
2371         (parseStaticMember):
2372         (parseAttributeOrOperationForStringifierOrStatic):
2373         (parseReadWriteAttribute):
2374         (parseAttributeRest):
2375         (parseOperation):
2376         (parseSpecialOperation):
2377         (parseMapLikeProperties):
2378         (parseOperationRest):
2379         (parseAttributeOrOperationOrIterator): Deleted.
2380         (parseQualifier): Deleted.
2381         (parseAttributeOrOperationRest): Deleted.
2382         (parseAttribute): Deleted.
2383         (parseOperationOrIterator): Deleted.
2384         - Update parser to more closely resemble the WebIDL grammar, splitting out parseStringifier and
2385           parseStaticMember into their own subroutines. 
2386         - Move those and parseSerializer, parseStringifier, parseStaticMember, parseIterableRest and a split out
2387           parseReadOnlyMembers up into parseInterfaceMember to make it clearer that they are top level members
2388           and match the grammar.
2389         - Rename parseAttributeOrOperationOrIterator to parseOperationOrReadWriteAttributeOrMaplike to match the
2390           grammar language and make it clear what it does.
2391         - Add parseAttributeOrOperationForStringifierOrStatic which contains most of the logic for parsing stringifiers
2392           and static members, which have almost identical grammars.
2393         - Remove creator special which no longer exists in the spec.
2394
2395         * css/DOMMatrixReadOnly.idl:
2396         * css/WebKitCSSMatrix.idl:
2397         * dom/Range.idl:
2398         * html/URLSearchParams.idl:
2399         Fix FIXMEs by switching to use stringifier.
2400
2401         * bindings/scripts/test/JS/JSTestStringifier.cpp: Added.
2402         * bindings/scripts/test/JS/JSTestStringifier.h: Added.
2403         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: Added.
2404         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h: Added.
2405         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: Added.
2406         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h: Added.
2407         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: Added.
2408         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h: Added.
2409         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: Added.
2410         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h: Added.
2411         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: Added.
2412         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h: Added.
2413         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: Added.
2414         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h: Added.
2415         * bindings/scripts/test/TestStringifier.idl: Added.
2416         * bindings/scripts/test/TestStringifierAnonymousOperation.idl: Added.
2417         * bindings/scripts/test/TestStringifierNamedOperation.idl: Added.
2418         * bindings/scripts/test/TestStringifierOperationImplementedAs.idl: Added.
2419         * bindings/scripts/test/TestStringifierOperationNamedToString.idl: Added.
2420         * bindings/scripts/test/TestStringifierReadOnlyAttribute.idl: Added.
2421         * bindings/scripts/test/TestStringifierReadWriteAttribute.idl: Added.
2422         Add new tests.
2423
2424 2017-06-24  Chris Fleizach  <cfleizach@apple.com>
2425
2426         AX: Cannot call setValue() on contenteditable or ARIA text controls
2427         https://bugs.webkit.org/show_bug.cgi?id=173520
2428
2429         Reviewed by Ryosuke Niwa.
2430
2431         Add support for changing the value of a contenteditable and any other aria text control in setValue().
2432  
2433         Test: accessibility/mac/set-value-editable-types.html
2434
2435         * accessibility/AccessibilityRenderObject.cpp:
2436         (WebCore::AccessibilityRenderObject::setValue):
2437
2438 2017-06-23  Simon Fraser  <simon.fraser@apple.com>
2439
2440         Attempt to fix an internal build after r218755.
2441
2442         * bindings/js/JSMainThreadExecStateInstrumentation.h:
2443
2444 2017-06-23  Chris Dumez  <cdumez@apple.com>
2445
2446         Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
2447         https://bugs.webkit.org/show_bug.cgi?id=173792
2448
2449         Reviewed by Ryosuke Niwa.
2450
2451         Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
2452         as this could cause HashTable corruption on WebPageProxy side.
2453
2454         * loader/DocumentLoader.cpp:
2455         (WebCore::DocumentLoader::finishedLoadingIcon):
2456
2457 2017-06-23  Youenn Fablet  <youenn@apple.com>
2458
2459         webrtc::WebRtcSession is not handling correctly its state when setLocalDescription fails and is called again
2460         https://bugs.webkit.org/show_bug.cgi?id=173783
2461
2462         Reviewed by Alex Christensen.
2463
2464         Test: webrtc/libwebrtc/setLocalDescriptionCrash.html
2465
2466         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2467         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription): Fail early if there is no pending remote description and description is for an answer.
2468
2469 2017-06-23  Eric Carlson  <eric.carlson@apple.com>
2470
2471         [MediaStream macOS] enumerateDevices should only return valid audio capture devices
2472         https://bugs.webkit.org/show_bug.cgi?id=173790
2473         <rdar://problem/32260334>
2474
2475         Reviewed by Youenn Fablet.
2476
2477         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
2478         (WebCore::isValidCaptureDevice): A valid device has a name and is not an aggregate device
2479         created by VPIO.
2480         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
2481
2482 2017-06-23  Jer Noble  <jer.noble@apple.com>
2483
2484         [WK2] Support -[WebAVPlayerController setMuted:]
2485         https://bugs.webkit.org/show_bug.cgi?id=173777
2486
2487         Reviewed by Eric Carlson.
2488
2489         Have -[WebAVPlayerController setMuted:] pass the request to its delegate (the model)
2490         rather than just storing the value.
2491
2492         * platform/cocoa/WebPlaybackSessionModel.h:
2493         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
2494         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2495         (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
2496         (WebCore::WebPlaybackSessionModelMediaElement::setMuted):
2497         * platform/ios/WebAVPlayerController.h:
2498         * platform/ios/WebAVPlayerController.mm:
2499         (-[WebAVPlayerController isMuted]):
2500         (-[WebAVPlayerController setMuted:]):
2501         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2502         (WebVideoFullscreenControllerContext::setMuted):
2503
2504 2017-06-23  Frederic Wang  <fwang@igalia.com>
2505
2506         Make RenderLayer::handleTouchEvent use usesAcceleratedScrolling()
2507         https://bugs.webkit.org/show_bug.cgi?id=173763
2508
2509         Reviewed by Simon Fraser.
2510
2511         No new tests, behavior is unchanged.
2512
2513         * rendering/RenderLayer.cpp:
2514         (WebCore::RenderLayer::handleTouchEvent): Call usesAcceleratedScrolling() instead of
2515         hasTouchScrollableOverflow() for clarity.
2516
2517 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
2518
2519         Remove excessive headers from WebCore/{bindings,css,dom}
2520         https://bugs.webkit.org/show_bug.cgi?id=173766
2521
2522         Reviewed by Simon Fraser.
2523
2524         No new tests needed.
2525
2526         * ForwardingHeaders/runtime/ThrowScope.h: Added.
2527         * Modules/plugins/QuickTimePluginReplacement.mm:
2528         * bindings/js/CachedScriptSourceProvider.h:
2529         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2530         * bindings/js/JSCustomXPathNSResolver.cpp:
2531         * bindings/js/JSDOMConstructorNotConstructable.h:
2532         * bindings/js/JSDOMConvertBase.h:
2533         * bindings/js/JSDOMConvertBufferSource.h:
2534         * bindings/js/JSDOMConvertInterface.h:
2535         * bindings/js/JSDOMConvertStrings.h:
2536         * bindings/js/JSDOMConvertUnion.h:
2537         * bindings/js/JSDOMConvertVariadic.h:
2538         * bindings/js/JSDOMConvertWebGL.h:
2539         * bindings/js/JSDOMExceptionHandling.h:
2540         * bindings/js/JSDOMIterator.h:
2541         * bindings/js/JSDOMMapLike.h:
2542         * bindings/js/JSDOMWindowBase.cpp:
2543         * bindings/js/JSDOMWindowCustom.cpp:
2544         * bindings/js/JSDOMWindowCustom.h:
2545         * bindings/js/JSDOMWindowProperties.h:
2546         * bindings/js/JSDOMWrapperCache.h:
2547         * bindings/js/JSLazyEventListener.cpp:
2548         * bindings/js/JSMainThreadExecStateInstrumentation.h:
2549         * bindings/js/JSMediaListCustom.h:
2550         * bindings/js/JSNodeCustom.h:
2551         * bindings/js/JSNodeListCustom.h:
2552         * bindings/js/JSVideoTrackListCustom.cpp:
2553         * bindings/js/ScheduledAction.h:
2554         * bindings/js/ScriptSourceCode.h:
2555         * bindings/js/SerializedScriptValue.h:
2556         * bindings/js/WebCoreJSClientData.h:
2557         * css/CSSFontFeatureValue.h:
2558         * css/CSSPrimitiveValue.h:
2559         * css/CSSStyleSheet.h:
2560         * css/CSSValue.h:
2561         * css/StyleBuilderCustom.h:
2562         * dom/ContainerNodeAlgorithms.h:
2563         * dom/DataTransfer.h:
2564         * dom/Node.h:
2565         * dom/NodeRareData.h:
2566         * dom/Position.h:
2567         * dom/RenderedDocumentMarker.h:
2568
2569 2017-06-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2570
2571         Fix broken WinCairo build
2572
2573         [Curl] Extract CurlDownloadManager as shared background task handler
2574         https://bugs.webkit.org/show_bug.cgi?id=173557
2575
2576         Reviewed by Joseph Pecoraro.
2577
2578         * platform/network/curl/CurlManager.h:
2579
2580 2017-06-23  Chris Dumez  <cdumez@apple.com>
2581
2582         [iOS] Potential crash under WebCore::notifyLowPowerModeChanged(WebCore::LowPowerModeNotifier*, bool)
2583         https://bugs.webkit.org/show_bug.cgi?id=173755
2584         <rdar://problem/32940942>
2585
2586         Reviewed by Mark Lam.
2587
2588         The crash was happening because the WebLowPowerModeObserver would dispatch
2589         a lambda to the main thread but the LowPowerModeNotifier object could be
2590         dead by the time we get to the main thread.
2591
2592         To address the issue, keep a strong ref to the WebLowPowerModeObserver in
2593         the lambda we dispatch to the main thread to make sure it stays alive until
2594         we execute the lambda. In the LowPowerModeNotifier destructor, we now reset
2595         the WebLowPowerModeObserver's notifier pointer to nil and I added a null
2596         check for this notifier in the lambda.
2597
2598         * platform/LowPowerModeNotifier.cpp:
2599         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
2600         * platform/LowPowerModeNotifier.h:
2601         * platform/ios/LowPowerModeNotifierIOS.mm:
2602         (-[WebLowPowerModeObserver initWithNotifier:]):
2603         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
2604         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
2605         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
2606         (WebCore::notifyLowPowerModeChanged):
2607
2608 2017-06-23  Alex Christensen  <achristensen@webkit.org>
2609
2610         Add SPI to WKURLSchemeTask for redirection
2611         https://bugs.webkit.org/show_bug.cgi?id=173730
2612
2613         Reviewed by Brady Eidson.
2614
2615         * platform/network/CacheValidation.cpp:
2616         (WebCore::computeFreshnessLifetimeForHTTPFamily):
2617         Asserting that redirects are always http/https URLs is no longer valid.
2618         If there's a custom scheme redirect, give it no freshness lifetime in the cache.
2619
2620 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
2621
2622         Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
2623         https://bugs.webkit.org/show_bug.cgi?id=173769
2624
2625         Reviewed by Simon Fraser.
2626
2627         No new tests needed.
2628
2629         * css/CSSFontFaceSource.cpp:
2630         * editing/DictationCommand.cpp:
2631         * editing/Editor.h:
2632         * editing/VisiblePosition.h:
2633         * editing/VisibleUnits.h:
2634         * fileapi/BlobBuilder.h:
2635         * history/PageCache.h:
2636         * html/DOMURL.h:
2637         * html/HTMLCollection.h:
2638         * html/HTMLMediaElement.cpp:
2639         * html/HTMLMediaElement.h:
2640         * html/HTMLPlugInImageElement.cpp:
2641         * html/StepRange.h:
2642         * html/canvas/CanvasRenderingContext.h:
2643         * html/canvas/CanvasRenderingContext2D.h:
2644         * html/parser/HTMLDocumentParser.cpp:
2645         * html/parser/HTMLElementStack.h:
2646         * html/parser/HTMLInputStream.h:
2647         * html/shadow/MediaControlElements.cpp:
2648         * html/shadow/MediaControls.cpp:
2649         * html/shadow/MediaControls.h:
2650         * html/track/TrackListBase.h:
2651         * html/track/VTTCue.h:
2652         * html/track/WebVTTParser.cpp:
2653         * html/track/WebVTTParser.h:
2654         * loader/CrossOriginPreflightChecker.cpp:
2655         * loader/DocumentThreadableLoader.cpp:
2656         * loader/FrameLoaderClient.h:
2657         * loader/LinkPreloadResourceClients.h:
2658         * loader/LoadTiming.h:
2659         * loader/ThreadableLoaderClientWrapper.h:
2660         * loader/WorkerThreadableLoader.h:
2661         * loader/cache/CachedResourceLoader.h:
2662         * loader/cache/CachedResourceRequest.h:
2663         * loader/cache/CachedSVGDocument.h:
2664         * loader/cache/CachedTextTrack.h:
2665         * loader/icon/IconLoader.cpp:
2666         * page/AlternativeTextClient.h:
2667         * page/CaptionUserPreferences.cpp:
2668         * page/CaptionUserPreferences.h:
2669         * page/ContextMenuClient.h:
2670         * page/MainFrame.h:
2671         * page/Page.h:
2672         * page/PageGroup.h:
2673         * page/PerformanceEntry.h:
2674         * page/PerformanceResourceTiming.h:
2675         * page/ResourceUsageOverlay.cpp:
2676         * page/ResourceUsageOverlay.h:
2677         * page/UserContentController.h:
2678         * page/UserContentProvider.h:
2679         * page/animation/AnimationBase.h:
2680         * page/animation/CSSPropertyAnimation.h:
2681         * page/animation/CompositeAnimation.h:
2682         * page/scrolling/ScrollingCoordinator.h:
2683         * xml/XSLTProcessorLibxslt.cpp:
2684         * xml/parser/XMLDocumentParserLibxml2.cpp:
2685
2686 2017-06-23  Chris Dumez  <cdumez@apple.com>
2687
2688         [mac-wk1] requestAnimationFrame callbacks may not get serviced
2689         https://bugs.webkit.org/show_bug.cgi?id=173628
2690
2691         Reviewed by Simon Fraser.
2692
2693         Page::setIsVisibleInternal() was firing the 'visibilitychange' event
2694         synchronously while in the middle of updating its visibility/activity
2695         state. This allowed the JavaScript to re-enter the method by calling
2696         testRunner.setPageVisibility() / resetPageVisiblity() and we would
2697         end up in an inconsistent state.
2698
2699         No new tests, extended existing test.
2700
2701         * dom/Document.cpp:
2702         (WebCore::Document::visibilityStateChanged):
2703         Do no fire the visibilitychange event synchronously as we are in the
2704         middle of updating the page's activity state. Instead fire the
2705         event asynchronously.
2706
2707         * page/Page.cpp:
2708         (WebCore::Page::setIsVisibleInternal):
2709         Move the calling of Document::visibilityStateChanged() until after we're
2710         done updating the page's visibility state.
2711
2712         * testing/Internals.cpp:
2713         (WebCore::Internals::scriptedAnimationsAreSuspended):
2714         * testing/Internals.h:
2715         * testing/Internals.idl:
2716         Add test infrastructure to check if scripted animations are suspended.
2717
2718 2017-06-23  Eric Carlson  <eric.carlson@apple.com>
2719
2720         [iOS] Respond to AudioSession interruption and resume
2721         https://bugs.webkit.org/show_bug.cgi?id=173718
2722         <rdar://problem/32925263>
2723
2724         Reviewed by Youenn Fablet.
2725
2726         Tested manually.
2727
2728         * WebCore.xcodeproj/project.pbxproj: Add CoreAudioCaptureSourceIOS.mm/.h
2729
2730         * platform/mediastream/RealtimeMediaSource.h: Make createWeakPtr protected so derived classes
2731         can use it.
2732
2733         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: Added.
2734         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Added.
2735         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
2736         (-[WebCoreAudioCaptureSourceIOSListener invalidate]):
2737         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
2738         (-[WebCoreAudioCaptureSourceIOSListener sessionMediaServicesWereReset:]):
2739         (WebCore::CoreAudioCaptureSourceIOS::CoreAudioCaptureSourceIOS):
2740         (WebCore::CoreAudioCaptureSourceIOS::~CoreAudioCaptureSourceIOS):
2741
2742         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2743         (WebCore::CoreAudioSharedUnit::suspended): 
2744         (WebCore::CoreAudioSharedUnit::setupAudioUnit): Clear m_suspended.
2745         (WebCore::CoreAudioSharedUnit::suspend): Don't clear sources or uninitialize the audio unit,
2746         suspend is temporary. Set m_suspended.
2747         (WebCore::CoreAudioSharedUnit::resume): New, restart the audio unit.
2748         (WebCore::CoreAudioCaptureSource::create): Create the correct object.
2749         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration): Dispatch to main thread if necessary.
2750         (WebCore::CoreAudioCaptureSource::beginInterruption): New, suspend from main thread.
2751         (WebCore::CoreAudioCaptureSource::endInterruption): New, resume/reconfigure from main thread.
2752         (WebCore::CoreAudioCaptureSource::interrupted):
2753         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2754
2755 2017-06-23  Zan Dobersek  <zdobersek@igalia.com>
2756
2757         [GCrypt] Drop the AES-CFB support
2758         https://bugs.webkit.org/show_bug.cgi?id=173547
2759
2760         Reviewed by Jiewen Tan.
2761
2762         No new tests -- relevant test baselines are updated.
2763
2764         Stop registering the AES-CFB algorithm as something that's supported by
2765         the libgcrypt implementation. This algorithm was previously included in
2766         the Web Crypto API specification, but has since been dropped from it.
2767
2768         Conveniently, libgcrypt only recently gained support for the CFB8 AES
2769         cipher mode that's required by the specification, meaning we could only
2770         support this algorithm with future releases of the libgcrypt library.
2771
2772         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
2773         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
2774
2775 2017-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2776
2777         [WPE] Enable PUBLIC_SUFFIX_LIST
2778         https://bugs.webkit.org/show_bug.cgi?id=173758
2779
2780         Reviewed by Žan Doberšek.
2781
2782         * PlatformWPE.cmake: Add PublicSuffixSoup.cpp to the build.
2783
2784 2017-06-22  Antti Koivisto  <antti@apple.com>
2785
2786         REGRESSION(r217695): Offscreen/overflowed items not being rendered while translating in-frame
2787         https://bugs.webkit.org/show_bug.cgi?id=173732
2788
2789         Reviewed by Simon Fraser.
2790
2791         If an accelerated animation starts completely outside the view we fail to create backing for it
2792         when it moves into view.
2793
2794         Fix by computing the full extent rect of the animation when it starts and doing the viewport overlap
2795         testing with that.
2796
2797         Test: compositing/backing/transform-transition-from-outside-view.html
2798
2799         * platform/graphics/GraphicsLayer.h:
2800         (WebCore::GraphicsLayer::animationExtent):
2801         (WebCore::GraphicsLayer::setAnimationExtent):
2802         * platform/graphics/ca/GraphicsLayerCA.cpp:
2803         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
2804
2805             Return the current animation transformation matrix so we can use it elsewhere without recomputing.
2806
2807         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2808
2809             If we have animation extent use it instead of bounds for visibility testing.
2810
2811         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2812
2813             Track if theres is a visible ancestor layer with a transition animation.
2814
2815         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2816         (WebCore::GraphicsLayerCA::updateCoverage):
2817
2818             For simplicity create backing for all sublayers of a visible transform animated layer.
2819
2820         * platform/graphics/ca/GraphicsLayerCA.h:
2821         (WebCore::GraphicsLayerCA::VisibleAndCoverageRects::VisibleAndCoverageRects): Deleted.
2822         * rendering/RenderLayerBacking.cpp:
2823         (WebCore::RenderLayerBacking::updateGeometry):
2824
2825             Pass the animation extent (including descendants) to GraphicsLayer.
2826
2827 2017-06-22  Chris Dumez  <cdumez@apple.com>
2828
2829         ResourceLoadStatisticsStore should be ThreadSafeRefCounted
2830         https://bugs.webkit.org/show_bug.cgi?id=173753
2831         <rdar://problem/32939326>
2832
2833         Reviewed by Andreas Kling.
2834
2835         ResourceLoadStatisticsStore should be ThreadSafeRefCounted as it is ref'd/deref'd
2836         from different threads.
2837
2838         * loader/ResourceLoadStatisticsStore.h:
2839
2840 2017-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
2841
2842         @font-face rules with invalid primary fonts never download their secondary fonts
2843         https://bugs.webkit.org/show_bug.cgi?id=173138
2844         <rdar://problem/32554450>
2845
2846         Reviewed by Simon Fraser.
2847
2848         We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
2849         is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
2850         to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
2851         try to download the next item in the src: list because the CSSFontFace is succeeded.
2852
2853         This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
2854         in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
2855         file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
2856         set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.
2857
2858         This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
2859         The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
2860         only be resolved if the fonts are actually parsed and understood by our text system.
2861
2862         Test: fast/text/font-fallback-invalid-load.html
2863
2864         * css/CSSFontFaceSource.cpp:
2865         (WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
2866         data. This is the crux of this patch.
2867         (WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
2868         state, which means now we know we should always be able to understand the bytes of the file. Therefore,
2869         we can change some if statements into ASSERT()s.
2870         * loader/cache/CachedSVGFont.cpp:
2871         (WebCore::CachedSVGFont::createFont): Ditto.
2872         (WebCore::CachedSVGFont::ensureCustomFontData): Similarly to CSSFontFaceSource::fontLoaded(), this
2873         adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
2874         later we will always be able to create the font object.
2875
2876 2017-06-22  Andreas Kling  <akling@apple.com>
2877
2878         Rename MemoryPressureHandler::setTabCount to setPageCount
2879         https://bugs.webkit.org/show_bug.cgi?id=173750
2880
2881         Reviewed by Daniel Bates.
2882
2883         * page/Page.cpp:
2884         (WebCore::Page::~Page):
2885
2886 2017-06-22  Antoine Quint  <graouts@apple.com>
2887
2888         Modern media controls localised strings are out of sync with used strings in code
2889         https://bugs.webkit.org/show_bug.cgi?id=173752
2890
2891         Reviewed by Dean Jackson.
2892
2893         Remove strings we no longer use and add strings we use but failed to add previously.
2894
2895         * English.lproj/modern-media-controls-localized-strings.js:
2896
2897 2017-06-22  Antoine Quint  <graouts@apple.com>
2898
2899         Log when scripted animations get suspended and resumed
2900         https://bugs.webkit.org/show_bug.cgi?id=173751
2901
2902         Reviewed by Dean Jackson.
2903
2904         More work toward understanding why rAF callbacks are not serviced on bots (webkit.org/b/173628).
2905
2906         * dom/Document.cpp:
2907         (WebCore::Document::requestAnimationFrame):
2908         * dom/ScriptedAnimationController.cpp:
2909         (WebCore::ScriptedAnimationController::suspend):
2910         (WebCore::ScriptedAnimationController::resume):
2911         (WebCore::ScriptedAnimationController::logSuspendCount): Deleted.
2912         * dom/ScriptedAnimationController.h:
2913         * page/Page.cpp:
2914         (WebCore::Page::suspendScriptedAnimations):
2915         (WebCore::Page::resumeScriptedAnimations):
2916         (WebCore::Page::setIsVisibleInternal):
2917
2918 2017-06-22  Zalan Bujtas  <zalan@apple.com>
2919
2920         REGRESSION(r214712): Infinite recursion in RenderTable::layout in paginated mode
2921         https://bugs.webkit.org/show_bug.cgi?id=173731
2922         <rdar://problem/32237775>
2923
2924         Reviewed by Antti Koivisto.
2925
2926         We should just skip bottom captions to check if section is moved, since they don't affect
2927         the section position (bottom <caption> is preceded by <tfoot>).
2928
2929         Test: fast/table/caption-bottom-with-pagination.html
2930
2931         * rendering/RenderTable.cpp:
2932         (WebCore::RenderTable::layout):
2933
2934 2017-06-22  Dean Jackson  <dino@apple.com>
2935
2936         REGRESSION (r215809): 50% regression 14E305 -> 15A293a in MotionMark Suits test
2937         https://bugs.webkit.org/show_bug.cgi?id=173728
2938         <rdar://problem/32526744>
2939
2940         Reviewed by Tim Horton.
2941
2942         It turns out that CGGradientCreateWithColors is much slower than
2943         CGGradientCreateWithColorComponents, even without colorspace variations.
2944         Update the gradient creation code to only use this slower path
2945         when it has extended colors.
2946
2947         * platform/graphics/Color.h: Add a FIXME about renaming some methods.
2948         * platform/graphics/cg/GradientCG.cpp: Use CGGradientCreateWithColorComponents
2949         if we have stops that are not extended colors.
2950         (WebCore::Gradient::platformGradient):
2951
2952 2017-06-22  Youenn Fablet  <youenn@apple.com>
2953
2954         Fix memory leak in LibWebRTCMediaEndpoint
2955         https://bugs.webkit.org/show_bug.cgi?id=173717
2956
2957         Reviewed by Eric Carlson.
2958
2959         No chnage of behavior.
2960         Making sure SessionDescription pointer get properly released.
2961
2962         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2963         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
2964         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2965         * testing/MockLibWebRTCPeerConnection.cpp: Allocating description.
2966
2967 2017-06-22  Daniel Bates  <dabates@apple.com>
2968
2969         Make FrameLoadRequest a move-only type
2970         https://bugs.webkit.org/show_bug.cgi?id=173682
2971
2972         Reviewed by Alex Christensen and Darin Adler.
2973
2974         A FrameLoadRequest groups together the information to perform a load into a single object
2975         that is more manageable to pass around than its constituent parts. Code that receives a
2976         FrameLoadRequest is expected to extract out the information it needs to complete its task.
2977         And it does not make sense to re-use the same FrameLoadRequest object for more than one
2978         load. Therefore, it is sufficient to make FrameLoadRequest a move-only type.
2979
2980         * inspector/InspectorFrontendClientLocal.cpp:
2981         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2982         * inspector/InspectorPageAgent.cpp:
2983         (WebCore::InspectorPageAgent::navigate):
2984         * loader/FrameLoadRequest.h:
2985         * loader/FrameLoader.cpp:
2986         (WebCore::FrameLoader::changeLocation):
2987         (WebCore::FrameLoader::urlSelected):
2988         (WebCore::FrameLoader::loadURLIntoChildFrame):
2989         (WebCore::FrameLoader::loadFrameRequest):
2990         (WebCore::FrameLoader::loadURL):
2991         (WebCore::FrameLoader::load):
2992         (WebCore::FrameLoader::loadPostRequest):
2993         (WebCore::createWindow):
2994         * loader/FrameLoader.h:
2995         * loader/NavigationScheduler.cpp:
2996         (WebCore::NavigationScheduler::scheduleLocationChange):
2997         * page/ContextMenuController.cpp:
2998         (WebCore::openNewWindow):
2999         (WebCore::ContextMenuController::contextMenuItemSelected):
3000         * page/DOMWindow.cpp:
3001         (WebCore::DOMWindow::createWindow):
3002         * replay/UserInputBridge.cpp:
3003         (WebCore::UserInputBridge::loadRequest):
3004         * replay/UserInputBridge.h:
3005
3006 2017-06-22  Jer Noble  <jer.noble@apple.com>
3007
3008         REGRESSION (r217223): [iOS] Video keeps playing after application is backgrounded
3009         https://bugs.webkit.org/show_bug.cgi?id=173727
3010
3011         Reviewed by Eric Carlson.
3012
3013         Only override media element visibility if it is in picture-in-picture mode (not fullscreen generally).
3014
3015         * html/HTMLMediaElement.cpp:
3016         (WebCore::HTMLMediaElement::visibilityStateChanged):
3017
3018 2017-06-22  Joseph Pecoraro  <pecoraro@apple.com>
3019
3020         Follow-up to r218662. Only log backtraces for DumpRenderTree.
3021
3022         Rubber-stamped by Antoine Quint.
3023
3024         * dom/ScriptedAnimationController.cpp:
3025         (WebCore::ScriptedAnimationController::logSuspendCount):
3026
3027 2017-06-22  Charlie Turner  <cturner@igalia.com>
3028
3029         [GTK] Spreaker live shows won't play
3030         https://bugs.webkit.org/show_bug.cgi?id=173306
3031
3032         Reviewed by Xabier Rodriguez-Calvar.
3033
3034         This was due to removing the code that negotiated caps for Icecast
3035         streams based on the response headers in r191947. The problem is that
3036         the typefind element can sometimes squint hard enough and see an MP3
3037         stream and attempt to play it, resulting in garbled audio playback. More
3038         commonly typefind fails to recognize the Icecast stream and bails,
3039         resulting in no playback at all.
3040
3041         r191947 also removed the emission of metadata into the pipeline. This
3042         patch also leaves that out since we have no use for it within WebKit.
3043
3044         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3045         (StreamingClient::handleResponseReceived):
3046
3047 2017-06-22  Matt Lewis  <jlewis3@apple.com>
3048
3049         Unreviewed, rolling out r218633.
3050
3051         The test is failing frequently on Sierra Debug and Windows
3052
3053         Reverted changeset:
3054
3055         "AX: Cannot call setValue() on contenteditable or ARIA text
3056         controls"
3057         https://bugs.webkit.org/show_bug.cgi?id=173520
3058         http://trac.webkit.org/changeset/218633
3059
3060 2017-06-22  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3061
3062         [Readable Streams API] Implement ReadableStreamBYOBReader read()
3063         https://bugs.webkit.org/show_bug.cgi?id=172714
3064
3065         Reviewed by Youenn Fablet.
3066
3067         Implemented read() method of ReadableStreamBYOBReader [1]. Also added code related 
3068         to BYOB features that were previously described as FIXMEs and that now become reachable.
3069
3070         In addition, WPT tests that involve read() have allowed to identify 2 bugs not directly 
3071         related to read() (172716 and 172717). They will be fixed distinctly. Once done, all WPT
3072         tests should pass.
3073
3074         [1] https://streams.spec.whatwg.org/#byob-reader-read
3075
3076         WPT tests (web-platform-tests/streams/readable-byte-streams/general.js) already cover
3077         most cases for read() usage. Corresponding expectations have been updated. In addition,
3078         1 test has been added to WebKit tests (in streams/readable-stream-byob-reader.js) to 
3079         check that read() can only be applied to a ReadableStreamBYOBReader.
3080
3081         * Modules/streams/ReadableByteStreamInternals.js:
3082         (readableByteStreamControllerClearPendingPullIntos): Implemented.
3083         (readableByteStreamControllerEnqueue): Updated with support for BYOBReader.
3084         (readableByteStreamControllerPullInto): Added.
3085         (readableStreamAddReadIntoRequest): Added.
3086         * Modules/streams/ReadableStreamBYOBReader.js:
3087         (read): Added.
3088
3089 2017-06-22  Youenn Fablet  <youenn@apple.com>
3090
3091         [WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder on Mac
3092         https://bugs.webkit.org/show_bug.cgi?id=172602
3093         <rdar://problem/32407693>
3094
3095         Reviewed by Eric Carlson.
3096
3097         Test: platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html
3098
3099         Add internal API to switch on/off hardware H264 encoder.
3100         Add checks for standard size. If using a software encoder and frame size is not standard,
3101         the session is destroyed and no frame is sent at all.
3102
3103         Added tests based on captureStream.
3104         Fixed the case of capturing a canvas which size is changing.
3105
3106         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
3107         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
3108         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h:
3109         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
3110         (WebCore::H264VideoToolboxEncoder::setHardwareEncoderForWebRTCAllowed):
3111         (WebCore::H264VideoToolboxEncoder::hardwareEncoderForWebRTCAllowed):
3112         (WebCore::isUsingSoftwareEncoder):
3113         (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
3114         (isStandardFrameSize): Added.
3115         (isUsingSoftwareEncoder): Added.
3116         * testing/Internals.cpp:
3117         (WebCore::Internals::setH264HardwareEncoderAllowed):
3118         * testing/Internals.h:
3119         * testing/Internals.idl:
3120
3121 2017-06-21  Youenn Fablet  <youenn@apple.com>
3122
3123         [Fetch API] TypeError when called with body === {}
3124         https://bugs.webkit.org/show_bug.cgi?id=173295
3125         <rdar://problem/32746733>
3126
3127         Reviewed by Sam Weinig.
3128
3129         Test: fetch/body-init.html
3130
3131         Handling body of Request and Response using binding generator to correctly handle unions.
3132         The biggest change is that any value that is not a specific type in the union will match a String.
3133         This is matching WebIDL spec and Firefox behavior.
3134
3135         Handling of ReadableStream bodies remains in JS builtin for Response.
3136         This allows easier handling cloning and consumption of body.
3137         Adding setBodyAsReadableStream since this is no longer handled by extractBody.
3138
3139         * Modules/fetch/FetchBody.cpp:
3140         (WebCore::FetchBody::extract): Using Variant instead of JSC::JSValue.
3141         (WebCore::FetchBody::readableStreamBody): Introduced to handle the
3142         case of readable stream bodies.
3143         * Modules/fetch/FetchBody.h:
3144         * Modules/fetch/FetchBodyOwner.cpp:
3145         (WebCore::FetchBodyOwner::extractBody):
3146         * Modules/fetch/FetchBodyOwner.h:
3147         (WebCore::FetchBodyOwner::setBody):
3148         * Modules/fetch/FetchRequest.cpp:
3149         (WebCore::FetchRequest::setBody): Splitting setBody for ease of readability.
3150         (WebCore::FetchRequest::setBodyFromInputRequest):
3151         * Modules/fetch/FetchRequest.h:
3152         * Modules/fetch/FetchRequest.idl:
3153         * Modules/fetch/FetchRequest.js:
3154         (initializeFetchRequest):
3155         * Modules/fetch/FetchResponse.cpp:
3156         (WebCore::FetchResponse::initializeWith):
3157         (WebCore::FetchResponse::setBodyAsReadableStream):
3158         * Modules/fetch/FetchResponse.h:
3159         * Modules/fetch/FetchResponse.idl:
3160         * Modules/fetch/FetchResponse.js:
3161         (initializeFetchResponse):
3162         * WebCore.xcodeproj/project.pbxproj:
3163         * bindings/js/WebCoreBuiltinNames.h:
3164
3165 2017-06-21  Simon Fraser  <simon.fraser@apple.com>
3166
3167         Add z-index to compositing logging output
3168         https://bugs.webkit.org/show_bug.cgi?id=173684
3169
3170         Reviewed by Zalan Bujtas.
3171
3172         Show z-index, which is often useful to find negative z-index items.
3173
3174         Log "+foreground" rather than "foreground" to indicate that this layer has an
3175         additional foreground/background layer, and fix spacing.
3176
3177         * rendering/RenderLayerCompositor.cpp:
3178         (WebCore::RenderLayerCompositor::logLayerInfo):
3179
3180 2017-06-21  Chris Dumez  <cdumez@apple.com>
3181
3182         Unreviewed, fix Window Debug build after r218660.
3183
3184         * rendering/SimpleLineLayout.cpp:
3185         (WebCore::SimpleLineLayout::canUseForWithReason):
3186
3187 2017-06-21  Andreas Kling  <akling@apple.com>
3188
3189         Increase memory kill limits for WebContent processes that manage multiple tabs.
3190         https://bugs.webkit.org/show_bug.cgi?id=173674
3191
3192         Reviewed by Geoffrey Garen.
3193
3194         Plumb the non-utility Page count down to WTF::MemoryPressureHandler.
3195
3196         * page/Page.cpp:
3197         (WebCore::Page::Page):
3198         (WebCore::Page::~Page):
3199
3200 2017-06-21  Jiewen Tan  <jiewen_tan@apple.com>
3201
3202         [WebCrypto] Restore ordering of CryptoAlgorithmIdentifier in SerializedScriptValue
3203         https://bugs.webkit.org/show_bug.cgi?id=173678
3204         <rdar://problem/32879314>
3205
3206         Reviewed by Sam Weinig.
3207
3208         r218030 reorders the ordering of CryptoAlgorithmIdentifier in SerializedScriptValue,
3209         which introduces backward compatibility issues with CryptoKey objects stored in the
3210         IndexedDB. Hence, we should restore it back.
3211
3212         No tests.
3213
3214         * bindings/js/SerializedScriptValue.cpp:
3215
3216 2017-06-21  Daniel Bates  <dabates@apple.com>
3217
3218         Change FrameLoadRequest from a struct to a class
3219
3220         FrameLoadRequest is underutilizing the purpose of a struct - default visibility of
3221         members is public, as FrameLoadRequest explicitly groups its members under public:
3222         or private: sections. Maybe in the future we can make FrameLoadRequest a struct
3223         with only public members. For now, we should consider FrameLoadRequest a class.
3224
3225         * loader/FormSubmission.h:
3226         * loader/FrameLoadRequest.h:
3227         * loader/FrameLoader.h:
3228         * page/Chrome.h:
3229         * page/ChromeClient.h:
3230         * replay/UserInputBridge.h:
3231
3232 2017-06-21  Daewoong Jang  <daewoong.jang@navercorp.com>
3233
3234         Compiler error while building with !HAVE(ACCESSIBILITY)
3235         https://bugs.webkit.org/show_bug.cgi?id=173670
3236
3237         Reviewed by Chris Fleizach.
3238
3239         * accessibility/AXObjectCache.h:
3240         (WebCore::AXObjectCache::getOrCreate):
3241         (WebCore::AXObjectCache::childrenChanged):
3242
3243 2017-06-21  Antoine Quint  <graouts@apple.com>
3244
3245         Build fix.
3246
3247         Reviewed by Tim "Mr. T" Horton.
3248
3249         * dom/ScriptedAnimationController.cpp:
3250         (WebCore::ScriptedAnimationController::logSuspendCount):
3251         * page/Page.cpp:
3252         (WebCore::Page::suspendScriptedAnimations):
3253         (WebCore::Page::resumeScriptedAnimations):
3254
3255 2017-06-21  Antoine Quint  <graouts@apple.com>
3256
3257         Ensure DRT always logs rAF suspension debugging code
3258         https://bugs.webkit.org/show_bug.cgi?id=173681
3259
3260         Reviewed by Tim "Mr. T" Horton.
3261
3262         Instead of using a setting to check whether we should log information related to rAF
3263         callbacks being suspended with WK1, we now check whether we're using in DRT to avoid
3264         any potential issue with settings being in the incorrect state when a test is run.
3265
3266         * dom/ScriptedAnimationController.cpp:
3267         (WebCore::ScriptedAnimationController::logSuspendCount):
3268         * page/Page.cpp:
3269         (WebCore::Page::suspendScriptedAnimations):
3270         (WebCore::Page::resumeScriptedAnimations):
3271         * page/Settings.in:
3272         * platform/RuntimeApplicationChecks.h:
3273         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3274         (WebCore::MacApplication::isDumpRenderTree):
3275
3276 2017-06-21  Chris Dumez  <cdumez@apple.com>
3277
3278         Allow constructing a WTF:Function from a function pointer
3279         https://bugs.webkit.org/show_bug.cgi?id=173660
3280
3281         Reviewed by Alex Christensen.
3282
3283         Construct WTF:Function directly from a function pointer when possible
3284         instead of constructing a lambda to do so.
3285
3286         * Modules/encryptedmedia/InitDataRegistry.cpp:
3287         (WebCore::InitDataRegistry::InitDataRegistry):
3288         * page/Page.cpp:
3289         * page/mac/PageMac.mm:
3290         (WebCore::Page::platformInitialize):
3291         * platform/cf/MainThreadSharedTimerCF.cpp:
3292         (WebCore::setupPowerObserver):
3293         * platform/mac/WebCoreNSURLExtras.mm:
3294         * rendering/SimpleLineLayout.cpp:
3295         (WebCore::SimpleLineLayout::canUseForWithReason):
3296         * workers/Worker.cpp:
3297         (WebCore::Worker::Worker):
3298
3299 2017-06-21  Antoine Quint  <graouts@apple.com>
3300
3301         CSS text properties affect <video> shadow root
3302         https://bugs.webkit.org/show_bug.cgi?id=173664
3303         <rdar://problem/32904328>
3304
3305         Reviewed by Dean Jackson.
3306
3307         Ensure that we reset all inheritable styles back to their initial value for media shadow roots.
3308
3309         Test: media/modern-media-controls/time-label/time-label-inherited-text-indent.html
3310
3311         * Modules/modern-media-controls/controls/media-controls.css:
3312         (.media-controls-container):
3313
3314 2017-06-20  Simon Fraser  <simon.fraser@apple.com>
3315
3316         Remove WILL_REVEAL_EDGE_EVENTS code
3317         https://bugs.webkit.org/show_bug.cgi?id=173632
3318
3319         Reviewed by Sam Weinig, Beth Dakin.
3320
3321         Remove will-reveal-edge events, which never took off.
3322
3323         * dom/Document.cpp:
3324         (WebCore::Document::clearScriptedAnimationController):
3325         (WebCore::Document::sendWillRevealEdgeEventsIfNeeded): Deleted.
3326         * dom/Document.h:
3327         * dom/GlobalEventHandlers.idl:
3328         * html/HTMLBodyElement.idl:
3329         * html/HTMLFrameSetElement.idl:
3330         * page/FrameView.cpp:
3331         (WebCore::FrameView::scrollPositionChanged):
3332         * rendering/RenderLayer.cpp:
3333         (WebCore::RenderLayer::scrollTo):
3334
3335 2017-06-21  Daniel Bates  <dabates@apple.com>
3336
3337         Cleanup FrameLoadRequest
3338         https://bugs.webkit.org/show_bug.cgi?id=173564
3339         <rdar://problem/32903570>
3340
3341         Reviewed by Brent Fulgham.
3342
3343         FrameLoadRequest has too many constructors. Use default values to reduce the number of
3344         constructors. Have FrameLoadRequest hold a Ref<SecurityOrigin> instead of a RefPtr<SecurityOrigin>
3345         as FrameLoadRequest must always hold a valid SecurityOrigin, the security origin of the
3346         document that initiated the request.
3347
3348         * inspector/InspectorFrontendClientLocal.cpp:
3349         (WebCore::InspectorFrontendClientLocal::openInNewTab): Explicitly pass the null-string for
3350         the target frame name as we do not have one. Use C++11 brace initialization syntax and ASCIILiteral().
3351         Rename local variable from request to frameLoadRequest to better describe its purpose. Fix up
3352         FIXME comment added in r105600 to better describe the issue we should fix as the code as
3353         changed since the FIXME was added.
3354         * inspector/InspectorPageAgent.cpp:
3355         (WebCore::InspectorPageAgent::navigate): No need to pass ShouldReplaceDocumentIfJavaScriptURL::ReplaceDocumentIfJavaScriptURL
3356         now that the FrameLoadRequests constructor uses this policy by default. Use C++11 brace
3357         initialization syntax and ASCIILiteral(). Rename local variable from frameRequest to frameLoadRequest
3358         to better describe its purpose.
3359         * loader/FrameLoadRequest.cpp:
3360         (WebCore::FrameLoadRequest::FrameLoadRequest): Use C++11 brace initialization syntax.
3361         * loader/FrameLoadRequest.h: Remove many constructor overloads. Changed m_requester from
3362         RefPtr<SecurityOrigin> to Ref<SecurityOrigin> as we can never be instantiated with a null
3363         SecurityOrigin. Moved m_shouldCheckNewWindowPolicy to be under ShouldOpenExternalURLsPolicy
3364         to reduce the size of the class by 8 bytes.
3365         * loader/FrameLoadRequest.h:
3366         (WebCore::FrameLoadRequest::FrameLoadRequest): Added copy constructor as we must use Ref::copyRef()
3367         to copy the Ref<SecurityOrigin>.
3368         (WebCore::FrameLoadRequest::requester): Return a const SecurityOrigin& instead of a const SecurityOrigin*.
3369         * loader/FrameLoader.cpp:
3370         (WebCore::FrameLoader::urlSelected): Update now that the order of the ShouldReplaceDocumentIfJavaScriptURL
3371         and ShouldOpenExternalURLsPolicy arguments in the FrameLoadRequest constructor has changed.
3372         (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto. Also use C++11 brace initialization syntax
3373         and ASCIILiteral().
3374         (WebCore::FrameLoader::loadFrameRequest): Update code now that FrameLoadRequest::requester() returns a
3375         SecurityOrigin& instead of a SecurityOrigin*. Use C++11 brace initialization syntax.
3376         * loader/NavigationScheduler.cpp:
3377         (WebCore::NavigationScheduler::scheduleLocationChange): Use C++11 brace initialization syntax.
3378         Rename local variable from frameRequest to frameLoadRequest to better describe its purpose.
3379         * page/ContextMenuController.cpp:
3380         (WebCore::openNewWindow):
3381         (WebCore::ContextMenuController::contextMenuItemSelected): ove FrameLoadRequest instantiation
3382         into a local variable and use C++11 brace initialization syntax to make it easier to identify
3383         the arguments passed to FrameLoader::loadFrameRequest().
3384         * page/DOMWindow.cpp:
3385         (WebCore::DOMWindow::createWindow): Update now that the order of the ShouldReplaceDocumentIfJavaScriptURL
3386         and ShouldOpenExternalURLsPolicy arguments in the FrameLoadRequest constructor has changed.
3387         Use C++11 brace initialization syntax and ASCIILiteral(). Rename some local variables to better
3388         describe their purpose.
3389
3390 2017-06-20  Simon Fraser  <simon.fraser@apple.com>
3391
3392         svgPath.getTotalLength() freezes webkit
3393         https://bugs.webkit.org/show_bug.cgi?id=173566
3394         <rdar://problem/32866731>
3395
3396         Reviewed by Dean Jackson.
3397
3398         Ensure that curveLength() progresses by making split() return a bool indicating
3399         whether either of the resulting curves are the same as the original. This can happen
3400         when midPoint() on two close points returns a point that is the same as one of the
3401         arguments because of floating-point precision limitations.
3402
3403         Test: svg/custom/path-getTotalLength-hang.html
3404
3405         * platform/graphics/PathTraversalState.cpp:
3406         (WebCore::QuadraticBezier::operator ==):
3407         (WebCore::QuadraticBezier::split):
3408         (WebCore::CubicBezier::operator ==):
3409         (WebCore::CubicBezier::split):
3410         (WebCore::curveLength):
3411
3412 2017-06-21  Youenn Fablet  <youenn@apple.com>
3413
3414         Fix AVVideoCaptureSource frameRate setter and getter
3415         https://bugs.webkit.org/show_bug.cgi?id=173637
3416
3417         Reviewed by Eric Carlson.
3418
3419         Covered by manual testing.
3420
3421         Using activeVideoMaxFrameDuration to get the frame rate.
3422         Setting the frame rate according the given vale if in the allowed range.
3423
3424         * platform/mediastream/mac/AVVideoCaptureSource.h:
3425         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3426         (WebCore::AVVideoCaptureSource::updateSettings):
3427         (WebCore::AVVideoCaptureSource::applyFrameRate):
3428         (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
3429         (WebCore::AVVideoCaptureSource::shutdownCaptureSession):
3430         (WebCore::AVVideoCaptureSource::processNewFrame):
3431         (WebCore::AVVideoCaptureSource::updateFramerate): Deleted.
3432
3433 2017-06-21  Youenn Fablet  <youenn@apple.com>
3434
3435         Refresh libwebrtc code up to a87675d4a160e2c49c3e754cd9ca291d6c8f36ae
3436         https://bugs.webkit.org/show_bug.cgi?id=173602
3437
3438         Reviewed by Eric Carlson.
3439
3440         No feature change.
3441
3442         Updated according small libwebrtc API changes.
3443
3444         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3445         (WebCore::configurationFromMediaEndpointConfiguration):
3446         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
3447         (WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame):
3448         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3449         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
3450         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
3451
3452 2017-06-21  Sam Weinig  <sam@webkit.org>
3453
3454         Add support for structured serialization of CSS Geometry types
3455         https://bugs.webkit.org/show_bug.cgi?id=173631
3456
3457         Reviewed by Simon Fraser.
3458
3459         Tests: imported/w3c/web-platform-tests/css/geometry-1/structured-serialization.html
3460
3461         Adds support for serializing the new geometry types as specified by:
3462         https://drafts.fxtf.org/geometry-1/#structured-serialization
3463
3464         * WebCore.xcodeproj/project.pbxproj:
3465         Move a few custom bindings into the "GC / Wrapping Only" since they have no more custom operations or attributes.
3466
3467         * bindings/js/SerializedScriptValue.cpp:
3468         (WebCore::CloneSerializer::dumpDOMPoint):
3469         (WebCore::CloneSerializer::dumpDOMRect):
3470         (WebCore::CloneSerializer::dumpDOMMatrix):
3471         (WebCore::CloneSerializer::dumpDOMQuad):
3472         (WebCore::CloneSerializer::dumpIfTerminal):
3473         (WebCore::CloneDeserializer::getJSValue):
3474         (WebCore::CloneDeserializer::readDOMPoint):
3475         (WebCore::CloneDeserializer::readDOMMatrix):
3476         (WebCore::CloneDeserializer::readDOMRect):
3477         (WebCore::CloneDeserializer::readDOMPointInit):
3478         (WebCore::CloneDeserializer::readDOMQuad):
3479         (WebCore::CloneDeserializer::readTerminal):
3480         Add serialization/deserialization of the geometry types.
3481
3482         * css/DOMMatrix.cpp:
3483         (WebCore::DOMMatrix::DOMMatrix):
3484         * css/DOMMatrix.h:
3485         (WebCore::DOMMatrix::create):
3486         * css/DOMMatrixReadOnly.cpp:
3487         (WebCore::DOMMatrixReadOnly::DOMMatrixReadOnly):
3488         * css/DOMMatrixReadOnly.h:
3489         (WebCore::DOMMatrixReadOnly::create):
3490         Add create functions and constructors that take a TransformationMatrix by r-value reference
3491         so they can be moved into the DOM type.
3492
3493 2017-06-21  Andreas Kling  <akling@apple.com>
3494
3495         [iOS] Ensure that GraphicsServices is initialized before calling GSFontPurgeFontCache().
3496         https://bugs.webkit.org/show_bug.cgi?id=173616
3497         <rdar://problem/30780050>
3498
3499         Reviewed by Chris Dumez.
3500
3501         Fix for crash in GSFontPurgeFontCache() seen in apps embedding WebKit.
3502         Ensure GSFontInitialize() has been called first, since the former depends on state
3503         set up by this function.
3504
3505         * page/cocoa/MemoryReleaseCocoa.mm:
3506         (WebCore::platformReleaseMemory):
3507         * platform/spi/ios/GraphicsServicesSPI.h:
3508
3509 2017-06-21  Antoine Quint  <graouts@apple.com>
3510
3511         Add logging to identify when the Page suspends scripted animations
3512         https://bugs.webkit.org/show_bug.cgi?id=173626
3513
3514         Reviewed by Tim Horton.
3515
3516         We have a longstanding issue that some media/modern-media-controls tests time out due to
3517         requestAnimationFrame callbacks not being serviced, which is tracked by webkit.org/b/173628.
3518         We added some logging to identify when ScriptedAnimationController would get suspended in
3519         webkit.org/b/173326. This logging points to the fact that the reason rAF callbacks aren't
3520         serviced is because Document::requestAnimationFrame() suspends rAF when the page reports
3521         that scripted animations ought to be suspended, which is true when m_scriptedAnimationsSuspended
3522         is true. This patch adds logging that tracks when this flag is set, provided a new setting
3523      &