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