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