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