[Mac] Use one playback target for all web processes
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
2
3         [Mac] Use one playback target for all web processes
4         https://bugs.webkit.org/show_bug.cgi?id=144009
5
6         Reviewed by Tim Horton.
7
8         * Modules/mediacontrols/mediaControlsApple.js:
9         (Controller.prototype.updateWirelessPlaybackStatus): Drive-by fix to show controls when
10             we show the placeholder image.
11
12         Instead of having each Page/Document pair manage access to the playback target for the videos
13         in a web process, put all of the logic into a new class - WebMediaSessionManager. A singleton
14         instance talks to the target picker and manages video element access for all web processes.
15         All playback target logic was removed from Document, Page, and MediaSessionManager.
16
17         * Modules/mediasession: Added.
18         * Modules/mediasession/WebMediaSessionManager.cpp: Added.
19         (WebCore::ClientState::ClientState):
20         (WebCore::flagsAreSet):
21         (WebCore::WebMediaSessionManager::WebMediaSessionManager):
22         (WebCore::WebMediaSessionManager::~WebMediaSessionManager):
23         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient):
24         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient):
25         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
26         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
27         (WebCore::WebMediaSessionManager::clientStateDidChange):
28         (WebCore::WebMediaSessionManager::setPlaybackTarget):
29         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
30         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring):
31         (WebCore::WebMediaSessionManager::taskTimerFired):
32         (WebCore::WebMediaSessionManager::find):
33         (WebCore::WebMediaSessionManager::forEachClient):
34         * Modules/mediasession/WebMediaSessionManager.h: Added.
35         * Modules/mediasession/WebMediaSessionManagerClient.h: Added.
36         (WebCore::WebMediaSessionManagerClient::~WebMediaSessionManagerClient):
37         * Modules/webaudio/AudioContext.cpp:
38         (WebCore::AudioContext::mediaState): Replaces isPlayingAudio.
39         (WebCore::AudioContext::isPlayingAudio): Deleted.
40         * Modules/webaudio/AudioContext.h:
41         * WebCore.xcodeproj/project.pbxproj: Added new files.
42         * dom/Document.cpp:
43         (WebCore::Document::Document):
44         (WebCore::Document::addAudioProducer): Take a MediaProducer instead of an AudioProducer.
45         (WebCore::Document::removeAudioProducer):
46         (WebCore::Document::updateIsPlayingMedia):
47         (WebCore::nextPlaybackTargetClientContextId):
48         (WebCore::Document::addPlaybackTargetPickerClient):
49         (WebCore::Document::removePlaybackTargetPickerClient):
50         (WebCore::Document::showPlaybackTargetPicker):
51         (WebCore::Document::playbackTargetPickerClientStateDidChange):
52         (WebCore::Document::playbackTargetAvailabilityDidChange):
53         (WebCore::Document::setPlaybackTarget):
54         (WebCore::Document::setShouldPlayToPlaybackTarget):
55         (WebCore::Document::configurePlaybackTargetMonitoring): Deleted.
56         (WebCore::Document::requiresPlaybackTargetRouteMonitoring): Deleted.
57         (WebCore::Document::didChoosePlaybackTarget): Deleted.
58         * dom/Document.h:
59         (WebCore::Document::mediaState):
60         (WebCore::Document::isPlayingAudio): Deleted.
61         * html/HTMLMediaElement.cpp:
62         (WebCore::HTMLMediaElement::~HTMLMediaElement):
63         (WebCore::HTMLMediaElement::registerWithDocument):
64         (WebCore::HTMLMediaElement::setMuted): 
65         (WebCore::HTMLMediaElement::parseAttribute):
66         * html/HTMLMediaElement.h:
67         * html/HTMLMediaSession.cpp:
68         (WebCore::HTMLMediaSession::registerWithDocument):
69         (WebCore::HTMLMediaSession::unregisterWithDocument):
70         (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
71         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
72         (WebCore::HTMLMediaSession::setPlaybackTarget):
73         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
74         (WebCore::HTMLMediaSession::setShouldPlayToPlaybackTarget):
75         (WebCore::HTMLMediaSession::mediaStateDidChange):
76         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Deleted.
77         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Deleted.
78         (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Deleted.
79         (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Deleted.
80         * html/HTMLMediaSession.h:
81         * page/AudioProducer.h: Removed.
82         * page/ChromeClient.h:
83         * page/MediaProducer.h: Copied from Source/WebCore/page/AudioProducer.h.
84         (WebCore::MediaProducer::~MediaProducer):
85         (WebCore::AudioProducer::~AudioProducer): Deleted.
86         * page/Page.cpp:
87         (WebCore::Page::Page):
88         (WebCore::Page::updateIsPlayingMedia):
89         (WebCore::Page::addPlaybackTargetPickerClient):
90         (WebCore::Page::removePlaybackTargetPickerClient):
91         (WebCore::Page::showPlaybackTargetPicker):
92         (WebCore::Page::playbackTargetPickerClientStateDidChange):
93         (WebCore::Page::setPlaybackTarget):
94         (WebCore::Page::playbackTargetAvailabilityDidChange):
95         (WebCore::Page::setShouldPlayToPlaybackTarget):
96         (WebCore::Page::playbackTarget): Deleted.
97         (WebCore::Page::didChoosePlaybackTarget): Deleted.
98         (WebCore::Page::configurePlaybackTargetMonitoring): Deleted.
99         * page/Page.h:
100         (WebCore::Page::mediaState):
101         (WebCore::Page::isPlayingAudio): Deleted.
102         (WebCore::Page::hasWirelessPlaybackTarget): Deleted.
103         * platform/audio/MediaSession.h:
104         (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
105         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
106         (WebCore::MediaSessionClient::setShouldPlayToPlaybackTarget):
107         (WebCore::MediaSession::startPlayingToPlaybackTarget): Deleted.
108         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Deleted.
109         (WebCore::MediaSessionClient::startPlayingToPlaybackTarget): Deleted.
110         (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget): Deleted.
111         * platform/audio/MediaSessionManager.cpp:
112         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
113         (WebCore::MediaSessionManager::sessionCanLoadMedia):
114         (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): Deleted.
115         * platform/audio/MediaSessionManager.h:
116         * platform/graphics/MediaPlaybackTargetClient.h: Copied from Source/WebCore/platform/graphics/MediaPlaybackTargetPickerClient.h.
117         (WebCore::MediaPlaybackTargetClient::~MediaPlaybackTargetClient):
118         (WebCore::MediaPlaybackTargetPickerClient::~MediaPlaybackTargetPickerClient): Deleted.
119         * platform/graphics/MediaPlaybackTargetPicker.cpp:
120         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
121         (WebCore::MediaPlaybackTargetPicker::startingMonitoringPlaybackTargets):
122         (WebCore::MediaPlaybackTargetPicker::stopMonitoringPlaybackTargets):
123         * platform/graphics/MediaPlaybackTargetPicker.h:
124         * platform/graphics/MediaPlaybackTargetPickerClient.h: Removed.
125         * platform/graphics/MediaPlayer.cpp:
126         (WebCore::MediaPlayer::setShouldPlayToPlaybackTarget):
127         (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Deleted.
128         (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Deleted.
129         * platform/graphics/MediaPlayer.h:
130         * platform/graphics/MediaPlayerPrivate.h:
131         (WebCore::MediaPlayerPrivateInterface::setShouldPlayToPlaybackTarget):
132         (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget): Deleted.
133         (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget): Deleted.
134         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp: Added.
135         (WebCore::WebMediaSessionManagerMac::singleton):
136         (WebCore::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
137         (WebCore::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
138         (WebCore::WebMediaSessionManagerMac::targetPicker):
139         * platform/graphics/avfoundation/WebMediaSessionManagerMac.h: Added.
140         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
141         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
142         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
143         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
144         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
145         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
146         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
147         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
148         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Deleted.
149         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Deleted.
150         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
151         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
152         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
153         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Deleted.
154         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Deleted.
155         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Deleted.
156         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
157         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
158         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
159         (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Deleted.
160         (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Deleted.
161         (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Deleted.
162         * testing/Internals.cpp:
163         (WebCore::Internals::isPagePlayingAudio):
164
165 2015-04-21  Myles C. Maxfield  <mmaxfield@apple.com>
166
167         [iOS] When computing visible rects for tiling, stop searching at UIWindows
168         https://bugs.webkit.org/show_bug.cgi?id=144022
169         <rdar://problem/18327227>
170
171         Reviewed by Simon Fraser.
172
173         [WAKWindow _visibleRectRespectingMasksToBounds:] computes a visible rect which we use
174         to determine which tiles to create. We do this by finding the frame of the _hostLayer,
175         and then walking up the CALayer hierarchy converting each rect into its parent's
176         coordinate system (all the while clipping to bounds if necessary). This walk up the
177         layer hierarchy should stop at a layer associated with a UIWindow.
178
179         * platform/ios/wak/WAKWindow.mm:
180         (-[WAKWindow _visibleRectRespectingMasksToBounds:]):
181
182 2015-04-21  Jinwoo Song  <jinwoo7.song@samsung.com>
183
184         [Cairo] Implement Path::addPath
185         https://bugs.webkit.org/show_bug.cgi?id=130580
186
187         Reviewed by Dirk Schulze.
188
189         Add support for addPath method for ports using cairo.
190         This patch is originally authored by Jae Hyun Park <jaepark@webkit.org>.
191
192         Test: fast/canvas/canvas-path-addPath.html
193
194         * platform/graphics/cairo/PathCairo.cpp:
195         (WebCore::Path::addPath): Implement addPath for cairo.
196
197 2015-04-21  Tim Horton  <timothy_horton@apple.com>
198
199         Fix the iOS build.
200
201         * platform/spi/cg/CoreGraphicsSPI.h:
202
203 2015-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
204
205         SVGAnimateElementBase::calculateAnimatedValue() asserts when reinserting an SVG animating element within the same animation limits
206         https://bugs.webkit.org/show_bug.cgi?id=143994
207
208         Reviewed by Simon Fraser.
209
210         Make sure the SVG animation variables are reset cleanly such that if the
211         animation restarts it can rebuild its limit values reliably and correctly.
212
213         Tests: svg/animations/crash-reinsert-animate-length-same-limits.svg
214                svg/animations/crash-reinsert-animate-transform-same-limits.svg
215
216         * svg/SVGAnimateElementBase.h:
217         * svg/SVGAnimateElementBase.cpp:
218         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType):
219         Call the base class resetAnimatedPropertyType() from the derived class.
220
221         * svg/SVGAnimationElement.h:
222         * svg/SVGAnimationElement.cpp:
223         (WebCore::SVGAnimationElement::resetAnimatedPropertyType):
224         Make resetAnimatedPropertyType() virtual. The implementation of the base
225         class of this function resets the values of the animation limits. When
226         updateAnimation() is called, it will be forced to recalculate the animation
227         limits by calling calculateFromAndToValues() even if the limits have not
228         changed.
229
230 2015-04-21  Tim Horton  <timothy_horton@apple.com>
231
232         Long pause under _takeViewSnapshot when screen updates are disabled
233         https://bugs.webkit.org/show_bug.cgi?id=144017
234         <rdar://problem/20548397>
235
236         Reviewed by Simon Fraser.
237
238         * platform/spi/cg/CoreGraphicsSPI.h:
239         Add some SPI.
240
241 2015-04-21  Commit Queue  <commit-queue@webkit.org>
242
243         Unreviewed, rolling out r183077.
244         https://bugs.webkit.org/show_bug.cgi?id=144021
245
246         broke a bunch of tests, bfulgham is going to try again
247         (Requested by thorton on #webkit).
248
249         Reverted changeset:
250
251         "Context menu doesn't account for selection semantics"
252         https://bugs.webkit.org/show_bug.cgi?id=143958
253         http://trac.webkit.org/changeset/183077
254
255 2015-04-21  Chris Dumez  <cdumez@apple.com>
256
257         [WK2][NetworkCache] Better account of resource revalidations in efficacy logging
258         https://bugs.webkit.org/show_bug.cgi?id=144014
259
260         Reviewed by Antti Koivisto.
261
262         Add additional diagnostic logging key for network cache efficacy
263         logging.
264
265         * page/DiagnosticLoggingKeys.cpp:
266         (WebCore::DiagnosticLoggingKeys::needsRevalidationKey):
267         * page/DiagnosticLoggingKeys.h:
268
269 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
270
271         Context menu doesn't account for selection semantics
272         https://bugs.webkit.org/show_bug.cgi?id=143958
273         <rdar://problem/19735706>
274
275         Reviewed by Tim Horton.
276
277         Before using the default word-only selection, check with the
278         lookup service to see if we can get a semantically appropriate
279         selection.
280
281         * page/EventHandler.cpp:
282         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
283         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
284         * page/EventHandler.h:
285         * page/mac/EventHandlerMac.mm:
286         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
287
288 2015-04-21  Anders Carlsson  <andersca@apple.com>
289
290         Get rid of an unneeded function from LoaderNSURLExtras.mm
291         https://bugs.webkit.org/show_bug.cgi?id=144003
292
293         Reviewed by Chris Dumez.
294
295         Just use Vector::contains instead of vectorContainsString.
296
297         * loader/mac/LoaderNSURLExtras.mm:
298         (suggestedFilenameWithMIMEType):
299         (vectorContainsString): Deleted.
300
301 2015-04-21  Chris Dumez  <cdumez@apple.com>
302
303         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
304         https://bugs.webkit.org/show_bug.cgi?id=143970
305
306         Reviewed by Darin Adler.
307
308         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
309         constructor explicit as it copies the vector and it is easy to call it
310         by mistake.
311
312         * Modules/indexeddb/IDBDatabaseBackend.cpp:
313         (WebCore::IDBDatabaseBackend::setIndexKeys):
314         (WebCore::IDBDatabaseBackend::setIndexesReady):
315         * Modules/indexeddb/IDBDatabaseBackend.h:
316         * Modules/indexeddb/IDBServerConnection.h:
317         * cssjit/SelectorCompiler.cpp:
318         (WebCore::SelectorCompiler::minimumRegisterRequirements):
319         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasClasses):
320         * cssjit/StackAllocator.h:
321         (WebCore::StackAllocator::push):
322         (WebCore::StackAllocator::pop):
323         * rendering/RenderGrid.cpp:
324         (WebCore::RenderGrid::GridIterator::nextGridItem):
325         (WebCore::RenderGrid::GridIterator::isEmptyAreaEnough):
326         * rendering/style/SVGRenderStyle.cpp:
327         (WebCore::SVGRenderStyle::paintTypesForPaintOrder):
328         * rendering/style/SVGRenderStyle.h:
329         * rendering/svg/RenderSVGShape.cpp:
330         (WebCore::RenderSVGShape::fillStrokeMarkers):
331         * rendering/svg/SVGInlineTextBox.cpp:
332         (WebCore::SVGInlineTextBox::paint):
333         * svg/SVGToOTFFontConversion.cpp:
334         (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
335         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
336
337 2015-04-21  Chris Dumez  <cdumez@apple.com>
338
339         Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion
340         https://bugs.webkit.org/show_bug.cgi?id=143971
341
342         Reviewed by Darin Adler.
343
344         Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion as
345         firing JS events can cause arbitrary JS execution which often leads to
346         security bugs when event firing is forbidden. For e.g. firing events
347         from ActiveDOMObject::suspend() means JS can construct or destroy
348         ActiveDOMObjects while we are iterating over them.
349
350         * dom/ContainerNode.cpp:
351         (WebCore::dispatchChildInsertionEvents):
352         (WebCore::dispatchChildRemovalEvents):
353         * dom/ContainerNodeAlgorithms.h:
354         (WebCore::ChildNodeInsertionNotifier::notify):
355         * dom/Document.cpp:
356         (WebCore::Document::dispatchWindowEvent):
357         (WebCore::Document::dispatchWindowLoadEvent):
358         * dom/Element.cpp:
359         (WebCore::Element::dispatchFocusInEvent):
360         (WebCore::Element::dispatchFocusOutEvent):
361         * dom/EventDispatcher.cpp:
362         (WebCore::EventDispatcher::dispatchEvent):
363         * dom/EventTarget.cpp:
364         (WebCore::EventTarget::fireEventListeners):
365         * dom/Node.cpp:
366         (WebCore::Node::dispatchSubtreeModifiedEvent):
367         (WebCore::Node::dispatchDOMActivateEvent):
368         * dom/ScriptExecutionContext.cpp:
369         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache):
370         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
371         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
372         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
373         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
374         * dom/WebKitNamedFlow.cpp:
375         (WebCore::WebKitNamedFlow::dispatchRegionOversetChangeEvent):
376
377 2015-04-21  Darin Adler  <darin@apple.com>
378
379         Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template definitions and traits)
380         https://bugs.webkit.org/show_bug.cgi?id=143944
381
382         Reviewed by Andreas Kling.
383
384         * editing/ios/DictationCommandIOS.h: Added now-needed include of PassOwnPtr.h.
385
386 2015-04-20  Simon Fraser  <simon.fraser@apple.com>
387
388         REGRESSION (r177494): -webkit-mask-image: with data URI fails on non-local files
389         https://bugs.webkit.org/show_bug.cgi?id=141857
390
391         Reviewed by Dirk Schulze.
392         
393         r177494 regressed loading of data URIs in masks with remote content, triggering
394         a cross-domain error which occurs because the mask loading happened via a separate
395         SVGDocument.
396         
397         Fix by checking for data URIs at parsing time, which is what we used to do.
398
399         Test: http/tests/css/data-uri-mask.html
400
401         * css/CSSParser.cpp:
402         (WebCore::CSSParser::parseMaskImage):
403         * svg/SVGURIReference.h:
404         (WebCore::SVGURIReference::isExternalURIReference):
405
406 2015-04-20  Chris Dumez  <cdumez@apple.com>
407
408         Crash when showing Web Inspector on page with 'multipart/x-mixed-replace' main resource
409         https://bugs.webkit.org/show_bug.cgi?id=143979
410         <rdar://problem/20594948>
411
412         Reviewed by Timothy Hatcher.
413
414         InspectorDOMAgent::m_document was updated only once per load, from
415         FrameLoader::dispatchDidCommitLoad(). However, dispatchDidCommitLoad()
416         is not called for follow-up multipart replacing loads. You can see this
417         from the following check in DocumentLoader::commitData():
418             if (!isMultipartReplacingLoad())
419                 frameLoader()->receivedFirstData();
420
421         As a result, in the case of a 'multipart/x-mixed-replace' main resource
422         InspectorDOMAgent::m_document would quickly get outdated as we create
423         a new Document for each replacing load. This would lead to Web Inspector
424         code using a Document without frame and causing crashes.
425
426         This patch calls InspectorInstrumentation::frameDocumentUpdated() from
427         Frame::setDocument() so that InspectorDOMAgent::m_document is always up
428         to date.
429
430         No new tests, not easily testable as the main resource needs to be
431         'multipart/x-mixed-replace'.
432
433         * dom/Document.cpp:
434         (WebCore::Document::applyXSLTransform):
435         Stop calling InspectorInstrumentation::frameDocumentUpdated() here as
436         XSLTProcessor::createDocumentFromSource() will call Frame::setDocument()
437         and frameDocumentUpdated() will be called there.
438
439         * page/Frame.cpp:
440         (WebCore::Frame::setDocument):
441         Call InspectorInstrumentation::frameDocumentUpdated() to make sure
442         InspectorDOMAgent::m_document gets updated.
443
444 2015-04-20  Alex Christensen  <achristensen@webkit.org>
445
446         Overwrite existing files with moveFile.
447         https://bugs.webkit.org/show_bug.cgi?id=143968
448
449         Reviewed by Brady Eidson and Anders Carlsson.
450
451         * platform/mac/FileSystemMac.mm:
452         (-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]):
453         (WebCore::moveFile):
454         r182932 introduced moveFile instead of renameFile.  In order to preserve behavior, it should overwrite existing files.
455
456 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
457
458         Unreviewed Windows build fix after r183031.
459
460         * platform/graphics/OpenGLShims.cpp:
461         (WebCore::lookupOpenGLFunctionAddress):
462         Windows needs an explicit cast converting LChar* to const char*.
463         Also, add a FIXME comment for sketchy behavior.
464
465 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
466
467         Cleanup some StringBuilder use
468         https://bugs.webkit.org/show_bug.cgi?id=143550
469
470         Reviewed by Darin Adler.
471
472         * Modules/plugins/YouTubePluginReplacement.cpp:
473         (WebCore::YouTubePluginReplacement::youTubeURL):
474         * css/CSSAnimationTriggerScrollValue.cpp:
475         (WebCore::CSSAnimationTriggerScrollValue::customCSSText):
476         * css/CSSCanvasValue.cpp:
477         (WebCore::CSSCanvasValue::customCSSText):
478         * html/HTMLCanvasElement.cpp:
479         (WebCore::HTMLCanvasElement::createImageBuffer):
480         * page/CaptionUserPreferencesMediaAF.cpp:
481         (WebCore::CaptionUserPreferencesMediaAF::captionsWindowCSS):
482         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS):
483         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor):
484         (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS):
485         (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
486         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride):
487         * page/EventSource.cpp:
488         (WebCore::EventSource::didReceiveResponse):
489         * page/PageSerializer.cpp:
490         (WebCore::PageSerializer::serializeCSSStyleSheet):
491         * platform/graphics/OpenGLShims.cpp:
492         (WebCore::lookupOpenGLFunctionAddress):
493         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
494         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
495         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
496         (WebCore::generateHashedName):
497         * platform/text/DateTimeFormat.cpp:
498         (WebCore::DateTimeFormat::quoteAndAppendLiteral):
499         * rendering/RenderLayerCompositor.cpp:
500         (WebCore::RenderLayerCompositor::logLayerInfo):
501         * rendering/RenderTreeAsText.cpp:
502         (WebCore::writeRenderRegionList):
503         * testing/MicroTaskTest.cpp:
504         (WebCore::MicroTaskTest::run):
505         * testing/MockContentFilterSettings.cpp:
506         (WebCore::MockContentFilterSettings::unblockRequestURL):
507
508 2015-04-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
509
510         SVGFitToViewBox::viewBoxToViewTransform() has to count for zero physical width and height before calling SVGPreserveAspectRatio::getCTM()
511         https://bugs.webkit.org/show_bug.cgi?id=143903
512
513         Reviewed by Daniel Bates.
514
515         Ensure that the SVG viewBoxToView transformation is always invertible.
516         CG path drawing functions crash if the context is transformed to non-
517         invertible matrix.
518
519         Tests: svg/css/crash-path-zero-height-viewbox.svg
520                svg/css/crash-path-zero-width-viewbox.svg
521
522         * svg/SVGFitToViewBox.cpp:
523         (WebCore::SVGFitToViewBox::viewBoxToViewTransform):
524         Do not call SVGPreserveAspectRatio::getCTM() if the physical width or the
525         physical height is zero.
526
527         * svg/SVGPreserveAspectRatio.cpp:
528         (WebCore::SVGPreserveAspectRatio::getCTM):
529         Ensure that we are not dividing by zero in this function.
530
531 2015-04-20  Chris Dumez  <cdumez@apple.com>
532
533         CSSParser::parseValue() copies the m_parsedProperties vector at addParsedProperties()
534         https://bugs.webkit.org/show_bug.cgi?id=143925
535
536         Reviewed by Simon Fraser.
537
538         Update MutableStyleProperties::addParsedProperties() to use
539         CSSParser::ParsedPropertyVector type (i.e. Vector<CSSProperty, 256>)
540         instead of Vector<CSSProperty> so that the properties vector is no
541         longer copied unnecessarily to convert one type to the other.
542
543         * css/CSSParser.h:
544         * css/StyleProperties.cpp:
545         (WebCore::MutableStyleProperties::addParsedProperties):
546         * css/StyleProperties.h:
547
548 2015-04-20  Beth Dakin  <bdakin@apple.com>
549
550         Should remove mouseForceClick and mouseForceCancelled from DOM force events
551         https://bugs.webkit.org/show_bug.cgi?id=143904
552         -and corresponding-
553         rdar://problem/20578842
554
555         Reviewed by Dan Bernstein.
556
557         After more thought and discussion, we decided to remove mouseForceClick and 
558         mouseForceCancelled from DOM force events. mouseForceClick is confusing and 
559         redundant. mouseForceCancelled is confusing as it is currently implemented, and 
560         all of its functionality can be filled by exisiting events such as mouseup, 
561         mouseout, etc.
562
563         * dom/Document.cpp:
564         (WebCore::Document::addListenerTypeIfNeeded):
565         * dom/Document.h:
566         * dom/Document.idl:
567         * dom/Element.cpp:
568         (WebCore::Element::dispatchMouseForceWillBegin):
569         (WebCore::Element::dispatchMouseForceClick): Deleted.
570         (WebCore::Element::dispatchMouseForceCancelled): Deleted.
571         * dom/Element.h:
572         * dom/Element.idl:
573         * dom/EventNames.h:
574         * html/HTMLAttributeNames.in:
575         * html/HTMLBodyElement.cpp:
576         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
577         * html/HTMLBodyElement.idl:
578         * html/HTMLElement.cpp:
579         (WebCore::HTMLElement::createEventHandlerNameMap):
580         * page/DOMWindow.idl:
581
582 2015-04-20  Simon Fraser  <simon.fraser@apple.com>
583
584         Setting inline style to the same value it already has triggers a style recalc
585         https://bugs.webkit.org/show_bug.cgi?id=143922
586
587         Reviewed by Antti Koivisto.
588
589         MutableStyleProperties::setProperty() was taking the result of CSSParser::parseValue()
590         to mean "parsing changed the style", but it actually just means "parsing succeeded".
591         Add a new out param, piped through various parser functions, to indicate whether
592         parsing actually changed style, and instead return that from setProperty().
593
594         Add internals.startTrackingStyleRecalcs() and internals.styleRecalcCount() so
595         we can write tests for style recalc.
596
597         Test: fast/css/set-inline-style-recalc.html
598
599         * WebCore.xcodeproj/project.pbxproj: Let Xcode have it's way.
600         * css/CSSParser.cpp:
601         (WebCore::parseColorValue):
602         (WebCore::parseSimpleLengthValue):
603         (WebCore::parseKeywordValue):
604         (WebCore::parseTranslateTransformValue):
605         (WebCore::CSSParser::parseFontFaceValue):
606         (WebCore::CSSParser::parseValue):
607         * css/CSSParser.h:
608         * css/CSSProperty.h:
609         (WebCore::StylePropertyMetadata::operator==):
610         (WebCore::CSSProperty::operator==):
611         * css/DOMWindowCSS.cpp:
612         (WebCore::DOMWindowCSS::supports):
613         * css/StyleProperties.cpp:
614         (WebCore::MutableStyleProperties::setProperty):
615         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty):
616         (WebCore::MutableStyleProperties::addParsedProperties):
617         (WebCore::MutableStyleProperties::addParsedProperty):
618         * css/StyleProperties.h:
619         * css/WebKitCSSMatrix.cpp:
620         (WebCore::WebKitCSSMatrix::setMatrixValue):
621         * dom/Document.cpp:
622         (WebCore::Document::recalcStyle):
623         (WebCore::Document::startTrackingStyleRecalcs):
624         (WebCore::Document::styleRecalcCount):
625         * dom/Document.h:
626         * html/canvas/CanvasRenderingContext2D.cpp:
627         (WebCore::CanvasRenderingContext2D::setFont):
628         * testing/Internals.cpp:
629         (WebCore::Internals::startTrackingStyleRecalcs):
630         (WebCore::Internals::styleRecalcCount):
631         * testing/Internals.h:
632         * testing/Internals.idl:
633
634 2015-04-20  Brady Eidson  <beidson@apple.com>
635
636         Crash in StyleResolver::invalidateMatchedPropertiesCache() when using content extensions.
637         <rdar://problem/20554405> and https://bugs.webkit.org/show_bug.cgi?id=143892
638
639         Reviewed by Chris Dumez.
640
641         Test: http/tests/contentextensions/style-resolver-changed-reentrancy.html
642
643         * contentextensions/ContentExtensionsBackend.cpp:
644         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
645
646         * dom/DocumentStyleSheetCollection.cpp:
647         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
648         (WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Call styleResolverChanged on a delay.
649         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet): Ditto.
650         (WebCore::DocumentStyleSheetCollection::styleResolverChangedTimerFired):
651         * dom/DocumentStyleSheetCollection.h:
652
653 2015-04-20  Per Arne Vollan  <peavo@outlook.com>
654
655         Favicons are not always loaded.
656         https://bugs.webkit.org/show_bug.cgi?id=143880
657
658         Reviewed by Darin Adler.
659
660         If the favicon link element(s) in the document does not have a mime type,
661         the favicon is loaded from the domain root (/favicon.ico). If no favicon
662         exists at this location, the favicon loading will fail. This can be solved
663         by not demanding that the link element has a mime type.
664
665         Test: fast/dom/icon-url-without-mimetype.html
666
667         * loader/icon/IconController.cpp:
668         (WebCore::iconFromLinkElements): Return the chosen icon URL instead of a vector of URLs.
669         (WebCore::IconController::url):
670         (WebCore::iconsFromLinkElements): Deleted.
671
672 2015-04-20  Martin Robinson  <mrobinson@igalia.com>
673
674         [CMake] Include ICU unconditionally on the source lists
675         https://bugs.webkit.org/show_bug.cgi?id=143900
676
677         Reviewed by Darin Adler.
678
679         No new tests. This is just a build file change.
680
681         * CMakeLists.txt: Integrate ICU source files, includes, and libraries into the main
682         sections. They are shared by all platforms.
683         * PlatformGTK.cmake: Eliminate build rules that are duplicated from the main CMakeLists.txt.
684
685 2015-04-20  Chris Fleizach  <cfleizach@apple.com>
686
687         AX: iOS: Text input field ignores value of read-only and aria-readonly attributes
688         https://bugs.webkit.org/show_bug.cgi?id=143946
689
690         Reviewed by Mario Sanchez Prada.
691
692         Expose an existing method for determining whether the value can be set to the iOS accessibility platform.
693
694         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
695         (-[WebAccessibilityObjectWrapper accessibilityCanSetValue]):
696
697 2015-04-20  Andreas Kling  <akling@apple.com>
698
699         Merge TreeShared into Node.
700         <https://webkit.org/b/143942>
701
702         Reviewed by Darin Adler.
703
704         Node was the only remaining user of TreeShared, so just fold the class into Node.
705
706         * WebCore.vcxproj/WebCore.vcxproj:
707         * WebCore.vcxproj/WebCore.vcxproj.filters:
708         * WebCore.xcodeproj/project.pbxproj:
709         * dom/Node.cpp:
710         (WebCore::Node::Node):
711         (WebCore::Node::~Node):
712         * dom/Node.h:
713         (WebCore::Node::ref):
714         (WebCore::Node::deref):
715         (WebCore::Node::hasOneRef):
716         (WebCore::Node::refCount):
717         (WebCore::adopted):
718         (WebCore::Node::hasTreeSharedParent): Deleted.
719         * platform/TreeShared.h: Removed.
720
721 2015-04-19  Benjamin Poulain  <benjamin@webkit.org>
722
723         Improve the feature.json files
724
725         * features.json:
726
727 2015-04-18  Jon Lee  <jonlee@apple.com>
728
729         [Mac] Time elapsed should be right-aligned
730         https://bugs.webkit.org/show_bug.cgi?id=143927
731
732         Reviewed by Eric Carlson.
733
734         Current time is left-aligned, which is visually jarring when going from < 1 hour to > 1 hour.
735
736         * Modules/mediacontrols/mediaControlsApple.css:
737         (audio::-webkit-media-controls-current-time-display): Set justify-content to flex-end.
738         (audio::-webkit-media-controls-time-remaining-display): Explicitly set justify-content to flex-start.
739
740 2015-04-18  Simon Fraser  <simon.fraser@apple.com>
741
742         REGRESSION (r181656): Animated tiled layers are missing content
743         https://bugs.webkit.org/show_bug.cgi?id=143911
744         rdar://problem/20596328
745
746         Reviewed by Darin Adler.
747
748         After r181656, all requestAnimationFrame was falling back to timers, and not
749         using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
750         fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during
751         animations) was failing to do any updates.
752         
753         Replace this confusing Optional<> code with simpler code that just forces the
754         clients to make a DisplayRefreshMonitor if they can, first asking
755         ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
756         
757         Make lots of things into references, and use C++11 initialization in some places.
758         
759         Add Internals API to allow a test to get the number of layer flushes that have
760         occurred.
761         
762         * dom/ScriptedAnimationController.cpp:
763         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
764         (WebCore::ScriptedAnimationController::windowScreenDidChange):
765         (WebCore::ScriptedAnimationController::scheduleAnimation):
766         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
767         * dom/ScriptedAnimationController.h:
768         * page/ChromeClient.h:
769         * platform/graphics/DisplayRefreshMonitor.cpp:
770         (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
771         (WebCore::DisplayRefreshMonitor::create):
772         (WebCore::DisplayRefreshMonitor::addClient):
773         (WebCore::DisplayRefreshMonitor::removeClient):
774         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
775         * platform/graphics/DisplayRefreshMonitor.h:
776         * platform/graphics/DisplayRefreshMonitorClient.cpp:
777         (WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient):
778         * platform/graphics/DisplayRefreshMonitorClient.h:
779         * platform/graphics/DisplayRefreshMonitorManager.cpp:
780         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
781         (WebCore::DisplayRefreshMonitorManager::registerClient):
782         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
783         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
784         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
785         (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
786         * platform/graphics/DisplayRefreshMonitorManager.h:
787         * platform/graphics/GraphicsLayerUpdater.cpp:
788         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
789         (WebCore::GraphicsLayerUpdater::scheduleUpdate):
790         (WebCore::GraphicsLayerUpdater::screenDidChange):
791         (WebCore::GraphicsLayerUpdater::displayRefreshFired):
792         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
793         * platform/graphics/GraphicsLayerUpdater.h:
794         * rendering/RenderLayerCompositor.cpp:
795         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
796         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
797         (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
798         (WebCore::RenderLayerCompositor::flushLayersSoon):
799         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
800         (WebCore::RenderLayerCompositor::startTrackingLayerFlushes):
801         (WebCore::RenderLayerCompositor::layerFlushCount):
802         * rendering/RenderLayerCompositor.h:
803         * testing/Internals.cpp:
804         (WebCore::Internals::startTrackingLayerFlushes):
805         (WebCore::Internals::layerFlushCount):
806         * testing/Internals.h:
807         * testing/Internals.idl:
808
809 2015-04-17  Bem Jones-Bey  <bjonesbe@adobe.com>
810
811         Large values for line-height cause integer overflow in RenderStyle::computedLineHeight
812         https://bugs.webkit.org/show_bug.cgi?id=143863
813
814         Reviewed by Rob Buis.
815
816         When we compute huge values for line-height through percentage or CSS
817         calc, we'll overflow the integer and later on
818         ShapeOutsideInfo::computeDeltasForContainingBlockLine will ASSERT
819         because it expects non-negative line height.  So for the computed
820         line-height, clamp to an integer range to avoid overflow. Note that
821         the code path for percentages here is safe because LayoutUnit clamps
822         to an int on conversion.
823
824         This is based on a Blink patch by Rob Buis.
825
826         Test: fast/shapes/shape-outside-floats/shape-outside-negative-line-height-crash.html
827
828         * rendering/style/RenderStyle.cpp:
829         (WebCore::RenderStyle::computedLineHeight): Clamp line-height to an
830             int to avoid overflow.
831
832 2015-04-17  Beth Dakin  <bdakin@apple.com>
833
834         Force mouse events should go through normal mouse event handling code paths
835         https://bugs.webkit.org/show_bug.cgi?id=143749
836         -and corresponding-
837         rdar://problem/20472895
838
839         Reviewed by Dean Jackson.
840
841         This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and 
842         mouseforcechanged into normal mouse event dispatching code. This patch leaves 
843         behind the cancel and click events because we plan to remove those, and it also 
844         leaves mouseforcewillbegin because that is necessarily a very different event more 
845         tied to the NSImmediateActionGestureRecognizer than these other events which are 
846         tied to NSResponder’s pressureChangeWithEvent.
847
848         New helper functions.
849         * dom/Document.cpp:
850         (WebCore::Document::hasListenerTypeForEventType):
851         * dom/Document.h:
852         * dom/Element.cpp:
853         (WebCore::isForceEvent):
854
855         Move the code to ensure the force events have listeners in order to fire to 
856         dispatchMouseEvent, and delete the old implementations.
857         (WebCore::Element::dispatchMouseEvent):
858         (WebCore::Element::dispatchMouseForceChanged): Deleted.
859         (WebCore::Element::dispatchMouseForceDown): Deleted.
860         (WebCore::Element::dispatchMouseForceUp): Deleted.
861         * dom/Element.h:
862
863         Perform a hit test and pipe the events through dispatchMouseEvent(). 
864         * page/EventHandler.cpp:
865         (WebCore::EventHandler::handleMouseForceEvent):
866         * page/EventHandler.h:
867
868         New types for the new events.
869         * platform/PlatformEvent.h:
870
871         Forward to EventHandler. 
872         * replay/UserInputBridge.cpp:
873         (WebCore::UserInputBridge::handleMouseForceEvent):
874         * replay/UserInputBridge.h:
875
876 2015-04-17  Zalan Bujtas  <zalan@apple.com>
877
878         RenderTableCell::computeCollapsed*Border() should check if the cell is still attached to the render tree.
879         https://bugs.webkit.org/show_bug.cgi?id=143887
880         rdar://problem/20568989
881
882         Reviewed by Simon Fraser.
883
884         Detached table cell has no access to its parent table. This is a speculative fix to
885         avoid dereferencing the invalid table pointer.
886
887         * rendering/RenderTableCell.cpp:
888         (WebCore::RenderTableCell::computeCollapsedStartBorder):
889         (WebCore::RenderTableCell::computeCollapsedEndBorder):
890         (WebCore::RenderTableCell::computeCollapsedBeforeBorder):
891         (WebCore::RenderTableCell::computeCollapsedAfterBorder):
892
893 2015-04-16  Roger Fong  <roger_fong@apple.com>
894
895         Update fullscreen button visibility on fullscreen change.
896         https://bugs.webkit.org/show_bug.cgi?id=143861.
897         <rdar://problem/20143218>
898
899         Reviewed by Eric Carlson.
900
901         * Modules/mediacontrols/mediaControlsApple.js:
902         (Controller): There is no need for hasVisualMedia to be a class variable.
903         (Controller.prototype.handleReadyStateChange):
904         (Controller.prototype.handleFullscreenChange):
905         (Controller.prototype.updateFullscreenButtons):
906
907 2015-04-17  Daniel Bates  <dabates@apple.com>
908
909         REGRESSION: SVG does not support link dragging
910         https://bugs.webkit.org/show_bug.cgi?id=141597
911
912         Reviewed by Darin Adler.
913
914         Fixes an issue where a SVG hyperlink cannot be dragged. We should support
915         dragging an SVG A element just as we support dragging an HTML A element.
916
917         Test: fast/events/drag-and-drop-link.html
918
919         * page/DragController.cpp: Removed explicit include of header Element.h as it will
920         be ultimately included by HTMLAnchorElement.h, among other headers.
921         (WebCore::isDraggableLink): Added. Extracted code from HitTestResult::isLiveLink().
922         (WebCore::DragController::draggableElement): Call WebCore::isDraggableLink() to
923         determine whether a element is a hyperlink that can be dragged.
924         * page/DragController.h:
925         * page/EventHandler.cpp:
926         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Write code in terms of
927          WebCore::isDraggableLink().
928         * rendering/HitTestResult.cpp:
929         (WebCore::HitTestResult::isLiveLink): Deleted.
930         * rendering/HitTestResult.h:
931
932 2015-04-17  Commit Queue  <commit-queue@webkit.org>
933
934         Unreviewed, rolling out r182912 and r182920.
935         https://bugs.webkit.org/show_bug.cgi?id=143881
936
937         Build breakage in some configurations (Requested by ap on
938         #webkit).
939
940         Reverted changesets:
941
942         "Force mouse events should go through normal mouse event
943         handling code paths"
944         https://bugs.webkit.org/show_bug.cgi?id=143749
945         http://trac.webkit.org/changeset/182912
946
947         http://trac.webkit.org/changeset/182920
948
949 2015-04-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
950
951         Fix review comments for https://bugs.webkit.org/show_bug.cgi?id=143590
952         following http://trac.webkit.org/changeset/182876.
953
954         Reviewed by Daniel Bates.
955
956         * ChangeLog:
957         Fixed typo.
958         
959         * style/StyleFontSizeFunctions.cpp:
960         (WebCore::Style::computedFontSizeFromSpecifiedSize):
961         Fixed a typo in an enum definition and changed the name of an argument.
962
963 2015-04-17  Philippe Normand  <pnormand@igalia.com>
964
965         [GStreamer] Silent WebAudio buffers support
966         https://bugs.webkit.org/show_bug.cgi?id=143869
967
968         Reviewed by Carlos Garcia Campos.
969
970         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
971         (webKitWebAudioSrcLoop): Set gap flag on silent buffers. The audio
972         sink can then drop them and avoid un-necessary buffer processing.
973
974 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
975
976         [SOUP] Redirect to non HTTP destination is broken
977         https://bugs.webkit.org/show_bug.cgi?id=143866
978
979         Reviewed by Sergio Villar Senin.
980
981         This is because we are passing true unconditionally as
982         isHTTPFamilyRequest parameter of
983         createSoupRequestAndMessageForHandle in continueAfterWillSendRequest.
984         We don't actually need to pass isHTTPFamilyRequest parameter to
985         createSoupRequestAndMessageForHandle, since it can simply check
986         that from the given request.
987
988         Covered by unit tets and also cache/disk-cache/disk-cache-redirect-to-data.html.
989
990         * platform/network/soup/ResourceHandleSoup.cpp:
991         (WebCore::continueAfterWillSendRequest):
992         (WebCore::createSoupRequestAndMessageForHandle):
993         (WebCore::ResourceHandle::start):
994
995 2015-04-16  Alex Christensen  <achristensen@webkit.org>
996
997         Use less memory when compiling content extensions
998         https://bugs.webkit.org/show_bug.cgi?id=143857
999
1000         Reviewed by Benjamin Poulain.
1001
1002         When compiling a content extension, we convert the rule list into several intermediate forms:
1003
1004         1) A String.
1005         2) A JSValue from JSONParse in loadEncodedRules.
1006         3) A Vector of ContentExtensionRules.
1007         4) A CombinedURLFilters object representing the pieces of the regular expressions from the triggers.
1008         5) A Vector of NFAs.
1009         6) A DFA for each NFA.
1010         7) A Vector of DFABytecode.
1011         
1012         Each one of these contains all the information contained in the content extension,
1013         so we do not need to keep them all in memory at the same time like we are doing now.
1014         When we are done with one, we can free that memory to greatly reduce the maximum memory usage while compiling.
1015         The next step will be to reduce the copies of the original JSON String and to generate NFAs one at a time.
1016
1017         * contentextensions/CombinedURLFilters.cpp:
1018         (WebCore::ContentExtensions::CombinedURLFilters::clear):
1019         * contentextensions/CombinedURLFilters.h:
1020         * contentextensions/ContentExtensionCompiler.cpp:
1021         (WebCore::ContentExtensions::compileRuleList):
1022         Clear structures when finished using them.
1023
1024 2015-04-16  Brady Eidson  <beidson@apple.com>
1025
1026         Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
1027         https://bugs.webkit.org/show_bug.cgi?id=143834
1028
1029         Reviewed by Anders Carlsson.
1030
1031         - Add moveFile() for a WK2 call site to use.
1032         - Remove renameFile() as it is now dead code.
1033
1034         * platform/FileSystem.h:
1035
1036         * platform/gtk/FileSystemGtk.cpp:
1037         (WebCore::renameFile): Deleted.
1038
1039         * platform/mac/FileSystemMac.mm:
1040         (WebCore::moveFile):
1041
1042         * platform/posix/FileSystemPOSIX.cpp:
1043         (WebCore::renameFile): Deleted.
1044
1045         * platform/win/FileSystemWin.cpp:
1046         (WebCore::renameFile): Deleted.
1047
1048 2015-04-16  Roger Fong  <roger_fong@apple.com>
1049
1050         Media element time displays shouldn't wrap.
1051         https://bugs.webkit.org/show_bug.cgi?id=143854.
1052         <rdar://problem/20284766>
1053
1054         Reviewed by Brent Fulgham.
1055
1056         * Modules/mediacontrols/mediaControlsApple.css:
1057         (::-webkit-media-controls): Don't wrap any text.
1058         (audio::-webkit-media-controls-time-remaining-display): Also increase remaining time display width by 1.
1059         (audio::-webkit-media-controls-time-remaining-display.five-digit-time): Ditto.
1060         (audio::-webkit-media-controls-time-remaining-display.six-digit-time): Ditto.
1061
1062 2015-04-16  Chris Dumez  <cdumez@apple.com>
1063
1064         Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop() overrides don't fire events
1065         https://bugs.webkit.org/show_bug.cgi?id=143850
1066
1067         Reviewed by Alexey Proskuryakov.
1068
1069         Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop()
1070         overrides don't fire events as this is not allowed. This would cause
1071         arbitrary JS execution which would be very dangerous in these stages.
1072
1073         Firing JS events from these functions is a common source of crashes.
1074
1075         * Modules/websockets/WebSocket.cpp:
1076         (WebCore::WebSocket::suspend):
1077         (WebCore::WebSocket::resume):
1078         * dom/ScriptExecutionContext.cpp:
1079         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
1080         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
1081         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
1082         * xml/XMLHttpRequest.cpp:
1083         (WebCore::XMLHttpRequest::suspend):
1084         (WebCore::XMLHttpRequest::resume):
1085         (WebCore::XMLHttpRequest::stop):
1086
1087 2015-04-16  Brady Eidson  <beidson@apple.com>
1088
1089         Media element can manipulate DOM during Document destruction.
1090         rdar://problem/20553898 and https://bugs.webkit.org/show_bug.cgi?id=143780
1091
1092         Reviewed by Jer Noble.
1093
1094         * html/HTMLMediaElement.cpp:
1095         (WebCore::HTMLMediaElement::configureMediaControls): Bail if the element has no active document.
1096
1097 2015-04-13  Jer Noble  <jer.noble@apple.com>
1098
1099         [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
1100         https://bugs.webkit.org/show_bug.cgi?id=143680
1101
1102         Reviewed by Simon Fraser.
1103
1104         Add getters for the video's fullscreen layer, and be more tolerant about the order in which setVideoElement() and 
1105         setWebVideoFullscreenInterface are called.
1106
1107         * html/HTMLMediaElement.h:
1108         (WebCore::HTMLMediaElement::videoFullscreenLayer): Added simple getter.
1109         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1110         * platform/ios/WebVideoFullscreenModelVideoElement.h:
1111         (WebCore::WebVideoFullscreenModelVideoElement::videoElement): Added simple getter.
1112         (WebCore::WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Deleted. Moved to .mm file.
1113         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1114         (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement): Initialize ivars in the .h file.
1115         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Call those methods skipped in setVideoElement()
1116             if m_videoFullscreenInterface had not yet been set.
1117         (WebVideoFullscreenModelVideoElement::setVideoElement): Null-check m_videoFullscreenInterface.
1118
1119 2015-04-16  Beth Dakin  <bdakin@apple.com>
1120
1121         Force mouse events should go through normal mouse event handling code paths
1122         https://bugs.webkit.org/show_bug.cgi?id=143749
1123         -and corresponding-
1124         rdar://problem/20472895
1125
1126         Reviewed by Dean Jackson.
1127
1128         This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and 
1129         mouseforcechanged into normal mouse event dispatching code. This patch leaves 
1130         behind the cancel and click events because we plan to remove those, and it also 
1131         leaves mouseforcewillbegin because that is necessarily a very different event more 
1132         tied to the NSImmediateActionGestureRecognizer than these other events which are 
1133         tied to NSResponder’s pressureChangeWithEvent.
1134
1135         New helper functions.
1136         * dom/Document.cpp:
1137         (WebCore::Document::hasListenerTypeForEventType):
1138         * dom/Document.h:
1139         * dom/Element.cpp:
1140         (WebCore::isForceEvent):
1141
1142         Move the code to ensure the force events have listeners in order to fire to 
1143         dispatchMouseEvent, and delete the old implementations.
1144         (WebCore::Element::dispatchMouseEvent):
1145         (WebCore::Element::dispatchMouseForceChanged): Deleted.
1146         (WebCore::Element::dispatchMouseForceDown): Deleted.
1147         (WebCore::Element::dispatchMouseForceUp): Deleted.
1148         * dom/Element.h:
1149
1150         Perform a hit test and pipe the events through dispatchMouseEvent(). 
1151         * page/EventHandler.cpp:
1152         (WebCore::EventHandler::handleMouseForceEvent):
1153         * page/EventHandler.h:
1154
1155         New types for the new events.
1156         * platform/PlatformEvent.h:
1157
1158         Forward to EventHandler. 
1159         * replay/UserInputBridge.cpp:
1160         (WebCore::UserInputBridge::handleMouseForceEvent):
1161         * replay/UserInputBridge.h:
1162
1163 2015-04-16  Tim Horton  <timothy_horton@apple.com>
1164
1165         Sites with both width=device-width and height=device-height load zoomed out
1166         https://bugs.webkit.org/show_bug.cgi?id=143795
1167         <rdar://problem/20369671>
1168
1169         Reviewed by Ben Poulain.
1170
1171         * page/ViewportConfiguration.cpp:
1172         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
1173         Some sites specify both width=device-width and height=device-height, and
1174         then lay out to device width but with a large amount of vertically scrollable content
1175         (so, height=device-height was a lie).
1176
1177         In all other cases where we use device-width and device-height, we prefer
1178         width=device-width over height=device-height, but in the code to ignore scaling constraints,
1179         the two paths were completely separate. On sites that specify both, this
1180         resulted in us attempting to zoom out to fit the entire height of the very tall page,
1181         which isn't at all what we wanted. So, ignore height=device-height if a width is specified.
1182
1183 2015-04-16  Chris Dumez  <cdumez@apple.com>
1184
1185         Regression(r182517): WebSocket::suspend() causes error event to be fired
1186         https://bugs.webkit.org/show_bug.cgi?id=143806
1187         <rdar://problem/20559812>
1188
1189         Reviewed by Alexey Proskuryakov.
1190
1191         WebSocket::suspend() causes an error event to be fired after r182517.
1192         This is not allowed as firing the event could trigger arbitrary JS
1193         execution, which is no longer allowed at this point.
1194
1195         This patch delays the error event firing until after
1196         WebSocket::resume() is called, similarly to what we already do for
1197         the close event.
1198
1199         Also add assertions in WebSocket::suspend() / WebSocket::resume()
1200         that will be hit if JS events are fired from within these functions.
1201         The pre-existing closed-when-entering-page-cache.html test is hitting
1202         one of these assertions without the fix above.
1203
1204         Tests:
1205           - http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
1206           - http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html
1207
1208         * Modules/websockets/WebSocket.cpp:
1209         (WebCore::WebSocket::suspend):
1210         (WebCore::WebSocket::resume):
1211         (WebCore::WebSocket::resumeTimerFired):
1212         (WebCore::WebSocket::stop):
1213         (WebCore::WebSocket::didReceiveMessageError):
1214         (WebCore::WebSocket::didClose):
1215         (WebCore::WebSocket::dispatchOrQueueEvent):
1216         * Modules/websockets/WebSocket.h:
1217
1218 2015-04-15  Roger Fong  <roger_fong@apple.com>
1219
1220         Adjustments to button graphics for media controls.
1221         https://bugs.webkit.org/show_bug.cgi?id=143797.
1222         <rdar://problem/20083708>
1223
1224         Reviewed by Dean Jackson.
1225
1226         These changes are visual in nature and mainly affect the buttons.
1227         I've gotten rid of the text-shadow for all the buttons,
1228         used plus-lighter blending mode and changed the button opacity to reflect the specs,
1229         and made all the buttons turn opaque white when active.
1230
1231         * Modules/mediacontrols/mediaControlsApple.css:
1232         (audio::-webkit-media-controls-panel button):
1233         (audio::-webkit-media-controls-rewind-button):
1234         (audio::-webkit-media-controls-play-button):
1235         (audio::-webkit-media-controls-play-button.paused):
1236         (video::-webkit-media-controls-volume-max-button):
1237         (video::-webkit-media-controls-volume-slider):
1238         (video::-webkit-media-controls-volume-min-button):
1239         (audio::-webkit-media-controls-wireless-playback-picker-button):
1240         (audio::-webkit-media-controls-toggle-closed-captions-button):
1241         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
1242         (audio::-webkit-media-controls-fullscreen-button):
1243         (audio::-webkit-media-controls-fullscreen-button.exit):
1244         (audio::-webkit-media-controls-status-display):
1245         (audio::-webkit-media-controls-timeline):
1246         (audio::-webkit-media-controls-time-remaining-display):
1247         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
1248         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
1249         (video:-webkit-full-screen::-webkit-media-controls-play-button):
1250         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
1251         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
1252         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
1253         (video::-webkit-media-controls-volume-max-button:active):
1254         (video::-webkit-media-controls-volume-min-button:active):
1255         (audio::-webkit-media-controls-toggle-closed-captions-button:active):
1256         (audio::-webkit-media-controls-rewind-button:active):
1257         (audio::-webkit-media-controls-play-button:active):
1258         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button:active):
1259         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button:active):
1260         (video:-webkit-full-screen::-webkit-media-controls-play-button:active):
1261         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button:active):
1262         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button:active):
1263         (audio::-webkit-media-controls-fullscreen-button:active):
1264
1265         Using the pseudo id itself here currently does not work, which is why we rely on the button.* selector for these.
1266         (video:-webkit-full-screen::-webkit-media-controls-panel button.paused:active):
1267         (audio::-webkit-media-controls-panel button.paused:active):
1268         (audio::-webkit-media-controls-panel button.exit:active):
1269  
1270         Draw volume slider knob as opaque white when active.
1271         Adjust colors of timeline and volume sliders now that we are using plus-lighter blending.
1272         * Modules/mediacontrols/mediaControlsApple.js:
1273         (Controller):
1274         (Controller.prototype.createControls):
1275         (Controller.prototype.handleVolumeSliderMouseDown):
1276         (Controller.prototype.handleVolumeSliderMouseUp):
1277         (Controller.prototype.drawTimelineBackground):
1278         (Controller.prototype.drawVolumeBackground):
1279
1280 2015-04-15  Simon Fraser  <simon.fraser@apple.com>
1281
1282         Pull emoji-position adjustment code into its own function
1283         https://bugs.webkit.org/show_bug.cgi?id=143592
1284
1285         Reviewed by Myles C. Maxfield.
1286
1287         First step to cleaning up FontCascade::drawGlyphs(). Pull iOS-only code related to
1288         emoji positioning into its own function.
1289
1290         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1291         (WebCore::pointAdjustedForEmoji):
1292         (WebCore::FontCascade::drawGlyphs):
1293
1294 2015-04-16  Myles C. Maxfield  <mmaxfield@apple.com>
1295
1296         [iOS] Delete hardcoded font fallback tables
1297         https://bugs.webkit.org/show_bug.cgi?id=143583
1298
1299         Reviewed by Darin Adler
1300
1301         Instead of hardcoding which font to use for a particular character, use
1302         CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage().
1303
1304         Updated test expected results:
1305             editing/selection/vertical-rl-rtl-extend-line-backward-br.html
1306             editing/selection/vertical-rl-rtl-extend-line-backward-p.html
1307             editing/selection/vertical-rl-rtl-extend-line-forward-br.html
1308             editing/selection/vertical-rl-rtl-extend-line-forward-p.html
1309             fast/text/international/danda-space.html
1310             fast/text/international/thai-baht-space.html
1311
1312         * platform/graphics/ios/FontCacheIOS.mm:
1313         (WebCore::FontCache::getSystemFontFallbackForCharacters):
1314         (WebCore::FontCache::systemFallbackForCharacters):
1315         * platform/spi/cocoa/CoreTextSPI.h:
1316
1317 2015-04-16  Per Arne Vollan  <peavo@outlook.com>
1318
1319         [WinCairo] Compile error when environment variable WEBKITLIBRARIESDIR is not defined.
1320         https://bugs.webkit.org/show_bug.cgi?id=143828
1321
1322         Reviewed by Brent Fulgham.
1323
1324         Python throws an exception when calling os.environ['WEBKITLIBRARIESDIR'] and
1325         WEBKITLIBRARIESDIR is not defined. WEBKITLIBRARIESDIR is obsolete, we can remove it.
1326
1327         * AVFoundationSupport.py:
1328         (lookFor):
1329
1330 2015-04-16  Alexey Proskuryakov  <ap@apple.com>
1331
1332         Minor AudioContext cleanup
1333         https://bugs.webkit.org/show_bug.cgi?id=143816
1334
1335         Reviewed by Jer Noble.
1336
1337         * Modules/webaudio/AudioContext.cpp:
1338         (WebCore::AudioContext::~AudioContext):
1339         (WebCore::AudioContext::lazyInitialize):
1340         (WebCore::AudioContext::stop):
1341         (WebCore::AudioContext::derefNode):
1342         (WebCore::AudioContext::scheduleNodeDeletion):
1343         (WebCore::AudioContext::deleteMarkedNodes):
1344         (WebCore::AudioContext::stopDispatch): Deleted.
1345         (WebCore::AudioContext::deleteMarkedNodesDispatch): Deleted.
1346         * Modules/webaudio/AudioContext.h:
1347
1348         * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::~AudioNode):
1349
1350 2015-04-16  Chris Dumez  <cdumez@apple.com>
1351
1352         Unreviewed attempt to fix Windows build after r182881.
1353
1354         Add missing header include.
1355
1356         * page/PageConsoleClient.h:
1357
1358 2015-04-16  Chris Dumez  <cdumez@apple.com>
1359
1360         Tests introduced in r182877 are flaky
1361         https://bugs.webkit.org/show_bug.cgi?id=143784
1362
1363         Reviewed by Alexey Proskuryakov.
1364
1365         Tests introduced in r182877 are flaky as the line number sometimes
1366         appears in the console messages. This patch updates the console
1367         logging code so that no Document is provided when logging. Therefore,
1368         no line number will ever be displayed. In this case, I don't think
1369         having the line number is terribly useful anyway.
1370
1371         * css/StyleSheetContents.cpp:
1372         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1373
1374 2015-04-15  Simon Fraser  <simon.fraser@apple.com>
1375
1376         We should dump GraphicsLayer's anchorPoint z component
1377         https://bugs.webkit.org/show_bug.cgi?id=143815
1378
1379         Reviewed by Tim Horton.
1380
1381         We didn't include the z component of a layer's anchor point when dumping.
1382         Dump if it's non-zero (to avoid having to change lots of test output).
1383         No test with non-zero z appears to dump layers.
1384
1385         * platform/graphics/GraphicsLayer.cpp:
1386         (WebCore::GraphicsLayer::dumpProperties):
1387         * rendering/style/RenderStyle.cpp:
1388         (WebCore::requireTransformOrigin): Remove a FIXME which, on further consideration,
1389         is wrong.
1390
1391 2015-04-15  Brent Fulgham  <bfulgham@apple.com>
1392
1393         [Mac] Disable "Save to Downloads" option for local files
1394         https://bugs.webkit.org/show_bug.cgi?id=143794
1395
1396         Reviewed by Tim Horton.
1397
1398         Disable the Image and Media download options if the download
1399         target is a local file. We can only download web resources;
1400         anything else is actually a no-op.
1401
1402         * page/ContextMenuController.cpp:
1403         (WebCore::ContextMenuController::checkOrEnableIfNeeded): Disable
1404         menu item if appropriate.
1405
1406 2015-04-15  Chris Dumez  <cdumez@apple.com>
1407
1408         Add a console message when a stylesheet is not parsed due to invalid MIME type
1409         https://bugs.webkit.org/show_bug.cgi?id=143784
1410
1411         Reviewed by Joseph Pecoraro.
1412
1413         After r180020, we no longer have a quirks mode exception for CSS MIME
1414         types. This means that we'll start rejecting stylesheets that were
1415         previously accepted due to this quirk. In this case we log a console
1416         message to help Web developers understand why their stylesheet is being
1417         rejected.
1418
1419         * css/StyleRuleImport.cpp:
1420         (WebCore::StyleRuleImport::setCSSStyleSheet):
1421
1422         * css/StyleSheetContents.cpp:
1423         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1424         - Initialize hasValidMIMEType to true so that it ends up being false
1425           only when canUseSheet(hasValidMIMEType) is called and we've determined
1426           the MIME type is indeed invalid. Otherwise, hasValidMIMEType would
1427           also be false when m_data is null or empty in
1428           CachedCSSStyleSheet::sheetText() and we don't want to display the MIME
1429           type error in this case.
1430         - If hasValidMIMEType is false, display the console message and abort
1431           early. We don't need to execute the rest of the function in this case
1432           as sheetText is a null String and there is no point in trying to parse
1433           it.
1434         - Drop handling of !hasValidMIMEType && !hasSyntacticallyValidCSSHeader()
1435           as this can no longer be reached. This handling no longer makes sense
1436           after r180020 as sheetText() will now always return a null String if
1437           the MIME type is invalid (as we no longer support the CSS MIME type
1438           quirks mode).
1439
1440         * css/StyleSheetContents.h:
1441         * html/HTMLLinkElement.cpp:
1442         (WebCore::HTMLLinkElement::setCSSStyleSheet):
1443
1444 2015-04-15  Said Abou-Hallawa  <said@apple.com>
1445
1446         Minimum font size pref breaks SVG text very badly.
1447         https://bugs.webkit.org/show_bug.cgi?id=143590.
1448
1449         Reviewed by Simon Fraser.
1450
1451         When enabling the minimum font size perf, the computed font size is set
1452         to the minimum font size if the computed value is smaller than the minimum.
1453         The bug happens because the SVG text element applies its scaling on the
1454         computed value after applying the minimum font size rule. This means the
1455         final computed value for the font size will be the scaling of the minimum
1456         font size and not minimum font size itself. What we need is to postpone
1457         applying the minimum font size rules, till the SVG scaling is applied.
1458
1459         Tests: svg/text/font-small-enlarged-minimum-larger.svg
1460                svg/text/font-small-enlarged-minimum-smaller.svg
1461
1462         * rendering/svg/RenderSVGInlineText.cpp:
1463         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle): Call
1464         computedFontSizeFromSpecifiedSizeForSVGInlineText() even if scalingFactor
1465         is 1. We need to make sure the minimum font size rules are applied. This
1466         function was assuming the mininum font size rule was applied when resolving
1467         the style. This is not true anymore for the SVG text.
1468
1469         * style/StyleFontSizeFunctions.cpp:
1470         (WebCore::Style::computedFontSizeFromSpecifiedSize): Do not apply the
1471         minimum size rules for the SVG element until it applies its scaling to
1472         the font size.
1473
1474 2015-04-15  Mark Lam  <mark.lam@apple.com>
1475
1476         Remove obsolete VMInspector debugging tool.
1477         https://bugs.webkit.org/show_bug.cgi?id=143798
1478
1479         Reviewed by Michael Saboff.
1480
1481         No new tests needed.  Just removing obsolete code.
1482
1483         * ForwardingHeaders/interpreter/VMInspector.h: Removed.
1484
1485 2015-04-15  Timothy Horton  <timothy_horton@apple.com>
1486
1487         Custom CSS cursors do not use -webkit-image-set on retina displays
1488         https://bugs.webkit.org/show_bug.cgi?id=120783
1489         <rdar://problem/14921432>
1490
1491         Reviewed by Beth Dakin.
1492         Patch by Evan Wallace <evan.exe@gmail.com>.
1493
1494         Scale NSCursor images correctly so custom CSS cursors work with
1495         -webkit-image-set on retina displays.
1496
1497         * WebCore.exp.in:
1498         * page/EventHandler.cpp:
1499         (WebCore::EventHandler::selectCursor):
1500         * platform/mac/CursorMac.mm:
1501         (WebCore::createCustomCursor):
1502         (WebCore::Cursor::ensurePlatformCursor):
1503
1504 2015-04-15  Alexey Proskuryakov  <ap@apple.com>
1505
1506         No thread safety when passing ThreadableLoaderOptions from a worker thread
1507         https://bugs.webkit.org/show_bug.cgi?id=143790
1508
1509         Reviewed by Geoffrey Garen.
1510
1511         * loader/ThreadableLoader.h:
1512         * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): Added.
1513
1514         * loader/WorkerThreadableLoader.cpp:
1515         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Don't just send
1516         a structure with strings to a different thread, that's bad.
1517
1518         * platform/CrossThreadCopier.h: I think that this is dead code, but for this bug,
1519         just removing a clearly wrong specialization.
1520
1521 2015-04-15  Alex Christensen  <achristensen@webkit.org>
1522
1523         Progress towards CMake on Mac.
1524         https://bugs.webkit.org/show_bug.cgi?id=143785
1525
1526         Reviewed by Csaba Osztrogonác.
1527
1528         * CMakeLists.txt:
1529         * PlatformMac.cmake:
1530
1531 2015-04-15  Daniel Bates  <dabates@apple.com>
1532
1533         Clean up: Have SVGTextLayoutEngine::beginTextPathLayout() take a reference to a
1534         RenderSVGTextPath instead of a pointer
1535         https://bugs.webkit.org/show_bug.cgi?id=143787
1536
1537         Reviewed by Andreas Kling.
1538
1539         SVGTextLayoutEngine::beginTextPathLayout() assumes that the passed RenderObject is a
1540         non-null pointer to a RenderSVGTextPath object. Instead we should have this function take a
1541         reference to a RenderSVGTextPath object to help callers catch bad usage and better document
1542         the expectation of a valid RenderSVGTextPath object.
1543
1544         * rendering/svg/SVGRootInlineBox.cpp:
1545         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Downcast the renderer of the
1546         inline box to a RenderSVGTextPath object and pass it to SVGTextLayoutEngine::beginTextPathLayout().
1547         We ensured that this cast is safe earlier in this function.
1548         SVGTextLayoutEngine::beginTextPathLayout().
1549         * rendering/svg/SVGTextLayoutEngine.cpp:
1550         (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Change type of first parameter from
1551         RenderObject* to RenderSVGTextPath. Remove ASSERT() that was checking for a non-null
1552         RenderObject pointer since we are passing the renderer by reference and a well-formed
1553         reference must refer to a valid object.
1554         * rendering/svg/SVGTextLayoutEngine.h: Substitute RenderSVGTextPath& for RenderObject*.
1555
1556 2015-04-13  Jer Noble  <jer.noble@apple.com>
1557
1558         [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
1559         https://bugs.webkit.org/show_bug.cgi?id=143674
1560
1561         Reviewed by Darin Adler.
1562
1563         * html/HTMLMediaElement.cpp:
1564         (WebCore::HTMLMediaElement::enterFullscreen): Pass a reference.
1565         (WebCore::HTMLMediaElement::exitFullscreen): exitVideoFullscreen() -> exitVideoFullscreenForVideoElement(...).
1566         * page/ChromeClient.h:
1567
1568 2015-04-14  Anders Carlsson  <andersca@apple.com>
1569
1570         Make creating send rights from shared memory more robust
1571         https://bugs.webkit.org/show_bug.cgi?id=143730
1572         rdar://problem/16595870
1573
1574         Reviewed by Darin Adler.
1575
1576         Add a bool conversion operator to MachSendRight and tidy up the default constructor.
1577
1578         * platform/cocoa/MachSendRight.h:
1579         (WebCore::MachSendRight::operator bool):
1580         (WebCore::MachSendRight::MachSendRight): Deleted.
1581
1582 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
1583
1584         Generalize "isPlayingAudio" to include other media characteristics
1585         https://bugs.webkit.org/show_bug.cgi?id=143713
1586
1587         Reviewed by Jer Noble.
1588
1589         No new functionality.
1590
1591         * Modules/webaudio/AudioContext.cpp:
1592         (WebCore::AudioContext::stop): updateIsPlayingAudio -> updateIsPlayingMedia.
1593         (WebCore::AudioContext::isPlayingAudioDidChange): Ditto.
1594
1595         * dom/Document.cpp:
1596         (WebCore::Document::addAudioProducer): Ditto.
1597         (WebCore::Document::removeAudioProducer): Ditto.
1598         (WebCore::Document::updateIsPlayingMedia): Renamed.
1599         (WebCore::Document::updateIsPlayingAudio): Deleted.
1600         * dom/Document.h:
1601
1602         * html/HTMLMediaElement.cpp:
1603         (WebCore::HTMLMediaElement::setMuted): updateIsPlayingAudio -> updateIsPlayingMedia.
1604         (WebCore::HTMLMediaElement::setPlaying): Ditto.
1605
1606         * page/ChromeClient.h:
1607         * page/Page.cpp:
1608         (WebCore::Page::updateIsPlayingMedia): Renamed.
1609         (WebCore::Page::updateIsPlayingAudio): Deleted.
1610         * page/Page.h:
1611
1612 2015-04-15  Joonghun Park  <jh718.park@samsung.com>
1613
1614         Fix Debug build error 'comparison of unsigned expression >= 0 is always true [-Werror=type-limits]'
1615         https://bugs.webkit.org/show_bug.cgi?id=143751
1616
1617         Reviewed by Csaba Osztrogonác.
1618
1619         No new tests, no new behaviors.
1620
1621         * rendering/svg/SVGTextChunk.cpp:
1622         (WebCore::SVGTextChunk::SVGTextChunk):
1623
1624 2015-04-14  Zalan Bujtas  <zalan@apple.com>
1625
1626         Make inline continuation style change logic consistent.
1627         https://bugs.webkit.org/show_bug.cgi?id=143737
1628         rdar://problem/20486596
1629
1630         Reviewed by Simon Fraser.
1631
1632         Do not force RenderBlock type-casting on the first sibling of the continuation's container.
1633         The first sibling of the container of a continuation should be handled as the rest of the siblings.
1634
1635         Test: fast/inline/inline-with-column-span-and-remove-block-child-crash.html
1636
1637         * rendering/RenderInline.cpp:
1638         (WebCore::updateStyleOfAnonymousBlockContinuations):
1639         (WebCore::RenderInline::styleDidChange):
1640
1641 2015-04-14  Chris Dumez  <cdumez@apple.com>
1642
1643         Regression(r180020): Web Inspector crashes on pages that have a stylesheet with an invalid MIME type
1644         https://bugs.webkit.org/show_bug.cgi?id=143745
1645         <rdar://problem/20243916>
1646
1647         Reviewed by Joseph Pecoraro.
1648
1649         After r180020, we are stricter and no longer accept CSS resources that
1650         are not served with a CSS MIME type. Showing Web inspector on a page
1651         with such bad resource would crash because
1652         InspectorPageAgent::cachedResourceContent() would return true but
1653         the result String would be null. This null String would then later
1654         be passed to the Yarr interpreter and crash on a String::is8Bit()
1655         call.
1656
1657         cachedResourceContent() calls CachedCSSStyleSheet::sheetText(). Before
1658         r180020, it would return the text, even if the MIME type was incorrect.
1659         However, this is no longer the case and we now need to make sure that
1660         cachedResourceContent() returns false if sheetText() returns a null
1661         String.
1662
1663         Test: http/tests/inspector/css/bad-mime-type.html
1664
1665         * inspector/InspectorPageAgent.cpp:
1666         (WebCore::InspectorPageAgent::cachedResourceContent):
1667
1668 2015-04-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1669
1670         textPath layout performance improvement.
1671         https://bugs.webkit.org/show_bug.cgi?id=141570.
1672
1673         Reviewed by Darin Adler.
1674
1675         The bottleneck of the text-on-path performance is the position and angle
1676         calculations for every single character. If the number of characters is
1677         'n' and the number of path elements is 'm', the total number of processing
1678         the path elements is O(2 x n x m). What makes it really worse is, for every
1679         curve we keep splitting the curve till the split curve is almost a straight
1680         line. The changes we need to do are:
1681         1. Merge the position and the angle traversals in one pass since they are
1682            returning info for the same length on the path. There is a degenerate
1683            case for the starting point when calculating the angle. The original
1684            code was solving this problem by passing an epsilon instead of zero but
1685            because traversing the path for position and angle are now merged, we
1686            will pass zero for the starting point as is. All we need is to move one
1687            step ahead without moving the position. We need the extra step forward
1688            to calculate the slope of the path at the starting point.
1689         2. We need to add a new mode to traversing a path. The new mode will take
1690            a vector of lengths and returns a vector of arrow vectors. Every arrow
1691            vector represents a position and an angle on the path at a certain length.
1692            This requires changing the SVGTextLayoutEngine to calculate the lengths
1693            of the characters on the curve first and then passing all of them to the
1694            path traversal function. Instead of traversing the path for every length,
1695            we are going to get the required point and angle from the vector of arrow
1696            vectors.
1697
1698         This patch is addressing the first fix only. The second one will require
1699         refactoring the SVGTextLayoutEngine so I am going to address it in a
1700         different patch.
1701
1702         * platform/graphics/Path.cpp:
1703         (WebCore::pathLengthApplierFunction): It is cleaner to move the function
1704         of this method to PathTraversalState::processPathElement().
1705         
1706         (WebCore::Path::length): Use new enum Action value and access methods.
1707         
1708         (WebCore::Path::traversalStateAtLength): New function which returns the
1709         traversalState at a certain length on a path.
1710         
1711         (WebCore::Path::pointAtLength):
1712         (WebCore::Path::normalAngleAtLength): Use traversalStateAtLength() to get
1713         the traversalState and from it return either the position or the angle.
1714         
1715         * platform/graphics/Path.h: Define traversalStateAtLength().
1716         
1717         * platform/graphics/PathTraversalState.cpp:
1718         (WebCore::distanceLine): Code clean up.
1719         
1720         (WebCore::curveLength): Make the setting of m_previous and m_current happens
1721         only in this function.
1722         
1723         (WebCore::PathTraversalState::PathTraversalState): Add an optional parameter
1724         for the desired length and move the initialization of the other members to
1725         the class definition.
1726         
1727         (WebCore::PathTraversalState::closeSubpath):
1728         (WebCore::PathTraversalState::moveTo):
1729         (WebCore::PathTraversalState::lineTo): Add the distance to the m_totalLength
1730         instead of returning it since this is what all the callers were doing.
1731         
1732         (WebCore::PathTraversalState::quadraticBezierTo):
1733         (WebCore::PathTraversalState::cubicBezierTo): Add the distance to the
1734         m_totalLength. Move the setting of m_previous and m_current to curveLength().
1735         Remove unused members m_control1 and m_control2.
1736
1737         (WebCore::PathTraversalState::processSegment): Deleted.        
1738         (WebCore::PathTraversalState::finalizeAppendPathElement): Create a new
1739         name for the function. Handle the case of the angle at the starting point
1740         where m_desiredLength is set to zero. The new flag m_isZeroVector will be
1741         set to notify the caller that the  next iteration will be the last one and
1742         it is only needed for the calculating the angle of a zero vector. m_current
1743         should not change by this last iteration.
1744         
1745         (WebCore::PathTraversalState::appendPathElement): This code is moved from
1746         pathLengthApplierFunction().
1747         
1748         (WebCore::PathTraversalState::processPathElement): This function is used
1749         by the class Path. It is a wrapper for appendPathElement(). If m_isZeroVector
1750         is set we append the new element to a copy for the PathTraversalState just
1751         to get the angle for the zero vector.
1752
1753         * platform/graphics/PathTraversalState.h: Change the enum values to not
1754         not include the class or the enum class. Make the data members private and
1755         expose the needed ones through access methods. Make all the internal methods
1756         to be private.
1757         
1758         (WebCore::PathTraversalState::processPathElement):  Another wrapper for
1759         appendPathElement() which is used by SVGPathTraversalStateBuilder.
1760         
1761         (WebCore::PathTraversalState::action):
1762         (WebCore::PathTraversalState::setAction):
1763         (WebCore::PathTraversalState::desiredLength):
1764         (WebCore::PathTraversalState::setDesiredLength):
1765         (WebCore::PathTraversalState::success):
1766         (WebCore::PathTraversalState::totalLength):
1767         (WebCore::PathTraversalState::current):
1768         (WebCore::PathTraversalState::normalAngle): New access methods which are now
1769         needed after making the data members private.
1770         
1771         * rendering/svg/SVGRootInlineBox.cpp:
1772         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Make the casting
1773         of the renderer on the caller side.
1774         
1775         * rendering/svg/SVGTextChunk.cpp:
1776         (WebCore::SVGTextChunk::SVGTextChunk): The constructor should append the
1777         elements of m_boxes instead of making this from outside the class.
1778         
1779         (WebCore::SVGTextChunk::totalCharacters):
1780         (WebCore::SVGTextChunk::totalLength):
1781         (WebCore::SVGTextChunk::calculateLength): Deleted.
1782         Replace calculateLength() by totalCharacters() and totalLength() to make
1783         the interface cleaner.
1784         
1785         (WebCore::SVGTextChunk::totalAnchorShift):
1786         (WebCore::SVGTextChunk::calculateTextAnchorShift): Deleted.
1787         Rename the function name.
1788         
1789         (WebCore::SVGTextChunk::layout):
1790         (WebCore::SVGTextChunk::processTextLengthSpacingCorrection):
1791         (WebCore::SVGTextChunk::buildBoxTransformations):
1792         (WebCore::SVGTextChunk::boxSpacingAndGlyphsTransform):
1793         (WebCore::SVGTextChunk::processTextAnchorCorrection):
1794         Move the chunk layout code from SVGTextChunkBuilder::layoutTextChunks()
1795         to the SVGTextChunk::layout(). Move all the helper functions as well.
1796         
1797         * rendering/svg/SVGTextChunk.h:
1798         (WebCore::SVGTextChunk::hasTextAnchor):
1799         (WebCore::SVGTextChunk::boxes): Deleted.
1800         Add the new methods and change most of the public methods to be private.
1801         
1802         * rendering/svg/SVGTextChunkBuilder.cpp:
1803         (WebCore::SVGTextChunkBuilder::totalCharacters):
1804         (WebCore::SVGTextChunkBuilder::totalLength):
1805         (WebCore::SVGTextChunkBuilder::totalAnchorShift): This code is moved from
1806         SVGTextLayoutEngine. It scans the boxes stored in the SVGTextChunkBuilder
1807         and sums up the total values.
1808         
1809         (WebCore::SVGTextChunkBuilder::transformationForTextBox):
1810         (WebCore::SVGTextChunkBuilder::buildTextChunks):
1811         (WebCore::SVGTextChunkBuilder::layoutTextChunks): Code clean up.
1812         
1813         (WebCore::SVGTextChunkBuilder::addTextChunk): Deleted.
1814         (WebCore::SVGTextChunkBuilder::processTextChunk): Deleted.
1815         (WebCore::SVGTextChunkBuilder::processTextLengthSpacingCorrection): Deleted.
1816         (WebCore::SVGTextChunkBuilder::processTextAnchorCorrection): Deleted.
1817         (WebCore::SVGTextChunkBuilder::buildSpacingAndGlyphsTransform): Deleted.
1818         This code now lives in SVGTextChunk.
1819         
1820         * rendering/svg/SVGTextChunkBuilder.h: Add new methods for code which was
1821         moved from SVGTextLayoutEngine and remove methods for code which was removed
1822         to SVGTextChunk.
1823         
1824         * rendering/svg/SVGTextLayoutEngine.cpp:
1825         (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Use the sum up methods
1826         from SVGTextChunkBuilder instead of looping through the chunks. Also get a
1827         clean order for defining variables and doing the calculations.
1828         
1829         (WebCore::SVGTextLayoutEngine::finalizeTransformMatrices): Code clean up.
1830         
1831         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Do a single path
1832         traversal to get the position and the angle for a length on a path.
1833         
1834         * svg/SVGAnimateMotionElement.cpp:
1835         (WebCore::SVGAnimateMotionElement::buildTransformForProgress): Do a single
1836         path traversal to get the position and the angle at a length on a path.
1837         
1838         * svg/SVGPathTraversalStateBuilder.cpp:
1839         (WebCore::SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder):
1840         (WebCore::SVGPathTraversalStateBuilder::moveTo):
1841         (WebCore::SVGPathTraversalStateBuilder::lineTo):
1842         (WebCore::SVGPathTraversalStateBuilder::curveToCubic):
1843         (WebCore::SVGPathTraversalStateBuilder::closePath):
1844         (WebCore::SVGPathTraversalStateBuilder::setDesiredLength):
1845         (WebCore::SVGPathTraversalStateBuilder::continueConsuming):
1846         (WebCore::SVGPathTraversalStateBuilder::totalLength):
1847         (WebCore::SVGPathTraversalStateBuilder::currentPoint):
1848         (WebCore::SVGPathTraversalStateBuilder::incrementPathSegmentCount): Deleted.
1849         (WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex): Deleted.
1850         * svg/SVGPathTraversalStateBuilder.h:
1851         (WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex):
1852         Code clean up.
1853         
1854         * svg/SVGPathUtilities.cpp:
1855         (WebCore::getSVGPathSegAtLengthFromSVGPathByteStream):
1856         (WebCore::getTotalLengthOfSVGPathByteStream):
1857         (WebCore::getPointAtLengthOfSVGPathByteStream): Use new TraversalState::Action
1858         enum values.
1859
1860 2015-04-14  Simon Fraser  <simon.fraser@apple.com>
1861
1862         Re-enable custom dilation for antialiased fonts
1863         https://bugs.webkit.org/show_bug.cgi?id=143738
1864
1865         Reviewed by Tim Horton.
1866         
1867         Enabling custom dilation for antialised fonts broke layout tests, so re-land it,
1868         but disable in WebKitTestRunner and DumpRenderTree. The latter requires adding
1869         a private WebKit pref. This pref defaults to YES, enabling the feature by default
1870         in WK1 as we do for WK2.
1871
1872         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1873         (WebCore::dilationSizeForTextColor):
1874         (WebCore::FontCascade::drawGlyphs):
1875
1876 2015-04-14  Andy Estes  <aestes@apple.com>
1877
1878         [Content Filtering] Use ASSERT_WITH_SECURITY_IMPLICATION for verifying types from NEFilterSource
1879         https://bugs.webkit.org/show_bug.cgi?id=143742
1880
1881         Reviewed by David Kilzer.
1882
1883         * platform/cocoa/NetworkExtensionContentFilter.mm:
1884         (replacementDataFromDecisionInfo): ASSERT_WITH_SECURITY_IMPLICATION that decisionInfo is really a NSDictionary.
1885         (WebCore::NetworkExtensionContentFilter::handleDecision): ASSERT_WITH_SECURITY_IMPLICATION that replacementData is really a NSData.
1886
1887 2015-04-14  Brent Fulgham  <bfulgham@apple.com>
1888
1889         Correct layering violation in DumpRenderTree Build
1890         https://bugs.webkit.org/show_bug.cgi?id=143732
1891
1892         Reviewed by Simon Fraser.
1893
1894         * testing/js/WebCoreTestSupport.cpp:
1895         (WebCoreTestSupport::monitorWheelEvents): Added. Provides a wrapper around
1896         the internal WebCore objects needed to implement this function.
1897         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
1898         * testing/js/WebCoreTestSupport.h:
1899
1900 2015-04-14  Brady Eidson  <beidson@apple.com>
1901
1902         Make sure media element loads hit content filter extensions.
1903         <rdar://problem/20014012> and https://bugs.webkit.org/show_bug.cgi?id=143731
1904
1905         Reviewed by Jer Noble.
1906
1907         Tests: http/tests/contentextensions/media-filtered.html
1908                http/tests/contentextensions/text-track-blocked.html
1909
1910         * html/HTMLMediaElement.cpp:
1911         (WebCore::HTMLMediaElement::parseAttribute): Skip loads that are filtered.
1912
1913 2015-04-14  Brian Weinstein  <bweinstein@apple.com>
1914
1915         Add SPI to clear HSTS hosts added since a date.
1916         https://bugs.webkit.org/show_bug.cgi?id=143726
1917         and
1918         rdar://problem/16664597
1919
1920         Declare _CFNetworkResetHSTSHostsSinceDate in CFNetworkSPI.h.
1921
1922         Reviewed by Anders Carlsson.
1923
1924         * platform/spi/cf/CFNetworkSPI.h:
1925
1926 2015-04-14  Roger Fong  <roger_fong@apple.com>
1927
1928         Unreviewed. Time numbers on media controls move as they update on OSX.
1929         <rdar://problem/20141790>.
1930
1931         * Modules/mediacontrols/mediaControlsApple.css:
1932         (audio::-webkit-media-controls-current-time-display):
1933         (audio::-webkit-media-controls-time-remaining-display):
1934         Don't bother justifying content to end. We size the box to fit the time displays exactly anyways.
1935
1936 2015-04-14  Roger Fong  <roger_fong@apple.com>
1937
1938         Insert volume control in correct place after exiting wireless play.
1939         https://bugs.webkit.org/show_bug.cgi?id=143721.
1940         <rdar://problem/20526106>
1941
1942         Reviewed by Darin Adler.
1943
1944         * Modules/mediacontrols/mediaControlsApple.js:
1945         (Controller.prototype.updateWirelessPlaybackStatus):
1946
1947 2015-04-14  Brady Eidson  <beidson@apple.com>
1948
1949         Media elements not in a page shouldn't load.
1950         https://bugs.webkit.org/show_bug.cgi?id=143720
1951
1952         Reviewed by Jer Noble.
1953
1954         No new tests (Theoretical problem noticed in code review).
1955
1956         * html/HTMLMediaElement.cpp:
1957         (WebCore::HTMLMediaElement::loadResource): Make sure the frame is in a page.
1958
1959 2015-04-14  Simon Fraser  <simon.fraser@apple.com>
1960
1961         [iOS] Clean up registration of layers with the ScrollingCoordinator
1962         https://bugs.webkit.org/show_bug.cgi?id=143725
1963
1964         Reviewed by Tim Horton.
1965
1966         Simplify a couple of bits of code related to the registration of layers with
1967         the ScrollingCoordinator in RenderLayerCompositor.
1968
1969         First, RenderLayerBacking was using ScrollingNodeTypes to choose which scrolling
1970         roles a layer has, which let to ambiguous code where we hardcoded a ScrollingNodeType
1971         with knowledge of what RenderLayerBacking did with it. Clean up by using LayerScrollCoordinationRole,
1972         which is moved to RenderLayer.h so that RenderLayerCompositor.h and RenderLayerBacking.h
1973         both see it.
1974
1975         Secondly, avoid having both detachFromScrollingCoordinator() and detachFromScrollingCoordinatorForRole()
1976         by passing in the bitmask of roles.
1977
1978         * page/FrameView.cpp:
1979         (WebCore::FrameView::scrollLayerID):
1980         * rendering/RenderLayer.h:
1981         * rendering/RenderLayerBacking.cpp:
1982         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1983         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1984         (WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole): Deleted.
1985         * rendering/RenderLayerBacking.h:
1986         * rendering/RenderLayerCompositor.cpp:
1987         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
1988         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1989         (WebCore::scrollCoordinationRoleForNodeType):
1990         (WebCore::RenderLayerCompositor::attachScrollingNode):
1991         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1992         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1993         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
1994         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole): Deleted.
1995         * rendering/RenderLayerCompositor.h:
1996
1997 2015-04-14  Benjamin Poulain  <benjamin@webkit.org>
1998
1999         Add a conservative DFA minimizer for the content extension matcher
2000         https://bugs.webkit.org/show_bug.cgi?id=143501
2001
2002         Reviewed by Alex Christensen.
2003
2004         This patch adds a simple minimizer for DFA graphs. It is not a perfect minimizer:
2005         some indistinguishable are not merged, but no two distinguishable are merged.
2006
2007         The general idea of the algorithm is to put all the state into a single set
2008         and partition iteratively until it is impossible to split any subset by using
2009         a transition to distinguish two states.
2010
2011         Let's ignore fallback transition for now, and I'll explain later how they fit in
2012         the big picture.
2013
2014
2015         The first thing we do is create a partition of the transition by grouping every
2016         transition by the same character in the same subset. This partition of transitions
2017         is the base by which we will partition the states.
2018
2019         Each subset in the transition partition is a "distinguisher" by which we can
2020         separate the state partition.
2021
2022         We also create a second partition, the state partition. This is where we keep
2023         all the subsets of states that have been split so far.
2024
2025         Let say we have the following graph.
2026
2027             1 --a--> 2
2028             1 --b--> 3
2029             2 --c--> 4 (final)
2030             3 --c--> 4 (final)
2031
2032         The partition of transition would start with:
2033         Set 0:
2034             1 --a--> 2
2035         Set 1:
2036             1 --b--> 3
2037         Set 2:
2038             2 --c--> 4
2039             3 --c--> 4
2040
2041         The state partition would have a single set with { 1, 2, 3, 4 }.
2042
2043
2044         Next, we split the state partition by distinguishable final states. In this case,
2045         we would split it into { 1, 2, 3 }, { 4 }.
2046
2047         We then refine the transition partition by splitting it by the states that have
2048         been distinguished. Here, the only transitions to 4 are both is the same set (set 2),
2049         so the transition partition remains the same.
2050
2051
2052         We can now execute the main loop of the algorithm:
2053         1) Split the states by the transitions.
2054         2) Split the transitions that are now reaching two different sets of the state partition.
2055         3) Add any newly discovered "distinguisher" (the ones we split) to the list of "distinguisher"
2056            to process.
2057
2058         In this case, we just iterate over the partition set in order, and add newly split transitions
2059         to the end of the list.
2060
2061         In the example, we would first visit set 0. We have that state 1 is distinguishable
2062         by "a", and the state partition would become { 1 }, { 2, 3 }, { 4 }.
2063
2064         We then visit transition set 1, it distinguishes state 1 which is already alone -> nothing to do.
2065
2066         Finally, we process the transition set 2, it distinguishes 2 and 3, they are already in the same
2067         set -> nothing to do.
2068
2069         There is no more transition to process, we have 3 unique subsets and we should merge 2 and 3.
2070
2071         ---
2072
2073         Okay, now how to we fit fallback transition in this model. In this patch, I take the conservative
2074         approach: we split everything assuming fallback transition do not exist, then we refine
2075         by the fallback transitions.
2076
2077         Let's take the following example:
2078             1 --a--> 3
2079             2 --a--> 3
2080             1 -[f]-> 4
2081             2 -[f]-> 5
2082
2083         and at this stage in the algorithm, we have the sets { 1, 2 }, { 3 }, { 4 }, { 5 }.
2084         The states 1 and 2 are together because they cannot be distinguished by 'a', but
2085         the fallback transition distinguishes them.
2086
2087         Since we have done every other split, we have one useful property: we know that every
2088         state in every set transition with the exact set of characters within that set.
2089         If that was not true, there would be one "distinguisher" 'x' that could spit the set
2090         into two subsets: the one with the transition 'x' and the ones without.
2091
2092         Since all the transitions are the same, there is no overlap between the defined transition
2093         and the fallback transition. Consequently, we can use the fallback transition as a whole
2094         transition and use it to distinguish the states.
2095
2096         The fallback transitions are handled like any other transition, we have a partition of such
2097         transitions and split by each of them. BUT, we can only use them after every unique transition
2098         has been covered.
2099
2100         This trick is also what makes the minimization imperfect: it should be possible to merge
2101         states with overlap in their fallback transitions but we would split them.
2102
2103         ---
2104
2105         Antti Valmari, Petri Lehtinen, Marie-Pierre Béal and Maxime Crochemore deserve credit for their indirect
2106         work on this patch. Thanks for your wonderful papers about DFA minimization.
2107
2108         * WebCore.xcodeproj/project.pbxproj:
2109         * contentextensions/ContentExtensionCompiler.cpp:
2110         (WebCore::ContentExtensions::compileRuleList):
2111         * contentextensions/DFA.cpp:
2112         (WebCore::ContentExtensions::DFA::minimize):
2113         (WebCore::ContentExtensions::DFA::debugPrintDot):
2114         * contentextensions/DFA.h:
2115         * contentextensions/DFABytecodeCompiler.cpp:
2116         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2117         * contentextensions/DFAMinimizer.cpp: Added.
2118         (WebCore::ContentExtensions::DFAMinimizer::simplifyTransitions):
2119         (WebCore::ContentExtensions::DFAMinimizer::Partition::initialize):
2120         (WebCore::ContentExtensions::DFAMinimizer::Partition::markElementInCurrentGeneration):
2121         (WebCore::ContentExtensions::DFAMinimizer::Partition::refineGeneration):
2122         (WebCore::ContentExtensions::DFAMinimizer::Partition::iterateSet):
2123         (WebCore::ContentExtensions::DFAMinimizer::Partition::setIndex):
2124         (WebCore::ContentExtensions::DFAMinimizer::Partition::firstElementInSet):
2125         (WebCore::ContentExtensions::DFAMinimizer::Partition::size):
2126         (WebCore::ContentExtensions::DFAMinimizer::Partition::SetDescriptor::indexAfterMarkedElements):
2127         (WebCore::ContentExtensions::DFAMinimizer::Partition::SetDescriptor::end):
2128         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::FullGraphPartition):
2129         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::markNode):
2130         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::refinePartitions):
2131         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::splitByUniqueTransitions):
2132         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::splitByFallbackTransitions):
2133         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::nodeReplacement):
2134         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::ActionKey):
2135         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::isEmptyValue):
2136         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::isDeletedValue):
2137         (WebCore::ContentExtensions::DFAMinimizer::ActionKeyHash::hash):
2138         (WebCore::ContentExtensions::DFAMinimizer::ActionKeyHash::equal):
2139         (WebCore::ContentExtensions::DFAMinimizer::minimize):
2140         * contentextensions/DFAMinimizer.h: Copied from Source/WebCore/contentextensions/DFA.h.
2141         * contentextensions/DFANode.h:
2142         * contentextensions/NFAToDFA.cpp:
2143         (WebCore::ContentExtensions::NFAToDFA::convert):
2144         (WebCore::ContentExtensions::simplifyTransitions): Deleted.
2145
2146 2015-04-14  Chris Dumez  <cdumez@apple.com>
2147
2148         ASSERT(frame().view() == this) assertion hit in FrameView::windowClipRect() on Windows bots
2149         https://bugs.webkit.org/show_bug.cgi?id=143723
2150
2151         Reviewed by Brent Fulgham.
2152
2153         ASSERT(frame().view() == this) in FrameView::windowClipRect() can be hit
2154         if the post layout timer timer fires after the page has entered page
2155         cache. Upon entering page cache, we call FrameView::unscheduleRelayout()
2156         to stop the layout timer if it is active, however, we don't stop the
2157         post-layout timer. Therefore, there was nothing preventing the
2158         post-layout timer from firing after entering page cache.
2159
2160         In this patch, we unschedule the post-layout timer in
2161         FrameView::unscheduleRelayout() to protect ourselves against this.
2162
2163         I think we were only seeing the assertion hit on Windows because this
2164         timer probably gets scheduled more frequently on Windows. On Mac, I
2165         rarely see it getting scheduled.
2166
2167         No new tests, should fix crashing tests on the bots.
2168
2169         * page/FrameView.cpp:
2170         (WebCore::FrameView::unscheduleRelayout):
2171
2172 2015-04-14  Chris Dumez  <cdumez@apple.com>
2173
2174         FrameView::m_frame should be a Ref<Frame>
2175         https://bugs.webkit.org/show_bug.cgi?id=143716
2176
2177         Reviewed by Andreas Kling.
2178
2179         FrameView::m_frame should be a Ref<Frame> instead of a RefPtr<Frame> as
2180         it can never be null.
2181
2182         * page/FrameView.cpp:
2183         (WebCore::FrameView::FrameView):
2184         (WebCore::FrameView::flushCompositingStateForThisFrame):
2185         (WebCore::FrameView::hasCompositedContentIncludingDescendants):
2186         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
2187         (WebCore::FrameView::updateCanBlitOnScrollRecursively):
2188         (WebCore::FrameView::setIsOverlapped):
2189         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
2190         (WebCore::FrameView::renderedCharactersExceed):
2191         (WebCore::FrameView::updateLayerFlushThrottling):
2192         (WebCore::FrameView::serviceScriptedAnimations):
2193         (WebCore::FrameView::updateBackgroundRecursively):
2194         (WebCore::FrameView::adjustScrollStepForFixedContent):
2195         (WebCore::FrameView::paintContentsForSnapshot):
2196         (WebCore::FrameView::notifyWidgetsInAllFrames):
2197         (WebCore::FrameView::setExposedRect):
2198         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
2199         * page/FrameView.h:
2200
2201 2015-04-13  Simon Fraser  <simon.fraser@apple.com>
2202
2203         [iOS WK2] Interactive elements of developer.apple.com are broken
2204         https://bugs.webkit.org/show_bug.cgi?id=143692
2205         rdar://problem/19320087
2206
2207         Reviewed by Sam Weinig.
2208         
2209         When a composited RenderLayer had nodes in the scrolling tree by virtue of
2210         both position and overflow:scroll, and one of those reasons disappeared,
2211         we'd fail to remove the corresponding node from the scrolling tree. This
2212         could leave an overflow:scroll element behaving as if it were position:fixed.
2213         
2214         Fix by having RenderLayerCompositor::updateScrollCoordinationForThisFrame()
2215         detach the layer on a per-role basis.
2216
2217         Test: platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html
2218
2219         * rendering/RenderLayerBacking.cpp:
2220         (WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole):
2221         * rendering/RenderLayerBacking.h:
2222         * rendering/RenderLayerCompositor.cpp:
2223         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole):
2224         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Just moved.
2225         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Call detachScrollCoordinatedLayerForRole()
2226         if the layer doesn't have the relevant scrolling reasons.
2227         * rendering/RenderLayerCompositor.h:
2228
2229 2015-04-14  Commit Queue  <commit-queue@webkit.org>
2230
2231         Unreviewed, rolling out r182794.
2232         https://bugs.webkit.org/show_bug.cgi?id=143714
2233
2234         readable-stream-templated.html fails on Debug bots (Requested
2235         by youenn on #webkit).
2236
2237         Reverted changeset:
2238
2239         "[Streams API] ReadableStream constructor start function
2240         should be able to close the stream"
2241         https://bugs.webkit.org/show_bug.cgi?id=143363
2242         http://trac.webkit.org/changeset/182794
2243
2244 2015-04-14  Per Arne Vollan  <peavo@outlook.com>
2245
2246         [WinCairo] Unreviewed build fix after r182707.
2247
2248         * platform/network/curl/MultipartHandle.cpp:
2249         (WebCore::MultipartHandle::didReceiveResponse):
2250
2251 2015-04-14  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2252
2253         [Streams API] ReadableStream constructor start function should be able to close the stream
2254         https://bugs.webkit.org/show_bug.cgi?id=143363
2255
2256         Reviewed by Benjamin Poulain.
2257
2258         Implements https://streams.spec.whatwg.org/#close-readable-stream.
2259         When the "close" JS function is called, the stream is getting closed.
2260         The stream state is changed to close and if it has a reader, the reader gets closed as well:
2261         The reader resolves the closed promise and release the stream.
2262
2263         Enabled the possibility to resolve a promise with any JS value.
2264         This is used to resolve closed promise with jsUndefined and will be used for read promises.
2265
2266         Covered by reference tests that are now passing.
2267
2268         * Modules/streams/ReadableStream.cpp:
2269         (WebCore::ReadableStream::changeStateToClosed): Called by the JS function 'close'.
2270         * Modules/streams/ReadableStream.h:
2271         * Modules/streams/ReadableStreamReader.cpp:
2272         (WebCore::ReadableStreamReader::ReadableStreamReader):
2273         (WebCore::ReadableStreamReader::initialize): Added to handle state change at constructor time (in particular closed/errored state).
2274         (WebCore::ReadableStreamReader::releaseStream):
2275         (WebCore::ReadableStreamReader::closed): Storing the closed promise callbacks.
2276         (WebCore::ReadableStreamReader::changeStateToClosed): Resolution of closed promise.
2277         * Modules/streams/ReadableStreamReader.h:
2278         * bindings/js/JSDOMPromise.h:
2279         (WebCore::DeferredWrapper::resolve<JSC::JSValue>):
2280         * bindings/js/JSReadableStreamReaderCustom.cpp:
2281         (WebCore::JSReadableStreamReader::closed):
2282         * bindings/js/ReadableStreamJSSource.cpp:
2283         (WebCore::readableStreamSlotName):
2284         (WebCore::getReadableJSStream): Helper function to retrieve the stream from the exec state.
2285         (WebCore::closeReadableStreamFunction):
2286         (WebCore::createReadableStreamCloseFunction):
2287         (WebCore::createReadableStreamController):
2288         (WebCore::ReadableStreamJSSource::start):
2289         (WebCore::ReadableJSStreamReader::ReadableJSStreamReader): Deleted.
2290
2291 2015-04-13  Joonghun Park  <jh718.park@samsung.com>
2292
2293         Use modern for-loops in Document
2294         https://bugs.webkit.org/show_bug.cgi?id=143600
2295
2296         Reviewed by Darin Adler.
2297
2298         No new tests, no behavior changes.
2299
2300         * dom/Document.cpp:
2301         (WebCore::Document::visibilityStateChanged):
2302         (WebCore::Document::processBaseElement):
2303         (WebCore::Document::moveNodeIteratorsToNewDocument):
2304         (WebCore::Document::updateRangesAfterChildrenChanged):
2305         (WebCore::Document::nodeChildrenWillBeRemoved):
2306         (WebCore::Document::nodeWillBeRemoved):
2307         (WebCore::Document::textInserted):
2308         (WebCore::Document::textRemoved):
2309         (WebCore::Document::textNodesMerged):
2310         (WebCore::Document::textNodeSplit):
2311         (WebCore::Document::documentWillSuspendForPageCache):
2312         (WebCore::Document::documentDidResumeFromPageCache):
2313         (WebCore::Document::mediaVolumeDidChange):
2314         (WebCore::Document::privateBrowsingStateDidChange):
2315         (WebCore::Document::captionPreferencesChanged):
2316         (WebCore::Document::validateAutoSizingNodes):
2317         (WebCore::Document::resetAutoSizingNodes):
2318         (WebCore::Document::webkitExitFullscreen):
2319         (WebCore::Document::absoluteRegionForEventTargets):
2320
2321 2015-04-13  Manuel Rego Casasnovas  <rego@igalia.com>
2322
2323         [CSS Grid Layout] Columns set in percentages collapse to auto width
2324         https://bugs.webkit.org/show_bug.cgi?id=141435
2325
2326         Reviewed by David Hyatt.
2327
2328         Based on a patch by Sergio Villar Senin  <svillar@igalia.com>.
2329
2330         This patch adds 2 new new methods in RenderBox to determine if the grid
2331         has a definite size or not.
2332
2333         RenderGrid::gridTrackSize() was not checking properly if the grid has or
2334         not an indefinite size.
2335         The condition was including auto which is not indefinite per se. For
2336         example, auto is definite if the containing block is definite.
2337         As the new method is more expensive, we just call it when it's really
2338         needed to avoid performance regressions.
2339
2340         Finally we were setting the override logical width/height to -1 (no
2341         possible resolution) for all the items regardless if they've a relative
2342         width/height or a fixed one.
2343         Added the condition, including not only items with percentage logical
2344         width/height but also relative, to avoid overriding the value for items
2345         with fixed width/height as it's not needed.
2346
2347         Tests: fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html
2348                fast/css-grid-layout/percent-intrinsic-track-breadth.html
2349                fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
2350
2351         * rendering/RenderBox.cpp:
2352         (WebCore::logicalWidthIsResolvable):
2353         (WebCore::RenderBox::hasDefiniteLogicalWidth):
2354         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
2355         (WebCore::RenderBox::hasRelativeLogicalWidth):
2356         * rendering/RenderBox.h:
2357         * rendering/RenderGrid.cpp:
2358         (WebCore::RenderGrid::hasDefiniteLogicalSize):
2359         (WebCore::RenderGrid::gridTrackSize):
2360         (WebCore::RenderGrid::logicalContentHeightForChild):
2361         (WebCore::RenderGrid::minContentForChild):
2362         (WebCore::RenderGrid::maxContentForChild):
2363         * rendering/RenderGrid.h:
2364
2365 2015-04-13  Chris Dumez  <cdumez@apple.com>
2366
2367         Regression: Scrolling on popsci.com spends too much time in FrameView::viewportsContentsChanged()
2368         https://bugs.webkit.org/show_bug.cgi?id=143675
2369
2370         Reviewed by Simon Fraser.
2371
2372         Optimize resumeVisibleImageAnimationsIncludingSubframes() so that the FrameViews'
2373         windowClipRect gets computed less often:
2374         - Cache the FrameView's windowClipRect before resuming image animations in subframes
2375           as calling windowClipRect() on those subframes' view is going to call windowClipRect()
2376           on their ancestors. This avoids a lot of unnecessary windowClipRect recomputations
2377           in deep frame trees.
2378         - Stop traversing the Frame tree if the current frame does not have a content
2379           renderer, as this means the subframes won't have one either.
2380         - Stop traversing the Frame tree if the current frame's view has an empty
2381           windowClipRect() as this means the windowClipRect will be empty for those
2382           subframes as well.
2383
2384         On popsci.com, this cuts down the number of uncached windowClipRect() calls by
2385         approximately half. I see viewportsContentsChanged() at ~0.4% when scrolling
2386         on popsci.com after this change.
2387
2388         * page/FrameView.cpp:
2389         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
2390         (WebCore::FrameView::windowClipRect):
2391         * page/FrameView.h:
2392         * rendering/RenderView.cpp:
2393         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
2394         * rendering/RenderView.h:
2395
2396 2015-04-13  Roger Fong  <roger_fong@apple.com>
2397
2398         Unreviewed. Set the title text of the placard added in r182631.
2399         https://bugs.webkit.org/show_bug.cgi?id=143585.
2400         <rdar://problem/12067439>
2401
2402         * Modules/mediacontrols/mediaControlsApple.js:
2403         (Controller.prototype.updateWirelessPlaybackStatus):
2404
2405 2015-04-10  Brent Fulgham  <bfulgham@apple.com>
2406
2407         Expand test infrastructure to support scrolling tests
2408         https://bugs.webkit.org/show_bug.cgi?id=143286
2409         <rdar://problem/20375516>
2410
2411         Reviewed by Simon Fraser.
2412
2413         No new functionality.
2414
2415         This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
2416         function object to be fired when scroll events are finished. The object also keeps track of reasons
2417         why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
2418         check rendering state in the middle of an animation.
2419
2420         This code is not yet hooked up to the rendering system, and so does not have any effect on behavior.
2421
2422         * CMakeLists.txt: Add new WheelEventTestTrigger files.
2423         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2424         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2425         * WebCore.xcodeproj/project.pbxproj: Ditto.
2426         * page/MainFrame.cpp:
2427         (WebCore::MainFrame::MainFrame): Add new member to constructor.
2428         (WebCore::MainFrame::testTrigger): Added.
2429         (WebCore::MainFrame::ensureTestTrigger): Added.
2430         (WebCore::MainFrame::clearTrigger): Added.
2431         * page/MainFrame.h:
2432         * page/WheelEventTestTrigger.cpp: Added.
2433         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger):
2434         (WebCore::WheelEventTestTrigger::createWeakPtr):
2435         (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
2436         (WebCore::WheelEventTestTrigger::setTestNotificationCallback):
2437         (WebCore::WheelEventTestTrigger::deferTestsForReason):
2438         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason):
2439         (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
2440         * page/WheelEventTestTrigger.h: Added.
2441
2442 2015-04-13  Jer Noble  <jer.noble@apple.com>
2443
2444         [iOS] When entering optimized fullscreen, standard fullscreen view should exit.
2445         https://bugs.webkit.org/show_bug.cgi?id=143615
2446
2447         Reviewed by Simon Fraser.
2448
2449         When entering optimized fullscreen from standard fullscreen, the original fullscreen
2450         view should animate out.
2451
2452         The original method for entering optimized fullscreen is deprecated, so replace it with
2453         the new method (which doesn't take completion blocks) and use delegate methods to detect
2454         when the animation transition completes.
2455
2456         * platform/Logging.h:
2457         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2458         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2459         (boolString): Added; use for logging boolean parameters.
2460         (-[WebAVPlayerController playerViewControllerWillStartOptimizedFullscreen:]): Pass to WebVideoFullscreenInterfaceAVKit.
2461         (-[WebAVPlayerController playerViewControllerDidStartOptimizedFullscreen:]): Ditto.
2462         (-[WebAVPlayerController playerViewControllerWillStopOptimizedFullscreen:]): Ditto.
2463         (-[WebAVPlayerController playerViewControllerDidStopOptimizedFullscreen:]): Ditto.
2464         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]): Ditto.
2465         (-[WebAVPlayerController playerViewControllerDidCancelOptimizedFullscreen:]): Ditto.
2466         (-[WebAVPlayerController playerViewController:restoreUserInterfaceForOptimizedFullscreenStopWithCompletionHandler:]): Ditto.
2467         (-[WebAVVideoLayer setPlayerViewController:]): Remove the KVO registration; now handled by above delegate methods.
2468         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Add logging.
2469         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Ditto.
2470         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Use new -startOptimizedFullscreen method.
2471         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Add logging.
2472         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal): Ditto.
2473         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Use hasMode() & isMode() rather than checking m_mode directly.
2474         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): Ditto.
2475         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline): Callback now stored on this object rather than the WebAVPlayerController.
2476         (WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoOptimized): Moved.
2477         (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline): Added; store the passed callback.
2478         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen): Exit out of standard fullscreen mode if necessary.
2479         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen): Moved from the start lambda in enterFullscreenOptimized().
2480         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen): Call the model's requestExitFullscreen() method.
2481         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen): Moved from the stop lambda in enterFullscreenOptimized().
2482         (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen): Call the model's requestExitFullscreen() method.
2483         (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen): Moved from the stop lambda in enterFullscreenOptimized().
2484         (WebVideoFullscreenInterfaceAVKit::prepareForOptimizedFullscreenStopWithCompletionHandler): Moved from -playerViewController:shouldExitFullScreenWithReason:.
2485         (WebVideoFullscreenInterfaceAVKit::setMode): Added; Call fullscreenModeChanged() if necessary.
2486         (WebVideoFullscreenInterfaceAVKit::clearMode): Ditto.
2487         (-[WebAVVideoLayer observeValueForKeyPath:ofObject:change:context:]): Deleted.
2488         (WebVideoFullscreenInterfaceAVKit::setIsOptimized): Deleted.
2489
2490 2015-04-13  Brent Fulgham  <bfulgham@apple.com>
2491
2492         [Win] Unreviewed fix after r182757.
2493
2494         * platform/win/FileSystemWin.cpp:
2495         (WebCore::renameFile): Checked in wrong version.
2496
2497 2015-04-13  Brent Fulgham  <bfulgham@apple.com>
2498
2499         [Win] Unreviewed fix after r182161.
2500
2501         The change caused Windows to lose Media UI, since the new 'getFileSize'
2502         signature was being improperly used for a 'UInt8'-based string.
2503
2504         Fix was to provide implementations for the two new methods, and to make
2505         sure RenderThemeWin was using the proper signature.
2506
2507         This should actually be a little more efficient, since we have the file
2508         handle when we call this new method. Previously, a Windows 'find file' was
2509         being done with the requested path, which was unnecessary work.
2510
2511         * platform/win/FileSystemWin.cpp:
2512         (WebCore::getFileSizeFromByHandleFileInformationStructure): Added helper function.
2513         (WebCore::getFileSize): Provide implementation.
2514         (WebCore::renameFile):
2515         * rendering/RenderThemeWin.cpp:
2516         (WebCore::RenderThemeWin::stringWithContentsOfFile): Use the file handle to
2517         get the file size, rather than using the path-based size lookup (which involves
2518         performing an unnecessary file search.
2519
2520 2015-04-13  Brady Eidson  <beidson@apple.com>
2521
2522         Share sheets from Share menus appear outside the browser window.
2523         <rdar://problem/20455592> and https://bugs.webkit.org/show_bug.cgi?id=143620
2524
2525         Reviewed by Darin Adler.
2526
2527         * page/ContextMenuController.h:
2528         (WebCore::ContextMenuController::client):
2529
2530 2015-04-13  Andreas Kling  <akling@apple.com>
2531
2532         Rebaseline bindings tests.
2533
2534         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2535         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2536         * bindings/scripts/test/JS/JSTestEventTarget.h:
2537         * bindings/scripts/test/JS/JSTestException.h:
2538         * bindings/scripts/test/JS/JSTestInterface.h:
2539         * bindings/scripts/test/JS/JSTestObj.h:
2540         * bindings/scripts/test/JS/JSTestTypedefs.h:
2541
2542 2015-04-13  Jer Noble  <jer.noble@apple.com>
2543
2544         [iOS] Treat a 'not found' media option index as the 'off' track.
2545         https://bugs.webkit.org/show_bug.cgi?id=143672
2546
2547         Reviewed by Eric Carlson.
2548
2549         The UIProcess will pass in UINT64_MAX for the index of the legible option to select. Treat this
2550         as if the captionOffMenuItem() had been selected to avoid a null dereference.
2551
2552         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2553         (WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):
2554
2555 2015-04-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2556
2557         list-style-image with SVG image renders at incorrect size.
2558         https://bugs.webkit.org/show_bug.cgi?id=141367.
2559
2560         Reviewed by Darin Adler.
2561         
2562         This patch imports https://codereview.chromium.org/197203003.
2563
2564         When using an SVG as list marker image, don't unconditionally set the
2565         dimensions to a square with the dimensions of ascent / 2, but rather
2566         determine a suitable size using intrinsic dimensions (and ratio).
2567
2568         Test: svg/as-list-image/svg-list-image-intrinsic-size-1.html
2569
2570         * rendering/RenderListMarker.cpp:
2571         (WebCore::RenderListMarker::updateContent):
2572
2573 2015-04-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2574
2575         Canvas drawImage() has a security hole when the image isn't yet fully loaded.
2576         https://bugs.webkit.org/show_bug.cgi?id=58681.
2577
2578         Reviewed by Darin Adler.
2579
2580         There is a race condition which may happen if an image from a different
2581         origin is drawn on a canvas before it finishes loading. The check to taint
2582         the canvas comes before drawing it. This check returns false if the image
2583         is not completely loaded because we check the URL of the resource response.
2584         If after this check and before the drawing, the image finishes loading, the
2585         canvas will not be tainted but the image will be drawn.
2586         
2587         The fix is to move the check to taint the canvas after drawing the image.
2588         The only problem with this solution is basically the opposite of this bug:
2589         we will become stricter than before with images which are from a different
2590         origin and before they finish loading. The image has not finished loading,
2591         so we do not draw it. Before we check for tainting, the image finishes
2592         loading. So we decide to taint the canvas even the image is not drawn.
2593         
2594         But this should not be a security issue anymore. I personally do not know
2595         if it is even a correctness issue or not.
2596
2597         Test: http/tests/canvas/canvas-tainted-after-draw-image.html
2598
2599         * html/canvas/CanvasRenderingContext2D.cpp:
2600         (WebCore::CanvasRenderingContext2D::drawImage):
2601
2602 2015-04-13  Beth Dakin  <bdakin@apple.com>
2603
2604         Add force property to MouseEvents
2605         https://bugs.webkit.org/show_bug.cgi?id=143569
2606         -and corresponding-
2607         rdar://problem/20472954
2608
2609         Reviewed by Darin Adler.
2610
2611         This patch removes WebKitMouseForceEvent and uses a MouseEvent everywhere that it 
2612         was used. That’s possible because this patch also adds a force property to all 
2613         MouseEvents and to PlatformMouseEvent.
2614
2615         Remove WebKitMouseForceEvent.
2616         * CMakeLists.txt:
2617         * DerivedSources.cpp:
2618         * DerivedSources.make:
2619         * WebCore.vcxproj/WebCore.vcxproj:
2620         * WebCore.vcxproj/WebCore.vcxproj.filters:
2621         * WebCore.xcodeproj/project.pbxproj:
2622         * dom/DOMAllInOne.cpp:
2623
2624         Create MouseEvents with the appropriate force instead of WebKitMouseForceEvents. 
2625         This patch also gets rid of the PlatformMouseEvent parameter for these events. 
2626         They were re-using the cached mousedown event before, which they never should have 
2627         done. Instead, we create PlatformMouseEvents inside these functions and then use 
2628         that to make MouseEvents.
2629         * dom/Element.cpp:
2630         (WebCore::Element::dispatchMouseForceWillBegin):
2631         (WebCore::Element::dispatchMouseForceChanged):
2632         (WebCore::Element::dispatchMouseForceDown):
2633         (WebCore::Element::dispatchMouseForceUp):
2634         (WebCore::Element::dispatchMouseForceClick):
2635         (WebCore::Element::dispatchMouseForceCancelled):
2636         * dom/Element.h:
2637
2638         No More WebKitMouseForceEvent.
2639         * dom/EventNames.in:
2640
2641         Add force to MouseEvent.
2642         * dom/MouseEvent.cpp:
2643         (WebCore::MouseEvent::create):
2644         (WebCore::MouseEvent::MouseEvent):
2645         (WebCore::MouseEvent::cloneFor):
2646         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
2647         * dom/MouseEvent.h:
2648         (WebCore::MouseEvent::force):
2649         (WebCore::MouseEvent::setForce):
2650         * dom/MouseEvent.idl:
2651
2652         No More WebKitMouseForceEvent.
2653         * dom/WebKitMouseForceEvent.cpp: Removed.
2654         * dom/WebKitMouseForceEvent.h: Removed.
2655         * dom/WebKitMouseForceEvent.idl: Removed.
2656
2657         PlatformMouseEvent now takes a force parameter.
2658         * dom/WheelEvent.cpp:
2659         (WebCore::WheelEvent::WheelEvent):
2660         * page/ContextMenuController.cpp:
2661         (WebCore::ContextMenuController::showContextMenuAt):
2662         * page/DragController.cpp:
2663         (WebCore::createMouseEvent):
2664         * page/EventHandler.cpp:
2665         (WebCore::EventHandler::dispatchDragEvent):
2666         (WebCore::EventHandler::sendContextMenuEventForKey):
2667         (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
2668
2669         We don’t need lastMouseDownEvent() anymore. We were using it to avoid creating new 
2670         PlatformMouseEvents for the force events, but we fix that in this patch.
2671         (WebCore::EventHandler::lastMouseDownEvent): Deleted.
2672         * page/EventHandler.h:
2673
2674         At force to PlatformMouseEvent.
2675         * platform/PlatformMouseEvent.h:
2676         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2677         (WebCore::PlatformMouseEvent::force):
2678         * replay/SerializationMethods.cpp:
2679         (JSC::EncodingTraits<PlatformMouseEvent>::encodeValue):
2680         (JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):
2681
2682 2015-04-13  Andreas Kling  <akling@apple.com>
2683
2684         Don't segregate heap objects based on Structure immortality.
2685         <https://webkit.org/b/143638>
2686
2687         Reviewed by Darin Adler.
2688
2689         * bindings/js/JSDOMBinding.h:
2690         * bindings/scripts/CodeGeneratorJS.pm:
2691         (GenerateHeader):
2692         (GeneratePrototypeDeclaration):
2693         * bridge/objc/objc_runtime.h:
2694         * bridge/runtime_array.h:
2695         * bridge/runtime_method.h:
2696         * bridge/runtime_object.h:
2697
2698 2015-04-13  Simon Fraser  <simon.fraser@apple.com>
2699
2700         Fixed position element is truncated if moved onscreen by a transform
2701         https://bugs.webkit.org/show_bug.cgi?id=143655
2702         rdar://problem/15020044
2703
2704         Reviewed by Darin Adler.
2705         
2706         Our "don't do layout if transform changes" code was too aggressive.
2707         If an element changes between having a transform and not having one, we
2708         really need to do a layout since so much else depends on transforms. In
2709         this particular case, we clip position:fixed elements to the viewport if
2710         they are not transformed, and were failing to re-evaluate this when a
2711         transform was added. Doing a layout fixes this.
2712
2713         Test: compositing/geometry/fixed-transformed.html
2714
2715         * rendering/style/RenderStyle.cpp:
2716         (WebCore::RenderStyle::changeRequiresLayout):
2717         * rendering/style/StyleTransformData.h:
2718         (WebCore::StyleTransformData::hasTransform):
2719
2720 2015-04-12  Darin Adler  <darin@apple.com>
2721
2722         [Cocoa] Localizable strings are inconsistent and need to be regenerated
2723         https://bugs.webkit.org/show_bug.cgi?id=143661
2724         rdar://problem/19634388
2725
2726         Reviewed by Dan Bernstein.
2727
2728         * English.lproj/Localizable.strings: Updated by running the
2729         update-webkit-localizable-strings script.
2730
2731 2015-04-13  Darin Adler  <darin@apple.com>
2732
2733         Remove needless recreation of URL in NavigationScheduler::scheduleLocationChange
2734         https://bugs.webkit.org/show_bug.cgi?id=143662
2735
2736         Reviewed by Sam Weinig.
2737
2738         * loader/NavigationScheduler.cpp:
2739         (WebCore::NavigationScheduler::scheduleLocationChange): Removed unnecessary code
2740         to convert a URL to a String and then back into a URL.
2741
2742 2015-04-13  Csaba Osztrogonác  <ossy@webkit.org>
2743
2744         [cmake] Add ENABLE(ATTACHMENT_ELEMENT) to the build system
2745         https://bugs.webkit.org/show_bug.cgi?id=143664
2746
2747         Reviewed by Gyuyoung Kim.
2748
2749         * page/efl/DragControllerEfl.cpp:
2750         (WebCore::DragController::declareAndWriteAttachment): Added stub implementation to fix the build.
2751         * page/gtk/DragControllerGtk.cpp:
2752         (WebCore::DragController::declareAndWriteAttachment): Added stub implementation to fix the build.
2753
2754 2015-04-13  Sungmann Cho  <sungmann.cho@navercorp.com>
2755
2756         [Curl] Small improvements to CurlCacheEntry::parseResponseHeaders()
2757         https://bugs.webkit.org/show_bug.cgi?id=143597
2758
2759         Reviewed by Csaba Osztrogonác.
2760
2761         Most lines of code in CurlCacheEntry::parseResponseHeaders() don't need to be
2762         executed if the response has "no-cache" or "no-store" directive, but we are
2763         checking these conditions in the middle of the method. We can move this to the
2764         beginning of the method for efficiency.
2765
2766         No new tests, no behavior change.
2767
2768         * platform/network/curl/CurlCacheEntry.cpp:
2769         (WebCore::CurlCacheEntry::parseResponseHeaders):
2770
2771 2015-04-13  Sergio Villar Senin  <svillar@igalia.com>
2772
2773         Unreviewed, build fix after r182704.
2774
2775         * rendering/RenderGrid.cpp:
2776         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2777
2778 2015-04-13  Joonghun Park  <jh718.park@samsung.com>
2779
2780         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceResponse
2781         https://bugs.webkit.org/show_bug.cgi?id=143056
2782
2783         Reviewed by Gyuyoung Kim.
2784
2785         No new tests, no behavior changes.
2786
2787         * loader/WorkerThreadableLoader.cpp:
2788         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2789         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
2790         * platform/CrossThreadCopier.h:
2791         * platform/network/ResourceResponseBase.cpp:
2792         (WebCore::ResourceResponseBase::adopt):
2793         (WebCore::ResourceResponseBase::copyData):
2794         * platform/network/ResourceResponseBase.h:
2795         * platform/network/cf/ResourceResponse.h:
2796         (WebCore::ResourceResponse::doPlatformCopyData):
2797         (WebCore::ResourceResponse::doPlatformAdopt):
2798         * platform/network/curl/ResourceResponse.h:
2799         (WebCore::ResourceResponse::doPlatformCopyData):
2800         (WebCore::ResourceResponse::doPlatformAdopt):
2801         * platform/network/soup/ResourceResponse.h:
2802         (WebCore::ResourceResponse::doPlatformCopyData):
2803         (WebCore::ResourceResponse::doPlatformAdopt):
2804
2805 2015-04-10  Sergio Villar Senin  <svillar@igalia.com>
2806
2807         [CSS Grid Layout] Support marking/unmarking tracks as infinitely growable
2808         https://bugs.webkit.org/show_bug.cgi?id=141431
2809
2810         Reviewed by Darin Adler.
2811
2812         As explained here
2813         http://lists.w3.org/Archives/Public/www-style/2014Mar/0512.html we
2814         sometimes need to consider that some tracks are infinitely
2815         growable even when they are really not, in order to produce more
2816         "natural" results.
2817
2818         For example the following case:
2819           grid-template-columns: auto auto;
2820           item 1 in column 1 with min-content = max-content = 10px;
2821           item 2 in columns 1-2 with min-content = 30, max-content = 100px;
2822
2823         will produce (45px, 55px) without this patch. But considering the
2824         second column as infinitely growable the result is (10px, 90px), a
2825         more "natural" result because column 1 just needs to be 10px to
2826         accommodate item 1. From now on we can flag GridTracks so that
2827         they can infinitely grow even when the growth limit is finite.
2828
2829         Apart from that distributeSpaceToTracks() is now unconditionally
2830         called even though the extra space is 0. That's because it
2831         computes the plannedSize value.
2832
2833         Test: fast/css-grid-layout/mark-as-infinitely-growable.html
2834
2835         * rendering/RenderGrid.cpp:
2836         (WebCore::GridTrack::infiniteGrowthPotential):
2837         (WebCore::GridTrack::infinitelyGrowable):
2838         (WebCore::GridTrack::setInfinitelyGrowable):
2839         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2840         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Updated with new phase.
2841         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Ditto.
2842         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Ditto.
2843         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Ditto.
2844         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Ditto.
2845         (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
2846         New helper method which does the mark/unmark just for growth limits.
2847         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2848         (WebCore::sortByGridTrackGrowthPotential): Use
2849         infiniteGrowthPotential() for sorting.
2850         (WebCore::RenderGrid::distributeSpaceToTracks):
2851         * rendering/RenderGrid.h:
2852
2853 2015-04-12  Benjamin Poulain  <benjamin@webkit.org>
2854
2855         Legacy scroll behavior on HTMLBodyElement should only apply to the first body element of a document
2856         https://bugs.webkit.org/show_bug.cgi?id=143651
2857
2858         Reviewed by Sam Weinig.
2859
2860         WebKit has some very weird behaviors for the scroll methods on body. This patch
2861         address the first bug: only the first body element should have the legacy behavior.
2862
2863         The relevant text in spec:
2864         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollleft
2865         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrolltop
2866         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollwidth
2867         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollheight
2868
2869         Tests: fast/dom/Element/body-scrollHeight-basics-quirks.html
2870                fast/dom/Element/body-scrollLeft-basics-quirks.html
2871                fast/dom/Element/body-scrollTop-basics-quirks.html
2872                fast/dom/Element/body-scrollWidth-basics-quirks.html
2873                fast/dom/Element/detached-body-element-does-not-scroll-main-frame-with-scrollLeft.html
2874                fast/dom/Element/detached-body-element-does-not-scroll-main-frame-with-scrollTop.html
2875
2876         * html/HTMLBodyElement.cpp:
2877         (WebCore::HTMLBodyElement::isFirstBodyElementOfDocument):
2878         (WebCore::HTMLBodyElement::scrollLeft):
2879         (WebCore::HTMLBodyElement::setScrollLeft):
2880         (WebCore::HTMLBodyElement::scrollTop):
2881         (WebCore::HTMLBodyElement::setScrollTop):
2882         (WebCore::HTMLBodyElement::scrollHeight):
2883         (WebCore::HTMLBodyElement::scrollWidth):
2884         * html/HTMLBodyElement.h:
2885
2886 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
2887
2888         Fix trival typos related to the word "coordinate".
2889         https://bugs.webkit.org/show_bug.cgi?id=143644
2890
2891         Reviewed by Alexey Proskuryakov.
2892
2893         No new tests, no behavior change.
2894
2895         * rendering/RenderBox.cpp:
2896         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2897
2898 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
2899
2900         Scrollbars in composited overflow and iframes fail to render on Mac
2901         https://bugs.webkit.org/show_bug.cgi?id=143647
2902         rdar://problem/20340544
2903
2904         Reviewed by Darin Adler.
2905
2906         When adding support for drawing scrollbars on the scrolling thread, we inadvertently
2907         disabled scrollbar drawing in other composited, main-thread scrolling configurations.
2908         
2909         Fix by having Scrollbar::supportsUpdateOnSecondaryThread() only return true if
2910         the scrollable area is using async scrolling.
2911         
2912         Sadly, we can't layout-test this.
2913
2914         * platform/Scrollbar.cpp:
2915         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
2916
2917 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
2918
2919         Selects don't scroll at some aspect ratios
2920         https://bugs.webkit.org/show_bug.cgi?id=143649
2921         rdar://problem/19365694
2922
2923         Reviewed by Darin Adler.
2924         
2925         Fix width/height flip in RenderListBox which caused us to fail to scroll when
2926         the list was wider than the scroll height.
2927         
2928         We're generally confused about RenderListBox scroll offsets (webkit.org/b/143648)
2929         but this fixes the immediate problem.
2930
2931         Test: fast/forms/listbox-visible-size.html
2932
2933         * rendering/RenderListBox.h:
2934
2935 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
2936
2937         Too much repainting on scrolling with fixed backgrounds
2938         https://bugs.webkit.org/show_bug.cgi?id=143637
2939         rdar://problem/20245243
2940
2941         Reviewed by Darin Adler.
2942         
2943         FrameView::scrollContentsSlowPath() would repaint the entire viewport if there were
2944         any slow-repaint objects (those with background-attachment: fixed) and the contents
2945         were using compositing for scrolling.
2946         
2947         This is wrong; we only need to issue repaint for the slow-repaint renderers,
2948         and, if the frame is hosted in a compositing layer and not using compositing for scrolling,
2949         repaint that hosting layer.
2950
2951         Tests: compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html
2952                compositing/repaint/iframes/compositing-iframe-scroll-repaint.html
2953                compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html
2954                platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint.html
2955
2956         * page/FrameView.cpp:
2957         (WebCore::FrameView::scrollContentsSlowPath):
2958
2959 2015-04-11  Matt Baker  <mattbaker@apple.com>
2960
2961         Web Inspector: create content view and details sidebar for Frames timeline
2962         https://bugs.webkit.org/show_bug.cgi?id=143533
2963
2964         Reviewed by Timothy Hatcher.
2965
2966         Refactoring: RunLoop prefix changed to RenderingFrame.
2967
2968         * inspector/InspectorTimelineAgent.cpp:
2969         (WebCore::InspectorTimelineAgent::internalStart):
2970         (WebCore::toProtocol):
2971         * inspector/InspectorTimelineAgent.h:
2972
2973 2015-04-11  Chris Dumez  <cdumez@apple.com>
2974
2975         Stop referring to outdated RFC2616 in CacheValidation.cpp
2976         https://bugs.webkit.org/show_bug.cgi?id=143619
2977
2978         Reviewed by Darin Adler.
2979
2980         Stop referring to outdated RFC2616 in CacheValidation.cpp and refer to
2981         the newer RFC7230 & RFC7234. Also update some variables to match the
2982         naming in the RFC for clarity.
2983
2984         No behavior change.
2985
2986         * platform/network/CacheValidation.cpp:
2987         (WebCore::updateResponseHeadersAfterRevalidation):
2988         (WebCore::computeCurrentAge):
2989         (WebCore::computeFreshnessLifetimeForHTTPFamily):
2990         (WebCore::isCacheHeaderSeparator):
2991         (WebCore::parseCacheControlDirectives):
2992
2993 2015-04-11  Ryosuke Niwa  <rniwa@webkit.org>
2994
2995         WebKit places caret in front of pasted Numbers cells instead of behind
2996         https://bugs.webkit.org/show_bug.cgi?id=143627
2997
2998         Reviewed by Darin Adler.
2999
3000         The bug was caused by Position::downstream not respecting modern position types inside a table.
3001         Fixed it by using Position::atStartOfNode which respects before/after positions.
3002
3003         This bug doesn't reproduce when there is no whitespace after td element in the pasted content
3004         because positionAtEndOfInsertedContent() will be inside the last pasted cell inside
3005         ReplaceSelectionCommand::completeHTMLReplacement in those cases. This related but separate bug
3006         is tracked in https://webkit.org/b/143628.
3007
3008         Tests: editing/pasteboard/paste-table-with-unrendered-text-nodes.html
3009
3010         * dom/Position.cpp:
3011         (WebCore::Position::downstream):
3012
3013 2015-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3014
3015         [ES6] Enable Symbol in web pages
3016         https://bugs.webkit.org/show_bug.cgi?id=143375
3017
3018         Reviewed by Ryosuke Niwa.
3019
3020         * inspector/InspectorFrontendClientLocal.cpp:
3021         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3022
3023 2015-04-10  Roger Fong  <roger_fong@apple.com>
3024
3025         Hide volume controls when playing wirelessly.
3026         https://bugs.webkit.org/show_bug.cgi?id=143621.
3027         <rdar://problem/20490673>
3028
3029         Reviewed by Darin Adler.
3030
3031         * Modules/mediacontrols/mediaControlsApple.js:
3032         (Controller.prototype.updateWirelessPlaybackStatus):
3033
3034 2015-04-10  Alexey Proskuryakov  <ap@apple.com>
3035
3036         Build fix.
3037
3038         * WebCore.xcodeproj/project.pbxproj: Make LaunchServicesSPI.h a private header
3039         instead of project, as it's used in WebKit.
3040
3041 2015-04-08  Sam Weinig  <sam@webkit.org>
3042
3043         Allow LaunchServices to handle URLs on link navigations
3044         <rdar://problem/19446826>
3045         https://bugs.webkit.org/show_bug.cgi?id=143544
3046
3047         Reviewed by Anders Carlsson.
3048
3049         * WebCore.xcodeproj/project.pbxproj:
3050         * platform/spi/ios/LaunchServicesSPI.h: Added.
3051         Add new SPI header.
3052
3053 2015-04-10  Bem Jones-Bey  <bjonesbe@adobe.com>
3054
3055         Unreviewed, added CSS Shapes to features.json file.
3056
3057         * features.json:
3058
3059 2015-04-10  Andy Estes  <aestes@apple.com>
3060
3061         [Content Filtering] Support modifying request URLs
3062         https://bugs.webkit.org/show_bug.cgi?id=143599
3063         rdar://problem/20442560
3064
3065         Reviewed by Darin Adler.
3066
3067         Tests: contentfiltering/modify-request-url.html
3068                http/tests/contentfiltering/modify-redirect-request-url.html
3069
3070         Allow NEFilterSource to modifiy request URLs. Also teach MockContentFilter to do the same for testing.
3071
3072         * platform/cocoa/NetworkExtensionContentFilter.mm:
3073         (WebCore::NetworkExtensionContentFilter::willSendRequest): If NEFilterSource provided a string representing a
3074         valid URL in decisionInfo[NEFilterSourceOptionsRedirectURL], then used that as the request URL.
3075         * platform/spi/cocoa/NEFilterSourceSPI.h: Temporarily defined NEFilterSourceOptionsRedirectURL.
3076         * testing/MockContentFilter.cpp:
3077         (WebCore::MockContentFilter::willSendRequest): If settings() has a valid modifiedRequestURL, use it as the
3078         request URL. Only do so once MockContentFilter has reached its decision point so that both initial requests and
3079         redirect requests can be tested.
3080         * testing/MockContentFilterSettings.h: Added modifiedRequestURL.
3081         (WebCore::MockContentFilterSettings::modifiedRequestURL): Ditto.
3082         (WebCore::MockContentFilterSettings::setModifiedRequestURL): Ditto.
3083         * testing/MockContentFilterSettings.idl: Ditto.
3084
3085 2015-04-10  Zalan Bujtas  <zalan@apple.com>
3086
3087         showRenderTree: Include the render object to the inlinebox output.
3088         https://bugs.webkit.org/show_bug.cgi?id=143610
3089
3090         This helps to match the inlinebox and its renderer.
3091
3092         Reviewed by Antti Koivisto.
3093
3094         * rendering/InlineBox.cpp:
3095         (WebCore::InlineBox::showLineBox):
3096
3097 2015-04-09  Roger Fong  <roger_fong@apple.com>
3098
3099         Update wireless player placard for OSX.
3100         https://bugs.webkit.org/show_bug.cgi?id=143585.
3101         <rdar://problem/12067439>
3102
3103         Reviewed by Eric Carlson.
3104
3105         * Modules/mediacontrols/mediaControlsApple.css:
3106         Adjust button positioning and svg.
3107         (audio::-webkit-media-controls-wireless-playback-picker-button):
3108         (audio::-webkit-media-controls-wireless-playback-picker-button.playing):
3109         Style the wireless playback status placard, small and big versions.
3110         (audio::-webkit-media-controls-wireless-playback-status):
3111         (audio::-webkit-media-controls-wireless-playback-text):
3112         (audio::-webkit-media-controls-wireless-playback-text-top):
3113         (audio::-webkit-media-controls-wireless-playback-text-bottom):
3114         (audio::-webkit-media-controls-wireless-playback-status.small):
3115         (audio::-webkit-media-controls-wireless-playback-text-top.small):
3116         (audio::-webkit-media-controls-wireless-playback-text-bottom.small):
3117         * Modules/mediacontrols/mediaControlsApple.js:
3118         Add new wireless player placard elements.
3119         (Controller.prototype.createControls):
3120         (Controller.prototype.configureInlineControls):
3121         Make sure to switch between small and big placards when switching between fullscreen and small videos.
3122         (Controller.prototype.configureFullScreenControls):
3123         (Controller.prototype.handleFullscreenChange):
3124         (Controller.prototype.updateWirelessPlaybackStatus):
3125
3126 2015-04-10  Eric Carlson  <eric.carlson@apple.com>
3127
3128         [Mac] Refactor MediaPlaybackTarget
3129         https://bugs.webkit.org/show_bug.cgi?id=143571
3130
3131         Reviewed by Jer Noble.
3132
3133         * WebCore.xcodeproj/project.pbxproj:
3134         * dom/Document.cpp:
3135         (WebCore::Document::addPlaybackTargetPickerClient): Don't call client if page playback target
3136             is NULL.
3137         (WebCore::Document::didChoosePlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
3138         * dom/Document.h:
3139
3140         * html/HTMLMediaElement.cpp:
3141         (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
3142         * html/HTMLMediaElement.h:
3143
3144         * html/HTMLMediaSession.cpp:
3145         (WebCore::HTMLMediaSession::HTMLMediaSession): Don't initialize m_playbackTarget.
3146         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
3147         * html/HTMLMediaSession.h:
3148
3149         * page/Page.cpp:
3150         (WebCore::Page::Page):
3151         (WebCore::Page::playbackTarget): m_playbackTarget is a RefPtr<MediaPlaybackTarget>
3152         (WebCore::Page::didChoosePlaybackTarget): Ditto.
3153         * page/Page.h:
3154
3155         * platform/audio/MediaSession.h:
3156         (WebCore::MediaSessionClient::setWirelessPlaybackTarget): Take a Ref<MediaPlaybackTarget>&&.
3157
3158         Make MediaPlaybackTarget RefCounted, and don't require it to be serializable so it can be
3159         subclassed to keep port-specific iformation out of the base class.
3160         * platform/graphics/MediaPlaybackTarget.h: 
3161         (WebCore::MediaPlaybackTarget::targetType):
3162         (WebCore::MediaPlaybackTarget::targetContext):
3163         (WebCore::MediaPlaybackTarget::hasActiveRoute):
3164         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget):
3165         (WebCore::MediaPlaybackTarget::setDevicePickerContext): Deleted.
3166         (WebCore::MediaPlaybackTarget::devicePickerContext): Deleted.
3167
3168         MediaPlaybackTargetContext is the struct that is serialized to pass across the process boudary.
3169         It has union to hold port-specific data.
3170         * platform/graphics/MediaPlaybackTargetContext.h: Added.
3171
3172         * platform/graphics/MediaPlaybackTargetPicker.h: didChoosePlaybackTarget takes a Ref<MediaPlaybackTarget>&&
3173         * platform/graphics/MediaPlaybackTargetPickerClient.h: Ditto.
3174         * platform/graphics/MediaPlayer.cpp:
3175         (WebCore::MediaPlayer::setWirelessPlaybackTarget): Ditto.
3176         * platform/graphics/MediaPlayer.h:
3177
3178         * platform/graphics/MediaPlayerPrivate.h:
3179         (WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
3180
3181         * platform/graphics/avfoundation/MediaPlaybackTargetMac.h: Added.
3182         (WebCore::MediaPlaybackTargetMac::targetType):
3183         (WebCore::MediaPlaybackTargetMac::outputContext):
3184         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
3185         (WebCore::MediaPlaybackTargetMac::create):
3186         (WebCore::MediaPlaybackTargetMac::MediaPlaybackTargetMac):
3187         (WebCore::MediaPlaybackTargetMac::~MediaPlaybackTargetMac):
3188         (WebCore::MediaPlaybackTargetMac::targetContext):
3189         (WebCore::MediaPlaybackTargetMac::hasActiveRoute):
3190         (WebCore::toMediaPlaybackTargetMac):
3191         (WebCore::MediaPlaybackTarget::encode): Deleted.
3192         (WebCore::MediaPlaybackTarget::decode): Deleted.
3193         (WebCore::MediaPlaybackTarget::hasActiveRoute): Deleted.
3194
3195         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3196         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Allocate and pass a MediaPlaybackTargetMac
3197         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3198
3199         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3200         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Take a Ref<MediaPlaybackTarget&&
3201
3202         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3203         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3204         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
3205
3206         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3207         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3208         (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
3209
3210 2015-04-09  Sergio Villar Senin  <svillar@igalia.com>
3211
3212         [CSS Grid Layout] Fix raw function pointer usages
3213         https://bugs.webkit.org/show_bug.cgi?id=143481
3214
3215         Reviewed by Antti Koivisto.
3216
3217         The argument list of
3218         resolveContentBasedTrackSizingFunctionsForItems() became too long
3219         and rather incomprehensible as it included up to 6 function
3220         pointers. This replaces all of them by an enum which describes the
3221         phase of the algorithm that is currently running. With that phase
3222         we have enough information to select the right function to call.
3223
3224         In order not to tangle up too much the method, the new explicit
3225         switch statements where moved to static helper functions.
3226
3227         No new tests as this is just a code refactoring.
3228
3229         * rendering/RenderGrid.cpp:
3230         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3231         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3232         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): New helper function.
3233         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Ditto.
3234         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Ditto.
3235         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Ditto.
3236         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Ditto.
3237         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3238         (WebCore::RenderGrid::distributeSpaceToTracks):
3239         * rendering/RenderGrid.h:
3240
3241 2015-04-10  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3242
3243         WebRTC: Remove AudioStreamTrack and VideoStreamTrack (removed in spec)
3244         https://bugs.webkit.org/show_bug.cgi?id=143336
3245
3246         Reviewed by Philippe Normand.
3247
3248         The specific MediaStreamTrakc types (AudioStreamTrack and VideoStreamTrack) have been
3249         removed from the Media Capture and Streams [1] specification.
3250
3251         [1] http://w3c.github.io/mediacapture-main/archives/20150324/getusermedia.html
3252
3253         There are no test for this feature to remove.
3254
3255         * CMakeLists.txt:
3256         * DerivedSources.make:
3257         * Modules/mediastream/AudioStreamTrack.cpp: Removed.
3258         * Modules/mediastream/AudioStreamTrack.h: Removed.
3259         * Modules/mediastream/AudioStreamTrack.idl: Removed.
3260         * Modules/mediastream/MediaStream.cpp:
3261         (WebCore::MediaStream::MediaStream):
3262         (WebCore::MediaStream::addRemoteTrack):
3263         (WebCore::MediaStream::active): Deleted.
3264         * Modules/mediastream/MediaStreamTrack.cpp:
3265         (WebCore::MediaStreamTrack::create):
3266         (WebCore::MediaStreamTrack::MediaStreamTrack):
3267         (WebCore::MediaStreamTrack::kind):
3268         (WebCore::MediaStreamTrack::clone):
3269         (WebCore::MediaStreamTrack::trackEnded): Deleted.
3270         * Modules/mediastream/MediaStreamTrack.h:
3271         * Modules/mediastream/VideoStreamTrack.cpp: Removed.
3272         * Modules/mediastream/VideoStreamTrack.h: Removed.
3273         * Modules/mediastream/VideoStreamTrack.idl: Removed.
3274         * WebCore.xcodeproj/project.pbxproj:
3275
3276 2015-04-09  Andy Estes  <aestes@apple.com>
3277
3278         [Cocoa] Add a HAVE(AVKIT) and use it
3279         https://bugs.webkit.org/show_bug.cgi?id=143593
3280
3281         Reviewed by David Kilzer.
3282
3283         * page/Settings.h: Only defined setAVKitEnabled() if HAVE(AVKIT).
3284         * platform/ios/WebVideoFullscreenControllerAVKit.mm: Only compiled if HAVE(AVKIT).
3285         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.
3286
3287 2015-04-09  Simon Fraser  <simon.fraser@apple.com>
3288
3289         Some CSS3 filters tests crash under iOS testing
3290         https://bugs.webkit.org/show_bug.cgi?id=143594
3291         rdar://problem/20491140
3292
3293         Reviewed by David Kilzer.
3294
3295         Some tests disable accelerated compositing via testRunner.overridePreference(). In this case,
3296         we'd not create a root scrolling tree node, so null-check it in AsyncScrollingCoordinator::updateNonFastScrollableRegion().
3297
3298         * page/scrolling/AsyncScrollingCoordinator.cpp:
3299         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
3300
3301 2015-04-09  Zalan Bujtas  <zalan@apple.com>
3302
3303         Simple line layout: Add <br> support.
3304         https://bugs.webkit.org/show_bug.cgi?id=139012
3305
3306         This patch enables RenderBlockFlows to use simple line layout on text content when <br> is present.
3307         Simple text with <br> is a fairly common pattern on discussion(forum)-like web pages. This patch reduces memory usage
3308         and speeds up layout for such content.
3309
3310         PerformanceTest/layout/line-layout-simple.html shows more than 2x speedup, when each paragraph is modified by appending <br> to the end.
3311         With <br> support enabled:
3312           mean: 70.02391461289068 runs/s
3313           median: 70.47986488932318 runs/s
3314
3315         While with <br> support disabled:
3316           mean: 30.417295049468184 runs/s
3317           median: 30.36517778760357 runs/s
3318
3319         Reviewed by Antti Koivisto.
3320
3321         Test: fast/text/simple-line-with-br.html
3322
3323         * editing/TextIterator.cpp:
3324         (WebCore::TextIterator::handleTextNode):
3325         * rendering/RenderBlock.h:
3326         * rendering/RenderBlockFlow.cpp:
3327         (WebCore::RenderBlockFlow::setSelectionState):
3328         (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
3329         * rendering/RenderBlockFlow.h:
3330         * rendering/RenderLineBreak.cpp:
3331         (WebCore::simpleLineLayout):
3332         (WebCore::ensureLineBoxes):
3333         (WebCore::RenderLineBreak::deleteLineBoxesBeforeSimpleLineLayout):
3334         (WebCore::RenderLineBreak::positionForPoint):
3335         (WebCore::RenderLineBreak::setSelectionState):
3336         (WebCore::RenderLineBreak::linesBoundingBox):
3337         (WebCore::RenderLineBreak::absoluteRects):
3338         (WebCore::RenderLineBreak::absoluteQuads):
3339         (WebCore::RenderLineBreak::collectSelectionRects):
3340         * rendering/RenderLineBreak.h:
3341         * rendering/RenderText.cpp:
3342         (WebCore::RenderText::absoluteRects):
3343         (WebCore::RenderText::absoluteQuadsClippedToEllipsis):
3344         (WebCore::RenderText::absoluteQuads):
3345         (WebCore::RenderText::linesBoundingBox):
3346         (WebCore::RenderText::caretMinOffset):
3347         (WebCore::RenderText::caretMaxOffset):
3348         (WebCore::RenderText::containsCaretOffset):
3349         (WebCore::RenderText::hasRenderedText):
3350         * rendering/SimpleLineLayout.cpp:
3351         (WebCore::SimpleLineLayout::canUseFor):
3352         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3353         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
3354         (WebCore::SimpleLineLayout::consumeLineBreakIfNeeded):
3355         (WebCore::SimpleLineLayout::skipWhitespaceIfNeeded):
3356         (WebCore::SimpleLineLayout::firstFragment):
3357         (WebCore::SimpleLineLayout::forceFragmentToLine):
3358         (WebCore::SimpleLineLayout::createLineRuns):
3359         (WebCore::SimpleLineLayout::create):
3360         * rendering/SimpleLineLayoutFlowContents.cpp:
3361         (WebCore::SimpleLineLayout::initializeSegments):
3362         (WebCore::SimpleLineLayout::FlowContents::segmentForRenderer): Deleted.
3363         * rendering/SimpleLineLayoutFlowContents.h:
3364         * rendering/SimpleLineLayoutFunctions.cpp:
3365         (WebCore::SimpleLineLayout::paintFlow):
3366         (WebCore::SimpleLineLayout::hitTestFlow):
3367         (WebCore::SimpleLineLayout::showLineLayoutForFlow):
3368         * rendering/SimpleLineLayoutResolver.cpp:
3369         (WebCore::SimpleLineLayout::RunResolver::Run::rect):
3370         (WebCore::SimpleLineLayout::RunResolver::RunResolver):
3371         (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
3372         * rendering/SimpleLineLayoutResolver.h:
3373         (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode):
3374         (WebCore::SimpleLineLayout::RunResolver::Iterator::operator--):
3375         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3376         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3377         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
3378         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3379         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3380         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3381         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLastInRenderer):
3382         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLineBreak):
3383         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
3384         (WebCore::SimpleLineLayout::TextFragmentIterator::isSoftLineBreak):
3385         (WebCore::SimpleLineLayout::TextFragmentIterator::isHardLineBreak):
3386         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak): Deleted.
3387
3388 2015-04-09  Chris Dumez  <cdumez@apple.com>
3389
3390         Regression(r182603): editing/selection/selection-invalid-offset.html is crashing
3391         https://bugs.webkit.org/show_bug.cgi?id=143591
3392
3393         Reviewed by Ryosuke Niwa.
3394
3395         Add missing null-check for m_frame->editor().client() in
3396         FrameSelection::updateAndRevealSelection().
3397
3398         * editing/FrameSelection.cpp:
3399         (WebCore::FrameSelection::updateAndRevealSelection):
3400
3401 2015-04-09  Sungmann Cho  <sungmann.cho@navercorp.com>
3402
3403         Minor cleanups to WebCore/plugins
3404         https://bugs.webkit.org/show_bug.cgi?id=143509
3405
3406         Reviewed by Anders Carlsson.
3407
3408         1. Remove unnecessary #includes.
3409         2. Fix some wrong namespace comments for consistency.
3410
3411         No new tests, no behavior change.
3412
3413         * plugins/DOMMimeType.cpp:
3414         * plugins/DOMMimeType.h:
3415         * plugins/DOMMimeTypeArray.h:
3416         * plugins/DOMPlugin.h:
3417         * plugins/DOMPluginArray.h:
3418         * plugins/PluginData.cpp:
3419         * plugins/PluginData.h:
3420         * plugins/PluginMainThreadScheduler.cpp:
3421         * plugins/PluginViewBase.h:
3422
3423 2015-04-09  Javier Fernandez  <jfernandez@igalia.com>
3424
3425         [CSS Grid Layout] Implement justify-self and justify-item css properties.
3426         https://bugs.webkit.org/show_bug.cgi?id=133281
3427
3428         Reviewed by David Hyatt.
3429
3430         Implement the new property 'justify-items', defined in the CSS Box Alignment
3431         specification to describe the container's alignment behavior, in the same way
3432         the 'align-items' property does. The 'justify-self' 'auto' value of any relative
3433         positioned element will be resolved to its container's 'justify-items' value.
3434
3435         Test: fast/css/parse-justify-items.html
3436
3437         * css/CSSComputedStyleDeclaration.cpp:
3438         (WebCore::resolveContainerAlignmentAuto): Function to resolve 'auto' values for 'align-items' or 'justify-items'.
3439         (WebCore::resolveSelfAlignmentAuto): Function to resolve 'auto' values for 'align-self' or 'justify-self'.
3440         (WebCore::valueForItemPositionWithOverflowAlignment): Take into account the 'legacy' keyword.
3441         (WebCore::ComputedStyleExtractor::propertyValue):
3442         (WebCore::resolveAlignmentAuto): Deleted (renamed to resolveContainerAlignmentAuto).
3443         * css/CSSParser.cpp:
3444         (WebCore::CSSParser::parseValue): Refactoring to share logic between justify-xxx and align-xxx properties.
3445         (WebCore::CSSParser::parseLegacyPosition): Parsing logic of 'legacy' keyword,
3446         (WebCore::CSSParser::parseItemPositionOverflowPosition): Take into account the 'legacy' keyword.
3447         * css/CSSParser.h:
3448         * css/CSSPropertyNames.in:
3449         * css/CSSValueKeywords.in:
3450         * css/StyleBuilderCustom.h:
3451         (WebCore::StyleBuilderCustom::applyInheritJustifyItems): Added.
3452         (WebCore::StyleBuilderCustom::applyInitialJustifyItems): Added.
3453         (WebCore::StyleBuilderCustom::applyValueJustifyItems): Added.
3454         * css/StyleResolver.cpp:
3455         (WebCore::StyleResolver::adjustRenderStyle): Resolve 'auto' values for justify-items when parents have the 'legacy' keyword.
3456         * rendering/style/RenderStyle.h: Managing the new ItemPositionType fields.
3457         * rendering/style/RenderStyleConstants.h: Added the ItemPositionType enumeration for handling the 'legacy' keyword.
3458         * rendering/style/StyleRareNonInheritedData.cpp: Managing the new ItemPositionType fields.
3459         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3460         (WebCore::StyleRareNonInheritedData::operator==):
3461         * rendering/style/StyleRareNonInheritedData.h:
3462
3463 2015-04-09  Anders Carlsson  <andersca@apple.com>
3464
3465         Make it possible to create an application cache storage with custom directories
3466         https://bugs.webkit.org/show_bug.cgi?id=143588
3467
3468         Reviewed by Sam Weinig.
3469
3470         Add cache directory and flat file directory name parameters to ApplicationCacheStorage::create.
3471
3472         * loader/appcache/ApplicationCacheStorage.cpp:
3473         (WebCore::ApplicationCacheStorage::store):
3474         (WebCore::ApplicationCacheStorage::loadCache):
3475         (WebCore::ApplicationCacheStorage::checkForDeletedResources):
3476         (WebCore::ApplicationCacheStorage::flatFileAreaSize):
3477         (WebCore::ApplicationCacheStorage::ApplicationCacheStorage):
3478         (WebCore::ApplicationCacheStorage::create):
3479         (WebCore::ApplicationCacheStorage::singleton):
3480         * loader/appcache/ApplicationCacheStorage.h:
3481
3482 2015-04-09  Myles C. Maxfield  <mmaxfield@apple.com>
3483
3484         Text-combine erroneously draws vertically after non-layout-causing style change
3485         https://bugs.webkit.org/show_bug.cgi?id=143461
3486         <rdar://problem/19285490>
3487
3488         Reviewed by Darin Adler.
3489
3490         RenderCombineText::styleDidChange() unconditionally uncombines its text. Layout then
3491         recombines it. However, if there is a style change that does not cause layout, the
3492         RenderCombineText will be left uncombined until the next layout.
3493
3494         Test: fast/text/text-combine-style-change-no-layout.html
3495
3496         * rendering/RenderCombineText.cpp:
3497         (WebCore::RenderCombineText::styleDidChange):
3498
3499 2015-04-09  Simon Fraser  <simon.fraser@apple.com>
3500
3501         Revert part of 182516: it broke tests
3502         https://bugs.webkit.org/show_bug.cgi?id=143568
3503         rdar://problem/20484578
3504
3505         Reviewed by Myles Maxfield.
3506
3507         Revert the FontCascadeCocoa parts of r182516, since it broke some CSS shapes tests.
3508
3509         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3510         (WebCore::FontCascade::drawGlyphs):
3511         (WebCore::dilationSizeForTextColor): Deleted.
3512
3513 2015-04-09  Zalan Bujtas  <zalan@apple.com>
3514
3515         Simple line layout(regression): Calling innerText on RenderFlow with multiple children is slow.
3516         https://bugs.webkit.org/show_bug.cgi?id=143554
3517
3518         Reviewed by Antti Koivisto.
3519
3520         Initialize render flow's segments only when the render flow changes in TextIterator.
3521         The included performance test shows 6x speedup. (from ~10 runs/sec to ~60 runs/sec)
3522
3523         Test: PerformanceTests/Layout/simple-line-layout-innertext.html.
3524
3525         * editing/TextIterator.cpp:
3526         (WebCore::TextIterator::handleTextNode):
3527         * editing/TextIterator.h:
3528         * rendering/SimpleLineLayoutFlowContents.cpp: Instruments log shows that vector's expandCapacity could be expensive when flow has large amount of children.
3529         (WebCore::SimpleLineLayout::initializeSegments):
3530
3531 2015-04-09  Chris Dumez  <cdumez@apple.com>
3532
3533         [WK2][iOS] editorState() should not cause a synchronous layout
3534         https://bugs.webkit.org/show_bug.cgi?id=142536
3535         <rdar://problem/20041506>
3536
3537         Reviewed by Enrica Casucci.
3538
3539         Add didChangeSelectionAndUpdateLayout() callback to EditorClient
3540         that is called at the end of FrameSelection::updateAndRevealSelection().
3541
3542         * editing/FrameSelection.cpp:
3543         (WebCore::FrameSelection::updateAndRevealSelection):
3544         * loader/EmptyClients.h:
3545         * page/EditorClient.h:
3546
3547 2015-04-08  Anders Carlsson  <andersca@apple.com>
3548
3549         Give each cache group a storage and use it in place of the singleton
3550         https://bugs.webkit.org/show_bug.cgi?id=143540
3551
3552         Reviewed by Sam Weinig.
3553
3554         This is another step towards making the cache storage be per page.
3555
3556         * loader/appcache/ApplicationCacheGroup.cpp:
3557         (WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
3558         (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup):
3559         (WebCore::ApplicationCacheGroup::cacheForMainRequest):
3560         (WebCore::ApplicationCacheGroup::fallbackCacheForMainRequest):
3561         (WebCore::ApplicationCacheGroup::selectCache):
3562         (WebCore::ApplicationCacheGroup::makeObsolete):
3563         (WebCore::ApplicationCacheGroup::didReachMaxAppCacheSize):
3564         (WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota):
3565         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
3566         * loader/appcache/ApplicationCacheGroup.h:
3567         * loader/appcache/ApplicationCacheStorage.cpp:
3568         (WebCore::ApplicationCacheStorage::loadCacheGroup):
3569         (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
3570         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
3571         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
3572
3573 2015-04-09  Andy Estes  <aestes@apple.com>
3574
3575         Try to fix the Mac build after r182596.
3576
3577         I was wrong to replace PLATFORM(IOS) with HAVE(PARENTAL_CONTROLS) in ContentFilterUnblockHandler.
3578         The conditional should be HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS).
3579
3580         * platform/ContentFilterUnblockHandler.h:
3581         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3582         (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler):
3583         (WebCore::ContentFilterUnblockHandler::needsUIProcess):
3584         (WebCore::ContentFilterUnblockHandler::encode):
3585         (WebCore::ContentFilterUnblockHandler::decode):
3586         (WebCore::ContentFilterUnblockHandler::canHandleRequest):
3587         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
3588
3589 2015-04-09  Andy Estes  <aestes@apple.com>
3590
3591         [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
3592         https://bugs.webkit.org/show_bug.cgi?id=143559
3593
3594         Reviewed by David Kilzer.
3595
3596         * loader/ContentFilter.cpp:
3597         (WebCore::ContentFilter::types): Only registered ParentalControlsContentFilter if HAVE(PARENTAL_CONTROLS).
3598         * platform/ContentFilterUnblockHandler.h: Changed PLATFORM(IOS) to HAVE(PARENTAL_CONTROLS).
3599         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3600         (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Ditto.
3601         (WebCore::ContentFilterUnblockHandler::needsUIProcess): Ditto.
3602         (WebCore::ContentFilterUnblockHandler::encode): Ditto.
3603         (WebCore::ContentFilterUnblockHandler::decode): Ditto.
3604         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Ditto.
3605         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Ditto.
3606         * platform/cocoa/ParentalControlsContentFilter.mm: Wrapped the file with HAVE(PARENTAL_CONTROLS)
3607
3608 2015-04-09  Sergio Villar Senin  <svillar@igalia.com>
3609
3610         Unreviewed, added CSS Grid Layout to features.json file.
3611
3612         * features.json:
3613
3614 2015-04-08  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3615
3616         [Streams API] Support the start function parameter in ReadableStream constructor
3617         https://bugs.webkit.org/show_bug.cgi?id=141160
3618
3619         Reviewed by Benjamin Poulain.
3620
3621         Stores the JS source object in ReadableStreamJSSource and calls its "start" function.
3622         This function takes a controller object that has three JS functions as members: close, enqueue and error.
3623         This controller is stored in ReadableStreamJSSource as it will be reused as "pull" parameter.
3624         All three JS functions do not currently do anything.
3625
3626         Test: streams/readablestream-start.html
3627
3628         * Modules/streams/ReadableStream.cpp:
3629         (WebCore::ReadableStream::start): Place holder for step 11 of https://streams.spec.whatwg.org/#rs-constructor.
3630         * Modules/streams/ReadableStream.h:
3631         * bindings/js/JSReadableStreamCustom.cpp:
3632         (WebCore::constructJSReadableStream):
3633         * bindings/js/ReadableStreamJSSource.cpp:
3634         (WebCore::getPropertyFromObject): Helper function to get a public property from an object.
3635         (WebCore::setPropertyToObject): Helper function to set a public property to an object.
3636         (WebCore::callFunction): Helper function to call a JS function from C++.
3637         (WebCore::ReadableStreamJSSource::ReadableStreamJSSource):
3638         (WebCore::notImplementedFunction):
3639         (WebCore::createReadableStreamEnqueueFunction): Creates the JS function for enqueue.
3640         (WebCore::createReadableStreamCloseFunction): Creates the JS function for close.
3641         (WebCore::createReadableStreamErrorFunction): Creates the JS function for error.
3642         (WebCore::startReadableStreamAsync): Equivalent of promise resolution for start.
3643         (WebCore::ReadableStreamJSSource::start): Calls the "start" function of the JS source with all three JS functions (enqueue, close, error) as parameters.
3644         * bindings/js/ReadableStreamJSSource.h:
3645
3646 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
3647
3648         [Mac] Unreviewed test fix after r182584
3649         https://bugs.webkit.org/show_bug.cgi?id=143452
3650
3651         Correct bit comparison to use the correct value for the Control-key
3652
3653         * platform/mac/PlatformEventFactoryMac.mm:
3654         (WebCore::typeForEvent):
3655
3656 2015-04-08  Simon Fraser  <simon.fraser@apple.com>
3657
3658         Add a debug assertion that will fire if we try to paint layer contents on a background thread
3659         https://bugs.webkit.org/show_bug.cgi?id=143547
3660
3661         Reviewed by Alexey Proskuryakov.
3662
3663         New assertion to catch cases where other frameworks erroneously trigger painting
3664         on a non-main (or non-Web) thread.
3665
3666         * platform/graphics/mac/WebLayer.mm:
3667         (-[WebSimpleLayer display]):
3668         (-[WebSimpleLayer drawInContext:]):
3669
3670 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
3671
3672         [Mac] WebKit is not honoring OS preferences for secondary click behaviors
3673         https://bugs.webkit.org/show_bug.cgi?id=143452
3674         <rdar://problem/20437483>
3675
3676         Reviewed by Tim Horton.
3677
3678         We cannot rely on the event's button number to decide behavior. The OS settings might have
3679         mapped middle button to context menu, etc. Instead, we should ask the OS (via NSMenu) what
3680         the proper button press behavior is.
3681
3682         * platform/mac/PlatformEventFactoryMac.mm:
3683         (WebCore::mouseButtonForEvent): Ask NSMenu what kind of button press we have received.
3684
3685 2015-04-08  Michael Catanzaro  <mcatanzaro@igalia.com>
3686
3687         Fix -Wformat in AnimationBase.cpp
3688         https://bugs.webkit.org/show_bug.cgi?id=143541
3689
3690         Reviewed by Simon Fraser.
3691
3692         * page/animation/AnimationBase.cpp:
3693         (WebCore::nameForStateInput): Added. Converts an AnimationBase::AnimationStateInput to a
3694         string.
3695         (WebCore::AnimationBase::updateStateMachine): Print AnimationBase::AnimationStateInput as a
3696         string, instead of passing it to %d and assuming that works, to silence GCC's -Wformat.
3697
3698 2015-04-08  Brady Eidson  <beidson@apple.com>
3699
3700         Expose the "Share" menu for links, images, and media.
3701         <rdar://problem/20435340> and https://bugs.webkit.org/show_bug.cgi?id=143502
3702
3703         Reviewed by Tim Horton.
3704
3705         * loader/EmptyClients.h:
3706         * page/ContextMenuClient.h:
3707         (WebCore::ContextMenuClient::shareSelectedTextMenuItem): Deleted.
3708
3709         * page/ContextMenuController.cpp:
3710         (WebCore::ContextMenuController::populate):
3711         (WebCore::selectionContainsPossibleWord): Deleted.
3712         * page/ContextMenuController.h:
3713         (WebCore::ContextMenuController::page):
3714
3715         * platform/ContextMenuItem.cpp:
3716         (WebCore::ContextMenuItem::ContextMenuItem):
3717         (WebCore::ContextMenuItem::isNull):
3718         (WebCore::ContextMenuItem::shareMenuItem):
3719         (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
3720         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
3721         * platform/ContextMenuItem.h:
3722
3723         * platform/gtk/ContextMenuItemGtk.cpp:
3724         (WebCore::ContextMenuItem::shareMenuItem): Return a null item.
3725         (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
3726         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
3727
3728         * platform/mac/ContextMenuItemMac.mm:
3729         (WebCore::ContextMenuItem::shareMenuItem): Create a full-featured Share menu item instead of just for selected text.
3730         (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
3731         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
3732
3733         * rendering/HitTestResult.cpp:
3734         (WebCore::HitTestResult::selectedText): Instead of calculating selected text outside the HitTestResult, let the
3735           HitTestResult do what it does best: Calculate things!
3736         * rendering/HitTestResult.h:
3737
3738 2015-04-08  Per Arne Vollan  <peavo@outlook.com>
3739
3740         [Curl] Compile error in CurlCacheEntry::parseResponseHeaders method.
3741         https://bugs.webkit.org/show_bug.cgi?id=143531
3742
3743         Reviewed by Alex Christensen.
3744
3745         Cache related methods in ResourceResponse have changed return type.
3746
3747         * platform/network/curl/CurlCacheEntry.cpp:
3748         (WebCore::CurlCacheEntry::parseResponseHeaders):
3749
3750 2015-04-08  Anders Carlsson  <andersca@apple.com>
3751
3752         Remove ApplicationCacheGroup::m_isCopy
3753         https://bugs.webkit.org/show_bug.cgi?id=143536
3754
3755         Reviewed by Tim Horton.
3756
3757         Code that used to set m_isCopy to true is long gone.
3758
3759         * loader/appcache/ApplicationCache.cpp:
3760         (WebCore::ApplicationCache::~ApplicationCache):
3761         * loader/appcache/ApplicationCacheGroup.cpp:
3762         (WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
3763         (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup):
3764         * loader/appcache/ApplicationCacheGroup.h:
3765         (WebCore::ApplicationCacheGroup::isCopy): Deleted.
3766
3767 2015-04-08  Anders Carlsson  <andersca@apple.com>
3768
3769         Delete ApplicationCache static member functions
3770         https://bugs.webkit.org/show_bug.cgi?id=143534
3771
3772         Reviewed by Tim Horton.
3773
3774         * loader/appcache/ApplicationCache.cpp:
3775         (WebCore::ApplicationCache::deleteCacheForOrigin): Deleted.
3776         (WebCore::ApplicationCache::deleteAllCaches): Deleted.
3777         (WebCore::ApplicationCache::diskUsageForOrigin): Deleted.
3778         * loader/appcache/ApplicationCache.h:
3779
3780 2015-04-08  Alex Christensen  <achristensen@webkit.org>
3781
3782         Block popups from content extensions.
3783         https://bugs.webkit.org/show_bug.cgi?id=143497
3784
3785         Reviewed by Brady Eidson.
3786
3787         Test: http/tests/contentextensions/popups.html
3788
3789         * loader/ResourceLoadInfo.cpp:
3790         (WebCore::readResourceType):
3791         * loader/ResourceLoadInfo.h:
3792         * page/DOMWindow.cpp:
3793         (WebCore::DOMWindow::open):
3794         * page/UserContentController.cpp:
3795         (WebCore::UserContentController::actionsForResourceLoad):
3796         * page/UserContentController.h:
3797         Check content extensions before opening a window.
3798
3799 2015-04-08  Bem Jones-Bey  <bjonesbe@adobe.com>
3800
3801         [CSS Shapes] Properly handle negative reference box widths and center coordinates
3802         https://bugs.webkit.org/show_bug.cgi?id=142610
3803
3804         Reviewed by Rob Buis.
3805
3806         Fix a few cases where values that should not be negative end up that
3807         way.
3808
3809         This patch is based on a couple of Blink patches by Rob Buis.
3810
3811         Tests: fast/shapes/shape-outside-floats/shape-outside-floats-circle-negative-radius-crash.html
3812                fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-width-crash.html
3813
3814         * rendering/shapes/ShapeOutsideInfo.cpp:
3815         (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): A
3816             negative margin box width means that the shape has no extent, so
3817             clamp to zero.
3818         * rendering/style/BasicShapes.cpp:
3819         (WebCore::BasicShapeCircle::floatValueForRadiusInBox): When computing
3820             the radii, take the absolute value, since the radii is based on
3821             the distance, which is always positive.
3822         (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto.
3823
3824 2015-04-08  Commit Queue  <commit-queue@webkit.org>
3825
3826         Unreviewed, rolling out r182522.
3827         https://bugs.webkit.org/show_bug.cgi?id=143529
3828
3829         Not needed any more (Requested by ap on #webkit).
3830
3831         Reverted changeset:
3832
3833         "Fix the build."
3834         http://trac.webkit.org/changeset/182522
3835
3836 2015-04-08  Beth Dakin  <bdakin@apple.com>
3837
3838         Force events should not require preventDefault in order to fire
3839         https://bugs.webkit.org/show_bug.cgi?id=143503
3840         -and corresponding-
3841         rdar://problem/20458916
3842
3843         Reviewed by Tim Horton.
3844
3845         Since these events will fire whether or not preventDefault was set on the 
3846         willBegin event, we should make sure we only send them when there are registered 
3847         event listeners. These are new events, so we don’t want to spam the vast majority 
3848         of web content that doesn’t use them yet.
3849         * dom/Document.cpp:
3850         (WebCore::Document::addListenerTypeIfNeeded):
3851         * dom/Document.h:
3852         * dom/Element.cpp:
3853         (WebCore::Element::dispatchMouseForceWillBegin):
3854         (WebCore::Element::dispatchMouseForceChanged):
3855         (WebCore::Element::dispatchMouseForceDown):
3856         (WebCore::Element::dispatchMouseForceUp):
3857         (WebCore::Element::dispatchMouseForceClick):
3858         (WebCore::Element::dispatchMouseForceCancelled):
3859
3860 2015-04-08  Jer Noble  <jer.noble@apple.com>
3861
3862         [Mac][WebAudio] Update the AVAudioMix in the AudioSourceProviderAVFObjC when the list of enabled audio tracks change.
3863         https://bugs.webkit.org/show_bug.cgi?id=143332
3864
3865         Reviewed by Eric Carlson.
3866
3867         Some media assets (notably, mp3s) will not have an enabled audio track when the AVAsset is
3868         first loaded, so the AVAudioMix will have no trackID in it's parameters. Whenever the list
3869         of enabled tracks change, recreate the AVAudioMix with the new first enabled audio trackID.
3870
3871         To facilitate this, add a new setter to AudioSourceProviderAVFObjC taking an AVAssetTrack to
3872         use with the AVAudioMix. Whenever this parameter changes, the AVAudioMix is destroyed and
3873         recreated.
3874
3875         * html/HTMLMediaElement.cpp:
3876         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Drive-by fix: when the media
3877             player switches engines, re-associate the audio source node with its provider.
3878         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
3879         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3880         (WebCore::AudioSourceProviderAVFObjC::setPlayerItem): Only create the mix if there is a valid AVPlayerItem and AVAssetTrack
3881         (WebCore::AudioSourceProviderAVFObjC::setAudioTrack): Ditto.
3882         (WebCore::AudioSourceProviderAVFObjC::createMix): Don't iterate over the AVPlayerItem's tracks,
3883             just use the one passed in through setAudioTrack().
3884         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3885         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear the provider's track.
3886         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Set the provider's track.
3887         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Ditto.
3888         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto.
3889
3890 2015-04-08  Anders Carlsson  <andersca@apple.com>
3891
3892         Move some ApplicationCache static member functions to ApplicationCacheStorage
3893         https://bugs.webkit.org/show_bug.cgi?id=143524
3894
3895         Reviewed by Antti Koivisto.
3896
3897         This is yet another step towards eliminating ApplicationCacheStorage::singleton() and making the storage be per page instead.
3898
3899         * loader/appcache/ApplicationCache.cpp:
3900         (WebCore::ApplicationCache::deleteCacheForOrigin):
3901         (WebCore::ApplicationCache::deleteAllCaches):
3902         (WebCore::ApplicationCache::diskUsageForOrigin):
3903         * loader/appcache/ApplicationCacheStorage.cpp:
3904         (WebCore::ApplicationCacheStorage::deleteAllCaches):
3905         (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
3906         (WebCore::ApplicationCacheStorage::diskUsageForOrigin):
3907         * loader/appcache/ApplicationCacheStorage.h:
3908
3909 2015-04-08  ChangSeok Oh  <changseok.oh@collabora.com>
3910
3911         Fill list style background with same color with that of list background.
3912         https://bugs.webkit.org/show_bug.cgi?id=143483
3913
3914         Reviewed by Simon Fraser.
3915
3916         LayoutListMarker does not have a node so its selectionBackgroundColor alway returns
3917         the default theme color for selection. We can make it more natural by filling
3918         the same color with that of LayoutListItem into it.
3919
3920         Tests: fast/backgrounds/selection-background-color-of-image-list-style.html
3921                fast/backgrounds/selection-background-color-of-list-style.html
3922
3923         * rendering/RenderListMarker.cpp:
3924         (WebCore::RenderListMarker::paint):
3925
3926 2015-04-08  Alex Christensen  <achristensen@webkit.org> and Patrick Gansterer  <paroga@webkit.org>
3927
3928         Add CMake build system for WinCairo port.
3929         https://bugs.webkit.org/show_bug.cgi?id=115944
3930
3931         Reviewed by Chris Dumez.
3932
3933         * CMakeLists.txt:
3934         * PlatformWin.cmake:
3935         * PlatformWinCairo.cmake:
3936         * platform/graphics/texmap/TextureMapperGL.cpp:
3937         (WebCore::TextureMapperGL::TextureMapperGL):
3938
3939 2015-04-08  Chris Dumez  <cdumez@apple.com>
3940
3941         Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for clarity
3942         https://bugs.webkit.org/show_bug.cgi?id=143513
3943
3944         Reviewed by Andreas Kling.
3945
3946         Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for
3947         clarity as it is only used for the page cache. Also rename the
3948         'DocumentWillBecomeInactive' value of the ReasonForSuspension enum to
3949         'PageCache' as it is only used by CachedFrame for the page cache and it
3950         is a lot more understandable.
3951
3952 2015-04-08  Commit Queue  <commit-queue@webkit.org>
3953
3954         Unreviewed, rolling out r182536.
3955         https://bugs.webkit.org/show_bug.cgi?id=143523
3956
3957         Made accessibility/table-sections.html time out on debug bots
3958         (Requested by ap on #webkit).
3959
3960         Reverted changeset:
3961
3962         "Simple line layout: Add <br> support."
3963         https://bugs.webkit.org/show_bug.cgi?id=139012
3964         http://trac.webkit.org/changeset/182536
3965
3966 2015-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3967
3968         [GTK] Crash in DOMObjectCache when a wrapped object owned by the cache is unreffed by the user
3969         https://bugs.webkit.org/show_bug.cgi?id=143521
3970
3971         Reviewed by Martin Robinson.
3972
3973         This is a case we claim to support, but it only works if the
3974         object has only one reference. In that case, when the user unrefs
3975         it, the weak ref notify callback removes the object from the
3976         cache. However, if the object has more than one ref, the cache
3977         doesn't know the user unreffed it, and when clearing the cache we
3978         try to remove more references than what the object actually has,
3979         causing a crash in g_object_unref.
3980
3981         * bindings/gobject/DOMObjectCache.cpp:
3982         (WebKit::DOMObjectCacheData::clearObject):
3983
3984 2015-04-08  Zalan Bujtas  <zalan@apple.com>
3985
3986         Simple line layout: Add <br> support.
3987         https://bugs.webkit.org/show_bug.cgi?id=139012
3988
3989         This patch enables RenderBlockFlows to use simple line layout on text&