[SOUP] Use a webkit subdirectory for the disk cache
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [SOUP] Use a webkit subdirectory for the disk cache
4         https://bugs.webkit.org/show_bug.cgi?id=144048
5
6         Reviewed by Martin Robinson.
7
8         Add a static method to SoupNetworkSession to clear a soup cache
9         given its directory.
10
11         * platform/network/soup/SoupNetworkSession.cpp:
12         (WebCore::strIsNumeric):
13         (WebCore::SoupNetworkSession::clearCache):
14         * platform/network/soup/SoupNetworkSession.h:
15
16 2015-04-23  Andy Estes  <aestes@apple.com>
17
18         Fix the iOS build after r183234.
19
20         * platform/ios/LegacyTileCache.mm:
21         (WebCore::LegacyTileCache::commitScaleChange):
22
23 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
24
25         Fix Windows build.
26
27         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
28         (PlatformCALayerWin::setBackingStoreAttached):
29         (PlatformCALayerWin::backingStoreAttached):
30         * platform/graphics/ca/win/PlatformCALayerWin.h:
31
32 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
33
34         Make it possible to detach GraphicsLayerCA backing store
35         https://bugs.webkit.org/show_bug.cgi?id=144140
36
37         Reviewed by Tim Horton.
38
39         This changes makes it possible to denote a GraphicsLayerCA's backing store
40         as "attached" or not. When not attached, the backing store is made volatile
41         and can be purged. This will be used in a future patch.
42
43         * platform/graphics/ca/GraphicsLayerCA.h: Add updateBackingStoreAttachment().
44         * platform/graphics/ca/PlatformCALayer.h:
45         * platform/graphics/ca/mac/PlatformCALayerMac.h:
46         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Stubs. In future, we could
47         remove backing store on Mac and iOS WK1 too.
48         (PlatformCALayerMac::setBackingStoreAttached):
49         (PlatformCALayerMac::backingStoreAttached):
50
51 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
52
53         Remove "layer" from GraphicsLayerCA member function names
54         https://bugs.webkit.org/show_bug.cgi?id=144139
55
56         Reviewed by Myles Maxfield.
57
58         Rename "updateLayer*" to "update*" in GraphicsLayerCA.
59
60         * platform/graphics/ca/GraphicsLayerCA.cpp:
61         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
62         (WebCore::GraphicsLayerCA::updateNames):
63         (WebCore::GraphicsLayerCA::updateDrawsContent):
64         (WebCore::GraphicsLayerCA::updateLayerNames): Deleted.
65         (WebCore::GraphicsLayerCA::updateLayerDrawsContent): Deleted.
66         * platform/graphics/ca/GraphicsLayerCA.h:
67
68 2015-04-23  Dan Bernstein  <mitz@apple.com>
69
70         <rdar://problem/20663758> Fix the build after AVPlayerViewController API change
71
72         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
73         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Don’t pass a nil completion
74         handler to -[AVPlayerViewController exitFullScreenAnimated:completionHandler:].
75
76 2015-04-23  Darin Adler  <darin@apple.com>
77
78         Another round of removing use of OwnPtr, PassOwnPtr, and deleteOwnedPtr
79         https://bugs.webkit.org/show_bug.cgi?id=144090
80
81         Reviewed by Anders Carlsson.
82
83         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h: Removed unneeded include.
84
85         * Modules/navigatorcontentutils/NavigatorContentUtils.h: Removed include of
86         RefCountedSupplement.h.
87
88         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
89         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
90         Pass data using rvalue references, and use new/delete to pass it across
91         threads, rather than using PassOwnPtr.
92         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: Pass data
93         in an rvalue reference instead of PassOwnPtr.
94         * Modules/websockets/WebSocket.cpp:
95         (WebCore::WebSocket::didReceiveBinaryData): Take an rvalue reference
96         instead of a PassOwnPtr.
97         * Modules/websockets/WebSocket.h: Ditto.
98         * Modules/websockets/WebSocketChannel.cpp: Ditto.
99         (WebCore::WebSocketChannel::processFrame): Ditto.
100         * Modules/websockets/WebSocketChannelClient.h:
101         (WebCore::WebSocketChannelClient::didReceiveBinaryData): Ditto.
102         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
103         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
104         Ditto.
105         * Modules/websockets/WorkerThreadableWebSocketChannel.h: Ditto.
106
107         * WebCore.xcodeproj/project.pbxproj: Removed RefCountedSupplement.h.
108
109         * loader/cocoa/DiskCacheMonitorCocoa.mm:
110         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Fixed comment
111         to not mention adoptPtr.
112
113         * page/make_settings.pl:
114         (generateInternalSettingsHeaderFile): Removed include of RefCountedSupplement.h.
115
116         * platform/ColorChooserClient.h: Removed unneded include.
117         * platform/ContextMenuItem.h: Ditto.
118
119         * platform/RefCountedSupplement.h: Removed.
120
121         * platform/ScrollAnimator.cpp: Removed unneeded include.
122         * platform/ScrollAnimatorNone.h: Ditto.
123
124         * platform/ThreadGlobalData.cpp: Added now-needed include of PassOwnPtr.h.
125
126         * platform/graphics/GlyphMetricsMap.h: Ditto.
127         * platform/graphics/MediaPlayer.h: Ditto.
128         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: Ditto.
129         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Ditto.
130         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Ditto.
131         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Ditto.
132         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h: Ditto.
133         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: Ditto.
134         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: Ditto.
135
136         * platform/graphics/cg/ImageBufferCG.cpp:
137         (WebCore::ImageBuffer::ImageBuffer): Use make_unique instead of adoptPtr.
138         * platform/graphics/cg/ImageBufferDataCG.cpp:
139         (WebCore::ImageBufferData::getData): Return a RefPtr instead of a PassRefPtr.
140         * platform/graphics/cg/ImageBufferDataCG.h: Streamlined the header a bit,
141         use unique_ptr instead of OwnPtr and RefPtr instead of PassRefPtr.
142
143         * platform/graphics/cocoa/IOSurface.h: Use unique_ptr instead of OwnPtr.
144         * platform/graphics/cocoa/IOSurface.mm:
145         (IOSurface::ensureGraphicsContext): Use make_unique instead of adoptPtr.
146
147         * platform/graphics/egl/GLContextEGL.cpp: Removed unneeded includes.
148         * platform/graphics/filters/FilterOperation.h: Ditto.
149         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Ditto.
150         * platform/ios/DeviceMotionClientIOS.h: Ditto.
151         * platform/ios/DeviceOrientationClientIOS.h: Ditto.
152
153         * platform/ios/LegacyTileCache.h: Use unique_ptr instead of OwnPtr.
154         * platform/ios/LegacyTileCache.mm:
155         (WebCore::LegacyTileCache::LegacyTileCache): Use make_unique instead of
156         a create function, and also get rid of unneeded initialization to null.
157         (WebCore::LegacyTileCache::commitScaleChange): Ditto.
158
159         * platform/ios/LegacyTileGrid.h: Made constructor public and got rid of create
160         function. Made constructor take a reference to the tile cache, and make both
161         tileCache() and m_tileCache be references too.
162
163         * platform/ios/LegacyTileGrid.mm:
164         (WebCore::LegacyTileGrid::LegacyTileGrid): Updated to use reference.
165         (WebCore::LegacyTileGrid::visibleRect): Ditto.
166         (WebCore::LegacyTileGrid::tileByteSize) Ditto.:
167         (WebCore::LegacyTileGrid::dropDistantTiles): Ditto.
168         (WebCore::LegacyTileGrid::updateTileOpacity): Ditto.
169         (WebCore::LegacyTileGrid::updateTileBorderVisibility): Ditto.
170         (WebCore::LegacyTileGrid::updateHostLayerSize): Ditto.
171         (WebCore::LegacyTileGrid::invalidateTiles): Ditto.
172         (WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage): Ditto.
173         (WebCore::LegacyTileGrid::tileDistance2): Ditto.
174         (WebCore::LegacyTileGrid::createTiles): Ditto.
175         * platform/ios/LegacyTileGridTile.mm:
176         (WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
177         (WebCore::LegacyTileGridTile::invalidateRect): Ditto.
178         (WebCore::LegacyTileGridTile::showBorder): Ditto.
179         * platform/ios/LegacyTileLayer.mm:
180         (-[LegacyTileHostLayer renderInContext:]): Ditto.
181         (-[LegacyTileLayer layoutSublayers]): Ditto.
182         (-[LegacyTileLayer drawInContext:]): Ditto.
183
184         * platform/ios/LegacyTileLayerPool.h: Removed unneeded include.
185         * platform/ios/ScrollAnimatorIOS.mm: Ditto.
186         * platform/mac/ScrollAnimatorMac.mm: Ditto.
187         * platform/mac/WebVideoFullscreenController.h: Ditto.
188         * platform/network/BlobData.cpp: Ditto.
189
190         * platform/network/ResourceHandle.cpp:
191         (WebCore::ResourceHandle::ResourceHandle): Use make_unique instead of adoptPtr.
192         * platform/network/ResourceHandle.h: Use unique_ptr instead of OwnPtr.
193
194         * platform/network/ResourceHandleInternal.h: Added now-needed include.
195
196         * platform/network/ResourceResponseBase.h: Removed unneeded includes and
197         tweaked formatting a bit.
198
199         * platform/network/SynchronousLoaderClient.h: Removed the create function and
200         the private constructor. Used data member initialize to make the default
201         empty constructor automatically get generated (and be public now).
202
203         * platform/network/cf/FormDataStreamCFNet.cpp:
204         (WebCore::formFinishFinalizationOnMainThread): Use delete instead of adoptPtr
205         to delete the context argument.
206
207         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
208         (WebCore::defaultNetworkStorageSession): Return a unique_ptr& instead of an OwnPtr&.
209         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use make_unique
210         instead of adoptPtr.
211         (WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
212
213         * platform/network/cf/ResourceHandleCFNet.cpp:
214         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Use a
215         SynchronousLoaderClient on the stack instead of putting one on the heap with adoptPtr.
216         * platform/network/mac/ResourceHandleMac.mm:
217         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.
218
219         * platform/text/TextCodec.h: Removed unneeded include.
220         * platform/win/CursorWin.cpp: Ditto.
221
222         * rendering/RenderLayer.cpp:
223         (WebCore::RenderLayer::calculateClipRects): Use move instead of release since
224         we are using RefPtr&& instead of PassRefPtr.
225
226         * rendering/RenderLayerFilterInfo.cpp:
227         (WebCore::RenderLayer::FilterInfo::setRenderer): Use RefPtr&& instead of PassRefPtr.
228         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients): Streamlined to use
229         modern for loops and auto.
230         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients): Ditto.
231
232         * rendering/RenderLayerFilterInfo.h: Streamlined code and removed some stuff that
233         I think is unneeded on iOS; there is no unused private field and I suspect the problem
234         that led to the warning is gone. Deleted friending of deleteOwnedPtr.
235
236         * rendering/RenderLayerMaskImageInfo.cpp: Removed unneeded includes. Moved private
237         client classes in here from the header and made them members of MaskImageInfo.
238         Streamlined them a bit in other ways.
239         (WebCore::RenderLayer::MaskImageInfo::getIfExists): Use nullptr.
240         (WebCore::RenderLayer::MaskImageInfo::MaskImageInfo): Use member initialization
241         and also pass the layer in rather than the MaskImageInfo.
242         (WebCore::RenderLayer::MaskImageInfo::notifyFinished): Deleted. Moved the code
243         into the SVGDocumentClient.
244         (WebCore::RenderLayer::MaskImageInfo::imageChanged): Deleted. Moved the code into
245         the ImageClient.
246         (WebCore::RenderLayer::MaskImageInfo::updateMaskImageClients): Streamlined a bit
247         to use a for loop.
248         (WebCore::RenderLayer::MaskImageInfo::removeMaskImageClients): Ditto.
249
250         * rendering/RenderLayerMaskImageInfo.h: Reduced unneeded includes. Got rid of
251         definitions of private member classes here in the header; they can be in the cpp
252         file instead. Also cut down from three classes to two, and gave the classes less
253         redundant names since they are already members of MaskImageInfo. Removed some
254         unneeded functions and friending of deleteOwnedPtr.
255
256         * testing/InternalSettings.cpp: Got rid of comment about RefCountedSupplement
257         since no code anywhere was using it, so not using it here was not remarkable.
258
259 2015-04-23  Jer Noble  <jer.noble@apple.com>
260
261         [iOS] Add a wrapper around the hosted AVPlayerLayer to intercept -setBounds:
262         https://bugs.webkit.org/show_bug.cgi?id=144129
263
264         Reviewed by Simon Fraser.
265
266         When passing the hosted AVPlayerLayer to the fullscreen controller, the new superlayer will
267         resize the hosted layer with a call to -setBounds:. But because this is a hosted layer, the
268         bonuds change has no effect. Instead, wrap the CALayerHost in another CALayer whose job it is
269         to intercept -setBounds: in the same way that WebAVVideoLayer did. In fact, we should just use
270         that wrapper class inside WebAVVideoLayer as well, to avoid duplicating code.
271
272         Drive-by Fix: Null-check m_videoElement in setVideoLayerFrame().
273
274         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
275         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
276         (-[WebCALayerHostWrapper setVideoSublayer:]):
277         (-[WebCALayerHostWrapper videoSublayer]):
278         (-[WebCALayerHostWrapper setBounds:]): Moved from WebAVVideoLayer.
279         (-[WebCALayerHostWrapper resolveBounds]): Ditto.
280         (-[WebAVVideoLayer setBounds:]): Moved to WebCALayerHostWrapper.
281         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Create the wrapper.
282         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Clear the wrapper.
283         (-[WebAVVideoLayer resolveBounds]): Deleted. Moved to WebCALayerHostWrapper.
284         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
285         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Null-check m_videoElement.
286
287 2015-04-23  Tim Horton  <timothy_horton@apple.com>
288
289         Yellow highlight has gray background color when invoking Lookup on an address in a Google Maps drop down
290         https://bugs.webkit.org/show_bug.cgi?id=138737
291         <rdar://problem/18904429>
292
293         Reviewed by Simon Fraser.
294
295         * rendering/RenderReplaced.cpp:
296         (WebCore::RenderReplaced::paint):
297         Other RenderObjects don't paint box decorations in the selection painting phase,
298         so RenderReplaced probably shouldn't either. This fixes the case where, when doing
299         selection-only painting of a bit of text over top of a RenderReplaced, the RenderReplaced
300         would paint its background, filling the previously transparent bitmap with an unwanted color.
301
302 2015-04-23  Roger Fong  <roger_fong@apple.com>
303
304         Update media timeline controls when video is paused..
305         https://bugs.webkit.org/show_bug.cgi?id=144122.
306         <rdar://problem/20422927>
307
308         Reviewed by Dean Jackson.
309
310         * Modules/mediacontrols/mediaControlsApple.js:
311         (Controller.prototype.drawTimelineBackground): Use timelineWidth because offsetWidth is 0 when display: none.
312         (Controller.prototype.setPlaying): Show controls when pausing.
313         (Controller.prototype.showControls): Update time and timeline when unhiding controls.
314
315 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
316
317         Changing TiledBacking velocity should schedule a tile revalidation
318         https://bugs.webkit.org/show_bug.cgi?id=144123
319
320         Reviewed by Tim Horton.
321
322         Changing the velocity parameters on the TileController affect the computed
323         coverage rect, so whenever we make a change to velocity data that could
324         affect the outcome (basically any non-zero old or new velocities),
325         schedule a layer flush.
326
327         * platform/graphics/TiledBacking.h:
328         (WebCore::VelocityData::velocityOrScaleIsChanging):
329         * platform/graphics/ca/TileController.cpp:
330         (WebCore::TileController::setVelocity):
331
332 2015-04-23  Jer Noble  <jer.noble@apple.com>
333
334         [Mac] Disable QTKit by default on future OS X.
335         https://bugs.webkit.org/show_bug.cgi?id=144082
336
337         Reviewed by Darin Adler.
338
339         Settings::gQTKitEnabled defaults to false.
340
341         * page/Settings.cpp:
342
343 2015-04-23  Daniel Bates  <dabates@apple.com>
344
345         Clean up: Use references instead of pointers in more SVG files
346         https://bugs.webkit.org/show_bug.cgi?id=144045
347
348         Reviewed by Darin Adler.
349
350         * rendering/svg/SVGRootInlineBox.cpp:
351         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Pass reference instead of pointer.
352
353         * rendering/svg/SVGTextLayoutEngine.cpp:
354         (WebCore::SVGTextLayoutEngine::recordTextFragment): Changed parameter textBox from pointer to reference.
355         (WebCore::SVGTextLayoutEngine::layoutInlineTextBox): Ditto.
356         (WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics): Changed parameter textBox from pointer to
357         reference and made it const since this function does not modify textBox.
358         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Changed parameters from pointers to references.
359         Also, removed comma from comment so that it reads well.
360         * rendering/svg/SVGTextLayoutEngine.h: Updated declarations for the above functions.
361
362         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
363         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift): Changed parameter style from pointer to reference.
364         Added case BS_LENGTH to switch block and removed default case so that the compiler checks that we handle all cases.
365         Renamed parameter contextElement to context since the name of its data type conveys that it is an element.
366         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift): Changed parameter textRenderer from
367         pointer to reference and removed runtime assertion that textRenderer is non-null (since it well-formed reference
368         cannot point to a non-existent object).
369         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle): Changed parameter style from pointer to reference
370         removed runtime assertion that style is non-null.
371         * rendering/svg/SVGTextLayoutEngineBaseline.h: Updated declarations for the above functions.
372
373 2015-04-23  Commit Queue  <commit-queue@webkit.org>
374
375         Unreviewed, rolling out r183194.
376         https://bugs.webkit.org/show_bug.cgi?id=144121
377
378         Made multiple tests flaky (Requested by ap_ on #webkit).
379
380         Reverted changeset:
381
382         "Memory cache live resources repeatedly purged during
383         painting"
384         https://bugs.webkit.org/show_bug.cgi?id=144104
385         http://trac.webkit.org/changeset/183194
386
387 2015-04-23  Roger Fong  <roger_fong@apple.com>
388
389         Unreviewed. Missed a button in r182900.
390
391         * Modules/mediacontrols/mediaControlsApple.css:
392         (audio::-webkit-media-controls-wireless-playback-picker-button:active):
393
394 2015-04-23  Roger Fong  <roger_fong@apple.com>
395
396         Unreviewed. Just shift some CSS around for code cleanup purposes.
397
398         * Modules/mediacontrols/mediaControlsApple.css:
399         (video::-webkit-media-controls-panel):
400         (video::-webkit-media-controls-panel:hover):
401
402 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
403
404         [iOS] WebKit services should inherit environment variables for home
405         https://bugs.webkit.org/show_bug.cgi?id=144078
406         rdar://problem/20571678
407
408         Reviewed by Dan Bernstein.
409
410         Added an SPI header for a drive-by fix.
411
412         * WebCore.xcodeproj/project.pbxproj:
413         * platform/spi/cf/CFBundleSPI.h: Added.
414
415 2015-04-23  Alex Christensen  <achristensen@webkit.org>
416
417         Use less memory when compiling content extensions.
418         https://bugs.webkit.org/show_bug.cgi?id=144051
419
420         Reviewed by Darin Adler and Benjamin Poulain.
421
422         No change in functionality, correctness already covered by existing tests.
423
424         Before this patch, a DFANode contained a HashSet of transitions.
425         Large vectors of DFANodes made many small HashSets, which was inefficient use of memory.
426         We now put all the actions and transitions into one big compact Vector and each node owns ranges in that vector.
427
428         * contentextensions/CombinedURLFilters.cpp:
429         (WebCore::ContentExtensions::recursiveMemoryUsed):
430         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
431         * contentextensions/CombinedURLFilters.h:
432         * contentextensions/ContentExtensionCompiler.cpp:
433         (WebCore::ContentExtensions::compileRuleList):
434         * contentextensions/ContentExtensionsDebugging.h:
435         * contentextensions/DFA.cpp:
436         (WebCore::ContentExtensions::DFA::memoryUsed):
437         (WebCore::ContentExtensions::DFANode::actions):
438         (WebCore::ContentExtensions::DFANode::transitions):
439         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
440         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
441         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
442         (WebCore::ContentExtensions::DFANode::containsTransition):
443         (WebCore::ContentExtensions::DFANode::kill):
444         (WebCore::ContentExtensions::DFA::minimize):
445         (WebCore::ContentExtensions::DFA::DFA): Deleted.
446         (WebCore::ContentExtensions::DFA::operator=): Deleted.
447         * contentextensions/DFA.h:
448         * contentextensions/DFABytecodeCompiler.cpp:
449         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
450         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
451         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
452         * contentextensions/DFABytecodeCompiler.h:
453         * contentextensions/DFAMinimizer.cpp:
454         (WebCore::ContentExtensions::DFAMinimizer::minimize):
455         * contentextensions/DFAMinimizer.h:
456         * contentextensions/DFANode.h:
457         (WebCore::ContentExtensions::DFANode::isKilled):
458         (WebCore::ContentExtensions::DFANode::hasFallbackTransition):
459         (WebCore::ContentExtensions::DFANode::hasActions):
460         (WebCore::ContentExtensions::DFANode::transitionsLength):
461         (WebCore::ContentExtensions::DFANode::actionsLength):
462         (WebCore::ContentExtensions::DFANode::actionsStart):
463         (WebCore::ContentExtensions::DFANode::setActions):
464         (WebCore::ContentExtensions::DFANode::setTransitions):
465         (WebCore::ContentExtensions::DFANode::resetTransitions):
466         (WebCore::ContentExtensions::DFANode::transitionsStart):
467         (WebCore::ContentExtensions::DFANode::setHasFallbackTransitionWithoutChangingDFA):
468         * contentextensions/NFA.cpp:
469         (WebCore::ContentExtensions::NFA::memoryUsed):
470         * contentextensions/NFA.h:
471         * contentextensions/NFAToDFA.cpp:
472         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
473         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
474         (WebCore::ContentExtensions::getOrCreateDFANode):
475         (WebCore::ContentExtensions::NFAToDFA::convert):
476
477 2015-04-23  David Hyatt  <hyatt@apple.com>
478
479         Don't fire a bunch of mouse moveds during scrolling.
480         https://bugs.webkit.org/show_bug.cgi?id=99940
481
482         Reviewed by Simon Fraser.
483
484         * page/EventHandler.cpp:
485         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
486         Even for the short interval timer, make sure to cancel and restart it instead of allowing the original to
487         complete. This has the effect of preventing fake mouse moves from firing until the scroll stops.
488
489 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
490
491         Unreviewed, fix the release build.
492
493         * html/HTMLMediaSession.cpp:
494         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Add an UNUSED_PARAM.
495
496 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
497
498         Remove m_isPageTiledBackingLayer data member from GraphicsLayerCA, just use the layer type instead
499         https://bugs.webkit.org/show_bug.cgi?id=144108
500
501         Reviewed by Dean Jackson.
502
503         No need for the m_isPageTiledBackingLayer data member. We can just check the layer
504         type instead.
505
506         * platform/graphics/ca/GraphicsLayerCA.cpp:
507         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
508         (WebCore::GraphicsLayerCA::initialize):
509         (WebCore::GraphicsLayerCA::platformCALayerShowRepaintCounter):
510         (WebCore::GraphicsLayerCA::updateContentsScale):
511         (WebCore::GraphicsLayerCA::getDebugBorderInfo):
512         (WebCore::GraphicsLayerCA::requiresTiledLayer):
513         * platform/graphics/ca/GraphicsLayerCA.h:
514         (WebCore::GraphicsLayerCA::isPageTiledBackingLayer):
515
516 2015-04-23  Brady Eidson  <beidson@apple.com>
517
518         Content extension with oft-repeated rules can cause slowdown.
519         rdar://problem/20618511 and https://bugs.webkit.org/show_bug.cgi?id=144010
520
521         Reviewed by Alex Christensen.
522
523         No new tests (Behavior covered by existing tests).
524
525         * WebCore.xcodeproj/project.pbxproj:
526
527         * contentextensions/ContentExtension.cpp:
528         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
529
530         Add the String identifier for the extension and the rule action ID to Actions:
531         * contentextensions/ContentExtensionRule.cpp:
532         (WebCore::ContentExtensions::Action::deserialize):
533         * contentextensions/ContentExtensionRule.h:
534         (WebCore::ContentExtensions::Action::Action):
535         (WebCore::ContentExtensions::Action::operator==):
536         (WebCore::ContentExtensions::Action::setExtensionIdentifier):
537         (WebCore::ContentExtensions::Action::extensionIdentifier):
538         (WebCore::ContentExtensions::Action::actionID):
539         (WebCore::ContentExtensions::Action::type): Deleted.
540
541         Object to manage a CSSStyleSheet and selectors identified by ID:
542         * contentextensions/ContentExtensionStyleSheet.cpp:
543         (WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet):
544         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
545         * contentextensions/ContentExtensionStyleSheet.h:
546         (WebCore::ContentExtensions::ContentExtensionStyleSheet::create):
547         (WebCore::ContentExtensions::ContentExtensionStyleSheet::styleSheet):
548
549         Instead of globbing selectors together into a String and making a new stylesheet,
550         add new unique selectors to an already existing sheet:
551         * contentextensions/ContentExtensionsBackend.cpp:
552         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
553         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
554         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
555
556         * dom/DocumentStyleSheetCollection.cpp:
557         (WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector):
558         (WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Deleted.
559         * dom/DocumentStyleSheetCollection.h:
560
561         * loader/DocumentLoader.cpp:
562         (WebCore::DocumentLoader::commitData):
563         (WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
564         (WebCore::DocumentLoader::addPendingContentExtensionSheet): Deleted.
565         * loader/DocumentLoader.h:
566
567 2015-04-23  Antti Koivisto  <antti@apple.com>
568
569         Memory cache live resources repeatedly purged during painting
570         https://bugs.webkit.org/show_bug.cgi?id=144104
571         <rdar://problem/20667695>
572
573         Reviewed by Chris Dumez.
574
575         On some PLT pages (like nytimes.com) we get into state where painting repeatedly purges live bitmaps.
576         This slows down page loads significantly.
577
578         This might have regressed because improvements in page caching keep more pages and so resources 'live'.
579
580         With this path we do all regular cache pruning asynchronously. If memory is really critical
581         the low memory handling code will still prune synchronously.
582
583         * loader/cache/CachedResource.cpp:
584         (WebCore::CachedResource::removeClient):
585         (WebCore::CachedResource::didAccessDecodedData):
586
587             prune() -> pruneSoon()
588
589         * loader/cache/MemoryCache.cpp:
590
591             Decrease the pruning size target from 0.95 to 0.8 so we don't need to prune so often.
592
593         (WebCore::MemoryCache::needsPruning):
594
595             Factor into a function.
596
597         (WebCore::MemoryCache::prune):
598         (WebCore::MemoryCache::pruneSoon):
599
600             Prune asynchronously.
601
602         * loader/cache/MemoryCache.h:
603
604 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
605
606         Unreviewed, make a suggested change I overlooked in Darin's review of
607         https://bugs.webkit.org/show_bug.cgi?id=144098
608
609         * dom/Document.cpp:
610         (WebCore::Document::removePlaybackTargetPickerClient): const auto& -> auto
611         (WebCore::Document::showPlaybackTargetPicker): Ditto.
612         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
613         (WebCore::Document::playbackTargetAvailabilityDidChange): Ditto.
614         (WebCore::Document::setPlaybackTarget): Ditto.
615         (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
616
617 2015-04-23  Joonghun Park  <jh718.park@samsung.com>
618
619         Use std::unique_ptr instead of OwnPtr in ThreadGlobalData
620         https://bugs.webkit.org/show_bug.cgi?id=141950
621
622         Reviewed by Darin Adler.
623
624         No new tests, no behavior changes.
625
626         * dom/EventNames.h:
627         (WebCore::EventNames::create):
628         * loader/cache/CachedResourceRequestInitiators.h:
629         * platform/ThreadGlobalData.cpp:
630         (WebCore::ThreadGlobalData::ThreadGlobalData):
631         (WebCore::ThreadGlobalData::destroy):
632         * platform/ThreadGlobalData.h:
633
634 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
635
636         Some media tests assert after r183096
637         https://bugs.webkit.org/show_bug.cgi?id=144098
638
639         Reviewed by Darin Adler.
640
641         * dom/Document.cpp:
642         (WebCore::Document::removePlaybackTargetPickerClient): Don't assert if the client has already
643             been removed from the map. This happens when a media element is removed from the document
644             before its destructor runs and is not an error.
645         (WebCore::Document::showPlaybackTargetPicker): It is an error to call this after the client 
646             has been removed from the map so leave the assert in a debug build, but return early
647             so a release build doesn't crash.
648         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
649         (WebCore::Document::playbackTargetAvailabilityDidChange): Use "auto" for the map iterator variable.
650         (WebCore::Document::setPlaybackTarget): Ditto.
651         (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
652         * dom/Document.h: Fix map typedef names.
653
654 2015-04-23  Andreas Kling  <akling@apple.com>
655
656         DOM nodes should be allocated with fastMalloc().
657
658         Unreviewed. This got lost in the TreeShared merge. :|
659
660         * dom/Node.h:
661
662 2015-04-23  Chris Dumez  <cdumez@apple.com>
663
664         [WK2] WebDiagnosticLoggingClient is leaking
665         https://bugs.webkit.org/show_bug.cgi?id=144089
666         <rdar://problem/19706214>
667
668         Reviewed by Darin Adler.
669
670         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
671         constructor but there is no code destroying it.
672
673         This patch adds a new xxxDestroyed() virtual function to
674         DiagnosticLoggingClient and that is overriden in
675         WebDiagnosticLoggingClient to call "delete this". This is the same
676         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
677         WebProgressTrackerClient).
678
679         * loader/EmptyClients.h:
680         * page/DiagnosticLoggingClient.h:
681         * page/MainFrame.cpp:
682         (WebCore::MainFrame::~MainFrame):
683
684 2015-04-22  Antti Koivisto  <antti@apple.com>
685
686         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
687         https://bugs.webkit.org/show_bug.cgi?id=144050
688         rdar://problem/15534973
689
690         Reviewed by Chris Dumez.
691
692         We are seeing null Element pointer crashes with this stack:
693
694         47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
695         47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
696         47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175
697
698         The most likely cause seems to be that this code
699
700             ASSERT(m_pendingAsyncScripts.contains(scriptElement));
701             m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));
702
703         in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with a null entry in
704         m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
705         could happen. The related code is fragile with lot of state (in ScriptElement class)
706         and involves many opportunities for re-entry via scripts.
707
708         No repro, no test case.
709
710         * dom/ScriptRunner.cpp:
711         (WebCore::ScriptRunner::timerFired):
712
713             Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
714             but this also covers possibility this is caused by something else.
715
716 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
717
718         Use a typedef for TileGrid tile validation policy flags
719         https://bugs.webkit.org/show_bug.cgi?id=144085
720
721         Reviewed by Tim Horton.
722
723         Replace 'unsigned' with a typedef for the bitmask of TileValidationPolicyFlags.
724
725         * platform/graphics/ca/TileController.cpp:
726         (WebCore::TileController::tileRevalidationTimerFired):
727         * platform/graphics/ca/TileGrid.cpp:
728         (WebCore::TileGrid::revalidateTiles):
729         * platform/graphics/ca/TileGrid.h:
730
731 2015-04-23  Andreas Kling  <akling@apple.com>
732
733         Slap Node's reference counting functions with ALWAYS_INLINE stick.
734
735         Speculative fix for weird ~3% regression on Speedometer seen after TreeShared
736         was merged into Node. Since the memory layout didn't change, failure to inline
737         seems like a possible source of regression.
738
739         * dom/Node.h:
740         (WebCore::Node::ref):
741         (WebCore::Node::deref):
742         (WebCore::Node::hasOneRef):
743         (WebCore::Node::refCount):
744
745 2015-04-22  Simon Fraser  <simon.fraser@apple.com>
746
747         [iOS] Move computeCoverageRect code from FrameView into TileController
748         https://bugs.webkit.org/show_bug.cgi?id=144087
749
750         Reviewed by Benjamin Poulain.
751         
752         There is code in four different places that adjusts tiling coverage rect:
753         1. LegacyTileCache. This will remain unchanged.
754         2. FrameView::computeTileCoverageRect(). This was added to do velocity-based
755         page tiled coverage expansion for iOS WK2.
756         3. TileController::computeTileCoverageRect(): this is used for the page tiles
757         on Mac.
758         4. GraphicsLayerCA::adjustTiledLayerVisibleRect(). This is used by non-page
759         tiled layers on both iOS and Mac.
760         
761         This patch reduced this list to 3, coalescing FrameView::computeTileCoverageRect()
762         and TileController::computeTileCoverageRect(). It removes the rect inflation that
763         affects the visibleRect passed into rootLayer->flushCompositingState() for iOS,
764         but the page tiles now do an identical coverage inflation. The visible rect
765         change does affect visible rect computations for non-page tiled backings, but
766         a future patch will restore that.
767
768         * page/FrameView.cpp:
769         (WebCore::FrameView::setScrollVelocity):
770         (WebCore::FrameView::computeCoverageRect): Deleted.
771         * page/FrameView.h:
772         * platform/graphics/TiledBacking.h:
773         (WebCore::VelocityData::VelocityData):
774         * platform/graphics/ca/TileController.cpp:
775         (WebCore::TileController::setVelocity):
776         (WebCore::TileController::computeTileCoverageRect):
777         * platform/graphics/ca/TileController.h:
778         * rendering/RenderLayerCompositor.cpp:
779         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
780
781 2015-04-22  Darin Adler  <darin@apple.com>
782
783         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
784         https://bugs.webkit.org/show_bug.cgi?id=143943
785
786         Reviewed by Anders Carlsson.
787
788         * editing/Editor.cpp:
789         (WebCore::Editor::insertDictationPhrases): Changed this iOS-only
790         function to take a Vector<Vector<String>>&& and not involve PassOwnPtr.
791         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Changed this iOS-only
792         function to take a Vector<Vector<String>> and not involve PassOwnPtr. Also made
793         it take a reference rather than a pointer to the element and simplify the code
794         a bit using modern for loops and auto.
795         * editing/Editor.h: Ditto.
796
797         * editing/ios/DictationCommandIOS.cpp:
798         (WebCore::DictationCommandIOS::DictationCommandIOS): Take
799         a Vector<Vector<String>>&& instead of a PassOwnPtr.
800         (WebCore::DictationCommandIOS::~DictationCommandIOS): Deleted. No need to
801         explicitly define this.
802         (WebCore::DictationCommandIOS::doApply): Updated to use modern for loop and
803         work with a Vector<Vector<String>> instead of an OwnPtr.
804         * editing/ios/DictationCommandIOS.h: Updated to not use PassOwnPtr and OwnPtr.
805         Also modernized a bit by using override.
806
807         * platform/network/ios/QuickLook.h: Return an NSURLRequest * instead of a
808         PassOwnPtr<ResourceRequest> from this iOS-specific function.
809         * platform/network/ios/QuickLook.mm:
810         (WebCore::registerQLPreviewConverterIfNeeded): Ditto.
811
812 2015-04-22  Jinwoo Song  <jinwoo7.song@samsung.com>
813
814         Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
815         https://bugs.webkit.org/show_bug.cgi?id=144033
816
817         Reviewed by Darin Adler.
818
819         Use unique_ptr for creating a copy of cairo_path_t and use lambda function
820         for custom deleter, cairo_path_destroy().
821
822         * platform/graphics/cairo/GraphicsContextCairo.cpp:
823         (WebCore::drawPathShadow): Use std::unique_ptr instead of OwnPtr.
824         (WebCore::GraphicsContext::clip): Call cairo_path_destroy() immediately.
825         * platform/graphics/cairo/OwnPtrCairo.cpp:
826         (WTF::deleteOwnedPtr<cairo_path_t>): Deleted. Remove unnecessary deleter anymore.
827         * platform/graphics/cairo/OwnPtrCairo.h: Ditto.
828
829 2015-04-22  Darin Adler  <darin@apple.com>
830
831         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
832         https://bugs.webkit.org/show_bug.cgi?id=143949
833
834         Reviewed by Andreas Kling.
835
836         * dom/ContainerNode.h: Removed unneeded includes and forward declarations.
837         * dom/Document.h: Ditto.
838
839         * dom/DocumentParser.h: Fixed comment to not mention PassOwnPtr.
840
841         * html/shadow/MediaControlElements.cpp:
842         (WebCore::MediaControlTextTrackContainerElement::create): Return a Ref instead of a PassRefPtr.
843         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation): Pass a reference
844         rather than a pointer to TextTrackRepresentation::create.
845         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Return a
846         RefPtr instead of a PassRefPtr.
847
848         * html/shadow/MediaControlElements.h: Use unique_ptr for m_textTrackRepresentation.
849         Also fix a couple uses of PassRefPtr.
850
851         * loader/DocumentLoader.cpp:
852         (WebCore::DocumentLoader::DocumentLoader): Use make_unique.
853         (WebCore::DocumentLoader::addAllArchiveResources): Ditto.
854         (WebCore::DocumentLoader::addArchiveResource): Ditto.
855         (WebCore::DocumentLoader::clearArchiveResources): Set to nullptr instead of calling clear.
856         (WebCore::DocumentLoader::startLoadingMainResource): Use make_unique.
857         * loader/DocumentLoader.h: Made m_archiveResourceCollection and
858         m_applicationCacheHost use unique_ptr.
859
860         * loader/WorkerThreadableLoader.cpp:
861         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Use delete here instead
862         of using OwnPtr to do the deletion. Matches the other code nearby.
863
864         * loader/appcache/ApplicationCacheGroup.cpp:
865         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Handle case where the host is
866         null; this happens during the DocumentLoader destruction process since unique_ptr sets itself
867         to null before it destroys the object it points to and OwnPtr does not.
868
869         * loader/cocoa/DiskCacheMonitorCocoa.mm:
870         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Use delete instead of adoptPtr
871         to delete a raw pointer.
872         (WebCore::DiskCacheMonitor::DiskCacheMonitor): Use unique_ptr instead of OwnPtr.
873
874         * page/DragController.h: Removed some unneeded forward declarations and changed the
875         create function to return unique_ptr.
876
877         * platform/LayoutUnit.h: Removed wtf_ceil workaround hack here. Not sure why we ever did it
878         this way!
879
880         * platform/graphics/FontCascade.cpp:
881         (WTF::deleteOwnedPtr<WebCore::TextLayout>): Deleted.
882         (WebCore::FontCascade::createLayout): Changed to return a unique_ptr.
883         (WebCore::FontCascade::deleteLayout): Deleted.
884         * platform/graphics/FontCascade.h: Made the above changes.
885
886         * platform/graphics/ImageBuffer.h: Changed copyImage to return a RefPtr instead of a PassRefPtr.
887
888         * platform/graphics/TextTrackRepresentation.cpp:
889         (WebCore::TextTrackRepresentation::create): Use make_unique and return a unique_ptr.
890         * platform/graphics/TextTrackRepresentation.h: Removed unneeded includes and forward declarations
891         and made create return a unique_ptr.
892         * platform/graphics/cairo/ImageBufferCairo.cpp:
893         (WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
894         * platform/graphics/cg/ImageBufferCG.cpp:
895         (WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
896
897         * platform/graphics/ios/TextTrackRepresentationIOS.h: Use reference instead of pointer,
898         made more things private.
899         * platform/graphics/ios/TextTrackRepresentationIOS.mm:
900         (TextTrackRepresentation::create): Use make_unique.
901         (TextTrackRepresentationIOS::TextTrackRepresentationIOS): Take a reference.
902
903         * platform/graphics/mac/ComplexTextController.cpp:
904         (WebCore::FontCascade::createLayout): Return a unique_ptr with a custom destruction function.
905         The custom destruction function eliminates the need to put TextLayout in a visible header.
906         (WebCore::FontCascade::deleteLayout): Deleted. Use a lambda instead.
907         (WebCore::roundCGFloat): Deleted. Old fashioned way to deal with multiple floating point sizes.
908         Just use std::round instead.
909         (WebCore::ceilCGFloat): Deleted. Same as above. Just use std::ceil instead.
910         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Use std::round and std::ceil.
911
912         * rendering/RenderBlockLineLayout.cpp:
913         (WebCore::RenderTextInfo::RenderTextInfo): Deleted. Can compile constructor and destructor
914         now thanks to use of unique_ptr with a custom deleter.
915         (WebCore::RenderTextInfo::~RenderTextInfo): Deleted. Ditto.
916         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Updated for RenderTextInfo data member
917         name change.
918
919         * rendering/RenderView.h: Removed unneeded include.
920
921         * rendering/line/BreakingContext.h: Removed unneeded include.
922         (WebCore::BreakingContext::handleOutOfFlowPositioned): Updated for RenderTextInfo data member
923         name change.
924         (WebCore::BreakingContext::handleFloat): Ditto.
925         (WebCore::BreakingContext::handleReplaced): Ditto.
926         (WebCore::BreakingContext::handleText): Ditto.
927         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Ditto.
928
929         * rendering/line/LineBreaker.h: Made the RenderTextInfo struct more like a struct by taking
930         off all the m_ prefixes from the data member names. Initialized all the values in the struct
931         to defaults so we don't need an explicit constructor. We also don't need an explicit destructor
932         any more due to use of a unique_ptr with a deleter.
933
934 2015-04-22  Roger Fong  <roger_fong@apple.com>
935
936         Volume slider appears/doesn't appear at the wrong times.
937         https://bugs.webkit.org/show_bug.cgi?id=144072.
938         <rdar://problem/20576145>
939
940         Reviewed by Dean Jackson.
941
942         Set background divs to match volume box dimensions.
943         * Modules/mediacontrols/mediaControlsApple.css:
944         (audio::-webkit-media-controls-volume-slider-container-background):
945         (audio::-webkit-media-controls-volume-slider-container-tint):
946
947         Draw the volume slider immediately on mousing over the mute box.
948         * Modules/mediacontrols/mediaControlsApple.js:
949         (Controller.prototype.createControls):
950         (Controller.prototype.handleMuteBoxOver):
951
952 2015-04-22  Jer Noble  <jer.noble@apple.com>
953
954         [Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
955         https://bugs.webkit.org/show_bug.cgi?id=144023
956
957         Reviewed by Darin Adler.
958
959         Partially revert r183097 (as it was not sufficient to protect against re-entrancy). Instead,
960         protect against re-entrancy in provideMediaData() directly by removing the first sample
961         from the TrackBuffer's decodeQueue at a time. If provideMediaData() is called re-entrantly,
962         or if any other method which modifies the decodeQueue is called from inside
963         provideMediaData, no iterators will be invalidated.
964
965         * Modules/mediasource/SourceBuffer.cpp:
966         (WebCore::SourceBuffer::provideMediaData):
967         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
968         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
969
970 2015-04-22  Zalan Bujtas  <zalan@apple.com>
971
972         Create RenderRubyText for <rt> only when the parent renderer is a RenderRuby.
973         https://bugs.webkit.org/show_bug.cgi?id=144035
974         rdar://problem/20604467
975
976         Reviewed by Darin Adler.
977
978         This patch extends HTMLElement::createElementRenderer()
979         with the render tree insertion point so that we can create different type
980         of renderers based on the render tree context.
981
982         Test: fast/ruby/ruby-rt-with-region-crash.html
983
984         * CMakeLists.txt:
985         * Modules/plugins/PluginReplacement.h:
986         * Modules/plugins/QuickTimePluginReplacement.h:
987         * Modules/plugins/QuickTimePluginReplacement.mm:
988         (WebCore::QuickTimePluginReplacement::createElementRenderer):
989         * Modules/plugins/YouTubePluginReplacement.cpp:
990         (WebCore::YouTubePluginReplacement::createElementRenderer):
991         * Modules/plugins/YouTubePluginReplacement.h:
992         * WebCore.vcxproj/WebCore.vcxproj:
993         * WebCore.vcxproj/WebCore.vcxproj.filters:
994         * WebCore.xcodeproj/project.pbxproj:
995         * dom/Element.cpp:
996         (WebCore::Element::createElementRenderer):
997         * dom/Element.h:
998         * html/HTMLAppletElement.cpp:
999         (WebCore::HTMLAppletElement::createElementRenderer):
1000         * html/HTMLAppletElement.h:
1001         * html/HTMLAttachmentElement.cpp:
1002         (WebCore::HTMLAttachmentElement::createElementRenderer):
1003         * html/HTMLAttachmentElement.h:
1004         * html/HTMLBRElement.cpp:
1005         (WebCore::HTMLBRElement::createElementRenderer):
1006         * html/HTMLBRElement.h:
1007         * html/HTMLButtonElement.cpp:
1008         (WebCore::HTMLButtonElement::createElementRenderer):
1009         * html/HTMLButtonElement.h:
1010         * html/HTMLCanvasElement.cpp:
1011         (WebCore::HTMLCanvasElement::createElementRenderer):
1012         * html/HTMLCanvasElement.h:
1013         * html/HTMLDetailsElement.cpp:
1014         (WebCore::HTMLDetailsElement::createElementRenderer):
1015         * html/HTMLDetailsElement.h:
1016         * html/HTMLElement.cpp:
1017         (WebCore::HTMLElement::createElementRenderer):
1018         * html/HTMLElement.h:
1019         * html/HTMLFieldSetElement.cpp:
1020         (WebCore::HTMLFieldSetElement::createElementRenderer):
1021         * html/HTMLFieldSetElement.h:
1022         * html/HTMLFrameElement.cpp:
1023         (WebCore::HTMLFrameElement::createElementRenderer):
1024         * html/HTMLFrameElement.h:
1025         * html/HTMLFrameSetElement.cpp:
1026         (WebCore::HTMLFrameSetElement::createElementRenderer):
1027         * html/HTMLFrameSetElement.h:
1028         * html/HTMLIFrameElement.cpp:
1029         (WebCore::HTMLIFrameElement::createElementRenderer):
1030         * html/HTMLIFrameElement.h:
1031         * html/HTMLImageElement.cpp:
1032         (WebCore::HTMLImageElement::createElementRenderer):
1033         * html/HTMLImageElement.h:
1034         * html/HTMLInputElement.cpp:
1035         (WebCore::HTMLInputElement::createElementRenderer):
1036         * html/HTMLInputElement.h:
1037         * html/HTMLMediaElement.cpp:
1038         (WebCore::HTMLMediaElement::parseAttribute):
1039         * html/HTMLMediaElement.h:
1040         * html/HTMLMeterElement.cpp:
1041         (WebCore::HTMLMeterElement::createElementRenderer):
1042         * html/HTMLMeterElement.h:
1043         * html/HTMLPlugInElement.cpp:
1044         (WebCore::HTMLPlugInElement::createElementRenderer):
1045         * html/HTMLPlugInElement.h:
1046         * html/HTMLPlugInImageElement.cpp:
1047         (WebCore::HTMLPlugInImageElement::createElementRenderer):
1048         * html/HTMLPlugInImageElement.h:
1049         * html/HTMLProgressElement.cpp:
1050         (WebCore::HTMLProgressElement::createElementRenderer):
1051         * html/HTMLProgressElement.h:
1052         * html/HTMLSelectElement.cpp:
1053         (WebCore::HTMLSelectElement::createElementRenderer):
1054         * html/HTMLSelectElement.h:
1055         * html/HTMLSummaryElement.cpp:
1056         (WebCore::HTMLSummaryElement::createElementRenderer):
1057         * html/HTMLSummaryElement.h:
1058         * html/HTMLTextAreaElement.cpp:
1059         (WebCore::HTMLTextAreaElement::createElementRenderer):
1060         * html/HTMLTextAreaElement.h:
1061         * html/HTMLVideoElement.cpp:
1062         (WebCore::HTMLVideoElement::createElementRenderer):
1063         * html/HTMLVideoElement.h:
1064         * html/HTMLWBRElement.cpp:
1065         (WebCore::HTMLWBRElement::createElementRenderer):
1066         * html/HTMLWBRElement.h:
1067         * html/RubyElement.cpp:
1068         (WebCore::RubyElement::createElementRenderer):
1069         * html/RubyElement.h:
1070         * html/RubyTextElement.cpp:
1071         (WebCore::RubyTextElement::createElementRenderer):
1072         * html/RubyTextElement.h:
1073         * html/shadow/DetailsMarkerControl.cpp:
1074         (WebCore::DetailsMarkerControl::createElementRenderer):
1075         * html/shadow/DetailsMarkerControl.h:
1076         * html/shadow/MediaControlElements.cpp:
1077         (WebCore::MediaControlTimelineContainerElement::createElementRenderer):
1078         (WebCore::MediaControlVolumeSliderContainerElement::createElementRenderer):
1079         (WebCore::MediaControlTextTrackContainerElement::createElementRenderer):
1080         * html/shadow/MediaControlElements.h:
1081         * html/shadow/MeterShadowElement.cpp:
1082         (WebCore::MeterInnerElement::createElementRenderer):
1083         * html/shadow/MeterShadowElement.h:
1084         * html/shadow/ProgressShadowElement.cpp:
1085         (WebCore::ProgressInnerElement::createElementRenderer):
1086         * html/shadow/ProgressShadowElement.h:
1087         * html/shadow/SliderThumbElement.cpp:
1088         (WebCore::SliderThumbElement::createElementRenderer):
1089         (WebCore::SliderContainerElement::createElementRenderer):
1090         * html/shadow/SliderThumbElement.h:
1091         * html/shadow/TextControlInnerElements.cpp:
1092         (WebCore::TextControlInnerContainer::createElementRenderer):
1093         (WebCore::TextControlInnerTextElement::createElementRenderer):
1094         * html/shadow/TextControlInnerElements.h:
1095         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
1096         (WebCore::ImageControlsButtonElementMac::createElementRenderer):
1097         * html/shadow/mac/ImageControlsButtonElementMac.h:
1098         * html/shadow/mac/ImageControlsRootElementMac.cpp:
1099         (WebCore::ImageControlsRootElementMac::createElementRenderer):
1100         * html/shadow/mac/ImageControlsRootElementMac.h:
1101         * html/track/VTTCue.cpp:
1102         (WebCore::VTTCueBox::createElementRenderer):
1103         * html/track/VTTCue.h:
1104         * mathml/MathMLInlineContainerElement.cpp:
1105         (WebCore::MathMLInlineContainerElement::createElementRenderer):
1106         * mathml/MathMLInlineContainerElement.h:
1107         * mathml/MathMLMathElement.cpp:
1108         (WebCore::MathMLMathElement::createElementRenderer):
1109         * mathml/MathMLMathElement.h:
1110         * mathml/MathMLMencloseElement.cpp:
1111         (WebCore::MathMLMencloseElement::createElementRenderer):
1112         * mathml/MathMLMencloseElement.h:
1113         * mathml/MathMLSelectElement.cpp:
1114         (WebCore::MathMLSelectElement::createElementRenderer):
1115         * mathml/MathMLSelectElement.h:
1116         * mathml/MathMLTextElement.cpp:
1117         (WebCore::MathMLTextElement::createElementRenderer):
1118         * mathml/MathMLTextElement.h:
1119         * rendering/RenderBlock.cpp:
1120         (WebCore::RenderBlock::clone):
1121         * rendering/RenderElement.cpp:
1122         * rendering/RenderRuby.h:
1123         (WebCore::isRuby):
1124         * style/RenderTreePosition.cpp: Added.
1125         (WebCore::RenderTreePosition::computeNextSibling):
1126         (WebCore::RenderTreePosition::invalidateNextSibling):
1127         (WebCore::RenderTreePosition::previousSiblingRenderer):
1128         (WebCore::RenderTreePosition::nextSiblingRenderer):
1129         (WebCore::RenderTreePosition::isRendererReparented):
1130         * style/RenderTreePosition.h: Added.
1131         (WebCore::RenderTreePosition::RenderTreePosition):
1132         (WebCore::RenderTreePosition::parent):
1133         (WebCore::RenderTreePosition::canInsert):
1134         (WebCore::RenderTreePosition::insert):
1135         * style/StyleResolveTree.cpp:
1136         (WebCore::Style::createRendererIfNeeded):
1137         (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
1138         (WebCore::Style::textRendererIsNeeded):
1139         (WebCore::Style::RenderTreePosition::parent): Deleted.
1140         (WebCore::Style::isRendererReparented): Deleted.
1141         (WebCore::Style::nextSiblingRenderer): Deleted.
1142         (WebCore::Style::RenderTreePosition::RenderTreePosition): Deleted.
1143         (WebCore::Style::RenderTreePosition::canInsert): Deleted.
1144         (WebCore::Style::RenderTreePosition::insert): Deleted.
1145         (WebCore::Style::RenderTreePosition::computeNextSibling): Deleted.
1146         (WebCore::Style::RenderTreePosition::invalidateNextSibling): Deleted.
1147         (WebCore::Style::previousSiblingRenderer): Deleted.
1148         * svg/SVGAElement.cpp:
1149         (WebCore::SVGAElement::createElementRenderer):
1150         * svg/SVGAElement.h:
1151         * svg/SVGAltGlyphElement.cpp:
1152         (WebCore::SVGAltGlyphElement::createElementRenderer):
1153         * svg/SVGAltGlyphElement.h:
1154         * svg/SVGCircleElement.cpp:
1155         (WebCore::SVGCircleElement::createElementRenderer):
1156         * svg/SVGCircleElement.h:
1157         * svg/SVGClipPathElement.cpp:
1158         (WebCore::SVGClipPathElement::createElementRenderer):
1159         * svg/SVGClipPathElement.h:
1160         * svg/SVGDefsElement.cpp:
1161         (WebCore::SVGDefsElement::createElementRenderer):
1162         * svg/SVGDefsElement.h:
1163         * svg/SVGEllipseElement.cpp:
1164         (WebCore::SVGEllipseElement::createElementRenderer):
1165         * svg/SVGEllipseElement.h:
1166         * svg/SVGFilterElement.cpp:
1167         (WebCore::SVGFilterElement::createElementRenderer):
1168         * svg/SVGFilterElement.h:
1169         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1170         (WebCore::SVGFilterPrimitiveStandardAttributes::createElementRenderer):
1171         * svg/SVGFilterPrimitiveStandardAttributes.h:
1172         * svg/SVGForeignObjectElement.cpp:
1173         (WebCore::SVGForeignObjectElement::createElementRenderer):
1174         * svg/SVGForeignObjectElement.h:
1175         * svg/SVGGElement.cpp:
1176         (WebCore::SVGGElement::createElementRenderer):
1177         * svg/SVGGElement.h:
1178         * svg/SVGGraphicsElement.cpp:
1179         (WebCore::SVGGraphicsElement::createElementRenderer):
1180         * svg/SVGGraphicsElement.h:
1181         * svg/SVGImageElement.cpp:
1182         (WebCore::SVGImageElement::createElementRenderer):
1183         * svg/SVGImageElement.h:
1184         * svg/SVGLinearGradientElement.cpp:
1185         (WebCore::SVGLinearGradientElement::createElementRenderer):
1186         * svg/SVGLinearGradientElement.h:
1187         * svg/SVGMarkerElement.cpp:
1188         (WebCore::SVGMarkerElement::createElementRenderer):
1189         * svg/SVGMarkerElement.h:
1190         * svg/SVGMaskElement.cpp:
1191         (WebCore::SVGMaskElement::createElementRenderer):
1192         * svg/SVGMaskElement.h:
1193         * svg/SVGPathElement.cpp:
1194         (WebCore::SVGPathElement::createElementRenderer):
1195         * svg/SVGPathElement.h:
1196         * svg/SVGPatternElement.cpp:
1197         (WebCore::SVGPatternElement::createElementRenderer):
1198         * svg/SVGPatternElement.h:
1199         * svg/SVGRadialGradientElement.cpp:
1200         (WebCore::SVGRadialGradientElement::createElementRenderer):
1201         * svg/SVGRadialGradientElement.h:
1202         * svg/SVGRectElement.cpp:
1203         (WebCore::SVGRectElement::createElementRenderer):
1204         * svg/SVGRectElement.h:
1205         * svg/SVGSVGElement.cpp:
1206         (WebCore::SVGSVGElement::createElementRenderer):
1207         * svg/SVGSVGElement.h:
1208         * svg/SVGStopElement.cpp:
1209         (WebCore::SVGStopElement::createElementRenderer):
1210         * svg/SVGStopElement.h:
1211         * svg/SVGSwitchElement.cpp:
1212         (WebCore::SVGSwitchElement::createElementRenderer):
1213         * svg/SVGSwitchElement.h:
1214         * svg/SVGSymbolElement.cpp:
1215         (WebCore::SVGSymbolElement::createElementRenderer):
1216         * svg/SVGSymbolElement.h:
1217         * svg/SVGTRefElement.cpp:
1218         (WebCore::SVGTRefElement::createElementRenderer):
1219         * svg/SVGTRefElement.h:
1220         * svg/SVGTSpanElement.cpp:
1221         (WebCore::SVGTSpanElement::createElementRenderer):
1222         * svg/SVGTSpanElement.h:
1223         * svg/SVGTextElement.cpp:
1224         (WebCore::SVGTextElement::createElementRenderer):
1225         * svg/SVGTextElement.h:
1226         * svg/SVGTextPathElement.cpp:
1227         (WebCore::SVGTextPathElement::createElementRenderer):
1228         * svg/SVGTextPathElement.h:
1229         * svg/SVGUseElement.cpp:
1230         (WebCore::SVGUseElement::createElementRenderer):
1231         * svg/SVGUseElement.h:
1232
1233 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
1234
1235         VisibleSelection should only accept Range by reference
1236         https://bugs.webkit.org/show_bug.cgi?id=144047
1237
1238         Reviewed by Tim Horton.
1239
1240         Update VisibleSelection to expect a Range reference argument, rather than a
1241         Range*. Also update all uses of VisibleSelection to pass a reference instead
1242         of a pointer.
1243
1244         No change in behavior, so new tests.
1245
1246         * editing/Editor.cpp:
1247         (WebCore::Editor::selectionForCommand):
1248         (WebCore::Editor::advanceToNextMisspelling):
1249         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1250         (WebCore::Editor::markAndReplaceFor):
1251         (WebCore::Editor::transpose):
1252         (WebCore::Editor::findString):
1253         (WebCore::Editor::rangeOfString):
1254         * editing/FrameSelection.cpp:
1255         (WebCore::FrameSelection::setSelectedRange):
1256         * editing/SpellingCorrectionCommand.cpp:
1257         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
1258         * editing/VisibleSelection.cpp:
1259         (WebCore::VisibleSelection::VisibleSelection):
1260         * editing/VisibleSelection.h:
1261         * editing/mac/EditorMac.mm:
1262         (WebCore::Editor::replaceNodeFromPasteboard):
1263         * page/DragController.cpp:
1264         (WebCore::selectElement):
1265         * page/TextIndicator.cpp:
1266         (WebCore::TextIndicator::createWithRange):
1267         * page/mac/EventHandlerMac.mm:
1268         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
1269         * rendering/SelectionSubtreeRoot.cpp:
1270         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
1271
1272 2015-04-22  Roger Fong  <roger_fong@apple.com>
1273
1274         Audio controls should render with a black background.
1275         https://bugs.webkit.org/show_bug.cgi?id=144074.
1276         <rdar://problem/20596939>
1277
1278         Reviewed by Darin Adler.
1279
1280         * Modules/mediacontrols/mediaControlsApple.css:
1281         (audio::-webkit-media-controls-panel-background-container):
1282         (audio::-webkit-media-controls-panel .volume-box):
1283
1284 2015-04-22  Roger Fong  <roger_fong@apple.com>
1285
1286         Inline media control icons scale down when video is too small.
1287         https://bugs.webkit.org/show_bug.cgi?id=144073.
1288         <rdar://problem/20659451>
1289
1290         Reviewed by Darin Adler.
1291
1292         Just make sure the buttons use min-width.
1293         * Modules/mediacontrols/mediaControlsApple.css:
1294         (audio::-webkit-media-controls-rewind-button):
1295         (audio::-webkit-media-controls-play-button):
1296         (audio::-webkit-media-controls-panel .mute-box):
1297         (video::-webkit-media-controls-volume-max-button):
1298         (audio::-webkit-media-controls-wireless-playback-picker-button):
1299         (audio::-webkit-media-controls-toggle-closed-captions-button):
1300         (audio::-webkit-media-controls-fullscreen-button):
1301
1302 2015-04-22  Jer Noble  <jer.noble@apple.com>
1303
1304         Add new optimized fullscreen delegate methods
1305         https://bugs.webkit.org/show_bug.cgi?id=144071
1306
1307         Reviewed by Eric Carlson.
1308
1309         AVPlayerViewController requires three new delegate methods to be implemented by WebKit which
1310         notify the delegates exactly when the owning view will enter and leave fullscreen mode. One
1311         of the delegate methods (-enterOptimizedFullScreenModeRedirectingVideoToLayer:) gives the
1312         delegate an opportunity to move the video sublayer into a new CALayer. The matching delegate
1313         (-leaveOptimizedFullScreenMode), allows us to return our sublayer back to its original parent.
1314         The third delegate (-isOptimizedFullscreenPossible) is required so the AVPlayerViewController
1315         knows whether to allow a standard -> optimized fullscreen transition.
1316
1317         Drive-by fix: initialize ivars at declaration time.
1318
1319         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1320         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1321         (-[WebAVPlayerController isOptimizedFullscreenPossible]):
1322         (-[WebAVVideoLayer enterOptimizedFullScreenModeRedirectingVideoToLayer:]):
1323         (-[WebAVVideoLayer leaveOptimizedFullScreenMode]):
1324         (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
1325         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal):
1326         (+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]): Deleted.
1327
1328 2015-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
1329
1330         [iOS] Caret does not line up with text when using the system font
1331         https://bugs.webkit.org/show_bug.cgi?id=144076
1332         <rdar://problem/20578301>
1333
1334         Reviewed by Enrica Casucci.
1335
1336         Determining caret locations often uses the complex text codepath, which means
1337         the complex text codepath must know about custom tracking.
1338
1339         This regression is due to r182512.
1340
1341         Note that this patch is a short-term solution until I can solve the bigger issue of
1342         having two CTFontRefs and using each in their proper place.
1343
1344         No new tests because there is no way to robustly test the system font.
1345
1346         * platform/graphics/Font.h:
1347         (WebCore::Font::hasCustomTracking):
1348         * platform/graphics/cocoa/FontCocoa.mm:
1349         (WebCore::canUseFastGlyphAdvanceGetter):
1350         (WebCore::Font::platformWidthForGlyph):
1351         (WebCore::hasCustomTracking): Deleted.
1352         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1353         (WebCore::Font::getCFStringAttributes):
1354
1355 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
1356
1357         Context menu doesn't account for selection semantics
1358         https://bugs.webkit.org/show_bug.cgi?id=143958
1359         <rdar://problem/19735706>
1360
1361         Reviewed by Tim Horton.
1362
1363         Before using the default word-only selection for context menus, check with the
1364         lookup service to see if we can get a semantically appropriate selection.
1365
1366         * editing/EditingBehavior.h:
1367         (WebCore::EditingBehavior::shouldSelectBasedOnDictionaryLookup): Added, so that we can
1368         behavior correctly when using non-Mac editing behavior.
1369         * editing/mac/DictionaryLookup.mm:
1370         (WebCore::rangeForDictionaryLookupAtHitTestResult): Modified to honor standard WebKit
1371         behavior when hit testing at end-of-line/end-of-paragraph, etc.
1372         * page/EventHandler.cpp:
1373         (WebCore::EventHandler::shouldAppendTrailingWhitespace): New helper function to share code.
1374         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Added.
1375         (WebCore::EventHandler::selectClosestContextualWordFromMouseEvent): Added.
1376         (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): Renamed from selectClosestWordOrLinkFromMouseEvent.
1377         Have this call the new 'selectClosestContextualWordFromMouseEvent' instead of the vanilla 'selectClosestWordFromMouseEvent'.
1378         * page/EventHandler.h:
1379         * page/mac/EventHandlerMac.mm:
1380         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Added.
1381
1382 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
1383
1384         [Mac] Extend action menus to support PDF
1385         https://bugs.webkit.org/show_bug.cgi?id=143895
1386         <rdar://problem/19003333>
1387
1388         Reviewed by Tim Horton.
1389
1390         Tested by TestWebKitAPI ActionMenus.mm.
1391
1392         Add a new dictionary lookup method to support PDF Selections. This code replicates the
1393         DOM Range-based logic used for HTML documents, but does so using the PDFKit API and
1394         its support types.
1395
1396         * Configurations/Base.xcconfig: Add PDFKit include path for build.
1397         * editing/mac/DictionaryLookup.h:
1398         * editing/mac/DictionaryLookup.mm:
1399         (WebCore::expandSelectionByCharacters): Helper function for PDF support.
1400         (WebCore::dictionaryLookupForPDFSelection): Added.
1401
1402 2015-04-22  Zalan Bujtas  <zalan@apple.com>
1403
1404         Move render ruby initialization logic from RenderElement::createFor() to *::createElementRenderer()
1405         https://bugs.webkit.org/show_bug.cgi?id=144058
1406
1407         Reviewed by Darin Adler.
1408
1409         No change in functionality.
1410
1411         * CMakeLists.txt:
1412         * WebCore.vcxproj/WebCore.vcxproj:
1413         * WebCore.vcxproj/WebCore.vcxproj.filters:
1414         * WebCore.xcodeproj/project.pbxproj:
1415         * html/HTMLTagNames.in:
1416         * html/RubyElement.cpp: Added.
1417         (WebCore::RubyElement::RubyElement):
1418         (WebCore::RubyElement::create):
1419         (WebCore::RubyElement::createElementRenderer):
1420         * html/RubyElement.h: Added.
1421         * html/RubyTextElement.cpp: Added.
1422         (WebCore::RubyTextElement::RubyTextElement):
1423         (WebCore::RubyTextElement::create):
1424         (WebCore::RubyTextElement::createElementRenderer):
1425         * html/RubyTextElement.h: Added.
1426         * rendering/RenderElement.cpp:
1427         (WebCore::RenderElement::createFor):
1428
1429 2015-04-22  Roger Fong  <roger_fong@apple.com>
1430
1431         Show correct wireless play placard on iOS.
1432         <rdar://problem/20656596>
1433
1434         Copy wireless player placard code from r182631 to iOS.
1435         * Modules/mediacontrols/mediaControlsiOS.css:
1436         (audio::-webkit-media-controls-wireless-playback-status):
1437         (audio::-webkit-media-controls-wireless-playback-text):
1438         (audio::-webkit-media-controls-wireless-playback-text-top):
1439         (audio::-webkit-media-controls-wireless-playback-text-bottom):
1440         (audio::-webkit-media-controls-wireless-playback-status.small):
1441         (audio::-webkit-media-controls-wireless-playback-text-top.small):
1442         (audio::-webkit-media-controls-wireless-playback-text-bottom.small):
1443         * Modules/mediacontrols/mediaControlsiOS.js:
1444         (ControllerIOS.prototype.createControls):
1445         (ControllerIOS.prototype.configureInlineControls):
1446
1447 2015-04-22  Roger Fong  <roger_fong@apple.com>
1448
1449         Rollout part of r182263 that broke inline media controls on iOS.
1450         <rdar://problem/20654260>
1451
1452         * Modules/mediacontrols/mediaControlsApple.js:
1453         (Controller.prototype.handlePanelTransitionEnd):
1454         (Controller.prototype.setPlaying):
1455         (Controller.prototype.showControls):
1456         (Controller.prototype.hideControls):
1457
1458 2015-04-22  Eric Carlson  <eric.carlson@apple.com>
1459
1460         Unreviewed post-review clean up after r183096.
1461
1462         * Modules/mediasession/WebMediaSessionManagerClient.h:
1463         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
1464
1465 2015-04-22  Nan Wang  <nanwang1101@yahoo.com>
1466
1467         AX: WebKit does not expose text fields inside tree views.
1468         https://bugs.webkit.org/show_bug.cgi?id=142196
1469
1470         Reviewed by Chris Fleizach.
1471
1472         The problem is that any object in a tree which is not a static text 
1473         or treeitem will be ignored. Fixed it by exposing the children of treeitem.
1474
1475         Test: accessibility/treeitem-child-exposed.html
1476
1477         * accessibility/AccessibilityRenderObject.cpp:
1478         (WebCore::AccessibilityRenderObject::isAllowedChildOfTree):
1479
1480 2015-04-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1481
1482         [Streams API] Implement ReadableStreamController
1483         https://bugs.webkit.org/show_bug.cgi?id=143608
1484
1485         Reviewed by Benjamin Poulain.
1486
1487         Introducing ReadableStreamController, an abstraction to manage JS source stream queues.
1488         This new interface is not exposed to JS scripts as specified, using NoInterfaceObject.
1489
1490         A controller is created at the time a ReadableJSStream is started and it is owned by it.
1491         The controller may outlive the stream but as its reference will be reset, the calls to
1492         its methods would result in exceptions.
1493
1494         The constructor is not implemented yet.
1495
1496         Change covered by existing tests and rebased expectations.
1497
1498         * CMakeLists.txt:
1499         * DerivedSources.cpp:
1500         * DerivedSources.make: Added ReadableStreamController.idl related files.
1501         * Modules/streams/ReadableStreamController.h: Added.
1502         * Modules/streams/ReadableStreamController.idl: Added.
1503         * WebCore.vcxproj/WebCore.vcxproj:
1504         * WebCore.vcxproj/WebCore.vcxproj.filters:
1505         * WebCore.xcodeproj/project.pbxproj:
1506         * bindings/js/JSBindingsAllInOne.cpp: Added ReadableStreamController.idl related files.
1507         * bindings/js/JSReadableStreamControllerCustom.cpp: Added.
1508         * bindings/js/ReadableStreamJSSource.cpp:
1509         * bindings/js/ReadableStreamJSSource.h: Removed custom controller implementation.
1510
1511 2015-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
1512
1513         Rename hasOverride{Height,Width}() to hasOverrideLogicalContent{Height,Width}()
1514         https://bugs.webkit.org/show_bug.cgi?id=143984
1515
1516         Reviewed by Darin Adler.
1517
1518         This patch is renaming these LayoutBox methods, because of their names
1519         don't match with the getters and setters, which is confusing. Specially
1520         now that we also have hasOverrideContainingBlockLogical{Height,Width}().
1521
1522         No new tests (this is just a refactoring).
1523
1524         * rendering/RenderBlockFlow.cpp:
1525         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
1526         * rendering/RenderBlockLineLayout.cpp:
1527         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
1528         * rendering/RenderBox.cpp:
1529         (WebCore::RenderBox::hasOverrideLogicalContentHeight):
1530         (WebCore::RenderBox::hasOverrideLogicalContentWidth):
1531         (WebCore::RenderBox::overrideLogicalContentWidth):
1532         (WebCore::RenderBox::overrideLogicalContentHeight):
1533         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
1534         (WebCore::RenderBox::computeLogicalWidthInRegion):
1535         (WebCore::RenderBox::computeLogicalHeight):
1536         (WebCore::RenderBox::computePercentageLogicalHeight):
1537         (WebCore::RenderBox::availableLogicalHeightUsing):
1538         * rendering/RenderBox.h:
1539         * rendering/RenderDeprecatedFlexibleBox.cpp:
1540         (WebCore::contentWidthForChild):
1541         (WebCore::contentHeightForChild):
1542         * rendering/RenderFlexibleBox.cpp:
1543         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
1544         * rendering/RenderRubyBase.cpp:
1545         (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds):
1546         * rendering/RenderTableSection.cpp:
1547         (WebCore::RenderTableSection::calcRowLogicalHeight):
1548
1549 2015-04-21  Jer Noble  <jer.noble@apple.com>
1550
1551         [Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
1552         https://bugs.webkit.org/show_bug.cgi?id=144023
1553
1554         Reviewed by Eric Carlson.
1555
1556         Fixes non-deterministic crash in media/media-source/media-source-stalled-holds-sleep-assertion.html.
1557
1558         Platform changes have introduced a re-entrancy to provideMediaData().  Calling
1559         SourceBufferPrivate::enqueueSample() can result in a re-entrant call back into
1560         SourceBuffer::provideMediaData(). To protect against this, wrap the client call
1561         from SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples() to
1562         SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples() in a dispatch_async() to the
1563         main thread. This gives the original provideMediaData() a chance to finish before the next
1564         one begins.
1565
1566         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1567         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
1568
1569 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
1570
1571         [Mac] Use one playback target for all web processes
1572         https://bugs.webkit.org/show_bug.cgi?id=144009
1573
1574         Reviewed by Tim Horton.
1575
1576         * Modules/mediacontrols/mediaControlsApple.js:
1577         (Controller.prototype.updateWirelessPlaybackStatus): Drive-by fix to show controls when
1578             we show the placeholder image.
1579
1580         Instead of having each Page/Document pair manage access to the playback target for the videos
1581         in a web process, put all of the logic into a new class - WebMediaSessionManager. A singleton
1582         instance talks to the target picker and manages video element access for all web processes.
1583         All playback target logic was removed from Document, Page, and MediaSessionManager.
1584
1585         * Modules/mediasession: Added.
1586         * Modules/mediasession/WebMediaSessionManager.cpp: Added.
1587         (WebCore::ClientState::ClientState):
1588         (WebCore::flagsAreSet):
1589         (WebCore::WebMediaSessionManager::WebMediaSessionManager):
1590         (WebCore::WebMediaSessionManager::~WebMediaSessionManager):
1591         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient):
1592         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient):
1593         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
1594         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
1595         (WebCore::WebMediaSessionManager::clientStateDidChange):
1596         (WebCore::WebMediaSessionManager::setPlaybackTarget):
1597         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
1598         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring):
1599         (WebCore::WebMediaSessionManager::taskTimerFired):
1600         (WebCore::WebMediaSessionManager::find):
1601         (WebCore::WebMediaSessionManager::forEachClient):
1602         * Modules/mediasession/WebMediaSessionManager.h: Added.
1603         * Modules/mediasession/WebMediaSessionManagerClient.h: Added.
1604         (WebCore::WebMediaSessionManagerClient::~WebMediaSessionManagerClient):
1605         * Modules/webaudio/AudioContext.cpp:
1606         (WebCore::AudioContext::mediaState): Replaces isPlayingAudio.
1607         (WebCore::AudioContext::isPlayingAudio): Deleted.
1608         * Modules/webaudio/AudioContext.h:
1609         * WebCore.xcodeproj/project.pbxproj: Added new files.
1610         * dom/Document.cpp:
1611         (WebCore::Document::Document):
1612         (WebCore::Document::addAudioProducer): Take a MediaProducer instead of an AudioProducer.
1613         (WebCore::Document::removeAudioProducer):
1614         (WebCore::Document::updateIsPlayingMedia):
1615         (WebCore::nextPlaybackTargetClientContextId):
1616         (WebCore::Document::addPlaybackTargetPickerClient):
1617         (WebCore::Document::removePlaybackTargetPickerClient):
1618         (WebCore::Document::showPlaybackTargetPicker):
1619         (WebCore::Document::playbackTargetPickerClientStateDidChange):
1620         (WebCore::Document::playbackTargetAvailabilityDidChange):
1621         (WebCore::Document::setPlaybackTarget):
1622         (WebCore::Document::setShouldPlayToPlaybackTarget):
1623         (WebCore::Document::configurePlaybackTargetMonitoring): Deleted.
1624         (WebCore::Document::requiresPlaybackTargetRouteMonitoring): Deleted.
1625         (WebCore::Document::didChoosePlaybackTarget): Deleted.
1626         * dom/Document.h:
1627         (WebCore::Document::mediaState):
1628         (WebCore::Document::isPlayingAudio): Deleted.
1629         * html/HTMLMediaElement.cpp:
1630         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1631         (WebCore::HTMLMediaElement::registerWithDocument):
1632         (WebCore::HTMLMediaElement::setMuted): 
1633         (WebCore::HTMLMediaElement::parseAttribute):
1634         * html/HTMLMediaElement.h:
1635         * html/HTMLMediaSession.cpp:
1636         (WebCore::HTMLMediaSession::registerWithDocument):
1637         (WebCore::HTMLMediaSession::unregisterWithDocument):
1638         (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
1639         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
1640         (WebCore::HTMLMediaSession::setPlaybackTarget):
1641         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
1642         (WebCore::HTMLMediaSession::setShouldPlayToPlaybackTarget):
1643         (WebCore::HTMLMediaSession::mediaStateDidChange):
1644         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Deleted.
1645         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Deleted.
1646         (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Deleted.
1647         (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Deleted.
1648         * html/HTMLMediaSession.h:
1649         * page/AudioProducer.h: Removed.
1650         * page/ChromeClient.h:
1651         * page/MediaProducer.h: Copied from Source/WebCore/page/AudioProducer.h.
1652         (WebCore::MediaProducer::~MediaProducer):
1653         (WebCore::AudioProducer::~AudioProducer): Deleted.
1654         * page/Page.cpp:
1655         (WebCore::Page::Page):
1656         (WebCore::Page::updateIsPlayingMedia):
1657         (WebCore::Page::addPlaybackTargetPickerClient):
1658         (WebCore::Page::removePlaybackTargetPickerClient):
1659         (WebCore::Page::showPlaybackTargetPicker):
1660         (WebCore::Page::playbackTargetPickerClientStateDidChange):
1661         (WebCore::Page::setPlaybackTarget):
1662         (WebCore::Page::playbackTargetAvailabilityDidChange):
1663         (WebCore::Page::setShouldPlayToPlaybackTarget):
1664         (WebCore::Page::playbackTarget): Deleted.
1665         (WebCore::Page::didChoosePlaybackTarget): Deleted.
1666         (WebCore::Page::configurePlaybackTargetMonitoring): Deleted.
1667         * page/Page.h:
1668         (WebCore::Page::mediaState):
1669         (WebCore::Page::isPlayingAudio): Deleted.
1670         (WebCore::Page::hasWirelessPlaybackTarget): Deleted.
1671         * platform/audio/MediaSession.h:
1672         (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
1673         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
1674         (WebCore::MediaSessionClient::setShouldPlayToPlaybackTarget):
1675         (WebCore::MediaSession::startPlayingToPlaybackTarget): Deleted.
1676         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Deleted.
1677         (WebCore::MediaSessionClient::startPlayingToPlaybackTarget): Deleted.
1678         (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget): Deleted.
1679         * platform/audio/MediaSessionManager.cpp:
1680         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
1681         (WebCore::MediaSessionManager::sessionCanLoadMedia):
1682         (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): Deleted.
1683         * platform/audio/MediaSessionManager.h:
1684         * platform/graphics/MediaPlaybackTargetClient.h: Copied from Source/WebCore/platform/graphics/MediaPlaybackTargetPickerClient.h.
1685         (WebCore::MediaPlaybackTargetClient::~MediaPlaybackTargetClient):
1686         (WebCore::MediaPlaybackTargetPickerClient::~MediaPlaybackTargetPickerClient): Deleted.
1687         * platform/graphics/MediaPlaybackTargetPicker.cpp:
1688         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
1689         (WebCore::MediaPlaybackTargetPicker::startingMonitoringPlaybackTargets):
1690         (WebCore::MediaPlaybackTargetPicker::stopMonitoringPlaybackTargets):
1691         * platform/graphics/MediaPlaybackTargetPicker.h:
1692         * platform/graphics/MediaPlaybackTargetPickerClient.h: Removed.
1693         * platform/graphics/MediaPlayer.cpp:
1694         (WebCore::MediaPlayer::setShouldPlayToPlaybackTarget):
1695         (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Deleted.
1696         (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Deleted.
1697         * platform/graphics/MediaPlayer.h:
1698         * platform/graphics/MediaPlayerPrivate.h:
1699         (WebCore::MediaPlayerPrivateInterface::setShouldPlayToPlaybackTarget):
1700         (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget): Deleted.
1701         (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget): Deleted.
1702         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp: Added.
1703         (WebCore::WebMediaSessionManagerMac::singleton):
1704         (WebCore::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
1705         (WebCore::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
1706         (WebCore::WebMediaSessionManagerMac::targetPicker):
1707         * platform/graphics/avfoundation/WebMediaSessionManagerMac.h: Added.
1708         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
1709         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1710         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
1711         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1712         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1713         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1714         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
1715         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
1716         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Deleted.
1717         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Deleted.
1718         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1719         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1720         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
1721         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Deleted.
1722         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Deleted.
1723         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Deleted.
1724         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1725         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1726         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
1727         (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Deleted.
1728         (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Deleted.
1729         (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Deleted.
1730         * testing/Internals.cpp:
1731         (WebCore::Internals::isPagePlayingAudio):
1732
1733 2015-04-21  Myles C. Maxfield  <mmaxfield@apple.com>
1734
1735         [iOS] When computing visible rects for tiling, stop searching at UIWindows
1736         https://bugs.webkit.org/show_bug.cgi?id=144022
1737         <rdar://problem/18327227>
1738
1739         Reviewed by Simon Fraser.
1740
1741         [WAKWindow _visibleRectRespectingMasksToBounds:] computes a visible rect which we use
1742         to determine which tiles to create. We do this by finding the frame of the _hostLayer,
1743         and then walking up the CALayer hierarchy converting each rect into its parent's
1744         coordinate system (all the while clipping to bounds if necessary). This walk up the
1745         layer hierarchy should stop at a layer associated with a UIWindow.
1746
1747         * platform/ios/wak/WAKWindow.mm:
1748         (-[WAKWindow _visibleRectRespectingMasksToBounds:]):
1749
1750 2015-04-21  Jinwoo Song  <jinwoo7.song@samsung.com>
1751
1752         [Cairo] Implement Path::addPath
1753         https://bugs.webkit.org/show_bug.cgi?id=130580
1754
1755         Reviewed by Dirk Schulze.
1756
1757         Add support for addPath method for ports using cairo.
1758         This patch is originally authored by Jae Hyun Park <jaepark@webkit.org>.
1759
1760         Test: fast/canvas/canvas-path-addPath.html
1761
1762         * platform/graphics/cairo/PathCairo.cpp:
1763         (WebCore::Path::addPath): Implement addPath for cairo.
1764
1765 2015-04-21  Tim Horton  <timothy_horton@apple.com>
1766
1767         Fix the iOS build.
1768
1769         * platform/spi/cg/CoreGraphicsSPI.h:
1770
1771 2015-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
1772
1773         SVGAnimateElementBase::calculateAnimatedValue() asserts when reinserting an SVG animating element within the same animation limits
1774         https://bugs.webkit.org/show_bug.cgi?id=143994
1775
1776         Reviewed by Simon Fraser.
1777
1778         Make sure the SVG animation variables are reset cleanly such that if the
1779         animation restarts it can rebuild its limit values reliably and correctly.
1780
1781         Tests: svg/animations/crash-reinsert-animate-length-same-limits.svg
1782                svg/animations/crash-reinsert-animate-transform-same-limits.svg
1783
1784         * svg/SVGAnimateElementBase.h:
1785         * svg/SVGAnimateElementBase.cpp:
1786         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType):
1787         Call the base class resetAnimatedPropertyType() from the derived class.
1788
1789         * svg/SVGAnimationElement.h:
1790         * svg/SVGAnimationElement.cpp:
1791         (WebCore::SVGAnimationElement::resetAnimatedPropertyType):
1792         Make resetAnimatedPropertyType() virtual. The implementation of the base
1793         class of this function resets the values of the animation limits. When
1794         updateAnimation() is called, it will be forced to recalculate the animation
1795         limits by calling calculateFromAndToValues() even if the limits have not
1796         changed.
1797
1798 2015-04-21  Tim Horton  <timothy_horton@apple.com>
1799
1800         Long pause under _takeViewSnapshot when screen updates are disabled
1801         https://bugs.webkit.org/show_bug.cgi?id=144017
1802         <rdar://problem/20548397>
1803
1804         Reviewed by Simon Fraser.
1805
1806         * platform/spi/cg/CoreGraphicsSPI.h:
1807         Add some SPI.
1808
1809 2015-04-21  Commit Queue  <commit-queue@webkit.org>
1810
1811         Unreviewed, rolling out r183077.
1812         https://bugs.webkit.org/show_bug.cgi?id=144021
1813
1814         broke a bunch of tests, bfulgham is going to try again
1815         (Requested by thorton on #webkit).
1816
1817         Reverted changeset:
1818
1819         "Context menu doesn't account for selection semantics"
1820         https://bugs.webkit.org/show_bug.cgi?id=143958
1821         http://trac.webkit.org/changeset/183077
1822
1823 2015-04-21  Chris Dumez  <cdumez@apple.com>
1824
1825         [WK2][NetworkCache] Better account of resource revalidations in efficacy logging
1826         https://bugs.webkit.org/show_bug.cgi?id=144014
1827
1828         Reviewed by Antti Koivisto.
1829
1830         Add additional diagnostic logging key for network cache efficacy
1831         logging.
1832
1833         * page/DiagnosticLoggingKeys.cpp:
1834         (WebCore::DiagnosticLoggingKeys::needsRevalidationKey):
1835         * page/DiagnosticLoggingKeys.h:
1836
1837 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
1838
1839         Context menu doesn't account for selection semantics
1840         https://bugs.webkit.org/show_bug.cgi?id=143958
1841         <rdar://problem/19735706>
1842
1843         Reviewed by Tim Horton.
1844
1845         Before using the default word-only selection, check with the
1846         lookup service to see if we can get a semantically appropriate
1847         selection.
1848
1849         * page/EventHandler.cpp:
1850         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
1851         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
1852         * page/EventHandler.h:
1853         * page/mac/EventHandlerMac.mm:
1854         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
1855
1856 2015-04-21  Anders Carlsson  <andersca@apple.com>
1857
1858         Get rid of an unneeded function from LoaderNSURLExtras.mm
1859         https://bugs.webkit.org/show_bug.cgi?id=144003
1860
1861         Reviewed by Chris Dumez.
1862
1863         Just use Vector::contains instead of vectorContainsString.
1864
1865         * loader/mac/LoaderNSURLExtras.mm:
1866         (suggestedFilenameWithMIMEType):
1867         (vectorContainsString): Deleted.
1868
1869 2015-04-21  Chris Dumez  <cdumez@apple.com>
1870
1871         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
1872         https://bugs.webkit.org/show_bug.cgi?id=143970
1873
1874         Reviewed by Darin Adler.
1875
1876         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
1877         constructor explicit as it copies the vector and it is easy to call it
1878         by mistake.
1879
1880         * Modules/indexeddb/IDBDatabaseBackend.cpp:
1881         (WebCore::IDBDatabaseBackend::setIndexKeys):
1882         (WebCore::IDBDatabaseBackend::setIndexesReady):
1883         * Modules/indexeddb/IDBDatabaseBackend.h:
1884         * Modules/indexeddb/IDBServerConnection.h:
1885         * cssjit/SelectorCompiler.cpp:
1886         (WebCore::SelectorCompiler::minimumRegisterRequirements):
1887         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasClasses):
1888         * cssjit/StackAllocator.h:
1889         (WebCore::StackAllocator::push):
1890         (WebCore::StackAllocator::pop):
1891         * rendering/RenderGrid.cpp:
1892         (WebCore::RenderGrid::GridIterator::nextGridItem):
1893         (WebCore::RenderGrid::GridIterator::isEmptyAreaEnough):
1894         * rendering/style/SVGRenderStyle.cpp:
1895         (WebCore::SVGRenderStyle::paintTypesForPaintOrder):
1896         * rendering/style/SVGRenderStyle.h:
1897         * rendering/svg/RenderSVGShape.cpp:
1898         (WebCore::RenderSVGShape::fillStrokeMarkers):
1899         * rendering/svg/SVGInlineTextBox.cpp:
1900         (WebCore::SVGInlineTextBox::paint):
1901         * svg/SVGToOTFFontConversion.cpp:
1902         (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
1903         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1904
1905 2015-04-21  Chris Dumez  <cdumez@apple.com>
1906
1907         Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion
1908         https://bugs.webkit.org/show_bug.cgi?id=143971
1909
1910         Reviewed by Darin Adler.
1911
1912         Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion as
1913         firing JS events can cause arbitrary JS execution which often leads to
1914         security bugs when event firing is forbidden. For e.g. firing events
1915         from ActiveDOMObject::suspend() means JS can construct or destroy
1916         ActiveDOMObjects while we are iterating over them.
1917
1918         * dom/ContainerNode.cpp:
1919         (WebCore::dispatchChildInsertionEvents):
1920         (WebCore::dispatchChildRemovalEvents):
1921         * dom/ContainerNodeAlgorithms.h:
1922         (WebCore::ChildNodeInsertionNotifier::notify):
1923         * dom/Document.cpp:
1924         (WebCore::Document::dispatchWindowEvent):
1925         (WebCore::Document::dispatchWindowLoadEvent):
1926         * dom/Element.cpp:
1927         (WebCore::Element::dispatchFocusInEvent):
1928         (WebCore::Element::dispatchFocusOutEvent):
1929         * dom/EventDispatcher.cpp:
1930         (WebCore::EventDispatcher::dispatchEvent):
1931         * dom/EventTarget.cpp:
1932         (WebCore::EventTarget::fireEventListeners):
1933         * dom/Node.cpp:
1934         (WebCore::Node::dispatchSubtreeModifiedEvent):
1935         (WebCore::Node::dispatchDOMActivateEvent):
1936         * dom/ScriptExecutionContext.cpp:
1937         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache):
1938         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
1939         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
1940         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
1941         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
1942         * dom/WebKitNamedFlow.cpp:
1943         (WebCore::WebKitNamedFlow::dispatchRegionOversetChangeEvent):
1944
1945 2015-04-21  Darin Adler  <darin@apple.com>
1946
1947         Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template definitions and traits)
1948         https://bugs.webkit.org/show_bug.cgi?id=143944
1949
1950         Reviewed by Andreas Kling.
1951
1952         * editing/ios/DictationCommandIOS.h: Added now-needed include of PassOwnPtr.h.
1953
1954 2015-04-20  Simon Fraser  <simon.fraser@apple.com>
1955
1956         REGRESSION (r177494): -webkit-mask-image: with data URI fails on non-local files
1957         https://bugs.webkit.org/show_bug.cgi?id=141857
1958
1959         Reviewed by Dirk Schulze.
1960         
1961         r177494 regressed loading of data URIs in masks with remote content, triggering
1962         a cross-domain error which occurs because the mask loading happened via a separate
1963         SVGDocument.
1964         
1965         Fix by checking for data URIs at parsing time, which is what we used to do.
1966
1967         Test: http/tests/css/data-uri-mask.html
1968
1969         * css/CSSParser.cpp:
1970         (WebCore::CSSParser::parseMaskImage):
1971         * svg/SVGURIReference.h:
1972         (WebCore::SVGURIReference::isExternalURIReference):
1973
1974 2015-04-20  Chris Dumez  <cdumez@apple.com>
1975
1976         Crash when showing Web Inspector on page with 'multipart/x-mixed-replace' main resource
1977         https://bugs.webkit.org/show_bug.cgi?id=143979
1978         <rdar://problem/20594948>
1979
1980         Reviewed by Timothy Hatcher.
1981
1982         InspectorDOMAgent::m_document was updated only once per load, from
1983         FrameLoader::dispatchDidCommitLoad(). However, dispatchDidCommitLoad()
1984         is not called for follow-up multipart replacing loads. You can see this
1985         from the following check in DocumentLoader::commitData():
1986             if (!isMultipartReplacingLoad())
1987                 frameLoader()->receivedFirstData();
1988
1989         As a result, in the case of a 'multipart/x-mixed-replace' main resource
1990         InspectorDOMAgent::m_document would quickly get outdated as we create
1991         a new Document for each replacing load. This would lead to Web Inspector
1992         code using a Document without frame and causing crashes.
1993
1994         This patch calls InspectorInstrumentation::frameDocumentUpdated() from
1995         Frame::setDocument() so that InspectorDOMAgent::m_document is always up
1996         to date.
1997
1998         No new tests, not easily testable as the main resource needs to be
1999         'multipart/x-mixed-replace'.
2000
2001         * dom/Document.cpp:
2002         (WebCore::Document::applyXSLTransform):
2003         Stop calling InspectorInstrumentation::frameDocumentUpdated() here as
2004         XSLTProcessor::createDocumentFromSource() will call Frame::setDocument()
2005         and frameDocumentUpdated() will be called there.
2006
2007         * page/Frame.cpp:
2008         (WebCore::Frame::setDocument):
2009         Call InspectorInstrumentation::frameDocumentUpdated() to make sure
2010         InspectorDOMAgent::m_document gets updated.
2011
2012 2015-04-20  Alex Christensen  <achristensen@webkit.org>
2013
2014         Overwrite existing files with moveFile.
2015         https://bugs.webkit.org/show_bug.cgi?id=143968
2016
2017         Reviewed by Brady Eidson and Anders Carlsson.
2018
2019         * platform/mac/FileSystemMac.mm:
2020         (-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]):
2021         (WebCore::moveFile):
2022         r182932 introduced moveFile instead of renameFile.  In order to preserve behavior, it should overwrite existing files.
2023
2024 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
2025
2026         Unreviewed Windows build fix after r183031.
2027
2028         * platform/graphics/OpenGLShims.cpp:
2029         (WebCore::lookupOpenGLFunctionAddress):
2030         Windows needs an explicit cast converting LChar* to const char*.
2031         Also, add a FIXME comment for sketchy behavior.
2032
2033 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
2034
2035         Cleanup some StringBuilder use
2036         https://bugs.webkit.org/show_bug.cgi?id=143550
2037
2038         Reviewed by Darin Adler.
2039
2040         * Modules/plugins/YouTubePluginReplacement.cpp:
2041         (WebCore::YouTubePluginReplacement::youTubeURL):
2042         * css/CSSAnimationTriggerScrollValue.cpp:
2043         (WebCore::CSSAnimationTriggerScrollValue::customCSSText):
2044         * css/CSSCanvasValue.cpp:
2045         (WebCore::CSSCanvasValue::customCSSText):
2046         * html/HTMLCanvasElement.cpp:
2047         (WebCore::HTMLCanvasElement::createImageBuffer):
2048         * page/CaptionUserPreferencesMediaAF.cpp:
2049         (WebCore::CaptionUserPreferencesMediaAF::captionsWindowCSS):
2050         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS):
2051         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor):
2052         (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS):
2053         (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
2054         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride):
2055         * page/EventSource.cpp:
2056         (WebCore::EventSource::didReceiveResponse):
2057         * page/PageSerializer.cpp:
2058         (WebCore::PageSerializer::serializeCSSStyleSheet):
2059         * platform/graphics/OpenGLShims.cpp:
2060         (WebCore::lookupOpenGLFunctionAddress):
2061         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2062         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
2063         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2064         (WebCore::generateHashedName):
2065         * platform/text/DateTimeFormat.cpp:
2066         (WebCore::DateTimeFormat::quoteAndAppendLiteral):
2067         * rendering/RenderLayerCompositor.cpp:
2068         (WebCore::RenderLayerCompositor::logLayerInfo):
2069         * rendering/RenderTreeAsText.cpp:
2070         (WebCore::writeRenderRegionList):
2071         * testing/MicroTaskTest.cpp:
2072         (WebCore::MicroTaskTest::run):
2073         * testing/MockContentFilterSettings.cpp:
2074         (WebCore::MockContentFilterSettings::unblockRequestURL):
2075
2076 2015-04-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2077
2078         SVGFitToViewBox::viewBoxToViewTransform() has to count for zero physical width and height before calling SVGPreserveAspectRatio::getCTM()
2079         https://bugs.webkit.org/show_bug.cgi?id=143903
2080
2081         Reviewed by Daniel Bates.
2082
2083         Ensure that the SVG viewBoxToView transformation is always invertible.
2084         CG path drawing functions crash if the context is transformed to non-
2085         invertible matrix.
2086
2087         Tests: svg/css/crash-path-zero-height-viewbox.svg
2088                svg/css/crash-path-zero-width-viewbox.svg
2089
2090         * svg/SVGFitToViewBox.cpp:
2091         (WebCore::SVGFitToViewBox::viewBoxToViewTransform):
2092         Do not call SVGPreserveAspectRatio::getCTM() if the physical width or the
2093         physical height is zero.
2094
2095         * svg/SVGPreserveAspectRatio.cpp:
2096         (WebCore::SVGPreserveAspectRatio::getCTM):
2097         Ensure that we are not dividing by zero in this function.
2098
2099 2015-04-20  Chris Dumez  <cdumez@apple.com>
2100
2101         CSSParser::parseValue() copies the m_parsedProperties vector at addParsedProperties()
2102         https://bugs.webkit.org/show_bug.cgi?id=143925
2103
2104         Reviewed by Simon Fraser.
2105
2106         Update MutableStyleProperties::addParsedProperties() to use
2107         CSSParser::ParsedPropertyVector type (i.e. Vector<CSSProperty, 256>)
2108         instead of Vector<CSSProperty> so that the properties vector is no
2109         longer copied unnecessarily to convert one type to the other.
2110
2111         * css/CSSParser.h:
2112         * css/StyleProperties.cpp:
2113         (WebCore::MutableStyleProperties::addParsedProperties):
2114         * css/StyleProperties.h:
2115
2116 2015-04-20  Beth Dakin  <bdakin@apple.com>
2117
2118         Should remove mouseForceClick and mouseForceCancelled from DOM force events
2119         https://bugs.webkit.org/show_bug.cgi?id=143904
2120         -and corresponding-
2121         rdar://problem/20578842
2122
2123         Reviewed by Dan Bernstein.
2124
2125         After more thought and discussion, we decided to remove mouseForceClick and 
2126         mouseForceCancelled from DOM force events. mouseForceClick is confusing and 
2127         redundant. mouseForceCancelled is confusing as it is currently implemented, and 
2128         all of its functionality can be filled by exisiting events such as mouseup, 
2129         mouseout, etc.
2130
2131         * dom/Document.cpp:
2132         (WebCore::Document::addListenerTypeIfNeeded):
2133         * dom/Document.h:
2134         * dom/Document.idl:
2135         * dom/Element.cpp:
2136         (WebCore::Element::dispatchMouseForceWillBegin):
2137         (WebCore::Element::dispatchMouseForceClick): Deleted.
2138         (WebCore::Element::dispatchMouseForceCancelled): Deleted.
2139         * dom/Element.h:
2140         * dom/Element.idl:
2141         * dom/EventNames.h:
2142         * html/HTMLAttributeNames.in:
2143         * html/HTMLBodyElement.cpp:
2144         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
2145         * html/HTMLBodyElement.idl:
2146         * html/HTMLElement.cpp:
2147         (WebCore::HTMLElement::createEventHandlerNameMap):
2148         * page/DOMWindow.idl:
2149
2150 2015-04-20  Simon Fraser  <simon.fraser@apple.com>
2151
2152         Setting inline style to the same value it already has triggers a style recalc
2153         https://bugs.webkit.org/show_bug.cgi?id=143922
2154
2155         Reviewed by Antti Koivisto.
2156
2157         MutableStyleProperties::setProperty() was taking the result of CSSParser::parseValue()
2158         to mean "parsing changed the style", but it actually just means "parsing succeeded".
2159         Add a new out param, piped through various parser functions, to indicate whether
2160         parsing actually changed style, and instead return that from setProperty().
2161
2162         Add internals.startTrackingStyleRecalcs() and internals.styleRecalcCount() so
2163         we can write tests for style recalc.
2164
2165         Test: fast/css/set-inline-style-recalc.html
2166
2167         * WebCore.xcodeproj/project.pbxproj: Let Xcode have it's way.
2168         * css/CSSParser.cpp:
2169         (WebCore::parseColorValue):
2170         (WebCore::parseSimpleLengthValue):
2171         (WebCore::parseKeywordValue):
2172         (WebCore::parseTranslateTransformValue):
2173         (WebCore::CSSParser::parseFontFaceValue):
2174         (WebCore::CSSParser::parseValue):
2175         * css/CSSParser.h:
2176         * css/CSSProperty.h:
2177         (WebCore::StylePropertyMetadata::operator==):
2178         (WebCore::CSSProperty::operator==):
2179         * css/DOMWindowCSS.cpp:
2180         (WebCore::DOMWindowCSS::supports):
2181         * css/StyleProperties.cpp:
2182         (WebCore::MutableStyleProperties::setProperty):
2183         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty):
2184         (WebCore::MutableStyleProperties::addParsedProperties):
2185         (WebCore::MutableStyleProperties::addParsedProperty):
2186         * css/StyleProperties.h:
2187         * css/WebKitCSSMatrix.cpp:
2188         (WebCore::WebKitCSSMatrix::setMatrixValue):
2189         * dom/Document.cpp:
2190         (WebCore::Document::recalcStyle):
2191         (WebCore::Document::startTrackingStyleRecalcs):
2192         (WebCore::Document::styleRecalcCount):
2193         * dom/Document.h:
2194         * html/canvas/CanvasRenderingContext2D.cpp:
2195         (WebCore::CanvasRenderingContext2D::setFont):
2196         * testing/Internals.cpp:
2197         (WebCore::Internals::startTrackingStyleRecalcs):
2198         (WebCore::Internals::styleRecalcCount):
2199         * testing/Internals.h:
2200         * testing/Internals.idl:
2201
2202 2015-04-20  Brady Eidson  <beidson@apple.com>
2203
2204         Crash in StyleResolver::invalidateMatchedPropertiesCache() when using content extensions.
2205         <rdar://problem/20554405> and https://bugs.webkit.org/show_bug.cgi?id=143892
2206
2207         Reviewed by Chris Dumez.
2208
2209         Test: http/tests/contentextensions/style-resolver-changed-reentrancy.html
2210
2211         * contentextensions/ContentExtensionsBackend.cpp:
2212         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2213
2214         * dom/DocumentStyleSheetCollection.cpp:
2215         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
2216         (WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Call styleResolverChanged on a delay.
2217         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet): Ditto.
2218         (WebCore::DocumentStyleSheetCollection::styleResolverChangedTimerFired):
2219         * dom/DocumentStyleSheetCollection.h:
2220
2221 2015-04-20  Per Arne Vollan  <peavo@outlook.com>
2222
2223         Favicons are not always loaded.
2224         https://bugs.webkit.org/show_bug.cgi?id=143880
2225
2226         Reviewed by Darin Adler.
2227
2228         If the favicon link element(s) in the document does not have a mime type,
2229         the favicon is loaded from the domain root (/favicon.ico). If no favicon
2230         exists at this location, the favicon loading will fail. This can be solved
2231         by not demanding that the link element has a mime type.
2232
2233         Test: fast/dom/icon-url-without-mimetype.html
2234
2235         * loader/icon/IconController.cpp:
2236         (WebCore::iconFromLinkElements): Return the chosen icon URL instead of a vector of URLs.
2237         (WebCore::IconController::url):
2238         (WebCore::iconsFromLinkElements): Deleted.
2239
2240 2015-04-20  Martin Robinson  <mrobinson@igalia.com>
2241
2242         [CMake] Include ICU unconditionally on the source lists
2243         https://bugs.webkit.org/show_bug.cgi?id=143900
2244
2245         Reviewed by Darin Adler.
2246
2247         No new tests. This is just a build file change.
2248
2249         * CMakeLists.txt: Integrate ICU source files, includes, and libraries into the main
2250         sections. They are shared by all platforms.
2251         * PlatformGTK.cmake: Eliminate build rules that are duplicated from the main CMakeLists.txt.
2252
2253 2015-04-20  Chris Fleizach  <cfleizach@apple.com>
2254
2255         AX: iOS: Text input field ignores value of read-only and aria-readonly attributes
2256         https://bugs.webkit.org/show_bug.cgi?id=143946
2257
2258         Reviewed by Mario Sanchez Prada.
2259
2260         Expose an existing method for determining whether the value can be set to the iOS accessibility platform.
2261
2262         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2263         (-[WebAccessibilityObjectWrapper accessibilityCanSetValue]):
2264
2265 2015-04-20  Andreas Kling  <akling@apple.com>
2266
2267         Merge TreeShared into Node.
2268         <https://webkit.org/b/143942>
2269
2270         Reviewed by Darin Adler.
2271
2272         Node was the only remaining user of TreeShared, so just fold the class into Node.
2273
2274         * WebCore.vcxproj/WebCore.vcxproj:
2275         * WebCore.vcxproj/WebCore.vcxproj.filters:
2276         * WebCore.xcodeproj/project.pbxproj:
2277         * dom/Node.cpp:
2278         (WebCore::Node::Node):
2279         (WebCore::Node::~Node):
2280         * dom/Node.h:
2281         (WebCore::Node::ref):
2282         (WebCore::Node::deref):
2283         (WebCore::Node::hasOneRef):
2284         (WebCore::Node::refCount):
2285         (WebCore::adopted):
2286         (WebCore::Node::hasTreeSharedParent): Deleted.
2287         * platform/TreeShared.h: Removed.
2288
2289 2015-04-19  Benjamin Poulain  <benjamin@webkit.org>
2290
2291         Improve the feature.json files
2292
2293         * features.json:
2294
2295 2015-04-18  Jon Lee  <jonlee@apple.com>
2296
2297         [Mac] Time elapsed should be right-aligned
2298         https://bugs.webkit.org/show_bug.cgi?id=143927
2299
2300         Reviewed by Eric Carlson.
2301
2302         Current time is left-aligned, which is visually jarring when going from < 1 hour to > 1 hour.
2303
2304         * Modules/mediacontrols/mediaControlsApple.css:
2305         (audio::-webkit-media-controls-current-time-display): Set justify-content to flex-end.
2306         (audio::-webkit-media-controls-time-remaining-display): Explicitly set justify-content to flex-start.
2307
2308 2015-04-18  Simon Fraser  <simon.fraser@apple.com>
2309
2310         REGRESSION (r181656): Animated tiled layers are missing content
2311         https://bugs.webkit.org/show_bug.cgi?id=143911
2312         rdar://problem/20596328
2313
2314         Reviewed by Darin Adler.
2315
2316         After r181656, all requestAnimationFrame was falling back to timers, and not
2317         using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
2318         fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during
2319         animations) was failing to do any updates.
2320         
2321         Replace this confusing Optional<> code with simpler code that just forces the
2322         clients to make a DisplayRefreshMonitor if they can, first asking
2323         ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
2324         
2325         Make lots of things into references, and use C++11 initialization in some places.
2326         
2327         Add Internals API to allow a test to get the number of layer flushes that have
2328         occurred.
2329         
2330         * dom/ScriptedAnimationController.cpp:
2331         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
2332         (WebCore::ScriptedAnimationController::windowScreenDidChange):
2333         (WebCore::ScriptedAnimationController::scheduleAnimation):
2334         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
2335         * dom/ScriptedAnimationController.h:
2336         * page/ChromeClient.h:
2337         * platform/graphics/DisplayRefreshMonitor.cpp:
2338         (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
2339         (WebCore::DisplayRefreshMonitor::create):
2340         (WebCore::DisplayRefreshMonitor::addClient):
2341         (WebCore::DisplayRefreshMonitor::removeClient):
2342         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
2343         * platform/graphics/DisplayRefreshMonitor.h:
2344         * platform/graphics/DisplayRefreshMonitorClient.cpp:
2345         (WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient):
2346         * platform/graphics/DisplayRefreshMonitorClient.h:
2347         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2348         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
2349         (WebCore::DisplayRefreshMonitorManager::registerClient):
2350         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
2351         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
2352         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
2353         (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
2354         * platform/graphics/DisplayRefreshMonitorManager.h:
2355         * platform/graphics/GraphicsLayerUpdater.cpp:
2356         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
2357         (WebCore::GraphicsLayerUpdater::scheduleUpdate):
2358         (WebCore::GraphicsLayerUpdater::screenDidChange):
2359         (WebCore::GraphicsLayerUpdater::displayRefreshFired):
2360         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
2361         * platform/graphics/GraphicsLayerUpdater.h:
2362         * rendering/RenderLayerCompositor.cpp:
2363         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
2364         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2365         (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
2366         (WebCore::RenderLayerCompositor::flushLayersSoon):
2367         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
2368         (WebCore::RenderLayerCompositor::startTrackingLayerFlushes):
2369         (WebCore::RenderLayerCompositor::layerFlushCount):
2370         * rendering/RenderLayerCompositor.h:
2371         * testing/Internals.cpp:
2372         (WebCore::Internals::startTrackingLayerFlushes):
2373         (WebCore::Internals::layerFlushCount):
2374         * testing/Internals.h:
2375         * testing/Internals.idl:
2376
2377 2015-04-17  Bem Jones-Bey  <bjonesbe@adobe.com>
2378
2379         Large values for line-height cause integer overflow in RenderStyle::computedLineHeight
2380         https://bugs.webkit.org/show_bug.cgi?id=143863
2381
2382         Reviewed by Rob Buis.
2383
2384         When we compute huge values for line-height through percentage or CSS
2385         calc, we'll overflow the integer and later on
2386         ShapeOutsideInfo::computeDeltasForContainingBlockLine will ASSERT
2387         because it expects non-negative line height.  So for the computed
2388         line-height, clamp to an integer range to avoid overflow. Note that
2389         the code path for percentages here is safe because LayoutUnit clamps
2390         to an int on conversion.
2391
2392         This is based on a Blink patch by Rob Buis.
2393
2394         Test: fast/shapes/shape-outside-floats/shape-outside-negative-line-height-crash.html
2395
2396         * rendering/style/RenderStyle.cpp:
2397         (WebCore::RenderStyle::computedLineHeight): Clamp line-height to an
2398             int to avoid overflow.
2399
2400 2015-04-17  Beth Dakin  <bdakin@apple.com>
2401
2402         Force mouse events should go through normal mouse event handling code paths
2403         https://bugs.webkit.org/show_bug.cgi?id=143749
2404         -and corresponding-
2405         rdar://problem/20472895
2406
2407         Reviewed by Dean Jackson.
2408
2409         This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and 
2410         mouseforcechanged into normal mouse event dispatching code. This patch leaves 
2411         behind the cancel and click events because we plan to remove those, and it also 
2412         leaves mouseforcewillbegin because that is necessarily a very different event more 
2413         tied to the NSImmediateActionGestureRecognizer than these other events which are 
2414         tied to NSResponder’s pressureChangeWithEvent.
2415
2416         New helper functions.
2417         * dom/Document.cpp:
2418         (WebCore::Document::hasListenerTypeForEventType):
2419         * dom/Document.h:
2420         * dom/Element.cpp:
2421         (WebCore::isForceEvent):
2422
2423         Move the code to ensure the force events have listeners in order to fire to 
2424         dispatchMouseEvent, and delete the old implementations.
2425         (WebCore::Element::dispatchMouseEvent):
2426         (WebCore::Element::dispatchMouseForceChanged): Deleted.
2427         (WebCore::Element::dispatchMouseForceDown): Deleted.
2428         (WebCore::Element::dispatchMouseForceUp): Deleted.
2429         * dom/Element.h:
2430
2431         Perform a hit test and pipe the events through dispatchMouseEvent(). 
2432         * page/EventHandler.cpp:
2433         (WebCore::EventHandler::handleMouseForceEvent):
2434         * page/EventHandler.h:
2435
2436         New types for the new events.
2437         * platform/PlatformEvent.h:
2438
2439         Forward to EventHandler. 
2440         * replay/UserInputBridge.cpp:
2441         (WebCore::UserInputBridge::handleMouseForceEvent):
2442         * replay/UserInputBridge.h:
2443
2444 2015-04-17  Zalan Bujtas  <zalan@apple.com>
2445
2446         RenderTableCell::computeCollapsed*Border() should check if the cell is still attached to the render tree.
2447         https://bugs.webkit.org/show_bug.cgi?id=143887
2448         rdar://problem/20568989
2449
2450         Reviewed by Simon Fraser.
2451
2452         Detached table cell has no access to its parent table. This is a speculative fix to
2453         avoid dereferencing the invalid table pointer.
2454
2455         * rendering/RenderTableCell.cpp:
2456         (WebCore::RenderTableCell::computeCollapsedStartBorder):
2457         (WebCore::RenderTableCell::computeCollapsedEndBorder):
2458         (WebCore::RenderTableCell::computeCollapsedBeforeBorder):
2459         (WebCore::RenderTableCell::computeCollapsedAfterBorder):
2460
2461 2015-04-16  Roger Fong  <roger_fong@apple.com>
2462
2463         Update fullscreen button visibility on fullscreen change.
2464         https://bugs.webkit.org/show_bug.cgi?id=143861.
2465         <rdar://problem/20143218>
2466
2467         Reviewed by Eric Carlson.
2468
2469         * Modules/mediacontrols/mediaControlsApple.js:
2470         (Controller): There is no need for hasVisualMedia to be a class variable.
2471         (Controller.prototype.handleReadyStateChange):
2472         (Controller.prototype.handleFullscreenChange):
2473         (Controller.prototype.updateFullscreenButtons):
2474
2475 2015-04-17  Daniel Bates  <dabates@apple.com>
2476
2477         REGRESSION: SVG does not support link dragging
2478         https://bugs.webkit.org/show_bug.cgi?id=141597
2479
2480         Reviewed by Darin Adler.
2481
2482         Fixes an issue where a SVG hyperlink cannot be dragged. We should support
2483         dragging an SVG A element just as we support dragging an HTML A element.
2484
2485         Test: fast/events/drag-and-drop-link.html
2486
2487         * page/DragController.cpp: Removed explicit include of header Element.h as it will
2488         be ultimately included by HTMLAnchorElement.h, among other headers.
2489         (WebCore::isDraggableLink): Added. Extracted code from HitTestResult::isLiveLink().
2490         (WebCore::DragController::draggableElement): Call WebCore::isDraggableLink() to
2491         determine whether a element is a hyperlink that can be dragged.
2492         * page/DragController.h:
2493         * page/EventHandler.cpp:
2494         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Write code in terms of
2495          WebCore::isDraggableLink().
2496         * rendering/HitTestResult.cpp:
2497         (WebCore::HitTestResult::isLiveLink): Deleted.
2498         * rendering/HitTestResult.h:
2499
2500 2015-04-17  Commit Queue  <commit-queue@webkit.org>
2501
2502         Unreviewed, rolling out r182912 and r182920.
2503         https://bugs.webkit.org/show_bug.cgi?id=143881
2504
2505         Build breakage in some configurations (Requested by ap on
2506         #webkit).
2507
2508         Reverted changesets:
2509
2510         "Force mouse events should go through normal mouse event
2511         handling code paths"
2512         https://bugs.webkit.org/show_bug.cgi?id=143749
2513         http://trac.webkit.org/changeset/182912
2514
2515         http://trac.webkit.org/changeset/182920
2516
2517 2015-04-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
2518
2519         Fix review comments for https://bugs.webkit.org/show_bug.cgi?id=143590
2520         following http://trac.webkit.org/changeset/182876.
2521
2522         Reviewed by Daniel Bates.
2523
2524         * ChangeLog:
2525         Fixed typo.
2526         
2527         * style/StyleFontSizeFunctions.cpp:
2528         (WebCore::Style::computedFontSizeFromSpecifiedSize):
2529         Fixed a typo in an enum definition and changed the name of an argument.
2530
2531 2015-04-17  Philippe Normand  <pnormand@igalia.com>
2532
2533         [GStreamer] Silent WebAudio buffers support
2534         https://bugs.webkit.org/show_bug.cgi?id=143869
2535
2536         Reviewed by Carlos Garcia Campos.
2537
2538         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2539         (webKitWebAudioSrcLoop): Set gap flag on silent buffers. The audio
2540         sink can then drop them and avoid un-necessary buffer processing.
2541
2542 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2543
2544         [SOUP] Redirect to non HTTP destination is broken
2545         https://bugs.webkit.org/show_bug.cgi?id=143866
2546
2547         Reviewed by Sergio Villar Senin.
2548
2549         This is because we are passing true unconditionally as
2550         isHTTPFamilyRequest parameter of
2551         createSoupRequestAndMessageForHandle in continueAfterWillSendRequest.
2552         We don't actually need to pass isHTTPFamilyRequest parameter to
2553         createSoupRequestAndMessageForHandle, since it can simply check
2554         that from the given request.
2555
2556         Covered by unit tets and also cache/disk-cache/disk-cache-redirect-to-data.html.
2557
2558         * platform/network/soup/ResourceHandleSoup.cpp:
2559         (WebCore::continueAfterWillSendRequest):
2560         (WebCore::createSoupRequestAndMessageForHandle):
2561         (WebCore::ResourceHandle::start):
2562
2563 2015-04-16  Alex Christensen  <achristensen@webkit.org>
2564
2565         Use less memory when compiling content extensions
2566         https://bugs.webkit.org/show_bug.cgi?id=143857
2567
2568         Reviewed by Benjamin Poulain.
2569
2570         When compiling a content extension, we convert the rule list into several intermediate forms:
2571
2572         1) A String.
2573         2) A JSValue from JSONParse in loadEncodedRules.
2574         3) A Vector of ContentExtensionRules.
2575         4) A CombinedURLFilters object representing the pieces of the regular expressions from the triggers.
2576         5) A Vector of NFAs.
2577         6) A DFA for each NFA.
2578         7) A Vector of DFABytecode.
2579         
2580         Each one of these contains all the information contained in the content extension,
2581         so we do not need to keep them all in memory at the same time like we are doing now.
2582         When we are done with one, we can free that memory to greatly reduce the maximum memory usage while compiling.
2583         The next step will be to reduce the copies of the original JSON String and to generate NFAs one at a time.
2584
2585         * contentextensions/CombinedURLFilters.cpp:
2586         (WebCore::ContentExtensions::CombinedURLFilters::clear):
2587         * contentextensions/CombinedURLFilters.h:
2588         * contentextensions/ContentExtensionCompiler.cpp:
2589         (WebCore::ContentExtensions::compileRuleList):
2590         Clear structures when finished using them.
2591
2592 2015-04-16  Brady Eidson  <beidson@apple.com>
2593
2594         Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
2595         https://bugs.webkit.org/show_bug.cgi?id=143834
2596
2597         Reviewed by Anders Carlsson.
2598
2599         - Add moveFile() for a WK2 call site to use.
2600         - Remove renameFile() as it is now dead code.
2601
2602         * platform/FileSystem.h:
2603
2604         * platform/gtk/FileSystemGtk.cpp:
2605         (WebCore::renameFile): Deleted.
2606
2607         * platform/mac/FileSystemMac.mm:
2608         (WebCore::moveFile):
2609
2610         * platform/posix/FileSystemPOSIX.cpp:
2611         (WebCore::renameFile): Deleted.
2612
2613         * platform/win/FileSystemWin.cpp:
2614         (WebCore::renameFile): Deleted.
2615
2616 2015-04-16  Roger Fong  <roger_fong@apple.com>
2617
2618         Media element time displays shouldn't wrap.
2619         https://bugs.webkit.org/show_bug.cgi?id=143854.
2620         <rdar://problem/20284766>
2621
2622         Reviewed by Brent Fulgham.
2623
2624         * Modules/mediacontrols/mediaControlsApple.css:
2625         (::-webkit-media-controls): Don't wrap any text.
2626         (audio::-webkit-media-controls-time-remaining-display): Also increase remaining time display width by 1.
2627         (audio::-webkit-media-controls-time-remaining-display.five-digit-time): Ditto.
2628         (audio::-webkit-media-controls-time-remaining-display.six-digit-time): Ditto.
2629
2630 2015-04-16  Chris Dumez  <cdumez@apple.com>
2631
2632         Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop() overrides don't fire events
2633         https://bugs.webkit.org/show_bug.cgi?id=143850
2634
2635         Reviewed by Alexey Proskuryakov.
2636
2637         Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop()
2638         overrides don't fire events as this is not allowed. This would cause
2639         arbitrary JS execution which would be very dangerous in these stages.
2640
2641         Firing JS events from these functions is a common source of crashes.
2642
2643         * Modules/websockets/WebSocket.cpp:
2644         (WebCore::WebSocket::suspend):
2645         (WebCore::WebSocket::resume):
2646         * dom/ScriptExecutionContext.cpp:
2647         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
2648         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
2649         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
2650         * xml/XMLHttpRequest.cpp:
2651         (WebCore::XMLHttpRequest::suspend):
2652         (WebCore::XMLHttpRequest::resume):
2653         (WebCore::XMLHttpRequest::stop):
2654
2655 2015-04-16  Brady Eidson  <beidson@apple.com>
2656
2657         Media element can manipulate DOM during Document destruction.
2658         rdar://problem/20553898 and https://bugs.webkit.org/show_bug.cgi?id=143780
2659
2660         Reviewed by Jer Noble.
2661
2662         * html/HTMLMediaElement.cpp:
2663         (WebCore::HTMLMediaElement::configureMediaControls): Bail if the element has no active document.
2664
2665 2015-04-13  Jer Noble  <jer.noble@apple.com>
2666
2667         [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
2668         https://bugs.webkit.org/show_bug.cgi?id=143680
2669
2670         Reviewed by Simon Fraser.
2671
2672         Add getters for the video's fullscreen layer, and be more tolerant about the order in which setVideoElement() and 
2673         setWebVideoFullscreenInterface are called.
2674
2675         * html/HTMLMediaElement.h:
2676         (WebCore::HTMLMediaElement::videoFullscreenLayer): Added simple getter.
2677         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2678         * platform/ios/WebVideoFullscreenModelVideoElement.h:
2679         (WebCore::WebVideoFullscreenModelVideoElement::videoElement): Added simple getter.
2680         (WebCore::WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Deleted. Moved to .mm file.
2681         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2682         (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement): Initialize ivars in the .h file.
2683         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Call those methods skipped in setVideoElement()
2684             if m_videoFullscreenInterface had not yet been set.
2685         (WebVideoFullscreenModelVideoElement::setVideoElement): Null-check m_videoFullscreenInterface.
2686
2687 2015-04-16  Beth Dakin  <bdakin@apple.com>
2688
2689         Force mouse events should go through normal mouse event handling code paths
2690         https://bugs.webkit.org/show_bug.cgi?id=143749
2691         -and corresponding-
2692         rdar://problem/20472895
2693
2694         Reviewed by Dean Jackson.
2695
2696         This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and 
2697         mouseforcechanged into normal mouse event dispatching code. This patch leaves 
2698         behind the cancel and click events because we plan to remove those, and it also 
2699         leaves mouseforcewillbegin because that is necessarily a very different event more 
2700         tied to the NSImmediateActionGestureRecognizer than these other events which are 
2701         tied to NSResponder’s pressureChangeWithEvent.
2702
2703         New helper functions.
2704         * dom/Document.cpp:
2705         (WebCore::Document::hasListenerTypeForEventType):
2706         * dom/Document.h:
2707         * dom/Element.cpp:
2708         (WebCore::isForceEvent):
2709
2710         Move the code to ensure the force events have listeners in order to fire to 
2711         dispatchMouseEvent, and delete the old implementations.
2712         (WebCore::Element::dispatchMouseEvent):
2713         (WebCore::Element::dispatchMouseForceChanged): Deleted.
2714         (WebCore::Element::dispatchMouseForceDown): Deleted.
2715         (WebCore::Element::dispatchMouseForceUp): Deleted.
2716         * dom/Element.h:
2717
2718         Perform a hit test and pipe the events through dispatchMouseEvent(). 
2719         * page/EventHandler.cpp:
2720         (WebCore::EventHandler::handleMouseForceEvent):
2721         * page/EventHandler.h:
2722
2723         New types for the new events.
2724         * platform/PlatformEvent.h:
2725
2726         Forward to EventHandler. 
2727         * replay/UserInputBridge.cpp:
2728         (WebCore::UserInputBridge::handleMouseForceEvent):
2729         * replay/UserInputBridge.h:
2730
2731 2015-04-16  Tim Horton  <timothy_horton@apple.com>
2732
2733         Sites with both width=device-width and height=device-height load zoomed out
2734         https://bugs.webkit.org/show_bug.cgi?id=143795
2735         <rdar://problem/20369671>
2736
2737         Reviewed by Ben Poulain.
2738
2739         * page/ViewportConfiguration.cpp:
2740         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
2741         Some sites specify both width=device-width and height=device-height, and
2742         then lay out to device width but with a large amount of vertically scrollable content
2743         (so, height=device-height was a lie).
2744
2745         In all other cases where we use device-width and device-height, we prefer
2746         width=device-width over height=device-height, but in the code to ignore scaling constraints,
2747         the two paths were completely separate. On sites that specify both, this
2748         resulted in us attempting to zoom out to fit the entire height of the very tall page,
2749         which isn't at all what we wanted. So, ignore height=device-height if a width is specified.
2750
2751 2015-04-16  Chris Dumez  <cdumez@apple.com>
2752
2753         Regression(r182517): WebSocket::suspend() causes error event to be fired
2754         https://bugs.webkit.org/show_bug.cgi?id=143806
2755         <rdar://problem/20559812>
2756
2757         Reviewed by Alexey Proskuryakov.
2758
2759         WebSocket::suspend() causes an error event to be fired after r182517.
2760         This is not allowed as firing the event could trigger arbitrary JS
2761         execution, which is no longer allowed at this point.
2762
2763         This patch delays the error event firing until after
2764         WebSocket::resume() is called, similarly to what we already do for
2765         the close event.
2766
2767         Also add assertions in WebSocket::suspend() / WebSocket::resume()
2768         that will be hit if JS events are fired from within these functions.
2769         The pre-existing closed-when-entering-page-cache.html test is hitting
2770         one of these assertions without the fix above.
2771
2772         Tests:
2773           - http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
2774           - http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html
2775
2776         * Modules/websockets/WebSocket.cpp:
2777         (WebCore::WebSocket::suspend):
2778         (WebCore::WebSocket::resume):
2779         (WebCore::WebSocket::resumeTimerFired):
2780         (WebCore::WebSocket::stop):
2781         (WebCore::WebSocket::didReceiveMessageError):
2782         (WebCore::WebSocket::didClose):
2783         (WebCore::WebSocket::dispatchOrQueueEvent):
2784         * Modules/websockets/WebSocket.h:
2785
2786 2015-04-15  Roger Fong  <roger_fong@apple.com>
2787
2788         Adjustments to button graphics for media controls.
2789         https://bugs.webkit.org/show_bug.cgi?id=143797.
2790         <rdar://problem/20083708>
2791
2792         Reviewed by Dean Jackson.
2793
2794         These changes are visual in nature and mainly affect the buttons.
2795         I've gotten rid of the text-shadow for all the buttons,
2796         used plus-lighter blending mode and changed the button opacity to reflect the specs,
2797         and made all the buttons turn opaque white when active.
2798
2799         * Modules/mediacontrols/mediaControlsApple.css:
2800         (audio::-webkit-media-controls-panel button):
2801         (audio::-webkit-media-controls-rewind-button):
2802         (audio::-webkit-media-controls-play-button):
2803         (audio::-webkit-media-controls-play-button.paused):
2804         (video::-webkit-media-controls-volume-max-button):
2805         (video::-webkit-media-controls-volume-slider):
2806         (video::-webkit-media-controls-volume-min-button):
2807         (audio::-webkit-media-controls-wireless-playback-picker-button):
2808         (audio::-webkit-media-controls-toggle-closed-captions-button):
2809         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
2810         (audio::-webkit-media-controls-fullscreen-button):
2811         (audio::-webkit-media-controls-fullscreen-button.exit):
2812         (audio::-webkit-media-controls-status-display):
2813         (audio::-webkit-media-controls-timeline):
2814         (audio::-webkit-media-controls-time-remaining-display):
2815         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
2816         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
2817         (video:-webkit-full-screen::-webkit-media-controls-play-button):
2818         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
2819         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
2820         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
2821         (video::-webkit-media-controls-volume-max-button:active):
2822         (video::-webkit-media-controls-volume-min-button:active):
2823         (audio::-webkit-media-controls-toggle-closed-captions-button:active):
2824         (audio::-webkit-media-controls-rewind-button:active):
2825         (audio::-webkit-media-controls-play-button:active):
2826         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button:active):
2827         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button:active):
2828         (video:-webkit-full-screen::-webkit-media-controls-play-button:active):
2829         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button:active):
2830         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button:active):
2831         (audio::-webkit-media-controls-fullscreen-button:active):
2832
2833         Using the pseudo id itself here currently does not work, which is why we rely on the button.* selector for these.
2834         (video:-webkit-full-screen::-webkit-media-controls-panel button.paused:active):
2835         (audio::-webkit-media-controls-panel button.paused:active):
2836         (audio::-webkit-media-controls-panel button.exit:active):
2837  
2838         Draw volume slider knob as opaque white when active.
2839         Adjust colors of timeline and volume sliders now that we are using plus-lighter blending.
2840         * Modules/mediacontrols/mediaControlsApple.js:
2841         (Controller):
2842         (Controller.prototype.createControls):
2843         (Controller.prototype.handleVolumeSliderMouseDown):
2844         (Controller.prototype.handleVolumeSliderMouseUp):
2845         (Controller.prototype.drawTimelineBackground):
2846         (Controller.prototype.drawVolumeBackground):
2847
2848 2015-04-15  Simon Fraser  <simon.fraser@apple.com>
2849
2850         Pull emoji-position adjustment code into its own function
2851         https://bugs.webkit.org/show_bug.cgi?id=143592
2852
2853         Reviewed by Myles C. Maxfield.
2854
2855         First step to cleaning up FontCascade::drawGlyphs(). Pull iOS-only code related to
2856         emoji positioning into its own function.
2857
2858         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2859         (WebCore::pointAdjustedForEmoji):
2860         (WebCore::FontCascade::drawGlyphs):
2861
2862 2015-04-16  Myles C. Maxfield  <mmaxfield@apple.com>
2863
2864         [iOS] Delete hardcoded font fallback tables
2865         https://bugs.webkit.org/show_bug.cgi?id=143583
2866
2867         Reviewed by Darin Adler
2868
2869         Instead of hardcoding which font to use for a particular character, use
2870         CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage().
2871
2872         Updated test expected results:
2873             editing/selection/vertical-rl-rtl-extend-line-backward-br.html
2874             editing/selection/vertical-rl-rtl-extend-line-backward-p.html
2875             editing/selection/vertical-rl-rtl-extend-line-forward-br.html
2876             editing/selection/vertical-rl-rtl-extend-line-forward-p.html
2877             fast/text/international/danda-space.html
2878             fast/text/international/thai-baht-space.html
2879
2880         * platform/graphics/ios/FontCacheIOS.mm:
2881         (WebCore::FontCache::getSystemFontFallbackForCharacters):
2882         (WebCore::FontCache::systemFallbackForCharacters):
2883         * platform/spi/cocoa/CoreTextSPI.h:
2884
2885 2015-04-16  Per Arne Vollan  <peavo@outlook.com>
2886
2887         [WinCairo] Compile error when environment variable WEBKITLIBRARIESDIR is not defined.
2888         https://bugs.webkit.org/show_bug.cgi?id=143828
2889
2890         Reviewed by Brent Fulgham.
2891
2892         Python throws an exception when calling os.environ['WEBKITLIBRARIESDIR'] and
2893         WEBKITLIBRARIESDIR is not defined. WEBKITLIBRARIESDIR is obsolete, we can remove it.
2894
2895         * AVFoundationSupport.py:
2896         (lookFor):
2897
2898 2015-04-16  Alexey Proskuryakov  <ap@apple.com>
2899
2900         Minor AudioContext cleanup
2901         https://bugs.webkit.org/show_bug.cgi?id=143816
2902
2903         Reviewed by Jer Noble.
2904
2905         * Modules/webaudio/AudioContext.cpp:
2906         (WebCore::AudioContext::~AudioContext):
2907         (WebCore::AudioContext::lazyInitialize):
2908         (WebCore::AudioContext::stop):
2909         (WebCore::AudioContext::derefNode):
2910         (WebCore::AudioContext::scheduleNodeDeletion):
2911         (WebCore::AudioContext::deleteMarkedNodes):
2912         (WebCore::AudioContext::stopDispatch): Deleted.
2913         (WebCore::AudioContext::deleteMarkedNodesDispatch): Deleted.
2914         * Modules/webaudio/AudioContext.h:
2915
2916         * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::~AudioNode):
2917
2918 2015-04-16  Chris Dumez  <cdumez@apple.com>
2919
2920         Unreviewed attempt to fix Windows build after r182881.
2921
2922         Add missing header include.
2923
2924         * page/PageConsoleClient.h:
2925
2926 2015-04-16  Chris Dumez  <cdumez@apple.com>
2927
2928         Tests introduced in r182877 are flaky
2929         https://bugs.webkit.org/show_bug.cgi?id=143784
2930
2931         Reviewed by Alexey Proskuryakov.
2932
2933         Tests introduced in r182877 are flaky as the line number sometimes
2934         appears in the console messages. This patch updates the console
2935         logging code so that no Document is provided when logging. Therefore,
2936         no line number will ever be displayed. In this case, I don't think
2937         having the line number is terribly useful anyway.
2938
2939         * css/StyleSheetContents.cpp:
2940         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2941
2942 2015-04-15  Simon Fraser  <simon.fraser@apple.com>
2943
2944         We should dump GraphicsLayer's anchorPoint z component
2945         https://bugs.webkit.org/show_bug.cgi?id=143815
2946
2947         Reviewed by Tim Horton.
2948
2949         We didn't include the z component of a layer's anchor point when dumping.
2950         Dump if it's non-zero (to avoid having to change lots of test output).
2951         No test with non-zero z appears to dump layers.
2952
2953         * platform/graphics/GraphicsLayer.cpp:
2954         (WebCore::GraphicsLayer::dumpProperties):
2955         * rendering/style/RenderStyle.cpp:
2956         (WebCore::requireTransformOrigin): Remove a FIXME which, on further consideration,
2957         is wrong.
2958
2959 2015-04-15  Brent Fulgham  <bfulgham@apple.com>
2960
2961         [Mac] Disable "Save to Downloads" option for local files
2962         https://bugs.webkit.org/show_bug.cgi?id=143794
2963
2964         Reviewed by Tim Horton.
2965
2966         Disable the Image and Media download options if the download
2967         target is a local file. We can only download web resources;
2968         anything else is actually a no-op.
2969
2970         * page/ContextMenuController.cpp:
2971         (WebCore::ContextMenuController::checkOrEnableIfNeeded): Disable
2972         menu item if appropriate.
2973
2974 2015-04-15  Chris Dumez  <cdumez@apple.com>
2975
2976         Add a console message when a stylesheet is not parsed due to invalid MIME type
2977         https://bugs.webkit.org/show_bug.cgi?id=143784
2978
2979         Reviewed by Joseph Pecoraro.
2980
2981         After r180020, we no longer have a quirks mode exception for CSS MIME
2982         types. This means that we'll start rejecting stylesheets that were
2983         previously accepted due to this quirk. In this case we log a console
2984         message to help Web developers understand why their stylesheet is being
2985         rejected.
2986
2987         * css/StyleRuleImport.cpp:
2988         (WebCore::StyleRuleImport::setCSSStyleSheet):
2989
2990         * css/StyleSheetContents.cpp:
2991         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2992         - Initialize hasValidMIMEType to true so that it ends up being false
2993           only when canUseSheet(hasValidMIMEType) is called and we've determined
2994           the MIME type is indeed invalid. Otherwise, hasValidMIMEType would
2995           also be false when m_data is null or empty in
2996           CachedCSSStyleSheet::sheetText() and we don't want to display the MIME
2997           type error in this case.
2998         - If hasValidMIMEType is false, display the console message and abort
2999           early. We don't need to execute the rest of the function in this case
3000           as sheetText is a null String and there is no point in trying to parse
3001           it.
3002         - Drop handling of !hasValidMIMEType && !hasSyntacticallyValidCSSHeader()
3003           as this can no longer be reached. This handling no longer makes sense
3004           after r180020 as sheetText() will now always return a null String if
3005           the MIME type is invalid (as we no longer support the CSS MIME type
3006           quirks mode).
3007
3008         * css/StyleSheetContents.h:
3009         * html/HTMLLinkElement.cpp:
3010         (WebCore::HTMLLinkElement::setCSSStyleSheet):
3011
3012 2015-04-15  Said Abou-Hallawa  <said@apple.com>
3013
3014         Minimum font size pref breaks SVG text very badly.
3015         https://bugs.webkit.org/show_bug.cgi?id=143590.
3016
3017         Reviewed by Simon Fraser.
3018
3019         When enabling the minimum font size perf, the computed font size is set
3020         to the minimum font size if the computed value is smaller than the minimum.
3021         The bug happens because the SVG text element applies its scaling on the
3022         computed value after applying the minimum font size rule. This means the
3023         final computed value for the font size will be the scaling of the minimum
3024         font size and not minimum font size itself. What we need is to postpone
3025         applying the minimum font size rules, till the SVG scaling is applied.
3026
3027         Tests: svg/text/font-small-enlarged-minimum-larger.svg
3028                svg/text/font-small-enlarged-minimum-smaller.svg
3029
3030         * rendering/svg/RenderSVGInlineText.cpp:
3031         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle): Call
3032         computedFontSizeFromSpecifiedSizeForSVGInlineText() even if scalingFactor
3033         is 1. We need to make sure the minimum font size rules are applied. This
3034         function was assuming the mininum font size rule was applied when resolving
3035         the style. This is not true anymore for the SVG text.
3036
3037         * style/StyleFontSizeFunctions.cpp:
3038         (WebCore::Style::computedFontSizeFromSpecifiedSize): Do not apply the
3039         minimum size rules for the SVG element until it applies its scaling to
3040         the font size.
3041
3042 2015-04-15  Mark Lam  <mark.lam@apple.com>
3043
3044         Remove obsolete VMInspector debugging tool.
3045         https://bugs.webkit.org/show_bug.cgi?id=143798
3046
3047         Reviewed by Michael Saboff.
3048
3049         No new tests needed.  Just removing obsolete code.
3050
3051         * ForwardingHeaders/interpreter/VMInspector.h: Removed.
3052
3053 2015-04-15  Timothy Horton  <timothy_horton@apple.com>
3054
3055         Custom CSS cursors do not use -webkit-image-set on retina displays
3056         https://bugs.webkit.org/show_bug.cgi?id=120783
3057         <rdar://problem/14921432>
3058
3059         Reviewed by Beth Dakin.
3060         Patch by Evan Wallace <evan.exe@gmail.com>.
3061
3062         Scale NSCursor images correctly so custom CSS cursors work with
3063         -webkit-image-set on retina displays.
3064
3065         * WebCore.exp.in:
3066         * page/EventHandler.cpp:
3067         (WebCore::EventHandler::selectCursor):
3068         * platform/mac/CursorMac.mm:
3069         (WebCore::createCustomCursor):
3070         (WebCore::Cursor::ensurePlatformCursor):
3071
3072 2015-04-15  Alexey Proskuryakov  <ap@apple.com>
3073
3074         No thread safety when passing ThreadableLoaderOptions from a worker thread
3075         https://bugs.webkit.org/show_bug.cgi?id=143790
3076
3077         Reviewed by Geoffrey Garen.
3078
3079         * loader/ThreadableLoader.h:
3080         * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): Added.
3081
3082         * loader/WorkerThreadableLoader.cpp:
3083         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Don't just send
3084         a structure with strings to a different thread, that's bad.
3085
3086         * platform/CrossThreadCopier.h: I think that this is dead code, but for this bug,
3087         just removing a clearly wrong specialization.
3088
3089 2015-04-15  Alex Christensen  <achristensen@webkit.org>
3090
3091         Progress towards CMake on Mac.
3092         https://bugs.webkit.org/show_bug.cgi?id=143785
3093
3094         Reviewed by Csaba Osztrogonác.
3095
3096         * CMakeLists.txt:
3097         * PlatformMac.cmake:
3098
3099 2015-04-15  Daniel Bates  <dabates@apple.com>
3100
3101         Clean up: Have SVGTextLayoutEngine::beginTextPathLayout() take a reference to a
3102         RenderSVGTextPath instead of a pointer
3103         https://bugs.webkit.org/show_bug.cgi?id=143787
3104
3105         Reviewed by Andreas Kling.
3106
3107         SVGTextLayoutEngine::beginTextPathLayout() assumes that the passed RenderObject is a
3108         non-null pointer to a RenderSVGTextPath object. Instead we should have this function take a
3109         reference to a RenderSVGTextPath object to help callers catch bad usage and better document
3110         the expectation of a valid RenderSVGTextPath object.
3111
3112         * rendering/svg/SVGRootInlineBox.cpp:
3113         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Downcast the renderer of the
3114         inline box to a RenderSVGTextPath object and pass it to SVGTextLayoutEngine::beginTextPathLayout().
3115         We ensured that this cast is safe earlier in this function.
3116         SVGTextLayoutEngine::beginTextPathLayout().
3117         * rendering/svg/SVGTextLayoutEngine.cpp:
3118         (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Change type of first parameter from
3119         RenderObject* to RenderSVGTextPath. Remove ASSERT() that was checking for a non-null
3120         RenderObject pointer since we are passing the renderer by reference and a well-formed
3121         reference must refer to a valid object.
3122         * rendering/svg/SVGTextLayoutEngine.h: Substitute RenderSVGTextPath& for RenderObject*.
3123
3124 2015-04-13  Jer Noble  <jer.noble@apple.com>
3125
3126         [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
3127         https://bugs.webkit.org/show_bug.cgi?id=143674
3128
3129         Reviewed by Darin Adler.
3130
3131         * html/HTMLMediaElement.cpp:
3132         (WebCore::HTMLMediaElement::enterFullscreen): Pass a reference.
3133         (WebCore::HTMLMediaElement::exitFullscreen): exitVideoFullscreen() -> exitVideoFullscreenForVideoElement(...).
3134         * page/ChromeClient.h:
3135
3136 2015-04-14  Anders Carlsson  <andersca@apple.com>
3137
3138         Make creating send rights from shared memory more robust
3139         https://bugs.webkit.org/show_bug.cgi?id=143730
3140         rdar://problem/16595870
3141
3142         Reviewed by Darin Adler.
3143
3144         Add a bool conversion operator to MachSendRight and tidy up the default constructor.
3145
3146         * platform/cocoa/MachSendRight.h:
3147         (WebCore::MachSendRight::operator bool):
3148         (WebCore::MachSendRight::MachSendRight): Deleted.
3149
3150 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
3151
3152         Generalize "isPlayingAudio" to include other media characteristics
3153         https://bugs.webkit.org/show_bug.cgi?id=143713
3154
3155         Reviewed by Jer Noble.
3156
3157         No new functionality.
3158
3159         * Modules/webaudio/AudioContext.cpp:
3160         (WebCore::AudioContext::stop): updateIsPlayingAudio -> updateIsPlayingMedia.
3161         (WebCore::AudioContext::isPlayingAudioDidChange): Ditto.
3162
3163         * dom/Document.cpp:
3164         (WebCore::Document::addAudioProducer): Ditto.
3165         (WebCore::Document::removeAudioProducer): Ditto.
3166         (WebCore::Document::updateIsPlayingMedia): Renamed.
3167         (WebCore::Document::updateIsPlayingAudio): Deleted.
3168         * dom/Document.h:
3169
3170         * html/HTMLMediaElement.cpp:
3171         (WebCore::HTMLMediaElement::setMuted): updateIsPlayingAudio -> updateIsPlayingMedia.
3172         (WebCore::HTMLMediaElement::setPlaying): Ditto.
3173
3174         * page/ChromeClient.h:
3175         * page/Page.cpp:
3176         (WebCore::Page::updateIsPlayingMedia): Renamed.
3177         (WebCore::Page::updateIsPlayingAudio): Deleted.
3178         * page/Page.h:
3179
3180 2015-04-15  Joonghun Park  <jh718.park@samsung.com>
3181
3182         Fix Debug build error 'comparison of unsigned expression >= 0 is always true [-Werror=type-limits]'
3183         https://bugs.webkit.org/show_bug.cgi?id=143751
3184
3185         Reviewed by Csaba Osztrogonác.
3186
3187         No new tests, no new behaviors.
3188
3189         * rendering/svg/SVGTextChunk.cpp:
3190         (WebCore::SVGTextChunk::SVGTextChunk):
3191
3192 2015-04-14  Zalan Bujtas  <zalan@apple.com>
3193
3194         Make inline continuation style change logic consistent.
3195         https://bugs.webkit.org/show_bug.cgi?id=143737
3196         rdar://problem/20486596
3197
3198         Reviewed by Simon Fraser.
3199
3200         Do not force RenderBlock type-casting on the first sibling of the continuation's container.
3201         The first sibling of the container of a continuation should be handled as the rest of the siblings.
3202
3203         Test: fast/inline/inline-with-column-span-and-remove-block-child-crash.html
3204
3205         * rendering/RenderInline.cpp:
3206         (WebCore::updateStyleOfAnonymousBlockContinuations):
3207         (WebCore::RenderInline::styleDidChange):
3208
3209 2015-04-14  Chris Dumez  <cdumez@apple.com>
3210
3211         Regression(r180020): Web Inspector crashes on pages that have a stylesheet with an invalid MIME type
3212         https://bugs.webkit.org/show_bug.cgi?id=143745
3213         <rdar://problem/20243916>
3214
3215         Reviewed by Joseph Pecoraro.
3216
3217         After r180020, we are stricter and no longer accept CSS resources that
3218         are not served with a CSS MIME type. Showing Web inspector on a page
3219         with such bad resource would crash because
3220         InspectorPageAgent::cachedResourceContent() would return true but
3221         the result String would be null. This null String would then later
3222         be passed to the Yarr interpreter and crash on a String::is8Bit()
3223         call.
3224
3225         cachedResourceContent() calls CachedCSSStyleSheet::sheetText(). Before
3226         r180020, it would return the text, even if the MIME type was incorrect.
3227         However, this is no longer the case and we now need to make sure that
3228         cachedResourceContent() returns false if sheetText() returns a null
3229         String.
3230
3231         Test: http/tests/inspector/css/bad-mime-type.html
3232
3233         * inspector/InspectorPageAgent.cpp:
3234         (WebCore::InspectorPageAgent::cachedResourceContent):
3235
3236 2015-04-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3237
3238         textPath layout performance improvement.
3239         https://bugs.webkit.org/show_bug.cgi?id=141570.
3240
3241         Reviewed by Darin Adler.
3242
3243         The bottleneck of the text-on-path performance is the position and angle
3244         calculations for every single character. If the number of characters is
3245         'n' and the number of path elements is 'm', the total number of processing
3246         the path elements is O(2 x n x m). What makes it really worse is, for every
3247         curve we keep splitting the curve till the split curve is almost a straight
3248         line. The changes we need to do are:
3249         1. Merge the position and the angle traversals in one pass since they are
3250            returning info for the same length on the path. There is a degenerate
3251            case for the starting point when calculating the angle. The original
3252            code was solving this problem by passing an epsilon instead of zero but
3253            because traversing the path for position and angle are now merged, we
3254            will pass zero for the starting point as is. All we need is to move one
3255            step ahead without moving the position. We need the extra step forward
3256            to calculate the slope of the path at the starting point.
3257         2. We need to add a new mode to traversing a path. The new mode will take
3258            a vector of lengths and returns a vector of arrow vectors. Every arrow
3259            vector represents a position and an angle on the path at a certain length.
3260            This requires changing the SVGTextLayoutEngine to calculate the lengths
3261            of the characters on the curve first and then passing all of them to the
3262            path traversal function. Instead of traversing the path for every length,
3263            we are going to get the required point and angle from the vector of arrow
3264            vectors.
3265
3266         This patch is addressing the first fix only. The second one will require
3267         refactoring the SVGTextLayoutEngine so I am going to address it in a
3268         different patch.
3269
3270         * platform/graphics/Path.cpp:
3271         (WebCore::pathLengthApplierFunction): It is cleaner to move the function
3272         of this method to PathTraversalState::processPathElement().
3273         
3274         (WebCore::Path::length): Use new enum Action value and access methods.
3275         
3276         (WebCore::Path::traversalStateAtLength): New function which returns the
3277         traversalState at a certain length on a path.
3278         
3279         (WebCore::Path::pointAtLength):
3280         (WebCore::Path::normalAngleAtLength): Use traversalStateAtLength() to get
3281         the traversalState and from it return either the position or the angle.
3282         
3283         * platform/graphics/Path.h: Define traversalStateAtLength().
3284         
3285         * platform/graphics/PathTraversalState.cpp:
3286         (WebCore::distanceLine): Code clean up.
3287         
3288         (WebCore::curveLength): Make the setting of m_previous and m_current happens
3289         only in this function.
3290         
3291         (WebCore::PathTraversalState::PathTraversalState): Add an optional parameter
3292         for the desired length and move the initialization of the other members to
3293         the class definition.
3294         
3295         (WebCore::PathTraversalState::closeSubpath):
3296         (WebCore::PathTraversalState::moveTo):
3297         (WebCore::PathTraversalState::lineTo): Add the distance to the m_totalLength
3298         instead of returning it since this is what all the callers were doing.
3299         
3300         (WebCore::PathTraversalState::quadraticBezierTo):
3301         (WebCore::PathTraversalState::cubicBezierTo): Add the distance to the
3302         m_totalLength. Move the setting of m_previous and m_current to curveLength().
3303         Remove unused members m_control1 and m_control2.
3304
3305         (WebCore::PathTraversalState::processSegment): Deleted.        
3306         (WebCore::PathTraversalState::finalizeAppendPathElement): Create a new
3307         name for the function. Handle the case of the angle at the starting point
3308         where m_desiredLength is set to zero. The new flag m_isZeroVector will be
3309         set to notify the caller that the  next iteration will be the last one and
3310         it is only needed for the calculating the angle of a zero vector. m_current
3311         should not change by this last iteration.
3312         
3313         (WebCore::PathTraversalState::appendPathElement): This code is moved from
3314         pathLengthApplierFunction().
3315         
3316         (WebCore::PathTraversalState::processPathElement): This function is used
3317         by the class Path. It is a wrapper for appendPathElement(). If m_isZeroVector
3318         is set we append the new element to a copy for the PathTraversalState just
3319         to get the angle for the zero vector.
3320
3321         * platform/graphics/PathTraversalState.h: Change the enum values to not
3322         not include the class or the enum class. Make the data members private and
3323         expose the needed ones through access methods. Make all the internal methods
3324         to be private.
3325         
3326         (WebCore::PathTraversalState::processPathElement):  Another wrapper for
3327         appendPathElement() which is used by SVGPathTraversalStateBuilder.
3328         
3329         (WebCore::PathTraversalState::action):
3330         (WebCore::PathTraversalState::setAction):
3331         (WebCore::PathTraversalState::desiredLength):
3332         (WebCore::PathTraversalState::setDesiredLength):
3333         (WebCore::PathTraversalState::success):
3334         (WebCore::PathTraversalState::totalLength):
3335         (WebCore::PathTraversalState::current):
3336         (WebCore::PathTraversalState::normalAngle): New access methods which are now
3337         needed after making the data members private.
3338         
3339         * rendering/svg/SVGRootInlineBox.cpp:
3340         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Make the casting
3341         of the renderer on the caller side.
3342         
3343         * rendering/svg/SVGTextChunk.cpp:
3344         (WebCore::SVGTextChunk::SVGTextChunk): The constructor should append the
3345         elements of m_boxes instead of making this from outside the class.
3346         
3347         (WebCore::SVGTextChunk::totalCharacters):
3348         (WebCore::SVGTextChunk::totalLength):
3349         (WebCore::SVGTextChunk::calculateLength): Deleted.
3350         Replace calculateLength() by totalCharacters() and totalLength() to make
3351         the interface cleaner.
3352         
3353         (WebCore::SVGTextChunk::totalAnchorShift):
3354         (WebCore::SVGTextChunk::calculateTextAnchorShift): Deleted.
3355         Rename the function name.
3356         
3357         (WebCore::SVGTextChunk::layout):
3358         (WebCore::SVGTextChunk::processTextLengthSpacingCorrection):
3359         (WebCore::SVGTextChunk::buildBoxTransformations):
3360         (WebCore::SVGTextChunk::boxSpacingAndGlyphsTransform):
3361         (WebCore::SVGTextChunk::processTextAnchorCorrection):
3362         Move the chunk layout code from SVGTextChunkBuilder::layoutTextChunks()
3363         to the SVGTextChunk::layout(). Move all the helper functions as well.
3364         
3365         * rendering/svg/SVGTextChunk.h:
3366         (WebCore::SVGTextChunk::hasTextAnchor):
3367         (WebCore::SVGTextChunk::boxes): Deleted.
3368         Add the new methods and change most of the public methods to be private.
3369         
3370         * rendering/svg/SVGTextChunkBuilder.cpp:
3371         (WebCore::SVGTextChunkBuilder::totalCharacters):
3372         (WebCore::SVGTextChunkBuilder::totalLength):
3373         (WebCore::SVGTextChunkBuilder::totalAnchorShift): This code is moved from
3374         SVGTextLayoutEngine. It scans the boxes stored in the SVGTextChunkBuilder
3375         and sums up the total values.
3376         
3377         (WebCore::SVGTextChunkBuilder::transformationForTextBox):
3378         (WebCore::SVGTextChunkBuilder::buildTextChunks):
3379         (WebCore::SVGTextChunkBuilder::layoutTextChunks): Code clean up.
3380         
3381         (WebCore::SVGTextChunkBuilder::addTextChunk): Deleted.
3382         (WebCore::SVGTextChunkBuilder::processTextChunk): Deleted.
3383         (WebCore::SVGTextChunkBuilder::processTextLengthSpacingCorrection): Deleted.
3384         (WebCore::SVGTextChunkBuilder::processTextAnchorCorrection): Deleted.
3385         (WebCore::SVGTextChunkBuilder::buildSpacingAndGlyphsTransform): Deleted.
3386         This code now lives in SVGTextChunk.
3387         
3388         * rendering/svg/SVGTextChunkBuilder.h: Add new methods for code which was
3389         moved from SVGTextLayoutEngine and remove methods for code which was removed
3390         to SVGTextChunk.
3391         
3392         * rendering/svg/SVGTextLayoutEngine.cpp:
3393         (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Use the sum up methods
3394         from SVGTextChunkBuilder instead of looping through the chunks. Also get a
3395         clean order for defining variables and doing the calculations.
3396         
3397         (WebCore::SVGTextLayoutEngine::finalizeTransformMatrices): Code clean up.
3398         
3399         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Do a single path
3400         traversal to get the position and the angle for a length on a path.
3401         
3402         * svg/SVGAnimateMotionElement.cpp:
3403         (WebCore::SVGAnimateMotionElement::buildTransformForProgress): Do a single
3404         path traversal to get the position and the angle at a length on a path.
3405         
3406         * svg/SVGPathTraversalStateBuilder.cpp:
3407         (WebCore::SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder):
3408         (WebCore::SVGPathTraversalStateBuilder::moveTo):
3409         (WebCore::SVGPathTraversalStateBuilder::lineTo):
3410         (WebCore::SVGPathTraversalStateBuilder::curveToCubic):
3411         (WebCore::SVGPathTraversalStateBuilder::closePath):
3412         (WebCore::SVGPathTraversalStateBuilder::setDesiredLength):
3413         (WebCore::SVGPathTraversalStateBuilder::continueConsuming):
3414         (WebCore::SVGPathTraversalStateBuilder::totalLength):
3415         (WebCore::SVGPathTraversalStateBuilder::currentPoint):
3416         (WebCore::SVGPathTraversalStateBuilder::incrementPathSegmentCount): Deleted.
3417         (WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex): Deleted.
3418         * svg/SVGPathTraversalStateBuilder.h:
3419         (WebCore