Reduce ResourceRequest copying in loading code
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-06-06  Alex Christensen  <achristensen@webkit.org>
2
3         Reduce ResourceRequest copying in loading code
4         https://bugs.webkit.org/show_bug.cgi?id=158251
5
6         Reviewed by Darin Adler.
7
8         No new tests. There should be no change in behavior except fewer unnecessary copies.
9         Before, we would pass a const ResourceRequest& around, and if we needed to modify it
10         we would copy the whole thing, modify the copy, and pass the copy along.  This can be
11         accomplished with move semantics without the now-unnecessary copy.
12         
13         The biggest conceptual change is that the synchronous ResourceHandleClient::willSendRequest
14         used to take a non-const ResourceRequest& and modify it, but now it returns a modified
15         ResourceRequest instead.
16
17         * loader/ResourceLoader.cpp:
18         (WebCore::ResourceLoader::cannotShowURLError):
19         (WebCore::ResourceLoader::willSendRequest):
20         (WebCore::ResourceLoader::didSendData):
21         * loader/ResourceLoader.h:
22         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
23         (ResourceHandleStreamingClient::getOrCreateReadBuffer):
24         (ResourceHandleStreamingClient::willSendRequest):
25         (ResourceHandleStreamingClient::didReceiveResponse):
26         * platform/network/ResourceHandle.h:
27         * platform/network/ResourceHandleClient.cpp:
28         (WebCore::ResourceHandleClient::~ResourceHandleClient):
29         (WebCore::ResourceHandleClient::willSendRequest):
30         (WebCore::ResourceHandleClient::willSendRequestAsync):
31         (WebCore::ResourceHandleClient::didReceiveResponseAsync):
32         * platform/network/ResourceHandleClient.h:
33         (WebCore::ResourceHandleClient::didSendData):
34         (WebCore::ResourceHandleClient::didReceiveResponse):
35         (WebCore::ResourceHandleClient::loadingSynchronousXHR):
36         (WebCore::ResourceHandleClient::willSendRequest): Deleted.
37         * platform/network/SynchronousLoaderClient.cpp:
38         (WebCore::SynchronousLoaderClient::~SynchronousLoaderClient):
39         (WebCore::SynchronousLoaderClient::willSendRequest):
40         (WebCore::SynchronousLoaderClient::shouldUseCredentialStorage):
41         * platform/network/SynchronousLoaderClient.h:
42         * platform/network/cf/ResourceHandleCFNet.cpp:
43         (WebCore::ResourceHandle::cancel):
44         (WebCore::ResourceHandle::willSendRequest):
45         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
46         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
47         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
48         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willSendRequest):
49         * platform/network/mac/ResourceHandleMac.mm:
50         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
51         (WebCore::ResourceHandle::willSendRequest):
52         (WebCore::ResourceHandle::continueWillSendRequest):
53         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
54         (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
55         (-[WebCoreResourceHandleAsDelegate connectionShouldUseCredentialStorage:]):
56         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
57         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
58         * platform/network/soup/ResourceHandleSoup.cpp:
59         (WebCore::shouldRedirectAsGET):
60         (WebCore::continueAfterWillSendRequest):
61         (WebCore::readCallback):
62         (WebCore::ResourceHandle::continueWillSendRequest):
63         (WebCore::ResourceHandle::continueDidReceiveResponse):
64
65 2016-06-05  Sam Weinig  <sam@webkit.org>
66
67         Add experimental support for spring based CSS animations
68         https://bugs.webkit.org/show_bug.cgi?id=158403
69
70         Reviewed by Dean Jackson.
71
72         Adds experimental support for a new CSS animation timing function that uses
73         spring to model the time function. To use it you replace your normal timing
74         function, be it cubic-bezier or steps, with a new function called spring().
75         For instance, for a transition you would write:
76
77             transition-timing-function: spring(1 100 10 0);
78         
79         The parameters are, in order:
80             - Mass
81             - Stiffness
82             - Damping
83             - Initial Velocity
84
85         Tests: animations/spring-computed-style.html
86                animations/spring-function.html
87                animations/spring-parsing.html
88
89         * WebCore.xcodeproj/project.pbxproj:
90         Add new file.
91
92         * css/CSSComputedStyleDeclaration.cpp:
93         (WebCore::createTimingFunctionValue):
94         Modernize and add support for the spring function.
95
96         * css/CSSParser.cpp:
97         (WebCore::CSSParserContext::CSSParserContext):
98         (WebCore::operator==):
99         (WebCore::CSSParser::CSSParser):
100         (WebCore::CSSParser::parseTransformOriginShorthand):
101         (WebCore::CSSParser::isSpringTimingFunctionEnabled):
102         (WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
103         (WebCore::CSSParser::parseSpringTimingFunctionValue):
104         (WebCore::CSSParser::parseAnimationTimingFunction):
105         * css/CSSParser.h:
106         * css/CSSParserMode.h:
107         Add parsing support for the spring() function.
108
109         * css/CSSTimingFunctionValue.cpp:
110         (WebCore::CSSCubicBezierTimingFunctionValue::customCSSText):
111         (WebCore::CSSCubicBezierTimingFunctionValue::equals):
112         (WebCore::CSSStepsTimingFunctionValue::customCSSText):
113         (WebCore::CSSStepsTimingFunctionValue::equals):
114         (WebCore::CSSSpringTimingFunctionValue::customCSSText):
115         (WebCore::CSSSpringTimingFunctionValue::equals):
116         * css/CSSTimingFunctionValue.h:
117         (WebCore::CSSSpringTimingFunctionValue::create):
118         (WebCore::CSSSpringTimingFunctionValue::mass):
119         (WebCore::CSSSpringTimingFunctionValue::stiffness):
120         (WebCore::CSSSpringTimingFunctionValue::damping):
121         (WebCore::CSSSpringTimingFunctionValue::initialVelocity):
122         (WebCore::CSSSpringTimingFunctionValue::CSSSpringTimingFunctionValue):
123         Modernize and add support for the spring function.
124
125         * css/CSSToStyleMap.cpp:
126         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
127         Pipe the spring function into the animation.
128
129         * css/CSSValue.cpp:
130         (WebCore::CSSValue::equals):
131         (WebCore::CSSValue::cssText):
132         (WebCore::CSSValue::destroy):
133         * css/CSSValue.h:
134         (WebCore::CSSValue::isSpringTimingFunctionValue):
135         Add support for the spring function.
136         
137         * page/Settings.in:
138         Add a setting to control if the spring function is enabled.
139
140         * page/animation/AnimationBase.cpp:
141         (WebCore::solveSpringFunction):
142         (WebCore::AnimationBase::progress):
143         Add support for solving the spring function. Since the spring requires time to be absolute,
144         get the real time by multiplying the ratio t, to the total duration.
145
146         * platform/animation/TimingFunction.cpp:
147         (WebCore::operator<<):
148         * platform/animation/TimingFunction.h:
149         (WebCore::TimingFunction::~TimingFunction):
150         (WebCore::TimingFunction::isSpringTimingFunction):
151         Add support for the spring timing function.
152
153         * platform/graphics/SpringSolver.h: Added.
154         (WebCore::SpringSolver::SpringSolver):
155         (WebCore::SpringSolver::solve):
156         Add a Spring solver that matches the one in CoreAnimation.
157
158         * platform/graphics/ca/GraphicsLayerCA.cpp:
159         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
160         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
161         (WebCore::GraphicsLayerCA::createBasicAnimation):
162         (WebCore::GraphicsLayerCA::createSpringAnimation):
163         (WebCore::GraphicsLayerCA::setupAnimation):
164         * platform/graphics/ca/GraphicsLayerCA.h:
165         Map animations with spring timing functions to CASpringAnimations.
166
167         * platform/graphics/ca/PlatformCAAnimation.cpp:
168         (WebCore::operator<<):
169         (WebCore::PlatformCAAnimation::isBasicAnimation):
170         * platform/graphics/ca/PlatformCAAnimation.h:
171         (WebCore::PlatformCAAnimation::setActualStartTimeIfNeeded):
172         (WebCore::PlatformCAAnimation::PlatformCAAnimation):
173         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
174         (WebCore::toCAMediaTimingFunction):
175         (PlatformCAAnimationCocoa::PlatformCAAnimationCocoa):
176         (PlatformCAAnimationCocoa::setTimingFunction):
177         (PlatformCAAnimationCocoa::copyTimingFunctionFrom):
178         (PlatformCAAnimationCocoa::setFromValue):
179         (PlatformCAAnimationCocoa::copyFromValueFrom):
180         (PlatformCAAnimationCocoa::setToValue):
181         (PlatformCAAnimationCocoa::copyToValueFrom):
182         Add a new type of PlatformCAAnimation, Spring, which is a sub-type of Basic.
183
184 2016-06-05  Zalan Bujtas  <zalan@apple.com>
185
186         Addressing post-review comments on r201635.
187
188         Reviewed by Chris Dumez.
189
190         * rendering/RenderInline.h:
191         (WebCore::RenderInline::computeRectForRepaint):
192         * rendering/RenderObject.h:
193         (WebCore::RenderObject::RepaintContext::RepaintContext):
194         (WebCore::RenderObject::computeRectForRepaint):
195         * rendering/RenderTableCell.h:
196         * rendering/RenderView.h:
197         * rendering/svg/RenderSVGForeignObject.h:
198         * rendering/svg/RenderSVGText.h:
199
200 2016-06-05  Yusuke Suzuki  <utatane.tea@gmail.com>
201
202         Change ProxyObject.[[Get]] not to use custom accessor
203         https://bugs.webkit.org/show_bug.cgi?id=157080
204
205         Reviewed by Darin Adler.
206
207         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
208         (WebCore::getProperty):
209         * bindings/js/JSDOMBinding.h:
210         (WebCore::nonCachingStaticFunctionGetter):
211         * bindings/js/JSDOMWindowCustom.cpp:
212         (WebCore::jsDOMWindowWebKit):
213         * bindings/js/JSDictionary.cpp:
214         (WebCore::JSDictionary::tryGetProperty):
215         * bindings/js/JSPluginElementFunctions.cpp:
216         (WebCore::pluginElementPropertyGetter):
217         * bindings/js/JSPluginElementFunctions.h:
218         * bindings/scripts/CodeGeneratorJS.pm:
219         (GenerateHeader):
220         (GenerateImplementation):
221         * bindings/scripts/test/JS/JSInterfaceName.cpp:
222         (WebCore::jsInterfaceNameConstructor):
223         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
224         (WebCore::jsTestActiveDOMObjectExcitingAttr):
225         (WebCore::jsTestActiveDOMObjectConstructor):
226         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
227         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
228         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
229         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
230         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
231         (WebCore::jsTestCustomNamedGetterConstructor):
232         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
233         (WebCore::jsTestEventConstructorAttr1):
234         (WebCore::jsTestEventConstructorAttr2):
235         (WebCore::jsTestEventConstructorAttr3):
236         (WebCore::jsTestEventConstructorConstructor):
237         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
238         (WebCore::jsTestEventTargetConstructor):
239         * bindings/scripts/test/JS/JSTestException.cpp:
240         (WebCore::jsTestExceptionName):
241         (WebCore::jsTestExceptionConstructor):
242         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
243         (WebCore::jsTestGenerateIsReachableConstructor):
244         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
245         (WebCore::jsTestGlobalObjectRegularAttribute):
246         (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttribute):
247         (WebCore::jsTestGlobalObjectConstructor):
248         * bindings/scripts/test/JS/JSTestInterface.cpp:
249         (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr):
250         (WebCore::jsTestInterfaceConstructorImplementsStaticAttr):
251         (WebCore::jsTestInterfaceImplementsStr1):
252         (WebCore::jsTestInterfaceImplementsStr2):
253         (WebCore::jsTestInterfaceImplementsStr3):
254         (WebCore::jsTestInterfaceImplementsNode):
255         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
256         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
257         (WebCore::jsTestInterfaceSupplementalStr1):
258         (WebCore::jsTestInterfaceSupplementalStr2):
259         (WebCore::jsTestInterfaceSupplementalStr3):
260         (WebCore::jsTestInterfaceSupplementalNode):
261         (WebCore::jsTestInterfaceConstructor):
262         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
263         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
264         (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
265         (WebCore::jsTestJSBuiltinConstructorConstructor):
266         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
267         (WebCore::jsTestMediaQueryListListenerConstructor):
268         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
269         (WebCore::jsTestNamedConstructorConstructor):
270         * bindings/scripts/test/JS/JSTestNode.cpp:
271         (WebCore::jsTestNodeName):
272         (WebCore::jsTestNodeConstructor):
273         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
274         (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr):
275         (WebCore::jsTestNondeterministicNondeterministicWriteableAttr):
276         (WebCore::jsTestNondeterministicNondeterministicExceptionAttr):
277         (WebCore::jsTestNondeterministicNondeterministicGetterExceptionAttr):
278         (WebCore::jsTestNondeterministicNondeterministicSetterExceptionAttr):
279         (WebCore::jsTestNondeterministicConstructor):
280         * bindings/scripts/test/JS/JSTestObj.cpp:
281         (WebCore::jsTestObjReadOnlyLongAttr):
282         (WebCore::jsTestObjReadOnlyStringAttr):
283         (WebCore::jsTestObjReadOnlyTestObjAttr):
284         (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr):
285         (WebCore::jsTestObjConstructorStaticStringAttr):
286         (WebCore::jsTestObjConstructorTestSubObj):
287         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
288         (WebCore::jsTestObjEnumAttr):
289         (WebCore::jsTestObjByteAttr):
290         (WebCore::jsTestObjOctetAttr):
291         (WebCore::jsTestObjShortAttr):
292         (WebCore::jsTestObjClampedShortAttr):
293         (WebCore::jsTestObjEnforceRangeShortAttr):
294         (WebCore::jsTestObjUnsignedShortAttr):
295         (WebCore::jsTestObjLongAttr):
296         (WebCore::jsTestObjLongLongAttr):
297         (WebCore::jsTestObjUnsignedLongLongAttr):
298         (WebCore::jsTestObjStringAttr):
299         (WebCore::jsTestObjTestObjAttr):
300         (WebCore::jsTestObjTestNullableObjAttr):
301         (WebCore::jsTestObjLenientTestObjAttr):
302         (WebCore::jsTestObjUnforgeableAttr):
303         (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
304         (WebCore::jsTestObjXMLObjAttr):
305         (WebCore::jsTestObjCreate):
306         (WebCore::jsTestObjReflectedStringAttr):
307         (WebCore::jsTestObjReflectedIntegralAttr):
308         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
309         (WebCore::jsTestObjReflectedBooleanAttr):
310         (WebCore::jsTestObjReflectedURLAttr):
311         (WebCore::jsTestObjReflectedCustomIntegralAttr):
312         (WebCore::jsTestObjReflectedCustomBooleanAttr):
313         (WebCore::jsTestObjReflectedCustomURLAttr):
314         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
315         (WebCore::jsTestObjTypedArrayAttr):
316         (WebCore::jsTestObjAttrWithGetterException):
317         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
318         (WebCore::jsTestObjAttrWithSetterException):
319         (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
320         (WebCore::jsTestObjStringAttrWithGetterException):
321         (WebCore::jsTestObjStringAttrWithSetterException):
322         (WebCore::jsTestObjStrictTypeCheckingAttribute):
323         (WebCore::jsTestObjCustomAttr):
324         (WebCore::jsTestObjOnfoo):
325         (WebCore::jsTestObjOnwebkitfoo):
326         (WebCore::jsTestObjWithScriptStateAttribute):
327         (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
328         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
329         (WebCore::jsTestObjWithScriptStateAttributeRaises):
330         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
331         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
332         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
333         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
334         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
335         (WebCore::jsTestObjConditionalAttr1):
336         (WebCore::jsTestObjConditionalAttr2):
337         (WebCore::jsTestObjConditionalAttr3):
338         (WebCore::jsTestObjConditionalAttr4Constructor):
339         (WebCore::jsTestObjConditionalAttr5Constructor):
340         (WebCore::jsTestObjConditionalAttr6Constructor):
341         (WebCore::jsTestObjCachedAttribute1):
342         (WebCore::jsTestObjCachedAttribute2):
343         (WebCore::jsTestObjAnyAttribute):
344         (WebCore::jsTestObjContentDocument):
345         (WebCore::jsTestObjMutablePoint):
346         (WebCore::jsTestObjImmutablePoint):
347         (WebCore::jsTestObjStrawberry):
348         (WebCore::jsTestObjStrictFloat):
349         (WebCore::jsTestObjDescription):
350         (WebCore::jsTestObjId):
351         (WebCore::jsTestObjHash):
352         (WebCore::jsTestObjReplaceableAttribute):
353         (WebCore::jsTestObjNullableDoubleAttribute):
354         (WebCore::jsTestObjNullableLongAttribute):
355         (WebCore::jsTestObjNullableBooleanAttribute):
356         (WebCore::jsTestObjNullableStringAttribute):
357         (WebCore::jsTestObjNullableLongSettableAttribute):
358         (WebCore::jsTestObjNullableStringSettableAttribute):
359         (WebCore::jsTestObjNullableStringValue):
360         (WebCore::jsTestObjAttribute):
361         (WebCore::jsTestObjAttributeWithReservedEnumType):
362         (WebCore::jsTestObjPutForwardsAttribute):
363         (WebCore::jsTestObjPutForwardsNullableAttribute):
364         (WebCore::jsTestObjConstructor):
365         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
366         (WebCore::jsTestOverloadedConstructorsConstructor):
367         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
368         (WebCore::jsTestOverrideBuiltinsConstructor):
369         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
370         (WebCore::jsTestSerializedScriptValueInterfaceValue):
371         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
372         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
373         (WebCore::jsTestSerializedScriptValueInterfacePorts):
374         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
375         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
376         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
377         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
378         (WebCore::jsTestTypedefsImmutableSerializedScriptValue):
379         (WebCore::jsTestTypedefsConstructorTestSubObj):
380         (WebCore::jsTestTypedefsAttrWithGetterException):
381         (WebCore::jsTestTypedefsAttrWithSetterException):
382         (WebCore::jsTestTypedefsStringAttrWithGetterException):
383         (WebCore::jsTestTypedefsStringAttrWithSetterException):
384         (WebCore::jsTestTypedefsConstructor):
385         * bindings/scripts/test/JS/JSattribute.cpp:
386         (WebCore::jsattributeReadonly):
387         (WebCore::jsattributeConstructor):
388         * bindings/scripts/test/JS/JSreadonly.cpp:
389         (WebCore::jsreadonlyConstructor):
390         * bridge/runtime_array.cpp:
391         (JSC::RuntimeArray::lengthGetter):
392         * bridge/runtime_array.h:
393         * bridge/runtime_method.cpp:
394         (JSC::RuntimeMethod::lengthGetter):
395         * bridge/runtime_method.h:
396         * bridge/runtime_object.cpp:
397         (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
398         (JSC::Bindings::RuntimeObject::fieldGetter):
399         (JSC::Bindings::RuntimeObject::methodGetter):
400         * bridge/runtime_object.h:
401
402 2016-06-03  Gavin & Ellie Barraclough  <barraclough@apple.com>
403
404         Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
405         https://bugs.webkit.org/show_bug.cgi?id=158178
406
407         Reviewed by Darin Adler.
408
409         As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
410         overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
411
412         Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.
413
414         * bindings/js/JSDOMWindowCustom.cpp:
415         (WebCore::JSDOMWindow::getOwnPropertySlot):
416             - getStaticPropertySlot -> Base::getOwnPropertySlot.
417         * bindings/js/JSPluginElementFunctions.h:
418         (WebCore::pluginElementCustomGetOwnPropertySlot):
419             - Switch call from getStaticValueSlot to Type::getOwnPropertySlot.
420               For any element where Type::hasStaticPropertyTable is true the HasStaticPropertyTable
421               structure flag will also be set, so Type::getOwnPropertySlot will do the same thing.
422         * bindings/scripts/CodeGeneratorJS.pm:
423         (PrototypeHasStaticPropertyTable):
424             - Was PrototypeOverridesGetOwnPropertySlot; prototypes now never need override getOwnPropertySlot so renaming accordingly.
425         (GenerateImplementation):
426             - Removed generation of getOwnPropertySlot body for DOMGlobalObjects.
427         (GeneratePrototypeDeclaration):
428             - For DOMGlobalObjects, set HasStaticPropertyTable instead of OverridesGetOwnPropertySlot & removed getOwnPropertySlot declaration.
429         (PrototypeOverridesGetOwnPropertySlot): Deleted.
430             Renamed to PrototypeHasStaticPropertyTable.
431         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
432         * bindings/scripts/test/JS/JSTestGlobalObject.h:
433             - Updating bindings test results.
434
435 2016-06-05  Antti Koivisto  <antti@apple.com>
436
437         Find on page finds too many matches
438         https://bugs.webkit.org/show_bug.cgi?id=158395
439         rdar://problem/7440637
440
441         Reviewed by Dan Bernstein and Darin Adler.
442
443         There is a long standing bug where in some cases WebKit may find non-visible text matches when doing find on page.
444         For example searching patch review view in bugs.webkit.org returns twice as many matches as there actually are
445         on the page. This happens because the text content is replicated in an invisible subframe.
446
447         Fix by making TextIterator ignore content in non-visible subframes in findPlainText.
448
449         Test: editing/text-iterator/count-matches-in-frames.html
450
451         * editing/TextIterator.cpp:
452         (WebCore::nextInPreOrderCrossingShadowBoundaries):
453
454             Remove support for an uninteresting assertion.
455
456         (WebCore::fullyClipsContents):
457
458             Elements without renderer clip their content (except for display:contents).
459             Test the content rect instead of the size rect for emptiness.
460
461         (WebCore::ignoresContainerClip):
462         (WebCore::pushFullyClippedState):
463         (WebCore::setUpFullyClippedStack):
464         (WebCore::isClippedByFrameAncestor):
465
466             Test if the frame owner element is clipped in any of the parent frames.
467
468         (WebCore::TextIterator::TextIterator):
469
470             If the frame is clipped by its ancestors the iterator is initialized to end state.
471             Clipped frame never renders anything so there is no need to maintain clip stack and traverse.
472
473         (WebCore::findPlainText):
474
475             Use TextIteratorClipsToFrameAncestors behavior. There might be other places where
476             this behavior should be used (or perhaps it should be used always?) but limit this to
477             text search for now.
478
479         (WebCore::depthCrossingShadowBoundaries): Deleted.
480         * editing/TextIterator.h:
481         * editing/TextIteratorBehavior.h:
482
483             Add TextIteratorClipsToFrameAncestors behavior.
484
485         * testing/Internals.cpp:
486         (WebCore::Internals::countMatchesForText):
487         (WebCore::Internals::countFindMatches):
488         (WebCore::Internals::numberOfLiveNodes):
489         * testing/Internals.h:
490         * testing/Internals.idl:
491
492             Testing support
493
494 2016-06-05  Konstantin Tokarev  <annulen@yandex.ru>
495
496         Do not construct temporary copy of String from AtomicString.
497         https://bugs.webkit.org/show_bug.cgi?id=158400
498
499         Reviewed by Darin Adler.
500
501         No new tests needed.
502
503         * accessibility/AccessibilityObject.cpp:
504         (WebCore::AccessibilityObject::ariaReadOnlyValue):
505
506 2016-06-05  Andreas Kling  <akling@apple.com>
507
508         Give RuleFeatures::classesMatchingAncestors some inline capacity.
509         <https://webkit.org/b/158356>
510
511         Reviewed by Darin Adler.
512
513         Avoid 362'000 heap allocations on PLUM (1.3% of all transient fastMallocs) by giving
514         RuleFeatures::classesMatchingAncestors some inline capacity (32).
515         This class is only ever allocated on the stack anyway.
516
517         * css/RuleFeature.h:
518
519 2016-06-05  Brady Eidson  <beidson@apple.com>
520
521         Unreviewed, rolling out r201693.
522
523         Can't fix right now
524
525         Reverted changeset:
526
527         "Modern IDB: Crash seen in IDBConnectionProxy::putOrAdd on
528         GuardMalloc bot"
529         https://bugs.webkit.org/show_bug.cgi?id=158124
530         http://trac.webkit.org/changeset/201693
531
532 2016-06-04  Brady Eidson  <beidson@apple.com>
533
534         Modern IDB: Crash seen in IDBConnectionProxy::putOrAdd on GuardMalloc bot
535         https://bugs.webkit.org/show_bug.cgi?id=158124
536
537         Reviewed by Darin Adler.
538
539         No new tests (Covered by existing test configurations).
540
541         * Modules/indexeddb/IDBTransaction.cpp:
542         (WebCore::IDBTransaction::putOrAddOnServer):
543         
544         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
545         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
546         
547         * Modules/indexeddb/client/IDBConnectionProxy.h:
548         (WebCore::IDBClient::IDBConnectionProxy::callConnectionOnMainThread):
549         
550         * bindings/js/SerializedScriptValue.cpp:
551         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
552         * bindings/js/SerializedScriptValue.h:
553         
554         * platform/network/BlobRegistry.h:
555         * platform/network/BlobRegistryImpl.cpp:
556         (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
557         * platform/network/BlobRegistryImpl.h:
558
559 2016-06-03  Ada Chan  <adachan@apple.com>
560
561         REGRESSION (r201474): Should set overflow: hidden on -webkit-media-controls when placeholder is showing
562         https://bugs.webkit.org/show_bug.cgi?id=158377
563
564         Reviewed by Darin Adler.
565
566         In r201474, we defer removing the hidden class from inlinePlaybackPlaceholder until
567         showInlinePlaybackPlaceholderWhenSafe(). We also need to move the code that adds the
568         placeholder-showing class to -webkit-media-controls to that method.
569
570         * Modules/mediacontrols/mediaControlsApple.js:
571         (Controller.prototype.showInlinePlaybackPlaceholderWhenSafe):
572         Add the "placeholder-showing" class to -webkit-media-controls when we show the placeholder.
573         (Controller.prototype.handlePresentationModeChange):
574         Remove the "placeholder-showing" class from -webkit-media-controls when we hide the
575         placeholder. Remove the old code that adds and removes that class.
576
577 2016-06-04  Darin Adler  <darin@apple.com>
578
579         leaks seen in fast/css/variables tests
580         https://bugs.webkit.org/show_bug.cgi?id=150728
581
582         Reviewed by Anders Carlsson.
583
584         Fixes leaks seen running fast/css/variables tests with leak checking turned on.
585
586         * css/CSSPrimitiveValue.cpp:
587         (WebCore::isStringType): Added. For debugging purposes so we catch cases where we
588         are not treating strings consistently between construction and destruction.
589         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Assert isStringType returns true.
590         (WebCore::CSSPrimitiveValue::cleanup): Added CSS_DIMENSION and CSS_PARSER_IDENTIFIER
591         to the list of types that have to decrement the reference count of the string we own.
592         Both types are passed to the string constructor above.
593
594         * css/CSSValueList.cpp:
595         (WebCore::CSSValueList::buildParserValueListSubstitutingVariables): Restructured the
596         code so we destroy any CSSParserValue that we don't use. This is needed because of the
597         peculiar requirements of CSSParserValue: it has a be a struct without a destructor so
598         it can be used in the CSS grammar, so we have to destroy it explicitly. Ideally we would
599         minimize any use of it outside the CSSParser itself, but as long as we are using it, we
600         need to do this explicit destruction.
601
602 2016-06-04  Anders Carlsson  <andersca@apple.com>
603
604         32-bit build fix
605         https://bugs.webkit.org/show_bug.cgi?id=158383
606         rdar://problem/26628125
607
608         Reviewed by Dan Bernstein.
609
610         Synthesize the webPlaybackSessionInterfaceMac property.
611
612         * platform/mac/WebPlaybackControlsManager.mm:
613
614 2016-06-04  Chris Dumez  <cdumez@apple.com>
615
616         Avoid redundant isUndefined() check for parameters that are both optional and nullable in overloads
617         https://bugs.webkit.org/show_bug.cgi?id=158380
618
619         Reviewed by Brady Eidson.
620
621         * bindings/scripts/CodeGeneratorJS.pm:
622         (GenerateParametersCheckExpression):
623         * bindings/scripts/test/JS/JSTestObj.cpp:
624         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
625
626 2016-06-04  Brent Fulgham  <bfulgham@apple.com>
627
628         CSP: Content Security Policy directive, upgrade-insecure-requests (UIR)
629         https://bugs.webkit.org/show_bug.cgi?id=143653
630         <rdar://problem/23032067>
631
632         Reviewed by Andy Estes.
633
634         Modify our loading logic so that we recognize and upgrade insecure requests to secure
635         requests if the Content Security Policy directive 'upgrade-insecure-requests' is
636         present.
637         
638         Add a static helper function to ContentSecurityPolicy to upgrade insecure URLs so
639         that we don't have to sprinkle the same code all over the loader system.
640
641         Tests: http/tests/security/contentSecurityPolicy/report-only-upgrade-insecure.php
642                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade-cors.https.html
643                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/basic-upgrade.https.html
644                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/form-upgrade.html
645                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/https-header-auxiliary.html
646                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/https-header-nested.html
647                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/https-header-subresource.html
648                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/https-header-top-level.html
649                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https.html
650                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-nested-upgrades.html
651                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-open-window-upgrades.html
652                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-audio-video-in-main-frame.html
653                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-css-in-iframe.html
654                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-image-in-main-frame.html
655                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-simple-ws.html
656                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-xhr-in-main-frame.html
657                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-redirect-http-to-https-script-in-iframe.html
658                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-redirect-https-to-http-script-in-iframe.html
659                http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrades-mixed-content.html
660                http/tests/ssl/iframe-upgrade.https.html
661                http/tests/ssl/upgrade-origin-usage.html
662                http/tests/websocket/tests/hybi/upgrade-simple-ws.html
663
664         * Modules/websockets/WebSocket.cpp:
665         (WebCore::WebSocket::connect): Upgrade insecure requests if the CSP
666         indicates we should.
667         * dom/Document.cpp:
668         (WebCore::Document::initSecurityContext): Populate new document CSP with sets of upgrade host and port combinations.
669         * dom/ScriptElement.cpp:
670         (WebCore::ScriptElement::requestScript): Upgrade insecure requests if
671         the CSP indicates we should.
672         * html/HTMLMediaElement.cpp:
673         (WebCore::HTMLMediaElement::loadResource): Ditto.
674         * loader/DocumentWriter.cpp:
675         (WebCore::DocumentWriter::begin): Ditto.
676         * loader/FormSubmission.cpp:
677         (WebCore::FormSubmission::create): Ditto.
678         (WebCore::FormSubmission::populateFrameLoadRequest): Add "Upgrade-Insecure-Requests"
679         header to frame load requests.
680         * loader/FrameLoader.cpp:
681         (WebCore::FrameLoader::addExtraFieldsToMainResourceRequest): Add the
682         'Update-Insecure-Requests' header field if necessary.
683         (WebCore::FrameLoader::addHTTPUpgradeInsecureRequestsIfNeeded): Added helper function.
684         (WebCore::FrameLoader::loadPostRequest): Upgrade insecure requests if the CSP
685         indicates we should.
686         (WebCore::FrameLoader::loadResourceSynchronously): Ditto.
687         (WebCore::FrameLoader::loadDifferentDocumentItem): If loading a form, add the
688         'Update-Insecure-Requests' header field if necessary.
689         (WebCore::createWindow): Upgrade insecure requests if the CSP
690         indicates we should.
691         * loader/FrameLoader.h:
692         * loader/PingLoader.cpp:
693         (WebCore::PingLoader::loadImage): Upgrade insecure requests if the CSP
694         indicates we should.
695         (WebCore::PingLoader::sendPing): Ditto.
696         (WebCore::PingLoader::sendViolationReport): Ditto.
697         * loader/ResourceLoader.cpp:
698         (WebCore::ResourceLoader::willSendRequestInternal): Ditto.
699         * loader/SubframeLoader.cpp:
700         (WebCore::SubframeLoader::requestFrame): Ditto.
701         (WebCore::SubframeLoader::requestObject): Ditto.
702         * loader/appcache/ApplicationCacheHost.cpp:
703         (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache): Ditto.
704         * loader/cache/CachedResourceLoader.cpp:
705         (WebCore::CachedResourceLoader::requestImage): Ditto.
706         (WebCore::CachedResourceLoader::requestResource): Ditto.
707         * page/DOMWindow.cpp:
708         (WebCore::DOMWindow::createWindow): Add the 'Update-Insecure-Requests' header
709         field if necessary.
710         * page/csp/ContentSecurityPolicy.cpp:
711         (WebCore::ContentSecurityPolicy::copyStateFrom): Populate upgraded resource set
712         from other context.
713         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded): Added helper function
714         to upgrade requests when the upgrade-insecure-requests CSP policy is present, or if
715         the host and port combination have previously been upgraded.
716         (WebCore::ContentSecurityPolicy::upgradeInsecureNavigationRequestIfNeeded): Added
717         helper function to upgrade requests that have been previously upgraded. Cross-site
718         navigations only get upgraded when they have been previously upgraded.
719         (WebCore::ContentSecurityPolicy::addInsecureNavigationRequestsToUpgrade): Added.
720         (WebCore::ContentSecurityPolicy::populateInsecureNavigationRequestsToUpgradeFromOther): Added.
721         * page/csp/ContentSecurityPolicy.h:
722         (WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests): Added.
723         (WebCore::ContentSecurityPolicy::upgradeInsecureRequests): Added.
724         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
725         (WebCore::ContentSecurityPolicyDirectiveList::ContentSecurityPolicyDirectiveList): Use
726         more C++11 initializations.
727         (WebCore::ContentSecurityPolicyDirectiveList::setUpgradeInsecureRequests): Added.
728         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Teach this function to
729         recognize the new directive.
730         * page/csp/ContentSecurityPolicyDirectiveList.h:
731         * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
732         * page/csp/ContentSecurityPolicyDirectiveNames.h:
733         * platform/network/HTTPHeaderNames.in: Add new 'Upgrade-Insecure-Requests' header field.
734         * xml/XMLHttpRequest.cpp:
735         (WebCore::XMLHttpRequest::open): Upgrade insecure requests if the CSP if needed.
736
737 2016-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
738
739         Bopomofo ruby in Dictionary.app is written horizontally (when it should be written vertically)
740         https://bugs.webkit.org/show_bug.cgi?id=158245
741         <rdar://problem/25675318>
742
743         Reviewed by Darin Adler.
744
745         With orthogonal flows, the inner element gets a logical width that is computed from two values:
746         - The containing block's available logical height
747         - The FrameView's visibleHeight
748
749         In Dictionary.app, the FrameView's height changes, but this element doesn't get relaid out.
750         This is because of our optimization where normal-flow elements don't get relaid out if their
751         parent's width doesn't change (which is the case here).
752
753         Therefore, this orthogonal writing mode element should be relaid out when the FrameView changes
754         size. Luckily, we already have machinery for doing this: percentage heights. In quirks mode, a
755         div with a percentage height may walk arbitrarily far up the DOM tree in order to determine which
756         element the percentage should be resolved against. Therefore, we have a map of percentage-sizing-
757         ancestors to percentage-sizing-descendants which speeds up this search. If a percentage-sizing-
758         ancestor gets relaid out, all the relevant percentage-sizing-descendants get relaid out too.
759
760         Therefore, we can simply mark the FrameView as a percentage-sizing-ancestor and the orthogonal
761         flow element as a percentage-sizing-descendant. The lifetime of this relationship is already
762         managed correctly - it gets reset when style changes and when the renderer is destroyed, and
763         is created during layout.
764
765         Unfortunately, this same treatment should also be done to the element which dictates the
766         containing block's logical height (which caused https://bugs.webkit.org/show_bug.cgi?id=158286).
767         Implementing this would require giving RenderBox::availableLogicalHeight() a second result
768         of the necessary element which dictates the return. In an effort to keep this patch small and
769         focused, I'll do this secondary (much larger) work in a patch on that bug. This patch,
770         therefore, is kept small and focused.
771
772         Test: fast/text/orthogonal-writing-mode-containing-block-frameView-resize-relayout.html
773
774         * rendering/RenderBox.cpp:
775         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
776
777 2016-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
778
779         Text not visible while external font downloading
780         https://bugs.webkit.org/show_bug.cgi?id=25207
781         <rdar://problem/15167413>
782
783         Reviewed by Dean Jackson.
784
785         I already laid the groundwork for this when implementing the CSS Font Loading API.
786         We only have to create a timer and correctly respond to it timing out (by setting
787         state).
788
789         This patch also adds a new internal setting which puts us in a mode where font
790         loads never complete and the timeout occurs immediately. This is so we can test
791         the fallback behavior.
792
793         Test: fast/text/web-font-load-fallback-during-loading.html
794
795         * css/CSSFontFace.cpp:
796         (WebCore::CSSFontFace::CSSFontFace):
797         (WebCore::CSSFontFace::fontLoadEventOccurred):
798         (WebCore::CSSFontFace::timeoutFired):
799         (WebCore::CSSFontFace::setStatus):
800         (WebCore::CSSFontFace::fontLoaded):
801         (WebCore::CSSFontFace::webFontsShouldAlwaysFallBack):
802         (WebCore::CSSFontFace::pump):
803         (WebCore::CSSFontFace::font):
804         * css/CSSFontFace.h:
805         * css/CSSFontFaceSource.cpp:
806         (WebCore::CSSFontFaceSource::fontLoaded):
807         * css/FontFace.cpp:
808         (WebCore::FontFace::fontStateChanged):
809         * page/Settings.cpp:
810         (WebCore::Settings::Settings):
811         (WebCore::Settings::setWebFontsAlwaysFallBack):
812         * page/Settings.h:
813         (WebCore::Settings::webFontsAlwaysFallBack):
814         * testing/InternalSettings.cpp:
815         (WebCore::InternalSettings::Backup::Backup):
816         (WebCore::InternalSettings::Backup::restoreTo):
817         (WebCore::InternalSettings::setWebFontsAlwaysFallBack):
818         * testing/InternalSettings.h:
819         * testing/InternalSettings.idl:
820
821 2016-06-03  Chris Dumez  <cdumez@apple.com>
822
823         Modernize a few more lambda captures
824         https://bugs.webkit.org/show_bug.cgi?id=158370
825
826         Reviewed by Brady Eidson.
827
828         * workers/DedicatedWorkerGlobalScope.cpp:
829         (WebCore::DedicatedWorkerGlobalScope::postMessage):
830         * workers/DedicatedWorkerGlobalScope.h:
831         * workers/Worker.cpp:
832         (WebCore::Worker::postMessage):
833         * workers/Worker.h:
834         * workers/WorkerEventQueue.cpp:
835         (WebCore::WorkerEventQueue::enqueueEvent):
836         * workers/WorkerGlobalScopeProxy.h:
837         * workers/WorkerMessagingProxy.cpp:
838         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
839         (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
840         * workers/WorkerMessagingProxy.h:
841         * workers/WorkerObjectProxy.h:
842
843 2016-06-03  Commit Queue  <commit-queue@webkit.org>
844
845         Unreviewed, rolling out r201663.
846         https://bugs.webkit.org/show_bug.cgi?id=158374
847
848         Broke the Windows build (Requested by andersca on #webkit).
849
850         Reverted changeset:
851
852         "Rename NoncopyableFunction to Function"
853         https://bugs.webkit.org/show_bug.cgi?id=158354
854         http://trac.webkit.org/changeset/201663
855
856 2016-06-03  Ryosuke Niwa  <rniwa@webkit.org>
857
858         Crash under VisibleSelection::firstRange()
859         https://bugs.webkit.org/show_bug.cgi?id=158241
860
861         Reviewed by Enrica Casucci.
862
863         The crash was commonly caused by parentAnchoredEquivalent returning null when the anchored node was a shadow root.
864         Fixed it by returning a shadow root in parentAnchoredEquivalent.
865
866         Also guard against other kinds of crashes by adding a null check in VisibleSelection::firstRange() since we've seen
867         a crash in the same code path outside of a shadow tree.
868
869         This patch also fixes other Position methods to stop using nonShadowBoundaryParentNode in place of parentNode as
870         that would cause a similar crash and/or a bug elsewhere.
871
872         Test: fast/shadow-dom/selection-at-shadow-root-crash.html
873
874         * accessibility/AXObjectCache.cpp:
875         (AXObjectCache::startCharacterOffsetOfParagraph): Fixed a bug uncovered by the assertion fix in Position::Position.
876         This code was sometimes creating a position inside a BR, which is wrong.
877         (AXObjectCache::endCharacterOffsetOfParagraph): Ditto.
878         * dom/Position.cpp:
879         (WebCore::Position::Position): Fixed an assertion which was checking that this constructor wasn't being called
880         with m_anchorNode set to an element editing ignores content of. ||ing it with isShadowRoot() made this assertion
881         useless because it's true whenever m_anchorNode is not a shadow root.
882         (WebCore::Position::containerNode): Use parentNode() instead of findParent() which calls nonShadowBoundaryParentNode
883         since Position should
884         (WebCore::Position::parentAnchoredEquivalent): Fixed the bug by letting this function return a shadow root.
885         (WebCore::Position::previous): Use parentNode() instead of findParent().
886         (WebCore::Position::next): Ditto.
887         (WebCore::Position::atStartOfTree): Ditto.
888         (WebCore::Position::atEndOfTree): Ditto.
889         (WebCore::Position::findParent): Deleted.
890         * dom/Position.h:
891         * editing/VisibleSelection.cpp:
892         (VisibleSelection::firstRange): Added a null check. 
893
894 2016-06-03  Zalan Bujtas  <zalan@apple.com>
895
896         Incorrect rendering on boostmobile FAQ page
897         https://bugs.webkit.org/show_bug.cgi?id=158303
898         <rdar://problem/26603462>
899
900         Reviewed by Chris Dumez.
901
902         Initial value for background-color is 'transparent'. see https://drafts.csswg.org/css-backgrounds-3/#background-color
903
904         Test: fast/selectors/non-visited-link-backround-color.html
905
906         * css/CSSPropertyNames.in:
907
908 2016-06-03  Brady Eidson  <beidson@apple.com>
909
910         More miscellaneous IDBBindingUtilities cleanup.
911         https://bugs.webkit.org/show_bug.cgi?id=158359
912
913         Reviewed by Tim Horton.
914
915         No new tests (Straight refactor, yo).
916
917         Replace more ScriptExecutionContext&s with ExecState&s.
918         Combine more unnecessarily separate functions.
919         Remove some cruft.
920         
921         * Modules/indexeddb/IDBCursor.cpp:
922         (WebCore::IDBCursor::setGetResult):
923         
924         * Modules/indexeddb/IDBRequest.cpp:
925         (WebCore::IDBRequest::setResult):
926         (WebCore::IDBRequest::setResultToStructuredClone):
927         
928         * Modules/indexeddb/server/MemoryObjectStore.cpp:
929         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
930         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
931         
932         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
933         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
934         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
935         
936         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
937         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
938         
939         * bindings/js/IDBBindingUtilities.cpp:
940         (WebCore::deserializeIDBValueToJSValue):
941         (WebCore::idbKeyDataToScriptValue):
942         (WebCore::deserializeIDBValueDataToJSValue): Deleted.
943         * bindings/js/IDBBindingUtilities.h:
944
945 2016-06-03  Chris Dumez  <cdumez@apple.com>
946
947         CanvasRenderingContext2D.createPattern() / putImageData() throw wrong exception type
948         https://bugs.webkit.org/show_bug.cgi?id=158322
949
950         Reviewed by Ryosuke Niwa.
951
952         CanvasRenderingContext2D.createPattern() / putImageData() were throwing the wrong
953         exception type when the first parameter was null. It should throw a TypeError
954         but it was throwing a legacy TYPE_MISMATCH_ERR:
955         - http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d
956         - http://www.w3.org/TR/2dcontext/#canvasimagesource
957
958         This patch aligns our behavior with the specification.
959
960         No new tests, covered by existing tests.
961
962         * html/canvas/CanvasRenderingContext2D.cpp:
963         (WebCore::CanvasRenderingContext2D::createPattern):
964         (WebCore::CanvasRenderingContext2D::putImageData):
965         (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD):
966         (WebCore::CanvasRenderingContext2D::didDraw): Deleted.
967         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded): Deleted.
968         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Deleted.
969         (WebCore::CanvasRenderingContext2D::font): Deleted.
970         * html/canvas/CanvasRenderingContext2D.h:
971         * html/canvas/CanvasRenderingContext2D.idl:
972
973 2016-06-03  Anders Carlsson  <andersca@apple.com>
974
975         Rename NoncopyableFunction to Function
976         https://bugs.webkit.org/show_bug.cgi?id=158354
977
978         Reviewed by Chris Dumez.
979
980         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
981         (WebCore::MediaEndpointPeerConnection::runTask):
982         * Modules/mediastream/MediaEndpointPeerConnection.h:
983         * Modules/webaudio/AudioDestinationNode.h:
984         (WebCore::AudioDestinationNode::resume):
985         (WebCore::AudioDestinationNode::suspend):
986         (WebCore::AudioDestinationNode::close):
987         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
988         (WebCore::DefaultAudioDestinationNode::resume):
989         (WebCore::DefaultAudioDestinationNode::suspend):
990         (WebCore::DefaultAudioDestinationNode::close):
991         * Modules/webaudio/DefaultAudioDestinationNode.h:
992         * dom/ActiveDOMCallbackMicrotask.cpp:
993         (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
994         * dom/ActiveDOMCallbackMicrotask.h:
995         * dom/ScriptExecutionContext.h:
996         (WebCore::ScriptExecutionContext::Task::Task):
997         * fileapi/AsyncFileStream.cpp:
998         (WebCore::callOnFileThread):
999         (WebCore::AsyncFileStream::perform):
1000         * fileapi/AsyncFileStream.h:
1001         * page/FrameView.cpp:
1002         (WebCore::FrameView::queuePostLayoutCallback):
1003         (WebCore::FrameView::flushPostLayoutTasksQueue):
1004         * page/FrameView.h:
1005         * page/scrolling/ScrollingThread.cpp:
1006         (WebCore::ScrollingThread::dispatch):
1007         (WebCore::ScrollingThread::dispatchBarrier):
1008         (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
1009         * page/scrolling/ScrollingThread.h:
1010         * platform/GenericTaskQueue.cpp:
1011         (WebCore::TaskDispatcher<Timer>::postTask):
1012         * platform/GenericTaskQueue.h:
1013         (WebCore::TaskDispatcher::postTask):
1014         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1015         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1016         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
1017         * platform/mediastream/MediaStreamPrivate.cpp:
1018         (WebCore::MediaStreamPrivate::scheduleDeferredTask):
1019         * platform/mediastream/MediaStreamPrivate.h:
1020         * platform/mediastream/mac/AVMediaCaptureSource.h:
1021         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1022         (WebCore::AVMediaCaptureSource::scheduleDeferredTask):
1023         * style/StyleTreeResolver.cpp:
1024         (WebCore::Style::postResolutionCallbackQueue):
1025         (WebCore::Style::queuePostResolutionCallback):
1026         * style/StyleTreeResolver.h:
1027
1028 2016-06-03  Ada Chan  <adachan@apple.com>
1029
1030         REGRESSION(r201474): Subtitles are not resizing in other fullscreen modes
1031         https://bugs.webkit.org/show_bug.cgi?id=158355
1032
1033         Reviewed by Eric Carlson.
1034
1035         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1036         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
1037         Set the text track representation layer's frame based on the active video layer.
1038
1039 2016-06-03  Brady Eidson  <beidson@apple.com>
1040
1041         Miscellaneous IDBBindingUtilities cleanup.
1042         https://bugs.webkit.org/show_bug.cgi?id=158353
1043
1044         Reviewed by Tim Horton.
1045
1046         No new tests (Straight refactor, yo).
1047
1048         Starting with removing a single form of scriptValueToIDBKey(), and making the return value be
1049         Ref<IDBKey> instead of RefPtr<IDBKey>, update a whole bunch of code to understand that the ExecState
1050         is non-null and the resulting key is non-null.
1051         
1052         * Modules/indexeddb/IDBCursor.cpp:
1053         (WebCore::IDBCursor::continueFunction):
1054         
1055         * Modules/indexeddb/IDBFactory.cpp:
1056         (WebCore::IDBFactory::cmp):
1057         
1058         * Modules/indexeddb/IDBIndex.cpp:
1059         (WebCore::IDBIndex::count):
1060         (WebCore::IDBIndex::get):
1061         (WebCore::IDBIndex::getKey):
1062         
1063         * Modules/indexeddb/IDBKey.cpp:
1064         (WebCore::IDBKey::compare):
1065         (WebCore::IDBKey::isLessThan):
1066         (WebCore::IDBKey::isEqual):
1067         * Modules/indexeddb/IDBKey.h:
1068         (WebCore::IDBKey::createMultiEntryArray):
1069         
1070         * Modules/indexeddb/IDBKeyRange.cpp:
1071         (WebCore::IDBKeyRange::only):
1072         (WebCore::IDBKeyRange::lowerBound):
1073         (WebCore::IDBKeyRange::upperBound):
1074         (WebCore::IDBKeyRange::bound):
1075         (WebCore::IDBKeyRange::isOnlyKey):
1076         
1077         * Modules/indexeddb/IDBObjectStore.cpp:
1078         (WebCore::IDBObjectStore::get):
1079         (WebCore::IDBObjectStore::modernDelete):
1080         (WebCore::IDBObjectStore::count):
1081         
1082         * bindings/js/IDBBindingUtilities.cpp:
1083         (WebCore::get):
1084         (WebCore::set):
1085         (WebCore::createIDBKeyFromValue):
1086         (WebCore::getNthValueOnKeyPath):
1087         (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
1088         (WebCore::ensureNthValueOnKeyPath):
1089         (WebCore::canInjectNthValueOnKeyPath):
1090         (WebCore::injectIDBKeyIntoScriptValue):
1091         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
1092         (WebCore::canInjectIDBKeyIntoScriptValue):
1093         (WebCore::deserializeIDBValueToJSValue):
1094         (WebCore::scriptValueToIDBKey):
1095         (WebCore::createKeyPathArray):
1096         * bindings/js/IDBBindingUtilities.h:
1097
1098 2016-06-03  Benjamin Poulain  <benjamin@webkit.org>
1099
1100         Rename CheckedRadioButtons into RadioButtonGroups
1101         https://bugs.webkit.org/show_bug.cgi?id=158326
1102
1103         Reviewed by Alex Christensen.
1104
1105         CheckedRadioButtons handles the set of all the Radio Button Groups
1106         for a particular form or document.
1107         The name is wrong and apparently comes from former uses of this class
1108         (see the comment above the class declaration).
1109
1110         This patch renames "CheckedRadioButtons" to "RadioButtonGroups" to reflect that it handles
1111         all the Radio Button Group from a given context (form or document).
1112         Internally it has a set of RadioButtonGroup but that is never explicitely
1113         exposed.
1114
1115         * CMakeLists.txt:
1116         * WebCore.xcodeproj/project.pbxproj:
1117         * dom/CheckedRadioButtons.cpp:
1118         (WebCore::RadioButtonGroup::isEmpty): Deleted.
1119         (WebCore::RadioButtonGroup::isRequired): Deleted.
1120         (WebCore::RadioButtonGroup::checkedButton): Deleted.
1121         (WebCore::RadioButtonGroup::RadioButtonGroup): Deleted.
1122         (WebCore::RadioButtonGroup::isValid): Deleted.
1123         (WebCore::RadioButtonGroup::members): Deleted.
1124         (WebCore::RadioButtonGroup::setCheckedButton): Deleted.
1125         (WebCore::RadioButtonGroup::add): Deleted.
1126         (WebCore::RadioButtonGroup::updateCheckedState): Deleted.
1127         (WebCore::RadioButtonGroup::requiredAttributeChanged): Deleted.
1128         (WebCore::RadioButtonGroup::remove): Deleted.
1129         (WebCore::RadioButtonGroup::updateValidityForAllButtons): Deleted.
1130         (WebCore::RadioButtonGroup::contains): Deleted.
1131         (WebCore::CheckedRadioButtons::CheckedRadioButtons): Deleted.
1132         (WebCore::CheckedRadioButtons::~CheckedRadioButtons): Deleted.
1133         (WebCore::CheckedRadioButtons::addButton): Deleted.
1134         (WebCore::CheckedRadioButtons::groupMembers): Deleted.
1135         (WebCore::CheckedRadioButtons::updateCheckedState): Deleted.
1136         (WebCore::CheckedRadioButtons::requiredAttributeChanged): Deleted.
1137         (WebCore::CheckedRadioButtons::checkedButtonForGroup): Deleted.
1138         (WebCore::CheckedRadioButtons::isInRequiredGroup): Deleted.
1139         (WebCore::CheckedRadioButtons::removeButton): Deleted.
1140         * dom/RadioButtonGroups.cpp: Renamed from Source/WebCore/dom/CheckedRadioButtons.cpp.
1141         (WebCore::RadioButtonGroup::isEmpty):
1142         (WebCore::RadioButtonGroup::isRequired):
1143         (WebCore::RadioButtonGroup::checkedButton):
1144         (WebCore::RadioButtonGroup::RadioButtonGroup):
1145         (WebCore::RadioButtonGroup::isValid):
1146         (WebCore::RadioButtonGroup::members):
1147         (WebCore::RadioButtonGroup::setCheckedButton):
1148         (WebCore::RadioButtonGroup::add):
1149         (WebCore::RadioButtonGroup::updateCheckedState):
1150         (WebCore::RadioButtonGroup::requiredAttributeChanged):
1151         (WebCore::RadioButtonGroup::remove):
1152         (WebCore::RadioButtonGroup::updateValidityForAllButtons):
1153         (WebCore::RadioButtonGroup::contains):
1154         (WebCore::RadioButtonGroups::RadioButtonGroups):
1155         (WebCore::RadioButtonGroups::~RadioButtonGroups):
1156         (WebCore::RadioButtonGroups::addButton):
1157         (WebCore::RadioButtonGroups::groupMembers):
1158         (WebCore::RadioButtonGroups::updateCheckedState):
1159         (WebCore::RadioButtonGroups::requiredAttributeChanged):
1160         (WebCore::RadioButtonGroups::checkedButtonForGroup):
1161         (WebCore::RadioButtonGroups::isInRequiredGroup):
1162         (WebCore::RadioButtonGroups::removeButton):
1163         * dom/RadioButtonGroups.h: Renamed from Source/WebCore/dom/CheckedRadioButtons.h.
1164         * html/FormController.h:
1165         (WebCore::FormController::radioButtonGroups):
1166         (WebCore::FormController::checkedRadioButtons): Deleted.
1167         * html/HTMLFormElement.h:
1168         * html/HTMLInputElement.cpp:
1169         (WebCore::HTMLInputElement::~HTMLInputElement):
1170         (WebCore::HTMLInputElement::setChecked):
1171         (WebCore::HTMLInputElement::didMoveToNewDocument):
1172         (WebCore::HTMLInputElement::requiredAttributeChanged):
1173         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup):
1174         (WebCore::HTMLInputElement::radioButtonGroup):
1175         (WebCore::HTMLInputElement::checkedRadioButtonForGroup):
1176         (WebCore::HTMLInputElement::radioButtonGroups):
1177         (WebCore::HTMLInputElement::addToRadioButtonGroup):
1178         (WebCore::HTMLInputElement::removeFromRadioButtonGroup):
1179         (WebCore::HTMLInputElement::checkedRadioButtons): Deleted.
1180         * html/HTMLInputElement.h:
1181
1182 2016-06-03  Chris Dumez  <cdumez@apple.com>
1183
1184         Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
1185         <rdar://problem/26521101>
1186
1187         * dom/Document.cpp:
1188         (WebCore::Document::setInPageCache): Deleted.
1189         * history/CachedPage.cpp:
1190         (WebCore::CachedPage::restore):
1191         (WebCore::CachedPage::clear):
1192         * history/CachedPage.h:
1193         (WebCore::CachedPage::markForVisitedLinkStyleRecalc):
1194         (WebCore::CachedPage::markForFullStyleRecalc):
1195         * history/PageCache.cpp:
1196         (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc):
1197         (WebCore::PageCache::markPagesForFullStyleRecalc):
1198         * history/PageCache.h:
1199         * page/Frame.cpp:
1200         (WebCore::Frame::setPageAndTextZoomFactors):
1201         * page/Page.cpp:
1202         (WebCore::Page::setViewScaleFactor):
1203         (WebCore::Page::setDeviceScaleFactor):
1204         (WebCore::Page::setPagination):
1205         (WebCore::Page::setPaginationLineGridEnabled):
1206         (WebCore::Page::setVisitedLinkStore):
1207
1208 2016-06-03  Antoine Quint  <graouts@apple.com>
1209
1210         Reflection of element does not respect backdrop-filter property
1211         https://bugs.webkit.org/show_bug.cgi?id=158201
1212
1213         Reviewed by Dean Jackson.
1214
1215         We weren't cloning the PlatformCALayer for the backdrop so reflections would simply
1216         not show their backdrops. We now follow the same pattern as other PlatformCALayers
1217         owned by a GraphicsLayerCA and keep a list of backdrop layer clones that we add
1218         to the structural layer when cloning to match the layer order of the original
1219         and update the backdrop layer clone properties to match the original when the
1220         backdrop filters or rectangle changes.
1221
1222         Tests: css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html
1223                css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html
1224                css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html
1225                css3/filters/backdrop/backdrop-filter-with-reflection.html
1226
1227         * platform/graphics/ca/GraphicsLayerCA.cpp:
1228         (WebCore::GraphicsLayerCA::updateBackdropFilters):
1229         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
1230         Update backdrop layer clones to match new values set when the backdrop filter
1231         configuration changes.
1232
1233         (WebCore::GraphicsLayerCA::ensureCloneLayers):
1234         Create the backdrop layer clones map if needed and clone the existing backdrop layer.
1235
1236         (WebCore::GraphicsLayerCA::clearClones):
1237         Clear the backdrop layer clones map.
1238
1239         (WebCore::GraphicsLayerCA::fetchCloneLayers):
1240         Obtain a clone for the backdrop layer, and if we have a valid clone, add it to the
1241         structural layer clone as its first child to match the operation in updateSublayerList().
1242
1243         * platform/graphics/ca/GraphicsLayerCA.h:
1244         Modify the signature for ensureCloneLayers() to account for the new backdrop layer clone and
1245         declare the backdrop layer clone map.
1246
1247         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1248         (PlatformCALayerCocoa::clone):
1249         Reflect the backdrop layer type when cloning a PlatformCALayer.
1250
1251 2016-06-03  Brady Eidson  <beidson@apple.com>
1252
1253         ResourceResponseBase cleanup.
1254         https://bugs.webkit.org/show_bug.cgi?id=158348
1255
1256         Reviewed by Chris Dumez.
1257
1258         No new tests (Refactor, no behavior change).
1259
1260         CrossThreadData can be noncopyable and WTFMove()'ed around, instead of 
1261         being in a unique_ptr.
1262         
1263         * platform/network/ResourceResponseBase.cpp:
1264         (WebCore::ResourceResponseBase::crossThreadData):
1265         (WebCore::ResourceResponseBase::fromCrossThreadData):
1266         * platform/network/ResourceResponseBase.h:
1267
1268 2016-06-03  Antoine Quint  <graouts@apple.com>
1269
1270         REGRESSION: WebGL doesn't show up in CSS reflections
1271         https://bugs.webkit.org/show_bug.cgi?id=76489
1272
1273         Reviewed by Dean Jackson.
1274
1275         The WebGLLayer needs to notify its owning GraphicsLayer that it was displayed
1276         such that its clones, in GraphicsLayerCA::layerDidDisplay, may have their contents
1277         updated to match that layer's contents. The test at compositing/webgl/webgl-reflection.html
1278         already covers this test and its expectation on Mac has been updated.
1279
1280         * platform/graphics/mac/WebGLLayer.mm:
1281         (-[WebGLLayer display]):
1282
1283 2016-06-02  Gavin Barraclough  <barraclough@apple.com>
1284
1285         Refactor showModalDialog handling in JSDOMWindowCustom
1286         https://bugs.webkit.org/show_bug.cgi?id=158294
1287
1288         Reviewed by Ryosuke Niwa.
1289
1290         The showModalDialog property is currently implemented in a way that  effectively
1291         results in duplication of the tail of the function, but modified to call
1292         Base::getOwnPropertySlot instead of getStaticPropertySlot. It does so based on the
1293         assumption that Base::getOwnPropertySlot is not going to search the static tables
1294         (containing the property we wish to omit).
1295
1296         However as a part of bug #158178 I plan to change it such that Base::getOwnPropertySlot
1297         does also search the static tables. So, refactoring this code to no longer depend on
1298         using a function that bypasses the static tables. Always perform a lookup that will
1299         check both property storage & static tables. If the object does contain the property,
1300         then check explicitly for the value we're intending to suppress.
1301
1302         Covered by exsiting tests.
1303
1304         * bindings/js/JSDOMWindowCustom.cpp:
1305         (WebCore::JSDOMWindow::getOwnPropertySlot):
1306             - Check result of getStaticPropertySlot for showModalDialog function.
1307
1308 2016-06-02  Brady Eidson  <beidson@apple.com>
1309
1310         Fix AtomicString regression caused by r201603.
1311         https://bugs.webkit.org/show_bug.cgi?id=158338
1312
1313         Reviewed by Chris Dumez.
1314
1315         No new tests (Refactor, plus already caught by existing test configs).
1316
1317         * loader/WorkerThreadableLoader.cpp:
1318         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
1319         
1320         * platform/network/ResourceResponseBase.cpp:
1321         (WebCore::ResourceResponseBase::crossThreadData): Re-introduce the cross thread data concept,
1322           but more modern and clean this time.
1323         (WebCore::ResourceResponseBase::fromCrossThreadData):
1324         (WebCore::ResourceResponseBase::isolatedCopy): Deleted.
1325         * platform/network/ResourceResponseBase.h:
1326
1327 2016-06-02  Chris Dumez  <cdumez@apple.com>
1328
1329         Drop BlobRegistryContext class as it is no longer needed
1330         https://bugs.webkit.org/show_bug.cgi?id=158328
1331
1332         Reviewed by Brady Eidson.
1333
1334         Drop BlobRegistryContext class as it is no longer needed. We can now
1335         call isolatedCopy() as we capture in the lambda.
1336
1337         * fileapi/ThreadableBlobRegistry.cpp:
1338         (WebCore::ThreadableBlobRegistry::registerFileBlobURL):
1339         (WebCore::ThreadableBlobRegistry::registerBlobURL):
1340         (WebCore::ThreadableBlobRegistry::registerBlobURLForSlice):
1341         (WebCore::ThreadableBlobRegistry::blobSize):
1342         (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
1343         (WebCore::BlobRegistryContext::BlobRegistryContext): Deleted.
1344
1345 2016-06-02  Zalan Bujtas  <zalan@apple.com>
1346
1347         Repaint issue with vertical text in an out of flow container.
1348         https://bugs.webkit.org/show_bug.cgi?id=102665
1349         <rdar://problem/26605298>
1350
1351         Reviewed by David Hyatt.
1352
1353         Since the renderer’s offset for positioned objects is always physical, we only
1354         need to flip the repaint rect(always logical) for writing root, when we see the first positioned object.
1355         All subsequent writing root changes for positioned objects are okay and they don't need flipping.
1356
1357         Test: fast/repaint/vertical-text-repaint.html
1358
1359         * rendering/RenderBox.cpp:
1360         (WebCore::RenderBox::computeRectForRepaint):
1361         * rendering/RenderBox.h:
1362         (WebCore::RenderBox::computeRectForRepaint):
1363         * rendering/RenderInline.cpp:
1364         (WebCore::RenderInline::computeRectForRepaint):
1365         * rendering/RenderInline.h:
1366         (WebCore::RenderInline::computeRectForRepaint):
1367         * rendering/RenderObject.cpp:
1368         (WebCore::RenderObject::computeRectForRepaint):
1369         * rendering/RenderObject.h:
1370         (WebCore::RenderObject::computeAbsoluteRepaintRect):
1371         (WebCore::RenderObject::computeRectForRepaint):
1372         * rendering/RenderTableCell.cpp:
1373         (WebCore::RenderTableCell::computeRectForRepaint):
1374         * rendering/RenderTableCell.h:
1375         * rendering/RenderView.cpp:
1376         (WebCore::RenderView::computeRectForRepaint):
1377         * rendering/RenderView.h:
1378         * rendering/svg/RenderSVGForeignObject.cpp:
1379         (WebCore::RenderSVGForeignObject::computeRectForRepaint):
1380         * rendering/svg/RenderSVGForeignObject.h:
1381         * rendering/svg/RenderSVGRoot.cpp:
1382         (WebCore::RenderSVGRoot::computeFloatRectForRepaint):
1383         * rendering/svg/RenderSVGText.cpp:
1384         (WebCore::RenderSVGText::computeRectForRepaint):
1385         * rendering/svg/RenderSVGText.h:
1386
1387 2016-06-02  Anders Carlsson  <andersca@apple.com>
1388
1389         Fix build
1390         https://bugs.webkit.org/show_bug.cgi?id=158337
1391         rdar://problem/26429419
1392
1393         Reviewed by Dan Bernstein.
1394
1395         * WebCore.xcodeproj/project.pbxproj:
1396         Add QTKitSPI.h header.
1397
1398         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1399         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1400         * platform/graphics/mac/MediaTimeQTKit.h:
1401         * platform/graphics/mac/MediaTimeQTKit.mm:
1402         * platform/mac/WebVideoFullscreenController.mm:
1403         Include QTKitSPI.h.
1404
1405         * platform/spi/cocoa/QuartzCoreSPI.h:
1406         * platform/spi/mac/AVFoundationSPI.h:
1407         Use MAX_ALLOWED instead of MIN_REQUIRED.
1408
1409         * platform/spi/mac/QTKitSPI.h:
1410         Add new QTKit header.
1411
1412 2016-06-02  Said Abou-Hallawa  <sabouhallawa@apple,com>
1413
1414         [iOS] PDFDocumentImage should not create a cached image larger than 4M pixels
1415         https://bugs.webkit.org/show_bug.cgi?id=157857
1416
1417         Reviewed by Darin Adler.
1418
1419         On iOS, if the scaled size of the PDFDocumentImage cached image will exceed
1420         the 4M pixels limit and the system physical memory is 1GB or less, do not
1421         create it. PDFDocumentImage::draw() falls back peacefully if the cached image
1422         couldn't be created for any reason. The PDF will be drawn directly to the
1423         GraphicsContext without having to go through the cached image. This means
1424         the whole PDF will be drawn multiple times; one time for each tile. I think
1425         this is okay for zooming a large PDFDocumentImage on a low end device.
1426         
1427         * html/canvas/CanvasRenderingContext2D.cpp:
1428         (WebCore::CanvasRenderingContext2D::drawTextInternal): Call the static function
1429         ImageBuffer::createCompatibleBuffer() without having to go through the GraphicsContext.
1430         
1431         * platform/graphics/BitmapImage.cpp:
1432         (WebCore::BitmapImage::drawPattern): Ditto.
1433         
1434         * platform/graphics/FloatSize.h:
1435         (WebCore::FloatSize::area): A helper function similar to IntSize::area().
1436         (WebCore::operator*): Scale a FloatSize by another FloatSize and return the result.
1437         
1438         * platform/graphics/GradientImage.cpp:
1439         (WebCore::GradientImage::drawPattern): Call ImageBuffer::createCompatibleBuffer().
1440         
1441         * platform/graphics/GraphicsContext.cpp:
1442         (WebCore::GraphicsContext::scaleFactor):: Return the scaling part of the current CTM.
1443         (WebCore::scalesMatch): Deleted.
1444         (WebCore::GraphicsContext::createCompatibleBuffer): Deleted.
1445         (WebCore::GraphicsContext::isCompatibleWithBuffer): Deleted.
1446         * platform/graphics/GraphicsContext.h:
1447         Move these image buffer functions to ImageBuffer.
1448         
1449         * platform/graphics/ImageBuffer.cpp:
1450         (WebCore::ImageBuffer::createCompatibleBuffer): Make createCompatibleBuffer
1451         a static function of the ImageBuffer. There is no need to go through the
1452         GraphicsContext just to get the GraphicsContext scaleFactor.
1453         
1454         (WebCore::ImageBuffer::compatibleBufferSize):  Scale the size of the cachedImage
1455         by the scaleFactor of the context.
1456         
1457         (WebCore::ImageBuffer::isCompatibleWithContext): Returns true if the drawing
1458         context and the ImageBuffer context have the same scaleFactor.
1459         
1460         * platform/graphics/ImageBuffer.h:
1461         
1462         * platform/graphics/NamedImageGeneratedImage.cpp:
1463         (WebCore::NamedImageGeneratedImage::drawPattern): Call ImageBuffer::createCompatibleBuffer().
1464         
1465         * platform/graphics/cg/PDFDocumentImage.cpp:
1466         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): On iOS, if the
1467         physical memory is less than 1GB, do not allocate more than 16MB for the
1468         PDF cachedImage.
1469         
1470         * rendering/RenderBoxModelObject.cpp:
1471         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Call ImageBuffer::createCompatibleBuffer().
1472         * rendering/svg/SVGRenderingContext.cpp:
1473         (WebCore::SVGRenderingContext::bufferForeground): Ditto.
1474
1475 2016-06-02  Chris Dumez  <cdumez@apple.com>
1476
1477         [WebIDL] 'undefined' should be an acceptable value for nullable parameters
1478         https://bugs.webkit.org/show_bug.cgi?id=158321
1479
1480         Reviewed by Ryosuke Niwa.
1481
1482         'undefined' should be an acceptable value for nullable parameters (and
1483         should be converted to null):
1484         - https://heycam.github.io/webidl/#es-nullable-type
1485
1486         Our bindings got most of the cases right but there was a bug in our
1487         overload resolution code. This patch fixes it.
1488
1489         No new tests, already covered by existing tests.
1490
1491         * bindings/scripts/CodeGeneratorJS.pm:
1492         (GenerateParametersCheckExpression):
1493         * bindings/scripts/test/JS/JSTestObj.cpp:
1494         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
1495         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
1496
1497 2016-06-02  Brady Eidson  <beidson@apple.com>
1498
1499         Modernize how many platform/network classes do isolatedCopy().
1500         https://bugs.webkit.org/show_bug.cgi?id=158313
1501
1502         Reviewed by Alex Christensen.
1503
1504         No new tests (Refactor, no behavior change).
1505
1506         * loader/WorkerThreadableLoader.h:
1507         
1508         * platform/network/FormData.cpp:
1509         (WebCore::FormData::isolatedCopy):
1510         (WebCore::FormDataElement::isolatedCopy):
1511         (WebCore::FormData::FormData): Deleted.
1512         (WebCore::FormData::deepCopy): Deleted.
1513         * platform/network/FormData.h:
1514         
1515         * platform/network/HTTPHeaderMap.cpp:
1516         (WebCore::HTTPHeaderMap::isolatedCopy):
1517         (WebCore::HTTPHeaderMap::copyData): Deleted.
1518         (WebCore::HTTPHeaderMap::adopt): Deleted.
1519         * platform/network/HTTPHeaderMap.h:
1520         
1521         * platform/network/ResourceErrorBase.cpp:
1522         (WebCore::ResourceErrorBase::asResourceError):
1523         (WebCore::ResourceErrorBase::isolatedCopy):
1524         * platform/network/ResourceErrorBase.h:
1525         (WebCore::ResourceErrorBase::platformCopy): Deleted.
1526
1527         * platform/network/ResourceLoadTiming.h:
1528         (WebCore::ResourceLoadTiming::isolatedCopy): Not strictly needed for now, but makes it obvious
1529           that changes will be needed if new members are added later.
1530
1531         * platform/network/ResourceRequestBase.cpp:
1532         (WebCore::ResourceRequestBase::isolatedCopy):
1533         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
1534         (WebCore::ResourceRequestBase::copyData): Deleted.
1535         * platform/network/ResourceRequestBase.h:
1536         
1537         * platform/network/ResourceResponseBase.cpp:
1538         (WebCore::ResourceResponseBase::isolatedCopy):
1539         (WebCore::ResourceResponseBase::copyData): Deleted.
1540         * platform/network/ResourceResponseBase.h:
1541         (WebCore::CrossThreadResourceResponseDataBase::CrossThreadResourceResponseDataBase): Deleted.
1542         
1543         * platform/network/cf/ResourceError.h:
1544         * platform/network/cf/ResourceErrorCF.cpp:
1545         (WebCore::ResourceError::doPlatformIsolatedCopy):
1546         (WebCore::ResourceError::platformCopy): Deleted.
1547         
1548         * platform/network/cf/ResourceRequest.h:
1549         * platform/network/cf/ResourceRequestCFNet.cpp:
1550         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
1551         (WebCore::ResourceRequest::doPlatformCopyData): Deleted.
1552         (WebCore::ResourceRequest::doPlatformAdopt): Deleted.
1553         
1554         * platform/network/cf/ResourceResponse.h:
1555         (WebCore::ResourceResponse::doPlatformCopyData): Deleted.
1556         (WebCore::ResourceResponse::doPlatformAdopt): Deleted.
1557         
1558         * platform/network/curl/ResourceError.h:
1559         (WebCore::ResourceError::doPlatformIsolatedCopy):
1560         
1561         * platform/network/curl/ResourceRequest.h:
1562         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
1563         (WebCore::ResourceRequest::doPlatformCopyData): Deleted.
1564         (WebCore::ResourceRequest::doPlatformAdopt): Deleted.
1565         
1566         * platform/network/curl/ResourceResponse.h:
1567         (WebCore::ResourceResponse::doPlatformCopyData): Deleted.
1568         (WebCore::ResourceResponse::doPlatformAdopt): Deleted.
1569         
1570         * platform/network/mac/ResourceErrorMac.mm:
1571         (WebCore::ResourceError::doPlatformIsolatedCopy):
1572         
1573         * platform/network/soup/ResourceError.h:
1574         * platform/network/soup/ResourceErrorSoup.cpp:
1575         (WebCore::ResourceError::doPlatformIsolatedCopy):
1576         (WebCore::ResourceError::platformCopy): Deleted.
1577         
1578         * platform/network/soup/ResourceRequest.h:
1579         (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
1580         (WebCore::ResourceRequest::doPlatformCopyData): Deleted.
1581         (WebCore::ResourceRequest::doPlatformAdopt): Deleted.
1582         
1583         * platform/network/soup/ResourceResponse.h:
1584         (WebCore::ResourceResponse::doPlatformCopyData): Deleted.
1585         (WebCore::ResourceResponse::doPlatformAdopt): Deleted.
1586
1587 2016-06-02  Chris Dumez  <cdumez@apple.com>
1588
1589         Crash under CachedResource::addClientToSet()
1590         https://bugs.webkit.org/show_bug.cgi?id=158310
1591         <rdar://problem/23643359>
1592
1593         Reviewed by Eric Carlson.
1594
1595         Only call CachedResource::addClient() on the resource returned
1596         by CachedResourceLoader::requestMedia() if the resource is
1597         non-null. CachedResourceLoader::requestMedia() can return null
1598         in some cases so we need to handle this properly.
1599
1600         No new tests, no known reproduction case.
1601
1602         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1603         (WebCore::WebCoreAVFResourceLoader::startLoading):
1604
1605 2016-06-02  Chris Dumez  <cdumez@apple.com>
1606
1607         ScriptExecutionContext::Task constructor should take a NoncopyableFunction<void ()> as parameter
1608         https://bugs.webkit.org/show_bug.cgi?id=158309
1609
1610         Reviewed by Brady Eidson.
1611
1612         ScriptExecutionContext::Task constructor should take a NoncopyableFunction<void ()>
1613         as parameter for consistency with the other constructor and because this can be
1614         called cross-thread.
1615
1616         * Modules/webaudio/AudioContext.cpp:
1617         (WebCore::AudioContext::suspend):
1618         (WebCore::AudioContext::resume):
1619         (WebCore::AudioContext::close):
1620         (WebCore::AudioContext::suspendPlayback):
1621         (WebCore::AudioContext::mayResumePlayback):
1622         * Modules/webaudio/AudioDestinationNode.h:
1623         (WebCore::AudioDestinationNode::resume):
1624         (WebCore::AudioDestinationNode::suspend):
1625         (WebCore::AudioDestinationNode::close):
1626         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1627         (WebCore::DefaultAudioDestinationNode::resume):
1628         (WebCore::DefaultAudioDestinationNode::suspend):
1629         (WebCore::DefaultAudioDestinationNode::close):
1630         * Modules/webaudio/DefaultAudioDestinationNode.h:
1631         * dom/ScriptExecutionContext.h:
1632         (WebCore::ScriptExecutionContext::Task::Task):
1633
1634 2016-06-02  Darin Adler  <darin@apple.com>
1635
1636         Fix a couple of mistakes in CSSParserValue memory management
1637         https://bugs.webkit.org/show_bug.cgi?id=158307
1638         <rdar://problem/26127225>
1639
1640         Reviewed by Daniel Bates.
1641
1642         * css/CSSGrammar.y.in: Added a destructor for calc_func_term. This presumably
1643         fixes some memory leaks in error cases. Removed an assertion about not needing
1644         a call to destroy that was far too limited. Tweaked formatting of the percentage
1645         ase in the key production. Indented calc_func_term to make it consistent with
1646         other productions nearby.
1647
1648         * css/CSSParserValues.cpp:
1649         (WebCore::CSSParserValueList::~CSSParserValueList): Use a modern for loop.
1650         (WebCore::CSSParserValueList::deleteValueAt): Deleted. Unused function, and also
1651         would have resulted in a memory leak unless the code already extracted the value
1652         from the list.
1653         (WebCore::CSSParserValueList::extend): Properly transfer ownership from one value
1654         list to the other by setting the unit to 0 in the donor.
1655
1656         * css/CSSParserValues.h: Removed unused deleteValueAt function.
1657
1658 2016-06-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
1659
1660         SVG content renders in incorrect vertical position when padding-left is not specified
1661         https://bugs.webkit.org/show_bug.cgi?id=158234
1662
1663         Reviewed by Darin Adler.
1664
1665         Fix the optimization in RenderSVGRoot::buildLocalToBorderBoxTransform().
1666         Use LayoutSize::isZero() instead of LayoutSize::isEmpty() to decide whether
1667         there is borderAndPadding applied or not.
1668
1669         Test: svg/custom/svg-root-padding-individual.html
1670
1671         * rendering/svg/RenderSVGRoot.cpp:
1672         (WebCore::RenderSVGRoot::buildLocalToBorderBoxTransform):
1673
1674 2016-06-02  Brady Eidson  <beidson@apple.com>
1675
1676         Overhaul cross-thread use of ResourceRequest, ResourceResponse, and ResourceError.
1677         https://bugs.webkit.org/show_bug.cgi?id=158293
1678
1679         Reviewed by Darin Adler.
1680
1681         No new tests (Refactor, no behavior change).
1682
1683         * loader/WorkerThreadableLoader.cpp:
1684         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1685         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
1686         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
1687         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck):
1688
1689         * loader/cache/MemoryCache.cpp:
1690         (WebCore::MemoryCache::removeRequestFromSessionCaches):
1691
1692         * platform/network/ResourceErrorBase.cpp:
1693         (WebCore::ResourceErrorBase::isolatedCopy):
1694         (WebCore::ResourceErrorBase::copy): Deleted.
1695         * platform/network/ResourceErrorBase.h:
1696
1697         * platform/network/ResourceRequestBase.cpp:
1698         (WebCore::ResourceRequestBase::isolatedCopy):
1699         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
1700         (WebCore::ResourceRequestBase::adopt): Deleted.
1701         
1702         Made copyData private, and made "adopt" be "isolatedCopy".
1703         Rest of the changes are all re-indenting the file.
1704         * platform/network/ResourceRequestBase.h:
1705         (WebCore::ResourceRequestBase::responseContentDispositionEncodingFallbackArray):
1706         (WebCore::ResourceRequestBase::reportUploadProgress):
1707         (WebCore::ResourceRequestBase::setReportUploadProgress):
1708         (WebCore::ResourceRequestBase::reportLoadTiming):
1709         (WebCore::ResourceRequestBase::setReportLoadTiming):
1710         (WebCore::ResourceRequestBase::reportRawHeaders):
1711         (WebCore::ResourceRequestBase::setReportRawHeaders):
1712         (WebCore::ResourceRequestBase::hiddenFromInspector):
1713         (WebCore::ResourceRequestBase::setHiddenFromInspector):
1714         (WebCore::ResourceRequestBase::requester):
1715         (WebCore::ResourceRequestBase::setRequester):
1716         (WebCore::ResourceRequestBase::encodingRequiresPlatformData):
1717         (WebCore::ResourceRequestBase::ResourceRequestBase):
1718         (WebCore::ResourceRequestBase::platformCompare):
1719         (WebCore::operator==):
1720         (WebCore::operator!=):
1721
1722         * platform/network/ResourceResponseBase.cpp:
1723         (WebCore::ResourceResponseBase::isolatedCopy):
1724         (WebCore::ResourceResponseBase::adopt): Deleted.
1725         * platform/network/ResourceResponseBase.h:
1726
1727         * platform/network/cf/ResourceError.h:
1728         (WebCore::ResourceError::isolatedCopy): Deleted.
1729
1730         Removed platform-specific isolatedCopy, and re-indented the header:
1731         * platform/network/cf/ResourceRequest.h:
1732         (WebCore::ResourceRequest::ResourceRequest):
1733         (WebCore::ResourceRequest::encodingRequiresPlatformData):
1734         (WebCore::ResourceRequest::cachePartition):
1735         (WebCore::ResourceRequest::setCachePartition):
1736         (WebCore::ResourceRequest::setDomainForCachePartition):
1737         (WebCore::ResourceRequest::resourcePrioritiesEnabled):
1738         (WebCore::ResourceRequest::isolatedCopy): Deleted.
1739
1740         * platform/network/cf/ResourceResponse.h:
1741         (WebCore::ResourceResponse::isolatedCopy): Deleted.
1742
1743 2016-06-02  Chris Dumez  <cdumez@apple.com>
1744
1745         Modernize various lambda captures
1746         https://bugs.webkit.org/show_bug.cgi?id=158292
1747
1748         Reviewed by Brady Eidson.
1749
1750         Modernize various lambda captures, especially the ones unnecessarily
1751         allocating objects on the heap and destroying them in the lambda.
1752
1753         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
1754         (WebCore::ThreadableWebSocketChannelClientWrapper::didConnect):
1755         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessage):
1756         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
1757         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
1758         (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
1759         (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
1760         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
1761         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
1762         (WebCore::ThreadableWebSocketChannelClientWrapper::resume): Deleted.
1763         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1764         (WebCore::WorkerThreadableWebSocketChannel::Bridge::disconnect):
1765         * bindings/js/JSCallbackData.h:
1766         (WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
1767         * loader/WorkerThreadableLoader.cpp:
1768         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1769         (WebCore::WorkerThreadableLoader::MainThreadBridge::destroy):
1770         (WebCore::WorkerThreadableLoader::MainThreadBridge::didSendData):
1771         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
1772         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
1773         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
1774         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
1775         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck):
1776         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
1777         (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel): Deleted.
1778
1779 2016-06-02  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1780
1781         WebRTC: Update RTCPeerConnection.addTrack() to create (or reuse) an RTCRtpTransceiver
1782         https://bugs.webkit.org/show_bug.cgi?id=158191
1783
1784         Reviewed by Eric Carlson.
1785
1786         Update RTCPeerConnection.addTrack to create an RTCRtpTranscevier, or reuse an existing
1787         transceiver that has not been used to send [1].
1788
1789         A new RtpTransceiverSet type is added that wraps a vector of RTCRtpTransceiver objects
1790         and internally maintains two lists for efficient access to RTCRtpSender and RTCRtpReceiver
1791         objects.
1792
1793         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-addtrack
1794
1795         Updated existing test: fast/mediastream/RTCPeerConnection-add-removeTrack.html
1796
1797         * Modules/mediastream/PeerConnectionBackend.h:
1798         * Modules/mediastream/RTCPeerConnection.cpp:
1799         (WebCore::RTCPeerConnection::addTrack):
1800         (WebCore::RTCPeerConnection::removeTrack):
1801         (WebCore::RTCPeerConnection::completeAddTransceiver):
1802         (WebCore::RTCPeerConnection::close):
1803         * Modules/mediastream/RTCPeerConnection.h:
1804         * Modules/mediastream/RTCRtpTransceiver.cpp:
1805         (WebCore::RtpTransceiverSet::append):
1806         * Modules/mediastream/RTCRtpTransceiver.h:
1807         (WebCore::RtpTransceiverSet::list):
1808         (WebCore::RtpTransceiverSet::getSenders):
1809         (WebCore::RtpTransceiverSet::getReceivers):
1810
1811 2016-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1812
1813         Use more references in ResourceLoader related code
1814         https://bugs.webkit.org/show_bug.cgi?id=158222
1815
1816         Reviewed by Darin Adler.
1817
1818         No change of behavior.
1819
1820         * css/CSSFontFaceSource.cpp:
1821         (WebCore::CSSFontFaceSource::load):
1822         * css/CSSFontSelector.cpp:
1823         (WebCore::CSSFontSelector::clearDocument):
1824         (WebCore::CSSFontSelector::beginLoadingFontSoon):
1825         (WebCore::CSSFontSelector::beginLoadTimerFired):
1826         * css/CSSFontSelector.h:
1827         * loader/DocumentLoader.cpp:
1828         (WebCore::DocumentLoader::scheduleArchiveLoad):
1829         * loader/DocumentLoader.h:
1830         * loader/LoaderStrategy.h:
1831         * loader/NetscapePlugInStreamLoader.cpp:
1832         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
1833         (WebCore::NetscapePlugInStreamLoader::create):
1834         * loader/NetscapePlugInStreamLoader.h:
1835         * loader/ResourceLoader.cpp:
1836         (WebCore::ResourceLoader::ResourceLoader):
1837         (WebCore::ResourceLoader::start):
1838         * loader/ResourceLoader.h:
1839         * loader/SubresourceLoader.cpp:
1840         (WebCore::SubresourceLoader::RequestCountTracker::RequestCountTracker):
1841         (WebCore::SubresourceLoader::SubresourceLoader):
1842         (WebCore::SubresourceLoader::create):
1843         (WebCore::SubresourceLoader::didReceiveResponse):
1844         (WebCore::SubresourceLoader::notifyDone):
1845         * loader/SubresourceLoader.h:
1846         * loader/appcache/ApplicationCacheHost.cpp:
1847         (WebCore::ApplicationCacheHost::maybeLoadResource):
1848         * loader/appcache/ApplicationCacheHost.h:
1849         * loader/cache/CachedResource.cpp:
1850         (WebCore::CachedResource::load):
1851         * loader/cache/CachedResourceLoader.cpp:
1852         (WebCore::CachedResourceLoader::incrementRequestCount):
1853         (WebCore::CachedResourceLoader::decrementRequestCount):
1854         * loader/cache/CachedResourceLoader.h:
1855
1856 2016-06-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1857
1858         [Wayland] PlatformDisplayWayland destructor is super crashy
1859         https://bugs.webkit.org/show_bug.cgi?id=157973
1860
1861         Reviewed by Michael Catanzaro.
1862
1863         EGL registers two at exist callbacks one to finish the display and another one to unload drivers, the one to
1864         finish the display happens first. When our destructor is called the _eglFiniDisplay callback has already been
1865         called, so we have a valid pointer for an already finished display. Then eglTerminate tries to find the display
1866         in the global display list, but fails and for some reason it crashes when trying to return an error.
1867         If atexit is called after the global PlatformDisplay constructor, the atexit handler is called before the
1868         destructor. The atexit callbacks are called in reverse order, so if we register an atexit handler after the
1869         global instace has been created and after EGL has been initialized, we could terminate the EGL display before
1870         the EGL atexit handlers and the global PlatformDisplay destructor.
1871
1872         * platform/graphics/PlatformDisplay.cpp:
1873         (WebCore::PlatformDisplay::initializeEGLDisplay):
1874
1875 2016-06-01  Brady Eidson  <beidson@apple.com>
1876
1877         Get rid of StringCapture.
1878         https://bugs.webkit.org/show_bug.cgi?id=158285
1879
1880         Reviewed by Chris Dumez.
1881
1882         No new tests (Refactor, no behavior change).
1883
1884         * dom/Document.cpp:
1885         (WebCore::Document::addConsoleMessage):
1886         (WebCore::Document::addMessage):
1887         
1888         * dom/ScriptExecutionContext.h:
1889         (WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
1890         
1891         * loader/DocumentLoader.cpp:
1892         (WebCore::DocumentLoader::installContentFilterUnblockHandler):
1893         
1894         * loader/WorkerThreadableLoader.cpp:
1895         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1896         
1897         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1898         (WebVideoFullscreenControllerContext::setExternalPlayback):
1899         
1900         * workers/WorkerGlobalScope.cpp:
1901         (WebCore::WorkerGlobalScope::addConsoleMessage):
1902         (WebCore::WorkerGlobalScope::addMessage):
1903         
1904         * workers/WorkerMessagingProxy.cpp:
1905         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
1906         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
1907
1908 2016-05-31  Darin Adler  <darin@apple.com>
1909
1910         Audit RenderObject casts and fix problems and style issues found
1911         https://bugs.webkit.org/show_bug.cgi?id=158221
1912
1913         Reviewed by Chris Dumez.
1914
1915         * bindings/objc/DOM.mm:
1916         (-[DOMElement image]): Use auto to get more specific types in code getting
1917         the renderer for an element instead of dumbing down the type to RenderObject.
1918
1919         * dom/Element.cpp:
1920         (WebCore::Element::scrollByUnits): Call renderer only once. The comment in
1921         Node advises we should do this since it has a branch in it.
1922         (WebCore::Element::absoluteEventBounds): Call renderer only once. Also use
1923         auto for a rect type to clarify that we are not changing the type of the
1924         rect returned by the fucntion.
1925         (WebCore::Element::webkitGetRegionFlowRanges): Call renderer only once.
1926
1927         * editing/CompositeEditCommand.cpp:
1928         (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded): Use auto
1929         to get a mroe specific renderer type.
1930
1931         * editing/SimplifyMarkupCommand.cpp:
1932         (WebCore::SimplifyMarkupCommand::doApply): Call renderer only once.
1933
1934         * editing/cocoa/HTMLConverter.mm:
1935         (HTMLConverter::_addAttachmentForElement): Add an obviously missing
1936         null check for something that is null checked elsewhere.
1937         (fileWrapperForURL): Ditto.
1938         (fileWrapperForElement): Changed argument type to HTMLImageElement& since
1939         the call site already checks the type of the object. Use HTMLImageElement::src
1940         instead of repeating the code here. Check the type of the renderer instead of
1941         assuming it's a RenderImage.
1942         (WebCore::editingAttributedStringFromRange): Pass a reference, not a pointer.
1943
1944         * html/HTMLAnchorElement.cpp:
1945         (WebCore::appendServerMapMousePosition): Take a reference to an event rather
1946         than a "known to be non-null" pointer. Call renderer only once. Round the
1947         floating point values rather than truncating them.
1948         (WebCore::HTMLAnchorElement::handleClick): Pass a reference.
1949
1950         * html/HTMLAttachmentElement.cpp:
1951         (WebCore::HTMLAttachmentElement::setFile): Removed the now-unneeded cast since
1952         the renderer function returns a pointer of a more specific type now.
1953         (WebCore::HTMLAttachmentElement::parseAttribute): Ditto.
1954         (WebCore::HTMLAttachmentElement::attachmentTitle): Use auto& to avoid a bit of
1955         reference count churn.
1956
1957         * html/HTMLAttachmentElement.h: Override renderer to return a more specific type.
1958         This follows the pattern that ContainerNode::renderer uses.
1959
1960         * html/HTMLButtonElement.h: Ditto.
1961
1962         * html/HTMLCanvasElement.cpp: Gave the constants at the top of the file more
1963         normal names. Removed unneeded "static" from them. Moved the
1964         defaultInterpolationQuality constant here from the header because it doesn't
1965         need to be there.
1966         (WebCore::HTMLCanvasElement::HTMLCanvasElement): Updated for name changes.
1967         (WebCore::HTMLCanvasElement::createElementRenderer): Removed unneeded code to
1968         set m_rendererIsCanvas to record renderer type; we can just check the type.
1969         (WebCore::HTMLCanvasElement::setHeight): Updated for name changes.
1970         (WebCore::HTMLCanvasElement::setWidth): Ditto.
1971         (WebCore::HTMLCanvasElement::reset): Check the type of the renderer directly
1972         instead of calling m_rendererIsCanvas. This helped make it clear we were
1973         do extra unneeded checks since a renderer can't both be a RenderCanvas and
1974         not be a RenderBox.
1975         (WebCore::HTMLCanvasElement::createImageBuffer): Updated for name changes.
1976
1977         * html/HTMLCanvasElement.h: Moved DefaultInterpolationQuality into the cpp file.
1978         Use nullptr instead of 0. Removed m_rendererIsCanvas.
1979
1980         * html/HTMLFieldSetElement.cpp:
1981         (WebCore::HTMLFieldSetElement::HTMLFieldSetElement): Initialize m_documentVersion
1982         in the class definition.
1983         (WebCore::HTMLFieldSetElement::~HTMLFieldSetElement): Use m_hasDisabledAttribute.
1984         (WebCore::updateFromControlElementsAncestorDisabledStateUnder): Fixed typo.
1985         (WebCore::HTMLFieldSetElement::disabledAttributeChanged): Fixed mistake in this
1986         function that would cause the number of disabled fieldset elements to be too high
1987         if the disabled attribute's value was changed from one value to another. Use a
1988         boolean to track the old value; can't think of a solution that works without that.
1989         (WebCore::HTMLFieldSetElement::childrenChanged): Fixed typo.
1990         (WebCore::HTMLFieldSetElement::didMoveToNewDocument): Use m_hasDisabledAttribute.
1991         (WebCore::HTMLFieldSetElement::updateAssociatedElements): Changed name to make it
1992         clearer what this function does. Tweaked a bit without changing behavior.
1993         (WebCore::HTMLFieldSetElement::associatedElements): Updated for name change.
1994         (WebCore::HTMLFieldSetElement::length): Changed to call associatedElements instead of
1995         repeating that it does.
1996
1997         * html/HTMLFieldSetElement.h: Override renderer to return a more specific type.
1998         Also updated for other changes mentioned above.
1999
2000         * html/HTMLFrameElement.cpp:
2001         (WebCore::HTMLFrameElement::HTMLFrameElement): Initialize booleans in the class
2002         definition rather than doing it here.
2003         (WebCore::HTMLFrameElement::parseAttribute): Call renderer only once.
2004
2005         * html/HTMLFrameElement.h: Override renderer to return a more specific type.
2006         Also initialize some booleans in the class definition.
2007
2008         * html/HTMLIFrameElement.h: Override renderer to return a more specific type.
2009
2010         * html/HTMLMediaElement.cpp:
2011         (WebCore::HTMLMediaElement::updateRenderer): Added. Helper for a common idiom.
2012         (WebCore::HTMLMediaElement::didAttachRenderers): Use auto to get a more specific
2013         type for the renderer.
2014         (WebCore::HTMLMediaElement::willDetachRenderers): Call renderer only once.
2015         (WebCore::HTMLMediaElement::didRecalcStyle): Use updateRenderer to call renderer
2016         only once.
2017         (WebCore::HTMLMediaElement::loadResource): Ditto.
2018         (WebCore::HTMLMediaElement::waitForSourceChange): Ditto.
2019         (WebCore::HTMLMediaElement::noneSupported): Ditto.
2020         (WebCore::HTMLMediaElement::setReadyState): Ditto.
2021         (WebCore::HTMLMediaElement::progressEventTimerFired): Ditto.
2022         (WebCore::HTMLMediaElement::selectNextSourceChild): Renamed goto label to use a style
2023         that fits WebKit coding style. Call renderer only once in MediaQuery code.
2024         (WebCore::HTMLMediaElement::mediaPlayerRepaint): Call renderer only once.
2025         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): Use updateRenderer to call
2026         renderer only once.
2027         (WebCore::HTMLMediaElement::mediaPlayerRenderingCanBeAccelerated): Call renderer
2028         only once.
2029         (WebCore::HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter): Call page only once.
2030         (WebCore::HTMLMediaElement::mediaEngineWasUpdated): Use updateRenderer to call
2031         renderer only once.
2032         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
2033         (WebCore::HTMLMediaElement::updatePlayState): Ditto.
2034         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
2035         (WebCore::HTMLMediaElement::resume): Ditto.
2036         (WebCore::HTMLMediaElement::mediaPlayerContentBoxRect): Call renderer only once.
2037         (WebCore::mediaElementIsAllowedToAutoplay): Use auto to get a more specific type.
2038
2039         * html/HTMLMediaElement.h: Removed conditionals around forward declarations.
2040         Tweaked formatting a bit. Added the updateRender function. Override renderer to
2041         return a more specific type.
2042
2043         * html/HTMLSelectElement.cpp:
2044         (WebCore::HTMLSelectElement::optionElementChildrenChanged): Don't use the renderer
2045         just to get to the document for the AXObjectCache.
2046         (WebCore::HTMLSelectElement::setLength): Use auto for the list items vector.
2047         (WebCore::HTMLSelectElement::nextValidIndex): Ditto.
2048         (WebCore::HTMLSelectElement::firstSelectableListIndex): Ditto.
2049         (WebCore::HTMLSelectElement::nextSelectableListIndexPageAway): Ditto. Also add a
2050         null check for the renderer.
2051         (WebCore::HTMLSelectElement::updateListBoxSelection): Split an assertion with &&
2052         in it into two separate assertions. Use auto for the list items vector and use
2053         a reference for the list items.
2054         (WebCore::HTMLSelectElement::listBoxOnChange): Use auto for the list items vector
2055         and use a reference for the list items.
2056         (WebCore::HTMLSelectElement::setRecalcListItems): Don't use the renderer
2057         just to get to the document for the AXObjectCache.
2058         (WebCore::HTMLSelectElement::selectOption): Use auto for the list items vector.
2059         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
2060         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
2061         (WebCore::HTMLSelectElement::searchOptionsForValue): Ditto.
2062         (WebCore::HTMLSelectElement::restoreFormControlState): Ditto.
2063         (WebCore::HTMLSelectElement::platformHandleKeydownEvent): Call renderer only once.
2064         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Split an assertion with
2065         && in it into two separate assertions. Use auto for the list items vector. Call
2066         renderer only once.
2067         (WebCore::HTMLSelectElement::updateSelectedState): Use a reference for the list
2068         item.
2069         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Use auto for the list
2070         items vvector. Call renderer less often; could not quite get it down to once.
2071         (WebCore::HTMLSelectElement::defaultEventHandler): Call renderer only once.
2072         (WebCore::HTMLSelectElement::lastSelectedListIndex): Use auto for the list items
2073         vector and use a reference for the list items.
2074         (WebCore::HTMLSelectElement::optionAtIndex): Use a reference for the list item.
2075         (WebCore::HTMLSelectElement::accessKeySetSelectedIndex): Use auto for the list
2076         items vector and use a reference for the list items.
2077         (WebCore::HTMLSelectElement::length): Use auto for the list items vector.
2078
2079         * html/HTMLTextAreaElement.h: Override renderer to return a more specific type.
2080
2081         * html/HTMLVideoElement.cpp:
2082         (WebCore::HTMLVideoElement::didAttachRenderers): Call renderer only once and
2083         don't downcast it. There was no obvious type check because the renderer has a
2084         guaranteed type, but this is now clearer because it's the renderer function
2085         that returns a more specific type.
2086         (WebCore::HTMLVideoElement::parseAttribute): Ditto.
2087         (WebCore::HTMLVideoElement::setDisplayMode): Ditto.
2088
2089         * html/HTMLVideoElement.h: Override renderer to return a more specific type.
2090         * html/HTMLWBRElement.h: Ditto.
2091
2092         * html/MediaElementSession.cpp:
2093         (WebCore::MediaElementSession::canControlControlsManager): Removed
2094         unneeded typecast in code that null checks a renderer.
2095         (WebCore::isMainContent): Remove now-unneeded downcast of a renderer
2096         obtained from an HTMLMediaElement. Fixed awkward formatting by splitting
2097         an if statement into two.
2098         (WebCore::isElementLargeEnoughForMainContent): Remove now unneeded downcast
2099         of a renderer obtained from an HTMLMediaElement.
2100
2101         * html/TextFieldInputType.cpp:
2102         (WebCore::TextFieldInputType::forwardEvent): Call renderer only once.
2103         Also use auto more in the code rather than writing out types.
2104
2105         * html/shadow/SliderThumbElement.cpp:
2106         (WebCore::SliderThumbElement::setPositionFromPoint): Used the renderBox
2107         function more consistently for all the renderers used here; before,
2108         some had null checks and others did not.
2109
2110         * html/shadow/TextControlInnerElements.cpp:
2111         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler): Use auto
2112         a bit more.
2113
2114         * page/EventHandler.cpp:
2115         (WebCore::enclosingScrollableArea): Removed a redundant null check and
2116         stopped using the name "element" for a local variable that was not
2117         always an element.
2118
2119         * page/PrintContext.cpp:
2120         (WebCore::enclosingBoxModelObject): Rewrote loop to be simpler and tighter.
2121         Also marked this inline since it's used only one place.
2122         (WebCore::PrintContext::pageNumberForElement): Use auto for the return
2123         value rather than writing out the type.
2124
2125         * page/SpatialNavigation.cpp:
2126         (WebCore::isScrollableNode): Tighten the code and use auto a bit.
2127
2128         * platform/ios/WebVideoFullscreenControllerAVKit.mm: Add an include of
2129         RenderVideo.h since this gets at the renderer for a video.
2130
2131         * rendering/RenderAttachment.h:
2132         (WebCore::HTMLAttachmentElement::renderer): Added. Function is here because
2133         it can only be called by code that includes this header. This matches the
2134         pattern of RenderElement.h and ContainerNode::renderer.
2135
2136         * rendering/RenderFrame.cpp: Added now-needed include.
2137
2138         * rendering/RenderFrame.h:
2139         (WebCore::HTMLFrameElement::renderer): Added. Same logic as above.
2140
2141         * rendering/RenderLayerFilterInfo.cpp:
2142         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients): Use auto
2143         a bit and call rendeer only once.
2144
2145         * rendering/RenderMedia.h:
2146         (WebCore::HTMLMediaElement::renderer): Added. Same logic as above.
2147         * rendering/RenderTextControlMultiLine.h:
2148         (WebCore::HTMLTextAreaElement::renderer): Ditto.
2149
2150         * rendering/RenderVideo.cpp:
2151         (WebCore::placeholder): Renamed. Tightened up argument type to match what
2152         is passed at all the call sites. Use auto instead of RenderObject.
2153         (WebCore::RenderVideo::offsetLeft): Use auto and the renamed function above.
2154         (WebCore::RenderVideo::offsetTop): Ditto.
2155         (WebCore::RenderVideo::offsetWidth): Ditto.
2156         (WebCore::RenderVideo::offsetHeight): Ditto.
2157
2158         * rendering/RenderVideo.h:
2159         (WebCore::HTMLVideoElement::renderer): Added. Same logic as above.
2160
2161         * svg/SVGGElement.cpp:
2162         (WebCore::SVGGElement::createElementRenderer): Fixed typo.
2163
2164         * svg/SVGGraphicsElement.cpp:
2165         (WebCore::SVGGraphicsElement::createElementRenderer): Removed
2166         non-helpful oblique comment.
2167         * svg/SVGPathElement.cpp:
2168         (WebCore::SVGPathElement::createElementRenderer): Ditto.
2169
2170 2016-06-01  Chris Fleizach  <cfleizach@apple.com>
2171
2172         LayoutTest accessibility/ios-simulator/attributed-string-for-range.html failing on ios-simulator debug
2173         https://bugs.webkit.org/show_bug.cgi?id=158279
2174
2175         Reviewed by Alexey Proskuryakov.
2176
2177         Just use the same description for debug and release. We're not getting any benefit from having two.
2178
2179         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2180         (-[WebAccessibilityObjectWrapper description]):
2181
2182 2016-06-01  Chris Dumez  <cdumez@apple.com>
2183
2184         Use HashMap::ensure() in DocumentOrderedMap::add()
2185         https://bugs.webkit.org/show_bug.cgi?id=158283
2186
2187         Reviewed by Ryosuke Niwa.
2188
2189         Use HashMap::ensure() in DocumentOrderedMap::add() to avoid constructing
2190         a MapEntry if the key is already present in the HashMap.
2191
2192         * dom/DocumentOrderedMap.cpp:
2193         (WebCore::DocumentOrderedMap::add):
2194
2195 2016-06-01  Alexey Proskuryakov  <ap@apple.com>
2196
2197         Update QuartzCoreSPI.h for <rdar://problem/26584828>.
2198
2199         * platform/spi/cocoa/QuartzCoreSPI.h:
2200
2201 2016-06-01  Brady Eidson  <beidson@apple.com>
2202
2203         Modernize lambda usage for all callers of RunLoop::dispatch().
2204         https://bugs.webkit.org/show_bug.cgi?id=158265
2205
2206         Reviewed by Chris Dumez.
2207
2208         No new tests (Refactor, no behavior change).
2209
2210         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2211         (WebCore::InProcessIDBServer::deleteDatabase):
2212         (WebCore::InProcessIDBServer::didDeleteDatabase):
2213         (WebCore::InProcessIDBServer::openDatabase):
2214         (WebCore::InProcessIDBServer::didOpenDatabase):
2215         (WebCore::InProcessIDBServer::didAbortTransaction):
2216         (WebCore::InProcessIDBServer::didCommitTransaction):
2217         (WebCore::InProcessIDBServer::didCreateObjectStore):
2218         (WebCore::InProcessIDBServer::didDeleteObjectStore):
2219         (WebCore::InProcessIDBServer::didClearObjectStore):
2220         (WebCore::InProcessIDBServer::didCreateIndex):
2221         (WebCore::InProcessIDBServer::didDeleteIndex):
2222         (WebCore::InProcessIDBServer::didPutOrAdd):
2223         (WebCore::InProcessIDBServer::didGetRecord):
2224         (WebCore::InProcessIDBServer::didGetCount):
2225         (WebCore::InProcessIDBServer::didDeleteRecord):
2226         (WebCore::InProcessIDBServer::didOpenCursor):
2227         (WebCore::InProcessIDBServer::didIterateCursor):
2228         (WebCore::InProcessIDBServer::abortTransaction):
2229         (WebCore::InProcessIDBServer::commitTransaction):
2230         (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
2231         (WebCore::InProcessIDBServer::createObjectStore):
2232         (WebCore::InProcessIDBServer::deleteObjectStore):
2233         (WebCore::InProcessIDBServer::clearObjectStore):
2234         (WebCore::InProcessIDBServer::createIndex):
2235         (WebCore::InProcessIDBServer::deleteIndex):
2236         (WebCore::InProcessIDBServer::putOrAdd):
2237         (WebCore::InProcessIDBServer::getRecord):
2238         (WebCore::InProcessIDBServer::getCount):
2239         (WebCore::InProcessIDBServer::deleteRecord):
2240         (WebCore::InProcessIDBServer::openCursor):
2241         (WebCore::InProcessIDBServer::iterateCursor):
2242         (WebCore::InProcessIDBServer::establishTransaction):
2243         (WebCore::InProcessIDBServer::fireVersionChangeEvent):
2244         (WebCore::InProcessIDBServer::didStartTransaction):
2245         (WebCore::InProcessIDBServer::didCloseFromServer):
2246         (WebCore::InProcessIDBServer::notifyOpenDBRequestBlocked):
2247         (WebCore::InProcessIDBServer::databaseConnectionClosed):
2248         (WebCore::InProcessIDBServer::abortOpenAndUpgradeNeeded):
2249         (WebCore::InProcessIDBServer::didFireVersionChangeEvent):
2250         (WebCore::InProcessIDBServer::openDBRequestCancelled):
2251         (WebCore::InProcessIDBServer::confirmDidCloseFromServer):
2252         (WebCore::InProcessIDBServer::getAllDatabaseNames):
2253         (WebCore::InProcessIDBServer::didGetAllDatabaseNames):
2254         
2255         * Modules/websockets/WebSocket.cpp:
2256         (WebCore::WebSocket::connect):
2257         
2258         * bindings/js/SerializedScriptValue.cpp:
2259         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
2260         
2261         * page/scrolling/ThreadedScrollingTree.cpp:
2262         (WebCore::ThreadedScrollingTree::invalidate):
2263         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2264         (WebCore::ThreadedScrollingTree::currentSnapPointIndicesDidChange):
2265         (WebCore::ThreadedScrollingTree::handleWheelEventPhase):
2266         (WebCore::ThreadedScrollingTree::setActiveScrollSnapIndices):
2267         (WebCore::ThreadedScrollingTree::deferTestsForReason):
2268         (WebCore::ThreadedScrollingTree::removeTestDeferralForReason):
2269         
2270         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2271         (WebCore::FontCache::platformPrecache):
2272         
2273         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
2274         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
2275         
2276         * platform/network/DataURLDecoder.cpp:
2277         (WebCore::DataURLDecoder::createDecodeTask):
2278         (WebCore::DataURLDecoder::decode):
2279
2280 2016-06-01  Eric Carlson  <eric.carlson@apple.com>
2281
2282         REGRESSION(r201385) ASSERT in WebCore::HTMLMediaElement::updateActiveTextTrackCues + 5688
2283         https://bugs.webkit.org/show_bug.cgi?id=158164
2284         <rdar://problem/26498634>
2285
2286         Reviewed by Jer Noble.
2287
2288         No new tests, this prevents an assert in existing tests.
2289
2290         * html/HTMLMediaElement.cpp:
2291         (WebCore::HTMLMediaElement::~HTMLMediaElement): Call beginIgnoringTrackDisplayUpdateRequests
2292           so we avoid doing unnecessary work triggered by destruction.
2293
2294 2016-06-01  Dean Jackson  <dino@apple.com>
2295
2296         Fix iOS build.
2297
2298         * platform/spi/cg/CoreGraphicsSPI.h: No ColorSync on iOS.
2299
2300 2016-06-01  Chris Dumez  <cdumez@apple.com>
2301
2302         Crash under eventTargetRespectingTargetRules()
2303         https://bugs.webkit.org/show_bug.cgi?id=158273
2304         <rdar://problem/26343998>
2305
2306         Reviewed by Alex Christensen.
2307
2308         The code would call nodeOrHostIfPseudoElement(), which can return null
2309         and then dereference it in eventTargetRespectingTargetRules() without
2310         null check. This patch adds a null check. When the node is null, the
2311         while loop after will do nothing and thus the target will not be used.
2312
2313         No new tests, we do not have a good reproduction case.
2314
2315         * dom/EventPath.cpp:
2316         (WebCore::EventPath::EventPath):
2317
2318 2016-06-01  Commit Queue  <commit-queue@webkit.org>
2319
2320         Unreviewed, rolling out r201551 and r201552.
2321         https://bugs.webkit.org/show_bug.cgi?id=158275
2322
2323         This change caused 3 API tests to crash on ios-simulator
2324         (Requested by ryanhaddad on #webkit).
2325
2326         Reverted changesets:
2327
2328         "Precache primary font in a secondary thread"
2329         https://bugs.webkit.org/show_bug.cgi?id=158243
2330         http://trac.webkit.org/changeset/201551
2331
2332         "Remove accidental fprintf."
2333         http://trac.webkit.org/changeset/201552
2334
2335 2016-06-01  Chris Fleizach  <cfleizach@apple.com>
2336
2337         AX: iOS: VoiceOver can't access attachments in mail messages
2338         https://bugs.webkit.org/show_bug.cgi?id=158198
2339
2340         Reviewed by Joanmarie Diggs.
2341
2342         Replaced elements, like attachemnts, were not being exposed in the attributed string returned to VoiceOver.
2343         Make sure they are exposed with the attachment character, pointing to the actual element.
2344
2345         Test: accessibility/ios-simulator/attributed-string-for-range.html
2346
2347         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2348         (AccessibilityUnignoredAncestor):
2349         (-[WebAccessibilityObjectWrapper _stringForRange:attributed:]):
2350
2351 2016-06-01  Jer Noble  <jer.noble@apple.com>
2352
2353         setVideoFullscreenGravity() has no effect on the fullscreen video layer
2354         https://bugs.webkit.org/show_bug.cgi?id=158267
2355
2356         Reviewed by Eric Carlson.
2357
2358         When we moved to a 2-AVPlayerLayer solution, we didn't update setVideoFullscreenGravity()
2359         to change the correct layer's videoGravity property.
2360
2361         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2362         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity):
2363
2364 2016-06-01  Alex Christensen  <achristensen@webkit.org>
2365
2366         Fix null dereferencing in ResourceTimingInformation::addResourceTiming
2367         https://bugs.webkit.org/show_bug.cgi?id=158266
2368         rdar://problem/26528466
2369
2370         Reviewed by Chris Dumez.
2371
2372         This would crash sometimes in http/tests/security/cross-frame-access-custom.html
2373
2374         * loader/ResourceTimingInformation.cpp:
2375         (WebCore::ResourceTimingInformation::addResourceTiming):
2376         * loader/ResourceTimingInformation.h:
2377         * loader/cache/CachedResourceLoader.cpp:
2378         (WebCore::CachedResourceLoader::requestResource):
2379         (WebCore::CachedResourceLoader::loadDone):
2380         We would dereference a null pointer on the first instruction when calling 
2381         Document::parentDocument from ResourceTimingInformation::addResourceTiming, 
2382         which means the document was null.  CachedResourceLoader::document even has
2383         a comment saying it can be null, so we should check it before using it.
2384
2385 2016-06-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
2386
2387         SVGImage should report its memory cost to JS garbage collector
2388         https://bugs.webkit.org/show_bug.cgi?id=158139
2389
2390         Reviewed by Geoffrey Garen.
2391
2392         Like what we do in HTMLImageLoader::notifyFinished() by reporting the memory
2393         cost of the BitmapImage, we need to do something similar for the SVGImage. In
2394         SVGImage::dataChange() and when allDataReceived is true, we can calculate
2395         the size of all DOM nodes and their renderers. The size of the encoded data
2396         has to be added as well to the total memory cost. An approximation for the
2397         memory cost has to be used since it is costly to get an accurate number.
2398
2399         * bindings/js/JSDocumentCustom.cpp: 
2400         (WebCore::reportMemoryForDocumentIfFrameless): Use Node::approximateMemoryCost()
2401         instead of sizeof(Node). A Node's descendant can override this function and
2402         return a more accurate memory cost.
2403         
2404         * dom/Node.h:
2405         (WebCore::Node::approximateMemoryCost): Define this new virtual function in the
2406         Node class. Its default value is sizeof(Node) but any descendant can return a
2407         more accurate number.
2408         
2409         * platform/graphics/Image.h:
2410         (WebCore::Image::data): Define a const version of data() so it can be called
2411         the const function SVGImage::reportApproximateMemoryCost().
2412         
2413         * svg/SVGGraphicsElement.h: Override approximateMemoryCost() to return 
2414         sizeof(SVGGraphicsElement).
2415         
2416         * svg/SVGPathElement.cpp:
2417         (WebCore::SVGPathElement::approximateMemoryCost): Override this function to return
2418         the memory cost of the points and the m_path of the renderer.
2419         * svg/SVGPathElement.h:
2420         
2421         * svg/SVGPolyElement.cpp:
2422         (WebCore::SVGPolyElement::approximateMemoryCost): Override this function to return
2423         the memory cost of the points and the m_path of the renderer.
2424         * svg/SVGPolyElement.h:
2425         
2426         * svg/graphics/SVGImage.cpp:
2427         (WebCore::SVGImage::reportApproximateMemoryCost): Calculate the memory cost of the 
2428         nodes in the SVGDocument of an SVGImage. Then report this number to the JS garbage 
2429         collector.
2430         
2431         (WebCore::SVGImage::dataChanged): After loading all the SVG encoded data and building
2432         its DOM tree and the render tree, report the total memory cost to the JS garbage collector.
2433         * svg/graphics/SVGImage.h:
2434
2435 2016-06-01  Andreas Kling  <akling@apple.com>
2436
2437         Use inline capacity for StylePropertyShorthand Vectors.
2438         <https://webkit.org/b/158260>
2439
2440         Reviewed by Antti Koivisto.
2441
2442         Vector<StylePropertyShorthand> was a huge source of heap allocations,
2443         just over 0.5% of all fastMalloc() bytes on PLUM. Giving it an inline capacity
2444         of 4 turns all of it into stack allocations.
2445
2446         * css/CSSParser.cpp:
2447         (WebCore::CSSParser::addProperty):
2448         * css/CSSProperty.cpp:
2449         (WebCore::StylePropertyMetadata::shorthandID):
2450         * css/StylePropertyShorthand.cpp:
2451         (WebCore::indexOfShorthandForLonghand):
2452         * css/StylePropertyShorthand.h:
2453         * css/makeprop.pl:
2454         (constructShorthandsVector):
2455
2456 2016-06-01  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2457
2458         POST request on a blob resource should return a "network error" instead of HTTP 500 response
2459         https://bugs.webkit.org/show_bug.cgi?id=158022
2460
2461         Reviewed by Alex Christensen.
2462
2463         Not allowed HTTP method is notified as failed in BlobResourceHandle as per Fetch
2464         specification (5.2 Basic fetch). This behavior is observable in fetch WPT tests.
2465
2466         The behavior of XHR is slightly changed for asynchronous request on a blob resource with not
2467         allowed or invalid HTTP methods. The onError callback is called instead of throwing an
2468         exception as per XHR specification (https://xhr.spec.whatwg.org/#request-error-steps).
2469
2470         WPT tests expected results have been updated for fetch tests on blob resources which are
2471         now correct.
2472
2473         Test: fast/files/xhr-blob-request.html ensures XHR response to requests on a blob resource is
2474         correct.
2475
2476         * platform/network/BlobResourceHandle.cpp:
2477         (WebCore::BlobResourceHandle::doStart):
2478         * xml/XMLHttpRequest.cpp:
2479         (WebCore::XMLHttpRequest::createRequest):
2480
2481 2016-06-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2482
2483         Remove allocation of SubresourceLoader::m_requestCountTracker
2484         https://bugs.webkit.org/show_bug.cgi?id=158255
2485
2486         Reviewed by Chris Dumez.
2487
2488         No change of behavior.
2489
2490         Making m_requestCountTracker an Optional in lieu of a unique_ptr.
2491         This requires constructing m_requestCountTracker in place so that constructor and destructor are called only once.
2492
2493         * loader/SubresourceLoader.cpp:
2494         (WebCore::SubresourceLoader::SubresourceLoader):
2495         (WebCore::SubresourceLoader::didReceiveResponse):
2496         (WebCore::SubresourceLoader::notifyDone):
2497         * loader/SubresourceLoader.h:
2498
2499 2016-06-01  Antti Koivisto  <antti@apple.com>
2500
2501         Remove accidental fprintf.
2502
2503         * platform/graphics/FontCache.cpp:
2504         (WebCore::FontCache::precache):
2505
2506 2016-05-31  Antti Koivisto  <antti@apple.com>
2507
2508         Precache primary font in a secondary thread
2509         https://bugs.webkit.org/show_bug.cgi?id=158243
2510
2511         Reviewed by Andreas Kling.
2512
2513         We know the font families and descriptions to use on style resolution. The actual fonts are only needed for
2514         layout. There is often time to load and cache fonts asynchronously before they are accessed. This can substantially
2515         reduce font related workload in the main thread.
2516
2517         * css/CSSFontFace.cpp:
2518         (WebCore::CSSFontFace::font):
2519         (WebCore::CSSFontFace::resolveFamilies):
2520         (WebCore::CSSFontFace::hasSVGFontFaceSource):
2521         * css/CSSFontFace.h:
2522         * css/CSSFontFaceSource.cpp:
2523         (WebCore::CSSFontFaceSource::font):
2524         (WebCore::CSSFontFaceSource::url):
2525         (WebCore::CSSFontFaceSource::isSVGFontFaceSource):
2526         * css/CSSFontFaceSource.h:
2527         * css/CSSFontSelector.cpp:
2528         (WebCore::CSSFontSelector::fallbackFontAt):
2529         (WebCore::CSSFontSelector::resolveFamilies):
2530
2531             Add a function for resolving font families of a cascade to their final values.
2532
2533         * css/CSSFontSelector.h:
2534         * css/CSSSegmentedFontFace.cpp:
2535         (WebCore::CSSSegmentedFontFace::fontRanges):
2536         (WebCore::CSSSegmentedFontFace::resolveFamilies):
2537         * css/CSSSegmentedFontFace.h:
2538         * platform/graphics/FontCache.cpp:
2539         (WebCore::fontPlatformDataCache):
2540         (WebCore::precacheTasksInProgress):
2541         (WebCore::alternateFamilyName):
2542         (WebCore::FontCache::getCachedFontPlatformData):
2543         (WebCore::FontCache::invalidate):
2544         (WebCore::FontCache::precache):
2545
2546             Precache fonts by trying to load them asyncronously one by one. On success the font is cached into font platform data cache.
2547
2548         (WebCore::FontCache::similarFont):
2549         * platform/graphics/FontCache.h:
2550         * platform/graphics/FontCascade.cpp:
2551         (WebCore::pruneSystemFallbackFonts):
2552         (WebCore::precachePrimaryFamily):
2553
2554             When initializing a new font cascade resolve any platform fonts to their actual names using FontSelector,
2555             then precache the primary font for the cascade.
2556
2557             Web fonts are ignored for now.
2558
2559         (WebCore::retrieveOrAddCachedFonts):
2560         * platform/graphics/FontSelector.h:
2561         (WebCore::FontSelector::~FontSelector):
2562         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2563         (WebCore::FontCache::setFontWhitelist):
2564         (WebCore::fontWithFamily):
2565         (WebCore::autoActivateFont):
2566         (WebCore::createFontPlatformDataThreadSafe):
2567
2568             Factor thread safe part of createFontPlatformData to a function.
2569
2570         (WebCore::FontCache::createFontPlatformData):
2571
2572             Do the main thread only hash lookups here then call to createFontPlatformDataThreadSafe.
2573
2574         (WebCore::fallbackDedupSet):
2575         (WebCore::FontCache::systemFallbackForCharacters):
2576         (WebCore::FontCache::platformPrecache):
2577
2578             Try to initialize font asynchronously in a dispatch queue, call completion handler on success or failure.
2579
2580         (WebCore::FontCache::platformCancelPrecache):
2581
2582             Cancel ongoing precache operation.
2583
2584         (WebCore::platformFontLookupWithFamily): Deleted.
2585
2586             This was inlined to the only client, fontWithFamily.
2587
2588 2016-06-01  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2589
2590         WebRTC: Add RTCRtpTransceiver interface and RTCPeerConnection.addTransceiver()
2591         https://bugs.webkit.org/show_bug.cgi?id=158189
2592
2593         Reviewed by Darin Adler.
2594
2595         The RTCRtpTransceiver interface represents a combination of an RTCRtpSender and an
2596         RTCRtpReceiver that share a common mid [1].
2597
2598         RTCPeerConnection.addTransceiver() [2] creates an RTCRtpTransceiver object, either directly
2599         from a MediaStreamTrack [3], or with a specific media type (kind).
2600
2601         This change introduces the RTCRtpTransceiver object, follow-up patches will integrate it
2602         into the offer/answer machinery.
2603
2604         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#rtcrtptransceiver-interface
2605         [2] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-addtransceiver
2606         [3] http://w3c.github.io/mediacapture-main/archives/20160513/getusermedia.html#mediastreamtrack
2607
2608         Test: fast/mediastream/RTCPeerConnection-addTransceiver.html
2609
2610         * CMakeLists.txt:
2611         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2612         (WebCore::MediaEndpointPeerConnection::createOfferTask):
2613         (WebCore::MediaEndpointPeerConnection::createReceiver):
2614         An RTCTransceiver always has a receiver (RTCRtpReceiver) with a track (MediaStreamTrack) that
2615         can be rendered. Before that remote track is receiving data from the remote peer, it's muted.
2616         createReceiver() uses MediaEndponit::createMutedRemoteSource() to create a source to represent
2617         future incoming media.
2618         * Modules/mediastream/MediaEndpointPeerConnection.h:
2619         * Modules/mediastream/PeerConnectionBackend.h:
2620         * Modules/mediastream/RTCPeerConnection.cpp:
2621         (WebCore::RTCPeerConnection::addTransceiver):
2622         (WebCore::RTCPeerConnection::completeAddTransceiver):
2623         (WebCore::RTCPeerConnection::addReceiver): Deleted.
2624         We now create the receiver explicitly with createReceiver.
2625         * Modules/mediastream/RTCPeerConnection.h:
2626         * Modules/mediastream/RTCPeerConnection.idl:
2627         * Modules/mediastream/RTCRtpSender.cpp:
2628         (WebCore::RTCRtpSender::create):
2629         (WebCore::RTCRtpSender::RTCRtpSender):
2630         (WebCore::RTCRtpSender::setTrack):
2631         (WebCore::RTCRtpSender::replaceTrack):
2632         * Modules/mediastream/RTCRtpSender.h:
2633         (WebCore::RTCRtpSender::trackId):
2634         (WebCore::RTCRtpSender::trackKind):
2635         (WebCore::RTCRtpSender::setMediaStreamIds):
2636         (WebCore::RTCRtpSender::isStopped):
2637         (WebCore::RTCRtpSender::create): Deleted.
2638         * Modules/mediastream/RTCRtpSenderReceiverBase.h:
2639         (WebCore::RTCRtpSenderReceiverBase::track):
2640         (WebCore::RTCRtpSenderReceiverBase::RTCRtpSenderReceiverBase):
2641         * Modules/mediastream/RTCRtpTransceiver.cpp: Added.
2642         (WebCore::RTCRtpTransceiver::create):
2643         (WebCore::RTCRtpTransceiver::getNextMid):
2644         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
2645         (WebCore::RTCRtpTransceiver::directionString):
2646         (WebCore::RTCRtpTransceiver::hasSendingDirection):
2647         (WebCore::RTCRtpTransceiver::enableSendingDirection):
2648         (WebCore::RTCRtpTransceiver::disableSendingDirection):
2649         * Modules/mediastream/RTCRtpTransceiver.h: Added.
2650         (WebCore::RTCRtpTransceiver::~RTCRtpTransceiver):
2651         (WebCore::RTCRtpTransceiver::direction):
2652         (WebCore::RTCRtpTransceiver::setDirection):
2653         (WebCore::RTCRtpTransceiver::provisionalMid):
2654         (WebCore::RTCRtpTransceiver::setProvisionalMid):
2655         (WebCore::RTCRtpTransceiver::mid):
2656         (WebCore::RTCRtpTransceiver::setMid):
2657         (WebCore::RTCRtpTransceiver::sender):
2658         (WebCore::RTCRtpTransceiver::receiver):
2659         (WebCore::RTCRtpTransceiver::stopped):
2660         (WebCore::RTCRtpTransceiver::stop):
2661         * Modules/mediastream/RTCRtpTransceiver.idl: Added.
2662         * WebCore.xcodeproj/project.pbxproj:
2663         * platform/mediastream/MediaEndpoint.h:
2664         Added createMutedRemoteSource() that creates a muted remote source that will become unmuted
2665         when media arrives from the remote peer.
2666         * platform/mediastream/RealtimeMediaSource.cpp:
2667         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Deleted.
2668         * platform/mediastream/RealtimeMediaSource.h:
2669         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2670         (WebCore::MockRealtimeVideoSource::create):
2671         Use Ref instead of RefPtr.
2672         * platform/mock/MockMediaEndpoint.cpp:
2673         (WebCore::MockMediaEndpoint::createMutedRemoteSource):
2674         * platform/mock/MockMediaEndpoint.h:
2675         * platform/mock/MockRealtimeAudioSource.cpp:
2676         (WebCore::MockRealtimeAudioSource::create):
2677         (WebCore::MockRealtimeAudioSource::createMuted):
2678         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
2679         * platform/mock/MockRealtimeAudioSource.h:
2680         * platform/mock/MockRealtimeVideoSource.cpp:
2681         (WebCore::MockRealtimeVideoSource::create):
2682         (WebCore::MockRealtimeVideoSource::createMuted):
2683         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
2684         * platform/mock/MockRealtimeVideoSource.h:
2685
2686 2016-06-01  Per Arne Vollan  <pvollan@apple.com>
2687
2688         [Win][IndexedDB] Crash when running blob test.
2689         https://bugs.webkit.org/show_bug.cgi?id=158224
2690
2691         Reviewed by Brady Eidson.
2692
2693         Avoid calling WTFMove(x) before calling x->method().
2694
2695         * Modules/indexeddb/IDBTransaction.cpp:
2696         (WebCore::IDBTransaction::putOrAddOnServer):
2697
2698 2016-06-01  Manuel Rego Casasnovas  <rego@igalia.com>
2699
2700         [css-grid] Positioned items can be placed on the implicit grid
2701         https://bugs.webkit.org/show_bug.cgi?id=158197
2702
2703         Reviewed by Sergio Villar Senin.
2704
2705         The old code wrongly assumed that positioned items couldn't be placed
2706         on the implicit grid. However, the spec doesn't mention anything about this.
2707
2708         The patch fixes this issue, so now positioned items can be actually
2709         placed on the implicit tracks.
2710
2711         Test: fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html
2712
2713         * rendering/RenderGrid.cpp:
2714         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild): Use the lines
2715         of the implicit grid instead of the explicit one.
2716
2717 2016-05-31  Chris Dumez  <cdumez@apple.com>
2718
2719         Modernize lambda captures in WorkerThreadableWebSocketChannel
2720         https://bugs.webkit.org/show_bug.cgi?id=158246
2721
2722         Reviewed by Brady Eidson.
2723
2724         Modernize lambda captures in WorkerThreadableWebSocketChannel and drop
2725         legacy URLCapture as it is no longer needed / used.
2726
2727         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2728         (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
2729         (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
2730         (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
2731         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
2732         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
2733         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
2734         (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
2735         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
2736         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
2737         (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
2738         (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
2739         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
2740         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
2741         (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
2742         (WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
2743         (WebCore::WorkerThreadableWebSocketChannel::Bridge::fail):
2744         (WebCore::WorkerThreadableWebSocketChannel::Bridge::disconnect):
2745         (WebCore::WorkerThreadableWebSocketChannel::Bridge::suspend):
2746         (WebCore::WorkerThreadableWebSocketChannel::Bridge::resume):
2747         (WebCore::WorkerThreadableWebSocketChannel::Bridge::setMethodNotCompleted): Deleted.
2748         (WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion): Deleted.
2749         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
2750         * platform/URL.h:
2751         (WebCore::operator==): Deleted.
2752
2753 2016-05-31  Joseph Pecoraro  <pecoraro@apple.com>
2754
2755         Web Inspector: ReportExtraMemoryCost IDL attribute should also be used to generate estimatedSize method
2756         https://bugs.webkit.org/show_bug.cgi?id=158144
2757
2758         Reviewed by Darin Adler.
2759
2760         * bindings/scripts/CodeGeneratorJS.pm:
2761         (InstanceNeedsEstimatedSize):
2762         (GenerateHeader):
2763         (GenerateImplementation):
2764         When an interface includes ReportExtraMemoryCost, generate an estimatedSize
2765         method which includes the Base::estimatedSize and the memoryCost().
2766
2767         * bindings/scripts/test/GObject/WebKitDOMInterfaceName.cpp: Added.
2768         (WebKit::kit):
2769         (WebKit::core):
2770         (WebKit::wrapInterfaceName):
2771         (webkit_dom_interface_name_finalize):
2772         (webkit_dom_interface_name_constructor):
2773         (webkit_dom_interface_name_class_init):
2774         (webkit_dom_interface_name_init):
2775         * bindings/scripts/test/GObject/WebKitDOMInterfaceName.h: Added.
2776         * bindings/scripts/test/GObject/WebKitDOMInterfaceNamePrivate.h: Added.
2777         * bindings/scripts/test/JS/JSInterfaceName.cpp: Added.
2778         (WebCore::JSInterfaceNamePrototype::create):
2779         (WebCore::JSInterfaceNamePrototype::createStructure):
2780         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
2781         (WebCore::JSInterfaceNameConstructor::prototypeForStructure):
2782         (WebCore::JSInterfaceNameConstructor::initializeProperties):
2783         (WebCore::JSInterfaceNamePrototype::finishCreation):
2784         (WebCore::JSInterfaceName::JSInterfaceName):
2785         (WebCore::JSInterfaceName::createPrototype):
2786         (WebCore::JSInterfaceName::prototype):
2787         (WebCore::JSInterfaceName::destroy):
2788         (WebCore::jsInterfaceNameConstructor):
2789         (WebCore::setJSInterfaceNameConstructor):
2790         (WebCore::JSInterfaceName::getConstructor):
2791         (WebCore::JSInterfaceName::visitChildren):
2792         (WebCore::JSInterfaceName::estimatedSize):
2793         (WebCore::JSInterfaceNameOwner::isReachableFromOpaqueRoots):
2794         (WebCore::JSInterfaceNameOwner::finalize):
2795         (WebCore::toJSNewlyCreated):
2796         (WebCore::toJS):
2797         (WebCore::JSInterfaceName::toWrapped):
2798         * bindings/scripts/test/JS/JSInterfaceName.h: Added.
2799         (WebCore::JSInterfaceName::create):
2800         (WebCore::JSInterfaceName::createStructure):
2801         (WebCore::JSInterfaceName::finishCreation):
2802         (WebCore::wrapperOwner):
2803         (WebCore::wrapperKey):
2804         (WebCore::toJS):
2805         (WebCore::toJSNewlyCreated):
2806         * bindings/scripts/test/ObjC/DOMInterfaceName.h: Added.
2807         * bindings/scripts/test/ObjC/DOMInterfaceName.mm: Added.
2808         (-[DOMInterfaceName dealloc]):
2809         (core):
2810         (kit):
2811         * bindings/scripts/test/ObjC/DOMInterfaceNameInternal.h: Added.
2812         * bindings/scripts/test/TestReportExtraMemoryCost.idl: Added.
2813         Include a test for the ReportExtraMemoryCost attribute.
2814
2815 2016-05-31  Alex Christensen  <achristensen@webkit.org>
2816
2817         Fix assertion after r201447
2818         https://bugs.webkit.org/show_bug.cgi?id=158244
2819
2820         Reviewed by Jer Noble.
2821
2822         * loader/cache/CachedResourceLoader.cpp:
2823         (WebCore::CachedResourceLoader::loadResource):
2824         If we are loading media using WebCoreNSURLSession, we could be making a request for a
2825         resource we already have in the memory cache because we are ignoring all caches.
2826
2827 2016-05-31  Chris Dumez  <cdumez@apple.com>
2828
2829         Clean up / modernize iOS text autosizing code
2830         https://bugs.webkit.org/show_bug.cgi?id=158217
2831
2832         Reviewed by Darin Adler.
2833
2834         Clean up / modernize iOS text autosizing code.
2835
2836         I think iOS text autosizing code is too intrusive inside the RenderStyle
2837         class but I have not updated this part of the code yet to limit patch
2838         size. This patch focuses on the TextAutoSizing.* and text autosizing
2839         code in the Document class.
2840
2841         * WebCore.xcodeproj/project.pbxproj:
2842         * dom/Document.cpp:
2843         (WebCore::TextAutoSizingTraits::constructDeletedValue): Deleted.
2844         (WebCore::TextAutoSizingTraits::isDeletedValue): Deleted.
2845         Move TextAutoSizingTraits to the TextAutoSizing header to
2846         promote reuse and make the text autosizing code a little less
2847         intrusive.
2848
2849         (WebCore::Document::addAutoSizingNode):
2850         - Drop local 'key' variable as it is only used once.
2851         - Use std::make_unique<> to construct the TextAutoSizingValue
2852           as it is no longer ref-counted.
2853
2854         (WebCore::Document::validateAutoSizingNodes):
2855         Iterate over the textAutosizedNodes HashMap only once instead
2856         of twice. TextAutoSizingValue::adjustTextNodeSizes() was updated
2857         to return an enum class so we know from that value if we can
2858         remove the value from the HashSet or not, without having to rely
2859         on TextAutoSizingValue::numNodes(), which I removed in this
2860         patch.
2861
2862         (WebCore::Document::clearAutoSizingNodes):
2863         Updated the TextAutoSizingValue destructor to call reset() so
2864         we don't have to explicitly call reset() on each value before
2865         clearing the textAutosizedNodes HashMap.
2866
2867         * dom/Document.h:
2868         - Move TextAutoSizingTraits to the TextAutosizing header.
2869         - Rename resetAutosizingNodes() to clearAutoSizingNodes() as
2870           the method now only clears the textAutosizedNodes HashMap
2871           and reset() is now an implementation detail for
2872           TextAutoSizingValue.
2873
2874         * rendering/RenderElement.cpp:
2875         (WebCore::RenderElement::resetTextAutosizing):
2876         Call clearAutoSizingNodes() as it was renamed.
2877
2878         * rendering/TextAutoSizing.cpp:
2879         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
2880         - Use value of -1 for std::unique_ptr m_style member for distinguishing
2881         a HashTable deleted value, instead of having an extra m_isDeleted
2882         data member for this purpose.
2883         - Take RenderStyle parameter by reference and drop the null check as the
2884           call site can never pass nullptr.
2885
2886         (WebCore::TextAutoSizingValue::addTextNode):
2887         - Rename addNode() to addTextNode() for clarity.
2888
2889         (WebCore::TextAutoSizingValue::~TextAutoSizingValue):
2890         Update destructor to call reset() so that the Document does not have to
2891         call it explicitly and can instead just clear the HashMap, which will
2892         destroy the TextAutoSizingValue objects.
2893
2894         (WebCore::TextAutoSizingValue::reset):
2895         Rename text to renderer for clarity.
2896
2897         * rendering/TextAutoSizing.h:
2898         - Make TextAutoSizingValue as fast allocated.
2899         - Update TextAutoSizingValue to no longer be refcounted as ownership is never
2900           shared. The Document owns those.
2901         - Drop the factory function for TextAutoSizingValue and make the constructor
2902           public now that the class is no longer refcounted.
2903         - Make reset() method private now that it is called from the destructor and
2904           the Document is no longer expected to explicitly call it.
2905         - Update adjustTextNodeSizes() to return a StillHasNodes enum class and the
2906           Document can rely on the determine if it can drop the TextAutoSizingValue
2907           from its HashMap (and therefore destroy the object).
2908         - Drop numNodes() method as it is no longer needed.
2909
2910
2911 2016-05-31  Dave Hyatt  <hyatt@apple.com>
2912
2913         REGRESSION(r201040): Repainting of moving overflow:hidden objects is broken.
2914         https://bugs.webkit.org/show_bug.cgi?id=158079
2915
2916         Reviewed by Zalan Bujtas.
2917
2918         Added new test fast/repaint/overflow-hidden-movement.html
2919
2920         Change checkForRepaintDuringLayout() to only be true for self-painting layers
2921         and not for all layers.
2922
2923         * rendering/RenderObject.cpp:
2924         (WebCore::RenderObject::hasSelfPaintingLayer):
2925         (WebCore::RenderObject::checkForRepaintDuringLayout):
2926         * rendering/RenderObject.h:
2927         (WebCore::RenderObject::hasSelfPaintingLayer):
2928
2929 2016-05-31  Zalan Bujtas  <zalan@apple.com>
2930
2931         ShowRenderTree: Print location information for relative/sticky inlines.
2932         https://bugs.webkit.org/show_bug.cgi?id=158235
2933
2934         Reviewed by David Hyatt.
2935
2936         * rendering/RenderObject.cpp:
2937         (WebCore::RenderObject::showRenderObject):
2938
2939 2016-05-31  Jer Noble  <jer.noble@apple.com>
2940
2941         Unreviewed build fix; use ASSERT_UNUSED rather than ASSERT to fix release builds.
2942
2943         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2944         (WebCore::MediaPlayerPrivateAVFoundationObjC::removeSession):
2945
2946 2016-05-31  Jer Noble  <jer.noble@apple.com>
2947
2948         [EME] Sound continues playing when video's src is changed
2949         https://bugs.webkit.org/show_bug.cgi?id=158233
2950
2951         Reviewed by Eric Carlson.
2952
2953         When CDMSessionAVFoundation began listening for outputObscuredDueToInsufficientExternalProtection
2954         KVO notifications, it retained the AVPlayer owned by MediaPlayerPrivateAVFoundationObjC, which
2955         caused the AVPlayer to outlive its original owner, and to continue playing even after the
2956         MediaPlayerPrivateAVFoundationObjC had been destroyed.
2957
2958         Rather than observe for outputObscuredDueToInsufficientExternalProtection changes in
2959         CDMSessionAVFoundation, add a backreference from the media player to the session, listen for changes
2960         in the player, and have the player notify the session when the value of that property changes.
2961
2962         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
2963         (WebCore::CDMSessionAVFoundationObjC::createWeakPtr):
2964         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2965         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
2966         (-[WebCDMSessionAVFoundationObjCListener initWithParent:player:]): Deleted.
2967         (-[WebCDMSessionAVFoundationObjCListener invalidate]): Deleted.
2968         (-[WebCDMSessionAVFoundationObjCListener observeValueForKeyPath:ofObject:change:context:]): Deleted.
2969         (WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC): Deleted.
2970         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2971         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2972         (WebCore::MediaPlayerPrivateAVFoundationObjC::removeSession):
2973         (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
2974         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2975         (WebCore::playerKVOProperties):
2976         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2977
2978 2016-05-31  Eric Carlson  <eric.carlson@apple.com>
2979
2980         [Mac] AirPlay route is sometimes reset when changing video.src
2981         https://bugs.webkit.org/show_bug.cgi?id=158226
2982         <rdar://problem/24197592>
2983
2984         Reviewed by Jer Noble.
2985
2986         Test: media/airplay-autoplay.html
2987
2988         * html/HTMLMediaElement.cpp:
2989         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Remove the gesture requirement
2990           if currently processing a user gesture.
2991         (WebCore::HTMLMediaElement::dispatchEvent): Set m_failedToPlayToWirelessTarget to false when
2992           dispatching webkitcurrentplaybacktargetiswirelesschanged so an element can succeed after failing.
2993
2994 2016-05-31  Chris Dumez  <cdumez@apple.com>
2995
2996         Regression(r201482): Crash under dispatch_semaphore_wait
2997         https://bugs.webkit.org/show_bug.cgi?id=158230
2998         <rdar://problem/26534698>
2999
3000         Reviewed by Eric Carlson.
3001
3002         Stop moving hasSessionSemaphore in the lambda capture since it is used in
3003         dispatch_semaphore_wait() call after the callOnMainThread() call.
3004
3005         No new tests, already covered by tests that are crashing on the bots.
3006
3007         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3008         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
3009
3010 2016-05-31  Brady Eidson  <beidson@apple.com>
3011
3012         Make createCrossThreadTask() functions return on the stack instead of the heap.
3013         https://bugs.webkit.org/show_bug.cgi?id=158215
3014
3015         Reviewed by Darin Adler.
3016
3017         No new tests (Refactor, no change in behavior).
3018
3019         * Modules/indexeddb/client/IDBConnectionProxy.h:
3020         
3021         * Modules/indexeddb/server/IDBServer.cpp:
3022         (WebCore::IDBServer::IDBServer::postDatabaseTask):
3023         (WebCore::IDBServer::IDBServer::postDatabaseTaskReply):
3024         (WebCore::IDBServer::IDBServer::databaseRunLoop):
3025         * Modules/indexeddb/server/IDBServer.h:
3026         
3027         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3028         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
3029         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
3030         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3031         
3032         * dom/ScriptExecutionContext.h:
3033         (WebCore::ScriptExecutionContext::postCrossThreadTask):
3034         
3035         * fileapi/ThreadableBlobRegistry.cpp:
3036         (WebCore::threadableQueue):
3037
3038 2016-05-31  Dave Hyatt  <hyatt@apple.com>
3039
3040         REGRESSION (r189567): Elements with aspect ratios not handled correctly inside flexbox.
3041         https://bugs.webkit.org/show_bug.cgi?id=158040
3042
3043         Reviewed by Zalan Bujtas.
3044
3045         Added new tests in fast/flexbox.
3046
3047         * rendering/RenderFlexibleBox.cpp:
3048         (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning):
3049         (WebCore::RenderFlexibleBox::hasOrthogonalFlow):
3050         (WebCore::RenderFlexibleBox::mainAxisContentExtent):
3051         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
3052         (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild):
3053         (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite):
3054         (WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild):
3055         (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
3056         (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite):
3057         (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
3058         (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
3059         (WebCore::RenderFlexibleBox::useChildAspectRatio):
3060         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
3061         (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis):
3062         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
3063         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite): Deleted.
3064         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite): Deleted.
3065         * rendering/RenderFlexibleBox.h:
3066         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
3067
3068 2016-05-31  Alex Christensen  <achristensen@webkit.org>
3069
3070         Build fix after r201482.
3071
3072         * platform/network/curl/CurlDownload.cpp:
3073         (WebCore::CurlDownload::didReceiveHeader):
3074         header used to be capturedHeader, which was a StringCapture, which needed .string() to get the String.
3075         Now it's a WTF::String, so we already have the String.  Hooray for c++14!
3076
3077 2016-05-31  Sergio Villar Senin  <svillar@igalia.com>
3078
3079         Unreviewed build fix.
3080
3081         * rendering/RenderGrid.cpp:
3082         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3083         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3084
3085 2016-05-25  Sergio Villar Senin  <svillar@igalia.com>
3086
3087         [css-grid] Empty grid without explicit tracks shouldn't have any size
3088         https://bugs.webkit.org/show_bug.cgi?id=155197
3089
3090         Reviewed by Darin Adler.
3091
3092         The internal representation of the grid is a Vector of Vector representing rows and
3093         columns. Because of that it was not possible to have columns without having at least one
3094         row. That forced us to have a 1x1 internal representation of the grid even if it was
3095         actually empty. That works for most of the cases except when the grid is actually empty.
3096
3097         By changing the way we compute the sizes we can overcome that implementation
3098         restriction. This allowed us also to thighten the conditions under we could use the
3099         GridIterator. From now on it won't be possible to use it on empty grids so callers should
3100         enforce that restriction.
3101
3102         A new bool was added to verify that placeItemsOnGrid() has been already called. The previous
3103         code was relying on the fact that there were items in the internal representation, which is
3104         wrong, as there might be no items in the grid.
3105
3106         Test: fast/css-grid-layout/empty-grid.html
3107
3108         * rendering/RenderGrid.cpp:
3109         (WebCore::RenderGrid::GridIterator::GridIterator): Added ASSERTs.
3110         (WebCore::RenderGrid::GridIterator::nextGridItem): Ditto.
3111         (WebCore::RenderGrid::GridIterator::isEmptyAreaEnough): Ditto.
3112         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea): Ditto.
3113         (WebCore::RenderGrid::gridColumnCount): Use the style to resolve the number of columns if
3114         the internal representation is empty.
3115         (WebCore::RenderGrid::gridRowCount):
3116         (WebCore::RenderGrid::guttersSize): Allow to pass 0 as span, this permits using the return
3117         value of gridColumnCount|gridRowCount directly to call this method.
3118         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Use m_gridIsDirty.
3119         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Do not examine the contents of grid
3120         tracks if there are no items in the grid.
3121         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Ditto.
3122         (WebCore::RenderGrid::placeItemsOnGrid): Set m_gridIsDirty to false.
3123         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
3124         (WebCore::RenderGrid::clearGrid):
3125         (WebCore::RenderGrid::populateGridPositionsForDirection):
3126         * rendering/RenderGrid.h: Moved gridColumnCount/gridRowCount to cpp file.
3127
3128 2016-05-30  Brady Eidson  <beidson@apple.com>
3129
3130         Move CrossThreadCopier/CrossThreadTask to WTF.
3131         https://bugs.webkit.org/show_bug.cgi?id=158207
3132
3133         Reviewed by Alex Christensen.
3134
3135         No new tests (Refactor, no behavior change).
3136
3137         * CMakeLists.txt:
3138         * WebCore.xcodeproj/project.pbxproj:
3139
3140         * Modules/indexeddb/IDBActiveDOMObject.h:
3141         * Modules/indexeddb/IDBValue.cpp:
3142         * Modules/indexeddb/client/IDBConnectionProxy.h:
3143         * Modules/indexeddb/server/IDBServer.cpp:
3144         * Modules/indexeddb/server/IDBServer.h:
3145         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3146         * dom/ScriptExecutionContext.h:
3147         * fileapi/ThreadableBlobRegistry.cpp:
3148         
3149         * platform/WebCoreCrossThreadCopier.cpp: Added.
3150         (WTF::WebCore::SessionID>::copy):
3151         (WTF::WebCore::ThreadSafeDataBuffer>::copy):
3152         * platform/WebCoreCrossThreadCopier.h: Added.
3153         
3154         * platform/network/cf/ResourceError.h:
3155         (WebCore::ResourceError::isolatedCopy):
3156         
3157         * platform/network/cf/ResourceRequest.h:
3158         (WebCore::ResourceRequest::isolatedCopy):
3159         
3160         * platform/network/cf/ResourceResponse.h:
3161         (WebCore::ResourceResponse::isolatedCopy):
3162
3163 2016-05-30  Per Arne Vollan  <pvollan@apple.com>
3164
3165         http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html crashes on Windows almost all the time
3166         https://bugs.webkit.org/show_bug.cgi?id=144057
3167
3168         Reviewed by Brent Fulgham.
3169
3170         Protect SocketStreamHandle object before trying to access it on the main thread, and make sure
3171         CFWriteStreamRef parameter is valid before calling CFWriteStreamCanAcceptBytes. 
3172
3173         * platform/network/cf/SocketStreamHandleCFNet.cpp:
3174         (WebCore::SocketStreamHandle::readStreamCallback):
3175         (WebCore::SocketStreamHandle::writeStreamCallback):
3176
3177 2016-05-30  Javier Fernandez  <jfernandez@igalia.com>
3178
3179         [CSS Box Alignment] New CSS Value 'normal' for Self Alignment
3180         https://bugs.webkit.org/show_bug.cgi?id=156254
3181
3182         Reviewed by Darin Adler.
3183
3184         The Box Alignment specification defines a new value 'normal' to be used
3185         as default for the different layout models, which will define the
3186         specific behavior for each case. This patch adds a new CSS value in the
3187         parsing logic and adapts the Self Alignment properties to the new
3188         value.
3189
3190         The 'auto' value is no longer valid for the 'align-items' property and
3191         the Computed Value will be always the specified value. Hence, I removed
3192         the StyleResolver logic because is not required now; the specific
3193         behavior of the 'normal' value will be resolved at layout time.
3194
3195         Additionally, this patch updates the layout logic as well, for both
3196         Flexbox and Grid layout models.
3197
3198         Test: css3/parse-alignment-of-root-elements.html
3199
3200         * css/CSSComputedStyleDeclaration.cpp:
3201         (WebCore::resolveLegacyJustifyItems): Added.
3202         (WebCore::resolveJustifyItemsAuto): Added.
3203         (WebCore::resolveJustifySelfAuto): Added.
3204         (WebCore::resolveAlignSelfAuto): Added.
3205         (WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument.
3206         (WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions.
3207         * css/CSSParser.cpp:
3208         (WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid.
3209         * css/CSSPrimitiveValueMappings.h:
3210         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'.
3211         (WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'.
3212         * css/CSSPropertyNames.in:
3213         * css/StyleResolver.cpp:
3214         (WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy" keyword.
3215         * rendering/RenderBox.cpp:
3216         (WebCore::flexItemHasStretchAlignment):
3217         (WebCore::RenderBox::hasStretchedLogicalWidth):
3218         * rendering/RenderFlexibleBox.cpp:
3219         (WebCore::RenderFlexibleBox::styleDidChange):
3220         (WebCore::RenderFlexibleBox::alignmentForChild):
3221         (WebCore::contentAlignmentNormalBehaviorFlexibleBox):
3222         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
3223         (WebCore::RenderFlexibleBox::layoutColumnReverse):
3224         (WebCore::RenderFlexibleBox::alignFlexLines):
3225         (WebCore::RenderFlexibleBox::alignChildren):
3226         * rendering/RenderGrid.cpp:
3227         (WebCore::defaultAlignmentChangedToStretchInRowAxis):
3228         (WebCore::defaultAlignmentChangedFromStretchInRowAxis):
3229         (WebCore::defaultAlignmentChangedFromStretchInColumnAxis):
3230         (WebCore::selfAlignmentChangedToStretchInRowAxis):
3231         (WebCore::selfAlignmentChangedFromStretchInRowAxis):
3232         (WebCore::selfAlignmentChangedFromStretchInColumnAxis):
3233         (WebCore::contentAlignmentNormalBehaviorGrid):
3234         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
3235         (WebCore::RenderGrid::needToStretchChildLogicalHeight):
3236         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
3237         (WebCore::RenderGrid::columnAxisPositionForChild):
3238         (WebCore::RenderGrid::rowAxisPositionForChild):
3239         (WebCore::RenderGrid::columnAxisOffsetForChild):
3240         (WebCore::RenderGrid::rowAxisOffsetForChild):
3241         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
3242         * rendering/style/RenderStyle.cpp:
3243         (WebCore::resolvedSelfAlignment):
3244         (WebCore::RenderStyle::resolvedAlignItems):
3245         (WebCore::RenderStyle::resolvedAlignSelf):
3246         (WebCore::RenderStyle::resolvedJustifyItems):
3247         (WebCore::RenderStyle::resolvedJustifySelf):
3248         * rendering/style/RenderStyle.h:
3249         * rendering/style/RenderStyleConstants.h:
3250         * rendering/style/StyleRareNonInheritedData.cpp:
3251         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function.
3252
3253 2016-05-29  Brady Eidson  <beidson@apple.com>
3254
3255         Transition various Task/Function queues from std::function to NoncopyableFunction.
3256         https://bugs.webkit.org/show_bug.cgi?id=158196
3257
3258         Reviewed by Chris Dumez.
3259
3260         No new tests (Refactor, no behavior change).
3261
3262         * dom/ActiveDOMCallbackMicrotask.cpp:
3263         (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
3264         * dom/ActiveDOMCallbackMicrotask.h:
3265
3266         * html/HTMLMediaElement.cpp:
3267         (WebCore::HTMLMediaElement::layoutSizeChanged):
3268
3269         * page/FrameView.cpp:
3270         (WebCore::FrameView::queuePostLayoutCallback):
3271         (WebCore::FrameView::flushPostLayoutTasksQueue):
3272         * page/FrameView.h:
3273
3274         * platform/GenericTaskQueue.cpp:
3275         (WebCore::TaskDispatcher<Timer>::postTask):
3276         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
3277         * platform/GenericTaskQueue.h:
3278         (WebCore::TaskDispatcher::postTask):
3279         (WebCore::GenericTaskQueue::enqueueTask):
3280
3281         * style/StyleTreeResolver.cpp:
3282         (WebCore::Style::postResolutionCallbackQueue):
3283         (WebCore::Style::queuePostResolutionCallback):
3284         (WebCore::Style::suspendMemoryCacheClientCalls):
3285         * style/StyleTreeResolver.h:
3286
3287 2016-05-29  Brady Eidson  <beidson@apple.com>
3288
3289         Make ScriptExecutionContext::Task work in terms of wtf::NoncopyableFunction instead of std::function.
3290         https://bugs.webkit.org/show_bug.cgi?id=158187
3291
3292         Reviewed by Chris Dumez.
3293
3294         No new tests (Refactor, no behavior change).
3295
3296         Also make postTask take an rvalue reference.
3297
3298         * bindings/js/JSDOMGlobalObjectTask.cpp:
3299         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
3300         
3301         * dom/Document.cpp:
3302         (WebCore::Document::postTask):
3303         * dom/Document.h:
3304         
3305         * dom/ScriptExecutionContext.h:
3306         (WebCore::ScriptExecutionContext::Task::Task):
3307         
3308         * workers/WorkerGlobalScope.cpp:
3309         (WebCore::WorkerGlobalScope::postTask):
3310         * workers/WorkerGlobalScope.h:
3311
3312 2016-05-28  Chris Dumez  <cdumez@apple.com>
3313
3314         Templatize NoncopyableFunction class similarly to std::function
3315         https://bugs.webkit.org/show_bug.cgi?id=158185
3316
3317         Reviewed by Darin Adler.
3318
3319         Templatize NoncopyableFunction class similarly to std::function, so
3320         that it can be used as a std::function replacement in more places.
3321
3322         Previously, NoncopyableFunction could only support "void()" lambdas.
3323
3324         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3325         (WebCore::MediaEndpointPeerConnection::runTask):
3326         * Modules/mediastream/MediaEndpointPeerConnection.h:
3327         * fileapi/AsyncFileStream.cpp:
3328         (WebCore::callOnFileThread):
3329         (WebCore::AsyncFileStream::perform):
3330         (WebCore::AsyncFileStream::getSize):
3331         (WebCore::AsyncFileStream::openForRead):
3332         (WebCore::AsyncFileStream::openForWrite):
3333         (WebCore::AsyncFileStream::write):
3334         * fileapi/AsyncFileStream.h:
3335         * page/scrolling/ScrollingThread.cpp:
3336         (WebCore::ScrollingThread::dispatch):
3337         (WebCore::ScrollingThread::dispatchBarrier):
3338         (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
3339         * page/scrolling/ScrollingThread.h:
3340         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3341         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3342         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
3343         * platform/mediastream/MediaStreamPrivate.cpp:
3344         (WebCore::MediaStreamPrivate::scheduleDeferredTask):
3345         * platform/mediastream/MediaStreamPrivate.h:
3346         * platform/mediastream/mac/AVMediaCaptureSource.h:
3347         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3348         (WebCore::AVMediaCaptureSource::scheduleDeferredTask):
3349
3350 2016-05-28  Alexey Proskuryakov  <ap@apple.com>
3351
3352         Fix the build with newer clang and other custom configuration options
3353         https://bugs.webkit.org/show_bug.cgi?id=158161
3354
3355         Reviewed by Dan Bernstein.
3356
3357         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
3358         (WebCore::WebVideoFullscreenInterfaceMac::rateChanged): Added UNUSED_PARAMs for the
3359         case where this function is unimplemented.
3360         (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback): Added a non-additions
3361         version of this function.
3362         * platform/spi/cf/CFNetworkSPI.h: Silence nullability-completeness (and other) warnings.
3363         I doubt that it's practical to get these right for every SDK version at this time. Added
3364         functions for overriding HTTPS certicate behavior that we used to declare in .m files.
3365         * platform/spi/mac/AVFoundationSPI.h: Define AVAssetCache conditionally.
3366
3367 2016-05-28  Ryosuke Niwa  <rniwa@webkit.org>
3368
3369         Autocorrection makes it hard to type "doesn't" and to type @ in email addresses
3370         https://bugs.webkit.org/show_bug.cgi?id=158177
3371         <rdar://problem/20490862>
3372         <rdar://problem/24707954>
3373
3374         Reviewed by Darin Adler.
3375
3376         When the user had typed "doesn'", some unified spellchecker may try to autocorrect it to "doesn't" or "does"
3377         but we should ignore this for a moment until the next character is typed by the user. The code to deal with
3378         this situation which checks the existence of an "ambiguous boundary character" was not robust when the
3379         replacement text was longer than the corrected text.
3380
3381         Fixed this bug by fixing the logic to detect this case. Also added '@' as an ambiguous boundary character
3382         since autocorrecting letters that appear right before '@' would not be useful in many cases.
3383
3384         Tests: ManualTests/autocorrection/autocorrection-at-mark.html
3385                ManualTests/autocorrection/autocorrection-contraction-2.html
3386
3387         * editing/AlternativeTextController.cpp:
3388         (WebCore::AlternativeTextController::timerFired): Fixed a bug that we can show an empty reversion panel.
3389         * editing/Editor.cpp:
3390         (WebCore::Editor::markAndReplaceFor): When the user had typed "doesn'" and our autocorrection result is
3391         "doesn't", resultEndLocation (the end of "doesn't") is larger than selectionOffset (the end of "doesn'").
3392         When the correction is "does", resultEndLocation (the end of "does") is one less than selectionOffset.
3393         Updated the condition to deal with both of these conditions as well as cases where the correction result
3394         contains more than one letter after '.
3395         * editing/htmlediting.cpp:
3396         (WebCore::isAmbiguousBoundaryCharacter): Moved from the header file since this is not a hot function and
3397         doesn't need to be inlined everywhere. Added '@' as an ambiguous boundary character.
3398         * editing/htmlediti