[DOMJIT] Rename CallDOM to CallDOMGetter
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-28  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         [DOMJIT] Rename CallDOM to CallDOMGetter
4         https://bugs.webkit.org/show_bug.cgi?id=164157
5
6         Reviewed by Keith Miller.
7
8         No behavior change.
9
10         * bindings/scripts/CodeGeneratorJS.pm:
11         (GenerateHeader):
12         * bindings/scripts/test/JS/JSTestDOMJIT.h:
13         * domjit/JSDocumentDOMJIT.cpp:
14         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
15         (WebCore::DocumentDocumentElementDOMJIT::callDOM): Deleted.
16         * domjit/JSNodeDOMJIT.cpp:
17         (WebCore::createCallDOMGetterForOffsetAccess):
18         (WebCore::NodeFirstChildDOMJIT::callDOMGetter):
19         (WebCore::NodeLastChildDOMJIT::callDOMGetter):
20         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
21         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
22         (WebCore::NodeParentNodeDOMJIT::callDOMGetter):
23         (WebCore::NodeNodeTypeDOMJIT::callDOMGetter):
24         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
25         (WebCore::createCallDOMForOffsetAccess): Deleted.
26         (WebCore::NodeFirstChildDOMJIT::callDOM): Deleted.
27         (WebCore::NodeLastChildDOMJIT::callDOM): Deleted.
28         (WebCore::NodeNextSiblingDOMJIT::callDOM): Deleted.
29         (WebCore::NodePreviousSiblingDOMJIT::callDOM): Deleted.
30         (WebCore::NodeParentNodeDOMJIT::callDOM): Deleted.
31         (WebCore::NodeNodeTypeDOMJIT::callDOM): Deleted.
32         (WebCore::NodeOwnerDocumentDOMJIT::callDOM): Deleted.
33
34 2016-10-28  Dave Hyatt  <hyatt@apple.com>
35
36         [CSS Parser] Fix font-family parsing inside @font-face
37         https://bugs.webkit.org/show_bug.cgi?id=164155
38
39         Reviewed by Simon Fraser.
40
41         * css/parser/CSSPropertyParser.cpp:
42         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
43         Use the full font-family parsing that returns a CSSValueList,
44         since we can handle multiple families.
45
46 2016-10-28  Per Arne Vollan  <pvollan@apple.com>
47
48         [Win][Direct2D] Implement ImageBufferData::putData.
49         https://bugs.webkit.org/show_bug.cgi?id=164151
50
51         Reviewed by Brent Fulgham.
52
53         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
54         (WebCore::ImageBufferData::getData):
55         (WebCore::ImageBufferData::putData):
56
57 2016-10-28  Dave Hyatt  <hyatt@apple.com>
58
59         [CSS Parser] Support hanging-punctuation
60         https://bugs.webkit.org/show_bug.cgi?id=164153
61
62         Reviewed by Simon Fraser.
63
64         * css/parser/CSSPropertyParser.cpp:
65         (WebCore::consumeHangingPunctuation):
66         (WebCore::CSSPropertyParser::parseSingleValue):
67
68 2016-10-28  Yusuke Suzuki  <utatane.tea@gmail.com>
69
70         [DOMJIT] Implement Document::documentElement
71         https://bugs.webkit.org/show_bug.cgi?id=164113
72
73         Reviewed by Sam Weinig.
74
75         Test: js/dom/domjit-accessor-document-element.html
76
77         This patch implements document.documentElement DOMJIT accessor.
78         Similar to ownerDocument accessor, the way to access to document.documentElement
79         from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing
80         functionality: using documentElementMemoryOffset().
81
82         document.documentElement is frequently called in jQuery. Especially, every time
83         we call jQuery.attr(), this is called.
84
85         To implement Document accessor, we clean up some code in DOMJITHelpers.
86         We create the cpp file for DOMJITHelpers and move some helpers to it.
87         And we also implement DOMJIT::checkDOM<DOMInterface> for convenience.
88         It returns appropriate CheckDOM patchpoint implementation.
89
90         This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54).
91
92         * CMakeLists.txt:
93         * WebCore.xcodeproj/project.pbxproj:
94         * cssjit/SelectorCompiler.cpp:
95         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
96         * dom/Document.idl:
97         * domjit/DOMJITAbstractHeapRepository.h:
98         * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
99         (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail):
100         (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail):
101         (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail):
102         (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail):
103         (WebCore::DOMJIT::checkDOM):
104         * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
105         (WebCore::DOMJIT::loadDocument):
106         (WebCore::DOMJIT::loadDocumentElement):
107         * domjit/DOMJITHelpers.h:
108         (WebCore::DOMJIT::toWrapperSlow):
109         (WebCore::DOMJIT::loadDocument): Deleted.
110         * domjit/JSDocumentDOMJIT.cpp: Added.
111         (WebCore::DocumentDocumentElementDOMJIT::checkDOM):
112         (WebCore::DocumentDocumentElementDOMJIT::callDOM):
113         * domjit/JSNodeDOMJIT.cpp:
114         (WebCore::createCallDOMForOffsetAccess):
115         (WebCore::NodeFirstChildDOMJIT::checkDOM):
116         (WebCore::NodeLastChildDOMJIT::checkDOM):
117         (WebCore::NodeNextSiblingDOMJIT::checkDOM):
118         (WebCore::NodePreviousSiblingDOMJIT::checkDOM):
119         (WebCore::NodeParentNodeDOMJIT::checkDOM):
120         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
121         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
122         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
123         (WebCore::toWrapperSlow): Deleted.
124         (WebCore::checkNode): Deleted.
125
126 2016-10-28  Dave Hyatt  <hyatt@apple.com>
127
128         [CSS Parser] Support initial-letter
129         https://bugs.webkit.org/show_bug.cgi?id=164150
130
131         Reviewed by Simon Fraser.
132
133         * css/parser/CSSPropertyParser.cpp:
134         (WebCore::consumeInitialLetter):
135         (WebCore::CSSPropertyParser::parseSingleValue):
136
137 2016-10-28  Simon Fraser  <simon.fraser@apple.com>
138
139         Remove some unused code in RenderLayerCompositor::computeExtent()
140         https://bugs.webkit.org/show_bug.cgi?id=163934
141
142         Reviewed by Zalan Bujtas.
143
144         viewportRect was never used.
145
146         * rendering/RenderLayerCompositor.cpp:
147         (WebCore::RenderLayerCompositor::computeExtent):
148
149 2016-10-28  Sam Weinig  <sam@webkit.org>
150
151         [WebIDL] Update parser and code generators to only access type information through the type property
152         https://bugs.webkit.org/show_bug.cgi?id=164141
153
154         Reviewed by Anders Carlsson.
155
156         Update IDLParser structs:
157         - domSignature: Rename idlType to type. Specify that type is a domType.
158         - domInterface: Remove name and parent. Specify that type and parentType are a domTypes.
159         - domFunction: Specify that signature is a domSignature.
160         - domAttribute: Remove unused type. Specify that signature is a domSignature.
161         - domIterable: Remove idlKeyType and valueKeyType. Specify that keyType and valueType are a domTypes
162         - domConstant: Specify that type is a domType.
163         - domEnum: Specify that type is a domType.
164         - domDictionary: Remove name and parent. Specify that type and parentType are a domTypes.
165         - Typedef: Rename idlType to type and specify that it is a domType.
166
167         * bindings/scripts/IDLParser.pm:
168         Remove redundant properties and specify type info in structs where possible.
169
170         * bindings/scripts/CodeGenerator.pm:
171         (IsSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
172         (IsSVGTypeWithWritablePropertiesNeedingTearOffForType): Renamed to remove ForType suffix.
173         (GetSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
174         (GetSVGWrappedTypeNeedingTearOffForType): Renamed to remove ForType suffix.
175
176         Update to always access type information through type accessors. Remove use of removed
177         properties.
178
179         * bindings/scripts/CodeGeneratorJS.pm:
180         (IsNullableType): Deleted.
181         (StripNullable): Deleted.
182         Remove unused functions.
183
184         Update to always access type information through type accessors. Remove use of removed
185         properties.
186
187         * bindings/scripts/generate-bindings.pl:
188         Update to always access type information through type accessors. Remove use of removed
189         properties.
190
191 2016-10-28  Dave Hyatt  <hyatt@apple.com>
192
193         [CSS Parser] Support bopomofo Ruby
194         https://bugs.webkit.org/show_bug.cgi?id=164148
195
196         Reviewed by Simon Fraser.
197
198         * css/parser/CSSParserFastPaths.cpp:
199         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
200
201 2016-10-28  Dave Hyatt  <hyatt@apple.com>
202
203         [CSS Parser] Add support for -webkit-canvas images
204         https://bugs.webkit.org/show_bug.cgi?id=164144
205
206         Reviewed by Simon Fraser.
207
208         * css/CSSValueKeywords.in:
209         * css/parser/CSSParser.cpp:
210         (WebCore::CSSParserContext::CSSParserContext):
211         * css/parser/CSSPropertyParserHelpers.cpp:
212         (WebCore::CSSPropertyParserHelpers::consumeWebkitCanvas):
213         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
214         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
215
216 2016-10-27  Geoffrey Garen  <ggaren@apple.com>
217
218         One file per class for Executable.h/.cpp
219         https://bugs.webkit.org/show_bug.cgi?id=164099
220
221         Reviewed by Saam Barati.
222
223         * ForwardingHeaders/runtime/Executable.h: Removed.
224         * ForwardingHeaders/runtime/FunctionExecutable.h: Copied from Source/WebCore/ForwardingHeaders/runtime/Executable.h.
225         * bindings/js/JSLazyEventListener.cpp:
226         * bindings/js/JSMainThreadExecStateInstrumentation.h:
227
228 2016-10-28  Dave Hyatt  <hyatt@apple.com>
229
230         [CSS Parser] Clean up gradient parsing
231         https://bugs.webkit.org/show_bug.cgi?id=164139
232
233         Reviewed by Dean Jackson.
234
235         * css/CSSGradientValue.cpp:
236         (WebCore::positionFromValue):
237         (WebCore::CSSGradientValue::computeEndPoint):
238         * css/parser/CSSPropertyParserHelpers.cpp:
239         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
240         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
241         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
242         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
243         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
244
245 2016-10-28  Dean Jackson  <dino@apple.com>
246
247         New CSS Parser should use Colors not RGBA32s
248         https://bugs.webkit.org/show_bug.cgi?id=164124
249         <rdar://problem/29000373>
250
251         Reviewed by Darin Adler.
252
253         The old parser has moved from using RGBA32 values to using
254         Colors directly. This was so we could support ExtendedColors
255         via the new color() syntax.
256
257         Update the new CSS parser to do the same.
258
259         * css/parser/CSSPropertyParserHelpers.cpp:
260         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
261         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
262         (WebCore::CSSPropertyParserHelpers::parseHexColor):
263         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
264         (WebCore::CSSPropertyParserHelpers::consumeColor):
265
266 2016-10-28  Dean Jackson  <dino@apple.com>
267
268         Allow new CSS parser to handle insertRule, etc via parseRule
269         https://bugs.webkit.org/show_bug.cgi?id=164122
270         <rdar://problem/29000101>
271
272         Reviewed by Darin Adler.
273
274         Call the new CSS parser from CSSParser::parseRule if enabled. This
275         allows style added via the CSSOM insertRule to go through
276         the parser.
277
278         I tested this across our layout tests that use insertRule. It
279         works fine, but does cause some filter tests to fail. This is
280         because the new parser does not generate WebKitCSSFilterValues,
281         but I think the CSSFunctionValue is good enough. I'll remove
282         WebKitCSSFilterValue separately.
283
284         * css/parser/CSSParser.cpp:
285         (WebCore::CSSParser::parseRule): Call CSSParserImpl::parseRule.
286
287 2016-10-28  Simon Fraser  <simon.fraser@apple.com>
288
289         Wrong blur radius for filter: drop-shadow()
290         https://bugs.webkit.org/show_bug.cgi?id=163667
291
292         Reviewed by Darin Adler.
293         
294         The "stdDev" parameter to <feDropShadow> and <feGaussianBlur> represents the standard
295         deviation (σ) of the Gaussian blur function. CSS filters drop-shadow() and blur() follow
296         this with their radius parameter.
297         
298         However, CSS box-shadow and text-shadow use 2σ to describe the blur radius, since this
299         is conveniently close to the number of pixels the effect of the blur extends out.
300         
301         feDropShadow, which is used by non-accelerated filter: drop-shadow(), was using
302         the wrong blur radius because it passed its stdDev directly to ShadowBlur. ShadowBlur
303         was written for CSS box-shadow, so expected its input "blur radius" to be twice the
304         stdDev.
305         
306         Tests: css3/filters/drop-shadow-blur-radius.html
307                svg/filters/feDropShadow-blur-radius.html
308
309         * platform/graphics/filters/FEDropShadow.cpp:
310         (WebCore::FEDropShadow::platformApplySoftware):
311
312 2016-10-28  Youenn Fablet  <youenn@apple.com>
313
314         Expose RTCPeerConnection unprefixed
315         https://bugs.webkit.org/show_bug.cgi?id=164060
316
317         Reviewed by Darin Adler.
318
319         Covered by rebased and activated tests.
320
321         * Modules/mediastream/RTCPeerConnection.idl:
322
323 2016-10-28  Dave Hyatt  <hyatt@apple.com>
324
325         [CSS Parser] Support the marquee properties
326         https://bugs.webkit.org/show_bug.cgi?id=164132
327
328         Reviewed by Zalan Bujtas.
329
330         * css/parser/CSSParserFastPaths.cpp:
331         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
332         * css/parser/CSSPropertyParser.cpp:
333         (WebCore::consumeWebkitMarqueeIncrement):
334         (WebCore::consumeWebkitMarqueeRepetition):
335         (WebCore::consumeWebkitMarqueeSpeed):
336         (WebCore::CSSPropertyParser::parseSingleValue):
337         (WebCore::CSSPropertyParser::parseShorthand):
338
339 2016-10-28  Dave Hyatt  <hyatt@apple.com>
340
341         [CSS Parser] Miscellaneous bug fixes
342         https://bugs.webkit.org/show_bug.cgi?id=164131
343
344         Reviewed by Zalan Bujtas.
345
346         * css/CSSComputedStyleDeclaration.cpp:
347         (WebCore::ComputedStyleExtractor::propertyValue):
348         * css/CSSPropertyNames.in:
349         The prefix was incorrectly dropped from -webkit-column-progression.
350         Put it back.
351
352         * css/StyleBuilderConverter.h:
353         (WebCore::StyleBuilderConverter::convertPositionComponent):
354         (WebCore::StyleBuilderConverter::convertObjectPosition):
355         Fix object-position parsing so that the position components can
356         be ids.
357
358         * css/StyleBuilderCustom.h:
359         (WebCore::StyleBuilderCustom::applyValueContent):
360         The new parser doesn't make a list for content:none, since none can't be
361         a component of a list anyway. Add code to handle this case in the
362         apply function.
363
364         * css/parser/CSSParser.cpp:
365         (WebCore::isValidKeywordPropertyAndValue):
366         Put the prefix back on -webkit-column-progression.
367
368         * css/parser/CSSParserFastPaths.cpp:
369         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
370         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
371         Same.
372
373         * css/parser/CSSParserImpl.cpp:
374         (WebCore::CSSParserImpl::parsePageSelector):
375         Make sure match type is checked, since our code asserts if it isn't.
376
377         * css/parser/CSSPropertyParser.cpp:
378         (WebCore::validWidthOrHeightKeyword):
379         (WebCore::consumeLineGrid):
380         (WebCore::CSSPropertyParser::parseSingleValue):
381         Add support for the line-grid properties and for -webkit-nbsp-mode.
382
383 2016-10-28  Antti Koivisto  <antti@apple.com>
384
385         Always use iOS preload behavior
386         https://bugs.webkit.org/show_bug.cgi?id=164127
387
388         Reviewed by Andreas Kling.
389
390         On non-iOS platforms we were delaying issuing lower priority preload (images mostly) until document has body.
391         This should be unnecessary as networking layer prioritization should ensure higher priority resources are
392         loaded earlier. Testing on iOS has showed that more aggressive behavior is a win.
393
394         This patch switches to iOS behavior on all platforms (and simplified the logic).
395
396         * html/parser/HTMLResourcePreloader.cpp:
397         (WebCore::HTMLResourcePreloader::preload):
398         * loader/LinkLoader.cpp:
399         (WebCore::LinkLoader::preloadIfNeeded):
400         * loader/cache/CachedResourceLoader.cpp:
401         (WebCore::CachedResourceLoader::performPostLoadActions):
402         (WebCore::CachedResourceLoader::preload):
403         (WebCore::CachedResourceLoader::isPreloaded):
404         (WebCore::CachedResourceLoader::checkForPendingPreloads): Deleted.
405         (WebCore::CachedResourceLoader::requestPreload): Deleted.
406         (WebCore::CachedResourceLoader::clearPendingPreloads): Deleted.
407         * loader/cache/CachedResourceLoader.h:
408
409 2016-10-28  Youenn Fablet  <youenn@apple.com>
410
411         [Fetch] Ensure redirection count is no more than 20 in case of cross origin requests
412         https://bugs.webkit.org/show_bug.cgi?id=164117
413
414         Reviewed by Sam Weinig.
415
416         Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-worker.html
417                imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin.html
418
419         Introducing a ResourceLoaderOptions that defines the maximum redirection count.
420         By default, it is set to 20 as per fetch specification.
421
422         This option is used by SubresourceLoader to cancel load if its redirection count is above that maximum.
423         DocumentThreadableLoader stopping redirections to make preflight if needed, it now uses the maxRedirectCount loader option to ensure
424         that the total number of redirections is 20.
425
426         * loader/DocumentThreadableLoader.cpp:
427         (WebCore::DocumentThreadableLoader::redirectReceived):
428         * loader/ResourceLoaderOptions.h:
429         * loader/SubresourceLoader.cpp:
430         (WebCore::SubresourceLoader::willSendRequestInternal):
431         * loader/SubresourceLoader.h:
432
433 2016-10-28  Fujii Hironori  <Hironori.Fujii@sony.com>
434
435         generate-bindings-all.pl should recompile supplemented IDL if its supplemental IDL are added or removed
436         https://bugs.webkit.org/show_bug.cgi?id=164054
437
438         Reviewed by Michael Catanzaro.
439
440         generate-bindings-all.pl determines which IDL to recompile by
441         comparing timestamps of generated files, source IDL and its
442         dependencies.  But this is not enough. If a new supplemental IDL
443         is added, its supplemented IDL needs to be recompiled even though
444         the timestamp of the supplemental IDL is older than the
445         generated files.
446
447         * bindings/scripts/generate-bindings-all.pl: Read supplemental
448         dependency file both before and after invoking preprocess-idls.pl.
449         Recompile IDL files if its supplemental dependencies are added or
450         removed.
451
452 2016-10-28  Youenn Fablet  <youenn@apple.com>
453
454         PeerMediaDescription does not need to be refcounted
455         https://bugs.webkit.org/show_bug.cgi?id=164059
456
457         Reviewed by Darin Adler.
458
459         No change of behavior.
460
461         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
462         (WebCore::MediaEndpointPeerConnection::createOfferTask):
463         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
464         (WebCore::createSourceMap):
465         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
466         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
467         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
468         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
469         * Modules/mediastream/MediaEndpointPeerConnection.h:
470         * Modules/mediastream/SDPProcessor.cpp:
471         (WebCore::configurationFromJSON):
472         (WebCore::configurationToJSON):
473         (WebCore::SDPProcessor::generateCandidateLine):
474         (WebCore::SDPProcessor::parseCandidateLine):
475         * platform/mediastream/IceCandidate.h:
476         * platform/mediastream/MediaEndpointSessionConfiguration.h:
477         (WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
478         (WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
479         (WebCore::MediaEndpointSessionConfiguration::clone):
480         * platform/mediastream/PeerMediaDescription.h:
481         (WebCore::PeerMediaDescription::addPayload):
482         (WebCore::PeerMediaDescription::addSsrc):
483         (WebCore::PeerMediaDescription::clearSsrcs):
484         (WebCore::PeerMediaDescription::addIceCandidate):
485         (WebCore::PeerMediaDescription::create): Deleted.
486         (WebCore::PeerMediaDescription::~PeerMediaDescription): Deleted.
487         (WebCore::PeerMediaDescription::type): Deleted.
488         (WebCore::PeerMediaDescription::setType): Deleted.
489         (WebCore::PeerMediaDescription::port): Deleted.
490         (WebCore::PeerMediaDescription::setPort): Deleted.
491         (WebCore::PeerMediaDescription::address): Deleted.
492         (WebCore::PeerMediaDescription::setAddress): Deleted.
493         (WebCore::PeerMediaDescription::mode): Deleted.
494         (WebCore::PeerMediaDescription::setMode): Deleted.
495         (WebCore::PeerMediaDescription::mid): Deleted.
496         (WebCore::PeerMediaDescription::setMid): Deleted.
497         (WebCore::PeerMediaDescription::payloads): Deleted.
498         (WebCore::PeerMediaDescription::setPayloads): Deleted.
499         (WebCore::PeerMediaDescription::rtcpMux): Deleted.
500         (WebCore::PeerMediaDescription::setRtcpMux): Deleted.
501         (WebCore::PeerMediaDescription::rtcpAddress): Deleted.
502         (WebCore::PeerMediaDescription::setRtcpAddress): Deleted.
503         (WebCore::PeerMediaDescription::rtcpPort): Deleted.
504         (WebCore::PeerMediaDescription::setRtcpPort): Deleted.
505         (WebCore::PeerMediaDescription::mediaStreamId): Deleted.
506         (WebCore::PeerMediaDescription::setMediaStreamId): Deleted.
507         (WebCore::PeerMediaDescription::mediaStreamTrackId): Deleted.
508         (WebCore::PeerMediaDescription::setMediaStreamTrackId): Deleted.
509         (WebCore::PeerMediaDescription::dtlsSetup): Deleted.
510         (WebCore::PeerMediaDescription::setDtlsSetup): Deleted.
511         (WebCore::PeerMediaDescription::dtlsFingerprintHashFunction): Deleted.
512         (WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction): Deleted.
513         (WebCore::PeerMediaDescription::dtlsFingerprint): Deleted.
514         (WebCore::PeerMediaDescription::setDtlsFingerprint): Deleted.
515         (WebCore::PeerMediaDescription::cname): Deleted.
516         (WebCore::PeerMediaDescription::setCname): Deleted.
517         (WebCore::PeerMediaDescription::ssrcs): Deleted.
518         (WebCore::PeerMediaDescription::iceUfrag): Deleted.
519         (WebCore::PeerMediaDescription::setIceUfrag): Deleted.
520         (WebCore::PeerMediaDescription::icePassword): Deleted.
521         (WebCore::PeerMediaDescription::setIcePassword): Deleted.
522         (WebCore::PeerMediaDescription::iceCandidates): Deleted.
523         (WebCore::PeerMediaDescription::clone): Deleted.
524         (WebCore::PeerMediaDescription::PeerMediaDescription): Deleted.
525         * platform/mediastream/mac/MediaEndpointMac.cpp:
526         (WebCore::MediaEndpointMac::addRemoteCandidate):
527         (WebCore::MediaEndpointMac::OnIceCandidate):
528         * platform/mediastream/mac/MediaEndpointMac.h:
529         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
530         (WebCore::MediaEndpointOwr::updateSendConfiguration):
531         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
532         * platform/mock/MockMediaEndpoint.cpp:
533         (WebCore::MockMediaEndpoint::updateConfigurationMids):
534
535 2016-10-28  Antoine Quint  <graouts@apple.com>
536
537         [Modern Media Controls] Media Controller: scrubbing support
538         https://bugs.webkit.org/show_bug.cgi?id=163726
539         <rdar://problem/27989481>
540
541         Reviewed by Dean Jackson.
542
543         We introduce the ScrubberSupport class which brings support for scrubbing the media
544         by interacting with the scrubber in the media controls and correctly reflecting
545         the media's current time as set via the media API.
546
547         Tests: media/modern-media-controls/scrubber-support/scrubber-support-click.html
548                media/modern-media-controls/scrubber-support/scrubber-support-drag.html
549                media/modern-media-controls/scrubber-support/scrubber-support-media-api.html
550
551         * Modules/modern-media-controls/js-files:
552         * Modules/modern-media-controls/media/media-controller.js:
553         (MediaController):
554         * Modules/modern-media-controls/media/scrubbing-support.js: Added.
555         (ScrubbingSupport.prototype.get control):
556         (ScrubbingSupport.prototype.get mediaEvents):
557         (ScrubbingSupport.prototype.controlValueWillStartChanging):
558         (ScrubbingSupport.prototype.controlValueDidChange):
559         (ScrubbingSupport.prototype.controlValueDidStopChanging):
560         (ScrubbingSupport.prototype.syncControl):
561         (ScrubbingSupport):
562         * WebCore.xcodeproj/project.pbxproj:
563
564 2016-10-28  Alex Christensen  <achristensen@webkit.org>
565
566         Fix Windows WebGL build after r208022
567         https://bugs.webkit.org/show_bug.cgi?id=164091
568
569         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
570         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
571         (WebCore::Extensions3DOpenGLES::Extensions3DOpenGLES):
572         * platform/graphics/opengl/Extensions3DOpenGLES.h:
573         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
574         (WebCore::GraphicsContext3D::getExtensions):
575
576 2016-10-27  Youenn Fablet  <youenn@apple.com>
577
578         [Fetch API] Fetch ReadableStream should only clone the second branch
579         https://bugs.webkit.org/show_bug.cgi?id=164058
580
581         Reviewed by Darin Adler.
582
583         Covered by rebased tests.
584
585         * Modules/streams/ReadableStreamInternals.js:
586         (readableStreamTeePullFunction):
587
588 2016-10-27  Alex Christensen  <achristensen@webkit.org>
589
590         Update ANGLE
591         https://bugs.webkit.org/show_bug.cgi?id=164101
592
593         Reviewed by Darin Adler.
594
595         ShCheckVariablesWithinPackingLimits has changed signatures from taking a ShVariableInfo* and length
596         to taking a std::vector<sh::ShaderVariable> which requires more information about the shader variables
597         than we kept in GraphicsContext3D::SymbolInfo.  I removed the SymbolInfo class because it was redundant
598         with ANGLE's sh::ShaderVariable and now unused.
599
600         Covered by existing WebGL tests.
601
602         * CMakeLists.txt:
603         * PlatformMac.cmake:
604         * PlatformWin.cmake:
605         * platform/graphics/ANGLEWebKitBridge.cpp:
606         (WebCore::appendSymbol):
607         (WebCore::getStructInfo):
608         (WebCore::getSymbolInfo):
609         (WebCore::ANGLEWebKitBridge::compileShaderSource):
610         * platform/graphics/ANGLEWebKitBridge.h:
611         (WebCore::ANGLEShaderSymbol::isSampler): Deleted.
612         * platform/graphics/GraphicsContext3D.h:
613         (WebCore::GraphicsContext3D::SymbolInfo::SymbolInfo): Deleted.
614         (WebCore::GraphicsContext3D::SymbolInfo::operator==): Deleted.
615         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
616         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
617         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
618         (WebCore::GraphicsContext3D::checkVaryingsPacking):
619         (WebCore::GraphicsContext3D::precisionsMatch):
620         (WebCore::GraphicsContext3D::mappedSymbolName):
621         (WebCore::GraphicsContext3D::originalSymbolName):
622
623 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
624
625         Remove RenderStyle::isRunningAcceleratedAnimation()
626         https://bugs.webkit.org/show_bug.cgi?id=164109
627
628         Reviewed by David Hyatt.
629
630         RenderStyle::isRunningAcceleratedAnimation() was added in r40876 to handle interrupted
631         accelerated transitions, and to allow RenderLayer::currentTransform() to know when it
632         has to manually get the animated style.
633         
634         The latter can now use isRunningAcceleratedAnimationOnRenderer(), and interrupting
635         accelerated transitions seems to work fine without it, so remove it.
636
637         * page/animation/ImplicitAnimation.cpp:
638         (WebCore::ImplicitAnimation::animate):
639         * page/animation/KeyframeAnimation.cpp:
640         (WebCore::KeyframeAnimation::animate):
641         * rendering/RenderLayer.cpp:
642         (WebCore::RenderLayer::currentTransform):
643         * rendering/style/RenderStyle.h:
644         (WebCore::RenderStyle::isRunningAcceleratedAnimation): Deleted.
645         (WebCore::RenderStyle::setIsRunningAcceleratedAnimation): Deleted.
646         * rendering/style/StyleRareNonInheritedData.cpp:
647         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
648         (WebCore::StyleRareNonInheritedData::operator==):
649         * rendering/style/StyleRareNonInheritedData.h:
650
651 2016-10-27  Myles C. Maxfield  <mmaxfield@apple.com>
652
653         Teach WebGL code about new buffer targets in WebGL2
654         https://bugs.webkit.org/show_bug.cgi?id=163924
655
656         Reviewed by Dean Jackson.
657
658         WebGL 2 adds new buffer targets. Instead of completely reimplementing
659         the functions again for WebGL 2, we can simply check if we are using
660         a new kind of context to conditionally enable support.
661
662         Test: fast/canvas/webgl/webgl2-buffer-targets.html
663
664         * html/canvas/WebGL2RenderingContext.h:
665         * html/canvas/WebGL2RenderingContext.idl:
666         * html/canvas/WebGLBuffer.cpp:
667         (WebCore::WebGLBuffer::associateBufferDataImpl):
668         (WebCore::WebGLBuffer::associateBufferSubDataImpl):
669         (WebCore::WebGLBuffer::setTarget):
670         * html/canvas/WebGLBuffer.h:
671         * html/canvas/WebGLRenderingContextBase.cpp:
672         (WebCore::WebGLRenderingContextBase::bindBuffer):
673         (WebCore::WebGLRenderingContextBase::getBufferParameter):
674         (WebCore::WebGLRenderingContextBase::validateBufferDataParameters):
675         * html/canvas/WebGLRenderingContextBase.h:
676
677 2016-10-27  Dave Hyatt  <hyatt@apple.com>
678
679         [CSS Parser] Enhance grid-auto-flow parsing to allow dense first.
680         https://bugs.webkit.org/show_bug.cgi?id=164110
681
682         Reviewed by Simon Fraser.
683
684         * css/StyleBuilderConverter.h:
685         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
686
687 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
688
689         constify the CSSValue arguments to StyleBuilderConverter functions
690         https://bugs.webkit.org/show_bug.cgi?id=164106
691
692         Reviewed by Zalan Bujtas.
693
694         Make almost all the CSSValue& arguments const (this makes it clear that they
695         are in params, not out params). Only a few that are CSSImageValues are non-const,
696         because they fall into a non-const code path.
697
698         * css/StyleBuilderConverter.h:
699         (WebCore::StyleBuilderConverter::convertLengthOrAuto):
700         (WebCore::StyleBuilderConverter::convertLengthSizing):
701         (WebCore::StyleBuilderConverter::convertLengthMaxSizing):
702         (WebCore::StyleBuilderConverter::convertComputedLength):
703         (WebCore::StyleBuilderConverter::convertLineWidth):
704         (WebCore::StyleBuilderConverter::convertSpacing):
705         (WebCore::StyleBuilderConverter::convertToRadiusLength):
706         (WebCore::StyleBuilderConverter::convertRadius):
707         (WebCore::StyleBuilderConverter::convertObjectPosition):
708         (WebCore::StyleBuilderConverter::convertTextDecoration):
709         (WebCore::StyleBuilderConverter::convertNumber):
710         (WebCore::StyleBuilderConverter::convertNumberOrAuto):
711         (WebCore::StyleBuilderConverter::convertWebkitHyphenateLimitLines):
712         (WebCore::StyleBuilderConverter::convertTransform):
713         (WebCore::StyleBuilderConverter::convertString):
714         (WebCore::StyleBuilderConverter::convertStringOrAuto):
715         (WebCore::StyleBuilderConverter::convertStringOrNone):
716         (WebCore::StyleBuilderConverter::valueToEmphasisPosition):
717         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
718         (WebCore::StyleBuilderConverter::convertTextAlign):
719         (WebCore::StyleBuilderConverter::convertClipPath):
720         (WebCore::StyleBuilderConverter::convertResize):
721         (WebCore::StyleBuilderConverter::convertMarqueeRepetition):
722         (WebCore::StyleBuilderConverter::convertMarqueeSpeed):
723         (WebCore::StyleBuilderConverter::convertQuotes):
724         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
725         (WebCore::StyleBuilderConverter::convertReflection):
726         (WebCore::StyleBuilderConverter::convertInitialLetter):
727         (WebCore::StyleBuilderConverter::convertTextStrokeWidth):
728         (WebCore::StyleBuilderConverter::convertLineBoxContain):
729         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
730         (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
731         (WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
732         (WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
733         (WebCore::StyleBuilderConverter::createGridTrackBreadth):
734         (WebCore::StyleBuilderConverter::createGridTrackSize):
735         (WebCore::StyleBuilderConverter::createGridTrackList):
736         (WebCore::StyleBuilderConverter::createGridPosition):
737         (WebCore::StyleBuilderConverter::convertGridTrackSizeList):
738         (WebCore::StyleBuilderConverter::convertGridTrackSize):
739         (WebCore::StyleBuilderConverter::convertGridPosition):
740         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
741         (WebCore::StyleBuilderConverter::convertWordSpacing):
742         (WebCore::StyleBuilderConverter::convertPerspective):
743         (WebCore::StyleBuilderConverter::convertMarqueeIncrement):
744         (WebCore::StyleBuilderConverter::convertFilterOperations):
745         (WebCore::StyleBuilderConverter::convertFontFeatureSettings):
746         (WebCore::StyleBuilderConverter::convertFontVariationSettings):
747         (WebCore::StyleBuilderConverter::convertTouchCallout):
748         (WebCore::StyleBuilderConverter::convertTapHighlightColor):
749         (WebCore::StyleBuilderConverter::convertOverflowScrolling):
750         (WebCore::StyleBuilderConverter::convertSVGLength):
751         (WebCore::StyleBuilderConverter::convertSVGLengthVector):
752         (WebCore::StyleBuilderConverter::convertStrokeDashArray):
753         (WebCore::StyleBuilderConverter::convertPaintOrder):
754         (WebCore::StyleBuilderConverter::convertOpacity):
755         (WebCore::StyleBuilderConverter::convertSVGURIReference):
756         (WebCore::StyleBuilderConverter::convertSVGColor):
757         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
758         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
759         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
760         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
761         (WebCore::StyleBuilderConverter::convertLineHeight):
762         (WebCore::StyleBuilderConverter::convertFontSynthesis):
763         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
764         (WebCore::StyleBuilderConverter::convertPageBreakInside):
765         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
766         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
767         (WebCore::StyleBuilderConverter::convertRegionBreakBetween):
768         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
769         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
770
771 2016-10-27  Dave Hyatt  <hyatt@apple.com>
772
773         [CSS Parser] Add support for a reference box to -webkit-clip-path
774         https://bugs.webkit.org/show_bug.cgi?id=164107
775
776         Reviewed by Simon Fraser.
777
778         * css/parser/CSSPropertyParser.cpp:
779         (WebCore::consumeBasicShape):
780         (WebCore::consumeBasicShapeOrBox):
781         (WebCore::consumeWebkitClipPath):
782
783 2016-10-27  Yusuke Suzuki  <utatane.tea@gmail.com>
784
785         [DOM] Add JSEventType
786         https://bugs.webkit.org/show_bug.cgi?id=164096
787
788         Reviewed by Darin Adler.
789
790         Event is inherited by many Event classes. But, Event's accessors and interfaces are
791         frequently called. For example, event.{type, target, srcElement} for accessors. And
792         event.stopPropagation() and event.preventDefault() functions.
793
794         However, since the user-visible event instance is typically the instance of the subclass,
795         jsDynamicCast<JSEvent*>() walks several classes before it succeeds. It is costly.
796
797         In this patch, we add a new WebCore JSType JSEventType for JSEvent and add a new
798         function jsEventCast. That supports a super fast cast operation. And it paves the way
799         for implementing DOM accessors of Event in DOMJIT.
800
801         No behavior change.
802
803         * WebCore.xcodeproj/project.pbxproj:
804         * bindings/js/JSDOMWrapper.h:
805         * bindings/js/JSEventCustom.h: Added.
806         (WebCore::jsEventCast):
807         * bindings/scripts/CodeGeneratorJS.pm:
808         (GetJSTypeForNode):
809         (GenerateHeader):
810         (GetCastingHelperForThisObject):
811         * bindings/scripts/test/JS/JSTestEventConstructor.h:
812         (WebCore::JSTestEventConstructor::createStructure):
813         * dom/Event.idl:
814         * domjit/DOMJITHelpers.h:
815         (WebCore::DOMJIT::branchIfEvent):
816         (WebCore::DOMJIT::branchIfNotEvent):
817
818 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
819
820         Rename StyleRareNonInheritedData::opacity to m_opacity
821         https://bugs.webkit.org/show_bug.cgi?id=164104
822
823         Reviewed by Dave Hyatt.
824
825         Pure rename.
826
827         * rendering/style/RenderStyle.cpp:
828         (WebCore::RenderStyle::changeRequiresLayerRepaint):
829         * rendering/style/RenderStyle.h:
830         (WebCore::RenderStyle::opacity):
831         (WebCore::RenderStyle::setOpacity):
832         * rendering/style/StyleRareNonInheritedData.cpp:
833         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
834         (WebCore::StyleRareNonInheritedData::operator==):
835         * rendering/style/StyleRareNonInheritedData.h:
836         (WebCore::StyleRareNonInheritedData::hasOpacity):
837
838 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
839
840         If an animation's keyframes affect stacking context properties, create stacking context while the animation is running
841         https://bugs.webkit.org/show_bug.cgi?id=164094
842
843         Reviewed by Dean Jackson.
844
845         The CSS animations spec <https://drafts.csswg.org/css-animations-1/> now makes it
846         clear that a keyframe animation animating properties which can affect stacking context
847         should establish stacking context while it's running, or filling-forwards. This is part
848         of the "the user agent must act as if the will-change property...includes all the properties
849         animated by the animation" clause.
850
851         Implement by having CompositeAnimation::animate() track whether running animations should
852         create stacking context, replacing existing code in AnimationController::updateAnimations()
853         which only looked at opacity and transform. Transitions are also checked to see if they need
854         to trigger stacking context.
855
856         This allows for the removal of a 0.9999 hack when blending opacity.
857
858         Tests: animations/stacking-context-fill-forwards.html
859                animations/stacking-context-not-fill-forwards.html
860                animations/stacking-context-unchanged-while-running.html
861
862         * page/animation/AnimationController.cpp:
863         (WebCore::AnimationController::updateAnimations):
864         * page/animation/CSSPropertyAnimation.cpp:
865         * page/animation/CompositeAnimation.cpp:
866         (WebCore::CompositeAnimation::animate):
867         * page/animation/KeyframeAnimation.cpp:
868         (WebCore::KeyframeAnimation::KeyframeAnimation):
869         (WebCore::KeyframeAnimation::computeStackingContextImpact):
870         (WebCore::KeyframeAnimation::animate):
871         * page/animation/KeyframeAnimation.h:
872         * rendering/RenderLayer.cpp:
873         (WebCore::RenderLayer::currentTransform):
874         * rendering/style/WillChangeData.cpp:
875         (WebCore::WillChangeData::propertyCreatesStackingContext):
876         (WebCore::propertyCreatesStackingContext): Deleted.
877         * rendering/style/WillChangeData.h:
878
879 2016-10-27  Sam Weinig  <sam@webkit.org>
880
881         [WebIDL] Move code generators off of domSignature::type and onto domSignature::idlType
882         https://bugs.webkit.org/show_bug.cgi?id=164089
883
884         Reviewed by Alex Christensen.
885
886         Make more IDLParser structures contain domTypes for type descriptions, rather than strings:
887         - domInterface gains type and parentType.
888         - domConstant gains type.
889         - domEnum gains type.
890         - domDictionary gains type and parentType.
891
892         With these structs now containing domTypes, we can update the CodeGenerators to operate on
893         domTypes exclusively, rather than types as strings. This allows us to consistently have access
894         to information such as subtypes and nullability.
895
896         * bindings/scripts/CodeGenerator.pm:
897         Update helpers to operate of domTypes. The one exception is SkipIncludeHeader, which
898         still operates on a type name, since it is called late in code generation on the textual
899         form of type names in the include list. 
900
901         * bindings/scripts/CodeGeneratorJS.pm:
902         Update to use domTypes.
903
904         * bindings/scripts/IDLParser.pm:
905         - Add domType accessors to domInterface, domConstant, domEnum, and domDictionary
906           and populate them.
907         - Remove type accessors from domSignature (domType is accessible from idlType).
908         - Remove special cases for sequence and FrozenArray, now that they are always
909           accessed as domTypes.
910
911         * html/HTMLEmbedElement.idl:
912         * html/HTMLFrameElement.idl:
913         * html/HTMLFrameOwnerElement.cpp:
914         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
915         * html/HTMLFrameOwnerElement.h:
916         * html/HTMLIFrameElement.idl:
917         * html/HTMLObjectElement.idl:
918         Fix interfaces declaring getSVGDocument() to correctly have it return
919         a Document, rather than an SVGDocument, which does exist anymore. To
920         make the bindings happy, also change the signature of HTMLFrameOwnerElement::getSVGDocument
921         to return a Document.
922
923         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
924         * bindings/scripts/test/JS/JSTestInterface.cpp:
925         * bindings/scripts/test/JS/JSTestObj.cpp:
926         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
927         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
928         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
929         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
930         Update test results to remove some redundant headers (Already included JSFoo.h, so no need for Foo.h).
931
932 2016-10-27  Myles C. Maxfield  <mmaxfield@apple.com>
933
934         [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
935         https://bugs.webkit.org/show_bug.cgi?id=164091
936
937         Reviewed by Dean Jackson.
938
939         In order to test WebGL2 correctly, I had to upgrade the macOS's OpenGL 
940         context to a 3.2-compatible context to make sure the new symbols are
941         accepted. Eventually, this 3.2-compatible context will have to be
942         reverted and replaced with an ANGLE context. The current 3.2-compatible
943         context is just for testing.
944
945         Test: fast/canvas/webgl/webgl2-context-creation.html
946
947         * html/canvas/WebGLBuffer.cpp: Use "nullptr" instead of 0.
948         (WebCore::WebGLBuffer::associateBufferData):
949         * html/canvas/WebGLRenderingContextBase.cpp: Use make_unique() instead
950         of the unique_ptr constructor.
951         (WebCore::WebGLRenderingContextBase::create):
952         * platform/graphics/GraphicsContext3D.h: GraphicsContext should know
953         if it is using a 3.2-compatible context because some parts of 2.1 are
954         removed in these contexts, and replaced with new things which aren't
955         in 2.1.
956         * platform/graphics/mac/GraphicsContext3DMac.mm:
957         (WebCore::setPixelFormat): Use kCGLPFAOpenGLProfile to specify an
958         OpenGL 3.2 context.
959         (WebCore::GraphicsContext3D::GraphicsContext3D): GL_CLAMP is deprecated
960         in OpenGL 3.2. Fortunately, GL_CLAMP_TO_EDGE isn't deprecated and does
961         exactly what we want. In OpenGL3.2, point sprites are always enabled,
962         so there's no need to enable them in those contexts.
963         (WebCore::GraphicsContext3D::isGLES2Compliant):
964         * platform/graphics/opengl/Extensions3DOpenGL.cpp: In OpenGL 3.2,
965         glGetString() no longer accepts GL_EXTENSIONS. Instead, glGetStringi()
966         is used instead. Unfortunately, glGetString() is not available in
967         OpenGL 2.1 contexts, so we need to use one or the other based on the
968         version of the context we're using.
969         (WebCore::Extensions3DOpenGL::Extensions3DOpenGL):
970         (WebCore::Extensions3DOpenGL::getExtensions):
971         * platform/graphics/opengl/Extensions3DOpenGL.h:
972         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
973         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
974         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
975         Instead of modifying getExtensions() to use glGetStringi(), it makes
976         better sense to modify this function because getExtensions() returns
977         a string. Building up a string just to split it up again is silly, so
978         modifying this function instead makes more sense.
979         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
980         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
981         (WebCore::GraphicsContext3D::getIntegerv): GL_MAX_VARYING_FLOATS is
982         removed in OpenGL 3.2 contexts. However, it is replaced by
983         GL_MAX_VARYING_COMPONENTS, though this is deprecated but not removed.
984         In the more recent OpenGL context versions, GL_MAX_VARYING_VECTORS is
985         recommended instead, but that isn't available in OpenGL 3.2.
986         (WebCore::GraphicsContext3D::getExtensions):
987
988 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
989
990         Add support for wide gamut for ShareableBitmap for image popovers
991         https://bugs.webkit.org/show_bug.cgi?id=164001
992
993         Reviewed by Simon Fraser.
994
995         Add a function to return a CGColorSpaceRef for extended sRGB.
996
997         This is currently untestable, so no tests added.
998
999         * platform/graphics/cg/GraphicsContextCG.cpp:
1000         (WebCore::extendedSRGBColorSpaceRef):
1001
1002 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
1003
1004         [Win][Direct2D] Create a RAII Helper Class for the Render Target
1005         https://bugs.webkit.org/show_bug.cgi?id=164005
1006
1007         Reviewed by Alex Christensen.
1008
1009         Tested by existing SVG, image, and Canvas layout tests.
1010
1011         * platform/graphics/GraphicsContext.h:
1012         * platform/graphics/win/GradientDirect2D.cpp:
1013         (WebCore::Gradient::fill): Use new convenience helper class.
1014         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1015         (WebCore::GraphicsContext::didBeginDraw):
1016         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
1017         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Add an
1018         assertion that we are in a valid state when cleaning up the graphics context.
1019         (WebCore::GraphicsContextPlatformPrivate::clip): Clipping can only happen in a Draw operation.
1020         Open a new BeginDraw if asked to Clip. The Begin must stay active when this method returns,
1021         as the Clip layer is only valid during a Draw operation.
1022         (WebCore::GraphicsContextPlatformPrivate::beginDraw): Added.
1023         (WebCore::GraphicsContextPlatformPrivate::endDraw): Added.
1024         (WebCore::GraphicsContext::beginDrawIfNeeded): Added.
1025         (WebCore::GraphicsContext::endDraw): Added.
1026         (WebCore::GraphicsContext::drawWithoutShadow): Revise to use new RenderTargetHelper class.
1027         (WebCore::GraphicsContext::drawWithShadow): Ditto.
1028         (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
1029         (WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
1030         (WebCore::GraphicsContext::setDidBeginDraw): Deleted.
1031         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
1032         (WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Revise to use count instead of
1033         a separate boolean.
1034         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1035         (WebCore::ImageBufferData::getData): Revise to use new RenderTargetHelper class.
1036         * platform/graphics/win/NativeImageDirect2D.cpp:
1037         (WebCore::drawNativeImage): Ditto.
1038         * platform/graphics/win/RenderTargetHelper.h: Added.
1039         (WebCore::RenderTargetHelper::RenderTargetHelper):
1040         (WebCore::RenderTargetHelper::~RenderTargetHelper):
1041         (WebCore::RenderTargetHelper::endDraw):
1042         * svg/graphics/SVGImage.cpp:
1043         (WebCore::SVGImage::nativeImage): Revise to use new RenderTargetHelper class.
1044
1045 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1046
1047         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
1048         https://bugs.webkit.org/show_bug.cgi?id=163948
1049         <rdar://problem/28921433>
1050
1051         Reviewed by Darin Adler.
1052
1053         Implements support for "insertFromDrop" and "deleteByDrag" inputTypes. These are fired when dragging and
1054         dropping text in editable areas. To do this, we introduce EditActionInsertFromDrop and EditActionDeleteByDrag
1055         (renamed from EditActionDrag, which is no longer necessary after this patch).
1056
1057         When moving text from an editable element to another, we will use a DeleteSelectionCommand to delete the text
1058         from the source element and a ReplaceSelectionCommand to insert the text into the destination element. This
1059         means that we currently fire two input events on the source and destination elements (i.e. given by the start
1060         and end selections) after both child editing commands of the MoveSelectionCommand have been applied. Instead, we
1061         need to fire events in this order:
1062
1063         1. beforeinput ("deleteByDrag") on the source
1064         2. Update DOM
1065         3. input ("deleteByDrag") on the source
1066
1067         4. beforeinput ("insertFromDrop") on the destination
1068         5. Update DOM
1069         6. input ("insertFromDrop") on the destination
1070
1071         To accomplish this, we allow an edit command to defer dispatching input events to its child commands via
1072         CompositeEditCommand::shouldDispatchInputEvents, which the MoveSelectionCommand overrides. Additionally,
1073         when applying the MoveSelectionCommand, we now apply() the child DeleteSelectionCommand and
1074         ReplaceSelectionCommand instead of using doApply(). This allows these children to separately dispatch input
1075         events, and also handle preventDefault() separately.
1076
1077         Tests: fast/events/before-input-events-prevent-drag-and-drop.html
1078                fast/events/input-events-drag-and-drop.html
1079                fast/events/input-events-insert-by-drop.html
1080
1081         * editing/CompositeEditCommand.cpp:
1082         (WebCore::CompositeEditCommand::apply):
1083         (WebCore::CompositeEditCommand::composition):
1084
1085         Searches for the top-level command and returns its composition. Also ASSERTs that the m_command of all child
1086         commands along the way is null. In places where we used to ASSERT that command.composition() should be null, we
1087         now perform the assertion here instead.
1088
1089         * editing/CompositeEditCommand.h:
1090         (WebCore::CompositeEditCommand::shouldDispatchInputEvents):
1091
1092         This is true by default, which means that if apply() is called for a composite edit command that does not
1093         override this to return false, it will try to dispatch input events. In most cases, the parent command will call
1094         on the child command to doApply(), bypassing this check.
1095
1096         (WebCore::CompositeEditCommand::composition): Deleted.
1097         * editing/EditAction.h:
1098         * editing/EditCommand.cpp:
1099         (WebCore::inputTypeNameForEditingAction):
1100         (WebCore::EditCommand::isEditingTextAreaOrTextInput):
1101         (WebCore::EditCommand::setStartingSelection):
1102         (WebCore::EditCommand::setEndingSelection):
1103         (WebCore::EditCommand::setParent):
1104         * editing/Editor.cpp:
1105         (WebCore::Editor::willApplyEditing):
1106         (WebCore::Editor::appliedEditing):
1107
1108         After applying editing, only adjust the current selection and notify clients of selection change if the applied
1109         command was a top-level command; otherwise, these actions should wait until all child commands of the top-level
1110         command have been applied. In particular, we should not register the applied command as an undo step.
1111
1112         * editing/MoveSelectionCommand.cpp:
1113         (WebCore::MoveSelectionCommand::doApply):
1114         (WebCore::MoveSelectionCommand::editingAction):
1115         * editing/MoveSelectionCommand.h:
1116         * page/DragController.cpp:
1117         (WebCore::DragController::concludeEditDrag):
1118
1119         For the cases where we're not deleting text from the drag source (i.e. we're just applying a
1120         ReplaceSelectionCommand) pass in EditActionInsertFromDrop as the EditAction when creating the command.
1121
1122 2016-10-27  Per Arne Vollan  <pvollan@apple.com>
1123
1124         [Win][Direct2D] Implement GraphicsContext::releaseWindowsContext.
1125         https://bugs.webkit.org/show_bug.cgi?id=163988
1126
1127         Reviewed by Brent Fulgham.
1128
1129         This method is needed to draw native controls.
1130
1131         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1132         (WebCore::GraphicsContext::releaseWindowsContext):
1133
1134 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1135
1136         Web Inspector: Worker should recover if Inspector is closed and never sent Worker.initialized command
1137         https://bugs.webkit.org/show_bug.cgi?id=164073
1138
1139         Reviewed by Brian Burg.
1140
1141         Test: inspector/worker/worker-recover-if-inspector-close.html
1142
1143         * workers/WorkerInspectorProxy.cpp:
1144         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
1145         Ensure we stop the debugger only task loop if needed when the last debugger
1146         message comes in.
1147
1148 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1149
1150         Web Inspector: Include ConsoleAgent in Workers - real console.log support
1151         https://bugs.webkit.org/show_bug.cgi?id=163844
1152         <rdar://problem/28903328>
1153
1154         Reviewed by Brian Burg.
1155
1156         Test: inspector/worker/console-basic.html
1157
1158         This introduces a real ConsoleAgent in the Worker InspectorController.
1159         We no longer need to pass partial ConsoleMessage objects to be logged
1160         through the Page, we can just send the full ConsoleMessages to a
1161         frontend once it connects to the Worker.
1162
1163         In order to guarantee that the Worker InspectorController is properly
1164         all Workers will start paused if there is an Inspector attached to
1165         the Page. The frontend _must_ call the new Worker.initialized method
1166         after sending its setup commands to the Worker. This ensures we get
1167         handle all initialization commands (like Agent.enable(), and
1168         setting state like breakpoints) before any script executes in the
1169         Worker. This mirrors the Inspector.initialized method that does the
1170         same thing for JSContext auto-attach of the Main target.
1171
1172         In the backend, the wait until initialized state is just running
1173         the WorkerThread's RunLoop in a special debugger mode to only process
1174         debugger commands until we are ready. This will effectively be
1175         the same as pausing so it is generalized into WorkerThread.
1176
1177         * CMakeLists.txt:
1178         * WebCore.xcodeproj/project.pbxproj:
1179         * inspector/InspectorAllInOne.cpp:
1180         New files.
1181
1182         * inspector/InspectorWorkerAgent.cpp:
1183         (WebCore::InspectorWorkerAgent::initialized):
1184         (WebCore::InspectorWorkerAgent::shouldWaitForDebuggerOnStart):
1185         * inspector/InspectorWorkerAgent.h:
1186         Add the new initialized method. This just uses the proxy to send
1187         a message to be handled on the Worker Thread and unpause.
1188
1189         * inspector/WorkerConsoleAgent.cpp:
1190         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
1191         (WebCore::WorkerConsoleAgent::addInspectedNode):
1192         * inspector/WorkerConsoleAgent.h:
1193         * inspector/WorkerInspectorController.cpp:
1194         (WebCore::WorkerInspectorController::WorkerInspectorController):
1195         Add a ConsoleAgent to WorkerInspectorController.
1196
1197         * workers/WorkerInspectorProxy.h:
1198         * workers/WorkerInspectorProxy.cpp:
1199         (WebCore::WorkerInspectorProxy::workerStartMode):
1200         (WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
1201         (WebCore::WorkerInspectorProxy::connectToWorkerInspector):
1202         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
1203         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
1204         Use the debugger mode when sending messages to the WorkerThread.
1205
1206         * workers/Worker.cpp:
1207         (WebCore::Worker::notifyFinished):
1208         * workers/WorkerMessagingProxy.cpp:
1209         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1210         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject): Deleted.
1211         * workers/WorkerMessagingProxy.h:
1212         * workers/WorkerReportingProxy.h:
1213         * workers/WorkerGlobalScope.cpp:
1214         (WebCore::WorkerGlobalScope::addConsoleMessage):
1215         (WebCore::WorkerGlobalScope::addMessage):
1216         * workers/WorkerGlobalScope.h:
1217         * workers/WorkerGlobalScopeProxy.h:
1218         Remove legacy partial console support.
1219
1220         * workers/WorkerRunLoop.h:
1221         * workers/WorkerRunLoop.cpp:
1222         (WebCore::WorkerRunLoop::debuggerMode):
1223         * workers/WorkerThread.h:
1224         * workers/WorkerThread.cpp:
1225         (WebCore::WorkerThread::workerThread):
1226         (WebCore::WorkerThread::startRunningDebuggerTasks):
1227         (WebCore::WorkerThread::stopRunningDebuggerTasks):
1228         General code for spinning the WorkerThread and only processing debugger
1229         (Inspector) commands. Use this when starting the thread to ensure the
1230         frontend initializes the Worker's Agents before any JavaScript executes.
1231
1232         * page/PageConsoleClient.cpp:
1233         * workers/WorkerConsoleClient.cpp:
1234         (WebCore::WorkerConsoleClient::count):
1235         (WebCore::WorkerConsoleClient::time):
1236         (WebCore::WorkerConsoleClient::timeEnd):
1237         * inspector/InspectorConsoleInstrumentation.h: Removed.
1238         * inspector/InspectorInstrumentation.cpp:
1239         (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
1240         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
1241         (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStartImpl):
1242         * inspector/InspectorInstrumentation.h:
1243         (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
1244         (WebCore::InspectorInstrumentation::addMessageToConsole):
1245         (WebCore::InspectorInstrumentation::consoleCount):
1246         (WebCore::InspectorInstrumentation::takeHeapSnapshot):
1247         (WebCore::InspectorInstrumentation::startConsoleTiming):
1248         (WebCore::InspectorInstrumentation::stopConsoleTiming):
1249         (WebCore::InspectorInstrumentation::consoleTimeStamp):
1250         (WebCore::InspectorInstrumentation::startProfiling):
1251         (WebCore::InspectorInstrumentation::stopProfiling):
1252         Implement a few more basic console APIs that required ConsoleAgent.
1253
1254 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1255
1256         Web Inspector: Include RuntimeAgent in Workers - evaluate in Worker context
1257         https://bugs.webkit.org/show_bug.cgi?id=163835
1258         <rdar://problem/28901465>
1259
1260         Reviewed by Brian Burg.
1261
1262         Tests: inspector/unit-tests/target-manager.html
1263                inspector/worker/runtime-basic.html
1264
1265         * CMakeLists.txt:
1266         * WebCore.xcodeproj/project.pbxproj:
1267         * inspector/InspectorAllInOne.cpp:
1268         New file.
1269
1270         * inspector/InspectorWebAgentBase.h:
1271         (WebCore::WorkerAgentContext::WorkerAgentContext):
1272         New agent context creation struct for Workers.
1273
1274         * inspector/WorkerInspectorController.cpp:
1275         (WebCore::WorkerInspectorController::WorkerInspectorController):
1276         Create a RuntimeAgent for Workers.
1277
1278         * inspector/WorkerRuntimeAgent.cpp: Added.
1279         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
1280         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
1281         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
1282         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
1283         * inspector/WorkerRuntimeAgent.h: Added.
1284         Workers currently only ever have a single execution context.
1285
1286 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1287
1288         Web Inspector: Introduce Page WorkerAgent and Worker InspectorController
1289         https://bugs.webkit.org/show_bug.cgi?id=163817
1290         <rdar://problem/28899063>
1291
1292         Reviewed by Brian Burg.
1293
1294         Test: inspector/worker/worker-create-and-terminate.html
1295
1296         From the perspective of an Inspector frontend, Workers are
1297         like a special JavaScript context, separate from the page, that
1298         may have its own set of Agents. This patch adds the necessary
1299         backend infrastructure to provide WorkerGlobalObject with an
1300         InspectorController and the means to communicate with a frontend
1301         through a Page's WorkerAgent.
1302
1303         Pages now get a WorkerAgent. This informs the frontend about
1304         created and terminated Workers. It also provides a communication
1305         channel to dispatch and return inspector protocol messages to
1306         each of the Workers. The Page side always interacts with the
1307         WorkerInspectorProxy on the main thread. The Page's Worker Agent
1308         can sends and receives messages to WorkerInspectorControllers.
1309
1310         WorkerGlobalScopes now get a WorkerInspectorController which
1311         will eventually contain its own set of agents. There are no
1312         agents yet, but they will be added individually in follow-up
1313         patches. The Worker side always interacts with the
1314         WorkerGlobalScope on the worker thread. WorkerInspectorController
1315         dispatches messages on its agents.
1316
1317         All communication with Worker agents goes through Worker.sendMessageToWorker,
1318         which tunnels the command request to the Worker's InspectorController
1319         and agents. At the protocol level, worker agent command responses and
1320         worker agent events are sent as events through Worker.dispatchMessageFromWorker.
1321         On the frontend, the message dispatcher code will pair up replies with
1322         their commands, and no-reply messages as events, like normal. So calling
1323         worker agent methods in the frontend will be no different from the
1324         existing callback/promise-based ways.
1325
1326         * CMakeLists.txt:
1327         * WebCore.xcodeproj/project.pbxproj:
1328         * inspector/InspectorAllInOne.cpp:
1329         Add new files.
1330
1331         * bindings/js/WorkerScriptController.cpp:
1332         (WebCore::WorkerScriptController::WorkerScriptController):
1333         (WebCore::WorkerScriptController::initScript):
1334         * bindings/js/WorkerScriptController.h:
1335         Some cleanup.
1336
1337         * inspector/InspectorController.cpp:
1338         (WebCore::InspectorController::InspectorController):
1339         * inspector/InspectorController.h:
1340         * inspector/InstrumentingAgents.cpp:
1341         (WebCore::InstrumentingAgents::reset):
1342         * inspector/InstrumentingAgents.h:
1343         (WebCore::InstrumentingAgents::inspectorWorkerAgent):
1344         (WebCore::InstrumentingAgents::setInspectorWorkerAgent):
1345         * inspector/InspectorInstrumentation.cpp:
1346         (WebCore::InspectorInstrumentation::workerStartedImpl):
1347         (WebCore::InspectorInstrumentation::workerTerminatedImpl):
1348         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
1349         * inspector/InspectorInstrumentation.h:
1350         (WebCore::InspectorInstrumentation::workerStarted):
1351         (WebCore::InspectorInstrumentation::workerTerminated):
1352         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
1353         Give the Page a WorkerAgent and Instrumentation methods for
1354         Worker creation and termination.
1355
1356         * inspector/InspectorWorkerAgent.h: Added.
1357         * inspector/InspectorWorkerAgent.cpp: Added.
1358         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
1359         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
1360         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
1361         (WebCore::InspectorWorkerAgent::enable):
1362         (WebCore::InspectorWorkerAgent::disable):
1363         (WebCore::InspectorWorkerAgent::workerStarted):
1364         (WebCore::InspectorWorkerAgent::workerTerminated):
1365         (WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage):
1366         (WebCore::InspectorWorkerAgent::disconnectFromAllWorkerInspectorProxies):
1367         (WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
1368         (WebCore::InspectorWorkerAgent::disconnectFromWorkerInspectorProxy):
1369         Handle connecting to Workers. This performs the "connectFrontend"
1370         and "disconnectFrontend" dance with each Worker's InspectorController.
1371         We only connect to workers when the Worker domain is enabled.
1372
1373         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
1374         (WebCore::InspectorWorkerAgent::sendMessageFromWorkerToFrontend):
1375         Proxying messages to individual messages happens through the
1376         WorkerInspectorProxy. That takes care of passing messages
1377         across threads for us.
1378
1379         * workers/WorkerInspectorProxy.cpp: Added.
1380         (WebCore::WorkerInspectorProxy::allWorkerInspectorProxies):
1381         (WebCore::WorkerInspectorProxy::WorkerInspectorProxy):
1382         (WebCore::WorkerInspectorProxy::~WorkerInspectorProxy):
1383         (WebCore::WorkerInspectorProxy::workerStarted):
1384         (WebCore::WorkerInspectorProxy::workerTerminated):
1385         (WebCore::WorkerInspectorProxy::connectToWorkerInspector):
1386         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
1387         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
1388         (WebCore::WorkerInspectorProxy::sendMessageFromWorkerToFrontend):
1389         * workers/WorkerInspectorProxy.h: Added.
1390         (WebCore::WorkerInspectorProxy::PageChannel::~PageChannel):
1391         (WebCore::WorkerInspectorProxy::url):
1392         (WebCore::WorkerInspectorProxy::identifier):
1393         (WebCore::WorkerInspectorProxy::scriptExecutionContext):
1394         The WorkerInspectorProxy simplifies the cross thread communication
1395         between the Page Inspector and Worker Inspector. It also provides
1396         a clean interface between the two sides.
1397
1398         * inspector/WorkerToPageFrontendChannel.h: Added.
1399         * inspector/WorkerInspectorController.h: Added.
1400         * inspector/WorkerInspectorController.cpp: Added.
1401         (WebCore::WorkerInspectorController::WorkerInspectorController):
1402         (WebCore::WorkerInspectorController::~WorkerInspectorController):
1403         (WebCore::WorkerInspectorController::workerTerminating):
1404         (WebCore::WorkerInspectorController::connectFrontend):
1405         (WebCore::WorkerInspectorController::disconnectFrontend):
1406         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
1407         (WebCore::WorkerInspectorController::functionCallHandler):
1408         (WebCore::WorkerInspectorController::evaluateHandler):
1409         (WebCore::WorkerInspectorController::vm):
1410         A basic InspectorController for a WorkerGlobalScope.
1411         No agents yet, they will come soon.
1412
1413         * inspector/WorkerScriptDebugServer.h:
1414         * inspector/WorkerScriptDebugServer.cpp:
1415         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
1416         (WebCore::WorkerScriptDebugServer::attachDebugger):
1417         (WebCore::WorkerScriptDebugServer::detachDebugger):
1418         (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
1419         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
1420         (WebCore::WorkerScriptDebugServer::reportException):
1421         (WebCore::WorkerScriptDebugServer::interruptAndRunTask):
1422         A basic WorkerScriptDebug server for a WorkerGlobalScope.
1423         Not really used until we implement DebuggerAgent, but needed for InspectorEnvironment.
1424
1425         * workers/WorkerGlobalScope.cpp:
1426         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1427         * workers/WorkerGlobalScope.h:
1428         (WebCore::WorkerGlobalScope::inspectorController):
1429         Give the WorkerGlobalScope an InspectorController.
1430
1431         * workers/WorkerThread.cpp:
1432         (WebCore::WorkerThread::stop):
1433         Ensure the Worker InspectorController is immediately on
1434         the WorkerThread when it is about to be closed.
1435
1436         * workers/WorkerMessagingProxy.cpp:
1437         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
1438         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1439         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
1440         (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
1441         (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):
1442         * workers/WorkerMessagingProxy.h:
1443         * workers/WorkerReportingProxy.h:
1444         Call into the WorkerInspectorProxy for any inspector related logic,
1445         such as creation, termination, and messages received from the Worker.
1446
1447 2016-10-27  Dave Hyatt  <hyatt@apple.com>
1448
1449         [CSS Parser] Implement CSS variables
1450         https://bugs.webkit.org/show_bug.cgi?id=164075
1451
1452         Reviewed by Dean Jackson.
1453
1454         * CMakeLists.txt:
1455         * WebCore.xcodeproj/project.pbxproj:
1456         Add CSSCustomPropertyValue.cpp to the project.
1457
1458         * css/CSSCustomPropertyValue.cpp: Added.
1459         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
1460         (WebCore::CSSCustomPropertyValue::resolveVariableReferences):
1461         * css/CSSCustomPropertyValue.h:
1462         These functions abstract the old and new implementations of CSS
1463         variables so that the callers don't have to worry about it.
1464
1465         * css/CSSValue.cpp:
1466         (WebCore::CSSValue::equals):
1467         Make sure CSSVariableReferenceValue and CSSPendingSubstitutionValue
1468         have equals implemented.
1469
1470         (WebCore::CSSValue::isInvalidCustomPropertyValue): Deleted.
1471         This code was dead and never called.
1472
1473         * css/CSSValue.h:
1474         (WebCore::CSSValue::isCustomPropertyValue):
1475         (WebCore::CSSValue::hasVariableReferences):
1476         Add a helper function for asking if a CSSValue has variable references.
1477         This abstracts the old and new implementations so that callers can
1478         ask if the value has variables without caring which implementation is
1479         being used.
1480
1481         * css/CSSValueList.cpp:
1482         (WebCore::CSSValueList::checkVariablesForCycles):
1483         * css/CSSValueList.h:
1484         In order to abstract the old and new variables implementations, custom
1485         properties now store CSSCustomPropertyValue as their values instead of
1486         raw values. The old implementation needs to be patched to deal with this
1487         wrapper being present now.
1488
1489         * css/CSSVariableData.cpp:
1490         (WebCore::CSSVariableData::checkVariablesForCycles):
1491         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
1492         (WebCore::CSSVariableData::resolveVariableFallback):
1493         (WebCore::CSSVariableData::resolveVariableReference):
1494         (WebCore::CSSVariableData::resolveVariableReferences):
1495         (WebCore::CSSVariableData::resolveTokenRange):
1496         * css/CSSVariableData.h:
1497         Implementation of cycle checking and variable resolution. The logic of
1498         this implementation is the same as the old. It walks CSSParserTokens
1499         instead of the old CSSParser structures.
1500
1501         * css/CSSVariableReferenceValue.cpp:
1502         (WebCore::CSSVariableReferenceValue::customCSSText):
1503         Add support for serialization caching, just like the old implementation
1504         had in CSSVariableDependentValue.
1505
1506         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles):
1507         * css/CSSVariableReferenceValue.h:
1508         Add cycle checking and variable resolution helper functions.
1509
1510         * css/CSSVariableValue.cpp:
1511         (WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
1512         Patched to account for the change in storage of custom properties to
1513         have custom property value wrappers.
1514
1515         * css/StyleProperties.cpp:
1516         (WebCore::StyleProperties::getPropertyValue):
1517         (WebCore::StyleProperties::borderSpacingValue):
1518         (WebCore::StyleProperties::getLayeredShorthandValue):
1519         (WebCore::StyleProperties::getShorthandValue):
1520         (WebCore::StyleProperties::getCommonValue):
1521         (WebCore::StyleProperties::getPropertyCSSValue):
1522         (WebCore::StyleProperties::asText):
1523         Clean up the resolution of pending substitution values. Instead of hacking
1524         it into every possible StyleShorthandProperty crawling function, obtain
1525         the shorthand for the property up front, access the first longhand, and
1526         if we see a pending substitution value, perform the substitution.
1527
1528         * css/StyleResolver.cpp:
1529         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
1530         (WebCore::StyleResolver::applyProperty):
1531         (WebCore::StyleResolver::resolvedVariableValue):
1532         * css/StyleResolver.h:
1533         Add support for the new implementation in all the same places as the old.
1534
1535         * css/parser/CSSParser.cpp:
1536         (WebCore::CSSParser::parseInlineStyleDeclaration):
1537         (WebCore::CSSParser::parseValueWithVariableReferences):
1538         (WebCore::CSSParser::parseVariableDependentValue): Deleted.
1539         * css/parser/CSSParser.h:
1540         Rename parseVariableDependentValue to parseValueWithVariableReferences,
1541         since it is operating on three distinct value types now. Turn on new
1542         parser support for parseInlineStyleDeclaration.
1543
1544         * css/parser/CSSParserImpl.cpp:
1545         (WebCore::filterProperties):
1546         (WebCore::CSSParserImpl::parseVariableValue): Deleted.
1547         (WebCore::CSSParserImpl::parseCustomPropertySet): Deleted.
1548         * css/parser/CSSParserImpl.h:
1549         Remove parser functions that aren't relevant to our implementation
1550         of CSS variables.
1551
1552         * css/parser/CSSVariableParser.cpp:
1553         (WebCore::classifyVariableRange):
1554         Add support for the CSS4 'revert' keyword to the new variable parser.
1555
1556         * rendering/style/RenderStyle.cpp:
1557         (WebCore::RenderStyle::checkVariablesInCustomProperties):
1558         Modified to store CSSCustomPropertyValues as the values always now and
1559         to use the method abstractions on CSSCustomPropertyValue to resolve
1560         cycles and perform substitutions.
1561
1562         * rendering/style/RenderStyle.h:
1563         (WebCore::RenderStyle::setCustomPropertyValue):
1564         (WebCore::RenderStyle::getCustomPropertyValue):
1565         * rendering/style/StyleCustomPropertyData.h:
1566         (WebCore::StyleCustomPropertyData::operator==):
1567         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
1568         (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
1569         Tighten up the map to store CSSCustomPropertyValue instead of just
1570         CSSValue.
1571
1572 2016-10-27  Zalan Bujtas  <zalan@apple.com>
1573
1574         RenderMultiColumnFlowThread::processPossibleSpannerDescendant should take RenderObject& instead of RenderObject*
1575         https://bugs.webkit.org/show_bug.cgi?id=164072
1576
1577         Reviewed by Simon Fraser.
1578
1579         No change in functionality.
1580
1581         * rendering/RenderFlowThread.h:
1582         * rendering/RenderMultiColumnFlowThread.cpp:
1583         (WebCore::findSetRendering):
1584         (WebCore::isValidColumnSpanner):
1585         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
1586         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
1587         (WebCore::RenderMultiColumnFlowThread::findSetRendering): Deleted.
1588         * rendering/RenderMultiColumnFlowThread.h:
1589         * rendering/RenderMultiColumnSet.cpp:
1590         (WebCore::precedesRenderer):
1591         (WebCore::RenderMultiColumnSet::containsRendererInFlowThread):
1592         * rendering/RenderMultiColumnSet.h:
1593         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
1594         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
1595         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
1596         * rendering/RenderMultiColumnSpannerPlaceholder.h:
1597         * rendering/RenderObject.cpp:
1598         (WebCore::RenderObject::insertedIntoTree):
1599
1600 2016-10-27  Brent Fulgham  <bfulgham@apple.com>
1601
1602         Prevent hit tests from being performed on an invalid render tree
1603         https://bugs.webkit.org/show_bug.cgi?id=163877
1604         <rdar://problem/28675761>
1605
1606         Reviewed by Simon Fraser.
1607
1608         Changeset r200971 added code to ensure that layout is up-to-date before hit testing, but did
1609         so only for the main frame. It was still possible to enter cross-frame hit testing with a
1610         subframe needing style recalc. In that situation, the subframe's updateLayout() would get
1611         called, which could trigger a compositing change that marked the parent frame as needing style
1612         recalc. A subsequent layout on the parent frame (for example by hit testing traversing into
1613         a second subframe) could then mutate the parent frame's layer tree while hit testing was
1614         traversing it.
1615         
1616         This patch modifies the hit test logic to ensure that a recursive layout is performed so that
1617         we always perform hit tests on a clean set of frames. It also adds some assertions to warn
1618         us if we encounter this invalid state.
1619
1620         Tested by fast/layers/prevent-hit-test-during-layout.html.
1621
1622         * dom/Document.cpp:
1623         (WebCore::Document::scheduleStyleRecalc): Assert that we are not hit testing
1624         during style recalculation.
1625         * page/EventHandler.cpp:
1626         (WebCore::EventHandler::hitTestResultAtPoint): Ensure that we have a clean render tree
1627         when hit testing.
1628         * page/FrameView.cpp:
1629         (WebCore::FrameView::setNeedsLayout): Assert that we are not in the process of hit testing
1630         when we schedule a layout.
1631         * rendering/RenderView.cpp:
1632         (WebCore::RenderView::hitTest): Mark RenderView as in an active hit test.
1633         * rendering/RenderView.h:
1634
1635 2016-10-27  Zan Dobersek  <zdobersek@igalia.com>
1636
1637         BufferSource should behave as an union
1638         https://bugs.webkit.org/show_bug.cgi?id=164056
1639
1640         Reviewed by Chris Dumez.
1641
1642         WebIDL typedefs BufferSource as (ArrayBufferView or ArrayBuffer).
1643         To follow that definition, IDLBufferSource is now type-aliased
1644         to IDLUnion<IDLInterface<ArrayBufferView>, IDLInterface<ArrayBuffer>>.
1645
1646         Converter<IDLBufferSource> template specialization can now be
1647         removed since the default specialization for IDLUnion will be
1648         used.
1649
1650         C++ implementations still work through a BufferSource object.
1651         That class now has an implicit constructor that consumes the
1652         Variant object. The data() and length() methods on the class
1653         now iterate the variant to find an existing object that can
1654         provide a pointer to the data or the length of it.
1655
1656         * Modules/mediasource/SourceBuffer.cpp:
1657         (WebCore::SourceBuffer::appendBuffer):
1658         * bindings/generic/IDLTypes.h:
1659         * bindings/js/BufferSource.h:
1660         (WebCore::BufferSource::BufferSource):
1661         (WebCore::BufferSource::data):
1662         (WebCore::BufferSource::length):
1663         * bindings/js/JSDOMConvert.h:
1664         (WebCore::Converter<IDLBufferSource>::convert): Deleted.
1665
1666 2016-10-27  Chris Dumez  <cdumez@apple.com>
1667
1668         Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations
1669         https://bugs.webkit.org/show_bug.cgi?id=164063
1670
1671         Reviewed by Sam Weinig.
1672
1673         Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations now
1674         that we support having IDL string enumerations in their own IDL file.
1675
1676         No new tests, no Web-exposed behavior change.
1677
1678         * CMakeLists.txt:
1679         * DerivedSources.cpp:
1680         * DerivedSources.make:
1681         * WebCore.xcodeproj/project.pbxproj:
1682         * css/ElementRuleCollector.cpp:
1683         (WebCore::ElementRuleCollector::collectMatchingRules):
1684         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
1685         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
1686         * css/SelectorChecker.cpp:
1687         (WebCore::SelectorChecker::matchRecursively):
1688         * dom/CustomElementRegistry.cpp:
1689         (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
1690         * dom/Element.cpp:
1691         (WebCore::Element::bindingsOffsetParent):
1692         (WebCore::Element::addShadowRoot):
1693         (WebCore::Element::attachShadow):
1694         (WebCore::Element::shadowRootForBindings):
1695         (WebCore::Element::userAgentShadowRoot):
1696         (WebCore::Element::ensureUserAgentShadowRoot):
1697         * dom/Element.h:
1698         * dom/Element.idl:
1699         * dom/InlineStyleSheetOwner.cpp:
1700         (WebCore::parserContextForElement):
1701         * dom/Node.cpp:
1702         (WebCore::Node::isUnclosedNode):
1703         (WebCore::Node::assignedSlotForBindings):
1704         (WebCore::Node::isInUserAgentShadowTree):
1705         * dom/ShadowRoot.cpp:
1706         (WebCore::ShadowRoot::ShadowRoot):
1707         * dom/ShadowRoot.h:
1708         * dom/ShadowRoot.idl:
1709         * dom/ShadowRootMode.h: Added.
1710         * dom/ShadowRootMode.idl: Copied from Source/WebCore/dom/ShadowRoot.idl.
1711         * dom/SlotAssignment.cpp:
1712         (WebCore::SlotAssignment::didChangeSlot):
1713         * html/HTMLSummaryElement.cpp:
1714         (WebCore::HTMLSummaryElement::create):
1715         * inspector/InspectorDOMAgent.cpp:
1716         (WebCore::shadowRootType):
1717         * rendering/HitTestResult.cpp:
1718         (WebCore::moveOutOfUserAgentShadowTree):
1719         * rendering/RenderElement.cpp:
1720         (WebCore::RenderElement::selectionPseudoStyle):
1721         * rendering/RenderLayer.cpp:
1722         (WebCore::rendererForScrollbar):
1723         * style/StyleScope.cpp:
1724         (WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
1725         (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
1726         * svg/SVGElement.cpp:
1727         (WebCore::SVGElement::correspondingUseElement):
1728         * testing/Internals.cpp:
1729         (WebCore::Internals::shadowRootType):
1730
1731 2016-10-27  Chris Dumez  <cdumez@apple.com>
1732
1733         Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable
1734         https://bugs.webkit.org/show_bug.cgi?id=164062
1735
1736         Reviewed by Darin Adler.
1737
1738         Element parameter to CanvasRenderingContext2D.drawFocusIfNeeded() should not be nullable:
1739         - https://html.spec.whatwg.org/#canvasuserinterface
1740
1741         Firefox and Chrome agree with the specification.
1742
1743         Test: fast/canvas/draw-focus-if-needed-null-element.html
1744
1745         * html/canvas/CanvasRenderingContext2D.cpp:
1746         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
1747         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
1748         * html/canvas/CanvasRenderingContext2D.h:
1749         * html/canvas/CanvasRenderingContext2D.idl:
1750
1751 2016-10-27  Yusuke Suzuki  <utatane.tea@gmail.com>
1752
1753         [DOMJIT][CSSJIT] Share code with DOMJIT
1754         https://bugs.webkit.org/show_bug.cgi?id=164006
1755
1756         Reviewed by Mark Lam.
1757
1758         Move CSSJIT's getDocument function to DOMJIT and share it with DOMJIT.
1759         And rename it to "loadDocument", it is closer name to the JSC's convention.
1760
1761         No behavior change.
1762
1763         * cssjit/SelectorCompiler.cpp:
1764         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSpecialFailureInQuirksModeForActiveAndHoverIfNeeded):
1765         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
1766         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
1767         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
1768         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
1769         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
1770         (WebCore::SelectorCompiler::getDocument): Deleted.
1771         * domjit/DOMJITHelpers.h:
1772         (WebCore::DOMJIT::loadDocument):
1773         * domjit/JSNodeDOMJIT.cpp:
1774         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
1775
1776 2016-10-27  Youenn Fablet  <youenn@apple.com>
1777
1778         REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
1779         https://bugs.webkit.org/show_bug.cgi?id=163905
1780
1781         Reviewed by Antti Koivisto.
1782
1783         Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
1784
1785         Small refactoring to do more member fields initialization in StyleSheetContents header.
1786         Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
1787         This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
1788
1789         * css/StyleSheetContents.cpp:
1790         (WebCore::StyleSheetContents::StyleSheetContents):
1791         (WebCore::StyleSheetContents::addedToMemoryCache):
1792         (WebCore::StyleSheetContents::removedFromMemoryCache):
1793         * css/StyleSheetContents.h:
1794         * loader/cache/CachedCSSStyleSheet.cpp:
1795         (WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
1796
1797 2016-10-27  Sergio Villar Senin  <svillar@igalia.com>
1798
1799         Unreviewed. Build fix for gcc.
1800
1801         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1802         (WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
1803
1804 2016-10-27  Youenn Fablet  <youenn@apple.com>
1805
1806         MediaPayload does not need to be refcounted
1807         https://bugs.webkit.org/show_bug.cgi?id=164015
1808
1809         Reviewed by Eric Carlson.
1810
1811         No change of behavior.
1812         Making MediaPayload a struct and no-longer ref-counted.
1813         Small performance improvements in MediaEndpointOwr.
1814
1815         * Modules/mediastream/MediaEndpointPeerConnection.h:
1816         * Modules/mediastream/SDPProcessor.cpp:
1817         (WebCore::configurationFromJSON):
1818         (WebCore::configurationToJSON):
1819         * platform/mediastream/MediaEndpoint.h:
1820         * platform/mediastream/MediaPayload.h:
1821         (WebCore::MediaPayload::addParameter):
1822         (WebCore::MediaPayload::create): Deleted.
1823         (WebCore::MediaPayload::~MediaPayload): Deleted.
1824         (WebCore::MediaPayload::type): Deleted.
1825         (WebCore::MediaPayload::setType): Deleted.
1826         (WebCore::MediaPayload::encodingName): Deleted.
1827         (WebCore::MediaPayload::setEncodingName): Deleted.
1828         (WebCore::MediaPayload::clockRate): Deleted.
1829         (WebCore::MediaPayload::setClockRate): Deleted.
1830         (WebCore::MediaPayload::channels): Deleted.
1831         (WebCore::MediaPayload::setChannels): Deleted.
1832         (WebCore::MediaPayload::ccmfir): Deleted.
1833         (WebCore::MediaPayload::setCcmfir): Deleted.
1834         (WebCore::MediaPayload::nackpli): Deleted.
1835         (WebCore::MediaPayload::setNackpli): Deleted.
1836         (WebCore::MediaPayload::nack): Deleted.
1837         (WebCore::MediaPayload::setNack): Deleted.
1838         (WebCore::MediaPayload::parameters): Deleted.
1839         (WebCore::MediaPayload::clone): Deleted.
1840         (WebCore::MediaPayload::MediaPayload): Deleted.
1841         * platform/mediastream/PeerMediaDescription.h:
1842         (WebCore::PeerMediaDescription::payloads):
1843         (WebCore::PeerMediaDescription::addPayload):
1844         (WebCore::PeerMediaDescription::setPayloads):
1845         (WebCore::PeerMediaDescription::clone):
1846         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
1847         (WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
1848         (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
1849         (WebCore::MediaEndpointOwr::filterPayloads):
1850         * platform/mock/MockMediaEndpoint.cpp:
1851         (WebCore::MockMediaEndpoint::getDefaultAudioPayloads):
1852         (WebCore::MockMediaEndpoint::getDefaultVideoPayloads):
1853         (WebCore::MockMediaEndpoint::filterPayloads):
1854
1855 2016-10-26  Dan Bernstein  <mitz@apple.com>
1856
1857         Improved the last build fix.
1858
1859         Darin pointed out I could have kept the function inline and just removed the WEBCORE_EXPORT.
1860
1861         * Modules/mediastream/UserMediaRequest.cpp:
1862         (WebCore::UserMediaRequest::document): Deleted.
1863         * Modules/mediastream/UserMediaRequest.h:
1864         (WebCore::UserMediaRequest::document):
1865
1866 2016-10-26  Chris Dumez  <cdumez@apple.com>
1867
1868         [Web IDL] Add support for having string enumerations in their own IDL file
1869         https://bugs.webkit.org/show_bug.cgi?id=164025
1870
1871         Reviewed by Darin Adler.
1872
1873         Add support for having string enumerations in their own IDL file to facilitate
1874         sharing them. Use this new support to implement IDBTransactionMode enumeration
1875         for IndexedDB:
1876         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBTransactionMode
1877
1878         No new tests, rebaselined existing tests.
1879
1880         * CMakeLists.txt:
1881         * DerivedSources.cpp:
1882         * DerivedSources.make:
1883         * Modules/indexeddb/IDBDatabase.cpp:
1884         (WebCore::IDBDatabase::transaction):
1885         (WebCore::IDBDatabase::startVersionChangeTransaction):
1886         * Modules/indexeddb/IDBDatabase.h:
1887         * Modules/indexeddb/IDBDatabase.idl:
1888         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1889         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
1890         * Modules/indexeddb/IDBTransaction.cpp:
1891         (WebCore::IDBTransaction::IDBTransaction):
1892         * Modules/indexeddb/IDBTransaction.h:
1893         (WebCore::IDBTransaction::mode):
1894         (WebCore::IDBTransaction::isVersionChange):
1895         (WebCore::IDBTransaction::isReadOnly):
1896         * Modules/indexeddb/IDBTransaction.idl:
1897         * Modules/indexeddb/IDBTransactionMode.h: Added.
1898         * Modules/indexeddb/IDBTransactionMode.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
1899         * Modules/indexeddb/IndexedDB.h:
1900         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1901         (WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
1902         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
1903         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
1904         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1905         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1906         (WebCore::IDBServer::MemoryBackingStoreTransaction::isVersionChange):
1907         (WebCore::IDBServer::MemoryBackingStoreTransaction::isWriting):
1908         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1909         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
1910         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
1911         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
1912         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1913         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
1914         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
1915         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
1916         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1917         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
1918         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
1919         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
1920         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
1921         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1922         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
1923         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
1924         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
1925         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1926         (WebCore::IDBServer::SQLiteIDBTransaction::begin):
1927         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
1928         (WebCore::IDBServer::SQLiteIDBTransaction::mode):
1929         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1930         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
1931         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
1932         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1933         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
1934         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1935         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
1936         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::originalDatabaseInfo):
1937         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::isVersionChange):
1938         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::isReadOnly):
1939         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1940         (WebCore::IDBTransactionInfo::clientTransaction):
1941         (WebCore::IDBTransactionInfo::versionChange):
1942         (WebCore::IDBTransactionInfo::loggingString):
1943         * Modules/indexeddb/shared/IDBTransactionInfo.h:
1944         (WebCore::IDBTransactionInfo::mode):
1945         * WebCore.xcodeproj/project.pbxproj:
1946         * bindings/scripts/CodeGenerator.pm:
1947         (ProcessDocument):
1948         (IsEnumType):
1949         (GetEnumByName):
1950         (IsExternalEnumType):
1951         (ValidEnumValues):
1952         * bindings/scripts/CodeGeneratorJS.pm:
1953         (GenerateEnumeration):
1954         (AddToImplIncludesForIDLType):
1955         (GetEnumerationClassName):
1956         (GenerateEnumerationHeader):
1957         (GenerateEnumerationImplementation):
1958         (GenerateEnumerationImplementationContent):
1959         (GenerateEnumerationsImplementationContent):
1960         (GenerateEnumerationHeaderContent):
1961         (GenerateEnumerationsHeaderContent):
1962         * bindings/scripts/test/JS/JSTestObj.cpp:
1963         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgCaller):
1964         (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArg):
1965         (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgCaller):
1966         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: Added.
1967         (WebCore::convertEnumerationToJS):
1968         (WebCore::parseEnumeration<TestStandaloneEnumeration>):
1969         (WebCore::convertEnumeration<TestStandaloneEnumeration>):
1970         (WebCore::expectedEnumerationValues<TestStandaloneEnumeration>):
1971         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h: Added.
1972         * bindings/scripts/test/TestObj.idl:
1973         * bindings/scripts/test/TestStandaloneEnumeration.idl: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.idl.
1974         * inspector/InspectorIndexedDBAgent.cpp:
1975
1976 2016-10-26  Dan Bernstein  <mitz@apple.com>
1977
1978         Fixed the WebKit2 build.
1979
1980         * Modules/mediastream/UserMediaRequest.cpp:
1981         (WebCore::UserMediaRequest::document): Moved the definition of this function to here from…
1982         * Modules/mediastream/UserMediaRequest.h:
1983         (WebCore::UserMediaRequest::document): …here, so that the WebKit2 build doesn’t encounter an
1984           exported inline function.
1985
1986 2016-10-26  Yusuke Suzuki  <utatane.tea@gmail.com>
1987
1988         [DOMJIT] Implement Node::ownerDocument
1989         https://bugs.webkit.org/show_bug.cgi?id=164004
1990
1991         Reviewed by Darin Adler.
1992
1993         Test: js/dom/domjit-accessor-owner-document.html
1994
1995         Implement Node.ownerDocument DOMJIT accessor.
1996         According to the result of the profiler, jQuery's prop()
1997         function is frequently called in Ember.js SpeedoMeter.
1998         And this function calls jQuery.isXMLDoc(). And this isXMLDoc()
1999         function calls element.ownerDocument accessor. And our WebKit
2000         inspector also uses ownerDocument accessor frequently.
2001
2002         Interesting thing is this ownerDocument functionality is used
2003         in CSSJIT, so CSSJIT has similar helper function to look up the
2004         owner document of the element. As a result, all the necessary
2005         functionality is already implemented, DOMJIT just utilizes it.
2006         For example, Node::treeScopeMemoryOffset() and
2007         TreeScope::documentScopeMemoryOffset() is implemented before this
2008         patch.
2009
2010         In the future, we will convert CSSJIT's Assembler& to CCallHelpers&
2011         and share the code with DOMJIT[1].
2012
2013         [1]: https://bugs.webkit.org/show_bug.cgi?id=164006
2014
2015         * dom/Node.idl:
2016         * domjit/DOMJITAbstractHeapRepository.h:
2017         * domjit/JSNodeDOMJIT.cpp:
2018         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
2019         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
2020
2021 2016-10-26  Chris Dumez  <cdumez@apple.com>
2022
2023         Replace IDBKeyPath with a WTF::Variant
2024         https://bugs.webkit.org/show_bug.cgi?id=163909
2025
2026         Reviewed by Darin Adler.
2027
2028         Replace IDBKeyPath class with the IDBKeyPathVariant type entirely
2029         and rename IDBKeyPathVariant to IDBKeyPath.
2030
2031         Unfortunately, IDBKeyPath still needs some special handling when
2032         returned to the JavaScript because we do not have a toJS() accepting
2033         a WTF::Variant as input yet.
2034
2035         There should be no significant behavior change except that
2036         IDBIndex.keyPath / IDBObjectStore.keyPath now returns an array of
2037         Strings instead of a DOMStringList object when the IDBKeyPath
2038         contains a vector. This is a progression and matches the
2039         specification:
2040         - https://www.w3.org/TR/IndexedDB/#widl-IDBIndex-keyPath
2041         - https://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-keyPath
2042
2043         No new tests, rebaselined existing tests.
2044
2045         * Modules/indexeddb/IDBCursor.cpp:
2046         (WebCore::IDBCursor::update):
2047         * Modules/indexeddb/IDBDatabase.h:
2048         * Modules/indexeddb/IDBGetResult.cpp:
2049         (WebCore::IDBGetResult::isolatedCopy):
2050         * Modules/indexeddb/IDBKeyPath.cpp:
2051         (WebCore::isIDBKeyPathValid):
2052         (WebCore::IDBKeyPathIsolatedCopy):
2053         * Modules/indexeddb/IDBKeyPath.h:
2054         (WebCore::IDBKeyPathIsolatedCopy):
2055         * Modules/indexeddb/IDBObjectStore.cpp:
2056         (WebCore::IDBObjectStore::keyPath):
2057         (WebCore::IDBObjectStore::putOrAdd):
2058         (WebCore::IDBObjectStore::createIndex):
2059         * Modules/indexeddb/IDBObjectStore.h:
2060         * Modules/indexeddb/server/IDBSerialization.cpp:
2061         (WebCore::serializeIDBKeyPath):
2062         (WebCore::deserializeIDBKeyPath):
2063         * Modules/indexeddb/server/IDBSerialization.h:
2064         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2065         (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
2066         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2067         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2068         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2069         (WebCore::IDBDatabaseInfo::createNewObjectStore):
2070         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2071         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
2072         (WebCore::IDBIndexInfo::IDBIndexInfo):
2073         (WebCore::IDBIndexInfo::isolatedCopy):
2074         * Modules/indexeddb/shared/IDBIndexInfo.h:
2075         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
2076         (WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
2077         (WebCore::IDBObjectStoreInfo::createNewIndex):
2078         (WebCore::IDBObjectStoreInfo::isolatedCopy):
2079         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
2080         (WebCore::IDBObjectStoreInfo::keyPath):
2081         * bindings/js/IDBBindingUtilities.cpp:
2082         (WebCore::injectIDBKeyIntoScriptValue):
2083         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
2084         (WebCore::canInjectIDBKeyIntoScriptValue):
2085         (WebCore::createKeyPathArray):
2086         (WebCore::toJS):
2087         * bindings/js/IDBBindingUtilities.h:
2088         * inspector/InspectorIndexedDBAgent.cpp:
2089
2090 2016-10-26  Zalan Bujtas  <zalan@apple.com>
2091
2092         Ignore out-of-flow siblings when searching for a spanner candidate.
2093         https://bugs.webkit.org/show_bug.cgi?id=164042.
2094         <rdar://problem/28758456>
2095
2096         Reviewed by Simon Fraser.
2097
2098         While searching for the spanner candidates in a flow thread, we have to take into account
2099         whether renderers are in- or out-of-flow.
2100         What it means is that while traversing the renderer tree to find the the candidate
2101         renderer (next sibling/ancestor's next child in pre-order traversal), we have to check if the candidate
2102         is in the same layout context too.
2103
2104         Test: fast/multicol/crash-when-spanner-candidate-is-out-of-flow.html
2105
2106         * rendering/RenderMultiColumnFlowThread.cpp:
2107         (WebCore::spannerPlacehoderCandidate):
2108         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
2109
2110 2016-10-26  Brian Burg  <bburg@apple.com>
2111
2112         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
2113         https://bugs.webkit.org/show_bug.cgi?id=164046
2114
2115         Reviewed by Joseph Pecoraro.
2116
2117         * inspector/InspectorClient.cpp:
2118         (WebCore::InspectorClient::doDispatchMessageOnFrontendPage):
2119         * inspector/InspectorClient.h:
2120         * testing/Internals.cpp:
2121         (WebCore::InspectorStubFrontend::sendMessageToFrontend):
2122
2123 2016-10-26  Chris Dumez  <cdumez@apple.com>
2124
2125         The URLSearchParams constructor should take a union in parameter
2126         https://bugs.webkit.org/show_bug.cgi?id=163906
2127
2128         Reviewed by Darin Adler.
2129
2130         The URLSearchParams constructor should take a union in parameter:
2131         - https://url.spec.whatwg.org/#urlsearchparams
2132
2133         No new tests, no web-exposed behavior change.
2134
2135         * html/URLSearchParams.h:
2136         (WebCore::URLSearchParams::create):
2137         * html/URLSearchParams.idl:
2138
2139 2016-10-26  Sam Weinig  <sam@webkit.org>
2140
2141         [WebIDL] Move more string conversions over to JSDOMConvert
2142         https://bugs.webkit.org/show_bug.cgi?id=164021
2143
2144         Reviewed by Tim Horton.
2145
2146         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2147         (WebCore::JSCSSStyleDeclaration::putDelegate):
2148         * bindings/js/JSDOMWindowCustom.cpp:
2149         (WebCore::JSDOMWindow::open):
2150         (WebCore::JSDOMWindow::showModalDialog):
2151         (WebCore::handlePostMessage):
2152         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2153         (WebCore::JSHTMLCanvasElement::toDataURL):
2154         * bindings/js/JSHistoryCustom.cpp:
2155         (WebCore::JSHistory::pushState):
2156         (WebCore::JSHistory::replaceState):
2157         Switch to convert functions.
2158
2159         * bindings/js/JSApplePaySessionCustom.cpp:
2160         (WebCore::JSApplePaySession::completeShippingMethodSelection):
2161         (WebCore::JSApplePaySession::completeShippingContactSelection):
2162         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2163         (WebCore::createAesKeyGenParams):
2164         (WebCore::createRsaKeyGenParams):
2165         * bindings/js/JSDocumentCustom.cpp:
2166         (WebCore::JSDocument::getCSSCanvasContext):
2167         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2168         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
2169         (WebCore::toDecision):
2170         * bindings/js/JSNodeFilterCustom.cpp:
2171         (WebCore::JSNodeFilter::acceptNode):
2172         * bindings/js/JSDOMBinding.cpp:
2173         (WebCore::toSmallerInt):
2174         (WebCore::toSmallerUInt):
2175         (WebCore::toInt8EnforceRange):
2176         (WebCore::toUInt8EnforceRange):
2177         (WebCore::toInt8Clamp):
2178         (WebCore::toUInt8Clamp):
2179         (WebCore::toInt8):
2180         (WebCore::toUInt8):
2181         (WebCore::toInt16EnforceRange):
2182         (WebCore::toUInt16EnforceRange):
2183         (WebCore::toInt16Clamp):
2184         (WebCore::toUInt16Clamp):
2185         (WebCore::toInt16):
2186         (WebCore::toUInt16):
2187         Use updated IntegerConversionConfiguration naming.
2188
2189         (WebCore::valueToStringTreatingNullAsEmptyString): Deleted.
2190         (WebCore::valueToStringWithUndefinedOrNullCheck): Deleted.
2191         (WebCore::valueToUSVStringTreatingNullAsEmptyString): Deleted.
2192         (WebCore::valueToUSVStringWithUndefinedOrNullCheck): Deleted.
2193         * bindings/js/JSDOMBinding.h:
2194         Remove unused functions.
2195
2196         * bindings/js/JSDOMConvert.h:
2197         (WebCore::convert):
2198         Add StringConversionConfiguration, to match IntegerConversionConfiguration which moved here,
2199         and make them both enum classes. Remove SFINAE based overloading of convert<>, which is not
2200         needed if we get rid of the default parameter, which we can, since the two parameter convert
2201         routes to the right place.
2202
2203         (WebCore::Converter<IDLNullable<T>>::convert):
2204         Add overloads converts that take a Integer/String configuration.
2205
2206         (WebCore::Converter<IDLByte>::convert):
2207         (WebCore::Converter<IDLOctet>::convert):
2208         (WebCore::Converter<IDLShort>::convert):
2209         (WebCore::Converter<IDLUnsignedShort>::convert):
2210         (WebCore::Converter<IDLLong>::convert):
2211         (WebCore::Converter<IDLUnsignedLong>::convert):
2212         (WebCore::Converter<IDLLongLong>::convert):
2213         (WebCore::Converter<IDLUnsignedLongLong>::convert):
2214         Use updated IntegerConversionConfiguration naming.
2215
2216         (WebCore::Converter<IDLDOMString>::convert):
2217         (WebCore::Converter<IDLUSVString>::convert):
2218         Add a configuration parameter, similar to the one used for integers
2219         that changes the behavior of string conversions to return an empty
2220         string for null.
2221
2222         * bindings/js/JSDOMIterator.h:
2223         (WebCore::iteratorCreate):
2224         (WebCore::IteratorTraits>::asJS):
2225         (WebCore::appendForEachArguments):
2226         Simplify a bit by extracting the SFINAE helpers into a EnableIfMap and EnableIfSet.
2227
2228         * bindings/scripts/CodeGeneratorJS.pm:
2229         (GetIntegerConversionConfiguration):
2230         (GetStringConversionConfiguration):
2231         (JSValueToNativeIsHandledByDOMConvert):
2232         (JSValueToNative):
2233         Add support for converting more string types and passing the StringConversionConfiguration.
2234
2235 2016-10-26  Dan Bernstein  <mitz@apple.com>
2236
2237         When pasting web archive, width specifiers in srcset attribute change into density specifiers
2238         https://bugs.webkit.org/show_bug.cgi?id=164027
2239         <rdar://problem/28964948>
2240
2241         Reviewed by Tim Horton.
2242
2243         Updated editing/pasteboard/img-srcset-copy-paste-canonicalization.html.
2244
2245         * html/HTMLImageElement.cpp:
2246         (WebCore::HTMLImageElement::completeURLsInAttributeValue): Use 'w' when writing out a width
2247           specifier.
2248
2249 2016-10-26  Antoine Quint  <graouts@apple.com>
2250
2251         [Modern Media Controls] Media Controller: playback support
2252         https://bugs.webkit.org/show_bug.cgi?id=163678
2253         <rdar://problem/27989479>
2254
2255         Reviewed by Dean Jackson.
2256
2257         We introduce the PlaybackSupport class which brings support for playing and pausing
2258         the media by clicking on the play/pause button in the media controls and correctly
2259         reflecting the media's playback state as the media is played or paused via the media API.
2260
2261         * Modules/modern-media-controls/js-files:
2262         * Modules/modern-media-controls/media/media-controller.js:
2263         (MediaController):
2264         * Modules/modern-media-controls/media/playback-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
2265         (PlaybackSupport.prototype.get control):
2266         (PlaybackSupport.prototype.get mediaEvents):
2267         (PlaybackSupport.prototype.buttonWasClicked):
2268         (PlaybackSupport.prototype.syncControl):
2269         (PlaybackSupport):
2270         * WebCore.xcodeproj/project.pbxproj:
2271
2272 2016-10-26  Chris Dumez  <cdumez@apple.com>
2273
2274         Regression(r203848): 百度糯米 app fails to load content due to a JavaScript error
2275         https://bugs.webkit.org/show_bug.cgi?id=163967
2276         <rdar://problem/28707838>
2277
2278         Reviewed by Ryosuke Niwa.
2279
2280         Add quirk for 百度糯米 app making the 2 last parameters to Event.prototype.initEvent()
2281         optional.
2282
2283         No new tests, change only impacts this specific application.
2284
2285         * bindings/scripts/CodeGeneratorJS.pm:
2286         (GeneratePropertiesHashTable):
2287         * dom/Event.cpp:
2288         (WebCore::Event::initEventForBindings):
2289         * dom/Event.h:
2290         * dom/Event.idl:
2291         * platform/RuntimeApplicationChecks.h:
2292         * platform/RuntimeApplicationChecks.mm:
2293         (WebCore::IOSApplication::isBaiduNuomi):
2294
2295 2016-10-26  Chris Dumez  <cdumez@apple.com>
2296
2297         First parameter to TextTrack.addCue() / removeCue() should not be nullable
2298         https://bugs.webkit.org/show_bug.cgi?id=164020
2299
2300         Reviewed by Eric Carlson.
2301
2302         First parameter to TextTrack.addCue() / removeCue() should not be nullable:
2303         - https://html.spec.whatwg.org/#texttrack
2304
2305         Firefox and Chrome agree with the specification.
2306
2307         Test: media/track/texttrack-addCue-null.html
2308
2309         * html/track/InbandDataTextTrack.cpp:
2310         (WebCore::InbandDataTextTrack::removeDataCue):
2311         (WebCore::InbandDataTextTrack::removeCue):
2312         * html/track/InbandDataTextTrack.h:
2313         * html/track/InbandGenericTextTrack.cpp:
2314         (WebCore::InbandGenericTextTrack::addGenericCue):
2315         (WebCore::InbandGenericTextTrack::removeGenericCue):
2316         (WebCore::InbandGenericTextTrack::removeCue):
2317         * html/track/InbandGenericTextTrack.h:
2318         * html/track/TextTrack.cpp:
2319         (WebCore::TextTrack::addCue):
2320         (WebCore::TextTrack::removeCue):
2321         * html/track/TextTrack.h:
2322         * html/track/TextTrack.idl:
2323
2324 2016-10-26  Antoine Quint  <graouts@apple.com>
2325
2326         [Modern Media Controls] Media Controller: elapsed and remaining time support
2327         https://bugs.webkit.org/show_bug.cgi?id=163679
2328         <rdar://problem/28851675>
2329
2330         Reviewed by Dean Jackson.
2331
2332         We introduce the ElapsedTimeSupport and RemainingTimeSupport classes which bring
2333         support for displaying the elapsed and remaining time in the time control.
2334
2335         Tests: media/modern-media-controls/elapsed-time-support/elapsed-time-support.html
2336                media/modern-media-controls/remaining-time-support/remaining-time-support.html
2337
2338         * Modules/modern-media-controls/js-files:
2339         * Modules/modern-media-controls/media/elapsed-time-support.js: Added.
2340         (ElapsedTimeSupport.prototype.get control):
2341         (ElapsedTimeSupport.prototype.get mediaEvents):
2342         (ElapsedTimeSupport.prototype.syncControl):
2343         (ElapsedTimeSupport):
2344         * Modules/modern-media-controls/media/media-controller.js:
2345         (MediaController):
2346         * Modules/modern-media-controls/media/remaining-time-support.js: Added.
2347         (RemainingTimeSupport.prototype.get control):
2348         (RemainingTimeSupport.prototype.get mediaEvents):
2349         (RemainingTimeSupport.prototype.syncControl):
2350         (RemainingTimeSupport):
2351         * WebCore.xcodeproj/project.pbxproj:
2352
2353 2016-10-26  Dave Hyatt  <hyatt@apple.com>
2354
2355         [CSS Parser] Unify CSSCustomPropertyValue and CSSCustomPropertyDeclaration
2356         https://bugs.webkit.org/show_bug.cgi?id=164019
2357
2358         Reviewed by Zalan Bujtas.
2359
2360         * CMakeLists.txt:
2361         * WebCore.xcodeproj/project.pbxproj:
2362         * css/CSSCustomPropertyDeclaration.cpp: Removed.
2363         * css/CSSCustomPropertyDeclaration.h: Removed.
2364         Get rid of CSSCustomPropertyDeclaration.
2365
2366         * css/CSSCustomPropertyValue.h:
2367         Add new constructors to handle the new variable data format (either a CSSValueId or a
2368         CSSVariableData object that holds parser tokens).
2369
2370         * css/CSSValue.cpp:
2371         (WebCore::CSSValue::cssText):
2372         (WebCore::CSSValue::destroy):
2373         * css/CSSValue.h:
2374         (WebCore::CSSValue::isCustomPropertyDeclaration): Deleted.
2375         Get rid of CSSCustomPropertyDeclaration cases.
2376
2377         * css/CSSVariableData.h:
2378         Switch to CSSCustomPropertyValue.
2379
2380         * css/StyleResolver.cpp:
2381         (WebCore::StyleResolver::applyProperty):
2382         We've renamed the old parser variable data to deprecatedValue to make it clear it's going
2383         to be removed eventually.
2384
2385         * css/parser/CSSParserImpl.cpp:
2386         (WebCore::filterProperties):
2387         (WebCore::CSSParserImpl::consumeVariableValue):
2388         * css/parser/CSSVariableParser.cpp:
2389         (WebCore::CSSVariableParser::parseDeclarationValue):
2390         * css/parser/CSSVariableParser.h:
2391         Switch to CSSCustomPropertyValue.
2392
2393 2016-10-26  Youenn Fablet  <youenn@apple.com>
2394
2395         Enable SDPProcessor for Mac bots
2396         https://bugs.webkit.org/show_bug.cgi?id=163940
2397
2398         Reviewed by Eric Carlson.
2399
2400         Covered by activated tests.
2401
2402         Activating processing of SDPProcessor scripts for Mac bots.
2403         Moving platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp to platform/mediastream/SDPProcessorScriptResource.cpp.
2404         This file is not tied to openwebrtc and allows retrieving the SDPProcessor script resource file content.
2405
2406         * DerivedSources.make:
2407         * PlatformGTK.cmake:
2408         * WebCore.xcodeproj/project.pbxproj:
2409         * platform/mediastream/SDPProcessorScriptResource.cpp:
2410         (WebCore::SDPProcessorScriptResource::scriptString):
2411         * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Removed.
2412
2413 2016-10-26  Dave Hyatt  <hyatt@apple.com>
2414
2415         [CSS Parser] Get functional pseudos parsing
2416         https://bugs.webkit.org/show_bug.cgi?id=164018
2417
2418         Reviewed by Zalan Bujtas.
2419
2420         * css/parser/CSSParserValues.cpp:
2421         (WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
2422         Remove the ( check so that we can parse strings that end in (.
2423
2424         * css/parser/CSSSelectorParser.cpp:
2425         (WebCore::CSSSelectorParser::consumePseudo):
2426         Put in a hack that adds a ( to the end of the string so that it will be found in the map.
2427
2428 2016-10-26  Zan Dobersek  <zdobersek@igalia.com>
2429
2430         Unreviewed. Fixing compiler warnings in PlaybackPipeline
2431         that are popping up in GTK+ builds.
2432
2433         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2434         (WebCore::PlaybackPipeline::addSourceBuffer):
2435         (WebCore::PlaybackPipeline::attachTrack):
2436
2437 2016-10-26  Youenn Fablet  <youennf@gmail.com>
2438
2439         IceCandidate does not need to be refcounted
2440         https://bugs.webkit.org/show_bug.cgi?id=163944
2441
2442         Reviewed by Eric Carlson.
2443
2444         No change of behavior.
2445
2446         Simplifying IceCandidate class into a simple structure, no longer refcounted.
2447         Updated call sites accordingly.
2448         Updated SDP parsing of candidates to return a Variant instead of having both a return and an out parameter.
2449
2450         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2451         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
2452         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
2453         * Modules/mediastream/MediaEndpointPeerConnection.h:
2454         * Modules/mediastream/SDPProcessor.cpp:
2455         (WebCore::createCandidateObject):
2456         (WebCore::createCandidate):
2457         (WebCore::iceCandidateFromJSON):
2458         (WebCore::configurationToJSON):
2459         (WebCore::SDPProcessor::parseCandidateLine):
2460         * Modules/mediastream/SDPProcessor.h:
2461         (WebCore::SDPProcessor::ParsingResult::parsingStatus):
2462         (WebCore::SDPProcessor::ParsingResult::candidate):
2463         * platform/mediastream/IceCandidate.h:
2464         * platform/mediastream/MediaEndpoint.cpp:
2465         * platform/mediastream/MediaEndpoint.h:
2466         * platform/mediastream/PeerMediaDescription.h:
2467         (WebCore::PeerMediaDescription::iceCandidates):
2468         (WebCore::PeerMediaDescription::addIceCandidate):
2469         (WebCore::PeerMediaDescription::clone):
2470         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
2471         (WebCore::MediaEndpointOwr::updateSendConfiguration):
2472         (WebCore::MediaEndpointOwr::addRemoteCandidate):
2473         (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
2474         (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
2475         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
2476         * platform/mock/MockMediaEndpoint.cpp:
2477         (WebCore::MockMediaEndpoint::addRemoteCandidate):
2478         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
2479         * platform/mock/MockMediaEndpoint.h:
2480
2481 2016-10-26  Andreas Kling  <akling@apple.com>
2482
2483         Fix mach port leak in ResourceUsageThread.
2484         <https://webkit.org/b/164012>
2485
2486         Reviewed by Antti Koivisto.
2487
2488         The threads returned by task_threads() need to be deallocated.
2489
2490         * page/cocoa/ResourceUsageThreadCocoa.mm:
2491         (WebCore::cpuUsage):
2492
2493 2016-10-26  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2494
2495         WebRTC: The RTCTrackEventInit dictionary needs required members
2496         https://bugs.webkit.org/show_bug.cgi?id=158536
2497
2498         Reviewed by Chris Dumez.
2499
2500         Update RTCTrackEvent IDL as per specification.
2501
2502         No additional test required, rebase existing tests.
2503
2504         * Modules/mediastream/RTCTrackEvent.idl:
2505
2506 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2507
2508         [GStreamer][GTK+][MSE] Unreviewed debug build fix.
2509
2510         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2511         (WebCore::AppendPipeline::resetPipeline):
2512         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2513
2514 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2515
2516         [cmake][GStreamer][MSE][EME] Build MSE and EME code after refactoring
2517         https://bugs.webkit.org/show_bug.cgi?id=162928
2518
2519         Reviewed by Xabier Rodriguez-Calvar.
2520
2521         Consolidate all the source file tree changes after refactoring.
2522
2523         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
2524
2525         * platform/GStreamer.cmake:
2526
2527 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2528
2529         [MSE][GStreamer] Enable QUOTA_EXCEEDED_ERR support for GStreamer
2530         https://bugs.webkit.org/show_bug.cgi?id=162922
2531
2532         Reviewed by Xabier Rodriguez-Calvar.
2533
2534         QUOTA_EXCEEDED_ERR should be reported by SourceBuffer when appropriate, at least on the
2535         GStreamer implementation.
2536
2537         * Modules/mediasource/SourceBuffer.cpp:
2538         (WebCore::SourceBuffer::appendBufferInternal):
2539
2540 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2541
2542         [MSE] Expose additional MediaSource methods to MediaSourcePrivate
2543         https://bugs.webkit.org/show_bug.cgi?id=162920
2544
2545         Reviewed by Xabier Rodriguez-Calvar.
2546
2547         The GStreamer MSE platform implementation needs to report duration changes and trigger
2548         monitorSourceBuffers() calls.
2549
2550         * Modules/mediasource/MediaSource.cpp:
2551         (WebCore::MediaSource::durationChanged):
2552         * Modules/mediasource/MediaSource.h:
2553         * platform/graphics/MediaSourcePrivateClient.h:
2554
2555 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2556
2557         [GStreamer][EME] ClearKey decryption support
2558         https://bugs.webkit.org/show_bug.cgi?id=162918
2559
2560         Reviewed by Xabier Rodriguez-Calvar.
2561
2562         This patch is authored by Philippe Normand <philn@igalia.com>.
2563
2564         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: Added.
2565         (webkit_media_clear_key_decrypt_class_init):
2566         (webkit_media_clear_key_decrypt_init):
2567         (webKitMediaClearKeyDecryptorFinalize):
2568         (webKitMediaClearKeyDecryptorRequestDecryptionKey):
2569         (webKitMediaClearKeyDecryptorHandleKeyResponse):
2570         (webKitMediaClearKeyDecryptorSetupCipher):
2571         (webKitMediaClearKeyDecryptorDecrypt):
2572         (webKitMediaClearKeyDecryptorReleaseCipher):
2573         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h: Added.
2574
2575 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2576
2577         [GStreamer][EME] Base class for decryption support
2578         https://bugs.webkit.org/show_bug.cgi?id=162915
2579
2580         Reviewed by Xabier Rodriguez-Calvar.
2581
2582         Add common encryption base class.
2583
2584         This patch is authored by Philippe Normand <philn@igalia.com>.
2585
2586         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Added.
2587         (webkit_media_common_encryption_decrypt_class_init):
2588         (webkit_media_common_encryption_decrypt_init):
2589         (webKitMediaCommonEncryptionDecryptorFinalize):
2590         (webkitMediaCommonEncryptionDecryptTransformCaps):
2591         (webkitMediaCommonEncryptionDecryptTransformInPlace):
2592         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
2593         (webKitMediaCommonEncryptionDecryptorChangeState):
2594         (webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
2595         (webKitMediaCommonEncryptionDecryptDefaultReleaseCipher):
2596         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added.
2597
2598 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2599
2600         [GStreamer][EME] Utility function to create decryptor
2601         https://bugs.webkit.org/show_bug.cgi?id=162914
2602
2603         Reviewed by Xabier Rodriguez-Calvar.
2604
2605         Add a utility function to find a suitable GStreamer decryptor element.
2606
2607         This patch is authored by Philippe Normand <philn@igalia.com>.
2608
2609         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
2610         (WebCore::createGstDecryptor):
2611         (WebCore::gstRegistryHasElementForMediaType): Deleted.
2612         * platform/graphics/gstreamer/GStreamerUtilities.h:
2613
2614 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2615
2616         [GStreamer][MSE][EME] Remove MSE code from regular player and add EME support
2617         https://bugs.webkit.org/show_bug.cgi?id=162911
2618
2619         Now that the MSE responsibility has been refactored to the dedicated
2620         MediaPlayerPrivateGStreamerMSE subclass, the regular player no longer needs the MSE code,
2621         just to expose some more methods to the subclass. Float timestamps have been migrated to
2622         double. Also, small changes to accomodate the EME support are needed.
2623
2624         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support) and
2625         Žan Doberšek <zandobersek@gmail.com> (double timestamps).
2626
2627         Reviewed by Xabier Rodriguez-Calvar.
2628
2629         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2630         (WebCore::busMessageCallback):
2631         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
2632         (WebCore::initializeGStreamerAndRegisterWebKitElements):
2633         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2634         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2635         (WebCore::MediaPlayerPrivateGStreamer::load):
2636         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
2637         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
2638         (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime):
2639         (WebCore::MediaPlayerPrivateGStreamer::seek):
2640         (WebCore::MediaPlayerPrivateGStreamer::doSeek):
2641         (WebCore::MediaPlayerPrivateGStreamer::paused):
2642         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2643         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2644         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
2645         (WebCore::MediaPlayerPrivateGStreamer::buffered):
2646         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2647         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
2648         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
2649         (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
2650         (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded):
2651         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
2652         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
2653         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
2654         (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
2655         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
2656         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2657         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
2658         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted.
2659         (WebCore::MediaPlayerPrivateGStreamer::commitLoad): Deleted.
2660         (WebCore::MediaPlayerPrivateGStreamer::pause): Deleted.
2661         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback): Deleted.
2662         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback): Deleted.
2663         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps): Deleted.
2664         (WebCore::MediaPlayerPrivateGStreamer::setRate): Deleted.
2665         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Deleted.
2666         (WebCore::MediaPlayerPrivateGStreamer::totalBytes): Deleted.
2667         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Deleted.
2668         (WebCore::MediaPlayerPrivateGStreamer::loadStateChanged): Deleted.
2669         (WebCore::MediaPlayerPrivateGStreamer::timeChanged): Deleted.
2670         (WebCore::mimeTypeSet): Deleted.
2671         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Deleted.
2672         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2673         (WebCore::MediaPlayerPrivateGStreamer::configurePlaySink):
2674         (WebCore::MediaPlayerPrivateGStreamer::isMediaSource):
2675         (WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Deleted.
2676
2677 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2678
2679         [GStreamer][EME] Add EME support to base private player
2680         https://bugs.webkit.org/show_bug.cgi?id=162908
2681
2682         Reviewed by Xabier Rodriguez-Calvar.
2683
2684         Add encryption key management support.
2685
2686         This patch is authored by Philippe Normand <philn@igalia.com>.
2687
2688         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2689         (WebCore::registerWebKitGStreamerElements):
2690         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
2691         (WebCore::MediaPlayerPrivateGStreamerBase::needKey):
2692         (WebCore::MediaPlayerPrivateGStreamerBase::setCDMSession):
2693         (WebCore::MediaPlayerPrivateGStreamerBase::keyAdded):
2694         (WebCore::MediaPlayerPrivateGStreamerBase::createSession):
2695         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
2696         (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
2697         (WebCore::MediaPlayerPrivateGStreamerBase::extendedSupportsType):
2698         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Deleted.
2699         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline): Deleted.
2700         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Deleted.
2701         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2702         (WebCore::MediaPlayerPrivateGStreamerBase::pipeline):
2703
2704 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2705
2706         [GStreamer][MSE] WebKitMediaSourceGStreamer refactoring
2707         https://bugs.webkit.org/show_bug.cgi?id=162902
2708
2709         Reviewed by Xabier Rodriguez-Calvar.
2710
2711         Move WebKitMediaSourceGStreamer to the mse directory, split public and private header
2712         sections, manage stream data throttling and seek synchronization, audio/video/text stream
2713         counting, improve GStreamer duration query, stream initialization, remove
2714         MediaSourceClientGStreamer logic (factored out to its own class in another patch) and
2715         interaction with MediaPlayerPrivateGStreamerMSE, PlaybackPipeline and
2716         SourceBufferPrivateGStreamer.
2717
2718         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp: Removed.
2719         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: Added.
2720         (disabledAppsrcNeedData):
2721         (disabledAppsrcEnoughData):
2722         (disabledAppsrcSeekData):
2723         (enabledAppsrcEnoughData):
2724         (enabledAppsrcSeekData):
2725         (getStreamByAppsrc):
2726         (webkit_media_src_init):
2727         (webKitMediaSrcFinalize):
2728         (webKitMediaSrcSetProperty):
2729         (webKitMediaSrcGetProperty):
2730         (webKitMediaSrcDoAsyncStart):
2731         (webKitMediaSrcDoAsyncDone):
2732         (webKitMediaSrcChangeState):
2733         (webKitMediaSrcGetSize):
2734         (webKitMediaSrcQueryWithParent):
2735         (webKitMediaSrcUpdatePresentationSize):
2736         (webKitMediaSrcLinkStreamToSrcPad):
2737         (webKitMediaSrcLinkParser):
2738         (webKitMediaSrcFreeStream):
2739         (webKitMediaSrcCheckAllTracksConfigured):
2740         (webKitMediaSrcUriGetType):
2741         (webKitMediaSrcGetProtocols):
2742         (webKitMediaSrcGetUri):
2743         (webKitMediaSrcSetUri):
2744         (webKitMediaSrcUriHandlerInit):
2745         (seekNeedsDataMainThread):
2746         (notifyReadyForMoreSamplesMainThread):
2747         (applicationMessageCallback):
2748         (webKitMediaSrcSetMediaPlayerPrivate):
2749         (webKitMediaSrcSetReadyForSamples):
2750         (webKitMediaSrcPrepareSeek):
2751         (WTF::adoptGRef):
2752         (WTF::refGPtr<WebKitMediaSrc>):
2753         (WTF::derefGPtr<WebKitMediaSrc>):
2754         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/WebKitMediaSourceGStreamer.h.
2755         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: Added.
2756
2757 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2758
2759         [GStreamer][MSE] Playback pipeline
2760         https://bugs.webkit.org/show_bug.cgi?id=162901
2761
2762         Reviewed by Xabier Rodriguez-Calvar.
2763
2764         Encapsulate the responsibility to interact with the GStreamer playback pipeline and the
2765         different streams managed by the WebKitMediaSrc element into a new PlaybackPipeline class.
2766
2767         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added.
2768         (getStreamByTrackId):
2769         (getStreamBySourceBufferPrivate):
2770         (pushSample):
2771         (WebCore::PlaybackPipeline::create):
2772         (WebCore::PlaybackPipeline::PlaybackPipeline):
2773         (WebCore::PlaybackPipeline::~PlaybackPipeline):
2774         (WebCore::PlaybackPipeline::setWebKitMediaSrc):
2775         (WebCore::PlaybackPipeline::webKitMediaSrc):
2776         (WebCore::PlaybackPipeline::addSourceBuffer):
2777         (WebCore::PlaybackPipeline::removeSourceBuffer):
2778         (WebCore::PlaybackPipeline::attachTrack):
2779         (WebCore::PlaybackPipeline::reattachTrack):
2780         (WebCore::PlaybackPipeline::notifyDurationChanged):
2781         (WebCore::PlaybackPipeline::markEndOfStream):
2782         (WebCore::PlaybackPipeline::flushAndEnqueueNonDisplayingSamples):
2783         (WebCore::PlaybackPipeline::enqueueSample):
2784         (WebCore::PlaybackPipeline::pipeline):
2785         * platform/graphics/gstreamer/mse/PlaybackPipeline.h: Added.
2786
2787 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2788
2789         [GStreamer][MSE][EME] MSE specialization of Media Player Private for GStreamer
2790         https://bugs.webkit.org/show_bug.cgi?id=162900
2791
2792         Reviewed by Xabier Rodriguez-Calvar.
2793
2794         Refactor MSE-specific logic to its own GStreamer player. This new MSE player coordinates
2795         data appending, media playback and interaction with MediaSource by delegating to
2796         AppendPipeline (one instance per SourceBuffer), PlaybackPipeline and
2797         MediaSourceClientGStreamerMSE/MediaSourcePrivateClient respectively.
2798
2799         This patch is co-authored with Philippe Normand <philn@igalia.com> (EME support).
2800
2801         * platform/graphics/MediaPlayer.cpp:
2802         (WebCore::buildMediaEnginesVector):
2803         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: Added.
2804         (dumpReadyState):
2805         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
2806         (WebCore::initializeGStreamerAndRegisterWebKitMSEElement):
2807         (WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable):
2808         (WebCore::MediaPlayerPrivateGStreamerMSE::MediaPlayerPrivateGStreamerMSE):
2809         (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
2810         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
2811         (WebCore::MediaPlayerPrivateGStreamerMSE::pause):
2812         (WebCore::MediaPlayerPrivateGStreamerMSE::durationMediaTime):
2813         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
2814         (WebCore::MediaPlayerPrivateGStreamerMSE::configurePlaySink):
2815         (WebCore::MediaPlayerPrivateGStreamerMSE::changePipelineState):
2816         (WebCore::MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime):
2817         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
2818         (WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
2819         (WebCore::MediaPlayerPrivateGStreamerMSE::updatePlaybackRate):
2820         (WebCore::MediaPlayerPrivateGStreamerMSE::seeking):
2821         (WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
2822         (WebCore::MediaPlayerPrivateGStreamerMSE::waitForSeekCompleted):
2823         (WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
2824         (WebCore::MediaPlayerPrivateGStreamerMSE::setRate):
2825         (WebCore::MediaPlayerPrivateGStreamerMSE::buffered):
2826         (WebCore::MediaPlayerPrivateGStreamerMSE::sourceChanged):
2827         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
2828         (WebCore::MediaPlayerPrivateGStreamerMSE::asyncStateChangeDone):
2829         (WebCore::MediaPlayerPrivateGStreamerMSE::isTimeBuffered):
2830         (WebCore::MediaPlayerPrivateGStreamerMSE::setMediaSourceClient):
2831         (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourceClient):
2832         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
2833         (WebCore::mimeTypeCache):
2834         (WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
2835         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
2836         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
2837         (WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey):
2838         (WebCore::MediaPlayerPrivateGStreamerMSE::markEndOfStream):
2839         (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime):
2840         (WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable):
2841         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: Added.
2842         (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourcePrivateClient):
2843
2844 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2845
2846         [GStreamer][MSE] MediaSourceGStreamer refactoring
2847         https://bugs.webkit.org/show_bug.cgi?id=162899
2848
2849         Reviewed by Žan Doberšek.
2850
2851         Move MediaSourceGStreamer to the mse directory, manage SourceBufferPrivates and delegate WebKitMediaSrc operations to the MSE private player.
2852
2853         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp.
2854         (WebCore::MediaSourceGStreamer::open):
2855         (WebCore::MediaSourceGStreamer::MediaSourceGStreamer):
2856         (WebCore::MediaSourceGStreamer::~MediaSourceGStreamer):
2857         (WebCore::MediaSourceGStreamer::addSourceBuffer):
2858         (WebCore::MediaSourceGStreamer::removeSourceBuffer):
2859         (WebCore::MediaSourceGStreamer::durationChanged):
2860         (WebCore::MediaSourceGStreamer::markEndOfStream):
2861         (WebCore::MediaSourceGStreamer::unmarkEndOfStream):
2862         (WebCore::MediaSourceGStreamer::readyState):
2863         (WebCore::MediaSourceGStreamer::setReadyState):
2864         (WebCore::MediaSourceGStreamer::waitForSeekCompleted):
2865         (WebCore::MediaSourceGStreamer::seekCompleted):
2866         (WebCore::MediaSourceGStreamer::sourceBufferPrivateDidChangeActiveState):
2867         (WebCore::MediaSourceGStreamer::buffered):
2868         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h.
2869
2870 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2871
2872         [GStreamer][MSE] SourceBufferPrivateGStreamer refactoring
2873         https://bugs.webkit.org/show_bug.cgi?id=162898
2874
2875         Reviewed by Xabier Rodriguez-Calvar.
2876
2877         Moved SourceBufferPrivateGStreamer to an mse directory and added unimplemented features (abort, enqueueing and sample flow control).
2878
2879         * platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp: Removed.
2880         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: Added.
2881         (WebCore::SourceBufferPrivateGStreamer::create):
2882         (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
2883         (WebCore::SourceBufferPrivateGStreamer::~SourceBufferPrivateGStreamer):
2884         (WebCore::SourceBufferPrivateGStreamer::setClient):
2885         (WebCore::SourceBufferPrivateGStreamer::append):
2886         (WebCore::SourceBufferPrivateGStreamer::abort):
2887         (WebCore::SourceBufferPrivateGStreamer::resetParserState):
2888         (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):
2889         (WebCore::SourceBufferPrivateGStreamer::readyState):
2890         (WebCore::SourceBufferPrivateGStreamer::setReadyState):
2891         (WebCore::SourceBufferPrivateGStreamer::flushAndEnqueueNonDisplayingSamples):
2892         (WebCore::SourceBufferPrivateGStreamer::enqueueSample):
2893         (WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
2894         (WebCore::SourceBufferPrivateGStreamer::setReadyForMoreSamples):
2895         (WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
2896         (WebCore::SourceBufferPrivateGStreamer::setActive):
2897         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples):
2898         (WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
2899         (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment):
2900         (WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
2901         (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples):
2902         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h.
2903
2904 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2905
2906         [GStreamer][MSE] MediaSourceClientGStreamerMSE
2907         https://bugs.webkit.org/show_bug.cgi?id=162896
2908
2909         Reviewed by Xabier Rodriguez-Calvar.
2910
2911         This class encapsulates the MediaSource interaction responsibility for the
2912         GStreamer platform.
2913
2914         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: Added.
2915         (WebCore::MediaSourceClientGStreamerMSE::create):
2916         (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
2917         (WebCore::MediaSourceClientGStreamerMSE::~MediaSourceClientGStreamerMSE):
2918         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
2919         (WebCore::MediaSourceClientGStreamerMSE::duration):
2920         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
2921         (WebCore::MediaSourceClientGStreamerMSE::abort):
2922         (WebCore::MediaSourceClientGStreamerMSE::append):
2923         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
2924         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
2925         (WebCore::MediaSourceClientGStreamerMSE::flushAndEnqueueNonDisplayingSamples):
2926         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
2927         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
2928         (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate):
2929         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: Added.
2930
2931 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2932
2933         [GStreamer] GStreamer Media Sample
2934         https://bugs.webkit.org/show_bug.cgi?id=162894
2935
2936         Reviewed by Xabier Rodriguez-Calvar.
2937
2938         Implement the MediaSample interface for the GStreamer platform.
2939
2940         * platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp: Added.
2941         (WebCore::GStreamerMediaSample::GStreamerMediaSample):
2942         (WebCore::GStreamerMediaSample::create):
2943         (WebCore::GStreamerMediaSample::createFakeSample):
2944         (WebCore::GStreamerMediaSample::applyPtsOffset):
2945         (WebCore::GStreamerMediaSample::offsetTimestampsBy):
2946         (WebCore::GStreamerMediaSample::~GStreamerMediaSample):
2947         * platform/graphics/gstreamer/mse/GStreamerMediaSample.h: Added.
2948         (WebCore::GStreamerMediaSample::presentationTime):
2949         (WebCore::GStreamerMediaSample::decodeTime):
2950         (WebCore::GStreamerMediaSample::duration):
2951         (WebCore::GStreamerMediaSample::trackID):
2952         (WebCore::GStreamerMediaSample::setTrackID):
2953         (WebCore::GStreamerMediaSample::sizeInBytes):
2954         (WebCore::GStreamerMediaSample::sample):
2955         (WebCore::GStreamerMediaSample::presentationSize):
2956         (WebCore::GStreamerMediaSample::setTimestamps):
2957         (WebCore::GStreamerMediaSample::isDivisable):
2958         (WebCore::GStreamerMediaSample::divide):
2959         (WebCore::GStreamerMediaSample::flags):
2960         (WebCore::GStreamerMediaSample::platformSample):
2961         (WebCore::GStreamerMediaSample::dump):
2962
2963 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2964
2965         [GStreamer] GStreamer Media Description
2966         https://bugs.webkit.org/show_bug.cgi?id=162893
2967
2968         Reviewed by Xabier Rodriguez-Calvar.
2969
2970         Implement the MediaDescription interface for the GStreamer platform.
2971
2972         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.cpp: Added.
2973         (WebCore::GStreamerMediaDescription::codec):
2974         (WebCore::GStreamerMediaDescription::isVideo):
2975         (WebCore::GStreamerMediaDescription::isAudio):
2976         (WebCore::GStreamerMediaDescription::isText):
2977         * platform/graphics/gstreamer/mse/GStreamerMediaDescription.h: Added.
2978         (WebCore::GStreamerMediaDescription::create):
2979         (WebCore::GStreamerMediaDescription::~GStreamerMediaDescription):
2980         (WebCore::GStreamerMediaDescription::GStreamerMediaDescription):
2981
2982 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
2983
2984         [GStreamer][MSE][EME] Append Pipeline
2985         https://bugs.webkit.org/show_bug.cgi?id=162874
2986
2987         Reviewed by Žan Doberšek.
2988
2989         This patch is co-authored with Xabier Rodriguez-Calvar <calvaris@igalia.com> (data starve
2990         and last sample detection, debug features) and Philippe Normand <philn@igalia.com> (EME
2991         support).
2992
2993         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added.
2994         (WebCore::dumpAppendState):
2995         (WebCore::appendPipelineElementMessageCallback):
2996         (WebCore::appendPipelineApplicationMessageCallback):
2997         (WebCore::AppendPipeline::AppendPipeline):
2998         (WebCore::AppendPipeline::~AppendPipeline):
2999         (WebCore::AppendPipeline::clearPlayerPrivate):
3000         (WebCore::AppendPipeline::handleElementMessage):
3001         (WebCore::AppendPipeline::handleApplicationMessage):
3002         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
3003         (WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft):
3004         (WebCore::AppendPipeline::id):
3005         (WebCore::AppendPipeline::setAppendState):
3006         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
3007         (WebCore::AppendPipeline::appsinkCapsChanged):
3008         (WebCore::AppendPipeline::checkEndOfAppend):
3009         (WebCore::AppendPipeline::appsinkNewSample):
3010         (WebCore::AppendPipeline::appsinkEOS):
3011         (WebCore::AppendPipeline::didReceiveInitializationSegment):
3012         (WebCore::AppendPipeline::trackId):
3013         (WebCore::AppendPipeline::resetPipeline):
3014         (WebCore::AppendPipeline::setAppsrcDataLeavingProbe):
3015         (WebCore::AppendPipeline::removeAppsrcDataLeavingProbe):
3016         (WebCore::AppendPipeline::abort):
3017         (WebCore::AppendPipeline::pushNewBuffer):
3018         (WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft):
3019         (WebCore::AppendPipeline::reportAppsrcNeedDataReceived):
3020         (WebCore::AppendPipeline::handleNewAppsinkSample):
3021         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
3022         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
3023         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
3024         (WebCore::appendPipelineAppsinkCapsChanged):
3025         (WebCore::appendPipelineAppsrcDataLeaving):
3026         (WebCore::appendPipelinePadProbeDebugInformation):
3027         (WebCore::appendPipelineAppsrcNeedData):
3028         (WebCore::appendPipelineDemuxerPadAdded):
3029         (WebCore::appendPipelineDemuxerPadRemoved):
3030         (WebCore::appendPipelineAppsinkNewSample):
3031         (WebCore::appendPipelineAppsinkEOS):
3032         * platform/graphics/gstreamer/mse/AppendPipeline.h: Added.
3033         (WebCore::AppendPipeline::appendState):
3034         (WebCore::AppendPipeline::mediaSourceClient):
3035         (WebCore::AppendPipeline::sourceBufferPrivate):
3036         (WebCore::AppendPipeline::bus):
3037         (WebCore::AppendPipeline::pipeline):
3038         (WebCore::AppendPipeline::appsrc):
3039         (WebCore::AppendPipeline::appsink):
3040         (WebCore::AppendPipeline::demuxerSrcPadCaps):
3041         (WebCore::AppendPipeline::appsinkCaps):
3042         (WebCore::AppendPipeline::track):
3043         (WebCore::AppendPipeline::streamType):
3044
3045 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
3046
3047         [GStreamer] Drain query support
3048         https://bugs.webkit.org/show_bug.cgi?id=162872
3049
3050         Reviewed by Žan Doberšek.
3051
3052         Under some circumstances, GStreamer deadlocks completely during MSE seeks on OpenGL ES
3053         systems. This is because the video sink still holds samples. Proper DRAIN support
3054         fixes this issue and is also good for all the platforms, not only OpenGL ES.
3055
3056         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3057         (WebCore::MediaPlayerPrivateGStreamerBase::triggerDrain):
3058         (WebCore::MediaPlayerPrivateGStreamerBase::drainCallback):
3059         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
3060         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Deleted.
3061         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3062         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3063         (VideoRenderRequestScheduler::drain):
3064         (webkitVideoSinkQuery):
3065         (webkitVideoSinkEvent):
3066         (webkit_video_sink_class_init):
3067         (VideoRenderRequestScheduler::stop): Deleted.
3068         (webkitVideoSinkProposeAllocation): Deleted.
3069
3070 2016-10-26  Enrique Ocaña González  <eocanha@igalia.com>
3071
3072         [GStreamer] Track enhancements for MSE support
3073         https://bugs.webkit.org/show_bug.cgi?id=162869
3074
3075         Reviewed by Xabier Rodriguez-Calvar.
3076
3077         Add 'id' field to Audio/VideoTrackPrivateGStreamer. Make TrackPrivateBaseGStreamer
3078         work anyway in cases where the demuxer isn't contained in a GstPlaybin.
3079
3080         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
3081         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
3082         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
3083         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3084         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
3085         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
3086         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
3087         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
3088         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
3089
3090 2016-10-26  Youenn Fablet  <youenn@apple.com>
3091
3092         Make CachedResourceLoader originsMatch check more efficient
3093         https://bugs.webkit.org/show_bug.cgi?id=163938
3094
3095         Reviewed by Darin Adler.
3096
3097         No change of behavior.
3098
3099         * loader/cache/CachedResourceLoader.cpp:
3100         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
3101         (WebCore::originsMatch): Moved to SecurityOrigin.cpp.
3102         * page/SecurityOrigin.cpp:
3103         (WebCore::areOriginsMatching): Helper routine to check whether origins are matching.
3104         (WebCore::originsMatch): Ensuring string comparison provides the same result as this function.
3105         * page/SecurityOrigin.h:
3106         (WebCore::SecurityOrigin::protocol):
3107         (WebCore::SecurityOrigin::host):
3108         (WebCore::SecurityOrigin::domain):
3109
3110 2016-10-25  Yusuke Suzuki  <utatane.tea@gmail.com>
3111
3112         [DOMJIT] Tell IDL result type to DFG to drop type checks in AI
3113         https://bugs.webkit.org/show_bug.cgi?id=163900
3114
3115         Reviewed by Sam Weinig.
3116
3117         Add TestDOMJIT.idl for bindings generation tests.
3118
3119         * bindings/scripts/CodeGeneratorJS.pm:
3120         (GetResultTypeFilter):
3121         (GenerateImplementation):
3122         * bindings/scripts/test/JS/JSTestDOMJIT.cpp: Added.
3123         (WebCore::JSTestDOMJITPrototype::create):
3124         (WebCore::JSTestDOMJITPrototype::createStructure):
3125         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
3126         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
3127         (WebCore::JSTestDOMJITConstructor::initializeProperties):
3128         (WebCore::JSTestDOMJITPrototype::finishCreation):
3129         (WebCore::JSTestDOMJIT::JSTestDOMJIT):
3130         (WebCore::JSTestDOMJIT::createPrototype):
3131         (WebCore::JSTestDOMJIT::prototype):
3132         (WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
3133         (WebCore::jsTestDOMJITAnyAttr):
3134         (WebCore::jsTestDOMJITAnyAttrGetter):
3135         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
3136         (WebCore::domJITGetterSetterForTestDOMJITAnyAttr):
3137         (WebCore::jsTestDOMJITBooleanAttr):
3138         (WebCore::jsTestDOMJITBooleanAttrGetter):
3139         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
3140         (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr):
3141         (WebCore::jsTestDOMJITByteAttr):
3142         (WebCore::jsTestDOMJITByteAttrGetter):
3143         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
3144         (WebCore::domJITGetterSetterForTestDOMJITByteAttr):
3145         (WebCore::jsTestDOMJITOctetAttr):
3146         (WebCore::jsTestDOMJITOctetAttrGetter):
3147         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
3148         (WebCore::domJITGetterSetterForTestDOMJITOctetAttr):
3149         (WebCore::jsTestDOMJITShortAttr):
3150         (WebCore::jsTestDOMJITShortAttrGetter):
3151         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
3152         (WebCore::domJITGetterSetterForTestDOMJITShortAttr):
3153         (WebCore::jsTestDOMJITUnsignedShortAttr):
3154         (WebCore::jsTestDOMJITUnsignedShortAttrGetter):
3155         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
3156         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr):
3157         (WebCore::jsTestDOMJITLongAttr):
3158         (WebCore::jsTestDOMJITLongAttrGetter):
3159         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
3160         (WebCore::domJITGetterSetterForTestDOMJITLongAttr):
3161         (WebCore::jsTestDOMJITUnsignedLongAttr):
3162         (WebCore::jsTestDOMJITUnsignedLongAttrGetter):
3163         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
3164         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr):
3165         (WebCore::jsTestDOMJITLongLongAttr):
3166         (WebCore::jsTestDOMJITLongLongAttrGetter):
3167         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
3168         (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr):
3169         (WebCore::jsTestDOMJITUnsignedLongLongAttr):
3170         (WebCore::jsTestDOMJITUnsignedLongLongAttrGetter):
3171         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
3172         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr):
3173         (WebCore::jsTestDOMJITFloatAttr):
3174         (WebCore::jsTestDOMJITFloatAttrGetter):
3175         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
3176         (WebCore::domJITGetterSetterForTestDOMJITFloatAttr):
3177         (WebCore::jsTestDOMJITUnrestrictedFloatAttr):
3178         (WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter):
3179         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
3180         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr):
3181         (WebCore::jsTestDOMJITDoubleAttr):
3182         (WebCore::jsTestDOMJITDoubleAttrGetter):
3183         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
3184         (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr):
3185         (WebCore::jsTestDOMJITUnrestrictedDoubleAttr):
3186         (WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter):
3187         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
3188         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr):
3189         (WebCore::jsTestDOMJITDomStringAttr):
3190         (WebCore::jsTestDOMJITDomStringAttrGetter):
3191         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
3192         (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr):
3193         (WebCore::jsTestDOMJITByteStringAttr):
3194         (WebCore::jsTestDOMJITByteStringAttrGetter):
3195         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
3196         (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr):
3197         (WebCore::jsTestDOMJITUsvStringAttr):
3198         (WebCore::jsTestDOMJITUsvStringAttrGetter):
3199         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
3200         (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr):
3201         (WebCore::jsTestDOMJITNodeAttr):
3202         (WebCore::jsTestDOMJITNodeAttrGetter):
3203         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
3204         (WebCore::domJITGetterSetterForTestDOMJITNodeAttr):
3205         (WebCore::jsTestDOMJITBooleanNullableAttr):
3206         (WebCore::jsTestDOMJITBooleanNullableAttrGetter):
3207         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
3208         (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr):
3209         (WebCore::jsTestDOMJITByteNullableAttr):
3210         (WebCore::jsTestDOMJITByteNullableAttrGetter):
3211         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
3212         (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr):
3213         (WebCore::jsTestDOMJITOctetNullableAttr):
3214         (WebCore::jsTestDOMJITOctetNullableAttrGetter):
3215         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
3216         (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr):
3217         (WebCore::jsTestDOMJITShortNullableAttr):
3218         (WebCore::jsTestDOMJITShortNullableAttrGetter):
3219         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
3220         (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr):
3221         (WebCore::jsTestDOMJITUnsignedShortNullableAttr):
3222         (WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter):
3223         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
3224         (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr):
3225         (WebCore::jsTestDOMJITLongNullableAttr):
3226         (WebCore::jsTestDOMJITLongNullableAttrGetter):
3227         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
3228         (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr):
3229         (WebCore::jsTestDOMJITUnsignedLongNullableAttr):
3230         (WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter):
3231         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
3232         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr):
3233         (WebCore::jsTestDOMJITLongLongNullableAttr):
3234         (WebCore::jsTestDOMJITLongLongNullableAttrGetter):
3235         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
3236         (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr):
3237         (WebCore::jsTestDOMJITUnsignedLongLongNullableAttr):
3238         (WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter):
3239         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
3240         (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr):
3241         (WebCore::jsTestDOMJITFloatNullableAttr):
3242         (WebCore::jsTestDOMJITFloatNullableAttrGetter):
3243         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
3244         (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr):
3245         (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttr):
3246         (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter):
3247         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
3248         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr):
3249         (WebCore::jsTestDOMJITDoubleNullableAttr):
3250         (WebCore::jsTestDOMJITDoubleNullableAttrGetter):
3251         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
3252         (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr):
3253         (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttr):
3254         (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter):
3255         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
3256         (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr):
3257         (WebCore::jsTestDOMJITDomStringNullableAttr):
3258         (WebCore::jsTestDOMJITDomStringNullableAttrGetter):
3259         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
3260         (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr):
3261         (WebCore::jsTestDOMJITByteStringNullableAttr):
3262         (WebCore::jsTestDOMJITByteStringNullableAttrGetter):
3263         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
3264         (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr):
3265         (WebCore::jsTestDOMJITUsvStringNullableAttr):
3266         (WebCore::jsTestDOMJITUsvStringNullableAttrGetter):
3267         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
3268         (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr):
3269         (WebCore::jsTestDOMJITNodeNullableAttr):
3270         (WebCore::jsTestDOMJITNodeNullableAttrGetter):
3271         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
3272         (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr):
3273         (WebCore::jsTestDOMJITConstructor):
3274         (WebCore::setJSTestDOMJITConstructor):
3275         (WebCore::JSTestDOMJIT::getConstructor):
3276         (WebCore::JSTestDOMJIT::visitChildren):
3277         * bindings/scripts/test/JS/JSTestDOMJIT.h: Added.
3278         (WebCore::JSTestDOMJIT::create):
3279         (WebCore::JSTestDOMJIT::createStructure):
3280         (WebCore::JSTestDOMJIT::wrapped):
3281         (WebCore::JSTestDOMJIT::finishCreation):
3282         * bindings/scripts/test/TestDOMJIT.idl: Added.
3283
3284 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
3285
3286         [Win] Unreviewed build fix.
3287
3288         * platform/graphics/GraphicsContext.h: Add missing declaration.
3289
3290 2016-10-25  Ryosuke Niwa  <rniwa@webkit.org>
3291
3292         Updating attribute by textContent must create a single mutation record and custom element reaction
3293         https://bugs.webkit.org/show_bug.cgi?id=164003
3294
3295         Reviewed by Chris Dumez.
3296
3297         The bug was caused by setTextContent not invoking setNodeValue for Attr nodes.
3298         Use setNodeValue to match the specification: https://dom.spec.whatwg.org/#dom-node-textcontent
3299
3300         Test: fast/dom/MutationObserver/text-content-on-attr.html
3301
3302         * dom/Node.cpp:
3303         (WebCore::Node::setTextContent):
3304
3305 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
3306
3307         [Win][Direct2D] Use smart pointers for Direct2D Path types
3308         https://bugs.webkit.org/show_bug.cgi?id=163994
3309
3310         Reviewed by Alex Christensen.
3311
3312         Tested by existing path tests.
3313
3314         * platform/graphics/Path.h:
3315         (WebCore::Path::platformPath): Use a COMPtr for m_path.
3316         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3317         (WebCore::GraphicsContext::systemFactory): Present better D2D debug output
3318         when running a debug build.
3319         (WebCore::GraphicsContext::platformInit): Initialize a D2D device from a
3320         native GDI device context.
3321         (WebCore::GraphicsContext::platformStrokeStyle): Added.
3322         (WebCore::GraphicsContext::clipBounds): Simplify clip boundary calculations and
3323         avoid doing math on infinities.
3324         * platform/graphics/win/PathDirect2D.cpp:
3325         (WebCore::scratchRenderTarget): Added.
3326         (WebCore::Path::~Path): Switch to COMPtr implementation.
3327         (WebCore::Path::ensurePlatformPath): Ditto.
3328         (WebCore::Path::appendGeometry): Ditto.
3329         (WebCore::Path::operator=): Ditto.
3330         (WebCore::Path::initializePathState): Ditto.
3331         (WebCore::Path::strokeContains): Provide an implementation.
3332         (WebCore::Path::transform): Ditto.
3333         (WebCore::Path::addEllipse): No need for explicit construction of the
3334         D2D1::Point2F object.
3335         (WebCore::Path::clear): Switch to COMPtr implementation.
3336
3337 2016-10-25  Nan Wang  <n_wang@apple.com>
3338
3339         LayoutTest accessibility/mac/meter-gauge-value-description.html failing
3340         https://bugs.webkit.org/show_bug.cgi?id=163997
3341         <rdar://problem/28948637>
3342
3343         Reviewed by Chris Fleizach.
3344
3345         I hand-edited the Localizable.strings file in a previous patch and my changes
3346         were replaced by running update-webkit-localizable-strings script. Changed the
3347         key to be the same as the value to keep consistency with other entries.
3348
3349         Re-enabled the failing test.
3350
3351         * English.lproj/Localizable.strings:
3352         * platform/LocalizedStrings.cpp:
3353         (WebCore::AXMeterGaugeRegionOptimumText):
3354         (WebCore::AXMeterGaugeRegionSuboptimalText):
3355         (WebCore::AXMeterGaugeRegionLessGoodText):
3356
3357 2016-10-25  Filip Pizlo  <fpizlo@apple.com>
3358
3359         HeapTimer should not hardcode all of its subclasses and USE(CF) shouldn't be a bizarre special case
3360         https://bugs.webkit.org/show_bug.cgi?id=163947
3361
3362         Reviewed by Geoffrey Garen.
3363
3364         No new tests because no new behavior.
3365
3366         * platform/ios/WebSafeGCActivityCallbackIOS.h:
3367         * platform/ios/WebSafeIncrementalSweeperIOS.h:
3368
3369 2016-10-25  Dave Hyatt  <hyatt@apple.com>
3370
3371         [CSS Parser] Improvements to selector parsing
3372         https://bugs.webkit.org/show_bug.cgi?id=163964
3373
3374         Reviewed by Zalan Bujtas.
3375
3376         * css/CSSSelector.cpp:
3377         (WebCore::CSSSelector::setAttribute):
3378         (WebCore::CSSSelector::setNth):
3379         * css/CSSSelector.h:
3380         (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive):
3381         * css/StyleSheetContents.cpp:
3382         (WebCore::StyleSheetContents::StyleSheetContents):
3383         (WebCore::StyleSheetContents::parserAppendRule):
3384         (WebCore::StyleSheetContents::ruleAt):
3385         (WebCore::StyleSheetContents::ruleCount):
3386         (WebCore::StyleSheetContents::clearRules):
3387         (WebCore::StyleSheetContents::wrapperInsertRule):
3388         (WebCore::StyleSheetContents::wrapperDeleteRule):
3389         * css/StyleSheetContents.h:
3390         * css/parser/CSSParser.cpp:
3391         (WebCore::CSSParserContext::CSSParserContext):
3392         (WebCore::CSSParser::parseSelector):
3393         * css/parser/CSSParserValues.h:
3394         (WebCore::CSSParserSelector::setAttribute):
3395         (WebCore::CSSParserSelector::setArgument):
3396         (WebCore::CSSParserSelector::setNth):
3397         * css/parser/CSSSelectorParser.cpp:
3398         (WebCore::consumeLangArgumentList):
3399         (WebCore::CSSSelectorParser::consumeCompoundSelector):
3400         (WebCore::CSSSelectorParser::consumeAttribute):
3401         (WebCore::isPseudoClassFunction):
3402         (WebCore::isPseudoElementFunction):
3403         (WebCore::CSSSelectorParser::consumePseudo):
3404         (WebCore::CSSSelectorParser::consumeCombinator):
3405
3406 2016-10-25  Beth Dakin  <bdakin@apple.com>
3407
3408         Numbered list should be represented without ‘…’
3409         https://bugs.webkit.org/show_bug.cgi?id=163992
3410         -and corresponding-
3411         rdar://problem/28911337
3412
3413         Reviewed by Darin Adler.
3414
3415         * English.lproj/Localizable.strings:
3416         * platform/LocalizedStrings.cpp:
3417         (WebCore::insertListTypeNumbered):
3418
3419 2016-10-25  Daniel Bates  <dabates@apple.com>
3420
3421         REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
3422         https://bugs.webkit.org/show_bug.cgi?id=163978
3423         <rdar://problem/25962131>
3424
3425         Reviewed by Darin Adler.
3426
3427         During the tokenization process of an HTML tag the start and end positions of each of its
3428         attributes is tracked so that the XSS Auditor can request a snippet around a suspected
3429         injected attribute. We need to take care to consider document.write() boundaries when
3430         tracking the start and end positions of each HTML tag and attribute so that the XSS Auditor
3431         receives the correct snippet. Following r178265 we no longer consider document.write()
3432         boundaries when tracking the start and end positions of attributes. So, the substring
3433         represented by the start and end positions of an attribute may correspond to some other
3434         attribute in the tag. Therefore the XSS Auditor may fail to block an injection because the
3435         snippet it requested may not be the snippet that it intended to request.
3436
3437         Tests: http/tests/security/xssAuditor/dom-write-location-dom-write-open-img-onerror.html
3438                http/tests/security/xssAuditor/dom-write-location-open-img-onerror.html
3439                http/tests/security/xssAuditor/nested-dom-write-location-open-img-onerror.html
3440
3441         * html/parser/HTMLSourceTracker.cpp:
3442         (WebCore::HTMLSourceTracker::startToken): Set the attribute base offset to be the token
3443         start position.
3444         (WebCore::HTMLSourceTracker::source): Use the specified attribute start position as-is. We no
3445         longer adjust it here because it was adjusted with respect to the attribute base offset, which
3446         takes into account document.write() boundaries.
3447         * html/parser/HTMLToken.h:
3448         (WebCore::HTMLToken::setAttributeBaseOffset): Added.
3449         (WebCore::HTMLToken::beginAttribute): Subtract attribute base offset from the specified offset.
3450         (WebCore::HTMLToken::endAttribute): Ditto.
3451         * html/parser/HTMLTokenizer.h:
3452         (WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Added.
3453
3454 2016-10-25  Chris Dumez  <cdumez@apple.com>
3455
3456         IDBDatabase.transaction() should take a union in parameter
3457         https://bugs.webkit.org/show_bug.cgi?id=163966
3458
3459         Reviewed by Sam Weinig.
3460
3461         IDBDatabase.transaction() should take a union in parameter:
3462         - https://www.w3.org/TR/IndexedDB/#widl-IDBDatabase-transaction-IDBTransaction-DOMString-sequence-DOMString--storeNames-IDBTransactionMode-mode
3463
3464         No new tests, no expected Web-exposed behavior change.
3465
3466         * Modules/indexeddb/IDBDatabase.cpp:
3467         (WebCore::IDBDatabase::transaction):
3468         * Modules/indexeddb/IDBDatabase.h:
3469         * Modules/indexeddb/IDBDatabase.idl:
3470
3471 2016-10-25  Brady Eidson  <beidson@apple.com>
3472
3473         IndexedDB 2.0: Support IDBObjectStore openKeyCursor.
3474         <rdar://problem/28806930> and https://bugs.webkit.org/show_bug.cgi?id=163954
3475
3476         Reviewed by Andy Estes.
3477
3478         No new tests (Covered by changes to existing tests)
3479
3480         * Modules/indexeddb/IDBCursor.cpp:
3481         (WebCore::IDBCursor::create):
3482         * Modules/indexeddb/IDBCursor.h:
3483
3484         * Modules/indexeddb/IDBObjectStore.cpp:
3485         (WebCore::IDBObjectStore::openCursor):
3486         (WebCore::IDBObjectStore::openKeyCursor):
3487         * Modules/indexeddb/IDBObjectStore.h:
3488         * Modules/indexeddb/IDBObjectStore.idl:
3489
3490         * Modules/indexeddb/IDBTransaction.cpp:
3491         (WebCore::IDBTransaction::requestOpenCursor):
3492
3493         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
3494         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): Only grab the current value
3495           if the cursor is KeyAndValue.
3496
3497         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3498         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
3499         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Only save off the data for an
3500           object store cursor if it's both KeyAndValue.
3501         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3502
3503         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3504         (WebCore::IDBCursorInfo::objectStoreCursor): Allow for a KeyOnly ObjectStoreCursor.
3505         * Modules/indexeddb/shared/IDBCursorInfo.h:
3506
3507 2016-10-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3508
3509         Support InputEvent.dataTransfer for the InputEvent spec
3510         https://bugs.webkit.org/show_bug.cgi?id=163213
3511         <rdar://problem/28700407>
3512
3513         Reviewed by Ryosuke Niwa.
3514
3515         Adds support for the dataTransfer attribute of InputEvent, which contains both HTML and plain text
3516         representations of inserted content corresponding to input types "insertFromPaste", "insertFromDrop" and
3517         "insertReplacementText". The specification calls for the data transfer's drag data item list to contain this
3518         information via two entries with type strings "text/html" and "text/plain". However, WebKit does not yet support
3519         the DataTransfer.items -- in lieu of this, we will provide this information for now via getData("text/plain")
3520         and getData("text/html"), respectively.
3521
3522         To support this attribute, we need a special type of DataTransfer which is readonly and returns canned data
3523         given a type string. To implement this, we introduce StaticPasteboard, a type of Pasteboard which is initialized
3524         with a map of type string to data. When asked for its data via getData, the StaticPasteboard searches its map
3525         for the requested type and returns the result, if any.
3526
3527         An editing command may now create a new DataTransfer via DataTransfer::createForInputEvent from HTML and
3528         plaintext strings, and then vend this information to its dispatched input events by overriding
3529         CompositeEditCommand::inputEventDataTransfer.
3530
3531         Some further work will be needed to ensure that all information exposed via this DataTransfer does not contain
3532         hidden content. To do this, we should create a new Document, "paste" the contents of our copied HTML string into
3533         it, then simulate selecting the content and generating markup from the selection to create a sanitized
3534         DocumentFragment corresponding to the original copied HTML. This will be addressed in a future patch.
3535
3536         Tests: fast/events/input-events-paste-rich-datatransfer.html
3537                fast/events/input-events-spell-checking-datatransfer.html
3538
3539         * PlatformEfl.cmake:
3540         * PlatformGTK.cmake:
3541         * PlatformWin.cmake:
3542
3543         Add StaticPasteboard.cpp.
3544
3545         * WebCore.xcodeproj/project.pbxproj:
3546         * dom/DataTransfer.cpp:
3547         (WebCore::DataTransfer::DataTransfer):
3548         (WebCore::DataTransfer::createForInputEvent):
3549
3550         Initializes a new DataTransfer for the purposes of input events. This takes a HTML and plain text
3551         representations of the data being inserted and creates a new readonly DataTransfer backed by a StaticPasteboard
3552         that only knows how to map the "text/plain" data type to the given plaintext string and "text/html" to the
3553         given HTML text.
3554
3555         * dom/DataTransfer.h:
3556         * dom/InputEvent.cpp:
3557         (WebCore::InputEvent::create):
3558         (WebCore::InputEvent::InputEvent):
3559         (WebCore::InputEvent::dataTransfer):
3560         * dom/InputEvent.h:
3561         * dom/InputEvent.idl:
3562
3563         Add the InputEvent.dataTransfer attribute.
3564
3565         * dom/Node.cpp:
3566         * editing/CompositeEditCommand.cpp:
3567         (WebCore::CompositeEditCommand::inputEventDataTransfer):
3568
3569         Add a new hook for CompositeEditCommands to vend a DataTransfer for the purposes of input events. By default,
3570         this is null.
3571
3572         * editing/CompositeEditCommand.h:
3573         * editing/Editor.cpp:
3574         (WebCore::dispatchBeforeInputEvent):
3575         (WebCore::dispatchInputEvent):
3576         (WebCore::dispatchBeforeInputEvents):
3577         (WebCore::dispatchInputEvents):
3578         (WebCore::Editor::willApplyEditing):
3579         (WebCore::Editor::appliedEditing):
3580         * editing/ReplaceRangeWithTextCommand.cpp:
3581         (WebCore::ReplaceRangeWithTextCommand::willApplyCommand):
3582         (WebCore::ReplaceRangeWithTextCommand::doApply):
3583         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer):
3584         * editing/ReplaceRangeWithTextCommand.h:
3585         * editing/ReplaceSelectionCommand.cpp:
3586         (WebCore::ReplaceSelectionCommand::willApplyCommand):
3587
3588         Initialize the ReplacementFragment here before applying the command, adjusting the DocumentFragment to be
3589         inserted in the process.
3590
3591         (WebCore::ReplaceSelectionCommand::doApply):
3592         (WebCore::ReplaceSelectionCommand::inputEventDataTransfer):
3593         (WebCore::ReplaceSelectionCommand::ensureReplacementFragment):
3594
3595         Returns the ReplacementFragment used to apply the command, initializing it if necessary and stripping extraneous
3596         nodes off of the document fragment in the process. Since ReplaceSelectionCommand may be used as a top-level
3597         editing command or a child of another CompositeEditCommand such as the ReplaceRangeWithTextCommand, the
3598         ReplacementFragment may be initialized either in willApplyCommand or in doApply.
3599
3600         * editing/ReplaceSelectionCommand.h:
3601         * editing/SpellingCorrectionCommand.cpp:
3602         (WebCore::SpellingCorrectionCommand::willApplyCommand):
3603         (WebCore::SpellingCorrectionCommand::doApply):
3604         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer):
3605         * editing/SpellingCorrectionCommand.h:
3606
3607         Using the replacement text fragment, create and return a DataTransfer for input events.
3608
3609         * platform/Pasteboard.h:
3610         * platform/StaticPasteboard.cpp: Added.
3611         (WebCore::StaticPasteboard::create):
3612         (WebCore::StaticPasteboard::StaticPasteboard):
3613         (WebCore::StaticPasteboard::hasData):
3614         (WebCore::StaticPasteboard::types):
3615         (WebCore::StaticPasteboard::readString):
3616         * platform/StaticPasteboard.h: Copied from Source/WebCore/dom/InputEvent.cpp.
3617         * platform/efl/PasteboardEfl.cpp:
3618         (WebCore::Pasteboard::writeMarkup):
3619         (WebCore::Pasteboard::write):
3620         (WebCore::Pasteboard::read):
3621         * platform/gtk/PasteboardGtk.cpp:
3622         (WebCore::Pasteboard::writeMarkup):
3623         * platform/ios/PasteboardIOS.mm:
3624         (WebCore::Pasteboard::writeMarkup):
3625         * platform/mac/PasteboardMac.mm:
3626         (WebCore::Pasteboard::Pasteboard):
3627         (WebCore::Pasteboard::writeMarkup):
3628         * platform/win/PasteboardWin.cpp:
3629         (WebCore::Pasteboard::write):
3630         (WebCore::Pasteboard::read):
3631
3632         To account for virtual methods on Pasteboard, add implementations for methods that were previously defined but
3633         unimplemented on these platforms.
3634
3635 2016-10-25  Andy Estes  <aestes@apple.com>
3636
3637         Implement rel=noopener
3638         https://bugs.webkit.org/show_bug.cgi?id=155166
3639         <rdar://problem/25193787>
3640
3641         Reviewed by Brent Fulgham.
3642
3643         Added support for rel=noopener to a and area elements.
3644
3645         Tests: fast/dom/Window/a-rel-noopener.html
3646                fast/dom/Window/area-rel-noopener.html
3647
3648         * html/HTMLAnchorElement.cpp:
3649         (WebCore::HTMLAnchorElement::HTMLAnchorElement): Stopped initializing m_linkRelations to 0.
3650         (WebCore::HTMLAnchorElement::parseAttribute): Declared static AtomicStrings for "noreferrer"
3651         and "noopener", and created a SpaceSplitString from the rel attribute value to test for these
3652         two values.
3653         (WebCore::HTMLAnchorElement::hasRel): Updated to use OptionSet::contains().
3654         (WebCore::HTMLAnchorElement::relList): Added a check for "noopener".
3655         (WebCore::HTMLAnchorElement::handleClick): Passed NewFrameOpenerPolicy::Suppress to
3656         FrameLoader::urlSelected() if rel=noopener was specified.
3657         * html/HTMLAnchorElement.h: Changed the Relation enum to an enum class, removed unused enum
3658         values, and changed m_linkRelations from a 30-bit unsigned integer to an OptionSet<Relation>
3659         (HTMLAnchorElement is still 128 bytes on 64-bit).
3660         * loader/FrameLoader.cpp:
3661         (WebCore::FrameLoader::urlSelected): Changed to only compute a NewFrameOpenerPolicy from the
3662         referrer policy if an explicit NewFrameOpenerPolicy isn't specified. Removed the version of
3663         urlSelected() that did not take a downloadAttribute parameter.
3664         * loader/FrameLoader.h: Added an Optional<NewFrameOpenerPolicy> parameter to urlSelected(),
3665         and set a default argument for downloadAttribute instead of having a second version of
3666         urlSelected().
3667
3668 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
3669
3670         [MediaStream] Add "has capture device" bit to media state flags
3671         https://bugs.webkit.org/show_bug.cgi?id=163952
3672
3673         Reviewed by Jer Noble.
3674
3675         No new tests, updated fast/mediastream/MediaStream-page-muted.html, media/muted-video-is-playing-audio.html,
3676         and webaudio/web-audio-is-playing.html.
3677
3678         * Modules/mediastream/MediaStream.cpp:
3679         (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
3680           actually producing data.
3681
3682         * page/MediaProducer.h: Add HasMediaCaptureDevice bit.
3683
3684         * testing/Internals.cpp:
3685         (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
3686         (WebCore::Internals::isPagePlayingAudio): Deleted.
3687         * testing/Internals.h:
3688         * testing/Internals.idl:
3689
3690 2016-10-25  Commit Queue  <commit-queue@webkit.org>
3691
3692         Unreviewed, rolling out r207827 and r207828.
3693         https://bugs.webkit.org/show_bug.cgi?id=163965
3694
3695         Caused LayoutTest webaudio/web-audio-is-playing.html to time
3696         out on macOS. (Requested by ryanhaddad on #webkit).
3697
3698         Reverted changesets:
3699
3700         "[MediaStream] Add "has capture device" bit to media state
3701         flags"
3702         https://bugs.webkit.org/show_bug.cgi?id=163952
3703         http://trac.webkit.org/changeset/207827
3704
3705         "[MediaStream] Add "has capture device" bit to media state
3706         flags"
3707         https://bugs.webkit.org/show_bug.cgi?id=163952
3708         http://trac.webkit.org/changeset/207828
3709
3710 2016-10-25  Antoine Quint  <graouts@apple.com>
3711
3712         [Modern Media Controls] Media Controller: skip back support
3713         https://bugs.webkit.org/show_bug.cgi?id=163725
3714         <rdar://problem/27989480>
3715
3716         Reviewed by Dean Jackson.
3717
3718         We introduce the SkipBackSupport class which brings support for skipping back
3719         30 seconds into the media by clicking on the skip back button in the media controls.
3720
3721         Test: http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html
3722
3723         * Modules/modern-media-controls/js-files:
3724         * Modules/modern-media-controls/media/media-controller.js:
3725         (MediaController):
3726         * Modules/modern-media-controls/media/skip-back-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
3727         (SkipBackSupport.prototype.get control):
3728         (SkipBackSupport.prototype.buttonWasClicked):
3729         (SkipBackSupport):
3730         * WebCore.xcodeproj/project.pbxproj:
3731
3732 2016-10-25  Commit Queue  <commit-queue@webkit.org>
3733
3734         Unreviewed, rolling out r207578.
3735         https://bugs.webkit.org/show_bug.cgi?id=163962
3736
3737         Broke quip.com so that user can no longer type a space
3738         (Requested by rniwa on #webkit).
3739
3740         Reverted changeset:
3741
3742         "Add a plain space instead of &nbsp; between text nodes"
3743         https://bugs.webkit.org/show_bug.cgi?id=123163
3744         http://trac.webkit.org/changeset/207578
3745
3746 2016-10-25  Chris Dumez  <cdumez@apple.com>
3747
3748         LOG_WITH_STREAM() macro should not have a semi colon at the end
3749         https://bugs.webkit.org/show_bug.cgi?id=163951
3750
3751         Reviewed by Simon Fraser.
3752
3753         * platform/LogMacros.h:
3754
3755 2016-10-25  Chris Dumez  <cdumez@apple.com>
3756
3757         IDBObjectStore.createIndex() should take a union in parameter
3758         https://bugs.webkit.org/show_bug.cgi?id=163935
3759
3760         Reviewed by Darin Adler.
3761
3762         IDBObjectStore.createIndex() should take a union in parameter:
3763         - https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore
3764
3765         No new tests, no expected Web-exposed behavior change.
3766
3767         * Modules/indexeddb/IDBDatabase.cpp:
3768         (WebCore::IDBDatabase::createObjectStore):
3769         * Modules/indexeddb/IDBKeyPath.cpp:
3770         (WebCore::isIDBKeyPathValid):
3771         (WebCore::IDBKeyPath::isValid): Deleted.
3772         * Modules/indexeddb/IDBKeyPath.h:
3773         (WebCore::IDBKeyPath::isNull):
3774         * Modules/indexeddb/IDBObjectStore.cpp:
3775         (WebCore::IDBObjectStore::createIndex):
3776         * Modules/indexeddb/IDBObjectStore.h:
3777         * Modules/indexeddb/IDBObjectStore.idl:
3778
3779 2016-10-24  Sam Weinig  <sam@webkit.org>
3780
3781         [WebIDL] Move more types over to the new JSConverter based toJS functions
3782         https://bugs.webkit.org/show_bug.cgi?id=163920
3783
3784         Reviewed by Darin Adler.
3785
3786         - Adds WebIDL-extension type IDLDate, and use it for Date conversions.
3787         - Move JSDOMIterator over to using IDLType based conversions. Make them more
3788           explicit by adding a traits template argument which describes the iterator.
3789         - Add correct parsing for WebIDL iterable, parsing the parameter types into
3790           domTypes.
3791         - Support non-Optional nullable types via trait-like functions on IDLTypes.
3792
3793
3794         * bindings/generic/IDLTypes.h:
3795         (WebCore::IDLType::isNullValue):
3796         (WebCore::IDLType::extractValueFromNullable):
3797         (WebCore::IDLString::isNullValue):
3798         (WebCore::IDLString::extractValueFromNullable):
3799         (WebCore::IDLInterface::isNullValue):
3800         (WebCore::IDLInterface::extractValueFromNullable):
3801         (WebCore::IDLDate::isNullValue):
3802         (WebCore::IDLDate::extractValueFromNullable):
3803         Add isNullValue and extractValueFromNullable functions to allow non-Optional
3804         based nullable types.
3805         
3806         * Modules/plugins/QuickTimePluginReplacement.mm:
3807         (WebCore::QuickTimePluginReplacement::installReplacement):
3808         * bindings/js/IDBBindingUtilities.cpp:
3809         (WebCore::toJS):
3810         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3811         (WebCore::stylePropertyGetter):
3812         * bindings/js/JSCustomElementInterface.cpp:
3813         (WebCore::JSCustomElementInterface::invokeAttributeChangedCallback):
3814         Switch to IDLType based toJS.
3815
3816         * bindings/js/JSDOMBinding.cpp:
3817         (WebCore::jsStringOrNull): Deleted.
3818         (WebCore::jsDateOrNull): Deleted.
3819         * bindings/js/JSDOMBinding.h:
3820         (WebCore::jsPair): Deleted.
3821         (WebCore::toJSNullableString): Deleted.
3822         Remove now unusued toJS functions.
3823
3824         * bindings/js/JSDOMConvert.h:
3825         (WebCore::JSConverter<IDLNullable<T>>::convert):
3826         Use new functions to detect and extract nullable values.
3827
3828         (WebCore::Converter<IDLBufferSource>::convert):
3829         Moved to be with the other converters.
3830
3831         (WebCore::Converter<IDLDate>::convert):
3832         (WebCore::JSConverter<IDLDate>::convert):
3833         Added.
3834
3835         * bindings/js/JSDOMIterator.h:
3836         (WebCore::jsPair):
3837         (WebCore::iteratorCreate):
3838         (WebCore::IteratorTraits>::asJS):
3839         (WebCore::appendForEachArguments):
3840         (WebCore::iteratorForEach):
3841         (WebCore::IteratorTraits>::destroy):
3842         (WebCore::IteratorTraits>::next):
3843         (WebCore::IteratorTraits>::finishCreation):
3844         (WebCore::IteratorInspector::decltype): Deleted.
3845         (WebCore::IteratorInspector::test): Deleted.
3846         (WebCore::JSDOMIterator<JSWrapper>::asJS): Deleted.
3847         (WebCore::JSDOMIterator<JSWrapper>::destroy): Deleted.
3848         (WebCore::JSDOMIterator<JSWrapper>::next): Deleted.
3849         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next): Deleted.
3850         (WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation): Deleted.
3851         Switch to new Traits based model, and have the generated code pass in 
3852         the type (map or set) and key/value types. With the explicit types known,
3853         we can use the new toJS functions.
3854         
3855         Also, moved the jsPair functions here from JSDOMBinding.h, since this was
3856         the only place it was used.
3857
3858         * bindings/scripts/CodeGeneratorJS.pm:
3859         (GenerateImplementationIterableFunctions):
3860         Add iterator trait definition and update for new parameters to JSDOMIterator
3861         and JSDOMIteratorPrototype.
3862
3863         (GetBaseIDLType):
3864         Add IDLDate, and move IDLBufferSource up to the simple path.
3865
3866         (JSValueToNativeIsHandledByDOMConvert):
3867         Allow Date.
3868
3869         (JSValueToNative):
3870         Remove special case for Date.
3871
3872         (NativeToJSValueIsHandledByDOMConvert):
3873         Allow Date and remove restriction of nullable string-like types.
3874
3875         (NativeToJSValueDOMConvertNeedsState):
3876         Add Date to list of types needing state.
3877
3878         (NativeToJSValue):
3879         Remove special cases for Date and nullable-strings.
3880
3881         * bindings/scripts/IDLParser.pm:
3882         (parseOptionalIterableInterface):
3883         Add correct parsing of iterable.
3884
3885         * bindings/scripts/test/JS/JSTestIterable.cpp:
3886         * bindings/scripts/test/JS/JSTestNode.cpp:
3887         * bindings/scripts/test/JS/JSTestObj.cpp:
3888         Update test results.
3889
3890 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
3891
3892         [MediaStream] Add "has capture device" bit to media state flags
3893         https://bugs.webkit.org/show_bug.cgi?id=163952
3894
3895         Reviewed by Jer Noble.
3896
3897         No new tests, updated fast/mediastream/MediaStream-page-muted.html and media/muted-video-is-playing-audio.html.
3898
3899         * Modules/mediastream/MediaStream.cpp:
3900         (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when
3901           actually producing data.
3902
3903         * page/MediaProducer.h: Add HasMediaCaptureDevice bit.
3904
3905         * testing/Internals.cpp:
3906         (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags.
3907         (WebCore::Internals::isPagePlayingAudio): Deleted.
3908         * testing/Internals.h:
3909         * testing/Internals.idl:
3910
3911 2016-10-25  Brady Eidson  <beidson@apple.com>
3912
3913         IndexedDB 2.0: Support new IDBTransaction interfaces.
3914         <rdar://problem/28806928> and https://bugs.webkit.org/show_bug.cgi?id=163927
3915
3916         Reviewed by Sam Weinig.
3917
3918         Tests: storage/indexeddb/modern/idbtransaction-objectstores-1-private.html
3919                storage/indexeddb/modern/idbtransaction-objectstores-1.html
3920                At least partially passing results on 5 previously failed W3C tests.
3921
3922         The "new IDBTransaction interfaces" really just means adding the property IDBTransaction.objectStoreNames.
3923
3924         * Modules/indexeddb/IDBTransaction.cpp:
3925         (WebCore::IDBTransaction::objectStoreNames):
3926         * Modules/indexeddb/IDBTransaction.h:
3927         * Modules/indexeddb/IDBTransaction.idl:
3928
3929 2016-10-25  Youenn Fablet  <youenn@apple.com>
3930
3931         MediaEndpointConfiguration does not need to be refcounted
3932         https://bugs.webkit.org/show_bug.cgi?id=163888
3933
3934         Reviewed by Eric Carlson.
3935
3936         No change of behavior.
3937
3938         Updating MediaEndpoint to take a MediaEndpointConfiguration&& instead of a RefPtr<MediaEndpointConfiguration>&&.
3939         This allows ensuring that the configuration is not null and removes the need to ref-count it.
3940
3941         Removing ref-counting from MediaEndpointConfiguration and its related IceServer that is now a struct.
3942         Updated MediaEndpointOwr and mock implementations accordingly.
3943
3944         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3945         (WebCore::MediaEndpointPeerConnection::setConfiguration):
3946         * platform/mediastream/MediaEndpoint.cpp:
3947         * platform/mediastream/MediaEndpoint.h:
3948         * platform/mediastream/MediaEndpointConfiguration.cpp:
3949         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
3950         * platform/mediastream/MediaEndpointConfiguration.h:
3951         (WebCore::MediaEndpointConfiguration::iceServers):
3952         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
3953         (WebCore::MediaEndpointOwr::setConfiguration):
3954         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
3955         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
3956         * platform/mock/MockMediaEndpoint.cpp:
3957         * platform/mock/MockMediaEndpoint.h:
3958
3959 2016-10-25  Youenn Fablet  <youenn@apple.com>
3960
3961         CachedResourceLoader should set headers of the HTTP request prior checking for the cache
3962         https://bugs.webkit.org/show_bug.cgi?id=163103
3963
3964         Reviewed by Darin Adler.
3965
3966         No expected change of behavior.
3967
3968         Moved referrer, user-agent, and origin headers setting to CachedResourceRequest/CachedResourceLoader before checking the cache.
3969         This allows simplifying vary header checks and is more inline with the fetch specification.
3970
3971         To compute the referrer value, we need to know whether the request is cross-origin.
3972         A helper function isRequestCrossOrigin is added for that purpose and is also used in CachedResource to set its initial response tainting.
3973
3974         We should disable setting user-agent and origin headers by FrameLoader for subresources since this is now done in CachedResourceLoader.
3975         This could be done as a follow-up patch.
3976
3977         * loader/cache/CachedResource.cpp:
3978         (WebCore::CachedResource::CachedResource):
3979         (WebCore::CachedResource::load):
3980         (WebCore::CachedResource::varyHeaderValuesMatch):
3981         (WebCore::addAdditionalRequestHeadersToRequest): Deleted.
3982         (WebCore::CachedResource::addAdditionalRequestHeaders): Deleted.
3983         * loader/cache/CachedResource.h:
3984         * loader/cache/CachedResourceLoader.cpp:
3985         (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
3986         (WebCore::CachedResourceLoader::requestResource):
3987         (WebCore::CachedResourceLoader::determineRevalidationPolicy):