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