b509ca9f31c318346a3c103d2cd5ca48b7e96d58
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-08-20  Darin Adler  <darin@apple.com>
2
3         Removed Objective-C specific attributes from IDL, made conditionals more consistent
4         https://bugs.webkit.org/show_bug.cgi?id=160900
5
6         Reviewed by Sam Weinig.
7
8         Removed all Objective-C-specific attributes from all the various IDL files where
9         they were used. Except, oops, Sam already did that, and so everything just merged!
10         Now that Objective-C is gone, made all the conditionals be based on LANGUAGE_GOBJECT
11         specifically. Later we should cut these down because many were not actually needed
12         for the GObject bindings, actually only for Objective-C. Also made the style of
13         conditional consistent. Also re-sorted attributes in alphabetical order in many cases
14         and made formatting more consistent without fancy indentation. Also removed old comments
15         that tried to document where various operations and attributes were defined; it's not
16         helpful to track "this was part of DOM level 2" at this point. Also fixed a variety of
17         types to explicitly state the values are nullable in cases where the generated code
18         is currently not affected by that; mostly read-only attribute types.
19
20         * Modules/mediasession/HTMLMediaElementMediaSession.idl:
21         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
22         * animation/AnimationTimeline.idl:
23         * animation/DocumentAnimation.idl:
24         * bindings/scripts/IDLAttributes.txt:
25         * css/CSSMediaRule.idl:
26         * css/CSSPrimitiveValue.idl:
27         * css/CSSRule.idl:
28         * css/CSSStyleDeclaration.idl:
29         * css/CSSStyleSheet.idl:
30         * css/CSSValue.idl:
31         * css/RGBColor.idl:
32         * css/StyleSheet.idl:
33         * dom/CharacterData.idl:
34         * dom/DOMCoreException.idl:
35         * dom/DOMImplementation.idl:
36         * dom/Document.idl:
37         * dom/DocumentType.idl:
38         * dom/Element.idl:
39         * dom/Event.idl:
40         * dom/EventListener.idl:
41         * dom/EventTarget.idl:
42         * dom/KeyboardEvent.idl:
43         * dom/MessageEvent.idl:
44         * dom/MessagePort.idl:
45         * dom/MouseEvent.idl:
46         * dom/MutationEvent.idl:
47         * dom/NamedNodeMap.idl:
48         * dom/Node.idl:
49         * dom/NodeFilter.idl:
50         * dom/NonElementParentNode.idl:
51         * dom/Range.idl:
52         * dom/Slotable.idl:
53         * dom/UIEvent.idl:
54         * dom/WheelEvent.idl:
55         * fileapi/FileException.idl:
56         * html/DOMTokenList.idl:
57         * html/HTMLAnchorElement.idl:
58         * html/HTMLAppletElement.idl:
59         * html/HTMLCollection.idl:
60         * html/HTMLDocument.idl:
61         * html/HTMLElement.idl:
62         * html/HTMLEmbedElement.idl:
63         * html/HTMLFormElement.idl:
64         * html/HTMLInputElement.idl:
65         * html/HTMLMediaElement.idl:
66         * html/HTMLOptionElement.idl:
67         * html/HTMLOptionsCollection.idl:
68         * html/HTMLSelectElement.idl:
69         * html/HTMLTableColElement.idl:
70         * html/HTMLVideoElement.idl:
71         * html/ImageData.idl:
72         * html/URLUtils.idl:
73         * html/track/TextTrack.idl:
74         * page/AbstractView.idl:
75         * page/DOMSelection.idl:
76         * page/DOMWindow.idl:
77         * page/Location.idl:
78         * svg/SVGDocument.idl:
79         * svg/SVGElement.idl:
80         * svg/SVGException.idl:
81         * svg/SVGExternalResourcesRequired.idl:
82         * svg/SVGFilterPrimitiveStandardAttributes.idl:
83         * svg/SVGFitToViewBox.idl:
84         * svg/SVGPathSeg.idl:
85         * svg/SVGTests.idl:
86         * svg/SVGURIReference.idl:
87         * svg/SVGZoomAndPan.idl:
88         * workers/DedicatedWorkerGlobalScope.idl:
89         * workers/Worker.idl:
90         * workers/WorkerGlobalScope.idl:
91         * xml/XPathException.idl:
92         * xml/XPathExpression.idl:
93         * xml/XPathNSResolver.idl:
94         See above for summary of changes.
95
96 2016-08-20  Sam Weinig  <sam@webkit.org>
97
98         Remove Objective-C specific extended attributes from the bindings
99         https://bugs.webkit.org/show_bug.cgi?id=161034
100
101         Reviewed by Dan Bernstein.
102
103         - Removes ObjCPolymorphic, ObjCProtocol, ObjCLegacyUnnamedParameters and ObjCExplicitAtomicString
104           extended attributes.
105
106         * animation/AnimationTimeline.idl:
107         * css/CSSMediaRule.idl:
108         * css/CSSPrimitiveValue.idl:
109         * css/CSSRule.idl:
110         * css/CSSStyleDeclaration.idl:
111         * css/CSSStyleSheet.idl:
112         * css/CSSValue.idl:
113         * css/StyleSheet.idl:
114         * dom/CharacterData.idl:
115         * dom/DOMImplementation.idl:
116         * dom/Document.idl:
117         * dom/Element.idl:
118         * dom/Event.idl:
119         * dom/EventListener.idl:
120         * dom/EventTarget.idl:
121         * dom/MouseEvent.idl:
122         * dom/MutationEvent.idl:
123         * dom/NamedNodeMap.idl:
124         * dom/Node.idl:
125         * dom/NodeFilter.idl:
126         * dom/NonElementParentNode.idl:
127         * dom/Range.idl:
128         * dom/UIEvent.idl:
129         * html/HTMLCollection.idl:
130         * html/HTMLSelectElement.idl:
131         * svg/SVGExternalResourcesRequired.idl:
132         * svg/SVGFilterPrimitiveStandardAttributes.idl:
133         * svg/SVGFitToViewBox.idl:
134         * svg/SVGPathSeg.idl:
135         * svg/SVGTests.idl:
136         * svg/SVGURIReference.idl:
137         * svg/SVGZoomAndPan.idl:
138         * xml/XPathExpression.idl:
139         * xml/XPathNSResolver.idl:
140
141 2016-08-20  Sam Weinig  <sam@webkit.org>
142
143         Roll out r204683.
144
145 2016-08-20  Sam Weinig  <sam@webkit.org>
146
147         Remove Objective-C specific extended attributes / features from the bindings
148         https://bugs.webkit.org/show_bug.cgi?id=161034
149
150         Reviewed by Dan Bernstein.
151
152         - Removes ObjCPolymorphic, ObjCProtocol, ObjCLegacyUnnamedParameters and ObjCExplicitAtomicString
153           extended attributes.
154         - Remove support for multiple inheritance from the IDLParser.
155
156         * bindings/scripts/CodeGenerator.pm:
157         * bindings/scripts/IDLParser.pm:
158         * animation/AnimationTimeline.idl:
159         * css/CSSMediaRule.idl:
160         * css/CSSPrimitiveValue.idl:
161         * css/CSSRule.idl:
162         * css/CSSStyleDeclaration.idl:
163         * css/CSSStyleSheet.idl:
164         * css/CSSValue.idl:
165         * css/StyleSheet.idl:
166         * dom/CharacterData.idl:
167         * dom/DOMImplementation.idl:
168         * dom/Document.idl:
169         * dom/Element.idl:
170         * dom/Event.idl:
171         * dom/EventListener.idl:
172         * dom/EventTarget.idl:
173         * dom/MouseEvent.idl:
174         * dom/MutationEvent.idl:
175         * dom/NamedNodeMap.idl:
176         * dom/Node.idl:
177         * dom/NodeFilter.idl:
178         * dom/NonElementParentNode.idl:
179         * dom/Range.idl:
180         * dom/UIEvent.idl:
181         * html/HTMLCollection.idl:
182         * html/HTMLSelectElement.idl:
183         * svg/SVGExternalResourcesRequired.idl:
184         * svg/SVGFilterPrimitiveStandardAttributes.idl:
185         * svg/SVGFitToViewBox.idl:
186         * svg/SVGPathSeg.idl:
187         * svg/SVGTests.idl:
188         * svg/SVGURIReference.idl:
189         * svg/SVGZoomAndPan.idl:
190         * xml/XPathExpression.idl:
191         * xml/XPathNSResolver.idl:
192
193 2016-08-20  Sam Weinig  <sam@webkit.org>
194
195         Stop pretending that AbstractView is a thing, it's not
196         https://bugs.webkit.org/show_bug.cgi?id=161032
197
198         Reviewed by Dan Bernstein.
199
200         Remove AbstractView.idl, the AbstractView typedef of DOMWindow, and
201         all special casing of the name AbstractView in the JS code generator.
202
203         No change in behavior.
204
205         * DerivedSources.make:
206         * Modules/indieui/UIRequestEvent.cpp:
207         (WebCore::UIRequestEvent::createForBindings):
208         (WebCore::UIRequestEvent::create):
209         (WebCore::UIRequestEvent::UIRequestEvent):
210         * Modules/indieui/UIRequestEvent.h:
211         (WebCore::UIRequestEvent::receiver):
212         * WebCore.xcodeproj/project.pbxproj:
213         * bindings/scripts/CodeGeneratorGObject.pm:
214         * bindings/scripts/CodeGeneratorJS.pm:
215         (ShouldGenerateToJSDeclaration):
216         (GetImplClassName):
217         * dom/CompositionEvent.cpp:
218         (WebCore::CompositionEvent::CompositionEvent):
219         (WebCore::CompositionEvent::~CompositionEvent):
220         (WebCore::CompositionEvent::initCompositionEvent):
221         * dom/CompositionEvent.h:
222         * dom/FocusEvent.cpp:
223         (WebCore::FocusEvent::isFocusEvent):
224         (WebCore::FocusEvent::FocusEvent):
225         * dom/FocusEvent.h:
226         * dom/KeyboardEvent.cpp:
227         (WebCore::KeyboardEvent::KeyboardEvent):
228         (WebCore::KeyboardEvent::~KeyboardEvent):
229         (WebCore::KeyboardEvent::initKeyboardEvent):
230         * dom/KeyboardEvent.h:
231         * dom/MouseEvent.cpp:
232         (WebCore::MouseEvent::createForBindings):
233         (WebCore::MouseEvent::create):
234         (WebCore::MouseEvent::MouseEvent):
235         (WebCore::MouseEvent::~MouseEvent):
236         (WebCore::MouseEvent::initMouseEvent):
237         * dom/MouseEvent.h:
238         * dom/MouseRelatedEvent.cpp:
239         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
240         (WebCore::contentsScrollOffset):
241         * dom/MouseRelatedEvent.h:
242         * dom/SimulatedClick.cpp:
243         * dom/TextEvent.cpp:
244         (WebCore::TextEvent::createForBindings):
245         (WebCore::TextEvent::create):
246         (WebCore::TextEvent::createForPlainTextPaste):
247         (WebCore::TextEvent::createForFragmentPaste):
248         (WebCore::TextEvent::createForDrop):
249         (WebCore::TextEvent::createForDictation):
250         (WebCore::TextEvent::TextEvent):
251         (WebCore::TextEvent::~TextEvent):
252         (WebCore::TextEvent::initTextEvent):
253         * dom/TextEvent.h:
254         * dom/TouchEvent.h:
255         * dom/UIEvent.cpp:
256         (WebCore::UIEvent::UIEvent):
257         (WebCore::UIEvent::~UIEvent):
258         (WebCore::UIEvent::initUIEvent):
259         * dom/UIEvent.h:
260         (WebCore::UIEvent::create):
261         (WebCore::UIEvent::createForBindings):
262         (WebCore::UIEvent::view):
263         (WebCore::UIEvent::detail):
264         * dom/UIEventWithKeyState.h:
265         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
266         * dom/WheelEvent.cpp:
267         (WebCore::WheelEvent::WheelEvent):
268         (WebCore::WheelEvent::initWheelEvent):
269         (WebCore::WheelEvent::initWebKitWheelEvent):
270         * dom/WheelEvent.h:
271         * page/AbstractView.idl: Removed.
272
273 2016-08-19  Sam Weinig  <sam@webkit.org>
274
275         Location.ancestorOrigins should return a FrozenArray<USVString>
276         https://bugs.webkit.org/show_bug.cgi?id=161018
277
278         Reviewed by Ryosuke Niwa and Chris Dumez.
279
280         Updated tests: fast/dom/Window/Location/ancestor-origins.html
281                        fast/dom/indexed-getters-returning-string.html
282
283         * Modules/indexeddb/IDBDatabase.cpp:
284         (WebCore::IDBDatabase::createObjectStore):
285         (WebCore::IDBDatabase::transaction):
286         (WebCore::IDBDatabase::deleteObjectStore):
287         * Modules/indexeddb/IDBDatabase.h:
288         Remove unused ScriptExecutionContext parameter.
289
290         * Modules/indexeddb/IDBDatabase.idl:
291         There is no need for a custom implementation anymore.
292
293         * CMakeLists.txt:
294         * WebCore.xcodeproj/project.pbxproj:
295         Remove JSDOMStringListCustom.cpp, which is no longer needed.
296
297         * bindings/js/JSDOMBinding.cpp:
298         (WebCore::jsArray): Deleted.
299         Remove overload of jsArray that took a DOMStringList.
300
301         * bindings/js/JSDOMBinding.h:
302         (WebCore::jsFrozenArray):
303         Add jsFrozenArray which returns an JSArray which has had the moral 
304         equivalent of Object.freeze() called on it. This follows 
305         http://heycam.github.io/webidl/#es-frozen-array.
306
307         * bindings/js/JSDOMStringListCustom.cpp:
308         Removed.
309
310         * bindings/js/JSIDBDatabaseCustom.cpp:
311         (WebCore::JSIDBDatabase::transaction): Deleted.
312         Remove no longer necessary custom implementation of transaction.
313
314         * bindings/scripts/CodeGenerator.pm:
315         (IsRefPtrType):
316         (IsSVGAnimatedType):
317         (IsSequenceType):
318         (GetSequenceType):
319         (IsFrozenArrayType):
320         (GetFrozenArrayInnerType):
321         * bindings/scripts/CodeGeneratorJS.pm:
322         (AreTypesDistinguishableForOverloadResolution):
323         (GenerateOverloadedFunctionOrConstructor):
324         (GetNativeType):
325         (GetNativeVectorInnerType):
326         (GetNativeTypeForCallbacks):
327         (JSValueToNative):
328         (NativeToJSValue):
329         * bindings/scripts/IDLParser.pm:
330         (parseNonAnyType):
331         Add support for FrozenArray, closely matching the sequence code.
332
333         * bindings/scripts/test/JS/JSTestCallback.cpp:
334         * bindings/scripts/test/JS/JSTestCallback.h:
335         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
336         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
337         * bindings/scripts/test/JS/JSTestObj.cpp:
338         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
339         Updated bindings test results.
340
341         * dom/DOMStringList.idl:
342         Remove JSCustomToNativeObject, which is no longer needed.
343
344         * inspector/InspectorIndexedDBAgent.cpp:
345         Update calls to IDBDatabase::transaction.
346
347         * page/Location.cpp:
348         (WebCore::Location::ancestorOrigins):
349         * page/Location.h:
350         Change ancestorOrigins to return a Vector<String> rather than
351         a DOMStringList.
352
353         * page/Location.idl:
354         Change ancestorOrigins to return a FrozenArray<USVString>, matching
355         the HTML5 spec.
356
357 2016-08-19  Chris Dumez  <cdumez@apple.com>
358
359         Mark CanvasPath operations' parameters as mandatory when they should be
360         https://bugs.webkit.org/show_bug.cgi?id=161014
361
362         Reviewed by Sam Weinig.
363
364         Mark CanvasPath operations as mandatory when they should be:
365         - https://html.spec.whatwg.org/multipage/scripting.html#canvaspath
366
367         This patch moves the CanvasPath methods from CanvasRenderingContext2D
368         and Path2D to a new CanvasPath interface, to avoid duplication and
369         match the specification.
370
371         The parameters were correctly marked as mandatory in WebKit on
372         CanvasRenderingContext2D but not on Path2D.
373
374         Those parameters are correctly marked as mandatory in Chrome and Firefox.
375
376         No new tests, rebaselined existing test.
377
378         * CMakeLists.txt:
379         * DerivedSources.make:
380         * WebCore.xcodeproj/project.pbxproj:
381         * html/canvas/CanvasPath.cpp: Renamed from Source/WebCore/html/canvas/CanvasPathMethods.cpp.
382         (WebCore::CanvasPath::closePath):
383         (WebCore::CanvasPath::moveTo):
384         (WebCore::CanvasPath::lineTo):
385         (WebCore::CanvasPath::quadraticCurveTo):
386         (WebCore::CanvasPath::bezierCurveTo):
387         (WebCore::CanvasPath::arcTo):
388         (WebCore::normalizeAngles):
389         (WebCore::CanvasPath::arc):
390         (WebCore::CanvasPath::ellipse):
391         (WebCore::CanvasPath::rect):
392         * html/canvas/CanvasPath.h: Renamed from Source/WebCore/html/canvas/CanvasPathMethods.h.
393         (WebCore::CanvasPath::~CanvasPath):
394         (WebCore::CanvasPath::CanvasPath):
395         (WebCore::CanvasPath::hasInvertibleTransform):
396         * html/canvas/CanvasPath.idl: Added.
397         * html/canvas/CanvasRenderingContext2D.h:
398         * html/canvas/CanvasRenderingContext2D.idl:
399         * html/canvas/DOMPath.h:
400         * html/canvas/DOMPath.idl:
401
402 2016-08-19  Zalan Bujtas  <zalan@apple.com>
403
404         RenderObject::containingBlock() cleanup.
405         https://bugs.webkit.org/show_bug.cgi?id=161013
406
407         Reviewed by Simon Fraser.
408
409         Move ::containingBlockForAbsolutePosition and ::containingBlockForFixedPosition
410         to RenderElement after tightening containingBlock() callsites.
411
412         No change in functionality.
413
414         * dom/Element.cpp:
415         (WebCore::layoutOverflowRectContainsAllDescendants):
416         * rendering/RenderElement.cpp:
417         (WebCore::RenderElement::containingBlockForFixedPosition):
418         (WebCore::RenderElement::containingBlockForAbsolutePosition):
419         * rendering/RenderElement.h:
420         * rendering/RenderInline.cpp:
421         (WebCore::RenderInline::styleWillChange):
422         * rendering/RenderObject.cpp:
423         (WebCore::RenderObject::containingBlock):
424         (WebCore::RenderObject::containingBlockForFixedPosition): Deleted.
425         (WebCore::RenderObject::containingBlockForAbsolutePosition): Deleted.
426         * rendering/RenderObject.h:
427
428 2016-08-19  Dean Jackson  <dino@apple.com>
429
430         Implement preferLowPowerToHighPerformance for WebGL
431         https://bugs.webkit.org/show_bug.cgi?id=161017
432         <rdar://problem/26819135>
433
434         Reviewed by Myles Maxfield.
435
436         Implement preferLowPowerToHighPerformance on macOS by
437         passing the correct CGL attribute when creating the
438         pixel format.
439
440         * bindings/js/JSHTMLCanvasElementCustom.cpp:
441         (WebCore::get3DContextAttributes):
442         * platform/graphics/mac/GraphicsContext3DMac.mm:
443         (WebCore::setPixelFormat):
444         (WebCore::GraphicsContext3D::GraphicsContext3D):
445
446 2016-08-19  Joseph Pecoraro  <pecoraro@apple.com>
447
448         Remove empty files and empty namespace blocks
449         https://bugs.webkit.org/show_bug.cgi?id=160990
450
451         Reviewed by Alex Christensen.
452
453         * CMakeLists.txt:
454         * WebCore.xcodeproj/project.pbxproj:
455         * dom/DOMAllInOne.cpp:
456         * dom/MessagePortChannel.cpp: Removed.
457         * page/DatabaseProvider.h:
458         * platform/mock/mediasource/MockTracks.cpp: Removed.
459
460 2016-08-19  Myles C. Maxfield  <mmaxfield@apple.com>
461
462         Addressing post-review comments after r204592
463         https://bugs.webkit.org/show_bug.cgi?id=160895
464
465         Unreviewed.
466
467         No new tests because there is no behavior change.
468
469         * page/cocoa/ResourceUsageOverlayCocoa.mm:
470         (WebCore::showText):
471         * platform/graphics/ca/PlatformCALayer.cpp:
472         (WebCore::PlatformCALayer::drawTextAtPoint):
473         * platform/ios/LegacyTileCache.mm:
474         (WebCore::LegacyTileCache::drawLayer):
475
476 2016-08-19  Ryan Haddad  <ryanhaddad@apple.com>
477
478         Attempt to fix the Windows build after r204652.
479
480         Unreviewed build fix.
481
482         * dom/DOMAllInOne.cpp:
483
484 2016-08-19  Myles C. Maxfield  <mmaxfield@apple.com>
485
486         Migrate from ints to unsigneds in a few more places in rendering code
487         https://bugs.webkit.org/show_bug.cgi?id=161006
488
489         Reviewed by Alex Christensen.
490
491         No new tests because there is no behavior change.
492
493         * platform/graphics/GraphicsContext.cpp:
494         (WebCore::GraphicsContext::drawBidiText):
495         * platform/mock/MockRealtimeVideoSource.cpp:
496         (WebCore::MockRealtimeVideoSource::drawText):
497         * platform/text/BidiResolver.h:
498         (WebCore::BidiCharacterRun::BidiCharacterRun):
499         (WebCore::BidiCharacterRun::start):
500         (WebCore::BidiCharacterRun::stop):
501         * rendering/BidiRun.cpp:
502         (WebCore::BidiRun::BidiRun):
503         * rendering/BidiRun.h:
504         * rendering/RenderBlockLineLayout.cpp:
505         (WebCore::setLogicalWidthForTextRun):
506         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
507         (WebCore::findFirstTrailingSpace):
508         (WebCore::RenderBlockFlow::handleTrailingSpaces):
509         * rendering/line/BreakingContext.h:
510
511 2016-08-19  Myles C. Maxfield  <mmaxfield@apple.com>
512
513         Migrate RenderText::stringView() to unsigneds
514         https://bugs.webkit.org/show_bug.cgi?id=161005
515
516         Reviewed by Alex Christensen.
517
518         No new tests because there is no behavior change.
519
520         * rendering/RenderBlockLineLayout.cpp:
521         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
522         * rendering/RenderText.cpp:
523         (WebCore::RenderText::stringView):
524         * rendering/RenderText.h:
525
526 2016-08-18  Ryosuke Niwa  <rniwa@webkit.org>
527
528         Rename LifecycleCallback to CustomElementReaction
529         https://bugs.webkit.org/show_bug.cgi?id=160991
530
531         Reviewed by Chris Dumez.
532
533         Renamed LifecycleCallbackQueue and CustomElementLifecycleProcessingStack
534         to CustomElementReactionQueue and CustomElementReactionStack per the latest spec:
535         https://html.spec.whatwg.org/#custom-element-reactions
536
537         No new tests since this is just a rename of classes which are not exposed to the Web.
538
539         * CMakeLists.txt:
540         * WebCore.xcodeproj/project.pbxproj:
541
542         * bindings/js/JSCustomElementsRegistryCustom.cpp:
543         (WebCore::getCallback): Renamed from getLifecycleCallback.
544         (WebCore::JSCustomElementsRegistry::define):
545         (WebCore::getLifecycleCallback): Deleted.
546
547         * bindings/js/JSMainThreadExecState.h:
548         (WebCore::JSMainThreadNullState):
549
550         * bindings/scripts/CodeGeneratorJS.pm:
551         (GenerateImplementation):
552
553         * bindings/scripts/test/JS/JSTestObj.cpp: Rebaselined.
554         * bindings/scripts/test/TestObj.idl:
555
556         * dom/CustomElementReactionQueue.cpp: Moved from Source/WebCore/dom/LifecycleCallbackQueue.cpp.
557         (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
558         (WebCore::CustomElementReactionQueue::CustomElementReactionQueue):
559         (WebCore::CustomElementReactionQueue::~CustomElementReactionQueue):
560         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
561         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
562         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
563         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
564         (WebCore::CustomElementReactionQueue::invokeAll):
565         (WebCore::CustomElementReactionStack::ensureCurrentQueue):
566         (WebCore::CustomElementReactionStack::processQueue):
567
568         * dom/CustomElementReactionQueue.h: Moved from Source/WebCore/dom/LifecycleCallbackQueue.h.
569         (WebCore::CustomElementReactionStack::CustomElementReactionStack):
570         (WebCore::CustomElementReactionStack::~CustomElementReactionStack):
571         (WebCore::CustomElementReactionStack::hasCurrentProcessingStack):
572
573         * dom/Document.cpp:
574         (WebCore::createFallbackHTMLElement):
575
576         * dom/Element.cpp:
577         (WebCore::Element::attributeChanged):
578         (WebCore::Element::insertedInto):
579         (WebCore::Element::removedFrom):
580
581 2016-08-19  Chris Dumez  <cdumez@apple.com>
582
583         Attr.prefix / Element.prefix attribute should be readonly
584         https://bugs.webkit.org/show_bug.cgi?id=160998
585
586         Reviewed by Daniel Bates.
587
588         Attr.prefix / Element.prefix attribute should be readonly:
589         - https://dom.spec.whatwg.org/#element
590         - https://dom.spec.whatwg.org/#attr
591
592         Firefox and Chrome agree with the specification.
593
594         No new tests, rebaselined existing test.
595
596         * dom/Attr.idl:
597         * dom/Element.idl:
598
599 2016-08-19  Chris Dumez  <cdumez@apple.com>
600
601         <command> should be an HTMLUnknownElement and <basefont> should be an HTMLElement
602         https://bugs.webkit.org/show_bug.cgi?id=161004
603
604         Reviewed by Daniel Bates.
605
606         <command> should be an HTMLUnknownElement and <basefont> should be an HTMLElement as per:
607         - https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom:element-interface
608
609         <basefont> is already an HTMLElement in Firefox and Chrome. <command> is an
610         HTMLUnknownElement in Firefox but an HTMLElement in Chrome.
611
612         No new tests, rebaselined existing test.
613
614         * html/HTMLTagNames.in:
615
616 2016-08-19  Nan Wang  <n_wang@apple.com>
617
618         AX: iOS, Wrong axLabel on static text if heading has multiple children
619         https://bugs.webkit.org/show_bug.cgi?id=160981
620
621         Reviewed by Chris Fleizach.
622
623         Headings are using textUnderElement to compute the accessibilityLabel on iOS, so normally it's
624         the concatenation of all the children's accessibilityLabel. Therefore, we shouldn't use accessibilityLabel
625         to check for user defined text on headings. Instead, baseAccessibilityDescription will return the 
626         alternate text we want.
627
628         Changes are covered in the modified test.
629
630         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
631         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
632
633 2016-08-19  Johan K. Jensen  <johan_jensen@apple.com>
634
635         Resource Timing: Make PerformanceEntryList a sequence as per spec
636         https://bugs.webkit.org/show_bug.cgi?id=160963
637
638         Reviewed by Alex Christensen.
639
640         Change PerformanceEntryList to be a sequence of PerformanceEntry instead of an object.
641
642         Test: http/tests/performance/performance-resource-timing-entries-iterable.html
643
644         * CMakeLists.txt:
645         * DerivedSources.cpp:
646         * DerivedSources.make:
647         * PlatformGTK.cmake:
648         * WebCore.xcodeproj/project.pbxproj:
649         * bindings/scripts/CodeGeneratorGObject.pm:
650         Remove references to {JS,}PerformanceEntryList.{cpp,h,idl}.
651
652         * page/Performance.cpp:
653         (WebCore::Performance::getEntries):
654         (WebCore::Performance::getEntriesByType):
655         (WebCore::Performance::getEntriesByName):
656         * page/Performance.h:
657         Methods now operate on a Vector of PerformanceEntry.
658
659         * page/Performance.idl:
660         Typedef PerformanceEntryList as a sequence of PerformanceEntry.
661
662         * page/PerformanceEntryList.cpp: Removed.
663         (WebCore::PerformanceEntryList::PerformanceEntryList): Deleted.
664         (WebCore::PerformanceEntryList::~PerformanceEntryList): Deleted.
665         (WebCore::PerformanceEntryList::length): Deleted.
666         (WebCore::PerformanceEntryList::item): Deleted.
667         (WebCore::PerformanceEntryList::append): Deleted.
668         (WebCore::PerformanceEntryList::appendAll): Deleted.
669         (WebCore::PerformanceEntryList::sort): Deleted.
670         * page/PerformanceEntryList.h: Removed.
671         (WebCore::PerformanceEntryList::create): Deleted.
672         * page/PerformanceEntryList.idl: Removed.
673
674 2016-08-19  Eric Carlson  <eric.carlson@apple.com>
675
676         [Mac] fix PiP context menu typos
677         https://bugs.webkit.org/show_bug.cgi?id=160999
678         <rdar://problem/27885070>
679
680         Reviewed by Jer Noble.
681
682         * English.lproj/Localizable.strings: "Picture-in-Picture" -> "Picture in Picture".
683
684         * platform/LocalizedStrings.cpp:
685         (WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen): Ditto.
686         (WebCore::contextMenuItemTagExitVideoEnhancedFullscreen): Ditto.
687
688 2016-08-16  Simon Fraser  <simon.fraser@apple.com>
689
690         Rename didLayout(LayoutMilestones) to didReachLayoutMilestone(), and related WK2 functions
691         https://bugs.webkit.org/show_bug.cgi?id=160923
692
693         Reviewed by Tim Horton.
694
695         didLayout(LayoutMilestones) -> didReachLayoutMilestone(LayoutMilestones)
696         dispatchDidLayout(LayoutMilestones) -> dispatchDidReachLayoutMilestone(LayoutMilestones)
697
698         * dom/Document.cpp:
699         (WebCore::Document::setVisualUpdatesAllowed):
700         * loader/EmptyClients.h:
701         * loader/FrameLoader.cpp:
702         (WebCore::FrameLoader::didReachLayoutMilestone):
703         (WebCore::FrameLoader::didLayout): Deleted.
704         * loader/FrameLoader.h:
705         * loader/FrameLoaderClient.h:
706         * page/FrameView.cpp:
707         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
708         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
709         * page/LayoutMilestones.h: Formatting
710         * page/Page.cpp:
711         (WebCore::Page::addRelevantRepaintedObject):
712
713 2016-08-19  Chris Dumez  <cdumez@apple.com>
714
715         DumpRenderTree crashed in com.apple.WebCore: WebCore::DOMWindow::resetDOMWindowProperties + 607
716         https://bugs.webkit.org/show_bug.cgi?id=160983
717         <rdar://problem/26768524>
718
719         Reviewed by Brent Fulgham.
720
721         Update DOMWindow::frameDestroyed() to ref the window object as the crash
722         traces seem to indicate it can get destroyed during the execution of this
723         method. Also update the code in the ~Frame destructor to not iterate over
724         the list of FrameDestructionObservers because observers remove themselves
725         from the list when they get destroyed.
726
727         No new tests, do not know how to reproduce.
728
729         * page/DOMWindow.cpp:
730         (WebCore::DOMWindow::frameDestroyed):
731         * page/Frame.cpp:
732         (WebCore::Frame::~Frame):
733
734 2016-08-19  Chris Dumez  <cdumez@apple.com>
735
736         WebKit should unset event propagation flags after dispatch
737         https://bugs.webkit.org/show_bug.cgi?id=160853
738
739         Reviewed by Ryosuke Niwa.
740
741         WebKit should unset event propagation flags after dispatch to reflect
742         the latest DOM specification:
743         - https://github.com/whatwg/dom/commit/806d4aab584f6fc38c21f8e088b51b8ba3e27e20
744
745         No new tests, rebaselined existing tests.
746
747         * dom/Event.h:
748         (WebCore::Event::resetPropagationFlags):
749         * dom/EventDispatcher.cpp:
750         (WebCore::EventDispatcher::dispatchEvent):
751         * dom/EventTarget.cpp:
752         (WebCore::EventTarget::dispatchEvent):
753
754 2016-08-18  Daniel Bates  <dabates@apple.com>
755
756         Ld warns of non-existent PrivateFrameworks directory when building WebKit with the public iOS 9.3 SDK
757         https://bugs.webkit.org/show_bug.cgi?id=160979
758
759         Rubber-stamped by Simon Fraser.
760
761         Only add the SDK PrivateFrameworks directory to the FRAMEWORK_SEARCH_PATH when building for
762         iOS Simulator, building with an iOS SDK that does not support text-based stubs, or building
763         an Apple-internal build.
764
765         * Configurations/Base.xcconfig: Define WK_TARGET_IOS_VERSION_MAJOR.
766         * Configurations/WebCore.xcconfig:
767
768 2016-08-18  Sam Weinig  <sam@webkit.org>
769
770         Re-landing:
771
772         Support WebIDL unions (Part 1)
773         https://bugs.webkit.org/show_bug.cgi?id=160769
774
775         Reviewed by Chris Dumez.
776
777         This is the first part of an effort to add support for union types
778         in our code generators. This change:
779         - Adds a domType struct to hold the parsed type information. For now, we only
780           use it temporarily while parsing, and don't expose it to the code generators,
781           but that will change in a later patch.
782         - Remove support for scoped identifiers for types. They are not supported by WebIDL.
783         - Make debugging the parser easier by providing backtraces when asserting.
784
785         There should be no observable changes.
786
787         * bindings/scripts/IDLParser.pm:
788
789 2016-08-18  Chris Dumez  <cdumez@apple.com>
790
791         Move prefix / namespaceURI / localName attributes from Node to Attr / Element
792         https://bugs.webkit.org/show_bug.cgi?id=160988
793
794         Reviewed by Ryosuke Niwa.
795
796         Move prefix / namespaceURI / localName attributes from Node to Attr / Element
797         as per the latest DOM specification:
798         - https://dom.spec.whatwg.org/#element
799         - https://dom.spec.whatwg.org/#attr
800
801         Firefox and Chrome match the specification.
802
803         No new tests, rebaselined existing tests.
804
805         * dom/Attr.h:
806         * dom/Attr.idl:
807         * dom/Element.h:
808         * dom/Element.idl:
809         * dom/Node.idl:
810
811 2016-08-18  Jonathan Bedard  <jbedard@apple.com>
812
813         Binding NULL pointer to reference in WebCore::RenderObject
814         https://bugs.webkit.org/show_bug.cgi?id=160830
815
816         Reviewed by Myles C. Maxfield.
817
818         No new tests needed, existing functionality not changed.
819
820         Fixes a dereferenced NULL pointer bound to a reference through a minor re-factor.
821
822         * rendering/InlineIterator.h:
823         (WebCore::InlineIterator::clear): Explicit clear occurs, instead of a call to moveTo.
824         (WebCore::InlineIterator::moveToStartOf): Swapped pointer for reference.
825         (WebCore::InlineIterator::moveTo): Swapped pointer for reference.
826         (WebCore::InlineIterator::increment): Explicitly call clear for clarity.
827         * rendering/line/BreakingContext.h:
828         (WebCore::BreakingContext::commitLineBreakClear): Commit a line break and clear the iterator.
829         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth): Swapped pointer for reference.
830         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Swapped pointer for reference.
831         (WebCore::BreakingContext::increment): Explicitly call clear for clarity.
832         (WebCore::BreakingContext::handleBR): Swapped pointer for passed reference.
833         (WebCore::BreakingContext::handleReplaced): Explicitly call clear for clarity.
834         (WebCore::tryHyphenating): Swapped pointer for passed reference.
835         (WebCore::BreakingContext::handleText): Replaced all render object passing with references.  Note that the caller explicitly checks if m_current.renderer() exists before calling this function.
836         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded): Explicitly call clear for clarity.
837         (WebCore::BreakingContext::handleEndOfLine): Explicitly call clear for clarity.
838
839 2016-08-18  Ryosuke Niwa  <rniwa@webkit.org>
840
841         Windows build fix after r204611. Use the fully qualified name to avoid the ambiguity in VC++.
842
843         * bindings/js/JSCustomElementInterface.cpp:
844         (WebCore::JSCustomElementInterface::invokeCallback):
845         * bindings/js/JSCustomElementInterface.h:
846         (WebCore::JSCustomElementInterface::invokeCallback):
847
848 2016-08-18  Dean Jackson  <dino@apple.com>
849
850         Support passing preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat
851         https://bugs.webkit.org/show_bug.cgi?id=160982
852         <rdar://problem/27915946>
853
854         Reviewed by Simon Fraser.
855
856         Update WebGLContextAttributes to be compliant with the specification,
857         by adding preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat.
858         They are not implemented yet, so asking the created context what
859         values it used should give the default.
860
861         Test: fast/canvas/webgl/context-creation-attributes.html
862
863         * html/canvas/WebGLContextAttributes.cpp:
864         (WebCore::WebGLContextAttributes::preferLowPowerToHighPerformance):
865         (WebCore::WebGLContextAttributes::setPreferLowPowerToHighPerformance):
866         (WebCore::WebGLContextAttributes::failIfMajorPerformanceCaveat):
867         (WebCore::WebGLContextAttributes::setFailIfMajorPerformanceCaveat):
868         * html/canvas/WebGLContextAttributes.h:
869         * html/canvas/WebGLContextAttributes.idl:
870         * html/canvas/WebGLRenderingContextBase.cpp:
871         (WebCore::WebGLRenderingContextBase::create): Deleted.
872         * platform/graphics/GraphicsContext3D.h:
873         (WebCore::GraphicsContext3D::Attributes::Attributes): Deleted.
874
875 2016-08-18  Anders Carlsson  <andersca@apple.com>
876
877         Move an NPAPI-only function from WebCore to WebKit
878         https://bugs.webkit.org/show_bug.cgi?id=160967
879
880         Reviewed by Sam Weinig.
881
882         * WebCore.xcodeproj/project.pbxproj:
883         * bindings/js/ScriptController.cpp:
884         (WebCore::ScriptController::createScriptObjectForPluginElement): Deleted.
885         * bindings/js/ScriptController.h:
886         * bridge/NP_jsobject.h:
887
888 2016-08-18  Ryosuke Niwa  <rniwa@webkit.org>
889
890         Binding test fix after r204611.
891
892         * bindings/scripts/test/TestObj.idl:
893
894 2016-08-18  Chris Dumez  <cdumez@apple.com>
895
896         Unreviewed, nit fix after r204605 reported by Darin.
897
898         * platform/text/TextCodecICU.cpp:
899
900 2016-08-17  Ryosuke Niwa  <rniwa@webkit.org>
901
902         Add basic support for connected and disconnected callbacks
903         https://bugs.webkit.org/show_bug.cgi?id=160950
904
905         Reviewed by Chris Dumez.
906
907         Added the basic support for custom elements' connectedCallback and disconnectedCallback. These callbacks
908         are enqueued by inserting and removing a node as spec'ed by https://dom.spec.whatwg.org/#concept-node-insert
909         and https://dom.spec.whatwg.org/#concept-node-remove
910
911         For now, we only support callbacks on appendChild and removeChild to limit the amount of code changes and
912         tests that need to be included in this patch.
913
914         This patch also renames InvokesCustomElementLifecycleCallbacks IDL attribute to CEReactions to match
915         the latest specification: https://html.spec.whatwg.org/multipage/scripting.html#cereactions
916
917         Tests: fast/custom-elements/connected-callbacks.html
918                fast/custom-elements/disconnected-callbacks.html
919
920         * bindings/js/JSCustomElementInterface.cpp:
921         (WebCore::JSCustomElementInterface::invokeCallback): Extracted from invokeAttributeChangedCallback.
922         (WebCore::JSCustomElementInterface::setConnectedCallback): Added.
923         (WebCore::JSCustomElementInterface::invokeConnectedCallback): Added.
924         (WebCore::JSCustomElementInterface::setDisconnectedCallback): Added.
925         (WebCore::JSCustomElementInterface::invokeDisconnectedCallback): Added.
926         (WebCore::JSCustomElementInterface::setAttributeChangedCallback):
927         (WebCore::JSCustomElementInterface::invokeAttributeChangedCallback): Renamed from attributeChanged.
928         * bindings/js/JSCustomElementInterface.h: Added m_connectedCallback and m_disconnectedCallback as instance
929         variables. Also removed the superfluous mutable qualifier from m_constructor m_attributeChangedCallback.
930         * bindings/js/JSCustomElementsRegistryCustom.cpp:
931         (WebCore::JSCustomElementsRegistry::define): Store connectedCallback and disconnectedCallback.
932         * bindings/scripts/CodeGeneratorJS.pm:
933         (GenerateImplementation):
934         * bindings/scripts/IDLAttributes.txt:
935         * dom/CustomElementsRegistry.idl:
936         * dom/Element.cpp:
937         (WebCore::Element::insertedInto): Call enqueueConnectedCallbackIfNeeded.
938         (WebCore::Element::removedFrom): Call enqueueDisconnectedCallbackIfNeeded.
939         * dom/Element.idl:
940         * dom/LifecycleCallbackQueue.cpp:
941         (WebCore::LifecycleQueueItem::invoke): Added calls to invokeConnectedCallback and invokeDisconnectedCallback.
942         (WebCore::findInterfaceForCustomElement): Extracted from enqueueAttributeChangedCallbackIfNeeded.
943         (WebCore::LifecycleCallbackQueue::enqueueConnectedCallbackIfNeeded): Added.
944         (WebCore::LifecycleCallbackQueue::enqueueDisconnectedCallbackIfNeeded): Added.
945         (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded):
946         (WebCore::CustomElementLifecycleProcessingStack::ensureCurrentQueue):
947         * dom/LifecycleCallbackQueue.h:
948         * dom/Node.idl:
949
950 2016-08-18  Beth Dakin  <bdakin@apple.com>
951
952         Update the accessibility titles for list insertion
953         https://bugs.webkit.org/show_bug.cgi?id=160972
954         -and corresponding-
955         rdar://problem/27750446
956
957         Reviewed by Chris Fleizach.
958
959         Update accessibility titles based on feedback.
960         * English.lproj/Localizable.strings:
961         * platform/LocalizedStrings.cpp:
962         (WebCore::insertListTypeNone):
963         (WebCore::insertListTypeBulleted):
964         (WebCore::insertListTypeBulletedAccessibilityTitle):
965         (WebCore::insertListTypeNumbered):
966         (WebCore::insertListTypeNumberedAccessibilityTitle):
967         (WebCore::insertListTypeNoneAccessibilityTitle): Deleted.
968         * platform/LocalizedStrings.h:
969
970 2016-08-18  Chris Dumez  <cdumez@apple.com>
971
972         Align our encoding labels with the encoding specification
973         https://bugs.webkit.org/show_bug.cgi?id=160931
974
975         Reviewed by Darin Adler.
976
977         Align our encoding labels with the encoding specification:
978         - https://encoding.spec.whatwg.org/#names-and-labels
979
980         This also aligns with Firefox and Chrome.
981
982         No new tests, rebaselined existing test.
983
984         * platform/text/TextCodecICU.cpp:
985         (WebCore::TextCodecICU::registerEncodingNames):
986         * platform/text/TextCodecLatin1.cpp:
987         (WebCore::TextCodecLatin1::registerEncodingNames):
988         (WebCore::newStreamingTextDecoderWindowsLatin1): Deleted.
989         (WebCore::TextCodecLatin1::registerCodecs): Deleted.
990         * platform/text/TextCodecUTF8.cpp:
991         (WebCore::TextCodecUTF8::registerEncodingNames):
992
993 2016-08-18  Andy Estes  <aestes@apple.com>
994
995         [Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning
996         https://bugs.webkit.org/show_bug.cgi?id=160964
997
998         Reviewed by Brent Fulgham.
999
1000         * page/Settings.cpp:
1001         (WebCore::Settings::setCookieStoragePartitioningEnabled): Deleted.
1002         * page/Settings.h:
1003         (WebCore::Settings::cookieStoragePartitioningEnabled): Deleted.
1004         * platform/network/NetworkStorageSession.h:
1005         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Defined cookieStoragePartitioningEnabled.
1006         (WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Set cookieStoragePartitioningEnabled.
1007         (WebCore::cookieStoragePartition): Used cookieStoragePartitioningEnabled instead of Settings::cookieStoragePartitioningEnabled().
1008
1009 2016-08-18  Eric Carlson  <eric.carlson@apple.com>
1010
1011         AX: Audio Description tracks are not labeled correctly, causing user confusion
1012         https://bugs.webkit.org/show_bug.cgi?id=160652
1013         <rdar://problem/27742208>
1014
1015         Reviewed by Antoine Quint.
1016
1017         * http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt: Added.
1018         * http/tests/media/hls/hls-accessiblity-describes-video-menu.html: Added.
1019
1020         * media/trackmenu-test.js:
1021         (clickCCButton): Fail immediately if "video" is null or not a media element. Make failure 
1022         logging more descriptive.
1023
1024         * platform/gtk/TestExpectations: Skip new test.
1025
1026         * platform/ios-simulator/media/video-controls-captions-trackmenu-expected.txt: Updated for
1027         clickCCButton error message change.
1028         * platform/ios-simulator/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Ditto.
1029         * platform/ios-simulator/media/video-controls-captions-trackmenu-localized-expected.txt: Ditto.
1030         * platform/ios-simulator/media/video-controls-captions-trackmenu-sorted-expected.txt: Ditto.
1031
1032 2016-08-18  Alex Christensen  <achristensen@webkit.org>
1033
1034         Fix WinCairo build after r204592.
1035
1036         * PlatformAppleWin.cmake:
1037         * PlatformWin.cmake:
1038
1039 2016-08-18  Eric Carlson  <eric.carlson@apple.com>
1040
1041         [MediaStream] cleanup MediaConstraints
1042         https://bugs.webkit.org/show_bug.cgi?id=160957
1043
1044         Reviewed by Antoine Quint.
1045
1046         No new tests, no behavior change.
1047
1048         * Modules/mediastream/CaptureDeviceManager.cpp:
1049         (CaptureDeviceManager::sessionSupportsConstraint): Use MediaConstraint::type
1050
1051         * bindings/js/JSMediaDevicesCustom.cpp:
1052         (WebCore::initializeStringConstraintWithList): MediaConstraint::create now takes the constraint
1053         type, not name.
1054         (WebCore::createStringConstraint): Ditto.
1055         (WebCore::createBooleanConstraint): Ditto.
1056         (WebCore::createDoubleConstraint): Ditto.
1057         (WebCore::createIntConstraint): Ditto.
1058         (WebCore::parseMediaTrackConstraintSetForKey): Pass constraint type.
1059
1060         * platform/mediastream/MediaConstraints.cpp:
1061         (WebCore::MediaConstraint::create): MediaConstraint constructor now takes the constraint.
1062         (WebCore::IntConstraint::create): Take type, not name.
1063         (WebCore::IntConstraint::setMin): Ditto.
1064         (WebCore::DoubleConstraint::create): Ditto.
1065         (WebCore::BooleanConstraint::create): Ditto.
1066         (WebCore::StringConstraint::create): Ditto.
1067         * platform/mediastream/MediaConstraints.h:
1068
1069         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
1070         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Make static.
1071         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Ditto.
1072         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
1073
1074         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1075         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Use MediaConstraint::type
1076
1077         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1078         (WebCore::AVVideoCaptureSource::applyConstraints): nameForConstraint is a static method. Add
1079         error logging.
1080
1081         * platform/mock/MediaConstraintsMock.cpp:
1082         (WebCore::isSatisfiable): Use constraint type.
1083
1084 2016-08-18  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
1085
1086         [web-animations] Add Animatable, AnimationEffect, KeyframeEffect and Animation interface
1087         https://bugs.webkit.org/show_bug.cgi?id=156096
1088
1089         Reviewed by Dean Jackson.
1090
1091         Adds:
1092         - Animatable interface and implementation of getAnimations in Element.
1093         - Interface and implementation for Document getAnimations method.
1094         - AnimationEffect interface and class stub.
1095         - KeyframeEffect interface and constructor implementation.
1096         - 'Animation' interface, constructor and query methods for effect and timeline.
1097         - Remove runtime condition on Web animation interfaces (compile time flag is specified).
1098
1099         Test: webanimations/Document.html
1100
1101         * CMakeLists.txt:
1102         * DerivedSources.make:
1103         * PlatformGTK.cmake:
1104         * WebCore.xcodeproj/project.pbxproj:
1105         * animation/Animatable.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
1106         * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/AnimationTimeline.cpp.
1107         (WebCore::AnimationEffect::AnimationEffect):
1108         (WebCore::AnimationEffect::~AnimationEffect):
1109         (WebCore::AnimationEffect::setAnimation):
1110         (WebCore::AnimationEffect::isCurrent):
1111         (WebCore::AnimationEffect::isInEffect):
1112         * animation/AnimationEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
1113         * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/DocumentAnimation.idl.
1114         * animation/AnimationTimeline.cpp:
1115         (WebCore::AnimationTimeline::destroy):
1116         (WebCore::AnimationTimeline::attachAnimation):
1117         (WebCore::AnimationTimeline::detachAnimation):
1118         * animation/AnimationTimeline.h:
1119         * animation/AnimationTimeline.idl:
1120         * animation/DocumentAnimation.cpp:
1121         (WebCore::DocumentAnimation::timeline):
1122         (WebCore::DocumentAnimation::getAnimations):
1123         (WebCore::DocumentAnimation::addAnimation):
1124         (WebCore::DocumentAnimation::removeAnimation):
1125         * animation/DocumentAnimation.h:
1126         (WebCore::DocumentAnimation::getAnimations):
1127         * animation/DocumentAnimation.idl:
1128         * animation/DocumentTimeline.cpp:
1129         (WebCore::DocumentTimeline::create):
1130         (WebCore::DocumentTimeline::DocumentTimeline):
1131         (WebCore::DocumentTimeline::attach):
1132         (WebCore::DocumentTimeline::detach):
1133         * animation/DocumentTimeline.h:
1134         * animation/DocumentTimeline.idl:
1135         * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
1136         (WebCore::KeyframeEffect::create):
1137         (WebCore::KeyframeEffect::KeyframeEffect):
1138         (WebCore::KeyframeEffect::~KeyframeEffect):
1139         * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.h.
1140         * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
1141         * animation/WebAnimation.cpp: Copied from Source/WebCore/animation/DocumentAnimation.cpp.
1142         (WebCore::WebAnimation::create):
1143         (WebCore::WebAnimation::WebAnimation):
1144         (WebCore::WebAnimation::~WebAnimation):
1145         * animation/WebAnimation.h: Copied from Source/WebCore/animation/DocumentAnimation.h.
1146         * animation/WebAnimation.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
1147         * bindings/scripts/CodeGeneratorGObject.pm:
1148         * dom/Element.cpp:
1149         (WebCore::Element::getAnimations):
1150         * dom/Element.h:
1151         * dom/Element.idl:
1152
1153 2016-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
1154
1155         [Cocoa] Migrate off of deprecated CoreGraphics API CGContextSelectFont() and CGContextShowTextAtPoint()
1156         https://bugs.webkit.org/show_bug.cgi?id=160895
1157
1158         Reviewed by Dean Jackson.
1159
1160         Migrate to CTLineDraw() instead.
1161
1162         This patch also adds support for linking to the existing CoreText framework on Windows.
1163
1164         No new tests because there is no behavior change.
1165
1166         * PlatformWin.cmake:
1167         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1168         (WebCore::showText):
1169         * platform/graphics/ca/PlatformCALayer.cpp:
1170         (WebCore::PlatformCALayer::drawTextAtPoint):
1171         * platform/ios/LegacyTileCache.mm:
1172         (WebCore::LegacyTileCache::drawLayer):
1173         * platform/spi/win/CoreTextSPIWin.cpp: Added.
1174         * platform/spi/win/CoreTextSPIWin.h: Added.
1175
1176 2016-08-17  Benjamin Poulain  <benjamin@webkit.org>
1177
1178         [CSS] The parser should not get rid of empty namespace specification in front of element name selectors
1179         https://bugs.webkit.org/show_bug.cgi?id=160936
1180
1181         Reviewed by Chris Dumez.
1182
1183         There are two places where you can specify an empty namespace
1184         in selectors:
1185             - Element name (e.g. "|name")
1186             - Attribute name (e.g. "[|name]")
1187         In the first case, if we have an empty namespace, the selector
1188         should match that.
1189         In the second case, the default namespace of attribute is already
1190         empty so it is just the same as "[name]".
1191
1192         Our code was just discarding any empty namespace. This is fine
1193         for attributes but for names that is transforming "|name" into "name"
1194         which is invalid.
1195
1196         This patch updates those cases to differentiate:
1197         - Null prefix -> There was no namespace specified.
1198         - Empty prefix -> There was a namespace prefix and it is empty.
1199
1200         Test: fast/selectors/empty-namespace-with-element-selector.html
1201
1202         * css/CSSGrammar.y.in:
1203         * css/CSSParser.cpp:
1204         (WebCore::CSSParser::determineNameInNamespace):
1205         (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded):
1206         (WebCore::CSSParser::rewriteSpecifiersWithElementName):
1207         * css/CSSParser.h:
1208         * css/CSSSelector.cpp:
1209         (WebCore::CSSSelector::selectorText):
1210         * css/CSSSelectorList.cpp:
1211         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
1212         * css/StyleSheetContents.cpp:
1213         (WebCore::StyleSheetContents::determineNamespace): Deleted.
1214
1215 2016-08-17  Chris Dumez  <cdumez@apple.com>
1216
1217         [Web IDL] Add support for dictionary members of dictionary types
1218         https://bugs.webkit.org/show_bug.cgi?id=160902
1219
1220         Reviewed by Sam Weinig.
1221
1222         Add support for dictionary members of dictionary types.
1223
1224         No new tests, updated bindings tests.
1225
1226         * bindings/scripts/CodeGeneratorJS.pm:
1227         (GenerateDictionaryImplementationContent):
1228         * bindings/scripts/test/JS/JSTestObj.cpp:
1229         (WebCore::convertDictionary<TestObj::Dictionary>):
1230         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1231         * bindings/scripts/test/TestObj.idl:
1232
1233 2016-08-17  Anders Carlsson  <andersca@apple.com>
1234
1235         Add support for additional networks
1236         https://bugs.webkit.org/show_bug.cgi?id=160951
1237         rdar://problem/27807479
1238
1239         Reviewed by Sam Weinig.
1240
1241         * Modules/applepay/ApplePaySession.cpp:
1242         (WebCore::createSupportedNetworks):
1243         (WebCore::createPaymentRequest):
1244         (WebCore::ApplePaySession::create):
1245         * Modules/applepay/PaymentRequest.cpp:
1246         (WebCore::isAdditionalValidSupportedNetwork):
1247         (WebCore::PaymentRequest::isValidSupportedNetwork):
1248         * Modules/applepay/PaymentRequest.h:
1249         (WebCore::PaymentRequest::supportedNetworks):
1250         (WebCore::PaymentRequest::setSupportedNetworks):
1251         * Modules/applepay/PaymentRequestValidator.cpp:
1252         (WebCore::PaymentRequestValidator::validateSupportedNetworks):
1253         * Modules/applepay/PaymentRequestValidator.h:
1254
1255 2016-08-17  Anders Carlsson  <andersca@apple.com>
1256
1257         Remove a couple of unused WKSI function pointers
1258         https://bugs.webkit.org/show_bug.cgi?id=160946
1259
1260         Reviewed by Dan Bernstein.
1261
1262         * platform/mac/WebCoreSystemInterface.h:
1263         * platform/mac/WebCoreSystemInterface.mm:
1264
1265 2016-08-17  Anders Carlsson  <andersca@apple.com>
1266
1267         Move WKSignedPublicKeyAndChallengeString into WebCore and make it proper C++
1268         https://bugs.webkit.org/show_bug.cgi?id=160945
1269
1270         Reviewed by Dan Bernstein.
1271
1272         * platform/mac/SSLKeyGeneratorMac.mm:
1273         (WebCore::getSubjectPublicKey):
1274         (WebCore::signPublicKeyAndChallenge):
1275         (WebCore::signedPublicKeyAndChallengeString):
1276
1277 2016-08-17  Antti Koivisto  <antti@apple.com>
1278
1279         Remove CSS_IMAGE_SET feature define
1280         https://bugs.webkit.org/show_bug.cgi?id=160944
1281
1282         Reviewed by Dean Jackson.
1283
1284         This seems to be enabled everywhere already (except Mac cmake build which it keep breaking).
1285
1286         * css/CSSCursorImageValue.cpp:
1287         (WebCore::CSSCursorImageValue::CSSCursorImageValue):
1288         (WebCore::CSSCursorImageValue::cachedImage):
1289         (WebCore::CSSCursorImageValue::cachedOrPendingImage):
1290         * css/CSSImageSetValue.cpp:
1291         (WebCore::CSSImageSetValue::cloneForCSSOM):
1292         * css/CSSImageSetValue.h:
1293         * css/CSSParser.cpp:
1294         (WebCore::CSSParser::parseVariableDependentValue):
1295         (WebCore::isImageSetFunctionValue):
1296         (WebCore::CSSParser::parseValue):
1297         (WebCore::CSSParser::parseContent):
1298         (WebCore::CSSParser::parseFillImage):
1299         (WebCore::CSSParser::parseBorderImage):
1300         (WebCore::CSSParser::parseImageResolution):
1301         (WebCore::CSSParser::parseImageSet):
1302         * css/CSSParser.h:
1303         * css/CSSToStyleMap.cpp:
1304         (WebCore::CSSToStyleMap::mapNinePieceImage):
1305         * css/CSSValue.cpp:
1306         (WebCore::CSSValue::traverseSubresources):
1307         (WebCore::CSSValue::equals):
1308         (WebCore::CSSValue::cssText):
1309         (WebCore::CSSValue::destroy):
1310         (WebCore::CSSValue::cloneForCSSOM):
1311         * css/CSSValue.h:
1312         (WebCore::CSSValue::isImageGeneratorValue):
1313         (WebCore::CSSValue::isGradientValue):
1314         (WebCore::CSSValue::isNamedImageValue):
1315         (WebCore::CSSValue::isImageSetValue):
1316         (WebCore::CSSValue::isImageValue):
1317         (WebCore::CSSValue::isInheritedValue):
1318         * css/StyleBuilderConverter.h:
1319         (WebCore::isImageShape):
1320         * css/StyleBuilderCustom.h:
1321         (WebCore::StyleBuilderCustom::applyValueContent):
1322         * css/StyleResolver.cpp:
1323         (WebCore::StyleResolver::styleImage):
1324         (WebCore::StyleResolver::generatedOrPendingFromValue):
1325         (WebCore::StyleResolver::setOrPendingFromValue):
1326         (WebCore::StyleResolver::cursorOrPendingFromValue):
1327         * css/StyleResolver.h:
1328         (WebCore::StyleResolver::applyPropertyToRegularStyle):
1329         * css/makeprop.pl:
1330         (generateFillLayerPropertyValueSetter):
1331         * rendering/style/StyleCachedImage.cpp:
1332         (WebCore::StyleCachedImage::cssValue):
1333         * rendering/style/StylePendingImage.h:
1334         * style/StylePendingResources.cpp:
1335         (WebCore::Style::loadPendingImage):
1336
1337 2016-08-17  Antti Koivisto  <antti@apple.com>
1338
1339         Try to fix CMake build.
1340
1341         * rendering/style/StyleCachedImage.cpp:
1342         (WebCore::StyleCachedImage::cssValue):
1343
1344 2016-08-17  Chris Fleizach  <cfleizach@apple.com>
1345
1346         AX: Support abbreviations in iOS
1347         https://bugs.webkit.org/show_bug.cgi?id=160907
1348
1349         Reviewed by Joanmarie Diggs.
1350
1351         Expose the expandedTextValue attribute for iOS, so that VoiceOver can speak abbreviations correctly.
1352
1353         Test: accessibility/ios-simulator/abbreviation.html
1354
1355         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1356         (-[WebAccessibilityObjectWrapper textMarkersForRange:]):
1357         (-[WebAccessibilityObjectWrapper accessibilityExpandedTextValue]):
1358         (-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
1359         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1360         (AXAttributeStringSetSpelling):
1361         (AXAttributeStringSetExpandedTextValue):
1362         (AXAttributedStringAppendText):
1363         (AXAttributeStringSetexpandedTextValue): Deleted.
1364
1365 2016-08-17  Antti Koivisto  <antti@apple.com>
1366
1367         Remove StyleCachedImageSet
1368         https://bugs.webkit.org/show_bug.cgi?id=160941
1369
1370         Reviewed by Simon Fraser.
1371
1372         It is almost the same as StyleCachedImage. Just use that.
1373
1374         * CMakeLists.txt:
1375         * WebCore.xcodeproj/project.pbxproj:
1376         * css/CSSCursorImageValue.cpp:
1377         (WebCore::CSSCursorImageValue::cachedImage):
1378         * css/CSSImageSetValue.cpp:
1379         (WebCore::CSSImageSetValue::detachPendingImage):
1380         (WebCore::CSSImageSetValue::~CSSImageSetValue):
1381         (WebCore::CSSImageSetValue::fillImageSet):
1382         (WebCore::CSSImageSetValue::bestImageForScaleFactor):
1383         (WebCore::CSSImageSetValue::bestFitImage):
1384         (WebCore::CSSImageSetValue::cachedOrPendingImageSet):
1385         (WebCore::CSSImageSetValue::customCSSText):
1386         (WebCore::CSSImageSetValue::traverseSubresources):
1387         (WebCore::CSSImageSetValue::cachedImageSet): Deleted.
1388         * css/CSSImageSetValue.h:
1389         (WebCore::CSSImageSetValue::create):
1390         (WebCore::CSSImageSetValue::compareByScaleFactor):
1391         * css/StyleResolver.cpp:
1392         * page/EventHandler.cpp:
1393         * rendering/style/ShapeValue.cpp:
1394         (WebCore::ShapeValue::isImageValid):
1395         * rendering/style/StyleAllInOne.cpp:
1396         * rendering/style/StyleCachedImage.cpp:
1397         (WebCore::StyleCachedImage::StyleCachedImage):
1398
1399             Add scale factor and CSSImageSetValue backpointer, the only additional features of StyleCachedImageSet.
1400
1401         (WebCore::StyleCachedImage::cssValue):
1402         (WebCore::StyleCachedImage::imageSize):
1403         (WebCore::StyleCachedImage::imageHasRelativeWidth):
1404         * rendering/style/StyleCachedImage.h:
1405         * rendering/style/StyleCachedImageSet.cpp: Removed.
1406         * rendering/style/StyleCachedImageSet.h: Removed.
1407         * rendering/style/StyleImage.h:
1408         (WebCore::StyleImage::isCachedImage):
1409         (WebCore::StyleImage::isPendingImage):
1410         (WebCore::StyleImage::isGeneratedImage):
1411         (WebCore::StyleImage::StyleImage):
1412         (WebCore::StyleImage::isCachedImageSet): Deleted.
1413         * style/StylePendingResources.cpp:
1414         (WebCore::Style::loadPendingImage):
1415
1416 2016-08-17  Per Arne Vollan  <pvollan@apple.com>
1417
1418         [Win] Add tests for linked fonts.
1419         https://bugs.webkit.org/show_bug.cgi?id=160898
1420
1421         Reviewed by Brent Fulgham.
1422
1423         Add tests for https://trac.webkit.org/changeset/204502.
1424
1425         * platform/graphics/win/FontCacheWin.cpp:
1426         (WebCore::appendLinkedFonts):
1427         (WebCore::getLinkedFonts):
1428
1429 2016-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1430
1431         Unreviewed. Fix GObject DOM bindings API break after r204449, r204450 and r204451.
1432
1433         Attributes designMode, embeds, plugins, scripts and compatMode have been moved from HTMLDocument to Document.
1434
1435         * bindings/gobject/WebKitDOMDeprecated.cpp:
1436         (webkit_dom_html_document_get_design_mode):
1437         (webkit_dom_html_document_set_design_mode):
1438         (webkit_dom_html_document_get_compat_mode):
1439         (webkit_dom_html_document_get_embeds):
1440         (webkit_dom_html_document_get_plugins):
1441         (webkit_dom_html_document_get_scripts):
1442         * bindings/gobject/WebKitDOMDeprecated.h:
1443         * bindings/gobject/WebKitDOMDeprecated.symbols:
1444         * bindings/gobject/webkitdom.symbols:
1445
1446 2016-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1447
1448         Unreviewed. Fix GObject DOM bindings API break after r204312.
1449
1450         HTMLInputElement capture attribute now returns the actual capture value, instead of whether it's present or
1451         not. This patch renames webkit_dom_html_input_element_get_capture as
1452         webkit_dom_html_input_element_get_capture_type and deprecates webkit_dom_html_input_element_get_capture.
1453
1454         * bindings/gobject/WebKitDOMDeprecated.cpp:
1455         (webkit_dom_html_input_element_get_capture):
1456         * bindings/gobject/WebKitDOMDeprecated.h:
1457         * bindings/gobject/WebKitDOMDeprecated.symbols:
1458         * bindings/gobject/webkitdom.symbols:
1459         * bindings/scripts/CodeGeneratorGObject.pm:
1460         (GenerateProperty):
1461         (GetEffectiveFunctionName):
1462
1463 2016-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1464
1465         customElements.define should retrieve lifecycle callbacks
1466         https://bugs.webkit.org/show_bug.cgi?id=160797
1467
1468         Reviewed by Chris Dumez.
1469
1470         Updated JSCustomElementInterface to invoke Get(constructor, "prototype") and Get(prototype, callbackName)
1471         for each lifecycle callback as required by the latest specification:
1472         https://html.spec.whatwg.org/#dom-customelementsregistry-define
1473
1474         Also added the support for "observedAttributes" property on the custom elements constructor which defines
1475         the list of attributes for which attributeChangedCallback is invoked.
1476
1477         Test: fast/custom-elements/CustomElementsRegistry.html
1478
1479         * bindings/js/JSCustomElementInterface.cpp:
1480         (WebCore::JSCustomElementInterface::setAttributeChangedCallback): Added.
1481         (WebCore::JSCustomElementInterface::attributeChanged): Invoke m_attributeChangedCallback instead of on the
1482         result of Get(element, "attributeChangedCallback").
1483         * bindings/js/JSCustomElementInterface.h:
1484         (WebCore::JSCustomElementInterface::observesAttribute): Added.
1485
1486         * bindings/js/JSCustomElementsRegistryCustom.cpp:
1487         (WebCore::getLifecycleCallback): Added.
1488         (WebCore::JSCustomElementsRegistry::define): Invoke Get(prototype, callbackName) for each callback. Also
1489         store attributedChangedCallback and observedAttributes to JSCustomElementInterface. Other callbacks will
1490         be stored in the future when the support for those callbacks are added.
1491
1492         * dom/Element.cpp:
1493         (WebCore::Element::attributeChanged): Moved more code into enqueueAttributeChangedCallbackIfNeeded.
1494
1495         * dom/LifecycleCallbackQueue.cpp:
1496         (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded): Added an early exit for when
1497         the given attribute is not observed by the custom element. Also moved the logic to retrieve
1498         JSCustomElementInterface from Element::attributeChanged and renamed it from enqueueAttributeChangedCallback.
1499
1500         * bindings/js/JSDOMBinding.h:
1501         (WebCore::toNativeArray): Throw a TypeError when the argument is not an object.
1502         * bindings/js/JSDOMConvert.h:
1503         (WebCore::Converter<Vector<T>>::convert): Removed a FIXME comment.
1504
1505 2016-08-16  Zalan Bujtas  <zalan@apple.com>
1506
1507         Subpixel rendering: Cleanup RenderLayerBacking::updateGeometry.
1508         https://bugs.webkit.org/show_bug.cgi?id=156860
1509         <rdar://problem/25432352>
1510
1511         Reviewed by Simon Fraser.
1512
1513         This patch cleans up the subpixel adjustment computation for the graphics layers
1514         in RenderLayerBacking::updateGeometry.
1515         It also fixes subpixel jiggling with clipping layers (both ancestor and child containment layers). 
1516
1517         Tests: compositing/hidpi-ancestor-subpixel-clipping.html
1518                compositing/hidpi-sibling-composited-content-offset.html
1519                compositing/hidpi-subpixel-transform-origin.html
1520                fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor.html
1521
1522         * rendering/RenderLayer.cpp:
1523         (WebCore::RenderLayer::beginTransparencyLayers):
1524         (WebCore::RenderLayer::paint):
1525         (WebCore::RenderLayer::clipToRect):
1526         (WebCore::RenderLayer::setupClipPath):
1527         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1528         (WebCore::RenderLayer::paintBackgroundForFragments):
1529         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1530         (WebCore::RenderLayer::paintOutlineForFragments):
1531         (WebCore::RenderLayer::paintMaskForFragments):
1532         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
1533         (WebCore::RenderLayer::paintOverflowControlsForFragments):
1534         (WebCore::RenderLayer::calculateClipRects):
1535         * rendering/RenderLayer.h:
1536         * rendering/RenderLayerBacking.cpp:
1537         (WebCore::subpixelOffsetFromRendererChanged):
1538         (WebCore::subpixelForLayerPainting):
1539         (WebCore::computeOffsetFromRenderer):
1540         (WebCore::snappedGraphicsLayerRect):
1541         (WebCore::computeOffsetFromAncestorGraphicsLayer):
1542         (WebCore::ComputedOffsets::ComputedOffsets): This is a helper class to hold offset values.
1543         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
1544         (WebCore::ComputedOffsets::fromParentGraphicsLayer):
1545         (WebCore::ComputedOffsets::fromPrimaryGraphicsLayer):
1546         (WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect):
1547         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
1548         (WebCore::RenderLayerBacking::updateGeometry):
1549         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
1550         (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
1551         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1552         (WebCore::RenderLayerBacking::paintIntoLayer):
1553         (WebCore::RenderLayerBacking::paintContents):
1554         (WebCore::devicePixelFractionGapFromRendererChanged): Deleted.
1555         (WebCore::pixelFractionForLayerPainting): Deleted.
1556         (WebCore::calculateDevicePixelOffsetFromRenderer): Deleted.
1557         (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): Deleted.
1558         * rendering/RenderLayerBacking.h:
1559
1560 2016-08-16  Commit Queue  <commit-queue@webkit.org>
1561
1562         Unreviewed, rolling out r204540, r204545, and r204547.
1563         https://bugs.webkit.org/show_bug.cgi?id=160932
1564
1565         Broke Windows builds (Requested by rniwa on #webkit).
1566
1567         Reverted changesets:
1568
1569         "customElements.define should retrieve lifecycle callbacks"
1570         https://bugs.webkit.org/show_bug.cgi?id=160797
1571         http://trac.webkit.org/changeset/204540
1572
1573         "Windows build fix attempt after r204540."
1574         http://trac.webkit.org/changeset/204545
1575
1576         "Another Windows build fix attempt. The error message doesn't
1577         make any sense to me."
1578         http://trac.webkit.org/changeset/204547
1579
1580 2016-08-16  Hunseop Jeong  <hs85.jeong@samsung.com>
1581
1582         Unreviewed, CMake build fix after r204532
1583
1584         * PlatformMac.cmake:
1585
1586 2016-08-16  Hunseop Jeong  <hs85.jeong@samsung.com>
1587
1588         Unreviewed, CMake build fix
1589
1590         * PlatformMac.cmake:
1591
1592 2016-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1593
1594         Another Windows build fix attempt. The error message doesn't make any sense to me.
1595
1596         * bindings/js/JSCustomElementsRegistryCustom.cpp:
1597         (WebCore::JSCustomElementsRegistry::define):
1598
1599 2016-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1600
1601         Windows build fix attempt after r204540.
1602
1603         * bindings/js/JSBindingsAllInOne.cpp:
1604
1605 2016-08-16  Alex Christensen  <achristensen@webkit.org>
1606
1607         URLParser should parse URLs without credentials
1608         https://bugs.webkit.org/show_bug.cgi?id=160913
1609
1610         Reviewed by Brady Eidson.
1611
1612         When parsing a URL, after the scheme we do not know if we are parsing a username and password
1613         or if we are parsing the host until we hit a '@' indicating the end of the credentials or a /, ?, or #
1614         indicating the end of the host.  Because there are significantly different rules for serializing usernames,
1615         passwords, and hosts (all of which have yet to be implemented in URLParser) we put the code points after the 
1616         scheme in a special buffer that will be processed once we know what we are parsing.
1617         
1618         In the future, this could be optimized by assuming that we are parsing the host and if we encounter a '@' character,
1619         then do some extra work.  This would save us the effort of copying the host twice because most URLs don't have credentials.
1620
1621         This is covered by a new URLParser API test.
1622
1623         * platform/Logging.h:
1624         * platform/URLParser.cpp:
1625         (WebCore::isC0Control):
1626         (WebCore::isC0ControlOrSpace):
1627         (WebCore::isTabOrNewline):
1628         (WebCore::isSpecialScheme):
1629         (WebCore::URLParser::parse):
1630         (WebCore::URLParser::authorityEndReached):
1631         (WebCore::URLParser::hostEndReached):
1632         (WebCore::URLParser::allValuesEqual):
1633         (WebCore::isASCIIDigit): Deleted.
1634         (WebCore::isASCIIAlpha): Deleted.
1635         (WebCore::isASCIIAlphanumeric): Deleted.
1636         * platform/URLParser.h:
1637         (WebCore::URLParser::parse):
1638
1639 2016-08-16  Chris Dumez  <cdumez@apple.com>
1640
1641         Add support for ShadowRoot.mode attribute
1642         https://bugs.webkit.org/show_bug.cgi?id=160919
1643
1644         Reviewed by Ryosuke Niwa.
1645
1646         Add support for ShadowRoot.mode attribute:
1647         - https://dom.spec.whatwg.org/#interface-shadowroot
1648
1649         Test: fast/shadow-dom/ShadowRoot-mode.html
1650
1651         * css/ElementRuleCollector.cpp:
1652         (WebCore::ElementRuleCollector::collectMatchingRules):
1653         * css/SelectorChecker.cpp:
1654         (WebCore::SelectorChecker::matchRecursively):
1655         * dom/Element.cpp:
1656         (WebCore::Element::bindingsOffsetParent):
1657         (WebCore::Element::addShadowRoot):
1658         (WebCore::Element::attachShadow):
1659         (WebCore::Element::shadowRootForBindings):
1660         (WebCore::Element::userAgentShadowRoot):
1661         (WebCore::Element::ensureUserAgentShadowRoot):
1662         * dom/Node.cpp:
1663         (WebCore::Node::isUnclosedNode):
1664         (WebCore::Node::assignedSlotForBindings):
1665         (WebCore::Node::isInUserAgentShadowTree):
1666         * dom/ShadowRoot.cpp:
1667         (WebCore::ShadowRoot::ShadowRoot):
1668         (WebCore::ShadowRoot::styleResolver):
1669         * dom/ShadowRoot.h:
1670         * dom/ShadowRoot.idl:
1671         * dom/SlotAssignment.cpp:
1672         (WebCore::SlotAssignment::didChangeSlot):
1673         * html/HTMLSummaryElement.cpp:
1674         (WebCore::HTMLSummaryElement::create):
1675         * inspector/InspectorDOMAgent.cpp:
1676         (WebCore::shadowRootType):
1677         (WebCore::InspectorDOMAgent::buildObjectForNode):
1678         * rendering/HitTestResult.cpp:
1679         (WebCore::moveOutOfUserAgentShadowTree):
1680         * rendering/RenderElement.cpp:
1681         (WebCore::RenderElement::selectionPseudoStyle):
1682         * rendering/RenderLayer.cpp:
1683         (WebCore::rendererForScrollbar):
1684         * svg/SVGElement.cpp:
1685         (WebCore::SVGElement::correspondingUseElement):
1686         * testing/Internals.cpp:
1687         (WebCore::Internals::shadowRootType):
1688
1689 2016-08-16  Ryosuke Niwa  <rniwa@webkit.org>
1690
1691         customElements.define should retrieve lifecycle callbacks
1692         https://bugs.webkit.org/show_bug.cgi?id=160797
1693
1694         Reviewed by Chris Dumez.
1695
1696         Updated JSCustomElementInterface to invoke Get(constructor, "prototype") and Get(prototype, callbackName)
1697         for each lifecycle callback as required by the latest specification:
1698         https://html.spec.whatwg.org/#dom-customelementsregistry-define
1699
1700         Also added the support for "observedAttributes" property on the custom elements constructor which defines
1701         the list of attributes for which attributeChangedCallback is invoked.
1702
1703         Test: fast/custom-elements/CustomElementsRegistry.html
1704
1705         * bindings/js/JSCustomElementInterface.cpp:
1706         (WebCore::JSCustomElementInterface::setAttributeChangedCallback): Added.
1707         (WebCore::JSCustomElementInterface::attributeChanged): Invoke m_attributeChangedCallback instead of on the
1708         result of Get(element, "attributeChangedCallback").
1709         * bindings/js/JSCustomElementInterface.h:
1710         (WebCore::JSCustomElementInterface::observesAttribute): Added.
1711
1712         * bindings/js/JSCustomElementsRegistryCustom.cpp:
1713         (WebCore::getLifecycleCallback): Added.
1714         (WebCore::JSCustomElementsRegistry::define): Invoke Get(prototype, callbackName) for each callback. Also
1715         store attributedChangedCallback and observedAttributes to JSCustomElementInterface. Other callbacks will
1716         be stored in the future when the support for those callbacks are added.
1717
1718         * dom/Element.cpp:
1719         (WebCore::Element::attributeChanged): Moved more code into enqueueAttributeChangedCallbackIfNeeded.
1720
1721         * dom/LifecycleCallbackQueue.cpp:
1722         (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded): Added an early exit for when
1723         the given attribute is not observed by the custom element. Also moved the logic to retrieve
1724         JSCustomElementInterface from Element::attributeChanged and renamed it from enqueueAttributeChangedCallback.
1725
1726         * bindings/js/JSDOMBinding.h:
1727         (WebCore::toNativeArray): Throw a TypeError when the argument is not an object.
1728         * bindings/js/JSDOMConvert.h:
1729         (WebCore::Converter<Vector<T>>::convert): Removed a FIXME comment.
1730
1731 2016-08-16  Anders Carlsson  <andersca@apple.com>
1732
1733         Fix build.
1734
1735         * Configurations/WebCore.xcconfig:
1736
1737 2016-08-16  Chris Dumez  <cdumez@apple.com>
1738
1739         Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification
1740         https://bugs.webkit.org/show_bug.cgi?id=160911
1741
1742         Reviewed by Ryosuke Niwa.
1743
1744         Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification:
1745         - https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
1746         - https://dom.spec.whatwg.org/#dom-node-lookupprefix
1747         - https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri
1748
1749         Our implementation now matches closely the text of the DOM specification
1750         and we pass more W3C tests as it fixes the following bug:
1751         - isDefaultNamespace(null) / isDefaultNamespace('') was not returning true for in cases
1752           where the node's default namespace was null. Our implementation was returning false
1753           instead of comparing the node's default namespace (in this case null) with the input
1754           namespace (in this case null).
1755
1756         No new tests, rebaselined existing test.
1757
1758         * dom/Node.cpp:
1759         (WebCore::locateDefaultNamespace):
1760         (WebCore::Node::isDefaultNamespace):
1761         (WebCore::Node::lookupNamespaceURI):
1762         (WebCore::locateNamespacePrefix):
1763         (WebCore::Node::lookupPrefix):
1764         (WebCore::appendTextContent): Deleted.
1765         (WebCore::Node::textContent): Deleted.
1766         (WebCore::Node::setTextContent): Deleted.
1767         * dom/Node.h:
1768         * xml/NativeXPathNSResolver.cpp:
1769         (WebCore::NativeXPathNSResolver::lookupNamespaceURI):
1770
1771 2016-08-15  Ada Chan  <adachan@apple.com>
1772
1773         Placeholder does not show the first time going into picture-in-picture on video without controls
1774         https://bugs.webkit.org/show_bug.cgi?id=160868
1775
1776         Reviewed by Eric Carlson.
1777
1778         Test: media/controls/pip-placeholder-without-video-controls.html
1779
1780         If the media controls script is not injected by the time webkitpresentationmodechanged
1781         event fires, the script that updates the stylesheet to show the placeholder won't execute.
1782
1783         To fix this, doing one of the following would work:
1784         - Ensure the shadow dom for the video is set up when we schedule the
1785         webkitpresentationmodechanged event.
1786         - Make sure the styles are set up correctly to show the placeholder if needed
1787         when the Controller object (in mediaControlsApple.js) is created.
1788
1789         Doing both here following what we did for the wireless playback status.
1790
1791         * Modules/mediacontrols/mediaControlsApple.js:
1792         (Controller):
1793         Call updatePictureInPicturePlaceholder() so it updates the styles to show the
1794         placeholder if needed.
1795         (Controller.prototype.updatePictureInPicturePlaceholder):
1796         Extract the logic that updates the placeholder into a separate method so it can
1797         be called when we initialize Controller.
1798         (Controller.prototype.handlePresentationModeChange):
1799         Call updatePictureInPicturePlaceholder().
1800         * Modules/mediacontrols/mediaControlsiOS.js:
1801         (ControllerIOS.prototype.updatePictureInPicturePlaceholder):
1802         Renamed from handlePresentationModeChange().
1803         (ControllerIOS.prototype.handlePresentationModeChange): Deleted.
1804         * html/HTMLMediaElement.cpp:
1805         (WebCore::HTMLMediaElement::enterFullscreen):
1806         Call configureMediaControls() which ensures the shadow root gets added if needed.
1807
1808 2016-08-16  Simon Fraser  <simon.fraser@apple.com>
1809
1810         Rename FrameView::m_layoutDisallowed to m_layoutDisallowedCount
1811         https://bugs.webkit.org/show_bug.cgi?id=160918
1812
1813         Reviewed by Zalan Bujtas.
1814
1815         m_layoutDisallowedCount makes it clearer that it's accumulated.
1816
1817         * page/FrameView.h:
1818
1819 2016-08-16  Anders Carlsson  <andersca@apple.com>
1820
1821         Rename SSLKeyGeneratorMac.cpp to SSLKeyGeneratorMac.mm.
1822         
1823         Rubber-stamped by Dan Bernstein.
1824
1825         * platform/mac/SSLKeyGeneratorMac.mm: Renamed from platform/mac/SSLKeyGeneratorMac.cpp.
1826
1827 2016-08-16  Myles C. Maxfield  <mmaxfield@apple.com>
1828
1829         Migrate line breaking code from ints to Optional<unsigned>s
1830         https://bugs.webkit.org/show_bug.cgi?id=160859
1831
1832         Reviewed by Darin Adler.
1833
1834         Previously, we were using -1 to mean "before the beginning of the string". Now,
1835         Nullopt means that.
1836
1837         This patch also renames break_lines.{h,cpp} to BreakLines.{h.cpp}. This file was
1838         originally named during the KHTML days.
1839
1840         No new tests because there is no behavior change.
1841
1842         * CMakeLists.txt:
1843         * WebCore.xcodeproj/project.pbxproj:
1844         * rendering/BreakLines.cpp: Renamed from Source/WebCore/rendering/break_lines.cpp.
1845         * rendering/BreakLines.h: Renamed from Source/WebCore/rendering/break_lines.h.
1846         (WebCore::isBreakableSpace):
1847         (WebCore::shouldBreakAfter):
1848         (WebCore::needsLineBreakIterator):
1849         (WebCore::nextBreakablePositionNonLoosely):
1850         (WebCore::nextBreakablePositionLoosely):
1851         (WebCore::nextBreakablePositionKeepingAllWords):
1852         (WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP):
1853         (WebCore::nextBreakablePosition):
1854         (WebCore::nextBreakablePositionIgnoringNBSP):
1855         (WebCore::nextBreakablePositionLoose):
1856         (WebCore::nextBreakablePositionIgnoringNBSPLoose):
1857         (WebCore::isBreakable):
1858         * rendering/InlineIterator.h:
1859         (WebCore::InlineIterator::moveTo):
1860         (WebCore::InlineIterator::nextBreakablePosition):
1861         (WebCore::InlineIterator::setNextBreakablePosition):
1862         (WebCore::InlineIterator::InlineIterator): Deleted.
1863         * rendering/InlineTextBox.cpp:
1864         * rendering/RenderText.cpp:
1865         (WebCore::RenderText::computePreferredLogicalWidths):
1866         * rendering/RenderingAllInOne.cpp:
1867         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1868         * rendering/break_lines.h:
1869         (WebCore::isBreakableSpace): Deleted.
1870         (WebCore::shouldBreakAfter): Deleted.
1871         (WebCore::needsLineBreakIterator): Deleted.
1872         (WebCore::nextBreakablePositionNonLoosely): Deleted.
1873         (WebCore::nextBreakablePositionLoosely): Deleted.
1874         (WebCore::nextBreakablePositionKeepingAllWords): Deleted.
1875         (WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP): Deleted.
1876         (WebCore::nextBreakablePosition): Deleted.
1877         (WebCore::nextBreakablePositionIgnoringNBSP): Deleted.
1878         (WebCore::nextBreakablePositionLoose): Deleted.
1879         (WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
1880         (WebCore::isBreakable): Deleted.
1881         * rendering/line/BreakingContext.h:
1882         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
1883         (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition):
1884         (WebCore::BreakingContext::InlineIteratorHistory::moveTo):
1885         (WebCore::tryHyphenating):
1886         (WebCore::BreakingContext::handleText):
1887         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
1888
1889 2016-08-16  Chris Dumez  <cdumez@apple.com>
1890
1891         DOM4: getElementsByClassName should include non StyledElements
1892         https://bugs.webkit.org/show_bug.cgi?id=94718
1893
1894         Reviewed by Ryosuke Niwa.
1895
1896         getElementsByClassName() now includes non StyledElements as per the latest
1897         DOM specification:
1898         - https://dom.spec.whatwg.org/#concept-getelementsbyclassname
1899
1900         The new behavior is consistent with Firefox and Chrome.
1901
1902         Test: fast/dom/getElementsByClassName/non-styled-element.html
1903
1904         * dom/ClassCollection.h:
1905         (WebCore::ClassCollection::elementMatches):
1906
1907 2016-08-16  Brady Eidson  <beidson@apple.com>
1908
1909         Cleanup WK2 platform gamepad handling.
1910         https://bugs.webkit.org/show_bug.cgi?id=160871
1911
1912         Reviewed by Alex Christensen.
1913
1914         No new tests (No currently testable change in behavior).
1915
1916         This patch does a few things:
1917         1 - Separates the concepts of "monitoring gamepads" and "monitoring gamepad inputs"
1918         2 - Uses this new concept to much more cleanly handle the case where we are not currently
1919             monitoring gamepad inputs because an interested WKWebView is not front and center.
1920         3 - Pre-populates the "initial set of gamepads" in WebProcesses that start listening for gamepads.
1921
1922         * platform/gamepad/GamepadProviderClient.h:
1923         (WebCore::GamepadProviderClient::setInitialConnectedGamepads):
1924
1925         * platform/gamepad/mac/HIDGamepadProvider.cpp:
1926         (WebCore::HIDGamepadProvider::HIDGamepadProvider):
1927         (WebCore::HIDGamepadProvider::stopMonitoringInput):
1928         (WebCore::HIDGamepadProvider::startMonitoringInput):
1929         (WebCore::HIDGamepadProvider::connectionDelayTimerFired):
1930         * platform/gamepad/mac/HIDGamepadProvider.h:
1931
1932 2016-08-16  Chris Dumez  <cdumez@apple.com>
1933
1934         querySelector() / querySelectorAll() should always throw a SyntaxError when failing to parse selector string
1935         https://bugs.webkit.org/show_bug.cgi?id=160906
1936
1937         Reviewed by Ryosuke Niwa.
1938
1939         querySelector() / querySelectorAll() should always throw a SyntaxError
1940         when failing to parse selector string:
1941         - https://dom.spec.whatwg.org/#dom-parentnode-queryselector
1942         - https://dom.spec.whatwg.org/#scope-match-a-selectors-string
1943
1944         In some cases, WebKit was throwing a NamespaceError instead.
1945
1946         No new tests, rebaselined existing tests.
1947
1948         * dom/SelectorQuery.cpp:
1949         (WebCore::SelectorQueryCache::add):
1950
1951 2016-08-16  Brent Fulgham  <bfulgham@apple.com>
1952
1953         Upgrade-Insecure-Request state is improperly retained between navigations
1954         https://bugs.webkit.org/show_bug.cgi?id=160905
1955         <rdar://problem/27075526>
1956
1957         Reviewed by Andy Estes.
1958
1959         Correct the handling of Upgrade-Insecure-Request state to match the specification, so that
1960         performing top-level navigation to sites that do not have the Upgrade-Insecure-Request header
1961         does not automatically upgrade insecure loads. The same loads performed in an iframe should
1962         be upgraded.
1963
1964         The iframe case was already handled in our tests, but a new test is added that models the top-level
1965         navigation and confirms that an upgrade is not performed.
1966
1967         Tests: http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-uir-on-navigation.html
1968
1969         * dom/Document.cpp:
1970         (WebCore::Document::initContentSecurityPolicy): Properly inherit Upgrade-Insecure-Request state for children
1971         of existing frames.
1972         * loader/DocumentWriter.cpp:
1973         (WebCore::DocumentWriter::begin): Retain the history of upgraded resources (per the specification) so that
1974         we continue to upgrade resources that were upgraded during earlier navigations. Note that we do NOT want to
1975         retain the state of the Upgrade-Insecure-Requests header itself.
1976         * page/csp/ContentSecurityPolicy.cpp:
1977         (WebCore::ContentSecurityPolicy::copyStateFrom): Update to use new helper function.
1978         (WebCore::ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom): New helper function.
1979         * page/csp/ContentSecurityPolicy.h:
1980
1981 2016-08-16  Chris Dumez  <cdumez@apple.com>
1982
1983         ctx.drawImage should clip source rect if it is outside the source image
1984         https://bugs.webkit.org/show_bug.cgi?id=160804
1985
1986         Reviewed by Simon Fraser.
1987
1988         According to the specification [1]"
1989         "When the source rectangle is outside the source image, the source rectangle
1990         must be clipped to the source image and the destination rectangle must be
1991         clipped in the same proportion."
1992
1993         Firefox and Chrome behave according to the specification. This patch aligns
1994         our behavior.
1995
1996         [1] https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-drawimage
1997
1998         Test: fast/canvas/drawImage-srcRect-clipping.html
1999
2000         * html/canvas/CanvasRenderingContext2D.cpp:
2001         (WebCore::CanvasRenderingContext2D::drawImage):
2002
2003 2016-08-16  George Ruan  <gruan@apple.com>
2004
2005         ⛱ : Implement parsing of Media Constraints for getUserMedia algorithm in Media Capture and Streaming Spec
2006         https://bugs.webkit.org/show_bug.cgi?id=160533
2007         <rdar://problem/27688483>
2008
2009         Reviewed by Chris Dumez.
2010
2011         Two getUserMedia tests have been updated to reflect changes and cover limited
2012         testing of the parsing of media constraints when given to getUserMedia().
2013         Current testing infrastructure doesn't support full testing of the parsing
2014         of media constraints. Either a mock needs to be created or the selectSettings()
2015         algorithm will need to be implemented so we can see the constraints reflected
2016         by the settings of media stream tracks. See https://bugs.webkit.org/show_bug.cgi?id=160791.
2017
2018         The specification on media constraints and how they are provided to getUserMedia() and 
2019         applyConstraints() has changed. These constraints are parsed in the bindings and are
2020         stored in a new class MediaConstraint with derived classes LongConstraint, DoubleConstraint,
2021         BooleanConstraint, and StringConstraint, each holding their respective type of constraint
2022         value.
2023
2024         * CMakeLists.txt: Add JSMediaDevicesCustom.cpp and MediaConstraints.cpp.
2025         * Modules/mediastream/CaptureDeviceManager.cpp:
2026         (CaptureDeviceManager::verifyConstraintsForMediaType): Make changes according
2027         to how format of MediaConstraint was changed.
2028         (CaptureDeviceManager::sessionSupportsConstraint): Ditto.
2029         (CaptureDeviceManager::isSupportedFrameRate): Ditto. Also for the time being
2030         support constraint validation with a static acceptable frame rate range of 0-60.
2031         See relevant https://bugs.webkit.org/show_bug.cgi?id=160794 for supporting
2032         constraint validation of frame rate dynamically.
2033         * Modules/mediastream/CaptureDeviceManager.h: Make changes according to how
2034         format of MediaConstraint was changed.
2035         * Modules/mediastream/MediaConstraintsImpl.cpp: Remove code for parsing media
2036         constraints in the legacy format with keys 'mandatory' and 'optional'. Removal
2037         of legacy code is fine since MEDIA_STREAM feature flag is not enabled for any port.
2038         (WebCore::MediaConstraintsImpl::create): Ditto
2039         (WebCore::MediaConstraintsImpl::initialize): Still used by applyConstraints().
2040         Added FIXME to remove after applyConstraints implementation is changed according
2041         to w3c spec changes.
2042         (WebCore::MediaConstraintsImpl::mandatoryConstraints): Make changes according to
2043         how media constraint data is now stored.
2044         (WebCore::MediaConstraintsImpl::advancedConstraints): Ditto.
2045         (WebCore::MediaConstraintsImpl::getMandatoryConstraints): Deleted.
2046         (WebCore::MediaConstraintsImpl::getOptionalConstraints): Deleted.
2047         (WebCore::MediaConstraintsImpl::getMandatoryConstraintValue): Deleted.
2048         (WebCore::MediaConstraintsImpl::getOptionalConstraintValue): Deleted.
2049         * Modules/mediastream/MediaConstraintsImpl.h:
2050         (WebCore::MediaConstraintsImpl::MediaConstraintsImpl): Add a constructor to allow
2051         construction of MediaConstraintsImpl object based on how the custom binding code
2052         for MediaDevices would parse the media constraints given to getUserMedia().
2053         * Modules/mediastream/MediaDevices.cpp:
2054         (WebCore::MediaDevices::getUserMedia): Make changes according to how media constraint
2055         data is now stored.
2056         * Modules/mediastream/MediaDevices.h: Ditto.
2057         * Modules/mediastream/MediaDevices.idl: Add custom binding to parse media constraints,
2058         since we do not have support for automatic binding generation of sequence of dictionaries,
2059         dictionary inheritance, dictionaries inside of dictionaries, disjunctions, or dictionaries
2060         without an interface.
2061         * Modules/mediastream/MediaStreamTrack.cpp: Add FIXME with related bug.
2062         (WebCore::MediaStreamTrack::applyConstraints): Ditto.
2063         * Modules/mediastream/UserMediaRequest.cpp: Make changes according to how media constraint
2064         data is now parsed and stored.
2065         (WebCore::UserMediaRequest::start): Ditto.
2066         (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
2067         (WebCore::UserMediaRequest::didCreateStream): Ditto.
2068         (WebCore::parseOptions): Deleted.
2069         * Modules/mediastream/UserMediaRequest.h: Ditto.
2070         * WebCore.xcodeproj/project.pbxproj:
2071         * bindings/js/JSBindingsAllInOne.cpp: Added JSMediaDevicesCustom.cpp.
2072         * bindings/js/JSMediaDevicesCustom.cpp: Added. Custom bindings to parse media constraints.
2073         (WebCore::initializeStringConstraintWithList): Initialize string constraint 'exact' or 'ideal'
2074         value according to an ArrayValue.
2075         (WebCore::createStringConstraint): Given a dictionary acting as a 'MediaTrackConstraintSet'
2076         and a string constraint key (e.g for facingMode), creates a native StringConstraint class to hold
2077         the data.
2078         (WebCore::createBooleanConstraint): Ditto but for constraints of type boolean.
2079         (WebCore::createDoubleConstraint): Ditto but for constraints of type double.
2080         (WebCore::createIntConstraint): Ditto but for constraints of type long.
2081         (WebCore::parseMediaTrackConstraintSetForKey): Parses a given dictionary acting as a
2082         'MediaTrackConstraintSet' for a constraint as the key and creates the correct native object to hold
2083         the data.
2084         (WebCore::parseAdvancedConstraints): Parses the advanced constraints.
2085         (WebCore::parseConstraints): Parses the constraints of a Dictionary acting as a
2086         'MediaTrackConstraints'.
2087         (WebCore::JSMediaDevices::getUserMedia): Parses the constraint input to getUserMedia.
2088         * platform/mediastream/MediaConstraints.cpp: Added. Add MediaConstraint classes with derived
2089         classes IntConstraint, DoubleConstraint, BooleanConstraint, and StringConstraint to act as
2090         containers for the parsed data from getUserMedia().
2091         (WebCore::MediaConstraint::create): Factory that creates the correct derived class based on the
2092         name of a media constraint.
2093         (WebCore::MediaConstraint::getMin): Interface for getting the min value for a constraint.
2094         ASSERT checks are in place to prevent calling getMin with the incorrect constraint type.
2095         (WebCore::MediaConstraint::getMax): Ditto but for max value of constraint.
2096         (WebCore::MediaConstraint::getExact): Ditto but for exact value of constraint.
2097         (WebCore::MediaConstraint::getIdeal): Ditto but for ideal value of constraint.
2098         (WebCore::IntConstraint::create): Creates a long constraint.
2099         (WebCore::IntConstraint::setMin): Sets min value of constraint.
2100         (WebCore::IntConstraint::setMax): Sets max value of constraint.
2101         (WebCore::IntConstraint::setExact): Sets exact value of constraint.
2102         (WebCore::IntConstraint::setIdeal): Sets ideal value of constraint.
2103         (WebCore::IntConstraint::getMin): Overrides interface function and gets min value of constraint.
2104         (WebCore::IntConstraint::getMax): Ditto but for max value of constraint.
2105         (WebCore::IntConstraint::getExact): Ditto but for exact value of constraint.
2106         (WebCore::IntConstraint::getIdeal): Ditto but for ideal value of constraint.
2107         (WebCore::DoubleConstraint::create): Ditto, DoubleConstraint instead of IntConstraint.
2108         (WebCore::DoubleConstraint::setMin): Ditto.
2109         (WebCore::DoubleConstraint::setMax): Ditto.
2110         (WebCore::DoubleConstraint::setExact): Ditto.
2111         (WebCore::DoubleConstraint::setIdeal): Ditto.
2112         (WebCore::DoubleConstraint::getMin): Ditto.
2113         (WebCore::DoubleConstraint::getMax): Ditto.
2114         (WebCore::DoubleConstraint::getExact): Ditto.
2115         (WebCore::DoubleConstraint::getIdeal): Ditto.
2116         (WebCore::BooleanConstraint::create): Ditto, BooleanConstraint instead of IntConstraint.
2117         (WebCore::BooleanConstraint::setExact): Ditto.
2118         (WebCore::BooleanConstraint::setIdeal): Ditto.
2119         (WebCore::BooleanConstraint::getExact): Ditto.
2120         (WebCore::BooleanConstraint::getIdeal): Ditto.
2121         (WebCore::StringConstraint::create): Ditto, StringConstraint instead of IntConstraint.
2122         (WebCore::StringConstraint::setExact): Ditto.
2123         (WebCore::StringConstraint::appendExact): Appends string to 'exact' value of StringConstraint.
2124         (WebCore::StringConstraint::setIdeal): Ditto.
2125         (WebCore::StringConstraint::appendIdeal): Appends string to 'ideal' value of StringConstraint.
2126         (WebCore::StringConstraint::getExact): Ditto.
2127         (WebCore::StringConstraint::getIdeal): Ditto.
2128         * platform/mediastream/MediaConstraints.h: Add MediaConstraint classes with derived
2129         classes IntConstraint, DoubleConstraint, BooleanConstraint, and StringConstraint to act as
2130         containers for the parsed data from getUserMedia().
2131         (WebCore::MediaConstraint::~MediaConstraint):
2132         (WebCore::MediaConstraint::name): Get name of constraint.
2133         (WebCore::MediaConstraint::MediaConstraint): Constructor.
2134         (WebCore::NumericConstraint::NumericConstraint): Base class of DoubleConstraint and IntConstraint.
2135         (WebCore::NumericConstraint::setHasMin): Sets whether object has min vlaue.
2136         (WebCore::NumericConstraint::setHasMax): Ditto but for max.
2137         (WebCore::NumericConstraint::setHasExact): Ditto but for exact.
2138         (WebCore::NumericConstraint::setHasIdeal): Ditto but for ideal.
2139         (WebCore::NumericConstraint::hasMin): Gets whether object has min value.
2140         (WebCore::NumericConstraint::hasMax): Ditto but for max.
2141         (WebCore::NumericConstraint::hasExact): Ditto but for exact.
2142         (WebCore::NumericConstraint::hasIdeal): Ditto but for ideal.
2143         * platform/mediastream/RealtimeMediaSourceCenter.h: Parameters can be reference since
2144         lifetime is guaranteed and ownership is not taken.
2145         * platform/mediastream/mac/AVCaptureDeviceManager.h: Ditto.
2146         * platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
2147         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Ditto.
2148         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Make changes according to
2149         how media constraint data is stored.
2150         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
2151         Ditto.
2152         (WebCore::AVCaptureDeviceManager::isSupportedFrameRate): Ditto.
2153         * platform/mediastream/mac/AVVideoCaptureSource.h: Change frame rate from 'float' to 'double'.
2154         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2155         (WebCore::AVVideoCaptureSource::setFrameRateConstraint): Ditto.
2156         (WebCore::AVVideoCaptureSource::applyConstraints): Make changes according to how media constraint
2157         data is stored. The implementation of applyConstraints has also drastically changed, and a FIXME
2158         is associated.
2159         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2160         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
2161         The bindings will always pass a non-null MediaConstraints object to
2162         getUserMedia() so a pointer MediaConstraints parameter is not necessary.
2163         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
2164         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Change 'override' to 'final'
2165         since RealtimeMediaSourceCenterMac is a 'final' class.
2166         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Ditto to
2167         RealtimeMediaSourceCenterMac.
2168         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
2169         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
2170         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Ditto.
2171         * platform/mock/MediaConstraintsMock.cpp: Change how constraint validation is mocked.
2172         (WebCore::isLongMediaConstraintSatisfiable): Sets arbitrary min and max supported value to be 0 and 10,
2173         respectively. Then checks if constraint is satisfiable.
2174         (WebCore::isDoubleMediaConstraintSatisfiable): Ditto but with double.
2175         (WebCore::isBooleanMediaConstraintSatisfiable): Mock a boolean constraint to only be satisfiable if the
2176         'exact' value is true.
2177         (WebCore::isStringMediaConstraintSatisfiable): Mock a string constraint to only be satisfiable if the
2178         'exact' value has the string 'valid'
2179         (WebCore::isSatisfiable): Checks if a certain constraint is satisfiable.
2180         (WebCore::MediaConstraintsMock::verifyConstraints): Verifies if the constraints are satisfiable.
2181         (WebCore::isSupported): Deleted.
2182         (WebCore::isValid): Deleted.
2183         * platform/mock/MediaConstraintsMock.h: Change argument of MediaConstraints to raw pointer.
2184         * platform/mock/MockRealtimeMediaSourceCenter.cpp: Change arguments of MediaConstraints to a raw pointer
2185         and make changes according to how the MediaConstraint was changed.
2186         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
2187         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
2188         * platform/mock/MockRealtimeMediaSourceCenter.h: Change argument of MediaConstraints to raw pointer.
2189
2190 2016-08-16  Alex Christensen  <achristensen@webkit.org>
2191
2192         Fix WinCairo build after r204512.
2193
2194         * platform/network/curl/SocketStreamHandleImpl.h:
2195         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2196         (WebCore::createCopy):
2197         (WebCore::SocketStreamHandleImpl::createCopy): Deleted.
2198
2199 2016-08-16  Alex Christensen  <achristensen@webkit.org>
2200
2201         Clean up WebSockets
2202         https://bugs.webkit.org/show_bug.cgi?id=160889
2203
2204         Reviewed by Darin Adler.
2205
2206         We should use size_t's instead of ints for data lengths.
2207         SocketStreamHandleClient is now purely virtual.
2208         A few places that will need SocketStreamHandleImpls instead of SocketStreamHandles now have them.
2209         This patch doesn't change behavior.
2210
2211         * Modules/websockets/WebSocketChannel.cpp:
2212         (WebCore::WebSocketChannel::didCloseSocketStream):
2213         (WebCore::WebSocketChannel::didReceiveSocketStreamData):
2214         * Modules/websockets/WebSocketChannel.h:
2215         * platform/network/SocketStreamHandle.cpp:
2216         (WebCore::SocketStreamHandle::state):
2217         (WebCore::SocketStreamHandle::send):
2218         * platform/network/SocketStreamHandle.h:
2219         (WebCore::SocketStreamHandle::~SocketStreamHandle):
2220         (WebCore::SocketStreamHandle::bufferedAmount):
2221         (WebCore::SocketStreamHandle::client): Deleted.
2222         * platform/network/SocketStreamHandleClient.h:
2223         (WebCore::SocketStreamHandleClient::~SocketStreamHandleClient):
2224         (WebCore::SocketStreamHandleClient::didOpenSocketStream): Deleted.
2225         (WebCore::SocketStreamHandleClient::didCloseSocketStream): Deleted.
2226         (WebCore::SocketStreamHandleClient::didReceiveSocketStreamData): Deleted.
2227         (WebCore::SocketStreamHandleClient::didUpdateBufferedAmount): Deleted.
2228         (WebCore::SocketStreamHandleClient::didFailSocketStream): Deleted.
2229         * platform/network/cf/SocketStreamHandleImpl.h:
2230         (WebCore::SocketStreamHandleImpl::create):
2231         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2232         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
2233         (WebCore::SocketStreamHandleImpl::platformSend):
2234         (WebCore::SocketStreamHandleImpl::platformClose):
2235         * platform/network/curl/SocketStreamHandleImpl.h:
2236         (WebCore::SocketStreamHandleImpl::create):
2237         * platform/network/soup/SocketStreamHandleImpl.h:
2238         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2239         (WebCore::SocketStreamHandleImpl::create):
2240
2241 2016-08-16  Chris Dumez  <cdumez@apple.com>
2242
2243         Unreviewed, rolling out r204506.
2244
2245         Broke the build
2246
2247         Reverted changeset:
2248
2249         "Cleanup WK2 platform gamepad handling."
2250         https://bugs.webkit.org/show_bug.cgi?id=160871
2251         http://trac.webkit.org/changeset/204506
2252
2253 2016-08-16  Darin Adler  <darin@apple.com>
2254
2255         [Cocoa] Remove dependency on Objective-C bindings in WebKit2 editing code
2256         https://bugs.webkit.org/show_bug.cgi?id=160891
2257
2258         Reviewed by Anders Carlsson.
2259
2260         * WebCore.xcodeproj/project.pbxproj: Removed EditorCocoa.h.
2261
2262         * editing/Editor.cpp: Removed member initialization for members now
2263         initialized in the class definition.
2264
2265         * editing/Editor.h: Added FragmentAndResources struct, createFragment
2266         member function, and _WebCreateFragment function. Also initialize all the
2267         scalar data members here instead of in the constructor.
2268
2269         * editing/cocoa/EditorCocoa.h: Removed. This was unused.
2270
2271         * editing/cocoa/EditorCocoa.mm:
2272         (WebCore::Editor::createFragment): Added. Calls through to WebKitLegacy
2273         using soft linking for now, but later should be implemented here in WebCore.
2274
2275         * editing/ios/EditorIOS.mm:
2276         (WebCore::Editor::createFragmentAndAddResources): Call createFragment.
2277
2278         * editing/mac/EditorMac.mm:
2279         (WebCore::Editor::createFragmentAndAddResources): Call createFragment.
2280
2281         * loader/EmptyClients.h: Removed documentFragmentFromAttributedString
2282         implementation.
2283
2284         * page/EditorClient.h: Removed documentFragmentFromAttributedString.
2285         Two reasons: The first is that this is now implemented in WebCore. While
2286         there is a call through to WebKitLegacy, it's a temporary thing and done
2287         with soft linking. The second reason is that this returned a raw pointer,
2288         which is not safe in general. Was safe here because it was returning a
2289         pointer owned by an autoreleased Objective-C object.
2290
2291 2016-08-16  Brady Eidson  <beidson@apple.com>
2292
2293         Cleanup WK2 platform gamepad handling.
2294         https://bugs.webkit.org/show_bug.cgi?id=160871
2295
2296         Reviewed by Alex Christensen.
2297
2298         No new tests (No currently testable change in behavior).
2299
2300         This patch does a few things:
2301         1 - Separates the concepts of "monitoring gamepads" and "monitoring gamepad inputs"
2302         2 - Uses this new concept to much more cleanly handle the case where we are not currently
2303             monitoring gamepad inputs because an interested WKWebView is not front and center.
2304         3 - Pre-populates the "initial set of gamepads" in WebProcesses that start listening for gamepads.
2305
2306         * platform/gamepad/GamepadProviderClient.h:
2307         (WebCore::GamepadProviderClient::setInitialConnectedGamepads):
2308
2309         * platform/gamepad/mac/HIDGamepadProvider.cpp:
2310         (WebCore::HIDGamepadProvider::HIDGamepadProvider):
2311         (WebCore::HIDGamepadProvider::stopMonitoringInput):
2312         (WebCore::HIDGamepadProvider::startMonitoringInput):
2313         (WebCore::HIDGamepadProvider::connectionDelayTimerFired):
2314         * platform/gamepad/mac/HIDGamepadProvider.h:
2315
2316 2016-08-16  Commit Queue  <commit-queue@webkit.org>
2317
2318         Unreviewed, rolling out r204494.
2319         https://bugs.webkit.org/show_bug.cgi?id=160901
2320
2321         Broke the iOS build (Requested by cdumez on #webkit).
2322
2323         Reverted changeset:
2324
2325         "Drop unused EventTarget::hasActiveEventListeners()"
2326         https://bugs.webkit.org/show_bug.cgi?id=160869
2327         http://trac.webkit.org/changeset/204494
2328
2329 2016-08-16  Darin Adler  <darin@apple.com>
2330
2331         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2332         Regenerated results, which were affected by the sequence<T> change last night.
2333
2334 2016-08-16  Per Arne Vollan  <pvollan@apple.com>
2335
2336         [Win] Hardening of getLinkedFonts function.
2337         https://bugs.webkit.org/show_bug.cgi?id=160850
2338
2339         The SUCCEEDED macro should only be used for functions returning a HRESULT type.
2340         Also, make sure a string array index will not exceed the string length.
2341
2342         * platform/graphics/win/FontCacheWin.cpp:
2343         (WebCore::getLinkedFonts):
2344
2345 2016-08-16  Alex Christensen  <achristensen@webkit.org>
2346
2347         Simplify SocketStreamError
2348         https://bugs.webkit.org/show_bug.cgi?id=160888
2349
2350         Reviewed by Darin Adler.
2351
2352         SocketStreamErrorBase and platform-specific SocketStreamError were overly complicated.
2353         They had many functions that were never used.  There's no reason to have two separate classes.
2354
2355         * WebCore.xcodeproj/project.pbxproj:
2356         * platform/network/SocketStreamError.h: Copied from Source/WebCore/platform/network/SocketStreamErrorBase.h.
2357         (WebCore::SocketStreamError::SocketStreamError):
2358         (WebCore::SocketStreamError::isNull):
2359         (WebCore::SocketStreamError::errorCode):
2360         (WebCore::SocketStreamError::failingURL):
2361         (WebCore::SocketStreamError::localizedDescription):
2362         (WebCore::SocketStreamErrorBase::isNull): Deleted.
2363         (WebCore::SocketStreamErrorBase::errorCode): Deleted.
2364         (WebCore::SocketStreamErrorBase::failingURL): Deleted.
2365         (WebCore::SocketStreamErrorBase::localizedDescription): Deleted.
2366         (WebCore::SocketStreamErrorBase::SocketStreamErrorBase): Deleted.
2367         (WebCore::operator==): Deleted.
2368         (WebCore::operator!=): Deleted.
2369         * platform/network/SocketStreamErrorBase.cpp: Removed.
2370         * platform/network/SocketStreamErrorBase.h: Removed.
2371         * platform/network/cf/SocketStreamError.h: Removed.
2372         * platform/network/curl/SocketStreamError.h: Removed.
2373         * platform/network/soup/SocketStreamError.h: Removed.
2374
2375 2016-08-15  Ryosuke Niwa  <rniwa@webkit.org>
2376
2377         Conversion to sequence<T> is broken for iterable objects
2378         https://bugs.webkit.org/show_bug.cgi?id=160801
2379
2380         Reviewed by Darin Adler.
2381
2382         Added the proper iterator support for sequence<T> with one caveat that we don't check for RegExp object
2383         per https://github.com/heycam/webidl/issues/145.
2384
2385         See http://heycam.github.io/webidl/#es-sequence and http://heycam.github.io/webidl/#es-overloads
2386
2387         Tests: bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl
2388
2389         * bindings/js/JSDOMBinding.cpp:
2390         (WebCore::hasIteratorMethod): Added. A helper function for checking whether a JSValue is iterable or not.
2391         * bindings/js/JSDOMBinding.h:
2392         (WebCore::NativeValueTraits<unsigned>::nativeValue): Removed the check for isNumber to match the spec'ed
2393         behavior at http://heycam.github.io/webidl/#es-unsigned-long which calls ToNumber first without checking
2394         whether the value is a number or not.
2395         (WebCore::toRefPtrNativeArray): Replaced isJSArray check by isObject check and throw a TypeError. Deployed
2396         forEachInIterable to support non-JSArray iterable objects. Also removed the function pointer from the third
2397         argument since we were always calling JSCT::toWrapped.
2398         (WebCore::toNativeArray): Ditto.
2399         * bindings/js/JSDOMConvert.h:
2400         (WebCore::Converter<Vector<T>>::convert): Removed the comment about toNativeArray not throwing when value
2401         is not an object.
2402         * bindings/scripts/CodeGeneratorJS.pm:
2403         (GenerateOverloadedFunctionOrConstructor): Removed the check for isJSArray for sequence<T> as an iterable
2404         object is not necessary a JSArray.
2405         (WillConvertUndefinedToDefaultParameterValue): Don't return 1 for all sequences since toNativeArray and
2406         toRefPtrNativeArray now throws on undefined due to isObject check.
2407         (JSValueToNative): Removed the third argument from toRefPtrNativeArray.
2408
2409         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.cpp: Added.
2410         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequence.h: Added.
2411         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsWithSequencePrivate.h: Added.
2412         * bindings/scripts/test/JS/JSTestObj.cpp:
2413         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
2414         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: Added.
2415         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h: Added.
2416         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2417         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
2418         * bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl: Added.
2419
2420 2016-08-15  Chris Dumez  <cdumez@apple.com>
2421
2422         Rename RegisteredEventListener::listener() to callback() for clarity
2423         https://bugs.webkit.org/show_bug.cgi?id=160873
2424
2425         Reviewed by Darin Adler.
2426
2427         Rename RegisteredEventListener::listener() to callback() for clarity
2428         and to match the specification:
2429         - https://dom.spec.whatwg.org/#concept-event-listener
2430
2431         Always calling listener->listener() seems wrong.
2432
2433         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2434         (WebCore::getJSListenerFunctions):
2435         * dom/EventListenerMap.cpp:
2436         (WebCore::findListener):
2437         (WebCore::removeFirstListenerCreatedFromMarkup):
2438         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
2439         (WebCore::EventListenerIterator::nextListener):
2440         * dom/EventTarget.cpp:
2441         (WebCore::EventTarget::getAttributeEventListener):
2442         (WebCore::EventTarget::fireEventListeners):
2443         * dom/RegisteredEventListener.h:
2444         (WebCore::RegisteredEventListener::callback):
2445         (WebCore::RegisteredEventListener::RegisteredEventListener):
2446         (WebCore::RegisteredEventListener::listener): Deleted.
2447         * inspector/InspectorDOMAgent.cpp:
2448         (WebCore::InspectorDOMAgent::getEventListeners):
2449         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2450
2451 2016-08-15  Chris Dumez  <cdumez@apple.com>
2452
2453         Add support for dictionary members of non nullable wrapper types
2454         https://bugs.webkit.org/show_bug.cgi?id=160876
2455
2456         Reviewed by Darin Adler.
2457
2458         Add support for dictionary members of non nullable wrapper types. We
2459         only supported nullable wrapper types as dictionary members so far.
2460
2461         No new tests, updated bindings tests.
2462
2463         * bindings/js/JSDOMConvert.h:
2464         * bindings/scripts/CodeGeneratorJS.pm:
2465         (GenerateDictionaryImplementationContent):
2466         (GenerateParametersCheck):
2467         (JSValueToNative):
2468         (GenerateConstructorDefinition):
2469         * bindings/scripts/test/JS/JSTestInterface.cpp:
2470         (WebCore::JSTestInterfaceConstructor::construct):
2471         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2472         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
2473         * bindings/scripts/test/JS/JSTestObj.cpp:
2474         (WebCore::convertDictionary<TestObj::Dictionary>):
2475         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2476         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
2477         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
2478         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2479         (WebCore::constructJSTestOverloadedConstructors4):
2480         (WebCore::constructJSTestOverloadedConstructors5):
2481         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2482         (WebCore::JSTestTypedefsConstructor::construct):
2483         * bindings/scripts/test/TestObj.idl:
2484
2485 2016-08-15  Chris Dumez  <cdumez@apple.com>
2486
2487         Drop unused EventTarget::hasActiveEventListeners()
2488         https://bugs.webkit.org/show_bug.cgi?id=160869
2489
2490         Reviewed by Alex Christensen.
2491
2492         * dom/EventListenerMap.cpp:
2493         (WebCore::EventListenerMap::containsActive): Deleted.
2494         * dom/EventListenerMap.h:
2495         * dom/EventTarget.cpp:
2496         (WebCore::EventTarget::hasActiveEventListeners): Deleted.
2497         * dom/EventTarget.h:
2498
2499 2016-08-15  Sam Weinig  <sam@webkit.org>
2500
2501         Speed up compile times by not including wtf/Variant.h so much
2502         https://bugs.webkit.org/show_bug.cgi?id=160847
2503
2504         Reviewed by Alex Christensen and Saam Barati.
2505
2506         "using std::experimental::variant" caused internal compiler errors in MSVC2015, 
2507         so we are just writing std::experimental where we use it for now.
2508         We should move variant into the std::experimental namespace.
2509
2510         * bindings/js/JSNodeOrString.cpp:
2511         (WebCore::toNodeOrStringVector):
2512         * bindings/js/JSNodeOrString.h:
2513         * dom/ContainerNode.cpp:
2514         (WebCore::ContainerNode::childElementCount):
2515         (WebCore::ContainerNode::append):
2516         (WebCore::ContainerNode::prepend):
2517         * dom/ContainerNode.h:
2518         * dom/Node.cpp:
2519         (WebCore::Node::appendChild):
2520         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
2521         (WebCore::firstFollowingSiblingNotInNodeSet):
2522         (WebCore::Node::convertNodesOrStringsIntoNode):
2523         (WebCore::Node::before):
2524         (WebCore::Node::after):
2525         (WebCore::Node::replaceWith):
2526         * dom/Node.h:
2527         (WebCore::Node::setStyleChange):
2528         (WebCore::Node::customPseudoId):
2529
2530 2016-08-15  Daniel Bates  <dabates@apple.com>
2531
2532         ASSERTION FAILURE: [[videoLayer delegate] isKindOfClass:getUIViewClass()] in WebAVPlayerLayerView_videoView()
2533         https://bugs.webkit.org/show_bug.cgi?id=160433
2534
2535         Reviewed by Eric Carlson.
2536
2537         Early return from WebAVPlayerLayerView_videoView() if the PiP layer does not have a non-nil delegate view.
2538
2539         Test: media/controls/close-page-with-picture-in-picture-video-assertion-failure.html
2540
2541         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2542         (WebAVPlayerLayerView_videoView):
2543
2544 2016-08-15  Alex Christensen  <achristensen@webkit.org>
2545
2546         Rename SocketStreamHandleBase to SocketStreamHandle and SocketStreamHandle to SocketStreamHandleImpl
2547         https://bugs.webkit.org/show_bug.cgi?id=160858
2548
2549         Reviewed by Brady Eidson.
2550
2551         No new tests.  No change in behavior, except GTK's SocketStreamHandleImpl is now safely ThreadSafeRefCounted.
2552         This is preparation for making a new kind of SocketStreamHandle which is a proxy that communicates with the NetworkProcess in WebKit2.
2553
2554         * CMakeLists.txt:
2555         * PlatformAppleWin.cmake:
2556         * PlatformEfl.cmake:
2557         * PlatformGTK.cmake:
2558         * PlatformMac.cmake:
2559         * PlatformWinCairo.cmake:
2560         * WebCore.xcodeproj/project.pbxproj:
2561         * page/SocketProvider.cpp:
2562         (WebCore::SocketProvider::createSocketStreamHandle):
2563         * platform/network/SocketStreamHandle.cpp: Copied from Source/WebCore/platform/network/SocketStreamHandleBase.cpp.
2564         (WebCore::SocketStreamHandle::SocketStreamHandle):
2565         (WebCore::SocketStreamHandle::state):
2566         (WebCore::SocketStreamHandle::send):
2567         (WebCore::SocketStreamHandle::close):
2568         (WebCore::SocketStreamHandle::disconnect):
2569         (WebCore::SocketStreamHandle::sendPendingData):
2570         (WebCore::SocketStreamHandleBase::SocketStreamHandleBase): Deleted.
2571         (WebCore::SocketStreamHandleBase::state): Deleted.
2572         (WebCore::SocketStreamHandleBase::send): Deleted.
2573         (WebCore::SocketStreamHandleBase::close): Deleted.
2574         (WebCore::SocketStreamHandleBase::disconnect): Deleted.
2575         (WebCore::SocketStreamHandleBase::sendPendingData): Deleted.
2576         * platform/network/SocketStreamHandle.h: Copied from Source/WebCore/platform/network/SocketStreamHandleBase.h.
2577         (WebCore::SocketStreamHandle::~SocketStreamHandle):
2578         (WebCore::SocketStreamHandle::client):
2579         (WebCore::SocketStreamHandleBase::~SocketStreamHandleBase): Deleted.
2580         (WebCore::SocketStreamHandleBase::client): Deleted.
2581         * platform/network/SocketStreamHandleBase.cpp: Removed.
2582         * platform/network/SocketStreamHandleBase.h: Removed.
2583         * platform/network/cf/SocketStreamHandle.h: Removed.
2584         * platform/network/cf/SocketStreamHandleCFNet.cpp: Removed.
2585         * platform/network/cf/SocketStreamHandleImpl.h: Copied from Source/WebCore/platform/network/cf/SocketStreamHandle.h.
2586         (WebCore::SocketStreamHandleImpl::create):
2587         (WebCore::SocketStreamHandle::create): Deleted.
2588         * platform/network/cf/SocketStreamHandleImplCFNet.cpp: Copied from Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp.
2589         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
2590         (WebCore::SocketStreamHandleImpl::scheduleStreams):
2591         (WebCore::SocketStreamHandleImpl::retainSocketStreamHandle):
2592         (WebCore::SocketStreamHandleImpl::releaseSocketStreamHandle):
2593         (WebCore::SocketStreamHandleImpl::copyPACExecutionDescription):
2594         (WebCore::SocketStreamHandleImpl::pacExecutionCallback):
2595         (WebCore::SocketStreamHandleImpl::executePACFileURL):
2596         (WebCore::SocketStreamHandleImpl::removePACRunLoopSource):
2597         (WebCore::SocketStreamHandleImpl::chooseProxy):
2598         (WebCore::SocketStreamHandleImpl::chooseProxyFromArray):
2599         (WebCore::SocketStreamHandleImpl::createStreams):
2600         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
2601         (WebCore::authenticationSchemeFromAuthenticationMethod):
2602         (WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
2603         (WebCore::SocketStreamHandleImpl::copyCFStreamDescription):
2604         (WebCore::SocketStreamHandleImpl::readStreamCallback):
2605         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
2606         (WebCore::SocketStreamHandleImpl::reportErrorToClient):
2607         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
2608         (WebCore::SocketStreamHandleImpl::platformSend):
2609         (WebCore::SocketStreamHandleImpl::platformClose):
2610         (WebCore::SocketStreamHandleImpl::port):
2611         (WebCore::SocketStreamHandle::SocketStreamHandle): Deleted.
2612         (WebCore::SocketStreamHandle::scheduleStreams): Deleted.
2613         (WebCore::SocketStreamHandle::retainSocketStreamHandle): Deleted.
2614         (WebCore::SocketStreamHandle::releaseSocketStreamHandle): Deleted.
2615         (WebCore::SocketStreamHandle::copyPACExecutionDescription): Deleted.
2616         (WebCore::SocketStreamHandle::pacExecutionCallback): Deleted.
2617         (WebCore::SocketStreamHandle::executePACFileURL): Deleted.
2618         (WebCore::SocketStreamHandle::removePACRunLoopSource): Deleted.
2619         (WebCore::SocketStreamHandle::chooseProxy): Deleted.
2620         (WebCore::SocketStreamHandle::chooseProxyFromArray): Deleted.
2621         (WebCore::SocketStreamHandle::createStreams): Deleted.
2622         (WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials): Deleted.
2623         (WebCore::SocketStreamHandle::addCONNECTCredentials): Deleted.
2624         (WebCore::SocketStreamHandle::copyCFStreamDescription): Deleted.
2625         (WebCore::SocketStreamHandle::readStreamCallback): Deleted.
2626         (WebCore::SocketStreamHandle::writeStreamCallback): Deleted.
2627         (WebCore::SocketStreamHandle::reportErrorToClient): Deleted.
2628         (WebCore::SocketStreamHandle::~SocketStreamHandle): Deleted.
2629         (WebCore::SocketStreamHandle::platformSend): Deleted.
2630         (WebCore::SocketStreamHandle::platformClose): Deleted.
2631         (WebCore::SocketStreamHandle::port): Deleted.
2632         * platform/network/curl/SocketStreamHandle.h: Removed.
2633         * platform/network/curl/SocketStreamHandleCurl.cpp: Removed.
2634         * platform/network/curl/SocketStreamHandleImpl.h: Copied from Source/WebCore/platform/network/curl/SocketStreamHandle.h.
2635         (WebCore::SocketStreamHandleImpl::create):
2636         (WebCore::SocketStreamHandle::create): Deleted.
2637         * platform/network/curl/SocketStreamHandleImplCurl.cpp: Copied from Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp.
2638         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
2639         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
2640         (WebCore::SocketStreamHandleImpl::platformSend):
2641         (WebCore::SocketStreamHandleImpl::platformClose):
2642         (WebCore::SocketStreamHandleImpl::readData):
2643         (WebCore::SocketStreamHandleImpl::sendData):
2644         (WebCore::SocketStreamHandleImpl::waitForAvailableData):
2645         (WebCore::SocketStreamHandleImpl::startThread):
2646         (WebCore::SocketStreamHandleImpl::stopThread):
2647         (WebCore::SocketStreamHandleImpl::didReceiveData):
2648         (WebCore::SocketStreamHandleImpl::didOpenSocket):
2649         (WebCore::SocketStreamHandleImpl::createCopy):
2650         (WebCore::SocketStreamHandle::SocketStreamHandle): Deleted.
2651         (WebCore::SocketStreamHandle::~SocketStreamHandle): Deleted.
2652         (WebCore::SocketStreamHandle::platformSend): Deleted.
2653         (WebCore::SocketStreamHandle::platformClose): Deleted.
2654         (WebCore::SocketStreamHandle::readData): Deleted.
2655         (WebCore::SocketStreamHandle::sendData): Deleted.
2656         (WebCore::SocketStreamHandle::waitForAvailableData): Deleted.
2657         (WebCore::SocketStreamHandle::startThread): Deleted.
2658         (WebCore::SocketStreamHandle::stopThread): Deleted.
2659         (WebCore::SocketStreamHandle::didReceiveData): Deleted.
2660         (WebCore::SocketStreamHandle::didOpenSocket): Deleted.
2661         (WebCore::SocketStreamHandle::createCopy): Deleted.
2662         * platform/network/soup/SocketStreamHandle.h: Removed.
2663         * platform/network/soup/SocketStreamHandleImpl.h: Copied from Source/WebCore/platform/network/soup/SocketStreamHandle.h.
2664         * platform/network/soup/SocketStreamHandleImplSoup.cpp: Copied from Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp.
2665         (WebCore::SocketStreamHandleImpl::create):
2666         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
2667         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
2668         (WebCore::SocketStreamHandleImpl::connected):
2669         (WebCore::SocketStreamHandleImpl::connectedCallback):
2670         (WebCore::SocketStreamHandleImpl::readBytes):
2671         (WebCore::SocketStreamHandleImpl::readReadyCallback):
2672         (WebCore::SocketStreamHandleImpl::didFail):
2673         (WebCore::SocketStreamHandleImpl::writeReady):
2674         (WebCore::SocketStreamHandleImpl::platformSend):
2675         (WebCore::SocketStreamHandleImpl::platformClose):
2676         (WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
2677         (WebCore::SocketStreamHandleImpl::stopWaitingForSocketWritability):
2678         (WebCore::SocketStreamHandleImpl::writeReadyCallback):
2679         (WebCore::SocketStreamHandle::create): Deleted.
2680         (WebCore::SocketStreamHandle::SocketStreamHandle): Deleted.
2681         (WebCore::SocketStreamHandle::~SocketStreamHandle): Deleted.
2682         (WebCore::SocketStreamHandle::connected): Deleted.
2683         (WebCore::SocketStreamHandle::connectedCallback): Deleted.
2684         (WebCore::SocketStreamHandle::readBytes): Deleted.
2685         (WebCore::SocketStreamHandle::readReadyCallback): Deleted.
2686         (WebCore::SocketStreamHandle::didFail): Deleted.
2687         (WebCore::SocketStreamHandle::writeReady): Deleted.
2688         (WebCore::SocketStreamHandle::platformSend): Deleted.
2689         (WebCore::SocketStreamHandle::platformClose): Deleted.
2690         (WebCore::SocketStreamHandle::beginWaitingForSocketWritability): Deleted.
2691         (WebCore::SocketStreamHandle::stopWaitingForSocketWritability): Deleted.
2692         (WebCore::SocketStreamHandle::writeReadyCallback): Deleted.
2693         * platform/network/soup/SocketStreamHandleSoup.cpp: Removed.
2694
2695 2016-08-15  Jiewen Tan  <jiewen_tan@apple.com>
2696
2697         Expose crypto.getRandomValues to Web Workers
2698         https://bugs.webkit.org/show_bug.cgi?id=104851
2699         <rdar://problem/27285714>
2700
2701         Reviewed by Darin Adler.
2702
2703         Tests: crypto/webkitSubtle/disallowed-in-worker.html
2704                crypto/workers/crypto-gc-worker.html
2705                crypto/workers/crypto-random-values-limits-worker.html
2706                crypto/workers/crypto-random-values-types-worker.html
2707                crypto/workers/crypto-random-values-worker.html
2708
2709         Expose both crypto and crypto.getRandomValues to Web Workers. However, webkitSubtle is
2710         disabled in Web Workers. This change also refactors a bit on IDLs related to Crypto
2711         interface.
2712
2713         * CMakeLists.txt:
2714         * DerivedSources.cpp:
2715         * DerivedSources.make:
2716         * WebCore.xcodeproj/project.pbxproj:
2717         Introduce GlobalCrypto Interface which is used to repalace the partial IDL in both
2718         DOMWindow and WorkerGlobalScope with sub-implememtations.
2719         * bindings/js/JSDocumentCustom.cpp:
2720         (WebCore::JSDocument::visitAdditionalChildren):
2721         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2722         (WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
2723         * bindings/scripts/CodeGeneratorJS.pm:
2724         (GenerateImplementation):
2725         * bindings/scripts/IDLAttributes.txt:
2726         * dom/Document.idl:
2727         Add support of GenerateIsReachable=ImplScriptExecutionContext, which allow registered
2728         JS Objects to live as long as ScriptExecutionContext lives, i.e. Document and
2729         WorkerGlobalScope.
2730         * page/Crypto.cpp:
2731         (WebCore::Crypto::Crypto):
2732         (WebCore::Crypto::webkitSubtle):
2733         (WebCore::Crypto::document): Deleted.
2734         * page/Crypto.h:
2735         (WebCore::Crypto::create):
2736         * page/Crypto.idl:
2737         Change the opaque root of Crypto to ScriptExecutionContext such that it perserves
2738         the same live time in both Window and Web Worker. And disable WebKitSubtle in Web
2739         Workers.
2740         * page/DOMWindow.idl:
2741         * page/GlobalCrypto.idl: Added.
2742         Replace partial IDL to sub-implementation of crypto attribute.
2743         * workers/WorkerGlobalScope.cpp:
2744         (WebCore::WorkerGlobalScope::crypto):
2745         * workers/WorkerGlobalScope.h:
2746         * workers/WorkerGlobalScope.idl:
2747         Introduce crypto attribute to Web Workers.
2748
2749 2016-08-15  Joseph Pecoraro  <pecoraro@apple.com>
2750
2751         Use #pragma once in inspector headers
2752         https://bugs.webkit.org/show_bug.cgi?id=160861
2753
2754         Reviewed by Mark Lam.
2755
2756         * inspector/*.h:
2757
2758 2016-08-15  Keith Rollin  <krollin@apple.com>
2759
2760         Rename LOG_ALWAYS
2761         https://bugs.webkit.org/show_bug.cgi?id=160768
2762
2763         Rename LOG_ALWAYS and friends, given that the first parameter to it is
2764         a boolean expression that determines whether or not logging should be
2765         performed.
2766
2767         Reviewed by Chris Dumez.
2768
2769         No new tests. No new functionality is added. Only some macro names
2770         have been changed.
2771
2772         * loader/FrameLoader.cpp:
2773         (WebCore::FrameLoader::prepareForLoadStart):
2774         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2775         * platform/MemoryPressureHandler.cpp:
2776         (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
2777         * platform/graphics/cocoa/IOSurface.mm:
2778         (WebCore::IOSurface::IOSurface):
2779
2780 2016-08-15  Daniel Bates  <dabates@apple.com>
2781
2782         Cannot build WebKit for iOS device using Xcode 7.3/iOS 9.3 public SDK due to missing
2783         private frameworks and libraries
2784         https://bugs.webkit.org/show_bug.cgi?id=155931
2785         <rdar://problem/25807989>
2786
2787         Reviewed by Dan Bernstein.
2788
2789         Add directory WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/X to the framework search path
2790         where X is the major version of the active iOS SDK.
2791
2792         * Configurations/WebCore.xcconfig:
2793
2794 2016-08-15  Simon Fraser  <simon.fraser@apple.com>
2795
2796         Add a setting and preferences to enable visual viewport mode
2797         https://bugs.webkit.org/show_bug.cgi?id=160843
2798
2799         Reviewed by Sam Weinig.
2800
2801         Add a visualViewportEnabled setting, in the start of a group at the bottom
2802         of the file which is intended as the future home for all runtime-enabled
2803         settings.
2804
2805         * page/Settings.in:
2806
2807 2016-08-15  Alex Christensen  <achristensen@webkit.org>
2808
2809         Fix WinCairo build after r204466.
2810
2811         * platform/network/curl/SocketStreamHandleCurl.cpp:
2812
2813 2016-08-15  Alex Christensen  <achristensen@webkit.org>
2814
2815         Fix GTK build after r204466.
2816
2817         * platform/gtk/DataObjectGtk.h:
2818
2819 2016-08-15  Joseph Pecoraro  <pecoraro@apple.com>
2820
2821         Remove unused includes of wtf headers
2822         https://bugs.webkit.org/show_bug.cgi?id=160839
2823
2824         Reviewed by Alex Christensen.
2825
2826         * Lots of files.
2827
2828 2016-08-15  Alex Christensen  <achristensen@webkit.org>
2829
2830         Remove unused WebSocketChannel::willOpenSocketStream
2831         https://bugs.webkit.org/show_bug.cgi?id=160851
2832
2833         Reviewed by Daniel Bates.
2834
2835         * Modules/websockets/WebSocketChannel.cpp:
2836         (WebCore::WebSocketChannel::willOpenSocketStream): Deleted.
2837         * Modules/websockets/WebSocketChannel.h:
2838         * platform/network/SocketStreamHandleClient.h:
2839         (WebCore::SocketStreamHandleClient::willOpenSocketStream): Deleted.
2840
2841 2016-08-12  Anders Carlsson  <andersca@apple.com>
2842
2843         Move the plug-in and WebGL blacklist code to WebCore
2844         https://bugs.webkit.org/show_bug.cgi?id=160831
2845
2846         Reviewed by Sam Weinig.
2847
2848         * WebCore.xcodeproj/project.pbxproj:
2849         * platform/mac/BlacklistUpdater.h: Added.
2850         (WebCore::BlacklistUpdater::queue):
2851         (WebCore::BlacklistUpdater::pluginBlacklist):
2852         (WebCore::BlacklistUpdater::webGLBlacklist):
2853         * platform/mac/BlacklistUpdater.mm: Added.
2854         (WebCore::BlacklistUpdater::readBlacklistData):
2855         (WebCore::BlacklistUpdater::reloadIfNecessary):
2856         (WebCore::BlacklistUpdater::initializeQueue):
2857         * platform/mac/PluginBlacklist.h: Added.
2858         * platform/mac/PluginBlacklist.mm: Added.
2859         (WebCore::PluginBlacklist::loadPolicyForPluginVersion):
2860         (WebCore::PluginBlacklist::isPluginUpdateAvailable):
2861         (WebCore::PluginBlacklist::create):
2862         (WebCore::PluginBlacklist::~PluginBlacklist):
2863         (WebCore::PluginBlacklist::splitOSVersion):
2864         (WebCore::PluginBlacklist::loadPolicyForPlugin):
2865         (WebCore::PluginBlacklist::isUpdateAvailable):
2866         (WebCore::PluginBlacklist::PluginBlacklist):
2867         * platform/mac/WebGLBlacklist.h: Added.
2868         * platform/mac/WebGLBlacklist.mm: Added.
2869         (WebCore::OSBuildInfo::OSBuildInfo):
2870         (WebCore::OSBuildInfo::operator==):
2871         (WebCore::OSBuildInfo::operator>):
2872         (WebCore::OSBuildInfo::operator<=):
2873         (WebCore::OSBuildInfo::operator<):
2874         (WebCore::buildInfoFromOSBuildString):
2875         (WebCore::WebGLBlacklist::shouldBlockWebGL):
2876         (WebCore::WebGLBlacklist::shouldSuggestBlockingWebGL):
2877         (WebCore::matchesGPU):
2878         (WebCore::gpuMaskFromString):
2879         (WebCore::matchesBuildInfo):
2880         (WebCore::WebGLBlacklist::create):
2881         (WebCore::WebGLBlacklist::shouldBlock):
2882         (WebCore::WebGLBlacklist::shouldSuggestBlocking):
2883         (WebCore::WebGLBlacklist::WebGLBlacklist):
2884         (WebCore::WebGLBlacklist::~WebGLBlacklist):
2885         * platform/spi/cf/CFUtilitiesSPI.h: Added.
2886
2887 2016-08-14  Chris Dumez  <cdumez@apple.com>
2888
2889         Align the event listener firing code with the latest DOM Specification and simplify it
2890         https://bugs.webkit.org/show_bug.cgi?id=160828
2891
2892         Reviewed by Darin Adler.
2893
2894         Align the event listener firing code with the latest DOM specification:
2895         - https://dom.spec.whatwg.org/#concept-event-listener-invoke
2896         - https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke
2897         - https://dom.spec.whatwg.org/#concept-event-listener
2898
2899         The following changes were made:
2900         1. RegisteredEventListener (equivalent to "event listener" in the spec)
2901            is now RefCounted
2902         2. RegisteredEventListener now has a wasRemoved flag as in specification.
2903         3. fireEventListeners() is now iterating over a copy of the event
2904            listeners, as in the specification. We rely on the wasRemoved removed
2905            flag to avoid executing event listeners that were removed while we
2906            iterate.
2907
2908         Previously, the code was modifying the event listeners vector we were
2909         iterating on. Doing so safely lead to complicated and error prone code.
2910         The new code is much simpler and easier to reason about.
2911
2912         This change seems to be perf-neutral on Speedometer.
2913
2914         No new tests, no web-exposed behavior change.
2915
2916         * CMakeLists.txt:
2917         * WebCore.xcodeproj/project.pbxproj:
2918         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2919         (WebCore::getJSListenerFunctions):
2920         * dom/DOMAllInOne.cpp:
2921         * dom/EventListenerMap.cpp:
2922         (WebCore::EventListenerMap::assertNoActiveIterators):
2923         (WebCore::EventListenerMap::containsCapturing):
2924         (WebCore::EventListenerMap::containsActive):
2925         (WebCore::findListener):
2926         (WebCore::EventListenerMap::add):
2927         (WebCore::removeListenerFromVector):
2928         (WebCore::EventListenerMap::remove):
2929         (WebCore::EventListenerMap::find):
2930         (WebCore::removeFirstListenerCreatedFromMarkup):
2931         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
2932         (WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
2933         (WebCore::EventListenerIterator::nextListener):
2934         (WebCore::EventListenerMap::clear): Deleted.
2935         * dom/EventListenerMap.h:
2936         (WebCore::EventListenerMap::contains):
2937         (WebCore::EventListenerMap::assertNoActiveIterators):
2938         * dom/EventTarget.cpp:
2939         (WebCore::EventTarget::removeEventListener):
2940         (WebCore::EventTarget::getAttributeEventListener):
2941         (WebCore::FiringEventListenersScope::FiringEventListenersScope):
2942         (WebCore::FiringEventListenersScope::~FiringEventListenersScope):
2943         (WebCore::EventTarget::fireEventListeners):
2944         (WebCore::EventTarget::setAttributeEventListener): Deleted.
2945         (WebCore::EventTarget::hasActiveEventListeners): Deleted.
2946         (WebCore::EventTarget::dispatchEventForBindings): Deleted.
2947         (WebCore::EventTarget::getEventListeners): Deleted.
2948         * dom/EventTarget.h:
2949         (WebCore::EventTarget::isFiringEventListeners):
2950         * dom/RegisteredEventListener.cpp: Removed.
2951         * dom/RegisteredEventListener.h:
2952         (WebCore::RegisteredEventListener::Options::Options):
2953         (WebCore::RegisteredEventListener::create):
2954         (WebCore::RegisteredEventListener::listener):
2955         (WebCore::RegisteredEventListener::useCapture):
2956         (WebCore::RegisteredEventListener::isPassive):
2957         (WebCore::RegisteredEventListener::isOnce):
2958         (WebCore::RegisteredEventListener::wasRemoved):
2959         (WebCore::RegisteredEventListener::markAsRemoved):
2960         (WebCore::RegisteredEventListener::RegisteredEventListener):
2961         * inspector/InspectorDOMAgent.cpp:
2962         (WebCore::InspectorDOMAgent::getEventListenersForNode):
2963         (WebCore::InspectorDOMAgent::getEventListeners):
2964         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2965         * inspector/InspectorDOMAgent.h:
2966         (WebCore::EventListenerInfo::EventListenerInfo):
2967         * svg/SVGElement.cpp:
2968         (WebCore::hasLoadListener):
2969
2970 2016-08-14  Daniel Bates  <dabates@apple.com>
2971
2972         Fix compiler errors when building iOS WebKit using the iOS 10 beta SDK
2973         https://bugs.webkit.org/show_bug.cgi?id=160725
2974
2975         Reviewed by Sam Weinig.
2976
2977         * platform/cocoa/ThemeCocoa.mm: Unconditionally include header dlfcn.h as it
2978         exists in both the public iOS 9.3 SDK and iOS 10 beta SDK.
2979         * platform/spi/cocoa/CoreTextSPI.h: Add SPI declarations for constants that were
2980         used in r204107.
2981         * platform/spi/cocoa/PassKitSPI.h: Remove unnecessary #import statements when
2982         building with the Apple Internal SDK. Include header PassKit/PassKit.h when
2983         building for iOS.
2984         * platform/spi/cocoa/QuartzCoreSPI.h: No need to define CLayer.contentsFormat
2985         when building with the iOS 10 beta SDK as it is now part of the public API.
2986
2987 2016-08-14  Jonathan Bedard  <jbedard@apple.com>
2988
2989         Dereferenced NULL pointer in StyleResolver
2990         https://bugs.webkit.org/show_bug.cgi?id=160823
2991
2992         Reviewed by Darin Adler.
2993
2994         No behavior changed, new tests unneeded.
2995
2996         This change was initiated by a NULL pointer dereference to provide this unused argument.
2997
2998         * css/StyleResolver.cpp:
2999         (WebCore::StyleResolver::CascadedProperties::addStyleProperties): Removed unused function argument.
3000         (WebCore::StyleResolver::CascadedProperties::addMatch): Ditto.
3001         * css/StyleResolver.h: Ditto.
3002
3003 2016-08-14  Myles C. Maxfield  <mmaxfield@apple.com>
3004
3005         Fix GTK Debug bots after r204400
3006         https://bugs.webkit.org/show_bug.cgi?id=160818
3007
3008         Reviewed by Carlos Garcia Campos.
3009
3010         Because the GTK EWS bot doesn't run tests, I missed this.
3011
3012         No new tests because there is no behavior change.
3013
3014         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3015         (WebCore::HarfBuzzShaper::selectionRect):
3016
3017 2016-08-13  Chris Dumez  <cdumez@apple.com>
3018
3019         'compatMode' property should be on Document, not HTMLDocument
3020         https://bugs.webkit.org/show_bug.cgi?id=160819
3021
3022         Reviewed by Sam Weinig.
3023
3024         'compatMode' property should be on Document, not HTMLDocument:
3025         - https://dom.spec.whatwg.org/#dom-document-compatmode
3026
3027         WebKit had it on both. Firefox and Chrome have it on Document only.
3028
3029         Test: fast/dom/Document/compatMode-location.html
3030
3031         * html/HTMLDocument.idl:
3032
3033 2016-08-13  Chris Dumez  <cdumez@apple.com>
3034
3035         Move 'embeds' / 'plugins'/ 'scripts' attributes from HTMLDocument to Document
3036         https://bugs.webkit.org/show_bug.cgi?id=160829
3037
3038         Reviewed by Sam Weinig.
3039
3040         Move 'embeds' / 'plugins'/ 'scripts' attributes from HTMLDocument to Document
3041         to match the latest specification:
3042         - https://html.spec.whatwg.org/multipage/dom.html#the-document-object
3043
3044         This also matches Chrome.
3045
3046         No new tests, rebaselined existing test.
3047
3048         * dom/Document.idl:
3049         * html/HTMLDocument.idl:
3050
3051 2016-08-13  Chris Dumez  <cdumez@apple.com>
3052
3053         Move designMode attribute from HTMLDocument to Document
3054         https://bugs.webkit.org/show_bug.cgi?id=160838
3055
3056         Reviewed by Sam Weinig.
3057
3058         Move designMode attribute from HTMLDocument to Document to match the
3059         latest HTML specification:
3060         - https://html.spec.whatwg.org/multipage/interaction.html#designMode
3061
3062         This also matches Chrome.
3063
3064         No new tests, rebaselined existing test.
3065
3066         * dom/Document.cpp:
3067         (WebCore::Document::designMode):
3068         (WebCore::Document::setDesignMode):
3069         * dom/Document.h:
3070         * dom/Document.idl:
3071         * html/HTMLDocument.cpp:
3072         (WebCore::HTMLDocument::bgColor): Deleted.
3073         (WebCore::HTMLDocument::setBgColor): Deleted.
3074         (WebCore::HTMLDocument::fgColor): Deleted.
3075         * html/HTMLDocument.h:
3076         * html/HTMLDocument.idl:
3077
3078 2016-08-12  Chris Dumez  <cdumez@apple.com>
3079
3080         getElementsByTagName() should take a qualifiedName in parameter
3081         https://bugs.webkit.org/show_bug.cgi?id=160682
3082
3083         Reviewed by Ryosuke Niwa.
3084
3085         getElementsByTagName() should take a qualifiedName in parameter, not a
3086         localName, according to the latest DOM specification:
3087         - https://dom.spec.whatwg.org/#dom-document-getelementsbytagname
3088         - https://dom.spec.whatwg.org/#concept-getelementsbytagname
3089
3090         The new behavior matches Firefox and Edge. There is a slight
3091         compatiblity risk but we should give it a try.
3092
3093         No new tests, rebaselined existing tests.
3094
3095         * WebCore.xcodeproj/project.pbxproj:
3096         * dom/AllDescendantsCollection.h: Added.
3097         * dom/ContainerNode.cpp:
3098         (WebCore::ContainerNode::getElementsByTagName):
3099         (WebCore::ContainerNode::getElementsByTagNameNS):
3100         * dom/Node.cpp:
3101         (WebCore::NodeListsNodeData::invalidateCaches):
3102         * dom/NodeRareData.h:
3103         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
3104         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
3105         (WebCore::NodeListsNodeData::adoptDocument):
3106         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
3107         * dom/TagCollection.cpp:
3108         (WebCore::makeQualifiedName):
3109         (WebCore::splitQualifiedName):
3110         (WebCore::TagCollectionNS::TagCollectionNS):
3111         (WebCore::TagCollectionNS::~TagCollectionNS):
3112         (WebCore::TagCollection::TagCollection):
3113         (WebCore::TagCollection::~TagCollection):
3114         (WebCore::HTMLTagCollection::HTMLTagCollection):
3115         (WebCore::HTMLTagCollection::~HTMLTagCollection):
3116         * dom/TagCollection.h:
3117         (WebCore::TagCollection::elementMatches):
3118         (WebCore::TagCollectionNS::elementMatches):
3119         (WebCore::HTMLTagCollection::elementMatches):
3120         * html/CollectionType.h:
3121         * html/GenericCachedHTMLCollection.cpp:
3122         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
3123         * html/HTMLCollection.cpp:
3124         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
3125
3126 2016-08-12  Alex Christensen  <achristensen@webkit.org>
3127
3128         Make URLParser work with URLs missing URL parts
3129         https://bugs.webkit.org/show_bug.cgi?id=160824
3130
3131         Reviewed by Brady Eidson.
3132
3133         My initial implementation of URLParser didn't work correctly with URLs missing parts,
3134         like a URL with no fragment, or a URL with no query.  This fixes and tests parsing such URLS.
3135         Covered by new API tests.
3136
3137         * platform/URLParser.cpp:
3138         (WebCore::URLParser::parse):
3139         (WebCore::URLParser::allValuesEqual):
3140         * platform/URLParser.h:
3141         (WebCore::URLParser::parse):
3142
3143 2016-08-12  Johan K. Jensen  <johan_jensen@apple.com>
3144
3145         Rename DocumentLoadTiming and ResourceLoadTiming
3146         https://bugs.webkit.org/show_bug.cgi?id=160821
3147
3148         Reviewed by Alex Christensen.
3149
3150         Renames ResourceLoadTiming to NetworkLoadTiming.
3151         Renames DocumentLoadTiming to LoadTiming as well as
3152         navigationStart() to startTime(), so it's generic for
3153         both the main resource and subresources.
3154
3155         * CMakeLists.txt:
3156         * Modules/gamepad/NavigatorGamepad.cpp:
3157         (WebCore::NavigatorGamepad::from):
3158         * PlatformMac.cmake:
3159         * WebCore.xcodeproj/project.pbxproj:
3160         * inspector/InspectorNetworkAgent.cpp:
3161         (WebCore::buildObjectForTiming):
3162         (WebCore::buildObjectForResourceResponse):
3163         * loader/DocumentLoader.cpp:
3164         (WebCore::DocumentLoader::startLoadingMainResource):
3165         * loader/DocumentLoader.h:
3166         (WebCore::DocumentLoader::timing):
3167         (WebCore::DocumentLoader::resetTiming):
3168         * loader/FrameLoader.cpp:
3169         (WebCore::FrameLoader::dispatchUnloadEvents):
3170         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
3171         * loader/LoadTiming.cpp: Renamed from Source/WebCore/loader/DocumentLoadTiming.cpp.
3172         (WebCore::LoadTiming::LoadTiming):
3173         (WebCore::LoadTiming::monotonicTimeToZeroBasedDocumentTime):
3174         (WebCore::LoadTiming::monotonicTimeToPseudoWallTime):
3175         (WebCore::LoadTiming::markStartTime):
3176         (WebCore::LoadTiming::addRedirect):
3177         * loader/LoadTiming.h: Renamed from Source/WebCore/loader/DocumentLoadTiming.h.
3178         (WebCore::LoadTiming::markUnloadEventStart):
3179         (WebCore::LoadTiming::markUnloadEventEnd):
3180         (WebCore::LoadTiming::markRedirectStart):
3181         (WebCore::LoadTiming::markRedirectEnd):
3182         (WebCore::LoadTiming::markFetchStart):
3183         (WebCore::LoadTiming::setResponseEnd):
3184         (WebCore::LoadTiming::markLoadEventStart):
3185         (WebCore::LoadTiming::markLoadEventEnd):
3186         (WebCore::LoadTiming::setHasSameOriginAsPreviousDocument):
3187         (WebCore::LoadTiming::startTime):
3188         (WebCore::LoadTiming::unloadEventStart):
3189         (WebCore::LoadTiming::unloadEventEnd):
3190         (WebCore::LoadTiming::redirectStart):
3191         (WebCore::LoadTiming::redirectEnd):
3192         (WebCore::LoadTiming::redirectCount):
3193         (WebCore::LoadTiming::fetchStart):
3194         (WebCore::LoadTiming::responseEnd):
3195         (WebCore::LoadTiming::loadEventStart):
3196         (WebCore::LoadTiming::loadEventEnd):
3197         (WebCore::LoadTiming::hasCrossOriginRedirect):
3198         (WebCore::LoadTiming::hasSameOriginAsPreviousDocument):
3199         (WebCore::LoadTiming::referenceMonotonicTime):
3200         (WebCore::LoadTiming::referenceWallTime):
3201         * page/DOMWindow.cpp:
3202         (WebCore::DOMWindow::dispatchLoadEvent):
3203         * page/PerformanceNavigation.cpp:
3204         (WebCore::PerformanceNavigation::redirectCount):
3205         * page/PerformanceResourceTiming.cpp:
3206         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
3207         (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
3208         * page/PerformanceResourceTiming.h:
3209         * page/PerformanceTiming.cpp:
3210         (WebCore::PerformanceTiming::navigationStart):
3211         (WebCore::PerformanceTiming::unloadEventStart):
3212         (WebCore::PerformanceTiming::unloadEventEnd):
3213         (WebCore::PerformanceTiming::redirectStart):
3214         (WebCore::PerformanceTiming::redirectEnd):
3215         (WebCore::PerformanceTiming::fetchStart):
3216         (WebCore::PerformanceTiming::domainLookupStart):
3217         (WebCore::PerformanceTiming::domainLookupEnd):
3218         (WebCore::PerformanceTiming::connectStart):
3219         (WebCore::PerformanceTiming::connectEnd):
3220         (WebCore::PerformanceTiming::secureConnectionStart):
3221         (WebCore::PerformanceTiming::requestStart):
3222         (WebCore::PerformanceTiming::responseStart):
3223         (WebCore::PerformanceTiming::responseEnd):
3224         (WebCore::PerformanceTiming::loadEventStart):
3225         (WebCore::PerformanceTiming::loadEventEnd):
3226         (WebCore::PerformanceTiming::loadTiming):
3227         (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
3228         * page/PerformanceTiming.h:
3229         * platform/network/NetworkLoadTiming.h: Renamed from Source/WebCore/platform/network/ResourceLoadTiming.h.
3230         (WebCore::NetworkLoadTiming::NetworkLoadTiming):
3231         (WebCore::NetworkLoadTiming::operator=):
3232         (WebCore::NetworkLoadTiming::isolatedCopy):
3233         (WebCore::NetworkLoadTiming::operator==):
3234         (WebCore::NetworkLoadTiming::operator!=):
3235         (WebCore::NetworkLoadTiming::encode):
3236         (WebCore::NetworkLoadTiming::decode):
3237         * platform/network/ResourceHandle.h:
3238         * platform/network/ResourceResponseBase.cpp:
3239         (WebCore::ResourceResponseBase::crossThreadData):
3240         (WebCore::ResourceResponseBase::fromCrossThreadData):
3241         (WebCore::ResourceResponseBase::compare):
3242         * platform/network/ResourceResponseBase.h:
3243         (WebCore::ResourceResponseBase::networkLoadTiming):
3244         (WebCore::ResourceResponseBase::encode):
3245         (WebCore::ResourceResponseBase::decode):
3246         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3247         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3248         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3249         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
3250         * platform/network/cocoa/NetworkLoadTiming.mm: Renamed from Source/WebCore/platform/network/cocoa/ResourceLoadTiming.mm.
3251         (WebCore::timingValue):
3252         (WebCore::copyTimingData):
3253         (WebCore::setCollectsTimingData):
3254         * platform/network/curl/ResourceHandleManager.cpp:
3255         (WebCore::calculateWebTimingInformations):
3256         * platform/network/mac/ResourceHandleMac.mm:
3257         (WebCore::ResourceHandle::getConnectionTimingData):
3258         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3259         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
3260         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3261         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3262         * platform/network/soup/ResourceHandleSoup.cpp:
3263         (WebCore::sendRequestCallback):
3264         (WebCore::ResourceHandle::didStartRequest):
3265         (WebCore::networkEventCallback):
3266
3267 2016-08-12  Joseph Pecoraro  <pecoraro@apple.com>
3268
3269         Remove unused includes of RefCountedLeakCounter.h
3270         https://bugs.webkit.org/show_bug.cgi?id=160817
3271
3272         Reviewed by Mark Lam.
3273
3274         * bindings/js/JSEventListener.cpp:
3275         * rendering/RenderBlockLineLayout.cpp:
3276
3277 2016-08-12  Alex Christensen  <achristensen@webkit.org>
3278
3279         Initial URLParser implementation
3280         https://bugs.webkit.org/show_bug.cgi?id=160811
3281
3282         Reviewed by Brady Eidson.
3283
3284         There are a lot of missing parts, but it works in one case, so I test that one case.
3285
3286         * platform/URLParser.cpp:
3287         (WebCore::isC0Control):
3288         (WebCore::isC0ControlOrSpace):
3289         (WebCore::isTabOrNewline):
3290         (WebCore::isASCIIDigit):
3291         (WebCore::isASCIIAlpha):
3292         (WebCore::isASCIIAlphanumeric):
3293         (WebCore::isSpecialScheme):
3294         (WebCore::URLParser::parse):
3295
3296 2016-08-12  Commit Queue  <commit-queue@webkit.org>
3297
3298         Unreviewed, rolling out r204404.
3299         https://bugs.webkit.org/show_bug.cgi?id=160805
3300
3301         "Broke the build for some Apple Internal projects" (Requested
3302         by bradee-oh on #webkit).
3303
3304         Reverted changeset:
3305
3306         "Support WebIDL unions (Part 1)"
3307         https://bugs.webkit.org/show_bug.cgi?id=160769
3308         http://trac.webkit.org/changeset/204404
3309
3310 2016-08-12  Philippe Normand  <pnormand@igalia.com>
3311
3312         [GStreamer] Performance problems with bigger video resolution in the webrtc media player
3313         https://bugs.webkit.org/show_bug.cgi?id=153826
3314
3315         Reviewed by Alejandro G. Castro.
3316
3317         Keep the OpenWebRTC video renderer size synchronized with the Media element size.
3318
3319         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
3320         (WebCore::MediaPlayerPrivateGStreamerOwr::setSize):
3321         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
3322
3323 2016-08-12  Philippe Normand  <pnormand@igalia.com>
3324
3325         [GStreamer][OWR] Video rendering fixes
3326         https://bugs.webkit.org/show_bug.cgi?id=160764
3327
3328         Reviewed by Xabier Rodriguez-Calvar.
3329
3330         The video renderer of OpenWebRTC now uses OpenGL so we have two
3331         options to correctly handle this in WebKit:
3332
3333         - if USE_GSTREAMER_GL is enabled then we simply pass our GL
3334           appsink to the renderer and there is no need to create glupload
3335           and glcolorconvert element on WebKit side because those elements
3336           are already created on OpenWebRTC side.
3337         - if USE_GSTREAMER_GL is disabled then we need our sink to download
3338           frames from the GPU so that rendering can be done with the WebKit
3339           video sink in main memory.
3340
3341         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3342         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Split out GL appsink management
3343         to a separate method that can be used by sub-classes.
3344         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL): Use new createGLAppSink method.
3345         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3346         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
3347         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink): handle GStreamer-GL configurations
3348         and pass a different element to the renderer depending on the configuration.
3349
3350 2016-08-11  Sam Weinig  <sam@webkit.org>
3351
3352         Support WebIDL unions (Part 1)
3353         https://bugs.webkit.org/show_bug.cgi?id=160769
3354
3355         Reviewed by Chris Dumez.
3356
3357         This is the first part of an effort to add support for union types
3358         in our code generators. This change:
3359         - Adds a domType struct to hold the parsed type information. For now, we only
3360           use it temporarily while parsing, and don't expose it to the code generators,
3361           but that will change in a later patch.
3362         - Remove support for scoped identifiers for types. They are not supported by WebIDL.
3363         - Make debugging the parser easier by providing backtraces when asserting.
3364
3365         There should be no observable changes.
3366
3367         * bindings/scripts/IDLParser.pm:
3368
3369 2016-08-11  Myles C. Maxfield  <mmaxfield@apple.com>
3370
3371         Migrate from ints to unsigneds when referring to indices into strings
3372         https://bugs.webkit.org/show_bug.cgi?id=160735
3373
3374         Reviewed by Simon Fraser.
3375
3376         There are a few cases where we use ints to refer to indices into strings:
3377         - A simple historical accident. These were migrated to unsigneds directly.
3378         - Where we use -1 as a sentinal value. These were migrated to Optional<unsigned>.
3379
3380         This patch only modifies rendering code (rather than DOM code). There are a few
3381         places in DOM code (such as Position and Node::maxCharacterOffset()) which also
3382         erroneously use ints; however, I didn't want this change to be observable from
3383         script and I wanted to keep this patch to a reasonable size.
3384
3385         No new tests because there is no behavior change.
3386
3387         * editing/FrameSelection.cpp:
3388         (WebCore::FrameSelection::updateAppearance):
3389         (WebCore::FrameSelection::setCaretVisibility):
3390         * platform/DragImage.cpp:
3391         (WebCore::createDragImageForRange):
3392         * platform/graphics/FontCascade.cpp:
3393         (WebCore::FontCascade::glyphBufferForTextRun):
3394         (WebCore::FontCascade::drawText):
3395         (WebCore::FontCascade::drawEmphasisMarks):
3396         (WebCore::FontCascade::adjustSelectionRectForText):
3397         (WebCore::computeUnderlineType):
3398         (WebCore::FontCascade::getGlyphsAndAdvancesForSimpleText):
3399         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
3400         (WebCore::FontCascade::drawGlyphBuffer):
3401         (WebCore::offsetToMiddleOfGlyphAtIndex):
3402         (WebCore::FontCascade::adjustSelectionRectForSimpleText):
3403         * platform/graphics/FontCascade.h:
3404         * platform/graphics/GlyphBuffer.h:
3405         (WebCore::GlyphBuffer::size):
3406         (WebCore::GlyphBuffer::glyphs):
3407         (WebCore::GlyphBuffer::advances):
3408         (WebCore::GlyphBuffer::fontAt):
3409         (WebCore::GlyphBuffer::glyphAt):
3410         (WebCore::GlyphBuffer::advanceAt):
3411         (WebCore::GlyphBuffer::offsetAt):
3412         (WebCore::GlyphBuffer::reverse):
3413         (WebCore::GlyphBuffer::offsetInString):
3414         (WebCore::GlyphBuffer::shrink):
3415         (WebCore::GlyphBuffer::swap):
3416         * platform/graphics/GraphicsContext.cpp:
3417         (WebCore::GraphicsContext::drawText):
3418         (WebCore::GraphicsContext::drawGlyphs):
3419         (WebCore::GraphicsContext::drawEmphasisMarks):
3420         * platform/graphics/GraphicsContext.h:
3421         * platform/graphics/Latin1TextIterator.h:
3422         (WebCore::Latin1TextIterator::Latin1TextIterator):
3423         (WebCore::Latin1TextIterator::currentCharacter):
3424         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
3425         (WebCore::SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator):
3426         * platform/graphics/SurrogatePairAwareTextIterator.h:
3427         (WebCore::SurrogatePairAwareTextIterator::currentCharacter):
3428         * platform/graphics/WidthIterator.cpp:
3429         (WebCore::WidthIterator::applyFontTransforms):
3430         (WebCore::WidthIterator::advanceInternal):
3431         (WebCore::WidthIterator::advance):
3432         (WebCore::WidthIterator::advanceOneCharacter):
3433         * platform/graphics/WidthIterator.h:
3434         * platform/graphics/cairo/FontCairo.cpp:
3435         (WebCore::drawGlyphsToContext):
3436         (WebCore::drawGlyphsShadow):
3437         (WebCore::FontCascade::drawGlyphs):
3438         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3439         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
3440         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3441         (WebCore::FontCascade::adjustSelectionRectForComplexText):
3442         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3443         (WebCore::fillVectorWithHorizontalGlyphPositions):
3444         (WebCore::showLetterpressedGlyphsWithAdvances):
3445         (WebCore::showGlyphsWithAdvances):
3446         (WebCore::FontCascade::drawGlyphs):
3447         (WebCore::FontCascade::dashesForIntersectionsWithRect):
3448         (WebCore::FontCascade::adjustSelectionRectForComplexText):
3449         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
3450         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3451         * platform/graphics/displaylists/DisplayListRecorder.cpp:
3452         (WebCore::DisplayList::Recorder::drawGlyphs):
3453         * platform/graphics/displaylists/DisplayListRecorder.h:
3454         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3455         (WebCore::HarfBuzzShaper::selectionRect):
3456         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
3457         * platform/graphics/mac/ComplexTextController.h:
3458         * platform/graphics/win/FontCGWin.cpp:
3459         (WebCore::FontCascade::drawGlyphs):
3460         * platform/graphics/win/FontWin.cpp:
3461         (WebCore::FontCascade::adjustSelectionRectForComplexText):
3462         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
3463         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3464         * rendering/EllipsisBox.cpp:
3465         (WebCore::EllipsisBox::paintSelection):
3466         * rendering/InlineTextBox.cpp:
3467         (WebCore::InlineTextBox::isSelected):
3468         (WebCore::InlineTextBox::selectionState):
3469         (WebCore::InlineTextBox::localSelectionRect):
3470         (WebCore::InlineTextBox::paint):
3471         (WebCore::InlineTextBox::clampedOffset):
3472         (WebCore::InlineTextBox::selectionStartEnd):
3473         (WebCore::InlineTextBox::paintSelection):
3474         (WebCore::InlineTextBox::paintCompositionBackground):
3475         (WebCore::InlineTextBox::paintDocumentMarker):
3476         (WebCore::InlineTextBox::paintTextMatchMarker):
3477         (WebCore::InlineTextBox::positionForOffset):
3478         * rendering/InlineTextBox.h:
3479         (WebCore::InlineTextBox::offsetRun):
3480         (WebCore::InlineTextBox::InlineTextBox): Deleted.
3481         * rendering/RenderBlock.cpp:
3482         (WebCore::RenderBlock::localCaretRect):
3483         * rendering/RenderBlock.h:
3484         * rendering/RenderBox.cpp:
3485         (WebCore::RenderBox::localCaretRect):
3486         * rendering/RenderBox.h:
3487         * rendering/RenderInline.cpp:
3488         (WebCore::RenderInline::localCaretRect):
3489         * rendering/RenderInline.h:
3490         * rendering/RenderLineBreak.cpp:
3491         (WebCore::RenderLineBreak::localCaretRect):
3492         * rendering/RenderLineBreak.h:
3493         * rendering/RenderObject.cpp:
3494         (WebCore::RenderObject::selectionStartEnd):
3495         (WebCore::RenderObject::localCaretRect):
3496         * rendering/RenderObject.h:
3497         * rendering/RenderReplaced.cpp:
3498         (WebCore::RenderReplaced::isSelected):
3499         * rendering/RenderText.cpp:
3500         (WebCore::RenderText::localCaretRect):
3501         (WebCore::RenderText::collectSelectionRectsForLineBoxes):
3502         * rendering/RenderText.h:
3503         * rendering/RenderTextLineBoxes.cpp:
3504         (WebCore::RenderTextLineBoxes::setSelectionState):
3505         * rendering/RenderView.cpp:
3506         (WebCore::RenderView::subtreeSelectionBounds):
3507         (WebCore::RenderView::repaintSubtreeSelection):
3508         (WebCore::RenderView::setSelection):
3509         (WebCore::RenderView::splitSelectionBetweenSubtrees):
3510         (WebCore::RenderView::clearSubtreeSelection):
3511         (WebCore::RenderView::applySubtreeSelection):
3512         (WebCore::RenderView::getSelection):
3513         (WebCore::RenderView::clearSelection):
3514         (WebCore::RenderView::RenderView): Deleted.
3515         * rendering/RenderView.h:
3516         * rendering/SelectionSubtreeRoot.cpp:
3517         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
3518         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot): Deleted.
3519         * rendering/SelectionSubtreeRoot.h:
3520         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
3521         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos):
3522         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos):
3523         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionClear):
3524         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartEndPositions):
3525         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos):
3526         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos):
3527         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection):
3528         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData): Deleted.
3529         * rendering/TextPainter.cpp:
3530         (WebCore::TextPainter::drawTextOrEmphasisMarks):
3531         (WebCore::TextPainter::paintTextWithShadows):
3532         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
3533         (WebCore::TextPainter::paintText):
3534         * rendering/TextPainter.h:
3535         (WebCore::TextPainter::addEmphasis):
3536         * rendering/svg/RenderSVGInlineText.cpp:
3537         (WebCore::RenderSVGInlineText::localCaretRect):
3538         * rendering/svg/RenderSVGInlineText.h:
3539         * rendering/svg/SVGInlineTextBox.cpp:
3540         (WebCore::SVGInlineTextBox::positionForOffset):
3541         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
3542         (WebCore::SVGInlineTextBox::localSelectionRect):
3543         (WebCore::SVGInlineTextBox::paintSelectionBackground):
3544         (WebCore::SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates):
3545         (WebCore::SVGInlineTextBox::paintTextWithShadows):
3546         (WebCore::SVGInlineTextBox::paintText):
3547         * rendering/svg/SVGInlineTextBox.h:
3548         * rendering/svg/SVGTextQuery.cpp:
3549         (WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates):
3550         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
3551         (WebCore::SVGTextQuery::subStringLengthCallback):
3552         (WebCore::SVGTextQuery::startPositionOfCharacterCallback):
3553         (WebCore::SVGTextQuery::endPositionOfCharacterCallback):
3554         (WebCore::SVGTextQuery::rotationOfCharacterCallback):
3555         (WebCore::calculateGlyphBoundaries):
3556         (WebCore::SVGTextQuery::extentOfCharacterCallback):
3557         (WebCore::SVGTextQuery::characterNumberAtPositionCallback):
3558         * rendering/svg/SVGTextQuery.h:
3559
3560 2016-08-11  Alex Christensen  <achristensen@webkit.org>
3561
3562         Don't use a NetworkingContext when creating SocketStreamHandles
3563         https://bugs.webkit.org/show_bug.cgi?id=160732
3564
3565         Reviewed by Brady Eidson.
3566
3567         No change in behavior.  After r204327 a SessionID is all we need to get the NetworkStorageSession,
3568         and we pass the SessionID to the SocketStreamHandle constructor, so use that instead.
3569         SessionIDs can be serialized and sent over IPC.  NetworkingContexts can't.
3570
3571         * Modules/websockets/WebSocketChannel.cpp:
3572         (WebCore::WebSocketChannel::connect):
3573         * page/SocketProvider.cpp:
3574         (WebCore::SocketProvider::createSocketStreamHandle):
3575         * page/SocketProvider.h:
3576         * platform/network/cf/SocketStreamHandle.h:
3577         (WebCore::SocketStreamHandle::create):
3578         * platform/network/cf/SocketStreamHandleCFNet.cpp:
3579         (WebCore::SocketStreamHandle::SocketStreamHandle):
3580         (WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials):
3581         * platform/network/curl/SocketStreamHandle.h:
3582         (WebCore::SocketStreamHandle::create):
3583         * platform/network/soup/SocketStreamHandle.h:
3584         * platform/network/soup/SocketStreamHandleSoup.cpp:
3585         (WebCore::SocketStreamHandle::create):
3586
3587 2016-08-11  Alex Christensen  <achristensen@webkit.org>
3588
3589         Use StringBuilder::appendLiteral when possible don't append result of makeString
3590         https://bugs.webkit.org/show_bug.cgi?id=160772
3591
3592         Reviewed by Sam Weinig.
3593
3594         StringBuilder::append does an unnecessary strlen call.
3595         append(makeString(...)) always does unnecessary allocations and copies.
3596         It's currently only used in debug logging, but we shouldn't have this pattern in WebKit.
3597
3598         * Modules/indexeddb/server/IndexValueStore.cpp:
3599         (WebCore::IDBServer::IndexValueStore::loggingString):
3600         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
3601         (WebCore::IDBDatabaseInfo::loggingString):
3602         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3603         (WebCore::IDBObjectStoreInfo::loggingString):
3604         * contentextensions/CombinedURLFilters.cpp:
3605         (WebCore::ContentExtensions::prefixTreeVertexToString):
3606         (WebCore::ContentExtensions::recursivePrint):
3607         * html/HTMLMediaElement.cpp:
3608         (WebCore::actionName):
3609         * html/MediaElementSession.cpp:
3610         (WebCore::restrictionName):
3611         * loader/ResourceLoadStatistics.cpp:
3612         (WebCore::appendBoolean):
3613         (WebCore::appendHashCountedSet):
3614         (WebCore::ResourceLoadStatistics::toString):
3615         * platform/PODInterval.h:
3616         (WebCore::PODInterval::toString):
3617         * platform/URL.cpp:
3618         (WebCore::URL::setHost):
3619         (WebCore::URL::setHostAndPort):
3620         (WebCore::URL::serialize):
3621         * testing/Internals.cpp:
3622         (WebCore::appendOffsets):
3623         (WebCore::Internals::scrollSnapOffsets):
3624
3625 2016-08-11  Chris Dumez  <cdumez@apple.com>
3626
3627         Align Range.surroundContents() with the latest DOM specification
3628         https://bugs.webkit.org/show_bug.cgi?id=160777
3629
3630         Reviewed by Ryosuke Niwa.
3631
3632         Align Range.surroundContents() with the latest DOM specification:
3633         - https://dom.spec.whatwg.org/#dom-range-surroundcontents
3634
3635         In particular, the following changes were made:
3636         1. Drop early check to see if startContainer() accepts children like
3637            newParent. This check is not in the specification. Let the later
3638            call to Range.insertNode() take care of doing the check and
3639            throwing.
3640         2. Drop early check to see if newParent contains the range's start
3641            node, for the same reasons as above.
3642         3. Move extractContents() call *before* removing newParent's children
3643            to match the order in the specification (steps 3 & 4).
3644
3645         This makes our behavior much closer to Firefox's as well.
3646
3647         No new tests, rebaselined existing W3C test.
3648
3649         * dom/Range.cpp:
3650         (WebCore::Range::surroundContents):
3651
3652 2016-08-11  Alex Christensen  <achristensen@webkit.org>
3653
3654         Add URLParser stub
3655         https://bugs.webkit.org/show_bug.cgi?id=160770
3656
3657         Reviewed by Sam Weinig.
3658
3659         Added API test stub.
3660
3661         * CMakeLists.txt:
3662         * WebCore.xcodeproj/project.pbxproj:
3663         * platform/URL.h:
3664         * platform/URLParser.cpp: Added.
3665         (WebCore::URLParser::parse):
3666         * platform/URLParser.h: Added.
3667         (WebCore::URLParser::parse):
3668
3669 2016-08-11  Chris Dumez  <cdumez@apple.com>
3670
3671         Move dataset attribute from Element to HTMLElement / SVGElement
3672         https://bugs.webkit.org/show_bug.cgi?id=160766
3673
3674         Reviewed by Alex Christensen.
3675
3676         Move dataset attribute from Element to HTMLElement / SVGElement as per
3677         the specifications:
3678         - https://html.spec.whatwg.org/multipage/dom.html#htmlelement
3679         - https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement
3680
3681         Firefox and Chrome seem to have dataset on HTMLElement but not on
3682         SVGElement (yet).
3683
3684         No new tests, rebaselined existing test.
3685
3686         * dom/Element.idl:
3687         * html/HTMLElement.idl:
3688         * svg/SVGElement.idl:
3689
3690 2016-08-11  Eric Carlson  <eric.carlson@apple.com>
3691
3692         Unreviewed, update MediaRemoteSPI.h after r204082.
3693
3694         * platform/spi/mac/MediaRemoteSPI.h:
3695
3696 2016-08-10  Joseph Pecoraro  <pecoraro@apple.com>
3697
3698         Web Inspector: Should be able to Edit Node Attributes and Styles for non-UserAgent Shadow DOM nodes
3699         https://bugs.webkit.org/show_bug.cgi?id=160762
3700         <rdar://problem/27798271>
3701
3702         Reviewed by Ryosuke Niwa.
3703
3704         * inspector/InspectorDOMAgent.cpp:
3705         (WebCore::InspectorDOMAgent::assertEditableNode):
3706         (WebCore::InspectorDOMAgent::assertEditableElement):
3707         * inspector/PageConsoleAgent.cpp:
3708         (WebCore::PageConsoleAgent::addInspectedNode):
3709         Allow editing shadow DOM nodes as long as they are not in a UserAgent shadow tree.
3710
3711 2016-08-10  Chris Dumez  <cdumez@apple.com>
3712
3713         Optimization in Node.insertBefore() is not spec-compliant
3714         https://bugs.webkit.org/show_bug.cgi?id=160746
3715
3716         Reviewed by Ryosuke Niwa.
3717
3718         We have an optimization in Node.insertBefore(newNode, refChild) to avoid
3719         doing any work when newNode == refChild or newNode.nextSibling == refChild.
3720
3721         This optimization is not in the specification:
3722         - https://dom.spec.whatwg.org/#concept-node-replace
3723
3724         The issue is that this optimization is observable with DOM mutation
3725         observers / listeners or DOM ranges.
3726
3727         This patch addresses the issue by dropping the optimization. This case
3728         does not seem common enough to be worth optimizing for. However, if it
3729         turns out to regress the performance of things we care about, we could
3730         fallback to doing the optimization only when it is not observable.
3731
3732         Test: fast/dom/Node/insertBefore-no-op-mutationobserver.html
3733
3734         * dom/ContainerNode.cpp:
3735         (WebCore::checkAcceptChild):
3736         Move refChild->parent() == parent check from insertBefore() to our
3737         pre-insertion check function, right after checking if newNode contains
3738         parent. This was done in order to match more closely the specification
3739         and to make sure that exception are thrown in the correct order:
3740         - https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity (steps 2 and 3)
3741
3742         (WebCore::ContainerNode::insertBefore):
3743         1. Drop the (refChild->previousSibling() == &newChild || refChild == &newChild)
3744            optimization as it is not spc-compliant.
3745         2. If refChild is newNode, then set refChild to newChild.nextSibling as per:
3746            - https://dom.spec.whatwg.org/#concept-node-pre-insert (step 3)
3747
3748 2016-08-10  Ryosuke Niwa  <rniwa@webkit.org>
3749
3750         Move document.defineElement to customElements.define
3751         https://bugs.webkit.org/show_bug.cgi?id=160731
3752
3753         Reviewed by Chris Dumez.
3754
3755         Replaced Document.prototype.defineElement by CustomElementsRegistry.prototype.define to match
3756         the latest HTML specification: https://html.spec.whatwg.org/#custom-elements-api 
3757
3758         This patch renames the existing CustomElementDefinitions to CustomElementsRegistry and exposes
3759         it on window.customElements. CustomElementDefinitions is now owned by DOMWindow instead of
3760         Document to match the spec's new semantics.
3761
3762         No new tests. The existing tests have been updated to reflect the change.
3763
3764         * DerivedSources.cpp:
3765         * DerivedSources.make:
3766         * WebCore.xcodeproj/project.pbxproj:
3767         * bindings/js/JSCustomElementsRegistryCustom.cpp: Added.
3768         (WebCore::JSCustomElementsRegistry::define): Moved from JSDocumentCustom. Removed the check for
3769         the existence of DOMWindow since CustomElementsRegistry is an attribute on DOMWindow itself.
3770         * bindings/js/JSDocumentCustom.cpp:
3771         (WebCore::JSDocument::defineElement): Deleted.
3772         * bindings/js/JSHTMLElementCustom.cpp: Added the code to check the existence of DOMWindow since
3773         the registry is associated with DOMWindow, not Document.
3774         (WebCore::constructJSHTMLElement):
3775         * dom/CustomElementsRegistry.cpp: Renamed from Source/WebCore/dom/CustomElementDefinitions.cpp.
3776         (WebCore::CustomElementsRegistry::create): Added.
3777         (WebCore::CustomElementsRegistry::CustomElementsRegistry): Added.
3778         (WebCore::CustomElementsRegistry::~CustomElementsRegistry): Added.
3779         (WebCore::CustomElementsRegistry::addElementDefinition): Moved from CustomElementDefinitions.
3780         (WebCore::CustomElementsRegistry::addUpgradeCandidate): Ditto.
3781         (WebCore::CustomElementsRegistry::findInterface): Ditto.
3782         (WebCore::CustomElementsRegistry::containsConstructor): Ditto.
3783         * dom/CustomElementsRegistry.h: Renamed from Source/WebCore/dom/CustomElementDefinitions.h.
3784         * dom/CustomElementsRegistry.idl: Added.
3785         * dom/Document.cpp:
3786         (WebCore::createUpgradeCandidateElement): Extracted out of createHTMLElementWithNameValidation
3787         and createFallbackHTMLElement to share code.
3788         (WebCore::createHTMLElementWithNameValidation):
3789         (WebCore::createFallbackHTMLElement): This function was missing a check for the runtime flag.
3790         Sharing code with createHTMLElementWithNameValidation via createUpgradeCandidateElement fixes it.
3791         (WebCore::Document::ensureCustomElementDefinitions): Deleted.
3792         * dom/Document.h:
3793         (WebCore::Document::customElementDefinitions): Deleted.
3794         * dom/Document.idl:
3795         * dom/Element.cpp:
3796         (WebCore::Element::attributeChanged):
3797         * html/parser/HTMLConstructionSite.cpp:
3798         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
3799         * page/DOMWindow.cpp:
3800         (WebCore::DOMWindow::ensureCustomElementsRegistry): Added. Moved from Document.
3801         * page/DOMWindow.h:
3802         * page/DOMWindow.idl: Added customElements on DOMWindow.
3803
3804 2016-08-10  Alex Christensen  <achristensen@webkit.org>
3805
3806         Fix WinCairo build after r204327.
3807
3808         * platform/network/NetworkStorageSessionStub.cpp:
3809         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Renamed from create...
3810         (WebCore::NetworkStorageSession::createPrivateBrowsingSession): Deleted.
3811
3812 2016-08-10  Nan Wang  <n_wang@apple.com>
3813
3814         AX: Media controls timeline should have percentage value description
3815         https://bugs.webkit.org/show_bug.cgi?id=160619
3816
3817         Reviewed by Eric Carlson.
3818
3819         Added aria-valuetext attribute to the timeline slider and set its value to
3820         the percentage format. Also formatted the elapsed/remaining timer's description
3821         so that it's more human readable.
3822
3823         Test: http/tests/media/hls/video-duration-accessibility.html
3824
3825         * English.lproj/mediaControlsLocalizedStrings.js:
3826         * Modules/mediacontrols/mediaControlsApple.js:
3827         (Controller.prototype.drawVolumeBackground):
3828         (Controller.prototype.formatTimeDescription):
3829         (Controller.prototype.formatTime):
3830         (Controller.prototype.updateTime):
3831         (Controller.prototype.updateControlsWhileScrubbing):
3832
3833 2016-08-10  Anders Carlsson  <andersca@apple.com>
3834
3835         Revert back to the old style member function state machine for callbacks
3836         https://bugs.webkit.org/show_bug.cgi?id=160756
3837
3838         Reviewed by Tim Horton.
3839
3840         This is another step towards merging SQLTransactionBackend and SQLTransaction,
3841         and using a single state machine for both sides.
3842
3843         * Modules/webdatabase/SQLTransaction.cpp:
3844         (WebCore::SQLTransaction::SQLTransaction):
3845         (WebCore::SQLTransaction::performPendingCallback):
3846         (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
3847         (WebCore::SQLTransaction::scheduleCallback):
3848         (WebCore::SQLTransaction::openTransactionAndPreflight):
3849         (WebCore::SQLTransaction::runCurrentStatement):
3850         (WebCore::SQLTransaction::handleCurrentStatementError):
3851         (WebCore::SQLTransaction::handleTransactionError):
3852         (WebCore::SQLTransaction::postflightAndCommit):
3853         (WebCore::SQLTransaction::debugStepName):
3854         * Modules/webdatabase/SQLTransaction.h:
3855
3856 2016-08-09  Skachkov Oleksandr  <gskachkov@gmail.com>
3857
3858         [ES2016] Implement Object.values
3859         https://bugs.webkit.org/show_bug.cgi?id=160410
3860
3861         Reviewed by Saam Barati, Yusuke Suzuki.
3862
3863         No new tests because all tests are implemented in JavaScriptCore 
3864         and there is no behavior change.
3865
3866         * ForwardingHeaders/runtime/IterationKind.h: Added.
3867         * bindings/js/SerializedScriptValue.cpp:
3868         (WebCore::CloneSerializer::serialize):
3869
3870 2016-08-10  Anders Carlsson  <andersca@apple.com>
3871
3872         Move more functions to from SQLTransactionBackend to SQLTransaction
3873         https://bugs.webkit.org/show_bug.cgi?id=160752
3874
3875         Reviewed by Tim Horton.
3876
3877         * Modules/webdatabase/SQLTransaction.cpp:
3878         (WebCore::SQLTransaction::acquireLock):
3879         (WebCore::SQLTransaction::openTransactionAndPreflight):
3880         (WebCore::SQLTransaction::runStatements):
3881         (WebCore::SQLTransaction::cleanupAndTerminate):
3882         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
3883         * Modules/webdatabase/SQLTransaction.h:
3884         * Modules/webdatabase/SQLTransactionBackend.cpp:
3885         (WebCore::SQLTransactionBackend::acquireLock):
3886         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
3887         (WebCore::SQLTransactionBackend::runStatements):
3888         (WebCore::SQLTransactionBackend::cleanupAndTerminate):
3889         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
3890
3891 2016-08-10  Anders Carlsson  <andersca@apple.com>
3892
3893         Begin moving member functions from SQLTransactionBackend to SQLTransaction
3894         https://bugs.webkit.org/show_bug.cgi?id=160747
3895
3896         Reviewed by Tim Horton.
3897
3898         * Modules/webdatabase/Database.cpp:
3899         (WebCore::Database::performClose):
3900         * Modules/webdatabase/DatabaseTask.cpp:
3901         (WebCore::DatabaseTransactionTask::~DatabaseTransactionTask):
3902         (WebCore::DatabaseTransactionTask::doPerformTask):
3903         * Modules/webdatabase/SQLTransaction.cpp:
3904         (WebCore::SQLTransaction::executeSQL):
3905         (WebCore::SQLTransaction::lockAcquired):
3906         (WebCore::SQLTransaction::performNextStep):
3907         (WebCore::SQLTransaction::performPendingCallback):
3908         (WebCore::SQLTransaction::notifyDatabaseThreadIsShuttingDown):
3909         (WebCore::SQLTransaction::enqueueStatement):
3910         (WebCore::SQLTransaction::getNextStatement):
3911         (WebCore::SQLTransaction::runCurrentStatement):
3912         (WebCore::SQLTransaction::handleCurrentStatementError):
3913         (WebCore::SQLTransaction::handleTransactionError):
3914         (WebCore::SQLTransaction::postflightAndCommit):
3915         (WebCore::SQLTransaction::acquireOriginLock):
3916         (WebCore::SQLTransaction::releaseOriginLockIfNeeded):
3917         * Modules/webdatabase/SQLTransaction.h:
3918         (WebCore::SQLTransaction::backend): Deleted.
3919         * Modules/webdatabase/SQLTransactionBackend.cpp:
3920         (WebCore::SQLTransactionBackend::doCleanup):
3921         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
3922         (WebCore::SQLTransactionBackend::runStatements):
3923         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
3924         (WebCore::SQLTransactionBackend::enqueueStatement): Deleted.
3925         (WebCore::SQLTransactionBackend::performNextStep): Deleted.
3926         (WebCore::SQLTransactionBackend::executeSQL): Deleted.
3927         (WebCore::SQLTransactionBackend::lockAcquired): Deleted.
3928         (WebCore::SQLTransactionBackend::getNextStatement): Deleted.
3929         (WebCore::SQLTransactionBackend::runCurrentStatement): Deleted.
3930         (WebCore::SQLTransactionBackend::handleCurrentStatementError): Deleted.
3931         (WebCore::SQLTransactionBackend::handleTransactionError): Deleted.
3932         (WebCore::SQLTransactionBackend::postflightAndCommit): Deleted.
3933         (WebCore::SQLTransactionBackend::acquireOriginLock): Deleted.
3934         (WebCore::SQLTransactionBackend::releaseOriginLockIfNeeded): Deleted.
3935         * Modules/webdatabase/SQLTransactionBackend.h:
3936         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
3937         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
3938         (WebCore::SQLTransactionCoordinator::shutdown):
3939
3940 2016-08-10  Anders Carlsson  <andersca@apple.com>
3941
3942         Move all SQLTransactionBackend member variables to SQLTransaction
3943         https://bugs.webkit.org/show_bug.cgi?id=160745
3944
3945         Reviewed by Tim Horton.
3946
3947         * Modules/webdatabase/ChangeVersionWrapper.cpp:
3948         (WebCore::ChangeVersionWrapper::performPreflight):
3949         (WebCore::ChangeVersionWrapper::performPostflight):
3950         (WebCore::ChangeVersionWrapper::handleCommitFailedAfterPostflight):
3951         * Modules/webdatabase/ChangeVersionWrapper.h:
3952         (WebCore::ChangeVersionWrapper::sqlError): Deleted.
3953         * Modules/webdatabase/SQLTransaction.cpp:
3954         (WebCore::SQLTransaction::SQLTransaction):
3955         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
3956         (WebCore::SQLTransaction::deliverStatementCallback):
3957         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
3958         (WebCore::SQLTransaction::hasCallback): Deleted.
3959         (WebCore::SQLTransaction::hasSuccessCallback): Deleted.
3960         (WebCore::SQLTransaction::hasErrorCallback): Deleted.
3961         * Modules/webdatabase/SQLTransaction.h:
3962         (WebCore::SQLTransaction::isReadOnly):
3963         * Modules/webdatabase/SQLTransactionBackend.cpp:
3964         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
3965         (WebCore::SQLTransactionBackend::~SQLTransactionBackend):
3966         (WebCore::SQLTransactionBackend::doCleanup):
3967         (WebCore::SQLTransactionBackend::enqueueStatement):
3968         (WebCore::SQLTransactionBackend::computeNextStateAndCleanupIfNeeded):
3969         (WebCore::SQLTransactionBackend::executeSQL):
3970         (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown):
3971         (WebCore::SQLTransactionBackend::acquireLock):
3972         (WebCore::SQLTransactionBackend::lockAcquired):
3973         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
3974         (WebCore::SQLTransactionBackend::runStatements):
3975         (WebCore::SQLTransactionBackend::getNextStatement):
3976         (WebCore::SQLTransactionBackend::runCurrentStatement):
3977         (WebCore::SQLTransactionBackend::handleCurrentStatementError):
3978         (WebCore::SQLTransactionBackend::handleTransactionError):
3979         (WebCore::SQLTransactionBackend::postflightAndCommit):
3980         (WebCore::SQLTransactionBackend::cleanupAndTerminate):
3981         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
3982         (WebCore::SQLTransactionBackend::requestTransitToState):
3983         (WebCore::SQLTransactionBackend::acquireOriginLock):
3984         (WebCore::SQLTransactionBackend::releaseOriginLockIfNeeded):
3985         (WebCore::SQLTransactionBackend::currentStatement): Deleted.
3986         (WebCore::SQLTransactionBackend::transactionError): Deleted.
3987         (WebCore::SQLTransactionBackend::setShouldRetryCurrentStatement): Deleted.
3988         (WebCore::SQLTransactionBackend::enqueueStatementBackend): Deleted.
3989         * Modules/webdatabase/SQLTransactionBackend.h:
3990         (WebCore::SQLTransactionBackend::database): Deleted.
3991         (WebCore::SQLTransactionBackend::isReadOnly): Deleted.
3992         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
3993         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
3994         (WebCore::SQLTransactionCoordinator::releaseLock):
3995
3996 2016-08-10  Simon Fraser  <simon.fraser@apple.com>
3997
3998         Sort the project file.
3999
4000         * WebCore.xcodeproj/project.pbxproj:
4001
4002 2016-08-10  Simon Fraser  <simon.fraser@apple.com>
4003
4004         Sort the feature flags in the FEATURE_DEFINES lines
4005         https://bugs.webkit.org/show_bug.cgi?id=160742
4006
4007         Reviewed by Anders Carlsson.
4008
4009         * Configurations/FeatureDefines.xcconfig:
4010
4011 2016-08-10  Anders Carlsson  <andersca@apple.com>
4012
4013         Make SQLTransactionBackend a member of SQLTransaction
4014         https://bugs.webkit.org/show_bug.cgi?id=160741
4015
4016         Reviewed by Tim Horton.
4017
4018         This is another step towards merging SQLTransaction and SQLTransactionBackend.
4019
4020         * Modules/webdatabase/Database.cpp:
4021         (WebCore::Database::performClose):
4022         (WebCore::Database::scheduleTransaction):
4023         (WebCore::Database::scheduleTransactionStep):
4024         (WebCore::Database::runTransaction):
4025         * Modules/webdatabase/Database.h:
4026         * Modules/webdatabase/DatabaseTask.cpp:
4027         (WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
4028         (WebCore::DatabaseTransactionTask::~DatabaseTransactionTask):
4029         (WebCore::DatabaseTransactionTask::doPerformTask):
4030         * Modules/webdatabase/DatabaseTask.h:
4031         (WebCore::DatabaseTransactionTask::transaction):
4032         * Modules/webdatabase/DatabaseThread.cpp:
4033         * Modules/webdatabase/SQLTransaction.cpp:
4034         (WebCore::SQLTransaction::SQLTransaction):
4035         (WebCore::SQLTransaction::deliverTransactionCallback):
4036         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
4037         (WebCore::SQLTransaction::deliverStatementCallback):
4038         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
4039         (WebCore::SQLTransaction::deliverSuccessCallback):
4040         (WebCore::SQLTransaction::executeSQL):
4041         (WebCore::SQLTransaction::computeNextStateAndCleanupIfNeeded):
4042         (WebCore::SQLTransaction::setBackend): Deleted.
4043         * Modules/webdatabase/SQLTransaction.h:
4044         (WebCore::SQLTransaction::backend):
4045         * Modules/webdatabase/SQLTransactionBackend.cpp:
4046         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
4047         (WebCore::SQLTransactionBackend::doCleanup):
4048         (WebCore::SQLTransactionBackend::computeNextStateAndCleanupIfNeeded):
4049         (WebCore::SQLTransactionBackend::acquireLock):
4050         (WebCore::SQLTransactionBackend::lockAcquired):
4051         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
4052         (WebCore::SQLTransactionBackend::runCurrentStatement):
4053         (WebCore::SQLTransactionBackend::handleCurrentStatementError):
4054         (WebCore::SQLTransactionBackend::handleTransactionError):
4055         (WebCore::SQLTransactionBackend::postflightAndCommit):
4056         (WebCore::SQLTransactionBackend::requestTransitToState):
4057         (WebCore::SQLTransactionBackend::create): Deleted.
4058         * Modules/webdatabase/SQLTransactionBackend.h:
4059         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
4060         (WebCore::getDatabaseIdentifier):
4061         (WebCore::SQLTransactionCoordinator::processPendingTransactions):
4062         (WebCore::SQLTransactionCoordinator::acquireLock):
4063         (WebCore::SQLTransactionCoordinator::releaseLock):
4064         (WebCore::SQLTransactionCoordinator::shutdown):
4065         * Modules/webdatabase/SQLTransactionCoordinator.h:
4066
4067 2016-08-08  Simon Fraser  <simon.fraser@apple.com>
4068
4069         child-transform-with-anchor-point-expected.html renders incorrectly
4070         https://bugs.webkit.org/show_bug.cgi?id=160616
4071
4072         Reviewed by Zalan Bujtas.
4073         
4074         If a layer has perspective, we need to ensure that its bounds don't collapse to 0x0 when clipped out,
4075         otherwise the sublayerTransform geometry gets messed up.
4076
4077         Test: compositing/geometry/clipped-out-perspective.html
4078
4079         * rendering/RenderLayerBacking.cpp:
4080         (WebCore::RenderLayerBacking::updateCompositedBounds):
4081
4082 2016-08-09  Sam Weinig  <sam@webkit.org>
4083
4084         Remove support for array types in IDLs
4085         https://bugs.webkit.org/show_bug.cgi?id=160729
4086
4087         Reviewed by Anders Carlsson.
4088
4089         Array types have been removed from WebIDL in favor of sequence<> and FrozenArray<>.
4090
4091         - Replace all current uses of Array types with sequences. This causes
4092           no functional change.
4093
4094         * bindings/scripts/CodeGenerator.pm:
4095         * bindings/scripts/CodeGeneratorGObject.pm:
4096         * bindings/scripts/CodeGeneratorJS.pm:
4097         * bindings/scripts/IDLParser.pm:
4098         Remove array support from the generators.
4099
4100         * Modules/gamepad/Gamepad.idl:
4101         * Modules/gamepad/NavigatorGamepad.idl:
4102         * Modules/gamepad/deprecated/Gamepad.idl:
4103         * Modules/mediacontrols/MediaControlsHost.idl:
4104         * Modules/mediastream/MediaStream.idl:
4105         * Modules/mediastream/MediaTrackConstraints.idl:
4106         * Modules/mediastream/RTCConfiguration.idl:
4107         * Modules/mediastream/RTCIceServer.idl:
4108         * Modules/mediastream/RTCTrackEvent.idl:
4109         * crypto/CryptoKey.idl:
4110         * dom/MessageEvent.idl:
4111         * testing/Internals.idl:
4112         Switch from array to sequence.
4113
4114 2016-08-10  Alex Christensen  <achristensen@webkit.org>
4115
4116         Use unsigned for locations in URL
4117         https://bugs.webkit.org/show_bug.cgi?id=160706
4118
4119         Reviewed by Sam Weinig.
4120
4121         No change in behavior.
4122
4123         * platform/URL.cpp:
4124         (WebCore::isSchemeFirstChar):
4125         (WebCore::findFirstOf):
4126         (WebCore::checkEncodedString):
4127         (WebCore::URL::host):
4128         (WebCore::URL::protocolIs):
4129         (WebCore::URL::setPort):
4130         (WebCore::URL::setUser):
4131         (WebCore::URL::setPass):
4132         (WebCore::escapeAndAppendNonHierarchicalPart):
4133         (WebCore::copyPathRemovingDots):
4134         (WebCore::URL::serialize):
4135