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