2a06d1849ceeea27bb39f0457bda06908c1ad8b0
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2
3         WebRTC: Add support for the iceconnectionstatechange event in MediaEndpointPeerConnection
4         https://bugs.webkit.org/show_bug.cgi?id=162961
5
6         Reviewed by Eric Carlson.
7
8         Implement MediaEndpointPeerConnection's iceTransportStateChanged callback. When called, it
9         updates the ICE transport state of the corresponding transceiver and determines if the
10         RTCPeerConnection's aggregated iceConnectionState needs to be updated.
11
12         Update MediaEndpointMock's emulatePlatformEvent feature to support a new action:
13         "step-ice-transport-states". When initiated, this action replays a predefined set of ICE
14         transport state changes on a set of transceivers which can be observed via the
15         iceTransportStateChanged (mentioned above).
16
17         Test: fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html
18
19         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
20         (WebCore::deriveAggregatedIceConnectionState):
21         (WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
22         * Modules/mediastream/MediaEndpointPeerConnection.h:
23         * platform/mediastream/MediaEndpoint.h:
24         (WebCore::MediaEndpointClient::~MediaEndpointClient):
25         * platform/mock/MockMediaEndpoint.cpp:
26         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
27         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
28         (WebCore::MockMediaEndpoint::stepIceTransportStates):
29         (WebCore::MockMediaEndpoint::iceTransportTimerFired):
30         * platform/mock/MockMediaEndpoint.h:
31
32 2016-10-06  Youenn Fablet  <youenn@apple.com>
33
34         CachedResource client handling methods should take reference
35         https://bugs.webkit.org/show_bug.cgi?id=163014
36
37         Reviewed by Alex Christensen.
38
39         No change of behavior.
40
41         * bindings/js/CachedScriptSourceProvider.h:
42         (WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
43         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
44         * css/CSSCrossfadeValue.cpp:
45         (WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
46         (WebCore::CSSCrossfadeValue::loadSubimages):
47         * css/CSSFilterImageValue.cpp:
48         (WebCore::CSSFilterImageValue::~CSSFilterImageValue):
49         (WebCore::CSSFilterImageValue::loadSubimages):
50         * css/CSSFontFaceSource.cpp:
51         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
52         (WebCore::CSSFontFaceSource::~CSSFontFaceSource):
53         * css/StyleRuleImport.cpp:
54         (WebCore::StyleRuleImport::~StyleRuleImport):
55         (WebCore::StyleRuleImport::requestStyleSheet):
56         * dom/DataTransfer.cpp:
57         (WebCore::DragImageLoader::startLoading):
58         (WebCore::DragImageLoader::stopLoading):
59         * dom/LoadableClassicScript.cpp:
60         (WebCore::LoadableClassicScript::create):
61         (WebCore::LoadableClassicScript::~LoadableClassicScript):
62         * dom/ProcessingInstruction.cpp:
63         (WebCore::ProcessingInstruction::~ProcessingInstruction):
64         (WebCore::ProcessingInstruction::checkStyleSheet):
65         (WebCore::ProcessingInstruction::parseStyleSheet):
66         * html/HTMLLinkElement.cpp:
67         (WebCore::HTMLLinkElement::~HTMLLinkElement):
68         (WebCore::HTMLLinkElement::process):
69         * loader/CrossOriginPreflightChecker.cpp:
70         (WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
71         (WebCore::CrossOriginPreflightChecker::startPreflight):
72         * loader/DocumentLoader.cpp:
73         (WebCore::DocumentLoader::detachFromFrame):
74         (WebCore::DocumentLoader::clearMainResource):
75         (WebCore::DocumentLoader::becomeMainResourceClient):
76         * loader/DocumentThreadableLoader.cpp:
77         (WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
78         (WebCore::DocumentThreadableLoader::clearResource):
79         (WebCore::DocumentThreadableLoader::loadRequest):
80         * loader/ImageLoader.cpp:
81         (WebCore::ImageLoader::~ImageLoader):
82         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
83         (WebCore::ImageLoader::updateFromElement):
84         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
85         * loader/LinkLoader.cpp:
86         (WebCore::LinkLoader::~LinkLoader):
87         (WebCore::LinkLoader::notifyFinished):
88         (WebCore::LinkLoader::loadLink):
89         * loader/LinkPreloadResourceClients.h:
90         (WebCore::LinkPreloadResourceClient::addResource):
91         (WebCore::LinkPreloadResourceClient::clearResource):
92         * loader/MediaResourceLoader.cpp:
93         (WebCore::MediaResource::MediaResource):
94         (WebCore::MediaResource::stop):
95         * loader/TextTrackLoader.cpp:
96         (WebCore::TextTrackLoader::~TextTrackLoader):
97         (WebCore::TextTrackLoader::cancelLoad):
98         (WebCore::TextTrackLoader::load):
99         * loader/cache/CachedCSSStyleSheet.cpp:
100         (WebCore::CachedCSSStyleSheet::didAddClient):
101         * loader/cache/CachedCSSStyleSheet.h:
102         * loader/cache/CachedFont.cpp:
103         (WebCore::CachedFont::didAddClient):
104         * loader/cache/CachedFont.h:
105         * loader/cache/CachedImage.cpp:
106         (WebCore::CachedImage::didAddClient):
107         (WebCore::CachedImage::didRemoveClient):
108         * loader/cache/CachedImage.h:
109         * loader/cache/CachedRawResource.cpp:
110         (WebCore::CachedRawResource::didAddClient):
111         * loader/cache/CachedRawResource.h:
112         * loader/cache/CachedResource.cpp:
113         (WebCore::CachedResource::addClient):
114         (WebCore::CachedResource::didAddClient):
115         (WebCore::CachedResource::addClientToSet):
116         (WebCore::CachedResource::removeClient):
117         (WebCore::CachedResource::switchClientsToRevalidatedResource):
118         (WebCore::CachedResource::Callback::timerFired):
119         * loader/cache/CachedResource.h:
120         (WebCore::CachedResource::hasClient):
121         (WebCore::CachedResource::didRemoveClient):
122         * loader/cache/CachedSVGDocumentReference.cpp:
123         (WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
124         (WebCore::CachedSVGDocumentReference::load):
125         * loader/cache/CachedXSLStyleSheet.cpp:
126         (WebCore::CachedXSLStyleSheet::didAddClient):
127         * loader/cache/CachedXSLStyleSheet.h:
128         * loader/cache/MemoryCache.cpp:
129         (WebCore::MemoryCache::addImageToCache):
130         (WebCore::MemoryCache::removeImageFromCache):
131         * loader/icon/IconLoader.cpp:
132         (WebCore::IconLoader::startLoading):
133         (WebCore::IconLoader::stopLoading):
134         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
135         (WebCore::WebCoreAVCFResourceLoader::startLoading):
136         (WebCore::WebCoreAVCFResourceLoader::stopLoading):
137         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
138         (WebCore::WebCoreAVFResourceLoader::startLoading):
139         (WebCore::WebCoreAVFResourceLoader::stopLoading):
140         * rendering/RenderImageResource.cpp:
141         (WebCore::RenderImageResource::shutdown):
142         (WebCore::RenderImageResource::setCachedImage):
143         * rendering/RenderLayerFilterInfo.cpp:
144         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
145         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
146         * rendering/style/StyleCachedImage.cpp:
147         (WebCore::StyleCachedImage::addClient):
148         (WebCore::StyleCachedImage::removeClient):
149         * svg/SVGFEImageElement.cpp:
150         (WebCore::SVGFEImageElement::clearResourceReferences):
151         (WebCore::SVGFEImageElement::requestImageResource):
152         * svg/SVGFontFaceUriElement.cpp:
153         (WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
154         (WebCore::SVGFontFaceUriElement::loadFont):
155         * svg/SVGUseElement.cpp:
156         (WebCore::SVGUseElement::~SVGUseElement):
157         (WebCore::SVGUseElement::updateExternalDocument):
158         * xml/XSLImportRule.cpp:
159         (WebCore::XSLImportRule::~XSLImportRule):
160         (WebCore::XSLImportRule::setXSLStyleSheet):
161         (WebCore::XSLImportRule::loadSheet):
162         * xml/parser/XMLDocumentParser.cpp:
163         (WebCore::XMLDocumentParser::notifyFinished):
164         * xml/parser/XMLDocumentParserLibxml2.cpp:
165         (WebCore::XMLDocumentParser::~XMLDocumentParser):
166         (WebCore::XMLDocumentParser::endElementNs):
167
168 2016-10-05  Philippe Normand  <pnormand@igalia.com>
169
170         [GStreamer][OWR] GL rendering support
171         https://bugs.webkit.org/show_bug.cgi?id=162972
172
173         Reviewed by Žan Doberšek.
174
175         When GStreamer-GL is enabled the GL context needs to be properly passed
176         to the GStreamer pipeline running within the OpenWebRTC video renderer.
177         This is now supported using a new OpenWebRTC API that allows the
178         renderer to request the context from the application using a callback
179         registered within the renderer.
180
181         The player's GL context/display set-up was refactored to a new
182         method, requestGLContext, which is used as callback for the
183         OpenWebRTC request_context handler.
184
185         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
186         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
187         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
188         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
189         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLContext):
190         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
191         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
192         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
193
194 2016-10-06  Antoine Quint  <graouts@apple.com>
195
196         [Modern Media Controls] Icon service and the IconButton class
197         https://bugs.webkit.org/show_bug.cgi?id=162970
198         <rdar://problem/28631803>
199
200         Reviewed by Dean Jackson.
201
202         We introduce the new IconButton class to display buttons that show an icon
203         in modern media controls. An IconButton uses a CSS mask-image to display the icon
204         such that we may set the actual button color to any value by setting the element's
205         background-color property.
206
207         Icons are obtained through the `iconService` singleton which knows how to load the
208         right icon for the current layout traits and resolution. Icons loaded through the
209         icon service are cached. In a later patch, we will be introducing functionality,
210         through the MediaControlsHost, to load the icon from the WebCore bundle.
211
212         Tests: media/modern-media-controls/icon-button/icon-button-active-state.html
213                media/modern-media-controls/icon-button/icon-button.html
214                media/modern-media-controls/icon-service/icon-service.html
215
216         * Modules/modern-media-controls/controls/button.css:
217         (button):
218         * Modules/modern-media-controls/controls/icon-button.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/button.css.
219         (button.icon):
220         (button.icon:active):
221         * Modules/modern-media-controls/controls/icon-button.js: Added.
222         (IconButton):
223         (IconButton.prototype.get iconName):
224         (IconButton.prototype.set iconName):
225         (IconButton.prototype.handleEvent):
226         (IconButton.prototype.layout):
227         (IconButton.prototype._imageDidLoad):
228         (IconButton.prototype._updateImage):
229         * Modules/modern-media-controls/controls/icon-service.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/layout-item.js.
230         (const.iconService.new.IconService):
231         (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
232         (const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
233         * Modules/modern-media-controls/controls/layout-item.js:
234         * Modules/modern-media-controls/images/iOS/pause@2x.png: Added.
235         * Modules/modern-media-controls/images/iOS/pause@3x.png: Added.
236         * Modules/modern-media-controls/images/iOS/start@2x.png: Added.
237         * Modules/modern-media-controls/images/iOS/start@3x.png: Added.
238         * Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Added.
239         * Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Added.
240         * Modules/modern-media-controls/images/macOS/pause@1x.png: Added.
241         * Modules/modern-media-controls/images/macOS/pause@2x.png: Added.
242         * Modules/modern-media-controls/images/macOS/start@1x.png: Added.
243         * Modules/modern-media-controls/images/macOS/start@2x.png: Added.
244
245 2016-10-06  Miguel Gomez  <magomez@igalia.com>
246
247         [GTK] Fix build with GSTREAMER_GL enabled and ACCELERATED_2D_CANVAS disabled
248         https://bugs.webkit.org/show_bug.cgi?id=163008
249
250         Reviewed by Carlos Garcia Campos.
251
252         Put functions using cairo-gl behind appropriate guards.
253
254         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
255         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
256         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
257
258 2016-10-06  Miguel Gomez  <magomez@igalia.com>
259
260         [GTK] Copying video textures to webgl should not depend on cairo-gl
261         https://bugs.webkit.org/show_bug.cgi?id=162904
262
263         Reviewed by Žan Doberšek.
264
265         Perform the texture copy without using cairo-gl.
266
267         Covered by existent tests.
268
269         * platform/GStreamer.cmake:
270         Add the new VideoTextureCopierGStreamer class to the build.
271         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
272         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
273         Use VideoTextureCopierGStreamer to perform the copy.
274         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
275         Add a VideoTextureCopierGStreamer as a class attribute.
276         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: Added.
277         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
278         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
279         (WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
280         Recalculates the matrix used as the texture coordinates transformation.
281         (WebCore::VideoTextureCopierGStreamer::updateTransformationMatrix):
282         Recalculates the matrices used as the vertices coordinates transformation.
283         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
284         Performs the texture copy by using a shader that applies the rotation needed to follow
285         the video orientation.
286         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Added.
287
288 2016-10-06  Gwang Yoon Hwang  <yoon@igalia.com>
289
290         [GTK] Build fix for X11 and GStreamerGL after r183731
291         https://bugs.webkit.org/show_bug.cgi?id=163000
292
293         Reviewed by Philippe Normand.
294
295         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
296         Include gstgldisplay_egl.h if platform uses EGL.
297
298 2016-10-06  Mario Sanchez Prada  <mario@endlessm.com>
299
300         [GStreamer] Can't play any video with GSTREAMER_GL enabled
301         https://bugs.webkit.org/show_bug.cgi?id=162669
302
303         Reviewed by Philippe Normand.
304
305         Make sure an EGLDisplay type is passed when creating the GstGlDisplay
306         for the EGL code path, instead of a native X11 display type, so
307         that we get a valid GstGlDisplay as a result, not a dummy one.
308
309         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
310         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
311
312 2016-10-06  Youenn Fablet  <youenn@apple.com>
313
314         [Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
315         https://bugs.webkit.org/show_bug.cgi?id=162785
316
317         Reviewed by Alex Christensen.
318
319         Covered by rebased and existing tests.
320
321         Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
322         This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
323
324         Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
325         This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
326         But they are not allowed for same-origin redirected requests.
327
328         * WebCore.xcodeproj/project.pbxproj:
329         * loader/DocumentThreadableLoader.cpp:
330         (WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
331         (WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
332         * loader/SubresourceLoader.cpp:
333         (WebCore::SubresourceLoader::willSendRequestInternal):
334         * loader/cache/CachedResourceLoader.cpp:
335         (WebCore::CachedResourceLoader::requestImage):
336         (WebCore::CachedResourceLoader::checkInsecureContent):
337         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
338         (WebCore::isSameOriginDataURL):
339         (WebCore::CachedResourceLoader::canRequest):
340         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
341         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
342         (WebCore::CachedResourceLoader::requestResource):
343         * loader/cache/CachedResourceLoader.h:
344
345 2016-10-06  Youenn Fablet  <youenn@apple.com>
346
347         [Fetch API] Use ReadableStream pull to transfer binary data to stream when application needs it
348         https://bugs.webkit.org/show_bug.cgi?id=162892
349
350         Reviewed by Alex Christensen.
351
352         Covered by existing tests.
353
354         Before this patch, FetchResponse was never resolving the start promise.
355         This way, it could enqueue data, error or close the stream whenever desired.
356
357         With this patch, FetchResponse will feed the stream when being asked to.
358         This allows keeping the data in WebCore until the application needs it.
359         This is only implemented for network data.
360         For other data owned by response (blob, text...), data will be enqueued like previously as fast as possible.
361
362         Note that FetchResponse can enqueue/error/close the stream at any time since JSFetchResponse has a reference to the stream.
363         And the stream has a reference to the controller.
364
365         In addition to transfer binary chunks to ReadableStream only when needed, WebCore is now aware of the data
366         stored in the response, which may allow applying backpressure to the network source in the future.
367
368         * Modules/fetch/FetchResponse.cpp:
369         (WebCore::FetchResponse::BodyLoader::didSucceed):
370         (WebCore::FetchResponse::BodyLoader::didReceiveData): Enqueuing only if stream is pulling.
371         Otherwise, storing in FetchBodyConsumer. If stream is pulling, we enqueue both buffered data and received chunk.
372         (WebCore::FetchResponse::consumeBodyAsStream): Resolving pull promise if we enqueued some buffered data.
373         (WebCore::FetchResponse::closeStream):
374         (WebCore::FetchResponse::feedStream): If we have some buffered data, we enqueue it. If there is no loader, the stream can be closed.
375         * Modules/fetch/FetchResponse.h:
376         * Modules/fetch/FetchResponseSource.cpp:
377         (WebCore::FetchResponseSource::doPull):
378         (WebCore::FetchResponseSource::close):
379         (WebCore::FetchResponseSource::error):
380         * Modules/fetch/FetchResponseSource.h:
381         * Modules/streams/ReadableStreamSource.h:
382         (WebCore::ReadableStreamSource::isPulling): Renamed from isStarting.
383         (WebCore::ReadableStreamSource::isStarting): Deleted.
384
385 2016-10-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
386
387         WebRTC: Add support for the icecandidate event in MediaEndpointPeerConnection
388         https://bugs.webkit.org/show_bug.cgi?id=162957
389
390         Reviewed by Eric Carlson.
391
392         Implement MediaEndpointPeerConnection's gotIceCandidate and doneGatheringCandidates
393         callbacks. These are used by the MediaEndpoint (WebRTC backend implementation) to
394         notify about ICE events.
395
396         Add API to Internals to emulate WebRTC platform events, such as dispatching a set of ICE
397         candidates followed by a gathering done indication. Initially, only a single action,
398         "dispatch-fake-ice-candidates", is supported, but the intention is to extend the set of
399         actions to support more test cases.
400
401         Test: fast/mediastream/RTCPeerConnection-icecandidate-event.html
402
403         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
404         (WebCore::MediaEndpointPeerConnection::emulatePlatformEvent):
405         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
406         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
407         * Modules/mediastream/MediaEndpointPeerConnection.h:
408         * Modules/mediastream/PeerConnectionBackend.h:
409         * Modules/mediastream/RTCIceTransport.h: Added.
410         RTCIceCandidate will eventually be part of the JS API, but right now it's
411         only used to keep track of the ICE states related to a RTCRtpTranscevier.
412         (WebCore::RTCIceTransport::create):
413         (WebCore::RTCIceTransport::~RTCIceTransport):
414         (WebCore::RTCIceTransport::transportState):
415         (WebCore::RTCIceTransport::setTransportState):
416         (WebCore::RTCIceTransport::gatheringState):
417         (WebCore::RTCIceTransport::setGatheringState):
418         (WebCore::RTCIceTransport::RTCIceTransport):
419         * Modules/mediastream/RTCPeerConnection.cpp:
420         (WebCore::RTCPeerConnection::emulatePlatformEvent):
421         * Modules/mediastream/RTCPeerConnection.h:
422         * Modules/mediastream/RTCRtpTransceiver.cpp:
423         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
424         * Modules/mediastream/RTCRtpTransceiver.h:
425         (WebCore::RTCRtpTransceiver::iceTransport):
426         * WebCore.xcodeproj/project.pbxproj:
427         * platform/mediastream/MediaEndpoint.h:
428         (WebCore::MediaEndpoint::emulatePlatformEvent):
429         * platform/mediastream/PeerConnectionStates.h:
430         * platform/mock/MockMediaEndpoint.cpp:
431         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
432         (WebCore::MockMediaEndpoint::updateReceiveConfiguration):
433         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
434         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
435         (WebCore::MockMediaEndpoint::iceCandidateTimerFired):
436         * platform/mock/MockMediaEndpoint.h:
437         * testing/Internals.cpp:
438         (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
439         Generic API to signal down to the WebRTC platform mock.
440         * testing/Internals.h:
441         * testing/Internals.idl:
442
443 2016-10-06  Nan Wang  <n_wang@apple.com>
444
445         AX:[Mac] Unable to edit text input, textarea fields in iframe using VO naivgation
446         https://bugs.webkit.org/show_bug.cgi?id=162999
447
448         Reviewed by Chris Fleizach.
449
450         In WebKit1, the top web area setting the selection to an input element inside an iframe
451         will make the input field not editable. The issue is that when the web area and the input element
452         have different documents, the setSelection function in FrameSelection will set the selection on
453         the input's frame and cause the caret to disappear. I fixed it by not setting the selection in such case.
454
455         Test: accessibility/mac/wk1-set-selected-text-marker-range-input-element.html
456
457         * accessibility/AccessibilityRenderObject.cpp:
458         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
459
460 2016-10-05  Commit Queue  <commit-queue@webkit.org>
461
462         Unreviewed, rolling out r206845.
463         https://bugs.webkit.org/show_bug.cgi?id=162998
464
465         broke el capitan build (Requested by alexchristensen on
466         #webkit).
467
468         Reverted changeset:
469
470         "Add Display P3 ColorSpace"
471         https://bugs.webkit.org/show_bug.cgi?id=162880
472         http://trac.webkit.org/changeset/206845
473
474 2016-10-05  Youenn Fablet  <youenn@apple.com>
475
476         Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
477         https://bugs.webkit.org/show_bug.cgi?id=162960
478
479         Reviewed by Alex Christensen.
480
481         No change of behavior.
482
483         * bindings/scripts/CodeGenerator.pm:
484         (UpdateFile): Adding FIXME to enable lazy writing when feasible.
485
486 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
487
488         [SOUP] HostTLSCertificateSet should not use SHA-1 hashes to compare certificates
489         https://bugs.webkit.org/show_bug.cgi?id=162965
490
491         Reviewed by Carlos Garcia Campos.
492
493         Use SHA-256 instead.
494
495         No new tests, covered by TestSSL.
496
497         * platform/network/soup/SoupNetworkSession.cpp:
498         (WebCore::HostTLSCertificateSet::computeCertificateHash):
499
500 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
501
502         [GTK] Bump Chrome version in Chrome user agent quirk
503         https://bugs.webkit.org/show_bug.cgi?id=162984
504
505         Reviewed by Carlos Garcia Campos.
506
507         * platform/gtk/UserAgentGtk.cpp:
508         (WebCore::buildUserAgentString):
509
510 2016-10-05  Dean Jackson  <dino@apple.com>
511
512         Add Display P3 ColorSpace
513         https://bugs.webkit.org/show_bug.cgi?id=162880
514         <rdar://problem/28598564>
515
516         Reviewed by Sam Weinig.
517
518         Add a new ColorSpace for Display P3.
519
520         This will be tested once the Color class can create
521         objects that reference other color spaces.
522
523         * platform/graphics/ColorSpace.h:
524         * platform/graphics/cg/GraphicsContextCG.cpp:
525         (WebCore::displayP3ColorSpaceRef):
526         * platform/graphics/cg/GraphicsContextCG.h:
527         (WebCore::cachedCGColorSpace):
528
529 2016-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
530
531         Introduce InputEvent bindings in preparation for the input events spec
532         https://bugs.webkit.org/show_bug.cgi?id=162954
533
534         Reviewed by Ryosuke Niwa.
535
536         Creates new bindings for InputEvent. Also introduces a runtime switch that allows Node to dispatch InputEvents
537         rather than generic events of type 'input'. Adds a new test verifying that when the switch is enabled, inputs
538         and contenteditable divs fire these new InputEvents on input. So far, only inputType is a part of the object
539         prototype, since we will be implementing this first. getTargetRanges() will follow once the finer details of
540         StaticRange are hashed out. See https://bugs.webkit.org/show_bug.cgi?id=162947 for more details.
541
542         Tests: fast/events/input-events-fired-when-typing.html
543                fast/events/ios/input-events-fired-when-typing-in-contenteditable.html
544
545         * CMakeLists.txt:
546         * DerivedSources.cpp:
547         * DerivedSources.make:
548         * WebCore.xcodeproj/project.pbxproj:
549         * dom/DOMAllInOne.cpp:
550         * dom/Event.cpp:
551         (WebCore::Event::composed):
552         (WebCore::Event::isInputEvent):
553         * dom/Event.h:
554         * dom/EventNames.in:
555         * dom/InputEvent.cpp: Added.
556         (WebCore::InputEvent::InputEvent):
557         * dom/InputEvent.h: Added.
558         * dom/InputEvent.idl: Added.
559         * dom/Node.cpp:
560         (WebCore::Node::dispatchInputEvent):
561         (WebCore::Node::defaultEventHandler):
562         * dom/Node.h:
563         * editing/Editor.cpp:
564         (WebCore::Editor::setBaseWritingDirection):
565         * html/HTMLFormControlElement.cpp:
566         (WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
567         * html/HTMLInputElement.cpp:
568         (WebCore::HTMLInputElement::setEditingValue):
569         (WebCore::HTMLInputElement::setValueFromRenderer):
570         * html/HTMLSelectElement.cpp:
571         (WebCore::HTMLSelectElement::listBoxOnChange):
572         (WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
573         * html/shadow/MediaControlElements.cpp:
574         (WebCore::MediaControlTimelineElement::defaultEventHandler):
575         * page/Settings.in:
576         * testing/InternalSettings.cpp:
577         (WebCore::InternalSettings::Backup::Backup):
578         (WebCore::InternalSettings::Backup::restoreTo):
579         * testing/InternalSettings.h:
580         * testing/InternalSettings.idl:
581
582 2016-10-05  Alex Christensen  <achristensen@webkit.org>
583
584         URLParser should parse IPv4 addresses as the last two pieces of an IPv6 address
585         https://bugs.webkit.org/show_bug.cgi?id=162991
586
587         Reviewed by Saam Barati.
588
589         The last 32 bits of an IPv6 address can be written in the form of an IPv4 address,
590         but the syntax is stricter than if it were just an IPv4 address.  There must be 4 pieces,
591         and each piece must be decimal (no octal or hex allowed).  These should serialize to
592         regular hex IPv6 addresses.
593
594         Covered by new API tests.
595
596         * platform/URLParser.cpp:
597         (WebCore::URLParser::parseIPv4Piece):
598         (WebCore::URLParser::parseIPv4Host):
599         (WebCore::URLParser::parseIPv4PieceInsideIPv6):
600         (WebCore::URLParser::parseIPv4AddressInsideIPv6):
601         (WebCore::URLParser::parseIPv6Host):
602         (WebCore::URLParser::parseIPv4Number): Deleted.
603         * platform/URLParser.h:
604
605 2016-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
606
607         Put variation fonts work behind a compile-time flag
608         https://bugs.webkit.org/show_bug.cgi?id=162949
609
610         Reviewed by Simon Fraser.
611
612         No new tests because there is no behavior change.
613
614         * Configurations/FeatureDefines.xcconfig:
615         * css/CSSComputedStyleDeclaration.cpp:
616         (WebCore::ComputedStyleExtractor::propertyValue):
617         * css/CSSFontVariationValue.cpp:
618         * css/CSSFontVariationValue.h:
619         * css/CSSPropertyNames.in:
620         * css/CSSValue.cpp:
621         (WebCore::CSSValue::equals):
622         (WebCore::CSSValue::cssText):
623         (WebCore::CSSValue::destroy):
624         * css/CSSValue.h:
625         (WebCore::CSSValue::isFontFeatureValue): Deleted.
626         (WebCore::CSSValue::isFontVariationValue): Deleted.
627         * css/StyleBuilderConverter.h:
628         (WebCore::StyleBuilderConverter::convertFontVariationSettings): Deleted.
629         * css/StyleBuilderCustom.h:
630         (WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
631         (WebCore::StyleBuilderCustom::applyInheritFontVariationSettings): Deleted.
632         * css/parser/CSSParser.cpp:
633         (WebCore::CSSParserContext::CSSParserContext):
634         (WebCore::operator==):
635         (WebCore::CSSParser::parseValue):
636         (WebCore::CSSParser::parseFontVariationSettings): Deleted.
637         * css/parser/CSSParserMode.h:
638         * page/Settings.in:
639         * page/animation/CSSPropertyAnimation.cpp:
640         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
641         (WebCore::blendFunc): Deleted.
642         * platform/graphics/FontCache.h:
643         (WebCore::FontDescriptionKey::FontDescriptionKey):
644         (WebCore::FontDescriptionKey::operator==):
645         (WebCore::FontDescriptionKey::computeHash):
646         * platform/graphics/FontDescription.cpp:
647         * platform/graphics/FontDescription.h:
648         (WebCore::FontDescription::operator==):
649         (WebCore::FontDescription::setFeatureSettings): Deleted.
650         (WebCore::FontDescription::setVariationSettings): Deleted.
651         * platform/graphics/FontTaggedSettings.cpp:
652         (WebCore::operator<<): Deleted.
653         * platform/graphics/FontTaggedSettings.h:
654         (WebCore::FontVariationSettings::isEmpty):
655         * platform/graphics/cocoa/FontCacheCoreText.cpp:
656         (WebCore::preparePlatformFont):
657         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
658         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
659         * rendering/style/RenderStyle.cpp:
660         (WebCore::RenderStyle::setFontVariationSettings): Deleted.
661         * rendering/style/RenderStyle.h:
662         (WebCore::RenderStyle::fontVariationSettings): Deleted.
663         * testing/InternalSettings.cpp:
664         (WebCore::InternalSettings::Backup::Backup):
665         (WebCore::InternalSettings::Backup::restoreTo):
666         (WebCore::InternalSettings::variationFontsEnabled):
667         (WebCore::InternalSettings::setVariationFontsEnabled):
668         * testing/InternalSettings.h:
669
670 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
671
672         Unreviewed build fix after r206830
673
674         * platform/graphics/win/FontPlatformDataWin.cpp: Add missing include
675         when building with Direct2D.
676
677 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
678
679         [Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
680         https://bugs.webkit.org/show_bug.cgi?id=162977
681
682         Reviewed by Alex Christensen.
683
684         Currently the Direct2D implementation does not support some of the accelerated compositing
685         features that require CoreAnimation. During this bring-up, we want to disable these routines
686         so that we can build and run in (mostly) unaccelerated drawing.
687
688         This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
689         specific to those implementations.
690
691         This change should have no impact on non-Direct2D ports.
692
693         No change in behavior for active ports.
694
695         * config.h: Turn of CG when building in Direct2D.
696         * css/CSSFontFaceSource.cpp:
697         * loader/cache/CachedFont.cpp:
698         * loader/cache/CachedSVGFont.cpp:
699         * page/CaptionUserPreferencesMediaAF.cpp:
700         * page/win/FrameCGWin.cpp:
701         * page/win/FrameDirect2D.cpp: Added.
702         * platform/graphics/Font.cpp:
703         * platform/graphics/FontCache.cpp:
704         * platform/graphics/FontPlatformData.cpp:
705         * platform/graphics/GraphicsContext.h:
706         * platform/graphics/Image.cpp:
707         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
708         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
709         * platform/graphics/ca/GraphicsLayerCA.cpp:
710         * platform/graphics/ca/PlatformCALayer.cpp:
711         * platform/graphics/ca/TileController.cpp:
712         * platform/graphics/ca/TileGrid.cpp:
713         * platform/graphics/ca/TileGrid.h:
714         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
715         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
716         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
717         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
718         * platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
719         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
720         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
721         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
722         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
723         * platform/graphics/cg/GradientCG.cpp:
724         * platform/graphics/cg/GraphicsContextCG.cpp:
725         * platform/graphics/cg/ImageBufferCG.cpp:
726         * platform/graphics/cg/ImageBufferDataCG.cpp:
727         * platform/graphics/cg/PDFDocumentImage.cpp:
728         * platform/graphics/cg/PatternCG.cpp:
729         * platform/graphics/cg/SubimageCacheWithTimer.cpp:
730         * platform/graphics/win/FontCGWin.cpp:
731         * platform/graphics/win/FontPlatformDataCGWin.cpp:
732         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
733         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
734         * platform/graphics/win/GradientDirect2D.cpp:
735         * platform/graphics/win/PathDirect2D.cpp: Fix a few build problems I didn't notice
736         while building without Direct2D active.
737         * platform/graphics/win/SimpleFontDataCGWin.cpp:
738         * platform/graphics/win/SimpleFontDataWin.cpp:
739         * platform/win/DragImageCGWin.cpp:
740         * platform/win/DragImageDirect2D.cpp: Added.
741         * rendering/RenderMediaControls.cpp:
742
743 2016-10-05  Chris Dumez  <cdumez@apple.com>
744
745         KeyboardEvent.getModifierState() should support "CapsLock" modifier
746         https://bugs.webkit.org/show_bug.cgi?id=162861
747
748         Reviewed by Darin Adler.
749
750         Add support for "CapsLock" modifier on Mac / iOS for KeyboardEvent's
751         getModifierState() API, as per:
752         - https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
753
754         No new tests, updated existing test.
755
756         * dom/KeyboardEvent.cpp:
757         (WebCore::KeyboardEvent::KeyboardEvent):
758         (WebCore::KeyboardEvent::getModifierState):
759         * dom/KeyboardEvent.h:
760         * platform/PlatformEvent.h:
761         * platform/ios/PlatformEventFactoryIOS.mm:
762         (WebCore::modifiersForEvent):
763         * platform/mac/PlatformEventFactoryMac.mm:
764         (WebCore::keyIdentifierForKeyEvent):
765
766 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
767
768         [GTK] Improve OS X UA quirk
769         https://bugs.webkit.org/show_bug.cgi?id=162613
770
771         Reviewed by Carlos Garcia Campos.
772
773         Include OS X version number in user agent, like Safari does.
774
775         * platform/gtk/UserAgentGtk.cpp:
776         (WebCore::buildUserAgentString):
777
778 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
779
780         [GTK] Improve comment in platformVersionForUAString
781         https://bugs.webkit.org/show_bug.cgi?id=162612
782
783         Reviewed by Carlos Garcia Campos.
784
785         * platform/gtk/UserAgentGtk.cpp:
786         (WebCore::platformVersionForUAString):
787
788 2016-10-05  Zalan Bujtas  <zalan@apple.com>
789
790         Missing quotation mark when <q> gets reparented.
791         https://bugs.webkit.org/show_bug.cgi?id=162940
792
793         Reviewed by Darin Adler.
794
795         When an opening RenderQuote gets removed due to some change in the render tree,
796         we notify the closing RenderQuote so that it can update its content (") accordingly (and vice versa).
797         However when the same RenderQuote is added back to the render tree (aka reparenting), we fail to
798         let the other RenderQuote know about it and its content becomes stale.  
799         This patch ensures that when either the opening or closing part of the quotation mark gets reparented,
800         we inform the other, corresponding opening/closing renderer about it.
801
802         Test: fast/css-generated-content/missing-quotes-with-dynamic-content.html
803
804         * dom/PseudoElement.cpp:
805         (WebCore::PseudoElement::didAttachRenderers):
806         * rendering/RenderQuote.cpp:
807         (WebCore::RenderQuote::insertedIntoTree):
808         * rendering/RenderQuote.h:
809
810 2016-10-05  Alex Christensen  <achristensen@webkit.org>
811
812         URLParser should correctly strip unnecessary 0's in IPv6 addresses
813         https://bugs.webkit.org/show_bug.cgi?id=162979
814
815         Reviewed by Brady Eidson.
816
817         Covered by new API tests.
818
819         * platform/URLParser.cpp:
820         (WebCore::URLParser::parseIPv6Host):
821         Strip leading 0's and any 0's before the last 0 if the value is 0.
822
823 2016-10-05  Alex Christensen  <achristensen@webkit.org>
824
825         UTF-8 encode queries of nonspecial and websocket schemes
826         https://bugs.webkit.org/show_bug.cgi?id=162956
827
828         Reviewed by Geoffrey Garen and Brady Eidson.
829
830         The URL spec says in the query state:
831         'If url is not special or url's scheme is either "ws" or "wss", set encoding to UTF-8.'
832         This should be determined as soon as we are done parsing the scheme.
833         
834         Covered by new API tests.
835         This also fixes tests like fast/loader/javascript-url-encoding-2.html when URLParser is enabled.
836
837         * platform/URLParser.cpp:
838         (WebCore::isValidSchemeCharacter):
839         Renamed Scheme to ValidScheme so I can use Scheme as the name of an enum class in the same namespace.
840         (WebCore::isSpecial):
841         (WebCore::scheme):
842         Separate functionality so we can have different behavior for different sets of
843         ws and wss schemes, special, and non-special schemes.
844         (WebCore::URLParser::copyURLPartsUntil):
845         (WebCore::URLParser::parse):
846         Set isUTF8Encoding to true when we finish parsing the scheme if the scheme is ws, wss, or non-special,
847         according to spec.  This also matches existing behavior.  This way we will already know whether to go
848         into UTF8Query or NonUTF8Query state when we see a '?'.
849         (WebCore::isSpecialScheme): Deleted.
850
851 2016-10-05  Alex Christensen  <achristensen@webkit.org>
852
853         Prepare to enable URLParser
854         https://bugs.webkit.org/show_bug.cgi?id=162974
855
856         Reviewed by Brady Eidson.
857
858         * platform/URL.cpp:
859         (WebCore::URL::serialize):
860         When we enable the URLParser, this attempt to make serialized URLs more spec compliant
861         won't be needed any more.
862
863 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
864
865         [Win][Direct2D] Add initial D2D Path and Gradient implementation
866         https://bugs.webkit.org/show_bug.cgi?id=162923
867
868         Reviewed by Alex Christensen.
869
870         This patch lands a set of new files that implements initial Path
871         and Gradient features on Windows using Direct2D.
872
873         No new tests until complete backend lands.
874
875         * platform/graphics/Gradient.h:
876         * platform/graphics/Path.cpp:
877         * platform/graphics/Path.h:
878         * platform/graphics/win/GradientDirect2D.cpp: Added.
879         * platform/graphics/win/PathDirect2D.cpp: Added.
880
881 2016-10-05  Romain Bellessort  <romain.bellessort@crf.canon.fr>
882
883         [Readable Streams API] Align function names with spec
884         https://bugs.webkit.org/show_bug.cgi?id=162967
885
886         Reviewed by Darin Adler.
887
888         Align function names with spec. Behaviour was already in line with spec, but previous function names had
889         sometimes been preserved to track the changes more easily. This led to some inconsistencies (for instance,
890         enqueueInReadableStream was still used even though it works on a controller instead of a stream) and it
891         also made it more difficult to compare spec and implementation.
892
893         No change in behaviour.
894
895         * Modules/fetch/FetchInternals.js:
896         (consumeStream): Updated with new function names.
897         * Modules/fetch/FetchResponse.js:
898         (clone): Updated with new function names.
899         * Modules/streams/ReadableStream.js:
900         (tee): Updated with new function names.
901         * Modules/streams/ReadableStreamDefaultController.js:
902         (enqueue): Updated with new function names.
903         (error): Updated with new function names.
904         * Modules/streams/ReadableStreamDefaultReader.js:
905         (read): Updated with new function names.
906         * Modules/streams/ReadableStreamInternals.js:
907         (privateInitializeReadableStreamDefaultController): Updated with new function names.
908         (readableStreamDefaultControllerError): Updated with new function names.
909         (readableStreamTee): Updated with new function names.
910         (readableStreamTeePullFunction): Updated with new function names.
911         (readableStreamTeeBranch2CancelFunction): Updated with new function names.
912         (readableStreamError): Updated with new function names.
913         (readableStreamCancel): Updated with new function names.
914         (readableStreamDefaultControllerPull): Updated with new function names.
915         (readableStreamDefaultControllerClose): Updated with new function names.
916         (readableStreamClose): Updated with new function names.
917         (readableStreamDefaultControllerEnqueue): Updated with new function names.
918         (readableStreamDefaultReaderRead): Updated with new function names.
919
920 2016-10-05  Chris Dumez  <cdumez@apple.com>
921
922         [Bindings] Declare dictionary / enumeration template specializations in the header
923         https://bugs.webkit.org/show_bug.cgi?id=162929
924
925         Reviewed by Darin Adler.
926
927         Declare dictionary / enumeration template specializations in the header
928         so that:
929         - They can be used from custom bindings code.
930         - Dictionaries / enumerations can be used to their own IDL files to
931           share them (Bug 162912).
932
933         No new tests, rebaselined bindings tests.
934
935         * WebCore.xcodeproj/project.pbxproj:
936         * bindings/generic/IDLTypes.h:
937         * bindings/js/JSDOMConvert.h:
938         * bindings/scripts/CodeGeneratorJS.pm:
939         (GenerateInterface):
940         (GenerateEnumerationImplementationContent):
941         (GenerateEnumerationHeaderContent):
942         (GenerateDictionaryHeaderContent):
943         (GenerateHeader):
944         (GenerateCallbackHeader):
945         (GenerateCallbackImplementation):
946         (GenerateDefaultValue): Deleted.
947         (GenerateDictionaryImplementationContent): Deleted.
948         (GenerateParametersCheck): Deleted.
949         * bindings/scripts/test/JS/JSTestObj.cpp:
950         * bindings/scripts/test/JS/JSTestObj.h:
951
952 2016-10-05  Zan Dobersek  <zdobersek@igalia.com>
953
954         Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
955         https://bugs.webkit.org/show_bug.cgi?id=162903
956
957         Reviewed by Alex Christensen.
958
959         Rename build guards for the remaining implementation of the legacy EME API
960         to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
961         of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.
962
963         No new tests -- no change in behavior.
964
965         * CMakeLists.txt:
966         * Configurations/FeatureDefines.xcconfig:
967         * DerivedSources.cpp:
968         * DerivedSources.make:
969         * Modules/encryptedmedia/CDM.cpp:
970         * Modules/encryptedmedia/CDM.h:
971         * Modules/encryptedmedia/CDMPrivate.h:
972         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
973         * Modules/encryptedmedia/CDMPrivateClearKey.h:
974         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
975         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
976         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
977         * Modules/encryptedmedia/CDMSessionClearKey.h:
978         * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
979         * Modules/encryptedmedia/MediaKeyMessageEvent.h:
980         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
981         * Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
982         * Modules/encryptedmedia/MediaKeyNeededEvent.h:
983         * Modules/encryptedmedia/MediaKeyNeededEvent.idl:
984         * Modules/encryptedmedia/MediaKeySession.cpp:
985         * Modules/encryptedmedia/MediaKeySession.h:
986         * Modules/encryptedmedia/MediaKeySession.idl:
987         * Modules/encryptedmedia/MediaKeys.cpp:
988         * Modules/encryptedmedia/MediaKeys.h:
989         * Modules/encryptedmedia/MediaKeys.idl:
990         * bindings/js/JSDictionary.cpp:
991         * bindings/js/JSDictionary.h:
992         * dom/Element.idl:
993         * dom/EventNames.in:
994         * dom/EventTargetFactory.in:
995         * html/HTMLMediaElement.cpp:
996         (WebCore::HTMLMediaElement::~HTMLMediaElement):
997         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
998         (WebCore::HTMLMediaElement::webkitAddKey):
999         * html/HTMLMediaElement.h:
1000         * html/HTMLMediaElement.idl:
1001         * html/MediaError.h:
1002         * html/MediaError.idl:
1003         * html/MediaKeyError.h:
1004         * html/MediaKeyError.idl:
1005         * page/Settings.h:
1006         * platform/graphics/CDMSession.h:
1007         * platform/graphics/MediaPlayer.cpp:
1008         * platform/graphics/MediaPlayer.h:
1009         * platform/graphics/MediaPlayerPrivate.h:
1010         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
1011         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1012         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1013         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1014         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1015         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
1016         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1017         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
1018         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1019         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1020         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
1021         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1022         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1023         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1024         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1025         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1026         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1027         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1028         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1029         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1030         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
1031         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1032         (WebCore::playerKVOProperties):
1033         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1034         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1035         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1036         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1037         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1038         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1039         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
1040         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1041         * testing/Internals.cpp:
1042         * testing/Internals.h:
1043         * testing/Internals.idl:
1044         * testing/MockCDM.cpp:
1045         * testing/MockCDM.h:
1046
1047 2016-10-05  Daniel Bates  <dabates@apple.com>
1048
1049         Do not follow redirects when sending violation report
1050         https://bugs.webkit.org/show_bug.cgi?id=162520
1051         <rdar://problem/27957639>
1052
1053         Reviewed by Alex Christensen.
1054
1055         Do not follow redirects when sending a Content Security Policy or XSS Auditor violation report
1056         as redirects can be used to forward report details to a third-party.
1057
1058         This changes makes WebKit more closely conform to the reporting requirements in section Reporting
1059         of the Content Security Level 2 standard: <https://w3c.github.io/webappsec-csp/2/#violation-reports>
1060         (Editor's Draft, 25 April 2016).
1061
1062         Tests: http/tests/security/contentSecurityPolicy/report-blocked-uri-and-do-not-follow-redirect-when-sending-report.php
1063                http/tests/security/xssAuditor/report-script-tag-and-do-not-follow-redirect-when-sending-report.html
1064                http/tests/security/xssAuditor/report-script-tag-full-block-and-do-not-follow-redirect-when-sending-report.html
1065
1066         * loader/LoaderStrategy.h: Modified createPingHandle() to take a boolean, shouldFollowRedirects,
1067         whether to follow redirect responses for a ping request.
1068         * loader/PingLoader.cpp:
1069         (WebCore::PingLoader::loadImage): Pass ShouldFollowRedirects::Yes to PingLoader::startPingLoad to
1070         keep our current behavior.
1071         (WebCore::PingLoader::sendPing): Ditto. Note our current behavior of following redirects matches
1072         the behavior described in the section "Hyperlink auditing" of the HTML standard:
1073         <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (23 September 2016).
1074         (WebCore::PingLoader::sendViolationReport): Pass ShouldFollowRedirects::No to PingLoader::startPingLoad
1075         so that we do not follow redirects when sending a violation report.
1076         (WebCore::PingLoader::startPingLoad): Modified to take argument shouldFollowRedirects whether to
1077         follow redirect responses for a ping request.
1078         * loader/PingLoader.h:
1079         * platform/network/PingHandle.h: Add boolean m_shouldFollowRedirects. I grouped this boolean with
1080         the existing boolean, m_shouldUseCredentialStorage, as opposed to appending to the end of the class
1081         definition to avoid increasing object size as clang will coalesces the two bools into a single
1082         machine word. Override ResourceHandleClient::willSendRequest() and ResourceHandleClient::willSendRequestAsync()
1083         to follow a redirect, if applicable. 
1084
1085 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1086
1087         [SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
1088         https://bugs.webkit.org/show_bug.cgi?id=162910
1089
1090         Reviewed by Alex Christensen.
1091
1092         So that it will be shared with network session code. Also remove setHostAllowsAnyHTTPSCertificate() that we have
1093         never actually used.
1094
1095         * platform/network/ResourceHandle.h:
1096         * platform/network/soup/ResourceHandleSoup.cpp:
1097         (WebCore::tlsErrorsChangedCallback): Use SoupNetworkSession::checkTLSErrors().
1098         * platform/network/soup/SoupNetworkSession.cpp:
1099         (WebCore::HostTLSCertificateSet::add):
1100         (WebCore::HostTLSCertificateSet::contains):
1101         (WebCore::HostTLSCertificateSet::computeCertificateHash):
1102         (WebCore::clientCertificates):
1103         (WebCore::SoupNetworkSession::setShouldIgnoreTLSErrors):
1104         (WebCore::SoupNetworkSession::checkTLSErrors):
1105         (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
1106         * platform/network/soup/SoupNetworkSession.h:
1107
1108 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1109
1110         [SOUP] Move request HTTP body handling to ResourceRequestSoup and simplify it
1111         https://bugs.webkit.org/show_bug.cgi?id=162891
1112
1113         Reviewed by Michael Catanzaro.
1114
1115         We are currently adding the HTTP body to the message in ResourceHandleSoup, but we could do it as part of the
1116         ResourceRequest::updateSoupMessage() method, since the HTTP body is indeed part of the request. The code can be
1117         also simplified, especially the handling of files, by using SharedBuffer that already mmaps the file when
1118         possible, instead of using GMappedFile API.
1119
1120         * platform/SharedBuffer.h: Add createSoupBuffer() method.
1121         * platform/network/soup/ResourceHandleSoup.cpp:
1122         (WebCore::createSoupMessageForHandleAndRequest):
1123         (WebCore::milisecondsSinceRequest): Deleted.
1124         (WebCore::ResourceHandle::didStartRequest): Deleted.
1125         (WebCore::startingCallback): Deleted.
1126         (WebCore::networkEventCallback): Deleted.
1127         (WebCore::ResourceHandle::start): Deleted.
1128         (WebCore::ResourceHandle::releaseForDownload): Deleted.
1129         (WebCore::ResourceHandle::timeoutFired): Deleted.
1130         * platform/network/soup/ResourceRequest.h:
1131         * platform/network/soup/ResourceRequestSoup.cpp:
1132         (WebCore::appendEncodedBlobItemToSoupMessageBody): Helper method to append the blob to the request message body.
1133         (WebCore::ResourceRequest::updateSoupMessageBody): Add HTTPBody to the request message body.
1134         (WebCore::ResourceRequest::updateSoupMessage): Call updateSoupMessageBody() to also update the body.
1135         * platform/soup/SharedBufferSoup.cpp:
1136         (WebCore::SharedBuffer::createSoupBuffer): Returns a new SoupBuffer for the SharedBuffer.
1137
1138 2016-10-04  Chris Dumez  <cdumez@apple.com>
1139
1140         Implement KeyboardEvent.code from the UI Event spec
1141         https://bugs.webkit.org/show_bug.cgi?id=149584
1142
1143         Reviewed by Darin Adler.
1144
1145         Add support for Keyboard.code attribute:
1146         - https://w3c.github.io/uievents/#dom-keyboardevent-code
1147         - https://w3c.github.io/uievents-code/
1148
1149         The feature is only enabled on Mac for now as the implementation is
1150         platform-specific and Mac only.
1151
1152         Test: fast/events/keyboardevent-code.html
1153
1154         * dom/KeyboardEvent.cpp:
1155         (WebCore::KeyboardEvent::KeyboardEvent):
1156         * dom/KeyboardEvent.h:
1157         * dom/KeyboardEvent.idl:
1158         * platform/PlatformKeyboardEvent.h:
1159         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1160         (WebCore::PlatformKeyboardEvent::code):
1161         (WebCore::PlatformKeyboardEvent::unmodifiedText): Deleted.
1162         * platform/mac/PlatformEventFactoryMac.h:
1163         * platform/mac/PlatformEventFactoryMac.mm:
1164         (WebCore::codeForKeyEvent):
1165         (WebCore::keyIdentifierForKeyEvent):
1166         * replay/SerializationMethods.cpp:
1167         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
1168         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
1169
1170 2016-10-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1171
1172         The dragged image should be the current frame only of the animated image
1173         https://bugs.webkit.org/show_bug.cgi?id=162109
1174
1175         Reviewed by Tim Horton.
1176
1177         Instead of creating an NSImage with all the frames for the dragImage,
1178         create an NSImage with the current frame only.
1179
1180         * dom/DataTransferMac.mm:
1181         (WebCore::DataTransfer::createDragImage): Call snapshotNSImage() to create the dragImage.
1182         * editing/cocoa/HTMLConverter.mm:
1183         (fileWrapperForElement):  Call the Image function with its new name.
1184         * platform/graphics/BitmapImage.h:
1185         * platform/graphics/Image.h:
1186         (WebCore::Image::nsImage): Rename getNSImage() to nsImage().
1187         (WebCore::Image::snapshotNSImage): Returns the NSImage of the current frame.
1188         (WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
1189         (WebCore::Image::getNSImage): Deleted.
1190         (WebCore::Image::getTIFFRepresentation): Deleted.
1191         * platform/graphics/mac/ImageMac.mm:
1192         (WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
1193         (WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
1194         (WebCore::BitmapImage::snapshotNSImage): Returns the NSImage of the current frame.
1195         (WebCore::BitmapImage::getTIFFRepresentation): Deleted.
1196         (WebCore::BitmapImage::getNSImage): Deleted.
1197         * platform/mac/CursorMac.mm:
1198         (WebCore::createCustomCursor): Call snapshotNSImage() since the cursor does not animate anyway.
1199         * platform/mac/DragImageMac.mm:
1200         (WebCore::createDragImageFromImage): Use snapshotNSImage() for the dragImage.
1201         * platform/mac/PasteboardMac.mm:
1202         (WebCore::Pasteboard::write): Call the Image function with its new name.
1203
1204 2016-10-04  Andy Estes  <aestes@apple.com>
1205
1206         [iOS] Crash in WebResourceLoaderQuickLookDelegate when the client cancels the navigation to a QuickLook resource
1207         https://bugs.webkit.org/show_bug.cgi?id=162950
1208         <rdar://problem/23759114>
1209
1210         Reviewed by Brady Eidson.
1211
1212         When we receive data from QLPreviewConverter for the first time, we call
1213         ResourceLoader::didReceiveResponse() with the preview NSURLResponse from QuickLook. If the
1214         client decides to cancel this navigation in decidePolicyForResponse(),
1215         WebResourceLoaderQuickLookDelegate will end up with a null _resourceLoader after
1216         didReceiveResponse() returns. This change adds null checks in the methods that use
1217         _resourceLoader after calling -_sendDidReceiveResponseIfNecessary.
1218
1219         New API test: QuickLook.CancelNavigationAfterResponse
1220
1221         * platform/network/ios/QuickLook.mm:
1222         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Changed to only
1223         call ResourceLoader::didReceiveDataArray() if _resourceLoader is non-null.
1224         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveData:lengthReceived:]): Ditto for
1225         ResourceLoader::didReceiveData().
1226         (-[WebResourceLoaderQuickLookDelegate connection:didFailWithError:]): Ditto for
1227         ResourceLoader::didFail().
1228
1229 2016-10-04  Chris Dumez  <cdumez@apple.com>
1230
1231         Add support for KeyboardEvent.isComposing attribute
1232         https://bugs.webkit.org/show_bug.cgi?id=162921
1233
1234         Reviewed by Darin Adler.
1235
1236         Add support for KeyboardEvent.isComposing attribute:
1237         - https://www.w3.org/TR/uievents/#dom-keyboardevent-iscomposing
1238         - https://www.w3.org/TR/uievents/#ref-for-dom-keyboardevent-iscomposing-3
1239
1240         Manual test: https://jsfiddle.net/ay92sr08/9/
1241
1242         No new tests, extended existing tests.
1243
1244         * dom/KeyboardEvent.cpp:
1245         (WebCore::KeyboardEvent::KeyboardEvent):
1246         * dom/KeyboardEvent.h:
1247         * dom/KeyboardEvent.idl:
1248
1249 2016-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1250
1251         ShadowRoot interface should have elementFromPoint
1252         https://bugs.webkit.org/show_bug.cgi?id=162882
1253
1254         Reviewed by Chris Dumez.
1255
1256         Add elementFromPoint to ShadowRoot's prototype as specified at:
1257         https://www.w3.org/TR/shadow-dom/#extensions-to-the-documentorshadowroot-mixin
1258         with changes proposed at https://github.com/w3c/csswg-drafts/issues/556
1259
1260         Added TreeScope::retargetToScope which implements 
1261
1262         This patch also factors DocumentOrShadowRoot.idl out of Document and ShadowRoot interfaces to better match
1263         the latest DOM specification: https://dom.spec.whatwg.org/#mixin-documentorshadowroot
1264
1265         Test: fast/shadow-dom/Document-prototype-elementFromPoint.html
1266
1267         * CMakeLists.txt:
1268         * DerivedSources.make:
1269         * WebCore.xcodeproj/project.pbxproj:
1270         * dom/Document.cpp:
1271         (WebCore::Document::nodeFromPoint): Moved to TreeScope.
1272         (WebCore::Document::elementFromPoint): Moved to TreeScope.
1273         * dom/Document.h:
1274         * dom/Document.idl: Moved elementFromPoint and activeElement to DocumentOrShadowRoot.idl.
1275         * dom/DocumentOrShadowRoot.idl: Added.
1276         * dom/EventPath.cpp:
1277         (WebCore::RelatedNodeRetargeter::checkConsistency): Use newly added TreeScope::retargetToScope.
1278         * dom/ShadowRoot.idl: Moved activeElement to DocumentOrShadowRoot.idl.
1279         * dom/TreeScope.cpp:
1280         (WebCore::TreeScope::retargetToScope): Added. Implements https://dom.spec.whatwg.org/#retarget efficiently.
1281         Instead of checking whether A (node) is a shadow-including inclusive ancestor of B (this scope) at each
1282         parent, find the lowest ancestor which contains both A and B, and return the self-inclusive ancestor of B
1283         in that tree. To find the lowest common ancestor in O(n), traverse all ancestors of A and B separately and
1284         do a top-down traversal. The last tree scope in which A's ancestor and B's ancestor match is the lowest
1285         common ancestor.
1286         (WebCore::TreeScope::nodeFromPoint): Moved from Document.
1287         (WebCore::TreeScope::elementFromPoint): Moved from Document. Use retargetToScope and parentInComposedTree
1288         instead of parentNode and ancestorInThisScope to match the semantics proposed in
1289         https://github.com/w3c/csswg-drafts/issues/556
1290         * dom/TreeScope.h:
1291
1292 2016-10-04  Myles C. Maxfield  <mmaxfield@apple.com>
1293
1294         font-family: cursive should map to KaiTi in Chinese
1295         https://bugs.webkit.org/show_bug.cgi?id=162889
1296         <rdar://problem/28363547>
1297
1298         Reviewed by Tim Horton.
1299
1300         According to Bobby Tung, this is a better mapping. Previously, we were
1301         relying on the system fallback mechanism. However, an explicit mapping
1302         is more robust.
1303
1304         Test: fast/text/cursive-zh.html
1305
1306         * page/cocoa/SettingsCocoa.mm:
1307         (WebCore::Settings::initializeDefaultFontFamilies):
1308
1309 2016-10-04  Alex Christensen  <achristensen@webkit.org>
1310
1311         URLParser: query-only URLs relative to file URLs should just add a query
1312         https://bugs.webkit.org/show_bug.cgi?id=162888
1313
1314         Reviewed by Tim Horton.
1315
1316         Covered by new API tests.
1317
1318         * platform/URLParser.cpp:
1319         (WebCore::URLParser::parse):
1320         Like bug 206749 but with queries instead of fragments.
1321
1322 2016-10-04  Alex Christensen  <achristensen@webkit.org>
1323
1324         URLParser should match URL::parse and other browsers when parsing a URL containing only scheme://
1325         https://bugs.webkit.org/show_bug.cgi?id=162909
1326
1327         Reviewed by Tim Horton.
1328
1329         If there's no host in this case we shouldn't fail, but rather make a valid URL with the // in the path.
1330         This matches Chrome, Firefox, and Safari's behavior.
1331         Covered by API tests.
1332
1333         * platform/URLParser.cpp:
1334         (WebCore::URLParser::parse):
1335
1336 2016-10-04  Brent Fulgham  <bfulgham@apple.com>
1337
1338         Unreviewed build fix after r206773.
1339
1340         Exclude Direct2D definitions when building for normal CG Windows.
1341
1342         * platform/graphics/GraphicsContext.h:
1343
1344 2016-10-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1345
1346         [DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information
1347         https://bugs.webkit.org/show_bug.cgi?id=162916
1348
1349         Reviewed by Filip Pizlo.
1350
1351         * ForwardingHeaders/domjit/DOMJITGetterSetter.h: Added.
1352         * PlatformEfl.cmake:
1353         * PlatformGTK.cmake:
1354         * PlatformMac.cmake:
1355         * PlatformWin.cmake:
1356
1357 2016-10-04  Chris Dumez  <cdumez@apple.com>
1358
1359         Return null when window.open() is popup blocked
1360         https://bugs.webkit.org/show_bug.cgi?id=162897
1361
1362         Reviewed by Michael Catanzaro.
1363
1364         The return value of window.open() when the popup is blocked should be null:
1365         - https://github.com/whatwg/html/pull/1854
1366         - https://github.com/whatwg/html/issues/1851
1367
1368         Firefox / Edge return null.
1369
1370         No new tests, rebaselined existing tests.
1371
1372         * bindings/js/JSDOMWindowCustom.cpp:
1373         (WebCore::JSDOMWindow::open):
1374
1375 2016-10-04  Chris Dumez  <cdumez@apple.com>
1376
1377         [Web IDL] Add support for dictionary inheritance
1378         https://bugs.webkit.org/show_bug.cgi?id=162907
1379
1380         Reviewed by Sam Weinig.
1381
1382         Add support for dictionary inheritance to our Web IDL parser and
1383         bindings generator. Leverage this new support for EventTarget's
1384         EventListenerOptions / AddEventListenerOptions dictionaries, in
1385         order to match the DOM specification:
1386         - https://dom.spec.whatwg.org/#interface-eventtarget
1387
1388         Also update the bindings generator to convert the dictionary
1389         members in lexicographical order, as per:
1390         - https://heycam.github.io/webidl/#es-dictionary (Step 5.1)
1391
1392         No new tests, rebaselined bindings tests.
1393
1394         * bindings/scripts/CodeGenerator.pm:
1395         (GetDictionaryByName):
1396         * bindings/scripts/CodeGeneratorJS.pm:
1397         (GenerateDictionaryImplementationContent):
1398         * bindings/scripts/IDLParser.pm:
1399         (parseDictionary):
1400         * bindings/scripts/test/JS/JSTestObj.cpp:
1401         (WebCore::convertDictionary<TestObj::Dictionary>):
1402         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1403         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
1404         (WebCore::convertDictionary<AlternateDictionaryName>):
1405         (WebCore::convertDictionary<TestObj::ParentDictionary>):
1406         (WebCore::convertDictionary<TestObj::ChildDictionary>):
1407         * bindings/scripts/test/TestObj.idl:
1408         * dom/EventTarget.idl:
1409
1410 2016-10-04  Brent Fulgham  <bfulgham@apple.com>
1411
1412         [Win][Direct2D] Add initial D2D GraphicsContext implementation
1413         https://bugs.webkit.org/show_bug.cgi?id=162917
1414
1415         Reviewed by Dean Jackson.
1416
1417         This patch lands a set of new files that implement the GraphicsContext
1418         features on Windows using Direct2D.
1419
1420         No new tests until complete backend lands.
1421
1422         * platform/graphics/Color.h: Add new casting operator.
1423         * platform/graphics/FloatSize.h: Ditto.
1424         * platform/graphics/GraphicsContext.cpp: Update for Direct2D
1425         implementation.
1426         * platform/graphics/GraphicsContext.h:
1427         * platform/graphics/win/ColorDirect2D.cpp:
1428         (WebCore::Color::operator D2D1_VECTOR_4F): Added.
1429         * platform/graphics/win/GraphicsContextCGWin.cpp: Add compiler
1430         guard to avoid building when using Direct2D.
1431         * platform/graphics/win/GraphicsContextDirect2D.cpp: Added.
1432         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Added.
1433         * platform/graphics/win/GraphicsContextWin.cpp: Update for Direct2D
1434         includes.
1435         * platform/graphics/win/TransformationMatrixDirect2D.cpp: Fix comment.
1436
1437 2016-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1438
1439         [SOUP] Remove SSLPolicyFlags from SoupNetworkSession
1440         https://bugs.webkit.org/show_bug.cgi?id=162906
1441
1442         Reviewed by Michael Catanzaro.
1443
1444         All soup based ports are setting SSLUseSystemCAFile flag unconditionally, so we can just use that when creating
1445         the session like we do for all other construct parameters.
1446
1447         * platform/network/soup/SoupNetworkSession.cpp:
1448         (WebCore::SoupNetworkSession::createTestingSession):
1449         (WebCore::SoupNetworkSession::setupLogger):
1450         (WebCore::SoupNetworkSession::SoupNetworkSession): Deleted.
1451         (WebCore::SoupNetworkSession::clearOldSoupCache): Deleted.
1452         (WebCore::SoupNetworkSession::setHTTPProxy): Deleted.
1453         * platform/network/soup/SoupNetworkSession.h:
1454         (WebCore::SoupNetworkSession::soupSession): Deleted.
1455
1456 2016-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1457
1458         Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
1459         https://bugs.webkit.org/show_bug.cgi?id=162766
1460         <rdar://problem/28533523>
1461
1462         Reviewed by Jer Noble.
1463
1464         When showing Now Playing controls for a media session, we should first set up the Now Playing info and
1465         playback state before telling MediaRemote to make the session visible. This is WebKit work in ensuring that
1466         when switching Now Playing sessions by switching tabs, we do not first display an invalid Now Playing state
1467         before updating to the expected state.
1468
1469         Adds 2 new WebKit API tests in NowPlayingControlsTests: NowPlayingControlsHideAfterShowingClearsInfo and
1470         NowPlayingControlsClearInfoAfterSessionIsNoLongerValid.
1471
1472         * platform/audio/PlatformMediaSessionManager.h:
1473         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingTitle):
1474         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingDuration):
1475         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingElapsedTime):
1476         (WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession): Deleted.
1477         * platform/audio/mac/MediaSessionManagerMac.h:
1478         * platform/audio/mac/MediaSessionManagerMac.mm:
1479         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
1480
1481 2016-10-04  Youenn Fablet  <youenn@apple.com>
1482
1483         [Fetch API] ReadableStream should be errored with TypeError values
1484         https://bugs.webkit.org/show_bug.cgi?id=162895
1485
1486         Reviewed by Alex Christensen.
1487
1488         Test: imported/w3c/web-platform-tests/fetch/api/basic/error-after-response.html
1489
1490         * Modules/fetch/FetchResponse.cpp:
1491         (WebCore::FetchResponse::BodyLoader::didFail): Removing FIXME.
1492         * bindings/js/ReadableStreamDefaultController.h:
1493         (WebCore::ReadableStreamDefaultController::error<String>): Erroring with TypeError values.
1494
1495 2016-10-03  Chris Dumez  <cdumez@apple.com>
1496
1497         Bindings do not throw a TypeError if a required dictionary member is missing
1498         https://bugs.webkit.org/show_bug.cgi?id=162734
1499
1500         Reviewed by Geoffrey Garen.
1501
1502         Bindings should throw a TypeError if a required dictionary member is missing.
1503         For example, if there is a "required long id" member in a dictionary that is
1504         missing, our bindings would prevously pass 0 to the implementation instead
1505         of throwing a TypeError.
1506
1507         Relevant specification:
1508         - https://heycam.github.io/webidl/#es-dictionary
1509
1510         I aligned our bindings generator implementation with the specification,
1511         except for the support for dictionary inheritance that is still missing
1512         and will be addressed in a follow-up patch.
1513
1514         No new tests, I rebaselined the bindings tests and this is already covered
1515         by fast/events/touch/touch-constructor.html on iOS.
1516
1517         * bindings/js/JSCustomElementRegistryCustom.cpp:
1518         (WebCore::JSCustomElementRegistry::define):
1519         * bindings/js/JSDOMConvert.h:
1520         (WebCore::convert): Deleted.
1521         (WebCore::Converter<bool>::convert): Deleted.
1522         (WebCore::Converter<String>::convert): Deleted.
1523         (WebCore::Converter<IDLDOMString>::convert): Deleted.
1524         (WebCore::Converter<IDLUSVString>::convert): Deleted.
1525         (WebCore::Converter<JSC::JSValue>::convert): Deleted.
1526         (WebCore::Converter<int8_t>::convert): Deleted.
1527         (WebCore::Converter<uint8_t>::convert): Deleted.
1528         * bindings/scripts/CodeGeneratorJS.pm:
1529         (GenerateDictionaryImplementationContent):
1530         * bindings/scripts/test/JS/JSTestObj.cpp:
1531         (WebCore::convertDictionary<TestObj::Dictionary>):
1532         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1533         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
1534         (WebCore::convertDictionary<AlternateDictionaryName>):
1535
1536 2016-10-03  Zalan Bujtas  <zalan@apple.com>
1537
1538         [ListItems] Render tree should be all clean by the end of FrameView::layout().
1539         https://bugs.webkit.org/show_bug.cgi?id=162832
1540
1541         Reviewed by Simon Fraser.
1542
1543         List item markers are inserted into the tree during layout, right before laying out
1544         the list item (that's a big FIXME). At this point we already know what part of the tree
1545         needs to be laid out. Inserting a list item marker does not expand this dirty area.
1546         However whenever we insert a new renderer into the tree, we call setNeedsLayout on the contining block chain.
1547         In certain cases (floating renderers), it could potentially trigger some unintentional markings
1548         and we return from FrameView::layout() with a dirty subtree.
1549
1550         This patch preemptively marks the list item and its marker dirty so that
1551         when the marker is getting inserted into the tree, we stop the marking at the parent.
1552
1553         Not testable.
1554
1555         * rendering/RenderListItem.cpp:
1556         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
1557
1558 2016-10-03  Myles C. Maxfield  <mmaxfield@apple.com>
1559
1560         Implement rendering of font-variation-settings
1561         https://bugs.webkit.org/show_bug.cgi?id=162782
1562
1563         Reviewed by Zalan Bujtas.
1564
1565         (Re-landing after fixing tests.)
1566
1567         Because the heavy lifting for font-variation-settings is done by CoreText, 
1568         this patch is fairly minimal. It simply hooks up the CSS property to CoreText. 
1569
1570         There is an existing bug in CoreText where variations inside fonts do not 
1571         survive the addition of a cascade list. Therefore, FontPlatformData::ctFont() 
1572         needs to work around this (conditionally) by resupplying the variation at 
1573         the same time as the cascade list. The CoreText bug is <rdar://problem/28449441>. 
1574
1575         Tests: fast/text/variations/duplicate.html
1576                fast/text/variations/exist.html
1577                fast/text/variations/inheritance.html
1578                fast/text/variations/order.html
1579                fast/text/variations/outofbounds.html
1580
1581         * platform/graphics/FontCache.h:
1582         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1583         (WebCore::preparePlatformFont):
1584         (WebCore::fontWithFamily):
1585         (WebCore::FontCache::createFontPlatformData):
1586         (WebCore::FontCache::systemFallbackForCharacters):
1587         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1588         (WebCore::cascadeToLastResortAttributesDictionary):
1589         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
1590         (WebCore::FontPlatformData::ctFont):
1591         (WebCore::cascadeToLastResortFontDescriptor): Deleted.
1592         * platform/graphics/mac/FontCustomPlatformData.cpp:
1593         (WebCore::FontCustomPlatformData::fontPlatformData):
1594         * rendering/RenderThemeIOS.mm:
1595         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
1596
1597 2016-10-03  Alex Christensen  <achristensen@webkit.org>
1598
1599         URLParser should strip tabs at all locations
1600         https://bugs.webkit.org/show_bug.cgi?id=162836
1601
1602         Reviewed by Geoffrey Garen.
1603
1604         Covered by adding tabs to each location of each API test
1605         except tests that test the encoding of surrogate pairs,
1606         because inserting a tab between the pairs changes the encoding.
1607
1608         * platform/URLParser.cpp:
1609         (WebCore::URLParser::takesTwoAdvancesUntilEnd):
1610         (WebCore::URLParser::parse):
1611         (WebCore::URLParser::parseIPv4Number):
1612         (WebCore::URLParser::parseIPv4Host):
1613         * platform/URLParser.h:
1614
1615 2016-10-03  Antti Koivisto  <antti@apple.com>
1616
1617         Remove Document::elementSheet()
1618         https://bugs.webkit.org/show_bug.cgi?id=162876
1619
1620         Reviewed by Andreas Kling.
1621
1622         This is a Document owned stylesheet that exists as a context for parsing element inline style.
1623         It never contains any rules and is generally confusing.
1624
1625         This patch removes the requirement for a stylesheet to be present for CSSParser to operate in
1626         the correct context. Inline style is now parsed without stylesheet and a context object is
1627         passed instead.
1628
1629         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1630         (WebCore::root):
1631         * bindings/js/JSCSSStyleDeclarationCustom.h:
1632         (WebCore::root): Deleted.
1633         * css/PropertySetCSSStyleDeclaration.cpp:
1634         (WebCore::PropertySetCSSStyleDeclaration::setCssText):
1635         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
1636         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
1637         (WebCore::PropertySetCSSStyleDeclaration::cssParserContext):
1638         (WebCore::StyleRuleCSSStyleDeclaration::parentStyleSheet):
1639         (WebCore::StyleRuleCSSStyleDeclaration::cssParserContext):
1640         (WebCore::InlineCSSStyleDeclaration::parentStyleSheet):
1641         (WebCore::InlineCSSStyleDeclaration::cssParserContext):
1642         * css/PropertySetCSSStyleDeclaration.h:
1643         (WebCore::PropertySetCSSStyleDeclaration::didMutate): Deleted.
1644         * css/StyleProperties.cpp:
1645         (WebCore::MutableStyleProperties::setProperty):
1646         (WebCore::MutableStyleProperties::setCustomProperty):
1647         (WebCore::MutableStyleProperties::parseDeclaration):
1648         * css/parser/CSSParser.cpp:
1649         (WebCore::CSSParser::parseValue):
1650         (WebCore::CSSParser::parseCustomPropertyValue):
1651         (WebCore::CSSParser::parseInlineStyleDeclaration):
1652         * css/parser/CSSParser.h:
1653         * css/parser/CSSParserImpl.cpp:
1654         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
1655         * dom/Document.cpp:
1656         (WebCore::Document::~Document):
1657         (WebCore::Document::updateBaseURL):
1658         (WebCore::Document::usesStyleBasedEditability):
1659         (WebCore::Document::setHasElementUsingStyleBasedEditability):
1660         (WebCore::Document::elementSheet): Deleted.
1661         * dom/Document.h:
1662         * dom/StyledElement.cpp:
1663         (WebCore::StyledElement::setInlineStyleFromString):
1664         (WebCore::StyledElement::invalidateStyleAttribute):
1665
1666             The usesStyleBasedEditability bit used to be set via the elementSheet. Instead check for it after inline style mutations.
1667
1668         (WebCore::StyledElement::setInlineStyleProperty):
1669         (WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
1670         * dom/StyledElement.h:
1671         (WebCore::StyledElement::invalidateStyleAttribute): Deleted.
1672         * inspector/InspectorStyleSheet.cpp:
1673         (WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
1674         * svg/SVGAnimateElementBase.cpp:
1675         (WebCore::applyCSSPropertyToTarget):
1676
1677 2016-10-03  Brent Fulgham  <bfulgham@apple.com>
1678
1679         Avoid null dereference when changing focus in design mode.
1680         https://bugs.webkit.org/show_bug.cgi?id=162877
1681         <rdar://problem/28061261>
1682
1683         Reviewed by Chris Dumez.
1684
1685         The bare m_frame pointer in DOMWindow can be cleared when setting focus to a new element. Check
1686         that the m_frame pointer is non-null before using it after calling a routine that could
1687         clear the pointer value.
1688
1689         Test: fast/frames/iframe-focus-crash.html
1690
1691         * page/DOMWindow.cpp:
1692         (WebCore::DOMWindow::focus): Check that the pointer is still non-null after setting the
1693         current focused element to nullptr.
1694
1695 2016-10-03  Chris Dumez  <cdumez@apple.com>
1696
1697         Add support for KeyboardEvent.key attribute
1698         https://bugs.webkit.org/show_bug.cgi?id=36267
1699
1700         Reviewed by Darin Adler.
1701
1702         Add support for KeyboardEvent.key attribute:
1703         - https://w3c.github.io/uievents/#dom-keyboardevent-key
1704
1705         This is behind a compile time flag that is only enabled on Mac and
1706         iOS and the implementation is still missing for other platforms.
1707
1708         Test: fast/events/keyboardevent-key.html
1709
1710         * dom/KeyboardEvent.cpp:
1711         (WebCore::KeyboardEvent::KeyboardEvent):
1712         * dom/KeyboardEvent.h:
1713         * dom/KeyboardEvent.idl:
1714         * platform/PlatformKeyboardEvent.h:
1715         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1716         (WebCore::PlatformKeyboardEvent::key):
1717         * platform/cocoa/KeyEventCocoa.h:
1718         * platform/cocoa/KeyEventCocoa.mm:
1719         (WebCore::keyForCharCode):
1720         * platform/ios/PlatformEventFactoryIOS.h:
1721         * platform/ios/PlatformEventFactoryIOS.mm:
1722         (WebCore::keyForKeyEvent):
1723         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
1724         * platform/mac/PlatformEventFactoryMac.h:
1725         * platform/mac/PlatformEventFactoryMac.mm:
1726         (WebCore::keyForKeyEvent):
1727         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
1728         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
1729         * replay/SerializationMethods.cpp:
1730         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
1731         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
1732
1733 2016-10-03  Chris Dumez  <cdumez@apple.com>
1734
1735         Add support for KeyboardEvent.key attribute
1736         https://bugs.webkit.org/show_bug.cgi?id=36267
1737
1738         Reviewed by Darin Adler.
1739
1740         Add support for KeyboardEvent.key attribute:
1741         - https://w3c.github.io/uievents/#dom-keyboardevent-key
1742
1743         This is behind a compile time flag that is only enabled on Mac and
1744         iOS and the implementation is still missing for other platforms.
1745
1746         Test: fast/events/keyboardevent-key.html
1747
1748         * dom/KeyboardEvent.cpp:
1749         (WebCore::KeyboardEvent::KeyboardEvent):
1750         * dom/KeyboardEvent.h:
1751         * dom/KeyboardEvent.idl:
1752         * platform/PlatformKeyboardEvent.h:
1753         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1754         (WebCore::PlatformKeyboardEvent::key):
1755         * platform/cocoa/KeyEventCocoa.h:
1756         * platform/cocoa/KeyEventCocoa.mm:
1757         (WebCore::keyForCharCode):
1758         * platform/ios/PlatformEventFactoryIOS.h:
1759         * platform/ios/PlatformEventFactoryIOS.mm:
1760         (WebCore::keyForKeyEvent):
1761         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
1762         * platform/mac/PlatformEventFactoryMac.h:
1763         * platform/mac/PlatformEventFactoryMac.mm:
1764         (WebCore::keyForKeyEvent):
1765         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
1766         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
1767         * replay/SerializationMethods.cpp:
1768         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
1769         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
1770
1771 2016-10-03  Alex Christensen  <achristensen@webkit.org>
1772
1773         URLParser: fragment-only URLs relative to file URLs should just add a fragment
1774         https://bugs.webkit.org/show_bug.cgi?id=162871
1775
1776         Reviewed by Geoffrey Garen.
1777
1778         Covered by new API tests.
1779
1780         * platform/URLParser.cpp:
1781         (WebCore::URLParser::parse):
1782         Instead of adding ///# after copying the base URL to the query, just add an #.
1783
1784 2016-10-03  Antoine Quint  <graouts@apple.com>
1785
1786         [Modern Media Controls] LayoutItem and Button classes
1787         https://bugs.webkit.org/show_bug.cgi?id=162868
1788         <rdar://problem/28590166>
1789
1790         Reviewed by Dean Jackson.
1791
1792         We introduce the new Button class and its parent class LayoutItem. We will subclass Button
1793         a lot in coming patches, as it provides a way to create a button and provide a delegate to
1794         respond to UI events via the `uiDelegate` property. A Button extends a LayoutItem, another
1795         class that we'll subclass heavily in coming patches, which is simply a LayoutNode with a
1796         `layoutDelegate` which allows to set the node's `layoutTraits`, a bit-mask allowing to
1797         specify layout attributes such as the platform and playback styles. 
1798
1799         Tests: media/modern-media-controls/button/button.html
1800                media/modern-media-controls/layout-item/layout-item.html
1801
1802         * Modules/modern-media-controls/controls/button.css: Added.
1803         (button):
1804         * Modules/modern-media-controls/controls/button.js: Added.
1805         (Button):
1806         (Button.prototype.get enabled):
1807         (Button.prototype.set enabled):
1808         (Button.prototype.handleEvent):
1809         (Button.prototype._handleUIEvent):
1810         * Modules/modern-media-controls/controls/layout-item.js: Added.
1811         (LayoutItem.prototype.get layoutTraits):
1812         (LayoutItem):
1813
1814 2016-10-03  Andy Estes  <aestes@apple.com>
1815
1816         ASSERTION FAILED: url.containsOnlyASCII() in WebCore::checkEncodedString() when parsing an invalid CSS cursor URL
1817         https://bugs.webkit.org/show_bug.cgi?id=162763
1818         <rdar://problem/28572758>
1819
1820         Reviewed by Youenn Fablet.
1821
1822         CSSCursorImageValue copies the URL of its underlying CSSImageValue by using the
1823         ParsedURLString URL constructor on the String returned by CSSImageValue::url(). While
1824         CSSImageValues were always being constructed from a URL implicitly converted to a String,
1825         nothing ensured that the URL was valid. For invalid URLs, URL::string() returns the string
1826         it was constructed with, which might still represent a relative URL or contain non-ASCII
1827         characters, violating the preconditions of the ParsedURLString URL constructor and causing
1828         an assertion to fail in Debug builds.
1829
1830         Fix this by having CSSImageValue store its image URL using a WebCore::URL rather than a
1831         String. CSSCursorImageValue can then copy this URL instead of attempting to re-parse a
1832         possibly-invalid URL string.
1833
1834         Test: fast/css/cursor-with-invalid-url.html
1835
1836         * css/CSSCursorImageValue.cpp:
1837         (WebCore::CSSCursorImageValue::CSSCursorImageValue): Copied m_imageValue.url() into
1838         m_originalURL instead of using the ParsedURLString URL constructor, since
1839         CSSImageValue::url() now returns a WebCore::URL.
1840         (WebCore::CSSCursorImageValue::loadImage): Created a URL from cursorElement->href() by
1841         calling Document::completeURL().
1842         * css/CSSImageValue.cpp:
1843         (WebCore::CSSImageValue::CSSImageValue): Changed to take a URL&& instead of a const String&.
1844         (WebCore::CSSImageValue::loadImage): Stopped calling Document::completeURL(), since m_url is
1845         now a WebCore::URL.
1846         * css/CSSImageValue.h: Changed url() to return a const URL&, and changed m_url to be a URL.
1847         * html/HTMLBodyElement.cpp:
1848         (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): Removed a call to
1849         URL::string().
1850         * html/HTMLTableElement.cpp:
1851         (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): Ditto.
1852         * html/HTMLTablePartElement.cpp:
1853         (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): Ditto.
1854
1855 2016-10-03  Zalan Bujtas  <zalan@apple.com>
1856
1857         Log an error to stderr when FrameView::layout() fails to clean all the renderers.
1858         https://bugs.webkit.org/show_bug.cgi?id=162835
1859
1860         Reviewed by Simon Fraser.
1861
1862         We've come across multiple layout/painting bugs caused by renderers left dirty
1863         after FrameView::layout(). This patch helps catching such issues early.
1864         Once all the blocking bugs are fixed (webkit.org/b/162835), logging should be replaced with ASSERT(). 
1865
1866         Not testable.
1867
1868         * page/FrameView.cpp:
1869         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
1870         (WebCore::FrameView::layout):
1871
1872 2016-10-03  Brent Fulgham  <bfulgham@apple.com>
1873
1874         [Win][Direct2D] Add D2D Bitmap Image handling code
1875         https://bugs.webkit.org/show_bug.cgi?id=162761
1876
1877         Reviewed by Dean Jackson.
1878
1879         This patch lands a set of new files that implement
1880         Image and BitmapImage features on Windows using
1881         Direct2D.
1882
1883         The desired ID2D1RenderTarget handle is needed by the
1884         image decoder so that it can load the resulting bitmap
1885         into the GPU.
1886
1887         No new tests until complete backend lands.
1888
1889         * platform/graphics/BitmapImage.cpp:
1890         (WebCore::BitmapImage::draw): Tell the Direct2D image decoder
1891         which render target to use.
1892         * platform/graphics/BitmapImage.h:
1893         * platform/graphics/ImageBuffer.cpp:
1894         * platform/graphics/ImageBuffer.h:
1895         * platform/graphics/ImageBufferData.h:
1896         * platform/graphics/ImageFrameCache.cpp:
1897         (WebCore::ImageFrameCache::setRenderTarget): Added.
1898         * platform/graphics/ImageFrameCache.h:
1899         (WebCore::ImageFrameCache::decoder): Added.
1900         * platform/graphics/ImageSource.cpp:
1901         * platform/graphics/ImageSource.h:
1902         (WebCore::ImageSource::setRenderTarget):
1903         * platform/graphics/win/ImageBufferDataDirect2D.cpp: Added.
1904         * platform/graphics/win/ImageBufferDataDirect2D.h: Added.
1905         * platform/graphics/win/ImageBufferDirect2D.cpp: Added.
1906         * platform/graphics/win/ImageCGWin.cpp:
1907         * platform/graphics/win/ImageDecoderDirect2D.cpp: Added.
1908         * platform/graphics/win/ImageDecoderDirect2D.h: Added.
1909         * platform/graphics/win/ImageDirect2D.cpp: Added.
1910         * platform/graphics/win/NativeImageDirect2D.cpp: Added.
1911
1912 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1913
1914         [SOUP] Remove unused methods toSoupMessage from ResourceRequest/Response
1915         https://bugs.webkit.org/show_bug.cgi?id=162867
1916
1917         Reviewed by Sergio Villar Senin.
1918
1919         * platform/network/soup/ResourceRequest.h:
1920         * platform/network/soup/ResourceRequestSoup.cpp:
1921         (WebCore::ResourceRequest::updateSoupMessage):
1922         (WebCore::ResourceRequest::updateFromSoupMessage): Deleted.
1923         * platform/network/soup/ResourceResponse.h:
1924         * platform/network/soup/ResourceResponseSoup.cpp:
1925         (WebCore::ResourceResponse::updateFromSoupMessage): Deleted.
1926
1927 2016-10-03  Youenn Fablet  <youenn@apple.com>
1928
1929         Remove FetchBody::m_isEmpty
1930         https://bugs.webkit.org/show_bug.cgi?id=162857
1931
1932         Reviewed by Alex Christensen.
1933
1934         No change of behavior.
1935
1936         Moving handling of null bodies in FetchBodyOwner, by having an Optional<FetchBody> in FetchBodyOwner.
1937         Moving storage of m_contentType in FetchBodyOwner.
1938
1939         Moving header storage from FetchResponse/FetchRequest to FetchBodyOwner, as it helps updating m_contentType.
1940
1941         * Modules/fetch/FetchBody.cpp: removing m_isEmpty and m_contentType.
1942         (WebCore::FetchBody::extract): Computes the default content-type which is stored in FetchBodyOwner.
1943         (WebCore::FetchBody::blob):
1944         (WebCore::FetchBody::consume):
1945         (WebCore::FetchBody::consumeAsStream):
1946         (WebCore::FetchBody::loadingSucceeded):
1947         (WebCore::FetchBody::bodyForInternalRequest):
1948         (WebCore::FetchBody::clone):
1949         * Modules/fetch/FetchBody.h:
1950         (WebCore::FetchBody::loadingBody):
1951         (WebCore::FetchBody::FetchBody):
1952         * Modules/fetch/FetchBodyOwner.cpp:
1953         (WebCore::FetchBodyOwner::FetchBodyOwner):
1954         (WebCore::FetchBodyOwner::stop):
1955         (WebCore::FetchBodyOwner::arrayBuffer):
1956         (WebCore::FetchBodyOwner::blob):
1957         (WebCore::FetchBodyOwner::cloneBody): Needs to clone m_contentType as well.
1958         (WebCore::FetchBodyOwner::extractBody):
1959         (WebCore::FetchBodyOwner::updateContentType):
1960         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
1961         (WebCore::FetchBodyOwner::formData):
1962         (WebCore::FetchBodyOwner::json):
1963         (WebCore::FetchBodyOwner::text):
1964         (WebCore::FetchBodyOwner::loadBlob):
1965         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
1966         (WebCore::FetchBodyOwner::blobLoadingFailed):
1967         (WebCore::FetchBodyOwner::finishBlobLoading):
1968         * Modules/fetch/FetchBodyOwner.h:
1969         (WebCore::FetchBodyOwner::body):
1970         (WebCore::FetchBodyOwner::isBodyNull):
1971         * Modules/fetch/FetchRequest.cpp:
1972         (WebCore::FetchRequest::setBody):
1973         (WebCore::FetchRequest::internalRequest):
1974         (WebCore::FetchRequest::clone):
1975         * Modules/fetch/FetchRequest.h:
1976         (WebCore::FetchRequest::FetchRequest):
1977         * Modules/fetch/FetchResponse.cpp:
1978         (WebCore::FetchResponse::initializeWith):
1979         (WebCore::FetchResponse::FetchResponse):
1980         (WebCore::FetchResponse::cloneForJS):
1981         (WebCore::FetchResponse::fetch):
1982         (WebCore::FetchResponse::BodyLoader::didSucceed):
1983         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
1984         (WebCore::FetchResponse::BodyLoader::start):
1985         (WebCore::FetchResponse::createReadableStreamSource):
1986         * Modules/fetch/FetchResponse.h:
1987
1988 2016-10-03  Andy Estes  <aestes@apple.com>
1989
1990         ASSERTION FAILED: result in WebCore::CSSParser::parseURI
1991         https://bugs.webkit.org/show_bug.cgi?id=141638
1992         <rdar://problem/27709952>
1993
1994         Reviewed by Andreas Kling.
1995
1996         CSSParser::parseURIInternal() failed to parse unquoted URLs with Unicode escape sequences
1997         greater than 0xFF, even when the destination character type was multi-byte. Fixed by
1998         checking the size of DestCharacterType instead of SrcCharacterType.
1999
2000         Updated fast/css/url-with-multi-byte-unicode-escape.html to test for an unquoted URL.
2001
2002         * css/parser/CSSParser.cpp:
2003         (WebCore::CSSParser::parseURIInternal): For code points greater than 0xFF, only returned
2004         false if sizeof(DestCharacterType) == 1.
2005
2006 2016-10-03  Alex Christensen  <achristensen@webkit.org>
2007
2008         URLParser: empty relative URLs should not copy fragment from the base URL
2009         https://bugs.webkit.org/show_bug.cgi?id=162864
2010
2011         Reviewed by Chris Dumez.
2012
2013         Covered by new API tests.
2014
2015         * platform/URL.cpp:
2016         (WebCore::URL::removeFragmentIdentifier):
2017         Optimize removing fragments, now that it happens more often. We don't need to reparse, 
2018         because the result will always be equal to just a substring when removing the fragment at the end.
2019         * platform/URLParser.cpp:
2020         (WebCore::URLParser::copyASCIIStringUntil):
2021         (WebCore::URLParser::copyURLPartsUntil):
2022         (WebCore::containsOnlyC0ControlOrSpace):
2023         (WebCore::URLParser::URLParser):
2024         (WebCore::URLParser::parse):
2025         * platform/URLParser.h:
2026         Because we are not copying the fragment, we can simplify and remove some unreachable code.
2027
2028 2016-10-03  Chris Dumez  <cdumez@apple.com>
2029
2030         td.scope should only return known values
2031         https://bugs.webkit.org/show_bug.cgi?id=162755
2032
2033         Reviewed by Sam Weinig.
2034
2035         td.scope should only return known values:
2036         - https://html.spec.whatwg.org/#dom-th-scope
2037
2038         Firefox conforms to the specification.
2039
2040         No new tests, rebaselined existing test.
2041
2042         * html/HTMLTableCellElement.cpp:
2043         (WebCore::HTMLTableCellElement::scope):
2044
2045 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2046
2047         [SOUP] Simplify AuthenticationChallenge
2048         https://bugs.webkit.org/show_bug.cgi?id=162784
2049
2050         Reviewed by Alex Christensen.
2051
2052         We don't really need to keep references to the SoupSession and SoupMessage in AuthenticationChallenge, the
2053         SoupNetworkSession callback already forwards the challenge to the right ResourceHandle.
2054
2055         * platform/network/soup/AuthenticationChallenge.h:
2056         (WebCore::AuthenticationChallenge::authenticationClient):
2057         (WebCore::AuthenticationChallenge::soupSession): Deleted.
2058         (WebCore::AuthenticationChallenge::soupMessage): Deleted.
2059         * platform/network/soup/AuthenticationChallengeSoup.cpp:
2060         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2061         (WebCore::AuthenticationChallenge::platformCompare):
2062         * platform/network/soup/ResourceHandleSoup.cpp:
2063         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
2064         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2065         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
2066         (WebCore::ResourceHandle::receivedCredential):
2067         (WebCore::ResourceHandle::receivedCancellation):
2068         * platform/network/soup/SoupNetworkSession.cpp:
2069         (WebCore::authenticateCallback):
2070
2071 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2072
2073         [SOUP] Cleanup persistent credential storage code
2074         https://bugs.webkit.org/show_bug.cgi?id=162777
2075
2076         Reviewed by Alex Christensen.
2077
2078         We have this feature behind ENABLE_CREDENTIAL_STORAGE flag, which is confusing, because we use credential
2079         storage unconditionally and this is only about persistent storage. Also the flag assumes libsecret is available,
2080         and since it's only used by GTK sometimes we use GTK ifdefs instead of CREDENTIAL_STORAGE. So, I think we should
2081         use USE(LIBSECRET) instead, and reduce a bit the ifdefs in common soup code. Another problem is that current
2082         implementation is always used, while it should depend on the current network storage session and never used in
2083         ephemeral sessions. This patch moves the code from CredentialBackingStore to NetworkStorageSessionSoup and
2084         modernizes a bit.
2085
2086         * PlatformGTK.cmake: Remove CredentialBackingStore.cpp.
2087         * platform/gtk/GRefPtrGtk.cpp: Use USE(LIBSECRET)
2088         * platform/gtk/GRefPtrGtk.h:
2089         * platform/network/NetworkStorageSession.h:
2090         * platform/network/ResourceHandleInternal.h:
2091         * platform/network/gtk/CredentialBackingStore.cpp: Removed.
2092         * platform/network/gtk/CredentialBackingStore.h: Removed.
2093         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2094         (WebCore::NetworkStorageSession::~NetworkStorageSession):
2095         (WebCore::schemeFromProtectionSpaceServerType):
2096         (WebCore::authTypeFromProtectionSpaceAuthenticationScheme):
2097         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2098         (WebCore::NetworkStorageSession::saveCredentialToPersistentStorage):
2099         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted.
2100         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2101         * platform/network/soup/ResourceHandleSoup.cpp:
2102         (WebCore::gotHeadersCallback):
2103         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2104         (WebCore::ResourceHandle::receivedCredential):
2105         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge): Deleted.
2106         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): Deleted.
2107         (WebCore::ResourceHandle::receivedCancellation): Deleted.
2108
2109 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2110
2111         Unreviewed. Fix the build with coordinated graphics enabled after r206712.
2112
2113         * page/scrolling/ScrollingStateTree.cpp:
2114         (WebCore::ScrollingStateTree::attachNode):
2115
2116 2016-10-02  Chris Dumez  <cdumez@apple.com>
2117
2118         Add support for KeyboardEvent.getModifierState() operation
2119         https://bugs.webkit.org/show_bug.cgi?id=162855
2120
2121         Reviewed by Darin Adler.
2122
2123         Add support for KeyboardEvent.getModifierState() operation:
2124         - https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
2125
2126         Test: fast/events/constructors/keyboard-event-getModifierState.html
2127
2128         * dom/KeyboardEvent.cpp:
2129         (WebCore::KeyboardEvent::getModifierState):
2130         * dom/KeyboardEvent.idl:
2131
2132 2016-10-02  Chris Dumez  <cdumez@apple.com>
2133
2134         Add support for KeyboardEvent.repeat attribute
2135         https://bugs.webkit.org/show_bug.cgi?id=162854
2136
2137         Reviewed by Darin Adler.
2138
2139         Add support for KeyboardEvent.repeat attribute:
2140         - https://w3c.github.io/uievents/#dom-keyboardevent-repeat
2141
2142         No new tests, extended existing test.
2143
2144         * dom/KeyboardEvent.cpp:
2145         (WebCore::KeyboardEvent::KeyboardEvent):
2146         * dom/KeyboardEvent.h:
2147         * dom/KeyboardEvent.idl:
2148
2149 2016-10-02  Darin Adler  <darin@apple.com>
2150
2151         Rename ExceptionCode-based exception handling to "legacy"
2152         https://bugs.webkit.org/show_bug.cgi?id=162859
2153
2154         Reviewed by Chris Dumez.
2155
2156         RaisesException is now MayThrowLegacyException.
2157
2158         A follow-up patch soon will add MayThrowException for the new style,
2159         where we use ExceptionOr<> as the return type instead of an ExceptionCode
2160         out argument.
2161
2162         * bindings/scripts/CodeGeneratorJS.pm:
2163         Removed the quotation marks from the syntax object->{PropertyName} so the
2164         renaming script could handle it. Tweaked various comments and logic for clarity.
2165         Changed to use the perl "x if y" syntax for brevity in many places.
2166         Renamed with the script and by hand. Added code to skip including the same header
2167         in both the implementation file and the header, just to make generated bindings
2168         slightly smaller and faster to compile. Used "using" instead of "typedef".
2169
2170         * bindings/scripts/IDLAttributes.txt: Updated from old names to new ones.
2171
2172         * Modules/applepay/ApplePaySession.idl:
2173         * Modules/encryptedmedia/MediaKeySession.idl:
2174         * Modules/encryptedmedia/MediaKeys.idl:
2175         * Modules/fetch/FetchHeaders.idl:
2176         * Modules/fetch/FetchRequest.idl:
2177         * Modules/fetch/FetchResponse.idl:
2178         * Modules/indexeddb/IDBCursor.idl:
2179         * Modules/indexeddb/IDBDatabase.idl:
2180         * Modules/indexeddb/IDBFactory.idl:
2181         * Modules/indexeddb/IDBIndex.idl:
2182         * Modules/indexeddb/IDBKeyRange.idl:
2183         * Modules/indexeddb/IDBObjectStore.idl:
2184         * Modules/indexeddb/IDBRequest.idl:
2185         * Modules/indexeddb/IDBTransaction.idl:
2186         * Modules/mediasource/MediaSource.idl:
2187         * Modules/mediasource/SourceBuffer.idl:
2188         * Modules/mediastream/MediaDevices.idl:
2189         * Modules/mediastream/RTCDTMFSender.idl:
2190         * Modules/mediastream/RTCDataChannel.idl:
2191         * Modules/mediastream/RTCIceCandidate.idl:
2192         * Modules/mediastream/RTCPeerConnection.idl:
2193         * Modules/mediastream/RTCRtpSender.idl:
2194         * Modules/mediastream/RTCSessionDescription.idl:
2195         * Modules/navigatorcontentutils/NavigatorContentUtils.idl:
2196         * Modules/notifications/NotificationCenter.idl:
2197         * Modules/webaudio/AnalyserNode.idl:
2198         * Modules/webaudio/AudioBuffer.idl:
2199         * Modules/webaudio/AudioBufferSourceNode.idl:
2200         * Modules/webaudio/AudioContext.idl:
2201         * Modules/webaudio/AudioNode.idl:
2202         * Modules/webaudio/ConvolverNode.idl:
2203         * Modules/webaudio/OfflineAudioContext.idl:
2204         * Modules/webaudio/OscillatorNode.idl:
2205         * Modules/webdatabase/DOMWindowWebDatabase.idl:
2206         * Modules/webdatabase/SQLResultSet.idl:
2207         * Modules/websockets/WebSocket.idl:
2208         * bindings/scripts/test/TestImplements.idl:
2209         * bindings/scripts/test/TestInterface.idl:
2210         * bindings/scripts/test/TestNamedConstructor.idl:
2211         * bindings/scripts/test/TestNondeterministic.idl:
2212         * bindings/scripts/test/TestObj.idl:
2213         * bindings/scripts/test/TestSupplemental.idl:
2214         * bindings/scripts/test/TestTypedefs.idl:
2215         * css/CSSCharsetRule.idl:
2216         * css/CSSMediaRule.idl:
2217         * css/CSSPrimitiveValue.idl:
2218         * css/CSSRule.idl:
2219         * css/CSSStyleDeclaration.idl:
2220         * css/CSSStyleSheet.idl:
2221         * css/CSSSupportsRule.idl:
2222         * css/CSSValue.idl:
2223         * css/FontFace.idl:
2224         * css/FontFaceSet.idl:
2225         * css/MediaList.idl:
2226         * css/WebKitCSSMatrix.idl:
2227         * dom/CharacterData.idl:
2228         * dom/ChildNode.idl:
2229         * dom/CustomElementRegistry.idl:
2230         * dom/DataTransferItemList.idl:
2231         * dom/Document.idl:
2232         * dom/Element.idl:
2233         * dom/EventTarget.idl:
2234         * dom/MessagePort.idl:
2235         * dom/MutationObserver.idl:
2236         * dom/NamedNodeMap.idl:
2237         * dom/Node.idl:
2238         * dom/ParentNode.idl:
2239         * dom/Range.idl:
2240         * dom/ShadowRoot.idl:
2241         * dom/Text.idl:
2242         * fileapi/FileReader.idl:
2243         * fileapi/FileReaderSync.idl:
2244         * html/DOMTokenList.idl:
2245         * html/DOMURL.idl:
2246         * html/HTMLCanvasElement.idl:
2247         * html/HTMLElement.idl:
2248         * html/HTMLEmbedElement.idl:
2249         * html/HTMLFrameElement.idl:
2250         * html/HTMLIFrameElement.idl:
2251         * html/HTMLInputElement.idl:
2252         * html/HTMLMarqueeElement.idl:
2253         * html/HTMLMediaElement.idl:
2254         * html/HTMLObjectElement.idl:
2255         * html/HTMLOptionElement.idl:
2256         * html/HTMLOptionsCollection.idl:
2257         * html/HTMLProgressElement.idl:
2258         * html/HTMLSelectElement.idl:
2259         * html/HTMLTableElement.idl:
2260         * html/HTMLTableRowElement.idl:
2261         * html/HTMLTableSectionElement.idl:
2262         * html/HTMLTextAreaElement.idl:
2263         * html/HTMLVideoElement.idl:
2264         * html/ImageData.idl:
2265         * html/MediaController.idl:
2266         * html/TimeRanges.idl:
2267         * html/URLUtils.idl:
2268         * html/canvas/CanvasGradient.idl:
2269         * html/canvas/CanvasPath.idl:
2270         * html/canvas/CanvasRenderingContext2D.idl:
2271         * html/canvas/OESVertexArrayObject.idl:
2272         * html/canvas/WebGLRenderingContextBase.idl:
2273         * html/track/DataCue.idl:
2274         * html/track/TextTrack.idl:
2275         * html/track/TextTrackCue.idl:
2276         * html/track/VTTCue.idl:
2277         * html/track/VTTRegion.idl:
2278         * loader/appcache/DOMApplicationCache.idl:
2279         * page/Crypto.idl:
2280         * page/DOMSelection.idl:
2281         * page/DOMWindow.idl:
2282         * page/EventSource.idl:
2283         * page/History.idl:
2284         * page/Location.idl:
2285         * page/Performance.idl:
2286         * page/UserMessageHandler.idl:
2287         * page/WindowOrWorkerGlobalScope.idl:
2288         * storage/Storage.idl:
2289         * svg/SVGAltGlyphElement.idl:
2290         * svg/SVGAngle.idl:
2291         * svg/SVGAnimatedBoolean.idl:
2292         * svg/SVGAnimatedEnumeration.idl:
2293         * svg/SVGAnimatedInteger.idl:
2294         * svg/SVGAnimatedNumber.idl:
2295         * svg/SVGAnimatedString.idl:
2296         * svg/SVGAnimationElement.idl:
2297         * svg/SVGColor.idl:
2298         * svg/SVGGlyphRefElement.idl:
2299         * svg/SVGGraphicsElement.idl:
2300         * svg/SVGLength.idl:
2301         * svg/SVGLengthList.idl:
2302         * svg/SVGMatrix.idl:
2303         * svg/SVGNumberList.idl:
2304         * svg/SVGPaint.idl:
2305         * svg/SVGPathSegList.idl:
2306         * svg/SVGPointList.idl:
2307         * svg/SVGPreserveAspectRatio.idl:
2308         * svg/SVGStringList.idl:
2309         * svg/SVGStyleElement.idl:
2310         * svg/SVGTextContentElement.idl:
2311         * svg/SVGTransformList.idl:
2312         * svg/SVGViewSpec.idl:
2313         * testing/InternalSettings.idl:
2314         * testing/Internals.idl:
2315         * workers/DedicatedWorkerGlobalScope.idl:
2316         * workers/Worker.idl:
2317         * xml/DOMParser.idl:
2318         * xml/XMLHttpRequest.idl:
2319         * xml/XPathEvaluator.idl:
2320         * xml/XPathExpression.idl:
2321         * xml/XPathResult.idl:
2322         Allowed the rename script to rename the exception-related extended attributes.
2323
2324         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2325         * bindings/scripts/test/JS/JSInterfaceName.h:
2326         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2327         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2328         * bindings/scripts/test/JS/JSTestCallback.cpp:
2329         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2330         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2331         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2332         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2333         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2334         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2335         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2336         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2337         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2338         * bindings/scripts/test/JS/JSTestEventTarget.h:
2339         * bindings/scripts/test/JS/JSTestException.cpp:
2340         * bindings/scripts/test/JS/JSTestException.h:
2341         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2342         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2343         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2344         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2345         * bindings/scripts/test/JS/JSTestInterface.cpp:
2346         * bindings/scripts/test/JS/JSTestInterface.h:
2347         * bindings/scripts/test/JS/JSTestIterable.cpp:
2348         * bindings/scripts/test/JS/JSTestIterable.h:
2349         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2350         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
2351         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2352         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2353         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2354         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2355         * bindings/scripts/test/JS/JSTestNode.cpp:
2356         * bindings/scripts/test/JS/JSTestNode.h:
2357         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2358         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2359         * bindings/scripts/test/JS/JSTestObj.cpp:
2360         * bindings/scripts/test/JS/JSTestObj.h:
2361         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2362         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2363         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2364         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
2365         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2366         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2367         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2368         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2369         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2370         * bindings/scripts/test/JS/JSTestTypedefs.h:
2371         * bindings/scripts/test/JS/JSattribute.cpp:
2372         * bindings/scripts/test/JS/JSattribute.h:
2373         * bindings/scripts/test/JS/JSreadonly.cpp:
2374         * bindings/scripts/test/JS/JSreadonly.h:
2375         Regenerated.
2376
2377
2378 2016-10-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2379
2380         Media controls for Soundcloud easily falls out of sync with what's actually playing
2381         https://bugs.webkit.org/show_bug.cgi?id=162843
2382         <rdar://problem/28176874>
2383
2384         Reviewed by Beth Dakin.
2385
2386         Currently, audio elements are subject to the same main content restrictions as video elements. This is
2387         problematic on sites where audio elements are really the main content, such as soundcloud. We need a different
2388         heuristic for determining whether audio elements such as these should be allowed to show playback controls.
2389
2390         Furthermore, we currently forbid autoplaying audio from showing controls if it has user gesture restrictions
2391         (i.e. it started playing via script). This is, again, problematic on sites where audio elements are played one
2392         after another (such as on soundcloud). Even though a subsequent audio element may have been triggered via
2393         script, we might want still want to show controls for it if the user has explicitly triggered other elements on
2394         the page to begin playing. However, if the user has not gestured on any media in the page, we still should not
2395         show controls for audio elements that begin playing via script.
2396
2397         Adds two new unit tests to TestWebKitAPI simulating audio playback behavior on soundcloud.
2398
2399         * html/MediaElementSession.cpp:
2400         (WebCore::MediaElementSession::removeBehaviorRestriction):
2401         (WebCore::MediaElementSession::canShowControlsManager):
2402         (WebCore::MediaElementSession::allowsPlaybackControlsForAutoplayingAudio):
2403         * html/MediaElementSession.h:
2404         * page/Page.h:
2405         (WebCore::Page::allowsPlaybackControlsForAutoplayingAudio):
2406         (WebCore::Page::setAllowsPlaybackControlsForAutoplayingAudio):
2407
2408 2016-10-02  Ryan Haddad  <ryanhaddad@apple.com>
2409
2410         Unreviewed, rolling out r206683.
2411
2412         This change caused API test WebKit2.FindMatches to fail on
2413         Mac.
2414
2415         Reverted changeset:
2416
2417         "The dragged image should be the current frame only of the
2418         animated image"
2419         https://bugs.webkit.org/show_bug.cgi?id=162109
2420         http://trac.webkit.org/changeset/206683
2421
2422 2016-10-02  Chris Dumez  <cdumez@apple.com>
2423
2424         Unreviewed, rolling out r206692 and r206718.
2425
2426         Seems to have caused >200 failures on Sierra
2427
2428         Reverted changesets:
2429
2430         "Implement rendering of font-variation-settings"
2431         https://bugs.webkit.org/show_bug.cgi?id=162782
2432         http://trac.webkit.org/changeset/206692
2433
2434         "Tried to fix the build after r206692."
2435         http://trac.webkit.org/changeset/206718
2436
2437 2016-10-02  Dan Bernstein  <mitz@apple.com>
2438
2439         Tried to fix the build after r206692.
2440
2441         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2442         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
2443
2444 2016-10-02  Commit Queue  <commit-queue@webkit.org>
2445
2446         Unreviewed, rolling out r206716.
2447         https://bugs.webkit.org/show_bug.cgi?id=162858
2448
2449         It is breaking Mac CMake Debug build (Requested by youenn on
2450         #webkit).
2451
2452         Reverted changeset:
2453
2454         "[Fetch API] Forbid redirection to non-HTTP(s) URL in non-
2455         navigation mode."
2456         https://bugs.webkit.org/show_bug.cgi?id=162785
2457         http://trac.webkit.org/changeset/206716
2458
2459 2016-10-02  Youenn Fablet  <youenn@apple.com>
2460
2461         [Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
2462         https://bugs.webkit.org/show_bug.cgi?id=162785
2463
2464         Reviewed by Alex Christensen.
2465
2466         Covered by rebased and existing tests.
2467
2468         Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
2469         This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
2470
2471         Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
2472         This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
2473         But they are not allowed for same-origin redirected requests.
2474
2475         * WebCore.xcodeproj/project.pbxproj:
2476         * loader/DocumentThreadableLoader.cpp:
2477         (WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
2478         (WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
2479         * loader/SubresourceLoader.cpp:
2480         (WebCore::SubresourceLoader::willSendRequestInternal):
2481         * loader/cache/CachedResourceLoader.cpp:
2482         (WebCore::CachedResourceLoader::requestImage):
2483         (WebCore::CachedResourceLoader::checkInsecureContent):
2484         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
2485         (WebCore::isSameOriginDataURL):
2486         (WebCore::CachedResourceLoader::canRequest):
2487         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
2488         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
2489         (WebCore::CachedResourceLoader::requestResource):
2490         * loader/cache/CachedResourceLoader.h:
2491
2492 2016-10-01  Simon Fraser  <simon.fraser@apple.com>
2493
2494         Support transitions/animations of background-position with right/bottom-relative values
2495         https://bugs.webkit.org/show_bug.cgi?id=162048
2496
2497         Reviewed by Dean Jackson.
2498         
2499         Make transitions between "background-position: 10px 20px" and "background-position: right 10px bottom 20px"
2500         work. We do this by by converting "right 10px" to "calc(100% - 10px)" when blending.
2501         
2502         Also improve logging of calculated lengths, and better animation logging for FillLayer properties.
2503
2504         Test: transitions/background-position-transitions.html
2505
2506         * page/animation/CSSPropertyAnimation.cpp:
2507         (WebCore::FillLayerAnimationPropertyWrapperBase::FillLayerAnimationPropertyWrapperBase): Keep the propertyID
2508         around so logging can use it.
2509         (WebCore::FillLayerAnimationPropertyWrapperBase::property):
2510         (WebCore::FillLayerPropertyWrapperGetter::FillLayerPropertyWrapperGetter):
2511         (WebCore::FillLayerPropertyWrapperGetter::value):
2512         (WebCore::FillLayerPropertyWrapper::FillLayerPropertyWrapper):
2513         (WebCore::createCalculatedLength):
2514         (WebCore::FillLayerPositionPropertyWrapper::FillLayerPositionPropertyWrapper):
2515         (WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
2516         (WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
2517         (WebCore::FillLayersPropertyWrapper::FillLayersPropertyWrapper):
2518         (WebCore::CSSPropertyAnimation::blendProperties): Blend then log, so that the logging
2519         can show the result.
2520         * platform/CalculationValue.cpp:
2521         (WebCore::CalcExpressionNumber::dump):
2522         (WebCore::CalcExpressionBinaryOperation::dump):
2523         (WebCore::CalcExpressionLength::dump):
2524         (WebCore::CalcExpressionBlendLength::dump):
2525         (WebCore::operator<<):
2526         * platform/CalculationValue.h:
2527         * platform/Length.cpp:
2528         (WebCore::operator<<):
2529
2530 2016-10-01  Simon Fraser  <simon.fraser@apple.com>
2531
2532         Bad cast when CSS position programmatically changed from -webkit-sticky to fixed
2533         https://bugs.webkit.org/show_bug.cgi?id=160826
2534
2535         Reviewed by Zalan Bujtas.
2536         
2537         If a scrolling state tree node changed type (e.g. from sticky to fixed), we'd fail
2538         to recreate the node so keep a node with the wrong type.
2539         
2540         Fix by destroying the node and making a new one with a new ID in this case. The
2541         new ID is necessary to ensure that the scrolling tree is updated.
2542
2543         Test: fast/scrolling/sticky-to-fixed.html
2544
2545         * page/scrolling/ScrollingStateTree.cpp:
2546         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch):
2547         (WebCore::ScrollingStateTree::attachNode):
2548         (WebCore::ScrollingStateTree::stateNodeForID):
2549         * page/scrolling/ScrollingStateTree.h:
2550
2551 2016-10-01  Youenn Fablet  <youenn@apple.com>
2552
2553         removing FetchBoyd::m_type
2554
2555         Remove FetchBody::m_type
2556         https://bugs.webkit.org/show_bug.cgi?id=162841
2557
2558         Reviewed by Sam Weinig.
2559
2560         No change of behavior.
2561
2562         Removing FetchBody::m_type and using m_data in lieu.
2563         Introducing temporarily FetchBody::m_isEmpty to handle the case of null bodies.
2564         Null body handling should be moved to FetchBodyOwner in a follow-up patch.
2565
2566         * Modules/fetch/FetchBody.cpp:
2567         (WebCore::FetchBody::FetchBody):
2568         (WebCore::FetchBody::extract):
2569         (WebCore::FetchBody::arrayBuffer):
2570         (WebCore::FetchBody::blob):
2571         (WebCore::FetchBody::json):
2572         (WebCore::FetchBody::text):
2573         (WebCore::FetchBody::consumeOnceLoadingFinished):
2574         (WebCore::FetchBody::consume):
2575         (WebCore::FetchBody::consumeAsStream):
2576         (WebCore::FetchBody::loadingSucceeded):
2577         (WebCore::FetchBody::bodyForInternalRequest):
2578         (WebCore::FetchBody::clone):
2579         (WebCore::FetchBody::consumeText): Deleted.
2580         (WebCore::FetchBody::consumeBlob): Deleted.
2581         * Modules/fetch/FetchBody.h:
2582         (WebCore::FetchBody::isEmpty):
2583         (WebCore::FetchBody::isBlob):
2584         (WebCore::FetchBody::isFormData):
2585         (WebCore::FetchBody::isArrayBuffer):
2586         (WebCore::FetchBody::isArrayBufferView):
2587         (WebCore::FetchBody::isURLSearchParams):
2588         (WebCore::FetchBody::isText):
2589         (WebCore::FetchBody::FetchBody):
2590         (WebCore::FetchBody::setContentType): Deleted.
2591         (WebCore::FetchBody::urlSearchParamsBody): Deleted.
2592         * Modules/fetch/FetchBodyOwner.cpp:
2593         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
2594         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
2595         (WebCore::FetchBodyOwner::finishBlobLoading): Deleted.
2596         * Modules/fetch/FetchBodyOwner.h:
2597         (WebCore::FetchBodyOwner::body): Deleted.
2598         * Modules/fetch/FetchRequest.cpp:
2599         (WebCore::FetchRequest::setBody):
2600         * Modules/fetch/FetchResponse.cpp:
2601         (WebCore::FetchResponse::fetch):
2602         (WebCore::FetchResponse::BodyLoader::didSucceed):
2603         (WebCore::FetchResponse::consume):
2604         (WebCore::FetchResponse::consumeBodyAsStream):
2605         (WebCore::FetchResponse::createReadableStreamSource):
2606         (WebCore::FetchResponse::finishConsumingStream): Deleted.
2607         * Modules/fetch/FetchResponse.h:
2608
2609 2016-09-30  David Kilzer  <ddkilzer@apple.com>
2610
2611         REGRESSION (r203424): WebCore::ImageBuffer::createCompatibleBuffer() in ImageBufferCG.cpp over-releases CGColorSpaceRef objects
2612         <https://webkit.org/b/162823>
2613         <rdar://problem/27723268>
2614
2615         Reviewed by Joseph Pecoraro.
2616
2617         Code is covered by existing tests, but no crashes have been
2618         observed in practice.  May require running one test multiple
2619         times to reproduce.
2620
2621         * platform/graphics/cg/ImageBufferCG.cpp:
2622         (WebCore::ImageBuffer::createCompatibleBuffer): Don't use
2623         adoptCF() when the function doesn't return a +1 retained
2624         CGColorSpaceRef.
2625
2626 2016-09-30  Joonghun Park  <jh718.park@samsung.com>
2627
2628         [EFL] Fix build break since r206661. Unreviewed
2629         https://bugs.webkit.org/show_bug.cgi?id=162825
2630
2631         No new tests, no new behaviours.
2632
2633         * rendering/RenderLayer.cpp:
2634         (WebCore::ClipRects::ClipRects):
2635
2636 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
2637
2638         Declare that our variation fonts work is in progress
2639         https://bugs.webkit.org/show_bug.cgi?id=162816
2640
2641         Reviewed by Simon Fraser.
2642
2643         * features.json:
2644
2645 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
2646
2647         Turn variation fonts on by default
2648         https://bugs.webkit.org/show_bug.cgi?id=162818
2649
2650         Reviewed by Simon Fraser.
2651
2652         No new tests because there is no behavior change.
2653
2654         * page/Settings.in:
2655         * testing/InternalSettings.cpp:
2656         (WebCore::InternalSettings::variationFontsEnabled):
2657
2658 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
2659
2660         Implement rendering of font-variation-settings
2661         https://bugs.webkit.org/show_bug.cgi?id=162782
2662
2663         Reviewed by Zalan Bujtas.
2664
2665         Because the heavy lifting for font-variation-settings is done by CoreText,
2666         this patch is fairly minimal. It simply hooks up the CSS property to CoreText.
2667
2668         There is an existing bug in CoreText where variations inside fonts do not
2669         survive the addition of a cascade list. Therefore, FontPlatformData::ctFont()
2670         needs to work around this (conditionally) by resupplying the variation at
2671         the same time as the cascade list. The CoreText bug is <rdar://problem/28449441>.
2672
2673         Tests: fast/text/variations/duplicate.html
2674                fast/text/variations/exist.html
2675                fast/text/variations/inheritance.html
2676                fast/text/variations/order.html
2677                fast/text/variations/outofbounds.html
2678
2679         * platform/graphics/FontCache.h:
2680         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2681         (WebCore::preparePlatformFont):
2682         (WebCore::fontWithFamily):
2683         (WebCore::FontCache::createFontPlatformData):
2684         (WebCore::FontCache::systemFallbackForCharacters):
2685         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2686         (WebCore::cascadeToLastResortAttributesDictionary):
2687         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
2688         (WebCore::FontPlatformData::ctFont):
2689         (WebCore::cascadeToLastResortFontDescriptor): Deleted.
2690         * platform/graphics/mac/FontCustomPlatformData.cpp:
2691         (WebCore::FontCustomPlatformData::fontPlatformData):
2692         * rendering/RenderThemeIOS.mm:
2693         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2694
2695 2016-09-29  Sam Weinig  <sam@webkit.org>
2696
2697         Add initial support for IDL union conversion
2698         https://bugs.webkit.org/show_bug.cgi?id=161576
2699
2700         Reviewed by Chris Dumez.
2701
2702         * WebCore.xcodeproj/project.pbxproj:
2703         Add IDLTypes.h
2704
2705         * bindings/generic/IDLTypes.h: Added.
2706         Add a basic type hierarchy for types defined by WebIDL and their corresponding
2707         WebCore implementation types.
2708
2709         * bindings/js/JSDOMConvert.h:
2710         (WebCore::Converter<IDLDOMString>::convert):
2711         (WebCore::Converter<IDLUSVString>::convert):
2712         Add Converters for IDLDOMString and IDLUSVString.
2713
2714         (WebCore::ConditionalConverter<typename ReturnType, typename T, bool enabled>)
2715         Add a struct to allow conditional conversion of types based on a compile boolean
2716         value. This allows the union code to work, by ensuring that code for types that don't
2717         exist doesn't get compiled.
2718
2719         (WebCore::Converter<IDLUnion>::convert):
2720         Add template meta programming based version of the WebIDL conversion algorithm. It uses
2721         introspection of the typelist to conditionally execute the parts of the algorithm that
2722         apply and relies on the compiler eliminate the dead code it produces. This initial cut
2723         doesn't implement the full algorithm, just a subset needed to see if this method will work
2724         out.
2725
2726         * bindings/js/JSDOMWrapper.h:
2727         (WebCore::isJSDOMWrapperType):
2728         Add JSDOMWrapperType to the list of well known types to allow quick checking of wrappers
2729         by the union code.
2730
2731         * bindings/js/JSNodeOrString.cpp:
2732         (WebCore::toNodeOrStringVector):
2733         Switch to new IDLUnion based converter.
2734
2735 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
2736
2737         Implement animation of font-variation-settings
2738         https://bugs.webkit.org/show_bug.cgi?id=162783
2739
2740         Reviewed by Simon Fraser.
2741
2742         Modify CSSPropertyAnimation to understand FontVariationSettings objects and how
2743         to interpolate them.
2744
2745         If two FontVariationSettings objects are unlike (meaning they specify different
2746         variation axes), for now the interpolation simply returns an empty object. This
2747         might change in the future, but for now, this is a reasonable place to start.
2748
2749         Because CSSPropertyAnimation interacts with RenderStyles instead of
2750         FontDescriptions, this patch adds a transparent accessor from the RenderStyle
2751         to the inner FontDescription.
2752
2753         Tests: animations/font-variation-settings-order.html
2754                animations/font-variation-settings-unlike.html
2755                animations/font-variation-settings.html
2756
2757         * page/animation/CSSPropertyAnimation.cpp:
2758         (WebCore::blendFunc):
2759         (WebCore::PropertyWrapperFontVariationSettings::PropertyWrapperFontVariationSettings):
2760         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2761         * rendering/style/RenderStyle.cpp:
2762         (WebCore::RenderStyle::setFontVariationSettings):
2763         * rendering/style/RenderStyle.h:
2764         (WebCore::RenderStyle::fontVariationSettings):
2765
2766 2016-09-30  Antoine Quint  <graouts@apple.com>
2767
2768         [Modern Media Controls] layout nodes
2769         https://bugs.webkit.org/show_bug.cgi?id=162799
2770         <rdar://problem/28569301>
2771
2772         Reviewed by Dean Jackson.
2773
2774         Modern media controls will be using a tree of LayoutNode objects that commit to the DOM
2775         in coordinated `requestAnimationFrame()` calls to ensure all layouts are done in an efficient
2776         and coordinated manner. As a preamble, we introduced the `scheduler` singleton in
2777         https://webkit.org/b/162726 which is in charge of scheduling callbacks.
2778
2779         A LayoutNode is created by providing an Element to its constructor, or an HTML string. Not
2780         providing a parameter creates a simple <div>.
2781
2782         When we set a property on a LayoutNode, we call `markDirtyProperty(propertyName)` which keeps
2783         track of dirty properties in the `_dirtyProperties` set. When this set is non-empty, the node
2784         is marked as dirty and registered in the global `dirtyNodes` map, asking the shared scheduler
2785         that a layout is needed. When the layout is performed, all nodes in the `dirtyNodes` map are
2786         processed such that `commitProperty(propertyName)` is called to commit dirty properties for
2787         a given node to the DOM, and `layout()` is called to allow subclasses of LayoutNode to conduct
2788         custom layout logic that goes beyond committing a given property.
2789
2790         Another reason why a node may be marked as dirty is when a DOM hierarchy change is needed. A
2791         host of DOM-like methods are exposed to allow flexible manipulations of nodes, with an extra
2792         `children` property which allows wholesale change of a node's subtree with a single array
2793         property assignment. Changes to the DOM hierarchy are performed in the same scheduler callback
2794         as style properties.
2795
2796         Nodes can be marked for layout explicitly with by setting the `needsLayout` property.
2797
2798         Tests: media/modern-media-controls/layout-node/addChild.html
2799                media/modern-media-controls/layout-node/children.html
2800                media/modern-media-controls/layout-node/constructor.html
2801                media/modern-media-controls/layout-node/height.html
2802                media/modern-media-controls/layout-node/insertAfter.html
2803                media/modern-media-controls/layout-node/insertBefore.html
2804                media/modern-media-controls/layout-node/parent.html
2805                media/modern-media-controls/layout-node/remove.html
2806                media/modern-media-controls/layout-node/removeChild.html
2807                media/modern-media-controls/layout-node/subclassing.html
2808                media/modern-media-controls/layout-node/visible.html
2809                media/modern-media-controls/layout-node/width.html
2810                media/modern-media-controls/layout-node/x.html
2811                media/modern-media-controls/layout-node/y.html
2812
2813         * Modules/modern-media-controls/controls/layout-node.js: Added.
2814         (LayoutNode):
2815         (LayoutNode.prototype.get x):
2816         (LayoutNode.prototype.set x):
2817         (LayoutNode.prototype.get y):
2818         (LayoutNode.prototype.set y):
2819         (LayoutNode.prototype.get width):
2820         (LayoutNode.prototype.set width):
2821         (LayoutNode.prototype.get height):
2822         (LayoutNode.prototype.set height):
2823         (LayoutNode.prototype.get visible):
2824         (LayoutNode.prototype.set visible):
2825         (LayoutNode.prototype.get needsLayout):
2826         (LayoutNode.prototype.set needsLayout):
2827         (LayoutNode.prototype.get parent):
2828         (LayoutNode.prototype.get children):
2829         (LayoutNode.prototype.set children):
2830         (LayoutNode.prototype.addChild):
2831         (LayoutNode.prototype.insertBefore):
2832         (LayoutNode.prototype.insertAfter):
2833         (LayoutNode.prototype.removeChild):
2834         (LayoutNode.prototype.remove):
2835         (LayoutNode.prototype.markDirtyProperty):
2836         (LayoutNode.prototype.commitProperty):
2837         (LayoutNode.prototype.layout):
2838         (LayoutNode.prototype._markNodeManipulation):
2839         (LayoutNode.prototype._updateDirtyState):
2840         (LayoutNode.prototype._updateChildren):
2841         (performScheduledLayout):
2842         (elementFromString):
2843
2844 2016-09-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2845
2846         The dragged image should be the current frame only of the animated image
2847         https://bugs.webkit.org/show_bug.cgi?id=162109
2848
2849         Reviewed by Tim Horton.
2850
2851         Instead of creating an NSImage with all the frames for the dragImage,
2852         create an NSImage with the current frame only.
2853
2854         * dom/DataTransferMac.mm:
2855         (WebCore::DataTransfer::createDragImage): Call currentFrameNSImage() to create the dragImage.
2856         * editing/cocoa/HTMLConverter.mm:
2857         (fileWrapperForElement):  Call the Image function with its new name.
2858         * platform/graphics/BitmapImage.h:
2859         * platform/graphics/Image.h:
2860         (WebCore::Image::nsImage): Rename getNSImage() to nsImage().
2861         (WebCore::Image::currentFrameNSImage): Returns the NSImage of the current frame.
2862         (WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
2863         (WebCore::Image::getNSImage): Deleted.
2864         (WebCore::Image::getTIFFRepresentation): Deleted.
2865         * platform/graphics/mac/ImageMac.mm:
2866         (WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
2867         (WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
2868         (WebCore::BitmapImage::currentFrameNSImage): Returns the NSImage of the current frame.
2869         (WebCore::BitmapImage::getTIFFRepresentation): Deleted.
2870         (WebCore::BitmapImage::getNSImage): Deleted.
2871         * platform/mac/CursorMac.mm:
2872         (WebCore::createCustomCursor): Call currentFrameNSImage() since the cursor does not animate anyway.
2873         * platform/mac/DragImageMac.mm:
2874         (WebCore::createDragImageFromImage): Use currentFrameNSImage() for the dragImage.
2875         * platform/mac/PasteboardMac.mm:
2876         (WebCore::Pasteboard::write): Call the Image function with its new name.
2877
2878 2016-09-30  Chris Dumez  <cdumez@apple.com>
2879
2880         [iOS] Allow sequence<Touch> input in TouchEvent constructor
2881         https://bugs.webkit.org/show_bug.cgi?id=162806
2882         <rdar://problem/28566429>
2883
2884         Reviewed by Ryosuke Niwa.
2885
2886         Allow sequence<Touch> input in TouchEvent constructor in addition to
2887         TouchList objects. It is convenient for developers to pass arrays of
2888         Touch objects.
2889
2890         No new tests, already covered by:
2891         imported/w3c/web-platform-tests/touch-events/touch-touchevent-constructor.html
2892
2893         * bindings/js/JSDOMBinding.h:
2894         (WebCore::toRefNativeArray):
2895         (WebCore::toRefPtrNativeArray):
2896         * bindings/js/JSDictionary.cpp:
2897         (WebCore::JSDictionary::convertValue):
2898
2899 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
2900
2901         Parse font-variation-settings
2902         https://bugs.webkit.org/show_bug.cgi?id=162781
2903
2904         Reviewed by Simon Fraser.
2905
2906         CSS Fonts level 4 [1] details the font-variation-settings property which allows variations
2907         to be applied to fonts which accept it. The property accepts a list of key/value
2908         pairs where the keys are four-character Ascii codes and the values are floating
2909         point values. The implementation uses font-feature-settings as a model, but with one
2910         big difference: font-variation-settings can be animated. The set of variation points
2911         are animated individually.
2912
2913         This font variations work is being done behind a run-time switch, which is settable from
2914         the Safari Develop menu.
2915
2916         Now that FontDescription is growing, I'd like to do an investigation into the possibility of
2917         moving some of the rare pieces of it into their own class to reduce memory. However, upon
2918         advice, this investigation will be fairly involved and should be done in its own bug.
2919
2920         Test: fast/text/variations/getComputedStyle.html
2921
2922         * CMakeLists.txt:
2923         * WebCore.xcodeproj/project.pbxproj:
2924         * css/CSSAllInOne.cpp:
2925         * css/CSSComputedStyleDeclaration.cpp:
2926         (WebCore::ComputedStyleExtractor::propertyValue):
2927         * css/CSSFontVariationValue.cpp: Copied from Source/WebCore/platform/graphics/FontTaggedSettings.cpp.
2928         (WebCore::CSSFontVariationValue::CSSFontVariationValue):
2929         (WebCore::CSSFontVariationValue::customCSSText):
2930         (WebCore::CSSFontVariationValue::equals):
2931         * css/CSSFontVariationValue.h: Copied from Source/WebCore/platform/graphics/FontTaggedSettings.cpp.
2932         * css/CSSPropertyNames.in:
2933         * css/CSSValue.cpp:
2934         (WebCore::CSSValue::equals):
2935         (WebCore::CSSValue::cssText):
2936         (WebCore::CSSValue::destroy):
2937         * css/CSSValue.h:
2938         (WebCore::CSSValue::isFontVariationValue):
2939         (WebCore::CSSValue::isFontFeatureValue): Deleted.
2940         * css/StyleBuilderConverter.h:
2941         (WebCore::StyleBuilderConverter::convertFontVariationSettings):
2942         * css/StyleBuilderCustom.h:
2943         (WebCore::StyleBuilderCustom::applyInitialFontVariationSettings):
2944         (WebCore::StyleBuilderCustom::applyInheritFontVariationSettings):
2945         (WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
2946         * css/parser/CSSParser.cpp:
2947         (WebCore::CSSParserContext::CSSParserContext):
2948         (WebCore::operator==):
2949         (WebCore::CSSParser::parseValue):
2950         (WebCore::CSSParser::parseFontFeatureSettings):
2951         (WebCore::CSSParser::parseFontVariationTag):
2952         (WebCore::CSSParser::parseFontVariationSettings):
2953         * css/parser/CSSParser.h:
2954         * css/parser/CSSParserMode.h:
2955         * platform/graphics/FontCache.h:
2956         (WebCore::FontDescriptionKey::FontDescriptionKey):
2957         (WebCore::FontDescriptionKey::operator==):
2958         (WebCore::FontDescriptionKey::computeHash):
2959         * platform/graphics/FontDescription.cpp:
2960         * platform/graphics/FontDescription.h:
2961         (WebCore::FontDescription::variationSettings):
2962         (WebCore::FontDescription::setVariationSettings):
2963         (WebCore::FontDescription::operator==):
2964         (WebCore::FontDescription::featureSettings): Deleted.
2965         (WebCore::FontDescription::setFeatureSettings): Deleted.
2966         * platform/graphics/FontTaggedSettings.cpp:
2967         (WebCore::FontVariationSettings::hash):
2968         (WebCore::operator<<):
2969         * platform/graphics/FontTaggedSettings.h:
2970
2971 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
2972
2973         Followup patch to r206664
2974         https://bugs.webkit.org/show_bug.cgi?id=162774
2975
2976         Unreviewed.
2977
2978         No new tests because there is no behavior change.
2979
2980         * platform/graphics/FontTaggedSettings.h:
2981         (WebCore::FourCharacterTagHashTraits::isDeletedValue): Deleted.
2982
2983 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
2984
2985         Fix fast/text/trak-optimizeLegibility.html
2986         https://bugs.webkit.org/show_bug.cgi?id=162779
2987
2988         Reviewed by Simon Fraser.
2989
2990         I accidentally created this test to allow an unnecessary delta
2991         in the width comparison. This covered the fact that the fonts
2992         were not being selected correctly in our testing code. Update the
2993         font selection code to work with system fonts correctly and
2994         update the test to not use a delta when performing width
2995         comparisons.
2996
2997         Test: fast/text/trak-optimizeLegibility.html
2998
2999         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3000         (WebCore::isSystemFont):
3001         (WebCore::platformFontLookupWithFamily):
3002
3003 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
3004
3005         Create runtime flag for variation font work
3006         https://bugs.webkit.org/show_bug.cgi?id=162780
3007
3008         Reviewed by Alex Christensen.
3009
3010         No new tests because there is no behavior change.
3011
3012         Variation font work should be behind a runtime flag.
3013
3014         * page/Settings.in:
3015         * testing/InternalSettings.cpp:
3016         (WebCore::InternalSettings::Backup::Backup):
3017         (WebCore::InternalSettings::Backup::restoreTo):
3018         (WebCore::InternalSettings::variationFontsEnabled):
3019         (WebCore::InternalSettings::setVariationFontsEnabled):
3020         * testing/InternalSettings.h:
3021         * testing/InternalSettings.idl:
3022
3023 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
3024
3025         Templatize internal FontFeatureSettings class for variation font support
3026         https://bugs.webkit.org/show_bug.cgi?id=162774
3027
3028         Reviewed by Alex Christensen.
3029
3030         Font features and font variations are similar in that they are identified
3031         by four-character tags and an associated value. However, the value is an
3032         int for font features and is a float for font variations. In order to
3033         simplify code, we can use the same class for both, and use a template
3034         argument to distinguish between the two. Then, typedefs can be used to
3035         name them.
3036
3037         No new tests because there is no behavior change.
3038
3039         * WebCore.xcodeproj/project.pbxproj: Rename FontFeatureSettings.{cpp,h}
3040         to FontTaggedSettings.{cpp,h}
3041         * css/CSSComputedStyleDeclaration.cpp:
3042         (WebCore::ComputedStyleExtractor::propertyValue):
3043         * css/CSSFontFace.h:
3044         * css/CSSFontFaceSource.h:
3045         * css/CSSFontFeatureValue.cpp:
3046         (WebCore::CSSFontFeatureValue::CSSFontFeatureValue):
3047         * css/CSSFontFeatureValue.h:
3048         * css/FontFace.cpp:
3049         (WebCore::FontFace::featureSettings):
3050         * css/parser/CSSParser.cpp:
3051         (WebCore::CSSParser::parseFontFeatureTag):
3052         * loader/cache/CachedFont.h:
3053         * platform/graphics/FontDescription.h:
3054         * platform/graphics/FontFeatureSettings.cpp:
3055         (WebCore::FontFeature::FontFeature): Deleted.
3056         (WebCore::FontFeature::operator==): Deleted.
3057         (WebCore::FontFeature::operator<): Deleted.
3058         (WebCore::FontFeatureSettings::insert): Deleted.
3059         (WebCore::FontFeatureSettings::hash): Deleted.
3060         * platform/graphics/FontFeatureSettings.h: Removed.
3061         (WebCore::fontFeatureTag): Deleted.
3062         (WebCore::FontFeatureTagHash::hash): Deleted.
3063         (WebCore::FontFeatureTagHash::equal): Deleted.
3064         (WebCore::FontFeatureTagHashTraits::constructDeletedValue): Deleted.
3065         (WebCore::FontFeatureTagHashTraits::isDeletedValue): Deleted.
3066         (WebCore::FontFeature::operator!=): Deleted.
3067         (WebCore::FontFeature::tag): Deleted.
3068         (WebCore::FontFeature::value): Deleted.
3069         (WebCore::FontFeature::enabled): Deleted.
3070         (WebCore::FontFeatureSettings::operator==): Deleted.
3071         (WebCore::FontFeatureSettings::operator!=): Deleted.
3072         (WebCore::FontFeatureSettings::size): Deleted.
3073         (WebCore::FontFeatureSettings::operator[]): Deleted.
3074         (WebCore::FontFeatureSettings::at): Deleted.
3075         (WebCore::FontFeatureSettings::begin): Deleted.
3076         (WebCore::FontFeatureSettings::end): Deleted.
3077         * platform/graphics/FontTaggedSettings.cpp: Renamed from Source/WebCore/platform/graphics/FontFeatureSettings.cpp.
3078         (WebCore::FontFeatureSettings::hash):
3079         * platform/graphics/FontTaggedSettings.h: Added.
3080         (WebCore::fontFeatureTag):
3081         (WebCore::FourCharacterTagHash::hash):
3082         (WebCore::FourCharacterTagHash::equal):
3083         (WebCore::FourCharacterTagHashTraits::constructDeletedValue):
3084         (WebCore::FourCharacterTagHashTraits::isDeletedValue):
3085         (WebCore::FontTaggedSetting::operator!=):
3086         (WebCore::FontTaggedSetting::tag):
3087         (WebCore::FontTaggedSetting::value):
3088         (WebCore::FontTaggedSetting::enabled):
3089         (WebCore::FontTaggedSetting<T>::FontTaggedSetting):
3090         (WebCore::=):
3091         (WebCore::FontTaggedSetting<T>::operator<):
3092         (WebCore::FontTaggedSettings::operator==):
3093         (WebCore::FontTaggedSettings::operator!=):
3094         (WebCore::FontTaggedSettings::isEmpty):
3095         (WebCore::FontTaggedSettings::size):
3096         (WebCore::FontTaggedSettings::operator[]):
3097         (WebCore::FontTaggedSettings::at):
3098         (WebCore::FontTaggedSettings::begin):
3099         (WebCore::FontTaggedSettings::end):
3100         (WebCore::FontTaggedSettings<T>::insert):
3101         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3102         (WebCore::tagEquals):
3103         (WebCore::appendOpenTypeFeature):
3104         * platform/graphics/mac/FontCustomPlatformData.h:
3105
3106 2016-09-30  Chris Dumez  <cdumez@apple.com>
3107
3108         Fragment serialization should always use 'xml:' prefix for attributes in XML namespace
3109         https://bugs.webkit.org/show_bug.cgi?id=162803
3110
3111         Reviewed by Sam Weinig.
3112
3113         Fragment serialization should always use 'xml:' prefix for attributes in XML namespace:
3114         - https://html.spec.whatwg.org/#serialising-html-fragments
3115         """
3116         If the attribute is in the XML namespace
3117         -> The attribute's serialized name is the string "xml:" followed by the attribute's local name.
3118         """
3119
3120         - https://www.w3.org/TR/DOM-Parsing/#dfn-concept-xml-serialization-algorithm
3121         """
3122         If ns is the XML namespace, then let qualified name be the concatenation of the string "xml:"
3123         and the value of node's localName.
3124         """
3125
3126         Firefox complies with the specification.
3127
3128         No new tests, rebaselined existing test.
3129
3130         * editing/MarkupAccumulator.cpp:
3131         (WebCore::MarkupAccumulator::appendAttribute):
3132
3133 2016-09-30  Zalan Bujtas  <zalan@apple.com>
3134
3135         Unreviewed, rolling out r206611.
3136
3137         Scroll perf did not recover.
3138
3139         Reverted changeset:
3140
3141         "Unreviewed, rolling out r206483."
3142         https://bugs.webkit.org/show_bug.cgi?id=162750
3143         http://trac.webkit.org/changeset/206611
3144
3145 2016-09-30  Zalan Bujtas  <zalan@apple.com>
3146
3147         Remove ClipRects's custom refcounting.
3148         https://bugs.webkit.org/show_bug.cgi?id=162798
3149
3150         Reviewed by Simon Fraser.
3151
3152         It's safer to use RefCounted<>. 
3153
3154         No change in functionality.
3155
3156         * rendering/RenderLayer.cpp:
3157         (WebCore::ClipRects::ClipRects):
3158         (WebCore::ClipRectsCache::getClipRects):
3159         (WebCore::ClipRectsCache::setClipRects):
3160         (WebCore::ClipRectsCache::getIndex):
3161         (WebCore::RenderLayer::updateClipRects):
3162         (WebCore::ClipRects::ref): Deleted.
3163         (WebCore::ClipRects::deref): Deleted.
3164
3165 2016-09-30  Chris Dumez  <cdumez@apple.com>
3166
3167         FileSaver.js does not work in WebKit
3168         https://bugs.webkit.org/show_bug.cgi?id=162788
3169
3170         Reviewed by Sam Weinig.
3171
3172         FileSaver.js does not work in WebKit:
3173         - https://eligrey.com/demos/FileSaver.js/
3174
3175         It works in Firefox and Chrome, but in WebKit, we were getting a
3176         "Synthetic clicks on anchors that have a download attribute are
3177         ignored." warning. We were too strict in restricting synthetic clicks.
3178         We now allow synthetic clicks as long as they are triggered by a user
3179         gesture.
3180
3181         Test: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
3182
3183         * html/HTMLAnchorElement.cpp:
3184         (WebCore::HTMLAnchorElement::handleClick):
3185
3186 2016-09-30  Joseph Pecoraro  <pecoraro@apple.com>
3187
3188         Breakpoints on blank lines or comments don't break
3189         https://bugs.webkit.org/show_bug.cgi?id=9885
3190         <rdar://problem/6134406>
3191
3192         Reviewed by Mark Lam.
3193
3194         Tests: inspector/debugger/breakpoints/resolved-dump-all-pause-locations.html
3195                inspector/debugger/breakpoints/resolved-dump-each-line.html
3196
3197         * bindings/js/CachedScriptSourceProvider.h:
3198         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
3199
3200 2016-09-30  Joseph Pecoraro  <pecoraro@apple.com>
3201
3202         Web Inspector: Stepping out of a function finishes the line that called it.
3203         https://bugs.webkit.org/show_bug.cgi?id=155325
3204         <rdar://problem/25094578>
3205
3206         Reviewed by Mark Lam.
3207
3208         Tests: inspector/debugger/stepping/stepInto.html
3209                inspector/debugger/stepping/stepOut.html
3210                inspector/debugger/stepping/stepOver.html
3211                inspector/debugger/stepping/stepping-arrow-functions.html
3212                inspector/debugger/stepping/stepping-classes.html
3213                inspector/debugger/stepping/stepping-control-flow.html
3214                inspector/debugger/stepping/stepping-function-calls.html
3215                inspector/debugger/stepping/stepping-function-default-parameters.html
3216                inspector/debugger/stepping/stepping-literal-construction.html
3217                inspector/debugger/stepping/stepping-loops.html
3218                inspector/debugger/stepping/stepping-misc.html
3219                inspector/debugger/stepping/stepping-switch.html
3220                inspector/debugger/stepping/stepping-template-string.html
3221                inspector/debugger/stepping/stepping-try-catch-finally.html
3222
3223         * inspector/InspectorDOMDebuggerAgent.h:
3224         * inspector/InspectorDOMDebuggerAgent.cpp:
3225         (WebCore::InspectorDOMDebuggerAgent::stepInto): Deleted.
3226         Setting this state in step-into does not make sense since we do not
3227         know when the debugger resumes and won't know when to clear it.
3228
3229 2016-09-30  Alex Christensen  <achristensen@webkit.org>
3230
3231         Fix off-by-one error in URLParser::parseIPv4Host
3232         https://bugs.webkit.org/show_bug.cgi?id=162789
3233
3234         Reviewed by Tim Horton.
3235
3236         The spec says "If any but the last item in numbers is greater than 255, return failure."
3237         This means check up to size - 1, not size - 2.
3238
3239         Covered by a new API test.
3240
3241         * platform/URLParser.cpp:
3242         (WebCore::URLParser::parseIPv4Host):
3243
3244 2016-09-30  Alex Christensen  <achristensen@webkit.org>
3245
3246         URLParser: parsing a URL with an empty host and a colon should fail
3247         https://bugs.webkit.org/show_bug.cgi?id=162795
3248
3249         Reviewed by Tim Horton.
3250
3251         Covered by new API tests.
3252
3253         * platform/URLParser.cpp:
3254         (WebCore::URLParser::parseHostAndPort):
3255
3256 2016-09-30  Alex Christensen  <achristensen@webkit.org>
3257
3258         URLParser: handle syntax violations in non-UTF-8 encoded queries
3259         https://bugs.webkit.org/show_bug.cgi?id=162770
3260
3261         Reviewed by Tim Horton.
3262
3263         There is a fast path for queries of URLs that use UTF-8 encoding, which are quite common.
3264         For non-UTF-8 encoded queries, which are less common, we put the code points in a Vector<UChar>
3265         and encode them all at once.  If there is a syntax violation in the query, we need to copy the
3266         syntax-violation-free string up to the beginning of the query, then encode the query.
3267
3268         Covered by new API tests.
3269
3270         * platform/URLParser.cpp:
3271         (WebCore::URLParser::percentEncodeByte):
3272         (WebCore::URLParser::encodeQuery):
3273         (WebCore::URLParser::parse):
3274         * platform/URLParser.h:
3275
3276 2016-09-27  Anders Carlsson  <andersca@apple.com>
3277
3278         Remove a couple of unused members from PlatformKeyboardEvent
3279         https://bugs.webkit.org/show_bug.cgi?id=162641
3280
3281         Reviewed by Tim Horton.
3282
3283         * platform/PlatformKeyboardEvent.h:
3284         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3285         (WebCore::PlatformKeyboardEvent::nativeVirtualKeyCode): Deleted.
3286         (WebCore::PlatformKeyboardEvent::macCharCode): Deleted.
3287         * platform/mac/PlatformEventFactoryMac.mm:
3288         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3289         * replay/SerializationMethods.cpp:
3290         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
3291         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
3292
3293 2016-09-30  Antti Koivisto  <antti@apple.com>
3294
3295         Remove "rem" unit optimization for document element font size changes
3296         https://bugs.webkit.org/show_bug.cgi?id=162778
3297
3298         Reviewed by Alex Christensen.
3299
3300         We awkwardly track from the parser level if any stylesheet in a document uses any rem units. This is only used to minimally
3301         optimize a case where document element's (<html>) font size changes dynamically.
3302
3303         In practice such changes are rare. Browsing around I couldn't find a single case where this optimization got used.
3304         Even if it was used it would be of low value as a full style resolution is likely to happen anyway (as font inherits)
3305         and the only thing really saved is that we don't need to invalidate the matched properties cache.
3306
3307         * css/CSSGrammar.y.in:
3308         * css/StyleSheetContents.cpp:
3309         (WebCore::StyleSheetContents::StyleSheetContents):
3310         * css/StyleSheetContents.h:
3311         * dom/AuthorStyleSheets.cpp:
3312         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
3313         * dom/AuthorStyleSheets.h:
3314         (WebCore::AuthorStyleSheets::usesRemUnits): Deleted.
3315         (WebCore::AuthorStyleSheets::setUsesRemUnit): Deleted.
3316         * dom/Document.cpp:
3317         (WebCore::Document::recalcStyle):
3318         (WebCore::Document::updateBaseURL):
3319         * style/StyleTreeResolver.cpp:
3320         (WebCore::Style::TreeResolver::resolveElement):
3321
3322 2016-09-30  Zalan Bujtas  <zalan@apple.com>
3323
3324         RenderLayer::clipRects may return nullptr.
3325         https://bugs.webkit.org/show_bug.cgi?id=162729
3326
3327         Reviewed by Chris Dumez.
3328
3329         This patch refactors RenderLayer::updateClipRects(), parentClipRects() and backgroundClipRect()
3330         so that we don't have to rely on this seemingly unsafe line: clipRects = *parent()->clipRects(clipRectsContext);
3331         Now updateClipRects() returns the computed/cached clip rects as opposed to update and refetch them.
3332         While this patch makes the code look more readable/safer, it also eliminates cached item tripple retrievals.  
3333
3334         No change in functionality.
3335
3336         * rendering/RenderLayer.cpp:
3337         (WebCore::ClipRectsCache::getClipRects):
3338         (WebCore::ClipRectsCache::setClipRects):
3339         (WebCore::RenderLayer::updateClipRects):
3340         (WebCore::RenderLayer::clipRects):
3341         (WebCore::RenderLayer::calculateClipRects):
3342         * rendering/RenderLayer.h:
3343
3344 2016-09-30  Youenn Fablet  <youenn@apple.com>
3345
3346         Add a way to go from a RefPtr<T> to Ref<const T>
3347         https://bugs.webkit.org/show_bug.cgi?id=162683
3348
3349         Reviewed by Alex Christensen.
3350
3351         No change of behavior.
3352
3353         * Modules/fetch/FetchBody.cpp:
3354         (WebCore::FetchBody::extract):
3355
3356 2016-09-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
3357
3358         Unreviewed, fix 32-bit build.
3359
3360         * loader/cache/CachedImage.cpp:
3361         (WebCore::CachedImage::decodedSizeChanged):
3362
3363 2016-09-30  Youenn Fablet  <youenn@apple.com>
3364
3365         FetchBody should use UTF8Encoding to encode text data
3366         https://bugs.webkit.org/show_bug.cgi?id=162775
3367
3368         Reviewed by Sam Weinig.
3369
3370         Covered by added tests.
3371
3372         Removing unnecesary vector allocation when extracting UTF8 bytes from a Request/Response text/URLSearchParams body.
3373         Making use of UTF8Encoding for consistency with  the upload code path.
3374
3375         * Modules/fetch/FetchBody.cpp:
3376         (WebCore::FetchBody::consumeAsStream):
3377         (WebCore::FetchBody::consumeText):
3378         (WebCore::extractBytesFromText): Deleted.
3379
3380 2016-09-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
3381
3382         Change the MemoryCache and CachedResource adjustSize functions to take a long argument
3383         https://bugs.webkit.org/show_bug.cgi?id=162708
3384         <rdar://problem/28555702>
3385
3386         Reviewed by Brent Fulgham.
3387
3388         Because the MemoryCache stores the size of the cached memory in unsigned,
3389         two problems my happen when reporting a change in the size of the memory:
3390         
3391         1. Signed integer overflow -- which can happen because MemoryCache::adjustSize()
3392            takes a signed integer argument. If the allocated or the freed memory size is
3393            larger than the maximum of a signed integer, an overflow will happen.
3394            For the image caching code, this can be seen where the unsigned decodedSize
3395            is casted to an integer before passing it to ImageObserver::decodedSizeChanged().
3396
3397         2. Unsigned integer overflow -- which can happen if the new allocated memory
3398            size plus the currentSize exceeds the maximum of unsigned.
3399            This can be seen in MemoryCache::adjustSize() where we add delta to m_liveSize
3400            or m_deadSize without checking whether this addition will overflow or not. We
3401            do not assert for overflow although we assert for underflow.
3402            
3403         The fix for these two problems can be the following:
3404         
3405         1. Make all the adjustSize functions all the way till MemoryCache::adjustSize()
3406            take a signed long integer argument.
3407            
3408         2. Do not create a NativeImagePtr for an ImageFrame if its frameBytes plus the
3409            ImageFrameCache::decodedSize() will exceed the maximum of an unsigned integer.
3410
3411         * loader/cache/CachedImage.cpp:
3412         (WebCore::CachedImage::decodedSizeChanged): Change the argument to be long. No overflow will happen when casting the argument from unsigned to long.
3413         * loader/cache/CachedImage.h:
3414         * loader/cache/CachedResource.cpp: 
3415         (WebCore::CachedResource::setDecodedSize): Use long integer casting when calling MemoryCache::adjustSize().
3416         (WebCore::CachedResource::setEncodedSize): Ditto.
3417         * loader/cache/MemoryCache.cpp:
3418         (WebCore::MemoryCache::MemoryCache): Add as static assert to ensure sizeof(long long) can hold any unsigned or its negation.
3419         (WebCore::MemoryCache::revalidationSucceeded): Use long integer casting when calling MemoryCache::adjustSize().
3420         (WebCore::MemoryCache::remove): Ditto.
3421         (WebCore::MemoryCache::adjustSize): Change the function argument to long integer. No overflow will happen when casting the argument from unsigned to long.
3422         * loader/cache/MemoryCache.h:
3423         * platform/graphics/ImageFrameCache.cpp:
3424         (WebCore::ImageFrameCache::destroyIncompleteDecodedData): Call a function with its new name.
3425         (WebCore::ImageFrameCache::decodedSizeChanged): Change the function argument to long integer. No overflow will happen when casting the argument from unsigned to long.
3426         (WebCore::ImageFrameCache::decodedSizeIncreased): Use long integer casting when calling decodedSizeChanged().
3427         (WebCore::ImageFrameCache::decodedSizeDecreased): Ditto.
3428         (WebCore::ImageFrameCache::decodedSizeReset): Ditto.
3429         (WebCore::ImageFrameCache::didDecodeProperties): Ditto.
3430         (WebCore::ImageFrameCache::frameAtIndex): Do not create the NativeImage if adding its frameByes to the MemoryCache will cause numerical overflow.
3431         (WebCore::ImageFrameCache::decodedSizeIncremented): Deleted. This function is renamed decodedSizeIncreased().
3432         (WebCore::ImageFrameCache::decodedSizeDecremented): Deleted. This function is renamed decodedSizeDecreased().
3433         * platform/graphics/ImageFrameCache.h:
3434         * platform/graphics/ImageObserver.h:
3435         * platform/graphics/IntSize.h:
3436         (WebCore::IntSize::unclampedArea): Returns the area of an IntSize in size_t.
3437         * platform/graphics/cg/PDFDocumentImage.cpp:
3438         (WebCore::PDFDocumentImage::decodedSizeChanged): Use long integer casting when calling ImageObserver::decodedSizeChanged().
3439
3440 2016-09-30  Chris Dumez  <cdumez@apple.com>
3441
3442         Add support for ImageData.data attribute
3443         https://bugs.webkit.org/show_bug.cgi?id=162767
3444
3445         Reviewed by Sam Weinig.
3446
3447         Add support for ImageData.data attribute:
3448         - https://html.spec.whatwg.org/#imagedata
3449
3450         Firefox already supports it.
3451
3452         No new tests, updated existing tests.
3453
3454         * html/ImageData.idl:
3455
3456 2016-09-30  Youenn Fablet  <youenn@apple.com>
3457
3458         DumpRenderTree crashed in com.apple.WebCore: WTF::Optional<WebCore::FetchBodyOwner::BlobLoader>::operator bool const + 12
3459         https://bugs.webkit.org/show_bug.cgi?id=162483
3460
3461         Reviewed by Alex Christensen.
3462
3463         Test: fetch/closing-while-fetching-blob.html
3464         No change of behavior.
3465
3466         * Modules/fetch/FetchBodyOwner.cpp:
3467         (WebCore::FetchBodyOwner::stop): Asserting m_blobLoader is null (meaning that unsetPendingActivity was done)
3468         only in case FetchBodyOwner has no risk being destroyed.
3469
3470 2016-09-30  Youenn Fablet  <youennf@gmail.com>
3471
3472         [Fetch API] Add support for URLSearchParams body
3473         https://bugs.webkit.org/show_bug.cgi?id=162667
3474
3475         Reviewed by Alex Christensen.
3476
3477         Tests: imported/w3c/web-platform-tests/fetch/api/basic/request-upload-worker.html
3478                imported/w3c/web-platform-tests/fetch/api/basic/request-upload.html
3479
3480         * Modules/fetch/FetchBody.cpp:
3481         (WebCore::extractBytesFromText): Moving to a static function that should be moved to a String method.
3482         (WebCore::FetchBody::FetchBody): Adding constructor for URLSearchParams.
3483         (WebCore::FetchBody::extract): Adding URLSearchParams body initialization.
3484         (WebCore::FetchBody::consume): Consuming URLSearchParams bodies.
3485         (WebCore::FetchBody::consumeAsStream): Ditto.
3486         (WebCore::FetchBody::consumeText): Updated to take a parameter to handle both text and URLSearchParams bodies.
3487         (WebCore::FetchBody::bodyForInternalRequest): Add URLSearchParams body upload.
3488         (WebCore::FetchBody::clone): Add URLSearchParams body cloning
3489         * Modules/fetch/FetchBody.h:
3490         (WebCore::FetchBody::urlSearchParamsBody):
3491         * html/URLSearchParams.cpp:
3492         (WebCore::URLSearchParams::toString):
3493         * html/URLSearchParams.h:
3494
3495 2016-09-29  Simon Fraser  <simon.fraser@apple.com>
3496
3497         Re-order the arguments to drawPattern() functions
3498         https://bugs.webkit.org/show_bug.cgi?id=162772
3499
3500         Reviewed by Zalan Bujtas.
3501         
3502         Re-order the arguments to have the destination rect come near the front,
3503         leaving CompositeOperator and BlendMode hanging out at the back like
3504         other drawing functions.
3505
3506         No behavior change.
3507
3508         * platform/graphics/BitmapImage.cpp:
3509         (WebCore::BitmapImage::drawPattern):
3510         * platform/graphics/BitmapImage.h:
3511         * platform/graphics/CrossfadeGeneratedImage.cpp:
3512         (WebCore::CrossfadeGeneratedImage::drawPattern):
3513         * platform/graphics/CrossfadeGeneratedImage.h:
3514         * platform/graphics/GeneratedImage.h:
3515         * platform/graphics/GradientImage.cpp:
3516         (WebCore::GradientImage::drawPattern):
3517         * platform/graphics/GradientImage.h:
3518         * platform/graphics/GraphicsContext.h:
3519         * platform/graphics/Image.cpp:
3520         (WebCore::Image::drawTiled):
3521         * platform/graphics/Image.h:
3522         * platform/graphics/ImageBuffer.h:
3523         * platform/graphics/NamedImageGeneratedImage.cpp:
3524         (WebCore::NamedImageGeneratedImage::drawPattern):
3525         * platform/graphics/NamedImageGeneratedImage.h:
3526         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3527         (WebCore::GraphicsContext::drawPattern):
3528         * platform/graphics/cairo/ImageBufferCairo.cpp:
3529         (WebCore::ImageBuffer::drawPattern):
3530         * platform/graphics/cairo/ImageCairo.cpp:
3531         (WebCore::Image::drawPattern):
3532         * platform/graphics/cg/GraphicsContextCG.cpp:
3533         (WebCore::GraphicsContext::drawPattern):
3534         * platform/graphics/cg/ImageBufferCG.cpp:
3535         (WebCore::ImageBuffer::drawPattern):
3536         * platform/graphics/cg/ImageCG.cpp: This file can probably be removed and the code moved, since the
3537         code is almost the same as the cairo code, and not platform-specific.
3538         (WebCore::Image::drawPattern):
3539         * platform/graphics/displaylists/DisplayListItems.cpp:
3540         (WebCore::DisplayList::DrawPattern::DrawPattern):
3541         (WebCore::DisplayList::DrawPattern::apply):
3542         * platform/graphics/displaylists/DisplayListItems.h:
3543         (WebCore::DisplayList::DrawPattern::create):
3544         * platform/graphics/displaylists/DisplayListRecorder.cpp:
3545         (WebCore::DisplayList::Recorder::drawPattern):
3546         * platform/graphics/displaylists/DisplayListRecorder.h:
3547         * svg/graphics/SVGImage.cpp:
3548         (WebCore::SVGImage::drawPatternForContainer):
3549         * svg/graphics/SVGImageForContainer.cpp:
3550         (WebCore::SVGImageForContainer::drawPattern):
3551         * svg/graphics/SVGImageForContainer.h:
3552
3553 2016-09-29  Chris Dumez  <cdumez@apple.com>
3554
3555         Add support for download attribute on area elements
3556         https://bugs.webkit.org/show_bug.cgi?id=162765
3557
3558         Reviewed by Brent Fulgham.
3559
3560         Add support for download attribute on area elements:
3561         - https://html.spec.whatwg.org/#htmlanchorelement
3562
3563         Because HTMLAreaElement inherits from HTMLAnchorElement on native side,
3564         and because HTMLAnchorElement already supports the download attribute,
3565         all that was needed was to add the download attribute to
3566         HTMLAreaElement.idl file.
3567
3568         Test: http/tests/download/area-download.html
3569
3570         * html/HTMLAreaElement.idl:
3571
3572 2016-09-29  Ryosuke Niwa  <rniwa@webkit.org>
3573
3574         Editor::findStringAndScrollToVisible is unused
3575         https://bugs.webkit.org/show_bug.cgi?id=162762
3576
3577         Reviewed by Simon Fraser.
3578
3579         Deleted the unused function.
3580
3581         * editing/Editor.cpp:
3582         (WebCore::Editor::findStringAndScrollToVisible): Deleted.
3583         * editing/Editor.h:
3584
3585 2016-09-29  Jiewen Tan  <jiewen_tan@apple.com>
3586
3587         Expose CryptoKey to web workers
3588         https://bugs.webkit.org/show_bug.cgi?id=162640
3589         <rdar://problem/28182204>
3590
3591         Reviewed by Brent Fulgham.
3592
3593         Tests: crypto/workers/aes-postMessage-worker.html
3594                crypto/workers/hmac-postMessage-worker.html
3595                crypto/workers/hrsa-postMessage-worker.html
3596                crypto/workers/multiple-postMessage-worker.html
3597                crypto/workers/rsa-postMessage-worker.html
3598
3599         * crypto/CryptoKey.idl:
3600         * crypto/SerializedCryptoKeyWrap.h:
3601         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3602         (WebCore::deleteDefaultWebCryptoMasterKey):
3603         Add a way to delete the default web crypto master key such that we can test
3604         these APIs and cleanup.
3605         * workers/WorkerGlobalScope.cpp:
3606         (WebCore::WorkerGlobalScope::wrapCryptoKey):
3607         (WebCore::WorkerGlobalScope::unwrapCryptoKey):
3608         * workers/WorkerGlobalScope.h:
3609
3610 2016-09-29  Nan Wang  <n_wang@apple.com>
3611
3612         AX: iOS: Tapping <input> in Safari zooms in a bit when page has max scale = 1
3613         https://bugs.webkit.org/show_bug.cgi?id=162471
3614
3615         Reviewed by Simon Fraser.
3616
3617         If the author has defined a maximum scale, we should honor that when keyboard focus moves
3618         to a text field, instead of using the forceAlwaysUserScalableMaximumScale.
3619
3620         Tests: fast/forms/ios/user-scalable-does-not-scale-for-keyboard-focus-with-author-defined-scale.html
3621                fast/forms/ios/user-scalable-does-not-scale-for-keyboard-focus-with-user-scalable-no.html
3622                fast/forms/ios/user-scalable-scales-for-keyboard-focus-with-no-author-defined-scale.html
3623
3624         * page/ViewportConfiguration.cpp:
3625         (WebCore::ViewportConfiguration::allowsUserScaling):
3626         (WebCore::ViewportConfiguration::allowsUserScalingIgnoringAlwaysScalable):
3627         (WebCore::ViewportConfiguration::allowsUserScalingIgnoringForceAlwaysScaling): Deleted.
3628         * page/ViewportConfiguration.h:
3629         (WebCore::ViewportConfiguration::maximumScaleIgnoringAlwaysScalable):
3630         (WebCore::ViewportConfiguration::maximumScale): Deleted.
3631
3632 2016-09-29  Alex Christensen  <achristensen@webkit.org>
3633
3634         Fix syntax violation handling in IPv4 address parsing
3635         https://bugs.webkit.org/show_bug.cgi?id=162756
3636
3637         Reviewed by Tim Horton.
3638
3639         When we are parsing the up to 4 numbers in an IPv4 address, if we find a syntax violation 
3640         (the canonicalized address would be different than the input string) then wait to report
3641         it until we have determined that this is a valid IPv4 address that will be canonicalized.
3642         If it is not a valid IPv4 address, then we will just treat the characters as the host, and
3643         that could be no syntax violation.
3644
3645         Covered by a new API test and existing API tests.
3646
3647         * platform/URLParser.cpp:
3648         (WebCore::URLParser::URLParser):
3649         (WebCore::URLParser::parseIPv4Number):
3650         (WebCore::URLParser::parseIPv4Host):
3651         * platform/URLParser.h:
3652
3653 2016-09-29  Chris Dumez  <cdumez@apple.com>
3654
3655         Fix post-landing nits after r206561.
3656         https://bugs.webkit.org/show_bug.cgi?id=162659
3657
3658         Reviewed by Alex Christensen.
3659
3660         Uses more StringViews and constness.
3661
3662         * dom/SecurityContext.cpp:
3663         (WebCore::SecurityContext::isSupportedSandboxPolicy):
3664         * dom/SecurityContext.h:
3665         * html/DOMTokenList.cpp:
3666         (WebCore::DOMTokenList::DOMTokenList):
3667         (WebCore::DOMTokenList::supports):
3668         * html/DOMTokenList.h:
3669         (WebCore::DOMTokenList::DOMTokenList):
3670         * html/HTMLAnchorElement.cpp:
3671         (WebCore::HTMLAnchorElement::relList):
3672         * html/HTMLIFrameElement.cpp:
3673         (WebCore::HTMLIFrameElement::sandbox):
3674         * html/HTMLLinkElement.cpp:
3675         (WebCore::HTMLLinkElement::relList):
3676         * html/LinkRelAttribute.cpp:
3677         (WebCore::LinkRelAttribute::isSupported):
3678         * html/LinkRelAttribute.h:
3679
3680 2016-09-29  Alex Christensen  <achristensen@webkit.org>
3681
3682         URLParser should correctly parse ports with leading 0's
3683         https://bugs.webkit.org/show_bug.cgi?id=162752
3684
3685         * platform/URLParser.cpp:
3686         (WebCore::URLParser::parsePort):
3687         Followup.  Remove branches based on Geoffrey's feedback.
3688
3689 2016-09-29  Alex Christensen  <achristensen@webkit.org>
3690
3691         URLParser should correctly parse ports with leading 0's
3692         https://bugs.webkit.org/show_bug.cgi?id=162752
3693
3694         Reviewed by Tim Horton.
3695
3696         Covered by new API tests.
3697
3698         * platform/URLParser.cpp:
3699         (WebCore::URLParser::parsePort):
3700
3701 2016-09-29  Commit Queue  <commit-queue@webkit.org>
3702
3703         Unreviewed, rolling out r206483.
3704         https://bugs.webkit.org/show_bug.cgi?id=162750
3705
3706         May have caused iOS perf regression (Requested by smfr on
3707         #webkit).
3708
3709         Reverted changeset:
3710
3711         "REGRESSION (r204552): Yelp carousel animation is not smooth."
3712         https://bugs.webkit.org/show_bug.cgi?id=162632
3713         http://trac.webkit.org/changeset/206483
3714
3715 2016-09-29  Alex Christensen  <achristensen@webkit.org>
3716
3717         URLParser: make parsing invalid IPv4 addresses more robust and correct
3718         https://bugs.webkit.org/show_bug.cgi?id=162746
3719
3720         Reviewed by Tim Horton.
3721
3722         If parsing an IPv4 address fails, the characters are just treated as a regular domain.
3723
3724         Covered by new API tests.
3725
3726         * platform/URLParser.cpp:
3727         (WebCore::URLParser::parseIPv4Number):
3728         (WebCore::URLParser::parseIPv4Host):
3729
3730 2016-09-29  Alex Christensen  <achristensen@webkit.org>
3731
3732         URLParser: IPv6 addresses followed by a colon are invalid
3733         https://bugs.webkit.org/show_bug.cgi?id=162747
3734
3735         Reviewed by Tim Horton.
3736
3737         Covered by new API tests.
3738
3739         * platform/URLParser.cpp:
3740         (WebCore::URLParser::parseIPv6Host):
3741
3742 2016-09-29  Antoine Quint  <graouts@apple.com>
3743
3744         [Modern Media Controls] scheduler for layout nodes
3745         https://bugs.webkit.org/show_bug.cgi?id=162726
3746         <rdar://problem/28543043>
3747
3748         Reviewed by Dean Jackson.
3749
3750         For the work on the modern media controls we will be using a tree of LayoutNode objects that will
3751         commit to the DOM in coordinated `requestAnimationFrame()` calls to ensure all layouts are done
3752         in an efficient and coordinated manner. As a preamble, we introduce a `scheduler` singleton which
3753         provides a single public method `scheduleLayout(callback)` to queue callbacks to be fired in the
3754         next `requestAnimationFrame()` callback.
3755
3756         Tests: media/modern-media-controls/scheduler/not-reentrant.html
3757                media/modern-media-controls/scheduler/single-callback-when-registered-multiple-times.html
3758
3759         * Modules/modern-media-controls/controls/scheduler.js: Added.
3760         (const.scheduler.new.prototype.scheduleLayout):
3761         (const.scheduler.new.prototype._requestFrameIfNeeded):
3762         (const.scheduler.new.prototype._frameDidFire):
3763         (const.scheduler.new.prototype._layout):
3764
3765 2016-09-28  Ryosuke Niwa  <rniwa@webkit.org>
3766
3767         Text nodes assigned to a linked slot are not clickable
3768         https://bugs.webkit.org/show_bug.cgi?id=162091
3769         <rdar://problem/28383300>
3770
3771         Reviewed by Antti Koivisto.
3772
3773         The bug was caused by updateMouseEventTargetNode adjusting the target to its parent element when
3774         the original target was a text node. Fixed the bug by using the parent element in the composed tree.
3775
3776         Also fixed the bug that the hit testing was not finding the anchor element and keeping the cursor
3777         in I-beam by traversing the composed tree instead.
3778
3779         Test: fast/shadow-dom/click-text-inside-linked-slot.html
3780
3781         * dom/Node.cpp:
3782         (WebCore::Node::enclosingLinkEventParentOrSelf): Fixed the cursor problem.
3783         * page/EventHandler.cpp:
3784         (WebCore::EventHandler::updateMouseEventTargetNode): Fixed the activation problem.
3785
3786 2016-09-29  Sam Weinig  <sam@webkit.org>
3787
3788         Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
3789         <rdar://problem/27648683>
3790         https://bugs.webkit.org/show_bug.cgi?id=162735
3791
3792         Reviewed by Dan Bernstein.
3793
3794         * platform/spi/cf/CFNetworkSPI.h:
3795         Forward declare _sourceApplicationSecondaryIdentifier and _CTDataConnectionServiceType
3796
3797 2016-09-29  Antti Koivisto  <antti@apple.com>
3798
3799         Remove addSubresourceStyleURLs functions
3800         https://bugs.webkit.org/show_bug.cgi?id=162731
3801
3802         Reviewed by Ryosuke Niwa.
3803
3804         Use the generic std::function taking traverseSubresources instead. This prevents bugs caused by the code paths
3805         not being in sync.
3806
3807         These functions are only used by the legacy webarchive code to gather URLs to locate CachedResources from the memory cache.
3808         This can be improved further by returning the cached resources themselves instead of the URLs.
3809
3810         * css/CSSFontFaceSrcValue.cpp:
3811         (WebCore::CSSFontFaceSrcValue::addSubresourceStyleURLs): Deleted.
3812         * css/CSSFontFaceSrcValue.h:
3813         * css/CSSPrimitiveValue.cpp:
3814         (WebCore::CSSPrimitiveValue::addSubresourceStyleURLs): Deleted.
3815         * css/CSSPrimitiveValue.h:
3816         * css/CSSReflectValue.cpp:
3817         (WebCore::CSSReflectValue::addSubresourceStyleURLs): Deleted.
3818         * css/CSSReflectValue.h:
3819         * css/CSSValue.cpp:
3820         (WebCore::CSSValue::addSubresourceStyleURLs): Deleted.
3821         * css/CSSValue.h:
3822         * css/CSSValueList.cpp:
3823         (WebCore::CSSValueList::addSubresourceStyleURLs): Deleted.
3824         * css/CSSValueList.h:
3825         * css/StyleProperties.cpp:
3826         (WebCore::StyleProperties::addSubresourceStyleURLs): Deleted.
3827         * css/StyleProperties.h:
3828         * css/StyleRuleImport.h:
3829         * css/StyleSheetContents.cpp:
3830         (WebCore::StyleSheetContents::traverseSubresources):
3831
3832             Fix a bug where this would miss @import rules in @imported stylesheets.
3833             Include the CachedResource for the imported stylesheet itself.
3834
3835             Tested by the test cases under LayoutTests/webarchive
3836
3837         (WebCore::StyleSheetContents::addSubresourceStyleURLs): Deleted.
3838         * css/StyleSheetContents.h:
3839         * dom/StyledElement.cpp:
3840         (WebCore::StyledElement::addSubresourceAttributeURLs):
3841         * html/HTMLLinkElement.cpp:
3842         (WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
3843         * html/HTMLStyleElement.cpp:
3844         (WebCore::HTMLStyleElement::addSubresourceAttributeURLs):
3845
3846 2016-09-29  Brent Fulgham  <bfulgham@apple.com>
3847
3848         [Win][Direct2D] Add D2D Font handling code
3849         https://bugs.webkit.org/show_bug.cgi?id=162712
3850
3851         Reviewed by Brent Fulgham.
3852
3853         This patch lands a set of new files that implement 
3854
3855         No new tests until complete backend lands.
3856
3857         * platform/graphics/Font.h:
3858         * platform/graphics/FontCascade.h:
3859         (WebCore::FontCascade::syntheticObliqueAngle): Added helper function.
3860         * platform/graphics/FontPlatformData.h:
3861         (WebCore::FontPlatformData::dwFont): Added.
3862         (WebCore::FontPlatformData::dwFontFace): Ditto.
3863         * platform/graphics/GlyphBuffer.h:
3864         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3865         (WebCore::FontCascade::drawGlyphs): Use helper function.
3866         * platform/graphics/win/FontCGWin.cpp:
3867         (WebCore::FontCascade::drawGlyphs): Ditto.
3868         * platform/graphics/win/FontCacheWin.cpp:
3869         (WebCore::FontCache::createFontPlatformData): Add case for Direct2D.
3870         * platform/graphics/win/FontCascadeDirect2D.cpp: Added.
3871         * platform/graphics/win/FontCustomPlatformData.cpp:
3872         (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Fix whitespace.
3873         (WebCore::FontCustomPlatformData::fontPlatformData): Add Direct2D case.
3874         * platform/graphics/win/FontPlatformDataCGWin.cpp:
3875         (WebCore::FontPlatformData::FontPlatformData): Clean up C++ initializers.
3876         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
3877         (WebCore::FontPlatformData::FontPlatformData): Ditto.
3878         * platform/graphics/win/FontPlatformDataDirect2D.cpp: Added.
3879         * platform/graphics/win/FontPlatformDataWin.cpp:
3880         (WebCore::FontPlatformData::FontPlatformData): Clean up C++ initializers.
3881         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp: Added.
3882         * platform/graphics/win/SimpleFontDataDirect2D.cpp: Added.
3883         * platform/graphics/win/TextAnalyzerHelper.cpp: Added.
3884         * platform/graphics/win/TextAnalyzerHelper.h: Added.
3885
3886 2016-09-29  Alex Christensen  <achristensen@webkit.org>
3887
3888         URLParser should fail to parse unclosed IPv6 addresses
3889         https://bugs.webkit.org/show_bug.cgi?id=162715
3890
3891         Reviewed by Tim Horton.
3892
3893         Covered by new API tests.
3894
3895         * platform/URLParser.cpp:
3896         (WebCore::URLParser::parseHostAndPort):
3897
3898 2016-09-29  Alex Christensen  <achristensen@webkit.org>
3899
3900         URLParser should ignore tabs at all possible locations
3901         https://bugs.webkit.org/show_bug.cgi?id=162711
3902
3903         Reviewed by Tim Horton.
3904
3905         The URL spec says to remove all tabs and newlines before parsing a URL.
3906         To reduce passes on the URL and copies of data, I chose to just ignore them every time I increment the iterator.
3907         This is fragile, but faster.  It can be completely tested, though.  That is what this patch does.
3908
3909         Covered by an addition to the API tests that tries inserting one tab at each location of each test.
3910
3911         * platform/URLParser.cpp:
3912         (WebCore::URLParser::advance):
3913         (WebCore::URLParser::isWindowsDriveLetter):
3914         (WebCore::URLParser::appendWindowsDriveLetter):
3915         (WebCore::URLParser::isPercentEncodedDot):
3916         (WebCore::URLParser::isSingleDotPathSegment):
3917         (WebCore::URLParser::isDoubleDotPathSegment):
3918         (WebCore::URLParser::consumeSingleDotPathSegment):
3919         (WebCore::URLParser::consumeDoubleDotPathSegment):
3920         (WebCore::URLParser::checkLocalhostCodePoint):
3921         (WebCore::URLParser::isAtLocalhost):
3922         (WebCore::URLParser::isLocalhost):
3923         (WebCore::URLParser::URLParser):
3924         (WebCore::URLParser::parse):
3925         (WebCore::isPercentEncodedDot): Deleted.
3926         (WebCore::isSingleDotPathSegment): Deleted.
3927         (WebCore::isDoubleDotPathSegment): Deleted.
3928         (WebCore::consumeSingleDotPathSegment): Deleted.
3929         (WebCore::consumeDoubleDotPathSegment): Deleted.
3930         * platform/URLParser.h:
3931         (WebCore::URLParser::advance):
3932
3933 2016-09-29  Simon Fraser  <simon.fraser@apple.com>
3934
3935         Fix hit testing on display:block <svg> elements
3936         https://bugs.webkit.org/show_bug.cgi?id=162717
3937         rdar://problem/23261130
3938
3939         Reviewed by Zalan Bujtas.
3940
3941         RenderSVGRoot::nodeAtPoint() needs to test for both the HitTestBlockBackground and
3942         HitTestChildBlockBackground phases, since we only get the HitTestChildBlockBackground
3943         phase when the <svg> is a block. This is similar to code in RenderTable::nodeAtPoint(),
3944         and matches Blink code.
3945         
3946         This fixes the point dragging on http://anthonydugois.com/svg-path-builder/.
3947
3948         Test: svg/hittest/block-svg.html
3949
3950         * rendering/svg/RenderSVGRoot.cpp:
3951         (WebCore::RenderSVGRoot::nodeAtPoint):
3952
3953 2016-09-29  Chris Dumez  <cdumez@apple.com>
3954
3955         Assigning non-numeric to input.minlength should set minlength to 0
3956         https://bugs.webkit.org/show_bug.cgi?id=162727
3957
3958         Reviewed by Ryosuke Niwa.
3959
3960         There was a typo when we were updating the m_minLength member from the 'min'
3961         content attribute instead of the 'minlength' one.
3962
3963         Test: imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/minlength.html.
3964
3965         * html/HTMLInputElement.cpp:
3966         (WebCore::HTMLInputElement::parseAttribute):
3967
3968 2016-09-29  Chris Dumez  <cdumez@apple.com>
3969
3970         [Web IDL] Fix overload resolution when the distinguishing argument is a Window
3971         https://bugs.webkit.org/show_bug.cgi?id=162728
3972
3973         Reviewed by Ryosuke Niwa.
3974
3975         Fix overload resolution when the distinguishing argument is a Window.
3976         Window is special because we could have a window or a proxy to the
3977         Window (JSDOMWindowShell).
3978
3979         * bindings/scripts/CodeGeneratorJS.pm:
3980         (GenerateOverloadedFunctionOrConstructor):
3981         * bindings/scripts/test/JS/JSTestObj.cpp:
3982         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
3983         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
3984         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
3985         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
3986         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod13):
3987         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
3988         * bindings/scripts/test/TestObj.idl:
3989
3990 2016-09-29  Per Arne Vollan  <pvollan@apple.com>
3991
3992         [Win] Compile fix.
3993         https://bugs.webkit.org/show_bug.cgi?id=162262
3994
3995         Reviewed by Anders Carlsson.
3996
3997         If CoreText.h is included, we will get redefinition compile errors on some older SDK
3998         versions. 
3999
4000         * platform/spi/win/CoreTextSPIWin.h:
4001
4002 2016-09-29  Carlos Garcia Campos  <cgarcia@igalia.com>
4003
4004         [SOUP] Remove WebCoreSynchronousLoader from ResourceHandleSoup
4005         https://bugs.webkit.org/show_bug.cgi?id=162723
4006
4007         Reviewed by Sergio Villar Senin.
4008
4009         Since all soup based ports switched to NetworkProcess this is dead code.
4010
4011         * platform/network/soup/ResourceHandleSoup.cpp:
4012         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
4013
4014 2016-09-29  Nan Wang  <n_wang@apple.com>
4015