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