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