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