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