Prefer eglGetPlatformDisplay to eglGetDisplay
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-10-20  Adam Jackson  <ajax@redhat.com>
2
3         Prefer eglGetPlatformDisplay to eglGetDisplay
4         https://bugs.webkit.org/show_bug.cgi?id=163333
5
6         Reviewed by Carlos Garcia Campos.
7
8         eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations
9         do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL
10         what kind of display it is, so let's use it.
11
12         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
13         (WebCore::PlatformDisplayWayland::initialize):
14         * platform/graphics/x11/PlatformDisplayX11.cpp:
15         (WebCore::PlatformDisplayX11::initializeEGLDisplay):
16
17 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
18
19         [GTK] Avoid including egl.h headers in internal headers
20         https://bugs.webkit.org/show_bug.cgi?id=163722
21
22         Reviewed by Žan Doberšek.
23
24         egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
25         to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
26         eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
27         default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
28         for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
29         the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
30         include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.
31
32         * PlatformGTK.cmake:
33         * platform/graphics/GLContext.cpp:
34         (WebCore::GLContext::createContextForWindow):
35         * platform/graphics/GLContext.h:
36         * platform/graphics/egl/GLContextEGL.cpp:
37         (WebCore::GLContextEGL::createWindowContext):
38         (WebCore::GLContextEGL::createContext):
39         (WebCore::GLContextEGL::~GLContextEGL):
40         * platform/graphics/egl/GLContextEGL.h:
41         * platform/graphics/egl/GLContextEGLWayland.cpp: Added.
42         (WebCore::GLContextEGL::GLContextEGL):
43         (WebCore::GLContextEGL::createWindowSurfaceWayland):
44         (WebCore::GLContextEGL::createWaylandContext):
45         (WebCore::GLContextEGL::destroyWaylandWindow):
46         * platform/graphics/egl/GLContextEGLX11.cpp: Added.
47         (WebCore::GLContextEGL::GLContextEGL):
48         (WebCore::GLContextEGL::createWindowSurfaceX11):
49         (WebCore::GLContextEGL::createPixmapContext):
50         * platform/graphics/glx/GLContextGLX.cpp:
51         (WebCore::GLContextGLX::createWindowContext):
52         (WebCore::GLContextGLX::createContext):
53         (WebCore::GLContextGLX::GLContextGLX):
54         * platform/graphics/glx/GLContextGLX.h:
55         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
56         * platform/graphics/x11/PlatformDisplayX11.cpp:
57
58 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
59
60         [GTK] Avoid strstr() when checking (E)GL extensions
61         https://bugs.webkit.org/show_bug.cgi?id=161958
62
63         Reviewed by Žan Doberšek.
64
65         Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension
66         list, and use it instead of strstr().
67
68         * platform/graphics/GLContext.cpp:
69         (WebCore::GLContext::isExtensionSupported):
70         * platform/graphics/GLContext.h:
71         * platform/graphics/egl/GLContextEGL.cpp:
72         (WebCore::GLContextEGL::createSurfacelessContext):
73         * platform/graphics/glx/GLContextGLX.cpp:
74         (WebCore::hasSGISwapControlExtension):
75
76 2016-10-20  Per Arne Vollan  <pvollan@apple.com>
77
78         [Win][Direct2D] Implement ImageBufferData::getData.
79         https://bugs.webkit.org/show_bug.cgi?id=163668
80
81         Reviewed by Brent Fulgham.
82
83         Render data to a bitmap in system memory, which data can be read from.
84
85         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
86         (WebCore::ImageBufferData::getData):
87         * platform/graphics/win/ImageBufferDirect2D.cpp:
88         (WebCore::ImageBuffer::ImageBuffer):
89
90 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
91
92         Wrong use of EGL_DEPTH_SIZE
93         https://bugs.webkit.org/show_bug.cgi?id=155536
94
95         Reviewed by Michael Catanzaro.
96
97         What happens here is that the driver doesn't implement EGL_DEPTH_SIZE and the default value, which is 0, is
98         returned. Then XCreatePixmap fails because 0 is not a valid depth. The thing is that even if EGL_DEPTH_SIZE or
99         EGL_BUFFER_SIZE returned a valid depth, it still might not be supported by the default screen and XCreatePixmap
100         can fail. What we need to ensure is that the depth we pass is compatible with the X display, not only with the
101         EGL config, to avoid failures when creating the pixmap. So, we can use EGL_NATIVE_VISUAL_ID instead, and
102         then ask X for the visual info for that id. If it isn't found then we just return before creating the pixmap,
103         but if the visual is found then we can be sure that the depth of the visual will not make the pixmap creation
104         fail. However, with the driver I'm using it doesn't matter how we create the pixmap that eglCreatePixmapSurface
105         always fails, again with X errors that are fatal by default. Since the driver is not free, I assume it doesn't
106         support eglCreatePixmapSurface or it's just buggy, so the only option we have here is trap the x errors and
107         ignore them. It turns out that the X errors are not fatal in this case, because eglCreatePixmapSurface ends up
108         returning a surface, and since these are offscreen contexts, it doesn't really matter if they contain an
109         invalid pixmap, because we never do swap buffer on them, so just ignoring the X errors fixes the crashes and
110         makes everythig work. This patch adds a helper class XErrorTrapper that allows to trap XErrors and decide what
111         to do with them (ignore, warn or crash) or even not consider a particular set of errors as errors.
112
113         * PlatformEfl.cmake: Add new file to compilation.
114         * PlatformGTK.cmake: Ditto.
115         * platform/graphics/egl/GLContextEGL.cpp:
116         (WebCore::GLContextEGL::createPixmapContext): Use EGL_NATIVE_VISUAL_ID instead of EGL_DEPTH_SIZE to figure out
117         the depth to be passed to XCreatePixmap. Also use the XErrorTrapper class to ignore all BadDrawable errors
118         produced by eglCreatePixmapSurface() and only show a warning about all other X errors.
119         * platform/graphics/x11/XErrorTrapper.cpp: Added.
120         (WebCore::xErrorTrappersMap):
121         (WebCore::XErrorTrapper::XErrorTrapper):
122         (WebCore::XErrorTrapper::~XErrorTrapper):
123         (WebCore::XErrorTrapper::errorCode):
124         (WebCore::XErrorTrapper::errorEvent):
125         * platform/graphics/x11/XErrorTrapper.h: Added.
126         (WebCore::XErrorTrapper::XErrorTrapper):
127
128 2016-10-20  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
129
130         WebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
131         https://bugs.webkit.org/show_bug.cgi?id=146232
132
133         Update MediaStreamTrackEvent IDL as per specification.
134
135         Reviewed by Darin Adler.
136
137         No additional test required, rebase existings tests.
138
139         * Modules/mediastream/MediaStreamTrackEvent.idl:
140
141 2016-10-19  Antoine Quint  <graouts@apple.com>
142
143         [Modern Media Controls] Media Controller: mute support
144         https://bugs.webkit.org/show_bug.cgi?id=163677
145         <rdar://problem/28851582>
146
147         Reviewed by Dean Jackson.
148
149         We introduce the MuteSupport class which brings support for muting the media
150         by clicking on the mute button in the media controls and correctly reflecting
151         the media's muted state should the media be muted via the media API.
152
153         Tests: media/modern-media-controls/mute-support/mute-support-button-click.html
154                media/modern-media-controls/mute-support/mute-support-media-api.html
155                media/modern-media-controls/mute-support/mute-support-muted.html
156
157         * Modules/modern-media-controls/media/media-controller.js:
158         (MediaController):
159         * Modules/modern-media-controls/media/mute-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
160         (MuteSupport.prototype.get control):
161         (MuteSupport.prototype.get mediaEvents):
162         (MuteSupport.prototype.buttonWasClicked):
163         (MuteSupport.prototype.syncControl):
164         (MuteSupport):
165         * WebCore.xcodeproj/project.pbxproj:
166         * rendering/RenderThemeMac.mm:
167         (WebCore::RenderThemeMac::mediaControlsScript):
168
169 2016-10-19  Alex Christensen  <achristensen@webkit.org>
170
171         Revert r207151
172         https://bugs.webkit.org/show_bug.cgi?id=163675
173
174         Reviewed by Brent Fulgham.
175
176         This code is still useful for comparison with Windows.  I'll remove it again soon.
177
178         No new tests.  No change in behavior.
179
180         * WebCore.xcodeproj/project.pbxproj:
181         * WebCorePrefix.h:
182         * loader/DocumentLoader.h:
183         * loader/EmptyClients.h:
184         * loader/FrameLoaderClient.h:
185         * loader/ResourceLoader.cpp:
186         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
187         * loader/ResourceLoader.h:
188         * loader/SubresourceLoader.h:
189         * loader/cf/ResourceLoaderCFNet.cpp:
190         * loader/cocoa/SubresourceLoaderCocoa.mm:
191         (WebCore::SubresourceLoader::willCacheResponse):
192         * loader/mac/DocumentLoaderMac.cpp:
193         * loader/mac/ResourceLoaderMac.mm:
194         (WebCore::ResourceLoader::willCacheResponse):
195         * page/mac/PageMac.mm:
196         (WebCore::Page::platformInitialize):
197         (WebCore::Page::addSchedulePair):
198         (WebCore::Page::removeSchedulePair):
199         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
200         (WebCore::WebCoreNSURLAuthenticationChallengeClient::create):
201         (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient):
202         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
203         * platform/mac/WebCoreSystemInterface.h:
204         * platform/network/NetworkStorageSession.h:
205         * platform/network/ProtectionSpace.h:
206         * platform/network/ProtectionSpaceBase.cpp:
207         * platform/network/ResourceHandle.cpp:
208         * platform/network/ResourceHandle.h:
209         * platform/network/ResourceHandleClient.cpp:
210         * platform/network/ResourceHandleClient.h:
211         * platform/network/ResourceHandleInternal.h:
212         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
213         * platform/network/ResourceRequestBase.cpp:
214         * platform/network/cf/AuthenticationCF.cpp:
215         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
216         (WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
217         (WebCore::AuthenticationChallenge::authenticationClient): Deleted.
218         (WebCore::AuthenticationChallenge::platformCompare): Deleted.
219         (WebCore::createCF): Deleted.
220         (WebCore::core): Deleted.
221         * platform/network/cf/AuthenticationCF.h:
222         * platform/network/cf/AuthenticationChallenge.h:
223         * platform/network/cf/CookieJarCFNet.cpp:
224         * platform/network/cf/CredentialStorageCFNet.cpp:
225         (WebCore::CredentialStorage::getFromPersistentStorage):
226         (WebCore::CredentialStorage::saveToPersistentStorage):
227         * platform/network/cf/LoaderRunLoopCF.cpp:
228         * platform/network/cf/LoaderRunLoopCF.h:
229         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
230         (WebCore::NetworkStorageSession::cookieStorage):
231         * platform/network/cf/ProtectionSpaceCFNet.cpp:
232         * platform/network/cf/ProtectionSpaceCFNet.h:
233         * platform/network/cf/ResourceError.h:
234         * platform/network/cf/ResourceErrorCF.cpp:
235         * platform/network/cf/ResourceHandleCFNet.cpp:
236         (WebCore::shouldSniffConnectionProperty):
237         (WebCore::ResourceHandle::createCFURLConnection):
238         (WebCore::ResourceHandle::start):
239         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
240         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
241         (WebCore::ResourceHandle::receivedCredential):
242         (WebCore::ResourceHandle::schedule):
243         (WebCore::ResourceHandle::unschedule):
244         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
245         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
246         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
247         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
248         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
249         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
250         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
251         * platform/network/cf/ResourceRequest.h:
252         (WebCore::ResourceRequest::encodingRequiresPlatformData):
253         * platform/network/cf/ResourceRequestCFNet.cpp:
254         (WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction):
255         (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
256         (WebCore::ResourceRequest::doUpdatePlatformRequest):
257         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
258         (WebCore::ResourceRequest::doUpdateResourceRequest):
259         (WebCore::ResourceRequest::setStorageSession):
260         * platform/network/cf/ResourceRequestCFNet.h:
261         * platform/network/cf/ResourceResponse.h:
262         * platform/network/cf/ResourceResponseCFNet.cpp:
263         (WebCore::ResourceResponse::cfURLResponse):
264         * platform/network/cf/SynchronousLoaderClientCFNet.cpp:
265         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
266         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
267         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
268         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
269         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
270         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
271         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
272         * platform/network/cocoa/CredentialCocoa.h:
273         * platform/network/cocoa/CredentialCocoa.mm:
274         (WebCore::Credential::Credential):
275         (WebCore::Credential::cfCredential):
276         * platform/network/cocoa/ProtectionSpaceCocoa.h:
277         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
278         (WebCore::ProtectionSpace::ProtectionSpace):
279         (WebCore::ProtectionSpace::cfSpace):
280         * platform/network/cocoa/ResourceRequestCocoa.mm:
281         (WebCore::ResourceRequest::nsURLRequest):
282         * platform/network/cocoa/ResourceResponseCocoa.mm:
283         (WebCore::ResourceResponse::platformCertificateInfo):
284         (WebCore::ResourceResponse::nsURLResponse):
285         (WebCore::ResourceResponse::ResourceResponse):
286         * platform/network/ios/QuickLook.h:
287         * platform/network/ios/QuickLook.mm:
288         (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]):
289         (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]):
290         (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]):
291         (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]):
292         (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]):
293         (-[WebQuickLookHandleAsDelegate detachHandle]):
294         (WebCore::QuickLookHandle::create):
295         (WebCore::QuickLookHandle::cfResponse):
296         * platform/network/mac/AuthenticationMac.mm:
297         (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]):
298         (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]):
299         (WebCore::core):
300         (WebCore::mac):
301         * platform/network/mac/CookieJarMac.mm:
302         (WebCore::setCookiesFromDOM):
303         (WebCore::addCookie):
304         (WebCore::cookieStorage):
305         * platform/network/mac/CredentialStorageMac.mm:
306         * platform/network/mac/FormDataStreamMac.h:
307         * platform/network/mac/FormDataStreamMac.mm:
308         * platform/network/mac/ResourceErrorMac.mm:
309         (NSErrorFromCFError):
310         (WebCore::ResourceError::ResourceError):
311         (WebCore::ResourceError::nsError):
312         (WebCore::ResourceError::operator NSError *):
313         * platform/network/mac/ResourceHandleMac.mm:
314         (WebCore::ResourceHandle::getConnectionTimingData):
315         * platform/network/mac/ResourceRequestMac.mm: Added.
316         (WebCore::ResourceRequest::ResourceRequest):
317         (WebCore::ResourceRequest::updateNSURLRequest):
318         * platform/network/mac/SynchronousLoaderClient.mm:
319         * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
320         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
321         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
322         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
323         * platform/network/mac/WebCoreURLResponse.mm:
324         * platform/win/TemporaryLinkStubs.cpp:
325         * testing/js/WebCoreTestSupportPrefix.h:
326
327 2016-10-19  Jer Noble  <jer.noble@apple.com>
328
329         REGRESSION (r206025): All YouTube videos play with black bars on all four sides
330         https://bugs.webkit.org/show_bug.cgi?id=163308
331
332         Reviewed by Darin Adler.
333
334         Test: media/media-source/media-source-resize.html
335
336         After r206025, we do not fire resize events when the size change notification happens equal-
337         to-or-before the current time, which can happen at the very beginning of a stream. Take care
338         of this case by checking that the target time isn't actually in the past inside of
339         sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no
340         previous size (such as after a flush due to a seek).
341
342         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
343         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
344         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
345         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
346         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
347         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
348         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
349
350 2016-10-19  Nan Wang  <n_wang@apple.com>
351
352         AX: [Mac] Mark element AXAPI should comform to specs
353         https://bugs.webkit.org/show_bug.cgi?id=163707
354
355         Reviewed by Chris Fleizach.
356
357         Created a new role for mark elements on Mac and exposed the role
358         description.
359
360         Changes are covered in modified test expectaions.
361
362         * English.lproj/Localizable.strings:
363         * accessibility/AccessibilityObject.h:
364         * accessibility/AccessibilityRenderObject.cpp:
365         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
366         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
367         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
368         * accessibility/mac/AccessibilityObjectMac.mm:
369         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
370         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
371         (createAccessibilityRoleMap):
372         (-[WebAccessibilityObjectWrapper roleDescription]):
373         * platform/LocalizedStrings.cpp:
374         (WebCore::AXMarkText):
375         * platform/LocalizedStrings.h:
376
377 2016-10-19  Alex Christensen  <achristensen@webkit.org>
378
379         Re-enable URLParser for non-Safari Cocoa apps after r207321
380         https://bugs.webkit.org/show_bug.cgi?id=163690
381
382         Reviewed by Darin Adler.
383
384         I disabled the URLParser for non-Safari applications in r207305
385         to give me time to make URLParser more compatible, which I did in r207321
386
387         Updated some API tests which will be investigated in 
388         https://bugs.webkit.org/show_bug.cgi?id=163127
389
390         * platform/URLParser.cpp:
391         (WebCore::URLParser::setEnabled):
392         (WebCore::URLParser::enabled):
393         * testing/js/WebCoreTestSupport.cpp:
394         (WebCoreTestSupport::setURLParserEnabled): Deleted.
395         * testing/js/WebCoreTestSupport.h:
396
397 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
398
399         CSS font-variation-settings does not handle uppercase axis names in variable fonts
400         https://bugs.webkit.org/show_bug.cgi?id=163546
401
402         Reviewed by Dean Jackson.
403
404         Remove the extra toASCIILower() call.
405
406         Test: fast/text/variations/case-axis-names.html
407
408         * css/parser/CSSParser.cpp:
409         (WebCore::CSSParser::parseFontVariationTag):
410
411 2016-10-19  Anders Carlsson  <andersca@apple.com>
412
413         Remove m_redirectURLs from HistoryItem
414         https://bugs.webkit.org/show_bug.cgi?id=163704
415
416         Reviewed by Dan Bernstein.
417
418         * history/HistoryItem.cpp:
419         (WebCore::HistoryItem::HistoryItem):
420         (WebCore::HistoryItem::reset):
421         * history/HistoryItem.h:
422
423 2016-10-19  Joone Hur  <joone.hur@intel.com>
424
425         Add a plain space instead of &nbsp; between text nodes
426         https://bugs.webkit.org/show_bug.cgi?id=123163
427
428         Reviewed by Ryosuke Niwa.
429
430         When we rebalance white spaces, &nbsp; can be added as space
431         under some conditions. This patch adds a condition that the next
432         sibling text node should not exist.
433
434         No new tests, updated existing test.
435
436         * editing/CompositeEditCommand.cpp:
437         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
438         * editing/htmlediting.cpp:
439         (WebCore::stringWithRebalancedWhitespace):
440         * editing/htmlediting.h:
441
442 2016-10-19  Sam Weinig  <sam@webkit.org>
443
444         Add support for sequences and dictionaries in unions
445         https://bugs.webkit.org/show_bug.cgi?id=163695
446
447         Reviewed by Chris Dumez.
448
449         Tests:
450          - Updated js/dom/webidl-type-mapping.html
451
452         * bindings/generic/IDLTypes.h:
453         Add additional helper predicates and fix formatting.
454
455         * bindings/js/JSDOMBinding.h:
456         Export hasIteratorMethod for use in testing.
457
458         * bindings/js/JSDOMConvert.h:
459         - Change return type of Converter<IDLDictionary<T>> to T, from Optional<T>.
460         - Add support for unions conversion step 12 (parts 1-3).
461
462         * bindings/scripts/CodeGeneratorJS.pm:
463         (GenerateDefaultValue):
464         Support complex default value computations for unions using the convert infrastructure.
465
466         (GenerateParametersCheck):
467         (GenerateConstructorDefinition):
468         Remove incorrect .value() calls now that Converter<IDLDictionary<T>> returns T.
469
470         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
471         * bindings/scripts/test/JS/JSTestObj.cpp:
472         Update bindings test results.
473
474         * testing/TypeConversions.h:
475         (WebCore::TypeConversions::setTypeConversionsDictionary):
476         (WebCore::TypeConversions::typeConversionsDictionaryLongValue):
477         (WebCore::TypeConversions::typeConversionsDictionaryStringValue):
478         (WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
479         (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
480         * testing/TypeConversions.idl:
481         Add some complex types to allow testing IDL conversions from tests.
482
483 2016-10-19  Ryosuke Niwa  <rniwa@webkit.org>
484
485         Annotate more DOM and HTML IDLs with CEReactions
486         https://bugs.webkit.org/show_bug.cgi?id=163653
487
488         Reviewed by Darin Adler.
489
490         Added CEReactions to more IDL files.
491
492         Test: fast/custom-elements/reactions-for-webkit-extensions.html
493
494         * bindings/js/JSDOMStringMapCustom.cpp:
495         (WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
496         adding CEReactions in IDL.
497         (WebCore::JSDOMStringMap::putDelegate): Ditto.
498         * dom/Document.idl:
499         * dom/Element.idl:
500         * html/HTMLElement.idl:
501         * page/DOMSelection.idl:
502
503 2016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
504
505         Unreviewed, rolling out r207557.
506
507         This change caused animations/font-variations tests to time
508         out on pre-Sierra Macs.
509
510         Reverted changeset:
511
512         "[macOS] [iOS] Disable variation fonts on macOS El Capitan and
513         iOS 9"
514         https://bugs.webkit.org/show_bug.cgi?id=163374
515         http://trac.webkit.org/changeset/207557
516
517 2016-10-19  Dave Hyatt  <hyatt@apple.com>
518
519         [CSS Parser] Support -webkit-border-fit
520         https://bugs.webkit.org/show_bug.cgi?id=163687
521
522         Reviewed by Zalan Bujtas.
523
524         Add support for -webkit-border-fit to isValidKeywordPropertyAndValue.
525
526         * css/parser/CSSParserFastPaths.cpp:
527         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
528
529 2016-10-19  Dave Hyatt  <hyatt@apple.com>
530
531         [CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
532         https://bugs.webkit.org/show_bug.cgi?id=163685
533
534         Reviewed by Zalan Bujtas.
535
536         Class and ID parsing should be case-insensitive in quirks mode. Apply the same hack
537         that the old parser did and lowercase the class and ids in place.
538
539         * css/parser/CSSSelectorParser.cpp:
540         (WebCore::CSSSelectorParser::consumeId):
541         (WebCore::CSSSelectorParser::consumeClass):
542
543 2016-10-19  Nan Wang  <n_wang@apple.com>
544
545         AX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects + 600
546         https://bugs.webkit.org/show_bug.cgi?id=163682
547
548         Reviewed by Chris Fleizach.
549
550         There's a null pointer crash when we ask for startObject->parentObjectUnignored() in
551         AccessibilityObject::findMatchingObject. Added a null check for the startObject to fix that.
552
553         Test: accessibility/mac/search-predicate-crash.html
554
555         * accessibility/AccessibilityObject.cpp:
556         (WebCore::AccessibilityObject::findMatchingObjects):
557
558 2016-10-19  David Kilzer  <ddkilzer@apple.com>
559
560         Bug 163670: Refine assertions in WebCore::ImageData constructors
561         <https://webkit.org/b/163670>
562         <rdar://problem/27497338>
563
564         Reviewed by Brent Fulgham.
565
566         No new tests because there is no change in nominal behavior.
567
568         * html/ImageData.cpp:
569         (WebCore::ImageData::ImageData(const IntSize&)): Change to use
570         ASSERT() since the worst-case scenario here is a nullptr deref.
571         Switch to IntSize::area() to compute the area.
572         (WebCore::ImageData::ImageData(const IntSize&, Ref<Uint8ClampedArray>&&)):
573         Add ASSERT() identical to the previous constructor, and change
574         ASSERT_WITH_SECURITY_IMPLICATION() to only fire when m_data is
575         not nullptr and the length check fails.  Switch to
576         IntSize::area() to compute the area.
577
578 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
579
580         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
581         https://bugs.webkit.org/show_bug.cgi?id=163374
582
583         Reviewed by Darin Adler.
584
585         Because of platform lack of support for variations in in-memory fonts,
586         this feature should be disabled on the affected OSes.
587
588         No tests because there is no behavior change (on the relevant platforms).
589
590         * Configurations/FeatureDefines.xcconfig:
591
592 2016-10-19  Dave Hyatt  <hyatt@apple.com>
593
594         [CSS Parser] Fix background-position parsing
595         https://bugs.webkit.org/show_bug.cgi?id=163681
596
597         Reviewed by Dean Jackson.
598
599         The new parser has a more efficient parsed representation of background positions. When
600         background-position is "center" or when no length unit is specified for a dimension,
601         then rather than creating a pair, the new parser makes a singleton primitive value.
602
603         Patch the StyleBuilder code to handle this case, resolving center to (left,50%) or
604         (top,50%) as appropriate and also handling top/left without any associated length.
605
606         * css/CSSToStyleMap.cpp:
607         (WebCore::CSSToStyleMap::mapFillXPosition):
608         (WebCore::CSSToStyleMap::mapFillYPosition):
609
610 2016-10-19  Antoine Quint  <graouts@apple.com>
611
612         [Modern Media Controls] Media Controller: click-to-start support
613         https://bugs.webkit.org/show_bug.cgi?id=163659
614         <rdar://problem/28845656>
615
616         Reviewed by Dean Jackson.
617
618         We introduce the MediaControllerSupport class which will allow a number of media controller
619         features to be implemented by subclasses each devoted to implementing a specific subset of
620         media controller features. With this bug, we add the correct behavior for click-to-start,
621         only showing the start button under the right circumstances.
622
623         A MediaController object indicates which media control to attach click event listeners to
624         through the `control` property, and a list of media events it should register on the media
625         element through the `mediaEvents` property. Then, as the user interacts with the specified
626         control and the media, the Button delegation method `buttonWasClicked()` and the `syncControl()`
627         methods are called to allow for the media state to be correctly set and represented in the
628         media controls. Custom event handling for the specified events can also be achieved by
629         subclassing the `handleEvent()` method.
630
631         Tests: media/modern-media-controls/start-support/start-support-audio.html
632                media/modern-media-controls/start-support/start-support-autoplay.html
633                media/modern-media-controls/start-support/start-support-click-to-start.html
634                media/modern-media-controls/start-support/start-support-error.html
635                media/modern-media-controls/start-support/start-support-fullscreen.html
636                media/modern-media-controls/start-support/start-support-manual-play.html
637                media/modern-media-controls/start-support/start-support-no-source.html
638
639         * Modules/modern-media-controls/media/media-controller-support.js: Added.
640         (MediaControllerSupport):
641         (MediaControllerSupport.prototype.get control):
642         (MediaControllerSupport.prototype.get mediaEvents):
643         (MediaControllerSupport.prototype.buttonWasClicked):
644         (MediaControllerSupport.prototype.handleEvent):
645         (MediaControllerSupport.prototype.syncControl):
646         * Modules/modern-media-controls/media/media-controller.js:
647         (MediaController):
648         (MediaController.prototype.buttonWasClicked): Deleted.
649         * Modules/modern-media-controls/media/start-support.js: Added.
650         (StartSupport.prototype.get control):
651         (StartSupport.prototype.get mediaEvents):
652         (StartSupport.prototype.buttonWasClicked):
653         (StartSupport.prototype.handleEvent):
654         (StartSupport.prototype.syncControl):
655         (StartSupport.prototype._shouldShowStartButton):
656         (StartSupport):
657
658 2016-10-19  Aaron Chu  <aaron_chu@apple.com>
659
660         Web Inspector: AXI: expose computed tree node and heading level
661         https://bugs.webkit.org/show_bug.cgi?id=130825
662         <rdar://problem/16442349>
663
664         Reviewed by Joseph Pecoraro.
665
666         Exposing two new accessibility properties: Heading Level and Hierarchical Level.
667
668         Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html
669
670         * inspector/InspectorDOMAgent.cpp:
671         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
672
673 2016-10-19  Adam Bergkvist  <adam.bergkvist@ericsson.com>
674
675         WebRTC: Implement MediaEndpointPeerConnection::stop()
676         https://bugs.webkit.org/show_bug.cgi?id=163660
677
678         Reviewed by Philippe Normand.
679
680         Make MediaEndpointPeerConnection::stop() stop its MediaEndpoint.
681
682         Testing: This fix deals with cleanup and tearing down resources down in the platform layer
683         and is not covered by automated tests. It is however observable in the manual test added
684         in [1] where the remote videos should stop when the connections are closed.
685
686         [1] http://webkit.org/b/163327
687
688         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
689         (WebCore::MediaEndpointPeerConnection::stop):
690
691 2016-10-19  Dave Hyatt  <hyatt@apple.com>
692
693         [CSS Parser] Fix -webkit-mask-box-image parsing
694         https://bugs.webkit.org/show_bug.cgi?id=163676
695
696         Reviewed by Dean Jackson.
697
698         -webkit-mask-box-image is not a shorthand in our current code, so treat it the same as the legacy
699         -webkit-border-image.
700
701         * css/parser/CSSPropertyParser.cpp:
702         (WebCore::CSSPropertyParser::parseSingleValue):
703         (WebCore::CSSPropertyParser::parseShorthand):
704
705 2016-10-19  Carlos Alberto Lopez Perez  <clopez@igalia.com>
706
707         [GTK][EFL] Build fix after r207543.
708         https://bugs.webkit.org/show_bug.cgi?id=163671
709
710         Unreviewed.
711
712         Fix typo on the filename of the included header:
713         Mac filesystem is case insensitive, but Linux filesystems are case sensitive.
714
715         * css/parser/CSSPropertyParser.cpp:
716
717 2016-10-19  Zalan Bujtas  <zalan@apple.com>
718
719         Use anonymous table row for new child at RenderTableRow::addChild() if available.
720         https://bugs.webkit.org/show_bug.cgi?id=163651
721         <rdar://problem/28705022>
722
723         Reviewed by David Hyatt.
724
725         We should try to prevent the continuation siblings from getting separated and inserted into
726         wrapper renderers. It makes finding these continuation siblings difficult.
727         This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
728         beforeChild/new child. 
729
730         Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html
731
732         * rendering/RenderObject.cpp:
733         (WebCore::RenderObject::showRenderObject): Add continuation information.
734         * rendering/RenderTableRow.cpp:
735         (WebCore::RenderTableRow::addChild):
736
737 2016-10-19  Joseph Pecoraro  <pecoraro@apple.com>
738
739         Cleanup WebCore/workers
740         https://bugs.webkit.org/show_bug.cgi?id=163635
741
742         Reviewed by Chris Dumez.
743
744         * workers/*:
745         Cleanup like pragma once, nullptr, remove stale includes, declarations.
746
747 2016-10-19  Chris Dumez  <cdumez@apple.com>
748
749         MouseEvent's coordinates should be 0 for simulated clicks
750         https://bugs.webkit.org/show_bug.cgi?id=163648
751
752         Reviewed by Darin Adler.
753
754         MouseEvent's coordinates should be 0 / 0 for simulated clicks triggered
755         by JavaScript (i.e. via element.click()). This behavior matches Chrome
756         and Firefox.
757
758         WebKit was computing actual coordinates for the element which was
759         expensive, especially because computing  screenX / screenY required
760         a synchronous IPC with the UI process.
761
762         Test: fast/events/element-click-no-coords.html
763
764         * dom/Element.cpp:
765         (WebCore::Element::dispatchSimulatedClick):
766         * dom/SimulatedClick.cpp:
767         (WebCore::simulateMouseEvent):
768         (WebCore::simulateClick):
769         * dom/SimulatedClick.h:
770         * html/HTMLElement.cpp:
771         (WebCore::HTMLElement::click):
772
773 2016-10-19  Dave Hyatt  <hyatt@apple.com>
774
775         [CSS Parser] Fix transform parsing
776         https://bugs.webkit.org/show_bug.cgi?id=163671
777
778         Reviewed by Dean Jackson.
779
780         The new parser turned function names into CSSValueIDs and made CSSFunctionValue store them. This
781         meant it could be used to handle transform values, with the function name representing the
782         transform operation efficiently as a CSSValueID.
783
784         The old parser, however, creates WebKitCSSTransformValues. This value does not exist in the new
785         parser. Rather than forcing the old and new parser over to CSSFunctionValues, I opted to
786         just make the new parser build WebkitCSSTransformValues too.
787
788         The main reason I did this is that WebkitCSSTransformValue is actually exposed to the Web via
789         IDL. To be safe, I am not eliminating it (even though Blink has).
790
791         * css/parser/CSSPropertyParser.cpp:
792         (WebCore::consumeTranslate3d):
793         (WebCore::consumeNumbers):
794         (WebCore::consumePerspective):
795         (WebCore::transformOperationForCSSValueID):
796         (WebCore::consumeTransformValue):
797
798 2016-10-19  Darin Adler  <darin@apple.com>
799
800         Move XPath from ExceptionCode to Exception
801         https://bugs.webkit.org/show_bug.cgi?id=163656
802
803         Reviewed by Chris Dumez.
804
805         * dom/Document.cpp:
806         (WebCore::Document::createExpression): Use ExceptionOr.
807         (WebCore::Document::createNSResolver): Return Ref.
808         (WebCore::Document::evaluate): Use ExceptionOr.
809         * dom/Document.h: Updated for above changes.
810         * dom/Document.idl: Use non-legacy exceptions for the functions above.
811
812         * inspector/InspectorNodeFinder.cpp:
813         (WebCore::InspectorNodeFinder::searchUsingXPath): Call XPath functions
814         with new interface.
815
816         * xml/DOMParser.cpp:
817         (WebCore::DOMParser::DOMParser): Marked inline.
818         (WebCore::DOMParser::create): Moved here from header.
819         (WebCore::DOMParser::parseFromString): Use ExceptionOr.
820         * xml/DOMParser.h: Updated for above changes.
821         * xml/DOMParser.idl: Use non-legacy exception.
822
823         * xml/XPathEvaluator.cpp:
824         (WebCore::XPathEvaluator::createExpression): Use ExceptionOr.
825         (WebCore::XPathEvaluator::evaluate): Ditto.
826         * xml/XPathEvaluator.h: Updated for above changes.
827         * xml/XPathEvaluator.idl: Use non-legacy exceptions.
828
829         * xml/XPathExpression.cpp:
830         (WebCore::XPathExpression::createExpression): Use ExceptionOr.
831         (WebCore::XPathExpression::evaluate): Ditto.
832         * xml/XPathExpression.h: Updated for above changes.
833         * xml/XPathExpression.idl: Use non-legacy exceptions.
834
835         * xml/XPathGrammar.y: Added include of XPathStep.h.
836
837         * xml/XPathParser.cpp:
838         (WebCore::XPath::Parser::Parser): Initialize three scalar data members
839         in the class definition rather than here.
840         (WebCore::XPath::Parser::parseStatement): Use ExceptionOr.
841         * xml/XPathParser.h: Updated for above changes.
842
843         * xml/XPathResult.cpp:
844         (WebCore::XPathResult::XPathResult): Use a reference rather than a
845         pointer for the document. Alao initialize two scalar data members
846         in the class definition rather than here.
847         (WebCore::XPathResult::convertTo): Use ExceptionOr.
848         (WebCore::XPathResult::numberValue): Ditto.
849         (WebCore::XPathResult::stringValue): Ditto.
850         (WebCore::XPathResult::booleanValue): Ditto.
851         (WebCore::XPathResult::singleNodeValue): Ditto.
852         (WebCore::XPathResult::snapshotLength): Ditto.
853         (WebCore::XPathResult::iterateNext): Ditto.
854         (WebCore::XPathResult::snapshotItem): Ditto.
855         * xml/XPathResult.h: Updated for the changes above.
856         * xml/XPathResult.idl: Use non-legacy exceptions.
857
858 2016-10-19  Nan Wang  <n_wang@apple.com>
859
860         AX: [Mac] Meter element should use AXValueDescription to descrbe the status of the value
861         https://bugs.webkit.org/show_bug.cgi?id=163610
862
863         Reviewed by Chris Fleizach.
864
865         Exposed the goodness of the meter value in AXValueDescription.
866
867         Test: accessibility/mac/meter-gauge-value-description.html
868
869         * English.lproj/Localizable.strings:
870         * accessibility/AccessibilityProgressIndicator.cpp:
871         (WebCore::AccessibilityProgressIndicator::gaugeRegionValueDescription):
872         * accessibility/AccessibilityProgressIndicator.h:
873         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
874         (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]):
875         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
876         * platform/LocalizedStrings.cpp:
877         (WebCore::AXMeterGaugeRegionOptimumText):
878         (WebCore::AXMeterGaugeRegionSuboptimalText):
879         (WebCore::AXMeterGaugeRegionLessGoodText):
880         * platform/LocalizedStrings.h:
881
882 2016-10-19  Dave Hyatt  <hyatt@apple.com>
883
884         [CSS Parser] Fix named color parsing
885         https://bugs.webkit.org/show_bug.cgi?id=163662
886
887         Reviewed by Zalan Bujtas.
888
889         Named color parsing in the old parser for extended colors relied on constructing a Color with the
890         name and doing a lookup that way.
891
892         The new parser allows the back end to hold a primitive identifier value for extended colors.
893
894         StyleColor contains a helper function for looking up the correct color.
895
896         This patch switches both the old and the new parsers over to the new StyleColor function.
897
898         Also remove some asserts from the CSSSelectorList, since the new parser allows it to be empty and
899         detects parsing failure that way.
900
901         * css/CSSSelectorList.cpp:
902         (WebCore::CSSSelectorList::CSSSelectorList):
903         (WebCore::CSSSelectorList::operator=):
904         * css/StyleColor.cpp:
905         (WebCore::StyleColor::isColorKeyword):
906         * css/StyleResolver.cpp:
907         (WebCore::StyleResolver::colorFromPrimitiveValue):
908         (WebCore::colorForCSSValue): Deleted.
909
910 2016-10-19  Youenn Fablet  <youenn@apple.com>
911
912         Remove SecurityOrigin::taintsCanvas
913         https://bugs.webkit.org/show_bug.cgi?id=163594
914
915         Reviewed by Darin Adler.
916
917         No change of behavior.
918
919         * html/canvas/CanvasRenderingContext.cpp:
920         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
921         * page/SecurityOrigin.cpp:
922         (WebCore::SecurityOrigin::canReceiveDragData):
923         (WebCore::SecurityOrigin::taintsCanvas): Deleted.
924         * page/SecurityOrigin.h:
925
926 2016-10-18  Dave Hyatt  <hyatt@apple.com>
927
928         [CSS Parser] Fix compound selector parsing.
929         https://bugs.webkit.org/show_bug.cgi?id=163649
930
931         Reviewed by Darin Adler.
932
933         The new CSS parser is failing to handle compound selectors. The code has an assumption that the
934         first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
935         name used in Blink, RelationType, and to make the ordering be exactly the same.
936
937         * css/CSSSelector.h:
938         (WebCore::CSSSelector::relation):
939         (WebCore::CSSSelector::setRelation):
940         * css/SelectorChecker.cpp:
941         (WebCore::SelectorChecker::matchRecursively):
942         (WebCore::canMatchHoverOrActiveInQuirksMode):
943         (WebCore::SelectorChecker::determineLinkMatchType):
944         * css/SelectorFilter.cpp:
945         (WebCore::SelectorFilter::collectIdentifierHashes):
946         * css/parser/CSSParserValues.cpp:
947         (WebCore::CSSParserSelector::insertTagHistory):
948         (WebCore::CSSParserSelector::appendTagHistory):
949         * css/parser/CSSParserValues.h:
950         (WebCore::CSSParserSelector::setRelation):
951         * css/parser/CSSSelectorParser.cpp:
952         (WebCore::CSSSelectorParser::consumeComplexSelector):
953         (WebCore::CSSSelectorParser::consumeCombinator):
954         * css/parser/CSSSelectorParser.h:
955         * cssjit/SelectorCompiler.cpp:
956         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
957         (WebCore::SelectorCompiler::constructFragmentsInternal):
958
959 2016-10-19  Javier Fernandez  <jfernandez@igalia.com>
960
961         Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected
962         https://bugs.webkit.org/show_bug.cgi?id=163572
963
964         Reviewed by Sergio Villar Senin.
965
966         We only allow the new CSS Box Alignment syntax when the Grid Layout
967         feature is enabled. Due to flexbox backward compatibility we have
968         implemented a different code path for the style initial/default values
969         assignment. However, we have incorrectly resolved both align-content
970         and justify-content to 'flex-start' when grid layout is disabled.
971
972         This patch changes the approach, so we set 'normal' (the value specified
973         by the new syntax) for both properties, but using the values defined in
974         the old syntax (Flexbox specification) at computed style resolution.
975
976         Since 'stretch' is the default value for the align-content property, this
977         issue implies that any flexbox line with an undefined height will be
978         laid out incorrectly, if not explicitly set via CSS, because flex items
979         can't use the available height, even though they use 'stretch' for their
980         'align-self' properties.
981
982         Test: css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
983
984         * css/CSSComputedStyleDeclaration.cpp:
985         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
986         (WebCore::ComputedStyleExtractor::propertyValue):
987         * rendering/style/RenderStyle.h:
988         (WebCore::RenderStyle::initialContentAlignment):
989
990 2016-10-19  Carlos Alberto Lopez Perez  <clopez@igalia.com>
991
992         [GTK] REGRESSION(r207396) Build broken with Clang.
993         https://bugs.webkit.org/show_bug.cgi?id=163599
994
995         Suggested and reviewed by Darin Adler.
996
997         * css/CSSPrimitiveValue.cpp:
998         (WebCore::CSSPrimitiveValue::getStringValue):
999
1000 2016-10-19  Darin Adler  <darin@apple.com>
1001
1002         Try to fix build.
1003
1004         * page/PerformanceUserTiming.cpp: Add back class name; needed by some compiler versions.
1005
1006 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1007
1008         Unreviewed. Fix the build after r207522.
1009
1010         * page/PerformanceUserTiming.cpp: Include PerformanceTiming.h.
1011
1012 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1013
1014         Unreviewed. Fix the build after r207519.
1015
1016         The build error is:
1017         IDL ATTRIBUTE CHECKER ERROR: Unknown IDL attribute [PassContext] is found at TestRunner.idl.
1018
1019         Because PassContext was removed from IDLAttributes.txt in rr207519, but it's implemented by
1020         CodeGeneratorTestRunner.pm and used by TestRunner.idl.
1021
1022         * bindings/scripts/IDLAttributes.txt: Bring back PassContext.
1023
1024 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1025
1026         Unreviewed. Fix the build with GCC 4.9 after r207463.
1027
1028         Add constructors to MediaConstraintsData.
1029
1030         * Modules/mediastream/MediaConstraintsImpl.h:
1031         (WebCore::MediaConstraintsData::MediaConstraintsData):
1032
1033 2016-10-19  Jer Noble  <jer.noble@apple.com>
1034
1035         [Mac][MSE] Movies with a 'mehd' box have a zero-duration
1036         https://bugs.webkit.org/show_bug.cgi?id=163641
1037
1038         Reviewed by Darin Adler.
1039
1040         Test: media/media-source/media-source-init-segment-duration.html
1041
1042         The canonical (ISO/IEC 14496-12:2012) way to signal the duration of a fragmented media file is to add a
1043         'mehd' box to the 'mvex' container box specifying the duration of the fragment. Support this through the
1044         AVAsset -overallDurationHint property.
1045
1046         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1047         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1048         * platform/spi/mac/AVFoundationSPI.h:
1049
1050 2016-10-18  Darin Adler  <darin@apple.com>
1051
1052         Move many miscellaneous classes from ExceptionCode to Exception
1053         https://bugs.webkit.org/show_bug.cgi?id=163645
1054
1055         Reviewed by Ryosuke Niwa.
1056
1057         * bindings/js/JSCryptoCustom.cpp:
1058         (WebCore::JSCrypto::getRandomValues): Use propagateException.
1059         * bindings/js/JSDOMWindowCustom.cpp:
1060         (WebCore::handlePostMessage): Ditto.
1061         (WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
1062         (WebCore::JSDOMWindow::setInterval): Ditto.
1063         * bindings/js/JSStorageCustom.cpp:
1064         (WebCore::JSStorage::nameGetter): Use propagateException.
1065         (WebCore::JSStorage::deleteProperty): Ditto.
1066         (WebCore::JSStorage::getOwnPropertyNames): Ditto.
1067         (WebCore::JSStorage::putDelegate): Ditto.
1068
1069         * loader/appcache/DOMApplicationCache.cpp:
1070         (WebCore::DOMApplicationCache::update): Use ExceptionOr.
1071         (WebCore::DOMApplicationCache::swapCache): Ditto.
1072         * loader/appcache/DOMApplicationCache.h: Update for above changes.
1073         * loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
1074
1075         * page/Crypto.cpp:
1076         (WebCore::Crypto::getRandomValues): Use ExceptionOr.
1077         (WebCore::Crypto::webkitSubtle): Ditto.
1078         * page/Crypto.h: Updated for above changes.
1079         * page/Crypto.idl: Use non-legacy exceptions.
1080
1081         * page/DOMWindow.cpp:
1082         (WebCore::DOMWindow::DOMWindow): Initialize many data members in
1083         the class definition instead of here.
1084         (WebCore::DOMWindow::page): Use nullptr.
1085         (WebCore::DOMWindow::screen): Ditto.
1086         (WebCore::DOMWindow::crypto): Ditto.
1087         (WebCore::DOMWindow::locationbar): Ditto.
1088         (WebCore::DOMWindow::menubar): Ditto.
1089         (WebCore::DOMWindow::personalbar): Ditto.
1090         (WebCore::DOMWindow::scrollbars): Ditto.
1091         (WebCore::DOMWindow::statusbar): Ditto.
1092         (WebCore::DOMWindow::toolbar): Ditto.
1093         (WebCore::DOMWindow::applicationCache): Ditto.
1094         (WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
1095         (WebCore::DOMWindow::localStorage): Ditto.
1096         (WebCore::DOMWindow::postMessage): Ditto.
1097         (WebCore::DOMWindow::frameElement): Use nullptr.
1098         (WebCore::DOMWindow::self): Ditto.
1099         (WebCore::DOMWindow::opener): Ditto.
1100         (WebCore::DOMWindow::parent): Ditto.
1101         (WebCore::DOMWindow::top): Ditto.
1102         (WebCore::DOMWindow::getComputedStyle): Use Ref.
1103         (WebCore::DOMWindow::setTimeout): Use ExceptionOr.
1104         (WebCore::DOMWindow::setInterval): Ditto.
1105         (WebCore::didAddStorageEventListener): Use a reference instead of a
1106         pointer, and ignore return value instead of using IGNORE_EXCEPTION.
1107         (WebCore::DOMWindow::addEventListener): Pass reference to function above.
1108         (WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
1109         * page/DOMWindow.h: Updated for changes above. Also changed indentatation.
1110         * page/DOMWindow.idl: Use non-legacy exceptions.
1111
1112         * page/EventSource.cpp:
1113         (WebCore::EventSource::create): Use ExceptionOr.
1114         * page/EventSource.h: Updated for change above.
1115         * page/EventSource.idl: Use non-legacy exception.
1116
1117         * page/Location.cpp:
1118         (WebCore::Location::setProtocol): Use ExceptionOr.
1119         * page/Location.h: Updated for change above.
1120         * page/Location.idl: Use non-legacy exception.
1121
1122         * page/Performance.cpp:
1123         (WebCore::Performance::Performance): Remove unnecessary initialization of
1124         smart pointer to null, and moved initialization of m_resourceTimingBufferSize
1125         to the header.
1126         (WebCore::Performance::navigation): Made non-const and return a reference.
1127         (WebCore::Performance::timing): Ditto.
1128         (WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
1129         a const& instead of passing in a copy.
1130         (WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
1131         (WebCore::Performance::webkitClearMarks): Ditto.
1132         (WebCore::Performance::webkitMeasure): Ditto.
1133         (WebCore::Performance::webkitClearMeasures): Ditto.
1134         (WebCore::Performance::reduceTimeResolution): Use std::floor.
1135         * page/Performance.h: Updated for above changes. Removed unneeded includes.
1136         Made more things private. Removed unneeded reference counting of UserTiming.
1137         * page/Performance.idl: Use non-legacy exceptions.
1138
1139         * page/PerformanceUserTiming.cpp:
1140         (WebCore::restrictedMarkFunction): Removed unneeded class name.
1141         (WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
1142         (WebCore::UserTiming::mark): Use ExceptionOr.
1143         (WebCore::UserTiming::findExistingMarkStartTime): Ditto.
1144         (WebCore::UserTiming::measure): Ditto.
1145         (WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
1146         * page/PerformanceUserTiming.h: Updated for above changes. Removed reference
1147         counting since this is a single-owner object.
1148
1149         * page/UserMessageHandler.cpp:
1150         (WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
1151         * page/UserMessageHandler.h: Updated for above change.
1152         * page/UserMessageHandler.idl: Use non-legacy exception.
1153
1154         * storage/Storage.cpp:
1155         (WebCore::Storage::length): Use ExceptionOr.
1156         (WebCore::Storage::key): Ditto.
1157         (WebCore::Storage::getItem): Ditto.
1158         (WebCore::Storage::setItem): Ditto.
1159         (WebCore::Storage::removeItem): Ditto.
1160         (WebCore::Storage::clear): Ditto.
1161         (WebCore::Storage::contains): Ditto.
1162         * storage/Storage.h: Updated for above change.
1163         * storage/Storage.idl: Use non-legacy exceptions.
1164
1165         * storage/StorageEventDispatcher.cpp:
1166         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
1167         Updated for ExceptionOr.
1168         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
1169
1170 2016-10-18  Darin Adler  <darin@apple.com>
1171
1172         Move internal testing classes from ExceptionCode to Exception
1173         https://bugs.webkit.org/show_bug.cgi?id=163553
1174
1175         Reviewed by Ryosuke Niwa.
1176
1177         * bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
1178         is now needed in the testing library.
1179         * bindings/scripts/CodeGeneratorJS.pm:
1180         (NativeToJSValue): Added code to handle the jsArray case with an exception.
1181
1182         * css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
1183         CSS_SCROLL_SNAP is not enabled.
1184
1185         * dom/Element.cpp:
1186         (WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
1187         There is no reason it needs to be a RefPtr.
1188         * dom/Element.h: Updated for above change.
1189
1190         * svg/SVGPathStringBuilder.h: Exported class and made more public so it can
1191         be used in test code.
1192
1193         * svg/SVGPathUtilities.cpp:
1194         (WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
1195         so moved into there.
1196         (WebCore::buildStringFromPath): Deleted. Ditto.
1197         * svg/SVGPathUtilities.h: Removed buildStringFromPath.
1198
1199         * testing/InternalSettings.cpp: Simplified the guard macro and used the all
1200         capitals style that our style guide prescribes for non-function-like macros.
1201         (WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
1202         (WebCore::InternalSettings::resetToConsistentState): Updated since settings
1203         returns a reference.
1204         (WebCore::InternalSettings::settings): Changed to return a reference and
1205         assert that m_page is not null; functions all check m_page for null first.
1206         (WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
1207         ExceptionOr, do an m_page check, and use settings that returns a reference.
1208         (WebCore::InternalSettings::setStandardFontFamily): Ditto.
1209         (WebCore::InternalSettings::setSerifFontFamily): Ditto.
1210         (WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
1211         (WebCore::InternalSettings::setFixedFontFamily): Ditto.
1212         (WebCore::InternalSettings::setCursiveFontFamily): Ditto.
1213         (WebCore::InternalSettings::setFantasyFontFamily): Ditto.
1214         (WebCore::InternalSettings::setPictographFontFamily): Ditto.
1215         (WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
1216         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
1217         (WebCore::InternalSettings::setMediaTypeOverride): Ditto.
1218         (WebCore::InternalSettings::setCanStartMedia): Ditto.
1219         (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
1220         (WebCore::InternalSettings::setEditingBehavior): Ditto.
1221         (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
1222         (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
1223         (WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
1224         (WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
1225         (WebCore::InternalSettings::setImagesEnabled): Ditto.
1226         (WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
1227         (WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
1228         (WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
1229         (WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
1230         (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
1231         (WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
1232         (WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
1233         (WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
1234         (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
1235         (WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
1236         (WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
1237         (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
1238         (WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
1239         (WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
1240         (WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
1241         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
1242         (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
1243         (WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
1244         (WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
1245         (WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
1246         (WebCore::InternalSettings::systemLayoutDirection): Ditto.
1247         (WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
1248         (WebCore::InternalSettings::variationFontsEnabled): Ditto.
1249         (WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
1250         (WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
1251         (WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
1252         * testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
1253         it private instead of public.
1254         * testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
1255         exception for setIndexedDBWorkersEnabled.
1256
1257         * testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
1258         (WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
1259         (WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
1260         (WebCore::Internals::animationsAreSuspended): Ditto.
1261         (WebCore::Internals::suspendAnimations): Ditto.
1262         (WebCore::Internals::resumeAnimations): Ditto.
1263         (WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
1264         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
1265         (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
1266         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
1267         (WebCore::Internals::elementRenderTreeAsText): Ditto.
1268         (WebCore::Internals::ensureShadowRoot): Ditto.
1269         (WebCore::Internals::createShadowRoot): Ditto.
1270         (WebCore::Internals::shadowRootType): Ditto.
1271         (WebCore::Internals::isTimerThrottled): Ditto.
1272         (WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
1273         (WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
1274         (WebCore::Internals::absoluteCaretBounds): Ditto.
1275         (WebCore::Internals::inspectorHighlightRects): Ditto.
1276         (WebCore::Internals::inspectorHighlightObject): Ditto.
1277         (WebCore::Internals::markerCountForNode): Ditto.
1278         (WebCore::Internals::markerAt): Ditto.
1279         (WebCore::Internals::markerRangeForNode): Ditto.
1280         (WebCore::Internals::markerDescriptionForNode): Ditto.
1281         (WebCore::Internals::dumpMarkerRects): Ditto.
1282         (WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
1283         (WebCore::Internals::setScrollViewPosition): Ditto.
1284         (WebCore::Internals::setViewBaseBackgroundColor): Ditto.
1285         (WebCore::Internals::setPagination): Ditto.
1286         (WebCore::Internals::setPaginationLineGridEnabled): Ditto.
1287         (WebCore::Internals::configurationForViewport): Ditto.
1288         (WebCore::Internals::wasLastChangeUserEdit): Ditto.
1289         (WebCore::Internals::scrollElementToRect): Ditto.
1290         (WebCore::Internals::autofillFieldName): Ditto.
1291         (WebCore::Internals::paintControlTints): Ditto.
1292         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
1293         (WebCore::Internals::setDelegatesScrolling): Ditto.
1294         (WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
1295         (WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
1296         (WebCore::Internals::wheelEventHandlerCount): Ditto.
1297         (WebCore::Internals::touchEventHandlerCount): Ditto.
1298         (WebCore::Internals::nodesFromRect): Ditto.
1299         (WebCore::Internals::setBatteryStatus): Ditto.
1300         (WebCore::Internals::setDeviceProximity): Ditto.
1301         (WebCore::Internals::hasSpellingMarker): Ditto.
1302         (WebCore::Internals::hasAutocorrectedMarker): Ditto.
1303         (WebCore::Internals::handleAcceptedCandidate): Ditto.
1304         (WebCore::Internals::isOverwriteModeEnabled): Ditto.
1305         (WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
1306         (WebCore::Internals::countMatchesForText): Ditto.
1307         (WebCore::Internals::countFindMatches): Ditto.
1308         (WebCore::Internals::setInspectorIsUnderTest): Ditto.
1309         (WebCore::Internals::hasGrammarMarker): Ditto.
1310         (WebCore::Internals::numberOfScrollableAreas): Ditto.
1311         (WebCore::Internals::isPageBoxVisible): Ditto.
1312         (WebCore::Internals::layerTreeAsText): Ditto.
1313         (WebCore::Internals::repaintRectsAsText): Ditto.
1314         (WebCore::Internals::scrollingStateTreeAsText): Ditto.
1315         (WebCore::Internals::mainThreadScrollingReasons): Ditto.
1316         (WebCore::Internals::nonFastScrollableRects): Ditto.
1317         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
1318         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
1319         (WebCore::Internals::displayListForElement): Ditto.
1320         (WebCore::Internals::replayDisplayListForElement): Ditto.
1321         (WebCore::Internals::garbageCollectDocumentResources): Ditto.
1322         (WebCore::Internals::insertAuthorCSS): Ditto.
1323         (WebCore::Internals::insertUserCSS): Ditto.
1324         (WebCore::Internals::pageProperty): Ditto.
1325         (WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
1326         (WebCore::Internals::setPageScaleFactor): Ditto.
1327         (WebCore::Internals::setPageZoomFactor): Ditto.
1328         (WebCore::Internals::setTextZoomFactor): Ditto.
1329         (WebCore::Internals::setUseFixedLayout): Ditto.
1330         (WebCore::Internals::setFixedLayoutSize): Ditto.
1331         (WebCore::Internals::setViewExposedRect): Ditto.
1332         (WebCore::Internals::setHeaderHeight): Ditto.
1333         (WebCore::Internals::setFooterHeight): Ditto.
1334         (WebCore::Internals::setTopContentInset): Ditto.
1335         (WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
1336         (WebCore::Internals::startTrackingRepaints): Ditto.
1337         (WebCore::Internals::stopTrackingRepaints): Ditto.
1338         (WebCore::Internals::startTrackingLayerFlushes): Ditto.
1339         (WebCore::Internals::layerFlushCount): Ditto.
1340         (WebCore::Internals::startTrackingStyleRecalcs): Ditto.
1341         (WebCore::Internals::styleRecalcCount): Ditto.
1342         (WebCore::Internals::startTrackingCompositingUpdates): Ditto.
1343         (WebCore::Internals::compositingUpdateCount): Ditto.
1344         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
1345         (WebCore::Internals::getCurrentCursorInfo): Ditto.
1346         (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
1347         (WebCore::Internals::captionsStyleSheetOverride): Ditto.
1348         (WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
1349         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
1350         (WebCore::Internals::setCaptionDisplayMode): Ditto.
1351         (WebCore::Internals::selectionBounds): Ditto.
1352         (WebCore::Internals::isVibrating): Ditto.
1353         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
1354         (WebCore::Internals::beginMediaSessionInterruption): Ditto.
1355         (WebCore::Internals::setMediaSessionRestrictions): Ditto.
1356         (WebCore::Internals::postRemoteControlCommand): Ditto.
1357         (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
1358         (WebCore::Internals::installMockPageOverlay): Ditto.
1359         (WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
1360         (WebCore::Internals::scrollSnapOffsets): Ditto.
1361         (WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
1362         the path string in here for now since it's only used for this testing.
1363         (WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
1364
1365         * testing/Internals.h: Updated for above changes.
1366         * testing/Internals.idl: Use non-legacy exceptions.
1367
1368 2016-10-18  Chris Dumez  <cdumez@apple.com>
1369
1370         [Web IDL] Drop webkit-specific extended attributes that are no longer useful
1371         https://bugs.webkit.org/show_bug.cgi?id=163643
1372
1373         Reviewed by Ryosuke Niwa.
1374
1375         Drop webkit-specific IDL extended attributes that are no longer useful:
1376         - [CustomReturn]: I believe this used to be for ObjC bindings. It has
1377           no impact in JS bindings.
1378         - [Deletable]: It only had an impact on static attributes and was only
1379           used on HTMLAllCollection.all, which is not static. I updated the
1380           bindings generator to so that static attributes are now configurable
1381           by default (unless marked as [Unforgeable], as per Web IDL [1]. This
1382           causes Notification.permission (This only static attribute we have)
1383           to become deletable. This behavior is consistent with the specification
1384           and with Chrome. I added test coverage for this.
1385         - [ImplementationNamespace]: Implemented but unused.
1386         - [PassContext]: Not implemented and unused.
1387         - [TypedArray=*]: Not implemented and unused.
1388
1389         [1] https://heycam.github.io/webidl/#es-attributes
1390
1391         Test: fast/notifications/notification-permisssion-deletable.html
1392
1393         * bindings/scripts/CodeGeneratorJS.pm:
1394         (GetNamespaceForInterface):
1395         (GenerateImplementation):
1396         * bindings/scripts/IDLAttributes.txt:
1397         * bindings/scripts/test/JS/JSTestInterface.cpp:
1398         * bindings/scripts/test/JS/JSTestObj.cpp:
1399         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1400         * dom/Node.idl:
1401         * html/HTMLDocument.idl:
1402
1403 2016-10-18  Sam Weinig  <sam@webkit.org>
1404
1405         Replace std::experimental::variant with WTF::Variant (or similar)
1406         https://bugs.webkit.org/show_bug.cgi?id=163626
1407
1408         Reviewed by Chris Dumez.
1409
1410         Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc.
1411         into the WTF namespace.
1412
1413         * Modules/fetch/FetchBody.h:
1414         (WebCore::FetchBody::isBlob):
1415         (WebCore::FetchBody::isFormData):
1416         (WebCore::FetchBody::isArrayBuffer):
1417         (WebCore::FetchBody::isArrayBufferView):
1418         (WebCore::FetchBody::isURLSearchParams):
1419         (WebCore::FetchBody::isText):
1420         (WebCore::FetchBody::blobBody):
1421         (WebCore::FetchBody::formDataBody):
1422         (WebCore::FetchBody::arrayBufferBody):
1423         (WebCore::FetchBody::arrayBufferViewBody):
1424         (WebCore::FetchBody::textBody):
1425         (WebCore::FetchBody::urlSearchParamsBody):
1426         * bindings/generic/IDLTypes.h:
1427         * dom/ExceptionOr.h:
1428         (WebCore::ExceptionOr<ReturnType>::hasException):
1429         (WebCore::ExceptionOr<ReturnType>::releaseException):
1430         (WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
1431         * dom/MessageEvent.cpp:
1432         (WebCore::MessageEvent::source):
1433         * dom/MessageEvent.h:
1434         * dom/Node.cpp:
1435         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
1436         (WebCore::Node::convertNodesOrStringsIntoNode):
1437         * dom/Node.h:
1438         * html/HTMLOptionsCollection.h:
1439         * html/HTMLSelectElement.cpp:
1440         (WebCore::HTMLSelectElement::add):
1441         * html/HTMLSelectElement.h:
1442         * html/track/TrackEvent.cpp:
1443         (WebCore::TrackEvent::TrackEvent):
1444         * html/track/TrackEvent.h:
1445
1446 2016-10-18  Chris Dumez  <cdumez@apple.com>
1447
1448         Unreviewed, rebaseline bindings tests after Sam's r207505.
1449
1450         * bindings/scripts/test/JS/JSTestCallback.cpp:
1451         (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
1452         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1453         (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
1454         * bindings/scripts/test/JS/JSTestObj.cpp:
1455         (WebCore::jsTestObjPrototypeFunctionSerializedValueCaller):
1456         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1457         (WebCore::jsTestSerializedScriptValueInterfaceValueGetter):
1458         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter):
1459         (WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter):
1460         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter):
1461         (WebCore::setJSTestSerializedScriptValueInterfaceValueFunction):
1462         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValueFunction):
1463         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1464         (WebCore::jsTestTypedefsImmutableSerializedScriptValueGetter):
1465         (WebCore::setJSTestTypedefsImmutableSerializedScriptValueFunction):
1466
1467 2016-10-18  Chris Dumez  <cdumez@apple.com>
1468
1469         [Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
1470         https://bugs.webkit.org/show_bug.cgi?id=163630
1471
1472         Reviewed by Darin Adler.
1473
1474         Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
1475         IDL now that all our events use proper constructors instead.
1476
1477         * bindings/scripts/CodeGenerator.pm:
1478         * bindings/scripts/CodeGeneratorJS.pm:
1479         (GenerateHeader):
1480         (GenerateConstructorDefinition):
1481         (GenerateConstructorHelperMethods):
1482         (IsConstructable):
1483         * bindings/scripts/IDLAttributes.txt:
1484         * dom/Event.h:
1485         (WebCore::Event::create):
1486         * dom/Event.idl:
1487         * dom/UIEvent.h:
1488         (WebCore::UIEvent::create):
1489         * dom/UIEvent.idl:
1490
1491 2016-10-18  Chris Dumez  <cdumez@apple.com>
1492
1493         Changing details.open should cause a toggle event to be fired asynchronously
1494         https://bugs.webkit.org/show_bug.cgi?id=163568
1495
1496         Reviewed by Darin Adler.
1497
1498         Changing details.open should cause a toggle event to be fired asynchronously:
1499         - https://html.spec.whatwg.org/#details-notification-task-steps
1500
1501         Firefox and Chrome implement this, we don't.
1502
1503         Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
1504
1505         * dom/EventNames.h:
1506         * dom/GlobalEventHandlers.idl:
1507         * html/HTMLAttributeNames.in:
1508         * html/HTMLDetailsElement.cpp:
1509         (WebCore::detailToggleEventSender):
1510         (WebCore::HTMLDetailsElement::~HTMLDetailsElement):
1511         (WebCore::HTMLDetailsElement::dispatchPendingEvent):
1512         (WebCore::HTMLDetailsElement::parseAttribute):
1513         * html/HTMLDetailsElement.h:
1514         * html/HTMLElement.cpp:
1515         (WebCore::HTMLElement::createEventHandlerNameMap):
1516
1517 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1518
1519         [CSS Parser] Enable basic parser testing.
1520         https://bugs.webkit.org/show_bug.cgi?id=163639
1521
1522         Reviewed by Dean Jackson.
1523
1524         * css/SelectorChecker.cpp:
1525         (WebCore::SelectorChecker::matchRecursively):
1526         Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this
1527         eventually, but it's better to not assert on that for now.
1528
1529         * css/parser/CSSParserValues.cpp:
1530         (WebCore::CSSParserSelector::isHostPseudoSelector):
1531         Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert.
1532
1533         * css/parser/CSSParserValues.h:
1534         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
1535         Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert.
1536
1537         * css/parser/CSSPropertyParser.cpp:
1538         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
1539         copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties.
1540
1541         (WebCore::parseSingleShadow):
1542         (WebCore::CSSPropertyParser::consumeFont):
1543         Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems
1544         some of the font properties should be reset as part of this shorthand but aren't.
1545 '
1546         * css/parser/CSSPropertyParserHelpers.cpp:
1547         (WebCore::CSSPropertyParserHelpers::consumeInteger):
1548         Just return a number for now instead of the parser_integer type.
1549
1550         * css/parser/CSSSelectorParser.cpp:
1551         (WebCore::CSSSelectorParser::consumePseudo):
1552         Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type.
1553
1554 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1555
1556         Update the comment for HTML Imports as there is now a proposal to use ES6 Modules for this.
1557         Also replace the contact by me since I'm most familiar with this feature.
1558
1559         * features.json:
1560
1561 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1562
1563         Update the status of shadow DOM API to "Done" with a comment saying we're still fixing bugs.
1564
1565         Also update my contact information since I'm no longer on Twitter.
1566
1567         * features.json:
1568
1569 2016-10-18  Chris Dumez  <cdumez@apple.com>
1570
1571         Provide better form validation messages
1572         https://bugs.webkit.org/show_bug.cgi?id=163584
1573
1574         Reviewed by Darin Adler.
1575
1576         Provide better form validation messages that match more closely the ones
1577         from Chrome and Firefox.
1578
1579         No new tests, updated existing tests.
1580
1581         * English.lproj/Localizable.strings:
1582         * platform/LocalizedStrings.cpp:
1583         (WebCore::validationMessageValueMissingText):
1584         (WebCore::validationMessageValueMissingForCheckboxText):
1585         (WebCore::validationMessageValueMissingForFileText):
1586         (WebCore::validationMessageValueMissingForMultipleFileText):
1587         (WebCore::validationMessageValueMissingForRadioText):
1588         (WebCore::validationMessageValueMissingForSelectText):
1589         (WebCore::validationMessageTypeMismatchText):
1590         (WebCore::validationMessageTypeMismatchForEmailText):
1591         (WebCore::validationMessageTypeMismatchForMultipleEmailText):
1592         (WebCore::validationMessageTypeMismatchForURLText):
1593         (WebCore::validationMessagePatternMismatchText):
1594         (WebCore::validationMessageTooShortText):
1595         (WebCore::validationMessageTooLongText):
1596         (WebCore::validationMessageRangeUnderflowText):
1597         (WebCore::validationMessageRangeOverflowText):
1598         (WebCore::validationMessageStepMismatchText):
1599         (WebCore::validationMessageBadInputForNumberText):
1600
1601 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1602
1603         Fix GTK build.
1604
1605         * css/parser/CSSPropertyParser.cpp:
1606         (WebCore::CSSPropertyParser::parseSingleValue):
1607
1608 2016-10-18  Sam Weinig  <sam@webkit.org>
1609
1610         Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
1611         https://bugs.webkit.org/show_bug.cgi?id=163625
1612
1613         Reviewed by Chris Dumez.
1614
1615         - Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
1616         - Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
1617         - Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
1618         - Move MessagePorts and ArrayBuffers more where possible.
1619
1620         * Modules/indexeddb/IDBObjectStore.cpp:
1621         (WebCore::IDBObjectStore::putOrAdd):
1622         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1623         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
1624         * bindings/js/IDBBindingUtilities.cpp:
1625         (WebCore::deserializeIDBValueToJSValue):
1626         * bindings/js/JSCustomEventCustom.cpp:
1627         (WebCore::JSCustomEvent::detail):
1628         * bindings/js/JSHistoryCustom.cpp:
1629         (WebCore::JSHistory::state):
1630         (WebCore::JSHistory::pushState):
1631         (WebCore::JSHistory::replaceState):
1632         * bindings/js/JSPopStateEventCustom.cpp:
1633         (WebCore::JSPopStateEvent::state):
1634         * dom/CustomEvent.cpp:
1635         (WebCore::CustomEvent::trySerializeDetail):
1636         * dom/ErrorEvent.cpp:
1637         (WebCore::ErrorEvent::sanitizedErrorValue):
1638         (WebCore::ErrorEvent::trySerializeError):
1639         * dom/PopStateEvent.cpp:
1640         (WebCore::PopStateEvent::trySerializeState):
1641         * page/DOMWindow.cpp:
1642         (WebCore::DOMWindow::postMessage):
1643         * page/DOMWindow.h:
1644         * workers/DedicatedWorkerGlobalScope.cpp:
1645         (WebCore::DedicatedWorkerGlobalScope::postMessage):
1646         * workers/DedicatedWorkerGlobalScope.h:
1647         * workers/Worker.cpp:
1648         (WebCore::Worker::postMessage):
1649         * workers/Worker.h:
1650         * bindings/js/JSDOMWindowCustom.cpp:
1651         (WebCore::handlePostMessage):
1652         * bindings/js/JSDictionary.cpp:
1653         (WebCore::JSDictionary::convertValue):
1654         * bindings/js/JSDictionary.h:
1655         Updated for new SerializedScriptValue interface/vector naming.
1656
1657         * bindings/js/JSMessageEventCustom.cpp:
1658         (WebCore::handleInitMessageEvent):
1659         Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
1660
1661         * bindings/js/JSMessagePortCustom.cpp:
1662         (WebCore::extractTransferables):
1663         (WebCore::fillMessagePortArray): Deleted.
1664         * bindings/js/JSMessagePortCustom.h:
1665         (WebCore::handlePostMessage):
1666         Rename fillMessagePortArray to extractTransferables to better express what it does.
1667
1668         * bindings/js/SerializedScriptValue.cpp:
1669         (WebCore::CloneSerializer::serialize):
1670         (WebCore::CloneSerializer::CloneSerializer):
1671         (WebCore::CloneSerializer::fillTransferMap):
1672         (WebCore::CloneSerializer::dumpIfTerminal):
1673         (WebCore::CloneDeserializer::deserialize):
1674         (WebCore::CloneDeserializer::CloneDeserializer):
1675         (WebCore::CloneDeserializer::readTerminal):
1676         (WebCore::SerializedScriptValue::transferArrayBuffers):
1677         (WebCore::SerializedScriptValue::create):
1678         (WebCore::SerializedScriptValue::deserialize):
1679         * bindings/js/SerializedScriptValue.h:
1680         Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
1681         * bindings/scripts/CodeGeneratorJS.pm:
1682         (GetNativeVectorType):
1683         Remove special case for MessagePort.
1684         (JSValueToNative):
1685         (NativeToJSValue):
1686         Updated for new SerializedScriptValue interface.
1687
1688         * dom/MessageEvent.cpp:
1689         (WebCore::MessageEvent::MessageEvent):
1690         (WebCore::MessageEvent::create):
1691         (WebCore::MessageEvent::initMessageEvent):
1692         (WebCore::MessageEvent::trySerializeData):
1693         * dom/MessageEvent.h:
1694         Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
1695
1696         * dom/MessageEvent.idl:
1697         Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
1698         custom, as we don't quite generate these correctly yet. 
1699
1700         * dom/MessagePort.cpp:
1701         (WebCore::MessagePort::postMessage):
1702         (WebCore::MessagePort::dispatchMessages):
1703         (WebCore::MessagePort::disentanglePorts):
1704         (WebCore::MessagePort::entanglePorts):
1705         * dom/MessagePort.h:
1706         Update interface to take MessagePort vectors by rvalue reference.
1707
1708 2016-10-18  Chris Dumez  <cdumez@apple.com>
1709
1710         [iOS] Drop JSDictionary::convertValue() overload taking a TouchList
1711         https://bugs.webkit.org/show_bug.cgi?id=163620
1712
1713         Reviewed by Sam Weinig.
1714
1715         Drop JSDictionary::convertValue() overload taking a TouchList now that
1716         TouchEvent is using a proper constructor with a TouchEventInit
1717         dictionary on iOS.
1718
1719         * bindings/js/JSDictionary.cpp:
1720
1721 2016-10-18  Dean Jackson  <dino@apple.com>
1722
1723         Remove CSS_SHAPES feature definition. This should always be on.
1724         https://bugs.webkit.org/show_bug.cgi?id=163628
1725         <rdar://problem/28834613>
1726
1727         Reviewed by Tim Horton.
1728
1729         CSS Shapes is in Candidate Recommendation. It's a core part
1730         of CSS. It should always be enabled.
1731
1732         * Configurations/FeatureDefines.xcconfig:
1733         * css/CSSComputedStyleDeclaration.cpp:
1734         (WebCore::shapePropertyValue):
1735         (WebCore::ComputedStyleExtractor::propertyValue):
1736         * css/CSSPropertyNames.in:
1737         * css/CSSValueKeywords.in:
1738         * css/StyleBuilderConverter.h:
1739         (WebCore::StyleBuilderConverter::convertShapeValue):
1740         * css/parser/CSSParser.cpp:
1741         (WebCore::isSimpleLengthPropertyID):
1742         (WebCore::CSSParser::parseValue):
1743         (WebCore::CSSParser::parseShapeProperty):
1744         * css/parser/CSSParser.h:
1745         * inspector/InspectorOverlay.cpp:
1746         (WebCore::buildObjectForShapeOutside):
1747         (WebCore::buildObjectForElementData):
1748         * page/animation/CSSPropertyAnimation.cpp:
1749         (WebCore::blendFunc):
1750         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1751         * rendering/FloatingObjects.cpp:
1752         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
1753         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
1754         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
1755         * rendering/RenderBlock.cpp:
1756         * rendering/RenderBlockFlow.cpp:
1757         (WebCore::RenderBlockFlow::positionNewFloats):
1758         * rendering/RenderBox.cpp:
1759         (WebCore::RenderBox::~RenderBox):
1760         (WebCore::RenderBox::styleDidChange):
1761         (WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange):
1762         (WebCore::isCandidateForOpaquenessTest):
1763         (WebCore::RenderBox::imageChanged):
1764         * rendering/RenderBox.h:
1765         (WebCore::RenderBox::markShapeOutsideDependentsForLayout):
1766         * rendering/RenderElement.cpp:
1767         (WebCore::RenderElement::~RenderElement):
1768         (WebCore::RenderElement::updateShapeImage):
1769         (WebCore::RenderElement::initializeStyle):
1770         (WebCore::RenderElement::setStyle):
1771         * rendering/RenderElement.h:
1772         (WebCore::RenderElement::hasShapeOutside):
1773         * rendering/SimpleLineLayout.cpp:
1774         (WebCore::SimpleLineLayout::canUseForWithReason):
1775         * rendering/line/LineWidth.cpp:
1776         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
1777         (WebCore::LineWidth::wrapNextToShapeOutside):
1778         (WebCore::LineWidth::fitBelowFloats):
1779         * rendering/line/LineWidth.h:
1780         * rendering/shapes/ShapeOutsideInfo.cpp:
1781         * rendering/shapes/ShapeOutsideInfo.h:
1782         * rendering/style/RenderStyle.cpp:
1783         (WebCore::RenderStyle::changeRequiresLayout):
1784         (WebCore::RenderStyle::changeRequiresRepaint):
1785         * rendering/style/RenderStyle.h:
1786         (WebCore::RenderStyle::initialShapeImageThreshold):
1787         * rendering/style/ShapeValue.cpp:
1788         * rendering/style/ShapeValue.h:
1789         * rendering/style/StyleRareNonInheritedData.cpp:
1790         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1791         (WebCore::StyleRareNonInheritedData::operator==):
1792         * rendering/style/StyleRareNonInheritedData.h:
1793         * style/StylePendingResources.cpp:
1794         (WebCore::Style::loadPendingResources):
1795
1796 2016-10-18  Chris Dumez  <cdumez@apple.com>
1797
1798         convertDictionary<>() no longer needs to return an Optional<> type
1799         https://bugs.webkit.org/show_bug.cgi?id=163624
1800
1801         Reviewed by Sam Weinig.
1802
1803         convertDictionary<>() no longer needs to return an Optional<> type now
1804         that our dictionary structures are all default constructible after
1805         <https://trac.webkit.org/changeset/206974>.
1806
1807         * bindings/js/JSDOMConvert.h:
1808         * bindings/scripts/CodeGeneratorJS.pm:
1809         (GenerateDictionaryHeaderContent):
1810         (GenerateDictionaryImplementationContent):
1811         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1812         (WebCore::convertDictionary<TestEventConstructor::Init>):
1813         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1814         * bindings/scripts/test/JS/JSTestObj.cpp:
1815         (WebCore::convertDictionary<TestObj::Dictionary>):
1816         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1817         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
1818         (WebCore::convertDictionary<AlternateDictionaryName>):
1819         (WebCore::convertDictionary<TestObj::ParentDictionary>):
1820         (WebCore::convertDictionary<TestObj::ChildDictionary>):
1821         * bindings/scripts/test/JS/JSTestObj.h:
1822         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1823         (WebCore::convertDictionary<DictionaryImplName>):
1824         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1825
1826 2016-10-18  Chris Dumez  <cdumez@apple.com>
1827
1828         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add()
1829         https://bugs.webkit.org/show_bug.cgi?id=163608
1830
1831         Reviewed by Ryosuke Niwa.
1832
1833         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add():
1834         - https://html.spec.whatwg.org/#htmlselectelement
1835         - https://html.spec.whatwg.org/#htmloptionscollection
1836
1837         No new tests, rebaseline existing test.
1838
1839         * bindings/scripts/CodeGeneratorJS.pm:
1840         (GenerateDefaultValue):
1841         (GenerateParametersCheck):
1842         * bindings/scripts/test/JS/JSTestObj.cpp:
1843         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyCaller):
1844         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1845         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
1846         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1847         (WebCore::jsTestTypedefsPrototypeFunctionFuncCaller):
1848         * html/HTMLOptGroupElement.idl:
1849         * html/HTMLOptionsCollection.cpp:
1850         (WebCore::HTMLOptionsCollection::add):
1851         * html/HTMLOptionsCollection.h:
1852         * html/HTMLOptionsCollection.idl:
1853         * html/HTMLSelectElement.cpp:
1854         (WebCore::HTMLSelectElement::add):
1855         (WebCore::HTMLSelectElement::setOption):
1856         (WebCore::HTMLSelectElement::setLength):
1857         * html/HTMLSelectElement.h:
1858         * html/HTMLSelectElement.idl:
1859
1860 2016-10-18  Aaron Chu  <aaron_chu@apple.com>
1861
1862         Web Inspector: AXI: focused/focusable state should be based on Accessibility Object instead of Element
1863         https://bugs.webkit.org/show_bug.cgi?id=163088
1864         <rdar://problem/16421985>
1865
1866         Reviewed by Darin Adler.
1867
1868         Changed code in InspectDOMAgent so that it determines the focusability of a Node based
1869         on the AccessibilityNodeObject and not the Element class.
1870
1871         Covered by existing tests: 
1872         LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
1873
1874         * inspector/InspectorDOMAgent.cpp:
1875         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1876
1877 2016-10-18  Anders Carlsson  <andersca@apple.com>
1878
1879         Get rid of more WebHistoryItem cruft
1880         https://bugs.webkit.org/show_bug.cgi?id=163623
1881
1882         Reviewed by Tim Horton.
1883
1884         * history/HistoryItem.cpp:
1885         (WebCore::HistoryItem::HistoryItem):
1886         * history/HistoryItem.h:
1887         (WebCore::HistoryItem::setViewportArguments):
1888         (WebCore::HistoryItem::bookmarkID): Deleted.
1889         (WebCore::HistoryItem::setBookmarkID): Deleted.
1890         (WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
1891         (WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.
1892
1893 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1894
1895         Fix Windows build.
1896  
1897         * css/parser/CSSPropertyParser.cpp:
1898         (WebCore::CSSPropertyParser::parseSingleValue):
1899
1900 2016-10-18  Antoine Quint  <graouts@apple.com>
1901
1902         Modern media controls don't update their rendering correctly
1903         https://bugs.webkit.org/show_bug.cgi?id=163603
1904         <rdar://problem/28826022>
1905
1906         Reviewed by Dean Jackson.
1907
1908         There are rendering issues when we use an absolutely-positioned element
1909         as the top-most element in a media element's shadow root (webkit.org/b/163592).
1910         Since we only need for that element to be positioned, we can use "position: relative"
1911         instead, which removes the rendering issues.
1912
1913         * Modules/modern-media-controls/controls/media-controls.css:
1914         (.media-controls):
1915         (.media-controls,): Deleted.
1916
1917 2016-10-18  Dean Jackson  <dino@apple.com>
1918
1919         Add preliminary support for extended colors to WebCore::Color
1920         https://bugs.webkit.org/show_bug.cgi?id=162878
1921         <rdar://problem/28596413>
1922
1923         Follow-up review comments from Darin Adler.
1924
1925         * html/canvas/CanvasGradient.cpp:
1926         (WebCore::CanvasGradient::addColorStop): Use nullptr.
1927         * platform/graphics/Color.cpp:
1928         (WebCore::Color::Color): Explicitly zero before assigning the pointer.
1929         * platform/graphics/Color.h: Add some comments about the failings of operator== and hash.
1930         (WebCore::Color::Color): Add some static_asserts to the constructors. Move the empty and deleted values
1931         to static constants.
1932         (WebCore::Color::isHashTableDeletedValue):
1933         (WebCore::Color::hash): Replacement for asUint64, which was only being used for a hash.
1934         (WebCore::Color::asUint64): Deleted.
1935         * platform/graphics/ColorHash.h: Use new hash functions. Use "using" instead of typedef.
1936         (WTF::ColorHash::hash):
1937
1938 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1939
1940         REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
1941         https://bugs.webkit.org/show_bug.cgi?id=163581
1942         <rdar://problem/27739558>
1943
1944         Reviewed by Simon Fraser.
1945
1946         The bug was caused by Chrome::elementDidBlur not getting called, which resulted in
1947         StopAssistingNode not getting sent to the UI process.
1948
1949         Test: fast/forms/ios/hide-keyboard-on-node-removal.html
1950
1951         * dom/Document.cpp:
1952         (WebCore::Document::setFocusedElement): Restore the behavior prior to r201471 by calling
1953         Chrome::elementDidBlur explicitly.
1954         * html/HTMLTextFormControlElement.cpp:
1955         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent): Added a comment about ordering.
1956
1957 2016-10-17  Anders Carlsson  <andersca@apple.com>
1958
1959         Move some history specific HistoryItem code to WebHistoryItem
1960         https://bugs.webkit.org/show_bug.cgi?id=163567
1961
1962         Reviewed by Tim Horton.
1963
1964         * history/HistoryItem.cpp:
1965         (WebCore::HistoryItem::addRedirectURL): Deleted.
1966         (WebCore::HistoryItem::redirectURLs): Deleted.
1967         (WebCore::HistoryItem::setRedirectURLs): Deleted.
1968         * history/HistoryItem.h:
1969
1970 2016-10-18  Dave Hyatt  <hyatt@apple.com>
1971
1972         [CSS Parser] Get all the properties turned on
1973         https://bugs.webkit.org/show_bug.cgi?id=163605
1974
1975         Reviewed by Dean Jackson.
1976
1977         * WebCore.xcodeproj/project.pbxproj:
1978         * css/CSSFunctionValue.h:
1979         * css/CSSPendingSubstitutionValue.cpp: Added.
1980         (WebCore::CSSPendingSubstitutionValue::customCSSText):
1981         * css/CSSPendingSubstitutionValue.h: Added.
1982         (WebCore::CSSPendingSubstitutionValue::create):
1983         (WebCore::CSSPendingSubstitutionValue::shorthandValue):
1984         (WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
1985         (WebCore::CSSPendingSubstitutionValue::equals):
1986         (WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
1987         * css/CSSValue.cpp:
1988         (WebCore::CSSValue::cssText):
1989         (WebCore::CSSValue::destroy):
1990         * css/CSSValue.h:
1991         (WebCore::CSSValue::isPendingSubstitutionValue):
1992         * css/CSSValueKeywords.in:
1993         * css/StylePropertyShorthand.cpp:
1994         (WebCore::transitionShorthandForParsing):
1995         * css/StylePropertyShorthand.h:
1996         * css/parser/CSSParser.cpp:
1997         (WebCore::CSSParser::completeURL):
1998         * css/parser/CSSParserImpl.cpp:
1999         (WebCore::CSSParserImpl::parseValue):
2000         (WebCore::CSSParserImpl::consumeDeclaration):
2001         (WebCore::CSSParserImpl::consumeDeclarationValue):
2002         * css/parser/CSSParserMode.h:
2003         (WebCore::CSSParserContext::completeURL):
2004         * css/parser/CSSParserToken.cpp:
2005         (WebCore::CSSParserToken::parseAsCSSPropertyID):
2006         (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
2007         * css/parser/CSSParserToken.h:
2008         * css/parser/CSSPropertyParser.cpp:
2009         (WebCore::cssPropertyID):
2010         (WebCore::CSSPropertyParser::addProperty):
2011         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
2012         (WebCore::CSSPropertyParser::parseValue):
2013         (WebCore::CSSPropertyParser::parseSingleValue):
2014         (WebCore::CSSPropertyParser::parseValueStart):
2015         (WebCore::CSSPropertyParser::consumeCSSWideKeyword):
2016         (WebCore::consumeTransformOrigin):
2017         (WebCore::consumeWillChange):
2018         (WebCore::consumeFontFeatureTag):
2019         (WebCore::consumeFontFeatureSettings):
2020         (WebCore::consumePage):
2021         (WebCore::consumeQuotes):
2022         (WebCore::FontVariantLigaturesParser::consumeLigature):
2023         (WebCore::FontVariantLigaturesParser::finalizeValue):
2024         (WebCore::consumeFontVariantLigatures):
2025         (WebCore::consumeFontVariantCaps):
2026         (WebCore::FontVariantNumericParser::consumeNumeric):
2027         (WebCore::FontVariantNumericParser::finalizeValue):
2028         (WebCore::consumeFontVariantNumeric):
2029         (WebCore::consumeFontVariantCSS21):
2030         (WebCore::consumeFontVariantList):
2031         (WebCore::consumeFontWeight):
2032         (WebCore::consumeFamilyName):
2033         (WebCore::consumeGenericFamily):
2034         (WebCore::consumeFontFamily):
2035         (WebCore::consumeSpacing):
2036         (WebCore::consumeTabSize):
2037         (WebCore::consumeTextSizeAdjust):
2038         (WebCore::consumeFontSize):
2039         (WebCore::consumeLineHeight):
2040         (WebCore::createPrimitiveValuePair):
2041         (WebCore::consumeCounter):
2042         (WebCore::consumePageSize):
2043         (WebCore::consumeSize):
2044         (WebCore::consumeTextIndent):
2045         (WebCore::validWidthOrHeightKeyword):
2046         (WebCore::consumeMaxWidthOrHeight):
2047         (WebCore::consumeWidthOrHeight):
2048         (WebCore::consumeMarginOrOffset):
2049         (WebCore::consumeClipComponent):
2050         (WebCore::consumeClip):
2051         (WebCore::consumeTouchAction):
2052         (WebCore::consumeLineClamp):
2053         (WebCore::consumeLocale):
2054         (WebCore::consumeColumnWidth):
2055         (WebCore::consumeColumnCount):
2056         (WebCore::consumeColumnGap):
2057         (WebCore::consumeColumnSpan):
2058         (WebCore::consumeZoom):
2059         (WebCore::consumeAnimationIterationCount):
2060         (WebCore::consumeAnimationName):
2061         (WebCore::consumeTransitionProperty):
2062         (WebCore::consumeCubicBezier):
2063         (WebCore::consumeAnimationTimingFunction):
2064         (WebCore::consumeAnimationValue):
2065         (WebCore::isValidAnimationPropertyList):
2066         (WebCore::consumeAnimationPropertyList):
2067         (WebCore::CSSPropertyParser::consumeAnimationShorthand):
2068         (WebCore::consumeZIndex):
2069         (WebCore::parseSingleShadow):
2070         (WebCore::consumeShadow):
2071         (WebCore::consumeFilterFunction):
2072         (WebCore::consumeFilter):
2073         (WebCore::consumeTextDecorationLine):
2074         (WebCore::consumeTextEmphasisStyle):
2075         (WebCore::consumeOutlineColor):
2076         (WebCore::consumeLineWidth):
2077         (WebCore::consumeBorderWidth):
2078         (WebCore::consumeTextStrokeWidth):
2079         (WebCore::consumeColumnRuleWidth):
2080         (WebCore::consumeTranslate3d):
2081         (WebCore::consumeNumbers):
2082         (WebCore::consumePerspective):
2083         (WebCore::consumeTransformValue):
2084         (WebCore::consumeTransform):
2085         (WebCore::consumePositionLonghand):
2086         (WebCore::consumePositionX):
2087         (WebCore::consumePositionY):
2088         (WebCore::consumePaintStroke):
2089         (WebCore::consumePaintOrder):
2090         (WebCore::consumeNoneOrURI):
2091         (WebCore::consumeFlexBasis):
2092         (WebCore::consumeStrokeDasharray):
2093         (WebCore::consumeBaselineShift):
2094         (WebCore::consumeRxOrRy):
2095         (WebCore::consumeCursor):
2096         (WebCore::consumeAttr):
2097         (WebCore::consumeCounterContent):
2098         (WebCore::consumeContent):
2099         (WebCore::consumePositionList):
2100         (WebCore::consumeScrollSnapCoordinate):
2101         (WebCore::consumeScrollSnapPoints):
2102         (WebCore::consumeBorderRadiusCorner):
2103         (WebCore::consumeVerticalAlign):
2104         (WebCore::consumeShapeRadius):
2105         (WebCore::consumeBasicShapeCircle):
2106         (WebCore::consumeBasicShapeEllipse):
2107         (WebCore::consumeBasicShapePolygon):
2108         (WebCore::complete4Sides):
2109         (WebCore::consumeRadii):
2110         (WebCore::consumeBasicShapeInset):
2111         (WebCore::consumeBasicShape):
2112         (WebCore::consumeWebkitClipPath):
2113         (WebCore::consumeShapeOutside):
2114         (WebCore::consumeContentDistributionOverflowPosition):
2115         (WebCore::consumeBorderImageRepeatKeyword):
2116         (WebCore::consumeBorderImageRepeat):
2117         (WebCore::consumeBorderImageSlice):
2118         (WebCore::consumeBorderImageOutset):
2119         (WebCore::consumeBorderImageWidth):
2120         (WebCore::consumeBorderImageComponents):
2121         (WebCore::consumeWebkitBorderImage):
2122         (WebCore::consumeReflect):
2123         (WebCore::consumeImageOrientation):
2124         (WebCore::consumeBackgroundBlendMode):
2125         (WebCore::consumeBackgroundAttachment):
2126         (WebCore::consumeBackgroundBox):
2127         (WebCore::consumeBackgroundComposite):
2128         (WebCore::consumePrefixedBackgroundBox):
2129         (WebCore::consumeBackgroundSize):
2130         (WebCore::consumeGridAutoFlow):
2131         (WebCore::consumeBackgroundComponent):
2132         (WebCore::addBackgroundValue):
2133         (WebCore::consumeCommaSeparatedBackgroundComponent):
2134         (WebCore::consumeSelfPositionKeyword):
2135         (WebCore::consumeSelfPositionOverflowPosition):
2136         (WebCore::consumeAlignItems):
2137         (WebCore::consumeJustifyItems):
2138         (WebCore::consumeFitContent):
2139         (WebCore::consumeCustomIdentForGridLine):
2140         (WebCore::consumeGridLine):
2141         (WebCore::isGridTrackFixedSized):
2142         (WebCore::consumeGridBreadth):
2143         (WebCore::consumeGridTrackSize):
2144         (WebCore::consumeGridLineNames):
2145         (WebCore::consumeGridTrackRepeatFunction):
2146         (WebCore::consumeGridTrackList):
2147         (WebCore::consumeGridTemplatesRowsOrColumns):
2148         (WebCore::consumeGridTemplateAreas):
2149         (WebCore::consumeFontFaceUnicodeRange):
2150         (WebCore::consumeFontFaceSrcURI):
2151         (WebCore::consumeFontFaceSrcLocal):
2152         (WebCore::consumeFontFaceSrc):
2153         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
2154         (WebCore::CSSPropertyParser::consumeSystemFont):
2155         (WebCore::CSSPropertyParser::consumeFont):
2156         (WebCore::CSSPropertyParser::consumeFontVariantShorthand):
2157         (WebCore::CSSPropertyParser::consumeBorderSpacing):
2158         (WebCore::consumeSingleViewportDescriptor):
2159         (WebCore::CSSPropertyParser::parseViewportDescriptor):
2160         (WebCore::consumeColumnWidthOrCount):
2161         (WebCore::CSSPropertyParser::consumeColumns):
2162         (WebCore::CSSPropertyParser::consumeShorthandGreedily):
2163         (WebCore::CSSPropertyParser::consumeFlex):
2164         (WebCore::CSSPropertyParser::consumeBorder):
2165         (WebCore::CSSPropertyParser::consume4Values):
2166         (WebCore::CSSPropertyParser::consumeBorderImage):
2167         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
2168         (WebCore::consumeBackgroundPosition):
2169         (WebCore::consumeRepeatStyleComponent):
2170         (WebCore::consumeRepeatStyle):
2171         (WebCore::CSSPropertyParser::consumeBackgroundShorthand):
2172         (WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
2173         (WebCore::CSSPropertyParser::consumeGridAreaShorthand):
2174         (WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
2175         (WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
2176         (WebCore::CSSPropertyParser::consumeGridShorthand):
2177         (WebCore::CSSPropertyParser::parseShorthand):
2178         (WebCore::unresolvedCSSPropertyID): Deleted.
2179         * css/parser/CSSPropertyParser.h:
2180         * css/parser/CSSPropertyParserHelpers.cpp:
2181         (WebCore::CSSPropertyParserHelpers::consumeIdent):
2182         (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
2183         (WebCore::CSSPropertyParserHelpers::consumeString):
2184         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
2185         * css/parser/CSSPropertyParserHelpers.h:
2186
2187 2016-10-18  Brent Fulgham  <bfulgham@apple.com>
2188
2189         Correct Document::removeAllEventListeners
2190         https://bugs.webkit.org/show_bug.cgi?id=163558
2191         <rdar://problem/28716840>
2192
2193         Reviewed by Chris Dumez.
2194
2195         Tested by fast/dom/node-move-to-new-document-crash-main.html.
2196
2197         * dom/Document.cpp:
2198         (WebCore::Document::removeAllEventListeners): Clear out the wheel and
2199         touch event targets when clearing all data.
2200
2201 2016-10-18  Dean Jackson  <dino@apple.com>
2202
2203         Remove dependency cycle with UIKit
2204         https://bugs.webkit.org/show_bug.cgi?id=163577
2205         <rdar://problem/28786160>
2206
2207         Reviewed by Tim Horton.
2208
2209         Soft link against UIKit. Followup patch because
2210         I screwed up and forgot to edit the simulator
2211         configuration.
2212
2213         * Configurations/WebCoreTestSupport.xcconfig:
2214
2215 2016-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2216
2217         SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
2218         https://bugs.webkit.org/show_bug.cgi?id=116470
2219
2220         Reviewed by Simon Fraser.
2221
2222         When we encounter a shorthand css property, we set m_implicitShorthand
2223         to true to tell addProperty() later that the individual properties are
2224         all set through a short hand one. We need to make sure that setting 
2225         m_implicitShorthand to true will not be leaked after finishing parsing
2226         the short hand property.
2227
2228         Test: fast/css/implicit-property-restore.html
2229
2230         * css/parser/CSSParser.cpp:
2231         (WebCore::CSSParser::parseValue):
2232         (WebCore::CSSParser::parseFillShorthand):
2233         (WebCore::CSSParser::parseShorthand):
2234         (WebCore::CSSParser::parse4Values):
2235         (WebCore::CSSParser::parseBorderRadius):
2236         (WTF::ImplicitScope::ImplicitScope): Deleted.
2237         (WTF::ImplicitScope::~ImplicitScope): Deleted.
2238         Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>.
2239         
2240         * css/parser/SVGCSSParser.cpp:
2241         (WebCore::CSSParser::parseSVGValue):
2242         Restore m_implicitShorthand value after setting it temporarily to true.
2243
2244 2016-10-18  Chris Dumez  <cdumez@apple.com>
2245
2246         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
2247         https://bugs.webkit.org/show_bug.cgi?id=163580
2248
2249         Reviewed by Sam Weinig.
2250
2251         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
2252         and use a regular constructor as in the specification:
2253         - https://html.spec.whatwg.org/#the-trackevent-interface
2254
2255         No new tests, updated existing tests.
2256
2257         * html/track/TrackEvent.cpp:
2258         (WebCore::TrackEvent::TrackEvent):
2259         * html/track/TrackEvent.h:
2260         * html/track/TrackEvent.idl:
2261
2262 2016-10-18  Commit Queue  <commit-queue@webkit.org>
2263
2264         Unreviewed, rolling out r207409.
2265         https://bugs.webkit.org/show_bug.cgi?id=163602
2266
2267         Introduced many test failures and timeouts, causing release
2268         bot to exit early (Requested by mcatanzaro on #webkit).
2269
2270         Reverted changeset:
2271
2272         "[GTK] Several tests crashing on debug bot in (anonymous
2273         namespace)::MediaPlayerPrivateGStreamerBase::repaint"
2274         https://bugs.webkit.org/show_bug.cgi?id=163511
2275         http://trac.webkit.org/changeset/207409
2276
2277 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
2278
2279         [MediaStream] Resolve constraints and enumerate devices in the UI process
2280         https://bugs.webkit.org/show_bug.cgi?id=162147
2281         <rdar://problem/28803569>
2282
2283         Reviewed by Darin Adler.
2284
2285         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
2286         access happens in the UI process.
2287
2288         No new tests, updated results of existing tests.
2289
2290         * CMakeLists.txt: Add MediaDevicesEnumerationRequest.cpp, delete UserMediaPermissionCheck.cpp.
2291
2292         * Modules/mediastream/MediaConstraintsImpl.cpp:
2293         (WebCore::MediaConstraintsImpl::create): Only create from MediaConstraintsData.
2294         (WebCore::MediaConstraintsImpl::initialize): Deleted.
2295         * Modules/mediastream/MediaConstraintsImpl.h:
2296
2297         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Added.
2298         (WebCore::MediaDevicesEnumerationRequest::create):
2299         (WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
2300         (WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
2301         (WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin):
2302         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
2303         (WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
2304         (WebCore::MediaDevicesEnumerationRequest::start):
2305         (WebCore::MediaDevicesEnumerationRequest::cancel):
2306         (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo):
2307         (WebCore::MediaDevicesEnumerationRequest::finish):
2308         * Modules/mediastream/MediaDevicesEnumerationRequest.h: Added.
2309
2310         * Modules/mediastream/MediaDevicesRequest.cpp:
2311         (WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the enumeration request.
2312         (WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
2313         (WebCore::MediaDevicesRequest::start): Create and use a MediaDevicesEnumerationRequest.
2314         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Deleted.
2315         * Modules/mediastream/MediaDevicesRequest.h:
2316
2317         * Modules/mediastream/UserMediaClient.h:
2318         * Modules/mediastream/UserMediaController.h:
2319         (WebCore::UserMediaController::enumerateMediaDevices): New.
2320         (WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): New.
2321         (WebCore::UserMediaController::checkUserMediaPermission): Deleted.
2322         (WebCore::UserMediaController::cancelUserMediaPermissionCheck): Deleted.
2323
2324         * Modules/mediastream/UserMediaPermissionCheck.h: Deleted.
2325         * Modules/mediastream/UserMediaPermissionCheck.cpp: Deleted.
2326
2327         * Modules/mediastream/UserMediaRequest.cpp:
2328         (WebCore::UserMediaRequest::UserMediaRequest):
2329         (WebCore::UserMediaRequest::start):
2330         (WebCore::UserMediaRequest::allow):
2331         (WebCore::UserMediaRequest::deny):
2332         (WebCore::UserMediaRequest::constraintsValidated): Deleted.
2333         (WebCore::UserMediaRequest::userMediaAccessGranted): Deleted.
2334         (WebCore::UserMediaRequest::userMediaAccessDenied): Deleted.
2335         (WebCore::UserMediaRequest::constraintsInvalid): Deleted.
2336         (WebCore::UserMediaRequest::didCreateStream): Deleted.
2337         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Deleted.
2338         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Deleted.
2339         * Modules/mediastream/UserMediaRequest.h:
2340
2341         * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesEnumerationRequest.*.
2342
2343         * platform/mediastream/CaptureDevice.h:
2344         (WebCore::CaptureDevice::CaptureDevice):
2345         (WebCore::CaptureDevice::setPersistentId): Add setter for argument decoder.
2346         (WebCore::CaptureDevice::setLabel): Ditto.
2347         (WebCore::CaptureDevice::setGroupId): Ditto.
2348         (WebCore::CaptureDevice::setKind): Ditto.
2349
2350         * platform/mediastream/CaptureDeviceManager.h: Remove unnecessary include.
2351
2352         * platform/mediastream/MediaConstraints.h:
2353         (WebCore::MediaConstraint::encode): New.
2354         (WebCore::MediaConstraint::decode): Ditto.
2355         (WebCore::NumericConstraint::encode): Ditto.
2356         (WebCore::NumericConstraint::decode): Ditto.
2357
2358         * platform/mediastream/MediaStreamCreationClient.h: Deleted.
2359
2360         * platform/mediastream/RealtimeMediaSourceCenter.h: Use completion handlers instead of client interface.
2361
2362         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2363         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Drive-by fix: don't initialize
2364         group id, we don't support it.
2365
2366         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2367         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Update for interface change.
2368         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
2369         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
2370
2371         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
2372         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): Ditto.
2373         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
2374         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
2375         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
2376
2377         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2378         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
2379         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Ditto.
2380         * platform/mock/MockRealtimeMediaSourceCenter.h:
2381
2382 2016-10-18  Zan Dobersek  <zdobersek@igalia.com>
2383
2384         [WebIDL] Support BufferSource
2385         https://bugs.webkit.org/show_bug.cgi?id=163541
2386
2387         Reviewed by Youenn Fablet.
2388
2389         Add support for the BufferSource typedef in WebIDL. The implementation
2390         adds the necessary handling for this type in the generator scripts and
2391         the specialization of the Converter<> template for the IDLBufferSource
2392         struct that enables exposing ArrayBuffer or ArrayBufferView objects by
2393         having WebCore::BufferSource objects pointing to their data.
2394
2395         The SourceBuffer interface in the MSE module has the appendBuffer()
2396         operation modified to accept a BufferSource parameter, instead of
2397         overloading it for ArrayBuffer and ArrayBufferView parameters.
2398
2399         The bindings generator tests cover BufferSource as both an operation
2400         parameter and as a dictionary member.
2401
2402         * Modules/mediasource/SourceBuffer.cpp:
2403         (WebCore::SourceBuffer::appendBuffer):
2404         (WebCore::SourceBuffer::appendBufferInternal):
2405         * Modules/mediasource/SourceBuffer.h:
2406         * Modules/mediasource/SourceBuffer.idl:
2407         * WebCore.xcodeproj/project.pbxproj:
2408         * bindings/generic/IDLTypes.h:
2409         * bindings/js/BufferSource.h: Added.
2410         * bindings/js/JSDOMConvert.h:
2411         (WebCore::Converter<IDLBufferSource>::convert):
2412         * bindings/scripts/CodeGenerator.pm:
2413         (SkipIncludeHeader):
2414         (IsWrapperType):
2415         * bindings/scripts/CodeGeneratorJS.pm:
2416         (AddClassForwardIfNeeded):
2417         (GetBaseIDLType):
2418         (IsHandledByDOMConvert):
2419         * bindings/scripts/test/JS/JSTestObj.cpp:
2420         (WebCore::convertDictionary<TestObj::Dictionary>):
2421         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
2422         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
2423         * bindings/scripts/test/TestObj.idl:
2424
2425 2016-10-18  Javier Fernandez  <jfernandez@igalia.com>
2426
2427         [css-grid] Different width of grid container between initial load and refresh
2428         https://bugs.webkit.org/show_bug.cgi?id=163535
2429
2430         Reviewed by Manuel Rego Casasnovas.
2431
2432         Grid's layout logic manages two different override sizes; one it's
2433         designed to implement the grid item's stretching behavior, identified
2434         with the concept of 'overrideContentLogicalSize'; there is another
2435         override size, known as overrideContainingBlockContentLogicalSize,
2436         used to implement the Grid Area abstraction, which will behave as
2437         the actual containing block of any grid item.
2438
2439         During grid's layout logic these override sizes are set according
2440         to the CSS style rules. This affects how the grid container and its
2441         children are going to be sized during layout. Grid Tracks sizing
2442         algorithm depends on these override sizes.
2443
2444         In order to ensure that the tracks sizing algorithm produces the
2445         same results when it's run consecutively several times, we need to
2446         clear these override sizes and perform a layout of the affected grid
2447         items. Otherwise, the affected items will return sizing values which
2448         depend on the override values set in the previous layout, which in
2449         some cases, like orthogonal flows, may change through different runs
2450         of the sizing algorithm.
2451
2452         Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html
2453
2454         * rendering/RenderGrid.cpp:
2455         (WebCore::RenderGrid::layoutBlock):
2456
2457 2016-10-18  Youenn Fablet  <youenn@apple.com>
2458
2459         CachedResourceLoader should not need to remove fragment identifier
2460         https://bugs.webkit.org/show_bug.cgi?id=163015
2461
2462         Reviewed by Darin Adler.
2463
2464         No expected change for non-window port.
2465         For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
2466         before querying the memory cache.
2467
2468         Removing the fragment identifier from the request stored in CachedResourceRequest.
2469         The fragment identifier is stored in a separate field.
2470
2471         This allows CachedResourceLoader to not care about fragment identifier.
2472         CachedResource can then get access to it.
2473
2474         * loader/cache/CachedResource.cpp:
2475         (WebCore::CachedResource::CachedResource):
2476         (WebCore::CachedResource::finishRequestInitialization): Deleted.
2477         * loader/cache/CachedResource.h:
2478         * loader/cache/CachedResourceLoader.cpp:
2479         (WebCore::CachedResourceLoader::cachedResource):
2480         Updated the method taking a const String& to strip the fragment identifier if needed.
2481         Updated the method taking a const URL& to assert if the fragment identifier is present.
2482         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
2483         (WebCore::CachedResourceLoader::requestResource):
2484         * loader/cache/CachedResourceRequest.cpp:
2485         (WebCore::CachedResourceRequest::CachedResourceRequest):
2486         (WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
2487         * loader/cache/CachedResourceRequest.h:
2488         (WebCore::CachedResourceRequest::releaseFragmentIdentifier):
2489         (WebCore::CachedResourceRequest::clearFragmentIdentifier):
2490         * loader/cache/MemoryCache.cpp:
2491         (WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
2492         (WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
2493         (WebCore::MemoryCache::revalidationSucceeded):
2494         (WebCore::MemoryCache::resourceForRequest):
2495         * loader/cache/MemoryCache.h:
2496
2497 2016-10-18  Antti Koivisto  <antti@apple.com>
2498
2499         Rename setNeedsStyleRecalc to invalidateStyle
2500         https://bugs.webkit.org/show_bug.cgi?id=163542
2501
2502         Reviewed by Darin Adler.
2503
2504         Also rename StyleChangeType enum and some related functions for clarity. For example
2505
2506             element.setNeedsStyleRecalc(SyntheticStyleChange);
2507
2508         becomes
2509
2510             element.invalidateStyleAndLayerComposition();
2511
2512         * WebCore.xcodeproj/project.pbxproj:
2513         * css/StyleInvalidationAnalysis.cpp:
2514         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
2515         * dom/Document.cpp:
2516         (WebCore::Document::recalcStyle):
2517         (WebCore::Document::updateViewportUnitsOnResize):
2518         (WebCore::Document::setCSSTarget):
2519         (WebCore::unwrapFullScreenRenderer):
2520         (WebCore::Document::setAnimatingFullScreen):
2521         * dom/Element.cpp:
2522         (WebCore::Element::setActive):
2523         (WebCore::Element::setFocus):
2524         (WebCore::Element::setHovered):
2525         (WebCore::Element::attributeChanged):
2526         (WebCore::Element::invalidateStyle):
2527         (WebCore::Element::invalidateStyleAndLayerComposition):
2528         (WebCore::Element::invalidateStyleForSubtree):
2529         (WebCore::Element::invalidateStyleAndRenderersForSubtree):
2530
2531             Move public invalidation functions to Element tightening typing.
2532             Use separate functions instead of enum values.
2533             This way the call sites look nicer and only useful combinations are exposed.
2534
2535         (WebCore::Element::addShadowRoot):
2536         (WebCore::checkForEmptyStyleChange):
2537         (WebCore::checkForSiblingStyleChanges):
2538         (WebCore::Element::needsStyleInvalidation):
2539         (WebCore::Element::setContainsFullScreenElement):
2540         * dom/Element.h:
2541         (WebCore::Element::setHasFocusWithin):
2542         * dom/Node.cpp:
2543         (WebCore::computeEditabilityFromComputedStyle):
2544         (WebCore::Node::adjustStyleValidity):
2545
2546             Update validity and mode separately. There was a potential bug here where
2547             SyntheticStyleChange could overwrite FullStyleChange (no known repro).
2548
2549         (WebCore::Node::updateAncestorsForStyleRecalc):
2550         (WebCore::Node::invalidateStyle):
2551         (WebCore::Node::insertedInto):
2552         (WebCore::Node::setNeedsStyleRecalc): Deleted.
2553         * dom/Node.h:
2554         (WebCore::Node::needsStyleRecalc):
2555         (WebCore::Node::styleValidity):
2556         (WebCore::Node::styleResolutionShouldRecompositeLayer):
2557         (WebCore::Node::setHasValidStyle):
2558         (WebCore::Node::styleChangeType): Deleted.
2559         (WebCore::Node::clearNeedsStyleRecalc): Deleted.
2560         (WebCore::Node::setStyleChange): Deleted.
2561         * dom/RadioButtonGroups.cpp:
2562         (WebCore::RadioButtonGroup::remove):
2563         (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
2564         * dom/ShadowRoot.cpp:
2565         (WebCore::ShadowRoot::setResetStyleInheritance):
2566         * dom/SlotAssignment.cpp:
2567         (WebCore::SlotAssignment::addSlotElementByName):
2568         (WebCore::SlotAssignment::removeSlotElementByName):
2569         (WebCore::SlotAssignment::didChangeSlot):
2570         * dom/StyledElement.cpp:
2571         (WebCore::StyledElement::attributeChanged):
2572         (WebCore::StyledElement::styleAttributeChanged):
2573         (WebCore::StyledElement::invalidateStyleAttribute):
2574         * dom/Text.cpp:
2575         (WebCore::Text::updateRendererAfterContentChange):
2576         * dom/VisitedLinkState.cpp:
2577         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
2578         (WebCore::VisitedLinkState::invalidateStyleForLink):
2579         * editing/FrameSelection.cpp:
2580         (WebCore::FrameSelection::focusedOrActiveStateChanged):
2581         * html/BaseDateAndTimeInputType.cpp:
2582         (WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
2583         * html/FileInputType.cpp:
2584         (WebCore::FileInputType::setValue):
2585         * html/HTMLAnchorElement.cpp:
2586         (WebCore::HTMLAnchorElement::parseAttribute):
2587         * html/HTMLBodyElement.cpp:
2588         (WebCore::HTMLBodyElement::parseAttribute):
2589         * html/HTMLCanvasElement.cpp:
2590         (WebCore::HTMLCanvasElement::getContext):
2591         (WebCore::HTMLCanvasElement::createImageBuffer):
2592         * html/HTMLElement.cpp:
2593         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
2594         (WebCore::HTMLElement::calculateAndAdjustDirectionality):
2595         * html/HTMLFieldSetElement.cpp:
2596         (WebCore::HTMLFieldSetElement::addInvalidDescendant):
2597         (WebCore::HTMLFieldSetElement::removeInvalidDescendant):
2598         * html/HTMLFormControlElement.cpp:
2599         (WebCore::HTMLFormControlElement::disabledStateChanged):
2600         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
2601         (WebCore::HTMLFormControlElement::requiredAttributeChanged):
2602         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
2603         (WebCore::HTMLFormControlElement::updateValidity):
2604         * html/HTMLFormElement.cpp:
2605         (WebCore::HTMLFormElement::registerFormElement):
2606         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
2607         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
2608         (WebCore::HTMLFormElement::resetDefaultButton):
2609         * html/HTMLFrameElementBase.cpp:
2610         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
2611         * html/HTMLFrameOwnerElement.cpp:
2612         (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
2613         (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
2614         * html/HTMLFrameOwnerElement.h:
2615         * html/HTMLFrameSetElement.cpp:
2616         (WebCore::HTMLFrameSetElement::parseAttribute):
2617         (WebCore::HTMLFrameSetElement::willRecalcStyle):
2618         * html/HTMLInputElement.cpp:
2619         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
2620         (WebCore::HTMLInputElement::parseAttribute):
2621         (WebCore::HTMLInputElement::setChecked):
2622         (WebCore::HTMLInputElement::setIndeterminate):
2623         (WebCore::HTMLInputElement::setAutoFilled):
2624         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
2625         (WebCore::HTMLInputElement::minLengthAttributeChanged):
2626         * html/HTMLLinkElement.cpp:
2627         (WebCore::HTMLLinkElement::parseAttribute):
2628         * html/HTMLMediaElement.cpp:
2629         (WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
2630         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2631         * html/HTMLObjectElement.cpp:
2632         (WebCore::HTMLObjectElement::parseAttribute):
2633         (WebCore::HTMLObjectElement::childrenChanged):
2634         (WebCore::HTMLObjectElement::renderFallbackContent):
2635         * html/HTMLOptGroupElement.cpp:
2636         (WebCore::HTMLOptGroupElement::parseAttribute):
2637         * html/HTMLOptionElement.cpp:
2638         (WebCore::HTMLOptionElement::parseAttribute):
2639         (WebCore::HTMLOptionElement::setSelectedState):
2640         * html/HTMLPlugInElement.cpp:
2641         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
2642         * html/HTMLPlugInImageElement.cpp:
2643         (WebCore::HTMLPlugInImageElement::setDisplayState):
2644         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
2645         (WebCore::HTMLPlugInImageElement::finishParsingChildren):
2646         (WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
2647         (WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
2648         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
2649         * html/HTMLProgressElement.cpp:
2650         (WebCore::HTMLProgressElement::didElementStateChange):
2651         * html/HTMLSelectElement.cpp:
2652         (WebCore::HTMLSelectElement::parseAttribute):
2653         (WebCore::HTMLSelectElement::setRecalcListItems):
2654         (WebCore::HTMLSelectElement::parseMultipleAttribute):
2655         (WebCore::HTMLSelectElement::reset):
2656         * html/HTMLTableElement.cpp:
2657         (WebCore::isTableCellAncestor):
2658         (WebCore::setTableCellsChanged):
2659         (WebCore::HTMLTableElement::parseAttribute):
2660         * html/HTMLTextAreaElement.cpp:
2661         (WebCore::HTMLTextAreaElement::setValueCommon):
2662         * html/HTMLTextFormControlElement.cpp:
2663         (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
2664         * html/InputType.cpp:
2665         (WebCore::InputType::setValue):
2666         * html/NumberInputType.cpp:
2667         (WebCore::NumberInputType::minOrMaxAttributeChanged):
2668         * html/TextFieldInputType.cpp:
2669         (WebCore::TextFieldInputType::subtreeHasChanged):
2670         * mathml/MathMLElement.cpp:
2671         (WebCore::MathMLElement::parseAttribute):
2672         * mathml/MathMLSelectElement.cpp:
2673         (WebCore::MathMLSelectElement::updateSelectedChild):
2674         * page/animation/AnimationBase.cpp:
2675         (WebCore::AnimationBase::setNeedsStyleRecalc):
2676         * page/animation/AnimationController.cpp:
2677         (WebCore::AnimationControllerPrivate::clear):
2678         (WebCore::AnimationControllerPrivate::updateAnimations):
2679         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
2680         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
2681         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
2682         (WebCore::AnimationController::cancelAnimations):
2683         * rendering/RenderImage.cpp:
2684         (WebCore::RenderImage::imageChanged):
2685         * rendering/RenderLayer.cpp:
2686         (WebCore::RenderLayer::calculateClipRects):
2687         * rendering/RenderLayerCompositor.cpp:
2688         (WebCore::RenderLayerCompositor::attachRootLayer):
2689         (WebCore::RenderLayerCompositor::detachRootLayer):
2690         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
2691         * rendering/RenderObject.cpp:
2692         (WebCore::RenderObject::updateDragState):
2693         * rendering/svg/SVGResourcesCache.cpp:
2694         (WebCore::SVGResourcesCache::clientStyleChanged):
2695         * style/AttributeChangeInvalidation.cpp:
2696         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
2697         * style/ClassChangeInvalidation.cpp:
2698         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
2699         * style/IdChangeInvalidation.cpp:
2700         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
2701         * style/RenderTreeUpdater.cpp:
2702         (WebCore::RenderTreeUpdater::updateElementRenderer):
2703         * style/StyleScope.cpp:
2704         (WebCore::Style::Scope::updateActiveStyleSheets):
2705         * style/StyleTreeResolver.cpp:
2706         (WebCore::Style::resetStyleForNonRenderedDescendants):
2707         (WebCore::Style::TreeResolver::resolveElement):
2708         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2709         (WebCore::Style::TreeResolver::popParent):
2710         (WebCore::Style::clearNeedsStyleResolution):
2711         (WebCore::Style::TreeResolver::resolveComposedTree):
2712         * style/StyleUpdate.h:
2713         * style/StyleValidity.h: Added.
2714
2715             StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
2716             Move to a file of its own.
2717
2718         * svg/SVGAElement.cpp:
2719         (WebCore::SVGAElement::svgAttributeChanged):
2720         * svg/SVGAnimateElementBase.cpp:
2721         (WebCore::applyCSSPropertyToTarget):
2722         (WebCore::removeCSSPropertyFromTarget):
2723         * svg/SVGElement.cpp:
2724         (WebCore::SVGElement::willRecalcStyle):
2725         * svg/SVGElement.h:
2726         (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
2727         * svg/SVGTests.cpp:
2728         (WebCore::SVGTests::handleAttributeChange):
2729         * svg/SVGUseElement.cpp:
2730         (WebCore::SVGUseElement::invalidateShadowTree):
2731         * testing/Internals.cpp:
2732         (WebCore::styleValidityToToString):
2733         (WebCore::Internals::styleChangeType):
2734         (WebCore::styleChangeTypeToString): Deleted.
2735
2736 2016-10-17  Sergio Villar Senin  <svillar@igalia.com>
2737
2738         [css-grid] Constrain by min|max-height on auto repeat computation
2739         https://bugs.webkit.org/show_bug.cgi?id=163540
2740
2741         Reviewed by Darin Adler.
2742
2743         The max-height (if definite) is used to compute the number of auto repeat rows whenever the
2744         height is indefinite. We were using the min-height only in case both values were indefinite.
2745
2746         Although not explicitly mentioned by grid specs, it's reasonable to assume that
2747         the min-height trumps the used value of height/max-height like it always does, per CSS
2748         2.2. Note that the number of rows still needs to fit within that size even if using
2749         min-height, because we're just using min-height to compute the used value of the height
2750         property. If both height and max-height are indefinite we keep doing the same, i.e., compute
2751         the minimum number of rows that fulfill min-height (if definite).
2752
2753         * rendering/RenderGrid.cpp:
2754         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
2755
2756 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
2757
2758         [DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
2759         https://bugs.webkit.org/show_bug.cgi?id=163586
2760
2761         Reviewed by Saam Barati.
2762
2763         * domjit/JSNodeDOMJIT.cpp:
2764         (WebCore::toWrapperSlow):
2765
2766 2016-10-18  Ryuan Choi  <ryuan.choi@navercorp.com>
2767
2768         [EFL] Build break since r207442
2769         https://bugs.webkit.org/show_bug.cgi?id=163587
2770
2771         Unreviewed.
2772
2773         Since r207442, setRGB is moved to private.
2774
2775         * rendering/RenderThemeEfl.cpp:
2776         (WebCore::fillColorsFromEdjeClass):
2777
2778 2016-10-17  Dean Jackson  <dino@apple.com>
2779
2780         Remove dependency cycle with UIKit
2781         https://bugs.webkit.org/show_bug.cgi?id=163577
2782         <rdar://problem/28786160>
2783
2784         Reviewed by Tim Horton.
2785
2786         Soft link against UIKit.
2787
2788         * Configurations/WebCoreTestSupport.xcconfig:
2789         * testing/Internals.mm:
2790
2791 2016-10-17  Dean Jackson  <dino@apple.com>
2792
2793         Allow creation of ExtendedColors and make Color immutable
2794         https://bugs.webkit.org/show_bug.cgi?id=163557
2795         <rdar://problem/28805360>
2796
2797         Reviewed by Darin Adler and Dave Hyatt.
2798
2799         1. Support the creation of ExtendedColor objects via the
2800         Color class.
2801
2802         2. Fix the remaining few places where a Color object is
2803         modified after creation, instead creating a new Color.
2804         Move all the mutation methods into the private section,
2805         making Color now immutable.
2806
2807         Changes to Color are covered by existing tests. Changes
2808         to ExtendedColor are covered by the ExtendedColor API test.
2809
2810         * css/parser/CSSParser.cpp:
2811         (WebCore::CSSParser::fastParseColor): Return a new named Color.
2812
2813         * dom/Document.cpp:
2814         (WebCore::Document::resetActiveLinkColor): Set to be the named "red" color.
2815
2816         * html/HTMLElement.cpp:
2817         (WebCore::HTMLElement::addHTMLColorToStyle): Use the string-based constructor
2818         where possible.
2819
2820         * page/CaptionUserPreferencesMediaAF.cpp:
2821         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): No need to
2822         use the string "black" here - we have a constant value.
2823
2824         * platform/graphics/cairo/GraphicsContextCairo.cpp: Don't use setRGB.
2825
2826         * platform/graphics/Color.cpp:
2827         (WebCore::findNamedColor): Move this up in the file.
2828         (WebCore::Color::Color): Copy in the code from setNamedColor. Also
2829         add a constructor for ExtendedColor.
2830         (WebCore::Color::serialized): Call ExtendedColor's serializer if necessary.
2831         (WebCore::Color::cssText): Ditto.
2832         (WebCore::Color::setNamedColor): Deleted.
2833         (WebCore::Color::tagAsExtended): Deleted.
2834
2835         * platform/graphics/Color.h: Add a new constructor.
2836         (WebCore::Color::setRGB): Move to private.
2837
2838         * platform/graphics/ExtendedColor.cpp:
2839         (WebCore::ExtendedColor::cssText): Implement serializer.
2840         * platform/graphics/ExtendedColor.h:
2841
2842         * rendering/style/RenderStyle.cpp:
2843         (WebCore::RenderStyle::colorIncludingFallback): Construct a new Color rather than changing an existing object.
2844
2845 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
2846
2847         Implement DOMRect/DOMRectReadOnly
2848         https://bugs.webkit.org/show_bug.cgi?id=163464
2849
2850         Reviewed by Darin Adler.
2851         
2852         Implement the DOMRectInit/DOMRectReadOnly/DOMRect interfaces specified in
2853         https://dev.w3.org/fxtf/geometry/
2854         
2855         DOMRects allow negative height/width and require double storage, so we can't just
2856         use FloatRect for storage. They also require handling of NaN and Infinity.
2857         
2858         To have the left/right/top/bottom accessors follow IEEE NaN rules, we need to use
2859         custom min/max functions that return NaN if either argument is NaN, so add 
2860         nanPropagatingMin/nanPropagatingMax helpers to MathExtras.h.
2861
2862         Test: fast/dom/domrect.html
2863
2864         * CMakeLists.txt:
2865         * DerivedSources.make:
2866         * WebCore.xcodeproj/project.pbxproj:
2867         * dom/DOMRect.h: Added.
2868         (WebCore::DOMRect::create):
2869         (WebCore::DOMRect::fromRect):
2870         (WebCore::DOMRect::setX):
2871         (WebCore::DOMRect::setY):
2872         (WebCore::DOMRect::setWidth):
2873         (WebCore::DOMRect::setHeight):
2874         (WebCore::DOMRect::DOMRect):
2875         * dom/DOMRect.idl: Added.
2876         * dom/DOMRectInit.h: Added.
2877         * dom/DOMRectInit.idl: Added.
2878         * dom/DOMRectReadOnly.h: Added.
2879         (WebCore::DOMRectReadOnly::create):
2880         (WebCore::DOMRectReadOnly::fromRect):
2881         (WebCore::DOMRectReadOnly::x):
2882         (WebCore::DOMRectReadOnly::y):
2883         (WebCore::DOMRectReadOnly::width):
2884         (WebCore::DOMRectReadOnly::height):
2885         (WebCore::DOMRectReadOnly::top):
2886         (WebCore::DOMRectReadOnly::right):
2887         (WebCore::DOMRectReadOnly::bottom):
2888         (WebCore::DOMRectReadOnly::left):
2889         (WebCore::DOMRectReadOnly::DOMRectReadOnly):
2890         * dom/DOMRectReadOnly.idl: Added.
2891
2892 2016-10-17  Antoine Quint  <graouts@apple.com>
2893
2894         [Modern Media Controls] Basic MediaController
2895         https://bugs.webkit.org/show_bug.cgi?id=163539
2896         <rdar://problem/28797542>
2897
2898         Reviewed by Darin Adler.
2899
2900         We add a new main.js file which acts as the entry point by implementing the createControls()
2901         function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
2902         been created. That functions creates an instance of the new MediaController class, which is
2903         the controller object that will handle communication between the media controls and the media
2904         element. At first, this MediaController class is very limited and assumes macOS inline
2905         layout traits and forces a start button to be shown over the media, which can be played
2906         to start the media and show the full controls. More functionality will be added by future patches.
2907
2908         Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
2909                media/modern-media-controls/media-controller/media-controller-constructor.html
2910                media/modern-media-controls/media-controller/media-controller-resize.html
2911
2912         * Modules/modern-media-controls/main.js: Added.
2913         (createControls):
2914         * Modules/modern-media-controls/media/media-controller.js: Added.
2915         (MediaController):
2916         (MediaController.prototype.set pageScaleFactor):
2917         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
2918         (MediaController.prototype.handleEvent):
2919         (MediaController.prototype.buttonWasClicked):
2920         (MediaController.prototype._updateControlsSize):
2921         * WebCore.xcodeproj/project.pbxproj:
2922         * rendering/RenderThemeMac.mm:
2923         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2924         (WebCore::RenderThemeMac::mediaControlsScript):
2925
2926 2016-10-17  Anders Carlsson  <andersca@apple.com>
2927
2928         Remove an unused HistoryItem function
2929         https://bugs.webkit.org/show_bug.cgi?id=163565
2930
2931         Reviewed by Tim Horton.
2932
2933         * history/HistoryItem.cpp:
2934         (WebCore::HistoryItem::isAncestorOf): Deleted.
2935         * history/HistoryItem.h:
2936
2937 2016-10-17  Nan Wang  <n_wang@apple.com>
2938
2939         AX: [Mac] mapping for output elements
2940         https://bugs.webkit.org/show_bug.cgi?id=163471
2941
2942         Reviewed by Chris Fleizach.
2943
2944         Mapped the output element to status role and exposed its text content
2945         as AXTitle. 
2946
2947         Test: accessibility/mac/output-element.html
2948
2949         * English.lproj/Localizable.strings:
2950         * accessibility/AccessibilityNodeObject.cpp:
2951         (WebCore::AccessibilityNodeObject::visibleText):
2952         * accessibility/AccessibilityObject.cpp:
2953         (WebCore::AccessibilityObject::isOutput):
2954         * accessibility/AccessibilityObject.h:
2955         * accessibility/AccessibilityRenderObject.cpp:
2956         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2957         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2958         (-[WebAccessibilityObjectWrapper roleDescription]):
2959         * platform/LocalizedStrings.cpp:
2960         (WebCore::AXOutputText):
2961         * platform/LocalizedStrings.h:
2962         * platform/efl/LocalizedStringsEfl.cpp:
2963         (WebCore::AXOutputText):
2964         * platform/gtk/LocalizedStringsGtk.cpp:
2965         (WebCore::AXOutputText):
2966
2967 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
2968
2969         [DOMJIT] Use DOMJIT::Patchpoint in IC
2970         https://bugs.webkit.org/show_bug.cgi?id=163223
2971
2972         Reviewed by Saam Barati.
2973
2974         Make DOMJITPatchpointParams non-const.
2975
2976         * domjit/DOMJITHelpers.h:
2977         (WebCore::DOMJITHelpers::toWrapper):
2978         * domjit/JSNodeDOMJIT.cpp:
2979         (WebCore::createCallDOMForOffsetAccess):
2980         (WebCore::checkNode):
2981         (WebCore::NodeNodeTypeDOMJIT::callDOM):
2982
2983 2016-10-17  Chris Dumez  <cdumez@apple.com>
2984
2985         Move form.reportValidity() behind InteractiveFormValidation setting
2986         https://bugs.webkit.org/show_bug.cgi?id=163550
2987
2988         Reviewed by Darin Adler.
2989
2990         Move form.reportValidity() behind InteractiveFormValidation setting for consistency
2991         given that the two features are strongly related.
2992
2993         Also enable the setting by default so we can get feedback on the implementation.
2994
2995         Demos:
2996         - Interactive form validation: http://jsfiddle.net/tj_vantoll/HdSqt/
2997         - Report validity: https://googlechrome.github.io/samples/report-validity/
2998
2999         * bindings/generic/RuntimeEnabledFeatures.h:
3000         (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
3001         (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
3002         * html/HTMLButtonElement.idl:
3003         * html/HTMLFieldSetElement.idl:
3004         * html/HTMLFormElement.idl:
3005         * html/HTMLInputElement.idl:
3006         * html/HTMLKeygenElement.idl:
3007         * html/HTMLObjectElement.idl:
3008         * html/HTMLOutputElement.idl:
3009         * html/HTMLSelectElement.idl:
3010         * html/HTMLTextAreaElement.idl:
3011
3012 2016-10-17  Antoine Quint  <graouts@apple.com>
3013
3014         [Modern Media Controls] Add a MediaControlsHost API to retrieve images as base64
3015         https://bugs.webkit.org/show_bug.cgi?id=163502
3016         <rdar://problem/28792017>
3017
3018         Reviewed by Darin Adler.
3019
3020         Add a new `base64StringForIconAndPlatform()` method to MediaControlsHost such that we
3021         may load images from the modern-media-controls directory in the WebCore.framework bundle.
3022         We use this new method in the iconService singleton when a `mediaControlsHost` is set,
3023         which will be set in a later patch.
3024
3025         * Modules/mediacontrols/MediaControlsHost.cpp:
3026         (WebCore::MediaControlsHost::base64StringForIconAndPlatform):
3027         * Modules/mediacontrols/MediaControlsHost.h:
3028         * Modules/mediacontrols/MediaControlsHost.idl:
3029         * Modules/modern-media-controls/controls/icon-service.js:
3030         (const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
3031         (const.iconService.new.IconService):
3032         * rendering/RenderTheme.h:
3033         (WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform):
3034         (WebCore::RenderTheme::mediaControlsScript): Deleted.
3035         * rendering/RenderThemeMac.h:
3036         * rendering/RenderThemeMac.mm:
3037         (WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform):
3038
3039 2016-10-17  Antoine Quint  <graouts@apple.com>
3040
3041         [Modern Media Controls] Add a MediaControlsHost API to retrieve the shadow root CSS
3042         https://bugs.webkit.org/show_bug.cgi?id=163501
3043         <rdar://problem/28792014>
3044
3045         Reviewed by Darin Adler.
3046
3047         Add a new `shadowRootCSSText` property to MediaControlsHost so that we may obtain the
3048         concatenated CSS sources for the media controls shadow root via JS. Actually using this
3049         API will be done in a later patch. We also no longer inject those styles as a user-agent
3050         stylesheet when the runtime flag is on since it will no longer be necessary.
3051
3052         * Modules/mediacontrols/MediaControlsHost.cpp:
3053         (WebCore::MediaControlsHost::shadowRootCSSText):
3054         * Modules/mediacontrols/MediaControlsHost.h:
3055         * Modules/mediacontrols/MediaControlsHost.idl:
3056         * css/CSSDefaultStyleSheets.cpp:
3057         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
3058
3059 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
3060
3061         Implement DOMPoint/DOMPointReadOnly
3062         https://bugs.webkit.org/show_bug.cgi?id=133916
3063
3064         Reviewed by Darin Adler.
3065
3066         Patch mostly by Dirk Schultz <krit@webkit.org>.
3067
3068         Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
3069         (although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
3070         with Chrome).
3071         
3072         Test: geometry/DOMPoint-001.html
3073
3074         * CMakeLists.txt:
3075         * DerivedSources.make:
3076         * WebCore.xcodeproj/project.pbxproj:
3077         * dom/DOMPoint.h: Added.
3078         * dom/DOMPoint.idl: Added.
3079         * dom/DOMPointInit.h: Added.
3080         * dom/DOMPointInit.idl: Added.
3081         * dom/DOMPointReadOnly.h: Added.
3082         (WebCore::DOMPointReadOnly::create):
3083         (WebCore::DOMPointReadOnly::fromPoint):
3084         (WebCore::DOMPointReadOnly::x):
3085         (WebCore::DOMPointReadOnly::y):
3086         (WebCore::DOMPointReadOnly::z):
3087         (WebCore::DOMPointReadOnly::w):
3088         (WebCore::DOMPointReadOnly::DOMPointReadOnly):
3089         * dom/DOMPointReadOnly.idl: Added.
3090
3091 2016-10-17  Antoine Quint  <graouts@apple.com>
3092
3093         [Modern Media Controls] Use modern-media-controls module sources for media controls stylesheet and script injection
3094         https://bugs.webkit.org/show_bug.cgi?id=163500
3095         <rdar://problem/28792010>
3096
3097         Reviewed by Darin Adler.
3098
3099         Add files from the Modules/modern-media-controls directory to the Xcode project and add a copy phase
3100         to copy those files with their directory stucture as a subdirectory of the WebCore.framework Resources
3101         directory.
3102
3103         Additionally, use the modern-media-controls Module CSS and JS files when concatenating the media controls
3104         scripts and styles in RenderTheme when the runtime flag is on.
3105
3106         * WebCore.xcodeproj/project.pbxproj:
3107         * rendering/RenderThemeMac.mm:
3108         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
3109         (WebCore::RenderThemeMac::mediaControlsScript):
3110
3111 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
3112
3113         Fix typo in error message.
3114
3115         * bindings/scripts/CodeGeneratorJS.pm:
3116         (GenerateSerializerFunction):
3117
3118 2016-10-17  Fujii Hironori  <Hironori.Fujii@sony.com>
3119
3120         preprocessor.pm: cl.exe outputs processing filenames if Windows Perl is used
3121         https://bugs.webkit.org/show_bug.cgi?id=163435
3122
3123         Reviewed by Alex Christensen.
3124
3125         cl.exe outputs processing filenames to stderr. Suppress this
3126         annoying messages by using open3 instead of open2.
3127
3128         * bindings/scripts/preprocessor.pm:
3129         (applyPreprocessor): Use open3 in case of Windows Perl.
3130
3131 2016-10-17  Mark Lam  <mark.lam@apple.com>
3132
3133         Use the reject() helper function for conditionally throwing TypeErrors.
3134         https://bugs.webkit.org/show_bug.cgi?id=163491
3135
3136         Reviewed by Filip Pizlo.
3137
3138         No new tests because this patch does not introduce new behavior.
3139
3140         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3141         (WebCore::createRsaKeyGenParams):
3142         * bindings/js/JSIDBDatabaseCustom.cpp:
3143         (WebCore::JSIDBDatabase::createObjectStore):
3144         * bridge/c/c_instance.cpp:
3145         (JSC::Bindings::CInstance::invokeMethod):
3146
3147 2016-10-17  Miguel Gomez  <magomez@igalia.com>
3148
3149         [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
3150         https://bugs.webkit.org/show_bug.cgi?id=163511
3151
3152         Reviewed by Carlos Garcia Campos.
3153
3154         Perform the video repaint in the main thread when accelerated compositing is disabled.
3155
3156         Covered by existent tests.
3157
3158         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3159         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
3160         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
3161         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
3162         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3163
3164 2016-10-17  Konstantin Tokarev  <annulen@yandex.ru>
3165
3166         Eleminate code duplication between ResourceRequest encoding/decoding implementations
3167         https://bugs.webkit.org/show_bug.cgi?id=163507
3168
3169         Reviewed by Carlos Garcia Campos.
3170
3171         ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
3172         ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
3173         ditto for decoding implementations.
3174
3175         No new tests needed.
3176
3177         * platform/network/ResourceRequestBase.h:
3178         (WebCore::ResourceRequestBase::encodeBase):
3179         (WebCore::ResourceRequestBase::decodeBase):
3180         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
3181         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
3182         * platform/network/soup/ResourceRequest.h:
3183         (WebCore::ResourceRequest::encodeWithPlatformData):
3184         (WebCore::ResourceRequest::decodeWithPlatformData):
3185
3186 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3187
3188         Move user agent quirks to cross-platform location
3189         https://bugs.webkit.org/show_bug.cgi?id=163508
3190
3191         Reviewed by Carlos Garcia Campos.
3192
3193         Tested by Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp.
3194
3195         * PlatformGTK.cmake:
3196         * platform/UserAgent.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.
3197         * platform/UserAgentQuirks.cpp: Added. Moved from UserAgentGtk.cpp.
3198         (WebCore::urlRequiresChromeBrowser): Sneakily tighten up Google domain detection, it should
3199         only apply to sites if the base domain matches google.*, not any base domain that starts
3200         with google.
3201         (WebCore::urlRequiresMacintoshPlatform):
3202         (WebCore::UserAgentQuirks::quirksForURL):
3203         (WebCore::UserAgentQuirks::stringForQuirk):
3204         * platform/UserAgentQuirks.h: Moved from UserAgentGtk.cpp. prepare-ChangeLog thinks it was
3205         renamed from Source/WebCore/platform/efl/UserAgentEfl.h, but prepare-ChangeLog is dumb.
3206         (WebCore::UserAgentQuirks::UserAgentQuirks):
3207         (WebCore::UserAgentQuirks::add):
3208         (WebCore::UserAgentQuirks::contains):
3209         (WebCore::UserAgentQuirks::isEmpty):
3210         * platform/efl/UserAgentEfl.cpp:
3211         (WebCore::standardUserAgentForURL):
3212         * platform/gtk/UserAgentGtk.cpp:
3213         (WebCore::buildUserAgentString):
3214         (WebCore::standardUserAgentForURL):
3215         (): Deleted.
3216         (WebCore::UserAgentQuirks::UserAgentQuirks): Deleted.
3217         (WebCore::UserAgentQuirks::add): Deleted.
3218         (WebCore::UserAgentQuirks::contains): Deleted.
3219         (WebCore::UserAgentQuirks::isEmpty): Deleted.
3220         (WebCore::urlRequiresChromeBrowser): Deleted.
3221         (WebCore::urlRequiresMacintoshPlatform): Deleted.
3222
3223 2016-10-17  Alberto Garcia  <berto@igalia.com>
3224
3225         [GTK] gobject-introspection on package build with webkit2gtk fails without active X session
3226         https://bugs.webkit.org/show_bug.cgi?id=163105
3227
3228         Reviewed by Carlos Garcia Campos.
3229
3230         Don't call XCompositeQueryExtension() or XDamageQueryExtension()
3231         if m_display is NULL.
3232
3233         * platform/graphics/x11/PlatformDisplayX11.cpp:
3234         (WebCore::PlatformDisplayX11::supportsXComposite):
3235         (WebCore::PlatformDisplayX11::supportsXDamage):
3236
3237 2016-10-16  Nan Wang  <n_wang@apple.com>
3238
3239         AX: [Mac] roleDescription for AXTextField input types
3240         https://bugs.webkit.org/show_bug.cgi?id=163419
3241         <rdar://problem/28766192>
3242
3243         Reviewed by Darin Adler.
3244
3245         Provided more detailed role description for input types that
3246         exposed as standard text fields on the mac.
3247
3248         Changes are covered in modified test expectation.
3249
3250         * English.lproj/Localizable.strings:
3251         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3252         (-[WebAccessibilityObjectWrapper roleDescription]):
3253         * platform/LocalizedStrings.cpp:
3254         (WebCore::AXEmailFieldText):
3255         (WebCore::AXTelephoneFieldText):
3256         (WebCore::AXURLFieldText):
3257         (WebCore::AXDateFieldText):
3258         (WebCore::AXTimeFieldText):
3259         * platform/LocalizedStrings.h:
3260         * platform/efl/LocalizedStringsEfl.cpp:
3261         (WebCore::AXEmailFieldText):
3262         (WebCore::AXTelephoneFieldText):
3263         (WebCore::AXURLFieldText):
3264         (WebCore::AXDateFieldText):
3265         (WebCore::AXTimeFieldText):
3266         * platform/gtk/LocalizedStringsGtk.cpp:
3267         (WebCore::AXEmailFieldText):
3268         (WebCore::AXTelephoneFieldText):
3269         (WebCore::AXURLFieldText):
3270         (WebCore::AXDateFieldText):
3271         (WebCore::AXTimeFieldText):
3272
3273 2016-10-16  Chris Dumez  <cdumez@apple.com>
3274
3275         Update WebKit localizable strings
3276         https://bugs.webkit.org/show_bug.cgi?id=163513
3277
3278         Reviewed by Dan Bernstein.
3279
3280         Update WebKit localizable strings as it was missing the "too short" one needed
3281         by form validation. This was causing a "Localized string not found" message to
3282         be shown when testing the following sample on WebKit ToT:
3283         - https://googlechrome.github.io/samples/report-validity/
3284
3285         * English.lproj/Localizable.strings:
3286
3287 2016-10-16  Chris Dumez  <cdumez@apple.com>
3288
3289         REGRESSION (r206750): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences
3290         https://bugs.webkit.org/show_bug.cgi?id=163506
3291         <rdar://problem/28792483>
3292
3293         Reviewed by Darin Adler.
3294
3295         As per the NSEvent documentation [1], calling [NSEvent characters] is only
3296         valid on key up / key down events and will raise an NSInternalInconsistencyException
3297         if accessed on any other kind of event object. The crash happens when keyForKeyEvent()
3298         is called with the third kind of key event (NSFlagsChanged) which is used for
3299         detecting modifier keys. We normally detect the modifier key and return early before
3300         calling [NSEvent characters]. However, in some rare cases, we fail to detect the
3301         modifier key and we fall through.
3302
3303         To address the issue, we now return "Unidentified" for NSFlagsChanged events, if we
3304         fail to detect the modifier key and before calling [NSEvent characters].
3305
3306         [1] https://developer.apple.com/reference/appkit/nsevent/1534183-characters
3307
3308         No new test, not easily testable.
3309
3310         * platform/mac/PlatformEventFactoryMac.mm:
3311         (WebCore::keyForKeyEvent):
3312
3313 2016-10-16  Darin Adler  <darin@apple.com>
3314
3315         Move CSS classes from ExceptionCode to Exception
3316         https://bugs.webkit.org/show_bug.cgi?id=163494
3317
3318         Reviewed by Sam Weinig.
3319
3320         Removed the "get" prefix from the names of many CSSPrimitiveValue
3321         functions to match WebKit coding style and to disambiguate them
3322         from the public CSS DOM functions that raise exceptions.
3323
3324         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3325         (WebCore::propertyNamePrefix): Use enum class.
3326         (WebCore::parseJavaScriptCSSPropertyName): Tweak style a bit.
3327         (WebCore::stylePropertyGetter): Refactor to simplify structure.
3328         (WebCore::stylePropertyGetterPixelOrPosPrefix): Ditto. Also use floatValue.
3329         (WebCore::JSCSSStyleDeclaration::putDelegate): Use findIgnoringASCIICase,
3330         and use propagateException to handle ExcpetionOr.
3331         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Tweak style a bit.
3332         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Use a lambda to
3333         initialize a global here.
3334
3335         * bindings/js/JSDOMBinding.h: Added toJSString to support bindings for
3336         functions returning ExceptionOr<String>.
3337
3338         * bindings/scripts/gobject-generate-headers.pl: Deleted.
3339
3340         * css/BasicShapeFunctions.cpp:
3341         (WebCore::convertToLengthSize): Use pairValue.
3342         (WebCore::convertToCenterCoordinate): Use valueID and pairValue.
3343         (WebCore::cssValueToBasicShapeRadius): Ditto.
3344         * css/CSSBasicShapes.cpp:
3345         (WebCore::serializePositionOffset): Ditto.
3346         (WebCore::buildSerializablePositionOffset): Ditto.
3347         (WebCore::CSSBasicShapeCircle::cssText): Ditto.
3348         (WebCore::CSSBasicShapeEllipse::cssText): Ditto.
3349         (WebCore::updateCornerRadiusWidthAndHeight): Ditto.
3350         * css/CSSBorderImageSliceValue.h: Use quadValue.
3351         * css/CSSCalculationValue.cpp:
3352         (WebCore::determineCategory): Use floatValue and doubleValue.
3353
3354         * css/CSSCharsetRule.h: Use ExceptionOr. Also made more things private.
3355         * css/CSSCharsetRule.idl: Use non-legacy exceptions.
3356
3357         * css/CSSComputedStyleDeclaration.cpp:
3358         (WebCore::CSSComputedStyleDeclaration::setCssText): Use ExceptionOr.
3359         (WebCore::ComputedStyleExtractor::propertyMatches): Use valueID.
3360         (WebCore::CSSComputedStyleDeclaration::setProperty): Use ExceptionOr.
3361         (WebCore::CSSComputedStyleDeclaration::removeProperty): Ditto.
3362         (WebCore::CSSComputedStyleDeclaration::setPropertyInternal): Ditto.
3363         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): Return
3364         a Ref instead of a RefPtr.
3365         * css/CSSComputedStyleDeclaration.h: Updated for above changes.
3366
3367         * css/CSSCrossfadeValue.cpp:
3368         (WebCore::CSSCrossfadeValue::fixedSize): Use floatValue.
3369         (WebCore::CSSCrossfadeValue::image): Ditto.
3370         (WebCore::CSSCrossfadeValue::blend): Use doubleValue.
3371
3372         * css/CSSFontFace.cpp:
3373         (WebCore::CSSFontFace::calculateStyleMask): Use valueID.
3374         (WebCore::CSSFontFace::calculateWeightMask): Ditto.
3375         * css/CSSFontFaceSet.cpp:
3376         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
3377         (WebCore::CSSFontFaceSet::matchingFaces): Use ExceptoinOr.
3378         (WebCore::CSSFontFaceSet::check): Ditto.
3379         * css/CSSFontFaceSet.h: Updated for above changes.
3380
3381         * css/CSSGradientValue.cpp:
3382         (WebCore::compareStops): Use doubleValue.
3383         (WebCore::CSSGradientValue::addStops): Use floatValue.
3384         (WebCore::positionFromValue): Use floatValue and valudID.
3385         (WebCore::CSSLinearGradientValue::customCSSText): Use doubleValue and valueID.
3386         (WebCore::CSSLinearGradientValue::createGradient): Use floatValue and valueID.
3387         (WebCore::CSSRadialGradientValue::customCSSText): Use doubleValue and valueID.
3388         (WebCore::CSSRadialGradientValue::resolveRadius): Use floatValue.
3389         (WebCore::CSSRadialGradientValue::createGradient): Use valueID.
3390
3391         * css/CSSGroupingRule.cpp:
3392         (WebCore::CSSGroupingRule::insertRule): Use ExceptionOr.
3393         (WebCore::CSSGroupingRule::deleteRule): Ditto.
3394         * css/CSSGroupingRule.h: Updated for above changes.
3395
3396         * css/CSSImageGeneratorValue.cpp:
3397         (WebCore::CSSImageGeneratorValue::subimageIsPending): Use valueID.
3398         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.
3399
3400         * css/CSSImageSetValue.cpp:
3401         (WebCore::CSSImageSetValue::fillImageSet): Use floatValue.
3402
3403         * css/CSSMediaRule.idl: Use non-legacy exceptions.
3404
3405         * css/CSSPrimitiveValue.cpp:
3406         (WebCore::CSSPrimitiveValue::computeDegrees): Use doubleValue.
3407         (WebCore::CSSPrimitiveValue::setFloatValue): Use ExceptionOr.
3408         (WebCore::CSSPrimitiveValue::getFloatValue): Replaced getDoubleValue with this,
3409         since getDoubleValue is unused, moving the call to clampTo into this function.
3410         Also changed this to use ExceptionOr.
3411         (WebCore::CSSPrimitiveValue::doubleValue): Renamed from getDoubleValue.
3412         (WebCore::CSSPrimitiveValue::doubleValueInternal): Use Optional instead of a bool
3413         and an out argument to return the value and check for type failure.
3414         (WebCore::CSSPrimitiveValue::setStringValue): Use ExceptionOr.
3415         (WebCore::CSSPrimitiveValue::getStringValue): Ditto.
3416         (WebCore::CSSPrimitiveValue::stringValue): Renamed from getStringValue.
3417         (WebCore::CSSPrimitiveValue::getCounterValue): Use ExceptionOr.
3418         (WebCore::CSSPrimitiveValue::getRectValue): Use ExceptionOr.
3419         (WebCore::CSSPrimitiveValue::getQuadValue): Deleted.
3420         (WebCore::CSSPrimitiveValue::getLengthRepeatValue): Deleted.
3421         (WebCore::CSSPrimitiveValue::getRGBColorValue): Use ExceptionOr.
3422         (WebCore::CSSPrimitiveValue::getPairValue): Deleted.
3423         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use new names for functions.
3424         * css/CSSPrimitiveValue.h: Reorganized the class, moved large inline function bodies
3425         out of the class definition. Updated for the above changes.
3426         * css/CSSPrimitiveValue.idl: Use non-legacy exceptions.
3427
3428         * css/CSSPrimitiveValueMappings.h: Use value instead of getValue, etc.
3429
3430         * css/CSSRule.cpp:
3431         (WebCore::CSSRule::setCssText): Use ExceptionOr.
3432         * css/CSSRule.h: Updated for above change.
3433         * css/CSSRule.idl: Use non-legacy exceptions.
3434
3435         * css/CSSStyleDeclaration.h: Use ExceptionOr.
3436         * css/CSSStyleDeclaration.idl: Use non-legacy exceptions.
3437
3438         * css/CSSStyleSheet.cpp:
3439         (WebCore::CSSStyleSheet::deprecatedInsertRule): Use ExceptionOr.
3440         (WebCore::CSSStyleSheet::insertRule): Ditto.
3441         (WebCore::CSSStyleSheet::deleteRule): Ditto.
3442         (WebCore::CSSStyleSheet::addRule): Ditto.
3443         * css/CSSStyleSheet.h: Updated for the above changes.
3444         * css/CSSStyleSheet.idl: Use non-legacy exceptions.
3445
3446         * css/CSSSupportsRule.idl: Use non-legacy exceptions.
3447
3448         * css/CSSToStyleMap.cpp:
3449         (WebCore::CSSToStyleMap::mapFillAttachment): Use valueID instead of getValueID, etc.
3450         (WebCore::convertToLengthSize): Ditto.
3451         (WebCore::CSSToStyleMap::mapFillSize): Ditto.
3452         (WebCore::CSSToStyleMap::mapFillXPosition): Ditto.
3453         (WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
3454         (WebCore::CSSToStyleMap::mapFillMaskSourceType): Ditto.
3455         (WebCore::CSSToStyleMap::mapAnimationDirection): Ditto.
3456         (WebCore::CSSToStyleMap::mapAnimationFillMode): Ditto.
3457         (WebCore::CSSToStyleMap::mapAnimationIterationCount): Ditto.
3458         (WebCore::CSSToStyleMap::mapAnimationName): Ditto.
3459         (WebCore::CSSToStyleMap::mapAnimationPlayState): Ditto.
3460         (WebCore::CSSToStyleMap::mapAnimationProperty): Ditto.
3461         (WebCore::CSSToStyleMap::mapAnimationTimingFunction): Ditto.
3462         (WebCore::CSSToStyleMap::mapAnimationTrigger): Ditto.
3463         (WebCore::CSSToStyleMap::mapNinePieceImageSlice): Ditto.
3464         (WebCore::CSSToStyleMap::mapNinePieceImageQuad): Ditto.
3465         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat): Ditto.
3466
3467         * css/CSSValue.h: Use ExceptionOr.
3468         * css/CSSValue.idl: Use non-legacy exceptions.
3469
3470         * css/Counter.h: Use stringValue instead of getStringValue, etc.
3471
3472         * css/FontFace.cpp:
3473         (WebCore::FontFace::create): Use ExceptionOr.
3474         (WebCore::FontFace::setFamily): Ditto.
3475         (WebCore::FontFace::setStyle): Ditto.
3476         (WebCore::FontFace::setWeight): Ditto.
3477         (WebCore::FontFace::setStretch): Ditto.
3478         (WebCore::FontFace::setUnicodeRange): Ditto.
3479         (WebCore::FontFace::setVariant): Ditto.
3480         (WebCore::FontFace::setFeatureSettings): Ditto.
3481         * css/FontFace.h: Updated for above changes.
3482         * css/FontFace.idl: Use non-legacy exceptions.
3483
3484         * css/FontFaceSet.cpp:
3485         (WebCore::FontFaceSet::load): Use ExceptionOr.
3486         (WebCore::FontFaceSet::check): Ditto.
3487         * css/FontFaceSet.h: Updated for above changes.
3488         * css/FontFaceSet.idl: Use non-legacy exceptions.
3489
3490         * css/FontVariantBuilder.cpp:
3491         (WebCore::extractFontVariantLigatures): Use valueID instead of getValueID, etc.
3492         (WebCore::extractFontVariantNumeric): Ditto.
3493         (WebCore::extractFontVariantEastAsian): Ditto.
3494
3495         * css/MediaList.cpp:
3496         (WebCore::MediaList::setMediaText): Use ExceptionOr.
3497         (WebCore::MediaList::deleteMedium): Ditto.
3498         (WebCore::MediaList::appendMedium): Ditto.
3499         * css/MediaList.h: Updated for above changes.
3500         * css/MediaList.idl: Use non-legacy exceptions.
3501
3502         * css/MediaQueryEvaluator.cpp:
3503         (WebCore::doubleValue): Use valueID instead of getValueID, etc.
3504         (WebCore::colorGamutEvaluate): Ditto.
3505         (WebCore::invertedColorsEvaluate): Ditto.
3506         (WebCore::orientationEvaluate): Ditto.
3507         (WebCore::evaluateResolution): Ditto.
3508         (WebCore::computeLength): Ditto.
3509         (WebCore::viewModeEvaluate): Ditto.
3510         (WebCore::hoverEvaluate): Ditto.
3511         (WebCore::pointerEvaluate): Ditto.
3512         (WebCore::prefersReducedMotionEvaluate): Ditto.
3513
3514         * css/PropertySetCSSStyleDeclaration.cpp:
3515         (WebCore::PropertySetCSSStyleDeclaration::setCssText): Use ExceptionOr.
3516         (WebCore::PropertySetCSSStyleDeclaration::setProperty): Ditto.
3517         (WebCore::PropertySetCSSStyleDeclaration::removeProperty): Ditto.
3518         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal): Ditto.
3519         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal): Ditto.
3520         * css/PropertySetCSSStyleDeclaration.h: Updated for above changes.
3521         Also marked a couple additional functions private.
3522
3523         * css/StyleBuilderConverter.h: Use doubleValue instead of getDoubleValue, etc.
3524         * css/StyleBuilderCustom.h: Ditto.
3525         * css/StyleProperties.cpp:
3526         (WebCore::StyleProperties::getLayeredShorthandValue): Ditto.
3527         * css/StyleResolver.cpp:
3528         (WebCore::StyleResolver::MatchResult::addMatchedProperties): Ditto.
3529         (WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement): Ditto.
3530         (WebCore::StyleResolver::colorFromPrimitiveValue): Ditto.
3531         (WebCore::StyleResolver::createFilterOperations): Ditto.
3532         * css/TransformFunctions.cpp:
3533         (WebCore::transformsForValue): Ditto.
3534         * css/ViewportStyleResolver.cpp:
3535         (WebCore::ViewportStyleResolver::getViewportArgumentValue): Ditto.
3536
3537         * css/WebKitCSSMatrix.cpp:
3538         (WebCore::WebKitCSSMatrix::WebKitCSSMatrix): Tweaked constructors a bit,
3539         getting rid of the one that uses an ExceptionCode.
3540         (WebCore::WebKitCSSMatrix::create): Moved in here, and use ExceptionOr.
3541         (WebCore::WebKitCSSMatrix::setMatrixValue): Use ExceptionOr.
3542         (WebCore::WebKitCSSMatrix::multiply): Tweak coding style a bit.
3543         (WebCore::WebKitCSSMatrix::inverse): Use ExceptionOr.
3544         (WebCore::WebKitCSSMatrix::translate): Return a Ref instead of RefPtr.
3545         (WebCore::WebKitCSSMatrix::scale): Ditto.
3546         (WebCore::WebKitCSSMatrix::rotate): Ditto.
3547         (WebCore::WebKitCSSMatrix::rotateAxisAngle): Ditto.
3548         (WebCore::WebKitCSSMatrix::skewX): Ditto.
3549         (WebCore::WebKitCSSMatrix::skewY): Ditto.
3550         (WebCore::WebKitCSSMatrix::toString): Tweaked formatting a bit.
3551         * css/WebKitCSSMatrix.h: Updated for above changes.
3552         * css/WebKitCSSMatrix.idl: Use non-legacy extensions.
3553
3554         * css/makeprop.pl:
3555         (handleCurrentColorValue): Use valueID instead of getValueID.
3556         (generateValueSetter): Ditto.
3557
3558         * css/parser/CSSParser.cpp:
3559         (WebCore::CSSParser::parse4ValuesFillPosition): Use valueID instead of getValueID, etc.
3560         (WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
3561         (WebCore::CSSParser::parseFillPosition): Ditto.
3562         (WebCore::CSSParser::parseFillRepeat): Ditto.
3563         (WebCore::CSSParser::parseGridPosition): Ditto.
3564         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Ditto.
3565         (WebCore::isGridTrackFixedSized): Ditto.
3566         (WebCore::CSSParser::parseRadialGradient): Ditto.
3567         (WebCore::CSSParser::parseBuiltinFilterArguments): Ditto.
3568
3569         * css/parser/CSSParserValues.cpp:
3570         (WebCore::CSSParserValue::createCSSValue): Removed the unneeded call to
3571         setPrimitiveType here. The createParserOperator returns an object that
3572         already has the correct primitive type.
3573
3574         * css/parser/CSSPropertyParser.cpp: Updated most cases of calling the old
3575         getXXXValue functions, but not sure if it's right since it is commented out
3576         code that I did not compile.
3577
3578         * css/parser/CSSPropertyParserHelpers.cpp:
3579         (WebCore::CSSPropertyParserHelpers::clampRGBComponent): Use intValue instead of getIntValue, etc.
3580         (WebCore::CSSPropertyParserHelpers::parseHSLParameters): Ditto.
3581         (WebCore::CSSPropertyParserHelpers::isHorizontalPositionKeywordOnly): Ditto.
3582         (WebCore::CSSPropertyParserHelpers::isVerticalPositionKeywordOnly): Ditto.
3583         (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): Ditto.
3584         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.
3585
3586         * dom/Range.cpp: Added now-needed include of ExceptionCode.h.
3587         * dom/SelectorQuery.cpp: Ditto.
3588
3589         * editing/ApplyStyleCommand.cpp:
3590         (WebCore::toIdentifier): Use valueID instead of getValueID, etc.
3591         (WebCore::ApplyStyleCommand::computedFontSize): Ditto.
3592         * editing/EditingStyle.cpp:
3593         (WebCore::identifierForStyleProperty): Ditto.
3594         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle): Ditto.
3595         (WebCore::EditingStyle::extractFontSizeDelta): Ditto.
3596         (WebCore::EditingStyle::textDirection): Ditto.
3597         (WebCore::EditingStyle::prepareToApplyAt): Ditto.
3598         (WebCore::EditingStyle::textDirectionForSelection): Ditto.
3599         (WebCore::fontWeightIsBold): Ditto.
3600         (WebCore::legacyFontSizeFromCSSValue): Ditto.
3601         (WebCore::isTransparentColorValue): Ditto.
3602         (WebCore::hasTransparentBackgroundColor): Ditto.
3603         (WebCore::backgroundColorInEffect): Ditto.
3604
3605         * editing/Editor.cpp:
3606         (WebCore::Editor::applyEditingStyleToElement): Removed IGNORE_EXCEPTION; that is
3607         what we do by default for things returning ExceptionOr.
3608         * editing/RemoveCSSPropertyCommand.cpp:
3609         (WebCore::RemoveCSSPropertyCommand::doApply): Ditto.
3610         (WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
3611         * editing/ReplaceSelectionCommand.cpp:
3612         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.
3613
3614         * editing/cocoa/HTMLConverter.mm:
3615         (floatValueFromPrimitiveValue): Use floatValue instead of getFloatValue, etc.
3616         * editing/markup.cpp:
3617         (WebCore::propertyMissingOrEqualToNone): Ditto.
3618
3619         * inspector/InspectorStyleSheet.cpp:
3620         (WebCore::InspectorStyleSheet::addRule): Updated to call ExceptionOr-returning functions.
3621         (WebCore::InspectorStyleSheet::deleteRule): Ditto.
3622         (WebCore::InspectorStyleSheet::setStyleText): Ditto.
3623
3624         * svg/SVGLength.cpp:
3625         (WebCore::SVGLength::fromCSSPrimitiveValue): Use floatValue instead of getFloatValue.
3626
3627 2016-10-16  Antoine Quint  <graouts@apple.com>
3628
3629         [Modern Media Controls] Styles for StartButton are missing
3630         https://bugs.webkit.org/show_bug.cgi?id=163499
3631         <rdar://problem/28792009>
3632
3633         Reviewed by Darin Adler.
3634
3635         Add styling for StartButton so that instances are always displayed in the center of their container.
3636
3637         Test: media/modern-media-controls/start-button/start-button-styles.html
3638
3639         * Modules/modern-media-controls/controls/start-button.css: Added.
3640         (button.start):
3641         (button.start > *):
3642         (button.start > div):
3643         (button.start > img):
3644         (button.start:active > img):
3645
3646 2016-10-16  Simon Fraser  <simon.fraser@apple.com>
3647
3648         Implement serializer = { attribute }
3649         https://bugs.webkit.org/show_bug.cgi?id=163466
3650         
3651         Follow-up fix to die if "serializer {...}" lists an attribute not present
3652         on the interface. I don't think this is testable with the current bindings tests.
3653
3654         * bindings/scripts/CodeGeneratorJS.pm:
3655         (GenerateSerializerFunction):
3656
3657 2016-10-16  Simon Fraser  <simon.fraser@apple.com>
3658
3659         Add the "Geometry Interfaces" to features.json.
3660
3661         * features.json:
3662
3663 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3664
3665         Document request not updated after willSendRequest is called for a redirect
3666         https://bugs.webkit.org/show_bug.cgi?id=163436
3667
3668         Reviewed by Michael Catanzaro.
3669
3670         The first willSendRequest happens before DocumentLoader::startLoadingMainResource(), that calls setRequest, but
3671         the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.
3672
3673         Covered by GTK+ unit tests.
3674
3675         * loader/DocumentLoader.cpp:
3676         (WebCore::DocumentLoader::willContinueMainResourceLoadAfterRedirect): Set the new request.
3677         * loader/DocumentLoader.h:
3678         * loader/SubresourceLoader.cpp:
3679         (WebCore::SubresourceLoader::willSendRequestInternal): Notify the document loader when loading the main resource
3680         and called for a redirection.
3681
3682 2016-10-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
3683
3684         Delete the animated image catchup code
3685         https://bugs.webkit.org/show_bug.cgi?id=163410
3686
3687         Reviewed by Simon Fraser.
3688
3689         This patch fixes two issues in the animated image workflow:
3690
3691         1) Setting the animation timer should follow the following rules:
3692         
3693             -- Initial case: Which happens before drawing the first frame. We
3694             should set the timer to fire after the current_frame_duration.
3695
3696             -- Late case (Slow animation): This happens if the current_time is
3697             past the next_frame_desired_time. In this case we should fire the
3698             timer immediately.
3699
3700             -- Early case (Fast animation): This happens when there is still time
3701             before the next_frame_desired_time. In this case we should set the
3702             timer to fire after the difference between the next_frame_desired_time
3703             and the current_time.
3704
3705         2) Deleting the code for catching up the current_frame:
3706         
3707             This code used to run in the slow animation case. It was never used
3708             on iOS. It was trying to adjust the current_frame according to the
3709             current_time as if there were no delay. It turned out that this might
3710             cause a bigger delay because most likely the decoder decodes the image
3711             frames incrementally; i.e. to decode frame k, it has to have frame
3712             (k - 1) decoded.
3713
3714         Test: fast/images/ordered-animated-image-frames.html
3715
3716         * platform/graphics/BitmapImage.cpp:
3717         (WebCore::BitmapImage::draw): Remove the iOS specific code.
3718         (WebCore::BitmapImage::startAnimation): Move the animation finishing code from 
3719         BitmapImage::internalAdvanceAnimation() to this function. Simplify the timer
3720         duration code as it is described above.
3721
3722         (WebCore::BitmapImage::advanceAnimation): Merge BitmapImage::internalAdvanceAnimation()
3723         into this function.
3724
3725         (WebCore::BitmapImage::resetAnimation):
3726         
3727         (WebCore::BitmapImage::internalAdvanceAnimation): Deleted.
3728         * platform/graphics/BitmapImage.h:
3729
3730         * platform/graphics/Image.cpp:
3731         (WebCore::Image::drawTiled):
3732         * platform/graphics/Image.h:
3733         (WebCore::Image::startAnimation):
3734         * svg/graphics/SVGImage.cpp:
3735         (WebCore::SVGImage::startAnimation):
3736         * svg/graphics/SVGImage.h:
3737         Remove the catchup code form the Image and SVGImage classes.
3738
3739 2016-10-15  Darin Adler  <darin@apple.com>
3740
3741         Move Web SQL database and WebSockets off legacy exceptions
3742         https://bugs.webkit.org/show_bug.cgi?id=163284
3743
3744         Reviewed by Chris Dumez.
3745
3746         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
3747         (WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.
3748         * Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
3749         * Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.
3750
3751         * Modules/webdatabase/SQLResultSet.cpp:
3752         (WebCore::SQLResultSet::SQLResultSet): Move initialization of
3753         many data members into the class definition.
3754         (WebCore::SQLResultSet::insertId): Use ExceptionOr.
3755         (WebCore::SQLResultSet::rowsAffected): Moved into class definition.
3756         (WebCore::SQLResultSet::rows): Ditto.
3757         (WebCore::SQLResultSet::setInsertId): Ditto.
3758         (WebCore::SQLResultSet::setRowsAffected): Ditto.
3759
3760         * Modules/webdatabase/SQLResultSet.h: Updated for above.
3761
3762         * Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.
3763         Added a FIXME about the mismatch between long and int64_t.
3764
3765         * Modules/webdatabase/SQLStatement.cpp:
3766         (WebCore::SQLStatement::execute): Use reference instead of pointer.
3767
3768         * Modules/websockets/WebSocket.cpp:
3769         (WebCore::isValidProtocolString): Use StringView.
3770         (WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
3771         spelling error in the name of this function.
3772         (WebCore::WebSocket::WebSocket): Move initialization of many data
3773         members into the class definition.
3774         (WebCore::WebSocket::create): Use ExceptionOr.
3775         (WebCore::WebSocket::connect): Ditto.
3776         (WebCore::WebSocket::send): Ditto.
3777         (WebCore::WebSocket::close): Ditto.
3778         (WebCore::WebSocket::binaryType): Update to use enum class.
3779         (WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
3780         use enum class.
3781         (WebCore::WebSocket::didReceiveBinaryData): Ditto.
3782
3783         * Modules/websockets/WebSocket.h: Updated for above. Changed the
3784         BinaryType enum into an enum class.
3785
3786         * Modules/websockets/WebSocket.idl: Use non-legacy exceptions.
3787
3788         * Modules/websockets/WebSocketHandshake.cpp:
3789         (WebCore::WebSocketHandshake::checkResponseHeaders):
3790         Updated for name change to subprotocolSeparator.
3791
3792         * dom/ExceptionOr.h: Added a constructor for scalar types that does not
3793         require an rvalue reference. We can refine this more later, but for now
3794         this is sufficient to obviate the need for WTFMove where it otherwise would
3795         have been needed in the code above.
3796
3797         * inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.
3798
3799         * page/DOMWindow.idl: Touched this file to work around bugs in the dependency
3800         analysis of the current CMake build system, since otherwise it doesn't process the
3801         change to the partial interface WebSocket. Edited lots of comments, removed many
3802         others, and tweaked formatting.
3803
3804 2016-10-14  Sam Weinig  <sam@webkit.org>
3805
3806         MessageEvent's source property should be a (DOMWindow or MessagePort)? rather than a EventTarget?
3807         https://bugs.webkit.org/show_bug.cgi?id=163475
3808
3809         Reviewed by Simon Fraser.
3810
3811         Start fleshing out union support, starting with MessageEvent.
3812         - Simplify things a bit for now by requiring interface types to use RefPtr<T> as their type when
3813           used in sequences and unions. We should revisit this later, and see if we can use Ref<T> where
3814           possible, but it causes complications for dictionaries, since they want a Ref<T> uninitialized.
3815
3816         * bindings/generic/IDLTypes.h:
3817         Switch IDLInterface to use RefPtr<T> as its implementation type.
3818
3819         * bindings/js/JSDOMConvert.h:
3820         (WebCore::Detail::VariadicConverterBase::convert):
3821         - Remove isJSDOMWrapperType() optimization. It was not correct, due to not being able to detect window
3822           and window shell, and not always an optimization, e.g. in the case of a single interface.
3823         - Switch from JSC::jsDynamicCast<WrapperType*>() to WrapperType::toWrapped() which can be faster and
3824           handles window and window shell correctly.
3825         - Also fix an issue where we would wrongly assert that one interface had to match.
3826
3827         * bindings/js/JSDOMWrapper.h:
3828         (WebCore::isJSDOMWrapperType): Deleted.
3829         Remove unused predicate.
3830
3831         * bindings/scripts/IDLParser.pm:
3832         (parseType):
3833         Add missing support for nullable unions.
3834
3835         * bindings/scripts/test/JS/JSTestObj.cpp:
3836         * bindings/scripts/test/TestObj.idl:
3837         Add new tests for unions (both non-null and nullable) in dictionaries.
3838  
3839         * dom/ContainerNode.cpp:
3840         (WebCore::ContainerNode::append):
3841         (WebCore::ContainerNode::prepend):
3842         * dom/ContainerNode.h:
3843         * dom/Node.cpp:
3844         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
3845         (WebCore::Node::convertNodesOrStringsIntoNode):
3846         (WebCore::Node::before):
3847         (WebCore::Node::after):
3848         (WebCore::Node::replaceWith):
3849         * dom/Node.h:
3850         Add using declaration for NodeOrString and change it to use RefPtr<Node>.
3851
3852         * bindings/js/JSMessageEventCustom.cpp:
3853         (WebCore::handleInitMessageEvent):
3854         * dom/MessageEvent.cpp:
3855         (WebCore::MessageEvent::MessageEvent):
3856         (WebCore::MessageEvent::create):
3857         (WebCore::MessageEvent::initMessageEvent):
3858         (WebCore::MessageEvent::source):
3859         (WebCore::isValidSource): Deleted.
3860         * dom/MessageEvent.h:
3861         * dom/MessageEvent.idl:
3862         * page/DOMWindow.cpp:
3863         (WebCore::PostMessageTimer::event):
3864         Change MessageEvent's source to be a std::experimental::variant<RefPtr<DOMWindow>, RefPtr<MessagePort>>.
3865         For now, we only enforce this on setting, and leave the getter a EventTarget?, but that should not be
3866         observable, and will rectified in subsequent patches.
3867
3868 2016-10-15  Chris Dumez  <cdumez@apple.com>
3869
3870         Add support for reportValidity() on form and form control elements
3871         https://bugs.webkit.org/show_bug.cgi?id=163479
3872
3873         Reviewed by Darin Adler.
3874
3875         Add support for reportValidity() on form and form control elements:
3876         - https://html.spec.whatwg.org/#dom-form-reportvalidity
3877         - https://html.spec.whatwg.org/#dom-cva-reportvalidity
3878
3879         Firefox and Chrome already support this.
3880
3881         Demo: https://googlechrome.github.io/samples/report-validity/
3882
3883         No new tests, rebaselined existing tests.
3884
3885         * html/HTMLButtonElement.idl:
3886         * html/HTMLFieldSetElement.idl:
3887         * html/HTMLFormElement.idl:
3888         * html/HTMLInputElement.idl:
3889         * html/HTMLKeygenElement.idl:
3890         * html/HTMLObjectElement.idl:
3891         * html/HTMLOutputElement.idl:
3892         * html/HTMLSelectElement.idl:
3893         * html/HTMLTextAreaElement.idl:
3894         Add reportValidity() operation.
3895
3896         * html/HTMLFormControlElement.cpp:
3897         (WebCore::HTMLFormControlElement::checkValidity):
3898
3899         (WebCore::HTMLFormControlElement::reportValidity):
3900         Add implementation for reportValidity() for form control elements.
3901         First, it calls checkValidity() and returns early if there is no
3902         constraint violation. if the JS canceled the 'invalid' event
3903         fired by checkValidity(), then return early as well, as per the
3904         specification. If the element is focusable, we scroll to it,
3905         focus it and show the validation message. Otherwise, we log a
3906         error message to the console. The last part of the behavior
3907         matches what we already did in HTMLFormElement::validateInteractively()
3908         and complies with the behavior in the specification.
3909
3910         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
3911         Add utility function to scroll to the form control element, focus
3912         it and show its validation message. This code was moved from
3913         HTMLFormElement::validateInteractively() so that it could be reused
3914         in HTMLFormControlElement::reportValidity().
3915
3916         * html/HTMLFormControlElement.h:
3917         * html/HTMLFormElement.cpp:
3918         (WebCore::HTMLFormElement::validateInteractively):
3919         Move the early abort checks to the existing call site (prepareForSubmission)
3920         so that we can reuse this method for reportValidity().
3921
3922         (WebCore::HTMLFormElement::prepareForSubmission):
3923         Only call validateInteractively() if we really should validate. Those checks
3924         used to be in validateInteractively() but I moved them here so we could more
3925         easily reuse validateInteractively().
3926
3927         (WebCore::HTMLFormElement::checkValidity):
3928         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
3929         Update Vector type to be a Vector of HTMLFormControlElement given that we
3930         only add HTMLFormControlElement objects to it and that it results it simpler
3931         code.
3932
3933         (WebCore::HTMLFormElement::reportValidity):
3934         Add implementation for reportValidity() for form elements. The
3935         implementation calls our already existing validateInteractively()
3936         method, as per the specification.
3937
3938         * html/HTMLFormElement.h:
3939
3940         * html/HTMLObjectElement.h:
3941         reportValidity() returns true unconditionally for object elements,
3942         similarly to checkValidity().
3943
3944 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
3945
3946         Sort the project file.
3947
3948         * WebCore.xcodeproj/project.pbxproj:
3949
3950 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
3951
3952         Implement serializer = { attribute }
3953         https://bugs.webkit.org/show_bug.cgi?id=163466
3954
3955         Reviewed by Darin Adler.
3956
3957         Fix the code generator to generate code for serializer = { attribute }.
3958         In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
3959         'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
3960         to detect these; it needs to create the domSerializable() now. Basic support
3961         for isSerializableAttribute() is added (primitive types only).
3962         
3963         GenerateSerializerFunction is fixed to output code for the serializable attributes
3964         in the order specified in "serializer = {}", as specified in WebIDL.
3965         
3966         Removed custom serialization for ClientRect and PerformanceTiming.
3967         
3968         Other minor cleanup to always get $interfaceName from $interface->name, and to fix
3969         ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
3970
3971         * CMakeLists.txt:
3972         * WebCore.xcodeproj/project.pbxproj:
3973         * bindings/js/JSBindingsAllInOne.cpp:
3974         * bindings/js/JSClientRectCustom.cpp: Removed.
3975         * bindings/js/JSPerformanceTimingCustom.cpp: Removed.
3976         * bindings/scripts/CodeGeneratorJS.pm:
3977         (GenerateImplementation):
3978         (GenerateSerializerFunction):
3979         * bindings/scripts/IDLParser.pm:
3980         (parseSerializerRest):
3981         (parseSerializationPattern):
3982         (parseSerializationAttributes):
3983         (isSerializableAttribute):
3984         (applyMemberList):
3985         * bindings/scripts/test/JS/JSTestNode.cpp:
3986         * bindings/scripts/test/JS/JSTestObj.cpp:
3987         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
3988         * bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
3989         * bindings/scripts/test/JS/JSTestSerialization.h: Added.
3990         * bindings/scripts/test/TestObj.idl:
3991         * bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
3992         * dom/ClientRect.idl:
3993         * page/PerformanceTiming.idl:
3994
3995 2016-10-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3996
3997         [GTK] Restore user agent quirk for Yahoo
3998         https://bugs.webkit.org/show_bug.cgi?id=163481
3999
4000         Reviewed by Carlos Garcia Campos.
4001
4002         finance.yahoo.com is sending a mobile version in response to our standard user agent.
4003
4004         * platform/gtk/UserAgentGtk.cpp:
4005         (WebCore::urlRequiresMacintoshPlatform):
4006
4007 2016-10-15  Chris Dumez  <cdumez@apple.com>
4008
4009         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
4010         https://bugs.webkit.org/show_bug.cgi?id=163472
4011
4012         Reviewed by Sam Weinig.
4013
4014         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError:
4015         - https://html.spec.whatwg.org/#dom-media-volume
4016
4017         This is because the attribute is of type double (not unrestricted double in the IDL).
4018
4019         Chrome and Firefox agree with the specification. WebKit throws an IndexSizeErr instead.
4020
4021         No new tests, rebaselined existing test.
4022
4023         * html/HTMLMediaElement.idl:
4024
4025 2016-10-15  Zalan Bujtas  <zalan@apple.com>
4026
4027         CounterNode::resetRenderers is so inefficient.
4028         https://bugs.webkit.org/show_bug.cgi?id=163480
4029
4030         Reviewed by Simon Fraser.
4031
4032         CounterNode::resetRenderers() removes all the associated renderers from this CounterNode
4033         and sets the dirty bit on them.
4034         This patch does all that in a loop, instead of traversing the linked tree on each removal.
4035
4036         No change in functionality.
4037
4038         * rendering/CounterNode.cpp:
4039         (WebCore::CounterNode::CounterNode):
4040         (WebCore::CounterNode::~CounterNode):
4041         (WebCore::CounterNode::nextInPreOrderAfterChildren):
4042         (WebCore::CounterNode::lastDescendant):
4043         (WebCore::CounterNode::addRenderer): These assertions do not seem super useful.
4044         (WebCore::CounterNode::removeRenderer):
4045         (WebCore::CounterNode::resetRenderers):
4046         (WebCore::CounterNode::insertAfter):
4047         (WebCore::CounterNode::removeChild):
4048         * rendering/CounterNode.h:
4049         * rendering/RenderCounter.cpp:
4050         (WebCore::makeCounterNode):
4051         (WebCore::RenderCounter::RenderCounter):
4052         (WebCore::RenderCounter::~RenderCounter):
4053         (WebCore::RenderCounter::originalText):
4054         (WebCore::updateCounters):
4055         (WebCore::RenderCounter::invalidate): Deleted.
4056         * rendering/RenderCounter.h:
4057
4058 2016-10-15  Antoine Quint  <graouts@apple.com>
4059
4060         [Modern Media Controls] macOS inline controls
4061         https://bugs.webkit.org/show_bug.cgi?id=163444
4062         <rdar://problem/27989473>
4063
4064         Reviewed by Dean Jackson.
4065
4066         Introducing the new MacOSMediaControls and MacOSInlineMediaControls classes. MacOSMediaControls is a MediaControls subclass
4067         that adds specific buttons to the macOS platform and sets the layout traits to be macOS. This class has a new subclass,
4068         MacOSInlineMediaControls, which sets the layout traits to also include inline and implements custom layout to drop
4069         controls as necessary as the width of the controls varies. It also shows the volume slider when the mute button is hovered.
4070         
4071         Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html
4072                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html
4073                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html
4074                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html
4075                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html
4076                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html
4077                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html
4078                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html
4079                media/modern-media-controls/macos-media-controls/macos-media-controls.html
4080
4081         * Modules/modern-media-controls/controls/macos-inline-media-controls.css: Added.
4082         (.media-controls.mac.inline > .controls-bar):
4083         (.media-controls.mac.inline > .controls-bar > *):
4084         (.media-controls.mac.inline button):
4085         (.media-controls.mac.inline button:active):
4086         (.media-controls.mac.inline > .controls-bar button):
4087         (.media-controls.mac.inline > .controls-bar,):
4088         (.media-controls.mac.inline button.play-pause):
4089         (.media-controls.mac.inline button.skip-back):