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