52f29eddd5e055da6f163e7cf6f5ae4594b112cc
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-07-01  Alex Christensen  <achristensen@webkit.org>
2
3         Fix ANGLE Windows build after r186169.
4         https://bugs.webkit.org/show_bug.cgi?id=146532
5
6         Reviewed by Brent Fulgham.
7
8         * WebCore.vcxproj/WebCore.vcxproj:
9         * WebCore.vcxproj/WebCore.vcxproj.filters:
10         Don't compile OpenGLShims.cpp or Extensions3DOpenGL.cpp on Windows 
11         because Windows uses OpenGLES through ANGLE, not OpenGL.
12         * platform/graphics/ANGLEWebKitBridge.h:
13         Use OpenGLESShims.h on Windows instead of OpenGLShims.h.
14         * platform/graphics/OpenGLESShims.h:
15         Added needed definitions from OpenGL to compile successfully.
16         * platform/graphics/win/GL/glext.h: Removed.
17
18 2015-07-01  Dean Jackson  <dino@apple.com>
19
20         Disable the experimental WebGL2 implementation
21         https://bugs.webkit.org/show_bug.cgi?id=146526
22         <rdar://problem/21641235>
23
24         Reviewed by Myles Maxfield.
25
26         Add (and disable) an ENABLE_WEBGL2 flag. Also protect
27         anything that is specific to WebGL2.
28
29         Covered by running the WebGL 1.0.2 conformance suite
30         and our LayoutTests.
31
32         * Configurations/FeatureDefines.xcconfig:
33         * bindings/js/JSCanvasRenderingContextCustom.cpp:
34         (WebCore::toJS):
35         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
36         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
37         (WebCore::toJS):
38         * html/HTMLCanvasElement.cpp:
39         (WebCore::HTMLCanvasElement::is3dType):
40         * html/canvas/WebGL2RenderingContext.cpp:
41         * html/canvas/WebGL2RenderingContext.h:
42         * html/canvas/WebGL2RenderingContext.idl:
43         * html/canvas/WebGLFramebuffer.cpp:
44         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
45         * html/canvas/WebGLGetInfo.cpp:
46         * html/canvas/WebGLGetInfo.h:
47         * html/canvas/WebGLRenderingContextBase.cpp:
48         (WebCore::WebGLRenderingContextBase::create):
49         * html/canvas/WebGLVertexArrayObject.cpp:
50         * html/canvas/WebGLVertexArrayObject.h:
51         * html/canvas/WebGLVertexArrayObject.idl:
52
53 2015-07-01  Chris Dumez  <cdumez@apple.com>
54
55         Regression(183998): Disqus comments take a very long time to load
56         https://bugs.webkit.org/show_bug.cgi?id=146522
57         <rdar://problem/21590601>
58
59         Reviewed by Simon Fraser.
60
61         Stop throttling requestAnimationFrame() in iframes that are not visible
62         due to them being zero-sized or display:none. Those are usually utility
63         iframes and throttling them is risky.
64
65         Se still throttle requestAnimationFrame() in iframes that would be
66         visible in theory but are currently not noticeable because they are
67         outside the viewport.
68
69         Test:
70         - fast/animation/request-animation-frame-throttle-subframe.html
71         - fast/animation/request-animation-frame-throttle-subframe-display-none.html
72         - fast/animation/request-animation-frame-throttle-subframe-zero-size.html
73
74         * page/FrameView.cpp:
75         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
76
77 2015-06-30  Ryosuke Niwa  <rniwa@webkit.org>
78
79         REGRESSION (r179168): Characters overlap after resizing the font on the copy-pasted Japanese text
80         https://bugs.webkit.org/show_bug.cgi?id=146492
81
82         Reviewed by Darin Adler.
83
84         The bug was caused by WebKit serializing the used line-height size (e.g. 18px) in the copied content
85         instead of string "normal" and removeStyleFromRulesAndContext failing to strip it down when text with
86         a font that influences the line height got pasted. This is because the used value of line-height
87         property of the context and the pasted content doesn't match when the context doesn't use the same font.
88
89         Fixed the bug by not considering line-height as a list of editing properties we try to preserve. This is
90         fine because we don't provide editing operations to directly manipulate line-height.
91
92         Test: editing/pasteboard/cjk-line-height.html
93
94         * editing/EditingStyle.cpp:
95         (WebCore::editingProperties): Removed CSSPropertyLineHeight.
96
97 2015-06-30  Brent Fulgham  <bfulgham@apple.com>
98
99         REGRESSION (r184296): View keeps scrolling upward
100         https://bugs.webkit.org/show_bug.cgi?id=146497
101         <rdar://problem/21524942>
102
103         Reviewed by Darin Adler.
104
105         Avoid improperly triggering the ScrollController wheel event handling
106         logic when the wheel event deltaX/deltaY are zero. On certain sites,
107         this caused a programmatic JavaScript scroll to be triggered unexpectedly,
108         scrolling the page back to some initial state.
109
110         This bug was introduced while trying to make sure scrollbars were notified
111         when the wheel event had come to an end. Revise that change so that we still
112         follow the right code path for non-stretchable regions. However, make sure
113         that for zero-delta wheel events we make sure to properly handle the wheel
114         event phase. 
115
116         * platform/mac/ScrollAnimatorMac.h:
117         * platform/mac/ScrollAnimatorMac.mm:
118         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent): New helper function
119         to reduce the complexity of the logic in handleWheelEvent.
120         (WebCore::ScrollAnimatorMac::handleWheelEvent): When wheel events should be forwarded
121         to the parent scroll view, if the event was handled or has no change in position
122         trigger the 'handleWheelEventPhase' logic so that scrollbars are hidden, etc.
123
124 2015-06-30  Dean Jackson  <dino@apple.com>
125
126         Hide the inline controls when going into PiP
127         https://bugs.webkit.org/show_bug.cgi?id=146487
128         <rdar://problem/19881159>
129
130         Reviewed by Eric Carlson.
131
132         When the presentation mode is PiP, toggle a class
133         on the container element so that we can completely
134         hide the control toolbar. The placard should still
135         remain visible.
136
137         * Modules/mediacontrols/mediaControlsiOS.css:
138         (video::-webkit-media-controls-panel-container.picture-in-picture): Add
139         a rule that hides the toolbar when PiP is active.
140         * Modules/mediacontrols/mediaControlsiOS.js:
141         (ControllerIOS.prototype.showControls):
142         (ControllerIOS.prototype.handlePresentationModeChange): Toggle a
143         class. Also fix a bug I noticed where exiting from PiP was
144         not auto-hiding the controls until the user tapped.
145
146 2015-07-01  Matthew Daiter  <mdaiter@apple.com>
147
148         Enable MEDIA_STREAM flag
149         https://bugs.webkit.org/show_bug.cgi?id=145947
150         <rdar://problem/21365829>
151
152         Reviewed by Eric Carlson.
153
154         * Configurations/FeatureDefines.xcconfig: Added MEDIA_STREAM flag
155         * Modules/mediastream/MediaStreamTrack.h:
156         * WebCore.xcodeproj/project.pbxproj: Changed project headers to
157         private headers
158         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
159         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
160         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
161         * platform/mediastream/RealtimeMediaSource.h:
162         * platform/mediastream/mac/AVAudioCaptureSource.mm:
163         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
164         (WebCore::refreshCaptureDeviceList): Deleted.
165         * platform/mediastream/mac/AVMediaCaptureSource.mm:
166         (WebCore::AVMediaCaptureSource::startProducingData):
167         (WebCore::AVMediaCaptureSource::stopProducingData):
168
169 2015-07-01  Brent Fulgham  <bfulgham@apple.com>
170
171         REGRESSION (r185016): Intermittent crash in WebCore::TextTrackList::remove
172         https://bugs.webkit.org/show_bug.cgi?id=146493
173         <rdar://problem/21511122>
174
175         Reviewed by Eric Carlson.
176
177         The m_textTracks member is frequently null checked during other operations, but
178         was not checked during track removal. This needs to be corrected.
179
180         * html/HTMLMediaElement.cpp:
181         (WebCore::HTMLMediaElement::removeTextTrack): Check that m_textTracks is
182         not null before using it during track removal.
183
184 2015-07-01  Antti Koivisto  <antti@apple.com>
185
186         PNG mask images are loaded with Accept:image/svg+xml
187         https://bugs.webkit.org/show_bug.cgi?id=146509
188         rdar://problem/21584740
189
190         Reviewed by Simon Fraser.
191
192         For some strange reason MaskImageOperation code loads all mask images, including non-SVG ones
193         using CachedSVGDocument. Resulting bad accept header may cause server to reject the request.
194
195         This is far from ideal but as a quick fix we can override the accept header for mask images to
196         allow any image type.
197
198         Test: http/tests/misc/mask-image-accept.html
199
200         * loader/cache/CachedResourceLoader.cpp:
201         (WebCore::CachedResourceLoader::requestResource):
202         * loader/cache/CachedResourceRequest.h:
203         (WebCore::CachedResourceRequest::acceptOverride):
204         (WebCore::CachedResourceRequest::setAcceptOverride):
205         * loader/cache/CachedSVGDocumentReference.cpp:
206         (WebCore::CachedSVGDocumentReference::load):
207         * loader/cache/CachedSVGDocumentReference.h:
208         (WebCore::CachedSVGDocumentReference::loadRequested):
209         (WebCore::CachedSVGDocumentReference::setAcceptsAnyImageType):
210         (WebCore::CachedSVGDocumentReference::document):
211         * platform/graphics/MaskImageOperation.cpp:
212         (WebCore::MaskImageOperation::ensureCachedSVGDocumentReference):
213
214 2015-07-01  Jer Noble  <jer.noble@apple.com>
215
216         [MSE] Failures on W3C media-source tests regarding MIME types
217         https://bugs.webkit.org/show_bug.cgi?id=146499
218
219         Reviewed by Eric Carlson.
220
221         Tests: http/tests/media/media-source/SourceBuffer-abort-readyState.html
222                http/tests/media/media-source/SourceBuffer-abort-removed.html
223                http/tests/media/media-source/SourceBuffer-abort-updating.html
224                http/tests/media/media-source/SourceBuffer-abort.html
225
226         Multiple failures in the W3C media-source test suite due to two failures in isTypeSupported MIME type handling:
227         - MIME types without codec strings were being rejected.
228         - MIME types with codec strings which are rejected by the system are being reported as supported.
229
230         For the first, stop rejecting MIME types with non-existent codec strings. For MIME types which do have non-empty
231         codec strings, treat a "Maybe" response as unsupported.
232
233         * Modules/mediasource/MediaSource.cpp:
234         (WebCore::MediaSource::isTypeSupported):
235
236 2015-06-30  Alex Christensen  <achristensen@webkit.org>
237
238         Update ANGLE to b11e2483742db884bd0af41f78f528240577356b.
239         https://bugs.webkit.org/show_bug.cgi?id=145010
240
241         Reviewed by Dean Jackson.
242
243         * CMakeLists.txt:
244         * platform/graphics/ANGLEWebKitBridge.cpp:
245         (WebCore::appendSymbol):
246         (WebCore::getStructInfo):
247         (WebCore::getSymbolInfo):
248         (WebCore::ANGLEWebKitBridge::cleanupCompilers):
249         (WebCore::ANGLEWebKitBridge::compileShaderSource):
250         (WebCore::getValidationResultValue): Deleted.
251         * platform/graphics/ANGLEWebKitBridge.h:
252         (WebCore::ANGLEShaderSymbol::isSampler):
253         * platform/graphics/GraphicsContext3D.h:
254         (WebCore::GraphicsContext3D::SymbolInfo::SymbolInfo):
255         * platform/graphics/mac/GraphicsContext3DMac.mm:
256         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
257         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
258         (WebCore::GraphicsContext3D::checkVaryingsPacking):
259         (WebCore::GraphicsContext3D::precisionsMatch):
260         Update WebCore to reflect changes in ANGLE.
261
262 2015-06-30  Zalan Bujtas  <zalan@apple.com>
263
264         Frame flattening: Hit-testing an iframe could end up destroying the associated inline tree context.
265         https://bugs.webkit.org/show_bug.cgi?id=146447
266         rdar://problem/20613501
267
268         Reviewed by Simon Fraser.
269
270         This patch ensures that the render tree associated with the document on which
271         the hit-test is initiated does not get laid out, unless it was directly mutated prior to the hittest.
272
273         Hit-test requirements:
274         1. A clean the render tree before hit-testing gets propagated to the renderers.
275         Document::updateLayout() ensures it by calling both updateStyleIfNeeded() and layout() not only on the current tree, but also
276         on the ancestors if needed.
277
278         2. No render tree mutation while hit-testing the renderers.
279
280         When an iframe is being hit-tested, this hit-test could bubble down to the child frame's render view.
281         In order to ensure #1, we call Document::updateLayout() on the current (subframe) document.
282         If updateStyleIfNeeded() mutates the render tree, we mark it dirty for layout(). However frame flattening also
283         marks the parent renderer (RenderIFrame) dirty.
284         While calling layout() to clean the current render tree, we end up laying out the parent tree too.
285         Laying out the parent tree could end up destroying the inline tree context from where the
286         hittest just bubbled down. (InlineFlowBox -> RenderWidget -> RenderView).
287
288         This patch protects the render tree from such unintentional inline tree mutation during hittesting.
289         After the initial layout we set a layout disallow flag on the frame view to defer subsequent layouts.
290         This patch only changes behavior when frame flattening is enabled, but in future we may always want to enable this.
291
292         Test: fast/frames/flattening/hittest-iframe-while-style-changes-crash.html
293
294         * page/FrameView.cpp:
295         (WebCore::FrameView::layout):
296         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted. -> Assertion in no longer valid.
297         * page/FrameView.h:
298         * rendering/RenderView.cpp:
299         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower):
300         (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower):
301         (WebCore::RenderView::hitTest): Protect the render tree from subsequent layouts.
302
303 2015-06-30  Andy VanWagoner  <thetalecrafter@gmail.com>
304
305         Implement ECMAScript Internationalization API
306         https://bugs.webkit.org/show_bug.cgi?id=90906
307
308         Reviewed by Benjamin Poulain.
309
310         Test: js/intl.html
311
312         * Configurations/FeatureDefines.xcconfig: add ENABLE_INTL flag
313
314 2015-06-30  Wenson Hsieh  <whsieh@berkeley.edu>
315
316         scroll-snap-points do not work very well with mechanical scroll wheel events
317         https://bugs.webkit.org/show_bug.cgi?id=142501
318         <rdar://problem/20093511>
319
320         Reviewed by Brent Fulgham.
321
322         Stateless scroll events generated by scrolling with a mechanical mouse wheel now trigger scroll
323         snapping after a fixed delay.
324
325         Test: platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow-stateless.html
326
327         * platform/cocoa/ScrollController.h: Added member to track stateless scrolling.
328         * platform/cocoa/ScrollController.mm: Added constant for delay for stateless scroll snapping.
329         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Triggers timer upon stateless scroll events.
330         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Timer now handles stateless scrolling updates.
331         (WebCore::ScrollController::verticalScrollSnapTimerFired): See above.
332         (WebCore::ScrollController::beginScrollSnapAnimation): Handles stateless scroll snapping.
333
334 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
335
336         Try to fix Gtk and EFL builds.
337
338         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
339         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
340         (WebCore::GraphicsLayerTextureMapper::flushCompositingState):
341         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
342         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
343         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
344         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
345         (WebCore::CoordinatedGraphicsLayer::flushCompositingState):
346         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
347         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
348
349 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
350
351         [iOS] Missing tiles inside position:fixed on scrolling
352         https://bugs.webkit.org/show_bug.cgi?id=146485
353         rdar://problem/21226861
354
355         Reviewed by Tim Horton.
356
357         Layer flushing adjusts the coverage rect for tiled layers, but does so at times
358         when position:fixed layers are moved around by the scrolling tree. The computed
359         coverage rect then doesn't reflect the layer's on-screen position, causing missing
360         tiles.
361
362         Fix by pushing the notion of being in a "stable state" onto FrameView, and passing
363         that state into the layer flush. When not in a stable state, flushing doesn't change
364         the visible and coverage rects for layers that are viewport-constrained.
365
366         * page/FrameView.cpp:
367         (WebCore::FrameView::reset):
368         * page/FrameView.h: Remove some velocity-related data members that were unused.
369         * platform/graphics/GraphicsLayer.h:
370         (WebCore::GraphicsLayer::flushCompositingState):
371         (WebCore::GraphicsLayer::flushCompositingStateForThisLayerOnly):
372         * platform/graphics/ca/GraphicsLayerCA.cpp:
373         (WebCore::GraphicsLayerCA::flushCompositingState):
374         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
375         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): If this is a viewport-constrained
376         layer, and the viewport is not stable, don't touch the rects.
377         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
378         * platform/graphics/ca/GraphicsLayerCA.h:
379         (WebCore::GraphicsLayerCA::CommitState::CommitState):
380         * rendering/RenderLayerCompositor.cpp:
381         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
382
383 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
384
385         Rename GraphicsLayer's allowsBackingStoreDetachment to isViewportConstrained
386         https://bugs.webkit.org/show_bug.cgi?id=146483
387
388         Reviewed by Tim Horton.
389
390         What GraphicsLayer really needs to know is whether some other thread/process
391         is moving its platform layers around behind its back, and this is is better
392         expressed as "isViewportConstrained" rather than "allowsBackingStoreDetachment".
393         
394         The sense of the flag is flipped, and boolean logic adjusted accordingly.
395
396         * platform/graphics/GraphicsLayer.h:
397         (WebCore::GraphicsLayer::setIsViewportConstrained):
398         (WebCore::GraphicsLayer::isViewportConstrained):
399         (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment): Deleted.
400         (WebCore::GraphicsLayer::allowsBackingStoreDetachment): Deleted.
401         * platform/graphics/ca/GraphicsLayerCA.cpp:
402         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
403         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
404         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
405         * platform/graphics/ca/GraphicsLayerCA.h:
406         * rendering/RenderLayerBacking.cpp:
407         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
408
409 2015-06-30  Dean Jackson  <dino@apple.com>
410
411         CABackdropFilter should set windowServerAware to false
412         https://bugs.webkit.org/show_bug.cgi?id=146469
413         <rdar://problem/21618614>
414
415         Reviewed by Simon Fraser.
416
417         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
418         (PlatformCALayerCocoa::PlatformCALayerCocoa): Set windowServerAware
419         to false on Mac (it's not available on iOS).
420
421 2015-06-30  Chris Dumez  <cdumez@apple.com>
422
423         Rolling out r175171
424         https://bugs.webkit.org/show_bug.cgi?id=146470
425         <rdar://problem/21349934>
426
427         Unreviewed, rolling out <http://trac.webkit.org/changeset/175171>. It
428         wasn't a huge win and Brady says it caused crash at
429         <rdar://problem/21349934>.
430
431         * platform/network/cf/ResourceRequest.h:
432         * platform/network/cocoa/ResourceRequestCocoa.mm:
433         (WebCore::ResourceRequest::doUpdatePlatformRequest):
434         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
435
436 2015-06-30  Matt Baker  <mattbaker@apple.com>
437
438         Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
439         https://bugs.webkit.org/show_bug.cgi?id=146168
440
441         Reviewed by Brian Burg.
442
443         Added Inspector instrumentation for measuring CoreAnimation compositing time. We mark the start of a composite
444         event when the LayerFlushScheduler triggers a scheduled layer flush. InspectorController now exports a function
445         for marking the end of the composite event, which should be called during the CA transaction post-commit phase
446         (based on platform support). Lacking platform support, the event is considered complete after CoreAnimation
447         runloop observers have run.
448
449         * inspector/InspectorController.cpp:
450         (WebCore::InspectorController::didComposite):
451         * inspector/InspectorController.h:
452         New export for instrumentation in WebKit2.
453
454         * inspector/InspectorInstrumentation.cpp:
455         (WebCore::InspectorInstrumentation::willCompositeImpl):
456         (WebCore::InspectorInstrumentation::didCompositeImpl):
457         * inspector/InspectorInstrumentation.h:
458         (WebCore::InspectorInstrumentation::willComposite):
459         (WebCore::InspectorInstrumentation::didComposite):
460         Plumbing for new instrumentation.
461
462         * inspector/InspectorTimelineAgent.cpp:
463         (WebCore::InspectorTimelineAgent::internalStart):
464         (WebCore::InspectorTimelineAgent::internalStop):
465         (WebCore::InspectorTimelineAgent::willComposite):
466         (WebCore::InspectorTimelineAgent::didComposite):
467         (WebCore::toProtocol):
468         * inspector/InspectorTimelineAgent.h:
469         New Composite event type and instrumentation.
470
471         * page/FrameView.cpp:
472         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
473         Hook for start of compositing.
474
475         * platform/spi/cocoa/QuartzCoreSPI.h:
476         New header include and interface declaration.
477
478 2015-06-30  Beth Dakin  <bdakin@apple.com>
479
480         The bounds on InteractionInformationAtPosition should be more precise
481         https://bugs.webkit.org/show_bug.cgi?id=146468
482         -and corresponding-
483         rdar://problem/20739834
484
485         Reviewed by Enrica Casucci and Simon Fraser.
486
487         Export absoluteContentQuad().
488         * rendering/RenderBox.h:
489
490 2015-06-30  Zalan Bujtas  <zalan@apple.com>
491
492         Addressing post-review comments in r185756.
493
494         * html/RubyTextElement.cpp:
495         (WebCore::RubyTextElement::createElementRenderer):
496
497 2015-06-30  Zalan Bujtas  <zalan@apple.com>
498
499         Addressing post-review comments in r185916
500
501         * platform/LayoutUnit.h:
502         (WebCore::roundToDevicePixel):
503
504 2015-06-30  Matt Rajca  <mrajca@apple.com>
505
506         MediaSession: Use setSessionInternal to set the default media session in HTMLMediaElement's constructor
507         https://bugs.webkit.org/show_bug.cgi?id=146465
508
509         Reviewed by Eric Carlson.
510
511         * html/HTMLMediaElement.cpp:
512         (WebCore::HTMLMediaElement::HTMLMediaElement):
513
514 2015-06-30  Matt Rajca  <mrajca@apple.com>
515
516         Media Session: implement algorithm for updating a media element's session (6.1)
517         https://bugs.webkit.org/show_bug.cgi?id=146460
518
519         Reviewed by Darin Adler.
520
521         In addition to storing a pointer to the new media session, we now:
522
523         - pause the media element if it is 'active' in the current media session
524         - remove the media element from the current media session
525         - release the current media session if there are no more active media elements
526         - set the default media session if the new media session is null
527         - update the 'kind' attribute to match the kind of the new media session
528
529         * Modules/mediasession/MediaSession.cpp:
530         (WebCore::MediaSession::isMediaElementActive):
531         (WebCore::MediaSession::hasActiveMediaElements):
532         * Modules/mediasession/MediaSession.h:
533         * html/HTMLMediaElement.cpp:
534         (WebCore::HTMLMediaElement::setSession):
535         (WebCore::HTMLMediaElement::setSessionInternal):
536         * html/HTMLMediaElement.h:
537
538 2015-06-29  Anders Carlsson  <andersca@apple.com>
539
540         Get rid of unused WKSI functions
541         https://bugs.webkit.org/show_bug.cgi?id=146443
542
543         Reviewed by Tim Horton.
544
545         * platform/graphics/cg/PathCG.cpp:
546         (WebCore::Path::platformAddPathForRoundedRect):
547         Just call CGPathAddRoundedRect directly.
548
549         * platform/ios/WebCoreSystemInterfaceIOS.mm:
550         * platform/mac/WebCoreSystemInterface.h:
551         * platform/mac/WebCoreSystemInterface.mm:
552
553 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
554
555         [Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
556         https://bugs.webkit.org/show_bug.cgi?id=146408
557
558         Reviewed by Darin Adler.
559
560         Current tests cover the case already.
561
562         * Modules/streams/ReadableStream.cpp:
563         (WebCore::ReadableStream::pull): Call finishPull() in a postTask to delay it and simulate the promise
564         resolution.
565
566 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
567
568         [Streams API] Synced bad strategy test with reference implementation
569         https://bugs.webkit.org/show_bug.cgi?id=146411
570
571         Reviewed by Darin Adler.
572
573         Current tests cover the case.
574
575         * bindings/js/ReadableJSStream.cpp:
576         (WebCore::ReadableJSStream::retrieveChunkSize): Check for negative size then running the JavaScript function.
577
578 2015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr>
579
580         [Streams API] Remove ReadableStream.getReader() custom binding
581         https://bugs.webkit.org/show_bug.cgi?id=146404
582
583         Reviewed by Darin Adler.
584
585         Covered by existing tests.
586
587         * Modules/streams/ReadableStream.cpp:
588         (WebCore::ReadableStream::getReader): Updated to take an exception.
589         * Modules/streams/ReadableStream.h:
590         * Modules/streams/ReadableStream.idl: Updated to remove custom binding.
591         * bindings/js/JSReadableStreamCustom.cpp:
592         (WebCore::JSReadableStream::getReader): Deleted.
593         * bindings/js/JSReadableStreamReaderCustom.cpp:
594         (WebCore::constructJSReadableStreamReader): Updated to pass an exception to getReader.
595
596 2015-06-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
597
598         [Streams API] ReadableStreamReader.closed should use DOMPromise
599         https://bugs.webkit.org/show_bug.cgi?id=146406
600
601         Reviewed by Darin Adler.
602
603         Added storage of ClosedPromise as Optional of ReadableStream.
604         Updated code accordingly.
605
606         Covered by existing tests.
607
608         * Modules/streams/ReadableStream.cpp:
609         (WebCore::ReadableStream::clearCallbacks):
610         (WebCore::ReadableStream::releaseReader):
611         (WebCore::ReadableStream::changeStateToErrored):
612         (WebCore::ReadableStream::closed):
613         * Modules/streams/ReadableStream.h:
614         * Modules/streams/ReadableStreamReader.cpp:
615         (WebCore::ReadableStreamReader::closed):
616         * Modules/streams/ReadableStreamReader.h:
617         * bindings/js/JSReadableStreamReaderCustom.cpp:
618         (WebCore::JSReadableStreamReader::closed):
619
620 2015-06-29  Simon Fraser  <simon.fraser@apple.com>
621
622         [iOS WK2] WKWebViews in Facebook app start off black
623         https://bugs.webkit.org/show_bug.cgi?id=146445
624         rdar://problem/21600433
625
626         Reviewed by Tim Horton.
627
628         If -isOpaque is toggled on a WKWebView, we failed to make the page tiles non-opaque
629         for a while. After r183775, RenderLayerCompositor::rootBackgroundTransparencyChanged() was called,
630         but only considered the computed document background color, and not the view transparency.
631         
632         Fix by having rootBackgroundTransparencyChanged() simply use viewHasTransparentBackground(),
633         which checks the FrameView transparency. Now we just need to store a transparency bool rather
634         than the old color (we only checked its alpha anyway).
635
636         * rendering/RenderLayerCompositor.cpp:
637         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
638
639 2015-06-29  Dean Jackson  <dino@apple.com>
640
641         WebKit should use 80% black background for PiP indicator
642         https://bugs.webkit.org/show_bug.cgi?id=146444
643         <rdar://problem/21555726>
644
645         Reviewed by Sam Weinig.
646
647         Change the black background to a slightly less black background.
648         This also involved making the placard artwork white, in order
649         to keep it visible against the new grey.
650
651         * Modules/mediacontrols/mediaControlsiOS.css:
652         (audio::-webkit-media-controls-wireless-playback-status):
653         (audio::-webkit-media-controls-wireless-playback-status.small):
654         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
655
656 2015-06-29  Brady Eidson  <beidson@apple.com>
657
658         Flag sync XHRs from the network process so they can be handled appropriately.
659         <rdar://problem/21579162> and https://bugs.webkit.org/show_bug.cgi?id=146441
660
661         Reviewed by Darin Adler.
662
663         * platform/network/ResourceHandleClient.h:
664         (WebCore::ResourceHandleClient::loadingSynchronousXHR): Added so clients of asynchronous
665           loads can signal they should be treated like synchronous loads at the platform level.
666
667         * platform/network/cf/ResourceHandleCFNet.cpp:
668         (WebCore::ResourceHandle::start): Adjust SchedulingBehavior based on the client.
669
670         * platform/network/mac/ResourceHandleMac.mm:
671         (WebCore::ResourceHandle::start): Adjust SchedulingBehavior based on the client.
672
673 2015-06-29  Chris Fleizach  <cfleizach@apple.com>
674
675         AX: PlatformSpeechSynthesizer code doesn't catch Objective-C exceptions
676         https://bugs.webkit.org/show_bug.cgi?id=146419
677
678         Reviewed by Simon Fraser.
679
680         Make sure ObjC exception resulting from calling into the platform cause problems in WebKit.
681
682         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
683         (-[WebSpeechSynthesisWrapper speakUtterance:]):
684         (-[WebSpeechSynthesisWrapper pause]):
685         (-[WebSpeechSynthesisWrapper resume]):
686         (-[WebSpeechSynthesisWrapper cancel]):
687         (-[WebSpeechSynthesisWrapper speechSynthesizer:didStartSpeechUtterance:]):
688         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
689         (WebCore::PlatformSpeechSynthesizer::pause):
690
691 2015-06-29  Matt Rajca  <mrajca@apple.com>
692
693         Removing an element from a media session should also remove it from the sets of active participating elements
694         https://bugs.webkit.org/show_bug.cgi?id=146420
695
696         Reviewed by Eric Carlson.
697
698         * Modules/mediasession/MediaSession.cpp:
699         (WebCore::MediaSession::removeMediaElement):
700
701 2015-06-29  Dean Jackson  <dino@apple.com>
702
703         Temporarily disable PICTURE_SIZES
704         https://bugs.webkit.org/show_bug.cgi?id=146435
705         <rdar://problem/21087013>
706
707         Reviewed by Tim Horton.
708
709         Temporarily disable PICTURE_SIZES because it causes problems with out
710         of date <picture> polyfills.
711
712         * Configurations/FeatureDefines.xcconfig:
713
714 2015-06-29  Tim Horton  <timothy_horton@apple.com>
715
716         Fix the build.
717
718         * editing/cocoa/HTMLConverter.mm:
719         * platform/spi/cocoa/NSAttributedStringSPI.h:
720
721 2015-06-29  Tim Horton  <timothy_horton@apple.com>
722
723         Fix the build.
724
725         * platform/spi/cocoa/NSAttributedStringSPI.h:
726
727 2015-06-29  Tim Horton  <timothy_horton@apple.com>
728
729         Fix the build.
730
731         * platform/spi/cocoa/NSAttributedStringSPI.h:
732
733 2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
734
735         Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
736         https://bugs.webkit.org/show_bug.cgi?id=146379
737
738         Reviewed by Darin Adler.
739
740         The bug was caused by WebKit not updating the font panel when the typing style changes.
741         There was also a bug that WebKit never updated font attributes on OS X.
742
743         Fixed the bugs by always updating the font panel after applying style instead of only
744         when the selection changes and setting the font attributes.
745
746         I tried really had to write a WebKit API test but I couldn't get it to work so there are
747         no new tests :(
748
749         * WebCore.xcodeproj/project.pbxproj:
750         * editing/Editor.cpp:
751         (WebCore::Editor::applyStyle):
752         (WebCore::Editor::shouldApplyStyle):
753         (WebCore::Editor::applyParagraphStyle):
754         (WebCore::Editor::applyStyleToSelection):
755         (WebCore::Editor::applyParagraphStyleToSelection):
756         (WebCore::Editor::selectionStartHasStyle):
757         (WebCore::Editor::document):
758         (WebCore::Editor::styleForSelectionStart): Deleted.
759         * editing/Editor.h:
760         * editing/cocoa/EditorCocoa.h: Added. Shares the declaration for NSUnderlineStyle in iOS.
761         * editing/cocoa/EditorCocoa.mm: Added.
762         (WebCore::Editor::styleForSelectionStart): Moved from Editor.cpp
763         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): Extracted from iOS's
764         fontAttributesForSelectionStart implementation.
765         * editing/cocoa/HTMLConverter.mm:
766         * editing/ios/EditorIOS.mm:
767         (WebCore::Editor::fontAttributesForSelectionStart):
768         * editing/mac/EditorMac.mm:
769         (WebCore::Editor::fontAttributesForSelectionStart):
770         * loader/EmptyClients.h:
771         * page/EditorClient.h:
772
773 2015-06-29  Matt Rajca  <mrajca@apple.com>
774
775         MediaSession: use a HashSet for the collection of participating elements
776         https://bugs.webkit.org/show_bug.cgi?id=146421
777
778         Reviewed by Eric Carlson.
779
780         * Modules/mediasession/MediaSession.cpp:
781         (WebCore::MediaSession::addMediaElement):
782         (WebCore::MediaSession::removeMediaElement):
783         * Modules/mediasession/MediaSession.h:
784
785 2015-06-29  Dean Jackson  <dino@apple.com>
786
787         Setting to enable/disable media controls sizing on page zoom
788         https://bugs.webkit.org/show_bug.cgi?id=146423
789         <rdar://problem/18379634>
790
791         Reviewed by Eric Carlson.
792
793         Add a new setting "MediaControlsScaleWithPageZoom" that can disable
794         the behaviour we currently implement on iOS, where the media controls
795         attempt to remain at a fixed size independent of page zoom.
796
797         * html/HTMLMediaElement.cpp:
798         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Do not
799         set this value to true if the new setting is disabled.
800         * page/Settings.cpp:
801         * page/Settings.in: Add the new setting.
802
803 2015-06-29  Adam Bergkvist  <adam.bergkvist@ericsson.com>
804
805         WebRTC: Update the MediaStream API
806         https://bugs.webkit.org/show_bug.cgi?id=146313
807
808         Reviewed by Eric Carlson.
809
810         Update the MediaStream API (MediaStream, MediaStreamTrack and
811         RealtimeMediaSource) to match the Media Capture and Stream
812         specification [1]. Notable changes:
813
814         Updated event handling to synchronously update corresponding
815         state/attributes as events are dispatched.
816
817         Removed 'new' state from MediaStreamTrack. A track is either 'live' or
818         'ended'. As a consequence 'started' event is also removed.
819
820         MediaStreamTrack always has a source (disconnected source concept was
821         removed from the spec). Therefore, more state can be kept at the source
822         without going away.
823
824         Calculate MediaStream.active internally, from the track set, instead of
825         setting it externally.
826
827         Updated RealtimeMediaSource Observer interface.
828
829         Replaced MediaStream's separate audio and video track lists with a
830         single track set (more aligned with spec).
831
832         Updated MediaStream constructor to adopt instead of clone track
833         arguments (or tracks from MediaStream argument).
834
835         Removed MediaStreamTrack.getSources() and corresponding test (removed
836         from spec).
837
838         Test status: 3 added, 8 existing enabled (some updated) and 1 removed.
839
840         [1] http://w3c.github.io/mediacapture-main/archives/20150523/getusermedia.html
841
842         Tests: fast/mediastream/MediaStreamTrack-clone.html
843                fast/mediastream/MediaStreamTrack-kind.html
844                fast/mediastream/MediaStreamTrack-stop.html
845
846         * Modules/mediastream/MediaStream.cpp:
847         (WebCore::MediaStream::create):
848         (WebCore::MediaStream::MediaStream):
849         (WebCore::MediaStream::clone):
850         (WebCore::MediaStream::addTrack):
851         (WebCore::MediaStream::removeTrack):
852         (WebCore::MediaStream::getTrackById):
853         (WebCore::MediaStream::getAudioTracks):
854         (WebCore::MediaStream::getVideoTracks):
855         (WebCore::MediaStream::getTracks):
856         (WebCore::MediaStream::contextDestroyed):
857         (WebCore::MediaStream::trackDidEnd):
858         (WebCore::MediaStream::activeStatusChanged):
859         (WebCore::MediaStream::didAddTrackToPrivate):
860         (WebCore::MediaStream::didRemoveTrackFromPrivate):
861         (WebCore::MediaStream::internalAddTrack):
862         (WebCore::MediaStream::internalRemoveTrack):
863         (WebCore::MediaStream::scheduleActiveStateChange):
864         (WebCore::MediaStream::activityEventTimerFired):
865         (WebCore::MediaStream::trackVectorForType):
866         (WebCore::MediaStream::~MediaStream): Deleted.
867         (WebCore::MediaStream::registry): Deleted.
868         (WebCore::MediaStream::addObserver): Deleted.
869         (WebCore::MediaStream::removeObserver): Deleted.
870         * Modules/mediastream/MediaStream.h:
871         * Modules/mediastream/MediaStream.idl:
872         * Modules/mediastream/MediaStreamTrack.cpp:
873         (WebCore::MediaStreamTrack::MediaStreamTrack):
874         (WebCore::MediaStreamTrack::~MediaStreamTrack):
875         (WebCore::MediaStreamTrack::kind):
876         (WebCore::MediaStreamTrack::id):
877         (WebCore::MediaStreamTrack::label):
878         (WebCore::MediaStreamTrack::enabled):
879         (WebCore::MediaStreamTrack::setEnabled):
880         (WebCore::MediaStreamTrack::muted):
881         (WebCore::MediaStreamTrack::readonly):
882         (WebCore::MediaStreamTrack::remote):
883         (WebCore::MediaStreamTrack::readyState):
884         (WebCore::MediaStreamTrack::ended):
885         (WebCore::MediaStreamTrack::clone):
886         (WebCore::MediaStreamTrack::stopProducingData):
887         (WebCore::MediaStreamTrack::states):
888         (WebCore::MediaStreamTrack::getCapabilities):
889         (WebCore::MediaStreamTrack::applyConstraints):
890         (WebCore::MediaStreamTrack::trackEnded):
891         (WebCore::MediaStreamTrack::trackMutedChanged):
892         (WebCore::MediaStreamTrack::stop):
893         (WebCore::MediaStreamTrack::getConstraints): Deleted.
894         (WebCore::MediaStreamTrack::addObserver): Deleted.
895         (WebCore::MediaStreamTrack::removeObserver): Deleted.
896         (WebCore::MediaStreamTrack::configureTrackRendering): Deleted.
897         (WebCore::MediaStreamTrack::activeDOMObjectName): Deleted.
898         (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
899         * Modules/mediastream/MediaStreamTrack.h:
900         * Modules/mediastream/MediaStreamTrack.idl:
901         * Modules/mediastream/RTCPeerConnection.cpp:
902         (WebCore::RTCPeerConnection::didRemoveRemoteStream): Deleted.
903         * Modules/mediastream/UserMediaRequest.cpp:
904         (WebCore::UserMediaRequest::didCreateStream):
905         * platform/mediastream/MediaStreamPrivate.cpp:
906         (WebCore::MediaStreamPrivate::create):
907         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
908         (WebCore::MediaStreamPrivate::tracks):
909         (WebCore::MediaStreamPrivate::updateActiveState):
910         (WebCore::MediaStreamPrivate::addTrack):
911         (WebCore::MediaStreamPrivate::removeTrack):
912         * platform/mediastream/MediaStreamPrivate.h:
913         (WebCore::MediaStreamPrivate::active): Deleted.
914         * platform/mediastream/MediaStreamTrackPrivate.cpp:
915         (WebCore::MediaStreamTrackPrivate::create):
916         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
917         (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
918         (WebCore::MediaStreamTrackPrivate::label):
919         (WebCore::MediaStreamTrackPrivate::setEnabled):
920         (WebCore::MediaStreamTrackPrivate::endTrack):
921         (WebCore::MediaStreamTrackPrivate::clone):
922         (WebCore::MediaStreamTrackPrivate::type):
923         (WebCore::MediaStreamTrackPrivate::applyConstraints):
924         (WebCore::MediaStreamTrackPrivate::sourceStopped):
925         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
926         (WebCore::MediaStreamTrackPrivate::preventSourceFromStopping):
927         (WebCore::MediaStreamTrackPrivate::muted): Deleted.
928         (WebCore::MediaStreamTrackPrivate::readonly): Deleted.
929         (WebCore::MediaStreamTrackPrivate::remote): Deleted.
930         (WebCore::MediaStreamTrackPrivate::constraints): Deleted.
931         (WebCore::MediaStreamTrackPrivate::states): Deleted.
932         (WebCore::MediaStreamTrackPrivate::capabilities): Deleted.
933         * platform/mediastream/MediaStreamTrackPrivate.h:
934         (WebCore::MediaStreamTrackPrivate::id):
935         (WebCore::MediaStreamTrackPrivate::ended):
936         (WebCore::MediaStreamTrackPrivate::enabled):
937         (WebCore::MediaStreamTrackPrivate::setClient):
938         (WebCore::MediaStreamTrackPrivate::source): Deleted.
939         (WebCore::MediaStreamTrackPrivate::client): Deleted.
940         * platform/mediastream/RealtimeMediaSource.cpp:
941         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
942         (WebCore::RealtimeMediaSource::reset):
943         (WebCore::RealtimeMediaSource::setMuted):
944         (WebCore::RealtimeMediaSource::readonly):
945         (WebCore::RealtimeMediaSource::stop):
946         (WebCore::RealtimeMediaSource::requestStop):
947         (WebCore::RealtimeMediaSource::addObserver): Deleted.
948         (WebCore::RealtimeMediaSource::removeObserver): Deleted.
949         * platform/mediastream/RealtimeMediaSource.h:
950         (WebCore::RealtimeMediaSource::stopped):
951         (WebCore::RealtimeMediaSource::id): Deleted.
952         (WebCore::RealtimeMediaSource::muted): Deleted.
953         (WebCore::RealtimeMediaSource::setReadonly): Deleted.
954         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
955         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Deleted.
956         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
957         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Deleted.
958
959 2015-06-29  Benjamin Poulain  <benjamin@webkit.org>
960
961         Make the NFA transitions range-based
962         https://bugs.webkit.org/show_bug.cgi?id=146338
963
964         Reviewed by Alex Christensen.
965
966         Change the NFA to use range based transition for any kind of transition.
967         The fallback transition is also absorbed as ranges.
968
969         Previously, the NFA would only have single transitions and a fallback
970         transition for all cases not covered by single transitions.
971
972         The problem with that design was that character ranges (e.g. [a-z]) were
973         extended as individual transitions. Something like [^a] would cover
974         most of the alphabet with transitions.
975         When converting the NFA to DFA, the time is proportional to the number of states
976         multiplied by the number of transitions. With many individual transitions,
977         the run time was an order of magnitude higher than what we want.
978
979         This patch changes the NFA to only handle ranges of characters. A single transition
980         becomes a range with the character as first and last character in the range
981         ('a' becomes 'a' to 'a').
982         Ranges of characters are handled direclty (e.g. [a-z] becomes a single 'a' to 'z' transition).
983
984         In the context of the state machines, ranges have identifies (the target of the transitions).
985         When two ranges collide, they have to be split such that each part retain its target
986         except the intersection that gets the union of the targets.
987
988         Handling the union of ranges efficiently is critical because we have to do
989         it for every NFA node in any subset when building the DFA. The helper
990         class that does that is MutableRange.
991
992         The union of ranges is done efficiently because of preconditions on our list of ranges:
993         -The ranges must be sorted.
994         -No range in a list can intersect any other range in the same list.
995
996         To merge two ranges, we can go over them in order and split them part by part.
997         It is easy to find what goes where because they are both sorted and we can
998         compare the characters of each to know how to move forward.
999         The time to merge 2 range list is proportional to O(n+m) where 'n' and 'm' are
1000         the number of ranges in each list.
1001
1002         Since taking the union of two lists usually create new ranges, we have to allocate
1003         those somewhere efficiently. To do that, MutableRange support an inline capacity,
1004         which is used for the NFAToDFA Convertion.
1005
1006         ---
1007
1008         With ranges, the NFA-to-DFA conversion changes very little:
1009         -Each NFA nodes contains a list of ranges and each range has a list of targets.
1010         -The subset construction select any number of NFA nodes corresponding to
1011          a single deterministic state.
1012         -For the subset, we can use MutableRange to merge the ranges of every
1013          NFA node in the set. The resulting list has rangeis with targets corresponding
1014          to the union of all the transitions.
1015         -We go over all the ranges the same way we used to go over the transitions.
1016          Since the DFA does not support ranges, the ranges are spread as individual
1017          transitions + fallback transition.
1018
1019         ---
1020
1021         With the efficient merging solved, we still need the actual NFA to use ranges
1022         instead of individual transitions.
1023
1024         I could have used MutableRange for that but it is not the most compact
1025         way to represent ranges that do not need merging.
1026
1027         Instead, the NFA uses a custom structure: ImmutableNFA. It is basically
1028         the same thing, but in that one you cannot change a list of range
1029         after creating it.
1030
1031         Consequently, the sorted ranges in ImmutableNFA are also subsequent
1032         in memory, which is really nice to go over them efficiently
1033         when merging ranges in the NFA-to-DFA conversion. :)
1034
1035         When building the NFA, we don't know all the transitions when creating
1036         each node, BUT we know that we have very few node "unfinished" at any
1037         time. Since we build by going depth-first in the prefix-tree, we only
1038         have the max-depth of live nodes in the worst case.
1039
1040         To help building the NFA out of the prefix tree, we have
1041         ImmutableNFANodeBuilder. It keeps all the informations about a NFA node,
1042         but in a non-compact, mutable form. When a ImmutableNFANodeBuilder
1043         is destroyed, it serialize the information into the immutable NFA.
1044
1045         * WebCore.xcodeproj/project.pbxproj:
1046         * contentextensions/CombinedURLFilters.cpp:
1047         (WebCore::ContentExtensions::generateNFAForSubtree):
1048         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
1049         * contentextensions/ContentExtensionCompiler.cpp:
1050         (WebCore::ContentExtensions::compileRuleList):
1051         * contentextensions/DFA.cpp:
1052         (WebCore::ContentExtensions::DFA::empty):
1053         * contentextensions/DFA.h:
1054         * contentextensions/ImmutableNFA.h: Added.
1055         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator*):
1056         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator->):
1057         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator==):
1058         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator!=):
1059         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator++):
1060         (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::begin):
1061         (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::end):
1062         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator*):
1063         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator->):
1064         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator==):
1065         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator!=):
1066         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator++):
1067         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data):
1068         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::begin):
1069         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::end):
1070         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::debugPrint):
1071         (WebCore::ContentExtensions::ImmutableNFA::transitionsForNode):
1072         (WebCore::ContentExtensions::ImmutableNFA::root):
1073         (WebCore::ContentExtensions::ImmutableNFA::finalize):
1074         (WebCore::ContentExtensions::ImmutableNFA::memoryUsed):
1075         * contentextensions/ImmutableNFANodeBuilder.h: Added.
1076         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder):
1077         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::~ImmutableNFANodeBuilder):
1078         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addTransition):
1079         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addEpsilonTransition):
1080         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::setActions):
1081         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::operator=):
1082         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::finalize):
1083         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkActions):
1084         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkTransitions):
1085         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::sinkEpsilonTransitions):
1086         * contentextensions/MutableRange.h: Added.
1087         (WebCore::ContentExtensions::MutableRange::MutableRange):
1088         (WebCore::ContentExtensions::MutableRange::operator=):
1089         (WebCore::ContentExtensions::MutableRange::size):
1090         * contentextensions/MutableRangeList.h: Added.
1091         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator*):
1092         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator->):
1093         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator==):
1094         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator!=):
1095         (WebCore::ContentExtensions::MutableRangeList::ConstIterator::operator++):
1096         (WebCore::ContentExtensions::MutableRangeList::begin):
1097         (WebCore::ContentExtensions::MutableRangeList::end):
1098         (WebCore::ContentExtensions::MutableRangeList::appendRange):
1099         (WebCore::ContentExtensions::MutableRangeList::extend):
1100         (WebCore::ContentExtensions::MutableRangeList::isEmpty):
1101         (WebCore::ContentExtensions::MutableRangeList::clear):
1102         (WebCore::ContentExtensions::MutableRangeList::debugPrint):
1103         (WebCore::ContentExtensions::MutableRangeList::insertBetween):
1104         (WebCore::ContentExtensions::MutableRangeList::initializeFrom):
1105         * contentextensions/NFA.cpp:
1106         (WebCore::ContentExtensions::NFA::debugPrintDot):
1107         (WebCore::ContentExtensions::NFA::NFA): Deleted.
1108         (WebCore::ContentExtensions::NFA::createNode): Deleted.
1109         (WebCore::ContentExtensions::NFA::memoryUsed): Deleted.
1110         (WebCore::ContentExtensions::NFA::addTransition): Deleted.
1111         (WebCore::ContentExtensions::NFA::addEpsilonTransition): Deleted.
1112         (WebCore::ContentExtensions::NFA::addTransitionsOnAnyCharacter): Deleted.
1113         (WebCore::ContentExtensions::NFA::setActions): Deleted.
1114         (WebCore::ContentExtensions::NFA::graphSize): Deleted.
1115         (WebCore::ContentExtensions::NFA::restoreToGraphSize): Deleted.
1116         (WebCore::ContentExtensions::printRange): Deleted.
1117         (WebCore::ContentExtensions::printTransitions): Deleted.
1118         * contentextensions/NFA.h:
1119         (WebCore::ContentExtensions::NFA::root): Deleted.
1120         (WebCore::ContentExtensions::NFA::addRuleId): Deleted.
1121         * contentextensions/NFANode.h:
1122         * contentextensions/NFAToDFA.cpp:
1123         (WebCore::ContentExtensions::epsilonClosureExcludingSelf):
1124         (WebCore::ContentExtensions::resolveEpsilonClosures):
1125         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
1126         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
1127         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::convert):
1128         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::extend):
1129         (WebCore::ContentExtensions::createCombinedTransition):
1130         (WebCore::ContentExtensions::canUseFallbackTransition):
1131         (WebCore::ContentExtensions::findBestFallbackTarget):
1132         (WebCore::ContentExtensions::getOrCreateDFANode):
1133         (WebCore::ContentExtensions::NFAToDFA::convert):
1134         (WebCore::ContentExtensions::populateTransitions): Deleted.
1135         * contentextensions/NFAToDFA.h:
1136         * contentextensions/Term.h:
1137         (WebCore::ContentExtensions::Term::Term):
1138         (WebCore::ContentExtensions::Term::generateGraph):
1139         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
1140         (WebCore::ContentExtensions::Term::Term::generateGraph): Deleted.
1141
1142 2015-06-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1143
1144         Binding generator should allow using JSC::Value for "any" parameter in lieu of ScriptValue
1145         https://bugs.webkit.org/show_bug.cgi?id=146403
1146
1147         Reviewed by Darin Adler.
1148
1149         Covered by existing tests.
1150
1151         Enabling new APIs to use JSC::JSValue by using implicit case from ScriptValue to JSC::JSValue.
1152         Updated binding generator to include ScruptValue header in the needed JSXX.cpp files.
1153         Applied approach to ReadableStreamController.error.
1154
1155         * Modules/streams/ReadableStreamController.h:
1156         (WebCore::ReadableStreamController::error):
1157         * Modules/streams/ReadableStreamController.idl:
1158         * bindings/js/JSReadableStreamControllerCustom.cpp:
1159         (WebCore::constructJSReadableStreamController): Deleted.
1160         * bindings/js/ReadableJSStream.cpp:
1161         (WebCore::ReadableJSStream::error):
1162         * bindings/js/ReadableJSStream.h:
1163         * bindings/scripts/CodeGeneratorJS.pm:
1164         (JSValueToNative):
1165         * bindings/scripts/test/JS/JSTestObj.cpp:
1166
1167 2015-06-29  Anders Carlsson  <andersca@apple.com>
1168
1169         Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
1170         https://bugs.webkit.org/show_bug.cgi?id=146413
1171         rdar://problem/21295036
1172
1173         Reviewed by Andreas Kling.
1174
1175         Replace SPI with API.
1176
1177         * WebCore.xcodeproj/project.pbxproj:
1178         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1179         (WebCore::MemoryPressureHandler::install):
1180         * platform/mac/WebCoreSystemInterface.h:
1181         * platform/spi/cocoa/DispatchSPI.h: Removed.
1182
1183 2015-06-29  Andreas Kling  <akling@apple.com>
1184
1185         [iOS] Pausing a media element should discard buffered data immediately if under memory pressure.
1186         <https://webkit.org/b/146410>
1187         <rdar://problem/20366883>
1188
1189         Reviewed by Darin Adler.
1190
1191         When moving a media element into paused state, call purgeBufferedDataIfPossible()
1192         right away if the system is under memory pressure.
1193
1194         This ensures that mediaserverd drops its forward-looking frame queue right
1195         away instead of waiting for a new pressure notification.
1196
1197         * html/HTMLMediaElement.cpp:
1198         (WebCore::HTMLMediaElement::pauseInternal):
1199
1200 2015-06-29  Matt Rajca  <mrajca@apple.com>
1201
1202         Media Session: Media elements should report a null session for Default sessions
1203         https://bugs.webkit.org/show_bug.cgi?id=146373
1204
1205         Reviewed by Eric Carlson.
1206
1207         If a media element's current session is a 'Default' media session, its session property should report null in
1208         the JavaScript API.
1209
1210         * Modules/mediasession/MediaSession.h:
1211         * html/HTMLMediaElement.cpp:
1212         (WebCore::HTMLMediaElement::session):
1213
1214 2015-06-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
1215
1216         [Mac] Disable QTKit by default.
1217         https://bugs.webkit.org/show_bug.cgi?id=146352
1218
1219         Reviewed by Darin Adler.
1220         
1221         Fix the the requirement for enabling QTKit and AVFoundation.
1222
1223         * page/Settings.cpp:
1224         (WebCore::invalidateAfterGenericFamilyChange): Remove the requirement
1225         for enabling QTKit and AVFoundation. The initial state of QTKit should
1226         be disabled on all OS X ports. And the initial state of AVFoundation
1227         should be enabled  on all OS X ports.
1228
1229 2015-06-29  Hyungwook Lee  <hyungwook.lee@navercorp.com>
1230
1231         [EFL] Purge unused favicons from IconDatabase after 30 days.
1232         https://bugs.webkit.org/show_bug.cgi?id=146334
1233
1234         Reviewed by Gyuyoung Kim.
1235
1236         We need purge unused favicons from IconDatabase for database size control.
1237
1238         * loader/icon/IconDatabase.cpp:
1239         (WebCore::IconDatabase::performURLImport):
1240
1241 2015-06-26  Matt Rajca  <mrajca@apple.com>
1242
1243         Add support for 'Default' media session types
1244         https://bugs.webkit.org/show_bug.cgi?id=146355
1245
1246         Reviewed by Darin Adler.
1247
1248         * Modules/mediasession/MediaSession.cpp:
1249         (WebCore::MediaSession::MediaSession): Added a new constructor for creating 'Default' media sessions.
1250         (WebCore::MediaSession::kind): 'Default' media sessions are represented by an empty string.
1251         * Modules/mediasession/MediaSession.h:
1252         * dom/Document.cpp:
1253         (WebCore::Document::defaultMediaSession): Lazily construct the default media session.
1254         * dom/Document.h:
1255         * html/HTMLMediaElement.cpp:
1256         (WebCore::HTMLMediaElement::HTMLMediaElement): New media elements are assigned to the 'Default' media session.
1257
1258 2015-06-28  Andreas Kling  <akling@apple.com>
1259
1260         [iOS] Drop buffered data in paused media elements on memory pressure.
1261         <https://webkit.org/b/146369>
1262         <rdar://problem/20366883>
1263
1264         Reviewed by Eric Carlson.
1265
1266         To avoid getting crushed under mediaserverd memory growth when viewing
1267         a page with multiple media elements, add a step to the memory pressure
1268         handler that drops buffered data from all media elements that are
1269         not currently playing.
1270
1271         On a test page with a bunch of embedded YouTube videos, this pass frees
1272         up ~4MB per paused video when the system memory pressure hits.
1273
1274         * html/HTMLMediaElement.cpp:
1275         (WebCore::HTMLMediaElement::allMediaElements):
1276         (WebCore::HTMLMediaElement::HTMLMediaElement):
1277         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1278         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
1279         * html/HTMLMediaElement.h:
1280         * platform/MemoryPressureHandler.cpp:
1281         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
1282
1283 2015-06-28  Chris Dumez  <cdumez@apple.com>
1284
1285         Crash: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::CachedFrameBase::restore + 333
1286         https://bugs.webkit.org/show_bug.cgi?id=146388
1287         <rdar://problem/21567343>
1288
1289         Reviewed by Darin Adler.
1290
1291         Pages that are currently loading are not supposed to go into the
1292         PageCache. However, PageCache::canCache() only checks if the
1293         FrameLoader's documentLoader is loading. If the subframe is in
1294         provisional load stage, we would fail to detect that the frame is
1295         actually loading because the FrameLoader active documentLoader would
1296         be the provisional documentLoader, not the regular documentLoader.
1297         Therefore, the page would get added to the PageCache and the frame
1298         would keep loading while in the PageCache.
1299
1300         On http://www.audiusa.com/models, this is what was happening. It was
1301         crashing because the subframe would finish loading while in the
1302         PageCache, in which case we would fire the 'load' event and the
1303         content 'load' event handler would then proceed to remove the iframe.
1304         Upon restoring the PageCache entry, we would run into trouble as we
1305         would have a CachedFrame whose Frame has been removed.
1306
1307         The solution proposed is to prevent page-caching if a subframe is in
1308         provisional load stage.
1309
1310         Test: http/tests/navigation/page-cache-iframe-provisional-load.html
1311
1312         * history/PageCache.cpp:
1313         (WebCore::logCanCacheFrameDecision):
1314         (WebCore::PageCache::canCachePageContainingThisFrame):
1315         * page/DiagnosticLoggingKeys.cpp:
1316         (WebCore::DiagnosticLoggingKeys::provisionalLoadKey):
1317         * page/DiagnosticLoggingKeys.h:
1318
1319 2015-06-28  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1320
1321         [Streams API] Add support for chunks with customized sizes
1322         https://bugs.webkit.org/show_bug.cgi?id=146312
1323
1324         Reviewed by Darin Adler.
1325
1326         Covered by rebased tests.
1327
1328         * bindings/js/ReadableJSStream.cpp:
1329         (WebCore::ReadableJSStream::read): Decrement totalQueueSize with the chunk specific size.
1330         (WebCore::ReadableJSStream::enqueue): Calls retrieveSize, enqueue chunk with its size and increment totalQueueSize.
1331         (WebCore::ReadableJSStream::retrieveChunkSize): Calls size JS callback and convert it to double.
1332         * bindings/js/ReadableJSStream.h:
1333
1334 2015-06-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1335
1336         [Streams API]Remove ReadableStreamController.close custom binding
1337         https://bugs.webkit.org/show_bug.cgi?id=146380
1338
1339         Reviewed by Darin Adler.
1340
1341         No change in behavior.
1342
1343         * Modules/streams/ReadableStreamController.h:
1344         (WebCore::ReadableStreamController::close): Calling ReadableJSStream close method.
1345         * Modules/streams/ReadableStreamController.idl: Removed Custom.
1346         * bindings/js/JSReadableStreamControllerCustom.cpp:
1347         (WebCore::JSReadableStreamController::close): Deleted.
1348         * bindings/js/ReadableJSStream.cpp:
1349         (WebCore::ReadableJSStream::close): Moved custom binding code here.
1350         * bindings/js/ReadableJSStream.h:
1351
1352 2015-06-27  Chris Fleizach  <cfleizach@apple.com>
1353
1354         AX: implement @aria-roledescription
1355         https://bugs.webkit.org/show_bug.cgi?id=146274
1356
1357         Reviewed by Darin Adler.
1358
1359         Add support for aria-roledescription.
1360
1361         Test: accessibility/aria-roledescription.html
1362
1363         * accessibility/AccessibilityObject.cpp:
1364         (WebCore::AccessibilityObject::hasHighlighting):
1365         (WebCore::AccessibilityObject::roleDescription):
1366         (WebCore::nodeHasPresentationRole):
1367         * accessibility/AccessibilityObject.h:
1368         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1369         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
1370         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
1371         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
1372         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1373         (-[WebAccessibilityObjectWrapper roleDescription]):
1374
1375 2015-06-27  Darin Adler  <darin@apple.com>
1376
1377         Fix the build.
1378
1379         * platform/network/cf/ResourceErrorCF.cpp:
1380         (WebCore::ResourceError::cfError): Take out log statement. Add FIXME comment
1381         that explains part of the reason we may get null here.
1382         * platform/network/mac/ResourceErrorMac.mm:
1383         (WebCore::createNSErrorFromResourceErrorBase): Ditto.
1384
1385 2015-06-27  David Kilzer  <ddkilzer@apple.com>
1386
1387         Crash in WebCore::ResourceError::cfError() after provisional load failed
1388         <http://webkit.org/b/146384>
1389
1390         Reviewed by Darin Adler.
1391
1392         This is a speculative fix based on the crashing stack.
1393
1394         * platform/network/cf/ResourceErrorCF.cpp:
1395         (WebCore::ResourceError::cfError): Add NULL check.
1396         * platform/network/mac/ResourceErrorMac.mm:
1397         (WebCore::createNSErrorFromResourceErrorBase): Add nil check in
1398         case we ever turn off USE(CFNETWORK) for iOS.
1399
1400 2015-06-27  Eric Carlson  <eric.carlson@apple.com>
1401
1402         [Mac] Only flag a video element as eligible for auto-play to AppleTV one time
1403         https://bugs.webkit.org/show_bug.cgi?id=146386
1404
1405         Reviewed by Brent Fulgham.
1406
1407         * Modules/mediasession/WebMediaSessionManager.cpp:
1408         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): Drive-by fix - early 
1409           return when there are no clients.
1410
1411         * html/HTMLMediaElement.cpp:
1412         (WebCore::HTMLMediaElement::pendingActionTimerFired): Set m_failedToPlayToWirelessTarget if the
1413           media engine is still unable to play to the wireless target.
1414         (WebCore::HTMLMediaElement::prepareForLoad): Clear m_failedToPlayToWirelessTarget.
1415         (WebCore::HTMLMediaElement::mediaState): Don't set the ExternalDeviceAutoPlayCandidate flag
1416           if m_failedToPlayToWirelessTarget is true.
1417         * html/HTMLMediaElement.h:
1418
1419 2015-06-27  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1420
1421         [Streams API] Implement ReadableStreamController.desiredSize property
1422         https://bugs.webkit.org/show_bug.cgi?id=146311
1423
1424         Reviewed by Darin Adler.
1425
1426         Covered by rebased tests.
1427
1428         * Modules/streams/ReadableStreamController.h: Adding desiredSize getter.
1429         (WebCore::ReadableStreamController::desiredSize): Ditto.
1430         * Modules/streams/ReadableStreamController.idl: Added desiredSize attribute.
1431
1432 2015-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1433
1434         [GTK][SOUP] Implement WebCore::PublicSuffix for soup and enable PUBLIC_SUFFIX_LIST for GTK+
1435         https://bugs.webkit.org/show_bug.cgi?id=146318
1436
1437         Reviewed by Sergio Villar Senin.
1438
1439         This is covered by unit tests.
1440
1441         * PlatformGTK.cmake:
1442         * platform/soup/PublicSuffixSoup.cpp: Added.
1443         (WebCore::isPublicSuffix):
1444         (WebCore::topPrivatelyControlledDomain):
1445
1446 2015-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
1447
1448         [iOS] AppleGothic has been superseded by Apple SD Gothic Neo
1449         https://bugs.webkit.org/show_bug.cgi?id=146372
1450         <rdar://problem/21574004>
1451
1452         Reviewed by Dean Jackson.
1453
1454         Test: fast/text/hangul-generic-font-families.html
1455
1456         * page/mac/SettingsMac.mm:
1457         (WebCore::Settings::initializeDefaultFontFamilies):
1458
1459 2015-06-26  Matt Daiter  <mdaiter@apple.com>
1460
1461         Supporting getStartDate and added tests
1462         https://bugs.webkit.org/show_bug.cgi?id=145676
1463         <rdar://problem/20876076>
1464
1465         Reviewed by Brent Fulgham.
1466
1467         Test: http/tests/media/hls/video-controller-getStartDate.html
1468
1469         * bindings/js/JSDOMBinding.cpp:
1470         (WebCore::jsDateOrNaN):
1471         * bindings/js/JSDOMBinding.h:
1472         * bindings/scripts/CodeGeneratorJS.pm: Added features to return 
1473         NaN for Date
1474         * bindings/scripts/CodeGeneratorGObject.pm: Needed to add
1475         type checking code for GObject (no date)
1476         (NativeToJSValue):
1477         * bindings/scripts/IDLAttributes.txt: 
1478         * html/HTMLMediaElement.cpp: Added getStartDate function
1479         (WebCore::HTMLMediaElement::getStartDate):
1480         * html/HTMLMediaElement.h: Needed to add declarations
1481         * html/HTMLMediaElement.idl: Needed to modify for returning NaN
1482         * platform/graphics/MediaPlayer.cpp:
1483         (WebCore::MediaPlayer::getStartDate):
1484         * platform/graphics/MediaPlayer.h:
1485         * platform/graphics/MediaPlayerPrivate.h: Added in Mac-specific platform
1486         (WebCore::MediaPlayerPrivateInterface::getStartDate):
1487         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1488         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1489         (WebCore::MediaPlayerPrivateAVFoundationObjC::getStartDate):
1490
1491 2015-06-26  Beth Dakin  <bdakin@apple.com>
1492
1493         WebPage::getPositionInformation() should not copy an image that is larger than the  
1494         screen
1495         https://bugs.webkit.org/show_bug.cgi?id=146367
1496
1497         Reviewed by Tim Horton.
1498
1499         Export the rect version of this function too.
1500         * platform/graphics/GraphicsContext.h:
1501
1502 2015-06-26  Eric Carlson  <eric.carlson@apple.com>
1503
1504         [Mac] Muted videos should not automatically play to AppleTV
1505         https://bugs.webkit.org/show_bug.cgi?id=146366
1506
1507         Reviewed by Dean Jackson.
1508
1509         * html/HTMLMediaElement.cpp:
1510         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_initiallyMuted.
1511         (WebCore::HTMLMediaElement::scheduleDelayedAction): Support CheckMediaState.
1512         (WebCore::HTMLMediaElement::setReadyState): Set m_initiallyMuted to true if the element is
1513           muted or the volume is less than 5%.
1514         (WebCore::HTMLMediaElement::setMuted): Update media state asynchronously so multiple state
1515           changes can be coalesced.
1516         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Ditto.
1517         (WebCore::HTMLMediaElement::setPlaying): Ditto.
1518         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
1519         (WebCore::HTMLMediaElement::removeEventListener): Ditto.
1520         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Ditto.
1521         (WebCore::HTMLMediaElement::updateMediaState): Update after a timer when passed UpdateMediaState::Asynchronously.
1522         (WebCore::HTMLMediaElement::mediaState): Don't set the ExternalDeviceAutoPlayCandidate flag if
1523           m_initiallyMuted is true.
1524         * html/HTMLMediaElement.h:
1525         * html/HTMLMediaElementEnums.h:
1526
1527 2015-06-26  Daniel Bates  <dabates@apple.com>
1528
1529         Rolling out r184660
1530         https://bugs.webkit.org/show_bug.cgi?id=145200
1531
1532         Reverting r184660 because it caused a regression.
1533
1534         * English.lproj/Localizable.strings:
1535         * html/TextFieldInputType.cpp:
1536         (WebCore::TextFieldInputType::createAutoFillButton): Deleted.
1537         * platform/LocalizedStrings.cpp:
1538         (WebCore::AXAutoFillButtonText): Deleted.
1539         * platform/LocalizedStrings.h:
1540         * platform/efl/LocalizedStringsEfl.cpp:
1541         (WebCore::AXAutoFillButtonText): Deleted.
1542         * platform/gtk/LocalizedStringsGtk.cpp:
1543         (WebCore::AXAutoFillButtonText): Deleted.
1544
1545 2015-06-26  Daniel Bates  <dabates@apple.com>
1546
1547         Rolling out r185881
1548         https://bugs.webkit.org/show_bug.cgi?id=146243
1549         And
1550         r185828
1551         https://bugs.webkit.org/show_bug.cgi?id=145241
1552
1553         Reverting r185881 and r185828 because the latter caused a regression.
1554
1555         * accessibility/AccessibilityRenderObject.cpp:
1556         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Deleted.
1557         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Deleted.
1558         * accessibility/AccessibilityRenderObject.h:
1559
1560 2015-06-26  Dean Jackson  <dino@apple.com>
1561
1562         No audio on animated page with the attached fixed layout epub
1563         https://bugs.webkit.org/show_bug.cgi?id=146365
1564
1565         Reviewed by Eric Carlson.
1566
1567         The new restriction RequireUserGestureForAudioRateChange conflicted
1568         with existing clients who expected RequireUserGestureForRateChange
1569         to allow autoplaying audio. Update the logic to ensure that
1570         RequireUserGestureForRateChange covers all media when set to
1571         false.
1572
1573         This may require a revisit once we're using RequireUserGestureForAudioRateChange
1574         in production, because the global setting will trump that, and
1575         most clients have the global setting to false. We'll need to come
1576         up with a way to allow legacy clients to preserve their behaviour.
1577
1578         * html/HTMLMediaElement.cpp:
1579         (WebCore::HTMLMediaElement::HTMLMediaElement): Only restrict audio
1580         if RequireUserGestureForRateChange is also false.
1581
1582 2015-06-25  Anders Carlsson  <andersca@apple.com>
1583
1584         Get rid of ScrollbarThemeClient now that it's unused
1585         https://bugs.webkit.org/show_bug.cgi?id=146327
1586
1587         Reviewed by Beth Dakin.
1588
1589         * WebCore.vcxproj/WebCore.vcxproj:
1590         * WebCore.vcxproj/WebCore.vcxproj.filters:
1591         * WebCore.xcodeproj/project.pbxproj:
1592         * platform/Scrollbar.cpp:
1593         (WebCore::Scrollbar::scrollbarOverlayStyle): Deleted.
1594         (WebCore::Scrollbar::isScrollableAreaActive): Deleted.
1595         (WebCore::Scrollbar::isScrollViewScrollbar): Deleted.
1596         (WebCore::Scrollbar::root): Deleted.
1597         * platform/Scrollbar.h:
1598         (WebCore::Scrollbar::isCustomScrollbar):
1599         (WebCore::Scrollbar::orientation):
1600         (WebCore::Scrollbar::value):
1601         (WebCore::Scrollbar::currentPos):
1602         (WebCore::Scrollbar::visibleSize):
1603         (WebCore::Scrollbar::totalSize):
1604         (WebCore::Scrollbar::maximum):
1605         (WebCore::Scrollbar::controlSize):
1606         (WebCore::Scrollbar::lineStep):
1607         (WebCore::Scrollbar::pageStep):
1608         (WebCore::Scrollbar::pressedPart):
1609         (WebCore::Scrollbar::hoveredPart):
1610         (WebCore::Scrollbar::enabled):
1611         (WebCore::Scrollbar::styleChanged):
1612         (WebCore::Scrollbar::isAlphaLocked):
1613         (WebCore::Scrollbar::setIsAlphaLocked):
1614         * platform/ScrollbarTheme.h:
1615         * platform/ScrollbarThemeClient.h: Removed.
1616         (WebCore::ScrollbarThemeClient::~ScrollbarThemeClient): Deleted.
1617         * platform/mac/ScrollbarThemeMac.mm:
1618         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
1619         * rendering/RenderScrollbarTheme.cpp:
1620
1621 2015-06-26  Chris Dumez  <cdumez@apple.com>
1622
1623         Prevent new loads while in PageCache (or being added to PageCache)
1624         https://bugs.webkit.org/show_bug.cgi?id=146299
1625         <rdar://problem/21523788>
1626
1627         Reviewed by Darin Adler.
1628
1629         Generalize the change in r185337 to prevent new loads while in the
1630         PageCache (or being added to the PageCache), instead of merely
1631         preventing new loads in pagehide event handlers. We should never
1632         have any pages that are still loading inside the PageCache.
1633
1634         The fix in r185337 was apparently insufficient to address the
1635         problem so generalizing the check / policy will hopefully catch
1636         more cases where content is able to start loads while being added
1637         to the PageCache. This patch also removes some of the complexity
1638         added in r185337 as it is no longer needed.
1639
1640         No new tests, already covered by:
1641         http/tests/navigation/image-load-in-pagehide-handler.html
1642         http/tests/navigation/subframe-pagehide-handler-starts-load.html
1643         http/tests/navigation/subframe-pagehide-handler-starts-load2.html
1644
1645         * loader/FrameLoader.cpp:
1646         (WebCore::FrameLoader::stopLoading):
1647         (WebCore::FrameLoader::loadURL):
1648         (WebCore::FrameLoader::loadWithDocumentLoader):
1649         (WebCore::FrameLoader::stopAllLoaders):
1650         (WebCore::FrameLoader::handleBeforeUnloadEvent):
1651         (WebCore::FrameLoader::FrameLoader): Deleted.
1652         * loader/FrameLoader.h:
1653         (WebCore::FrameLoader::pageDismissalEventBeingDispatched):
1654         * loader/ImageLoader.cpp:
1655         (WebCore::pageIsBeingDismissed):
1656         * loader/cache/CachedResource.cpp:
1657         (WebCore::CachedResource::load):
1658         * loader/cache/CachedResourceLoader.cpp:
1659         (WebCore::CachedResourceLoader::requestImage):
1660         * page/Page.cpp:
1661         (WebCore::Page::inPageCache):
1662         * page/Page.h:
1663         (WebCore::Page::group): Deleted.
1664
1665 2015-06-26  Simon Fraser  <simon.fraser@apple.com>
1666
1667         [OS X] Change the layer tiling threshold from 2000 to 2048 pixels
1668         https://bugs.webkit.org/show_bug.cgi?id=146353
1669
1670         Reviewed by Tim Horton.
1671
1672         Programmers love powers of two.
1673
1674         * platform/graphics/ca/GraphicsLayerCA.cpp:
1675
1676 2015-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
1677
1678         [Cocoa] Sans-serif generic font family should map to PingFang
1679         https://bugs.webkit.org/show_bug.cgi?id=146333
1680         <rdar://problem/21521217>
1681
1682         Reviewed by Alexey Proskuryakov.
1683
1684         Also performs a little bit of cleanup.
1685
1686         Test: fast/text/han-generic-font-families.html
1687
1688         * page/mac/SettingsMac.mm:
1689         (WebCore::sansSerifTraditionalHanFontFamily):
1690         (WebCore::sansSerifSimplifiedHanFontFamily):
1691         (WebCore::Settings::initializeDefaultFontFamilies):
1692
1693 2015-06-26  Per Arne Vollan  <peavo@outlook.com>
1694
1695         [Curl] Compile errors; ResourceResponseBase::resourceLoadTiming() has changed return type.
1696         https://bugs.webkit.org/show_bug.cgi?id=146343
1697
1698         Reviewed by Brent Fulgham.
1699
1700         * platform/network/curl/ResourceHandleManager.cpp:
1701         (WebCore::calculateWebTimingInformations):
1702         (WebCore::headerCallback):
1703         (WebCore::ResourceHandleManager::initializeHandle):
1704         (WebCore::ResourceHandleManager::initCookieSession):
1705         (WebCore::sockoptfunction): Deleted.
1706
1707 2015-06-26  Chris Fleizach  <cfleizach@apple.com>
1708
1709         iOS speech synthesizer should expose names
1710         https://bugs.webkit.org/show_bug.cgi?id=146319
1711
1712         Reviewed by Mario Sanchez Prada.
1713
1714         Use newer API to get the name and identifier of each voice asset.
1715
1716         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1717         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1718
1719 2015-06-26  Csaba Osztrogonác  <ossy@webkit.org>
1720
1721         [EFL] Remove unnecessary overriden methods from ScrollBarEfl
1722         https://bugs.webkit.org/show_bug.cgi?id=146342
1723
1724         Reviewed by Gyuyoung Kim.
1725
1726         * platform/efl/ScrollbarEfl.cpp:
1727         (WebCore::ScrollbarEfl::setParent): Deleted.
1728         (WebCore::ScrollbarEfl::setFrameRect): Deleted.
1729         (WebCore::ScrollbarEfl::frameRectsChanged): Deleted.
1730         (WebCore::ScrollbarEfl::invalidate): Deleted.
1731         * platform/efl/ScrollbarEfl.h:
1732
1733 2015-06-26  Csaba Osztrogonác  <ossy@webkit.org>
1734
1735         Convert some of WebCore/dom over to range-for loops
1736         https://bugs.webkit.org/show_bug.cgi?id=126250
1737
1738         Reviewed by Darin Adler.
1739
1740         Based on the original patch of Sam Weinig <sam@webkit.org>.
1741
1742         * dom/ContainerNode.cpp:
1743         (WebCore::ContainerNode::replaceChild):
1744         (WebCore::willRemoveChildren):
1745         (WebCore::ContainerNode::appendChild):
1746         * dom/MutationObserver.cpp:
1747         (WebCore::MutationObserver::disconnect):
1748         (WebCore::MutationObserver::getObservedNodes):
1749         (WebCore::MutationObserver::deliver):
1750         * dom/MutationObserverInterestGroup.cpp:
1751         (WebCore::MutationObserverInterestGroup::isOldValueRequested):
1752         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
1753         * dom/MutationObserverRegistration.cpp:
1754         (WebCore::MutationObserverRegistration::clearTransientRegistrations):
1755         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet):
1756         * dom/Node.cpp:
1757         (WebCore::Node::dumpStatistics):
1758         (WebCore::collectMatchingObserversForMutation):
1759         (WebCore::Node::notifyMutationObserversNodeWillDetach):
1760
1761 2015-06-25  Lucas Forschler  <lforschler@apple.com>
1762
1763         Unreviewed build fix.
1764         
1765         * platform/audio/VectorMath.cpp:
1766         (WebCore::VectorMath::vsmul):
1767         (WebCore::VectorMath::vadd):
1768         (WebCore::VectorMath::vmul):
1769         (WebCore::VectorMath::zvmul):
1770
1771 2015-06-25  Stephanie Lewis  <slewis@apple.com>
1772
1773         Build fix.
1774
1775         Unreviewed.
1776
1777         * platform/audio/DirectConvolver.cpp:
1778         (WebCore::DirectConvolver::process):
1779
1780 2015-06-25  Chris Fleizach  <cfleizach@apple.com>
1781
1782         AX: improve list heuristics (presentational use versus actual lists)
1783         https://bugs.webkit.org/show_bug.cgi?id=134187
1784
1785         Rolling this change back in. 
1786         It was taken out to allow clients to have time to update their expectations of what is a list vs. a group
1787
1788         Test: accessibility/list-detection2.html
1789
1790         * accessibility/AccessibilityList.cpp:
1791         (WebCore::AccessibilityList::isDescriptionList):
1792         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
1793         (WebCore::AccessibilityList::determineAccessibilityRole):
1794         * accessibility/AccessibilityList.h:
1795
1796 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
1797
1798         Unreviewed build fix after r185964.
1799
1800         Correct a few pointers-that-should-be-references-now errors.
1801
1802         * platform/win/PopupMenuWin.cpp:
1803         (WebCore::AccessiblePopupMenu::accLocation):
1804         (WebCore::AccessiblePopupMenu::accHitTest):
1805
1806 2015-06-25  Doug Russell  <d_russell@apple.com>
1807
1808         Bug 146300 AX: AccessibilityObject focus events that don't cause a selection 
1809         change can leave m_isSynchronizingSelection set to true
1810         https://bugs.webkit.org/show_bug.cgi?id=146300
1811
1812         Reviewed by Chris Fleizach.
1813
1814         Added a clearTextSelectionIntent() convenience function to be used after any
1815         event that can, but isn't guaranteed to result in a selection change. Matches
1816         calls to setTextSelectionIntent() convenience function.
1817         Added support for tests listening for focus change notifications.
1818
1819         Test: platform/mac/accessibility/focus-setting-selection-syncronizing-not-clearing.html
1820
1821         * accessibility/AccessibilityRenderObject.cpp:
1822         (WebCore::clearTextSelectionIntent):
1823         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1824         (WebCore::AccessibilityRenderObject::setFocused):
1825         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1826         * accessibility/mac/AXObjectCacheMac.mm:
1827         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
1828
1829 2015-06-25  Alex Christensen  <achristensen@webkit.org>
1830
1831         [Content Extensions] Add a way to match a domain but not subdomains
1832         https://bugs.webkit.org/show_bug.cgi?id=146241
1833         rdar://problem/21557754
1834
1835         Reviewed by Darin Adler.
1836
1837         This patch makes it possible to have a trigger with an if-domain apply to sub2.sub1.webkit.org
1838         but not sub1.webkit.org by making the domains default to only applying to the domain and not subdomains.
1839         To make a domain apply to a domain and any subdomains, the domain must begin with a '*'.
1840
1841         * contentextensions/CombinedURLFilters.cpp:
1842         (WebCore::ContentExtensions::CombinedURLFilters::addDomain):
1843         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
1844         Make domains apply only to the exact domain unless there is a * at the beginning,
1845         in which case they apply to the domain and any subdomains.
1846
1847 2015-06-25  Simon Fraser  <simon.fraser@apple.com>
1848
1849         [iOS WK2] Swiping back just after scrolling can cause some tiles to disappear
1850         https://bugs.webkit.org/show_bug.cgi?id=146329
1851         rdar://problem/21233010
1852
1853         Reviewed by Tim Horton.
1854
1855         Have the Compositing log channel dump the visible rect used for layer flushing.
1856
1857         * rendering/RenderLayerCompositor.cpp:
1858         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1859
1860 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
1861
1862         [WIN] Enable WEB_TIMING API
1863         https://bugs.webkit.org/show_bug.cgi?id=146330
1864         <rdar://problem/21530765>
1865
1866         Reviewed by Dean Jackson.
1867
1868         Tested by internal HLS tests.
1869
1870         Enable WEB_TIMING features on Windows by activating the feature flag,
1871         and correcting some build errors.
1872
1873         * platform/network/cf/ResourceHandleCFNet.cpp:
1874         (WebCore::ResourceHandle::start): "setCollectionTimingData" is only
1875         defined for PLATFORM(COCOA).
1876         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1877         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1878         The 'ResourceHandle::getConnectionTimingData' method is only defined
1879         for PLATFORM(COCOA).
1880
1881 2015-06-25  Dean Jackson  <dino@apple.com>
1882
1883         Inline media controls disappear when returning a video to inline
1884         https://bugs.webkit.org/show_bug.cgi?id=146328
1885         <rdar://problem/21142862>
1886
1887         Reviewed by Tim Horton.
1888
1889         We were getting into a state where the controls were being
1890         hidden via a timer while we were in fullscreen or on
1891         another tab. Meanwhile, we could exit from such
1892         a condition to a point where the controls were
1893         not visible, but not completely removed from the DOM, confusing
1894         the logic that decided whether to show them on tap.
1895
1896         * Modules/mediacontrols/mediaControlsApple.js:
1897         (Controller.prototype.hideControls): If we are in the act of hiding
1898         controls, we can clear any existing timers that are going to try
1899         to hide them again.
1900         (Controller.prototype.resetHideControlsTimer): Make sure we null
1901         out the hideTimer object, since we look at its value often to
1902         decide whether or not a timer exists.
1903         * Modules/mediacontrols/mediaControlsiOS.js:
1904         (ControllerIOS.prototype.handlePlayButtonTouchEnd): If the user
1905         taps play, then we should call showControls, which resets the hide
1906         timers amongst other things. We need to do this due to the next change,
1907         so that a timer started before we pressed play doesn't cause the
1908         controls to instantly disappear as soon as we start playing.
1909         (ControllerIOS.prototype.handleWrapperTouchStart): We can get into
1910         the state where controls are invisible but still in the tree. Since the
1911         controlsAreHidden() logic only looks for the latter, we need to also
1912         look for invisible when the user taps for the controls. Yes, this
1913         naming doesn't make much sense :(
1914
1915 2015-06-25  Joseph Pecoraro  <pecoraro@apple.com>
1916
1917         [Mac] Web Inspector: Window dragging on toolbar should behave more like native window dragging
1918         https://bugs.webkit.org/show_bug.cgi?id=146324
1919
1920         Reviewed by Timothy Hatcher.
1921
1922         * inspector/InspectorFrontendClient.h:
1923         * inspector/InspectorFrontendClientLocal.h:
1924         Do nothing or pass it up to the the frontend client.
1925
1926         * inspector/InspectorFrontendHost.h:
1927         * inspector/InspectorFrontendHost.idl:
1928         * inspector/InspectorFrontendHost.cpp:
1929         (WebCore::InspectorFrontendHost::startWindowDrag):
1930         Add a new host function to get native window dragging behavior.
1931
1932 2015-06-25  Tim Horton  <timothy_horton@apple.com>
1933
1934         Viewport units are wrong when scaled in 2-up mode, cause content to hop around on apple.com/music
1935         https://bugs.webkit.org/show_bug.cgi?id=146322
1936         <rdar://problem/21413884>
1937
1938         Reviewed by Simon Fraser.
1939
1940         * page/FrameView.cpp:
1941         (WebCore::FrameView::viewportSizeForCSSViewportUnits):
1942         Use the fixed layout size, if enabled, instead of the visibleContentRect,
1943         for the viewport unit size. This ensures that viewport units take up the whole
1944         fixed-layout viewport, not just the size of the view scaled by the page scale
1945         (which visibleContentRect provides).
1946
1947 2015-06-25  Eric Carlson  <eric.carlson@apple.com>
1948
1949         [Mac] AirPlay menu button still doesn't always show on page load
1950         https://bugs.webkit.org/show_bug.cgi?id=146325
1951
1952         Reviewed by Dean Jackson.
1953
1954         * html/HTMLMediaElement.cpp:
1955         (WebCore::HTMLMediaElement::mediaState): A player that can't currently play to a wireless 
1956           target does require target monitoring if an availability event listner has been registered,
1957           otherwise we may not register for availability change notifications.
1958
1959 2015-06-25  Anders Carlsson  <andersca@apple.com>
1960
1961         Stop using ScrollbarThemeClient and just use Scrollbar directly
1962         https://bugs.webkit.org/show_bug.cgi?id=146320
1963
1964         Reviewed by Tim Horton.
1965
1966         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
1967         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
1968         * platform/ScrollableArea.cpp:
1969         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
1970         * platform/Scrollbar.cpp:
1971         (WebCore::Scrollbar::Scrollbar):
1972         (WebCore::Scrollbar::~Scrollbar):
1973         (WebCore::Scrollbar::offsetDidChange):
1974         (WebCore::Scrollbar::updateThumb):
1975         (WebCore::Scrollbar::paint):
1976         (WebCore::thumbUnderMouse):
1977         (WebCore::Scrollbar::autoscrollPressedPart):
1978         (WebCore::Scrollbar::startTimerIfNeeded):
1979         (WebCore::Scrollbar::moveThumb):
1980         (WebCore::Scrollbar::setHoveredPart):
1981         (WebCore::Scrollbar::setPressedPart):
1982         (WebCore::Scrollbar::mouseMoved):
1983         (WebCore::Scrollbar::mouseUp):
1984         (WebCore::Scrollbar::mouseDown):
1985         (WebCore::Scrollbar::setEnabled):
1986         * platform/ScrollbarTheme.h:
1987         (WebCore::ScrollbarTheme::updateEnabledState):
1988         (WebCore::ScrollbarTheme::paint):
1989         (WebCore::ScrollbarTheme::hitTest):
1990         (WebCore::ScrollbarTheme::updateScrollbarOverlayStyle):
1991         (WebCore::ScrollbarTheme::invalidateParts):
1992         (WebCore::ScrollbarTheme::invalidatePart):
1993         (WebCore::ScrollbarTheme::paintTickmarks):
1994         (WebCore::ScrollbarTheme::shouldCenterOnThumb):
1995         (WebCore::ScrollbarTheme::shouldSnapBackToDragOrigin):
1996         (WebCore::ScrollbarTheme::shouldDragDocumentInsteadOfThumb):
1997         (WebCore::ScrollbarTheme::thumbPosition):
1998         (WebCore::ScrollbarTheme::thumbLength):
1999         (WebCore::ScrollbarTheme::trackPosition):
2000         (WebCore::ScrollbarTheme::trackLength):
2001         (WebCore::ScrollbarTheme::registerScrollbar):
2002         (WebCore::ScrollbarTheme::unregisterScrollbar):
2003         * platform/ScrollbarThemeComposite.cpp:
2004         (WebCore::ScrollbarThemeComposite::paint):
2005         (WebCore::ScrollbarThemeComposite::hitTest):
2006         (WebCore::ScrollbarThemeComposite::invalidatePart):
2007         (WebCore::ScrollbarThemeComposite::splitTrack):
2008         (WebCore::usedTotalSize):
2009         (WebCore::ScrollbarThemeComposite::thumbPosition):
2010         (WebCore::ScrollbarThemeComposite::thumbLength):
2011         (WebCore::ScrollbarThemeComposite::minimumThumbLength):
2012         (WebCore::ScrollbarThemeComposite::trackPosition):
2013         (WebCore::ScrollbarThemeComposite::trackLength):
2014         (WebCore::ScrollbarThemeComposite::thumbRect):
2015         * platform/ScrollbarThemeComposite.h:
2016         (WebCore::ScrollbarThemeComposite::willPaintScrollbar):
2017         (WebCore::ScrollbarThemeComposite::didPaintScrollbar):
2018         (WebCore::ScrollbarThemeComposite::paintScrollbarBackground):
2019         (WebCore::ScrollbarThemeComposite::paintTrackBackground):
2020         (WebCore::ScrollbarThemeComposite::paintTrackPiece):
2021         (WebCore::ScrollbarThemeComposite::paintButton):
2022         (WebCore::ScrollbarThemeComposite::paintThumb):
2023         (WebCore::ScrollbarThemeComposite::constrainTrackRectToTrackPieces):
2024         * platform/efl/ScrollbarThemeEfl.h:
2025         * platform/gtk/ScrollbarThemeGtk.cpp:
2026         (WebCore::ScrollbarThemeGtk::hasThumb):
2027         (WebCore::ScrollbarThemeGtk::backButtonRect):
2028         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
2029         (WebCore::ScrollbarThemeGtk::trackRect):
2030         (WebCore::ScrollbarThemeGtk::registerScrollbar):
2031         (WebCore::ScrollbarThemeGtk::unregisterScrollbar):
2032         (WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness):
2033         (WebCore::ScrollbarThemeGtk::thumbRect):
2034         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
2035         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
2036         (WebCore::ScrollbarThemeGtk::paintThumb):
2037         (WebCore::ScrollbarThemeGtk::paintButton):
2038         (WebCore::ScrollbarThemeGtk::paint):
2039         (WebCore::ScrollbarThemeGtk::shouldCenterOnThumb):
2040         (WebCore::ScrollbarThemeGtk::buttonSize):
2041         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
2042         * platform/gtk/ScrollbarThemeGtk.h:
2043         (WebCore::ScrollbarThemeGtk::hasButtons):
2044         * platform/ios/ScrollbarThemeIOS.h:
2045         * platform/ios/ScrollbarThemeIOS.mm:
2046         (WebCore::ScrollbarThemeIOS::registerScrollbar):
2047         (WebCore::ScrollbarThemeIOS::unregisterScrollbar):
2048         (WebCore::ScrollbarThemeIOS::hasButtons):
2049         (WebCore::ScrollbarThemeIOS::hasThumb):
2050         (WebCore::ScrollbarThemeIOS::backButtonRect):
2051         (WebCore::ScrollbarThemeIOS::forwardButtonRect):
2052         (WebCore::ScrollbarThemeIOS::trackRect):
2053         (WebCore::ScrollbarThemeIOS::minimumThumbLength):
2054         (WebCore::ScrollbarThemeIOS::shouldCenterOnThumb):
2055         (WebCore::ScrollbarThemeIOS::paint):
2056         * platform/mac/ScrollAnimatorMac.mm:
2057         (scrollbarPainterForScrollbar):
2058         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
2059         (-[WebScrollbarPartAnimation startAnimation]):
2060         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]):
2061         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
2062         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
2063         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
2064         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
2065         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
2066         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
2067         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
2068         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
2069         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
2070         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
2071         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
2072         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
2073         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
2074         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
2075         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
2076         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
2077         * platform/mac/ScrollbarThemeMac.h:
2078         * platform/mac/ScrollbarThemeMac.mm:
2079         (WebCore::ScrollbarThemeMac::registerScrollbar):
2080         (WebCore::ScrollbarThemeMac::unregisterScrollbar):
2081         (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
2082         (WebCore::ScrollbarThemeMac::painterForScrollbar):
2083         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
2084         (WebCore::ScrollbarThemeMac::hasButtons):
2085         (WebCore::ScrollbarThemeMac::hasThumb):
2086         (WebCore::ScrollbarThemeMac::backButtonRect):
2087         (WebCore::ScrollbarThemeMac::forwardButtonRect):
2088         (WebCore::ScrollbarThemeMac::trackRect):
2089         (WebCore::ScrollbarThemeMac::minimumThumbLength):
2090         (WebCore::ScrollbarThemeMac::shouldCenterOnThumb):
2091         (WebCore::ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb):
2092         (WebCore::ScrollbarThemeMac::updateEnabledState):
2093         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
2094         (WebCore::ScrollbarThemeMac::paint):
2095         * platform/mock/ScrollbarThemeMock.cpp:
2096         (WebCore::ScrollbarThemeMock::trackRect):
2097         (WebCore::ScrollbarThemeMock::paintTrackBackground):
2098         (WebCore::ScrollbarThemeMock::paintThumb):
2099         * platform/mock/ScrollbarThemeMock.h:
2100         (WebCore::ScrollbarThemeMock::hasButtons): Deleted.
2101         (WebCore::ScrollbarThemeMock::hasThumb): Deleted.
2102         (WebCore::ScrollbarThemeMock::backButtonRect): Deleted.
2103         (WebCore::ScrollbarThemeMock::forwardButtonRect): Deleted.
2104         (WebCore::ScrollbarThemeMock::maxOverlapBetweenPages): Deleted.
2105         (WebCore::ScrollbarThemeMock::isMockTheme): Deleted.
2106         * platform/win/ScrollbarThemeSafari.cpp:
2107         (WebCore::ScrollbarThemeSafari::hasButtons):
2108         (WebCore::ScrollbarThemeSafari::hasThumb):
2109         (WebCore::ScrollbarThemeSafari::backButtonRect):
2110         (WebCore::ScrollbarThemeSafari::forwardButtonRect):
2111         (WebCore::ScrollbarThemeSafari::trackRect):
2112         (WebCore::ScrollbarThemeSafari::minimumThumbLength):
2113         (WebCore::ScrollbarThemeSafari::shouldCenterOnThumb):
2114         (WebCore::ScrollbarThemeSafari::paintTrackBackground):
2115         (WebCore::ScrollbarThemeSafari::paintButton):
2116         (WebCore::ScrollbarThemeSafari::paintThumb):
2117         * platform/win/ScrollbarThemeSafari.h:
2118         * platform/win/ScrollbarThemeWin.cpp:
2119         (WebCore::ScrollbarThemeWin::hasThumb):
2120         (WebCore::ScrollbarThemeWin::backButtonRect):
2121         (WebCore::ScrollbarThemeWin::forwardButtonRect):
2122         (WebCore::ScrollbarThemeWin::trackRect):
2123         (WebCore::ScrollbarThemeWin::shouldCenterOnThumb):
2124         (WebCore::ScrollbarThemeWin::shouldSnapBackToDragOrigin):
2125         (WebCore::ScrollbarThemeWin::paintTrackBackground):
2126         (WebCore::ScrollbarThemeWin::paintTrackPiece):
2127         (WebCore::ScrollbarThemeWin::paintButton):
2128         (WebCore::paintGripper):
2129         (WebCore::ScrollbarThemeWin::paintThumb):
2130         * platform/win/ScrollbarThemeWin.h:
2131         * rendering/RenderScrollbar.h:
2132         (isType):
2133         * rendering/RenderScrollbarPart.cpp:
2134         (WebCore::RenderScrollbarPart::styleDidChange):
2135         (WebCore::RenderScrollbarPart::imageChanged):
2136         * rendering/RenderScrollbarTheme.cpp:
2137         (WebCore::RenderScrollbarTheme::buttonSizesAlongTrackAxis):
2138         (WebCore::RenderScrollbarTheme::hasButtons):
2139         (WebCore::RenderScrollbarTheme::hasThumb):
2140         (WebCore::RenderScrollbarTheme::minimumThumbLength):
2141         (WebCore::RenderScrollbarTheme::backButtonRect):
2142         (WebCore::RenderScrollbarTheme::forwardButtonRect):
2143         (WebCore::RenderScrollbarTheme::trackRect):
2144         (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
2145         (WebCore::RenderScrollbarTheme::willPaintScrollbar):
2146         (WebCore::RenderScrollbarTheme::didPaintScrollbar):
2147         (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
2148         (WebCore::RenderScrollbarTheme::paintTrackBackground):
2149         (WebCore::RenderScrollbarTheme::paintTrackPiece):
2150         (WebCore::RenderScrollbarTheme::paintButton):
2151         (WebCore::RenderScrollbarTheme::paintThumb):
2152         (WebCore::RenderScrollbarTheme::paintTickmarks):
2153         * rendering/RenderScrollbarTheme.h:
2154
2155 2015-06-24  Matt Rajca  <mrajca@apple.com>
2156
2157         MediaSession: fall back to "content" kind when an unsupported media session kind is passed in
2158         https://bugs.webkit.org/show_bug.cgi?id=146293
2159
2160         Reviewed by Eric Carlson.
2161
2162         * Modules/mediasession/MediaSession.cpp:
2163         (WebCore::MediaSession::parseKind): Parse the media session kind to one of the four supported types.
2164         (WebCore::MediaSession::MediaSession):
2165         (WebCore::MediaSession::kind): Format the value as a string (which the JS bindings expect).
2166         * Modules/mediasession/MediaSession.h: The media session kind is now stored as an enum rather than a string
2167           since we only support a small, fixed number of values.
2168
2169 2015-06-25  Eric Carlson  <eric.carlson@apple.com>
2170
2171         [Mac] Crash in WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget
2172         https://bugs.webkit.org/show_bug.cgi?id=146317
2173
2174         Reviewed by Brent Fulgham.
2175
2176         * html/HTMLMediaElement.cpp:
2177         (WebCore::HTMLMediaElement::mediaState): NULL-check m_player before using it.
2178
2179 2015-06-25  Commit Queue  <commit-queue@webkit.org>
2180
2181         Unreviewed, rolling out r185956.
2182         https://bugs.webkit.org/show_bug.cgi?id=146321
2183
2184         Causes massive crashes on test bots (Requested by bfulgham on
2185         #webkit).
2186
2187         Reverted changeset:
2188
2189         "Enabling MEDIA_STREAM"
2190         https://bugs.webkit.org/show_bug.cgi?id=145947
2191         http://trac.webkit.org/changeset/185956
2192
2193 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
2194
2195         [Win] Update MediaPlayerPrivateAVFoundationCF::supportsType
2196         https://bugs.webkit.org/show_bug.cgi?id=146302
2197         <rdar://problem/19726553>
2198
2199         Reviewed by Eric Carlson.
2200
2201         Tested by existing media tests.
2202
2203         Update the AVFoundationCF version of 'supportsType' to more closely match the AVFoundation
2204         version. Use this new code when the necessary AVFoundationCF functions are present.
2205
2206         * AVFoundationSupport.py: Check for presence of AVCFURLAssetIsPlayableExtendedMIMEType.
2207         (fileContains): Added helper function.
2208         * WebCore.vcxproj/WebCoreGenerated.vcxproj: Add AVFoundationSupport.py to project file to make
2209         maintenance easier.
2210         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters: Ditto.
2211         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2212         (WebCore::MediaPlayerPrivateAVFoundation::isUnsupportedMIMEType): Moved from ObjC version.
2213         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList): Ditto.
2214         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2215         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add missing declaration.
2216         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2217         (WebCore::avfMIMETypes): Added CF version of AVFoundation code.
2218         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType): Update to use new AVCF
2219         method if it is available.
2220         (WebCore::MediaPlayerPrivateAVFoundationCF::languageOfPrimaryAudioTrack): Handle case of a
2221         null language locale. This is a drive-by fix of a bug found during testing.
2222         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2223         (WebCore::isUnsupportedMIMEType): Deleted.
2224         (WebCore::staticMIMETypeList): Deleted.
2225
2226 2015-06-25  Matthew Daiter  <mdaiter@apple.com>
2227
2228         Enabling MEDIA_STREAM
2229         https://bugs.webkit.org/show_bug.cgi?id=145947
2230         <rdar://problem/21365829>
2231
2232         Reviewed by Brent Fulgham.
2233
2234         * Configurations/FeatureDefines.xcconfig:
2235         * Modules/mediastream/UserMediaClient.h:
2236         * WebCore.xcodeproj/project.pbxproj:
2237         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2238         * platform/mock/UserMediaClientMock.h:
2239
2240 2015-06-25  Zalan Bujtas  <zalan@apple.com>
2241
2242         Do not send touch events to the slider's thumb when it does not have a renderer.
2243         https://bugs.webkit.org/show_bug.cgi?id=146307
2244         rdar://problem/21539399
2245
2246         Reviewed by Simon Fraser.
2247
2248         Bail out early if either the touch target or the renderer() is null.
2249
2250         Test: fast/events/touch/input-range-with-thumb-display-none-crash.html
2251
2252         * html/shadow/SliderThumbElement.cpp:
2253         (WebCore::findTouchWithIdentifier):
2254         (WebCore::SliderThumbElement::handleTouchStart):
2255         (WebCore::SliderThumbElement::handleTouchMove):
2256         (WebCore::SliderThumbElement::handleTouchEndAndCancel):
2257
2258 2015-06-25  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2259
2260         [Streams API] Implement HighWaterMark
2261         https://bugs.webkit.org/show_bug.cgi?id=146235
2262
2263         Reviewed by Darin Adler.
2264
2265         Retrieval of HighWaterMark parameter from arguments passed to the ReadableStream JS constructor.
2266         Retrieval of size function callback from arguments passed to the ReadableStream JS constructor.
2267         Calling doPull() if buffer size is below HighWaterMark.
2268
2269         Covered by rebased tests.
2270
2271         * Modules/streams/ReadableStream.cpp:
2272         (WebCore::ReadableStream::pull): Adding precise check for HWM.
2273         * Modules/streams/ReadableStream.h: Introducing hasEnoughValues.
2274         * bindings/js/ReadableJSStream.cpp:
2275         (WebCore::getHighWaterMark): Utility routine to get properly HWM value.
2276         (WebCore::ReadableJSStream::create): Retrieval of HWM and size function.
2277         (WebCore::ReadableJSStream::ReadableJSStream):
2278         * bindings/js/ReadableJSStream.h: Adding hasEnoughValues and desiredSize prototypes.
2279
2280 2015-06-25  Tim Horton  <timothy_horton@apple.com>
2281
2282         Try to fix the iOS EWS build.
2283
2284         * platform/spi/cocoa/SecuritySPI.h:
2285
2286 2015-06-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2287
2288         [GTK] Empty gtk-font-name setting causes WebProcess crash rendering pages
2289         https://bugs.webkit.org/show_bug.cgi?id=146246
2290
2291         Reviewed by Sergio Villar Senin.
2292
2293         Return early if system font is empty.
2294
2295         * rendering/RenderThemeGtk.cpp:
2296         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription):
2297
2298 2015-06-24  Chris Dumez  <cdumez@apple.com>
2299
2300         Unreviewed, EFL build fix after r185940.
2301
2302         Members were initialized in wrong order.
2303
2304         * Modules/mediastream/MediaDeviceInfo.cpp:
2305         (WebCore::MediaDeviceInfo::MediaDeviceInfo):
2306
2307 2015-06-24  Chris Dumez  <cdumez@apple.com>
2308
2309         Unreviewed, Build fix after r185940.
2310
2311         Move implementation inside WebCore namespace.
2312
2313         * Modules/mediastream/MediaDeviceInfo.cpp:
2314
2315 2015-06-24  Chris Dumez  <cdumez@apple.com>
2316
2317         Unreviewed, speculative GTK build fix after 185940.
2318
2319         Add new cpp file to CMakeLists.txt.
2320
2321         * CMakeLists.txt:
2322
2323 2015-06-24  Matt Daiter  <mdaiter@apple.com>
2324
2325         Building MediaDeviceInfo for enumerateDevices
2326         https://bugs.webkit.org/show_bug.cgi?id=146257
2327         <rdar://problem/21513462>
2328
2329         Reviewed by Eric Carlson.
2330
2331         MediaDeviceInfo necessary for enumerateDevices
2332
2333         * CMakeLists.txt: Added MediaDevicesInfo.idl
2334         * DerivedSources.make: Added MediaDevicesInfo.idl
2335         * Modules/mediastream/MediaDeviceInfo.h: Created class for MediaDevicesInfo
2336         (WebCore::MediaDeviceInfo::create): Allocates class
2337         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Creates class for public
2338         (WebCore::MediaDeviceInfo::~MediaDeviceInfo): 
2339         (WebCore::MediaDeviceInfo::label):
2340         (WebCore::MediaDeviceInfo::deviceId):
2341         (WebCore::MediaDeviceInfo::groupId):
2342         (WebCore::MediaDeviceInfo::kind):
2343         * Modules/mediastream/MediaDeviceInfo.idl:
2344         * WebCore.xcodeproj/project.pbxproj:
2345
2346 2015-06-24  Anders Carlsson  <andersca@apple.com>
2347
2348         Detect view services by using the "com.apple.UIKit.vends-view-services" entitlement
2349         https://bugs.webkit.org/show_bug.cgi?id=146301
2350
2351         Reviewed by Tim Horton.
2352
2353         * WebCore.xcodeproj/project.pbxproj:
2354         * platform/spi/cocoa/SecuritySPI.h:
2355
2356 2015-06-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
2357
2358         Add a new color -apple-wireless-playback-target-active
2359         https://bugs.webkit.org/show_bug.cgi?id=146269
2360         <rdar://problem/21465189>
2361
2362         Reviewed by Dean Jackson.
2363
2364         At the moment we use -apple-system-blue to indicate an Airplay route is
2365         active. This might not always be blue, so we need to add another system
2366         color with a name that will allow us to change the underlying color.
2367         Initially -apple-wireless-playback-target-active will be an alias to
2368         -apple-system-blue.
2369
2370         Existing tests are modified to include the new color value.
2371
2372         * Modules/mediacontrols/mediaControlsApple.js:
2373         (Controller.prototype.updateWirelessTargetPickerButton):
2374         * Modules/mediacontrols/mediaControlsiOS.css:
2375         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
2376         Use the new color value in the media controls.
2377         
2378         * css/CSSParser.cpp:
2379         (WebCore::isAppleLegacyCssValueKeyword): Returns true if the value keyword
2380         has an '-apple' prefix which has to be replaced by '-webkit'
2381         
2382         (WebCore::cssValueKeywordID): Call a new function which handles all the
2383         '-apple' legacy keywords.
2384         
2385         * css/CSSValueKeywords.in: Define the new color keyword.
2386         
2387         * rendering/RenderThemeIOS.mm:
2388         (WebCore::RenderThemeIOS::systemColor):
2389         * rendering/RenderThemeMac.mm:
2390         (WebCore::RenderThemeMac::systemColor):
2391         Define the value of the new color keyword to be an alias of systemBlueColor.
2392
2393 2015-06-24  Matt Rajca  <mrajca@apple.com>
2394
2395         MediaSession: propagate MediaSessionMetadata to WebPageProxy
2396         https://bugs.webkit.org/show_bug.cgi?id=146282
2397
2398         Reviewed by Darin Adler and Tim Horton.
2399
2400         * Modules/mediasession/MediaSession.cpp:
2401         (WebCore::MediaSession::setMetadata):
2402
2403 2015-06-24  Chris Dumez  <cdumez@apple.com>
2404
2405         Null dereference in DocumentLoader::areAllLoadersPageCacheAcceptable()
2406         https://bugs.webkit.org/show_bug.cgi?id=146286
2407         <rdar://problem/21523788>
2408
2409         Reviewed by Sam Weinig.
2410
2411         Add null check for the Page in areAllLoadersPageCacheAcceptable()
2412         to fix this top crasher until I can investigate how this can happen.
2413
2414         * loader/DocumentLoader.cpp:
2415         (WebCore::areAllLoadersPageCacheAcceptable):
2416
2417 2015-06-24  Anders Carlsson  <andersca@apple.com>
2418
2419         Move PluginMainThreadScheduler to WebKit/win
2420         https://bugs.webkit.org/show_bug.cgi?id=146289
2421
2422         Reviewed by Tim Horton.
2423
2424         * CMakeLists.txt:
2425         * Configurations/WebCore.xcconfig:
2426         * WebCore.vcxproj/WebCore.vcxproj:
2427         * WebCore.vcxproj/WebCore.vcxproj.filters:
2428         * WebCore.xcodeproj/project.pbxproj:
2429         * plugins/PluginMainThreadScheduler.cpp:
2430         (WebCore::PluginMainThreadScheduler::scheduler): Deleted.
2431         (WebCore::PluginMainThreadScheduler::PluginMainThreadScheduler): Deleted.
2432         (WebCore::PluginMainThreadScheduler::scheduleCall): Deleted.
2433         (WebCore::PluginMainThreadScheduler::registerPlugin): Deleted.
2434         (WebCore::PluginMainThreadScheduler::unregisterPlugin): Deleted.
2435         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Deleted.
2436         (WebCore::PluginMainThreadScheduler::dispatchCalls): Deleted.
2437         (WebCore::PluginMainThreadScheduler::mainThreadCallback): Deleted.
2438         * plugins/PluginMainThreadScheduler.h:
2439         (WebCore::PluginMainThreadScheduler::Call::Call): Deleted.
2440         (WebCore::PluginMainThreadScheduler::Call::performCall): Deleted.
2441
2442 2015-06-24  Dean Jackson  <dino@apple.com>
2443
2444         Better fix for Element with blur backdrop-filter shows edge duplication and dark edges
2445         https://bugs.webkit.org/show_bug.cgi?id=146287
2446         <rdar://problem/21530437>
2447
2448         Reviewed by Simon Fraser.
2449
2450         There is no need to carry around a bit in FilterOperations indicating what
2451         type of source property the object came from. Whether or not to clip to the
2452         bounds of the filter region is purely a property of the type of CALayer
2453         we are applying the filter to.
2454
2455         This basically reverts r185846.
2456
2457         Covered by the test for the previous commit.
2458
2459         * css/CSSPropertyNames.in:
2460         * css/StyleBuilderConverter.h:
2461         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): Deleted.
2462         * page/animation/CSSPropertyAnimation.cpp:
2463         (WebCore::blendFilterOperations): Deleted.
2464         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Set the normalized
2465         edges property if we are a CABackdropLayer.
2466         * platform/graphics/filters/FilterOperations.cpp:
2467         (WebCore::FilterOperations::operator==):
2468         (WebCore::FilterOperations::operationsMatch):
2469         (WebCore::FilterOperations::operator=): Deleted.
2470         * platform/graphics/filters/FilterOperations.h:
2471         (WebCore::FilterOperations::isUsedForBackdropFilters): Deleted.
2472         (WebCore::FilterOperations::setUsedForBackdropFilters): Deleted.
2473
2474 2015-06-24  Doug Russell  <d_russell@apple.com>
2475
2476         Bug 146177 - AX: AXObjectCache should try to use an unignored accessibilityObject 
2477         when posting a selection notification when on the border between two accessibilityObjects
2478         https://bugs.webkit.org/show_bug.cgi?id=146177
2479
2480         Reviewed by Darin Adler.
2481
2482         Add support for position to be passed for selection changes to allow checking.
2483         for boundaries in the case of ignored elements.
2484         Add support for searching for unignored siblings of AccessibilityObjects.
2485         Include AccessibilityObject wrappers in notifications for tests.
2486
2487         Test: platform/mac/accessibility/selection-element-tabbing-to-link.html
2488
2489         * accessibility/AXObjectCache.cpp:
2490         (WebCore::AXObjectCache::postTextStateChangeNotification):
2491         * accessibility/AXObjectCache.h:
2492         * accessibility/AccessibilityObject.cpp:
2493         (WebCore::AccessibilityObject::previousSiblingUnignored):
2494         (WebCore::AccessibilityObject::nextSiblingUnignored):
2495         * accessibility/AccessibilityObject.h:
2496         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2497         (isValueTypeSupported):
2498         (arrayRemovingNonSupportedTypes):
2499         (dictionaryRemovingNonSupportedTypes):
2500         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
2501         * editing/mac/FrameSelectionMac.mm:
2502         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2503
2504 2015-06-24  Anders Carlsson  <andersca@apple.com>
2505
2506         Enable -Winconsistent-missing-override when building with Xcode
2507         https://bugs.webkit.org/show_bug.cgi?id=146288
2508
2509         Reviewed by Sam Weinig.
2510
2511         * Configurations/Base.xcconfig:
2512         * Modules/encryptedmedia/MediaKeySession.h:
2513         * Modules/webdatabase/DatabaseTask.h:
2514         * html/DateTimeLocalInputType.h:
2515         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
2516         * page/scrolling/mac/ScrollingCoordinatorMac.h:
2517         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2518         (WebCore::MediaPlayerPrivateAVFoundation::platformLayer): Deleted.
2519         (WebCore::MediaPlayerPrivateAVFoundation::supportsScanning): Deleted.
2520         (WebCore::MediaPlayerPrivateAVFoundation::fileSize): Deleted.
2521         (WebCore::MediaPlayerPrivateAVFoundation::engineDescription): Deleted.
2522         (WebCore::MediaPlayerPrivateAVFoundation::platformErrorCode): Deleted.
2523         (WebCore::MediaPlayerPrivateAVFoundation::notifyTrackModeChanged): Deleted.
2524         * platform/graphics/avfoundation/VideoTrackPrivateAVF.h:
2525         (WebCore::VideoTrackPrivateAVF::trackIndex): Deleted.
2526         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
2527         (WebCore::CDMSessionAVFoundationObjC::type): Deleted.
2528         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2529         (WebCore::CDMSessionMediaSourceAVFObjC::type): Deleted.
2530         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2531         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsAcceleratedRendering): Deleted.
2532         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget): Deleted.
2533         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2534         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): Deleted.
2535         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToContinueWithoutCredential): Deleted.
2536         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCancellation): Deleted.
2537         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToPerformDefaultHandling): Deleted.
2538         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedChallengeRejection): Deleted.
2539         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2540         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Deleted.
2541         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2542         (WebCore::MediaPlayerPrivateQTKit::supportsScanning): Deleted.
2543         (WebCore::MediaPlayerPrivateQTKit::networkState): Deleted.
2544         (WebCore::MediaPlayerPrivateQTKit::readyState): Deleted.
2545         (WebCore::MediaPlayerPrivateQTKit::maximumDurationToCacheMediaTime): Deleted.
2546         (WebCore::MediaPlayerPrivateQTKit::engineDescription): Deleted.
2547         * platform/mac/ScrollAnimatorMac.h:
2548         * platform/mac/SerializedPlatformRepresentationMac.h:
2549         (WebCore::SerializedPlatformRepresentationMac::platformType): Deleted.
2550         * platform/mac/ThemeMac.h:
2551         (WebCore::ThemeMac::controlRequiresPreWhiteSpace): Deleted.
2552         * testing/MockCDM.cpp:
2553         (WebCore::MockCDMSession::setClient): Deleted.
2554
2555 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2556
2557         Improve JSDOMPromise callPromiseFunction naming
2558         https://bugs.webkit.org/show_bug.cgi?id=146280
2559
2560         Unreviewed.
2561
2562         No change in behavior.
2563
2564         * bindings/js/JSDOMPromise.h:
2565         (WebCore::callPromiseFunction):
2566
2567 2015-06-24  Tim Horton  <timothy_horton@apple.com>
2568
2569         REGRESSION (r185804): Crash selecting time in the form on https://backup.brighthorizons.com/BackupCareRequest.aspx
2570         <rdar://problem/21525376>
2571
2572         Reviewed by Sam Weinig.
2573
2574         * page/TextIndicator.cpp:
2575         (WebCore::TextIndicator::createWithRange):
2576         Null check.
2577
2578 2015-06-24  Zalan Bujtas  <zalan@apple.com>
2579
2580         Subpixel rendering: roundToDevicePixel() snaps to wrong value.
2581         https://bugs.webkit.org/show_bug.cgi?id=146273
2582         rdar://problem/18509840
2583
2584         Reviewed by Simon Fraser.
2585
2586         Due to the floating point approximate representation, we can't always produce
2587         the correct snap value. This patch addresses the issue by removing redundant kFixedPointDenominator multiplication
2588         and by changing the rounding in roundToDevicePixel() from float to double.
2589
2590         API test is added.
2591
2592         * platform/LayoutUnit.h:
2593         (WebCore::roundToDevicePixel):
2594
2595 2015-06-23  Matt Rajca  <mrajca@apple.com>
2596
2597         MediaSession: Support setting of metadata
2598         https://bugs.webkit.org/show_bug.cgi?id=146253
2599
2600         Reviewed by Eric Carlson.
2601
2602         * Modules/mediasession/MediaSession.cpp:
2603         (WebCore::MediaSession::MediaSession): Store a reference to the document so we can use it in setMetadata.
2604         (WebCore::MediaSession::setMetadata): Implemented as described in the Media Session spec.
2605         * Modules/mediasession/MediaSession.h:
2606         * Modules/mediasession/MediaSession.idl: Added the setMetadata method.
2607         * Modules/mediasession/MediaSessionMetadata.h:
2608         (WebCore::MediaSessionMetadata::MediaSessionMetadata): Added to keep track of media session metadata.
2609         (WebCore::MediaSessionMetadata::title):
2610         (WebCore::MediaSessionMetadata::artist):
2611         (WebCore::MediaSessionMetadata::album):
2612         (WebCore::MediaSessionMetadata::artworkURL):
2613         * WebCore.xcodeproj/project.pbxproj: Added MediaSessionMetadata.h.
2614
2615 2015-06-24  Daniel Bates  <dabates@apple.com>
2616
2617         Content Security Policy error message when frame load is blocked does not read well
2618         https://bugs.webkit.org/show_bug.cgi?id=146279
2619
2620         Reviewed by Csaba Osztrogonác.
2621
2622         Substitute "Refused to load frame" for "Refused to frame" as the prefix of the error message
2623         emitted when the Content Security Policy of the page blocks a frame load.
2624
2625         * page/ContentSecurityPolicy.cpp:
2626         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
2627
2628 2015-06-11  Sergio Villar Senin  <svillar@igalia.com>
2629
2630         intrinsic size keywords don't work for heights
2631         https://bugs.webkit.org/show_bug.cgi?id=113610
2632
2633         Reviewed by Darin Adler.
2634
2635         Based on Blink's r148314 & r150355 by <cbiesinger@chromium.org>.
2636
2637         Adds intrinsic values support to heigh & min/max-height. This involves the
2638         following changes:
2639         - RenderBox needs to pass the content height through to computeLogicalHeight and
2640         related functions, which needs it to resolve max-content, et. al.
2641         - Make the callers pass the content height to this function. Some callers pass
2642         logicalHeight() (adjusted for border/padding) which works because if
2643         logicalHeight is not the content height, then it is the height we ended up using,
2644         so the constrain* functions will just constrain to that value again.
2645         - Parsing code needs to be adjusted to support intrinsic values for heights.
2646
2647         Tests: fast/css-intrinsic-dimensions/height-css-tables-collapsed.html
2648                fast/css-intrinsic-dimensions/height-css-tables.html
2649                fast/css-intrinsic-dimensions/height-flexbox.html
2650                fast/css-intrinsic-dimensions/height-positioned-replaced.html
2651                fast/css-intrinsic-dimensions/height-positioned.html
2652                fast/css-intrinsic-dimensions/height-replaced.html
2653                fast/css-intrinsic-dimensions/height-tables-collapsed.html
2654                fast/css-intrinsic-dimensions/height-tables.html
2655                fast/css-intrinsic-dimensions/height.html
2656
2657         * css/CSSParser.cpp:
2658         (WebCore::CSSParser::isValidSize): Refactored from validateWidth and
2659         validateHeight.
2660         (WebCore::CSSParser::parseValue):
2661         (WebCore::CSSParser::validateWidth): Deleted.
2662         (WebCore::CSSParser::validateHeight): Deleted.
2663         * css/CSSParser.h:
2664         * platform/Length.h:
2665         (WebCore::Length::isFillAvailable):
2666         (WebCore::Length::isFitContent):
2667         * rendering/RenderBox.cpp:
2668         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
2669         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
2670         (WebCore::RenderBox::computeLogicalHeight):
2671         (WebCore::RenderBox::computeLogicalHeightUsing):
2672         (WebCore::RenderBox::computeContentLogicalHeight):
2673         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
2674         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2675         (WebCore::RenderBox::computePercentageLogicalHeight):
2676         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2677         (WebCore::RenderBox::availableLogicalHeight):
2678         (WebCore::RenderBox::availableLogicalHeightUsing):
2679         (WebCore::RenderBox::computePositionedLogicalHeight):
2680         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2681         * rendering/RenderBox.h:
2682         * rendering/RenderFlexibleBox.cpp:
2683         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2684         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
2685         * rendering/RenderFlowThread.cpp:
2686         (WebCore::RenderFlowThread::addForcedRegionBreak):
2687         * rendering/RenderGrid.cpp:
2688         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2689         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
2690         * rendering/RenderMultiColumnSet.cpp:
2691         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2692         * rendering/RenderReplaced.cpp:
2693         (WebCore::RenderReplaced::hasReplacedLogicalHeight):
2694         * rendering/RenderTable.cpp:
2695         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
2696         (WebCore::RenderTable::layout):
2697
2698 2015-06-24  Commit Queue  <commit-queue@webkit.org>
2699
2700         Unreviewed, rolling out r185906.
2701         https://bugs.webkit.org/show_bug.cgi?id=146276
2702
2703         MSVC doesn't yet provide a const-qualified std::array<T,
2704         N>::size(), failing to compile the static_assert (Requested by
2705         zdobersek on #webkit).
2706
2707         Reverted changeset:
2708
2709         "Improve the source code generated by make_names.pl"
2710         https://bugs.webkit.org/show_bug.cgi?id=146208
2711         http://trac.webkit.org/changeset/185906
2712
2713 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
2714
2715         Improve the source code generated by make_names.pl
2716         https://bugs.webkit.org/show_bug.cgi?id=146208
2717
2718         Reviewed by Darin Adler.
2719
2720         Clean up and optimize the output that's generated by the make_names.pl script
2721         when generating large sets of DOM names for attributes and tags.
2722
2723         The GenerateStrings() function in the StaticString.pm module is split into
2724         GenerateStringData() and GenerateASCIILiteral() so that the two new functions
2725         can be used independently, with the original function still being called when
2726         generating font names.
2727
2728         Tags and attributes have the corresponding static QualifiedName globals defined
2729         as before. After that, two static const std::array<> objects are defined for
2730         both types -- the first is an ordered array of addresses of the QualifiedName
2731         objects (corresponding to the C array that was defined in getHTMLTags(),
2732         getSVGAttrs() etc.), and the second is an ordered array of StringImpl::StaticASCIILiteral
2733         objects that replaces separately defined StringImpl::StaticASCIILiteral objects
2734         and the additional tables that contained pairs of QualifiedName object addresses
2735         and the corresponding StaticASCIILiteral object references in the init() function.
2736         This is all generated by the printStaticData() function in make_names.pl.
2737
2738         The printQualifiedNameCreation() function generates a static_assert() that ensures
2739         that the corresponding std::array<QualifiedName*> and std::array<StaticASCIILiteral>
2740         objects have the same amount of items, and then sets up a loop that walks through
2741         the two arrays and properly constructs the QualifiedName objects from the static
2742         literal data.
2743
2744         On the GTK port, this shaves off ~54kB from the final stripped shared library
2745         on a 64-bit build, and ~21kB on a 32-bit build.
2746
2747         * bindings/scripts/StaticString.pm:
2748         (GenerateStringData):
2749         (GenerateASCIILiteral):
2750         (GenerateStrings):
2751         * dom/make_names.pl:
2752         (printCppHead):
2753         (printNamesCppFile):
2754         (printStaticData):
2755         (printQualifiedNameCreation):
2756         (printInit): Deleted.
2757         (printDefinitions): Deleted.
2758
2759 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2760
2761         Refactor UserMediaRequest to share more codes between MediaDevices.getUserMedia and legacy webkitGetUserMedia
2762         https://bugs.webkit.org/show_bug.cgi?id=146237
2763
2764         Reviewed by Darin Adler.
2765
2766         Covered by existing tests, no change in behavior.
2767
2768         * Modules/mediastream/MediaConstraintsImpl.cpp:
2769         (WebCore::MediaConstraintsImpl::create): Simplified error handling by removing exception code parameter.
2770         * Modules/mediastream/MediaConstraintsImpl.h: Ditto.
2771         * Modules/mediastream/MediaDevices.cpp:
2772         (WebCore::MediaDevices::getUserMedia): Removed code now in UserMediaRequest::start.
2773         * Modules/mediastream/NavigatorUserMedia.cpp:
2774         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Ditto.
2775         * Modules/mediastream/UserMediaRequest.cpp:
2776         (WebCore::parseOptions): Simplified error handling by removing exception code parameter.
2777         (WebCore::UserMediaRequest::start): Renamed create in start and added common code.
2778         * Modules/mediastream/UserMediaRequest.h:
2779
2780 2015-06-23  Andreas Kling  <akling@apple.com>
2781
2782         Should reduce tile coverage for the first paint after a tab switch.
2783         <https://webkit.org/b/146252>
2784         <rdar://problem/19821583>
2785
2786         Reviewed by Darin Adler.
2787
2788         Reduce the number of tiles we need to paint after switching tabs,
2789         to shorten the time it takes before we can flush pixels to screen.
2790
2791         We accomplish this by piggybacking on the "speculative tiling enabled"
2792         mode of FrameView, which was previously only used to throttle painting
2793         and layer flushes during page load.
2794
2795         When a FrameView becomes visible, which is what happens when you
2796         switch to its tab, we revert the speculative tiling optimization to
2797         its initial state, and reset the "scrolled by user" flag.
2798
2799         In practice this means that after switching tabs, we only generate
2800         enough tiles to fill the viewport. Then, after 500ms has passed
2801         or the user scrolls the page, we go back to the usual speculative
2802         tiling mode.
2803
2804         * page/FrameView.cpp:
2805         (WebCore::FrameView::show):
2806
2807 2015-06-23  Anders Carlsson  <andersca@apple.com>
2808
2809         Remove windowResizerRect code, nobody is using it anymore
2810         https://bugs.webkit.org/show_bug.cgi?id=146265
2811
2812         Reviewed by Beth Dakin.
2813
2814         * loader/EmptyClients.h:
2815         * page/Chrome.cpp:
2816         (WebCore::Chrome::windowResizerRect): Deleted.
2817         * page/Chrome.h:
2818         * page/ChromeClient.h:
2819         * page/FrameView.cpp:
2820         (WebCore::FrameView::windowResizerRect): Deleted.
2821         * page/FrameView.h:
2822         * platform/ScrollView.cpp:
2823         (WebCore::ScrollView::ScrollView): Deleted.
2824         (WebCore::ScrollView::windowResizerRectChanged): Deleted.
2825         (WebCore::ScrollView::containsScrollbarsAvoidingResizer): Deleted.
2826         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount): Deleted.
2827         (WebCore::ScrollView::setParent): Deleted.
2828         * platform/ScrollView.h:
2829         (WebCore::ScrollView::windowResizerRect): Deleted.
2830         * platform/Scrollbar.cpp:
2831         (WebCore::Scrollbar::Scrollbar): Deleted.
2832         (WebCore::Scrollbar::setFrameRect): Deleted.
2833         (WebCore::Scrollbar::setParent): Deleted.
2834         * platform/Scrollbar.h:
2835
2836 2015-06-23  Dean Jackson  <dino@apple.com>
2837
2838         Media controls are missing the white backdrop in UIWebViews
2839         https://bugs.webkit.org/show_bug.cgi?id=146251
2840         <rdar://problem/20181345>
2841
2842         Reviewed by Simon Fraser.
2843
2844         Implement two new CALayer subclasses that explicitly set
2845         something that resembles the system appearance for
2846         media-controls-dark-bar-background and media-controls-light-bar-background.
2847         This way, WebKit1 clients get a visible result.
2848
2849         Creating the actual system recipes is tracked by:
2850         https://bugs.webkit.org/show_bug.cgi?id=146250
2851
2852         * WebCore.xcodeproj/project.pbxproj: Add new files.
2853         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2854         (PlatformCALayerCocoa::PlatformCALayerCocoa): Use the new CALayer subclasses for
2855         the appropriate layer types.
2856         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h: Added.
2857         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm: Added.
2858         (-[WebLightSystemBackdropLayer init]):
2859         (-[WebLightSystemBackdropLayer setBackgroundColor:]): Only set to a light grey.
2860         (-[WebDarkSystemBackdropLayer init]):
2861         (-[WebDarkSystemBackdropLayer setBackgroundColor:]): Only set to a dark grey.
2862
2863 2015-06-18  Matt Rajca  <mrajca@apple.com>
2864
2865         Support releasing media sessions
2866         https://bugs.webkit.org/show_bug.cgi?id=146132
2867
2868         Reviewed by Darin Adler.
2869
2870         * Modules/mediasession/MediaSession.cpp: Implemented as described in the Media Session spec.
2871         (WebCore::MediaSession::releaseSession):
2872         (WebCore::MediaSession::releaseInternal):
2873         * Modules/mediasession/MediaSession.h:
2874
2875 2015-06-23  Chris Fleizach  <cfleizach@apple.com>
2876
2877         AX: iOS: VoiceOver and ARIA: has popup property not announced
2878         https://bugs.webkit.org/show_bug.cgi?id=146188
2879
2880         Reviewed by Darin Adler.
2881
2882         Expose the existing "has popup" property to the iOS Accessibility API.
2883
2884         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2885         (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
2886
2887 2015-06-23  Javier Fernandez  <jfernandez@igalia.com>
2888
2889         [CSS Grid Layout] Performance optimization: avoid computing overflow alignment if not needed
2890         https://bugs.webkit.org/show_bug.cgi?id=146231
2891
2892         Reviewed by Sergio Villar Senin.
2893
2894         We don't need to apply any overflow handling if alignment value don't have a potential
2895         risk of data loss, as it's the case of 'start' value.
2896
2897         This patch avoid computing the overflow in all the cases, since it adds an unneeded
2898         overhead which affects performance.
2899
2900         New code improves performance around 3%-8%, depending on the grid tests.
2901
2902         No new tests, no new funcitonality.
2903
2904         * rendering/RenderGrid.cpp:
2905         (WebCore::RenderGrid::rowPositionForChild):
2906         (WebCore::RenderGrid::columnPositionForChild):
2907
2908 2015-06-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2909
2910         MediaDevices.getUserMedia should migrate from callbacks to DOMPromise
2911         https://bugs.webkit.org/show_bug.cgi?id=146200
2912
2913         Reviewed by Darin Adler.
2914
2915         Introduced DOMPromiseWithCallback to resolve/reject promises while allowing promise clients to use a typed callback approach.
2916         Migrated MediaDevices.getUserMedia from callbacks to DOMPromiseWithCallback.
2917         Removed MediaDevices.getUserMedia custom binding.
2918
2919         Covered by existing tests.
2920
2921         * CMakeLists.txt: Removing custom binding.
2922         * Modules/mediastream/MediaDevices.cpp:
2923         (WebCore::MediaDevices::getUserMedia): Moving from callback to promise.
2924         * Modules/mediastream/MediaDevices.h: Ditto.
2925         * Modules/mediastream/MediaDevices.idl: Removing custom binding.
2926         * Modules/mediastream/NavigatorUserMedia.cpp:
2927         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Converting from promise callback to API callbacks.
2928         * Modules/mediastream/UserMediaRequest.cpp:
2929         (WebCore::UserMediaRequest::create): Moving from callback to promise.
2930         (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
2931         (WebCore::UserMediaRequest::didCreateStream): Ditto.
2932         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Ditto.
2933         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Ditto.
2934         * Modules/mediastream/UserMediaRequest.h: Ditto.
2935         * bindings/js/JSDOMPromise.h: Introducing DOMPromiseWithCallback and removing crypto specific header.
2936         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback):
2937         (WebCore::Error>::resolve):
2938         (WebCore::Error>::reject):
2939         * bindings/js/JSMediaDevicesCustom.cpp: Removed.
2940         * bindings/js/JSSubtleCryptoCustom.cpp: Updating headers.
2941
2942 2015-06-23  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2943
2944         [Streams API] Implement ReadableStream js source "'cancel" callback
2945         https://bugs.webkit.org/show_bug.cgi?id=146204
2946
2947         Reviewed by Darin Adler.
2948
2949         Calling "cancel" JS function when web app is cancelling a JS readable stream.
2950         Handling of promise returned value in case of async cancel.
2951
2952         Covered by rebased tests.
2953
2954         * bindings/js/ReadableJSStream.cpp:
2955         (WebCore::ReadableJSStream::invoke): Refactoring to pass cancel reason or controller to the JS function.
2956         (WebCore::ReadableJSStream::doStart): Ditto.
2957         (WebCore::startReadableStreamAsync): Renaming readableStream as protectedStream.
2958         (WebCore::createPullResultFulfilledFunction): Ditto.
2959         (WebCore::ReadableJSStream::doPull): Refactoring to pass cancel reason or controller to the JS function.
2960         (WebCore::createCancelResultFulfilledFunction): Cancel promise fullfil callback.
2961         (WebCore::createCancelResultRejectedFunction): Cancel promise reject callback.
2962         (WebCore::ReadableJSStream::doCancel): Calling cancel JS callback and handling promise returned value.
2963         * bindings/js/ReadableJSStream.h: Refactoring to pass cancel reason or controller to the JS function.
2964
2965 2015-06-22  Ryuan Choi  <ryuan.choi@navercorp.com>
2966
2967         [EFL] Hyphenation is not supported
2968         https://bugs.webkit.org/show_bug.cgi?id=89830
2969
2970         Reviewed by Gyuyoung Kim.
2971
2972         Share libHyphen backend of GTK port.
2973
2974         Rebased fast/text/hyphenate-*.html
2975
2976         * PlatformEfl.cmake:
2977         * PlatformGTK.cmake:
2978         * platform/efl/FileSystemEfl.cpp:
2979         (WebCore::listDirectory): Deleted because of lack of functionality.
2980         eina_file_ls returns full directory path so fnmatch fails to check dict file.
2981         This patch reuse Posix implementation instead of EFL port specific function.
2982         * platform/posix/FileSystemPOSIX.cpp: Ditto.
2983         * platform/text/gtk/HyphenationLibHyphen.cpp: Moved to platform/text/hyphen
2984         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2985         Renamed from Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp.
2986         (WebCore::scanTestDictionariesDirectoryIfNecessary):
2987         Added PLATFORM guard and EFL implementation for the test directory
2988
2989 2015-06-22  Chris Dumez  <cdumez@apple.com>
2990
2991         [WK1] WebAllowDenyPolicyListener.denyOnlyThisRequest() should not start a new permission request
2992         https://bugs.webkit.org/show_bug.cgi?id=146228
2993         <rdar://problem/15179262>
2994
2995         Reviewed by Daniel Bates.
2996
2997         Add Geolocation::resetIsAllowed() API that merely resets
2998         m_allowGeolocation to Unknown, so that we will request the permission
2999         again the next time a position is requested.
3000
3001         * Modules/geolocation/Geolocation.h:
3002         (WebCore::Geolocation::resetIsAllowed):
3003
3004 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
3005
3006         ASSERT(!m_zOrderListsDirty) when mousing over web view with incremental rendering suppressed
3007         https://bugs.webkit.org/show_bug.cgi?id=146225
3008
3009         Reviewed by Zalan Bujtas.
3010
3011         Update RenderLayer's z-order lists when hit testing. There's no guarantee that they've
3012         been updated; this happens to work most of the time because painting updates them,
3013         but if incremental rendering is suppressed, we may not have painted yet.
3014         
3015         Easy to hit on webkit.org in MiniBrowser, but I wasn't able to make a reduced testcase.
3016
3017         * rendering/RenderLayer.cpp:
3018         (WebCore::RenderLayer::hitTest):
3019         (WebCore::RenderLayer::updateLayerListsIfNeeded): Flip the order of the tests, since checking
3020         dirty bits is cheaper than calling isStackingContext().
3021
3022 2015-06-22  Dean Jackson  <dino@apple.com>
3023
3024         Rename PlatformCA*Mac to PlatformCA*Cocoa
3025         https://bugs.webkit.org/show_bug.cgi?id=146224
3026         <rdar://problem/21497182>
3027
3028         Reviewed by Simon Fraser.
3029
3030         Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
3031         to the more accurate Cocoa suffix.
3032
3033         * WebCore.xcodeproj/project.pbxproj:
3034         * page/mac/ServicesOverlayController.mm:
3035         * platform/graphics/ca/GraphicsLayerCA.cpp:
3036         * platform/graphics/ca/PlatformCAAnimation.h:
3037         * platform/graphics/ca/PlatformCALayer.h:
3038         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Renamed from Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp.
3039         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h.
3040         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm.
3041         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm.
3042         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h.
3043         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm.
3044         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h.
3045         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm.
3046         * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
3047         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
3048         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
3049         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3050         * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
3051
3052 2015-06-22  Alex Christensen  <achristensen@webkit.org>
3053
3054         [cssjit] Disable compiling scrollbar pseudoclass selectors
3055         https://bugs.webkit.org/show_bug.cgi?id=146220
3056
3057         Reviewed by Benjamin Poulain.
3058
3059         * cssjit/SelectorCompiler.cpp:
3060         (WebCore::SelectorCompiler::addScrollbarPseudoClassType):
3061         Don't compile selectors with scrollbar pseudoclasses.
3062
3063 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
3064
3065         -webkit-clip-path clips incorrectly if the element bounds go beyond the top edge of the page
3066         https://bugs.webkit.org/show_bug.cgi?id=146218
3067         rdar://problem/21127840
3068
3069         Reviewed by Zalan Bujtas.
3070
3071         The clip path is computed using the RenderLayer's bounding box, so needs to be offset
3072         by the offsetFromRenderer when set on the mask layer.
3073
3074         Test: compositing/masks/compositing-clip-path-origin.html
3075
3076         * rendering/RenderLayerBacking.cpp:
3077         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
3078
3079 2015-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3080
3081         Web sockets should be treated as active mixed content
3082         https://bugs.webkit.org/show_bug.cgi?id=140624
3083
3084         Reviewed by Sam Weinig.
3085
3086         Tests: http/tests/security/mixedContent/websocket/insecure-websocket-in-iframe.html
3087                http/tests/security/mixedContent/websocket/insecure-websocket-in-main-frame.html
3088
3089         * Modules/websockets/WebSocket.cpp:
3090         (WebCore::WebSocket::connect): Block ws:// WebSocket connections from https:// pages, and
3091         emit the onerror event after doing so.
3092         * platform/SchemeRegistry.cpp:
3093         (WebCore::secureSchemes): Add wss:// to the list of secure schemes.
3094
3095 2015-06-22  Dean Jackson  <dino@apple.com>
3096
3097         Element with blur backdrop-filter shows edge duplication and dark edges
3098         https://bugs.webkit.org/show_bug.cgi?id=146215
3099         <rdar://problem/20367695>
3100
3101         Reviewed by Tim Horton.
3102
3103         The input images to backdrop filters should duplicate their edge pixels
3104         outwards, rather than using transparent pixels. This is a flag we
3105         set on the Gaussian blur, but means we have to remember if the
3106         FilterOperations list came from a regular filter or a backdrop filter.
3107
3108         Test: css3/filters/backdrop/blur-input-bounds.html
3109
3110         * css/CSSPropertyNames.in: New custom convertor for backdrop-filter.
3111         * css/StyleBuilderConverter.h:
3112         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): New convertor
3113         that sets the backdrop flag, but is otherwise the same as a normal filter
3114         convertor.
3115         * page/animation/CSSPropertyAnimation.cpp:
3116         (WebCore::blendFilterOperations): Inherit the backdrop flag if either of our
3117         inputs has it.
3118         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Set the inputNormalizeEdges
3119         key on the CAFilter if necessary.
3120         * platform/graphics/filters/FilterOperations.cpp: Add a new flag indicating if
3121         these operations are intended for backdrops.
3122         (WebCore::FilterOperations::operator=):
3123         (WebCore::FilterOperations::operator==):
3124         * platform/graphics/filters/FilterOperations.h:
3125         (WebCore::FilterOperations::isUsedForBackdropFilters):
3126         (WebCore::FilterOperations::setUsedForBackdropFilters):
3127
3128 2015-06-22  Tim Horton  <timothy_horton@apple.com>
3129
3130         [TextIndicator] Text shifts one pixel to the left when I force click to bring up Lookup in Mail messages
3131         https://bugs.webkit.org/show_bug.cgi?id=146214
3132         <rdar://problem/20782970>
3133
3134         Reviewed by Dean Jackson.
3135
3136         * page/mac/TextIndicatorWindow.mm:
3137         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
3138         (WebCore::TextIndicatorWindow::setTextIndicator):
3139         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]): Deleted.
3140         When the WebView is at a nonintegral position, we can end up needing a TextIndicator
3141         with a nonintegral position. We need to round the window position, so we need to apply
3142         the fractional part to the indicator layers inside, not to the window.
3143
3144 2015-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
3145
3146         [iOS] Arabic text styled with Georgia is rendered as boxes
3147         https://bugs.webkit.org/show_bug.cgi?id=145681
3148         <rdar://problem/21169844>
3149
3150         Reviewed by Darin Adler.
3151
3152         Georgia doesn't support Arabic, so we ask CoreText what font does support Arabic. It returns
3153         TimesNewRomanPSMT. However, WebKit explicitly disallows this font on iOS. Therefore, instead
3154         of using TimesNewRomanPSMT, we will simply just use GeezaPro.
3155
3156         Test: fast/text/arabic-times-new-roman.html
3157
3158         * platform/graphics/ios/FontCacheIOS.mm:
3159         (WebCore::FontCache::systemFallbackForCharacters):
3160         * platform/graphics/Font.h: Let FontCacheIOS call fontFamilyShouldNotBeUsedForArabic()
3161         * platform/graphics/cocoa/FontCocoa.mm:
3162         (WebCore::fontFamilyShouldNotBeUsedForArabic):
3163
3164 2015-06-22  Alex Christensen  <achristensen@webkit.org>
3165
3166         Unreviewed non-mac debug build fix after r185840.
3167
3168         * loader/ResourceLoader.cpp:
3169         (WebCore::ResourceLoader::willSendRequest):
3170         Added enable flag around assertion.
3171
3172 2015-06-20  Alex Christensen  <achristensen@webkit.org>
3173
3174         [Content Extensions] Add SPI to reload without content blocking.
3175         https://bugs.webkit.org/show_bug.cgi?id=146128
3176         rdar://problem/20351903
3177
3178         Reviewed by Sam Weinig.
3179
3180         * html/HTMLMediaElement.cpp:
3181         (WebCore::HTMLMediaElement::loadResource):
3182         * loader/ResourceLoader.cpp:
3183         (WebCore::ResourceLoader::willSendRequest):
3184         * loader/cache/CachedResourceLoader.cpp:
3185         (WebCore::CachedResourceLoader::requestResource):
3186         * page/DOMWindow.cpp:
3187         (WebCore::DOMWindow::open):
3188         * page/Page.h:
3189         (WebCore::Page::userContentController):
3190         (WebCore::Page::userContentExtensionsEnabled):
3191         (WebCore::Page::setUserContentExtensionsEnabled):
3192         (WebCore::Page::group):
3193         * page/UserContentController.cpp:
3194         (WebCore::UserContentController::removeAllUserContentExtensions):
3195         (WebCore::UserContentController::processContentExtensionRulesForLoad):
3196         (WebCore::UserContentController::actionsForResourceLoad):
3197         * page/UserContentController.h:
3198
3199 2015-06-22  Zalan Bujtas  <zalan@apple.com>
3200
3201         REGRESSION(r169105) Dangling renderer pointer in SelectionSubtreeRoot::SelectionSubtreeData.
3202         https://bugs.webkit.org/show_bug.cgi?id=146116
3203         rdar://problem/20959369
3204
3205         Reviewed by Brent Fulgham.
3206
3207         This patch ensures that we don't adjust the selection unless the visual selection still matches this subtree root.
3208
3209         When multiple selection roots are present we need to ensure that a RenderObject
3210         only shows up in one of them.
3211         RenderView::splitSelectionBetweenSubtrees(), as the name implies, splits the
3212         selection and sets the selection range (start/end) on each selection root.
3213         However, SelectionSubtreeRoot::adjustForVisibleSelection() later recomputes the range
3214         based on visible selection and that could end up collecting renderers as selection start/end
3215         from another selection subtree.
3216         RenderObject's holds the last selection state (RenderObject::setSelectionState).
3217         If we set a renderer first as "on selection border" and later "inside" using multiple selection roots,
3218         we can't clean up selections properly when this object gets destroyed.
3219         One of the roots ends up with a dangling RenderObject pointer.
3220
3221         Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees.html
3222
3223         * rendering/SelectionSubtreeRoot.cpp:
3224         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
3225
3226 2015-06-22  Jeremy Jones  <jeremyj@apple.com>
3227
3228         Do not exit fullscreen when starting PiP since this is done automatically.
3229         https://bugs.webkit.org/show_bug.cgi?id=144871
3230
3231         Reviewed by Darin Adler.
3232
3233         Since we don't explicitly exit fullscreen, update state in shouldExitFullscreenWithReason()
3234
3235         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Declare shouldExitFullscreenWithReason().
3236         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3237         (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Forward to WebVideoFullscreenInterfaceAVKit.
3238         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Added.
3239         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Remove enter fullscreen code.
3240         * platform/spi/cocoa/AVKitSPI.h: Add missing enums.
3241
3242 2015-06-22  Daniel Bates  <dabates@apple.com>
3243
3244         AX: UI Automation cannot find AutoFill or search cancel buttons
3245         https://bugs.webkit.org/show_bug.cgi?id=145241
3246         <rdar://problem/21051411>
3247
3248         Reviewed by Chris Fleizach.
3249
3250         Add support for hit testing the search cancel button and AutoFill button so that
3251         they can be accessed by UI Automation.
3252
3253         Currently the accessibility hit test machinery ignores nodes in a shadow tree.
3254         So, it neither finds the <input type="search"> cancel button nor the AutoFill button
3255         when it performs a hit test. Therefore these buttons cannot be accessed using
3256         UI Automation.
3257
3258         Tests: accessibility/hit-test-input-auto-fill-button.html
3259                accessibility/hit-test-input-search-cancel-button.html
3260                accessibility/input-search-cancel-button.html
3261
3262         * accessibility/AccessibilityRenderObject.cpp:
3263         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Added; returns
3264         the AccessibilityObject for the search cancel button or AutoFill text field decoration as applicable.
3265         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Check whether the hit node
3266         is a text field decoration.
3267
3268 2015-06-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3269
3270         [Streams API] Implement ReadableStream cancel (abstract part)
3271         https://bugs.webkit.org/show_bug.cgi?id=146111
3272
3273         Reviewed by Darin Adler.
3274
3275         This patch implements ReadableStream and ReadableStreamReader cancel.
3276         The reader delegates cancellation to its stream.
3277
3278         This patch also ensures that controller.close() will not throw in case cancellation is on-going.
3279
3280         A follow-up patch will implement the calling of 'cancel' JS callback for JS sources.
3281
3282         Covered by rebased tests.
3283
3284         * Modules/streams/ReadableStream.cpp:
3285         (WebCore::ReadableStream::cancel): Checks whether locked or not before cancelling.
3286         (WebCore::ReadableStream::cancelNoCheck): Cancel without lock check.
3287         (WebCore::ReadableStream::notifyCancelSucceeded): Async cancel callback.
3288         (WebCore::ReadableStream::notifyCancelFailed): Ditto.
3289         * Modules/streams/ReadableStream.h:
3290         * Modules/streams/ReadableStream.idl: Cleaned up IDL.
3291         * Modules/streams/ReadableStreamReader.cpp:
3292         (WebCore::ReadableStreamReader::cancel):
3293         * Modules/streams/ReadableStreamReader.h:
3294         * Modules/streams/ReadableStreamReader.idl: Cleaned up IDL
3295         * bindings/js/JSReadableStreamControllerCustom.cpp:
3296         (WebCore::JSReadableStreamController::close):
3297         * bindings/js/JSReadableStreamCustom.cpp:
3298         (WebCore::JSReadableStream::cancel):
3299         * bindings/js/JSReadableStreamReaderCustom.cpp:
3300         (WebCore::JSReadableStreamReader::cancel):
3301         * bindings/js/ReadableJSStream.cpp:
3302         (WebCore::ReadableJSStream::doCancel):
3303         * bindings/js/ReadableJSStream.h:
3304
3305 2015-06-22  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3306
3307         WebRTC: Navigator.webkitGetUserMedia() requires three arguments
3308         https://bugs.webkit.org/show_bug.cgi?id=146022
3309
3310         Reviewed by Eric Carlson.
3311
3312         Updated custom binding to make the third error callback argument
3313         mandatory. Updated and unskipped three tests (for the GTK+ port).
3314
3315         * bindings/js/JSNavigatorCustom.cpp:
3316         (WebCore::JSNavigator::webkitGetUserMedia):
3317
3318 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3319
3320         Unreviewed. Fix GTK+ build after r185818.
3321
3322         Actually rollout r185320.
3323
3324         * platform/network/soup/DNSSoup.cpp:
3325         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
3326         (WebCore::DNSResolveQueue::platformResolve):
3327         (WebCore::gotProxySettingsCallback): Deleted.
3328         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
3329
3330 2015-06-16  Gavin Barraclough  <barraclough@apple.com>
3331
3332         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
3333         https://bugs.webkit.org/show_bug.cgi?id=146198
3334
3335         Unreviewed rollout.
3336
3337         * platform/network/DNSResolveQueue.cpp:
3338         (WebCore::DNSResolveQueue::DNSResolveQueue):
3339         (WebCore::DNSResolveQueue::isUsingProxy):
3340         (WebCore::DNSResolveQueue::add):
3341         (WebCore::DNSResolveQueue::timerFired):
3342         * platform/network/DNSResolveQueue.h:
3343         * platform/network/cf/DNSCFNet.cpp:
3344         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
3345         (WebCore::clientCallback):
3346         (WebCore::DNSResolveQueue::platformResolve):
3347         (WebCore::proxyIsEnabledInSystemPreferences): Deleted.
3348         (WebCore::isUsingProxy): Deleted.
3349         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
3350         * platform/network/soup/DNSSoup.cpp:
3351
3352 2015-06-21  Alexey Proskuryakov  <ap@apple.com>
3353
3354         REGRESSION (r172975): navigator.language unable to tell region for Traditional Chinese users
3355         https://bugs.webkit.org/show_bug.cgi?id=146121
3356         rdar://problem/21395180
3357
3358         Reviewed by Darin Adler.
3359
3360         Revert to previous behavior, which is wrong in many ways, but not as wrong as the new one.
3361
3362         * platform/mac/Language.mm:
3363         (WebCore::httpStyleLanguageCode):
3364         (WebCore::platformUserPreferredLanguages):
3365         * platform/spi/cf/CFBundleSPI.h:
3366
3367 2015-06-19  Andy Estes  <aestes@apple.com>
3368
3369         Give Node::didNotifySubtreeInsertions() a better name
3370         https://bugs.webkit.org/show_bug.cgi?id=146170
3371
3372         Reviewed by Darin Adler.
3373
3374         didNotifySubtreeInsertions() is not a good name. It sounds like we are notifying the subtree insertions, which doesn't make sense.
3375
3376         This function is really about notifying the Node that the subtree it's a part of has finished being inserted into the DOM
3377         (i.e. all nodes have received their call to insertedInto()). Change the name to finishedInsertingSubtree() to better reflect this.
3378
3379         * dom/ContainerNode.cpp:
3380         (WebCore::ContainerNode::notifyChildInserted):
3381         * dom/ContainerNodeAlgorithms.h:
3382         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
3383         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
3384         * dom/Element.cpp:
3385         (WebCore::Element::addShadowRoot):
3386         * dom/Node.h:
3387         (WebCore::Node::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3388         (WebCore::Node::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3389         * dom/ScriptElement.cpp:
3390         (WebCore::ScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3391         (WebCore::ScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3392         * dom/ScriptElement.h:
3393         * html/HTMLFrameElementBase.cpp:
3394         (WebCore::HTMLFrameElementBase::insertedInto):
3395         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3396         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3397         * html/HTMLFrameElementBase.h:
3398         * html/HTMLScriptElement.cpp:
3399         (WebCore::HTMLScriptElement::insertedInto):
3400         (WebCore::HTMLScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3401         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3402         * html/HTMLScriptElement.h:
3403         * svg/SVGFEImageElement.cpp:
3404         (WebCore::SVGFEImageElement::insertedInto):
3405         (WebCore::SVGFEImageElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3406         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3407         * svg/SVGFEImageElement.h:
3408         * svg/SVGMPathElement.cpp:
3409         (WebCore::SVGMPathElement::insertedInto):
3410         (WebCore::SVGMPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3411         (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3412         * svg/SVGMPathElement.h:
3413         * svg/SVGScriptElement.cpp:
3414         (WebCore::SVGScriptElement::insertedInto):
3415         (WebCore::SVGScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3416         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3417         * svg/SVGScriptElement.h:
3418         * svg/SVGTRefElement.cpp:
3419         (WebCore::SVGTRefElement::insertedInto):
3420         (WebCore::SVGTRefElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3421         (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3422         * svg/SVGTRefElement.h:
3423         * svg/SVGTextPathElement.cpp:
3424         (WebCore::SVGTextPathElement::insertedInto):
3425         (WebCore::SVGTextPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3426         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3427         * svg/SVGTextPathElement.h:
3428         * svg/animation/SVGSMILElement.cpp:
3429         (WebCore::SVGSMILElement::insertedInto):
3430         (WebCore::SVGSMILElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
3431         (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
3432         * svg/animation/SVGSMILElement.h:
3433
3434 2015-06-21  Philip Chimento  <philip.chimento@gmail.com>
3435
3436         libwebkit2gtk fails to link without opengl
3437         https://bugs.webkit.org/show_bug.cgi?id=138332
3438
3439         Reviewed by Carlos Garcia Campos.
3440
3441         * CMakeLists.txt: The third-party ANGLE directories need to be
3442         included even if ENABLE(GRAPHICS_CONTEXT_3D) is false. They must
3443         be included after the OpenGL headers as the comment says.
3444         * platform/graphics/texmap/BitmapTexturePool.cpp: Remove
3445         reference to no longer existent header file.
3446
3447 2015-06-20  Tim Horton  <timothy_horton@apple.com>
3448
3449         Deselection of text causes a noticeable jump on force touch machines
3450         https://bugs.webkit.org/show_bug.cgi?id=146173
3451         <rdar://problem/20992842>
3452
3453         Reviewed by Sam Weinig.
3454
3455         When we have a TextIndicator of type Crossfade, we end up putting
3456         a layer with the blue highlight + text painted into it on top of the
3457         content, and cross-fading that layer to the yellow-highlighted text.
3458
3459         This is necessary for BounceAndCrossfade TextIndicators, because the
3460         blue highlight has to bounce, but is not necessary for Crossfade-only
3461         ones; we can just fade in the yellow highlight on top of the
3462         existing blue page highlight, and all is well.
3463
3464         So, get rid of the Crossfade TextIndicator type and use FadeIn, separately
3465         keeping track of whether or not we can add a margin (we still can't
3466         add a margin to TextIndicators that indicate the page's current selection,
3467         because the blue highlight cannot have the margin applied to it, and we
3468         want the bounds to match exactly).
3469
3470         * page/TextIndicator.cpp:
3471         (WebCore::TextIndicator::createWithRange):
3472         If the range is the same as the selection, turn off the margin.
3473         We were previously doing this based on the presentation transition, but now
3474         there's no difference in presentation transition in this case.
3475
3476         (WebCore::TextIndicator::createWithSelectionInFrame):
3477         (WebCore::TextIndicator::wantsBounce):
3478         (WebCore::TextIndicator::wantsContentCrossfade):
3479         (WebCore::TextIndicator::wantsFadeIn):
3480         (WebCore::TextIndicator::wantsManualAnimation):
3481         * page/TextIndicator.h:
3482         Get rid of TextIndicatorPresentationTransition::Crossfade.
3483
3484         (WebCore::TextIndicator::setWantsMargin):
3485         (WebCore::TextIndicator::wantsMargin):
3486         Keep track of whether we want a margin.
3487
3488         * page/mac/TextIndicatorWindow.mm:
3489         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
3490         Determine if we should use a margin based on wantsMargin instead of the
3491         presentation transition.
3492
3493 2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
3494
3495         [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
3496         https://bugs.webkit.org/show_bug.cgi?id=146171
3497
3498         Reviewed by Gyuyoung Kim.
3499
3500         * platform/efl/EflInspectorUtilities.cpp:
3501         (WebCore::inspectorResourcePath): Only used WEB_INSPECTOR_DIR which CMake decides properly.
3502
3503 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3504
3505         Fix absolute value warning in LocalizedStringsGtk.cpp
3506         https://bugs.webkit.org/show_bug.cgi?id=145919
3507
3508         Reviewed by Martin Robinson.
3509
3510         Use abs(static_cast<int>(time)) rather than static_cast<int>(abs(time)) to avoid clang's
3511         warnings about passing a float to abs() instead of std::abs(). Also, because casting an int
3512         to an int is silly.
3513
3514         * platform/gtk/LocalizedStringsGtk.cpp:
3515         (WebCore::localizedMediaTimeDescription):
3516
3517 2015-06-19  Devin Rousso  <drousso@apple.com>
3518
3519         Web Inspector: Highlight currently edited CSS selector
3520         https://bugs.webkit.org/show_bug.cgi?id=145658
3521
3522         Reviewed by Joseph Pecoraro.
3523
3524         Test: inspector/dom/highlight-multiple-shapes.html
3525
3526         * inspector/InspectorController.cpp:
3527         (WebCore::InspectorController::buildObjectForHighlightedNode):
3528         * inspector/InspectorController.h:
3529         * inspector/InspectorDOMAgent.cpp:
3530         (WebCore::InspectorDOMAgent::highlightSelector): Gets a list of all nodes matching a given selector string and highlights each of them.
3531         * inspector/InspectorDOMAgent.h:
3532         * inspector/InspectorOverlay.cpp:
3533         (WebCore::InspectorOverlay::hideHighlight):
3534         (WebCore::InspectorOverlay::highlightNodeList): Loops through a given NodeList to create highlightObjects for each of them.
3535         (WebCore::InspectorOverlay::shouldShowOverlay):
3536         (WebCore::buildObjectForElementData): Don't show flow fragments when highlighting multiple nodes.
3537         (WebCore::InspectorOverlay::buildHighlightObjectForNode):
3538         (WebCore::InspectorOverlay::buildObjectForHighlightedNode): Now returns an array containing the highlightObject for each highligthed node.
3539         (WebCore::InspectorOverlay::drawNodeHighlight): Now sends an array to the InspectorOverlayPage.js to provide support for highlighting multiple nodes.
3540         * inspector/InspectorOverlay.h:
3541         * inspector/InspectorOverlayPage.js: Now expects an array as its parameter and loops through it to highlight each node given.
3542         If the parameter array contains more than one element, do not draw the textbox containing info on that node.
3543         (drawNodeHighlight):
3544
3545 2015-06-19  Joseph Pecoraro  <pecoraro@apple.com>
3546
3547         Crash under WebCore::PageConsoleClient::addMessage attempting to log insecure content message in ImageDocument
3548         https://bugs.webkit.org/show_bug.cgi?id=146096
3549
3550         Reviewed by Timothy Hatcher.
3551
3552         Was able to reproduce this using a user stylesheet with an http css font
3553         on a pdf (ImageDocument) main document loaded over https. Was unable to
3554         create a reliable test for this scenario.
3555
3556         * page/PageConsoleClient.cpp:
3557         (WebCore::getParserLocationForConsoleMessage):
3558         The scriptableDocumentParser could be null, such as in an ImageDocument.
3559
3560 2015-06-19  Dean Jackson  <dino@apple.com>
3561
3562         Extremely large canvas crashes on pre-El Capitan machines
3563         https://bugs.webkit.org/show_bug.cgi?id=146169
3564         <rdar://problem/21410046>
3565
3566         Reviewed by Tim Horton.
3567
3568         On machines before El Capitan, make the maximum canvas size
3569         8k by 8k.
3570
3571         Covered by existing tests.
3572
3573         * html/HTMLCanvasElement.cpp:
3574
3575 2015-06-19  Tim Horton  <timothy_horton@apple.com>
3576
3577         Selection services cannot be invoked when force click is enabled
3578         https://bugs.webkit.org/show_bug.cgi?id=146166
3579         <rdar://problem/21468362>
3580
3581         Reviewed by Darin Adler.
3582
3583         * page/mac/ServicesOverlayController.h:
3584         Turn Highlight::Type into something we can use for dirty flags.
3585
3586         * page/mac/ServicesOverlayController.mm:
3587         (WebCore::ServicesOverlayController::Highlight::createForSelection):
3588         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
3589         (WebCore::ServicesOverlayController::ServicesOverlayController):
3590         (WebCore::ServicesOverlayController::selectionRectsDidChange):
3591         (WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
3592         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
3593         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
3594         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
3595         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
3596         (WebCore::ServicesOverlayController::buildSelectionHighlight):
3597         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
3598         (WebCore::ServicesOverlayController::determineActiveHighlight):
3599         (WebCore::ServicesOverlayController::didScrollFrame):
3600         (WebCore::ServicesOverlayController::handleClick):
3601         Coalesce highlight rebuilding so that things (like TextIndicator creation)
3602         that change the selection and then reset it immediately don't cause us
3603         to lose the active highlight.
3604
3605         This also means that if the selection changes multiple times in a runloop
3606         (easily possible from script), we won't waste a lot of time rebuilding highlights.
3607
3608         (WebCore::ServicesOverlayController::didRebuildPotentialHighlights):
3609         Merged into buildPotentialHighlightsIfNeeded.
3610
3611 2015-06-19  Matt Baker  <mattbaker@apple.com>
3612
3613         Web Inspector: TimelineAgent needs to handle nested runloops
3614         https://bugs.webkit.org/show_bug.cgi?id=145090
3615
3616         Reviewed by Joseph Pecoraro.
3617
3618         Previously nested run loops caused InspectorTimelineAgent to prematurely pop the current run loop record. This
3619         patch adds a counter to track the run loop nesting level, and rendering frame records are only pushed/popped
3620         when the nesting level is zero. Run loop entry/exit notifications received while the debugger is paused do not
3621         affect the nesting level.
3622
3623         * inspector/InspectorTimelineAgent.cpp:
3624         (WebCore::InspectorTimelineAgent::internalStart):
3625         (WebCore::InspectorTimelineAgent::internalStop):
3626         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
3627         * inspector/InspectorTimelineAgent.h:
3628
3629 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
3630
3631         Follow-up fix to r185766.
3632         https://bugs.webkit.org/show_bug.cgi?id=22132
3633
3634         Reviewed by Zalan Bujtas.
3635
3636         Suggested by Darin Adler in the bug.
3637
3638         * platform/graphics/filters/FETile.cpp:
3639         (WebCore::FETile::platformApplySoftware): Use WTF::move when passing
3640         the new tileImageCopy RefPtr.
3641
3642 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3643
3644         [SOUP] Fix return-type-c-linkage warning after r185553
3645         https://bugs.webkit.org/show_bug.cgi?id=146014
3646
3647         Reviewed by Martin Robinson.
3648
3649         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
3650         (webkitSoupRequestGenericGetRequest): Return a pointer rather than a reference.
3651         * platform/network/soup/WebKitSoupRequestGeneric.h: webkitSoupRequestGenericGetRequest now
3652         returns a pointer rather than a reference.
3653
3654 2015-06-19  Dean Jackson  <dino@apple.com>
3655
3656         Played <audio> looks invisible against the gray background
3657         https://bugs.webkit.org/show_bug.cgi?id=146164
3658         <rdar://problem/21014284>
3659
3660         Reviewed by Brent Fulgham.
3661
3662         The plus-darker blend mode was not allowing any white to
3663         show through in the rendering. We don't need this for
3664         audio controls, where we draw on an opaque grey background.
3665
3666         * Modules/mediacontrols/mediaControlsiOS.css:
3667         (audio::-webkit-media-controls-panel): Darken the color of the controls a
3668         little to make white stand out more.
3669         (audio::-webkit-media-controls-timeline): Remove the plus-darker blending.
3670         (video::-webkit-media-controls-timeline): Apply blending only to video.
3671
3672 2015-06-19  Andy Estes  <aestes@apple.com>
3673
3674         Various assertion failures occur when executing script in the midst of DOM insertion
3675         https://bugs.webkit.org/show_bug.cgi?id=132482
3676
3677         Reviewed by Darin Adler.
3678
3679         Prior to this change, when an element containing a <script> child was inserted into a document, the script was
3680         executed in ScriptElement::insertedInto(). That script can access nodes that follow it in the newly-inserted
3681         hierarchy but are not yet fully inserted, leading to at least the following problems:
3682
3683             - The script could remove a node that is not yet marked as in the document.
3684             - The script could remove a named <map> that has yet to be added to TreeScope::m_imageMapsByName.
3685             - The script could remove a form control that has yet to be added to FormController::m_formElementsWithState.
3686
3687         These scenarios all result in assertion failures. This change ensures that each node in the newly-inserted
3688         hierarchy is fully inserted before executing any scripts.
3689
3690         Tests: fast/dom/element-removed-while-inserting-parent-crash.html
3691                fast/dom/named-map-removed-while-inserting-parent-crash.html
3692                fast/forms/form-control-removed-while-inserting-parent-crash.html
3693                svg/dom/element-removed-while-inserting-parent-crash.html
3694
3695         * dom/ScriptElement.cpp:
3696         (WebCore::ScriptElement::shouldNotifySubtreeInsertions): Renamed from insertedInto().
3697         Returned true in the case where insertedInto() would've called prepareScript().
3698         (WebCore::ScriptElement::didNotifySubtreeInsertions): Called prepareScript().
3699         (WebCore::ScriptElement::insertedInto): Renamed to shouldNotifySubtreeInsertions().
3700         * dom/ScriptElement.h:
3701         * html/HTMLScriptElement.cpp:
3702         (WebCore::HTMLScriptElement::insertedInto): If shouldNotifySubtreeInsertions() is true, returned InsertionShouldCallDidNotifySubtreeInsertions.
3703         Otherwise, returned InsertionDone.
3704         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
3705         * html/HTMLScriptElement.h:
3706         * svg/SVGScriptElement.cpp:
3707         (WebCore::SVGScriptElement::insertedInto): Did the same as HTMLScriptElement::insertedInto().
3708         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
3709         * svg/SVGScriptElement.h:
3710
3711 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
3712
3713         All calls of ImageBuffer::create should null check the return value
3714         https://bugs.webkit.org/show_bug.cgi?id=22132
3715
3716         Reviewed by Zalan Bujtas.
3717
3718         ImageBuffer::create returns nullptr for a number of reasons, and should be
3719         expected to do so. We missed this check in a few places, resulting in
3720         crashes on some systems. Likewise, ImageBuffer::copyImage may return nullptr
3721         in normal use and should be checked.
3722
3723         * platform/graphics/BitmapImage.cpp:
3724         (WebCore::BitmapImage::drawPattern): Add nullptr check for create and copyImage. Remove
3725         extra call to 'setImageObserver'.
3726         * platform/graphics/cairo/ImageBufferCairo.cpp:
3727         (WebCore::ImageBuffer::drawPattern): Add nullptr check for copyImage.
3728         * platform/graphics/cg/ImageBufferCG.cpp:
3729         (WebCore::ImageBuffer::drawPattern): Add nullptr checks for copyImage.
3730         * platform/graphics/filters/FETile.cpp:
3731         (WebCore::FETile::platformApplySoftware): Add nullptr check for copyImage.
3732         * platform/graphics/filters/FilterEffect.cpp:
3733         (WebCore::FilterEffect::asImageBuffer): Add nullptr check for create.
3734         (WebCore::FilterEffect::openCLImageToImageBuffer): Ditto.
3735         * platform/graphics/texmap/BitmapTexture.cpp:
3736         (WebCore::BitmapTexture::updateContents): Add nullptr checks for create and copyImage.
3737         * svg/graphics/SVGImage.cpp:
3738         (WebCore::SVGImage::drawPatternForContainer): Add nullptr check for copyImage.
3739
3740 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
3741
3742         Get CAContext directly for CALayer instead of walking the layer tree.
3743         https://bugs.webkit.org/show_bug.cgi?id=146138
3744         <rdar://problem/21455974>
3745
3746         Reviewed by Darin Adler.
3747
3748         This will get the context directly from the CALayer instead of getting all CAContexts, walking the layer tree 
3749         to the root and comparing that against each CAContext's root layer.
3750
3751         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3752         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
3753
3754 2015-06-18  Brent Fulgham  <bfulgham@apple.com>
3755
3756         [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
3757         https://bugs.webkit.org/show_bug.cgi?id=145318
3758         <rdar://problem/21081501>
3759
3760         Reviewed by Simon Fraser.
3761
3762         Use the ScrollController in iOS to track the scroll snap point state.
3763         We do not need the animation implementation or timers since the actual
3764         animation is handled by UIKit.
3765
3766         This change lets us communicate the current offset into the scroll snap
3767         offset vector between the WebProcess and RemoteScrollingTree so that
3768         both sides stay in sync regardless of whether user gestures or style
3769         updates have caused us to shift to a different snap point.
3770
3771         * page/scrolling/AsyncScrollingCoordinator.cpp:
3772         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Set the
3773         current horizontal and vertical scroll snap offset indices.
3774         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
3775         * page/scrolling/AsyncScrollingCoordinator.h: Mark the setActiveScrollSnapIndices
3776         for export so that it can be reached by the UIProcess.
3777         * page/scrolling/ScrollingCoordinator.h: Keep track of horizontal and
3778         vertical scroll snap offset indices.
3779         * page/scrolling/ScrollingStateScrollingNode.cpp:
3780         (WebCore::ScrollingStateScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
3781         (WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex): Added.
3782         * page/scrolling/ScrollingStateScrollingNode.h:
3783         (WebCore::ScrollingStateScrollingNode::currentHorizontalSnapPointIndex): Added.
3784         (WebCore::ScrollingStateScrollingNode::currentVerticalSnapPointIndex): Added.
3785         * page/scrolling/ScrollingTree.h:
3786         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3787         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Update the scroll snap
3788         point offset indices if either has changed.
3789         * page/scrolling/ScrollingTreeScrollingNode.h:
3790         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex): Added.
3791         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex): Added.
3792         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
3793         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Added.
3794         * page/scrolling/ThreadedScrollingTree.cpp:
3795         (WebCore::ThreadedScrollingTree::currentSnapPointIndicesDidChange): New method
3796         to handle notifications about scroll snap index changes from the UIProcess.
3797         * page/scrolling/ThreadedScrollingTree.h:
3798         * page/scrolling/ios/ScrollingTreeIOS.cpp:
3799         (WebCore::ScrollingTreeIOS::currentSnapPointIndicesDidChange): New method
3800         to handle notifications about scroll snap index changes from the UIProcess.
3801         * page/scrolling/ios/ScrollingTreeIOS.h:
3802         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3803         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Update scroll
3804         snap point current offset indices if they have changed.
3805         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Remove unneeded
3806         PLATFORM(MAC) macro.
3807         * platform/ScrollAnimator.cpp:
3808         (WebCore::ScrollAnimator::ScrollAnimator): We have a ScrollController if we are
3809         supporting scroll snap points or rubber banding.
3810         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): This method is not needed
3811         for iOS builds.
3812         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): Enable this on iOS.
3813         (WebCore::ScrollAnimator::updateScrollSnapState): Renamed from 'updateScrollAnimatorsAndTimers'
3814         and enabled on iOS.
3815         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Deleted.
3816         * platform/ScrollAnimator.h: Enable some scroll snap methods on iOS.
3817         * platform/ScrollableArea.cpp:
3818         (WebCore::ScrollableArea::handleWheelEvent): Enable scroll snap index bookkeeping on iOS, too.
3819         (WebCore::ScrollableArea::updateScrollSnapState): Revise to call 'updateScrollSnapState' instead
3820         of 'updateScrollAnimatorsAndTimers'.
3821         * platform/cocoa/ScrollController.h: Enable some methods on iOS. Reorder methods to
3822         reduce the number of macros needed to do so.
3823         * platform/cocoa/ScrollController.mm:
3824         (systemUptime): Only build for Mac.
3825         (WebCore::ScrollController::ScrollController): Disable rubber band-specific members on iOS.
3826         (WebCore::ScrollController::handleWheelEvent): Only build this on Mac.
3827         (WebCore::ScrollController::isRubberBandInProgress): Always return 'false' on iOS.
3828         (WebCore::ScrollController::startSnapRubberbandTimer): Only build this on Mac.
3829         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
3830         (WebCore::ScrollController::scrollSnapPointState): Enable on iOS.
3831         (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Only build on Mac.
3832         (WebCore::ScrollController::updateScrollSnapState): renamed from 'updateScrollAnimatorsAndTimers'
3833         (WebCore::ScrollController::startScrollSnapTimer): Only build on Mac.
3834         (WebCore::ScrollController::initializeGlideParameters): Ditto.
3835         (WebCore::ScrollController::activeScrollSnapIndexForAxis): Enable on iOS.
3836         (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): Ditto.
3837         (WebCore::ScrollController::beginScrollSnapAnimation): Only build on Mac.
3838         (WebCore::ScrollController::computeGlideDelta): Ditto.
3839         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Deleted.
3840         * rendering/RenderLayerCompositor.cpp:
3841         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Capture any changes in scroll
3842         snap offset indices.
3843
3844 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
3845
3846         Fullscreen view should not update bounds of video when in PiP.
3847         https://bugs.webkit.org/show_bug.cgi?id=146134
3848
3849         Reviewed by Darin Adler.
3850
3851         Don't update bounds on video layer when it is not a child.
3852
3853         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3854         (-[WebAVVideoLayer setBounds:]):
3855
3856 2015-06-19  Zalan Bujtas  <zalan@apple.com>
3857
3858         RenderRubyText requires RenderRubyRun parent.
3859         https://bugs.webkit.org/show_bug.cgi?id=146148
3860         rdar://problem/21423319
3861
3862         Reviewed by Simon Fraser.
3863
3864         RenderRubyText expects its parent to be RenderRubyRun and since a
3865         a non-block <rt> requires anonymous wrapper, we should check whether
3866         the display type is actually block.
3867
3868         Test: fast/ruby/crash-when-ruby-rt-is-non-block.html
3869
3870         * html/RubyTextElement.cpp:
3871         (WebCore::RubyTextElement::createElementRenderer):
3872
3873 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
3874
3875         cancelPreviousPerformRequestsWithTarget for -resolveBounds in wrong class.
3876         https://bugs.webkit.org/show_bug.cgi?id=146140
3877
3878         Reviewed by Eric Carlson.
3879
3880         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3881         (-[WebCALayerHostWrapper dealloc]): Added.
3882         (-[WebAVVideoLayer dealloc]): Deleted.
3883
3884 2015-06-19  Per Arne Vollan  <peavo@outlook.com>
3885
3886         [WinCairo] Null pointer crash in BitmapTexture::updateContents.
3887         https://bugs.webkit.org/show_bug.cgi?id=146147
3888
3889         Reviewed by Brent Fulgham.
3890
3891         Added null pointer check.
3892
3893         * platform/graphics/texmap/BitmapTexture.cpp:
3894         (WebCore::BitmapTexture::updateContents):
3895
3896 2015-06-19  Anders Carlsson  <andersca@apple.com>
3897
3898         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
3899         https://bugs.webkit.org/show_bug.cgi?id=146124
3900         rdar://problem/21449395
3901
3902         Reviewed by Geoffrey Garen.
3903
3904         * platform/spi/cg/CoreGraphicsSPI.h:
3905
3906 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
3907
3908         Remove unnecessary svn:executable flags
3909         https://bugs.webkit.org/show_bug.cgi?id=146107
3910
3911         Reviewed by Alexey Proskuryakov.
3912
3913         * html/canvas/CanvasRenderingContext2D.cpp: Removed property svn:executable.
3914         * mathml/MathMLMencloseElement.cpp: Removed property svn:executable.
3915         * mathml/MathMLMencloseElement.h: Removed property svn:executable.
3916         * platform/efl/RenderThemeEfl.cpp: Removed property svn:executable.
3917         * rendering/mathml/RenderMathMLMenclose.cpp: Removed property svn:executable.
3918         * rendering/mathml/RenderMathMLMenclose.h: Removed property svn:executable.
3919
3920 2015-06-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3921
3922         Bindings generator should generate code to catch exception and reject promises for Promise-based APIs
3923         https://bugs.webkit.org/show_bug.cgi?id=146060
3924
3925         Reviewed by Darin Adler.
3926
3927         The binding generator splits the function that binds JS to the DOM class implementation in two for functions returning promise.
3928         The first function, called from JS, is responsible of casting this to the expected JSXXX class.
3929         If casting fails, an exception is raised. Otherwise, it calls the second function.
3930         After calling the second function, it checks whether an exception is raised, in which case it returns a rejected promise.
3931         The second function is responsible of argument conversion and calling the DOM class function.
3932
3933         Covered by expectations and AudioContext promise still working.
3934         A test case is added for a promise returning function taking a typed argument as input (if argument value cannot be typed, the promise is rejected).
3935         A second test case is a promise-returning function that can raise an exception. In that case the DOMException is used as rejection value.
3936
3937         As can be seen from generated code, this generalized code adds a mandatory check (is there an exception?) at the end of the function.
3938         This check is done even in cases we know there will be no exception.
3939         This may be covered by another patch if this optimization is thought useful enough.
3940
3941         * bindings/js/JSDOMPromise.cpp:
3942         (WebCore::rejectPromiseWithExceptionIfAny): Utility method for the binding code.
3943         (WebCore::callPromiseFunction): Ditto.
3944         * bindings/js/JSDOMPromise.h:
3945         * bindings/scripts/CodeGeneratorJS.pm:
3946         (GenerateImplementation):
3947         (GenerateFunctionCastedThis): Extracted from GenerateImplementationFunctionCall to reuse it in case of promise-returning functions.
3948         (GenerateImplementationFunctionCall):
3949         (GenerateCallbackImplementation): Deleted.
3950         * bindings/scripts/test/JS/JSTestObj.cpp:
3951         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
3952         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
3953         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
3954         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
3955         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
3956         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
3957         * bindings/scripts/test/TestObj.idl:
3958
3959 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
3960
3961         Disable UIWindow for fullscreen video for selected clients.
3962         https://bugs.webkit.org/show_bug.cgi?id=145852
3963
3964         Reviewed by Simon Fraser.
3965
3966         Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
3967         Fix some interface hiding and layout problems that showed up in the non UIWindow code path.
3968
3969         * platform/RuntimeApplicationChecksIOS.h:
3970         * platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
3971         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3972         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
3973         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.
3974
3975         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
3976         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
3977         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
3978         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
3979         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
3980         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
3981         These hide and show the view controller where we hide and show the window.
3982
3983 2015-06-18  Dean Jackson  <dino@apple.com>
3984
3985         Provide a way for web developers to draw a Theme-specific Wireless Playback icon
3986         https://bugs.webkit.org/show_bug.cgi?id=146123
3987         <rdar://problem/21119287>
3988
3989         Reviewed by Simon Fraser.
3990
3991         Implement a -webkit-named-image() CSS <image> generator that allows a site to
3992         request artwork by name and get the platform variant. At the moment
3993         we only support "wireless-playback" which returns a generic image everywhere
3994         but Cocoa platforms, where we render the AirPlay icon.
3995
3996         In order to do this I added a ThemeCocoa to share any Theme code between
3997         Mac and iOS.
3998
3999         Test: fast/css/named-icons.html
4000
4001         * WebCore.xcodeproj/project.pbxproj: Add new files CSSNamedImageValue, NamedImageGeneratedImage and ThemeCocoa.
4002
4003         * css/CSSImageGeneratorValue.cpp: Handle the new NamedImageClass in the switch statements for downcasting.