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