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