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