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