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