[CSS Parser] Implement CSS variables
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-27  Dave Hyatt  <hyatt@apple.com>
2
3         [CSS Parser] Implement CSS variables
4         https://bugs.webkit.org/show_bug.cgi?id=164075
5
6         Reviewed by Dean Jackson.
7
8         * CMakeLists.txt:
9         * WebCore.xcodeproj/project.pbxproj:
10         Add CSSCustomPropertyValue.cpp to the project.
11
12         * css/CSSCustomPropertyValue.cpp: Added.
13         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
14         (WebCore::CSSCustomPropertyValue::resolveVariableReferences):
15         * css/CSSCustomPropertyValue.h:
16         These functions abstract the old and new implementations of CSS
17         variables so that the callers don't have to worry about it.
18
19         * css/CSSValue.cpp:
20         (WebCore::CSSValue::equals):
21         Make sure CSSVariableReferenceValue and CSSPendingSubstitutionValue
22         have equals implemented.
23
24         (WebCore::CSSValue::isInvalidCustomPropertyValue): Deleted.
25         This code was dead and never called.
26
27         * css/CSSValue.h:
28         (WebCore::CSSValue::isCustomPropertyValue):
29         (WebCore::CSSValue::hasVariableReferences):
30         Add a helper function for asking if a CSSValue has variable references.
31         This abstracts the old and new implementations so that callers can
32         ask if the value has variables without caring which implementation is
33         being used.
34
35         * css/CSSValueList.cpp:
36         (WebCore::CSSValueList::checkVariablesForCycles):
37         * css/CSSValueList.h:
38         In order to abstract the old and new variables implementations, custom
39         properties now store CSSCustomPropertyValue as their values instead of
40         raw values. The old implementation needs to be patched to deal with this
41         wrapper being present now.
42
43         * css/CSSVariableData.cpp:
44         (WebCore::CSSVariableData::checkVariablesForCycles):
45         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
46         (WebCore::CSSVariableData::resolveVariableFallback):
47         (WebCore::CSSVariableData::resolveVariableReference):
48         (WebCore::CSSVariableData::resolveVariableReferences):
49         (WebCore::CSSVariableData::resolveTokenRange):
50         * css/CSSVariableData.h:
51         Implementation of cycle checking and variable resolution. The logic of
52         this implementation is the same as the old. It walks CSSParserTokens
53         instead of the old CSSParser structures.
54
55         * css/CSSVariableReferenceValue.cpp:
56         (WebCore::CSSVariableReferenceValue::customCSSText):
57         Add support for serialization caching, just like the old implementation
58         had in CSSVariableDependentValue.
59
60         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles):
61         * css/CSSVariableReferenceValue.h:
62         Add cycle checking and variable resolution helper functions.
63
64         * css/CSSVariableValue.cpp:
65         (WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
66         Patched to account for the change in storage of custom properties to
67         have custom property value wrappers.
68
69         * css/StyleProperties.cpp:
70         (WebCore::StyleProperties::getPropertyValue):
71         (WebCore::StyleProperties::borderSpacingValue):
72         (WebCore::StyleProperties::getLayeredShorthandValue):
73         (WebCore::StyleProperties::getShorthandValue):
74         (WebCore::StyleProperties::getCommonValue):
75         (WebCore::StyleProperties::getPropertyCSSValue):
76         (WebCore::StyleProperties::asText):
77         Clean up the resolution of pending substitution values. Instead of hacking
78         it into every possible StyleShorthandProperty crawling function, obtain
79         the shorthand for the property up front, access the first longhand, and
80         if we see a pending substitution value, perform the substitution.
81
82         * css/StyleResolver.cpp:
83         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
84         (WebCore::StyleResolver::applyProperty):
85         (WebCore::StyleResolver::resolvedVariableValue):
86         * css/StyleResolver.h:
87         Add support for the new implementation in all the same places as the old.
88
89         * css/parser/CSSParser.cpp:
90         (WebCore::CSSParser::parseInlineStyleDeclaration):
91         (WebCore::CSSParser::parseValueWithVariableReferences):
92         (WebCore::CSSParser::parseVariableDependentValue): Deleted.
93         * css/parser/CSSParser.h:
94         Rename parseVariableDependentValue to parseValueWithVariableReferences,
95         since it is operating on three distinct value types now. Turn on new
96         parser support for parseInlineStyleDeclaration.
97
98         * css/parser/CSSParserImpl.cpp:
99         (WebCore::filterProperties):
100         (WebCore::CSSParserImpl::parseVariableValue): Deleted.
101         (WebCore::CSSParserImpl::parseCustomPropertySet): Deleted.
102         * css/parser/CSSParserImpl.h:
103         Remove parser functions that aren't relevant to our implementation
104         of CSS variables.
105
106         * css/parser/CSSVariableParser.cpp:
107         (WebCore::classifyVariableRange):
108         Add support for the CSS4 'revert' keyword to the new variable parser.
109
110         * rendering/style/RenderStyle.cpp:
111         (WebCore::RenderStyle::checkVariablesInCustomProperties):
112         Modified to store CSSCustomPropertyValues as the values always now and
113         to use the method abstractions on CSSCustomPropertyValue to resolve
114         cycles and perform substitutions.
115
116         * rendering/style/RenderStyle.h:
117         (WebCore::RenderStyle::setCustomPropertyValue):
118         (WebCore::RenderStyle::getCustomPropertyValue):
119         * rendering/style/StyleCustomPropertyData.h:
120         (WebCore::StyleCustomPropertyData::operator==):
121         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
122         (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
123         Tighten up the map to store CSSCustomPropertyValue instead of just
124         CSSValue.
125
126 2016-10-27  Zalan Bujtas  <zalan@apple.com>
127
128         RenderMultiColumnFlowThread::processPossibleSpannerDescendant should take RenderObject& instead of RenderObject*
129         https://bugs.webkit.org/show_bug.cgi?id=164072
130
131         Reviewed by Simon Fraser.
132
133         No change in functionality.
134
135         * rendering/RenderFlowThread.h:
136         * rendering/RenderMultiColumnFlowThread.cpp:
137         (WebCore::findSetRendering):
138         (WebCore::isValidColumnSpanner):
139         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
140         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
141         (WebCore::RenderMultiColumnFlowThread::findSetRendering): Deleted.
142         * rendering/RenderMultiColumnFlowThread.h:
143         * rendering/RenderMultiColumnSet.cpp:
144         (WebCore::precedesRenderer):
145         (WebCore::RenderMultiColumnSet::containsRendererInFlowThread):
146         * rendering/RenderMultiColumnSet.h:
147         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
148         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
149         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
150         * rendering/RenderMultiColumnSpannerPlaceholder.h:
151         * rendering/RenderObject.cpp:
152         (WebCore::RenderObject::insertedIntoTree):
153
154 2016-10-27  Brent Fulgham  <bfulgham@apple.com>
155
156         Prevent hit tests from being performed on an invalid render tree
157         https://bugs.webkit.org/show_bug.cgi?id=163877
158         <rdar://problem/28675761>
159
160         Reviewed by Simon Fraser.
161
162         Changeset r200971 added code to ensure that layout is up-to-date before hit testing, but did
163         so only for the main frame. It was still possible to enter cross-frame hit testing with a
164         subframe needing style recalc. In that situation, the subframe's updateLayout() would get
165         called, which could trigger a compositing change that marked the parent frame as needing style
166         recalc. A subsequent layout on the parent frame (for example by hit testing traversing into
167         a second subframe) could then mutate the parent frame's layer tree while hit testing was
168         traversing it.
169         
170         This patch modifies the hit test logic to ensure that a recursive layout is performed so that
171         we always perform hit tests on a clean set of frames. It also adds some assertions to warn
172         us if we encounter this invalid state.
173
174         Tested by fast/layers/prevent-hit-test-during-layout.html.
175
176         * dom/Document.cpp:
177         (WebCore::Document::scheduleStyleRecalc): Assert that we are not hit testing
178         during style recalculation.
179         * page/EventHandler.cpp:
180         (WebCore::EventHandler::hitTestResultAtPoint): Ensure that we have a clean render tree
181         when hit testing.
182         * page/FrameView.cpp:
183         (WebCore::FrameView::setNeedsLayout): Assert that we are not in the process of hit testing
184         when we schedule a layout.
185         * rendering/RenderView.cpp:
186         (WebCore::RenderView::hitTest): Mark RenderView as in an active hit test.
187         * rendering/RenderView.h:
188
189 2016-10-27  Zan Dobersek  <zdobersek@igalia.com>
190
191         BufferSource should behave as an union
192         https://bugs.webkit.org/show_bug.cgi?id=164056
193
194         Reviewed by Chris Dumez.
195
196         WebIDL typedefs BufferSource as (ArrayBufferView or ArrayBuffer).
197         To follow that definition, IDLBufferSource is now type-aliased
198         to IDLUnion<IDLInterface<ArrayBufferView>, IDLInterface<ArrayBuffer>>.
199
200         Converter<IDLBufferSource> template specialization can now be
201         removed since the default specialization for IDLUnion will be
202         used.
203
204         C++ implementations still work through a BufferSource object.
205         That class now has an implicit constructor that consumes the
206         Variant object. The data() and length() methods on the class
207         now iterate the variant to find an existing object that can
208         provide a pointer to the data or the length of it.
209
210         * Modules/mediasource/SourceBuffer.cpp:
211         (WebCore::SourceBuffer::appendBuffer):
212         * bindings/generic/IDLTypes.h:
213         * bindings/js/BufferSource.h:
214         (WebCore::BufferSource::BufferSource):
215         (WebCore::BufferSource::data):
216         (WebCore::BufferSource::length):
217         * bindings/js/JSDOMConvert.h:
218         (WebCore::Converter<IDLBufferSource>::convert): Deleted.
219
220 2016-10-27  Chris Dumez  <cdumez@apple.com>
221
222         Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations
223         https://bugs.webkit.org/show_bug.cgi?id=164063
224
225         Reviewed by Sam Weinig.
226
227         Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations now
228         that we support having IDL string enumerations in their own IDL file.
229
230         No new tests, no Web-exposed behavior change.
231
232         * CMakeLists.txt:
233         * DerivedSources.cpp:
234         * DerivedSources.make:
235         * WebCore.xcodeproj/project.pbxproj:
236         * css/ElementRuleCollector.cpp:
237         (WebCore::ElementRuleCollector::collectMatchingRules):
238         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
239         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
240         * css/SelectorChecker.cpp:
241         (WebCore::SelectorChecker::matchRecursively):
242         * dom/CustomElementRegistry.cpp:
243         (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
244         * dom/Element.cpp:
245         (WebCore::Element::bindingsOffsetParent):
246         (WebCore::Element::addShadowRoot):
247         (WebCore::Element::attachShadow):
248         (WebCore::Element::shadowRootForBindings):
249         (WebCore::Element::userAgentShadowRoot):
250         (WebCore::Element::ensureUserAgentShadowRoot):
251         * dom/Element.h:
252         * dom/Element.idl:
253         * dom/InlineStyleSheetOwner.cpp:
254         (WebCore::parserContextForElement):
255         * dom/Node.cpp:
256         (WebCore::Node::isUnclosedNode):
257         (WebCore::Node::assignedSlotForBindings):
258         (WebCore::Node::isInUserAgentShadowTree):
259         * dom/ShadowRoot.cpp:
260         (WebCore::ShadowRoot::ShadowRoot):
261         * dom/ShadowRoot.h:
262         * dom/ShadowRoot.idl:
263         * dom/ShadowRootMode.h: Added.
264         * dom/ShadowRootMode.idl: Copied from Source/WebCore/dom/ShadowRoot.idl.
265         * dom/SlotAssignment.cpp:
266         (WebCore::SlotAssignment::didChangeSlot):
267         * html/HTMLSummaryElement.cpp:
268         (WebCore::HTMLSummaryElement::create):
269         * inspector/InspectorDOMAgent.cpp:
270         (WebCore::shadowRootType):
271         * rendering/HitTestResult.cpp:
272         (WebCore::moveOutOfUserAgentShadowTree):
273         * rendering/RenderElement.cpp:
274         (WebCore::RenderElement::selectionPseudoStyle):
275         * rendering/RenderLayer.cpp:
276         (WebCore::rendererForScrollbar):
277         * style/StyleScope.cpp:
278         (WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
279         (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
280         * svg/SVGElement.cpp:
281         (WebCore::SVGElement::correspondingUseElement):
282         * testing/Internals.cpp:
283         (WebCore::Internals::shadowRootType):
284
285 2016-10-27  Chris Dumez  <cdumez@apple.com>
286
287         Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable
288         https://bugs.webkit.org/show_bug.cgi?id=164062
289
290         Reviewed by Darin Adler.
291
292         Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable:
293         - https://html.spec.whatwg.org/#canvasuserinterface
294
295         Firefox and Chrome agree with the specification.
296
297         Test: fast/canvas/draw-focus-if-needed-null-element.html
298
299         * html/canvas/CanvasRenderingContext2D.cpp:
300         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
301         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
302         * html/canvas/CanvasRenderingContext2D.h:
303         * html/canvas/CanvasRenderingContext2D.idl:
304
305 2016-10-27  Yusuke Suzuki  <utatane.tea@gmail.com>
306
307         [DOMJIT][CSSJIT] Share code with DOMJIT
308         https://bugs.webkit.org/show_bug.cgi?id=164006
309
310         Reviewed by Mark Lam.
311
312         Move CSSJIT's getDocument function to DOMJIT and share it with DOMJIT.
313         And rename it to "loadDocument", it is closer name to the JSC's convention.
314
315         No behavior change.
316
317         * cssjit/SelectorCompiler.cpp:
318         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSpecialFailureInQuirksModeForActiveAndHoverIfNeeded):
319         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
320         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
321         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
322         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
323         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
324         (WebCore::SelectorCompiler::getDocument): Deleted.
325         * domjit/DOMJITHelpers.h:
326         (WebCore::DOMJIT::loadDocument):
327         * domjit/JSNodeDOMJIT.cpp:
328         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
329
330 2016-10-27  Youenn Fablet  <youenn@apple.com>
331
332         REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
333         https://bugs.webkit.org/show_bug.cgi?id=163905
334
335         Reviewed by Antti Koivisto.
336
337         Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
338
339         Small refactoring to do more member fields initialization in StyleSheetContents header.
340         Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
341         This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
342
343         * css/StyleSheetContents.cpp:
344         (WebCore::StyleSheetContents::StyleSheetContents):
345         (WebCore::StyleSheetContents::addedToMemoryCache):
346         (WebCore::StyleSheetContents::removedFromMemoryCache):
347         * css/StyleSheetContents.h:
348         * loader/cache/CachedCSSStyleSheet.cpp:
349         (WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
350
351 2016-10-27  Sergio Villar Senin  <svillar@igalia.com>
352
353         Unreviewed. Build fix for gcc.
354
355         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
356         (WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
357
358 2016-10-27  Youenn Fablet  <youenn@apple.com>
359
360         MediaPayload does not need to be refcounted
361         https://bugs.webkit.org/show_bug.cgi?id=164015
362
363         Reviewed by Eric Carlson.
364
365         No change of behavior.
366         Making MediaPayload a struct and no-longer ref-counted.
367         Small performance improvements in MediaEndpointOwr.
368
369         * Modules/mediastream/MediaEndpointPeerConnection.h:
370         * Modules/mediastream/SDPProcessor.cpp:
371         (WebCore::configurationFromJSON):
372         (WebCore::configurationToJSON):
373         * platform/mediastream/MediaEndpoint.h:
374         * platform/mediastream/MediaPayload.h:
375         (WebCore::MediaPayload::addParameter):
376         (WebCore::MediaPayload::create): Deleted.
377         (WebCore::MediaPayload::~MediaPayload): Deleted.
378         (WebCore::MediaPayload::type): Deleted.
379         (WebCore::MediaPayload::setType): Deleted.
380         (WebCore::MediaPayload::encodingName): Deleted.
381         (WebCore::MediaPayload::setEncodingName): Deleted.
382         (WebCore::MediaPayload::clockRate): Deleted.
383         (WebCore::MediaPayload::setClockRate): Deleted.
384         (WebCore::MediaPayload::channels): Deleted.
385         (WebCore::MediaPayload::setChannels): Deleted.
386         (WebCore::MediaPayload::ccmfir): Deleted.
387         (WebCore::MediaPayload::setCcmfir): Deleted.
388         (WebCore::MediaPayload::nackpli): Deleted.
389         (WebCore::MediaPayload::setNackpli): Deleted.
390         (WebCore::MediaPayload::nack): Deleted.
391         (WebCore::MediaPayload::setNack): Deleted.
392         (WebCore::MediaPayload::parameters): Deleted.
393         (WebCore::MediaPayload::clone): Deleted.
394         (WebCore::MediaPayload::MediaPayload): Deleted.
395         * platform/mediastream/PeerMediaDescription.h:
396         (WebCore::PeerMediaDescription::payloads):
397         (WebCore::PeerMediaDescription::addPayload):
398         (WebCore::PeerMediaDescription::setPayloads):
399         (WebCore::PeerMediaDescription::clone):
400         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
401         (WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
402         (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
403         (WebCore::MediaEndpointOwr::filterPayloads):
404         * platform/mock/MockMediaEndpoint.cpp:
405         (WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
406         (WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
407         (WebCore::MockMediaEndpoint::filterPayloads):
408
409 2016-10-26  Dan Bernstein  <mitz@apple.com>
410
411         Improved the last build fix.
412
413         Darin pointed out I could have kept the function inline and just removed the WEBCORE_EXPORT.
414
415         * Modules/mediastream/UserMediaRequest.cpp:
416         (WebCore::UserMediaRequest::document): Deleted.
417         * Modules/mediastream/UserMediaRequest.h:
418         (WebCore::UserMediaRequest::document):
419
420 2016-10-26  Chris Dumez  <cdumez@apple.com>
421
422         [Web IDL] Add support for having string enumerations in their own IDL file
423         https://bugs.webkit.org/show_bug.cgi?id=164025
424
425         Reviewed by Darin Adler.
426
427         Add support for having string enumerations in their own IDL file to facilitate
428         sharing them. Use this new support to implement IDBTransactionMode enumeration
429         for IndexedDB:
430         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBTransactionMode
431
432         No new tests, rebaselined existing tests.
433
434         * CMakeLists.txt:
435         * DerivedSources.cpp:
436         * DerivedSources.make:
437         * Modules/indexeddb/IDBDatabase.cpp:
438         (WebCore::IDBDatabase::transaction):
439         (WebCore::IDBDatabase::startVersionChangeTransaction):
440         * Modules/indexeddb/IDBDatabase.h:
441         * Modules/indexeddb/IDBDatabase.idl:
442         * Modules/indexeddb/IDBOpenDBRequest.cpp:
443         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
444         * Modules/indexeddb/IDBTransaction.cpp:
445         (WebCore::IDBTransaction::IDBTransaction):
446         * Modules/indexeddb/IDBTransaction.h:
447         (WebCore::IDBTransaction::mode):
448         (WebCore::IDBTransaction::isVersionChange):
449         (WebCore::IDBTransaction::isReadOnly):
450         * Modules/indexeddb/IDBTransaction.idl:
451         * Modules/indexeddb/IDBTransactionMode.h: Added.
452         * Modules/indexeddb/IDBTransactionMode.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
453         * Modules/indexeddb/IndexedDB.h:
454         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
455         (WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
456         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
457         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
458         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
459         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
460         (WebCore::IDBServer::MemoryBackingStoreTransaction::isVersionChange):
461         (WebCore::IDBServer::MemoryBackingStoreTransaction::isWriting):
462         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
463         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
464         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
465         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
466         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
467         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
468         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
469         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
470         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
471         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
472         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
473         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
474         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
475         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
476         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
477         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
478         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
479         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
480         (WebCore::IDBServer::SQLiteIDBTransaction::begin):
481         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
482         (WebCore::IDBServer::SQLiteIDBTransaction::mode):
483         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
484         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
485         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
486         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
487         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
488         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
489         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
490         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::originalDatabaseInfo):
491         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::isVersionChange):
492         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::isReadOnly):
493         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
494         (WebCore::IDBTransactionInfo::clientTransaction):
495         (WebCore::IDBTransactionInfo::versionChange):
496         (WebCore::IDBTransactionInfo::loggingString):
497         * Modules/indexeddb/shared/IDBTransactionInfo.h:
498         (WebCore::IDBTransactionInfo::mode):
499         * WebCore.xcodeproj/project.pbxproj:
500         * bindings/scripts/CodeGenerator.pm:
501         (ProcessDocument):
502         (IsEnumType):
503         (GetEnumByName):
504         (IsExternalEnumType):
505         (ValidEnumValues):
506         * bindings/scripts/CodeGeneratorJS.pm:
507         (GenerateEnumeration):
508         (AddToImplIncludesForIDLType):
509         (GetEnumerationClassName):
510         (GenerateEnumerationHeader):
511         (GenerateEnumerationImplementation):
512         (GenerateEnumerationImplementationContent):
513         (GenerateEnumerationsImplementationContent):
514         (GenerateEnumerationHeaderContent):
515         (GenerateEnumerationsHeaderContent):
516         * bindings/scripts/test/JS/JSTestObj.cpp:
517         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgCaller):
518         (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArg):
519         (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgCaller):
520         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: Added.
521         (WebCore::convertEnumerationToJS):
522         (WebCore::parseEnumeration<TestStandaloneEnumeration>):
523         (WebCore::convertEnumeration<TestStandaloneEnumeration>):
524         (WebCore::expectedEnumerationValues<TestStandaloneEnumeration>):
525         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h: Added.
526         * bindings/scripts/test/TestObj.idl:
527         * bindings/scripts/test/TestStandaloneEnumeration.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
528         * inspector/InspectorIndexedDBAgent.cpp:
529
530 2016-10-26  Dan Bernstein  <mitz@apple.com>
531
532         Fixed the WebKit2 build.
533
534         * Modules/mediastream/UserMediaRequest.cpp:
535         (WebCore::UserMediaRequest::document): Moved the definition of this function to here from…
536         * Modules/mediastream/UserMediaRequest.h:
537         (WebCore::UserMediaRequest::document): …here, so that the WebKit2 build doesn’t encounter an
538           exported inline function.
539
540 2016-10-26  Yusuke Suzuki  <utatane.tea@gmail.com>
541
542         [DOMJIT] Implement Node::ownerDocument
543         https://bugs.webkit.org/show_bug.cgi?id=164004
544
545         Reviewed by Darin Adler.
546
547         Test: js/dom/domjit-accessor-owner-document.html
548
549         Implement Node.ownerDocument DOMJIT accessor.
550         According to the result of the profiler, jQuery's prop()
551         function is frequently called in Ember.js SpeedoMeter.
552         And this function calls jQuery.isXMLDoc(). And this isXMLDoc()
553         function calls element.ownerDocument accessor. And our WebKit
554         inspector also uses ownerDocument accessor frequently.
555
556         Interesting thing is this ownerDocument functionality is used
557         in CSSJIT, so CSSJIT has similar helper function to look up the
558         owner document of the element. As a result, all the necessary
559         functionality is already implemented, DOMJIT just utilizes it.
560         For example, Node::treeScopeMemoryOffset() and
561         TreeScope::documentScopeMemoryOffset() is implemented before this
562         patch.
563
564         In the future, we will convert CSSJIT's Assembler& to CCallHelpers&
565         and share the code with DOMJIT[1].
566
567         [1]: https://bugs.webkit.org/show_bug.cgi?id=164006
568
569         * dom/Node.idl:
570         * domjit/DOMJITAbstractHeapRepository.h:
571         * domjit/JSNodeDOMJIT.cpp:
572         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
573         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
574
575 2016-10-26  Chris Dumez  <cdumez@apple.com>
576
577         Replace IDBKeyPath with a WTF::Variant
578         https://bugs.webkit.org/show_bug.cgi?id=163909
579
580         Reviewed by Darin Adler.
581
582         Replace IDBKeyPath class with the IDBKeyPathVariant type entirely
583         and rename IDBKeyPathVariant to IDBKeyPath.
584
585         Unfortunately, IDBKeyPath still needs some special handling when
586         returned to the JavaScript because we do not have a toJS() accepting
587         a WTF::Variant as input yet.
588
589         There should be no significant behavior change except that
590         IDBIndex.keyPath / IDBObjectStore.keyPath now returns an array of
591         Strings instead of a DOMStringList object when the IDBKeyPath
592         contains a vector. This is a progression and matches the
593         specification:
594         - https://www.w3.org/TR/IndexedDB/#widl-IDBIndex-keyPath
595         - https://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-keyPath
596
597         No new tests, rebaselined existing tests.
598
599         * Modules/indexeddb/IDBCursor.cpp:
600         (WebCore::IDBCursor::update):
601         * Modules/indexeddb/IDBDatabase.h:
602         * Modules/indexeddb/IDBGetResult.cpp:
603         (WebCore::IDBGetResult::isolatedCopy):
604         * Modules/indexeddb/IDBKeyPath.cpp:
605         (WebCore::isIDBKeyPathValid):
606         (WebCore::IDBKeyPathIsolatedCopy):
607         * Modules/indexeddb/IDBKeyPath.h:
608         (WebCore::IDBKeyPathIsolatedCopy):
609         * Modules/indexeddb/IDBObjectStore.cpp:
610         (WebCore::IDBObjectStore::keyPath):
611         (WebCore::IDBObjectStore::putOrAdd):
612         (WebCore::IDBObjectStore::createIndex):
613         * Modules/indexeddb/IDBObjectStore.h:
614         * Modules/indexeddb/server/IDBSerialization.cpp:
615         (WebCore::serializeIDBKeyPath):
616         (WebCore::deserializeIDBKeyPath):
617         * Modules/indexeddb/server/IDBSerialization.h:
618         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
619         (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
620         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
621         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
622         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
623         (WebCore::IDBDatabaseInfo::createNewObjectStore):
624         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
625         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
626         (WebCore::IDBIndexInfo::IDBIndexInfo):
627         (WebCore::IDBIndexInfo::isolatedCopy):
628         * Modules/indexeddb/shared/IDBIndexInfo.h:
629         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
630         (WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
631         (WebCore::IDBObjectStoreInfo::createNewIndex):
632         (WebCore::IDBObjectStoreInfo::isolatedCopy):
633         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
634         (WebCore::IDBObjectStoreInfo::keyPath):
635         * bindings/js/IDBBindingUtilities.cpp:
636         (WebCore::injectIDBKeyIntoScriptValue):
637         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
638         (WebCore::canInjectIDBKeyIntoScriptValue):
639         (WebCore::createKeyPathArray):
640         (WebCore::toJS):
641         * bindings/js/IDBBindingUtilities.h:
642         * inspector/InspectorIndexedDBAgent.cpp:
643
644 2016-10-26  Zalan Bujtas  <zalan@apple.com>
645
646         Ignore out-of-flow siblings when searching for a spanner candidate.
647         https://bugs.webkit.org/show_bug.cgi?id=164042.
648         <rdar://problem/28758456>
649
650         Reviewed by Simon Fraser.
651
652         While searching for the spanner candidates in a flow thread, we have to take into account
653         whether renderers are in- or out-of-flow.
654         What it means is that while traversing the renderer tree to find the the candidate
655         renderer (next sibling/ancestor's next child in pre-order traversal), we have to check if the candidate
656         is in the same layout context too.
657
658         Test: fast/multicol/crash-when-spanner-candidate-is-out-of-flow.html
659
660         * rendering/RenderMultiColumnFlowThread.cpp:
661         (WebCore::spannerPlacehoderCandidate):
662         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
663
664 2016-10-26  Brian Burg  <bburg@apple.com>
665
666         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
667         https://bugs.webkit.org/show_bug.cgi?id=164046
668
669         Reviewed by Joseph Pecoraro.
670
671         * inspector/InspectorClient.cpp:
672         (WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
673         * inspector/InspectorClient.h:
674         * testing/Internals.cpp:
675         (WebCore::InspectorStubFrontend::sendMessageToFrontend):
676
677 2016-10-26  Chris Dumez  <cdumez@apple.com>
678
679         The URLSearchParams constructor should take a union in parameter
680         https://bugs.webkit.org/show_bug.cgi?id=163906
681
682         Reviewed by Darin Adler.
683
684         The URLSearchParams constructor should take a union in parameter:
685         - https://url.spec.whatwg.org/#urlsearchparams
686
687         No new tests, no web-exposed behavior change.
688
689         * html/URLSearchParams.h:
690         (WebCore::URLSearchParams::create):
691         * html/URLSearchParams.idl:
692
693 2016-10-26  Sam Weinig  <sam@webkit.org>
694
695         [WebIDL] Move more string conversions over to JSDOMConvert
696         https://bugs.webkit.org/show_bug.cgi?id=164021
697
698         Reviewed by Tim Horton.
699
700         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
701         (WebCore::JSCSSStyleDeclaration::putDelegate):
702         * bindings/js/JSDOMWindowCustom.cpp:
703         (WebCore::JSDOMWindow::open):
704         (WebCore::JSDOMWindow::showModalDialog):
705         (WebCore::handlePostMessage):
706         * bindings/js/JSHTMLCanvasElementCustom.cpp:
707         (WebCore::JSHTMLCanvasElement::toDataURL):
708         * bindings/js/JSHistoryCustom.cpp:
709         (WebCore::JSHistory::pushState):
710         (WebCore::JSHistory::replaceState):
711         Switch to convert functions.
712
713         * bindings/js/JSApplePaySessionCustom.cpp:
714         (WebCore::JSApplePaySession::completeShippingMethodSelection):
715         (WebCore::JSApplePaySession::completeShippingContactSelection):
716         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
717         (WebCore::createAesKeyGenParams):
718         (WebCore::createRsaKeyGenParams):
719         * bindings/js/JSDocumentCustom.cpp:
720         (WebCore::JSDocument::getCSSCanvasContext):
721         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
722         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
723         (WebCore::toDecision):
724         * bindings/js/JSNodeFilterCustom.cpp:
725         (WebCore::JSNodeFilter::acceptNode):
726         * bindings/js/JSDOMBinding.cpp:
727         (WebCore::toSmallerInt):
728         (WebCore::toSmallerUInt):
729         (WebCore::toInt8EnforceRange):
730         (WebCore::toUInt8EnforceRange):
731         (WebCore::toInt8Clamp):
732         (WebCore::toUInt8Clamp):
733         (WebCore::toInt8):
734         (WebCore::toUInt8):
735         (WebCore::toInt16EnforceRange):
736         (WebCore::toUInt16EnforceRange):
737         (WebCore::toInt16Clamp):
738         (WebCore::toUInt16Clamp):
739         (WebCore::toInt16):
740         (WebCore::toUInt16):
741         Use updated IntegerConversionConfiguration naming.
742
743         (WebCore::valueToStringTreatingNullAsEmptyString): Deleted.
744         (WebCore::valueToStringWithUndefinedOrNullCheck): Deleted.
745         (WebCore::valueToUSVStringTreatingNullAsEmptyString): Deleted.
746         (WebCore::valueToUSVStringWithUndefinedOrNullCheck): Deleted.
747         * bindings/js/JSDOMBinding.h:
748         Remove unused functions.
749
750         * bindings/js/JSDOMConvert.h:
751         (WebCore::convert):
752         Add StringConversionConfiguration, to match IntegerConversionConfiguration which moved here,
753         and make them both enum classes. Remove SFINAE based overloading of convert<>, which is not
754         needed if we get rid of the default parameter, which we can, since the two parameter convert
755         routes to the right place.
756
757         (WebCore::Converter<IDLNullable<T>>::convert):
758         Add overloads converts that take a Integer/String configuration.
759
760         (WebCore::Converter<IDLByte>::convert):
761         (WebCore::Converter<IDLOctet>::convert):
762         (WebCore::Converter<IDLShort>::convert):
763         (WebCore::Converter<IDLUnsignedShort>::convert):
764         (WebCore::Converter<IDLLong>::convert):
765         (WebCore::Converter<IDLUnsignedLong>::convert):
766         (WebCore::Converter<IDLLongLong>::convert):
767         (WebCore::Converter<IDLUnsignedLongLong>::convert):
768         Use updated IntegerConversionConfiguration naming.
769
770         (WebCore::Converter<IDLDOMString>::convert):
771         (WebCore::Converter<IDLUSVString>::convert):
772         Add a configuration parameter, similar to the one used for integers
773         that changes the behavior of string conversions to return an empty
774         string for null.
775
776         * bindings/js/JSDOMIterator.h:
777         (WebCore::iteratorCreate):
778         (WebCore::IteratorTraits>::asJS):
779         (WebCore::appendForEachArguments):
780         Simplify a bit by extracting the SFINAE helpers into a EnableIfMap and EnableIfSet.
781
782         * bindings/scripts/CodeGeneratorJS.pm:
783         (GetIntegerConversionConfiguration):
784         (GetStringConversionConfiguration):
785         (JSValueToNativeIsHandledByDOMConvert):
786         (JSValueToNative):
787         Add support for converting more string types and passing the StringConversionConfiguration.
788
789 2016-10-26  Dan Bernstein  <mitz@apple.com>
790
791         When pasting web archive, width specifiers in srcset attribute change into density specifiers
792         https://bugs.webkit.org/show_bug.cgi?id=164027
793         <rdar://problem/28964948>
794
795         Reviewed by Tim Horton.
796
797         Updated editing/pasteboard/img-srcset-copy-paste-canonicalization.html.
798
799         * html/HTMLImageElement.cpp:
800         (WebCore::HTMLImageElement::completeURLsInAttributeValue): Use 'w' when writing out a width
801           specifier.
802
803 2016-10-26  Antoine Quint  <graouts@apple.com>
804
805         [Modern Media Controls] Media Controller: playback support
806         https://bugs.webkit.org/show_bug.cgi?id=163678
807         <rdar://problem/27989479>
808
809         Reviewed by Dean Jackson.
810
811         We introduce the PlaybackSupport class which brings support for playing and pausing
812         the media by clicking on the play/pause button in the media controls and correctly
813         reflecting the media's playback state as the media is played or paused via the media API.
814
815         * Modules/modern-media-controls/js-files:
816         * Modules/modern-media-controls/media/media-controller.js:
817         (MediaController):
818         * Modules/modern-media-controls/media/playback-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
819         (PlaybackSupport.prototype.get control):
820         (PlaybackSupport.prototype.get mediaEvents):
821         (PlaybackSupport.prototype.buttonWasClicked):
822         (PlaybackSupport.prototype.syncControl):
823         (PlaybackSupport):
824         * WebCore.xcodeproj/project.pbxproj:
825
826 2016-10-26  Chris Dumez  <cdumez@apple.com>
827
828         Regression(r203848): 百度糯米 app fails to load content due to a JavaScript error
829         https://bugs.webkit.org/show_bug.cgi?id=163967
830         <rdar://problem/28707838>
831
832         Reviewed by Ryosuke Niwa.
833
834         Add quirk for 百度糯米 app making the 2 last parameters to Event.prototype.initEvent()
835         optional.
836
837         No new tests, change only impacts this specific application.
838
839         * bindings/scripts/CodeGeneratorJS.pm:
840         (GeneratePropertiesHashTable):
841         * dom/Event.cpp:
842         (WebCore::Event::initEventForBindings):
843         * dom/Event.h:
844         * dom/Event.idl:
845         * platform/RuntimeApplicationChecks.h:
846         * platform/RuntimeApplicationChecks.mm:
847         (WebCore::IOSApplication::isBaiduNuomi):
848
849 2016-10-26  Chris Dumez  <cdumez@apple.com>
850
851         First parameter to TextTrack.addCue() / removeCue() should not be nullable
852         https://bugs.webkit.org/show_bug.cgi?id=164020
853
854         Reviewed by Eric Carlson.
855
856         First parameter to TextTrack.addCue() / removeCue() should not be nullable:
857         - https://html.spec.whatwg.org/#texttrack
858
859         Firefox and Chrome agree with the specification.
860
861         Test: media/track/texttrack-addCue-null.html
862
863         * html/track/InbandDataTextTrack.cpp:
864         (WebCore::InbandDataTextTrack::removeDataCue):
865         (WebCore::InbandDataTextTrack::removeCue):
866         * html/track/InbandDataTextTrack.h:
867         * html/track/InbandGenericTextTrack.cpp:
868         (WebCore::InbandGenericTextTrack::addGenericCue):
869         (WebCore::InbandGenericTextTrack::removeGenericCue):
870         (WebCore::InbandGenericTextTrack::removeCue):
871         * html/track/InbandGenericTextTrack.h:
872         * html/track/TextTrack.cpp:
873         (WebCore::TextTrack::addCue):
874         (WebCore::TextTrack::removeCue):
875         * html/track/TextTrack.h:
876         * html/track/TextTrack.idl:
877
878 2016-10-26  Antoine Quint  <graouts@apple.com>
879
880         [Modern Media Controls] Media Controller: elapsed and remaining time support
881         https://bugs.webkit.org/show_bug.cgi?id=163679
882         <rdar://problem/28851675>
883
884         Reviewed by Dean Jackson.
885
886         We introduce the ElapsedTimeSupport and RemainingTimeSupport classes which bring
887         support for displaying the elapsed and remaining time in the time control.
888
889         Tests: media/modern-media-controls/elapsed-time-support/elapsed-time-support.html
890                media/modern-media-controls/remaining-time-support/remaining-time-support.html
891
892         * Modules/modern-media-controls/js-files:
893         * Modules/modern-media-controls/media/elapsed-time-support.js: Added.
894         (ElapsedTimeSupport.prototype.get control):
895         (ElapsedTimeSupport.prototype.get mediaEvents):
896         (ElapsedTimeSupport.prototype.syncControl):
897         (ElapsedTimeSupport):
898         * Modules/modern-media-controls/media/media-controller.js:
899         (MediaController):
900         * Modules/modern-media-controls/media/remaining-time-support.js: Added.
901         (RemainingTimeSupport.prototype.get control):
902         (RemainingTimeSupport.prototype.get mediaEvents):
903         (RemainingTimeSupport.prototype.syncControl):
904         (RemainingTimeSupport):
905         * WebCore.xcodeproj/project.pbxproj:
906
907 2016-10-26  Dave Hyatt  <hyatt@apple.com>
908
909         [CSS Parser] Unify CSSCustomPropertyValue and CSSCustomPropertyDeclaration
910         https://bugs.webkit.org/show_bug.cgi?id=164019
911
912         Reviewed by Zalan Bujtas.
913
914         * CMakeLists.txt:
915         * WebCore.xcodeproj/project.pbxproj:
916         * css/CSSCustomPropertyDeclaration.cpp: Removed.
917         * css/CSSCustomPropertyDeclaration.h: Removed.
918         Get rid of CSSCustomPropertyDeclaration.
919
920         * css/CSSCustomPropertyValue.h:
921         Add new constructors to handle the new variable data format (either a CSSValueId or a
922         CSSVariableData object that holds parser tokens).
923
924         * css/CSSValue.cpp:
925         (WebCore::CSSValue::cssText):
926         (WebCore::CSSValue::destroy):
927         * css/CSSValue.h:
928         (WebCore::CSSValue::isCustomPropertyDeclaration): Deleted.
929         Get rid of CSSCustomPropertyDeclaration cases.
930
931         * css/CSSVariableData.h:
932         Switch to CSSCustomPropertyValue.
933
934         * css/StyleResolver.cpp:
935         (WebCore::StyleResolver::applyProperty):
936         We've renamed the old parser variable data to deprecatedValue to make it clear it's going
937         to be removed eventually.
938
939         * css/parser/CSSParserImpl.cpp:
940         (WebCore::filterProperties):
941         (WebCore::CSSParserImpl::consumeVariableValue):
942         * css/parser/CSSVariableParser.cpp:
943         (WebCore::CSSVariableParser::parseDeclarationValue):
944         * css/parser/CSSVariableParser.h:
945         Switch to CSSCustomPropertyValue.
946
947 2016-10-26  Youenn Fablet  <youenn@apple.com>
948
949         Enable SDPProcessor for Mac bots
950         https://bugs.webkit.org/show_bug.cgi?id=163940
951
952         Reviewed by Eric Carlson.
953
954         Covered by activated tests.
955
956         Activating processing of SDPProcessor scripts for Mac bots.
957         Moving platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp to platform/mediastream/SDPProcessorScriptResource.cpp.
958         This file is not tied to openwebrtc and allows retrieving the SDPProcessor script resource file content.
959
960         * DerivedSources.make:
961         * PlatformGTK.cmake:
962         * WebCore.xcodeproj/project.pbxproj:
963         * platform/mediastream/SDPProcessorScriptResource.cpp:
964         (WebCore::SDPProcessorScriptResource::scriptString):
965         * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Removed.
966
967 2016-10-26  Dave Hyatt  <hyatt@apple.com>
968
969         [CSS Parser] Get functional pseudos parsing
970         https://bugs.webkit.org/show_bug.cgi?id=164018
971
972         Reviewed by Zalan Bujtas.
973
974         * css/parser/CSSParserValues.cpp:
975         (WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
976         Remove the ( check so that we can parse strings that end in (.
977
978         * css/parser/CSSSelectorParser.cpp:
979         (WebCore::CSSSelectorParser::consumePseudo):
980         Put in a hack that adds a ( to the end of the string so that it will be found in the map.
981
982 2016-10-26  Zan Dobersek  <zdobersek@igalia.com>
983
984         Unreviewed. Fixing compiler warnings in PlaybackPipeline
985         that are popping up in GTK+ builds.
986
987         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
988         (WebCore::PlaybackPipeline::addSourceBuffer):
989         (WebCore::PlaybackPipeline::attachTrack):
990
991 2016-10-26  Youenn Fablet  <youennf@gmail.com>
992
993         IceCandidate does not need to be refcounted
994         https://bugs.webkit.org/show_bug.cgi?id=163944
995
996         Reviewed by Eric Carlson.
997
998         No change of behavior.
999
1000         Simplifying IceCandidate class into a simple structure, no longer refcounted.
1001         Updated call sites accordingly.
1002         Updated SDP parsing of candidates to return a Variant instead of having both a return and an out parameter.
1003
1004         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1005         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
1006         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
1007         * Modules/mediastream/MediaEndpointPeerConnection.h:
1008         * Modules/mediastream/SDPProcessor.cpp:
1009         (WebCore::createCandidateObject):
1010         (WebCore::createCandidate):
1011         (WebCore::iceCandidateFromJSON):
1012         (WebCore::configurationToJSON):
1013         (WebCore::SDPProcessor::parseCandidateLine):
1014         * Modules/mediastream/SDPProcessor.h:
1015         (WebCore::SDPProcessor::ParsingResult::parsingStatus):
1016         (WebCore::SDPProcessor::ParsingResult::candidate):
1017         * platform/mediastream/IceCandidate.h:
1018         * platform/mediastream/MediaEndpoint.cpp:
1019         * platform/mediastream/MediaEndpoint.h:
1020         * platform/mediastream/PeerMediaDescription.h:
1021         (WebCore::PeerMediaDescription::iceCandidates):
1022         (WebCore::PeerMediaDescription::addIceCandidate):
1023         (WebCore::PeerMediaDescription::clone):
1024         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
1025         (WebCore::MediaEndpointOwr::updateSendConfiguration):
1026         (WebCore::MediaEndpointOwr::addRemoteCandidate):
1027         (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
1028         (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
1029         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
1030         * platform/mock/MockMediaEndpoint.cpp:
1031         (WebCore::MockMediaEndpoint::addRemoteCandidate):
1032         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
1033         * platform/mock/MockMediaEndpoint.h:
1034
1035 2016-10-26  Andreas Kling  <akling@apple.com>
1036
1037         Fix mach port leak in ResourceUsageThread.
1038         <https://webkit.org/b/164012>
1039
1040         Reviewed by Antti Koivisto.
1041
1042         The threads returned by task_threads() need to be deallocated.
1043
1044         * page/cocoa/ResourceUsageThreadCocoa.mm:
1045         (WebCore::cpuUsage):
1046
1047 2016-10-26  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1048
1049         WebRTC: The RTCTrackEventInit dictionary needs required members
1050         https://bugs.webkit.org/show_bug.cgi?id=158536
1051
1052         Reviewed by Chris Dumez.
1053
1054         Update RTCTrackEvent IDL as per specification.
1055
1056         No additional test required, rebase existing tests.
1057
1058         * Modules/mediastream/RTCTrackEvent.idl:
1059
1060 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1061
1062         [GStreamer][GTK+][MSE] Unreviewed debug build fix.
1063
1064         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1065         (WebCore::AppendPipeline::resetPipeline):
1066         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1067
1068 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1069
1070         [cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
1071         https://bugs.webkit.org/show_bug.cgi?id=162928
1072
1073         Reviewed by Xabier Rodriguez-Calvar.
1074
1075         Consolidate all the source file tree changes after refactoring.
1076
1077         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
1078
1079         * platform/GStreamer.cmake:
1080
1081 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1082
1083         [MSE][GStreamer] Enable QUOTA_EXCEEDED_ERR support for GStreamer
1084         https://bugs.webkit.org/show_bug.cgi?id=162922
1085
1086         Reviewed by Xabier Rodriguez-Calvar.
1087
1088         QUOTA_EXCEEDED_ERR should be reported by SourceBuffer when appropriate, at least on the
1089         GStreamer implementation.
1090
1091         * Modules/mediasource/SourceBuffer.cpp:
1092         (WebCore::SourceBuffer::appendBufferInternal):
1093
1094 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1095
1096         [MSE] Expose additional MediaSource methods to MediaSourcePrivate
1097         https://bugs.webkit.org/show_bug.cgi?id=162920
1098
1099         Reviewed by Xabier Rodriguez-Calvar.
1100
1101         The GStreamer MSE platform implementation needs to report duration changes and trigger
1102         monitorSourceBuffers() calls.
1103
1104         * Modules/mediasource/MediaSource.cpp:
1105         (WebCore::MediaSource::durationChanged):
1106         * Modules/mediasource/MediaSource.h:
1107         * platform/graphics/MediaSourcePrivateClient.h:
1108
1109 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1110
1111         [GStreamer][EME] ClearKey decryption support
1112         https://bugs.webkit.org/show_bug.cgi?id=162918
1113
1114         Reviewed by Xabier Rodriguez-Calvar.
1115
1116         This patch is authored by Philippe Normand <philn@igalia.com>.
1117
1118         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: Added.
1119         (webkit_media_clear_key_decrypt_class_init):
1120         (webkit_media_clear_key_decrypt_init):
1121         (webKitMediaClearKeyDecryptorFinalize):
1122         (webKitMediaClearKeyDecryptorRequestDecryptionKey):
1123         (webKitMediaClearKeyDecryptorHandleKeyResponse):
1124         (webKitMediaClearKeyDecryptorSetupCipher):
1125         (webKitMediaClearKeyDecryptorDecrypt):
1126         (webKitMediaClearKeyDecryptorReleaseCipher):
1127         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h: Added.
1128
1129 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1130
1131         [GStreamer][EME] Base class for decryption support
1132         https://bugs.webkit.org/show_bug.cgi?id=162915
1133
1134         Reviewed by Xabier Rodriguez-Calvar.
1135
1136         Add common encryption base class.
1137
1138         This patch is authored by Philippe Normand <philn@igalia.com>.
1139
1140         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Added.
1141         (webkit_media_common_encryption_decrypt_class_init):
1142         (webkit_media_common_encryption_decrypt_init):
1143         (webKitMediaCommonEncryptionDecryptorFinalize):
1144         (webkitMediaCommonEncryptionDecryptTransformCaps):
1145         (webkitMediaCommonEncryptionDecryptTransformInPlace):
1146         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
1147         (webKitMediaCommonEncryptionDecryptorChangeState):
1148         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
1149         (webKitMediaCommonEncryptionDecryptDefaultReleaseCipher):
1150         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added.
1151
1152 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1153
1154         [GStreamer][EME] Utility function to create decryptor
1155         https://bugs.webkit.org/show_bug.cgi?id=162914
1156
1157         Reviewed by Xabier Rodriguez-Calvar.
1158
1159         Add a utility function to find a suitable GStreamer decryptor element.
1160
1161         This patch is authored by Philippe Normand <philn@igalia.com>.
1162
1163         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1164         (WebCore::createGstDecryptor):
1165         (WebCore::gstRegistryHasElementForMediaType): Deleted.
1166         * platform/graphics/gstreamer/GStreamerUtilities.h:
1167
1168 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1169
1170         [GStreamer][MSE][EME] Remove MSE code from regular player and add EME support
1171         https://bugs.webkit.org/show_bug.cgi?id=162911
1172
1173         Now that the MSE responsibility has been refactored to the dedicated
1174         MediaPlayerPrivateGStreamerMSE subclass, the regular player no longer needs the MSE code,
1175         just to expose some more methods to the subclass. Float timestamps have been migrated to
1176         double. Also, small changes to accomodate the EME support are needed.
1177
1178         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support) and
1179         Žan Doberšek <zandobersek@gmail.com> (double timestamps).
1180
1181         Reviewed by Xabier Rodriguez-Calvar.
1182
1183         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1184         (WebCore::busMessageCallback):
1185         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
1186         (WebCore::initializeGStreamerAndRegisterWebKitElements):
1187         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1188         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
1189         (WebCore::MediaPlayerPrivateGStreamer::load):
1190         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
1191         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
1192         (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime):
1193         (WebCore::MediaPlayerPrivateGStreamer::seek):
1194         (WebCore::MediaPlayerPrivateGStreamer::doSeek):
1195         (WebCore::MediaPlayerPrivateGStreamer::paused):
1196         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
1197         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
1198         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
1199         (WebCore::MediaPlayerPrivateGStreamer::buffered):
1200         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1201         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
1202         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
1203         (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
1204         (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded):
1205         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
1206         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
1207         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
1208         (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
1209         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
1210         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1211         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
1212         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted.
1213         (WebCore::MediaPlayerPrivateGStreamer::commitLoad): Deleted.
1214         (WebCore::MediaPlayerPrivateGStreamer::pause): Deleted.
1215         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): Deleted.
1216         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback): Deleted.
1217         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps): Deleted.
1218         (WebCore::MediaPlayerPrivateGStreamer::setRate): Deleted.
1219         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Deleted.
1220         (WebCore::MediaPlayerPrivateGStreamer::totalBytes): Deleted.
1221         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Deleted.
1222         (WebCore::MediaPlayerPrivateGStreamer::loadStateChanged): Deleted.
1223         (WebCore::MediaPlayerPrivateGStreamer::timeChanged): Deleted.
1224         (WebCore::mimeTypeSet): Deleted.
1225         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Deleted.
1226         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1227         (WebCore::MediaPlayerPrivateGStreamer::configurePlaySink):
1228         (WebCore::MediaPlayerPrivateGStreamer::isMediaSource):
1229         (WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Deleted.
1230
1231 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1232
1233         [GStreamer][EME] Add EME support to base private player
1234         https://bugs.webkit.org/show_bug.cgi?id=162908
1235
1236         Reviewed by Xabier Rodriguez-Calvar.
1237
1238         Add encryption key management support.
1239
1240         This patch is authored by Philippe Normand <philn@igalia.com>.
1241
1242         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1243         (WebCore::registerWebKitGStreamerElements):
1244         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1245         (WebCore::MediaPlayerPrivateGStreamerBase::needKey):
1246         (WebCore::MediaPlayerPrivateGStreamerBase::setCDMSession):
1247         (WebCore::MediaPlayerPrivateGStreamerBase::keyAdded):
1248         (WebCore::MediaPlayerPrivateGStreamerBase::createSession):
1249         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
1250         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
1251         (WebCore::MediaPlayerPrivateGStreamerBase::extendedSupportsType):
1252         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Deleted.
1253         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline): Deleted.
1254         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Deleted.
1255         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1256         (WebCore::MediaPlayerPrivateGStreamerBase::pipeline):
1257
1258 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1259
1260         [GStreamer][MSE] WebKitMediaSourceGStreamer refactoring
1261         https://bugs.webkit.org/show_bug.cgi?id=162902
1262
1263         Reviewed by Xabier Rodriguez-Calvar.
1264
1265         Move WebKitMediaSourceGStreamer to the mse directory, split public and private header
1266         sections, manage stream data throttling and seek synchronization, audio/video/text stream
1267         counting, improve GStreamer duration query, stream initialization, remove
1268         MediaSourceClientGStreamer logic (factored out to its own class in another patch) and
1269         interaction with MediaPlayerPrivateGStreamerMSE, PlaybackPipeline and
1270         SourceBufferPrivateGStreamer.
1271
1272         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp: Removed.
1273         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: Added.
1274         (disabledAppsrcNeedData):
1275         (disabledAppsrcEnoughData):
1276         (disabledAppsrcSeekData):
1277         (enabledAppsrcEnoughData):
1278         (enabledAppsrcSeekData):
1279         (getStreamByAppsrc):
1280         (webkit_media_src_init):
1281         (webKitMediaSrcFinalize):
1282         (webKitMediaSrcSetProperty):
1283         (webKitMediaSrcGetProperty):
1284         (webKitMediaSrcDoAsyncStart):
1285         (webKitMediaSrcDoAsyncDone):
1286         (webKitMediaSrcChangeState):
1287         (webKitMediaSrcGetSize):
1288         (webKitMediaSrcQueryWithParent):
1289         (webKitMediaSrcUpdatePresentationSize):
1290         (webKitMediaSrcLinkStreamToSrcPad):
1291         (webKitMediaSrcLinkParser):
1292         (webKitMediaSrcFreeStream):
1293         (webKitMediaSrcCheckAllTracksConfigured):
1294         (webKitMediaSrcUriGetType):
1295         (webKitMediaSrcGetProtocols):
1296         (webKitMediaSrcGetUri):
1297         (webKitMediaSrcSetUri):
1298         (webKitMediaSrcUriHandlerInit):
1299         (seekNeedsDataMainThread):
1300         (notifyReadyForMoreSamplesMainThread):
1301         (applicationMessageCallback):
1302         (webKitMediaSrcSetMediaPlayerPrivate):
1303         (webKitMediaSrcSetReadyForSamples):
1304         (webKitMediaSrcPrepareSeek):
1305         (WTF::adoptGRef):
1306         (WTF::refGPtr<WebKitMediaSrc>):
1307         (WTF::derefGPtr<WebKitMediaSrc>):
1308         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/WebKitMediaSourceGStreamer.h.
1309         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: Added.
1310
1311 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1312
1313         [GStreamer][MSE] Playback pipeline
1314         https://bugs.webkit.org/show_bug.cgi?id=162901
1315
1316         Reviewed by Xabier Rodriguez-Calvar.
1317
1318         Encapsulate the responsibility to interact with the GStreamer playback pipeline and the
1319         different streams managed by the WebKitMediaSrc element into a new PlaybackPipeline class.
1320
1321         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added.
1322         (getStreamByTrackId):
1323         (getStreamBySourceBufferPrivate):
1324         (pushSample):
1325         (WebCore::PlaybackPipeline::create):
1326         (WebCore::PlaybackPipeline::PlaybackPipeline):
1327         (WebCore::PlaybackPipeline::~PlaybackPipeline):
1328         (WebCore::PlaybackPipeline::setWebKitMediaSrc):
1329         (WebCore::PlaybackPipeline::webKitMediaSrc):
1330         (WebCore::PlaybackPipeline::addSourceBuffer):
1331         (WebCore::PlaybackPipeline::removeSourceBuffer):
1332         (WebCore::PlaybackPipeline::attachTrack):
1333         (WebCore::PlaybackPipeline::reattachTrack):
1334         (WebCore::PlaybackPipeline::notifyDurationChanged):
1335         (WebCore::PlaybackPipeline::markEndOfStream):
1336         (WebCore::PlaybackPipeline::flushAndEnqueueNonDisplayingSamples):
1337         (WebCore::PlaybackPipeline::enqueueSample):
1338         (WebCore::PlaybackPipeline::pipeline):
1339         * platform/graphics/gstreamer/mse/PlaybackPipeline.h: Added.
1340
1341 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1342
1343         [GStreamer][MSE][EME] MSE specialization of Media Player Private for GStreamer
1344         https://bugs.webkit.org/show_bug.cgi?id=162900
1345
1346         Reviewed by Xabier Rodriguez-Calvar.
1347
1348         Refactor MSE-specific logic to its own GStreamer player. This new MSE player coordinates
1349         data appending, media playback and interaction with MediaSource by delegating to
1350         AppendPipeline (one instance per SourceBuffer), PlaybackPipeline and
1351         MediaSourceClientGStreamerMSE/MediaSourcePrivateClient respectively.
1352
1353         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
1354
1355         * platform/graphics/MediaPlayer.cpp:
1356         (WebCore::buildMediaEnginesVector):
1357         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Added.
1358         (dumpReadyState):
1359         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
1360         (WebCore::initializeGStreamerAndRegisterWebKitMSEElement):
1361         (WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable):
1362         (WebCore::MediaPlayerPrivateGStreamerMSE::MediaPlayerPrivateGStreamerMSE):
1363         (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
1364         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
1365         (WebCore::MediaPlayerPrivateGStreamerMSE::pause):
1366         (WebCore::MediaPlayerPrivateGStreamerMSE::durationMediaTime):
1367         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
1368         (WebCore::MediaPlayerPrivateGStreamerMSE::configurePlaySink):
1369         (WebCore::MediaPlayerPrivateGStreamerMSE::changePipelineState):
1370         (WebCore::MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime):
1371         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
1372         (WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
1373         (WebCore::MediaPlayerPrivateGStreamerMSE::updatePlaybackRate):
1374         (WebCore::MediaPlayerPrivateGStreamerMSE::seeking):
1375         (WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
1376         (WebCore::MediaPlayerPrivateGStreamerMSE::waitForSeekCompleted):
1377         (WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
1378         (WebCore::MediaPlayerPrivateGStreamerMSE::setRate):
1379         (WebCore::MediaPlayerPrivateGStreamerMSE::buffered):
1380         (WebCore::MediaPlayerPrivateGStreamerMSE::sourceChanged):
1381         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
1382         (WebCore::MediaPlayerPrivateGStreamerMSE::asyncStateChangeDone):
1383         (WebCore::MediaPlayerPrivateGStreamerMSE::isTimeBuffered):
1384         (WebCore::MediaPlayerPrivateGStreamerMSE::setMediaSourceClient):
1385         (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourceClient):
1386         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
1387         (WebCore::mimeTypeCache):
1388         (WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
1389         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
1390         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
1391         (WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey):
1392         (WebCore::MediaPlayerPrivateGStreamerMSE::markEndOfStream):
1393         (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime):
1394         (WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
1395         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: Added.
1396         (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourcePrivateClient):
1397
1398 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1399
1400         [GStreamer][MSE] MediaSourceGStreamer refactoring
1401         https://bugs.webkit.org/show_bug.cgi?id=162899
1402
1403         Reviewed by Žan Doberšek.
1404
1405         Move MediaSourceGStreamer to the mse directory, manage SourceBufferPrivates and delegate WebKitMediaSrc operations to the MSE private player.
1406
1407         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp.
1408         (WebCore::MediaSourceGStreamer::open):
1409         (WebCore::MediaSourceGStreamer::MediaSourceGStreamer):
1410         (WebCore::MediaSourceGStreamer::~MediaSourceGStreamer):
1411         (WebCore::MediaSourceGStreamer::addSourceBuffer):
1412         (WebCore::MediaSourceGStreamer::removeSourceBuffer):
1413         (WebCore::MediaSourceGStreamer::durationChanged):
1414         (WebCore::MediaSourceGStreamer::markEndOfStream):
1415         (WebCore::MediaSourceGStreamer::unmarkEndOfStream):
1416         (WebCore::MediaSourceGStreamer::readyState):
1417         (WebCore::MediaSourceGStreamer::setReadyState):
1418         (WebCore::MediaSourceGStreamer::waitForSeekCompleted):
1419         (WebCore::MediaSourceGStreamer::seekCompleted):
1420         (WebCore::MediaSourceGStreamer::sourceBufferPrivateDidChangeActiveState):
1421         (WebCore::MediaSourceGStreamer::buffered):
1422         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h.
1423
1424 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1425
1426         [GStreamer][MSE] SourceBufferPrivateGStreamer refactoring
1427         https://bugs.webkit.org/show_bug.cgi?id=162898
1428
1429         Reviewed by Xabier Rodriguez-Calvar.
1430
1431         Moved SourceBufferPrivateGStreamer to an mse directory and added unimplemented features (abort, enqueueing and sample flow control).
1432
1433         * platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp: Removed.
1434         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: Added.
1435         (WebCore::SourceBufferPrivateGStreamer::create):
1436         (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
1437         (WebCore::SourceBufferPrivateGStreamer::~SourceBufferPrivateGStreamer):
1438         (WebCore::SourceBufferPrivateGStreamer::setClient):
1439         (WebCore::SourceBufferPrivateGStreamer::append):
1440         (WebCore::SourceBufferPrivateGStreamer::abort):
1441         (WebCore::SourceBufferPrivateGStreamer::resetParserState):
1442         (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):
1443         (WebCore::SourceBufferPrivateGStreamer::readyState):
1444         (WebCore::SourceBufferPrivateGStreamer::setReadyState):
1445         (WebCore::SourceBufferPrivateGStreamer::flushAndEnqueueNonDisplayingSamples):
1446         (WebCore::SourceBufferPrivateGStreamer::enqueueSample):
1447         (WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
1448         (WebCore::SourceBufferPrivateGStreamer::setReadyForMoreSamples):
1449         (WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
1450         (WebCore::SourceBufferPrivateGStreamer::setActive):
1451         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples):
1452         (WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
1453         (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment):
1454         (WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
1455         (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples):
1456         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h.
1457
1458 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1459
1460         [GStreamer][MSE] MediaSourceClientGStreamerMSE
1461         https://bugs.webkit.org/show_bug.cgi?id=162896
1462
1463         Reviewed by Xabier Rodriguez-Calvar.
1464
1465         This class encapsulates the MediaSource interaction responsibility for the
1466         GStreamer platform.
1467
1468         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: Added.
1469         (WebCore::MediaSourceClientGStreamerMSE::create):
1470         (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
1471         (WebCore::MediaSourceClientGStreamerMSE::~MediaSourceClientGStreamerMSE):
1472         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
1473         (WebCore::MediaSourceClientGStreamerMSE::duration):
1474         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
1475         (WebCore::MediaSourceClientGStreamerMSE::abort):
1476         (WebCore::MediaSourceClientGStreamerMSE::append):
1477         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
1478         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
1479         (WebCore::MediaSourceClientGStreamerMSE::flushAndEnqueueNonDisplayingSamples):
1480         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
1481         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
1482         (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate):
1483         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: Added.
1484
1485 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1486
1487         [GStreamer] GStreamer Media Sample
1488         https://bugs.webkit.org/show_bug.cgi?id=162894
1489
1490         Reviewed by Xabier Rodriguez-Calvar.
1491
1492         Implement the MediaSample interface for the GStreamer platform.
1493
1494         * platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp: Added.
1495         (WebCore::GStreamerMediaSample::GStreamerMediaSample):
1496         (WebCore::GStreamerMediaSample::create):
1497         (WebCore::GStreamerMediaSample::createFakeSample):
1498         (WebCore::GStreamerMediaSample::applyPtsOffset):
1499         (WebCore::GStreamerMediaSample::offsetTimestampsBy):
1500         (WebCore::GStreamerMediaSample::~GStreamerMediaSample):
1501         * platform/graphics/gstreamer/mse/GStreamerMediaSample.h: Added.
1502         (WebCore::GStreamerMediaSample::presentationTime):
1503         (WebCore::GStreamerMediaSample::decodeTime):
1504         (WebCore::GStreamerMediaSample::duration):
1505         (WebCore::GStreamerMediaSample::trackID):
1506         (WebCore::GStreamerMediaSample::setTrackID):
1507         (WebCore::GStreamerMediaSample::sizeInBytes):
1508         (WebCore::GStreamerMediaSample::sample):
1509         (WebCore::GStreamerMediaSample::presentationSize):
1510         (WebCore::GStreamerMediaSample::setTimestamps):
1511         (WebCore::GStreamerMediaSample::isDivisable):
1512         (WebCore::GStreamerMediaSample::divide):
1513         (WebCore::GStreamerMediaSample::flags):
1514         (WebCore::GStreamerMediaSample::platformSample):
1515         (WebCore::GStreamerMediaSample::dump):
1516
1517 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1518
1519         [GStreamer] GStreamer Media Description
1520         https://bugs.webkit.org/show_bug.cgi?id=162893
1521
1522         Reviewed by Xabier Rodriguez-Calvar.
1523
1524         Implement the MediaDescription interface for the GStreamer platform.
1525
1526         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp: Added.
1527         (WebCore::GStreamerMediaDescription::codec):
1528         (WebCore::GStreamerMediaDescription::isVideo):
1529         (WebCore::GStreamerMediaDescription::isAudio):
1530         (WebCore::GStreamerMediaDescription::isText):
1531         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.h: Added.
1532         (WebCore::GStreamerMediaDescription::create):
1533         (WebCore::GStreamerMediaDescription::~GStreamerMediaDescription):
1534         (WebCore::GStreamerMediaDescription::GStreamerMediaDescription):
1535
1536 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1537
1538         [GStreamer][MSE][EME] Append Pipeline
1539         https://bugs.webkit.org/show_bug.cgi?id=162874
1540
1541         Reviewed by Žan Doberšek.
1542
1543         This patch is co-authored with Xabier Rodriguez-Calvar <calvaris@igalia.com> (data starve
1544         and last sample detection, debug features) and Philippe Normand <philn@igalia.com> (EME
1545         support).
1546
1547         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added.
1548         (WebCore::dumpAppendState):
1549         (WebCore::appendPipelineElementMessageCallback):
1550         (WebCore::appendPipelineApplicationMessageCallback):
1551         (WebCore::AppendPipeline::AppendPipeline):
1552         (WebCore::AppendPipeline::~AppendPipeline):
1553         (WebCore::AppendPipeline::clearPlayerPrivate):
1554         (WebCore::AppendPipeline::handleElementMessage):
1555         (WebCore::AppendPipeline::handleApplicationMessage):
1556         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
1557         (WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft):
1558         (WebCore::AppendPipeline::id):
1559         (WebCore::AppendPipeline::setAppendState):
1560         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1561         (WebCore::AppendPipeline::appsinkCapsChanged):
1562         (WebCore::AppendPipeline::checkEndOfAppend):
1563         (WebCore::AppendPipeline::appsinkNewSample):
1564         (WebCore::AppendPipeline::appsinkEOS):
1565         (WebCore::AppendPipeline::didReceiveInitializationSegment):
1566         (WebCore::AppendPipeline::trackId):
1567         (WebCore::AppendPipeline::resetPipeline):
1568         (WebCore::AppendPipeline::setAppsrcDataLeavingProbe):
1569         (WebCore::AppendPipeline::removeAppsrcDataLeavingProbe):
1570         (WebCore::AppendPipeline::abort):
1571         (WebCore::AppendPipeline::pushNewBuffer):
1572         (WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft):
1573         (WebCore::AppendPipeline::reportAppsrcNeedDataReceived):
1574         (WebCore::AppendPipeline::handleNewAppsinkSample):
1575         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1576         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
1577         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
1578         (WebCore::appendPipelineAppsinkCapsChanged):
1579         (WebCore::appendPipelineAppsrcDataLeaving):
1580         (WebCore::appendPipelinePadProbeDebugInformation):
1581         (WebCore::appendPipelineAppsrcNeedData):
1582         (WebCore::appendPipelineDemuxerPadAdded):
1583         (WebCore::appendPipelineDemuxerPadRemoved):
1584         (WebCore::appendPipelineAppsinkNewSample):
1585         (WebCore::appendPipelineAppsinkEOS):
1586         * platform/graphics/gstreamer/mse/AppendPipeline.h: Added.
1587         (WebCore::AppendPipeline::appendState):
1588         (WebCore::AppendPipeline::mediaSourceClient):
1589         (WebCore::AppendPipeline::sourceBufferPrivate):
1590         (WebCore::AppendPipeline::bus):
1591         (WebCore::AppendPipeline::pipeline):
1592         (WebCore::AppendPipeline::appsrc):
1593         (WebCore::AppendPipeline::appsink):
1594         (WebCore::AppendPipeline::demuxerSrcPadCaps):
1595         (WebCore::AppendPipeline::appsinkCaps):
1596         (WebCore::AppendPipeline::track):
1597         (WebCore::AppendPipeline::streamType):
1598
1599 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1600
1601         [GStreamer] Drain query support
1602         https://bugs.webkit.org/show_bug.cgi?id=162872
1603
1604         Reviewed by Žan Doberšek.
1605
1606         Under some circumstances, GStreamer deadlocks completely during MSE seeks on OpenGL ES
1607         systems. This is because the video sink still holds samples. Proper DRAIN support
1608         fixes this issue and is also good for all the platforms, not only OpenGL ES.
1609
1610         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1611         (WebCore::MediaPlayerPrivateGStreamerBase::triggerDrain):
1612         (WebCore::MediaPlayerPrivateGStreamerBase::drainCallback):
1613         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
1614         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Deleted.
1615         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1616         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1617         (VideoRenderRequestScheduler::drain):
1618         (webkitVideoSinkQuery):
1619         (webkitVideoSinkEvent):
1620         (webkit_video_sink_class_init):
1621         (VideoRenderRequestScheduler::stop): Deleted.
1622         (webkitVideoSinkProposeAllocation): Deleted.
1623
1624 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
1625
1626         [GStreamer] Track enhancements for MSE support
1627         https://bugs.webkit.org/show_bug.cgi?id=162869
1628
1629         Reviewed by Xabier Rodriguez-Calvar.
1630
1631         Add 'id' field to Audio/VideoTrackPrivateGStreamer. Make TrackPrivateBaseGStreamer
1632         work anyway in cases where the demuxer isn't contained in a GstPlaybin.
1633
1634         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1635         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
1636         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
1637         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1638         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
1639         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
1640         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1641         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
1642         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
1643
1644 2016-10-26  Youenn Fablet  <youenn@apple.com>
1645
1646         Make CachedResourceLoader originsMatch check more efficient
1647         https://bugs.webkit.org/show_bug.cgi?id=163938
1648
1649         Reviewed by Darin Adler.
1650
1651         No change of behavior.
1652
1653         * loader/cache/CachedResourceLoader.cpp:
1654         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
1655         (WebCore::originsMatch): Moved to SecurityOrigin.cpp.
1656         * page/SecurityOrigin.cpp:
1657         (WebCore::areOriginsMatching): Helper routine to check whether origins are matching.
1658         (WebCore::originsMatch): Ensuring string comparison provides the same result as this function.
1659         * page/SecurityOrigin.h:
1660         (WebCore::SecurityOrigin::protocol):
1661         (WebCore::SecurityOrigin::host):
1662         (WebCore::SecurityOrigin::domain):
1663
1664 2016-10-25  Yusuke Suzuki  <utatane.tea@gmail.com>
1665
1666         [DOMJIT] Tell IDL result type to DFG to drop type checks in AI
1667         https://bugs.webkit.org/show_bug.cgi?id=163900
1668
1669         Reviewed by Sam Weinig.
1670
1671         Add TestDOMJIT.idl for bindings generation tests.
1672
1673         * bindings/scripts/CodeGeneratorJS.pm:
1674         (GetResultTypeFilter):
1675         (GenerateImplementation):
1676         * bindings/scripts/test/JS/JSTestDOMJIT.cpp: Added.
1677         (WebCore::JSTestDOMJITPrototype::create):
1678         (WebCore::JSTestDOMJITPrototype::createStructure):
1679         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
1680         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
1681         (WebCore::JSTestDOMJITConstructor::initializeProperties):
1682         (WebCore::JSTestDOMJITPrototype::finishCreation):
1683         (WebCore::JSTestDOMJIT::JSTestDOMJIT):
1684         (WebCore::JSTestDOMJIT::createPrototype):
1685         (WebCore::JSTestDOMJIT::prototype):
1686         (WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
1687         (WebCore::jsTestDOMJITAnyAttr):
1688         (WebCore::jsTestDOMJITAnyAttrGetter):
1689         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
1690         (WebCore::domJITGetterSetterForTestDOMJITAnyAttr):
1691         (WebCore::jsTestDOMJITBooleanAttr):
1692         (WebCore::jsTestDOMJITBooleanAttrGetter):
1693         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
1694         (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr):
1695         (WebCore::jsTestDOMJITByteAttr):
1696         (WebCore::jsTestDOMJITByteAttrGetter):
1697         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
1698         (WebCore::domJITGetterSetterForTestDOMJITByteAttr):
1699         (WebCore::jsTestDOMJITOctetAttr):
1700         (WebCore::jsTestDOMJITOctetAttrGetter):
1701         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
1702         (WebCore::domJITGetterSetterForTestDOMJITOctetAttr):
1703         (WebCore::jsTestDOMJITShortAttr):
1704         (WebCore::jsTestDOMJITShortAttrGetter):
1705         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
1706         (WebCore::domJITGetterSetterForTestDOMJITShortAttr):
1707         (WebCore::jsTestDOMJITUnsignedShortAttr):
1708         (WebCore::jsTestDOMJITUnsignedShortAttrGetter):
1709         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
1710         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr):
1711         (WebCore::jsTestDOMJITLongAttr):
1712         (WebCore::jsTestDOMJITLongAttrGetter):
1713         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
1714         (WebCore::domJITGetterSetterForTestDOMJITLongAttr):
1715         (WebCore::jsTestDOMJITUnsignedLongAttr):
1716         (WebCore::jsTestDOMJITUnsignedLongAttrGetter):
1717         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
1718         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr):
1719         (WebCore::jsTestDOMJITLongLongAttr):
1720         (WebCore::jsTestDOMJITLongLongAttrGetter):
1721         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
1722         (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr):
1723         (WebCore::jsTestDOMJITUnsignedLongLongAttr):
1724         (WebCore::jsTestDOMJITUnsignedLongLongAttrGetter):
1725         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
1726         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr):
1727         (WebCore::jsTestDOMJITFloatAttr):
1728         (WebCore::jsTestDOMJITFloatAttrGetter):
1729         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
1730         (WebCore::domJITGetterSetterForTestDOMJITFloatAttr):
1731         (WebCore::jsTestDOMJITUnrestrictedFloatAttr):
1732         (WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter):
1733         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
1734         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr):
1735         (WebCore::jsTestDOMJITDoubleAttr):
1736         (WebCore::jsTestDOMJITDoubleAttrGetter):
1737         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
1738         (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr):
1739         (WebCore::jsTestDOMJITUnrestrictedDoubleAttr):
1740         (WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter):
1741         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
1742         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr):
1743         (WebCore::jsTestDOMJITDomStringAttr):
1744         (WebCore::jsTestDOMJITDomStringAttrGetter):
1745         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
1746         (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr):
1747         (WebCore::jsTestDOMJITByteStringAttr):
1748         (WebCore::jsTestDOMJITByteStringAttrGetter):
1749         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
1750         (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr):
1751         (WebCore::jsTestDOMJITUsvStringAttr):
1752         (WebCore::jsTestDOMJITUsvStringAttrGetter):
1753         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
1754         (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr):
1755         (WebCore::jsTestDOMJITNodeAttr):
1756         (WebCore::jsTestDOMJITNodeAttrGetter):
1757         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
1758         (WebCore::domJITGetterSetterForTestDOMJITNodeAttr):
1759         (WebCore::jsTestDOMJITBooleanNullableAttr):
1760         (WebCore::jsTestDOMJITBooleanNullableAttrGetter):
1761         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
1762         (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr):
1763         (WebCore::jsTestDOMJITByteNullableAttr):
1764         (WebCore::jsTestDOMJITByteNullableAttrGetter):
1765         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
1766         (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr):
1767         (WebCore::jsTestDOMJITOctetNullableAttr):
1768         (WebCore::jsTestDOMJITOctetNullableAttrGetter):
1769         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
1770         (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr):
1771         (WebCore::jsTestDOMJITShortNullableAttr):
1772         (WebCore::jsTestDOMJITShortNullableAttrGetter):
1773         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
1774         (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr):
1775         (WebCore::jsTestDOMJITUnsignedShortNullableAttr):
1776         (WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter):
1777         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
1778         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr):
1779         (WebCore::jsTestDOMJITLongNullableAttr):
1780         (WebCore::jsTestDOMJITLongNullableAttrGetter):
1781         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
1782         (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr):
1783         (WebCore::jsTestDOMJITUnsignedLongNullableAttr):
1784         (WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter):
1785         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
1786         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr):
1787         (WebCore::jsTestDOMJITLongLongNullableAttr):
1788         (WebCore::jsTestDOMJITLongLongNullableAttrGetter):
1789         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
1790         (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr):
1791         (WebCore::jsTestDOMJITUnsignedLongLongNullableAttr):
1792         (WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter):
1793         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
1794         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr):
1795         (WebCore::jsTestDOMJITFloatNullableAttr):
1796         (WebCore::jsTestDOMJITFloatNullableAttrGetter):
1797         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
1798         (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr):
1799         (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttr):
1800         (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter):
1801         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
1802         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr):
1803         (WebCore::jsTestDOMJITDoubleNullableAttr):
1804         (WebCore::jsTestDOMJITDoubleNullableAttrGetter):
1805         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
1806         (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr):
1807         (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttr):
1808         (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter):
1809         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
1810         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr):
1811         (WebCore::jsTestDOMJITDomStringNullableAttr):
1812         (WebCore::jsTestDOMJITDomStringNullableAttrGetter):
1813         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
1814         (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr):
1815         (WebCore::jsTestDOMJITByteStringNullableAttr):
1816         (WebCore::jsTestDOMJITByteStringNullableAttrGetter):
1817         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
1818         (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr):
1819         (WebCore::jsTestDOMJITUsvStringNullableAttr):
1820         (WebCore::jsTestDOMJITUsvStringNullableAttrGetter):
1821         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
1822         (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr):
1823         (WebCore::jsTestDOMJITNodeNullableAttr):
1824         (WebCore::jsTestDOMJITNodeNullableAttrGetter):
1825         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
1826         (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr):
1827         (WebCore::jsTestDOMJITConstructor):
1828         (WebCore::setJSTestDOMJITConstructor):
1829         (WebCore::JSTestDOMJIT::getConstructor):
1830         (WebCore::JSTestDOMJIT::visitChildren):
1831         * bindings/scripts/test/JS/JSTestDOMJIT.h: Added.
1832         (WebCore::JSTestDOMJIT::create):
1833         (WebCore::JSTestDOMJIT::createStructure):
1834         (WebCore::JSTestDOMJIT::wrapped):
1835         (WebCore::JSTestDOMJIT::finishCreation):
1836         * bindings/scripts/test/TestDOMJIT.idl: Added.
1837
1838 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
1839
1840         [Win] Unreviewed build fix.
1841
1842         * platform/graphics/GraphicsContext.h: Add missing declaration.
1843
1844 2016-10-25  Ryosuke Niwa  <rniwa@webkit.org>
1845
1846         Updating attribute by textContent must create a single mutation record and custom element reaction
1847         https://bugs.webkit.org/show_bug.cgi?id=164003
1848
1849         Reviewed by Chris Dumez.
1850
1851         The bug was caused by setTextContent not invoking setNodeValue for Attr nodes.
1852         Use setNodeValue to match the specification: https://dom.spec.whatwg.org/#dom-node-textcontent
1853
1854         Test: fast/dom/MutationObserver/text-content-on-attr.html
1855
1856         * dom/Node.cpp:
1857         (WebCore::Node::setTextContent):
1858
1859 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
1860
1861         [Win][Direct2D] Use smart pointers for Direct2D Path types
1862         https://bugs.webkit.org/show_bug.cgi?id=163994
1863
1864         Reviewed by Alex Christensen.
1865
1866         Tested by existing path tests.
1867
1868         * platform/graphics/Path.h:
1869         (WebCore::Path::platformPath): Use a COMPtr for m_path.
1870         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1871         (WebCore::GraphicsContext::systemFactory): Present better D2D debug output
1872         when running a debug build.
1873         (WebCore::GraphicsContext::platformInit): Initialize a D2D device from a
1874         native GDI device context.
1875         (WebCore::GraphicsContext::platformStrokeStyle): Added.
1876         (WebCore::GraphicsContext::clipBounds): Simplify clip boundary calculations and
1877         avoid doing math on infinities.
1878         * platform/graphics/win/PathDirect2D.cpp:
1879         (WebCore::scratchRenderTarget): Added.
1880         (WebCore::Path::~Path): Switch to COMPtr implementation.
1881         (WebCore::Path::ensurePlatformPath): Ditto.
1882         (WebCore::Path::appendGeometry): Ditto.
1883         (WebCore::Path::operator=): Ditto.
1884         (WebCore::Path::initializePathState): Ditto.
1885         (WebCore::Path::strokeContains): Provide an implementation.
1886         (WebCore::Path::transform): Ditto.
1887         (WebCore::Path::addEllipse): No need for explicit construction of the
1888         D2D1::Point2F object.
1889         (WebCore::Path::clear): Switch to COMPtr implementation.
1890
1891 2016-10-25  Nan Wang  <n_wang@apple.com>
1892
1893         LayoutTest accessibility/mac/meter-gauge-value-description.html failing
1894         https://bugs.webkit.org/show_bug.cgi?id=163997
1895         <rdar://problem/28948637>
1896
1897         Reviewed by Chris Fleizach.
1898
1899         I hand-edited the Localizable.strings file in a previous patch and my changes
1900         were replaced by running update-webkit-localizable-strings script. Changed the
1901         key to be the same as the value to keep consistency with other entries.
1902
1903         Re-enabled the failing test.
1904
1905         * English.lproj/Localizable.strings:
1906         * platform/LocalizedStrings.cpp:
1907         (WebCore::AXMeterGaugeRegionOptimumText):
1908         (WebCore::AXMeterGaugeRegionSuboptimalText):
1909         (WebCore::AXMeterGaugeRegionLessGoodText):
1910
1911 2016-10-25  Filip Pizlo  <fpizlo@apple.com>
1912
1913         HeapTimer should not hardcode all of its subclasses and USE(CF) shouldn't be a bizarre special case
1914         https://bugs.webkit.org/show_bug.cgi?id=163947
1915
1916         Reviewed by Geoffrey Garen.
1917
1918         No new tests because no new behavior.
1919
1920         * platform/ios/WebSafeGCActivityCallbackIOS.h:
1921         * platform/ios/WebSafeIncrementalSweeperIOS.h:
1922
1923 2016-10-25  Dave Hyatt  <hyatt@apple.com>
1924
1925         [CSS Parser] Improvements to selector parsing
1926         https://bugs.webkit.org/show_bug.cgi?id=163964
1927
1928         Reviewed by Zalan Bujtas.
1929
1930         * css/CSSSelector.cpp:
1931         (WebCore::CSSSelector::setAttribute):
1932         (WebCore::CSSSelector::setNth):
1933         * css/CSSSelector.h:
1934         (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive):
1935         * css/StyleSheetContents.cpp:
1936         (WebCore::StyleSheetContents::StyleSheetContents):
1937         (WebCore::StyleSheetContents::parserAppendRule):
1938         (WebCore::StyleSheetContents::ruleAt):
1939         (WebCore::StyleSheetContents::ruleCount):
1940         (WebCore::StyleSheetContents::clearRules):
1941         (WebCore::StyleSheetContents::wrapperInsertRule):
1942         (WebCore::StyleSheetContents::wrapperDeleteRule):
1943         * css/StyleSheetContents.h:
1944         * css/parser/CSSParser.cpp:
1945         (WebCore::CSSParserContext::CSSParserContext):
1946         (WebCore::CSSParser::parseSelector):
1947         * css/parser/CSSParserValues.h:
1948         (WebCore::CSSParserSelector::setAttribute):
1949         (WebCore::CSSParserSelector::setArgument):
1950         (WebCore::CSSParserSelector::setNth):
1951         * css/parser/CSSSelectorParser.cpp:
1952         (WebCore::consumeLangArgumentList):
1953         (WebCore::CSSSelectorParser::consumeCompoundSelector):
1954         (WebCore::CSSSelectorParser::consumeAttribute):
1955         (WebCore::isPseudoClassFunction):
1956         (WebCore::isPseudoElementFunction):
1957         (WebCore::CSSSelectorParser::consumePseudo):
1958         (WebCore::CSSSelectorParser::consumeCombinator):
1959
1960 2016-10-25  Beth Dakin  <bdakin@apple.com>
1961
1962         Numbered list should be represented without ‘…’
1963         https://bugs.webkit.org/show_bug.cgi?id=163992
1964         -and corresponding-
1965         rdar://problem/28911337
1966
1967         Reviewed by Darin Adler.
1968
1969         * English.lproj/Localizable.strings:
1970         * platform/LocalizedStrings.cpp:
1971         (WebCore::insertListTypeNumbered):
1972
1973 2016-10-25  Daniel Bates  <dabates@apple.com>
1974
1975         REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
1976         https://bugs.webkit.org/show_bug.cgi?id=163978
1977         <rdar://problem/25962131>
1978
1979         Reviewed by Darin Adler.
1980
1981         During the tokenization process of an HTML tag the start and end positions of each of its
1982         attributes is tracked so that the XSS Auditor can request a snippet around a suspected
1983         injected attribute. We need to take care to consider document.write() boundaries when
1984         tracking the start and end positions of each HTML tag and attribute so that the XSS Auditor
1985         receives the correct snippet. Following r178265 we no longer consider document.write()
1986         boundaries when tracking the start and end positions of attributes. So, the substring
1987         represented by the start and end positions of an attribute may correspond to some other
1988         attribute in the tag. Therefore the XSS Auditor may fail to block an injection because the
1989         snippet it requested may not be the snippet that it intended to request.
1990
1991         Tests: http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror.html
1992                http/tests/security/xssAuditor/dom-write-location-open-img-onerror.html
1993                http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror.html
1994
1995         * html/parser/HTMLSourceTracker.cpp:
1996         (WebCore::HTMLSourceTracker::startToken): Set the attribute base offset to be the token
1997         start position.
1998         (WebCore::HTMLSourceTracker::source): Use the specified attribute start position as-is. We no
1999         longer adjust it here because it was adjusted with respect to the attribute base offset, which
2000         takes into account document.write() boundaries.
2001         * html/parser/HTMLToken.h:
2002         (WebCore::HTMLToken::setAttributeBaseOffset): Added.
2003         (WebCore::HTMLToken::beginAttribute): Subtract attribute base offset from the specified offset.
2004         (WebCore::HTMLToken::endAttribute): Ditto.
2005         * html/parser/HTMLTokenizer.h:
2006         (WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Added.
2007
2008 2016-10-25  Chris Dumez  <cdumez@apple.com>
2009
2010         IDBDatabase.transaction() should take a union in parameter
2011         https://bugs.webkit.org/show_bug.cgi?id=163966
2012
2013         Reviewed by Sam Weinig.
2014
2015         IDBDatabase.transaction() should take a union in parameter:
2016         - https://www.w3.org/TR/IndexedDB/#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode
2017
2018         No new tests, no expected Web-exposed behavior change.
2019
2020         * Modules/indexeddb/IDBDatabase.cpp:
2021         (WebCore::IDBDatabase::transaction):
2022         * Modules/indexeddb/IDBDatabase.h:
2023         * Modules/indexeddb/IDBDatabase.idl:
2024
2025 2016-10-25  Brady Eidson  <beidson@apple.com>
2026
2027         IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
2028         <rdar://problem/28806930> and https://bugs.webkit.org/show_bug.cgi?id=163954
2029
2030         Reviewed by Andy Estes.
2031
2032         No new tests (Covered by changes to existing tests)
2033
2034         * Modules/indexeddb/IDBCursor.cpp:
2035         (WebCore::IDBCursor::create):
2036         * Modules/indexeddb/IDBCursor.h:
2037
2038         * Modules/indexeddb/IDBObjectStore.cpp:
2039         (WebCore::IDBObjectStore::openCursor):
2040         (WebCore::IDBObjectStore::openKeyCursor):
2041         * Modules/indexeddb/IDBObjectStore.h:
2042         * Modules/indexeddb/IDBObjectStore.idl:
2043
2044         * Modules/indexeddb/IDBTransaction.cpp:
2045         (WebCore::IDBTransaction::requestOpenCursor):
2046
2047         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2048         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): Only grab the current value
2049           if the cursor is KeyAndValue.
2050
2051         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2052         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
2053         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Only save off the data for an
2054           object store cursor if it's both KeyAndValue.
2055         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2056
2057         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
2058         (WebCore::IDBCursorInfo::objectStoreCursor): Allow for a KeyOnly ObjectStoreCursor.
2059         * Modules/indexeddb/shared/IDBCursorInfo.h:
2060
2061 2016-10-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2062
2063         Support InputEvent.dataTransfer for the InputEvent spec
2064         https://bugs.webkit.org/show_bug.cgi?id=163213
2065         <rdar://problem/28700407>
2066
2067         Reviewed by Ryosuke Niwa.
2068
2069         Adds support for the dataTransfer attribute of InputEvent, which contains both HTML and plain text
2070         representations of inserted content corresponding to input types "insertFromPaste", "insertFromDrop" and
2071         "insertReplacementText". The specification calls for the data transfer's drag data item list to contain this
2072         information via two entries with type strings "text/html" and "text/plain". However, WebKit does not yet support
2073         the DataTransfer.items -- in lieu of this, we will provide this information for now via getData("text/plain")
2074         and getData("text/html"), respectively.
2075
2076         To support this attribute, we need a special type of DataTransfer which is readonly and returns canned data
2077         given a type string. To implement this, we introduce StaticPasteboard, a type of Pasteboard which is initialized
2078         with a map of type string to data. When asked for its data via getData, the StaticPasteboard searches its map
2079         for the requested type and returns the result, if any.
2080
2081         An editing command may now create a new DataTransfer via DataTransfer::createForInputEvent from HTML and
2082         plaintext strings, and then vend this information to its dispatched input events by overriding
2083         CompositeEditCommand::inputEventDataTransfer.
2084
2085         Some further work will be needed to ensure that all information exposed via this DataTransfer does not contain
2086         hidden content. To do this, we should create a new Document, "paste" the contents of our copied HTML string into
2087         it, then simulate selecting the content and generating markup from the selection to create a sanitized
2088         DocumentFragment corresponding to the original copied HTML. This will be addressed in a future patch.
2089
2090         Tests: fast/events/input-events-paste-rich-datatransfer.html
2091                fast/events/input-events-spell-checking-datatransfer.html
2092
2093         * PlatformEfl.cmake:
2094         * PlatformGTK.cmake:
2095         * PlatformWin.cmake:
2096
2097         Add StaticPasteboard.cpp.
2098
2099         * WebCore.xcodeproj/project.pbxproj:
2100         * dom/DataTransfer.cpp:
2101         (WebCore::DataTransfer::DataTransfer):
2102         (WebCore::DataTransfer::createForInputEvent):
2103
2104         Initializes a new DataTransfer for the purposes of input events. This takes a HTML and plain text
2105         representations of the data being inserted and creates a new readonly DataTransfer backed by a StaticPasteboard
2106         that only knows how to map the "text/plain" data type to the given plaintext string and "text/html" to the
2107         given HTML text.
2108
2109         * dom/DataTransfer.h:
2110         * dom/InputEvent.cpp:
2111         (WebCore::InputEvent::create):
2112         (WebCore::InputEvent::InputEvent):
2113         (WebCore::InputEvent::dataTransfer):
2114         * dom/InputEvent.h:
2115         * dom/InputEvent.idl:
2116
2117         Add the InputEvent.dataTransfer attribute.
2118
2119         * dom/Node.cpp:
2120         * editing/CompositeEditCommand.cpp:
2121         (WebCore::CompositeEditCommand::inputEventDataTransfer):
2122
2123         Add a new hook for CompositeEditCommands to vend a DataTransfer for the purposes of input events. By default,
2124         this is null.
2125
2126         * editing/CompositeEditCommand.h:
2127         * editing/Editor.cpp:
2128         (WebCore::dispatchBeforeInputEvent):
2129         (WebCore::dispatchInputEvent):
2130         (WebCore::dispatchBeforeInputEvents):
2131         (WebCore::dispatchInputEvents):
2132         (WebCore::Editor::willApplyEditing):
2133         (WebCore::Editor::appliedEditing):
2134         * editing/ReplaceRangeWithTextCommand.cpp:
2135         (WebCore::ReplaceRangeWithTextCommand::willApplyCommand):
2136         (WebCore::ReplaceRangeWithTextCommand::doApply):
2137         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer):
2138         * editing/ReplaceRangeWithTextCommand.h:
2139         * editing/ReplaceSelectionCommand.cpp:
2140         (WebCore::ReplaceSelectionCommand::willApplyCommand):
2141
2142         Initialize the ReplacementFragment here before applying the command, adjusting the DocumentFragment to be
2143         inserted in the process.
2144
2145         (WebCore::ReplaceSelectionCommand::doApply):
2146         (WebCore::ReplaceSelectionCommand::inputEventDataTransfer):
2147         (WebCore::ReplaceSelectionCommand::ensureReplacementFragment):
2148
2149         Returns the ReplacementFragment used to apply the command, initializing it if necessary and stripping extraneous
2150         nodes off of the document fragment in the process. Since ReplaceSelectionCommand may be used as a top-level
2151         editing command or a child of another CompositeEditCommand such as the ReplaceRangeWithTextCommand, the
2152         ReplacementFragment may be initialized either in willApplyCommand or in doApply.
2153
2154         * editing/ReplaceSelectionCommand.h:
2155         * editing/SpellingCorrectionCommand.cpp:
2156         (WebCore::SpellingCorrectionCommand::willApplyCommand):
2157         (WebCore::SpellingCorrectionCommand::doApply):
2158         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer):
2159         * editing/SpellingCorrectionCommand.h:
2160
2161         Using the replacement text fragment, create and return a DataTransfer for input events.
2162
2163         * platform/Pasteboard.h:
2164         * platform/StaticPasteboard.cpp: Added.
2165         (WebCore::StaticPasteboard::create):
2166         (WebCore::StaticPasteboard::StaticPasteboard):
2167         (WebCore::StaticPasteboard::hasData):
2168         (WebCore::StaticPasteboard::types):
2169         (WebCore::StaticPasteboard::readString):
2170         * platform/StaticPasteboard.h: Copied from Source/WebCore/dom/InputEvent.cpp.
2171         * platform/efl/PasteboardEfl.cpp:
2172         (WebCore::Pasteboard::writeMarkup):
2173         (WebCore::Pasteboard::write):
2174         (WebCore::Pasteboard::read):
2175         * platform/gtk/PasteboardGtk.cpp:
2176         (WebCore::Pasteboard::writeMarkup):
2177         * platform/ios/PasteboardIOS.mm:
2178         (WebCore::Pasteboard::writeMarkup):
2179         * platform/mac/PasteboardMac.mm:
2180         (WebCore::Pasteboard::Pasteboard):
2181         (WebCore::Pasteboard::writeMarkup):
2182         * platform/win/PasteboardWin.cpp:
2183         (WebCore::Pasteboard::write):
2184         (WebCore::Pasteboard::read):
2185
2186         To account for virtual methods on Pasteboard, add implementations for methods that were previously defined but
2187         unimplemented on these platforms.
2188
2189 2016-10-25  Andy Estes  <aestes@apple.com>
2190
2191         Implement rel=noopener
2192         https://bugs.webkit.org/show_bug.cgi?id=155166
2193         <rdar://problem/25193787>
2194
2195         Reviewed by Brent Fulgham.
2196
2197         Added support for rel=noopener to a and area elements.
2198
2199         Tests: fast/dom/Window/a-rel-noopener.html
2200                fast/dom/Window/area-rel-noopener.html
2201
2202         * html/HTMLAnchorElement.cpp:
2203         (WebCore::HTMLAnchorElement::HTMLAnchorElement): Stopped initializing m_linkRelations to 0.
2204         (WebCore::HTMLAnchorElement::parseAttribute): Declared static AtomicStrings for "noreferrer"
2205         and "noopener", and created a SpaceSplitString from the rel attribute value to test for these
2206         two values.
2207         (WebCore::HTMLAnchorElement::hasRel): Updated to use OptionSet::contains().
2208         (WebCore::HTMLAnchorElement::relList): Added a check for "noopener".
2209         (WebCore::HTMLAnchorElement::handleClick): Passed NewFrameOpenerPolicy::Suppress to
2210         FrameLoader::urlSelected() if rel=noopener was specified.
2211         * html/HTMLAnchorElement.h: Changed the Relation enum to an enum class, removed unused enum
2212         values, and changed m_linkRelations from a 30-bit unsigned integer to an OptionSet<Relation>
2213         (HTMLAnchorElement is still 128 bytes on 64-bit).
2214         * loader/FrameLoader.cpp:
2215         (WebCore::FrameLoader::urlSelected): Changed to only compute a NewFrameOpenerPolicy from the
2216         referrer policy if an explicit NewFrameOpenerPolicy isn't specified. Removed the version of
2217         urlSelected() that did not take a downloadAttribute parameter.
2218         * loader/FrameLoader.h: Added an Optional<NewFrameOpenerPolicy> parameter to urlSelected(),
2219         and set a default argument for downloadAttribute instead of having a second version of
2220         urlSelected().
2221
2222 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
2223
2224         [MediaStream] Add "has capture device" bit to media state flags
2225         https://bugs.webkit.org/show_bug.cgi?id=163952
2226
2227         Reviewed by Jer Noble.
2228
2229         No new tests, updated fast/mediastream/MediaStream-page-muted.html, media/muted-video-is-playing-audio.html,
2230         and webaudio/web-audio-is-playing.html.
2231
2232         * Modules/mediastream/MediaStream.cpp:
2233         (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
2234           actually producing data.
2235
2236         * page/MediaProducer.h: Add HasMediaCaptureDevice bit.
2237
2238         * testing/Internals.cpp:
2239         (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
2240         (WebCore::Internals::isPagePlayingAudio): Deleted.
2241         * testing/Internals.h:
2242         * testing/Internals.idl:
2243
2244 2016-10-25  Commit Queue  <commit-queue@webkit.org>
2245
2246         Unreviewed, rolling out r207827 and r207828.
2247         https://bugs.webkit.org/show_bug.cgi?id=163965
2248
2249         Caused LayoutTest webaudio/web-audio-is-playing.html to time
2250         out on macOS. (Requested by ryanhaddad on #webkit).
2251
2252         Reverted changesets:
2253
2254         "[MediaStream] Add "has capture device" bit to media state
2255         flags"
2256         https://bugs.webkit.org/show_bug.cgi?id=163952
2257         http://trac.webkit.org/changeset/207827
2258
2259         "[MediaStream] Add "has capture device" bit to media state
2260         flags"
2261         https://bugs.webkit.org/show_bug.cgi?id=163952
2262         http://trac.webkit.org/changeset/207828
2263
2264 2016-10-25  Antoine Quint  <graouts@apple.com>
2265
2266         [Modern Media Controls] Media Controller: skip back support
2267         https://bugs.webkit.org/show_bug.cgi?id=163725
2268         <rdar://problem/27989480>
2269
2270         Reviewed by Dean Jackson.
2271
2272         We introduce the SkipBackSupport class which brings support for skipping back
2273         30 seconds into the media by clicking on the skip back button in the media controls.
2274
2275         Test: http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html
2276
2277         * Modules/modern-media-controls/js-files:
2278         * Modules/modern-media-controls/media/media-controller.js:
2279         (MediaController):
2280         * Modules/modern-media-controls/media/skip-back-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
2281         (SkipBackSupport.prototype.get control):
2282         (SkipBackSupport.prototype.buttonWasClicked):
2283         (SkipBackSupport):
2284         * WebCore.xcodeproj/project.pbxproj:
2285
2286 2016-10-25  Commit Queue  <commit-queue@webkit.org>
2287
2288         Unreviewed, rolling out r207578.
2289         https://bugs.webkit.org/show_bug.cgi?id=163962
2290
2291         Broke quip.com so that user can no longer type a space
2292         (Requested by rniwa on #webkit).
2293
2294         Reverted changeset:
2295
2296         "Add a plain space instead of &nbsp; between text nodes"
2297         https://bugs.webkit.org/show_bug.cgi?id=123163
2298         http://trac.webkit.org/changeset/207578
2299
2300 2016-10-25  Chris Dumez  <cdumez@apple.com>
2301
2302         LOG_WITH_STREAM() macro should not have a semi colon at the end
2303         https://bugs.webkit.org/show_bug.cgi?id=163951
2304
2305         Reviewed by Simon Fraser.
2306
2307         * platform/LogMacros.h:
2308
2309 2016-10-25  Chris Dumez  <cdumez@apple.com>
2310
2311         IDBObjectStore.createIndex() should take a union in parameter
2312         https://bugs.webkit.org/show_bug.cgi?id=163935
2313
2314         Reviewed by Darin Adler.
2315
2316         IDBObjectStore.createIndex() should take a union in parameter:
2317         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore
2318
2319         No new tests, no expected Web-exposed behavior change.
2320
2321         * Modules/indexeddb/IDBDatabase.cpp:
2322         (WebCore::IDBDatabase::createObjectStore):
2323         * Modules/indexeddb/IDBKeyPath.cpp:
2324         (WebCore::isIDBKeyPathValid):
2325         (WebCore::IDBKeyPath::isValid): Deleted.
2326         * Modules/indexeddb/IDBKeyPath.h:
2327         (WebCore::IDBKeyPath::isNull):
2328         * Modules/indexeddb/IDBObjectStore.cpp:
2329         (WebCore::IDBObjectStore::createIndex):
2330         * Modules/indexeddb/IDBObjectStore.h:
2331         * Modules/indexeddb/IDBObjectStore.idl:
2332
2333 2016-10-24  Sam Weinig  <sam@webkit.org>
2334
2335         [WebIDL] Move more types over to the new JSConverter based toJS functions
2336         https://bugs.webkit.org/show_bug.cgi?id=163920
2337
2338         Reviewed by Darin Adler.
2339
2340         - Adds WebIDL-extension type IDLDate, and use it for Date conversions.
2341         - Move JSDOMIterator over to using IDLType based conversions. Make them more
2342           explicit by adding a traits template argument which describes the iterator.
2343         - Add correct parsing for WebIDL iterable, parsing the parameter types into
2344           domTypes.
2345         - Support non-Optional nullable types via trait-like functions on IDLTypes.
2346
2347
2348         * bindings/generic/IDLTypes.h:
2349         (WebCore::IDLType::isNullValue):
2350         (WebCore::IDLType::extractValueFromNullable):
2351         (WebCore::IDLString::isNullValue):
2352         (WebCore::IDLString::extractValueFromNullable):
2353         (WebCore::IDLInterface::isNullValue):
2354         (WebCore::IDLInterface::extractValueFromNullable):
2355         (WebCore::IDLDate::isNullValue):
2356         (WebCore::IDLDate::extractValueFromNullable):
2357         Add isNullValue and extractValueFromNullable functions to allow non-Optional
2358         based nullable types.
2359         
2360         * Modules/plugins/QuickTimePluginReplacement.mm:
2361         (WebCore::QuickTimePluginReplacement::installReplacement):
2362         * bindings/js/IDBBindingUtilities.cpp:
2363         (WebCore::toJS):
2364         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2365         (WebCore::stylePropertyGetter):
2366         * bindings/js/JSCustomElementInterface.cpp:
2367         (WebCore::JSCustomElementInterface::invokeAttributeChangedCallback):
2368         Switch to IDLType based toJS.
2369
2370         * bindings/js/JSDOMBinding.cpp:
2371         (WebCore::jsStringOrNull): Deleted.
2372         (WebCore::jsDateOrNull): Deleted.
2373         * bindings/js/JSDOMBinding.h:
2374         (WebCore::jsPair): Deleted.
2375         (WebCore::toJSNullableString): Deleted.
2376         Remove now unusued toJS functions.
2377
2378         * bindings/js/JSDOMConvert.h:
2379         (WebCore::JSConverter<IDLNullable<T>>::convert):
2380         Use new functions to detect and extract nullable values.
2381
2382         (WebCore::Converter<IDLBufferSource>::convert):
2383         Moved to be with the other converters.
2384
2385         (WebCore::Converter<IDLDate>::convert):
2386         (WebCore::JSConverter<IDLDate>::convert):
2387         Added.
2388
2389         * bindings/js/JSDOMIterator.h:
2390         (WebCore::jsPair):
2391         (WebCore::iteratorCreate):
2392         (WebCore::IteratorTraits>::asJS):
2393         (WebCore::appendForEachArguments):
2394         (WebCore::iteratorForEach):
2395         (WebCore::IteratorTraits>::destroy):
2396         (WebCore::IteratorTraits>::next):
2397         (WebCore::IteratorTraits>::finishCreation):
2398         (WebCore::IteratorInspector::decltype): Deleted.
2399         (WebCore::IteratorInspector::test): Deleted.
2400         (WebCore::JSDOMIterator<JSWrapper>::asJS): Deleted.
2401         (WebCore::JSDOMIterator<JSWrapper>::destroy): Deleted.
2402         (WebCore::JSDOMIterator<JSWrapper>::next): Deleted.
2403         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next): Deleted.
2404         (WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation): Deleted.
2405         Switch to new Traits based model, and have the generated code pass in 
2406         the type (map or set) and key/value types. With the explicit types known,
2407         we can use the new toJS functions.
2408         
2409         Also, moved the jsPair functions here from JSDOMBinding.h, since this was
2410         the only place it was used.
2411
2412         * bindings/scripts/CodeGeneratorJS.pm:
2413         (GenerateImplementationIterableFunctions):
2414         Add iterator trait definition and update for new parameters to JSDOMIterator
2415         and JSDOMIteratorPrototype.
2416
2417         (GetBaseIDLType):
2418         Add IDLDate, and move IDLBufferSource up to the simple path.
2419
2420         (JSValueToNativeIsHandledByDOMConvert):
2421         Allow Date.
2422
2423         (JSValueToNative):
2424         Remove special case for Date.
2425
2426         (NativeToJSValueIsHandledByDOMConvert):
2427         Allow Date and remove restriction of nullable string-like types.
2428
2429         (NativeToJSValueDOMConvertNeedsState):
2430         Add Date to list of types needing state.
2431
2432         (NativeToJSValue):
2433         Remove special cases for Date and nullable-strings.
2434
2435         * bindings/scripts/IDLParser.pm:
2436         (parseOptionalIterableInterface):
2437         Add correct parsing of iterable.
2438
2439         * bindings/scripts/test/JS/JSTestIterable.cpp:
2440         * bindings/scripts/test/JS/JSTestNode.cpp:
2441         * bindings/scripts/test/JS/JSTestObj.cpp:
2442         Update test results.
2443
2444 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
2445
2446         [MediaStream] Add "has capture device" bit to media state flags
2447         https://bugs.webkit.org/show_bug.cgi?id=163952
2448
2449         Reviewed by Jer Noble.
2450
2451         No new tests, updated fast/mediastream/MediaStream-page-muted.html and media/muted-video-is-playing-audio.html.
2452
2453         * Modules/mediastream/MediaStream.cpp:
2454         (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
2455           actually producing data.
2456
2457         * page/MediaProducer.h: Add HasMediaCaptureDevice bit.
2458
2459         * testing/Internals.cpp:
2460         (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
2461         (WebCore::Internals::isPagePlayingAudio): Deleted.
2462         * testing/Internals.h:
2463         * testing/Internals.idl:
2464
2465 2016-10-25  Brady Eidson  <beidson@apple.com>
2466
2467         IndexedDB 2.0: Support new IDBTransaction interfaces.
2468         <rdar://problem/28806928> and https://bugs.webkit.org/show_bug.cgi?id=163927
2469
2470         Reviewed by Sam Weinig.
2471
2472         Tests: storage/indexeddb/modern/idbtransaction-objectstores-1-private.html
2473                storage/indexeddb/modern/idbtransaction-objectstores-1.html
2474                At least partially passing results on 5 previously failed W3C tests.
2475
2476         The "new IDBTransaction interfaces" really just means adding the property IDBTransaction.objectStoreNames.
2477
2478         * Modules/indexeddb/IDBTransaction.cpp:
2479         (WebCore::IDBTransaction::objectStoreNames):
2480         * Modules/indexeddb/IDBTransaction.h:
2481         * Modules/indexeddb/IDBTransaction.idl:
2482
2483 2016-10-25  Youenn Fablet  <youenn@apple.com>
2484
2485         MediaEndpointConfiguration does not need to be refcounted
2486         https://bugs.webkit.org/show_bug.cgi?id=163888
2487
2488         Reviewed by Eric Carlson.
2489
2490         No change of behavior.
2491
2492         Updating MediaEndpoint to take a MediaEndpointConfiguration&& instead of a RefPtr<MediaEndpointConfiguration>&&.
2493         This allows ensuring that the configuration is not null and removes the need to ref-count it.
2494
2495         Removing ref-counting from MediaEndpointConfiguration and its related IceServer that is now a struct.
2496         Updated MediaEndpointOwr and mock implementations accordingly.
2497
2498         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2499         (WebCore::MediaEndpointPeerConnection::setConfiguration):
2500         * platform/mediastream/MediaEndpoint.cpp:
2501         * platform/mediastream/MediaEndpoint.h:
2502         * platform/mediastream/MediaEndpointConfiguration.cpp:
2503         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
2504         * platform/mediastream/MediaEndpointConfiguration.h:
2505         (WebCore::MediaEndpointConfiguration::iceServers):
2506         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
2507         (WebCore::MediaEndpointOwr::setConfiguration):
2508         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
2509         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
2510         * platform/mock/MockMediaEndpoint.cpp:
2511         * platform/mock/MockMediaEndpoint.h:
2512
2513 2016-10-25  Youenn Fablet  <youenn@apple.com>
2514
2515         CachedResourceLoader should set headers of the HTTP request prior checking for the cache
2516         https://bugs.webkit.org/show_bug.cgi?id=163103
2517
2518         Reviewed by Darin Adler.
2519
2520         No expected change of behavior.
2521
2522         Moved referrer, user-agent, and origin headers setting to CachedResourceRequest/CachedResourceLoader before checking the cache.
2523         This allows simplifying vary header checks and is more inline with the fetch specification.
2524
2525         To compute the referrer value, we need to know whether the request is cross-origin.
2526         A helper function isRequestCrossOrigin is added for that purpose and is also used in CachedResource to set its initial response tainting.
2527
2528         We should disable setting user-agent and origin headers by FrameLoader for subresources since this is now done in CachedResourceLoader.
2529         This could be done as a follow-up patch.
2530
2531         * loader/cache/CachedResource.cpp:
2532         (WebCore::CachedResource::CachedResource):
2533         (WebCore::CachedResource::load):
2534         (WebCore::CachedResource::varyHeaderValuesMatch):
2535         (WebCore::addAdditionalRequestHeadersToRequest): Deleted.
2536         (WebCore::CachedResource::addAdditionalRequestHeaders): Deleted.
2537         * loader/cache/CachedResource.h:
2538         * loader/cache/CachedResourceLoader.cpp:
2539         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
2540         (WebCore::CachedResourceLoader::requestResource):
2541         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2542         * loader/cache/CachedResourceLoader.h:
2543         * loader/cache/CachedResourceRequest.cpp:
2544         (WebCore::CachedResourceRequest::updateForAccessControl):
2545         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
2546         (WebCore::isRequestCrossOrigin):
2547         * loader/cache/CachedResourceRequest.h:
2548         (WebCore::CachedResourceRequest::setOrigin):
2549
2550 2016-10-25  Andreas Kling  <akling@apple.com>
2551
2552         More PassRefPtr purging in WebCore.
2553         <https://webkit.org/b/163895>
2554
2555         Reviewed by Antti Koivisto.
2556
2557         Remove PassRefPtr usage in RenderStyle, RenderTheme and Scrollbar, then fix up all the fallout.
2558
2559         * css/CSSComputedStyleDeclaration.cpp:
2560         (WebCore::contentToCSSValue):
2561         (WebCore::shapePropertyValue):
2562         (WebCore::ComputedStyleExtractor::propertyValue):
2563         * css/StyleBuilderConverter.h:
2564         (WebCore::StyleBuilderConverter::convertQuotes):
2565         * html/HTMLSelectElement.cpp:
2566         (WebCore::HTMLSelectElement::usesMenuList):
2567         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
2568         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2569         * html/InputType.cpp:
2570         (WebCore::InputType::themeSupportsDataListUI):
2571         * html/TextFieldInputType.cpp:
2572         (WebCore::TextFieldInputType::shouldHaveSpinButton):
2573         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
2574         * loader/SubframeLoader.cpp:
2575         (WebCore::SubframeLoader::loadPlugin):
2576         * page/FrameView.cpp:
2577         (WebCore::FrameView::createScrollbar):
2578         * page/FrameView.h:
2579         * page/animation/CSSPropertyAnimation.cpp:
2580         (WebCore::RefCountedPropertyWrapper::RefCountedPropertyWrapper):
2581         (WebCore::PropertyWrapperClipPath::PropertyWrapperClipPath):
2582         (WebCore::PropertyWrapperShape::PropertyWrapperShape):
2583         (WebCore::StyleImagePropertyWrapper::StyleImagePropertyWrapper):
2584         (WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
2585         (WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
2586         * platform/PopupMenuClient.h:
2587         * platform/ScrollView.cpp:
2588         (WebCore::ScrollView::createScrollbar):
2589         * platform/ScrollView.h:
2590         * platform/Scrollbar.cpp:
2591         (WebCore::Scrollbar::createNativeScrollbar):
2592         * platform/Scrollbar.h:
2593         * rendering/FilterEffectRenderer.cpp:
2594         (WebCore::FilterEffectRenderer::buildReferenceFilter):
2595         * rendering/FilterEffectRenderer.h:
2596         * rendering/RenderLayer.cpp:
2597         (WebCore::RenderLayer::createScrollbar):
2598         (WebCore::RenderLayer::createLocalTransformState):
2599         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
2600         * rendering/RenderLayer.h:
2601         * rendering/RenderListBox.cpp:
2602         (WebCore::RenderListBox::createScrollbar):
2603         * rendering/RenderListBox.h:
2604         * rendering/RenderMenuList.cpp:
2605         (RenderMenuList::createScrollbar):
2606         * rendering/RenderMenuList.h:
2607         * rendering/RenderScrollbar.cpp:
2608         (WebCore::RenderScrollbar::createCustomScrollbar):
2609         * rendering/RenderScrollbar.h:
2610         * rendering/RenderSearchField.cpp:
2611         (WebCore::RenderSearchField::createScrollbar):
2612         * rendering/RenderSearchField.h:
2613         * rendering/RenderTheme.h:
2614         (WebCore::RenderTheme::defaultTheme):
2615         * rendering/RenderThemeEfl.cpp:
2616         (WebCore::RenderThemeEfl::create):
2617         (WebCore::RenderTheme::themeForPage):
2618         * rendering/RenderThemeEfl.h:
2619         * rendering/RenderThemeGtk.cpp:
2620         (WebCore::RenderTheme::themeForPage):
2621         * rendering/RenderThemeIOS.mm:
2622         (WebCore::RenderTheme::themeForPage):
2623         * rendering/RenderThemeMac.mm:
2624         (WebCore::RenderTheme::themeForPage):
2625         * rendering/RenderThemeWin.cpp:
2626         (WebCore::RenderTheme::themeForPage):
2627         * rendering/RenderWidget.cpp:
2628         (WebCore::RenderWidget::setWidget):
2629         * rendering/RenderWidget.h:
2630         * rendering/style/CursorData.h:
2631         (WebCore::CursorData::CursorData):
2632         (WebCore::CursorData::setImage):
2633         * rendering/style/FillLayer.h:
2634         (WebCore::FillLayer::setImage):
2635         * rendering/style/QuotesData.cpp:
2636         (WebCore::QuotesData::create):
2637         * rendering/style/QuotesData.h:
2638         * rendering/style/RenderStyle.cpp:
2639         (WebCore::RenderStyle::addCursor):
2640         (WebCore::RenderStyle::setCursorList):
2641         (WebCore::RenderStyle::setQuotes):
2642         (WebCore::RenderStyle::setWillChange):
2643         (WebCore::RenderStyle::setContent):
2644         (WebCore::RenderStyle::setListStyleImage):
2645         (WebCore::RenderStyle::setBorderImageSource):
2646         * rendering/style/RenderStyle.h:
2647         (WebCore::RenderStyle::setMaskImage):
2648         (WebCore::RenderStyle::setMaskBoxImageSource):
2649         (WebCore::RenderStyle::setBoxReflect):
2650         (WebCore::RenderStyle::setShapeOutside):
2651         (WebCore::RenderStyle::setClipPath):
2652         * rendering/style/StyleCachedImage.cpp:
2653         (WebCore::StyleCachedImage::cssValue):
2654         * rendering/style/StyleCachedImage.h:
2655         * rendering/style/StyleGeneratedImage.cpp:
2656         (WebCore::StyleGeneratedImage::cssValue):
2657         * rendering/style/StyleGeneratedImage.h:
2658         * rendering/style/StyleImage.h:
2659         * rendering/style/StyleMultiColData.h:
2660         * rendering/style/StyleRareInheritedData.h:
2661
2662 2016-10-24  Ryosuke Niwa  <rniwa@webkit.org>
2663
2664         Custom elements reactions should have a queue per element
2665         https://bugs.webkit.org/show_bug.cgi?id=163878
2666
2667         Reviewed by Antti Koivisto.
2668
2669         This patch splits the custom elements reaction queue into per element to match the latest HTML specifications:
2670         https://html.spec.whatwg.org/multipage/scripting.html#custom-element-reaction-queue
2671         and introduces the backup element queue:
2672         https://html.spec.whatwg.org/multipage/scripting.html#backup-element-queue
2673
2674         In terms of code changes, CustomElementReactionStack now holds onto ElementQueue, an ordered list of elements,
2675         and make each ElementRareData keep its own CustomElementReactionQueue. CustomElementReactionQueue is created
2676         for each custom element when it is synchronously constructed or enqueued to upgrade.
2677
2678         Because each reaction queue is now specific to each element, CustomElementReactionQueue instead of
2679         CustomElementReactionQueueItem stores JSCustomElementInterface.
2680
2681         The backup element queue is created as a singleton returned by CustomElementReactionStack's backupElementQueue,
2682         and ensureBackupQueue() schedules a new mirotask to process the backup queue when there isn't already one.
2683
2684         ensureCurrentQueue() now returns a reference to CustomElementReactionQueue instead of a pointer since it can
2685         fallback to the backup queue when the stack is empty as specified:
2686         https://html.spec.whatwg.org/multipage/scripting.html#enqueue-an-element-on-the-appropriate-element-queue
2687
2688         Note that ensureCurrentQueue() may insert the same element multiple times into the element queue for now since
2689         avoiding this duplication would require either doing O(n) iteration on m_elements or adding a HashSet.
2690         We can revisit this in the future if the reaction queue is found to grow beyond a few entries since elements in
2691         the element queue will have duplicates only when each reaction queue has more than one item.
2692
2693         Tests: fast/custom-elements/backup-element-queue.html
2694                fast/custom-elements/custom-element-reaction-queue.html
2695
2696         * bindings/js/JSCustomElementInterface.cpp:
2697         (WebCore::JSCustomElementInterface::upgradeElement):
2698         * dom/CustomElementReactionQueue.cpp:
2699         (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
2700         (WebCore::CustomElementReactionQueueItem::invoke): Removed the check for isFailedCustomElement since the queue
2701         is explicitly cleared in Element::setIsFailedCustomElement.
2702         (WebCore::CustomElementReactionQueue::CustomElementReactionQueue): Now takes JSCustomElementInterface since
2703         each item in the queue no longer stores Element or JSCustomElementInterface.
2704         (WebCore::CustomElementReactionQueue::clear):
2705         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
2706         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined):
2707         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
2708         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
2709         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
2710         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
2711         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
2712         (WebCore::CustomElementReactionQueue::invokeAll):
2713         (WebCore::CustomElementReactionStack::ElementQueue::add): Added.
2714         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Added.
2715         (WebCore::CustomElementReactionStack::ensureCurrentQueue):
2716         (WebCore::BackupElementQueueMicrotask): Added.
2717         (WebCore::CustomElementReactionStack::ensureBackupQueue): Added.
2718         (WebCore::CustomElementReactionStack::processBackupQueue): Added.
2719         (WebCore::CustomElementReactionStack::backupElementQueue): Added.
2720         * dom/CustomElementReactionQueue.h:
2721         * dom/CustomElementRegistry.cpp:
2722         (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
2723         * dom/Document.cpp:
2724         (WebCore::createFallbackHTMLElement):
2725         * dom/Element.cpp:
2726         (WebCore::Element::setIsDefinedCustomElement): Create a new reaction queue if there isn't already one; when
2727         this element had been upgraded, the reaction queue have already been created in Element::enqueueToUpgrade.
2728         (WebCore::Element::setIsFailedCustomElement): Clear the reaction queue when the upgrading had failed.
2729         (WebCore::Element::enqueueToUpgrade): Added.
2730         (WebCore::Element::reactionQueue): Added.
2731         * dom/Element.h:
2732         * dom/ElementRareData.h:
2733         (WebCore::ElementRareData::customElementReactionQueue): Replaced customElementInterface.
2734         (WebCore::ElementRareData::setCustomElementReactionQueue): Replaced setCustomElementReactionQueue.
2735
2736 2016-10-24  Jiewen Tan  <jiewen_tan@apple.com>
2737
2738         Update SubtleCrypto::generateKey to match the latest spec
2739         https://bugs.webkit.org/show_bug.cgi?id=163718
2740         <rdar://problem/28864380>
2741
2742         Reviewed by Chris Dumez.
2743
2744         This patch does following few things:
2745         1. It updates the SubtleCrypto::generateKey method to match the latest spec:
2746            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey.
2747            It also refers to the latest Editor's Draft at a certain degree:
2748            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-generateKey.
2749         2. It implements generateKey operations of following algorithms: AES-CBC, AES-KW,
2750            HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
2751         3. It replaces SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS with
2752         SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS_DEPRECATED for deprecated params.
2753         4. It fixes https://bugs.webkit.org/show_bug.cgi?id=129750 as well.
2754
2755         Tests: crypto/subtle/aes-cbc-generate-key-length-128.html
2756                crypto/subtle/aes-cbc-generate-key-length-192.html
2757                crypto/subtle/aes-cbc-generate-key-length-256.html
2758                crypto/subtle/aes-generate-key-malformed-parameters.html
2759                crypto/subtle/aes-kw-generate-key.html
2760                crypto/subtle/generate-key-malformed-paramters.html
2761                crypto/subtle/hmac-generate-key-customized-length.html
2762                crypto/subtle/hmac-generate-key-hash-object.html
2763                crypto/subtle/hmac-generate-key-malformed-parameters.html
2764                crypto/subtle/hmac-generate-key-sha1.html
2765                crypto/subtle/hmac-generate-key-sha224.html
2766                crypto/subtle/hmac-generate-key-sha256.html
2767                crypto/subtle/hmac-generate-key-sha384.html
2768                crypto/subtle/hmac-generate-key-sha512.html
2769                crypto/subtle/rsa-generate-key-malformed-parameters.html
2770                crypto/subtle/rsa-oaep-generate-key.html
2771                crypto/subtle/rsaes-pkcs1-v1_5-generate-key-extractable.html
2772                crypto/subtle/rsaes-pkcs1-v1_5-generate-key.html
2773                crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html
2774                crypto/webkitSubtle/hmac-generate-key.html:
2775                crypto/workers/subtle/aes-generate-key.html
2776                crypto/workers/subtle/hmac-generate-key.html
2777                crypto/workers/subtle/rsa-generate-key.html
2778
2779         * CMakeLists.txt:
2780         * DerivedSources.make:
2781         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2782         * WebCore.xcodeproj/project.pbxproj:
2783         * bindings/js/JSSubtleCryptoCustom.cpp: Added.
2784         (WebCore::toHashIdentifier):
2785         (WebCore::normalizeCryptoAlgorithmParameters):
2786         (WebCore::cryptoKeyUsagesFromJSValue):
2787         (WebCore::createAlgorithm):
2788         (WebCore::rejectWithException):
2789         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
2790         (WebCore::JSSubtleCrypto::generateKey):
2791         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2792         (WebCore::JSWebKitSubtleCrypto::generateKey):
2793         * crypto/CryptoAlgorithm.cpp:
2794         (WebCore::CryptoAlgorithm::generateKey):
2795         * crypto/CryptoAlgorithm.h:
2796         * crypto/CryptoAlgorithmParameters.h: Added.
2797         (WebCore::CryptoAlgorithmParameters::CryptoAlgorithmParameters):
2798         (WebCore::CryptoAlgorithmParameters::~CryptoAlgorithmParameters):
2799         (WebCore::CryptoAlgorithmParameters::parametersClass):
2800         * crypto/CryptoAlgorithmParameters.idl: Added.
2801         * crypto/CryptoAlgorithmParametersDeprecated.h:
2802         * crypto/CryptoKey.cpp:
2803         (WebCore::CryptoKey::setUsagesBitmap):
2804         * crypto/CryptoKey.h:
2805         * crypto/CryptoKeyPair.idl:
2806         * crypto/SubtleCrypto.idl:
2807         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
2808         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
2809         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
2810         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
2811         (WebCore::CryptoAlgorithmAES_KW::generateKey):
2812         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
2813         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
2814         (WebCore::CryptoAlgorithmHMAC::generateKey):
2815         * crypto/algorithms/CryptoAlgorithmHMAC.h:
2816         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
2817         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
2818         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
2819         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
2820         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
2821         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
2822         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
2823         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
2824         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
2825         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
2826         (WebCore::CryptoKeyRSA::generatePair):
2827         * crypto/keys/CryptoKeyAES.cpp:
2828         (WebCore::CryptoKeyAES::generate):
2829         * crypto/keys/CryptoKeyHMAC.cpp:
2830         (WebCore::CryptoKeyHMAC::generate):
2831         * crypto/keys/CryptoKeyRSA.h:
2832         * crypto/mac/CryptoKeyRSAMac.cpp:
2833         (WebCore::CryptoKeyRSA::generatePair):
2834         * crypto/parameters/AesKeyGenParams.idl: Added.
2835         * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
2836         * crypto/parameters/CryptoAlgorithmAesKeyGenParams.h: Added.
2837         * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h:
2838         * crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h: Added.
2839         * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h:
2840         * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h:
2841         * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: Added.
2842         * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: Added.
2843         (WebCore::CryptoAlgorithmRsaKeyGenParams::arrayToVector):
2844         * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h:
2845         * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h:
2846         * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h:
2847         * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h:
2848         * crypto/parameters/HmacKeyGenParams.idl: Added.
2849         * crypto/parameters/RsaHashedKeyGenParams.idl: Added.
2850         * crypto/parameters/RsaKeyGenParams.idl: Added.
2851
2852 2016-10-24  Chris Dumez  <cdumez@apple.com>
2853
2854         IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
2855         https://bugs.webkit.org/show_bug.cgi?id=163916
2856
2857         Reviewed by Darin Adler.
2858
2859         IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter:
2860         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
2861         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters
2862
2863         Align our IDL with the specification.
2864
2865         No new tests, no expected Web-exposed behavior change.
2866
2867         * Modules/indexeddb/IDBDatabase.cpp:
2868         (WebCore::IDBDatabase::createObjectStore):
2869         * Modules/indexeddb/IDBDatabase.h:
2870         * Modules/indexeddb/IDBDatabase.idl:
2871         * Modules/indexeddb/IDBKeyPath.cpp:
2872         (WebCore::IDBKeyPath::IDBKeyPath):
2873         * Modules/indexeddb/IDBKeyPath.h:
2874         * WebCore.xcodeproj/project.pbxproj:
2875         * bindings/js/IDBBindingUtilities.cpp:
2876         (WebCore::idbKeyPathFromValue): Deleted.
2877         * bindings/js/IDBBindingUtilities.h:
2878         * bindings/js/JSIDBDatabaseCustom.cpp: Removed.
2879         * bindings/scripts/CodeGeneratorJS.pm:
2880         (GenerateParametersCheck):
2881         (GenerateConstructorDefinition):
2882         * dom/MessageEvent.cpp:
2883         (WebCore::MessageEvent::MessageEvent):
2884         (WebCore::MessageEvent::create):
2885         * dom/MessageEvent.h:
2886         * testing/TypeConversions.h:
2887         (WebCore::TypeConversions::setTypeConversionsDictionary):
2888
2889 2016-10-24  Alex Christensen  <achristensen@webkit.org>
2890
2891         URLParser should match old URL::parse with %2E in path
2892         https://bugs.webkit.org/show_bug.cgi?id=163929
2893
2894         Reviewed by Alexey Proskuryakov.
2895
2896         Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
2897         Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
2898         If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
2899
2900         * platform/URLParser.cpp:
2901         (WebCore::URLParser::isSingleDotPathSegment):
2902         (WebCore::URLParser::isDoubleDotPathSegment):
2903         (WebCore::URLParser::consumeSingleDotPathSegment):
2904         (WebCore::URLParser::consumeDoubleDotPathSegment):
2905         (WebCore::URLParser::parse):
2906         (WebCore::URLParser::isPercentEncodedDot): Deleted.
2907
2908 2016-10-24  Zalan Bujtas  <zalan@apple.com>
2909
2910         Do not update selection rect on dirty lineboxes.
2911         https://bugs.webkit.org/show_bug.cgi?id=163862
2912         <rdar://problem/28813156>
2913
2914         Reviewed by Simon Fraser.
2915
2916         In certain cases RenderBlock::updateFirstLetter() triggers
2917         unwanted render tree mutation while the caller assumes intact renderers.
2918         This patch ensures that no renderers gets destroyed while computing the preferred widths
2919         when we are outside of layout context.
2920
2921         Test: fast/css-generated-content/dynamic-first-letter-selection-clear-crash.html
2922
2923         * rendering/RenderBlock.cpp:
2924         (WebCore::RenderBlock::computePreferredLogicalWidths):
2925         (WebCore::RenderBlock::updateFirstLetter):
2926         * rendering/RenderBlock.h:
2927         * rendering/RenderListItem.cpp:
2928         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
2929         * rendering/RenderRubyRun.cpp:
2930         (WebCore::RenderRubyRun::updateFirstLetter):
2931         * rendering/RenderRubyRun.h:
2932         * rendering/RenderTable.cpp:
2933         (WebCore::RenderTable::updateFirstLetter):
2934         * rendering/RenderTable.h:
2935         * rendering/svg/RenderSVGText.cpp:
2936         (WebCore::RenderSVGText::updateFirstLetter):
2937         * rendering/svg/RenderSVGText.h:
2938
2939 2016-10-24  Ryan Haddad  <ryanhaddad@apple.com>
2940
2941         Unreviewed, rolling out r207795.
2942
2943         Introduced API test failures on iOS and macOS.
2944
2945         Reverted changeset:
2946
2947         "URLParser should match old URL::parse with %2E in path"
2948         https://bugs.webkit.org/show_bug.cgi?id=163929
2949         http://trac.webkit.org/changeset/207795
2950
2951 2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2952
2953         Unreviewed, attempt to fix Windows build after r207787
2954         https://bugs.webkit.org/show_bug.cgi?id=163657
2955
2956         Make the constructor public in DOMJIT::AbstractHeapRepository to make Windows bot green.
2957         It's a bit unfortunate that we need to introduce a workaround here.
2958
2959         * domjit/DOMJITAbstractHeapRepository.h:
2960
2961 2016-10-24  Chris Dumez  <cdumez@apple.com>
2962
2963         event.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop)
2964         https://bugs.webkit.org/show_bug.cgi?id=19893
2965         <rdar://problem/6055546>
2966
2967         Reviewed by Ryosuke Niwa.
2968
2969         We now write selection as HTML as well to the pasteboard so that
2970         event.(dataTransfer|clipboardData).getData('text/html') now works.
2971
2972         I have verified manually that it is still possible to copy text from
2973         Safari and paste it to Excel 2011 Mac after this change. The text is
2974         now pasted as HTML instead of text, which is fine because Excel can
2975         display HTML.
2976
2977         No new tests, unskipped existing tests.
2978
2979         * editing/Editor.h:
2980         * editing/mac/EditorMac.mm:
2981         (WebCore::Editor::selectionInHTMLFormat):
2982         (WebCore::Editor::writeSelectionToPasteboard):
2983         * platform/Pasteboard.h:
2984         * platform/mac/PasteboardMac.mm:
2985         (WebCore::Pasteboard::write):
2986
2987 2016-10-24  Alex Christensen  <achristensen@webkit.org>
2988
2989         URLParser should match old URL::parse with %2E in path
2990         https://bugs.webkit.org/show_bug.cgi?id=163929
2991
2992         Reviewed by Alexey Proskuryakov.
2993
2994         Covered by updated API tests, which show that URLParser now matches URL::parse in these cases.
2995         Also covered by newly failing web platform tests, which were failing before URLParser was enabled.
2996         If https://github.com/whatwg/url/issues/87 is resolved we can change behavior to match.
2997
2998         * platform/URLParser.cpp:
2999         (WebCore::URLParser::isSingleDotPathSegment):
3000         (WebCore::URLParser::isDoubleDotPathSegment):
3001         (WebCore::URLParser::consumeSingleDotPathSegment):
3002         (WebCore::URLParser::consumeDoubleDotPathSegment):
3003         (WebCore::URLParser::parse):
3004         (WebCore::URLParser::isPercentEncodedDot): Deleted.
3005
3006 2016-10-24  Per Arne Vollan  <pvollan@apple.com>
3007
3008         [Win] CMake build type is not set.
3009         https://bugs.webkit.org/show_bug.cgi?id=163917
3010
3011         Reviewed by Alex Christensen.
3012
3013         The CMAKE_BUILD_TYPE variable should be set to Debug or Release.
3014
3015         * WebCore.vcxproj/WebCore.proj:
3016
3017 2016-10-24  Yusuke Suzuki  <utatane.tea@gmail.com>
3018
3019         Unreviewed, attempt to fix Windows build after r207787
3020         https://bugs.webkit.org/show_bug.cgi?id=163657
3021
3022         According to the similar code in WebKit, I guess that
3023         Visual C++ requires friend class declaration is done
3024         in the private section to access private members.
3025
3026         And I also changed ::instance to ::shared to align to
3027         the existing WebCore code.
3028
3029         * domjit/DOMJITAbstractHeapRepository.cpp:
3030         (WebCore::DOMJIT::AbstractHeapRepository::shared):
3031         (WebCore::DOMJIT::AbstractHeapRepository::instance): Deleted.
3032         * domjit/DOMJITAbstractHeapRepository.h:
3033         * domjit/JSNodeDOMJIT.cpp:
3034         (WebCore::NodeFirstChildDOMJIT::callDOM):
3035         (WebCore::NodeLastChildDOMJIT::callDOM):
3036         (WebCore::NodeNextSiblingDOMJIT::callDOM):
3037         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
3038         (WebCore::NodeParentNodeDOMJIT::callDOM):
3039
3040 2016-10-24  Simon Fraser  <simon.fraser@apple.com>
3041
3042         Fix the lifetime of strings used in LOG_WITH_STREAM
3043         https://bugs.webkit.org/show_bug.cgi?id=163923
3044
3045         Reviewed by Brent Fulgham.
3046
3047         Make sure the const char* passed to WTFLog() outlives the call.
3048
3049         Removed logFunctionResult which wasn't used anywhere else, and encourages this bad
3050         pattern.
3051
3052         * platform/LogMacros.h:
3053         * platform/Logging.cpp:
3054         (WebCore::logFunctionResult): Deleted.
3055
3056 2016-10-24  Chris Dumez  <cdumez@apple.com>
3057
3058         Reduce special handling for typed arrays in JSDOMConvert.h
3059         https://bugs.webkit.org/show_bug.cgi?id=163907
3060
3061         Reviewed by Sam Weinig.
3062
3063         Reduce special handling for typed arrays in JSDOMConvert.h by adding a toWrapped() static
3064         function on JSGenericTypedArrayView, similarly to other wrapper types.
3065
3066         No new tests, no web-exposed behavior change.
3067
3068         * bindings/js/JSDOMConvert.h:
3069         (WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert): Deleted.
3070
3071 2016-10-24  Ryan Haddad  <ryanhaddad@apple.com>
3072
3073         Unreviewed, rolling out r207783.
3074
3075         This change appears to have caused fast/selectors/invalid-
3076         functional-pseudo-class.html to crash on iOS and macOS
3077
3078         Reverted changeset:
3079
3080         "[CSS Parser] Fix :lang argument parsing"
3081         https://bugs.webkit.org/show_bug.cgi?id=163913
3082         http://trac.webkit.org/changeset/207783
3083
3084 2016-10-24  Brady Eidson  <beidson@apple.com>
3085
3086         IndexedDB 2.0: Support new IDBKeyRange interfaces.
3087         <rdar://problem/28806929> and https://bugs.webkit.org/show_bug.cgi?id=163910
3088
3089         Reviewed by Andy Estes.
3090
3091         No new tests (Covered by additions to existing test)
3092
3093         The "new IDBKeyRanges interfaces" really just means adding the instance method IDBKeyRange.contains.
3094
3095         * Modules/indexeddb/IDBKeyRange.cpp:
3096         (WebCore::IDBKeyRange::contains):
3097         * Modules/indexeddb/IDBKeyRange.h:
3098         * Modules/indexeddb/IDBKeyRange.idl:
3099
3100 2016-10-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3101
3102         [DOMJIT] Add a way for DOMJIT::Patchpoint to express effects
3103         https://bugs.webkit.org/show_bug.cgi?id=163657
3104
3105         Reviewed by Saam Barati.
3106
3107         CallDOMPatchpoint now has the way to tell its effects to DFG and FTL compilers.
3108         WebCore DOMJIT::AbstractHeapRepository will construct the hierarchy of the abstract
3109         heap. And then it encodes these information into the pairs of the integers.
3110
3111         And this patch also changes the DOMJIT::PatchpointParams' parameter order.
3112         So we change them in all the DOMJIT::CallDOMPatchpoint sites.
3113
3114         * CMakeLists.txt:
3115         * ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
3116         * ForwardingHeaders/domjit/DOMJITEffect.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
3117         * ForwardingHeaders/domjit/DOMJITHeapRange.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
3118         * WebCore.xcodeproj/project.pbxproj:
3119         * domjit/DOMJITAbstractHeapRepository.cpp: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
3120         (WebCore::DOMJIT::AbstractHeapRepository::AbstractHeapRepository):
3121         (WebCore::DOMJIT::AbstractHeapRepository::instance):
3122         * domjit/DOMJITAbstractHeapRepository.h: Copied from Source/JavaScriptCore/domjit/DOMJITCallDOMPatchpoint.h.
3123         * domjit/DOMJITHelpers.h:
3124         (WebCore::DOMJITHelpers::branchIfNotWorldIsNormal): Deleted.
3125         (WebCore::DOMJITHelpers::branchIfNotWeakIsLive): Deleted.
3126         (WebCore::DOMJITHelpers::tryLookUpWrapperCache): Deleted.
3127         (WebCore::DOMJITHelpers::toWrapper): Deleted.
3128         (WebCore::DOMJITHelpers::branchIfDOMWrapper): Deleted.
3129         (WebCore::DOMJITHelpers::branchIfNotDOMWrapper): Deleted.
3130         (WebCore::DOMJITHelpers::branchIfNode): Deleted.
3131         (WebCore::DOMJITHelpers::branchIfNotNode): Deleted.
3132         (WebCore::DOMJITHelpers::branchIfElement): Deleted.
3133         (WebCore::DOMJITHelpers::branchIfNotElement): Deleted.
3134         (WebCore::DOMJITHelpers::branchIfDocumentWrapper): Deleted.
3135         (WebCore::DOMJITHelpers::branchIfNotDocumentWrapper): Deleted.
3136         * domjit/JSNodeDOMJIT.cpp:
3137         (WebCore::createCallDOMForOffsetAccess):
3138         (WebCore::checkNode):
3139         (WebCore::NodeFirstChildDOMJIT::checkDOM):
3140         (WebCore::NodeFirstChildDOMJIT::callDOM):
3141         (WebCore::NodeLastChildDOMJIT::checkDOM):
3142         (WebCore::NodeLastChildDOMJIT::callDOM):
3143         (WebCore::NodeNextSiblingDOMJIT::checkDOM):
3144         (WebCore::NodeNextSiblingDOMJIT::callDOM):
3145         (WebCore::NodePreviousSiblingDOMJIT::checkDOM):
3146         (WebCore::NodePreviousSiblingDOMJIT::callDOM):
3147         (WebCore::NodeParentNodeDOMJIT::checkDOM):
3148         (WebCore::NodeParentNodeDOMJIT::callDOM):
3149         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
3150         (WebCore::NodeNodeTypeDOMJIT::callDOM):
3151
3152 2016-10-24  Dave Hyatt  <hyatt@apple.com>
3153
3154         [CSS Parser] Fix :lang argument parsing
3155         https://bugs.webkit.org/show_bug.cgi?id=163913
3156
3157         Reviewed by Zalan Bujtas.
3158
3159         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
3160         Modify the map to support versions of the function pseudos
3161         without the left paren included.
3162
3163         * css/parser/CSSParserValues.cpp:
3164         (WebCore::CSSParserSelector::setLangArgumentList):
3165         * css/parser/CSSParserValues.h:
3166         Add a helper to just directly pass an AtomicString Vector through.
3167
3168         * css/parser/CSSSelectorParser.cpp:
3169         (WebCore::consumeLangArgumentList):
3170         (WebCore::CSSSelectorParser::consumePseudo):
3171         Add a new consumeLangArgumentList to collect the languages into
3172         an AtomicString Vector.
3173
3174 2016-10-24  Alex Christensen  <achristensen@webkit.org>
3175
3176         Fix AppleWin build after r207720.
3177
3178         * html/canvas/OESVertexArrayObject.cpp:
3179
3180 2016-10-24  Alex Christensen  <achristensen@webkit.org>
3181
3182         Fix AppleWin build after r207720.
3183
3184         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
3185
3186 2016-10-24  Alex Christensen  <achristensen@webkit.org>
3187
3188         Fix Windows build after r207767 and r207769
3189
3190         * css/CSSAllInOne.cpp:
3191         * platform/network/curl/ResourceHandleManager.cpp:
3192         (WebCore::getProtectionSpace):
3193
3194 2016-10-24  Per Arne Vollan  <pvollan@apple.com>
3195
3196         [Win] AVCF based media engine does not block cross-site/cross-domain loads.
3197         https://bugs.webkit.org/show_bug.cgi?id=163783
3198
3199         Reviewed by Brent Fulgham.
3200
3201         Prevent cross-site/cross-domain loads by setting appropriate AVCF options.
3202
3203         No new tests; covered by media/video-canvas-source.html. Media tests are
3204         currently skipped on Windows.
3205
3206         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
3207         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3208         (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL):
3209         (WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
3210         (WebCore::AVFWrapper::createAssetForURL):
3211         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
3212
3213 2016-10-24  Anders Carlsson  <andersca@apple.com>
3214
3215         Fix build with newer versions of clang
3216         https://bugs.webkit.org/show_bug.cgi?id=163908
3217         rdar://problem/28852016
3218
3219         Reviewed by Tim Horton.
3220
3221         Use the macros that names the soft-linked functions in such a way that they won't conflict with actual functions.
3222
3223         * platform/ios/PlatformScreenIOS.mm:
3224         (WebCore::screenIsMonochrome):
3225         (WebCore::screenHasInvertedColors):
3226         (WebCore::screenSize):
3227         (WebCore::availableScreenSize):
3228         (WebCore::screenScaleFactor):
3229
3230 2016-10-24  Joseph Pecoraro  <pecoraro@apple.com>
3231
3232         Remove unnecessary unused variable stubs
3233         https://bugs.webkit.org/show_bug.cgi?id=163688
3234
3235         Reviewed by Simon Fraser.
3236
3237         * Modules/applepay/cocoa/PaymentCocoa.mm:
3238         (WebCore::toDictionary):
3239         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3240         (WebCore::toDictionary):
3241
3242 2016-10-24  Alex Christensen  <achristensen@webkit.org>
3243
3244         Try to fix Windows build after r207767
3245         https://bugs.webkit.org/show_bug.cgi?id=163891
3246
3247         * DerivedSources.cpp:
3248
3249 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
3250
3251         [CodeGenerator] Only allow a single interface or standalone dictionary per WebIDL file
3252         https://bugs.webkit.org/show_bug.cgi?id=163889
3253
3254         Reviewed by Chris Dumez.
3255
3256         Assert that there's only one interface or standalone dictionary
3257         per WebIDL input file, and exit from the generator otherwise.
3258
3259         This avoids potential linking issues where multiple enumeration
3260         and dictionary bindings code can be generated if the source
3261         WebIDL for them is specified in a file that contains multiple
3262         interfaces or standalone dictionaries.
3263
3264         Additionally, the generator now also exits if it fails to
3265         generate code for any interface of standalone dictionary. This
3266         should avoid processing WebIDL files that are empty in
3267         substance.
3268
3269         TestException.idl and TestInterface.idl files have their second
3270         interfaces removed. In place of those a new testing IDL file is
3271         added, TestInterfaceLeadingUnderscore.idl. Like the two removed
3272         interfaces, it tests that the leading underscode in the
3273         identifier is removed by the generator.
3274
3275         * bindings/scripts/CodeGenerator.pm:
3276         (ProcessDocument):
3277         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: Added.
3278         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::create):
3279         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::createStructure):
3280         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
3281         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::prototypeForStructure):
3282         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
3283         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
3284         (WebCore::JSTestInterfaceLeadingUnderscore::JSTestInterfaceLeadingUnderscore):
3285         (WebCore::JSTestInterfaceLeadingUnderscore::createPrototype):
3286         (WebCore::JSTestInterfaceLeadingUnderscore::prototype):
3287         (WebCore::JSTestInterfaceLeadingUnderscore::destroy):
3288         (WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
3289         (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
3290         (WebCore::jsTestInterfaceLeadingUnderscoreReadonlyGetter):
3291         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
3292         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
3293         (WebCore::JSTestInterfaceLeadingUnderscore::getConstructor):
3294         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
3295         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::finalize):
3296         (WebCore::toJSNewlyCreated):
3297         (WebCore::toJS):
3298         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
3299         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: Renamed from Source/WebCore/bindings/scripts/test/JS/JSreadonly.h.
3300         (WebCore::JSTestInterfaceLeadingUnderscore::create):
3301         (WebCore::JSTestInterfaceLeadingUnderscore::createStructure):
3302         (WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
3303         (WebCore::wrapperOwner):
3304         (WebCore::wrapperKey):
3305         (WebCore::toJS):
3306         (WebCore::toJSNewlyCreated):
3307         * bindings/scripts/test/JS/JSattribute.cpp: Removed.
3308         * bindings/scripts/test/JS/JSattribute.h: Removed.
3309         * bindings/scripts/test/JS/JSreadonly.cpp: Removed.
3310         * bindings/scripts/test/TestException.idl:
3311         * bindings/scripts/test/TestInterface.idl:
3312         * bindings/scripts/test/TestInterfaceLeadingUnderscore.idl: Copied from Source/WebCore/bindings/scripts/test/TestException.idl.
3313
3314 2016-10-21  Alex Christensen  <achristensen@webkit.org>
3315
3316         URL::port should return Optional<uint16_t>
3317         https://bugs.webkit.org/show_bug.cgi?id=163806
3318
3319         Reviewed by Darin Adler.
3320
3321         A URL without a port is different than a URL with port 0.
3322         This matches the spec, Chrome, and Firefox.
3323
3324         Covered by newly-passing web platform tests.
3325
3326         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3327         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
3328         (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
3329         (WebCore::IDBDatabaseIdentifier::hash):
3330         (WebCore::IDBDatabaseIdentifier::isValid):
3331         (WebCore::IDBDatabaseIdentifier::isEmpty):
3332         * Modules/websockets/WebSocket.cpp:
3333         (WebCore::WebSocket::connect):
3334         * Modules/websockets/WebSocketHandshake.cpp:
3335         (WebCore::hostName):
3336         * contentextensions/ContentExtensionsBackend.cpp:
3337         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
3338         (WebCore::ContentExtensions::applyBlockedStatusToRequest):
3339         * html/HTMLPlugInImageElement.cpp:
3340         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
3341         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
3342         * html/URLUtils.h:
3343         (WebCore::URLUtils<T>::protocol):
3344         (WebCore::URLUtils<T>::host):
3345         (WebCore::URLUtils<T>::port):
3346         * loader/CrossOriginAccessControl.cpp:
3347         (WebCore::isValidCrossOriginRedirectionURL):
3348         * loader/DocumentLoader.cpp:
3349         (WebCore::DocumentLoader::responseReceived):
3350         (WebCore::isRemoteWebArchive):
3351         (WebCore::DocumentLoader::maybeLoadEmpty):
3352         * loader/DocumentThreadableLoader.cpp:
3353         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
3354         * loader/ResourceLoader.cpp:
3355         (WebCore::ResourceLoader::didReceiveResponse):
3356         * loader/cache/CachedResource.cpp:
3357         (WebCore::shouldCacheSchemeIndefinitely):
3358         (WebCore::CachedResource::freshnessLifetime):
3359         * page/Location.cpp:
3360         (WebCore::Location::protocol):
3361         (WebCore::Location::host):
3362         (WebCore::Location::port):
3363         * page/Page.cpp:
3364         (WebCore::Page::userStyleSheetLocationChanged):
3365         * page/SecurityOrigin.cpp:
3366         (WebCore::shouldTreatAsUniqueOrigin):
3367         (WebCore::SecurityOrigin::SecurityOrigin):
3368         (WebCore::SecurityOrigin::isSecure):
3369         (WebCore::SecurityOrigin::canDisplay):
3370         (WebCore::SecurityOrigin::toRawString):
3371         (WebCore::SecurityOrigin::create):
3372         (WebCore::SecurityOrigin::databaseIdentifier):
3373         * page/SecurityOrigin.h:
3374         (WebCore::SecurityOrigin::port):
3375         * page/SecurityOriginData.cpp:
3376         (WebCore::SecurityOriginData::debugString):
3377         * page/SecurityOriginData.h:
3378         (): Deleted.
3379         * page/SecurityOriginHash.h:
3380         (WebCore::SecurityOriginHash::hash):
3381         * page/csp/ContentSecurityPolicy.cpp:
3382         (WebCore::ContentSecurityPolicy::allowObjectFromSource):
3383         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
3384         (WebCore::ContentSecurityPolicy::allowResourceFromSource):
3385         (WebCore::ContentSecurityPolicy::allowConnectToSource):
3386         (WebCore::ContentSecurityPolicy::allowBaseURI):
3387         (WebCore::stripURLForUseInReport):
3388         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded):
3389         * page/csp/ContentSecurityPolicySource.cpp:
3390         (WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
3391         (WebCore::ContentSecurityPolicySource::portMatches):
3392         * page/csp/ContentSecurityPolicySource.h:
3393         * page/csp/ContentSecurityPolicySourceList.cpp:
3394         (WebCore::ContentSecurityPolicySourceList::parse):
3395         (WebCore::ContentSecurityPolicySourceList::parseSource):
3396         (WebCore::ContentSecurityPolicySourceList::parsePort):
3397         * page/csp/ContentSecurityPolicySourceList.h:
3398         * platform/SchemeRegistry.h:
3399         * platform/URL.cpp:
3400         (WebCore::URL::protocol):
3401         (WebCore::URL::port):
3402         (WebCore::URL::serialize):
3403         (WebCore::portAllowed):
3404         (WebCore::defaultPortsMap): Deleted.
3405         (WebCore::defaultPortForProtocol): Deleted.
3406         (WebCore::isDefaultPortForProtocol): Deleted.
3407         * platform/URL.h:
3408         (WebCore::URL::hasPort): Deleted.
3409         * platform/URLParser.cpp:
3410         (WebCore::defaultPortForProtocol):
3411         (WebCore::isDefaultPortForProtocol):
3412         (WebCore::URLParser::parsePort):
3413         (WebCore::isDefaultPort): Deleted.
3414         * platform/network/CredentialStorage.cpp:
3415         (WebCore::originStringFromURL):
3416         * platform/network/ResourceHandle.cpp:
3417         (WebCore::ResourceHandle::create):
3418         (WebCore::ResourceHandle::loadResourceSynchronously):
3419         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3420         (WebCore::SocketStreamHandleImpl::platformClose):
3421         (WebCore::SocketStreamHandleImpl::port):
3422         * workers/WorkerLocation.cpp:
3423         (WebCore::WorkerLocation::protocol):
3424         (WebCore::WorkerLocation::host):
3425         (WebCore::WorkerLocation::port):
3426
3427 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
3428
3429         [CodeGeneratorJS] Support enums for standalone dictionaries
3430         https://bugs.webkit.org/show_bug.cgi?id=163885
3431
3432         Reviewed by Youenn Fablet.
3433
3434         Add support for enumerations in WebIDL files that specify
3435         standalone dictionaries. Implementation of this is pretty
3436         straight-forward and mirrors interface and callback generators
3437         by calling GenerateEnumerations{Header,Implementation}Content()
3438         functions in GenerateDictionary{Header,Implementation}().
3439
3440         In GenerateEnumerationsImplementationContent(), the
3441         NeverDestroyed.h header is added to the implementation includes
3442         since that class is used to hold an array of possible enum
3443         values.
3444
3445         A test enum is added to the TestStandaloneDictionary.idl file
3446         and the baselines are updated to reflect the new capability.
3447
3448         * bindings/scripts/CodeGenerator.pm:
3449         (ProcessDocument):
3450         * bindings/scripts/CodeGeneratorJS.pm:
3451         (GenerateDictionary):
3452         (GenerateEnumerationsImplementationContent):
3453         (GenerateDictionaryHeader):
3454         (GenerateDictionaryImplementation):
3455         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3456         (WebCore::convertEnumerationToJS):
3457         (WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
3458         (WebCore::convertEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
3459         (WebCore::expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
3460         (WebCore::convertDictionary<DictionaryImplName>):
3461         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
3462         * bindings/scripts/test/TestStandaloneDictionary.idl:
3463
3464 2016-10-24  Dave Hyatt  <hyatt@apple.com>
3465
3466         Remove CSSCharsetRule from the CSS OM
3467         https://bugs.webkit.org/show_bug.cgi?id=163891
3468
3469         Reviewed by Darin Adler.
3470
3471         Remove CSSCharsetRule from the CSS OM. All other browser engines have made this
3472         change. This eliminates the weird overloading of isCharsetRule to match both
3473         CSSCharsetRule and StyleRuleCharset (only used by the new parser).
3474
3475         Fix the destroy() method in StyleRuleBase to clean up StyleRuleCharsets created
3476         by the new parser properly.
3477
3478         * CMakeLists.txt:
3479         * DerivedSources.make:
3480         * WebCore.xcodeproj/project.pbxproj:
3481         * bindings/js/JSCSSRuleCustom.cpp:
3482         (WebCore::toJSNewlyCreated):
3483         * css/CSSCharsetRule.cpp: Removed.
3484         * css/CSSCharsetRule.h: Removed.
3485         * css/CSSCharsetRule.idl: Removed.
3486         * css/CSSPropertySourceData.h:
3487         * css/CSSStyleSheet.cpp:
3488         (WebCore::CSSStyleSheet::item):
3489         (WebCore::CSSStyleSheet::rules):
3490         * css/CSSStyleSheet.h:
3491         * css/StyleRule.cpp:
3492         (WebCore::StyleRuleBase::destroy):
3493         * inspector/InspectorStyleSheet.cpp:
3494         (WebCore::asCSSRuleList):
3495
3496 2016-10-24  Zan Dobersek  <zdobersek@igalia.com>
3497
3498         [CodeGeneratorJS] Standalone dictionaries have misplaced build guards
3499         https://bugs.webkit.org/show_bug.cgi?id=163881
3500
3501         Reviewed by Chris Dumez.
3502
3503         Build guards that are generated from the Conditional attribute
3504         on WebIDL dictionary declarations properly guard the relevant
3505         convertDictionary() functions for WebIDL files that also specify
3506         interfaces. But for standalone dictionaries these build guards
3507         should guard the complete header and implementation files, much
3508         like this is done for files that originate from interfaces or
3509         callbacks.
3510
3511         Before this patch, guarding a standalone dictionary resulted in
3512         malformed output because GenerateHeaderContentHeader() and
3513         GenerateImplementationContentHeader() functions both generated
3514         the #if macro that would guard the whole file, but
3515         GenerateDictionary{Header,Implementation}() didn't generate the
3516         closing #endif.
3517
3518         CodeGeneratorJS.pm now passes the conditional string, if any,
3519         to GenerateDictionary{Header,Implementation}Content() functions
3520         in case of a non-standalone dictionary. Otherwise, the
3521         conditional string, if any, is used to guard the complete
3522         header and implementation files.
3523
3524         Generator tests are updated to cover various build guard
3525         combinations on dictionaries in TestObj.idl, and the standalone
3526         dictionary WebIDL file now has a Conditional attribute to check
3527         that the build guards cover complete generated header and
3528         implementation files.
3529
3530         * bindings/scripts/CodeGeneratorJS.pm:
3531         (GenerateDictionaryHeaderContent):
3532         (GenerateDictionariesHeaderContent):
3533         (GenerateDictionaryImplementationContent):
3534         (GenerateDictionariesImplementationContent):
3535         (GenerateDictionaryHeader):
3536         (GenerateDictionaryImplementation):
3537         * bindings/scripts/test/JS/JSTestObj.cpp:
3538         (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
3539         (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
3540         (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
3541         * bindings/scripts/test/JS/JSTestObj.h:
3542         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3543         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
3544         * bindings/scripts/test/TestObj.idl:
3545         * bindings/scripts/test/TestStandaloneDictionary.idl:
3546
3547 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
3548
3549         [MediaStream] Separate media capture and audio playback muting
3550         https://bugs.webkit.org/show_bug.cgi?id=163855
3551         <rdar://problem/28827186>
3552
3553         Reviewed by Darin Adler.
3554
3555         Test: fast/mediastream/MediaStream-page-muted.html
3556
3557         Change page.muted from a bool to a bitfield so audio and media capture muted are independent.
3558         Fix a couple of bugs in the mock media capture device uncovered by new test case.
3559         
3560         * Modules/mediastream/MediaStream.cpp:
3561         (WebCore::MediaStream::pageMutedStateDidChange): page.isMuted -> page.mutedState.
3562
3563         * Modules/webaudio/AudioContext.cpp:
3564         (WebCore::AudioContext::pageMutedStateDidChange): Ditto.
3565
3566         * html/HTMLMediaElement.cpp:
3567         (WebCore::HTMLMediaElement::updateVolume): Ditto.
3568         (WebCore::HTMLMediaElement::effectiveMuted): Ditto.
3569
3570         * page/MediaProducer.h: Add MutedState enum.
3571
3572         * page/Page.cpp:
3573         (WebCore::Page::Page):
3574         (WebCore::Page::setMuted): Take MutedStateFlags instead of bool. m_muted -> m_mutedState.
3575         * page/Page.h:
3576
3577         * platform/mock/MockRealtimeMediaSource.cpp:
3578         (WebCore::MockRealtimeMediaSource::startProducingData): Call setMuted.
3579         (WebCore::MockRealtimeMediaSource::stopProducingData): Ditto.
3580         * platform/mock/MockRealtimeMediaSource.h:
3581
3582         * platform/mock/MockRealtimeVideoSource.cpp:
3583         (WebCore::MockRealtimeVideoSource::stopProducingData): Call correct base class method.
3584
3585         * testing/Internals.cpp:
3586         (WebCore::Internals::setPageMuted): Change parameter from a bool to a string.
3587         * testing/Internals.h:
3588
3589         * testing/Internals.idl:
3590
3591 2016-10-24  Darin Adler  <darin@apple.com>
3592
3593         Try to fix Windows build.
3594
3595         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Rearranged includes
3596         so they are inside the conditional as they should be.
3597
3598 2016-10-24  Youenn Fablet  <youenn@apple.com>
3599
3600         Activate WEB_RTC compilation flags for Mac bots
3601         https://bugs.webkit.org/show_bug.cgi?id=163886
3602
3603         Reviewed by Eric Carlson.
3604
3605         Covered by existing tests.
3606
3607         Fixing compilation errors due to missing WEBCORE_EXPORT, missing method and missing override keywords.
3608
3609         * Configurations/FeatureDefines.xcconfig:
3610         * DerivedSources.make:
3611         * Modules/mediastream/MediaEndpointPeerConnection.h:
3612         * Modules/mediastream/RTCPeerConnection.h:
3613         * Modules/mediastream/RTCPeerConnection.idl:
3614         * Modules/mediastream/SDPProcessor.cpp:
3615         (WebCore::SDPProcessor::generate):
3616         (WebCore::SDPProcessor::parse):
3617         * WebCore.xcodeproj/project.pbxproj:
3618         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3619         (WebCore::MockRealtimeVideoSource::createMuted):
3620
3621 2016-10-24  Brady Eidson  <beidson@apple.com>
3622
3623         IndexedDB 2.0: Support IDBIndex name assignment.
3624         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
3625
3626         Reviewed by Alex Christensen.
3627
3628         Tests: storage/indexeddb/modern/index-rename-1-private.html
3629                storage/indexeddb/modern/index-rename-1.html
3630
3631         Touches a *lot* of code sites, but none of them are particularly interesting.
3632         They are all just getting the new name spread out to all of the various objects that need it.
3633
3634         * Modules/indexeddb/IDBDatabase.cpp:
3635         (WebCore::IDBDatabase::renameIndex):
3636         * Modules/indexeddb/IDBDatabase.h:
3637
3638         * Modules/indexeddb/IDBIndex.cpp:
3639         (WebCore::IDBIndex::IDBIndex):
3640         (WebCore::IDBIndex::setName):
3641         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
3642         * Modules/indexeddb/IDBIndex.h:
3643         * Modules/indexeddb/IDBIndex.idl:
3644
3645         * Modules/indexeddb/IDBObjectStore.cpp:
3646         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
3647         (WebCore::IDBObjectStore::renameReferencedIndex):
3648         (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): Deleted.
3649         * Modules/indexeddb/IDBObjectStore.h:
3650
3651         * Modules/indexeddb/IDBTransaction.cpp:
3652         (WebCore::IDBTransaction::internalAbort):
3653         (WebCore::IDBTransaction::renameIndex):
3654         (WebCore::IDBTransaction::renameIndexOnServer):
3655         (WebCore::IDBTransaction::didRenameIndexOnServer):
3656         * Modules/indexeddb/IDBTransaction.h:
3657
3658         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3659         (WebCore::IDBClient::IDBConnectionProxy::renameIndex):
3660         * Modules/indexeddb/client/IDBConnectionProxy.h:
3661
3662         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3663         (WebCore::IDBClient::IDBConnectionToServer::renameIndex):
3664         (WebCore::IDBClient::IDBConnectionToServer::didRenameIndex):
3665         * Modules/indexeddb/client/IDBConnectionToServer.h:
3666         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3667
3668         * Modules/indexeddb/client/TransactionOperation.h:
3669         (WebCore::IDBClient::createTransactionOperation):
3670
3671         * Modules/indexeddb/server/IDBBackingStore.h:
3672
3673         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3674         (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
3675         * Modules/indexeddb/server/IDBConnectionToClient.h:
3676         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
3677
3678         * Modules/indexeddb/server/IDBServer.cpp:
3679         (WebCore::IDBServer::IDBServer::renameIndex):
3680         * Modules/indexeddb/server/IDBServer.h:
3681
3682         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3683         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
3684         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3685         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
3686
3687         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3688         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
3689         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3690
3691         * Modules/indexeddb/server/MemoryIndex.h:
3692         (WebCore::IDBServer::MemoryIndex::rename):
3693
3694         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3695         (WebCore::IDBServer::MemoryObjectStore::renameIndex):
3696         * Modules/indexeddb/server/MemoryObjectStore.h:
3697
3698         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3699         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
3700         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3701
3702         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3703         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
3704         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
3705         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
3706         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3707
3708         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3709         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
3710         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3711
3712         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3713         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
3714         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3715
3716         * Modules/indexeddb/shared/IDBIndexInfo.h:
3717         (WebCore::IDBIndexInfo::rename):
3718
3719         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3720         (WebCore::IDBObjectStoreInfo::infoForExistingIndex):
3721         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
3722
3723         * Modules/indexeddb/shared/IDBResultData.cpp:
3724         (WebCore::IDBResultData::renameIndexSuccess):
3725         * Modules/indexeddb/shared/IDBResultData.h:
3726
3727         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3728         (WebCore::InProcessIDBServer::didRenameIndex):
3729         (WebCore::InProcessIDBServer::renameIndex):
3730         * Modules/indexeddb/shared/InProcessIDBServer.h:
3731
3732 2016-10-24  Dave Hyatt  <hyatt@apple.com>
3733
3734         [CSS Parser] Fix -webkit-box-reflect parsing
3735         https://bugs.webkit.org/show_bug.cgi?id=163890
3736
3737         Reviewed by Zalan Bujtas.
3738
3739         * css/parser/CSSPropertyParser.cpp:
3740         (WebCore::consumeReflect):
3741         Do a WTFMove on the mask instead of a .releaseNonNull(), since mask can be a nullptr.
3742         Exactly matches the old parser.
3743
3744         * css/parser/CSSPropertyParserHelpers.cpp:
3745         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
3746         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
3747         (WebCore::CSSPropertyParserHelpers::consumeInteger):
3748         (WebCore::CSSPropertyParserHelpers::consumeNumber):
3749         (WebCore::CSSPropertyParserHelpers::consumeLength):
3750         (WebCore::CSSPropertyParserHelpers::consumePercent):
3751         (WebCore::CSSPropertyParserHelpers::consumeAngle):
3752         (WebCore::CSSPropertyParserHelpers::consumeTime):
3753         (WebCore::CSSPropertyParserHelpers::consumeUrl):
3754         (WebCore::CSSPropertyParserHelpers::consumeColor):
3755         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
3756         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
3757         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
3758         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
3759         Clean up all instances of CSSPrimitiveValue::create to use the CSSValuePool.
3760
3761 2016-10-21  Antoine Quint  <graouts@apple.com>
3762
3763         [Modern Media Controls] Concatenate JS and CSS files into a single JS and CSS resources
3764         https://bugs.webkit.org/show_bug.cgi?id=163785
3765         <rdar://problem/28890058>
3766
3767         Reviewed by Darin Adler.
3768
3769         Concatenate CSS and JS resources for modern media controls into single JS and CSS files
3770         during build and load these single resources alone at runtime.
3771
3772         * Modules/modern-media-controls/js-files: Added.
3773         * WebCore.xcodeproj/project.pbxproj:
3774         * rendering/RenderThemeMac.mm:
3775         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
3776         (WebCore::RenderThemeMac::mediaControlsScript):
3777
3778 2016-10-24  Dave Hyatt  <hyatt@apple.com>
3779
3780         [CSS Parser] Unprefix -webkit-writing-mode
3781         https://bugs.webkit.org/show_bug.cgi?id=163870
3782
3783         Reviewed by Zalan Bujtas.
3784
3785         * css/CSSComputedStyleDeclaration.cpp:
3786         (WebCore::ComputedStyleExtractor::propertyValue):
3787         Change -webkit-writing mode to writing-mode.
3788
3789         * css/CSSPrimitiveValueMappings.h:
3790         (WebCore::CSSPrimitiveValue::operator WritingMode):
3791         (WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted.
3792         Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific
3793         values to the WritingMode converters.
3794
3795         * css/CSSPropertyNames.in:
3796         Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be
3797         high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode
3798         instead of to -webkit-writing-mode.
3799
3800         * css/SVGCSSComputedStyleDeclaration.cpp:
3801         (WebCore::ComputedStyleExtractor::svgPropertyValue):
3802         Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it.
3803
3804         * css/StyleBuilderCustom.h:
3805         (WebCore::StyleBuilderCustom::applyValueWritingMode):
3806         (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted.
3807         Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since
3808         the underlying converter for WritingMode now handles those values.
3809
3810         * css/StyleResolver.cpp:
3811         (WebCore::extractDirectionAndWritingMode):
3812         Rename -webkit-writing-mode to writing-mode.
3813
3814         * css/parser/CSSParser.cpp:
3815         (WebCore::isValidKeywordPropertyAndValue):
3816         Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values
3817         and the normal values.
3818
3819         * css/parser/CSSParserFastPaths.cpp:
3820         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3821         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3822         Same deal here.
3823
3824         * html/track/TextTrackCueGeneric.cpp:
3825         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
3826         * html/track/VTTCue.cpp:
3827         (WebCore::VTTCueBox::applyCSSProperties):
3828         Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now.
3829
3830         * rendering/RenderLineBreak.cpp:
3831         (WebCore::RenderLineBreak::collectSelectionRects):
3832         * rendering/RenderText.cpp:
3833         (WebCore::RenderText::collectSelectionRects):
3834         Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not
3835         the SVG-specific one.
3836
3837         * rendering/style/RenderStyle.h:
3838         (WebCore::RenderStyle::isVerticalWritingMode):
3839         Add a helper function for asking if something is vertical writing mode.
3840
3841         * rendering/style/SVGRenderStyle.cpp:
3842         * rendering/style/SVGRenderStyle.h:
3843         * rendering/style/SVGRenderStyleDefs.h:
3844         (WebCore::SVGRenderStyle::diff):
3845         Remove the SVG writing mode code.
3846
3847         * rendering/svg/RenderSVGInlineText.cpp:
3848         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
3849         Make sure to force SVG font descriptions to be horizontal, since SVG controls
3850         its own glyph orientation.
3851
3852         * rendering/svg/SVGRenderTreeAsText.cpp:
3853         (WebCore::writeSVGInlineTextBox):
3854         * rendering/svg/SVGTextChunk.cpp:
3855         (WebCore::SVGTextChunk::SVGTextChunk):
3856         * rendering/svg/SVGTextLayoutEngine.cpp:
3857         (WebCore::SVGTextLayoutEngine::layoutInlineTextBox):
3858         * rendering/svg/SVGTextQuery.cpp:
3859         (WebCore::SVGTextQuery::executeQuery):
3860         Changed to access the RenderStyle writing mode instead of the SVG-specific one.
3861
3862 2016-10-23  Antti Koivisto  <antti@apple.com>
3863
3864         Avoid unnecessary full style resolution in getComputedStyle for non-inherited properties
3865         https://bugs.webkit.org/show_bug.cgi?id=163875
3866
3867         Reviewed by Andreas Kling.
3868
3869         Test: fast/css/getComputedStyle/getComputedStyle-style-resolution.html
3870
3871         * css/CSSComputedStyleDeclaration.cpp:
3872         (WebCore::hasValidStyleForProperty):
3873
3874             For non-inherited properties we don't need to update style even if some ancestor style is invalid
3875             as long as explicit 'inherit' is not being used.
3876             We still need to update if we find out that the whole subtree we are in is invalid.
3877
3878         (WebCore::updateStyleIfNeededForProperty):
3879
3880             Pass the property.
3881
3882         (WebCore::ComputedStyleExtractor::customPropertyValue):
3883         (WebCore::ComputedStyleExtractor::propertyValue):
3884         (WebCore::CSSComputedStyleDeclaration::length):
3885         (WebCore::elementOrItsAncestorNeedsStyleRecalc): Deleted.
3886         (WebCore::updateStyleIfNeededForElement): Deleted.
3887         * css/StyleResolver.cpp:
3888         (WebCore::StyleResolver::colorFromPrimitiveValue):
3889
3890             Mark style as using explicit inheritance if 'currentcolor' value is used.
3891
3892 2016-10-24  Youenn Fablet  <youenn@apple.com>
3893
3894         ASSERTION FAILED: canvas()->securityOrigin()->toString() == cachedImage.origin()->toString()
3895         https://bugs.webkit.org/show_bug.cgi?id=163242
3896
3897         Reviewed by Darin Adler.
3898
3899         Test: http/tests/security/cross-origin-cached-images-canvas.html
3900
3901         We were previously on Origin HTTP header to check whether requests were made from different origins.
3902         This is fine for CORS enabled requests but not for GET no CORS requests since they will not have any Origin header.
3903
3904         Now that CachedResource and CachedResourceRequest own their origin, it is best to use these directly.
3905
3906         * loader/cache/CachedResourceLoader.cpp:
3907         (WebCore::isRequestMatchingResourceOrigin):
3908         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
3909
3910 2016-10-24  Youenn Fablet  <youenn@apple.com>
3911
3912         Remove CachedResource::passesSameOriginPolicyCheck
3913         https://bugs.webkit.org/show_bug.cgi?id=163593
3914
3915         Reviewed by Andreas Kling.
3916
3917         No change of behavior.
3918
3919         Removing no-longer used code.
3920
3921         * loader/cache/CachedResource.cpp:
3922         (WebCore::CachedResource::redirectReceived):
3923         (WebCore::CachedResource::passesAccessControlCheck): Deleted.
3924         (WebCore::CachedResource::passesSameOriginPolicyCheck): Deleted.
3925         (WebCore::CachedResource::responseForSameOriginPolicyChecks): Deleted.
3926         * loader/cache/CachedResource.h:
3927         (WebCore::CachedResource::response):
3928
3929 2016-10-24  Youenn Fablet  <youenn@apple.com>
3930
3931         Redirections should be upgraded if CSP policy says so
3932         https://bugs.webkit.org/show_bug.cgi?id=163544
3933
3934         Reviewed by Darin Adler.
3935
3936         Test: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-after-redirect.https.html
3937
3938         Introducing CachedResourceLoader::updateRequestAfterRedirection to do the checks that CachedResourceLoader is doing
3939         to the initial request, but for redirection requests.
3940
3941         Implemented URL upgrade according CSP policy, as specified by fetch algorithm.
3942         Minor refactoring in CachedResourceRequest to share some code.
3943         Fixing some constness issues.
3944
3945         * loader/SubresourceLoader.cpp:
3946         (WebCore::SubresourceLoader::willSendRequestInternal):
3947         * loader/cache/CachedResourceLoader.cpp:
3948         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
3949         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
3950         (WebCore::CachedResourceLoader::updateRequestAfterRedirection):
3951         * loader/cache/CachedResourceLoader.h:
3952         * loader/cache/CachedResourceRequest.cpp:
3953         (WebCore::upgradeInsecureResourceRequestIfNeeded):
3954         (WebCore::CachedResourceRequest::upgradeInsecureRequestIfNeeded):
3955         * loader/cache/CachedResourceRequest.h:
3956
3957 2016-10-22  Sam Weinig  <sam@webkit.org>
3958
3959         [WebIDL] Add IDLType based toJS conversion
3960         https://bugs.webkit.org/show_bug.cgi?id=163861
3961
3962         Reviewed by Darin Adler.
3963
3964         Adds toJS<IDLType>() functions to be the new way of converting
3965         from implementation types to JS types. These are implemented via
3966         a similar mechanism to the convert<IDL>() functions, though specializations
3967         of a JSConverter struct (rather than the Converter structs). This allows
3968         us to support arbitrarily complex aggregate types easily (e.g. sequence<(Node or DOMString?)>).
3969
3970         * Modules/geolocation/Geoposition.idl:
3971         * dom/Event.idl:
3972         Add typedef for DOMTimeStamp. Eventually, our IDLParser should do this for us, but
3973         for now it allows us to simplify the type system.
3974
3975         * bindings/js/JSDOMBinding.h:
3976         (WebCore::JSValueTraits::arrayJSValue): Deleted.
3977         (WebCore::JSValueTraits<String>::arrayJSValue): Deleted.
3978         (WebCore::JSValueTraits<double>::arrayJSValue): Deleted.
3979         (WebCore::JSValueTraits<float>::arrayJSValue): Deleted.
3980         (WebCore::jsArray): Deleted.
3981         (WebCore::jsFrozenArray): Deleted.
3982         (WebCore::NativeValueTraits<String>::nativeValue): Deleted.
3983         (WebCore::NativeValueTraits<unsigned>::nativeValue): Deleted.
3984         (WebCore::NativeValueTraits<float>::nativeValue): Deleted.
3985         (WebCore::NativeValueTraits<double>::nativeValue): Deleted.
3986         (WebCore::toNullableJSNumber): Deleted.
3987         (WebCore::toJSArray): Deleted.
3988         (WebCore::toJSBoolean): Deleted.
3989         (WebCore::toJSNumber): Deleted.
3990         (WebCore::toJSString): Deleted.
3991         Remove many now-unneeded conversion functions.
3992
3993         * bindings/js/JSDOMConvert.h:
3994         (WebCore::toJS):
3995         Add 5 primary toJS functions which take combinations of the following
3996         arguments: ExecState, JSDOMGlobalObject, ThrowScope.  All take the value 
3997         to be converted as well, except in the case of the throwScope ones, where
3998         they take the value in an ExceptionOr<>.
3999
4000         To simplify the implementations of the JSConverter specializations, avoiding
4001         the need for each one to implement their conversion up to 3 times (one for just
4002         the value, one for the value and the ExecState, and one for the value, the ExecState
4003         and the global object), each JSConverter instead specifies whether it's converter
4004         needs an ExecState or global object via a static constexpr. We then use the 
4005         JSConverterOverloader template, to call the correct function. This can probably be
4006         improved in the future, by inferring the number of arguments needed via SFINAE, but
4007         this seemed like a more straightforward first cut.