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