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