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