onbeforeunload event return value coercion is not per-spec
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-19  Chris Dumez  <cdumez@apple.com>
2
3         onbeforeunload event return value coercion is not per-spec
4         https://bugs.webkit.org/show_bug.cgi?id=168382
5
6         Reviewed by Darin Adler.
7
8         Update handling of value returned by onbeforeunload event listeners
9         to match Firefox and the specification:
10         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (step 4)
11
12         Namely, the following changes were made:
13         - Only set the event's returnValue attribute to the returned value if the attribute
14           value is the empty string (so as to not override the attribute value if it has
15           explicitly been set by JS).
16         - Cancel the event when the return value is not null by calling preventDefault().
17
18         Additionally, the following changes were made:
19         - Ask the user to confirm the navigation if the event was canceled, not just if the
20           returnValue attribute was set to a non-empty string.
21         as per:
22         - https://html.spec.whatwg.org/#prompt-to-unload-a-document (step 8)
23
24         Tests: fast/events/before-unload-return-string-conversion.html
25                imported/w3c/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html
26
27         * bindings/js/JSEventListener.cpp:
28         (WebCore::handleBeforeUnloadEventReturnValue):
29         (WebCore::JSEventListener::handleEvent):
30         * loader/FrameLoader.cpp:
31         (WebCore::shouldAskForNavigationConfirmation):
32         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
33
34 2017-02-19  Carlos Garcia Campos  <cgarcia@igalia.com>
35
36         [SOUP] Call SoupNetworkSession::setShouldIgnoreTLSErrors when testRunner.setAllowsAnySSLCertificate() is called
37         https://bugs.webkit.org/show_bug.cgi?id=168571
38
39         Reviewed by Michael Catanzaro.
40
41         Fixes: http/tests/ssl/upgrade-origin-usage.html
42
43         * testing/InternalSettings.cpp:
44         (WebCore::InternalSettings::setAllowsAnySSLCertificate):
45
46 2017-02-18  Ryosuke Niwa  <rniwa@webkit.org>
47
48         REGRESSION(r212218): Assertion failures in and after parserRemoveChild
49         https://bugs.webkit.org/show_bug.cgi?id=168458
50
51         Reviewed by Antti Koivisto.
52
53         The bug was caused by parserRemoveChild not preceeding to remove oldChild even when
54         oldChild had been inserted elsewhere during unload evnets of the disconnected frames.
55         Fixed the bug by checking this condition and exiting early.
56
57         Also fixed various callers of parserRemoveChild to not call parserAppendChild when
58         the removed node had already been inserted elsewhere by scripts.
59
60         Tests: fast/parser/adoption-agency-unload-iframe-3.html
61                fast/parser/adoption-agency-unload-iframe-4.html
62                fast/parser/xml-error-unload-iframe.html
63
64         * dom/ContainerNode.cpp:
65         (WebCore::ContainerNode::parserRemoveChild): Exit early when the node had been
66         inserted elsewhere while firing unload events. Also moved the call to
67         notifyRemovePendingSheetIfNeeded outside NoEventDispatchAssertion since it can
68         synchrnously fire a focus event.
69         (WebCore::ContainerNode::parserAppendChild): Moved adoptNode call to inside
70         NoEventDispatchAssertion since adoptNode call here should never mutate DOM.
71         * html/parser/HTMLConstructionSite.cpp:
72         (WebCore::executeReparentTask): Added an early exit when the node had already been
73         inserted elsewhere.
74         (WebCore::executeInsertAlreadyParsedChildTask): Ditto.
75         * xml/XMLErrors.cpp:
76         (WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
77         * xml/parser/XMLDocumentParser.cpp:
78         (WebCore::XMLDocumentParser::end): Fixed a crash unveiled by one of the test cases.
79         Exit early when insertErrorMessageBlock detached the parser (by author scripts).
80         (WebCore::XMLDocumentParser::finish): Keep the parser alive until we exit.
81
82 2017-02-19  Chris Dumez  <cdumez@apple.com>
83
84         <input type=color readonly> doesn't act per spec
85         https://bugs.webkit.org/show_bug.cgi?id=168421
86         <rdar://problem/30593185>
87
88         Reviewed by Ryosuke Niwa.
89
90         The 'readonly' attribute should not apply to <input type=color> as per the
91         HTML specification:
92         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
93
94         Chrome / Firefox and Edge already behave as per the specification.
95
96         Tests: fast/forms/color/input-color-disabled.html
97                fast/forms/color/input-color-readonly.html
98
99         * html/ColorInputType.cpp:
100         (WebCore::ColorInputType::handleDOMActivateEvent):
101         (WebCore::ColorInputType::didChooseColor):
102
103 2017-02-19  Commit Queue  <commit-queue@webkit.org>
104
105         Unreviewed, rolling out r212466.
106         https://bugs.webkit.org/show_bug.cgi?id=168577
107
108         causes crashes on AArch64 on linux, maybe it's causing crashes
109         on iOS too (Requested by pizlo on #webkit).
110
111         Reverted changeset:
112
113         "The collector thread should only start when the mutator
114         doesn't have heap access"
115         https://bugs.webkit.org/show_bug.cgi?id=167737
116         http://trac.webkit.org/changeset/212466
117
118 2017-02-19  Zalan Bujtas  <zalan@apple.com>
119
120         Simple line layout: Implement positionForPoint.
121         https://bugs.webkit.org/show_bug.cgi?id=168565
122         <rdar://problem/30593370>
123
124         Reviewed by Antti Koivisto.
125
126         With this patch, now we don't need to switch over to line box tree anymore when positionForPoint()
127         is called on a single RenderText content (which is the majority of the simple line content).
128         This patch also adds a new positionForPoint method which returns a Position object instead of VisiblePosition.
129         Some of the positionForPoint() callsites are only interested in the Position object so constructing a VisiblePosition
130         (which could potentially kick off a layout) is a waste. At this point the non-simple line layout codepath still constructs
131         a VisiblePosition and that should be addresses as part of webkit.org/b/168566.
132
133         Covered by existing tests.
134
135         * dom/Document.cpp:
136         (WebCore::Document::caretRangeFromPoint):
137         * rendering/RenderBlockFlow.cpp:
138         (WebCore::RenderBlockFlow::positionForPoint):
139         * rendering/RenderBlockFlow.h:
140         * rendering/RenderObject.cpp:
141         (WebCore::RenderObject::positionForPoint):
142         * rendering/RenderObject.h:
143         * rendering/RenderText.cpp:
144         (WebCore::RenderText::positionForPoint):
145         * rendering/RenderText.h:
146         * rendering/SimpleLineLayoutFunctions.cpp:
147         (WebCore::SimpleLineLayout::positionForPoint):
148         * rendering/SimpleLineLayoutFunctions.h:
149         * rendering/SimpleLineLayoutResolver.cpp:
150         (WebCore::SimpleLineLayout::RunResolver::runForPoint):
151         * rendering/SimpleLineLayoutResolver.h:
152         (WebCore::SimpleLineLayout::RunResolver::Run::logicalLeft):
153         (WebCore::SimpleLineLayout::RunResolver::Run::logicalRight):
154
155 2017-02-19  Antti Koivisto  <antti@apple.com>
156
157         Execute pending scripts asynchronously after stylesheet loads complete
158         https://bugs.webkit.org/show_bug.cgi?id=168367
159         rdar://problem/30561379
160
161         Reviewed by Andreas Kling.
162
163         The current synchronous execution is fragile and creates various problems.
164
165         * css/StyleSheetContents.cpp:
166         (WebCore::StyleSheetContents::checkLoaded):
167         * dom/ContainerNode.cpp:
168         (WebCore::ContainerNode::takeAllChildrenFrom):
169         (WebCore::ContainerNode::notifyChildInserted):
170         (WebCore::ContainerNode::removeChild):
171         (WebCore::ContainerNode::parserRemoveChild):
172         (WebCore::ContainerNode::removeChildren):
173
174             Remove various places where we would trigger delayed synchronous execution.
175
176         * dom/Document.cpp:
177         (WebCore::Document::Document):
178         (WebCore::Document::recalcStyle):
179
180             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
181
182         (WebCore::Document::didRemoveAllPendingStylesheet):
183
184             Call asynchronous script execution function.
185
186         * dom/Document.h:
187         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
188         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
189         * dom/ScriptableDocumentParser.cpp:
190         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
191         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
192         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
193
194             Add a timer for executing pending scripts.
195
196         (WebCore::ScriptableDocumentParser::detach):
197         * dom/ScriptableDocumentParser.h:
198         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
199         * html/HTMLLinkElement.cpp:
200         (WebCore::HTMLLinkElement::removedFrom):
201         (WebCore::HTMLLinkElement::removePendingSheet):
202         * html/HTMLLinkElement.h:
203         * html/parser/HTMLDocumentParser.cpp:
204         (WebCore::HTMLDocumentParser::detach):
205         * loader/DocumentLoader.cpp:
206         (WebCore::DocumentLoader::isLoadingInAPISense):
207
208             Stay in loading state if we have a pending script. This matches existing behavior.
209
210         * style/StyleScope.cpp:
211         (WebCore::Style::Scope::removePendingSheet):
212         * style/StyleScope.h:
213
214 2017-02-18  Chris Dumez  <cdumez@apple.com>
215
216         <input type=range readonly> doesn't act per spec
217         https://bugs.webkit.org/show_bug.cgi?id=168422
218         <rdar://problem/30593189>
219
220         Reviewed by Ryosuke Niwa.
221
222         'readonly' attribute should not apply to <input type=range> as per the HTML
223         specification:
224         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
225
226         Firefox and Edge already behave as per the specification.
227
228         No new tests, updated existing tests.
229
230         * html/RangeInputType.cpp:
231         (WebCore::RangeInputType::handleMouseDownEvent):
232         (WebCore::RangeInputType::handleTouchEvent):
233         (WebCore::RangeInputType::handleKeydownEvent):
234         * html/shadow/SliderThumbElement.cpp:
235         (WebCore::SliderThumbElement::defaultEventHandler):
236         (WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
237         (WebCore::SliderThumbElement::willRespondToMouseClickEvents):
238
239 2017-02-18  Chris Dumez  <cdumez@apple.com>
240
241         Recursive MessagePort.postMessage() calls causes tab to become unresponsive
242         https://bugs.webkit.org/show_bug.cgi?id=168548
243         <rdar://problem/29808005>
244
245         Reviewed by Darin Adler.
246
247         MessagePort::dispatchMessages() was getting messages one by one of the
248         channel's MessageQueue and firing the MessageEvent for each of them.
249         The issue is that we can get stuck in an infinite loop if the
250         MessageEvent handler posts a message on the same post.
251
252         To address the issue, we now takes all messages from the queue before
253         iterating over them to fire the event. This way, if new messages are
254         added to the queue in one of the MessageEvent handlers, they will not
255         be processed until the next event loop iteration, as is expected.
256
257         Test: fast/events/message-port-postMessage-recursive.html
258
259         * dom/MessagePort.cpp:
260         (WebCore::MessagePort::dispatchMessages):
261         * dom/MessagePortChannel.h:
262         (WebCore::MessagePortChannel::EventData::EventData):
263         * dom/default/PlatformMessagePortChannel.cpp:
264         (WebCore::MessagePortChannel::postMessageToRemote):
265         * dom/default/PlatformMessagePortChannel.h:
266         (WebCore::PlatformMessagePortChannel::MessagePortQueue::takeMessage):
267         (WebCore::PlatformMessagePortChannel::MessagePortQueue::takeAllMessages):
268         (WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
269
270 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
271
272         Remove COORDINATED_GRAPHICS_MULTIPROCESS
273         https://bugs.webkit.org/show_bug.cgi?id=168514
274
275         Reviewed by Darin Adler.
276
277         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
278         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
279
280 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
281
282         Allow properties in CSSProperties.json that don't trigger code generation
283         https://bugs.webkit.org/show_bug.cgi?id=168535
284
285         Reviewed by Sam Weinig.
286         
287         In order to track the development of CSS properties that we have not yet implemented,
288         support '"skip-codegen" : true' in "codegen-properties".
289
290         Test by adding a few fill-related properties with this attribute.
291
292         * css/CSSProperties.json:
293         * css/makeprop.pl:
294         (isPropertyEnabled):
295         (addProperty):
296
297 2017-02-17  Brian Burg  <bburg@apple.com>
298
299         Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
300         https://bugs.webkit.org/show_bug.cgi?id=168273
301         <rdar://problem/29949325>
302
303         Reviewed by Matt Baker.
304
305         Add the ability to dock Web Inspector to the left of the inspected view.
306         The frontend decides whether the Dock to Side button docks left or right
307         based on the current layout direction.
308
309         * inspector/InspectorFrontendClient.h:
310         * inspector/InspectorFrontendClientLocal.cpp:
311         (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
312         * inspector/InspectorFrontendHost.cpp:
313         (WebCore::InspectorFrontendHost::requestSetDockSide):
314
315 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
316
317         Allow PlatformCALayers to specify that they want deep color backing store
318         https://bugs.webkit.org/show_bug.cgi?id=168495
319
320         Reviewed by Tim Horton.
321         
322         Currently capable iOS devices get deep color backing store by virtue of a supports
323         check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
324
325         Future work will make layer contents format selection more complex, so express the need
326         for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
327         flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
328         is needed to propagte the state to TileControllers.
329         
330         The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
331         instead of RemoteLayerBackingStore looking at the properties of the screen directly.
332
333         Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
334         that we no longer use.
335
336         An iphone7 test verifies that page tiles, normal layers and tiled layers get the deep
337         color state set on them.
338
339         Test: tiled-drawing/ios/iphone7/compositing-layers-deep-color.html
340
341         * platform/graphics/ca/GraphicsLayerCA.cpp:
342         (WebCore::GraphicsLayerCA::createPlatformCALayer):
343         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
344         * platform/graphics/ca/GraphicsLayerCA.h:
345         * platform/graphics/ca/PlatformCALayer.cpp:
346         (WebCore::PlatformCALayer::canHaveBackingStore):
347         (WebCore::operator<<):
348         * platform/graphics/ca/PlatformCALayer.h:
349         * platform/graphics/ca/TileController.cpp:
350         (WebCore::TileController::setZoomedOutContentsScale):
351         (WebCore::TileController::setAcceleratesDrawing):
352         (WebCore::TileController::setWantsDeepColorBackingStore):
353         (WebCore::TileController::createTileLayer):
354         * platform/graphics/ca/TileController.h:
355         * platform/graphics/ca/TileGrid.cpp:
356         (WebCore::TileGrid::updateTileLayerProperties):
357         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
358         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
359         (PlatformCALayerCocoa::PlatformCALayerCocoa):
360         (PlatformCALayerCocoa::commonInit):
361         (PlatformCALayerCocoa::wantsDeepColorBackingStore):
362         (PlatformCALayerCocoa::setWantsDeepColorBackingStore):
363         (layerContentsFormat):
364         (PlatformCALayerCocoa::updateContentsFormat):
365         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
366         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
367         (-[WebTiledBackingLayer setWantsDeepColorBackingStore:]):
368         (-[WebTiledBackingLayer wantsDeepColorBackingStore]):
369         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
370         (PlatformCALayerWin::wantsDeepColorBackingStore):
371         (PlatformCALayerWin::setWantsDeepColorBackingStore):
372         (printLayer):
373         * platform/graphics/ca/win/PlatformCALayerWin.h:
374         * platform/spi/cocoa/QuartzCoreSPI.h:
375
376 2017-02-17  Jer Noble  <jer.noble@apple.com>
377
378         Refactoring: Make sure to unprepare WebAudioSourceProviderAVFObjC when its owner is destroyed.
379         https://bugs.webkit.org/show_bug.cgi?id=168532
380
381         Reviewed by Youenn Fablet.
382
383         Because WebAudioSourceProviderAVFObjC has a back-pointer to the object which creted it, make
384         sure that back-pointer is invalidated once the creating object is destroyed by calling
385         WebAudioSOurceProviderAVFObjC::unprepare().
386
387         Drive-by Fix: In WebAudioSourceProviderAVFObjC::audioSamplesAvailable(), PlatformAudioData will
388         always be of the WebAudioBufferList type. If this ever becomes untrue, an invalid downcast will
389         be caught by downcast<>, so just remove the is<> check.
390
391         * platform/mediastream/mac/AVAudioCaptureSource.mm:
392         (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource):
393         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
394         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
395         (WebCore::MockRealtimeAudioSourceMac::~MockRealtimeAudioSourceMac):
396         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
397         (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
398         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
399         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
400         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
401         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
402         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
403         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
404
405 2017-02-17  Antoine Quint  <graouts@apple.com>
406
407         [Modern Media Controls] Improve handling of <video> with only audio tracks
408         https://bugs.webkit.org/show_bug.cgi?id=167836
409         <rdar://problem/30255812>
410
411         Reviewed by Dean Jackson.
412
413         We now check for the availability of video tracks before considering a <video>
414         element is displaying an actual video file and turning auto-hide on. We also
415         check that we have video tracks before enabling the fullscreen button. This
416         brings the behavior of a <video> pointing to a resource with no video tracks
417         to be the same as an <audio> element.
418
419         Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
420
421         * Modules/modern-media-controls/media/controls-visibility-support.js:
422         (ControlsVisibilitySupport.prototype.get tracksToMonitor):
423         (ControlsVisibilitySupport.prototype._updateControls):
424         (ControlsVisibilitySupport):
425         * Modules/modern-media-controls/media/fullscreen-support.js:
426         (FullscreenSupport.prototype.syncControl):
427         (FullscreenSupport):
428
429 2017-02-17  Antoine Quint  <graouts@apple.com>
430
431         [Modern Media Controls] Toggle playback when clicking on the video on macOS
432         https://bugs.webkit.org/show_bug.cgi?id=168515
433         <rdar://problem/30577441>
434
435         Reviewed by Dean Jackson.
436
437         Listen to click events on the macOS media controls. Detect any clicks that were on the
438         background instead of the controls widgets themselves, and tell the delegate (MediaController)
439         about them.
440
441         Tests: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause.html
442                media/modern-media-controls/media-controller/media-controller-click-on-video-background-to-dismiss-tracks-panel-should-not-toggle-playback.html
443                media/modern-media-controls/media-controller/media-controller-click-on-video-controls-should-not-pause.html
444
445         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
446         (MacOSFullscreenMediaControls.prototype._handleMousedown):
447         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
448         (MacOSInlineMediaControls.prototype.handleEvent):
449         * Modules/modern-media-controls/controls/macos-media-controls.js:
450         (MacOSMediaControls.prototype.handleEvent):
451         (MacOSMediaControls):
452         * Modules/modern-media-controls/media/media-controller.js:
453         (MediaController.prototype.togglePlayback):
454         (MediaController.prototype.macOSControlsBackgroundWasClicked):
455         (MediaController.prototype._updateControlsIfNeeded):
456         * Modules/modern-media-controls/media/playback-support.js:
457         (PlaybackSupport.prototype.buttonWasPressed):
458
459 2017-02-17  Jer Noble  <jer.noble@apple.com>
460
461         Refactoring: Remove AudioSourceObserverObjC and AudioCaptureSourceProviderObjC
462         https://bugs.webkit.org/show_bug.cgi?id=168520
463
464         Reviewed by Youenn Fablet.
465
466         Having AudioCaptureSourceProviderObjC as the type provided to WebAudioSourceProviderAVFObjC
467         (and only ever to WebAudioSourceProviderAVFObjC) makes it impossible for that class to add
468         an observer on RealtimeMediaSource, of which all classes inheriting from
469         WebAudioSourceProviderAVFObjC are subclasses. There is no need to treat
470         WebAudioSourceProviderAVFObjC as an "observer", since the only thing it will ever observe is
471         the object which created it and hold an explicit reference to it. So replace all instances
472         of the "observer" pattern with direct calls to the necessary (newly non-virtual) methods.
473         This allows WebAudioSourceProviderAVFObjC to register as an observer directly on
474         RealtimeMediaSource, to listen for audioSamplesAvailable() instead of process(), and remove
475         a lot of unnecessary conversion code and observer duplication.
476
477         * WebCore.xcodeproj/project.pbxproj:
478         * platform/mediastream/RealtimeMediaSource.h:
479         (WebCore::RealtimeMediaSource::Observer::sourceStopped):
480         (WebCore::RealtimeMediaSource::Observer::sourceMutedChanged):
481         (WebCore::RealtimeMediaSource::Observer::sourceEnabledChanged):
482         (WebCore::RealtimeMediaSource::Observer::sourceSettingsChanged):
483         (WebCore::RealtimeMediaSource::Observer::preventSourceFromStopping):
484         * platform/mediastream/mac/AVAudioCaptureSource.h:
485         * platform/mediastream/mac/AVAudioCaptureSource.mm:
486         (WebCore::AVAudioCaptureSource::shutdownCaptureSession):
487         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
488         (WebCore::AVAudioCaptureSource::addObserver): Deleted.
489         (WebCore::AVAudioCaptureSource::removeObserver): Deleted.
490         (WebCore::AVAudioCaptureSource::start): Deleted.
491         * platform/mediastream/mac/AudioCaptureSourceProviderObjC.h: Removed.
492         * platform/mediastream/mac/AudioSourceObserverObjC.h: Removed.
493         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
494         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
495         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
496         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
497         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
498         (WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
499         (WebCore::MockRealtimeAudioSourceMac::addObserver): Deleted.
500         (WebCore::MockRealtimeAudioSourceMac::removeObserver): Deleted.
501         (WebCore::MockRealtimeAudioSourceMac::start): Deleted.
502         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
503         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
504         (WebCore::RealtimeIncomingAudioSource::addObserver): Deleted.
505         (WebCore::RealtimeIncomingAudioSource::removeObserver): Deleted.
506         (WebCore::RealtimeIncomingAudioSource::start): Deleted.
507         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
508         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
509         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
510         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
511         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
512         (WebCore::WebAudioSourceProviderAVFObjC::create):
513         (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
514         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
515         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
516         (WebCore::WebAudioSourceProviderAVFObjC::process): Deleted.
517
518 2017-02-17  Antoine Quint  <graouts@apple.com>
519
520         REGRESSION: Subtitles menu in media controls allows multiple items to be selected
521         https://bugs.webkit.org/show_bug.cgi?id=168168
522         <rdar://problem/30488605>
523
524         Reviewed by Dean Jackson.
525
526         Ensure that only a single audio track and a single text track can be selected
527         in the tracks panel at any given point.
528
529         * Modules/modern-media-controls/media/tracks-support.js:
530         (TracksSupport.prototype.tracksPanelSelectionDidChange):
531         (TracksSupport.prototype._sortedTrackList):
532         (TracksSupport):
533
534 2017-02-17  Jeremy Jones  <jeremyj@apple.com>
535
536         Invalidate WebAVSampleBufferStatusChangeListener when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
537         https://bugs.webkit.org/show_bug.cgi?id=168488
538
539         Reviewed by Jer Noble.
540
541         Fixes periodically crashing test: fast/mediastream/MediaStream-video-element-track-stop.html
542
543         WebAVSampleBufferStatusChangeListener has an unretained referecne to MediaPlayerPrivateMediaStreamAVFObjC
544         that must be invaldated when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
545
546         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
547         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
548
549 2017-02-17  Antoine Quint  <graouts@apple.com>
550
551         [Modern Media Controls] Improve handling of live broadcast video
552         https://bugs.webkit.org/show_bug.cgi?id=168506
553         <rdar://problem/30432094>
554
555         Reviewed by Dean Jackson.
556
557         We improve the handling of live broadcast video by:
558         
559             - checking that we have a media source before deciding to show the controls
560               bar and start button
561             - support a mode where neither the status text nor the scrubber is visible
562               in case we're still waiting on sufficient data to determine the video
563               time and we haven't really started loading data yet
564             - not showing time labels when we have an infinite duration
565             - ensuring the status label is left-aligned
566
567         Test: media/modern-media-controls/status-label/status-label-text-align.html
568
569         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
570         (MacOSInlineMediaControls.prototype.layout):
571         * Modules/modern-media-controls/controls/status-label.css:
572         (.status-label):
573         * Modules/modern-media-controls/controls/status-label.js:
574         (StatusLabel.prototype.get enabled):
575         (StatusLabel.prototype.set enabled):
576         * Modules/modern-media-controls/media/controls-visibility-support.js:
577         (ControlsVisibilitySupport.prototype._updateControls):
578         (ControlsVisibilitySupport):
579         * Modules/modern-media-controls/media/status-support.js:
580         (StatusSupport.prototype.syncControl):
581         (StatusSupport):
582         * Modules/modern-media-controls/media/time-labels-support.js:
583         (TimeLabelsSupport.prototype.syncControl):
584         (TimeLabelsSupport):
585
586 2017-02-17  Anders Carlsson  <andersca@apple.com>
587
588         Begin overhauling the pasteboard implementation
589         https://bugs.webkit.org/show_bug.cgi?id=168525
590
591         Reviewed by Tim Horton.
592
593         Add a new PasteboardWriterData object. This object will hold data that is going
594         to be written to the pasteboard at some point. Currently it only supports plain text.
595
596         Also add a Mac-only PasteboardWriter class which can convert a PasteboardWriterDataObject
597         into an object that conforms to NSPasteboardWriting.
598
599         The basic idea is that instead of doing a bunch of pasteboard operations,
600         we'll just package all the pasteboard data up into an object and ship it over to WebKit.
601
602         This code is currently unused but will be adopted by a new drag implementation (in an upcoming patch).
603
604         * WebCore.xcodeproj/project.pbxproj:
605         * platform/PasteboardWriterData.cpp: Added.
606         (WebCore::PasteboardWriterData::PasteboardWriterData):
607         (WebCore::PasteboardWriterData::~PasteboardWriterData):
608         (WebCore::PasteboardWriterData::isEmpty):
609         (WebCore::PasteboardWriterData::setPlainText):
610         * platform/PasteboardWriterData.h: Added.
611         * platform/mac/PasteboardWriter.h: Added.
612         * platform/mac/PasteboardWriter.mm: Added.
613         (WebCore::createPasteboardWriting):
614         * platform/spi/mac/NSPasteboardSPI.h: Added.
615
616 2017-02-17  Per Arne Vollan  <pvollan@apple.com>
617
618         Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text.
619         https://bugs.webkit.org/show_bug.cgi?id=168044
620         rdar://problem/30165746
621
622         Reviewed by Simon Fraser.
623
624         This patch moves these styles out of svg, and sets the properties on video cues.
625
626         Tests: fast/css/parsing-paint-order.html
627                fast/css/parsing-stroke-linecap.html
628                fast/css/parsing-stroke-linejoin.html
629                fast/css/parsing-stroke-width.html
630
631         * css/CSSComputedStyleDeclaration.cpp:
632         (WebCore::paintOrder):
633         (WebCore::ComputedStyleExtractor::propertyValue):
634         * css/CSSProperties.json:
635         * css/SVGCSSComputedStyleDeclaration.cpp:
636         (WebCore::ComputedStyleExtractor::svgPropertyValue):
637         (WebCore::paintOrder): Deleted.
638         * css/StyleResolver.cpp:
639         (WebCore::StyleResolver::isValidCueStyleProperty):
640         * page/CaptionUserPreferencesMediaAF.cpp:
641         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor):
642         * rendering/style/RenderStyle.cpp:
643         (WebCore::RenderStyle::diff):
644         (WebCore::RenderStyle::paintTypesForPaintOrder):
645         * rendering/style/RenderStyle.h:
646         (WebCore::RenderStyle::setPaintOrder):
647         (WebCore::RenderStyle::paintOrder):
648         (WebCore::RenderStyle::initialPaintOrder):
649         (WebCore::RenderStyle::setCapStyle):
650         (WebCore::RenderStyle::capStyle):
651         (WebCore::RenderStyle::initialCapStyle):
652         (WebCore::RenderStyle::setJoinStyle):
653         (WebCore::RenderStyle::joinStyle):
654         (WebCore::RenderStyle::initialJoinStyle):
655         (WebCore::RenderStyle::strokeWidth):
656         (WebCore::RenderStyle::setStrokeWidth):
657         (WebCore::RenderStyle::hasVisibleStroke):
658         (WebCore::RenderStyle::setStrokeOpacity):
659         * rendering/style/SVGRenderStyle.cpp:
660         (WebCore::SVGRenderStyle::diff):
661         (WebCore::SVGRenderStyle::paintTypesForPaintOrder): Deleted.
662         * rendering/style/SVGRenderStyle.h:
663         (WebCore::SVGRenderStyle::initialBufferedRendering):
664         (WebCore::SVGRenderStyle::initialFillRule):
665         (WebCore::SVGRenderStyle::initialMaskType):
666         (WebCore::SVGRenderStyle::setBufferedRendering):
667         (WebCore::SVGRenderStyle::setFillRule):
668         (WebCore::SVGRenderStyle::setMaskType):
669         (WebCore::SVGRenderStyle::bufferedRendering):
670         (WebCore::SVGRenderStyle::fillRule):
671         (WebCore::SVGRenderStyle::strokeMiterLimit):
672         (WebCore::SVGRenderStyle::maskType):
673         (WebCore::SVGRenderStyle::hasStroke):
674         (WebCore::SVGRenderStyle::setBitDefaults):
675         (WebCore::SVGRenderStyle::InheritedFlags::operator==):
676         (WebCore::SVGRenderStyle::initialCapStyle): Deleted.
677         (WebCore::SVGRenderStyle::initialJoinStyle): Deleted.
678         (WebCore::SVGRenderStyle::initialPaintOrder): Deleted.
679         (WebCore::SVGRenderStyle::setCapStyle): Deleted.
680         (WebCore::SVGRenderStyle::setJoinStyle): Deleted.
681         (WebCore::SVGRenderStyle::setPaintOrder): Deleted.
682         (WebCore::SVGRenderStyle::capStyle): Deleted.
683         (WebCore::SVGRenderStyle::joinStyle): Deleted.
684         (WebCore::SVGRenderStyle::strokeWidth): Deleted.
685         (WebCore::SVGRenderStyle::paintOrder): Deleted.
686         (WebCore::SVGRenderStyle::hasVisibleStroke): Deleted.
687         (WebCore::SVGRenderStyle::setStrokeWidth): Deleted.
688         * rendering/style/SVGRenderStyleDefs.cpp:
689         (WebCore::StyleStrokeData::StyleStrokeData):
690         (WebCore::StyleStrokeData::operator==):
691         * rendering/style/SVGRenderStyleDefs.h:
692         * rendering/style/StyleRareInheritedData.cpp:
693         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
694         (WebCore::StyleRareInheritedData::operator==):
695         * rendering/style/StyleRareInheritedData.h:
696         * rendering/svg/RenderSVGEllipse.cpp:
697         (WebCore::RenderSVGEllipse::strokeShape):
698         * rendering/svg/RenderSVGPath.cpp:
699         (WebCore::RenderSVGPath::strokeShape):
700         (WebCore::RenderSVGPath::shapeDependentStrokeContains):
701         (WebCore::RenderSVGPath::shouldStrokeZeroLengthSubpath):
702         (WebCore::RenderSVGPath::zeroLengthLinecapPath):
703         * rendering/svg/RenderSVGRect.cpp:
704         (WebCore::RenderSVGRect::strokeShape):
705         * rendering/svg/RenderSVGShape.cpp:
706         (WebCore::RenderSVGShape::strokeShape):
707         (WebCore::RenderSVGShape::fillStrokeMarkers):
708         (WebCore::RenderSVGShape::strokeWidth):
709         (WebCore::RenderSVGShape::hasSmoothStroke):
710         * rendering/svg/RenderSVGText.cpp:
711         (WebCore::RenderSVGText::strokeBoundingBox):
712         * rendering/svg/SVGInlineTextBox.cpp:
713         (WebCore::SVGInlineTextBox::paint):
714         (WebCore::SVGInlineTextBox::paintDecoration):
715         * rendering/svg/SVGRenderSupport.cpp:
716         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
717         * rendering/svg/SVGRenderTreeAsText.cpp:
718         (WebCore::writeStyle):
719
720 2017-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
721
722         [SOUP] Handle Settings::allowsAnySSLCertificate() in SSL sockets
723         https://bugs.webkit.org/show_bug.cgi?id=168521
724
725         Reviewed by Michael Catanzaro.
726
727         When Settings::allowsAnySSLCertificate() is enabled, connect to accept-certificate signal of the GTlsConnection
728         to always accept the certificates.
729
730         Fixes: http/tests/websocket/tests/hybi/simple-wss.html
731
732         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
733         (WebCore::wssConnectionAcceptCertificateCallback):
734         (WebCore::wssSocketClientEventCallback):
735         (WebCore::SocketStreamHandleImpl::create):
736
737 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
738
739         Fixed elements bounce when rubber-banding at the bottom of the page
740         https://bugs.webkit.org/show_bug.cgi?id=168493
741         rdar://problem/30567713
742
743         Reviewed by Tim Horton.
744
745         FrameView::visibleDocumentRect() was computing a bad visible rect when bottom-rubber-banding,
746         by adding rubberBandBottom which is negative, rather than subtracting.
747
748         Log some more scrolling stuff.
749
750         Ironically, the existing test didn't test stick-to-viewport fixed position because
751         backgroundShouldExtendBeyondPage() is off by default in WTR, so clone it to a test
752         that sets this, to test both behaviors.
753
754         This also revealed that dynamic changes to backgroundShouldExtendBeyondPage() need
755         to be propagated to the scrolling tree, which is fixed in AsyncScrollingCoordinator::frameViewLayoutUpdated().
756
757         Test: fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html
758
759         * page/FrameView.cpp:
760         (WebCore::FrameView::updateLayoutViewport):
761         (WebCore::FrameView::visibleDocumentRect):
762         * page/scrolling/AsyncScrollingCoordinator.cpp:
763         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
764         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
765         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
766         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
767         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
768         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
769         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
770         (WebCore::ScrollingCoordinatorMac::commitTreeState):
771
772 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
773
774         REGRESSION (209396): Apple Pay buttons do not render
775         https://bugs.webkit.org/show_bug.cgi?id=168523
776         rdar://problem/30451563
777
778         Reviewed by Geoffrey Garen.
779
780         The new CSS parser mistakenly converted -apple-pay-button values to
781         -webkit-pay-button, breaking -webkit-appearance: -apple-pay-button.
782
783         Fix by excluding "-apple-pay" prefixed values from the conversion.
784
785         Test: fast/css/appearance-apple-pay-button.html
786
787         * css/parser/CSSPropertyParser.cpp:
788         (WebCore::isAppleLegacyCssValueKeyword):
789
790 2017-02-17  Commit Queue  <commit-queue@webkit.org>
791
792         Unreviewed, rolling out r212463.
793         https://bugs.webkit.org/show_bug.cgi?id=168526
794
795         Some crashes with GuardMalloc (Requested by anttik on
796         #webkit).
797
798         Reverted changeset:
799
800         "Execute pending scripts asynchronously after stylesheet loads
801         complete"
802         https://bugs.webkit.org/show_bug.cgi?id=168367
803         http://trac.webkit.org/changeset/212463
804
805 2017-02-16  Brent Fulgham  <bfulgham@apple.com>
806
807         RenderView needs to be updated when FrameView changes
808         https://bugs.webkit.org/show_bug.cgi?id=168481
809         <rdar://problem/30339638>
810
811         Reviewed by Andreas Kling.
812
813         The state of the Document's RenderView can get out of sync with the Frame's FrameView.
814         We need a notification mechanism so that modifications to the Frame's view are properly
815         relayed to Document so that it can have a correct RenderView.
816
817         * dom/Document.cpp:
818         (WebCore::Document::didBecomeCurrentDocumentInView): Create an updated render tree (if
819         one does not already exist).
820         (WebCore::Document::destroyRenderTree): Remove an incorrect ASSERT. We may enter this
821         code when the Frame uses 'setView(nullptr)', which happens during certain  updates.
822         * dom/Document.h:
823         * page/Frame.cpp:
824         (WebCore::Frame::setView): Destroy the old render tree (if present) before switching to
825         the new view. Then notify the document that it is now the current document in the new view.
826
827 2017-02-17  Enrique Ocaña González  <eocanha@igalia.com>
828
829         [GStreamer] Fast replay on video hide/unhide on platforms with limited video buffer pools
830         https://bugs.webkit.org/show_bug.cgi?id=168505
831
832         Reviewed by Žan Doberšek.
833
834         The WebKit code isn't consuming the video samples when the video layer is hidden,
835         so the buffers aren't being returned to the pool and starve the decoder when the
836         buffer pool runs out of buffers (on platforms using a buffer pool and a custom
837         allocator, such as OMX on the Raspberry Pi 2). When the video layer is restored,
838         the pipeline tries to catch up and the user sees the video "going fast forward".
839
840         The added code "consumes" (removes and unrefs) the buffer in that case. However,
841         the sample isn't completely removed because it still holds important info (eg:
842         caps) needed for the proper operation of the video element.
843
844         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
845         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
846
847 2017-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
848
849         [SOUP] Stop removing the fragment identifier from resource requests
850         https://bugs.webkit.org/show_bug.cgi?id=168509
851
852         Reviewed by Sergio Villar Senin.
853
854         I don't know why, but have always removed the fragment identifier from the URL when creating the SoupURI that
855         is passed to libsoup. Maybe it was a bug in a very old version of libsoup, but it doesn't look necessary anymore
856         and it's causing several layout test failures.
857
858         Fixes: http/tests/svg/svg-use-external.html
859                imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin-with-hash.html
860                imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin-with-hash.html
861
862         * platform/network/soup/ResourceRequestSoup.cpp:
863         (WebCore::ResourceRequest::createSoupURI): Do not remove the fragment identifier from the URL.
864
865 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
866
867         [JSC] Drop PassRefPtr from ArrayBuffer
868         https://bugs.webkit.org/show_bug.cgi?id=168455
869
870         Reviewed by Geoffrey Garen.
871
872         * bindings/js/SerializedScriptValue.cpp:
873         (WebCore::CloneDeserializer::readArrayBufferView):
874         * css/FontFace.cpp:
875         (WebCore::FontFace::create):
876         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
877         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
878         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
879         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
880         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
881         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
882         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
883         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
884
885 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
886
887         REGRESSION(r212439): Web Inspector Toolbar / Window appears broken
888         https://bugs.webkit.org/show_bug.cgi?id=168494
889
890         Reviewed by Joseph Pecoraro.
891
892         Missed one conversion from acceleratesDrawing to drawsAsynchronously, which
893         caused non-Whippet GrpahicsContext shadow drawing to happen unexpectedly.
894
895         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
896         (-[WebTiledBackingLayer drawsAsynchronously]):
897         (-[WebTiledBackingLayer acceleratesDrawing]): Deleted.
898
899 2017-02-16  Chris Dumez  <cdumez@apple.com>
900
901         <input>.labels is empty if type changes from text->hidden->checkbox
902         https://bugs.webkit.org/show_bug.cgi?id=168358
903
904         Reviewed by Ryosuke Niwa.
905
906         We were invalidating LabelsNodeLists on 'for' attribute change.
907         We now also invalidate them of 'type' attribute change since
908         HTMLInputElements whose type is 'hidden' do not support labels.
909
910         No new tests, updated existing test.
911
912         * dom/Document.h:
913         * dom/LiveNodeList.h:
914         (WebCore::shouldInvalidateTypeOnAttributeChange):
915         * html/LabelsNodeList.cpp:
916         (WebCore::LabelsNodeList::LabelsNodeList):
917
918 2017-02-16  Michael Catanzaro  <mcatanzaro@igalia.com>
919
920         Remove even more EFL from WebCore
921         https://bugs.webkit.org/show_bug.cgi?id=168485
922
923         Reviewed by Alex Christensen.
924
925         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
926         (webkitAccessibleGetAttributes):
927         (atkRole):
928         * css/StyleRule.cpp:
929         (WebCore::StyleRuleBase::copy):
930         * platform/ContextMenuItem.h:
931         * platform/graphics/OpenGLESShims.h:
932         * platform/graphics/PlatformDisplay.cpp:
933         (WebCore::PlatformDisplay::createPlatformDisplay):
934         * platform/graphics/PlatformDisplay.h:
935         * platform/graphics/cairo/ImageBufferCairo.cpp:
936         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
937         (WebCore::Font::platformInit):
938         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
939         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
940         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
941         (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
942         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
943         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
944         * platform/network/soup/ResourceErrorSoup.cpp:
945         (WebCore::ResourceError::timeoutError):
946         * platform/network/soup/SoupNetworkSession.cpp:
947         (WebCore::SoupNetworkSession::setProxySettingsFromEnvironment): Deleted.
948         * platform/network/soup/SoupNetworkSession.h:
949
950 2017-02-16  Daniel Bates  <dabates@apple.com>
951
952         Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
953         https://bugs.webkit.org/show_bug.cgi?id=168417
954         <rdar://problem/30541748>
955
956         Reviewed by Brent Fulgham.
957
958         Remove Chromium-specific code that was added in r125500 to call FrameLoaderClient::redirectDataToPlugin(nullptr)
959         in PluginDocument::detachFromPluginElement(). Calling redirectDataToPlugin() with nullptr was used by the
960         Chromium port to signify that the plugin document was being destroyed so that they could tear down their
961         plugin widget. And PluginDocument::detachFromPluginElement() is the only place that calls redirectDataToPlugin()
962         passing nullptr. No other port made use of this machinery and the Chromium port has long since been removed
963         from the Open Source WebKit Project. We should remove this code.
964
965         * html/PluginDocument.cpp:
966         (WebCore::PluginDocumentParser::appendBytes): Pass the plugin widget by reference.
967         (WebCore::PluginDocument::detachFromPluginElement): Remove call to FrameLoaderClient::redirectDataToPlugin().
968         This call was only used by the Chromium port as means to be notified when the plugin document was being
969         destroyed. No other port made use of this notification or needed such a notification.
970         * loader/EmptyClients.cpp: Change argument of redirectDataToPlugin() from Widget* to Widget& to convey
971         that this function always takes a valid Widget. Also remove unnecessary argument name as the data type
972         of the argument and the name of the function sufficiently describes the purpose of the argument.
973         * loader/FrameLoaderClient.h: Ditto.
974
975 2017-02-16  Myles C. Maxfield  <mmaxfield@apple.com>
976
977         font-weight in @font-face can cause a font to be downloaded even when it's not used
978         https://bugs.webkit.org/show_bug.cgi?id=168114
979         <rdar://problem/30301317>
980
981         Reviewed by Darin Adler.
982
983         There were two problems with our font loading code.
984
985         When we are in the middle of a download, we will use a special interstitial font,
986         and this special font has a flag set which will cause it to be invisible when it is
987         drawn. However, when we start using this font during the load, we give it a
988         unicode-range of U+0-0 which means that it will never be used, and fallback will
989         happen to other weights immediately. 
990
991         The second problem with the font loading code is that this interstital font is just
992         Times. Times doesn't support every character, which means that if we are trying
993         to render some exotic character, we fall back to other weights. The solution here
994         is to use LastResort as the interstitial font, because it supports all characters.
995         Because its metrics are reasonable and we don't ever actually paint this
996         interstitial font, this choice is no worse than Times.
997
998         Tests: fast/text/font-style-download.html
999                fast/text/font-weight-download-2.html
1000                fast/text/font-weight-download.html
1001                fast/text/font-weight-fallback.html
1002
1003         * css/CSSFontFace.cpp:
1004         (WebCore::CSSFontFace::font):
1005         * css/CSSSegmentedFontFace.cpp:
1006         (WebCore::appendFont):
1007         (WebCore::CSSSegmentedFontFace::fontRanges):
1008         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Deleted.
1009         * platform/graphics/Font.h:
1010         (WebCore::Font::widthForGlyph):
1011         * platform/graphics/FontCache.h:
1012         * platform/graphics/freetype/FontCacheFreeType.cpp:
1013         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1014         * platform/graphics/mac/FontCacheMac.mm:
1015         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1016         * platform/graphics/win/FontCacheWin.cpp:
1017         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1018
1019 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1020
1021         Remove EFL-specific files in Source.
1022
1023         Rubber-stamped by Anders Carlsson.
1024
1025         * editing/efl: Removed.
1026         * page/efl: Removed.
1027         * platform/audio/efl: Removed.
1028         * platform/efl: Removed.
1029         * platform/efl/DefaultTheme: Removed.
1030         * platform/efl/DefaultTheme/widget: Removed.
1031         * platform/efl/DefaultTheme/widget/button: Removed.
1032         * platform/efl/DefaultTheme/widget/check: Removed.
1033         * platform/efl/DefaultTheme/widget/combo: Removed.
1034         * platform/efl/DefaultTheme/widget/entry: Removed.
1035         * platform/efl/DefaultTheme/widget/progressbar: Removed.
1036         * platform/efl/DefaultTheme/widget/radio: Removed.
1037         * platform/efl/DefaultTheme/widget/scrollbar: Removed.
1038         * platform/efl/DefaultTheme/widget/search: Removed.
1039         * platform/efl/DefaultTheme/widget/search/cancel: Removed.
1040         * platform/efl/DefaultTheme/widget/search/decoration: Removed.
1041         * platform/efl/DefaultTheme/widget/search/field: Removed.
1042         * platform/efl/DefaultTheme/widget/slider: Removed.
1043         * platform/efl/DefaultTheme/widget/spinner: Removed.
1044         * platform/gamepad/efl: Removed.
1045         * platform/graphics/efl: Removed.
1046         * platform/graphics/surfaces/efl: Removed.
1047         * platform/network/efl: Removed.
1048
1049 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
1050
1051         Add WebUSB to features.json as a "Not Considering".
1052
1053         * features.json:
1054
1055 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1056
1057         Remove old URL parser
1058         https://bugs.webkit.org/show_bug.cgi?id=168483
1059
1060         Reviewed by Tim Horton.
1061
1062         * platform/URL.cpp:
1063         (WebCore::isSchemeFirstChar):
1064         (WebCore::isSchemeChar):
1065         (WebCore::URL::URL):
1066         (WebCore::URL::setProtocol):
1067         (WebCore::URL::setHost):
1068         (WebCore::URL::removePort):
1069         (WebCore::URL::setPort):
1070         (WebCore::URL::setHostAndPort):
1071         (WebCore::URL::setUser):
1072         (WebCore::URL::setPass):
1073         (WebCore::URL::setFragmentIdentifier):
1074         (WebCore::URL::setQuery):
1075         (WebCore::URL::setPath):
1076         (WebCore::URL::serialize):
1077         (WebCore::isUserInfoChar): Deleted.
1078         (WebCore::isHostnameChar): Deleted.
1079         (WebCore::isIPv6Char): Deleted.
1080         (WebCore::isPathSegmentEndChar): Deleted.
1081         (WebCore::appendASCII): Deleted.
1082         (WebCore::findFirstOf): Deleted.
1083         (WebCore::checkEncodedString): Deleted.
1084         (WebCore::URL::init): Deleted.
1085         (WebCore::appendEscapingBadChars): Deleted.
1086         (WebCore::escapeAndAppendNonHierarchicalPart): Deleted.
1087         (WebCore::copyPathRemovingDots): Deleted.
1088         (WebCore::hasSlashDotOrDotDot): Deleted.
1089         (WebCore::URL::parse): Deleted.
1090         (WebCore::cannotBeABaseURL): Deleted.
1091         (WebCore::isDefaultPortForScheme): Deleted.
1092         (WebCore::hostPortIsEmptyButCredentialsArePresent): Deleted.
1093         (WebCore::isNonFileHierarchicalScheme): Deleted.
1094         (WebCore::isCanonicalHostnameLowercaseForScheme): Deleted.
1095         (WebCore::findHostnamesInMailToURL): Deleted.
1096         (WebCore::findHostnameInHierarchicalURL): Deleted.
1097         (WebCore::encodeHostnames): Deleted.
1098         (WebCore::encodeRelativeString): Deleted.
1099         (WebCore::substituteBackslashes): Deleted.
1100         * platform/URLParser.cpp:
1101         (WebCore::URLParser::URLParser):
1102         (WebCore::URLParser::setEnabled): Deleted.
1103         (WebCore::URLParser::enabled): Deleted.
1104         * platform/URLParser.h:
1105         * platform/cf/URLCF.cpp:
1106         (WebCore::URL::URL):
1107         * platform/mac/URLMac.mm:
1108         (WebCore::URL::URL):
1109
1110 2017-02-16  Anders Carlsson  <andersca@apple.com>
1111
1112         Build fixes.
1113
1114         * page/gtk/EventHandlerGtk.cpp:
1115         (WebCore::EventHandler::createDraggingDataTransfer):
1116         * page/win/EventHandlerWin.cpp:
1117         (WebCore::EventHandler::createDraggingDataTransfer):
1118
1119 2017-02-16  Anders Carlsson  <andersca@apple.com>
1120
1121         Remove EFL from WebCore
1122         https://bugs.webkit.org/show_bug.cgi?id=168477
1123
1124         Reviewed by Brian Burg.
1125
1126         * accessibility/AccessibilityList.cpp:
1127         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
1128         * accessibility/AccessibilityNodeObject.cpp:
1129         (WebCore::AccessibilityNodeObject::canSetValueAttribute):
1130         * accessibility/AccessibilityObject.cpp:
1131         (WebCore::AccessibilityObject::AccessibilityObject):
1132         (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
1133         * accessibility/AccessibilityObject.h:
1134         * accessibility/AccessibilityRenderObject.cpp:
1135         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1136         * accessibility/AccessibilityTableColumn.cpp:
1137         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
1138         * accessibility/AccessibilityTableHeaderContainer.cpp:
1139         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
1140         * crypto/CryptoKey.cpp:
1141         * crypto/keys/CryptoKeyRSA.h:
1142         * dom/Document.cpp:
1143         (WebCore::Document::implicitClose):
1144         * editing/Editor.cpp:
1145         (WebCore::Editor::performCutOrCopy):
1146         (WebCore::Editor::copyImage):
1147         * editing/Editor.h:
1148         * editing/FrameSelection.h:
1149         * html/HTMLCanvasElement.cpp:
1150         (WebCore::requiresAcceleratedCompositingForWebGL):
1151         * inspector/InspectorFrontendHost.cpp:
1152         (WebCore::InspectorFrontendHost::port):
1153         * loader/HistoryController.cpp:
1154         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1155         * loader/icon/IconDatabase.cpp:
1156         (WebCore::IconDatabase::performURLImport):
1157         * page/ContextMenuController.cpp:
1158         (WebCore::ContextMenuController::contextMenuItemSelected):
1159         (WebCore::ContextMenuController::populate):
1160         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1161         * page/DragController.cpp:
1162         (WebCore::DragController::startDrag):
1163         * page/EventHandler.cpp:
1164         (WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult):
1165         * page/FrameView.cpp:
1166         (WebCore::FrameView::layout):
1167         * platform/ContextMenuItem.h:
1168         * platform/Cursor.h:
1169         * platform/DragData.h:
1170         * platform/DragImage.h:
1171         * platform/FileSystem.h:
1172         * platform/LocalizedStrings.h:
1173         * platform/MIMETypeRegistry.cpp:
1174         (WebCore::initializeSupportedImageMIMETypesForEncoding):
1175         * platform/NotImplemented.h:
1176         * platform/Pasteboard.h:
1177         * platform/PlatformKeyboardEvent.h:
1178         * platform/PlatformMouseEvent.h:
1179         * platform/PlatformSpeechSynthesizer.h:
1180         * platform/PlatformWheelEvent.h:
1181         * platform/Widget.h:
1182         * platform/graphics/ANGLEWebKitBridge.h:
1183         * platform/graphics/BitmapImage.h:
1184         * platform/graphics/GraphicsContext3D.h:
1185         * platform/graphics/Icon.h:
1186         * platform/graphics/Image.h:
1187         (WebCore::Image::getEvasObject): Deleted.
1188         * platform/graphics/IntPoint.h:
1189         * platform/graphics/IntRect.h:
1190         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1191         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
1192         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
1193         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
1194         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
1195         (WebCore::Extensions3DOpenGL::supportsExtension):
1196         * platform/graphics/opengl/Extensions3DOpenGL.h:
1197         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1198         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1199         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1200         (WebCore::GraphicsContext3D::createForCurrentGLContext):
1201         (WebCore::GraphicsContext3D::reshape):
1202         (WebCore::GraphicsContext3D::createVertexArray):
1203         (WebCore::GraphicsContext3D::deleteVertexArray):
1204         (WebCore::GraphicsContext3D::isVertexArray):
1205         (WebCore::GraphicsContext3D::bindVertexArray):
1206         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
1207         * platform/network/NetworkStateNotifier.h:
1208         * platform/posix/FileSystemPOSIX.cpp:
1209         * rendering/RenderLayerCompositor.cpp:
1210         (WebCore::RenderLayerCompositor::ensureRootLayer):
1211         * rendering/RenderText.cpp:
1212         (WebCore::RenderText::previousOffsetForBackwardDeletion):
1213         * xml/XSLStyleSheetLibxslt.cpp:
1214         * xml/XSLTExtensions.cpp:
1215         * xml/XSLTProcessorLibxslt.cpp:
1216         * xml/XSLTUnicodeSort.cpp:
1217
1218 2017-02-16  Zalan Bujtas  <zalan@apple.com>
1219
1220         Simple line layout: Add forced line layout info to coverage print.
1221         https://bugs.webkit.org/show_bug.cgi?id=168470
1222
1223         Reviewed by Simon Fraser.
1224
1225         This is about potential vs. actual coverage:
1226
1227         Simple line layout potential coverage: 65.05%
1228         Simple line layout actual coverage: 46.60%
1229         Forced line layout blocks: 4 content length: 57(18.45%)
1230
1231         Not testable.
1232
1233         * rendering/SimpleLineLayout.cpp:
1234         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
1235
1236 2017-02-16  Anders Carlsson  <andersca@apple.com>
1237
1238         Rename DataTransfer functions to indicate whether they are for dragging or dropping
1239         https://bugs.webkit.org/show_bug.cgi?id=168478
1240
1241         Reviewed by Tim Horton.
1242
1243         * dom/DataTransfer.cpp:
1244         (WebCore::DataTransfer::createForDrag):
1245         (WebCore::DataTransfer::createForDrop):
1246         (WebCore::DataTransfer::createForDragAndDrop): Deleted.
1247         * dom/DataTransfer.h:
1248         * page/DragController.cpp:
1249         (WebCore::DragController::dragExited):
1250         (WebCore::DragController::performDragOperation):
1251         (WebCore::DragController::tryDHTMLDrag):
1252         * page/mac/EventHandlerMac.mm:
1253         (WebCore::EventHandler::createDraggingDataTransfer):
1254
1255 2017-02-16  Anders Carlsson  <andersca@apple.com>
1256
1257         Rename EventHandler::freeDataTransfer to invalidateDataTransfer
1258         https://bugs.webkit.org/show_bug.cgi?id=168472
1259
1260         Reviewed by Tim Horton.
1261
1262         The code doesn't necessarily free the data transfer object, so rename the member function
1263         to reflect that. Also, get rid of a goto.
1264
1265         * page/EventHandler.cpp:
1266         (WebCore::EventHandler::invalidateDataTransfer):
1267         (WebCore::EventHandler::dragSourceEndedAt):
1268         (WebCore::EventHandler::handleDrag):
1269         (WebCore::EventHandler::freeDataTransfer): Deleted.
1270         * page/EventHandler.h:
1271
1272 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1273
1274         Special URLs without a host are invalid
1275         https://bugs.webkit.org/show_bug.cgi?id=168461
1276
1277         Reviewed by Tim Horton.
1278
1279         http://? should be invalid.  This matches Chrome and the spec and the intent of my implementation
1280         of URLParser which already fails with urls like http:// and this was just an oversight.
1281         Covered by newly passing web platform tests.  Updated API tests.
1282
1283         * platform/URLParser.cpp:
1284         (WebCore::URLParser::parse):
1285
1286 2017-02-16  Zalan Bujtas  <zalan@apple.com>
1287
1288         Simple line layout: Add support for pagination.
1289         https://bugs.webkit.org/show_bug.cgi?id=168355
1290         <rdar://problem/30119769>
1291
1292         Reviewed by David Hyatt.
1293
1294         This patch adds basic support for paginated content including widows and orphans.
1295
1296         This is based on the normal line layout pagination logic. However there are 2 major
1297         advantages here (and they allow us to have a much simpler logic):
1298         1. all the lines are positioned by the time we start paginating them and
1299         2. lines always have uniform heights. 
1300
1301         This is not enabled yet.
1302
1303         * rendering/RenderBlockFlow.h:
1304         * rendering/SimpleLineLayout.cpp:
1305         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
1306         (WebCore::SimpleLineLayout::computeLineBreakIndex):
1307         (WebCore::SimpleLineLayout::setPageBreakForLine):
1308         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
1309         (WebCore::SimpleLineLayout::updateMinimumPageHeight):
1310         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
1311         (WebCore::SimpleLineLayout::create):
1312         (WebCore::SimpleLineLayout::Layout::create):
1313         (WebCore::SimpleLineLayout::Layout::Layout):
1314         * rendering/SimpleLineLayout.h:
1315         (WebCore::SimpleLineLayout::Layout::isPaginated):
1316         (WebCore::SimpleLineLayout::Layout::struts):
1317         * rendering/SimpleLineLayoutFunctions.h:
1318         (WebCore::SimpleLineLayout::computeFlowHeight):
1319         * rendering/SimpleLineLayoutResolver.h:
1320         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
1321
1322 2017-02-11  Filip Pizlo  <fpizlo@apple.com>
1323
1324         The collector thread should only start when the mutator doesn't have heap access
1325         https://bugs.webkit.org/show_bug.cgi?id=167737
1326
1327         Reviewed by Keith Miller.
1328
1329         Added new tests in JSTests and LayoutTests.
1330         
1331         The WebCore changes involve:
1332         
1333         - Refactoring around new header discipline.
1334         
1335         - Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
1336
1337         * ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
1338         * ForwardingHeaders/heap/IncrementalSweeper.h: Added.
1339         * ForwardingHeaders/heap/MachineStackMarker.h: Added.
1340         * ForwardingHeaders/heap/RunningScope.h: Added.
1341         * bindings/js/CommonVM.cpp:
1342         * testing/Internals.cpp:
1343         (WebCore::Internals::parserMetaData):
1344         (WebCore::Internals::isReadableStreamDisturbed):
1345         (WebCore::Internals::isGCRunning):
1346         (WebCore::Internals::addGCFinalizationCallback):
1347         (WebCore::Internals::stopSweeping):
1348         (WebCore::Internals::startSweeping):
1349         * testing/Internals.h:
1350         * testing/Internals.idl:
1351
1352 2017-02-16  Jiewen Tan  <jiewen_tan@apple.com>
1353
1354         [WebCrypto] remove toJSValueFromJsonWebKey from custom SubtleCrypto binding codes
1355         https://bugs.webkit.org/show_bug.cgi?id=167026
1356
1357         Reviewed by Chris Dumez.
1358
1359         Covered by existing tests.
1360
1361         * bindings/js/JSSubtleCryptoCustom.cpp:
1362         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
1363         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
1364         (WebCore::toJSValueFromJsonWebKey): Deleted.
1365         * crypto/JsonWebKey.h:
1366         * crypto/JsonWebKey.idl:
1367         * crypto/RsaOtherPrimesInfo.idl:
1368         Change std::optional<String> to String in order to use toJS<IDLDictionary<JsonWebKey>>.
1369         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1370         (WebCore::CryptoAlgorithmAES_CBC::importKey):
1371         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1372         (WebCore::CryptoAlgorithmAES_KW::importKey):
1373         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1374         (WebCore::CryptoAlgorithmHMAC::importKey):
1375         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1376         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1377         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1378         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1379         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1380         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1381         * crypto/keys/CryptoKeyAES.cpp:
1382         (WebCore::CryptoKeyAES::importJwk):
1383         Only check if key_ops contains all of the specified usages when key_ops field of jwk is present,
1384         as per the specification: https://www.w3.org/TR/WebCryptoAPI/#aes-cbc-operations
1385         * crypto/keys/CryptoKeyAES.h:
1386         * crypto/keys/CryptoKeyHMAC.cpp:
1387         (WebCore::CryptoKeyHMAC::importJwk):
1388         * crypto/keys/CryptoKeyHMAC.h:
1389         * crypto/keys/CryptoKeyRSA.cpp:
1390         (WebCore::CryptoKeyRSA::importJwk):
1391         Accommodate the change from std::optional<String> to String.
1392         * crypto/mac/CryptoKeyRSAMac.cpp:
1393         (WebCore::CryptoKeyRSA::create):
1394         Add a null check for p.
1395
1396 2017-02-16  Antti Koivisto  <antti@apple.com>
1397
1398         Execute pending scripts asynchronously after stylesheet loads complete
1399         https://bugs.webkit.org/show_bug.cgi?id=168367
1400         rdar://problem/30561379
1401
1402         Reviewed by Andreas Kling.
1403
1404         The current synchronous execution is fragile and creates various problems.
1405
1406         * css/StyleSheetContents.cpp:
1407         (WebCore::StyleSheetContents::checkLoaded):
1408         * dom/ContainerNode.cpp:
1409         (WebCore::ContainerNode::takeAllChildrenFrom):
1410         (WebCore::ContainerNode::notifyChildInserted):
1411         (WebCore::ContainerNode::removeChild):
1412         (WebCore::ContainerNode::parserRemoveChild):
1413         (WebCore::ContainerNode::removeChildren):
1414
1415             Remove various places where we would trigger delayed synchronous execution.
1416
1417         * dom/Document.cpp:
1418         (WebCore::Document::Document):
1419         (WebCore::Document::recalcStyle):
1420
1421             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
1422
1423         (WebCore::Document::didRemoveAllPendingStylesheet):
1424
1425             Call asynchronous script execution function.
1426
1427         * dom/Document.h:
1428         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
1429         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
1430         * dom/ScriptableDocumentParser.cpp:
1431         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
1432         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
1433         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
1434
1435             Add a timer for executing pending scripts.
1436
1437         (WebCore::ScriptableDocumentParser::detach):
1438         * dom/ScriptableDocumentParser.h:
1439         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
1440         * html/HTMLLinkElement.cpp:
1441         (WebCore::HTMLLinkElement::removedFrom):
1442         (WebCore::HTMLLinkElement::removePendingSheet):
1443         * html/HTMLLinkElement.h:
1444         * html/parser/HTMLDocumentParser.cpp:
1445         (WebCore::HTMLDocumentParser::detach):
1446         * loader/DocumentLoader.cpp:
1447         (WebCore::DocumentLoader::isLoadingInAPISense):
1448
1449             Stay in loading state if we have a pending script. This matches existing behavior.
1450
1451         * style/StyleScope.cpp:
1452         (WebCore::Style::Scope::removePendingSheet):
1453         * style/StyleScope.h:
1454
1455 2017-02-16  Anders Carlsson  <andersca@apple.com>
1456
1457         Set the DHTML drag image in the DHTML type check
1458         https://bugs.webkit.org/show_bug.cgi?id=168451
1459
1460         Reviewed by Wenson Hsieh.
1461
1462         * page/DragController.cpp:
1463         (WebCore::DragController::startDrag):
1464
1465 2017-02-16  Anders Carlsson  <andersca@apple.com>
1466
1467         Begin removing EFL code from WebCore.
1468
1469         Rubber-stamped by Alex Christensen.
1470
1471         * PlatformEfl.cmake: Removed.
1472         * editing/efl/EditorEfl.cpp: Removed.
1473         * page/efl/DragControllerEfl.cpp: Removed.
1474         * page/efl/EventHandlerEfl.cpp: Removed.
1475         * platform/audio/efl/AudioBusEfl.cpp: Removed.
1476         * platform/efl/CursorEfl.cpp: Removed.
1477         * platform/efl/DefaultTheme/CMakeLists.txt: Removed.
1478         * platform/efl/DefaultTheme/default.edc: Removed.
1479         * platform/efl/DefaultTheme/widget/button/button.edc: Removed.
1480         * platform/efl/DefaultTheme/widget/button/img_button_focus.png: Removed.
1481         * platform/efl/DefaultTheme/widget/button/img_button_hover.png: Removed.
1482         * platform/efl/DefaultTheme/widget/button/img_button_normal.png: Removed.
1483         * platform/efl/DefaultTheme/widget/button/img_button_press.png: Removed.
1484         * platform/efl/DefaultTheme/widget/check/check.edc: Removed.
1485         * platform/efl/DefaultTheme/widget/check/img_check_bg_disabled.png: Removed.
1486         * platform/efl/DefaultTheme/widget/check/img_check_bg_enabled.png: Removed.
1487         * platform/efl/DefaultTheme/widget/check/img_check_off.png: Removed.
1488         * platform/efl/DefaultTheme/widget/check/img_check_off_focus.png: Removed.
1489         * platform/efl/DefaultTheme/widget/check/img_check_off_hover.png: Removed.
1490         * platform/efl/DefaultTheme/widget/check/img_check_on.png: Removed.
1491         * platform/efl/DefaultTheme/widget/check/img_check_on_focus.png: Removed.
1492         * platform/efl/DefaultTheme/widget/check/img_check_on_hover.png: Removed.
1493         * platform/efl/DefaultTheme/widget/combo/combo.edc: Removed.
1494         * platform/efl/DefaultTheme/widget/combo/combo_focus.png: Removed.
1495         * platform/efl/DefaultTheme/widget/combo/combo_focus_button.png: Removed.
1496         * platform/efl/DefaultTheme/widget/combo/combo_focus_button_transparent.png: Removed.
1497         * platform/efl/DefaultTheme/widget/combo/combo_focus_transparent.png: Removed.
1498         * platform/efl/DefaultTheme/widget/combo/combo_hover.png: Removed.
1499         * platform/efl/DefaultTheme/widget/combo/combo_hover_button.png: Removed.
1500         * platform/efl/DefaultTheme/widget/combo/combo_hover_button_transparent.png: Removed.
1501         * platform/efl/DefaultTheme/widget/combo/combo_hover_transparent.png: Removed.
1502         * platform/efl/DefaultTheme/widget/combo/combo_normal.png: Removed.
1503         * platform/efl/DefaultTheme/widget/combo/combo_normal_button.png: Removed.
1504         * platform/efl/DefaultTheme/widget/combo/combo_normal_button_transparent.png: Removed.
1505         * platform/efl/DefaultTheme/widget/combo/combo_normal_transparent.png: Removed.
1506         * platform/efl/DefaultTheme/widget/combo/combo_press.png: Removed.
1507         * platform/efl/DefaultTheme/widget/combo/combo_press_button.png: Removed.
1508         * platform/efl/DefaultTheme/widget/combo/combo_press_button_transparent.png: Removed.
1509         * platform/efl/DefaultTheme/widget/combo/combo_press_transparent.png: Removed.
1510         * platform/efl/DefaultTheme/widget/combo/icon.png: Removed.
1511         * platform/efl/DefaultTheme/widget/entry/entry.edc: Removed.
1512         * platform/efl/DefaultTheme/widget/entry/img_focused.png: Removed.
1513         * platform/efl/DefaultTheme/widget/entry/img_hovered.png: Removed.
1514         * platform/efl/DefaultTheme/widget/entry/img_normal.png: Removed.
1515         * platform/efl/DefaultTheme/widget/progressbar/bt_base.png: Removed.
1516         * platform/efl/DefaultTheme/widget/progressbar/progressbar.edc: Removed.
1517         * platform/efl/DefaultTheme/widget/progressbar/shelf_inset.png: Removed.
1518         * platform/efl/DefaultTheme/widget/radio/img_radio_bg_disabled.png: Removed.
1519         * platform/efl/DefaultTheme/widget/radio/img_radio_bg_enabled.png: Removed.
1520         * platform/efl/DefaultTheme/widget/radio/img_radio_off.png: Removed.
1521         * platform/efl/DefaultTheme/widget/radio/img_radio_off_focus.png: Removed.
1522         * platform/efl/DefaultTheme/widget/radio/img_radio_off_hover.png: Removed.
1523         * platform/efl/DefaultTheme/widget/radio/img_radio_on.png: Removed.
1524         * platform/efl/DefaultTheme/widget/radio/img_radio_on_focus.png: Removed.
1525         * platform/efl/DefaultTheme/widget/radio/img_radio_on_hover.png: Removed.
1526         * platform/efl/DefaultTheme/widget/radio/radio.edc: Removed.
1527         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc: Removed.
1528         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Removed.
1529         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Removed.
1530         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Removed.
1531         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Removed.
1532         * platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png: Removed.
1533         * platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png: Removed.
1534         * platform/efl/DefaultTheme/widget/search/cancel/search_cancel.edc: Removed.
1535         * platform/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png: Removed.
1536         * platform/efl/DefaultTheme/widget/search/decoration/search_decoration.edc: Removed.
1537         * platform/efl/DefaultTheme/widget/search/field/field_focused.png: Removed.
1538         * platform/efl/DefaultTheme/widget/search/field/field_hovered.png: Removed.
1539         * platform/efl/DefaultTheme/widget/search/field/field_normal.png: Removed.
1540         * platform/efl/DefaultTheme/widget/search/field/search_field.edc: Removed.
1541         * platform/efl/DefaultTheme/widget/slider/slider.edc: Removed.
1542         * platform/efl/DefaultTheme/widget/slider/slider_fill_h.png: Removed.
1543         * platform/efl/DefaultTheme/widget/slider/slider_fill_v.png: Removed.
1544         * platform/efl/DefaultTheme/widget/slider/slider_h.png: Removed.
1545         * platform/efl/DefaultTheme/widget/slider/slider_thumb_h.png: Removed.
1546         * platform/efl/DefaultTheme/widget/slider/slider_thumb_press_h.png: Removed.
1547         * platform/efl/DefaultTheme/widget/slider/slider_thumb_press_v.png: Removed.
1548         * platform/efl/DefaultTheme/widget/slider/slider_thumb_v.png: Removed.
1549         * platform/efl/DefaultTheme/widget/slider/slider_v.png: Removed.
1550         * platform/efl/DefaultTheme/widget/spinner/sp_bg.png: Removed.
1551         * platform/efl/DefaultTheme/widget/spinner/sp_down_default.png: Removed.
1552         * platform/efl/DefaultTheme/widget/spinner/sp_down_hover.png: Removed.
1553         * platform/efl/DefaultTheme/widget/spinner/sp_down_pressed.png: Removed.
1554         * platform/efl/DefaultTheme/widget/spinner/sp_up_default.png: Removed.
1555         * platform/efl/DefaultTheme/widget/spinner/sp_up_hover.png: Removed.
1556         * platform/efl/DefaultTheme/widget/spinner/sp_up_pressed.png: Removed.
1557         * platform/efl/DefaultTheme/widget/spinner/spinner.edc: Removed.
1558         * platform/efl/DragDataEfl.cpp: Removed.
1559         * platform/efl/DragImageEfl.cpp: Removed.
1560         * platform/efl/EflInspectorUtilities.cpp: Removed.
1561         * platform/efl/EflInspectorUtilities.h: Removed.
1562         * platform/efl/EflKeyboardUtilities.cpp: Removed.
1563         * platform/efl/EflKeyboardUtilities.h: Removed.
1564         * platform/efl/EflScreenUtilities.cpp: Removed.
1565         * platform/efl/EflScreenUtilities.h: Removed.
1566         * platform/efl/ErrorsEfl.cpp: Removed.
1567         * platform/efl/ErrorsEfl.h: Removed.
1568         * platform/efl/EventLoopEfl.cpp: Removed.
1569         * platform/efl/FileSystemEfl.cpp: Removed.
1570         * platform/efl/LocalizedStringsEfl.cpp: Removed.
1571         * platform/efl/MIMETypeRegistryEfl.cpp: Removed.
1572         * platform/efl/MainThreadSharedTimerEfl.cpp: Removed.
1573         * platform/efl/PasteboardEfl.cpp: Removed.
1574         * platform/efl/PlatformKeyboardEventEfl.cpp: Removed.
1575         * platform/efl/PlatformMouseEventEfl.cpp: Removed.
1576         * platform/efl/PlatformScreenEfl.cpp: Removed.
1577         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp: Removed.
1578         * platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed.
1579         * platform/efl/PlatformSpeechSynthesizerEfl.cpp: Removed.
1580         * platform/efl/PlatformWheelEventEfl.cpp: Removed.
1581         * platform/efl/ScrollbarThemeEfl.cpp: Removed.
1582         * platform/efl/ScrollbarThemeEfl.h: Removed.
1583         * platform/efl/SoundEfl.cpp: Removed.
1584         * platform/efl/TemporaryLinkStubs.cpp: Removed.
1585         * platform/efl/UserAgentEfl.cpp: Removed.
1586         * platform/efl/WidgetEfl.cpp: Removed.
1587         * platform/gamepad/efl/GamepadsEfl.cpp: Removed.
1588         * platform/graphics/efl/CairoUtilitiesEfl.cpp: Removed.
1589         * platform/graphics/efl/CairoUtilitiesEfl.h: Removed.
1590         * platform/graphics/efl/EvasGLContext.cpp: Removed.
1591         * platform/graphics/efl/EvasGLContext.h: Removed.
1592         * platform/graphics/efl/EvasGLSurface.cpp: Removed.
1593         * platform/graphics/efl/EvasGLSurface.h: Removed.
1594         * platform/graphics/efl/GraphicsContext3DEfl.cpp: Removed.
1595         * platform/graphics/efl/GraphicsContext3DPrivate.cpp: Removed.
1596         * platform/graphics/efl/GraphicsContext3DPrivate.h: Removed.
1597         * platform/graphics/efl/IconEfl.cpp: Removed.
1598         * platform/graphics/efl/ImageBufferEfl.cpp: Removed.
1599         * platform/graphics/efl/ImageEfl.cpp: Removed.
1600         * platform/graphics/efl/IntPointEfl.cpp: Removed.
1601         * platform/graphics/efl/IntRectEfl.cpp: Removed.
1602         * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp: Removed.
1603         * platform/network/efl/NetworkStateNotifierEfl.cpp: Removed.
1604         * rendering/RenderThemeEfl.cpp: Removed.
1605         * rendering/RenderThemeEfl.h: Removed.
1606
1607 2017-02-16  Joseph Pecoraro  <pecoraro@apple.com>
1608
1609         [Resource Timing] Support Resource Timing in Workers
1610         https://bugs.webkit.org/show_bug.cgi?id=168086
1611         <rdar://problem/30430117>
1612
1613         Reviewed by Alex Christensen.
1614
1615         Worker's load resources through the Document that loaded them. However,
1616         their PerformanceResourceTiming entries should be added to the Performance
1617         object inside the Worker context, not the Document's context.
1618
1619         This change adds an InitiatorContext to ResourceLoadOptions so that loaders
1620         can determine if the load was initiated by the Document or a Worker. This
1621         allows loaders to then know if the ResourceTiming data they collect should
1622         be added to the Document's Performance object or forwarded on to the Worker's.
1623
1624         This adds a new ThreadableLoaderClient method intended only for the purpose
1625         of adding the ResourceTiming information to the Worker's Performance object.
1626         Unlike other ThreadableLoaderClient methods that are bridged and forwarded
1627         on to a client inside the worker (e.g. XMLHttpRequest or FetchLoader) this
1628         method never needs to be handled by clients and can be uniformly handled by
1629         the WorkerThreadableLoader itself.
1630
1631         We also add a new ResourceTiming object that encapsulates all of the data
1632         ultimately needed for a PerformanceResourceTimingEntry object. This allows
1633         for all of the information to be gathered while loading on the Document
1634         before serializing across to the Worker. That includes the Timing-Allow-Origin
1635         check which uses the SecurityOrigin of the Worker.
1636
1637         This also modernizes and addresses issues in the Resource Timing implementation.
1638         Better handling cases like loading from the Cache, Synchronous Loads, and
1639         improving initiatorType information.
1640
1641         Tests: imported/w3c/web-platform-tests/resource-timing/rt-cors.html
1642                imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html
1643                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html
1644                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html
1645                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html
1646                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html
1647                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html
1648                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html
1649                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html
1650                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html
1651                imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html
1652                imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html
1653                imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html
1654                imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html
1655                imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html
1656                imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html
1657                imported/w3c/web-platform-tests/resource-timing/rt-serialization.html
1658                imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html
1659                imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html
1660                performance-api/resource-timing-apis.html
1661
1662         * CMakeLists.txt:
1663         * WebCore.xcodeproj/project.pbxproj:
1664         New files.
1665
1666         * platform/network/NetworkLoadTiming.h:
1667         (WebCore::NetworkLoadTiming::reset): Deleted.
1668         We no longer need to reset.
1669
1670         * loader/ResourceTiming.cpp: Added.
1671         (WebCore::passesTimingAllowCheck):
1672         (WebCore::ResourceTiming::fromCache):
1673         (WebCore::ResourceTiming::fromLoad):
1674         (WebCore::ResourceTiming::fromSynchronousLoad):
1675         (WebCore::ResourceTiming::ResourceTiming):
1676         (WebCore::ResourceTiming::isolatedCopy):
1677         * loader/ResourceTiming.h: Added.
1678         (WebCore::ResourceTiming::url):
1679         (WebCore::ResourceTiming::initiator):
1680         (WebCore::ResourceTiming::loadTiming):
1681         (WebCore::ResourceTiming::networkLoadTiming):
1682         (WebCore::ResourceTiming::allowTimingDetails):
1683         (WebCore::ResourceTiming::overrideInitiatorName):
1684         (WebCore::ResourceTiming::ResourceTiming):
1685         Class that encapsulates all of the data needed for a PerformanceResourceTiming entry.
1686         There are three static constructors indicating the different ways this object can
1687         be constructed and the different data available at the time of construction.
1688
1689         * loader/ResourceLoaderOptions.h:
1690         Add the new InitiatorContext, default to Document.
1691
1692         * loader/ThreadableLoaderClient.h:
1693         (WebCore::ThreadableLoaderClient::didFinishTiming):
1694         New client method only used by WorkerThreadableLoader.
1695
1696         * loader/WorkerThreadableLoader.h:
1697         * loader/WorkerThreadableLoader.cpp:
1698         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1699         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
1700         All loads initiated in a WorkerThreadableLoader get identified as InitiatorContext::Worker.
1701         Add timing information to the Performance object when received. No need to inform clients.
1702
1703         * loader/DocumentThreadableLoader.h:
1704         * loader/DocumentThreadableLoader.cpp:
1705         (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
1706         (WebCore::DocumentThreadableLoader::loadRequest):
1707         Provide APIs to pass timing data on to a WorkerThreadableLoader.
1708         Create ResourceTiming data for synchronous loads.
1709
1710         * loader/LoadTiming.h:
1711         * loader/LoadTiming.cpp:
1712         (WebCore::LoadTiming::isolatedCopy):
1713         Add isolatedCopy to allow this data to be passed across to a Worker.
1714
1715         * loader/ResourceTimingInformation.h:
1716         * loader/ResourceTimingInformation.cpp:
1717         (WebCore::ResourceTimingInformation::shouldAddResourceTiming):
1718         (WebCore::ResourceTimingInformation::addResourceTiming):
1719         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
1720         Refactor to remove unused / unnecessary bits. Extract out some helpful code.
1721         Changed this to match when Blink decides when to add or ignore entries, however
1722         this may change over time.
1723
1724         * loader/SubresourceLoader.cpp:
1725         (WebCore::SubresourceLoader::didFinishLoading):
1726         (WebCore::SubresourceLoader::notifyDone):
1727         (WebCore::SubresourceLoader::reportResourceTiming):
1728         * loader/SubresourceLoader.h:
1729         * loader/cache/CachedRawResource.cpp:
1730         (WebCore::CachedRawResource::finishedTimingForWorkerLoad):
1731         * loader/cache/CachedRawResource.h:
1732         * loader/cache/CachedRawResourceClient.h:
1733         (WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
1734         Plumbing to report timing information to Worker if this resource was loaded for a Worker.
1735
1736         * loader/cache/CachedResource.cpp:
1737         (WebCore::CachedResource::CachedResource):
1738         * loader/cache/CachedResource.h:
1739         (WebCore::CachedResource::initiatorName):
1740         Store the initiator name on the CachedResource like other data added to the original
1741         CachedResourceRequest. This is a bit of a hack but follows an existing pattern, and
1742         cleans up other hacks that worked around this later on.
1743
1744         * loader/cache/CachedResourceLoader.h:
1745         * loader/cache/CachedResourceLoader.cpp:
1746         (WebCore::CachedResourceLoader::requestResource):
1747         (WebCore::CachedResourceLoader::revalidateResource):
1748         (WebCore::CachedResourceLoader::loadResource):
1749         Simply the creation of a ResourceTiming object for cache hits.
1750         Report timing information to Worker if this resource was loaded for a Worker.
1751
1752         (WebCore::CachedResourceLoader::loadDone):
1753         Eliminate this redundant point attempting to add a ResourceTiming entry.
1754
1755         * loader/cache/CachedResourceRequest.cpp:
1756         (WebCore::CachedResourceRequest::initiatorName):
1757         Update to match the spec. The fallback is "other".
1758
1759         * page/Performance.h:
1760         * page/Performance.cpp:
1761         (WebCore::Performance::setResourceTimingBufferSize):
1762         (WebCore::Performance::addResourceTiming):
1763         Update to support PerformanceObservers.
1764         Update to match spec (event should bubble).
1765
1766         * page/PerformanceResourceTiming.h:
1767         * page/PerformanceResourceTiming.cpp:
1768         (WebCore::PerformanceResourceTiming::create):
1769         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
1770         (WebCore::PerformanceResourceTiming::fetchStart):
1771         (WebCore::PerformanceResourceTiming::domainLookupStart):
1772         (WebCore::PerformanceResourceTiming::domainLookupEnd):
1773         (WebCore::PerformanceResourceTiming::connectStart):
1774         (WebCore::PerformanceResourceTiming::connectEnd):
1775         (WebCore::PerformanceResourceTiming::secureConnectionStart):
1776         (WebCore::PerformanceResourceTiming::requestStart):
1777         (WebCore::PerformanceResourceTiming::responseStart):
1778         (WebCore::PerformanceResourceTiming::responseEnd):
1779         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
1780         Construct with a ResourceTiming object containing all the data we need for the entry.
1781         Update to match spec for what is required, should fallback, should be zero, etc.
1782
1783         (WebCore::passesTimingAllowCheck): Deleted.
1784         Extracted this to ResourceTiming creation time in the loading context,
1785         since this can't be determined on the Worker context without also having
1786         all of the header information from each resource response.
1787
1788         * page/PerformanceResourceTiming.idl:
1789         Expose to Workers!
1790
1791 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1792
1793         [JSC] Drop PassRefPtr in inspector/
1794         https://bugs.webkit.org/show_bug.cgi?id=168420
1795
1796         Reviewed by Alex Christensen.
1797
1798         Use Ref<Inspector::ScriptArguments> and Ref<ScriptCallStack> as much as possible.
1799         It drops some unnecessary null checks.
1800
1801         * bindings/scripts/CodeGeneratorJS.pm:
1802         (GenerateCallWith):
1803         * bindings/scripts/test/JS/JSTestObj.cpp:
1804         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackCaller):
1805         * dom/ScriptExecutionContext.cpp:
1806         (WebCore::ScriptExecutionContext::PendingException::PendingException):
1807         * inspector/InspectorInstrumentation.cpp:
1808         (WebCore::InspectorInstrumentation::consoleCountImpl):
1809         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
1810         (WebCore::InspectorInstrumentation::consoleTimeStampImpl):
1811         * inspector/InspectorInstrumentation.h:
1812         (WebCore::InspectorInstrumentation::consoleCount):
1813         (WebCore::InspectorInstrumentation::stopConsoleTiming):
1814         (WebCore::InspectorInstrumentation::consoleTimeStamp):
1815         * inspector/InspectorNetworkAgent.cpp:
1816         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
1817         * inspector/TimelineRecordFactory.cpp:
1818         (WebCore::TimelineRecordFactory::createGenericRecord):
1819         * inspector/WebInjectedScriptManager.cpp:
1820         (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
1821         * inspector/WebInjectedScriptManager.h:
1822         * page/DOMWindow.cpp:
1823         (WebCore::DOMWindow::postMessageTimerFired):
1824         We dispatch appropriate addMessage function according to whether
1825         `timer.stackTrace()` is nullptr.
1826
1827         * page/PageConsoleClient.cpp:
1828         (WebCore::PageConsoleClient::addMessage):
1829         (WebCore::PageConsoleClient::messageWithTypeAndLevel):
1830         (WebCore::PageConsoleClient::count):
1831         (WebCore::PageConsoleClient::timeEnd):
1832         (WebCore::PageConsoleClient::timeStamp):
1833         * page/PageConsoleClient.h:
1834         * workers/WorkerConsoleClient.cpp:
1835         (WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
1836         (WebCore::WorkerConsoleClient::count):
1837         (WebCore::WorkerConsoleClient::timeEnd):
1838         (WebCore::WorkerConsoleClient::timeStamp):
1839         * workers/WorkerConsoleClient.h:
1840         * workers/WorkerGlobalScope.cpp:
1841         (WebCore::WorkerGlobalScope::addMessage):
1842
1843 2017-02-16  Chris Fleizach  <cfleizach@apple.com>
1844
1845         AX: Make form validation accessible on iOS
1846         https://bugs.webkit.org/show_bug.cgi?id=168400
1847
1848         Reviewed by Chris Dumez.
1849
1850         Hide the popover content of form validation from accessibility (since its not interactable)
1851         and instead announce the message.
1852
1853         * platform/ios/ValidationBubbleIOS.mm:
1854         (WebCore::ValidationBubble::show):
1855
1856 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
1857
1858         Clean up use of some CALayer-related SPI
1859         https://bugs.webkit.org/show_bug.cgi?id=168401
1860
1861         Reviewed by Tim Horton.
1862
1863         Use -setDrawsAsynchronously: rather than the old -setAcceleratesDrawing: SPI.
1864
1865         Remove CATiledLayer-related stuff from QuartzCoreSPI.h, since we don't use it any more.
1866
1867         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1868         (PlatformCALayerCocoa::acceleratesDrawing):
1869         (PlatformCALayerCocoa::setAcceleratesDrawing):
1870         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
1871         (-[WebTiledBackingLayer setDrawsAsynchronously:]): This override passes the state
1872         onto the TileController.
1873         (-[WebTiledBackingLayer setAcceleratesDrawing:]): Deleted.
1874         * platform/ios/LegacyTileGridTile.mm:
1875         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
1876         * platform/spi/cocoa/QuartzCoreSPI.h:
1877
1878 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1879
1880         Web Inspector: allow import() inside the inspector
1881         https://bugs.webkit.org/show_bug.cgi?id=167457
1882
1883         Reviewed by Ryosuke Niwa.
1884
1885         When evaluating `import("...")`, we need the caller's context to resolve
1886         the module specifier correctly. For example, if `import("./cocoa.js")` is
1887         evaluated in the script "drinks/hot.js", this module name is resolved to
1888         "drinks/cocoa.js". If the same import operator is evaluated in the script
1889         "menu/all.js", the module specifier becomes "menu/cocoa.js".
1890
1891         Previously we reject the import operator if the caller does not have such
1892         a context. These context is SourceOrigin and its ScriptFetcher. While they
1893         are offered in the script tag and other code evaluations, the inspector
1894         console does not offer that. These class are offered in the WebCore side
1895         and we should not touch these classes in the JSC's inspector code.
1896
1897         Now we relax the above restriction. If the above caller information is not
1898         offered, we fallback to the default one. In the web page, we use the page's
1899         URL as the caller's source origin. This allows us to evaluate the import
1900         operator in the inspector console.
1901
1902         And as of r167698, the console recognizes `await import("...")` form. We use
1903         this to test this `import()` in the console functionality.
1904
1905         Test: inspector/controller/runtime-controller-import.html
1906
1907         * bindings/js/ScriptModuleLoader.cpp:
1908         (WebCore::ScriptModuleLoader::importModule):
1909
1910 2017-02-16  Miguel Gomez  <magomez@igalia.com>
1911
1912         [GTK] scroll with transparent background not repainted after scrollY >= 32768
1913         https://bugs.webkit.org/show_bug.cgi?id=154283
1914
1915         Reviewed by Carlos Garcia Campos.
1916
1917         Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
1918         not able to draw anything when using transformation matrices with values bigger than 32768. When
1919         drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
1920         draw anything in, which causes the reported transparent backgrounds.
1921
1922         The patch modifies the transformation matrices both from the current context and the pattern we
1923         are painting, to avoid them to hold values that cannot stored in 16 bits.
1924
1925         There's still the possibility that this happens, but it would require using a pattern with a size
1926         bigger than 32768.
1927
1928         Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.
1929
1930         Test: fast/backgrounds/background-repeat-long-scroll.html
1931
1932         * platform/graphics/cairo/CairoUtilities.cpp:
1933         (WebCore::drawPatternToCairoContext):
1934
1935 2017-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1936
1937         [GTK] Images are never read from the clipboard
1938         https://bugs.webkit.org/show_bug.cgi?id=168419
1939
1940         Reviewed by Sergio Villar Senin.
1941
1942         We write images in the clipboard, but we don't read them.
1943
1944         Fixes: editing/pasteboard/paste-image-using-image-data.html
1945
1946         * editing/Editor.cpp:
1947         (WebCore::Editor::createFragmentForImageAndURL): Moved from EditorMac.mm since it's cross-platform code.
1948         * editing/Editor.h:
1949         * editing/gtk/EditorGtk.cpp:
1950         (WebCore::createFragmentFromPasteboardData): Check if there's an image in the selection, and use
1951         Editor::createFragmentForImageAndURL in that case.
1952         * editing/mac/EditorMac.mm:
1953         (WebCore::Editor::createFragmentForImageAndURL): Deleted.
1954         * platform/gtk/PasteboardHelper.cpp:
1955         (WebCore::PasteboardHelper::getClipboardContents): Check also if there's an image in the clipboard.
1956
1957 2017-02-15  Jer Noble  <jer.noble@apple.com>
1958
1959         REGRESSION (r212311): NULL-dereference in HTMLMediaElement::prepareToPlay()
1960         https://bugs.webkit.org/show_bug.cgi?id=168404
1961         <rdar://problem/30547188>
1962
1963         Reviewed by Brian Weinstein.
1964
1965         Prior to r212311, m_player was always guaranteed to be initialized when calling
1966         prepareToPlay(). r212311 began calling prepareToPlay() on a subsequent run-loop iteration
1967         after creating m_player. So now check whether m_player is NULL before calling methods on it.
1968
1969         * html/HTMLMediaElement.cpp:
1970         (WebCore::HTMLMediaElement::prepareToPlay):
1971
1972 2017-02-15  Eric Carlson  <eric.carlson@apple.com>
1973
1974         [MediaStream] delete CaptureDeviceInfo struct
1975         https://bugs.webkit.org/show_bug.cgi?id=168395
1976
1977         The CaptureDeviceInfo struct and CaptureDevice class were almost identical, so
1978         add an "enabled" field to the later, delete the former, and switch all uses of
1979         CaptureDeviceInfo to CaptureDevice.
1980
1981         Do some minor drive-by cleanup of AVCaptureDeviceManager::refreshCaptureDevices
1982         and CaptureDeviceManager::captureDeviceFromDeviceID.
1983         
1984         Reviewed by Sam Weinig.
1985
1986         No new tests, no behavior change.
1987
1988         * Modules/mediastream/MediaDevicesRequest.cpp:
1989         (WebCore::MediaDevicesRequest::start): SourceKind -> DeviceType
1990         * platform/mediastream/CaptureDevice.h:
1991         (WebCore::CaptureDevice::CaptureDevice):
1992         (WebCore::CaptureDevice::type): Renamed from kind.
1993         (WebCore::CaptureDevice::setType):
1994         (WebCore::CaptureDevice::enabled): Added.
1995         (WebCore::CaptureDevice::setEnabled):
1996         (WebCore::CaptureDevice::kind): Deleted.
1997         (WebCore::CaptureDevice::setKind): Deleted.
1998
1999         * platform/mediastream/CaptureDeviceManager.cpp:
2000         (CaptureDeviceManager::getSourcesInfo):
2001         (CaptureDeviceManager::captureDeviceFromDeviceID): Don't call sourceWithUID.
2002         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
2003         (CaptureDeviceManager::sourceWithUID):
2004         * platform/mediastream/CaptureDeviceManager.h:
2005         (WebCore::CaptureDeviceManager::refreshCaptureDevices):
2006         (WebCore::CaptureDeviceManager::refreshCaptureDeviceList): Deleted.
2007
2008         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2009         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2010         (WebCore::AVCaptureDeviceManager::captureDevices):
2011         (WebCore::deviceIsAvailable):
2012         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
2013         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
2014         (WebCore::AVCaptureDeviceManager::deviceConnected):
2015         (WebCore::AVCaptureDeviceManager::deviceDisconnected):
2016         (WebCore::AVCaptureDeviceManager::captureDeviceList): Deleted.
2017         (WebCore::shouldConsiderDeviceInDeviceList): Deleted.
2018         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Deleted.
2019         * platform/mock/MockRealtimeMediaSource.cpp:
2020         (WebCore::MockRealtimeMediaSource::audioDeviceInfo):
2021         (WebCore::MockRealtimeMediaSource::videoDeviceInfo):
2022
2023 2017-02-15  Sam Weinig  <sam@webkit.org>
2024
2025         [WebIDL] Remove custom conversion from FontFace code by using a Variant
2026         https://bugs.webkit.org/show_bug.cgi?id=168384
2027
2028         Reviewed by Alex Christensen.
2029
2030         Match the font face spec and use a union rather than any in the FontFace constructor.
2031
2032         Test: Added additional cases to fast/text/font-face-javascript.html.
2033
2034         * css/FontFace.cpp:
2035         (WebCore::FontFace::create):
2036         * css/FontFace.h:
2037         * css/FontFace.idl:
2038
2039 2017-02-15  Jer Noble  <jer.noble@apple.com>
2040
2041         Disabled Media Sources should render black/silence
2042         https://bugs.webkit.org/show_bug.cgi?id=168281
2043
2044         Reviewed by Eric Carlson.
2045
2046         Test: webrtc/video-disabled-black.html
2047
2048         Pass the enabled flag setting down from the MediaStreamTrackPrivate to its underlying
2049         source, including RealtimeMediaSource and RealtimeOutgoingAudio/VideoSource. When either
2050         enabled is cleared or muted is set, generate empty (black or silent) media, as opposed to
2051         pausing media or (worse) continuing to send generated media.
2052
2053         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2054         (WebCore::MediaStreamTrackPrivate::setEnabled):
2055         (WebCore::MediaStreamTrackPrivate::sourceEnabledChanged):
2056         * platform/mediastream/MediaStreamTrackPrivate.h:
2057         * platform/mediastream/RealtimeMediaSource.cpp:
2058         (WebCore::RealtimeMediaSource::setEnabled):
2059         * platform/mediastream/RealtimeMediaSource.h:
2060         (WebCore::RealtimeMediaSource::enabled):
2061         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2062         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2063         (WebCore::MockRealtimeAudioSourceMac::render):
2064         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2065         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
2066         (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
2067         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
2068         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2069         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2070         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
2071         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
2072         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
2073         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2074         * platform/mock/MockRealtimeVideoSource.cpp:
2075         (WebCore::MockRealtimeVideoSource::generateFrame):
2076
2077 2017-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2078
2079         Editing history scripts should not add the contenteditable attribute or override key events
2080         https://bugs.webkit.org/show_bug.cgi?id=168389
2081         <rdar://problem/30529945>
2082
2083         Reviewed by Dan Bernstein.
2084
2085         Clients that hook into editing history tracking should handle setting the contenteditable attribute on the body
2086         rather than have the script add it to the body. Additionally, this script should NOT be overriding any keydown
2087         events. These were initially added for compatibility with a test harness early on, and should have been removed
2088         earlier.
2089
2090         * Scripts/DumpEditingHistory.js:
2091
2092 2017-02-15  Jer Noble  <jer.noble@apple.com>
2093
2094         Pass "RequiresCustomURLLoading" in AVURLAsset options dictionary
2095         https://bugs.webkit.org/show_bug.cgi?id=168381
2096
2097         Reviewed by Eric Carlson.
2098
2099         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2100         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2101
2102 2017-02-15  Anders Carlsson  <andersca@apple.com>
2103
2104         Fix build.
2105
2106         * page/DragController.cpp:
2107         (WebCore::DragController::doSystemDrag):
2108
2109 2017-02-15  Anders Carlsson  <andersca@apple.com>
2110
2111         Modernize DragClient::startDrag somewhat
2112         https://bugs.webkit.org/show_bug.cgi?id=168379
2113
2114         Reviewed by Tim Horton.
2115
2116         Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
2117         instead of whether it's a link or not.
2118
2119         * loader/EmptyClients.cpp:
2120         * page/DragClient.h:
2121         * page/DragController.cpp:
2122         (WebCore::DragController::startDrag):
2123         (WebCore::DragController::doImageDrag):
2124         (WebCore::DragController::doSystemDrag):
2125         * page/DragController.h:
2126
2127 2017-02-15  Chris Dumez  <cdumez@apple.com>
2128
2129         Expose Symbol.toPrimitive / valueOf on Location instances
2130         https://bugs.webkit.org/show_bug.cgi?id=168295
2131
2132         Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
2133
2134         Expose Symbol.toPrimitive / valueOf on Location instances as per:
2135         - https://html.spec.whatwg.org/#the-location-interface
2136
2137         Firefox and Chrome already comply with the specification.
2138
2139         Tests: fast/dom/location-valueOf-after-object-prototype-update.html
2140                fast/dom/location-valueOf-after-object-prototype-update2.html
2141                imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
2142                imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
2143
2144         * bindings/scripts/CodeGeneratorJS.pm:
2145         (GenerateImplementation):
2146
2147 2017-02-15  Aakash Jain  <aakash_jain@apple.com>
2148
2149         Remove WebIOSEvent interface
2150         https://bugs.webkit.org/show_bug.cgi?id=168368
2151
2152         Reviewed by Tim Horton.
2153
2154         * platform/ios/WebEvent.h: Removed WebIOSEvent.
2155
2156 2017-02-15  Chris Dumez  <cdumez@apple.com>
2157
2158         [iOS] Form Validation Bubble should be sensitive to Dynamic Type
2159         https://bugs.webkit.org/show_bug.cgi?id=168291
2160         <rdar://problem/30508593>
2161
2162         Reviewed by Tim Horton.
2163
2164         Update ValidationBubble implementation on iOS to stop obeying the
2165         minimum font size setting, given that this setting is not exposed
2166         on iOS. Instead, we now rely on
2167         [UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
2168         will give us a font whose size obeys Dynamic Type [1] setting on iOS.
2169
2170         [1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
2171
2172         No new tests, no easily testable.
2173
2174         * platform/ios/ValidationBubbleIOS.mm:
2175         (WebCore::ValidationBubble::ValidationBubble):
2176
2177 2017-02-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2178
2179         [JSC] Drop PassRefPtr
2180         https://bugs.webkit.org/show_bug.cgi?id=168320
2181
2182         Reviewed by Saam Barati.
2183
2184         * bindings/js/ScriptSourceCode.h:
2185         (WebCore::ScriptSourceCode::ScriptSourceCode):
2186         Use Ref and pass it to SourceCode.
2187
2188         * replay/ReplayController.cpp:
2189         (WebCore::ReplayController::frameNavigated):
2190         Pass reference.
2191
2192 2017-02-15  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2193
2194         [GStreamer][MSE][EME] Handle protection event also at decryptor level
2195         https://bugs.webkit.org/show_bug.cgi?id=168316
2196
2197         Reviewed by Žan Doberšek.
2198
2199         So far in MSE pipeline we were handling the encryption events
2200         only when they arrived at the demuxer but this won't work in any
2201         kind of key renegotiation as the event will never arrive. Now we
2202         connect to the element messages, check for the drm id and send it
2203         to the private player for processing.
2204
2205         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2206         (WebCore::appendPipelineElementMessageCallback):
2207         (WebCore::AppendPipeline::AppendPipeline):
2208         (WebCore::AppendPipeline::handleElementMessage):
2209         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2210
2211 2017-02-15  Zan Dobersek  <zdobersek@igalia.com>
2212
2213         [EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
2214         https://bugs.webkit.org/show_bug.cgi?id=168362
2215
2216         Reviewed by Xabier Rodriguez-Calvar.
2217
2218         In MediaKeys::setServerCertificate(), when the CDM implementation
2219         doesn't support server certificates, it should resolve the promise
2220         with the 'false' value, as mandated by the specification, and not
2221         reject it.
2222
2223         A test case in mock-MediaKeys-setServerCertificate.html is updated.
2224
2225         * Modules/encryptedmedia/MediaKeys.cpp:
2226         (WebCore::MediaKeys::setServerCertificate):
2227
2228 2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2229
2230         REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields
2231         https://bugs.webkit.org/show_bug.cgi?id=168115
2232
2233         Reviewed by Darin Adler.
2234
2235         In r206014 HTTPHeaderMap::add() was updated to combine common headers with ',' instead of ", " to match the
2236         fetch specification, but the uncommon headers are still combined with ", ".
2237
2238         * platform/network/HTTPHeaderMap.cpp:
2239         (WebCore::HTTPHeaderMap::add):
2240
2241 2017-02-14  Ryosuke Niwa  <rniwa@webkit.org>
2242
2243         An assertion failure inside removeChildren
2244         https://bugs.webkit.org/show_bug.cgi?id=168069
2245
2246         Reviewed by Brent Fulgham.
2247
2248         The bug was caused by notifyRemovePendingSheet executing scripts synchronously where it shouldn't.
2249
2250         Removed the call to notifyRemovePendingSheetIfNeeded in notifyChildNodeRemoved. Instead, invoke it
2251         in its call sites when they're safe.
2252
2253         Test: http/tests/security/move-iframe-within-focus-handler-inside-removal.html
2254
2255         * dom/ContainerNode.cpp:
2256         (WebCore::ContainerNode::takeAllChildrenFrom):
2257         (WebCore::ContainerNode::notifyChildInserted):
2258         (WebCore::ContainerNode::removeChild):
2259         (WebCore::ContainerNode::parserRemoveChild):
2260         (WebCore::ContainerNode::replaceAllChildren):
2261         (WebCore::ContainerNode::removeChildren):
2262         * dom/ContainerNodeAlgorithms.cpp:
2263         (WebCore::notifyChildNodeRemoved):
2264
2265 2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2266
2267         [GStreamer] Several tests are timing out after r212349
2268         https://bugs.webkit.org/show_bug.cgi?id=168359
2269
2270         Reviewed by Žan Doberšek.
2271
2272         This is because they are failing the cross origin check. Those tests are not using WebKitWebSrc, but
2273         GstFileSrc. I didn't consider the case of source not being a WebKitWebSrc.
2274
2275         Fixes several timeout instroduced in r212349.
2276
2277         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2278         (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin): Split the source check in two. First check if
2279         it's nullptr, and return false. Then check if it's a WebKitWebSrc and return true if it isn't.
2280
2281 2017-02-14  Brent Fulgham  <bfulgham@apple.com>
2282
2283         Revalidate URL after events that could trigger navigations
2284         https://bugs.webkit.org/show_bug.cgi?id=168071
2285         <rdar://problem/30450379>
2286
2287         Reviewed by Ryosuke Niwa.
2288
2289         When arbitary javascript runs during a load, we should revalidate
2290         the URLs involved to make sure they are still valid.
2291
2292         Tests: http/tests/plugins/navigation-during-load-embed.html
2293                http/tests/plugins/navigation-during-load.html
2294
2295         * html/HTMLEmbedElement.cpp:
2296         (WebCore::HTMLEmbedElement::updateWidget): Confirm we are still allowed to
2297         load the URL after executing JS callbacks.
2298         * html/HTMLFrameElementBase.cpp:
2299         (WebCore::HTMLFrameElementBase::isURLAllowed): Split existing function into
2300         existing protected method, and a new public method that checks a passed URL
2301         for validity.
2302         * html/HTMLFrameElementBase.h:
2303         * html/HTMLFrameOwnerElement.h:
2304         (WebCore::HTMLFrameOwnerElement::isURLAllowed):
2305         * html/HTMLObjectElement.cpp:
2306         (WebCore::HTMLObjectElement::updateWidget): Confirm we are still allowed to
2307         load the URL after executing JS callbacks.
2308         * loader/SubframeLoader.cpp:
2309         (WebCore::SubframeLoader::requestFrame): Ditto.
2310
2311 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2312
2313         [GStreamer] Implement MediaPlayerPrivate::hasSingleSecurityOrigin()
2314         https://bugs.webkit.org/show_bug.cgi?id=168322
2315
2316         Reviewed by Žan Doberšek.
2317
2318         It currently returns true unconditionally. Add resolved-location property to WebKitWebSourceGStreamer to track
2319         the resolved url returned by the server and use that from MediaPlayerPrivate to check if there was a cross
2320         origin redirection.
2321
2322         Fixes: http/tests/security/canvas-remote-read-remote-video-redirect.html
2323
2324         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2325         (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin):
2326         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2327         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2328         (webKitWebSrcFinalize):
2329         (webKitWebSrcGetProperty):
2330         (webKitWebSrcStart):
2331         (webKitWebSrcQueryWithParent):
2332         (webKitWebSrcGetUri):
2333         (webKitWebSrcSetUri):
2334         (StreamingClient::handleResponseReceived):
2335         (ResourceHandleStreamingClient::wasBlocked):
2336         (ResourceHandleStreamingClient::cannotShowURL):
2337
2338 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2339
2340         Unreviewed, rolling out r211967.
2341
2342         Caused rendering issues in HiDPI
2343
2344         Reverted changeset:
2345
2346         "[GTK] scroll with transparent background not repainted after
2347         scrollY >= 32768"
2348         https://bugs.webkit.org/show_bug.cgi?id=154283
2349         http://trac.webkit.org/changeset/211967
2350
2351 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2352
2353         [GTK] Update cookie manager API to properly work with ephemeral sessions
2354         https://bugs.webkit.org/show_bug.cgi?id=168230
2355
2356         Reviewed by Michael Catanzaro.
2357
2358         Add implementation for deleteAllCookiesModifiedSince. Note that this only works when the timespan is 0, we need
2359         new libsoup API to support removing recently modified cookies.
2360
2361         * platform/network/soup/CookieJarSoup.cpp:
2362         (WebCore::deleteAllCookiesModifiedSince):
2363
2364 2017-02-14  Joseph Pecoraro  <pecoraro@apple.com>
2365
2366         [WebIDL] Improve serializer = { inherit }
2367         https://bugs.webkit.org/show_bug.cgi?id=168293
2368
2369         Reviewed by Youenn Fablet.
2370
2371         * bindings/scripts/CodeGeneratorJS.pm:
2372         (GenerateHeader):
2373         Expose a serialize() method on the interface.
2374
2375         (GenerateSerializerFunction):
2376         (GenerateSerializerAttributesForInterface): Deleted.
2377         Subclasses that have `serializer = { inherit }` can use
2378         their parent's serialize() method to get the initial object.
2379         We can now collapse everything back into a single function
2380         because we only generate code for our own attributes.
2381
2382         * bindings/scripts/test/JS/JSTestNode.cpp:
2383         (WebCore::JSTestNode::serialize):
2384         (WebCore::jsTestNodePrototypeFunctionToJSONCaller):
2385         * bindings/scripts/test/JS/JSTestNode.h:
2386         * bindings/scripts/test/JS/JSTestObj.cpp:
2387         (WebCore::JSTestObj::serialize):
2388         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
2389         * bindings/scripts/test/JS/JSTestObj.h:
2390         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2391         (WebCore::JSTestSerialization::serialize):
2392         (WebCore::jsTestSerializationPrototypeFunctionToJSONCaller):
2393         * bindings/scripts/test/JS/JSTestSerialization.h:
2394         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2395         (WebCore::JSTestSerializationInherit::serialize):
2396         (WebCore::jsTestSerializationInheritPrototypeFunctionToJSONCaller):
2397         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
2398         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2399         (WebCore::JSTestSerializationInheritFinal::serialize):
2400         (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSONCaller):
2401         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
2402         Updated results.
2403
2404 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
2405
2406         Move methods from WebCoreThread.h to WebCoreThreadInternal.h
2407         https://bugs.webkit.org/show_bug.cgi?id=168326
2408
2409         Reviewed by Alexey Proskuryakov.
2410
2411         * platform/ios/wak/WebCoreThread.h: Move methods WebThreadRunLoop and WebThreadCurrentContext to WebCoreThreadInternal.h
2412         * platform/ios/wak/WebCoreThreadInternal.h: Ditto.
2413         * platform/ios/wak/WebCoreThreadRun.cpp: Removed WebCoreThread.h as it is already included by WebCoreThreadInternal.h
2414         * platform/ios/wak/WKGraphics.mm: Included WebCoreThreadInternal.h, it subsequently includes WebCoreThread.h
2415         * inspector/InspectorTimelineAgent.cpp: Ditto.
2416         * page/mac/PageMac.mm: Ditto.
2417         * platform/cf/MainThreadSharedTimerCF.cpp: Ditto.
2418         * platform/cocoa/MemoryPressureHandlerCocoa.mm: Ditto.
2419         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Ditto.
2420         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Ditto.
2421         * bindings/js/CommonVM.cpp: included WebCoreThreadInternal.h
2422
2423 2017-02-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2424
2425         [WK2] Support data interaction on links
2426         https://bugs.webkit.org/show_bug.cgi?id=168331
2427         <rdar://problem/30200837>
2428
2429         Reviewed by Tim Horton.
2430
2431         Adds support for data interaction on links at the WebCore layer, refactoring some drag-and-drop code on the Mac
2432         along the way. Also adds two new TestWebKitAPI unit tests in DataInteractionTests.mm: LinkToInput and
2433         BackgroundImageLinkToInput (see Tools/ChangeLog for more information).
2434
2435         * page/DragController.cpp:
2436         (WebCore::DragController::startDrag):
2437         (WebCore::DragController::doImageDrag):
2438         (WebCore::DragController::doSystemDrag):
2439
2440         Introduce platformAdjustDragImageForDeviceScaleFactor, and special-case drag images for links to anchor at the
2441         bottom center.
2442
2443         * platform/DragImage.cpp:
2444         (WebCore::platformAdjustDragImageForDeviceScaleFactor):
2445
2446         Scale the drag image up by the device scale factor. In WebDragClient, we scale the image back down to the
2447         original size. It seems the reason we do this extra dance is because the image sizing heuristic in between
2448         assumes that the image dimensions are for a non-retina device, but this work should really not be necessary if
2449         we tweak the heuristic to account for deviceScaleFactor. We should address this in a separate patch.
2450
2451         * platform/DragImage.h:
2452         * platform/graphics/Path.h:
2453
2454 2017-02-14  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
2455
2456         [CURL] ResourceError created with error information should have default type Type::General
2457         https://bugs.webkit.org/show_bug.cgi?id=168345
2458
2459         Reviewed by Alex Christensen.
2460
2461         ResourceError has separate implementaion for each platform
2462         so that the interface should be same.
2463         On CURL port, the constructor with error information has
2464         different default value on `type` parameter. It is Type::Null but other implementaitons have Type::General.
2465         This causes some ResourceError is created inconsistent. 
2466
2467         * platform/network/curl/ResourceError.h:
2468         (WebCore::ResourceError::ResourceError):
2469
2470 2017-02-14  Youenn Fablet  <youennf@gmail.com>
2471
2472         [WebRTC] Add support for libwebrtc negotiation needed event
2473         https://bugs.webkit.org/show_bug.cgi?id=168267
2474
2475         Reviewed by Eric Carlson.
2476
2477         Test: webrtc/negotiatedneeded-event-addStream.html
2478
2479         Moving generic code (markAsNeedingNegotiation) from MediaEndpointPeerConnection to PeerConnectionBackend.
2480         This code handles the control of sending or not the negotiationneeded event.
2481
2482         Updating mock to use markAsNeedingNegotiation when streams are changed.
2483         Updating libwebrtc backend to call markAsNeedingNegotiation when required by libwebrtc implementation.
2484
2485         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2486         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
2487         * Modules/mediastream/MediaEndpointPeerConnection.h:
2488         * Modules/mediastream/PeerConnectionBackend.cpp:
2489         (WebCore::PeerConnectionBackend::markAsNeedingNegotiation):
2490         * Modules/mediastream/PeerConnectionBackend.h:
2491         (WebCore::PeerConnectionBackend::isNegotiationNeeded):
2492         (WebCore::PeerConnectionBackend::clearNegotiationNeededState):
2493         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2494         (WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
2495         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2496         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2497         * testing/MockLibWebRTCPeerConnection.cpp:
2498         (WebCore::MockLibWebRTCPeerConnection::AddStream):
2499         (WebCore::MockLibWebRTCPeerConnection::RemoveStream):
2500
2501 2017-02-14  Brady Eidson  <beidson@apple.com>
2502
2503         Unreviewed followup to r212330 to fix Debug builds
2504
2505         * loader/DocumentThreadableLoader.cpp:
2506         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Add call to relaxAdoptionRequirement().
2507
2508 2017-02-14  Matt Rajca  <mrajca@apple.com>
2509
2510         Website policies: iframes should respect the autoplay policy of the top-level document
2511         https://bugs.webkit.org/show_bug.cgi?id=168333
2512
2513         Reviewed by Alex Christensen.
2514
2515         API tests were added.
2516
2517         * html/HTMLMediaElement.cpp:
2518         (WebCore::HTMLMediaElement::HTMLMediaElement):
2519
2520 2017-02-14  Dean Jackson  <dino@apple.com>
2521
2522         Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
2523         https://bugs.webkit.org/show_bug.cgi?id=168339
2524         <rdar://problem/30522092>
2525
2526         Reviewed by Simon Fraser.
2527
2528         Use a setting name that more clearly reflects what it is doing. It's not
2529         preferring to use the low-power GPU, it's forcing it.
2530
2531         * html/canvas/WebGLRenderingContextBase.cpp:
2532         (WebCore::WebGLRenderingContextBase::create):
2533         * page/Settings.in:
2534
2535 2017-02-14  Brady Eidson  <beidson@apple.com>
2536
2537         Speculative fix for: Crash in DocumentThreadableLoader::redirectReceived.
2538         <rdar://problem/29899473> and https://bugs.webkit.org/show_bug.cgi?id=168337
2539
2540         Reviewed by Geoffrey Garen.
2541
2542         No new tests (Unable to find a reproduction).
2543
2544         * loader/DocumentThreadableLoader.cpp:
2545         (WebCore::DocumentThreadableLoader::loadRequest):
2546
2547 2017-02-14  Youenn Fablet  <youenn@apple.com>
2548
2549         [WebRTC] Remove obsolete WebRTC stats API
2550         https://bugs.webkit.org/show_bug.cgi?id=167910
2551
2552         Reviewed by Alex Christensen.
2553
2554         No change of behavior as removed constructs are not functional.
2555         Removing RTCStatsResponse which no longer exists and made RTCStatsReport an empty container for now.
2556
2557         * CMakeLists.txt:
2558         * DerivedSources.cpp:
2559         * DerivedSources.make:
2560         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2561         (WebCore::MediaEndpointPeerConnection::getStats):
2562         * Modules/mediastream/MediaEndpointPeerConnection.h:
2563         * Modules/mediastream/PeerConnectionBackend.h:
2564         * Modules/mediastream/RTCPeerConnection.cpp:
2565         (WebCore::RTCPeerConnection::getStats):
2566         * Modules/mediastream/RTCStatsReport.cpp:
2567         (WebCore::RTCStatsReport::create): Deleted.
2568         (WebCore::RTCStatsReport::RTCStatsReport): Deleted.
2569         (WebCore::RTCStatsReport::names): Deleted.
2570         (WebCore::RTCStatsReport::local): Deleted.
2571         (WebCore::RTCStatsReport::remote): Deleted.
2572         (WebCore::RTCStatsReport::addStatistic): Deleted.
2573         * Modules/mediastream/RTCStatsReport.h:
2574         (WebCore::RTCStatsReport::create):
2575         (WebCore::RTCStatsReport::timestamp): Deleted.
2576         (WebCore::RTCStatsReport::id): Deleted.
2577         (WebCore::RTCStatsReport::type): Deleted.
2578         (WebCore::RTCStatsReport::stat): Deleted.
2579         * Modules/mediastream/RTCStatsReport.idl:
2580         * Modules/mediastream/RTCStatsResponse.cpp: Removed.
2581         * Modules/mediastream/RTCStatsResponse.h: Removed.
2582         * Modules/mediastream/RTCStatsResponse.idl: Removed.
2583         * WebCore.xcodeproj/project.pbxproj:
2584         * platform/mediastream/MediaEndpoint.h:
2585         (WebCore::MediaEndpoint::getStats):
2586         * platform/mediastream/RTCStatsRequest.h: Removed.
2587         * platform/mediastream/RTCStatsResponseBase.h: Removed.
2588
2589 2017-02-14  Karim H  <karim@karhm.com>
2590
2591         Removed unused methods of WebCore::FileStream
2592         https://bugs.webkit.org/show_bug.cgi?id=168025
2593
2594         Reviewed by Michael Catanzaro.
2595
2596         * fileapi/AsyncFileStream.cpp:
2597         (WebCore::AsyncFileStream::openForWrite): Deleted.
2598         (WebCore::AsyncFileStream::write): Deleted.
2599         (WebCore::AsyncFileStream::truncate): Deleted.
2600         * fileapi/AsyncFileStream.h:
2601         * platform/FileStream.cpp:
2602         (WebCore::FileStream::openForWrite): Deleted.
2603         (WebCore::FileStream::write): Deleted.
2604         (WebCore::FileStream::truncate): Deleted.
2605         * platform/FileStream.h:
2606
2607 2017-02-14  Chris Dumez  <cdumez@apple.com>
2608
2609         HTML Form Validation bubble should take minimum font size setting into consideration
2610         https://bugs.webkit.org/show_bug.cgi?id=168271
2611         <rdar://problem/29869869>
2612
2613         Reviewed by Simon Fraser.
2614
2615         HTML Form Validation bubble should take minimum font size setting into consideration
2616         for better accessibility.
2617
2618         Test: fast/forms/validation-message-minimum-font-size.html
2619
2620         * platform/ValidationBubble.h:
2621         (WebCore::ValidationBubble::create):
2622         (WebCore::ValidationBubble::fontSize):
2623         * platform/ios/ValidationBubbleIOS.mm:
2624         (WebCore::ValidationBubble::ValidationBubble):
2625         * platform/mac/ValidationBubbleMac.mm:
2626         (WebCore::ValidationBubble::ValidationBubble):
2627         Update the ValidationBubble constructor to take in Settings. For now, there is a
2628         single setting that is the minimum font size and that is taken into account when
2629         setting the font size of the validation bubble text.
2630
2631 2017-02-14  Eric Carlson  <eric.carlson@apple.com>
2632
2633         [MediaStream] add navigator.getUserMedia for compatibility with legacy content
2634         https://bugs.webkit.org/show_bug.cgi?id=168324
2635         <rdar://problem/30513125>
2636
2637         Reviewed by Youenn Fablet.
2638
2639         Tests: fast/mediastream/argument-types.html
2640                fast/mediastream/getusermedia.html
2641                fast/mediastream/webkitGetUserMedia-shadowing-then.html
2642
2643         * CMakeLists.txt:
2644         * DerivedSources.cpp:
2645         * DerivedSources.make:
2646         * Modules/mediastream/MediaDevices.idl:
2647         * Modules/mediastream/NavigatorUserMedia.idl: Added.
2648         * Modules/mediastream/NavigatorUserMedia.js: Added.
2649         * WebCore.xcodeproj/project.pbxproj:
2650         * bindings/js/WebCoreBuiltinNames.h:
2651         * page/Navigator.idl:
2652
2653 2017-02-14  Chris Dumez  <cdumez@apple.com>
2654
2655         Fallback to legacy type only when event is trusted
2656         https://bugs.webkit.org/show_bug.cgi?id=168301
2657
2658         Reviewed by Ryosuke Niwa.
2659
2660         Fallback to legacy type only when event is trusted as per a recent
2661         DOM specification change:
2662         - https://github.com/whatwg/dom/issues/404
2663         - https://github.com/whatwg/dom/pull/406
2664
2665         No new tests, rebaselined existing test.
2666
2667         * dom/EventTarget.cpp:
2668         (WebCore::legacyType):
2669         (WebCore::EventTarget::fireEventListeners):
2670
2671 2017-02-13  Dean Jackson  <dino@apple.com>
2672
2673         Rename preferLowPowerToHighPerformance to powerPreference
2674         https://bugs.webkit.org/show_bug.cgi?id=168269
2675         <rdar://problem/30504444>
2676
2677         Reviewed by Chris Dumez.
2678
2679         Based on the discussion in https://github.com/KhronosGroup/WebGL/pull/2283.
2680
2681         Change WebGLContextAttributes's preferLowPowerToHighPerformance boolean
2682         into a powerPreference enum taking three values. The implementation
2683         of the enum is in GraphicsContext3DAttributes.
2684
2685         While the name and values have changed, there should be no change in
2686         behaviour caused by this patch.
2687
2688         * html/canvas/WebGLContextAttributes.h: Use GraphicsContext3DAttributes
2689         enum GraphicsContext3DPowerPreference.
2690         * html/canvas/WebGLContextAttributes.idl: Rename and add the WebIDL enum.
2691         * html/canvas/WebGLRenderingContextBase.cpp: Use the new values.
2692         (WebCore::WebGLRenderingContextBase::create):
2693         (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
2694         * platform/WebGLStateTracker.cpp:
2695         * platform/WebGLStateTracker.h: Update the state tracker to use the new
2696         values.
2697         * platform/graphics/GraphicsContext3DAttributes.h:
2698         * platform/graphics/mac/GraphicsContext3DMac.mm:
2699         (WebCore::setPixelFormat): Accept GraphicsContext3DPowerPreference as a parameter.
2700         (WebCore::GraphicsContext3D::GraphicsContext3D):
2701
2702 2017-02-14  Youenn Fablet  <youennf@gmail.com>
2703
2704         [WebRTC] Implement description getters for libwebrtc RTCPeerConnection
2705         https://bugs.webkit.org/show_bug.cgi?id=168234
2706
2707         Reviewed by Alex Christensen.
2708
2709         Allows passing W3C webrtc tests.
2710
2711         Implementing localDescription/remoteDescription using libwebrtc backend.
2712         current and pending description getters are made the same as local/remote getters for the moment.
2713         This should be fixed when upgrading to latest libwebrtc revision.
2714
2715         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2716         (WebCore::toSessionDescriptionType):
2717         (WebCore::fromSessionDescriptionType):
2718         (WebCore::fromSessionDescription):
2719         (WebCore::LibWebRTCMediaEndpoint::localDescription):
2720         (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
2721         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
2722         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
2723         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2724         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2725         (WebCore::LibWebRTCPeerConnectionBackend::localDescription):
2726         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2727
2728 2017-02-14  Jeremy Jones  <jeremyj@apple.com>
2729
2730         When playing inline after fullscreen, set a flag instead of adding attribute plays inline, and use in requiresFullscreenForVideoPlayback.
2731         https://bugs.webkit.org/show_bug.cgi?id=167815
2732         rdar://problem/27685077
2733
2734         Reviewed by Jer Noble.
2735
2736         Test: media/media-fullscreen-loop-inline.html
2737
2738         When video is allowed to play inline after fullscreen. Looped video causes play state to update, which can send video back to fullscreen when
2739         allowsInline is false. This change will set a new flag when allowsInlineMediaPlaybackAfterFullscreen allows inline playback that can be tested
2740         in requiresFullscreenForVideoPlayback to prevent sending video back into fullscreen when video loops.
2741
2742         * html/HTMLMediaElement.cpp:
2743         (WebCore::HTMLMediaElement::enterFullscreen):
2744         (WebCore::HTMLMediaElement::exitFullscreen):
2745         * html/HTMLMediaElement.h:
2746         (WebCore::HTMLMediaElement::isTemporarilyAllowingInlinePlaybackAfterFullscreen): Added.
2747         * html/MediaElementSession.cpp:
2748         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2749
2750 2017-02-14  Jer Noble  <jer.noble@apple.com>
2751
2752         Video elements with MediaSource objects set by srcObject are not cleared when srcObject is set to null
2753         https://bugs.webkit.org/show_bug.cgi?id=168268
2754
2755         Reviewed by Eric Carlson.
2756
2757         Test: fast/mediastream/MediaStream-MediaElement-setObject-null.html
2758
2759         Make the setSrcObject() operation compliant with the HTML spec. Since the specification defines
2760         srcObject in terms of either a MediaSource, MediaStream, or Blob object, add the variant typedef
2761         to HTMLMediaElement and move the definition out of the Modules/mediastream extension IDL and into
2762         HTMLMediaElement.idl. Then bring the "media elements load" and "resource selection" algorithms up
2763         to their most recent definitions in the HTML5 spec.
2764
2765         Drive-by fix: Allow the (admittedly weird) single-element-union type in IDL.
2766
2767         * CMakeLists.txt:
2768         * DerivedSources.cpp:
2769         * DerivedSources.make:
2770         * Modules/mediastream/HTMLMediaElementMediaStream.cpp: Removed.
2771         * Modules/mediastream/HTMLMediaElementMediaStream.h: Removed.
2772         * Modules/mediastream/HTMLMediaElementMediaStream.idl: Removed.
2773         * WebCore.xcodeproj/project.pbxproj:
2774         * bindings/scripts/IDLParser.pm:
2775         (parseUnionType):
2776         * html/HTMLAudioElement.cpp:
2777         (WebCore::HTMLAudioElement::createForJSConstructor):
2778         * html/HTMLMediaElement.cpp:
2779         (WebCore::actionName):
2780         (WebCore::HTMLMediaElement::parseAttribute):
2781         (WebCore::HTMLMediaElement::insertedInto):
2782         (WebCore::HTMLMediaElement::scheduleDelayedAction):
2783         (WebCore::HTMLMediaElement::scheduleNextSourceChild):
2784         (WebCore::HTMLMediaElement::pendingActionTimerFired):
2785         (WebCore::HTMLMediaElement::setSrcObject):
2786         (WebCore::HTMLMediaElement::load):
2787         (WebCore::HTMLMediaElement::prepareForLoad):
2788         (WebCore::HTMLMediaElement::selectMediaResource):
2789         (WebCore::HTMLMediaElement::loadResource):
2790         (WebCore::HTMLMediaElement::playInternal):
2791         (WebCore::HTMLMediaElement::pauseInternal):
2792         (WebCore::HTMLMediaElement::sourceWasAdded):
2793         (WebCore::HTMLMediaElement::clearMediaPlayer):
2794         (WebCore::HTMLMediaElement::resume):
2795         (WebCore::HTMLMediaElement::mediaCanStart):
2796         (WebCore::HTMLMediaElement::createMediaPlayer):
2797         (WebCore::HTMLMediaElement::loadInternal): Deleted.
2798         * html/HTMLMediaElement.h:
2799         (WebCore::HTMLMediaElement::srcObject):
2800         * html/HTMLMediaElement.idl:
2801         * platform/ContentType.h:
2802
2803 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
2804
2805         Remove unused WebThreadContextIsCurrent method from WebCoreThread.h
2806         https://bugs.webkit.org/show_bug.cgi?id=168254
2807
2808         Reviewed by Dan Bernstein.
2809
2810         * platform/ios/wak/WebCoreThread.h: Removed unused WebThreadContextIsCurrent.
2811         * platform/ios/wak/WebCoreThread.mm:
2812         (WebThreadContextIsCurrent): Deleted.
2813
2814 2017-02-14  Alexey Proskuryakov  <ap@apple.com>
2815
2816         WebCore shouldn't export SystemMemory.h
2817         https://bugs.webkit.org/show_bug.cgi?id=168285
2818
2819         Reviewed by Alex Christensen.
2820
2821         * WebCore.xcodeproj/project.pbxproj:
2822
2823 2017-02-13  Filip Pizlo  <fpizlo@apple.com>
2824
2825         worker.postMessage should throw a TypeError if a SharedArrayBuffer is in the transfer list
2826         https://bugs.webkit.org/show_bug.cgi?id=168277
2827
2828         Reviewed by Mark Lam.
2829
2830         Test: workers/sab/postMessage-transfer-type-error.html
2831         
2832         This is a simple spec compliance change. The title says it all.
2833
2834         * bindings/js/SerializedScriptValue.cpp:
2835         (WebCore::SerializedScriptValue::create):
2836
2837 2017-02-14  Zan Dobersek  <zdobersek@igalia.com>
2838
2839         HTMLMediaElement: WebKitMediaKeys member name should be prefixed
2840         https://bugs.webkit.org/show_bug.cgi?id=168297
2841
2842         Reviewed by Xabier Rodriguez-Calvar.
2843
2844         Rename the LEGACY_ENCRYPTED_MEDIA m_mediaKeys variable to m_webkitMediaKeys
2845         so that it contains the legacy prefix, just like the API. This will make
2846         room for the MediaKeys member variable that will be implemented under
2847         the ENCRYPTED_MEDIA guards.
2848
2849         * html/HTMLMediaElement.cpp:
2850         (WebCore::HTMLMediaElement::mediaPlayerCachedKeyForKeyId):
2851         (WebCore::HTMLMediaElement::webkitSetMediaKeys):
2852         * html/HTMLMediaElement.h:
2853         (WebCore::HTMLMediaElement::webkitKeys):
2854
2855 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2856
2857         [GTK] Make DragImageRef a RefPtr instead of a plain pointer
2858         https://bugs.webkit.org/show_bug.cgi?id=168296
2859
2860         Reviewed by Sergio Villar Senin.
2861
2862         Use RefPtr<cairo_surface_t> as DragImageRef for GTK+ port to avoid memory leaks.
2863
2864         * platform/DragImage.h:
2865         * platform/gtk/DragImageGtk.cpp:
2866         (WebCore::dragImageSize):
2867         (WebCore::deleteDragImage):
2868         (WebCore::scaleDragImage):
2869         (WebCore::dissolveDragImageToFraction):
2870         (WebCore::createDragImageFromImage):
2871         (WebCore::createDragImageIconForCachedImageFilename):
2872
2873 2017-02-14  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
2874
2875         [GStreamer][MSE] Some GStreamer log messages are generated with the 'default' category
2876         https://bugs.webkit.org/show_bug.cgi?id=168015
2877
2878         Reviewed by Xabier Rodriguez-Calvar.
2879
2880         The elements AppendPipeline, PlaybackPipeline, MediaSourceClientGstreamerMSE do not have
2881         a defined Gstreamer log category, then the webkitmse category has been added to them.
2882         WebKitMediaSourceGstreamer has its own category but was not declared at the beginning of
2883         the .cpp file.
2884
2885         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added webkitmse category.
2886         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2887         Added webkitmse category and gst header.
2888         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added webkitmse category.
2889         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2890         Added webkitmediasrc category.
2891
2892 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2893
2894         CookieManager only works with the default session
2895         https://bugs.webkit.org/show_bug.cgi?id=168229
2896
2897         Reviewed by Alex Christensen.
2898
2899         Update cookie observer API to use a std::function instead of a function pointer and make it work with multiple
2900         sessions in the backends that support it.
2901
2902         * platform/network/CookieStorage.h:
2903         * platform/network/cf/CookieStorageCFNet.cpp:
2904         (WebCore::cookieChangeCallbackMap):
2905         (WebCore::notifyCookiesChanged):
2906         (WebCore::startObservingCookieChanges):
2907         (WebCore::stopObservingCookieChanges):
2908         * platform/network/mac/CookieStorageMac.mm:
2909         (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
2910         (-[WebCookieStorageObjCAdapter stopListeningForCookieChangeNotifications]):
2911         (WebCore::startObservingCookieChanges):
2912         (WebCore::stopObservingCookieChanges):
2913         * platform/network/soup/CookieStorageSoup.cpp:
2914         (WebCore::cookieChangeCallbackMap):
2915         (WebCore::soupCookiesChanged):
2916         (WebCore::startObservingCookieChanges):
2917         (WebCore::stopObservingCookieChanges):
2918
2919 2017-02-13  Antoine Quint  <graouts@apple.com>
2920
2921         REGRESSION: Update volume and scrubbing slider to match HI designs
2922         https://bugs.webkit.org/show_bug.cgi?id=168170
2923         <rdar://problem/28095266>
2924
2925         Reviewed by Dean Jackson.
2926
2927         We bring the designs of the control's background materials, scrubber and
2928         volume slider up to spec.
2929
2930         The first important set of changes is that, on macOS, the materials and colors
2931         were incorrect. Buttons and time labels now set a mix-blend-mode to correctly
2932         appear vibrant against the media, and the controls bar, volume container
2933         and tracks menu now use a new BackgroundTint node to correctly apply both
2934         a backdrop-filter and blended tint above it.
2935
2936         The second important set of changes is the rendering of the sliders. Up to now
2937         we would simply style the <input type="range"> track and thumb, applying solid
2938         fills and strokes. We now draw sliders in two ways depending on the platform.
2939         
2940         On macOS, we draw the whole slider with a <canvas> element with "mix-blend-mode"
2941         set to "plus-lighter". On iOS, we draw the track as a <div> with "mix-blend-mode"
2942         set to "plus-darker" and draw the fill (up to the thumb) in the <canvas> with
2943         no blend mode to obtain a pure white color, finally the thumb is rendered by the
2944         <input> element. We couldn't draw the pure white color with the track in the
2945         same <canvas> due to the "plus-darker" blend mode.
2946
2947         Test: media/modern-media-controls/background-tint/background-tint.html
2948
2949         * Modules/modern-media-controls/controls/airplay-button.css:
2950         (button.airplay.on):
2951         * Modules/modern-media-controls/controls/background-tint.css: Added.
2952         (.background-tint):
2953         (.background-tint,):
2954         (.background-tint > .blur):
2955         (.background-tint > .tint):
2956         * Modules/modern-media-controls/controls/background-tint.js: Added.
2957         (BackgroundTint):
2958         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
2959         (.media-controls.ios.inline .scrubber.slider):
2960         (.media-controls.ios.inline .scrubber.slider > div):
2961         (.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
2962         (.media-controls.ios.inline .scrubber.slider > .fill): Deleted.
2963         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
2964         (.media-controls.mac.inline.compact .volume-slider-container):
2965         (.media-controls.mac.inline.compact .volume.slider):
2966         (.media-controls.mac.inline.compact .scrubber.slider > input::-webkit-slider-thumb): Deleted.
2967         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
2968         (.media-controls.mac.fullscreen > .controls-bar):
2969         (.media-controls.mac.fullscreen > .controls-bar > .background-tint > div):
2970         (.media-controls.mac.fullscreen .volume.slider):
2971         (.media-controls.mac.fullscreen button.volume-up):
2972         (.media-controls.mac.fullscreen button.rewind):
2973         (.media-controls.mac.fullscreen button.forward):
2974         (.media-controls.mac.fullscreen .buttons-container.right button):
2975         (.media-controls.mac.fullscreen .scrubber):
2976         (.media-controls.mac.fullscreen > .controls-bar button): Deleted.
2977         (.media-controls.mac.fullscreen button.airplay): Deleted.
2978         (.media-controls.mac.fullscreen button.aspect-ratio): Deleted.
2979         (.media-controls.mac.fullscreen button.pip): Deleted.
2980         (.media-controls.mac.fullscreen button.tracks): Deleted.
2981         (.media-controls.mac.fullscreen button.fullscreen): Deleted.
2982         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2983         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
2984         (.media-controls.mac.inline .scrubber.slider):
2985         (.media-controls.mac.inline .volume-slider-container):
2986         (.media-controls.mac.inline .volume-slider-container > .background-tint):
2987         (.media-controls.mac.inline .volume-slider-container > .background-tint > div):
2988         (.media-controls.mac.inline .volume.slider):
2989         (.media-controls.mac.inline button): Deleted.
2990         (.media-controls.mac.inline button:active): Deleted.
2991         (.media-controls.mac.inline > .controls-bar button): Deleted.
2992         (.media-controls.mac.inline > .controls-bar,): Deleted.
2993         (.media-controls.mac.inline .volume-slider-container:before): Deleted.
2994         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2995         (MacOSInlineMediaControls.prototype.layout):
2996         * Modules/modern-media-controls/controls/macos-media-controls.css: Added.
2997         (.media-controls.mac button:active):
2998         (.media-controls.mac > .controls-bar button):
2999         (.media-controls.mac > .controls-bar .time-label):
3000         (.media-controls.mac > .controls-bar .slider > canvas):
3001         (.media-controls.mac > .controls-bar .slider > input::-webkit-slider-thumb):
3002         * Modules/modern-media-controls/controls/scrubber.css: Removed.
3003         * Modules/modern-media-controls/controls/scrubber.js:
3004         (Scrubber):
3005         (Scrubber.prototype.get buffered):
3006         (Scrubber.prototype.set buffered):
3007         (Scrubber.prototype.draw):
3008         (Scrubber.prototype._drawMacOS):
3009         (Scrubber.prototype._drawiOS):
3010         * Modules/modern-media-controls/controls/slider.css:
3011         (.slider):
3012         (.slider > canvas,):
3013         (.slider > canvas):
3014         (.slider > input):
3015         (.slider > input,): Deleted.
3016         (.slider > .fill): Deleted.
3017         (.slider > input::-webkit-slider-thumb): Deleted.
3018         * Modules/modern-media-controls/controls/slider.js:
3019         (Slider.prototype.set value):
3020         (Slider.prototype.set width):
3021         (Slider.prototype.commitProperty):
3022         (Slider.prototype.layout):
3023         (Slider.prototype.draw):
3024         (Slider.prototype._handleInputEvent):
3025         (Slider.prototype._handleChangeEvent):
3026         (addRoundedRect):
3027         (Slider.prototype._updateFill): Deleted.
3028         * Modules/modern-media-controls/controls/start-button.css:
3029         (button.start):
3030         * Modules/modern-media-controls/controls/time-control.js:
3031         * Modules/modern-media-controls/controls/time-label.css:
3032         (.time-label):
3033         * Modules/modern-media-controls/controls/tracks-panel.css:
3034         (.tracks-panel):
3035         (.tracks-panel > .background-tint > div):
3036         (.tracks-panel > section):
3037         (.tracks-panel > section:first-of-type):
3038         (.tracks-panel > section > h3):
3039         (.tracks-panel > section > ul):
3040         (.tracks-panel > section > ul > li):
3041         (.tracks-panel > section > ul > li:focus):
3042         (.tracks-panel > section > ul > li.selected:before):
3043         (.tracks-panel > section > ul > li.animated):
3044         (.tracks-panel-section): Deleted.
3045         (.tracks-panel-section:first-of-type): Deleted.
3046         (.tracks-panel-section > h3): Deleted.
3047         (.tracks-panel-section > ul): Deleted.
3048         (.tracks-panel-section > ul > li): Deleted.
3049         (.tracks-panel-section > ul > li:focus): Deleted.
3050         (.tracks-panel-section > ul > li.selected:before): Deleted.
3051         (.tracks-panel-section > ul > li.animated): Deleted.
3052         * Modules/modern-media-controls/controls/tracks-panel.js:
3053         (TracksPanel.prototype._childrenFromDataSource):
3054         (TracksPanel.prototype._childrenFromDataSource.): Deleted.
3055         * Modules/modern-media-controls/controls/volume-slider.js:
3056         (VolumeSlider):
3057         (VolumeSlider.prototype.handleEvent):
3058         (VolumeSlider.prototype.draw):
3059         * Modules/modern-media-controls/js-files:
3060         * Modules/modern-media-controls/media/scrubbing-support.js:
3061         (ScrubbingSupport.prototype.get mediaEvents):
3062         (ScrubbingSupport.prototype.syncControl):
3063         (ScrubbingSupport):
3064
3065 2017-02-13  Alex Christensen  <achristensen@webkit.org>
3066
3067         URLs with an invalid IPv4 address should be invalid
3068         https://bugs.webkit.org/show_bug.cgi?id=168260
3069
3070         Reviewed by Tim Horton.
3071
3072         All URL hosts are fed through the IPv4 parser.  https://webkit.org/ doesn't
3073         look enough like an IPv4 address to be considered an invalid IPv4 address, so 
3074         we continue to the String host processing.  http://127.0.0.257 does, though, and
3075         according to https://url.spec.whatwg.org/#concept-ipv4-parser parsing that URL
3076         should fail.
3077
3078         Covered by newly passing web platform tests.
3079
3080         * platform/URLParser.cpp:
3081         (WebCore::URLParser::parseIPv4Host):
3082         (WebCore::URLParser::parseHostAndPort):
3083         * platform/URLParser.h:
3084
3085 2017-02-13  Dan Bernstein  <mitz@apple.com>
3086
3087         Reverted r212275. It still breaks some Apple-internal builds.
3088
3089         * platform/spi/mac/TUCallSPI.h:
3090
3091 2017-02-13  Joseph Pecoraro  <pecoraro@apple.com>
3092
3093         Address ESLint warnings in modern-media-controls
3094         https://bugs.webkit.org/show_bug.cgi?id=168224
3095
3096         Reviewed by Alexey Proskuryakov.
3097
3098         * Modules/modern-media-controls/controls/controls-bar.js:
3099         * Modules/modern-media-controls/controls/fullscreen-button.js:
3100         * Modules/modern-media-controls/controls/layout-node.js:
3101         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3102         * Modules/modern-media-controls/controls/media-controls.js:
3103         * Modules/modern-media-controls/controls/scheduler.js:
3104         * Modules/modern-media-controls/controls/seek-button.js:
3105         * Modules/modern-media-controls/controls/tracks-panel.js:
3106         * Modules/modern-media-controls/controls/volume-slider.js:
3107         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
3108         * Modules/modern-media-controls/gesture-recognizers/pinch.js:
3109         * Modules/modern-media-controls/media/fullscreen-support.js:
3110         * Modules/modern-media-controls/media/media-controller.js:
3111         * Modules/modern-media-controls/media/placard-support.js:
3112         * Modules/modern-media-controls/media/status-support.js:
3113         Address pedantic warnings.
3114
3115 2017-02-13  Dan Bernstein  <mitz@apple.com>
3116
3117         Restored changes from r212210 in a way that does not break the build.
3118
3119         * platform/spi/mac/TUCallSPI.h:
3120
3121 2017-02-13  Zalan Bujtas  <zalan@apple.com>
3122
3123         FontCascade::widthForSimpleText should skip applyTransforms() when kerning and ligatures are off.
3124         https://bugs.webkit.org/show_bug.cgi?id=168251
3125         <rdar://problem/30498102>
3126
3127         Reviewed by Antti Koivisto.
3128
3129         Covered by existing (perf)tests.
3130
3131         * platform/graphics/FontCascade.cpp:
3132         (WebCore::FontCascade::widthForSimpleText):
3133
3134 2017-02-12  Brian Burg  <bburg@apple.com>
3135
3136         Web Inspector: expose system user interface layout direction through InspectorFrontendHost
3137         https://bugs.webkit.org/show_bug.cgi?id=168209
3138         <rdar://problem/11573736>
3139
3140         Reviewed by Joseph Pecoraro.
3141
3142         Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
3143         properly set the UI directionality from system settings in PageClient, this will get inherited
3144         automatically by the Inspector's WebPage instance.
3145
3146         * inspector/InspectorFrontendClient.h:
3147         * inspector/InspectorFrontendClientLocal.cpp:
3148         (WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection):
3149         * inspector/InspectorFrontendClientLocal.h:
3150
3151         * inspector/InspectorFrontendHost.h:
3152         * inspector/InspectorFrontendHost.idl:
3153         * inspector/InspectorFrontendHost.cpp:
3154         (WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
3155         Expose the directionality to the frontend as "ltr" or "rtl" strings.
3156
3157 2017-02-13  Zalan Bujtas  <zalan@apple.com>
3158
3159         Simple line layout: Do not measure runs with trailing whitespace when kerning and ligatures are off.
3160         https://bugs.webkit.org/show_bug.cgi?id=168247
3161         <rdar://problem/30497288>
3162
3163         Reviewed by Antti Koivisto.
3164
3165         The width of the run is supposed to be the same with or without the trailing whitespace.
3166
3167         Covered by performance test.
3168
3169         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3170         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
3171         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3172         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3173
3174 2017-02-13  Karim H  <karim@karhm.com>
3175
3176         Added the other missing BSTR roles tag names.
3177         https://bugs.webkit.org/show_bug.cgi?id=165545
3178
3179         Reviewed by Chris Fleizach.
3180
3181         Test: accessibility/win/bstr-elements-role.html
3182
3183         * accessibility/AccessibilityRenderObject.cpp:
3184         (WebCore::shouldReturnTagNameAsRoleForMSAA):
3185
3186 2017-02-13  Youenn Fablet  <youennf@gmail.com>
3187
3188         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
3189         https://bugs.webkit.org/show_bug.cgi?id=168250
3190
3191         Reviewed by Alex Christensen.
3192
3193         Covered by webrtc tests in LayoutTests and in web-platform-tests.
3194         Making mock peer connection factory keep a ref of the real libwebrtc peer connection factory.
3195         That way, it can create real libwebrtc backends whenever requested by tests.
3196
3197         Moving LibWebRTCUtils.h routines as static LibWebRTCProvider methods.
3198         In the future, we should make them no longer static.
3199
3200         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3201         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
3202         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
3203         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3204         * WebCore.xcodeproj/project.pbxproj:
3205         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp.
3206         (WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread):
3207         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
3208         (WebCore::LibWebRTCProvider::factory):
3209         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
3210         (WebCore::createActualPeerConnection):
3211         (WebCore::LibWebRTCProvider::createPeerConnection):
3212         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3213         * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Removed.
3214         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3215         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3216         * testing/Internals.cpp:
3217         * testing/MockLibWebRTCPeerConnection.cpp:
3218         (WebCore::useMockRTCPeerConnectionFactory):
3219         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
3220         (WebCore::releaseInNetworkThread):
3221         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
3222         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
3223         (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
3224         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
3225
3226 2017-02-13  Anders Carlsson  <andersca@apple.com>
3227
3228         Simplify DragController::startDrag
3229         https://bugs.webkit.org/show_bug.cgi?id=168240
3230
3231         Reviewed by Tim Horton.
3232
3233         Use early returns instead of assigning to a variable that's returned at the end of the function.
3234
3235         * page/DragController.cpp:
3236         (WebCore::DragController::startDrag):
3237
3238 2017-02-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
3239
3240         The current frame of an image should not deleted if another frame is asynchronously being decoded
3241         https://bugs.webkit.org/show_bug.cgi?id=167618
3242
3243         Reviewed by Simon Fraser.
3244
3245         Test: fast/images/animated-image-draw-while-decode.html
3246
3247         If the memory cache asks the BitmapImage to destroy all its frames while
3248         the next frame is being decoded, a thread contention may happen. This can
3249         happen when BitmapImage::draw() is called and the next frame is not ready
3250         yet for drawing, so the current frame has to be drawn. This will invoke
3251         a frame decoding in the same image from the drawing committing thread.
3252
3253         We can avoid that by destroying all the frames except the current frame if
3254         the image is asynchronously decoding its frames. This should not add extra
3255         memory overhead because building the image frame cache and then destroying
3256         it, when needed, is an on-going process. The frames will be allocated and
3257         decoded all the time and all of them can be destroyed except the current one.
3258         
3259         * platform/graphics/BitmapImage.cpp:
3260         (WebCore::BitmapImage::destroyDecodedData):
3261         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
3262         The logic of destroying the ImageFrames was split among BitmapImage, ImageSource
3263         and ImageFrameCache. Move all the logic to BitmapImage and have ImageFrameCache
3264         be responsible only for destroying a range of ImageFrames.
3265
3266         (WebCore::BitmapImage::draw): add an ASSERT_IMPLIES to ensure the current frame
3267         is ready to be rendered if the next frame is being decoded.
3268         
3269         * platform/graphics/BitmapImage.h: Move a const from ImageFrameCache.h to BitmapImage.h.
3270
3271         * platform/graphics/ImageFrameCache.cpp:
3272         (WebCore::ImageFrameCache::destroyDecodedData):
3273         (WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Deleted.
3274         * platform/graphics/ImageFrameCache.h:
3275         (WebCore::ImageFrameCache::destroyAllDecodedData):
3276         (WebCore::ImageFrameCache::destroyAllDecodedDataExcludeFrame):
3277         (WebCore::ImageFrameCache::destroyDecodedDataBeforeFrame):
3278         Make ImageFrameCache be responsible for destroying a range of ImageFrames.
3279         This range might include all the frames, all the frames but up to a specific
3280         frame, or all the frames but exclude one frame in the middle.
3281         
3282         * platform/graphics/ImageSource.cpp:
3283         (WebCore::ImageSource::clear): No need to call clearFrameBufferCache() from clear().
3284         The decision to call clearFrameBufferCache() or clear() is moved to
3285         BitmapImage::destroyDecodedData().
3286          
3287         (WebCore::ImageSource::destroyDecodedData): Deleted.
3288         (WebCore::ImageSource::destroyDecodedDataIfNecessary): Deleted.
3289         These functions are replaced by another set of functions in ImageSource.h.
3290         
3291         * platform/graphics/ImageSource.h:
3292         (WebCore::ImageSource::destroyAllDecodedData):
3293         (WebCore::ImageSource::destroyAllDecodedDataExcludeFrame):
3294         (WebCore::ImageSource::destroyDecodedDataBeforeFrame):
3295         (WebCore::ImageSource::hasDecodingQueue):
3296         These are new wrappers which call the corresponding ImageFrameCache functions.
3297
3298 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
3299
3300         [Cocoa] Stop soft-linking CTRunGetBaseAdvancesAndOrigins()
3301         https://bugs.webkit.org/show_bug.cgi?id=168256
3302
3303         Reviewed by Alex Christensen.
3304
3305         Use of this function is already behind a platform guard.
3306
3307         No new tests because there is no behavior change.
3308
3309         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3310         (SOFT_LINK): Deleted.
3311
3312 2017-02-13  Jiewen Tan  <jiewen_tan@apple.com>
3313
3314         [WebCrypto] WebInspector should indicate webkitSubtle is deprecated
3315         https://bugs.webkit.org/show_bug.cgi?id=165913
3316         <rdar://problem/30477222>
3317
3318         Reviewed by Joseph Pecoraro.
3319
3320         Covered by existing tests.
3321
3322         * page/Crypto.cpp:
3323         (WebCore::Crypto::webkitSubtle):
3324
3325 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
3326
3327         Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
3328         https://bugs.webkit.org/show_bug.cgi?id=168261
3329         rdar://problem/30481079
3330
3331         Reviewed by Tim Horton.
3332
3333         Add CABackingStoreCollectBlocking() to QuartzCoreSPI.h, and fix files in WebCore
3334         that do a framework include.
3335
3336         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
3337         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
3338         * platform/spi/cocoa/QuartzCoreSPI.h:
3339         * platform/spi/mac/NSViewSPI.h:
3340
3341 2017-02-13  Youenn Fablet  <youenn@apple.com>
3342
3343         ASSERTION FAILED: !m_bodyLoader
3344         https://bugs.webkit.org/show_bug.cgi?id=166986
3345
3346         Reviewed by Sam Weinig.
3347
3348         Refactoring to make the unset/set pending activity part of body loader.
3349         This allows ensuring to not forget to do that by simply deleting the body loader.
3350
3351         * Modules/fetch/FetchResponse.cpp:
3352         (WebCore::FetchResponse::fetch):
3353         (WebCore::FetchResponse::BodyLoader::didSucceed):
3354         (WebCore::FetchResponse::BodyLoader::didFail):
3355         (WebCore::FetchResponse::BodyLoader::BodyLoader):
3356         (WebCore::FetchResponse::BodyLoader::~BodyLoader):
3357         (WebCore::FetchResponse::stop):
3358         * Modules/fetch/FetchResponse.h:
3359
3360 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
3361
3362         Remove unused WebCoreThreadSafe.h
3363         https://bugs.webkit.org/show_bug.cgi?id=168236
3364
3365         Reviewed by Dan Bernstein.
3366
3367         * platform/ios/wak/WebCoreThreadSafe.h: Removed.
3368         * WebCore.xcodeproj/project.pbxproj: Removed WebCoreThreadSafe.h
3369         * platform/ios/wak/WebCoreThread.mm: Removed WebCoreThreadSafe.h and included WAKWindow.h directly
3370
3371 2017-02-13  Anders Carlsson  <andersca@apple.com>
3372
3373         Fix iOS build.
3374
3375         * platform/ios/DragImageIOS.mm:
3376         (WebCore::deleteDragImage):
3377
3378 2017-02-13  Sam Weinig  <sam@webkit.org>
3379
3380         Rename MediaQueryExp.h/cpp to MediaQueryExpression.h/cpp
3381         https://bugs.webkit.org/show_bug.cgi?id=168249
3382
3383         Reviewed by Dean Jackson.
3384
3385         Fix a FIXME and rename MediaQueryExp.h/cpp to match the class it contains, MediaQueryExpression.
3386
3387         * CMakeLists.txt:
3388         * WebCore.xcodeproj/project.pbxproj:
3389         * css/CSSAllInOne.cpp:
3390         * css/MediaQuery.h:
3391         * css/MediaQueryEvaluator.h:
3392         * css/MediaQueryExp.cpp: Removed.
3393         * css/MediaQueryExp.h: Removed.
3394         * css/MediaQueryExpression.cpp: Copied from Source/WebCore/css/MediaQueryExp.cpp.
3395         * css/MediaQueryExpression.h: Copied from Source/WebCore/css/MediaQueryExp.h.
3396         * css/parser/MediaQueryParser.h:
3397
3398 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
3399
3400         WAKResponder should be exported from WebCore
3401         https://bugs.webkit.org/show_bug.cgi?id=168245
3402
3403         Reviewed by Dan Bernstein.
3404
3405         * platform/ios/wak/WAKResponder.h:
3406
3407 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
3408
3409         Log to the History Channel in a few more places
3410         https://bugs.webkit.org/show_bug.cgi?id=168252
3411
3412         Reviewed by Brady Eidson.
3413
3414         *** Aliens ***
3415
3416         * loader/HistoryController.cpp:
3417         (WebCore::HistoryController::restoreScrollPositionAndViewState):
3418         (WebCore::HistoryController::updateForReload):
3419         * loader/NavigationScheduler.cpp:
3420         (WebCore::NavigationScheduler::scheduleHistoryNavigation):
3421         (WebCore::NavigationScheduler::timerFired):
3422         (WebCore::NavigationScheduler::cancel):
3423         * page/History.cpp:
3424         (WebCore::History::go):
3425
3426 2017-02-13  Alex Christensen  <achristensen@webkit.org>
3427
3428         Percent should be allowed in non-special URL hosts
3429         https://bugs.webkit.org/show_bug.cgi?id=168255
3430
3431         Reviewed by Tim Horton.
3432
3433         In the last few weeks, the spec has consolidated its sets of code points.
3434         Now forbidden host code points replace the old invalid host code points with
3435         the modification that percents are allowed in non-special hosts because we
3436         percent-encode non-ascii code points in non-special hosts.
3437         See https://url.spec.whatwg.org/#concept-opaque-host-parser
3438
3439         Covered by newly passing web platform tests.
3440
3441         * platform/URLParser.cpp:
3442         (WebCore::isC0Control):
3443         (WebCore::isInUserInfoEncodeSet):
3444         (WebCore::URLParser::hasForbiddenHostCodePoint):
3445         (WebCore::URLParser::parseHostAndPort):
3446         (WebCore::isInvalidDomainCharacter): Deleted.
3447         (WebCore::URLParser::hasInvalidDomainCharacter): Deleted.
3448         * platform/URLParser.h:
3449
3450 2017-02-13  Anders Carlsson  <andersca@apple.com>
3451
3452         Fix Windows build.
3453
3454         * platform/win/PasteboardWin.cpp:
3455         (WebCore::Pasteboard::setDragImage):
3456
3457 2017-02-13  Alex Christensen  <achristensen@webkit.org>
3458
3459         Fix Yosemite build after r211765
3460         https://bugs.webkit.org/show_bug.cgi?id=168246
3461         <rdar://problem/30494174>
3462
3463         Reviewed by Brady Eidson.
3464
3465         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3466         (SOFT_LINK):
3467
3468 2017-02-13  Anders Carlsson  <andersca@apple.com>
3469
3470         Add a DragImage class that wraps a DragImageRef
3471         https://bugs.webkit.org/show_bug.cgi?id=168131
3472
3473         Reviewed by Beth Dakin.
3474
3475         This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
3476         various drag code paths possible. No functionality change.
3477
3478         * dom/DataTransfer.cpp:
3479         (WebCore::DataTransfer::updateDragImage):
3480         * page/DragController.cpp:
3481         (WebCore::DragController::startDrag):
3482         (WebCore::DragController::doImageDrag):
3483         (WebCore::DragController::doSystemDrag):
3484         * page/DragController.h:
3485         * platform/DragImage.cpp:
3486         (WebCore::DragImage::DragImage):
3487         (WebCore::DragImage::operator=):
3488         (WebCore::DragImage::~DragImage):
3489         * platform/DragImage.h:
3490         * platform/Pasteboard.h:
3491         * platform/StaticPasteboard.h:
3492         * platform/mac/PasteboardMac.mm:
3493         (WebCore::Pasteboard::setDragImage):
3494
3495 2017-02-13  Chris Dumez  <cdumez@apple.com>
3496
3497         Regression(r211455): ASSERTION FAILED: frameView || pageCacheState() == InPageCache in com.apple.WebCore: WebCore::Document::destroyRenderTree
3498         https://bugs.webkit.org/show_bug.cgi?id=168237
3499         <rdar://problem/30494165>
3500
3501         Reviewed by Gavin Barraclough.
3502
3503         Drop bad assertion under document::destroyRenderTree() that was introduced in r211455.
3504         The assertion seemed like a good idea but the issue is that CachedFrame::destroy()
3505         reset's the document's pageCacheState before calling Document::prepareForDestruction().
3506
3507         No new tests, this fixes assertion hits on our bots.
3508
3509         * dom/Document.cpp:
3510         (WebCore::Document::destroyRenderTree):
3511
3512 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
3513
3514         Update custom line breaking iterators to the latest version of Unicode
3515         https://bugs.webkit.org/show_bug.cgi?id=168182
3516
3517         Reviewed by Zalan Bujtas.
3518
3519         Clean up our breaking code to be more descriptive about the difference between
3520         line-break: auto vs line-break: loose | normal | strict. The only difference is
3521         that we have some hardcoded tables to speed up character iteration for
3522         line-break: auto.
3523
3524         Tests: TestWebKitAPI WebKit2.LineBreaking
3525
3526         * rendering/BreakLines.h:
3527         (WebCore::nextBreakablePosition):
3528         (WebCore::nextBreakablePositionIgnoringNBSP):
3529         (WebCore::nextBreakablePositionWithoutShortcut):
3530         (WebCore::nextBreakablePositionIgnoringNBSPWithoutShortcut):
3531         (WebCore::isBreakable):
3532         (WebCore::nextBreakablePositionNonLoosely): Deleted.
3533         (WebCore::nextBreakablePositionLoosely): Deleted.
3534         (WebCore::nextBreakablePositionLoose): Deleted.
3535         (WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
3536         * rendering/RenderText.cpp:
3537         (WebCore::RenderText::computePreferredLogicalWidths):
3538         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3539         (WebCore::SimpleLineLayout::nextBreakablePositionInSegment):
3540         * rendering/line/BreakingContext.h:
3541         (WebCore::BreakingContext::handleText):
3542         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
3543
3544 2017-02-13  Youenn Fablet  <youenn@apple.com>
3545
3546         Remove @getUserMedia identifier
3547         https://bugs.webkit.org/show_bug.cgi?id=168216
3548
3549         Reviewed by Sam Weinig.
3550
3551         No change of behavior.
3552
3553         * Modules/mediastream/MediaDevices.idl:
3554         * bindings/js/WebCoreBuiltinNames.h:
3555
3556 2017-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3557
3558         [GTK] Non-accelerated drawing is broken with HiDPI
3559         https://bugs.webkit.org/show_bug.cgi?id=168128
3560
3561         Reviewed by Michael Catanzaro.
3562
3563         When device scale factor changes, the page notifies the page overlay controller about it. Then overlay root
3564         layers are created to be notified about the device scale factor. That causes us to enter in accelerated
3565         compositing mode, because the graphics layer factory is called. But the render layer compositor doesn't really
3566         enter in accelerated mode, because there aren't page overlays, the accelerated mode is not forced and the website
3567         doesn't require acceleration either. This leaves our drawing area in an inconsistent state, it thinks it's in AC
3568         mode because it has a layer tree host, but without a root layer attached, so nothing is rendered. The page
3569         overlay controller doesn't need to create the layers when device scale factor changes, when an overlay is
3570         installed, layers will be created with the current device scale factor anyway.
3571
3572         * page/PageOverlayController.cpp:
3573         (WebCore::PageOverlayController::didChangeDeviceScaleFactor): Return early if not initialized yet.
3574
3575 2017-02-13  Csaba Osztrogonác  <ossy@webkit.org>
3576
3577         REGRESSION(r210845) Build broken with ENABLE_MHTML disabled
3578         https://bugs.webkit.org/show_bug.cgi?id=167771
3579
3580         Reviewed by Daniel Bates.
3581
3582         * loader/DocumentLoader.cpp:
3583         (WebCore::DocumentLoader::commitData):
3584
3585 2017-02-12  Dan Bernstein  <mitz@apple.com>
3586
3587         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
3588
3589         * platform/spi/mac/TUCallSPI.h: Reverted to r212210.
3590
3591 2017-02-12  Dan Bernstein  <mitz@apple.com>
3592
3593         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
3594
3595         * platform/spi/mac/TUCallSPI.h:
3596
3597 2017-02-12  Dan Bernstein  <mitz@apple.com>
3598
3599         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
3600
3601         * platform/spi/mac/TUCallSPI.h:
3602
3603 2017-02-12  Dan Bernstein  <mitz@apple.com>
3604
3605         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
3606
3607         * platform/spi/mac/NSMenuSPI.h: Replaced declaration of deprecated method with its current
3608           equivalent.
3609
3610 2017-02-12  Dan Bernstein  <mitz@apple.com>
3611
3612         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
3613
3614         * platform/spi/mac/NSImmediateActionGestureRecognizerSPI.h:
3615
3616 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
3617
3618         parserRemoveChild should unload subframes
3619         https://bugs.webkit.org/show_bug.cgi?id=168151
3620
3621         Reviewed by Darin Adler.
3622
3623         Fix the bug that the adoption agency algorithm does not unload subframes as it disconnects nodes.
3624
3625         Also moved calls to nodeWillBeRemoved inside NoEventDispatchAssertion to expand on r211965.
3626
3627         Tests: fast/parser/adoption-agency-clear-focus-range.html
3628                fast/parser/adoption-agency-unload-iframe-1.html
3629                fast/parser/adoption-agency-unload-iframe-2.html
3630
3631         * dom/ContainerNode.cpp:
3632         (WebCore::ContainerNode::takeAllChildrenFrom): Rewritten using idioms used in removeChildren and parserAppendChild.
3633
3634         Disconnect all subframes first since this can synchronously dispatch an unload event. Then update DOM ranges,
3635         the focused element, and other states in the document.
3636
3637         Second, use the regular removeBetween, notifyChildNodeRemoved, childrenChanged sequence of calls to disconnect nodes
3638         instead of a single call to removeDetachedChildren to properly disconnect child nodes since those nodes may have
3639         already come live due to execution of synchronous scripts prior to the adoption agency algorithm has run, or in
3640         response to the unload event we just dispatched.
3641
3642         Third, append these nodes using parserAppendChild to avoid dispatching mutation events.
3643
3644         (WebCore::willRemoveChild): Removed the call to nodeWillBeRemoved. It's now called within NoEventDispatchAssertion
3645         in each call site of willRemoveChild and willRemoveChildren.
3646         (WebCore::willRemoveChildren): Ditto.
3647         (WebCore::ContainerNode::removeChild): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
3648         (WebCore::ContainerNode::replaceAllChildren): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
3649         (WebCore::ContainerNode::parserRemoveChild): Disconnect subframes and update document's states.
3650
3651         * html/parser/HTMLConstructionSite.cpp:
3652         (WebCore::executeTakeAllChildrenAndReparentTask): Add a release assert that new parent does not already have a parent. 
3653
3654 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
3655
3656         REGRESSION (r179497): Crash inside setAttributeNode
3657         https://bugs.webkit.org/show_bug.cgi?id=168161
3658         <rdar://problem/30451581>
3659
3660         Reviewed by Andreas Kling.
3661
3662         The bug was caused by setAttributeNode calling setAttributeInternal with the same element data as the one used
3663         to call removeAttributeInternal despite of the fact removeAttributeInternal could have invoked arbitrary scripts
3664         and mutated element's m_elementData.
3665
3666         Fixed the bug by calling with setAttributeInternal with the result of new invocation of ensureUniqueElementData().
3667
3668         Test: fast/dom/Attr/make-unique-element-data-while-replacing-attr.html
3669
3670         * dom/Element.cpp:
3671         (WebCore::Element::setAttributeNode):
3672
3673 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
3674
3675         Rebaseline bindings tests after r212207.
3676
3677         * bindings/scripts/test/JS/JSTestObj.cpp:
3678         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3679
3680 2017-02-12  Dan Bernstein  <mitz@apple.com>
3681
3682         [Cocoa] Some -respondsToSelector: checks are unnecessary
3683         https://bugs.webkit.org/show_bug.cgi?id=168183
3684
3685         Reviewed by Tim Horton.
3686
3687         * English.lproj/Localizable.strings: Removed a string that’s no longer needed after the
3688           change to WebKit2/Platform/mac/MenuUtilities.mm.
3689
3690         * editing/mac/DictionaryLookup.mm:
3691         (WebCore::showPopupOrCreateAnimationController): Removed check whether
3692           LULookupDefinitionModule responds to +showDefinitionForTerm:relativeToRect:ofView:options:.
3693
3694         * platform/cocoa/NetworkExtensionContentFilter.mm:
3695         (WebCore::NetworkExtensionContentFilter::initialize): Changed to use
3696           -[NEFilterSource setSourceAppIdentifier:], without checking, instead of
3697           -setSourceAppBundleID:, which does not exist.
3698
3699         * platform/cocoa/ScrollController.mm:
3700         (systemUptime): Deleted.
3701         (WebCore::ScrollController::snapRubberBand): Use -[NSProcessInfo systemUptime] directly.
3702
3703         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3704         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove unnecessary check.
3705
3706         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3707         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Ditto.
3708         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
3709         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck): Replaced
3710           -respondsToSelector: check with -isKindOfClass: check corresponding to the above cast.
3711         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): Removed unnecessary
3712           check.
3713
3714         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
3715         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): Removed unnecessary checks.
3716
3717         * platform/graphics/mac/WebGLLayer.mm:
3718         (-[WebGLLayer initWithGraphicsContext3D:]): Ditto.
3719
3720         * platform/mac/PlatformEventFactoryMac.mm:
3721         (WebCore::typeForEvent): Removed check whether NSMenu responds to +menuTypeForEvent: and
3722           all code to handle that case that it doesn’t.
3723
3724         * platform/mac/WebVideoFullscreenController.mm:
3725         (-[WebVideoFullscreenController applicationDidResignActive:]): Removed check whether
3726           NSWindow responds to -isOnActiveSpace.
3727         (-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Removed check whether
3728           NSApplication responds to -setPresentationOptions:
3729
3730         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
3731         (-[WebVideoFullscreenInterfaceMacObjC updateIsPlaying:newPlaybackRate:]): Removed
3732           unnecessary -respondsToSelector: check.
3733         (-[WebVideoFullscreenInterfaceMacObjC setVideoDimensions:]): Ditto.
3734         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): Ditto.
3735
3736         * platform/spi/cf/CFNetworkSPI.h: Moved declarations of
3737           -[NSURLCache _initWithMemoryCapacity:diskCapacity:relativePath:] and
3738           -[NSURLCache _CFURLCache] to the !USE(APPLE_INTERNAL_SDK) section.
3739
3740         * platform/spi/cocoa/NEFilterSourceSPI.h: Added declaration of NEFilterSource’
3741           sourceAppIdentifier property to the !USE(APPLE_INTERNAL_SDK) section and deleted
3742           unconditional declaration of sourceAppBundleID property, which doesn’t exist.
3743
3744         * platform/spi/cocoa/QuartzCoreSPI.h: Removed redundant declarations.
3745
3746         * platform/spi/ios/DataDetectorsUISPI.h: Moved declarations of DDDetectionController methods
3747           from WebKit2/UIProcess/ios/{WKActionSheetAssistant,WKContentViewInteraction}.mm to here.
3748           Removed an unused declaration.
3749
3750         * platform/spi/mac/LookupSPI.h: Moved redundant declarations into the
3751           !USE(APPLE_INTERNAL_SDK) section.
3752
3753         * platform/spi/mac/NSMenuSPI.h: Changed to import NSMenu_Private.h when using the
3754           Apple internal SDK. Cleaned up the declarations for the other case.
3755
3756         * platform/spi/mac/TUCallSPI.h: Changed to import TUCall_Strings.h when use the Apple
3757           internal SDK.
3758
3759 2017-02-11  Sam Weinig  <sam@webkit.org>
3760
3761         Remove the remaining functions out of JSDOMBinding
3762         https://bugs.webkit.org/show_bug.cgi?id=168179
3763
3764         Reviewed by Darin Adler.
3765
3766         Move utility functions into more appropriate locations.
3767         - Move hasIteratorMethod to runtime/IteratorOperations.h
3768         - Move nonCachingStaticFunctionGetter to runtime/Lookup.h
3769         - Move addImpureProperty to CommonVM
3770
3771         Remove toJS overload that took a Vector<T>. Replace it's usage
3772         with toJS<IDLSequence<T>> usage. To make this work, added two
3773         new types, IDLIDBKeyData and IDLIDBValue.
3774
3775         * Modules/indexeddb/IDBCursor.cpp:
3776         (WebCore::IDBCursor::setGetResult):
3777         * Modules/indexeddb/IDBRequest.cpp:
3778         (WebCore::IDBRequest::setResult):
3779         (WebCore::IDBRequest::setResultToStructuredClone):
3780         Adopt JSDOMConvert infrastructure for conversions using new types.
3781
3782         * bindings/IDLTypes.h:
3783         * bindings/js/JSDOMConvertIndexedDB.h:
3784         (WebCore::JSConverter<IDLIDBKeyData>::convert):
3785         (WebCore::JSConverter<IDLIDBValue>::convert):
3786         Add new types for IDBKeyData and IDBValue.
3787
3788         * bindings/js/CommonVM.cpp:
3789         (WebCore::addImpureProperty):
3790         * bindings/js/CommonVM.h:
3791         Move addImpureProperty here from JSDOMBinding.
3792
3793         * bindings/js/IDBBindingUtilities.cpp:
3794         (WebCore::idbKeyDataToScriptValue): Deleted.
3795         * bindings/js/IDBBindingUtilities.h:
3796         Remove unused idbKeyDataToScriptValue, and group like functions
3797         together.
3798
3799         * bindings/js/JSDOMBinding.cpp: Removed.
3800         * bindings/js/JSDOMBinding.h:
3801         (WebCore::nonCachingStaticFunctionGetter): Deleted.
3802         (WebCore::toJS): Deleted.
3803         Move/remove functions.
3804
3805         * bindings/js/JSDOMConvertUnion.h:
3806         Update for move of hasIteratorMethod to runtime/IteratorOperations.h
3807
3808         * bindings/js/JSDOMWindowCustom.cpp:
3809         * bindings/js/JSHTMLDocumentCustom.cpp:
3810         * bindings/js/JSLocationCustom.cpp:
3811         Update for move of nonCachingStaticFunctionGetter to runtime/Lookup.h
3812
3813         * bindings/js/JSSubtleCryptoCustom.cpp:
3814         Remove unneeded include of runtime/IteratorOperations.h
3815
3816         * bindings/scripts/CodeGeneratorJS.pm:
3817         (GenerateOverloadedFunctionOrConstructor):
3818         Include runtime/IteratorOperations when needing to distinguish a sequence.
3819
3820         * html/HTMLDocument.cpp:
3821         Replace include of JSDOMBinding.h with CommonVM.h for addImpureProperty.
3822
3823 2017-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3824
3825         [GTK] Handle caps lock indicator in event modifiers
3826         https://bugs.webkit.org/show_bug.cgi?id=168186
3827
3828         Reviewed by Michael Catanzaro.
3829
3830         Add helper function to check if caps lock is present in the given modifiers. We need this because in GDK
3831         GDK_LOCK_MASK might be either CapsLock or ShiftLock in X11. We use this new method in all platform event
3832         implementations to add the appropriate modifiers.
3833
3834         Fixes: fast/events/special-key-events-in-input-text.html
3835
3836         * platform/PlatformKeyboardEvent.h:
3837         * platform/gtk/PlatformKeyboardEventGtk.cpp:
3838         (WebCore::modifiersForGdkKeyEvent):
3839         (WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
3840         * platform/gtk/PlatformMouseEventGtk.cpp:
3841         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3842         * platform/gtk/PlatformWheelEventGtk.cpp:
3843         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3844
3845 2017-02-11  Sam Weinig  <sam@webkit.org>
3846
3847         Remove custom bindings for XSLTProcessor.idl
3848         https://bugs.webkit.org/show_bug.cgi?id=168174
3849
3850         Reviewed by Andreas Kling.
3851
3852         * CMakeLists.txt:
3853         * WebCore.xcodeproj/project.pbxproj:
3854         * bindings/js/JSBindingsAllInOne.cpp:
3855         * bindings/js/JSXSLTProcessorCustom.cpp: Removed.
3856         Remove file.
3857  
3858         * bindings/js/JSDOMBinding.cpp:
3859         (WebCore::jsStringOrUndefined): Deleted.
3860         * bindings/js/JSDOMBinding.h:
3861         Remove now unused jsStringOrUndefined.
3862
3863         * xml/XSLTProcessor.cpp:
3864         (WebCore::XSLTProcessor::setParameter):
3865         (WebCore::XSLTProcessor::getParameter):
3866         (WebCore::XSLTProcessor::removeParameter):
3867         * xml/XSLTProcessor.idl:
3868         Replace custom bindings bindings with early returns. One subtle difference
3869         between the custom bindings and this, is that getParameter will return 
3870         jsNull() rather than jsUndefined() for null String returns. This matches
3871         all other bindings.
3872
3873 2017-02-11  Olivier Blin  <olivier.blin@softathome.com>
3874
3875         [GStreamer][MSE][EME] Fix decryptor assignment
3876         https://bugs.webkit.org/show_bug.cgi?id=168122
3877
3878         Reviewed by Michael Catanzaro.
3879
3880         The new decryptor is a floating reference so we should not use the
3881         adopt GRefPtr constructor, but use the regular assignment operator
3882         that will sink the object (clear the floating flag).
3883
3884         This fixes assertions in debug build.
3885
3886         See previous pipeline fix in r210851 and WPE commit
3887         06020b18831e1c0eead34e2c1a5a4b7d026c227d.
3888
3889         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3890         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
3891         Do not use adoptGRef(), it prevented the object from being sunk.
3892
3893 2017-02-11  Simon Fraser  <simon.fraser@apple.com>
3894
3895         Avoid a redundant scroll to 0,0 when navigating back to a url with no fragment
3896         https://bugs.webkit.org/show_bug.cgi?id=168177
3897
3898         Reviewed by Sam Weinig.
3899
3900         FrameView::scrollToFragment() is called from FrameLoader::scrollToFragmentWithParentBoundary()
3901         when navigating within the page. If the URL had no fragment identifier, this code would
3902         call into FrameView::scrollToAnchor() with an empty name, where maintainScrollPositionAtAnchor()
3903         used the document as the anchor, thus scrolling to 0,0. Later, history().restoreScrollPositionAndViewState()
3904         the restores the scroll position from history.
3905         
3906         This scroll to 0,0 happened to be not visible to the page because of scroll event
3907         coalescing, but it makes implementation of history.scrollRestoration harder, so avoid it
3908         by just returning early from FrameView::scrollToFragment() if there is no fragment,
3909         making sure to clear the document's CSSTarget.
3910
3911         * dom/Document.cpp:
3912         (WebCore::Document::setCSSTarget):
3913         * page/FrameView.cpp:
3914         (WebCore::FrameView::scrollToFragment):
3915         (WebCore::FrameView::scrollToAnchor):
3916
3917 2017-02-11  Chris Dumez  <cdumez@apple.com>
3918
3919         Implement URL's toJSON()
3920         https://bugs.webkit.org/show_bug.cgi?id=167979
3921
3922         Reviewed by Sam Weinig.
3923
3924         Implement URL's toJSON() as per:
3925         - https://url.spec.whatwg.org/#dom-url-tojson
3926
3927         This is already supported by Firefox.
3928
3929         Also, drop URLUtils.idl as it is no longer in the specification.
3930         Merge its content to DOMURL.idl as per the URL specification.
3931
3932         Finally, mark href attribute as stringifier and drop the toString()
3933         operation to match the specification. This fixes a bug where our
3934         toString property was not enumerable but should have been.
3935
3936         Tests: fast/url/url-tojson.html
3937                imported/w3c/web-platform-tests/url/url-tojson.html
3938
3939         * CMakeLists.txt:
3940         * DerivedSources.make:
3941         * WebCore.xcodeproj/project.pbxproj:
3942         * html/DOMURL.idl:
3943         * html/URLUtils.h:
3944         (WebCore::URLUtils<T>::toJSON):
3945         * html/URLUtils.idl: Removed.
3946
3947 2017-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3948
3949         [GTK][EFL] Implement MIMETypeRegistry::getPreferredExtensionForMIMEType
3950         https://bugs.webkit.org/show_bug.cgi?id=168163
3951
3952         Reviewed by Michael Catanzaro.
3953
3954         It's missing causing several HTML anchor download tests to fail because the suggested filename missed the
3955         extension. This patch moves MIMETypeRegistry::appendFileExtensionIfNecessary() from the cocoa specific file to the
3956         common file because it's not actually platform specific. MIMETypeRegistry::getPreferredExtensionForMIMEType() is
3957         what platforms should implement.
3958
3959         Fixes: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
3960                fast/dom/HTMLAnchorElement/anchor-download.html
3961                fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
3962                fast/dom/HTMLAnchorElement/anchor-nodownload-set.html
3963
3964         * platform/MIMETypeRegistry.cpp:
3965         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
3966         * platform/cocoa/MIMETypeRegistryCocoa.mm:
3967         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): Deleted.
3968         * platform/efl/MIMETypeRegistryEfl.cpp:
3969         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
3970         * platform/gtk/MIMETypeRegistryGtk.cpp:
3971         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
3972
3973 2017-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3974
3975         Unreviewed. Update imageTitle translatable string.
3976
3977         To match mac port. Fixes fast/images/imageDocument-title.html.
3978
3979         * platform/gtk/LocalizedStringsGtk.cpp:
3980         (WebCore::imageTitle):
3981
3982 2017-02-10  John Wilander  <wilander@apple.com>
3983
3984         Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
3985         https://bugs.webkit.org/show_bug.cgi?id=167474
3986         <rdar://problem/24681808>
3987         <rdar://problem/24703286>
3988         <rdar://problem/30290270>
3989
3990         This patch does the following:
3991         1. Gets the right website data store. API::WebsiteDataStore::defaultDataStore()
3992             does not provide the right data store.
3993         2. Introduces timeout for user interaction. A domain needs interaction every 30
3994