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