Synchronous XMLHttpRequest should get access to AppCache resources stored as flat...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2
3         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
4         https://bugs.webkit.org/show_bug.cgi?id=143711
5
6         Reviewed by Darin Adler.
7
8         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
9         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
10         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
11
12         Test: http/tests/appcache/simple-video-sync.html
13
14         * html/HTMLMediaElement.cpp:
15         (WebCore::HTMLMediaElement::parseAttribute):
16         * loader/DocumentThreadableLoader.cpp:
17         (WebCore::DocumentThreadableLoader::loadRequest):
18         * loader/FrameLoader.cpp:
19         (WebCore::FrameLoader::loadResourceSynchronously):
20         * loader/FrameLoader.h:
21         * loader/appcache/ApplicationCacheHost.cpp:
22         (WebCore::ApplicationCacheHost::maybeLoadResource):
23         (WebCore::ApplicationCacheHost::createFileURL):
24         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
25         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
26         * loader/appcache/ApplicationCacheHost.h:
27         * xml/XSLTProcessorLibxslt.cpp:
28         (WebCore::docLoaderFunc):
29         * xml/parser/XMLDocumentParserLibxml2.cpp:
30         (WebCore::openFunc):
31
32 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
33
34         Purge PassRefPtr from createSVGPathSegFoo factory functions
35         https://bugs.webkit.org/show_bug.cgi?id=144374
36
37         Reviewed by Darin Adler.
38
39         Use Ref instead of PassRefPtr in createSVGPathSegFoo functions because
40         those factory functions can't return null. Additionally let's remove unnecessary
41         #include<PassRefPtr.h> there.
42
43         No new tests, no behavior changes.
44
45         * svg/SVGColor.cpp:
46         (WebCore::SVGColor::cloneForCSSOM):
47         * svg/SVGColor.h:
48         * svg/SVGGlyphMap.h:
49         (WebCore::GlyphMapNode::create):
50         * svg/SVGPaint.cpp:
51         (WebCore::SVGPaint::cloneForCSSOM):
52         * svg/SVGPaint.h:
53         * svg/SVGPathElement.cpp:
54         (WebCore::SVGPathElement::createSVGPathSegClosePath):
55         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
56         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
57         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
58         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
59         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
60         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
61         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
62         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
63         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
64         (WebCore::SVGPathElement::createSVGPathSegArcRel):
65         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
66         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
67         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
68         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
69         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
70         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
71         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
72         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
73         * svg/SVGPathElement.h:
74         * svg/SVGPathSegArcAbs.h:
75         (WebCore::SVGPathSegArcAbs::create):
76         * svg/SVGPathSegArcRel.h:
77         (WebCore::SVGPathSegArcRel::create):
78         * svg/SVGPathSegClosePath.h:
79         (WebCore::SVGPathSegClosePath::create):
80         * svg/SVGPathSegCurvetoCubicAbs.h:
81         (WebCore::SVGPathSegCurvetoCubicAbs::create):
82         * svg/SVGPathSegCurvetoCubicRel.h:
83         (WebCore::SVGPathSegCurvetoCubicRel::create):
84         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
85         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
86         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
87         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
88         * svg/SVGPathSegCurvetoQuadraticAbs.h:
89         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
90         * svg/SVGPathSegCurvetoQuadraticRel.h:
91         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
92         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
93         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
94         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
95         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
96         * svg/SVGPathSegLinetoAbs.h:
97         (WebCore::SVGPathSegLinetoAbs::create):
98         * svg/SVGPathSegLinetoHorizontalAbs.h:
99         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
100         * svg/SVGPathSegLinetoHorizontalRel.h:
101         (WebCore::SVGPathSegLinetoHorizontalRel::create):
102         * svg/SVGPathSegLinetoRel.h:
103         (WebCore::SVGPathSegLinetoRel::create):
104         * svg/SVGPathSegLinetoVerticalAbs.h:
105         (WebCore::SVGPathSegLinetoVerticalAbs::create):
106         * svg/SVGPathSegLinetoVerticalRel.h:
107         (WebCore::SVGPathSegLinetoVerticalRel::create):
108         * svg/SVGPathSegMovetoAbs.h:
109         (WebCore::SVGPathSegMovetoAbs::create):
110         * svg/SVGPathSegMovetoRel.h:
111         (WebCore::SVGPathSegMovetoRel::create):
112         * svg/SVGViewSpec.h:
113         (WebCore::SVGViewSpec::create):
114         * svg/animation/SMILTimeContainer.h:
115         (WebCore::SMILTimeContainer::create):
116         * svg/animation/SVGSMILElement.cpp:
117         (WebCore::ConditionEventListener::create):
118         * svg/graphics/SVGImage.h:
119         * svg/graphics/SVGImageForContainer.h:
120         * svg/graphics/filters/SVGFilter.cpp:
121         (WebCore::SVGFilter::create):
122         * svg/graphics/filters/SVGFilter.h:
123
124 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
125
126         Make a non-static version of FrameView::yPositionForRootContentLayer()
127         https://bugs.webkit.org/show_bug.cgi?id=144375
128
129         Reviewed by Andy Estes.
130
131         There were two calls to the static FrameView::yPositionForRootContentLayer()
132         which passed in all the arguments for the same FrameView. Make a member
133         function for convenience.
134
135         * page/FrameView.cpp:
136         (WebCore::FrameView::yPositionForRootContentLayer):
137         * page/FrameView.h:
138         * rendering/RenderLayerCompositor.cpp:
139         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
140
141 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
142
143         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
144         https://bugs.webkit.org/show_bug.cgi?id=143001
145
146         Reviewed by Gyuyoung Kim.
147
148         TiledBackingStore has only been used by Coordinated Graphics since Qt and WebKit1/Efl were dropped.
149         So, this patch replaces USE(TILED_BACKING_STORE) with USE(COORDINATED_GRAPHICS) to merge the features.
150
151         In addition, this moves TiledBackingStore and related files from platform to platform/texmap/coordinated
152         where other coordinated graphics files are located.
153
154         * CMakeLists.txt: Move TiledBackingStore.cpp because this is not common file.
155         * PlatformEfl.cmake:
156         * PlatformGTK.cmake:
157         * WebCore.vcxproj/WebCore.vcxproj: Follow new location of TiledBackingStore* files.
158         * WebCore.vcxproj/WebCore.vcxproj.filters:
159         * loader/EmptyClients.h:
160         * page/Chrome.cpp:
161         * page/Chrome.h:
162         * page/ChromeClient.h:
163         * page/Frame.cpp:
164         (WebCore::Frame::createView):
165         * page/FrameView.cpp:
166         (WebCore::FrameView::requestScrollPositionUpdate):
167         * page/FrameView.h:
168         * page/Page.cpp:
169         (WebCore::Page::setPageScaleFactor):
170         * platform/HostWindow.h:
171         * platform/ScrollView.cpp:
172         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
173         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):
174         (WebCore::ScrollView::visibleContentRectInternal):
175         (WebCore::ScrollView::scrollTo):
176         * platform/ScrollView.h:
177         * platform/graphics/cairo/TileCairo.h: Removed because it is dead code since r169328
178         * platform/graphics/texmap/coordinated/Tile.h: Renamed from Source/WebCore/platform/graphics/Tile.h.
179         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.cpp.
180         * platform/graphics/texmap/coordinated/TiledBackingStore.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.h.
181         * platform/graphics/texmap/coordinated/TiledBackingStoreBackend.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreBackend.h.
182         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreClient.h.
183
184 2015-04-28  Brent Fulgham  <bfulgham@apple.com>
185
186         REGRESSION(180076): [Mac, iOS] Correct possible null dereference in printing code
187         https://bugs.webkit.org/show_bug.cgi?id=144366
188         <rdar://problem/20533513>
189
190         Reviewed by Dean Jackson.
191
192         * rendering/RenderBlockFlow.cpp:
193         (WebCore::needsAppleMailPaginationQuirk): Check if the document settings is a nullptr
194         before attempting to dereference it. 
195
196 2015-04-28  Andreas Kling  <akling@apple.com>
197
198         Simplify DOM wrapper destruction, don't deref() in finalizers.
199         <https://webkit.org/b/144183>
200
201         Reviewed by Darin Adler.
202
203         DOM JS bindings had two mechanisms to call deref() on the WebCore object,
204         once through a weak finalizer, and once through the JSCell's regular destructor.
205
206         That was once believed to be an optimization, but these days the finalizer will
207         run just moments before the destructor anyway, all in the same call stack.
208         And more importantly, the finalizer is not guaranteed to run, for instance in the
209         case where a Weak is assigned to after going dead, but before the WeakBlock
210         has been swept by the incremental sweeper.
211
212         Simplify this by just removing the deref() from the generated finalizers.
213         This makes it easier to reason about DOM wrapper destruction, and eliminates
214         the awkward time window  where a DOM wrapper could have a null impl().
215
216         We could spend more time on figuring out a way to have finalizers manage the
217         destruction of these wrappers, but that would require fundamental changes to
218         our implementation of JSC::Weak pointers. It would allow us to make JSDOMWrapper
219         destructor-less, and shrink each wrapper object by 1 pointer (the ClassInfo*.)
220         However the risk:reward ratio does not seem justified at this point in time.
221
222         * bindings/scripts/CodeGeneratorJS.pm:
223         (GenerateHeader):
224         (GenerateImplementation):
225         * bindings/js/JSCSSValueCustom.cpp:
226         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
227         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
228         (WebCore::JSTestActiveDOMObjectOwner::finalize):
229         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
230         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
231         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
232         (WebCore::JSTestCustomNamedGetterOwner::finalize):
233         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
234         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
235         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
236         (WebCore::JSTestEventConstructorOwner::finalize):
237         * bindings/scripts/test/JS/JSTestEventConstructor.h:
238         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
239         (WebCore::JSTestEventTarget::~JSTestEventTarget):
240         (WebCore::JSTestEventTargetOwner::finalize):
241         * bindings/scripts/test/JS/JSTestEventTarget.h:
242         * bindings/scripts/test/JS/JSTestException.cpp:
243         (WebCore::JSTestException::~JSTestException):
244         (WebCore::JSTestExceptionOwner::finalize):
245         * bindings/scripts/test/JS/JSTestException.h:
246         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
247         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
248         (WebCore::JSTestGenerateIsReachableOwner::finalize):
249         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
250         * bindings/scripts/test/JS/JSTestInterface.cpp:
251         (WebCore::JSTestInterface::~JSTestInterface):
252         (WebCore::JSTestInterfaceOwner::finalize):
253         * bindings/scripts/test/JS/JSTestInterface.h:
254         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
255         (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
256         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
257         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
258         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
259         (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
260         (WebCore::JSTestNamedConstructorOwner::finalize):
261         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
262         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
263         (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
264         (WebCore::JSTestNondeterministicOwner::finalize):
265         * bindings/scripts/test/JS/JSTestNondeterministic.h:
266         * bindings/scripts/test/JS/JSTestObj.cpp:
267         (WebCore::JSTestObj::~JSTestObj):
268         (WebCore::JSTestObjOwner::finalize):
269         * bindings/scripts/test/JS/JSTestObj.h:
270         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
271         (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
272         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
273         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
274         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
275         (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
276         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
277         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
278         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
279         (WebCore::JSTestTypedefs::~JSTestTypedefs):
280         (WebCore::JSTestTypedefsOwner::finalize):
281         * bindings/scripts/test/JS/JSTestTypedefs.h:
282         * bindings/scripts/test/JS/JSattribute.cpp:
283         (WebCore::JSattribute::~JSattribute):
284         (WebCore::JSattributeOwner::finalize):
285         * bindings/scripts/test/JS/JSattribute.h:
286         * bindings/scripts/test/JS/JSreadonly.cpp:
287         (WebCore::JSreadonly::~JSreadonly):
288         (WebCore::JSreadonlyOwner::finalize):
289         * bindings/scripts/test/JS/JSreadonly.h:
290
291 2015-04-28  Alex Christensen  <achristensen@webkit.org>
292
293         Build WinCairo without cygwin.
294         https://bugs.webkit.org/show_bug.cgi?id=144365
295
296         Reviewed by Myles Maxfield.
297
298         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
299         Pass the CC executable to build-generated-files.pl like r182164.
300         * WebCore.vcxproj/build-generated-files.pl:
301         Default to 8 CPUs unless otherwise specified.
302
303 2015-04-28  Sam Weinig  <sam@webkit.org>
304
305         [Content Extensions] Process NFAs individually to avoid having all NFAs live at the same time
306         https://bugs.webkit.org/show_bug.cgi?id=144363
307
308         Reviewed by Alex Christensen.
309
310         This brings dirty memory use when compiling our test content extension down from ~300MB to ~100MB.
311
312         * contentextensions/CombinedURLFilters.cpp:
313         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
314         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs): Deleted.
315         * contentextensions/CombinedURLFilters.h:
316         Replace function that creates a Vector of all the NFAs with one that allows incremental processing
317         as they are created.
318
319         * contentextensions/ContentExtensionCompiler.cpp:
320         (WebCore::ContentExtensions::addUniversalActionsToDFA):
321         Extract code to add universal actions into a helper, since we need to call it in two places now.
322
323         (WebCore::ContentExtensions::compileRuleList):
324         Adopt CombinedURLFilters::processNFAs. Now that we don't have a Vector of NFAs, we need to keep track
325         of whether or not any NFAs were processed and if we are currently processing the first NFA so we can
326         ensure that we have some bytecode generated event for empty rule sets, and that universal actions are
327         placed on the first DFA.
328
329 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
330
331         [TextIndicator] Yellow highlight takes too long to fade out on scroll
332         https://bugs.webkit.org/show_bug.cgi?id=144358
333         <rdar://problem/19451011>
334
335         Reviewed by Beth Dakin.
336
337         * page/TextIndicator.h:
338         Add Lifetime and DismissalAnimation enums.
339
340         (WebCore::TextIndicator::contentImageWithHighlight):
341         (WebCore::TextIndicator::contentImage):
342         Fix style.
343
344         * page/mac/TextIndicatorWindow.h:
345         * page/mac/TextIndicatorWindow.mm:
346         (WebCore::TextIndicatorWindow::TextIndicatorWindow):
347         (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
348         (WebCore::TextIndicatorWindow::clearTextIndicator):
349         (WebCore::TextIndicatorWindow::setTextIndicator):
350         (WebCore::TextIndicatorWindow::closeWindow):
351         (WebCore::TextIndicatorWindow::startFadeOut):
352         Rename m_startFadeOutTimer to m_temporaryTextIndicatorTimer (and related).
353         This is just about temporary-lifetime TextIndicators, like the ones
354         you get when the find-in-page UI is hidden but you hit Cmd-G.
355
356         Add clearTextIndicator, which takes a DismissalAnimation, providing
357         clients an opportunity to avoid the normal fade-out animation, if it
358         was going to happen.
359
360 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
361
362         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
363         https://bugs.webkit.org/show_bug.cgi?id=144304
364
365         Reviewed by Geoffrey Garen.
366
367         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
368
369         * Configurations/FeatureDefines.xcconfig:
370
371 2015-04-28  Commit Queue  <commit-queue@webkit.org>
372
373         Unreviewed, rolling out r183514.
374         https://bugs.webkit.org/show_bug.cgi?id=144359
375
376         It broke cloop test bots (Requested by mcatanzaro on #webkit).
377
378         Reverted changeset:
379
380         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
381         https://bugs.webkit.org/show_bug.cgi?id=144304
382         http://trac.webkit.org/changeset/183514
383
384 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
385
386         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
387         https://bugs.webkit.org/show_bug.cgi?id=144304
388
389         Reviewed by Geoffrey Garen.
390
391         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
392
393         * Configurations/FeatureDefines.xcconfig:
394
395 2015-04-28  Zalan Bujtas  <zalan@apple.com>
396
397         Checkboxes on bugs.webkit.org are painted with stripes at some zoom levels.
398         https://bugs.webkit.org/show_bug.cgi?id=144351
399
400         Reviewed by Simon Fraser.
401
402         This patch ensures that CG context is properly restored after painting dashed/dotted lines.
403
404         Test: fast/forms/checkbox-painting-with-hr.html
405
406         * platform/graphics/cg/GraphicsContextCG.cpp:
407         (WebCore::GraphicsContext::drawLine):
408
409 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
410
411         Provide contentsToView() and viewToContents() functions on ScrollView, and use them
412         https://bugs.webkit.org/show_bug.cgi?id=144357
413
414         Reviewed by Tim Horton.
415
416         Too much code was consulting topContentInset() and headerHeight() directly. Replace
417         with calls to new contentsToView() and viewToContents() functions, which wrap the
418         exisiting documentScrollOffsetRelativeToViewOrigin().
419         
420         Use the new functions in FrameView and ScrollView coordinate mapping functions.
421         
422         No behavior change.
423
424         * page/FrameView.cpp:
425         (WebCore::FrameView::convertFromRendererToContainingView):
426         (WebCore::FrameView::convertFromContainingViewToRenderer):
427         * platform/ScrollView.cpp:
428         (WebCore::ScrollView::viewToContents):
429         (WebCore::ScrollView::contentsToView):
430         (WebCore::ScrollView::rootViewToContents):
431         (WebCore::ScrollView::contentsToRootView):
432         (WebCore::ScrollView::rootViewToTotalContents):
433         (WebCore::ScrollView::windowToContents):
434         (WebCore::ScrollView::contentsToWindow):
435         * platform/ScrollView.h:
436
437 2015-04-28  Eric Carlson  <eric.carlson@apple.com>
438
439         [Mac] Simplify code to support media engines which do not support target playback
440         https://bugs.webkit.org/show_bug.cgi?id=144332
441
442         Reviewed by Jer Noble.
443
444         * Modules/mediasession/WebMediaSessionManager.cpp:
445         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): Always make client
446         callback, let them decide if it is significant or not.
447
448         * html/HTMLMediaElement.cpp:
449         (WebCore::HTMLMediaElement::HTMLMediaElement): m_loadTimer -> m_pendingActionTimer.
450         (WebCore::HTMLMediaElement::scheduleDelayedAction): Handle CheckPlaybackTargetCompatablity.
451         (WebCore::HTMLMediaElement::scheduleNextSourceChild): m_loadTimer -> m_pendingActionTimer.
452         (WebCore::HTMLMediaElement::loadTimerFired): Renamed pendingActionTimerFired.
453         (WebCore::HTMLMediaElement::prepareForLoad): m_loadTimer -> m_pendingActionTimer.
454         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Add logging.
455         (WebCore::HTMLMediaElement::clearMediaPlayer): m_loadTimer -> m_pendingActionTimer.
456         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): Removed.
457         (WebCore::HTMLMediaElement::dispatchEvent): If a 'webkitcurrentplaybacktargetiswirelesschanged'
458         event is dispatched when the current target is wireless but the media engine does not support
459         wireless playback, tell the media engine not to play to the target.
460         * html/HTMLMediaElement.h:
461         * html/HTMLMediaElement.idl:
462
463         * html/HTMLMediaSession.cpp:
464         (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Drive-by fix to disallow audio-only files.
465         (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): Deleted.
466         * html/HTMLMediaSession.h:
467
468         * platform/graphics/MediaPlayer.cpp:
469         (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): Deleted.
470         * platform/graphics/MediaPlayer.h:
471         * platform/graphics/MediaPlayerPrivate.h:
472
473         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
474         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Use a RetainPtr
475         to explicitly manage the lifetime of the temporary object.
476         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): Ditto.
477         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
478
479         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
480         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
481         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless):
482         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): Deleted.
483
484         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
485         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
486         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
487         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetWireless):
488         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Deleted.
489
490 2015-04-28  Alex Christensen  <achristensen@webkit.org>
491
492         [Content Extensions] Use less memory for CombinedURLFilters.
493         https://bugs.webkit.org/show_bug.cgi?id=144290
494
495         Reviewed by Andreas Kling.
496
497         * contentextensions/CombinedURLFilters.cpp:
498         (WebCore::ContentExtensions::recursiveMemoryUsed):
499         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
500         (WebCore::ContentExtensions::generateNFAForSubtree):
501         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
502         * contentextensions/NFA.cpp:
503         (WebCore::ContentExtensions::NFA::memoryUsed):
504         (WebCore::ContentExtensions::NFA::setActions):
505         * contentextensions/NFA.h:
506         * contentextensions/NFANode.h:
507         * contentextensions/Term.h:
508         (WebCore::ContentExtensions::Term::Term::generateGraph):
509         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
510         Use Vectors instead of HashTables in PrefixTreeVertex because the sets stay small and need to be more memory efficient.
511
512 2015-04-28  Brady Eidson  <beidson@apple.com>
513
514         Consolidate most "frame load" arguments into FrameLoadRequest.
515         https://bugs.webkit.org/show_bug.cgi?id=144276
516
517         Reviewed by Alexey Proskuryakov.
518
519         No new tests (No change in behavior).
520         
521         This patch starts the long overdue process of wrangling the insane load methods in FrameLoader.
522         
523         Humble beginnings of this long process:
524         - Put most of the various "frame load" arguments that are passed around within FrameLoader on FrameLoadRequest.
525         - Get rid of the "easy" constructors of FrameLoadRequest, forcing users to actually think about what they're doing.
526         - Change a private FrameLoader load method (urlSelected) to take a FrameLoadRequest instead of argument gobbledygook.
527         - Change a public FrameLoader load methods (changeLocation) to take a FrameLoadRequest instead of gobbledygook.
528         
529         These cover the straightforward changes where it was easy to figure out what the values of the FrameLoadRequest
530         arguments were from these various call sites.
531         
532         Further refactoring can be done in much smaller patches, handling fewer cases at a time. Little by little we will be
533         able to reduce the number of "load" methods on FrameLoader and make sure that they mainly only take a FrameLoadRequest
534         as an argument.
535
536         * inspector/InspectorFrontendClientLocal.cpp:
537         (WebCore::InspectorFrontendClientLocal::openInNewTab):
538         
539         * inspector/InspectorPageAgent.cpp:
540         (WebCore::InspectorPageAgent::navigate):
541         
542         * loader/FrameLoadRequest.cpp:
543         (WebCore::FrameLoadRequest::FrameLoadRequest):
544         * loader/FrameLoadRequest.h:
545         (WebCore::FrameLoadRequest::FrameLoadRequest):
546         (WebCore::FrameLoadRequest::lockHistory):
547         (WebCore::FrameLoadRequest::lockBackForwardList):
548         (WebCore::FrameLoadRequest::shouldSendReferrer):
549         (WebCore::FrameLoadRequest::allowNavigationToInvalidURL):
550         (WebCore::FrameLoadRequest::newFrameOpenerPolicy):
551         (WebCore::FrameLoadRequest::shouldReplaceDocumentIfJavaScriptURL):
552         
553         * loader/FrameLoader.cpp:
554         (WebCore::FrameLoader::changeLocation):
555         (WebCore::FrameLoader::urlSelected):
556         (WebCore::FrameLoader::loadFrameRequest):
557         * loader/FrameLoader.h:
558         
559         * loader/NavigationScheduler.cpp:
560         (WebCore::NavigationScheduler::scheduleLocationChange):
561         
562         * page/ContextMenuController.cpp:
563         (WebCore::openNewWindow):
564         (WebCore::ContextMenuController::contextMenuItemSelected):
565         
566         * page/DOMWindow.cpp:
567         (WebCore::DOMWindow::createWindow):
568
569 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
570
571         [Mac] [iOS] Implement font-synthesis CSS property
572         https://bugs.webkit.org/show_bug.cgi?id=144305
573
574         Reviewed by Andreas Kling.
575
576         This patch is fairly straightforward, though there are some particular pieces to the patch listed below.
577
578         The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
579         determine if we should synthesize bold and italics, this CSS property simply guards that decision.
580
581         Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
582         regarding font-synthesis into FontDescription (from RenderStyle).
583
584         Test: fast/css3-text/font-synthesis.html
585
586         * css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept
587         inside FontDescription. This also means that the property must be marked as a "high priority" property, which
588         is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
589         FontCacheIOS and FontCacheMac have access to the saved state.
590         * css/CSSComputedStyleDeclaration.cpp:
591         (WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.
592         * css/CSSSegmentedFontFace.cpp:
593         (WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
594         FontSynthesis state inside FontDescription.
595         * css/StyleBuilderConverter.h:
596         (WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
597         StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
598         CSSPropertyNames.in
599         * css/StyleBuilderCustom.h:
600         (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.
601         * platform/graphics/FontDescription.h:
602         (WebCore::FontDescription::FontDescription): Moved from RenderStyle.
603         (WebCore::FontDescription::fontSynthesis): Ditto.
604         (WebCore::FontDescription::setFontSynthesis): Ditto.
605         (WebCore::FontDescription::initialFontSynthesis): Ditto.
606         (WebCore::FontDescription::operator==): Update to include new state.
607         * platform/graphics/FontCache.h:
608         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
609         state inside FontDescription.
610         * platform/graphics/ios/FontCacheIOS.mm:
611         (WebCore::FontCache::createFontPlatformData): Guard the synthetic bold and synthetic italic decision on the
612         new FontSynthesis state inside FontDescription.
613         * platform/graphics/mac/FontCacheMac.mm:
614         (WebCore::FontCache::createFontPlatformData): Ditto.
615         * platform/text/TextFlags.h: Move FontSynthesis type from RenderStyleConstants.
616         * rendering/style/RenderStyle.h:
617         (WebCore::RenderStyle::fontSynthesis): Moved to FontDescription.
618         (WebCore::RenderStyle::setFontSynthesis): Ditto.
619         (WebCore::RenderStyle::initialFontSynthesis): Ditto.
620         * rendering/style/RenderStyleConstants.h: Moved FontSynthesis type to TextFlags.
621         * rendering/style/StyleRareInheritedData.h: Remove state regarding font synthesis (moved to FontDescription)
622
623 2015-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
624
625         SharedBuffer::copy is not computing the buffer size correctly when having m_dataArray
626         https://bugs.webkit.org/show_bug.cgi?id=144321
627
628         Reviewed by Darin Adler.
629
630         Patch correctness covered by existing tests.
631
632         * platform/SharedBuffer.cpp:
633         (WebCore::SharedBuffer::copy): Direct appending to m_dataArray and not using append method as this method updates the SharedBuffer size.
634
635 2015-04-28  Per Arne Vollan  <peavo@outlook.com>
636
637         [Curl] Memory leak.
638         https://bugs.webkit.org/show_bug.cgi?id=144327
639
640         Reviewed by Brent Fulgham.
641
642         When a data url is loaded, the ResourceHandle is not released.
643
644         * platform/network/curl/ResourceHandleManager.cpp:
645         (WebCore::ResourceHandleManager::startJob):
646
647 2015-04-28  Andy Estes  <aestes@apple.com>
648
649         Fix the Mavericks Debug build after r183467.
650
651         * platform/network/ResourceRequestBase.h:
652         (WebCore::ResourceRequestBase::requester): Removed WEBCORE_EXPORT.
653         (WebCore::ResourceRequestBase::setRequester): Ditto.
654
655 2015-04-28  Csaba Osztrogonác  <ossy@webkit.org>
656
657         Remove make-file-arrays.py
658         https://bugs.webkit.org/show_bug.cgi?id=144324
659
660         Reviewed by Gyuyoung Kim.
661
662         * make-file-arrays.py: Removed.
663
664 2015-04-28  Antti Koivisto  <antti@apple.com>
665
666         Build fix.
667
668         * platform/network/ios/ResourceRequestIOS.mm:
669         (WebCore::ResourceRequest::ResourceRequest):
670
671 2015-04-28  Antti Koivisto  <antti@apple.com>
672
673         Network Cache: Disk cache getting filled by YouTube video data
674         https://bugs.webkit.org/show_bug.cgi?id=144259
675
676         Reviewed by Darin Adler.
677
678         MSE media is loaded via XHR and tends to eventually fill the cache.
679
680         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
681         We can reduce disk writes and keep more useful resources around by not caching them
682
683         Test: http/tests/cache/disk-cache/disk-cache-media.html
684
685         * loader/DocumentLoader.cpp:
686         (WebCore::DocumentLoader::startLoadingMainResource):
687
688             Set the requester.
689
690         * loader/cache/CachedRawResource.cpp:
691         (WebCore::CachedRawResource::CachedRawResource):
692         * page/DiagnosticLoggingKeys.cpp:
693         (WebCore::DiagnosticLoggingKeys::streamingMedia):
694         * page/DiagnosticLoggingKeys.h:
695         * platform/network/ResourceRequestBase.cpp:
696         (WebCore::ResourceRequestBase::adopt):
697         (WebCore::ResourceRequestBase::copyData):
698         (WebCore::equalIgnoringHeaderFields):
699         * platform/network/ResourceRequestBase.h:
700         (WebCore::ResourceRequestBase::requester):
701         (WebCore::ResourceRequestBase::setRequester):
702
703             Add requester type to the request object. Currently this is main resource, xhr or unspecified.
704
705         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
706         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
707         * platform/network/cf/ResourceRequest.h:
708         (WebCore::ResourceRequest::deprecatedSetMainResourceRequest): Deleted.
709         (WebCore::ResourceRequest::deprecatedIsMainResourceRequest): Deleted.
710
711             Replace this iOS only field with shared mechanism.
712
713         * platform/network/ios/QuickLook.mm:
714         (WebCore::QuickLookHandle::create):
715         * xml/XMLHttpRequest.cpp:
716         (WebCore::XMLHttpRequest::createRequest):
717
718             Set the requester.
719
720 2015-04-28  Namhoon Kim  <nakim@ea.com>
721
722         Fix windows build error in WebCore related to bulk build.
723         https://bugs.webkit.org/show_bug.cgi?id=144313
724
725         Reviewed by Csaba Osztrogonác.
726
727         No new tests because there is no behavior change.
728
729         * css/CSSAllInOne.cpp:
730         * dom/DOMAllInOne.cpp:
731
732 2015-04-27  Simon Fraser  <simon.fraser@apple.com>
733
734         Eliminate styleDidChange with StyleDifferenceEqual when updates are actually necessary
735         https://bugs.webkit.org/show_bug.cgi?id=144198
736
737         Followup: fix assertions seen in fullscreen and pseudo-element tests. These code
738         paths set the style to the existing pointer, but with a SyntheticStyleChange.
739         We have to avoid an early return in this case.
740
741         * rendering/RenderElement.cpp:
742         (WebCore::RenderElement::setStyle):
743
744 2015-04-25  Simon Fraser  <simon.fraser@apple.com>
745
746         Eliminate styleDidChange with StyleDifferenceEqual when updates are actually necessary
747         https://bugs.webkit.org/show_bug.cgi?id=144198
748
749         Reviewed by Darin Adler, Antti Koivisto.
750         
751         SyntheticStyleChange style recalcs are triggered for cases where behavior depends
752         on state which is outside of RenderStyle; this includes triggering compositing for
753         animations, for video and canvas, and for iframes with composited content.
754         
755         In these cases, we'd run through RenderElement::setStyle() and its fan-out, but
756         with diff == StyleDifferenceEqual, and so be unable to determine if there
757         is actual work to be done.
758         
759         This patch enforces the contract that the diff is never StyleDifferenceEqual if
760         compositing or other work has to happen from setStyle(). This is achieved by
761         passing in a 'hasSideEffects' flag, which causes the diff to become at least
762         StyleDifferenceRecompositeLayer.
763         
764         RenderLayerCompositor::layerStyleChanged() can now safely early return
765         if the diff is equal. Future patches will reduce redundant work even more.
766
767         Test: compositing/animation/no-style-recalc-during-accelerated-animation.html
768
769         * page/animation/AnimationBase.h:
770         (WebCore::AnimationBase::animate): Returns a bool now if the state changed.
771         (WebCore::AnimationBase::state):
772         * page/animation/AnimationController.cpp:
773         (WebCore::AnimationController::updateAnimations): bool out param which indicates
774         whether any animations changed state.
775         * page/animation/AnimationController.h:
776         * page/animation/CompositeAnimation.cpp:
777         (WebCore::CompositeAnimation::animate): If any transitions or animations changed
778         state, set the animationStateChanged out param to true.
779         * page/animation/CompositeAnimation.h:
780         * page/animation/ImplicitAnimation.cpp:
781         (WebCore::ImplicitAnimation::animate): Return true if the state changed.
782         * page/animation/ImplicitAnimation.h:
783         * page/animation/KeyframeAnimation.cpp:
784         (WebCore::KeyframeAnimation::animate): Return true if the state changed.
785         * page/animation/KeyframeAnimation.h:
786         * rendering/RenderElement.cpp:
787         (WebCore::RenderElement::adjustStyleDifference): We may enter here now with diff
788         != StyleDifferenceEqual, but still need to do the check to see if layers changed.
789         (WebCore::RenderElement::initializeStyle): When setting style for the first time,
790         don't use StyleDifferenceEqual.
791         (WebCore::RenderElement::setStyle): Additional flag to indicate whether this style
792         change involves side effects. If the diff is equal but the flag is set, change
793         the diff to StyleDifferenceRecompositeLayer (the "lowest" non-zero diff).
794         * rendering/RenderElement.h:
795         (WebCore::RenderElement::setAnimatableStyle): Pass true to setStyle() if hasSideEffects
796         is true, or if animation state changed.
797         * rendering/RenderLayer.cpp:
798         (WebCore::RenderLayer::styleChanged): Pass the diff down.
799         * rendering/RenderLayerCompositor.cpp:
800         (WebCore::RenderLayerCompositor::layerStyleChanged): Return if the diff is equal.
801         * rendering/RenderLayerCompositor.h:
802         * rendering/style/RenderStyleConstants.h: StyleDifferenceNewStyle is used when
803         setting style for the first time.
804         * style/StyleResolveTree.cpp:
805         (WebCore::Style::createRendererIfNeeded): Provide animationsChanged bool (which is unused).
806         (WebCore::Style::resolveLocal): If the style change is synthetic, set the flag that
807         says there are side-effects.
808
809 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
810
811         [GTK] Add one single option to control all OpenGL-related options
812         https://bugs.webkit.org/show_bug.cgi?id=144105
813
814         Reviewed by Martin Robinson.
815
816         Test WTF_USE_TEXTURE_MAPPER since USE_TEXTURE_MAPPER has been removed.
817
818         * PlatformGTK.cmake:
819
820 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
821
822         Consolidate one-line flag-related header files into TextFlags.h
823         https://bugs.webkit.org/show_bug.cgi?id=144295
824
825         Reviewed by Tim Horton.
826
827         There were a collection of single-line header files throughout platform/ which contain
828         single-line type declaractions of flags related to text layout & rendering. This patch
829         consolidates all these single-line headers into TextFlags.h
830
831         No new tests because there is no behavior change.
832
833         * WebCore.vcxproj/WebCore.vcxproj:
834         * WebCore.vcxproj/WebCore.vcxproj.filters:
835         * WebCore.xcodeproj/project.pbxproj:
836         * css/CSSFontFace.h:
837         * css/CSSPrimitiveValueMappings.h:
838         * loader/cache/CachedFont.h:
839         * loader/cache/CachedTextTrack.h:
840         * page/Settings.h:
841         * platform/DragImage.h:
842         * platform/graphics/FontDescription.h:
843         * platform/graphics/FontOrientation.h: Removed.
844         * platform/graphics/FontPlatformData.h:
845         * platform/graphics/FontRenderingMode.h: Removed.
846         * platform/graphics/FontSmoothingMode.h: Removed.
847         * platform/graphics/FontTraitsMask.h: Removed.
848         * platform/graphics/FontWidthVariant.h: Removed.
849         * platform/graphics/TextRenderingMode.h: Removed.
850         * platform/graphics/cairo/FontCustomPlatformData.h:
851         * platform/graphics/freetype/FontPlatformData.h:
852         * platform/graphics/mac/FontCustomPlatformData.h:
853         * platform/graphics/win/FontCustomPlatformData.h:
854         * platform/text/NonCJKGlyphOrientation.h: Removed.
855         * platform/text/TextFlags.h:
856         * rendering/TextPainter.h:
857         * style/StyleFontSizeFunctions.h:
858
859 2015-04-27  Daniel Bates  <dabates@apple.com>
860
861         Form control may be associated with the wrong HTML Form element after form id change
862         https://bugs.webkit.org/show_bug.cgi?id=133456
863         <rdar://problem/17095055>
864
865         Reviewed by Andy Estes.
866
867         Fixes an issue where a form control may be associated with the wrong HTML Form element
868         after the id of the HTML Form element associated with the form control is changed when
869         there is more than one HTML Form element with the same id in the document. Specifically,
870         a form control that has an HTML form attribute value X will always be associated with
871         some HTML Form element f where f.id = X regardless of whether f.id is subsequently
872         changed.
873
874         Tests: fast/forms/change-form-id-to-be-unique-then-submit-form.html
875                fast/forms/change-form-id-to-be-unique.html
876
877         * dom/Element.cpp:
878         (WebCore::Element::attributeChanged): Notify observers when the id of an element changed.
879         (WebCore::Element::updateId): Added parameter NotifyObservers (defaults to NotifyObservers::Yes),
880         as to whether we should notify observers of the id change.
881         (WebCore::Element::updateIdForTreeScope): Ditto.
882         (WebCore::Element::willModifyAttribute): Do not notify observers of the id change immediately. As
883         indicated by the name of this method, we plan to modify the DOM attribute id of the element, but
884         we have not actually modified it when this method is called. Instead we will notify observers
885         in Element::attributeChanged(), which is called after the DOM attribute id is modified.
886         (WebCore::Element::cloneAttributesFromElement): Ditto.
887         * dom/Element.h: Defined enum class NotifyObservers.
888         * dom/TreeScope.cpp:
889         (WebCore::TreeScope::addElementById): Added boolean parameter notifyObservers (defaults to true)
890         as to whether we should dispatch a notification to all observers.
891         (WebCore::TreeScope::removeElementById): Ditto.
892         * dom/TreeScope.h:
893
894 2015-04-27  Alex Christensen  <achristensen@webkit.org>
895
896         Reduce allocations and memory usage when compiling content extensions.
897         https://bugs.webkit.org/show_bug.cgi?id=144277
898
899         Reviewed by Benjamin Poulain.
900
901         Covered by existing tests.
902
903         * contentextensions/Term.h:
904         (WebCore::ContentExtensions::Term::CharacterSet::set):
905         (WebCore::ContentExtensions::Term::CharacterSet::get):
906         (WebCore::ContentExtensions::Term::CharacterSet::invert):
907         (WebCore::ContentExtensions::Term::CharacterSet::inverted):
908         (WebCore::ContentExtensions::Term::CharacterSet::bitCount):
909         (WebCore::ContentExtensions::Term::CharacterSet::operator==):
910         (WebCore::ContentExtensions::Term::CharacterSet::hash):
911         (WebCore::ContentExtensions::Term::Term):
912         (WebCore::ContentExtensions::Term::addCharacter):
913         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
914         (WebCore::ContentExtensions::Term::isUniversalTransition):
915         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
916         Use two uint64_t's instead of a BitVector with a capacity of 128 bits.
917
918 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
919
920         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
921         https://bugs.webkit.org/show_bug.cgi?id=144193
922
923         Reviewed by Darin Adler.
924
925         * CMakeLists.txt:
926         * platform/graphics/ANGLEWebKitBridge.cpp:
927         * platform/graphics/FormatConverter.cpp:
928         * platform/graphics/FormatConverter.h:
929         * platform/graphics/GLContext.h:
930         * platform/graphics/GraphicsContext3D.cpp:
931         * platform/graphics/GraphicsContext3DPrivate.cpp:
932         * platform/graphics/OpenGLShims.cpp:
933         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
934         * platform/graphics/cg/GraphicsContext3DCG.cpp:
935         * platform/graphics/egl/GLContextEGL.cpp:
936         * platform/graphics/egl/GLContextEGL.h:
937         * platform/graphics/glx/GLContextGLX.cpp:
938         * platform/graphics/glx/GLContextGLX.h:
939         * platform/graphics/mac/GraphicsContext3DMac.mm:
940         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
941         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
942         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
943         * platform/graphics/opengl/GLPlatformContext.cpp:
944         * platform/graphics/opengl/GLPlatformSurface.cpp:
945         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
946         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
947         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
948         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
949         * platform/graphics/win/GraphicsContext3DWin.cpp:
950
951 2015-04-27  Jer Noble  <jer.noble@apple.com>
952
953         [iOS] Video not centered in element on retina devices
954         https://bugs.webkit.org/show_bug.cgi?id=144274
955
956         Reviewed by Simon Fraser.
957
958         In r173702, a transform was added to the video layer (and a matching, inverse transform
959         in the UIProcess), but this transform affects the position property of the video layer
960         used to position the video content within the element bounds when their aspect ratios
961         do not match.
962
963         To work around this problem, pre-apply the transform during -setPosition:.
964
965         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
966         (-[WebVideoContainerLayer setPosition:]):
967
968 2015-04-27  Jer Noble  <jer.noble@apple.com>
969
970         Add a setting & restriction which prevents non-interactivte playback of audible media elements.
971         https://bugs.webkit.org/show_bug.cgi?id=143486
972
973         Reviewed by Eric Carlson.
974
975         Tests: media/audio-playback-restriction-autoplay.html
976                media/audio-playback-restriction-play.html
977
978         To allow clients who want to allow non-user-interactive video-only playback, but still
979         restrict playback of audible media elements, add a new setting and matching restriction
980         which disallows playback of media elements containing audible characteristics.
981
982         * html/HTMLMediaElement.cpp:
983         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the RequireUserGestureForAudioRateChange
984             restriction if the audioPlaybackRequiresUserGesture() setting is set.
985         (WebCore::HTMLMediaElement::parseAttribute): Drive-by fix. Move the opening brace
986             out of the #if, as this confuses the heck out of diff and makes all subsequent
987             changes appear to be within HTMLMediaElement::parseAttribute.
988         (WebCore::HTMLMediaElement::autoplay): Remove the restriction check from within autoplay().
989             It is checked again immediately after every autoplay() call site.
990         (WebCore::HTMLMediaElement::pauseInternal): Remove the iOS-only #if.
991         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Check whether playback
992             is permitted, and if not, pause.
993         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
994         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Ditto.
995         * html/HTMLMediaSession.cpp:
996         (WebCore::restrictionName): Since BehaviorRestrictions is a bitfield, check each bit
997             individually.
998         (WebCore::HTMLMediaSession::removeBehaviorRestriction): Handle RequireUserGestureForAudioRateChange.
999         (WebCore::HTMLMediaSession::playbackPermitted): Check whether the element has audio and 
1000             audio playback is restricted, and return false if so.
1001         * html/HTMLMediaSession.h:
1002         * page/Settings.cpp:
1003         * page/Settings.in:
1004         * testing/Internals.cpp:
1005         (WebCore::Internals::setMediaSessionRestrictions): Added. 
1006         (WebCore::Internals::setMediaElementRestrictions): Added.
1007         * testing/Internals.h:
1008         * testing/Internals.idl:
1009
1010 2015-04-27  Jer Noble  <jer.noble@apple.com>
1011
1012         [WebAudio] AudioContext does not remove user-gesture restriction during resume()
1013         https://bugs.webkit.org/show_bug.cgi?id=144211
1014
1015         Reviewed by Eric Carlson.
1016
1017         Tests: webaudio/audiocontext-restriction-audiobuffersourcenode-start.html
1018                webaudio/audiocontext-restriction.html
1019
1020         Before the introduction of resume(), suspend(), and stop(), AudioContexts which required
1021         a user-gesture would start normally, but would effectively mute their outputs. Now that
1022         the AudioContext's state property is exposed to JavaScript, the AudioContext should stay
1023         in the "suspended" state until the user-gesture restriction is lifted.
1024
1025         Add a new method, willBeginPlayback() which checks and potentially clears the context's
1026         behavior restrictions before checking with the MediaSession. Call this new willBeginPlayback()
1027         method when the state would transition to "running".
1028
1029         Because they may be called before any nodes are created, make sure to call lazyInitialize()
1030         from within the JS-exposed resumePlayback(), suspendPlayback(), and stopPlayback() methods.
1031
1032         Instead of clearing the behavior restrictions directly, scheduled AudioNodes should instead
1033         call a new method nodeWillBeginPlayback(). Because existing sites will call AudioNode.start()
1034         inside a user-gesture handler to clear the user-gesture restriction, call startRendering()
1035         from nodeWillBeginPlayback(). But because we don't want AudioNode.start() to resume playback
1036         unconditionally, only do so when the user-gesture restriction is set.
1037
1038         Now that an AudioContext will not transition to "running" state without a user-gesture (if
1039         that restriction is set), there's no reason to check for that restriction from inside
1040         AudioDestinationNode.
1041
1042         Add some internal methods to set and clear AudioContext BehaviorRestrictions for testing purposes.
1043
1044         * Modules/webaudio/AudioBufferSourceNode.cpp:
1045         (WebCore::AudioBufferSourceNode::startPlaying):
1046         * Modules/webaudio/AudioContext.cpp:
1047         (WebCore::AudioContext::nodeWillBeginPlayback):
1048         (WebCore::AudioContext::willBeginPlayback):
1049         (WebCore::AudioContext::willPausePlayback):
1050         (WebCore::AudioContext::startRendering):
1051         (WebCore::AudioContext::suspendContext):
1052         (WebCore::AudioContext::resumeContext):
1053         (WebCore::AudioContext::closeContext):
1054         (WebCore::AudioContext::suspendPlayback):
1055         (WebCore::AudioContext::mayResumePlayback):
1056         * Modules/webaudio/AudioContext.h:
1057         (WebCore::AudioContext::behaviorRestrictions):
1058         (WebCore::AudioContext::userGestureRequiredForAudioStart):
1059         (WebCore::AudioContext::pageConsentRequiredForAudioStart):
1060         * Modules/webaudio/AudioDestinationNode.cpp:
1061         (WebCore::AudioDestinationNode::render):
1062         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1063         (WebCore::AudioScheduledSourceNode::start):
1064         * testing/Internals.cpp:
1065         (WebCore::Internals::setAudioContextRestrictions):
1066         * testing/Internals.h:
1067         * testing/Internals.idl:
1068
1069 2015-04-27  Alexey Proskuryakov  <ap@apple.com>
1070
1071         Build fix.
1072
1073         * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1074         Use -setObject:forKey:, not array subscript.
1075
1076 2015-04-27  Eric Carlson  <eric.carlson@apple.com>
1077
1078         WirelessTargetPicker should not be visible unless a file is playable
1079         https://bugs.webkit.org/show_bug.cgi?id=144271
1080         <rdar://problem/20712003>
1081
1082         Reviewed by Jer Noble.
1083
1084         * Modules/mediacontrols/mediaControlsApple.js:
1085         (Controller.prototype.isPlayable): New.
1086         (Controller.prototype.setStatusHidden): Call updateWirelessTargetAvailable.
1087         (Controller.prototype.updateWirelessTargetAvailable): Don't show the button until the
1088             status message has been hidden.
1089
1090 2015-04-22  Martin Robinson  <mrobinson@igalia.com>
1091
1092         [CMake] Autogenerate cmakeconfig.h.cmake
1093         https://bugs.webkit.org/show_bug.cgi?id=143997
1094
1095         Reviewed by Csaba Osztrogonác.
1096
1097         * PlatformGTK.cmake: Use the WTF_USE style variables, because those are the same
1098         as the ones exposed to the build.
1099
1100 2015-04-27  Zalan Bujtas  <zalan@apple.com>
1101
1102         Simple line layout: Wrong text offsetting when range does not start from the first renderer.
1103         https://bugs.webkit.org/show_bug.cgi?id=144167
1104         rdar://problem/20639857
1105
1106         Reviewed by Simon Fraser.
1107
1108         This patch ensures that TextIterator returns the right text when the input range starts
1109         from a sibling node.
1110
1111         TextIterator::m_previousTextLengthInFlow keeps track of the current node offset from the parent.
1112         It is required to map simple line layout runs to RenderText positions.
1113         This patch sets the offset value when the iteration start with a sibling node.
1114
1115         Test: fast/text/range-text-with-simple-line-layout.html
1116
1117         * editing/TextIterator.cpp:
1118         (WebCore::TextIterator::TextIterator):
1119         (WebCore::TextIterator::handleTextNode):
1120
1121 2015-04-27  Commit Queue  <commit-queue@webkit.org>
1122
1123         Unreviewed, rolling out r183393.
1124         https://bugs.webkit.org/show_bug.cgi?id=144272
1125
1126         Caused memory corruption detected by GuardMalloc (Requested by
1127         ap on #webkit).
1128
1129         Reverted changeset:
1130
1131         "Synchronous XMLHttpRequest should get access to AppCache
1132         resources stored as flat files"
1133         https://bugs.webkit.org/show_bug.cgi?id=143711
1134         http://trac.webkit.org/changeset/183393
1135
1136 2015-04-27  Per Arne Vollan  <peavo@outlook.com>
1137
1138         [Curl] Favicons loaded from disc cache are ignored.
1139         https://bugs.webkit.org/show_bug.cgi?id=143953
1140
1141         Reviewed by Alex Christensen.
1142
1143         When a favicon is loaded from the Curl disc cache, the icon data is thrown away.
1144         This happens because we give a 304 response, which makes the icon loader ignore
1145         the response. We can solve this by responding with 200 OK.
1146
1147         * platform/network/ResourceHandleInternal.h:
1148         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1149         * platform/network/curl/CurlCacheManager.cpp:
1150         (WebCore::CurlCacheManager::didReceiveResponse):
1151         * platform/network/curl/ResourceHandleManager.cpp:
1152         (WebCore::headerCallback):
1153         (WebCore::ResourceHandleManager::initializeHandle):
1154
1155 2015-04-27  Brady Eidson  <beidson@apple.com>
1156
1157         Make 'enum NavigationType' be an enum class
1158         https://bugs.webkit.org/show_bug.cgi?id=144270
1159
1160         Reviewed by Alex Christensen.
1161
1162         No new tests (No change in behavior).
1163
1164         I’ll be adding a new NavigationType for bug 144269 so it makes sense to make this
1165         an enum class first.
1166
1167         * loader/FrameLoader.cpp:
1168         (WebCore::FrameLoader::load):
1169         (WebCore::FrameLoader::reload):
1170         (WebCore::FrameLoader::loadDifferentDocumentItem):
1171         * loader/FrameLoaderTypes.h:
1172
1173         * loader/NavigationAction.cpp:
1174         (WebCore::navigationType):
1175         (WebCore::NavigationAction::NavigationAction):
1176
1177         * loader/PolicyChecker.cpp:
1178         (WebCore::PolicyChecker::checkNavigationPolicy):
1179
1180         * page/PerformanceNavigation.cpp:
1181         (WebCore::PerformanceNavigation::type):
1182
1183 2015-04-27  Yoav Weiss  <yoav@yoav.ws>
1184
1185         Fix viewport units in Media Queries
1186         https://bugs.webkit.org/show_bug.cgi?id=144260
1187
1188         Reviewed by Darin Adler.
1189
1190         This patch makes sure that viewport units are considered "length units"
1191         in the context of Media Queries, by having MediaQueryExp use the unit logic
1192         that is in CSSPrimitiveValue.
1193         It does that by turning the relevant methods in CSSPrimitiveValue into static.
1194
1195         It also makes sure that the logic for "resolution units" is not maintained separately 
1196         in MediaQueryExp, to avoid similiar issues in the future with resolution units.
1197
1198         Test: fast/media/mq-viewport-units.html
1199
1200         * css/CSSPrimitiveValue.h:
1201         (WebCore::CSSPrimitiveValue::isViewportPercentageLength): Added a static variant.
1202         (WebCore::CSSPrimitiveValue::isLength): Added a static variant.
1203         (WebCore::CSSPrimitiveValue::isResolution): Added a static variant.
1204         * css/MediaQueryExp.cpp:
1205         (WebCore::featureWithValidPositiveLenghtOrNumber): Call CSSPrimitiveValue's length unit logic.
1206         (WebCore::featureWithValidDensity): Call CSSPrimitiveValue's resolution unit logic.
1207
1208 2015-04-27  Javier Fernandez  <jfernandez@igalia.com>
1209
1210         [CSS Grid Layout] Support for the justify-self and justify-items in grid layout
1211         https://bugs.webkit.org/show_bug.cgi?id=133280
1212
1213         Reviewed by David Hyatt.
1214
1215         Implementation of justify-self and justify-items properties for grid. It supports
1216         different writing-modes and direction. Margins, borders and paddings are also
1217         considered when computing the final position and stretched size.
1218
1219         This patch applies also a quite important refactoring of the alignment logic in
1220         order to share code between the two alignment dimensions, row-axis and column-axis.
1221
1222         Overflow handling is still missing and will be added later in a follow-up bug.
1223
1224         Tests: fast/css-grid-layout/grid-align-justify-margin-border-padding-vertical-lr.html
1225                fast/css-grid-layout/grid-align-justify-margin-border-padding-vertical-rl.html
1226                fast/css-grid-layout/grid-align-justify-margin-border-padding.html
1227                fast/css-grid-layout/justify-self-cell.html
1228
1229         * rendering/RenderGrid.cpp:
1230         (WebCore::RenderGrid::layoutGridItems):
1231         (WebCore::RenderGrid::columnAxisPositionForChild):
1232         (WebCore::RenderGrid::rowAxisPositionForChild):
1233         (WebCore::RenderGrid::rowPositionForChild):
1234         (WebCore::RenderGrid::columnPositionForChild):
1235         (WebCore::RenderGrid::findChildLogicalPosition):
1236         (WebCore::RenderGrid::allowedToStretchLogicalHeightForChild): Deleted.
1237         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
1238         (WebCore::RenderGrid::marginLogicalHeightForChild): Deleted.
1239         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching): Deleted.
1240         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): Deleted.
1241         * rendering/RenderGrid.h:
1242         * rendering/style/RenderStyle.cpp:
1243         (WebCore::RenderStyle::resolveJustification):
1244         * rendering/style/RenderStyle.h:
1245
1246 2015-04-27  Darin Adler  <darin@apple.com>
1247
1248         Crashes under IDBDatabase::closeConnection
1249         https://bugs.webkit.org/show_bug.cgi?id=141745
1250
1251         Reviewed by Alexey Proskuryakov.
1252
1253         * Modules/indexeddb/IDBDatabase.cpp:
1254         (WebCore::IDBDatabase::~IDBDatabase): Do the work of close/closeConnection without
1255         actually calling those functions.
1256         (WebCore::IDBDatabase::closeConnection): Protect the database so it's not destroyed
1257         in the middle of this function's execution.
1258
1259 2015-04-27  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1260
1261         [Streams API] ReadableStream constructor start function should be able to close the stream
1262         https://bugs.webkit.org/show_bug.cgi?id=143363
1263
1264         Reviewed by Benjamin Poulain.
1265
1266         Implements https://streams.spec.whatwg.org/#close-readable-stream.
1267         When the "close" JS function is called, the stream is getting closed.
1268         The stream state is changed to close and if it has a reader, the reader gets closed as well:
1269         The reader resolves the closed promise and releases the stream.
1270
1271         Enabled the possibility to resolve a promise with any JS value.
1272         This is used to resolve closed promise with jsUndefined and will be used for read promises in
1273         the future as well, though of course it is not restricted to Streams.
1274
1275         Covered by reference tests that are now passing.
1276
1277         * Modules/streams/ReadableStream.h:
1278         * Modules/streams/ReadableStream.cpp:
1279         (WebCore::ReadableStream::changeStateToClosed): Called by the JS function 'close'.
1280         * Modules/streams/ReadableStreamReader.cpp:
1281         (WebCore::ReadableStreamReader::ReadableStreamReader): Initialized stream.
1282         (WebCore::ReadableStreamReader::initialize): Added to handle state change at constructor time
1283         in particular closed/errored state.
1284         (WebCore::ReadableStreamReader::releaseStream): Releases the stream.
1285         (WebCore::ReadableStreamReader::closed): Stores the promise callbacks and invokes success
1286         immediately if the stream is already closed.
1287         (WebCore::ReadableStreamReader::changeStateToClosed): Changes the internal state to closed,
1288         resolves the promise and releases the stream.
1289         * Modules/streams/ReadableStreamReader.h:
1290         (WebCore::ReadableStreamReader::State): Added.
1291         * bindings/js/JSDOMPromise.h:
1292         (WebCore::DeferredWrapper::resolve<JSC::JSValue>): Adds the ability to resolve a promise with
1293         a custom JS value.
1294         * bindings/js/JSReadableStreamControllerCustom.cpp:
1295         (WebCore::JSReadableStreamController::close): Not "notImplemented" anymore. Now it closes the
1296         stream.
1297         * bindings/js/JSReadableStreamReaderCustom.cpp:
1298         (WebCore::JSReadableStreamReader::closed): Resolves the promise with undefined.
1299
1300 2015-04-27  Csaba Osztrogonác  <ossy@webkit.org>
1301
1302         Fix the !ENABLE(CSS_GRID_LAYOUT) build after r183370
1303         https://bugs.webkit.org/show_bug.cgi?id=144255
1304
1305         Reviewed by Carlos Garcia Campos.
1306
1307         * rendering/RenderBox.cpp:
1308         (WebCore::RenderBox::computeLogicalHeight):
1309
1310 2015-04-27  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1311
1312         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
1313         https://bugs.webkit.org/show_bug.cgi?id=143711
1314
1315         Reviewed by Darin Adler.
1316
1317         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
1318         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
1319         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
1320
1321         Test: http/tests/appcache/simple-video-sync.html
1322
1323         * html/HTMLMediaElement.cpp:
1324         (WebCore::HTMLMediaElement::parseAttribute):
1325         * loader/DocumentThreadableLoader.cpp:
1326         (WebCore::DocumentThreadableLoader::loadRequest):
1327         * loader/FrameLoader.cpp:
1328         (WebCore::FrameLoader::loadResourceSynchronously):
1329         * loader/FrameLoader.h:
1330         * loader/appcache/ApplicationCacheHost.cpp:
1331         (WebCore::ApplicationCacheHost::maybeLoadResource):
1332         (WebCore::ApplicationCacheHost::createFileURL):
1333         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
1334         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
1335         * loader/appcache/ApplicationCacheHost.h:
1336         * xml/XSLTProcessorLibxslt.cpp:
1337         (WebCore::docLoaderFunc):
1338         * xml/parser/XMLDocumentParserLibxml2.cpp:
1339         (WebCore::openFunc):
1340
1341 2015-04-24  Philippe Normand  <pnormand@igalia.com>
1342
1343         [JHBuild] Move to upstream OpenWebRTC
1344         https://bugs.webkit.org/show_bug.cgi?id=144145
1345
1346         Reviewed by Carlos Garcia Campos.
1347
1348         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp:
1349         (WebCore::initializeOpenWebRTC): Update with new owr_init API.
1350
1351 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1352
1353         [SOUP] Add initial implementation of NetworkProcess disk cache
1354         https://bugs.webkit.org/show_bug.cgi?id=143872
1355
1356         Reviewed by Martin Robinson.
1357
1358         Allow to create a GRefPtr for SoupBuffer. Even though SoupBuffer
1359         is not a GObject and has copy/free functions instead of ref/unref,
1360         it's internally refcounted, so we could use copy/free as
1361         ref/unref.
1362
1363         * PlatformGTK.cmake:
1364         * platform/network/soup/GRefPtrSoup.cpp: Added.
1365         (WTF::refGPtr):
1366         (WTF::derefGPtr):
1367         * platform/network/soup/GRefPtrSoup.h: Added.
1368
1369 2015-04-26  Manuel Rego Casasnovas  <rego@igalia.com>
1370
1371         [CSS Grid Layout] LayoutBox::hasDefiniteLogicalHeight() should consider abspos boxes as definite
1372         https://bugs.webkit.org/show_bug.cgi?id=144144
1373
1374         Reviewed by Darin Adler.
1375
1376         Change order in hasDefiniteLogicalHeight() ifs to consider definite
1377         absolutely positioned elements.
1378
1379         Test: fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
1380
1381         * rendering/RenderBox.cpp:
1382         (WebCore::RenderBox::hasDefiniteLogicalHeight):
1383
1384 2015-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1385
1386         SVGFilterBuilder should drive the builtin sourceAlpha from the passed sourceGraphic
1387         https://bugs.webkit.org/show_bug.cgi?id=144137
1388
1389         Reviewed by Darin Adler.
1390
1391         The SourceAlpha should be driven from the last applied FilterEffect. This
1392         will require the SourceAlpha FilterEffect to wrap a FilterEffect rather
1393         than just getting the SourceGraphic reference from FilterEffectRenderer.
1394
1395         This is based on the Blink patch:
1396         https://src.chromium.org/viewvc/blink?revision=194115&view=revision.
1397
1398         Test: svg/filters/sourceAlpha-input-filter-effect.html
1399         
1400         * platform/graphics/filters/SourceAlpha.cpp:
1401         (WebCore::SourceAlpha::create): Make SourceAlpha wraps a FilterEffect
1402         rather than a Filter.
1403         
1404         (WebCore::SourceAlpha::determineAbsolutePaintRect): Determine the paint
1405         rect from the wrapped FilterEffect.
1406         
1407         (WebCore::SourceAlpha::platformApplySoftware): Extract the alpha channel
1408         from the wrapped FilterEffect.
1409         
1410         (WebCore::SourceAlpha::SourceAlpha): 
1411         * platform/graphics/filters/SourceAlpha.h:
1412         (WebCore::SourceAlpha::SourceAlpha): Deleted.
1413         Reimplement the constructor of the SourceAlpha such that it wraps the
1414         sourceEffect in its inputEffects.
1415     
1416         * rendering/FilterEffectRenderer.cpp:
1417         (WebCore::FilterEffectRenderer::buildReferenceFilter): Delete the FIXME
1418         comment and do exactly what it said. This matches the implementation of
1419         Gecko and Blink.
1420         
1421         * rendering/svg/RenderSVGResourceFilter.cpp:
1422         (WebCore::RenderSVGResourceFilter::buildPrimitives):
1423         Delete the extra argument.
1424
1425         * svg/graphics/filters/SVGFilterBuilder.cpp:
1426         (WebCore::SVGFilterBuilder::SVGFilterBuilder):
1427         * svg/graphics/filters/SVGFilterBuilder.h: Drive the SourceAlpha from the
1428         passed source FilterEffect.
1429
1430         * platform/graphics/filters/FEBlend.cpp:
1431         * platform/graphics/filters/FEBlend.h:
1432         * platform/graphics/filters/FEColorMatrix.cpp:
1433         * platform/graphics/filters/FEColorMatrix.h:
1434         * platform/graphics/filters/FEComponentTransfer.cpp:
1435         * platform/graphics/filters/FEComponentTransfer.h:
1436         * platform/graphics/filters/FEComposite.cpp:
1437         * platform/graphics/filters/FEComposite.h:
1438         * platform/graphics/filters/FEConvolveMatrix.cpp:
1439         * platform/graphics/filters/FEConvolveMatrix.h:
1440         * platform/graphics/filters/FEDiffuseLighting.cpp:
1441         * platform/graphics/filters/FEDiffuseLighting.h:
1442         * platform/graphics/filters/FEDisplacementMap.cpp:
1443         * platform/graphics/filters/FEDisplacementMap.h:
1444         * platform/graphics/filters/FEDropShadow.cpp:
1445         * platform/graphics/filters/FEDropShadow.h:
1446         * platform/graphics/filters/FEFlood.cpp:
1447         * platform/graphics/filters/FEFlood.h:
1448         * platform/graphics/filters/FEGaussianBlur.cpp:
1449         * platform/graphics/filters/FEGaussianBlur.h:
1450         * platform/graphics/filters/FELighting.cpp:
1451         * platform/graphics/filters/FELighting.h:
1452         * platform/graphics/filters/FEMerge.cpp:
1453         * platform/graphics/filters/FEMerge.h:
1454         * platform/graphics/filters/FEMorphology.cpp:
1455         * platform/graphics/filters/FEMorphology.h:
1456         * platform/graphics/filters/FEOffset.cpp:
1457         * platform/graphics/filters/FEOffset.h:
1458         * platform/graphics/filters/FESpecularLighting.cpp:
1459         * platform/graphics/filters/FESpecularLighting.h:
1460         * platform/graphics/filters/FETile.cpp:
1461         * platform/graphics/filters/FETile.h:
1462         * platform/graphics/filters/FETurbulence.cpp:
1463         * platform/graphics/filters/FETurbulence.h:
1464         * platform/graphics/filters/Filter.h:
1465         * platform/graphics/filters/FilterEffect.cpp:
1466         * platform/graphics/filters/FilterEffect.h:
1467         * platform/graphics/filters/SourceGraphic.cpp:
1468         * platform/graphics/filters/SourceGraphic.h:
1469         * rendering/svg/RenderSVGResourceFilter.h:
1470         * rendering/svg/SVGRenderTreeAsText.cpp:
1471         Code clean up: Pointer to reference conversion. It starts by converting
1472         FilterEffect::m_filter from pointer to reference and it kept expanding.
1473         All the creations of FilterEffect were happening by passing "this" so
1474         passing "*this" did not require to check whether the pointer is nil.
1475
1476         * svg/SVGFEBlendElement.cpp:
1477         * svg/SVGFEBlendElement.h:
1478         * svg/SVGFEColorMatrixElement.cpp:
1479         * svg/SVGFEColorMatrixElement.h:
1480         * svg/SVGFEComponentTransferElement.cpp:
1481         * svg/SVGFEComponentTransferElement.h:
1482         * svg/SVGFECompositeElement.cpp:
1483         * svg/SVGFECompositeElement.h:
1484         * svg/SVGFEConvolveMatrixElement.cpp:
1485         * svg/SVGFEConvolveMatrixElement.h:
1486         * svg/SVGFEDiffuseLightingElement.cpp:
1487         * svg/SVGFEDiffuseLightingElement.h:
1488         * svg/SVGFEDisplacementMapElement.cpp:
1489         * svg/SVGFEDisplacementMapElement.h:
1490         * svg/SVGFEDropShadowElement.cpp:
1491         * svg/SVGFEDropShadowElement.h:
1492         * svg/SVGFEFloodElement.cpp:
1493         * svg/SVGFEFloodElement.h:
1494         * svg/SVGFEGaussianBlurElement.cpp:
1495         * svg/SVGFEGaussianBlurElement.h:
1496         * svg/SVGFEImageElement.cpp:
1497         * svg/SVGFEImageElement.h:
1498         * svg/SVGFEMergeElement.cpp:
1499         * svg/SVGFEMergeElement.h:
1500         * svg/SVGFEMorphologyElement.cpp:
1501         * svg/SVGFEMorphologyElement.h:
1502         * svg/SVGFEOffsetElement.cpp:
1503         * svg/SVGFEOffsetElement.h:
1504         * svg/SVGFESpecularLightingElement.cpp:
1505         * svg/SVGFESpecularLightingElement.h:
1506         * svg/SVGFETileElement.cpp:
1507         * svg/SVGFETileElement.h:
1508         * svg/SVGFETurbulenceElement.cpp:
1509         * svg/SVGFETurbulenceElement.h:
1510         * svg/SVGFilterPrimitiveStandardAttributes.h:
1511         * svg/graphics/filters/SVGFEImage.cpp:
1512         * svg/graphics/filters/SVGFEImage.h:
1513         Code clean up: Pointer to reference and PassRefPtr<> to RefPtr<> or Ref<>
1514         conversion.
1515
1516 2015-04-26  Darin Adler  <darin@apple.com>
1517
1518         REGRESSION (r174283): disabled default buttons use impossible-to-read white text on Mac
1519         https://bugs.webkit.org/show_bug.cgi?id=144237
1520
1521         Reviewed by Simon Fraser.
1522
1523         No test because DumpRenderTree and WebKitTestRunner don't have a good method
1524         for testing behaviors that are specific to active windows. That's the same reason
1525         that the change that caused this bug didn't come with a regression test.
1526
1527         * rendering/RenderTheme.cpp:
1528         (WebCore::RenderTheme::adjustStyle): Renamed "e" to "element". Added a comment to
1529         clarify the meaning of the setInsideDefaultButton function, and added an
1530         isDisabledFormControl check so it won't trigger on a disabled button.
1531         (WebCore::RenderTheme::systemColor): Moved CSSValueActivebuttontext into
1532         alphabetical order to match the rest of the switch statement ordering.
1533
1534         * rendering/RenderThemeMac.mm:
1535         (WebCore::RenderThemeMac::systemColor): Moved CSSValueActivebuttontext into
1536         alphabetical order to match the rest of the switch statement ordering. Also
1537         fixed its behavior on older versions of OS X; it should just return the same
1538         thing that CSSValueButtontext would return in that context.
1539
1540 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
1541
1542         [ES6] Implement ES6 template literals
1543         https://bugs.webkit.org/show_bug.cgi?id=142691
1544
1545         Reviewed by Darin Adler.
1546
1547         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
1548
1549         * Configurations/FeatureDefines.xcconfig:
1550
1551 2015-04-26  Javier Fernandez  <jfernandez@igalia.com>
1552
1553         [CSS Grid Layout] Support for align-self and align-items in grid layout
1554         https://bugs.webkit.org/show_bug.cgi?id=133225
1555
1556         Reviewed by Darin Adler.
1557
1558         Implementation of align-self and align-items properties for grid. It supports
1559         different writing-modes and direction. Margins, borders and paddings are also
1560         considered when computing the final position and stretched size.
1561
1562         Overflow handling is still missing and will be added when implemented row-axis
1563         alignment support.
1564
1565         Test: fast/css-grid-layout/grid-align.html
1566
1567         * rendering/RenderBox.cpp:
1568         (WebCore::RenderBox::computeLogicalHeight):
1569         * rendering/RenderGrid.cpp:
1570         (WebCore::RenderGrid::logicalContentHeightForChild):
1571         (WebCore::RenderGrid::layoutGridItems):
1572         (WebCore::computeOverflowAlignmentOffset):
1573         (WebCore::RenderGrid::endOfRowForChild):
1574         (WebCore::RenderGrid::startOfRowForChild):
1575         (WebCore::RenderGrid::centeredRowPositionForChild):
1576         (WebCore::marginWidthForChild):
1577         (WebCore::marginHeightForChild):
1578         (WebCore::RenderGrid::allowedToStretchLogicalHeightForChild):
1579         (WebCore::RenderGrid::needToStretchChildLogicalHeight):
1580         (WebCore::RenderGrid::marginLogicalHeightForChild):
1581         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
1582         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1583         (WebCore::RenderGrid::rowPositionForChild):
1584         (WebCore::RenderGrid::findChildLogicalPosition):
1585         (WebCore::RenderGrid::populateGridPositions): Deleted.
1586         * rendering/RenderGrid.h:
1587
1588 2015-04-26  Doug Russell  <d_russell@apple.com>
1589
1590         AX: richer text change notifications (142719)
1591         https://bugs.webkit.org/show_bug.cgi?id=142719
1592
1593         Reviewed by Darin Adler.
1594
1595         Richer accessibility value change notifications. Introduce AXTextEditType,
1596         postTextStateChangeNotification and postTextReplacementNotification to give assistive
1597         tech apps more reliable context for responding to changes in web content. Also implement
1598         a mechanism to post value changes in password form fields in coalesced ticks to thwart
1599         analyzing the cadence of changes.
1600
1601         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
1602         and an overload of postTextReplacementNotification to give assistive tech apps more
1603         reliable context for responding to changes in web content selection. Also block posting
1604         selection changes on password fields.
1605
1606         Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
1607                platform/mac/accessibility/selection-change-userinfo.html
1608                platform/mac/accessibility/value-change-userinfo.html
1609
1610         * CMakeLists.txt:
1611         * WebCore.vcxproj/WebCore.vcxproj:
1612         * WebCore.vcxproj/WebCore.vcxproj.filters:
1613         * WebCore.xcodeproj/project.pbxproj:
1614         * accessibility/AXObjectCache.cpp:
1615         (WebCore::AXObjectCache::AXObjectCache):
1616         (WebCore::AXObjectCache::notificationPostTimerFired):
1617         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
1618         (WebCore::AXObjectCache::showIntent):
1619         (WebCore::AXObjectCache::setTextSelectionIntent):
1620         (WebCore::isPasswordFieldOrContainedByPasswordField):
1621         (WebCore::AXObjectCache::postTextStateChangeNotification):
1622         (WebCore::AXObjectCache::postTextReplacementNotification):
1623         (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
1624         (WebCore::AXObjectCache::rootWebArea):
1625         (WebCore::AXObjectCache::textChangeForEditType):
1626         (WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
1627         (WebCore::AXObjectCache::frameLoadingEventNotification): Deleted.
1628         * accessibility/AXObjectCache.h:
1629         (WebCore::AXObjectCache::postTextStateChangeNotification):
1630         (WebCore::AXObjectCache::postTextReplacementNotification):
1631         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1632         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1633         (WebCore::AXObjectCache::textChangeForEditType):
1634         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1635         (WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
1636         (WebCore::AXObjectCache::getOrCreate): Deleted.
1637         (WebCore::AXObjectCache::attachWrapper): Deleted.
1638         * accessibility/AXTextStateChangeIntent.h: Added.
1639         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
1640         * accessibility/AccessibilityNodeObject.cpp:
1641         (WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
1642         * accessibility/AccessibilityNodeObject.h:
1643         * accessibility/AccessibilityObject.cpp:
1644         (WebCore::AccessibilityObject::isContainedByPasswordField):
1645         * accessibility/AccessibilityObject.h:
1646         (WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
1647         (WebCore::AccessibilityObject::isPasswordField): Deleted.
1648         * accessibility/AccessibilityRenderObject.cpp:
1649         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1650         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1651         * accessibility/AccessibilityScrollView.h:
1652         * accessibility/atk/AXObjectCacheAtk.cpp:
1653         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1654         * accessibility/ios/AXObjectCacheIOS.mm:
1655         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1656         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1657         * accessibility/mac/AXObjectCacheMac.mm:
1658         (WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
1659         (WebCore::AXPostNotificationWithUserInfo):
1660         (WebCore::AXObjectCache::postPlatformNotification):
1661         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1662         (WebCore::textReplacementChangeDictionary):
1663         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1664         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1665         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1666         (+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
1667         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
1668         (arrayRemovingNonJSONTypes):
1669         (dictionaryRemovingNonJSONTypes):
1670         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
1671         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
1672         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1673         (textMarkerRangeFromVisiblePositions):
1674         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
1675         * editing/AppendNodeCommand.cpp:
1676         (WebCore::AppendNodeCommand::AppendNodeCommand):
1677         (WebCore::sendAXTextChangedIgnoringLineBreaks):
1678         (WebCore::AppendNodeCommand::doApply):
1679         (WebCore::AppendNodeCommand::doUnapply):
1680         * editing/AppendNodeCommand.h:
1681         (WebCore::AppendNodeCommand::create):
1682         * editing/ApplyStyleCommand.cpp:
1683         (WebCore::ApplyStyleCommand::ApplyStyleCommand):
1684         (WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
1685         * editing/ApplyStyleCommand.h:
1686         * editing/CompositeEditCommand.cpp:
1687         (WebCore::EditCommandComposition::unapplyEditType):
1688         (WebCore::CompositeEditCommand::CompositeEditCommand):
1689         (WebCore::CompositeEditCommand::apply):
1690         (WebCore::CompositeEditCommand::insertParagraphSeparator):
1691         (WebCore::CompositeEditCommand::insertNodeBefore):
1692         (WebCore::CompositeEditCommand::appendNode):
1693         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
1694         (WebCore::CompositeEditCommand::insertTextIntoNode):
1695         (WebCore::CompositeEditCommand::deleteTextFromNode):
1696         (WebCore::CompositeEditCommand::replaceTextInNode):
1697         (WebCore::CompositeEditCommand::moveParagraphs):
1698         (WebCore::EditCommandComposition::getNodesInCommand): Deleted.
1699         (WebCore::CompositeEditCommand::applyStyle): Deleted.
1700         (WebCore::CompositeEditCommand::insertLineBreak): Deleted.
1701         (WebCore::CompositeEditCommand::insertNodeAt): Deleted.
1702         (WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
1703         (WebCore::CompositeEditCommand::inputText): Deleted.
1704         * editing/CompositeEditCommand.h:
1705         * editing/DeleteFromTextNodeCommand.cpp:
1706         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
1707         (WebCore::DeleteFromTextNodeCommand::doApply):
1708         (WebCore::DeleteFromTextNodeCommand::doUnapply):
1709         * editing/DeleteFromTextNodeCommand.h:
1710         (WebCore::DeleteFromTextNodeCommand::create):
1711         (WebCore::DeleteFromTextNodeCommand::deletedText):
1712         * editing/DeleteSelectionCommand.cpp:
1713         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
1714         (WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
1715         * editing/DeleteSelectionCommand.h:
1716         (WebCore::DeleteSelectionCommand::create):
1717         * editing/DictationCommand.cpp:
1718         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
1719         (WebCore::DictationCommand::insertParagraphSeparator):
1720         * editing/EditAction.h:
1721         * editing/EditCommand.cpp:
1722         (WebCore::EditCommand::EditCommand):
1723         (WebCore::EditCommand::editingAction):
1724         (WebCore::EditCommand::applyEditType):
1725         (WebCore::EditCommand::unapplyEditType):
1726         (WebCore::SimpleEditCommand::SimpleEditCommand):
1727         (WebCore::SimpleEditCommand::notifyAccessibilityForTextChange):
1728         (WebCore::EditCommand::setParent): Deleted.
1729         * editing/EditCommand.h:
1730         * editing/EditingAllInOne.cpp:
1731         * editing/Editor.cpp:
1732         (WebCore::Editor::handleTextEvent):
1733         (WebCore::Editor::deleteSelectionWithSmartDelete):
1734         (WebCore::Editor::replaceSelectionWithFragment):
1735         (WebCore::Editor::replaceSelectionWithText):
1736         (WebCore::Editor::appliedEditing):
1737         (WebCore::Editor::unappliedEditing):
1738         (WebCore::Editor::performCutOrCopy):
1739         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1740         (WebCore::Editor::changeBackToReplacedString):
1741         (WebCore::Editor::transpose):
1742         (WebCore::Editor::changeSelectionAfterCommand):
1743         * editing/Editor.h:
1744         * editing/EditorCommand.cpp:
1745         (WebCore::executeInsertFragment):
1746         * editing/FrameSelection.cpp:
1747         (WebCore::FrameSelection::moveTo):
1748         (WebCore::FrameSelection::moveWithoutValidationTo):
1749         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
1750         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
1751         (WebCore::FrameSelection::setSelection):
1752         (WebCore::FrameSelection::updateAndRevealSelection):
1753         (WebCore::isBoundary):
1754         (WebCore::FrameSelection::textSelectionIntent):
1755         (WebCore::FrameSelection::modify):
1756         (WebCore::FrameSelection::selectAll):
1757         (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
1758         (WebCore::FrameSelection::modifyMovingBackward): Deleted.
1759         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Deleted.
1760         (WebCore::FrameSelection::selectionAtWordStart): Deleted.
1761         * editing/FrameSelection.h:
1762         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1763         (WebCore::FrameSelection::selection): Deleted.
1764         * editing/InsertIntoTextNodeCommand.cpp:
1765         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
1766         (WebCore::InsertIntoTextNodeCommand::doApply):
1767         (WebCore::InsertIntoTextNodeCommand::doUnapply):
1768         * editing/InsertIntoTextNodeCommand.h:
1769         (WebCore::InsertIntoTextNodeCommand::create):
1770         (WebCore::InsertIntoTextNodeCommand::insertedText):
1771         * editing/InsertNodeBeforeCommand.cpp:
1772         (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
1773         (WebCore::InsertNodeBeforeCommand::doApply):
1774         (WebCore::InsertNodeBeforeCommand::doUnapply):
1775         * editing/InsertNodeBeforeCommand.h:
1776         (WebCore::InsertNodeBeforeCommand::create):
1777         * editing/InsertParagraphSeparatorCommand.cpp:
1778         (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
1779         * editing/InsertParagraphSeparatorCommand.h:
1780         (WebCore::InsertParagraphSeparatorCommand::create):
1781         * editing/InsertTextCommand.cpp:
1782         (WebCore::InsertTextCommand::InsertTextCommand):
1783         * editing/InsertTextCommand.h:
1784         (WebCore::InsertTextCommand::create):
1785         (WebCore::InsertTextCommand::createWithMarkerSupplier):
1786         * editing/MoveSelectionCommand.cpp:
1787         (WebCore::MoveSelectionCommand::doApply):
1788         * editing/RemoveNodePreservingChildrenCommand.cpp:
1789         (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
1790         * editing/RemoveNodePreservingChildrenCommand.h:
1791         (WebCore::RemoveNodePreservingChildrenCommand::create):
1792         * editing/ReplaceDeleteFromTextNodeCommand.cpp: Copied from Source/WebCore/editing/AppendNodeCommand.h.
1793         (WebCore::ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand):
1794         (WebCore::ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange):
1795         * editing/ReplaceDeleteFromTextNodeCommand.h: Copied from Source/WebCore/editing/AppendNodeCommand.h.
1796         * editing/ReplaceInsertIntoTextNodeCommand.cpp: Added.
1797         (WebCore::ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand):
1798         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
1799         * editing/ReplaceInsertIntoTextNodeCommand.h: Copied from Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h.
1800         * editing/ReplaceSelectionCommand.cpp:
1801         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
1802         (WebCore::ReplaceSelectionCommand::InsertedNodes::didReplaceNode): Deleted.
1803         (WebCore::ReplaceSelectionCommand::insertAsListItems): Deleted.
1804         * editing/ReplaceSelectionCommand.h:
1805         (WebCore::ReplaceSelectionCommand::create):
1806         * editing/TypingCommand.cpp:
1807         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
1808         (WebCore::TypingCommand::insertParagraphSeparator):
1809         * editing/atk/FrameSelectionAtk.cpp:
1810         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1811         * editing/ios/DictationCommandIOS.cpp:
1812         (WebCore::DictationCommandIOS::DictationCommandIOS):
1813         * editing/ios/DictationCommandIOS.h:
1814         * editing/mac/FrameSelectionMac.mm:
1815         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1816         * html/HTMLTextFormControlElement.cpp:
1817         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
1818         * page/DragController.cpp:
1819         (WebCore::DragController::concludeEditDrag):
1820         * page/EventHandler.cpp:
1821         (WebCore::setInitialKeyboardSelection):
1822         * page/FocusController.cpp:
1823         (WebCore::FocusController::advanceFocusInDocumentOrder):
1824
1825 2015-04-26  Darin Adler  <darin@apple.com>
1826
1827         REGRESSION (r176751): line-height ignored in <button> elements
1828         https://bugs.webkit.org/show_bug.cgi?id=144234
1829
1830         Reviewed by Antti Koivisto.
1831
1832         Test: fast/forms/button-line-height.html
1833
1834         The theme code was overriding line heights on all themed form controls.
1835         Instead it should have only overridden line height when the theme overrides the font.
1836         For <input type=button> on Mac, the theme always overrides the font, but for
1837         other elements like <button> it does not.
1838
1839         * platform/Theme.h: Changed controlFont to return an Optional so we can tell
1840         when the theme is overriding the font. Otherwise if the font from the user-agent
1841         style sheet and the font from the theme are the same, we will think we are not
1842         overriding the font when we actually are.
1843
1844         * platform/mac/ThemeMac.h: Updated controlFont to return Optional.
1845         * platform/mac/ThemeMac.mm:
1846         (WebCore::ThemeMac::controlFont): Ditto.
1847
1848         * rendering/RenderTheme.cpp:
1849         (WebCore::RenderTheme::adjustStyle): Set line height only if the font is
1850         overriden by the theme, all the time for PushButtonPart on Mac, and not at all
1851         for other parts. Also tightened up the logic a little since RenderStyle's
1852         setFontDescription already does an "==" comparison; we don't have to do
1853         that twice.
1854
1855 2015-04-26  Darin Adler  <darin@apple.com>
1856
1857         REGRESSION (r173801): Use after free in WebCore::NotificationCenter::~NotificationCenter
1858         https://bugs.webkit.org/show_bug.cgi?id=137163
1859
1860         Reviewed by Andy Estes.
1861
1862         Test: fast/notifications/request-notification-permission-while-reloading.html
1863
1864         The test doesn't crash under WebKit2, but that's still OK for our purposes.
1865
1866         * Modules/notifications/NotificationCenter.cpp:
1867         (WebCore::NotificationCenter::NotificationCenter): Initialize m_timer.
1868         (WebCore::NotificationCenter::createNotification): Moved here from the header.
1869         (WebCore::NotificationCenter::requestPermission): Start the timer and ref the notification
1870         center when we need to defer a callback. Also use a lambda for the callback and changed
1871         the argument to match what the bindings actually pass. Before we said PassRefPtr, but the
1872         bindings were not transferring ownership of the VoidCallback. The new type is a little
1873         strange but it's consistent with how the bindings work right now.
1874         (WebCore::NotificationCenter::timerFired): Added. Calls all the callbacks, then does a deref
1875         to match the ref we did above.
1876         (WebCore::NotificationCenter::requestTimedOut): Deleted.
1877         (WebCore::NotificationCenter::NotificationRequestCallback::createAndStartTimer): Deleted.
1878         (WebCore::NotificationCenter::NotificationRequestCallback::NotificationRequestCallback): Deleted.
1879         (WebCore::NotificationCenter::NotificationRequestCallback::startTimer): Deleted.
1880         (WebCore::NotificationCenter::NotificationRequestCallback::timerFired): Deleted.
1881
1882         * Modules/notifications/NotificationCenter.h: Reorganized the header to be a bit more tidy.
1883         Changed the argument type for requestPermission to match the reality of what's passed by the
1884         bindings. Removed NotificationRequestCallback and replaced the m_callbacks HashSet with a
1885         vector of std::function.
1886
1887 2015-04-26  Simon Fraser  <simon.fraser@apple.com>
1888
1889         Modernize animations code
1890         https://bugs.webkit.org/show_bug.cgi?id=144196
1891
1892         Reviewed by Darin Adler.
1893         
1894         General cleanup in animation-related code.
1895         
1896         Use C++ references where possible. Use modern loops. Make classes fast-allocated.
1897         Use C++11 member initialization. Order member variables to optimize packing.
1898         
1899         This removes some null checks in CompositeAnimation, but the values in m_transitions
1900         and m_keyframeAnimations can never be null.
1901         
1902         No behavior change.
1903
1904         * page/animation/AnimationBase.cpp:
1905         (WebCore::AnimationBase::AnimationBase):
1906         (WebCore::AnimationBase::animationsMatch):
1907         (WebCore::AnimationBase::updateStateMachine):
1908         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1909         (WebCore::AnimationBase::beginAnimationUpdateTime):
1910         (WebCore::AnimationBase::getElapsedTime):
1911         * page/animation/AnimationBase.h:
1912         (WebCore::AnimationBase::animation):
1913         (WebCore::AnimationBase::setAnimation):
1914         * page/animation/AnimationController.cpp:
1915         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
1916         (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse):
1917         * page/animation/CompositeAnimation.cpp:
1918         (WebCore::CompositeAnimation::CompositeAnimation):
1919         (WebCore::CompositeAnimation::clearRenderer):
1920         (WebCore::CompositeAnimation::updateTransitions):
1921         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1922         (WebCore::CompositeAnimation::animate):
1923         (WebCore::CompositeAnimation::getAnimatedStyle):
1924         (WebCore::CompositeAnimation::timeToNextService):
1925         (WebCore::CompositeAnimation::getAnimationForProperty):
1926         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
1927         (WebCore::CompositeAnimation::suspendAnimations):
1928         (WebCore::CompositeAnimation::resumeAnimations):
1929         (WebCore::CompositeAnimation::overrideImplicitAnimations):
1930         (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations):
1931         (WebCore::CompositeAnimation::isAnimatingProperty):
1932         (WebCore::CompositeAnimation::pauseTransitionAtTime):
1933         (WebCore::CompositeAnimation::numberOfActiveAnimations):
1934         * page/animation/CompositeAnimation.h:
1935         (WebCore::CompositeAnimation::create):
1936         (WebCore::CompositeAnimation::animationController):
1937         * page/animation/ImplicitAnimation.cpp:
1938         (WebCore::ImplicitAnimation::ImplicitAnimation):
1939         (WebCore::ImplicitAnimation::sendTransitionEvent):
1940         * page/animation/ImplicitAnimation.h:
1941         (WebCore::ImplicitAnimation::create):
1942         * page/animation/KeyframeAnimation.cpp:
1943         (WebCore::KeyframeAnimation::KeyframeAnimation):
1944         (WebCore::KeyframeAnimation::animate):
1945         (WebCore::KeyframeAnimation::getAnimatedStyle):
1946         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
1947         (WebCore::KeyframeAnimation::startAnimation):
1948         (WebCore::KeyframeAnimation::sendAnimationEvent):
1949         (WebCore::KeyframeAnimation::overrideAnimations):
1950         (WebCore::KeyframeAnimation::resumeOverriddenAnimations):
1951         (WebCore::KeyframeAnimation::timeToNextService):
1952         * page/animation/KeyframeAnimation.h:
1953         * platform/animation/Animation.cpp:
1954         (WebCore::Animation::animationsMatch):
1955         * platform/animation/Animation.h:
1956         * rendering/RenderLayer.cpp:
1957         (WebCore::RenderLayer::paint):
1958         (WebCore::performOverlapTests):
1959         * rendering/style/KeyframeList.h:
1960         (WebCore::KeyframeList::properties):
1961         (WebCore::KeyframeList::keyframes):
1962         (WebCore::KeyframeList::beginProperties): Deleted.
1963         (WebCore::KeyframeList::endProperties): Deleted.
1964         (WebCore::KeyframeList::operator[]): Deleted.
1965         * rendering/style/RenderStyle.h:
1966
1967 2015-04-25  Simon Fraser  <simon.fraser@apple.com>
1968
1969         Expand compositing coverage rect when scrolling and animating
1970         https://bugs.webkit.org/show_bug.cgi?id=144214
1971         rdar://problem/20695926
1972
1973         Reviewed by Darin Adler.
1974         
1975         r183300 added a secondary rect that gets mapped through graphics layers during
1976         layer flushing, which represents a rect, in layer coordinates, that represents
1977         the portion of this layer that's visible in the viewport.
1978         
1979         This patch extends that rect based on scrolling and animating, with the extended
1980         coverage rect being mapped into descendants (where it's used to determine whether
1981         they should detach their backing store). This required moving the responsibility for
1982         extending the coverage rect from TileController (where it was used to compute
1983         tiled extent), to GraphicsLayerCA. Thus, GraphicsLayerCA now owns the concept
1984         of coverage rect, and pushes it onto TileControllers.
1985
1986         Test: compositing/tiling/transform-origin-tiled.html
1987
1988         * platform/graphics/TiledBacking.h: Coverage rect is now pushed onto
1989         TiledBacking from outside; new functions reflect that.
1990         * platform/graphics/ca/GraphicsLayerCA.cpp:
1991         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly): No need to pass
1992         old visible rect to commitLayerChangesBeforeSublayers.
1993         (WebCore::accumulatesTransform):
1994         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush): Now calls computeVisibleAndCoverageRect(),
1995         then adjustCoverageRect() which adjusts for scrolling and animations.
1996         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect): Fetch the coverage rect from the
1997         TransformState, but we can only use this if mapping it through various transforms didn't clamp
1998         it (which can happen with severe rotations in perspective).
1999         (WebCore::GraphicsLayerCA::adjustCoverageRect): If this layer represents the page tiled backing,
2000         ask the TileController to do coverage adjustment (code which should move into here eventually).
2001         For other tiled layers, do motion-based adjustment. This should really be done for all layers
2002         (an animating non-tiled layer may contain a tiled layer).
2003         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): The VisibleRectChanged wasn't needed
2004         any more; layers only react to changed in coverage rect now.
2005         (WebCore::GraphicsLayerCA::recursiveCommitChanges): If adjustCoverageRect() changed the
2006         coverage rect, here we push the new rect back into the TransformState so it will affect
2007         descendants.
2008         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2009         (WebCore::GraphicsLayerCA::updateCoverage): Coverage and backing store attachment go
2010         hand-in-hand now.
2011         (WebCore::GraphicsLayerCA::changeLayerTypeTo):
2012         (WebCore::GraphicsLayerCA::computeVisibleRect): Deleted.
2013         (WebCore::GraphicsLayerCA::updateBackingStoreAttachment): Deleted.
2014         (WebCore::GraphicsLayerCA::updateVisibleRect): Deleted.
2015         * platform/graphics/ca/GraphicsLayerCA.h:
2016         * platform/graphics/ca/TileController.cpp:
2017         (WebCore::TileController::setVisibleRect): Visible rect is only used for scroll performance
2018         logging now.
2019         (WebCore::TileController::setCoverageRect):
2020         (WebCore::TileController::tilesWouldChangeForCoverageRect):
2021         (WebCore::TileController::revalidateTiles):
2022         (WebCore::TileController::boundsForSize): This is required because when computeTileCoverageRect()
2023         is called at the top of committing the owning layer, we haven't yet pushed a new size to the
2024         underlying platform layer (which TileController::bounds() consults).
2025         (WebCore::TileController::bounds):
2026         (WebCore::TileController::computeTileCoverageRect): Have to push the new size in, since the
2027         underlying layer hasn't been updated yet.
2028         (WebCore::TileController::didRevalidateTiles):
2029         (WebCore::TileController::tilesWouldChangeForVisibleRect): Deleted.
2030         * platform/graphics/ca/TileController.h:
2031         * platform/graphics/ca/TileCoverageMap.cpp:
2032         (WebCore::TileCoverageMap::TileCoverageMap): Add a layer to the tile map that shows 
2033         a dark blue outline for the coverage rect.
2034         (WebCore::TileCoverageMap::update): Fix some minor issues with map position when top
2035         content inset is non-zero.
2036         * platform/graphics/ca/TileCoverageMap.h:
2037         * platform/graphics/ca/TileGrid.cpp: Everything is in terms of coverage rect now.
2038         (WebCore::TileGrid::tilesWouldChangeForCoverageRect):
2039         (WebCore::TileGrid::revalidateTiles):
2040         (WebCore::TileGrid::tilesWouldChangeForVisibleRect): Deleted.
2041         * platform/graphics/ca/TileGrid.h:
2042         * platform/graphics/transforms/TransformState.cpp:
2043         (WebCore::TransformState::operator=):
2044         (WebCore::TransformState::mappedQuad): Pass direction into mapQuad().
2045         (WebCore::TransformState::mappedSecondaryQuad): Ditto.
2046         (WebCore::TransformState::setLastPlanarSecondaryQuad): This function allows a caller
2047         to pass in a secondary quad, and get it mapped into the coordinate space of the last
2048         "flattening" state (since the TransformState may have in-flight XY offset, or transform).
2049         This mapping is achieved by re-using mapQuad(), but in the inverse direction.
2050         (WebCore::TransformState::mapQuad): Make direction a parameter.
2051         (WebCore::TransformState::flattenWithTransform): This code omitted to map the secondary
2052         quad. Failure was detected by tests.
2053         * platform/graphics/transforms/TransformState.h:
2054         (WebCore::TransformState::isMappingSecondaryQuad):
2055         (WebCore::TransformState::direction):
2056         (WebCore::TransformState::inverseDirection):
2057         (WebCore::TransformState::lastPlanarSecondaryQuad): Deleted.
2058
2059 2015-04-25  Dan Bernstein  <mitz@apple.com>
2060
2061         Updated expected bindings generation test results after r183343.
2062
2063         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h:
2064         * bindings/scripts/test/ObjC/DOMTestCallback.h:
2065         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h:
2066         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
2067         * bindings/scripts/test/ObjC/DOMTestEventTarget.h:
2068         * bindings/scripts/test/ObjC/DOMTestException.h:
2069         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h:
2070         * bindings/scripts/test/ObjC/DOMTestInterface.h:
2071         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h:
2072         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h:
2073         * bindings/scripts/test/ObjC/DOMTestNode.h:
2074         * bindings/scripts/test/ObjC/DOMTestNondeterministic.h:
2075         * bindings/scripts/test/ObjC/DOMTestObj.h:
2076         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h:
2077         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
2078         * bindings/scripts/test/ObjC/DOMTestTypedefs.h:
2079         * bindings/scripts/test/ObjC/DOMattribute.h:
2080         * bindings/scripts/test/ObjC/DOMreadonly.h:
2081
2082 2015-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2083
2084         font-synthesis's initial value is "style weight"
2085         https://bugs.webkit.org/show_bug.cgi?id=144195
2086
2087         Reviewed by Darin Adler.
2088
2089         Updated fast/css3-text/font-synthesis-parse.html.
2090
2091         * rendering/style/RenderStyle.h:
2092
2093 2015-04-25  Commit Queue  <commit-queue@webkit.org>
2094
2095         Unreviewed, rolling out r183305.
2096         https://bugs.webkit.org/show_bug.cgi?id=144213
2097
2098         Crashes on wikipedia (Requested by litherum on #webkit).
2099
2100         Reverted changeset:
2101
2102         "[Cocoa] FontPlatformData's equality check should always use
2103         reference URLs"
2104         https://bugs.webkit.org/show_bug.cgi?id=144168
2105         http://trac.webkit.org/changeset/183305
2106
2107 2015-04-25  Dan Bernstein  <mitz@apple.com>
2108
2109         WebCore part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE
2110         https://bugs.webkit.org/show_bug.cgi?id=144201
2111
2112         Reviewed by Darin Adler.
2113
2114         Instead of TBD, use the high version number to which it corresponds in CFAvailability.h,
2115         9876.5.
2116
2117         * bindings/objc/WebKitAvailability.h: Added a definition of __NSi_9876_5, so that we can
2118         use 9876_5 in availability macros. Removed the definition of
2119         __AVAILABILITY_INTERNAL__MAC_TBD, which will no longer be used.
2120
2121         * bindings/scripts/CodeGeneratorObjC.pm:
2122         (ReadPublicInterfaces): Use 9876_5 instead of TBD.
2123
2124 2015-04-25  Timothy Hatcher  <timothy@apple.com>
2125
2126         Update localized strings.
2127
2128         * English.lproj/Localizable.strings: Updated.
2129
2130 2015-04-25  Darin Adler  <darin@apple.com>
2131
2132         Crash if IDBTransaction is aborted right after it's created
2133         https://bugs.webkit.org/show_bug.cgi?id=144199
2134
2135         Reviewed by Simon Fraser.
2136
2137         Test: storage/indexeddb/transaction-abort.html
2138
2139         * Modules/indexeddb/IDBTransactionBackend.cpp:
2140         (WebCore::IDBTransactionBackend::IDBTransactionBackend): Don't start the
2141         transaction if it is already complete (has been aborted).
2142
2143 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
2144
2145         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
2146         https://bugs.webkit.org/show_bug.cgi?id=144182
2147
2148         Reviewed by Simon Fraser.
2149
2150         * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2151         * WebCore.vcxproj/WebCoreCommon.props: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2152         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2153         * css/CSSComputedStyleDeclaration.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2154         * css/MediaQueryEvaluator.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2155         * platform/graphics/GraphicsContext.h: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2156         * platform/graphics/cairo/GraphicsContextCairo.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2157         * platform/graphics/texmap/TextureMapperImageBuffer.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2158         * rendering/RenderLayer.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2159         * rendering/RenderLayerCompositor.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2160         * rendering/RenderObject.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2161
2162 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2163
2164         [Cocoa] FontPlatformData's equality check should always use reference URLs
2165         https://bugs.webkit.org/show_bug.cgi?id=144168
2166
2167         Reviewed by Tim Horton.
2168
2169         <rdar://problem/18985642> is not fixed, so we need to continue using the older
2170         objectForEqualityCheck().
2171
2172         No new tests because there is no behavior change.
2173
2174         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2175         (WebCore::FontPlatformData::objectForEqualityCheck):
2176
2177 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2178
2179         Implement parsing support for font-synthesis CSS property
2180         https://bugs.webkit.org/show_bug.cgi?id=144180
2181         <rdar://problem/20692791>
2182         <rdar://problem/20625024>
2183
2184         Reviewed by Tim Horton.
2185
2186         See http://www.w3.org/TR/css-fonts-3/#font-synthesis-prop
2187
2188         This property allows web authors to opt out of font synthesis. This patch only
2189         implements parsing support for the property.
2190
2191         Test: fast/css3-text/font-synthesis-parse.html
2192
2193         * css/CSSComputedStyleDeclaration.cpp:
2194         (WebCore::fontSynthesisFromStyle): Create a CSSValue for the existing style object.
2195         (WebCore::ComputedStyleExtractor::propertyValue): Call fontSynthesisFromStyle().
2196         * css/CSSParser.cpp:
2197         (WebCore::CSSParser::parseValue): Call parseFontSynthesis().
2198         (WebCore::CSSParser::parseFontSynthesis): Accept the grammar
2199         "none | [ weight || style ]"
2200         * css/CSSParser.h: Function signature.
2201         * css/CSSPropertyNames.in: New CSS property name.
2202         * css/CSSValueKeywords.in: New CSS value names.
2203         * css/StyleBuilderCustom.h:
2204         (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Construct an internal
2205         representation of font-synthesis for a given CSSValue.
2206         * rendering/style/RenderStyle.h: Function signature.
2207         * rendering/style/RenderStyleConstants.h: Internal representation of
2208         font-synthesis.
2209         * rendering/style/StyleRareInheritedData.h: Where we actually store the bits
2210         related to this internal representation.
2211
2212 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
2213
2214         Have the web inspector report accurate memory use for layers with detached backing store
2215         https://bugs.webkit.org/show_bug.cgi?id=144179
2216
2217         Reviewed by Dean Jackson.
2218
2219         Only report memory use for layers whose backing store is attached.
2220
2221         * platform/graphics/ca/GraphicsLayerCA.cpp:
2222         * platform/graphics/ca/PlatformCALayer.h: Add backingContributesToMemoryEstimate()
2223         which platforms can override if they allow backing store detaching.
2224
2225 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
2226
2227         Track a coverage rect through GraphicsLayerCA flushes, use it to mark backing store attached
2228         https://bugs.webkit.org/show_bug.cgi?id=144165
2229
2230         Reviewed by Dean Jackson.
2231         
2232         Push in the clipRect as the secondary rect when doing a GraphicsLayerCA flush,
2233         which maps this rect through all the layers. Each layer tests intersection with
2234         this rect to determine if its backing store should be attached.
2235         
2236         This will cause us to drop backing store for layers that don't intersect the
2237         visible part of the view, which is too aggressive. A future patch will add
2238         some padding.
2239
2240         Tests: compositing/visible-rect/coverage-clipped.html
2241                compositing/visible-rect/coverage-scrolling.html
2242
2243         * platform/graphics/ca/GraphicsLayerCA.cpp:
2244         (WebCore::GraphicsLayerCA::GraphicsLayerCA): Remove initialization of things with
2245         C++11 initializers. Initialize the new m_intersectsCoverageRect bit.
2246         (WebCore::GraphicsLayerCA::flushCompositingState): Push the clipRect in as the
2247         secondary coverage rect. A future patch will inflate this on the way down the tree.
2248         (WebCore::GraphicsLayerCA::computeVisibleRect): If we're clipping, and
2249         we have a secondary coverage rect, that rect can be clipped to us too.
2250         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2251         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2252         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2253         (WebCore::GraphicsLayerCA::updateBackingStoreAttachment):
2254         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
2255         * platform/graphics/ca/GraphicsLayerCA.h: New CoverageRectChanged bit.
2256         Use more C++11 initializers.
2257         (WebCore::GraphicsLayerCA::coverageRect):
2258
2259 2015-04-24  Dean Jackson  <dino@apple.com>
2260
2261         AnimationController::scrollWasUpdated() shows up in scrolling profiles on pages that don't use scroll triggers
2262         https://bugs.webkit.org/show_bug.cgi?id=144173
2263         <rdar://problem/20526168>
2264
2265         Reviewed by Simon Fraser.
2266
2267         Keep a list of Animations that care about scroll updates, and only
2268         run the animation update if the list is not empty.
2269
2270         Covered by existing tests.
2271
2272         * page/animation/AnimationBase.cpp:
2273         (WebCore::AnimationBase::updateStateMachine): Tell the AnimationController
2274         if this is an animation that depends on scrolling.
2275         * page/animation/AnimationController.cpp:
2276         (WebCore::AnimationControllerPrivate::animationWillBeRemoved): Call the
2277         new removeFromAnimationsDependentOnScroll as this animation is deleted.
2278         (WebCore::AnimationControllerPrivate::addToAnimationsDependentOnScroll):
2279         (WebCore::AnimationControllerPrivate::removeFromAnimationsDependentOnScroll):
2280         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Only update if
2281         there are animations that care.
2282         (WebCore::AnimationController::wantsScrollUpdates): Helper to expose this
2283         value to FrameView.
2284         * page/animation/AnimationController.h:
2285         * page/animation/AnimationControllerPrivate.h:
2286         (WebCore::AnimationControllerPrivate::wantsScrollUpdates):
2287
2288 2015-04-24  Tim Horton  <timothy_horton@apple.com>
2289
2290         WKPDFView does not support password-protected PDFs
2291         https://bugs.webkit.org/show_bug.cgi?id=144162
2292         <rdar://problem/18411512>
2293
2294         Reviewed by Andy Estes.
2295
2296         * English.lproj/Localizable.strings:
2297         Add some localizable strings.
2298
2299 2015-04-24  David Kilzer  <ddkilzer@apple.com>
2300
2301         Fix iOS EWS builds after updating to iOS 8.3 SDK
2302
2303         * platform/spi/cocoa/CoreTextSPI.h:
2304         * rendering/RenderThemeIOS.mm:
2305         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2306         - Update __IPHONE_OS_VERSION_MIN_REQUIRED for these constants.
2307
2308 2015-04-24  Jer Noble  <jer.noble@apple.com>
2309
2310         Unreviewed iOS build fix; add declarations to AVKitSPI.h
2311
2312         * platform/spi/cocoa/AVKitSPI.h:
2313
2314 2015-04-24  Enrica Casucci  <enrica@apple.com>
2315
2316         Make rangeExpandedAroundPositionByCharacters to all platforms.
2317         https://bugs.webkit.org/show_bug.cgi?id=144161
2318
2319         Reviewed by Tim Horton.
2320
2321         No change in functionality, simply making this available
2322         to all platforms.
2323
2324         * editing/VisibleUnits.cpp:
2325         (WebCore::rangeExpandedAroundPositionByCharacters):
2326         * editing/VisibleUnits.h:
2327         * editing/mac/DataDetection.mm:
2328         * editing/mac/DictionaryLookup.h:
2329         * editing/mac/DictionaryLookup.mm:
2330         (WebCore::rangeExpandedAroundPositionByCharacters): Deleted.
2331
2332 2015-04-24  Andreas Kling  <akling@apple.com>
2333
2334         Purge PassRefPtr from NamedNodeMap.
2335         <https://webkit.org/b/144091>
2336
2337         Reviewed by Antti Koivisto.
2338
2339         Use RefPtr instead of PassRefPtr in NamedNodeMap.
2340
2341         * dom/NamedNodeMap.cpp:
2342         (WebCore::NamedNodeMap::getNamedItem):
2343         (WebCore::NamedNodeMap::getNamedItemNS):
2344         (WebCore::NamedNodeMap::removeNamedItem):
2345         (WebCore::NamedNodeMap::removeNamedItemNS):
2346         (WebCore::NamedNodeMap::setNamedItem):
2347         (WebCore::NamedNodeMap::setNamedItemNS):
2348         (WebCore::NamedNodeMap::item):
2349         * dom/NamedNodeMap.h:
2350
2351 2015-04-24  Commit Queue  <commit-queue@webkit.org>
2352
2353         Unreviewed, rolling out r183266.
2354         https://bugs.webkit.org/show_bug.cgi?id=144164
2355
2356         Broke 32-bit build and a test. (Requested by ap on #webkit).
2357
2358         Reverted changeset:
2359
2360         "AX: richer text change notifications (142719)"
2361         https://bugs.webkit.org/show_bug.cgi?id=142719
2362         http://trac.webkit.org/changeset/183266
2363
2364 2015-04-24  Brady Eidson  <beidson@apple.com>
2365
2366         Origin header is preserved on cross-origin redirects.
2367         https://bugs.webkit.org/show_bug.cgi?id=144157.
2368
2369         Reviewed by Sam Weinig.
2370
2371         Tests: http/tests/security/cors-post-redirect-301.html
2372                http/tests/security/cors-post-redirect-302.html
2373                http/tests/security/cors-post-redirect-307.html
2374                http/tests/security/cors-post-redirect-308.html
2375
2376         * platform/network/cf/ResourceHandleCFNet.cpp:
2377         (WebCore::ResourceHandle::willSendRequest): Always clear any origin header for cross-origin redirects.
2378         * platform/network/mac/ResourceHandleMac.mm:
2379         (WebCore::ResourceHandle::willSendRequest): Ditto.
2380
2381 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
2382
2383         Immediate action not functional for embedded PDFs
2384         https://bugs.webkit.org/show_bug.cgi?id=143952
2385         <rdar://problem/19842365>        
2386
2387         Reviewed by Tim Horton.
2388
2389         Add a dictionary lookup method to allow us to retrieve
2390         relevant information for PDFs.
2391
2392         * editing/mac/DictionaryLookup.mm:
2393         (WebCore::dictionaryLookupForPDFSelection): Updated to properly handle cases
2394         where the Lookup engine selects a smaller range than the initial automatic
2395         selection performed on clicking.
2396
2397 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
2398
2399         Make it possible to map a secondary quad through TransformState
2400         https://bugs.webkit.org/show_bug.cgi?id=144156
2401
2402         Reviewed by Dean Jackson.
2403
2404         A future patch will need to map two quads simultaneously through TransformState,
2405         so add the ability to provide an optional secondary quad.
2406         
2407         This patch also firms up the setQuad() contract, fixing webkit.org/b/106680,
2408         requiring the state to be flattened when setting the quad (and now, the secondary quad).
2409         Previously, setQuad implicitly flattened but failed to update m_mapPoint when
2410         doing so.
2411
2412         * platform/graphics/ca/GraphicsLayerCA.cpp:
2413         (WebCore::GraphicsLayerCA::computeVisibleRect): Now we have to explicitly flatten
2414         before setting the quad.
2415         * platform/graphics/ca/GraphicsLayerCA.h: Drive-up #include removal.
2416         * platform/graphics/transforms/TransformState.cpp:
2417         (WebCore::TransformState::operator=): Copy the secondary quad if we have one.
2418         (WebCore::TransformState::translateMappedCoordinates): Move the secondary quad
2419         if we have one.
2420         (WebCore::TransformState::mappedQuad): Code factored into mapQuad().
2421         (WebCore::TransformState::mappedSecondaryQuad): Return the secondary quad mapped
2422         into the state's current coordinate space.
2423         (WebCore::TransformState::mapQuad): Factored code.
2424         * platform/graphics/transforms/TransformState.h:
2425         (WebCore::TransformState::setQuad): Make the contract more explicit with assertions.
2426         (WebCore::TransformState::setSecondaryQuad): Ditto when setting the secondary quad.
2427         (WebCore::TransformState::lastPlanarSecondaryQuad):
2428         (WebCore::TransformState::lastPlanarQuad): Deleted.
2429
2430 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2431
2432         [iOS] Reimplement r182512 and r183153 in a cleaner way
2433         https://bugs.webkit.org/show_bug.cgi?id=144151
2434
2435         Reviewed by Enrica Casucci.
2436
2437         On iOS, we create FontPlatformData's ctFont() by round tripping it through a CGFontRef.
2438         This causes the resultant ctFont() to lose system-font-ness. Patches r182512 and r183153
2439         react to this fact by making users of a FontPlatformData use the original font passed in
2440         to the FontPlatformData instead of the FontPlatformData's ctFont(), but only if we
2441         detect that the FontPlatformData represents a system font (the underlying APIs have
2442         different behavior for system fonts and non-system-fonts).
2443
2444         However, on OS X, we create a FontPlatformData's ctFont() directly from the original
2445         font passed in to the constructor. This preserves system-font-ness (because it no
2446         longer has the CGFontRef in the middle of the transformation). Therefore, OS X has the
2447         correct behavior regarding system fonts.
2448
2449         The difference between the two ctFont() creation codepaths seems to be historical
2450         rather than intentional. Rather than change all the call sites of ctFont() to use a
2451         different platform font object if a system font is detected, a cleaner solution is to
2452         simply unify the two ctFont() creation codepaths to the version which preserves system-
2453         font-ness. Doing this will make all users of FontPlatformData automatically have the
2454         correct behavior with no updates.
2455
2456         This patch reverts the relevant parts of r182512 and r183153 in favor of this new
2457         solution.
2458
2459         No new tests because there is no behavior change.
2460
2461         * platform/graphics/FontPlatformData.h:
2462         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
2463         * platform/graphics/cocoa/FontCocoa.mm:
2464         (WebCore::Font::platformWidthForGlyph):
2465         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2466         (WebCore::FontPlatformData::ctFontSize):
2467         (WebCore::FontPlatformData::ctFont):
2468         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
2469         (WebCore::Font::getCFStringAttributes):
2470
2471 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2472
2473         Unreviewed build fix.
2474
2475         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2476         (WebCore::FontPlatformData::FontPlatformData):
2477
2478 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2479
2480         [Cocoa] Start cleaning up FontPlatformData
2481         https://bugs.webkit.org/show_bug.cgi?id=144133
2482
2483         Reviewed by Enrica Casucci.
2484
2485         This is the start of a crusade to ultimately remove one of the CTFontRefs which we have inside
2486         FontPlatformData. This patch starts this effort out by removing the FontPlatformData
2487         constructor which accepts an NSFont. This constructor simply casts the NSFont to a CTFontRef,
2488         and forwards to another constructor. This patch moves this cast to callers of this constructor,
2489         thereby enumerating the places we have left that use NSFont with FontPlatformData.
2490
2491         This patch also cleans up two of the constructors in FontPlatformData.cpp to forward on to
2492         a common constructor.
2493
2494         This patch also collects places inside FontPlatformDataCocoa.mm where we check if a pointer is
2495         not 0 and not -1, and puts this common code inside a new function,
2496         FontPlatformData::isValidCTFontRef().
2497
2498         No new tests because there is no behavior change.
2499
2500         * platform/graphics/FontPlatformData.cpp:
2501         (WebCore::FontPlatformData::FontPlatformData): Coalesce constructors.
2502         * platform/graphics/FontPlatformData.h:
2503         (WebCore::FontPlatformData::isValidCTFontRef): Check if a pointer is not 0 and not -1.
2504         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
2505         * platform/graphics/cocoa/FontCocoa.mm:
2506         (WebCore::Font::platformCreateScaledFont): Receive cast which has been hoisted from the deleted
2507         FontPlatformData constructor.
2508         (WebCore::Font::compositeFontReferenceFont): Ditto.
2509         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2510         (WebCore::FontPlatformData::~FontPlatformData): Use isValidCTFontRef().
2511         (WebCore::FontPlatformData::platformDataInit): Ditto.
2512         (WebCore::FontPlatformData::platformDataAssign): Ditto.
2513         (WebCore::FontPlatformData::platformIsEqual): Simplify preprocessor macros.
2514         (WebCore::FontPlatformData::allowsLigatures): Remove unnecessary NSFont use.
2515         (WebCore::FontPlatformData::FontPlatformData): Deleted.
2516         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2517         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Remove unnecessary
2518         NSFont use.
2519         * platform/graphics/mac/FontCacheMac.mm:
2520         (WebCore::FontCache::systemFallbackForCharacters): Receive cast which has been hoisted from the
2521         deleted FontPlatformData constructor.
2522         (WebCore::FontCache::createFontPlatformData): Ditto.
2523         * platform/mac/DragImageMac.mm:
2524         (WebCore::fontFromNSFont): Ditto.
2525         (WebCore::widthWithFont): Ditto.
2526         (WebCore::drawAtPoint): Ditto.
2527
2528 2015-04-24  Doug Russell  <d_russell@apple.com>
2529
2530         AX: richer text change notifications (142719)
2531         https://bugs.webkit.org/show_bug.cgi?id=142719
2532
2533         Reviewed by Darin Adler.
2534
2535         Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
2536
2537         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields.
2538
2539         Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
2540                platform/mac/accessibility/selection-change-userinfo.html
2541                platform/mac/accessibility/value-change-userinfo.html
2542
2543         * CMakeLists.txt:
2544         * WebCore.vcxproj/WebCore.vcxproj:
2545         * WebCore.vcxproj/WebCore.vcxproj.filters:
2546         * WebCore.xcodeproj/project.pbxproj:
2547         * accessibility/AXObjectCache.cpp:
2548         (WebCore::AXObjectCache::AXObjectCache):
2549         (WebCore::AXObjectCache::notificationPostTimerFired):
2550         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
2551         (WebCore::AXObjectCache::showIntent):
2552         (WebCore::AXObjectCache::setTextSelectionIntent):
2553         (WebCore::isPasswordFieldOrContainedByPasswordField):
2554         (WebCore::AXObjectCache::postTextStateChangeNotification):
2555         (WebCore::AXObjectCache::postTextReplacementNotification):
2556         (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
2557         (WebCore::AXObjectCache::rootWebArea):
2558         (WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
2559         * accessibility/AXObjectCache.h:
2560         (WebCore::AXObjectCache::postTextStateChangeNotification):
2561         (WebCore::AXObjectCache::postTextReplacementNotification):
2562         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2563         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
2564         (WebCore::AXObjectCache::textChangeForEditType):
2565         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2566         (WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
2567         (WebCore::AXObjectCache::getOrCreate): Deleted.
2568         (WebCore::AXObjectCache::attachWrapper): Deleted.
2569         * accessibility/AXTextStateChangeIntent.h: Added.
2570         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
2571         * accessibility/AccessibilityNodeObject.cpp:
2572         (WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
2573         * accessibility/AccessibilityNodeObject.h:
2574         * accessibility/AccessibilityObject.cpp:
2575         (WebCore::AccessibilityObject::isContainedByPasswordField):
2576         * accessibility/AccessibilityObject.h:
2577         (WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
2578         (WebCore::AccessibilityObject::isPasswordField): Deleted.
2579         * accessibility/AccessibilityRenderObject.cpp:
2580         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
2581         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
2582         * accessibility/AccessibilityScrollView.h:
2583         * accessibility/atk/AXObjectCacheAtk.cpp:
2584         (WebCore::AXObjectCache::textChangeForEditType):
2585         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2586         (WebCore::AXObjectCache::postPlatformNotification): Deleted.
2587         * accessibility/ios/AXObjectCacheIOS.mm:
2588         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2589         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
2590         * accessibility/mac/AXObjectCacheMac.mm:
2591         (WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
2592         (WebCore::AXPostNotificationWithUserInfo):
2593         (WebCore::AXObjectCache::postPlatformNotification):
2594         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2595         (WebCore::textReplacementChangeDictionary):
2596         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
2597         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2598         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2599         (+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
2600         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
2601         (arrayRemovingNonJSONTypes):
2602         (dictionaryRemovingNonJSONTypes):
2603         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
2604         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
2605         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2606         (textMarkerRangeFromVisiblePositions):
2607         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
2608         * editing/AppendNodeCommand.cpp:
2609         (WebCore::AppendNodeCommand::AppendNodeCommand):
2610         (WebCore::sendAXTextChangedIgnoringLineBreaks):
2611         (WebCore::AppendNodeCommand::doApply):
2612         (WebCore::AppendNodeCommand::doUnapply):
2613         * editing/AppendNodeCommand.h:
2614         (WebCore::AppendNodeCommand::create):
2615         * editing/ApplyStyleCommand.cpp:
2616         (WebCore::ApplyStyleCommand::ApplyStyleCommand):
2617         (WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
2618         * editing/ApplyStyleCommand.h:
2619         * editing/CompositeEditCommand.cpp:
2620         (WebCore::EditCommandComposition::unapplyEditType):
2621         (WebCore::CompositeEditCommand::CompositeEditCommand):
2622         (WebCore::CompositeEditCommand::apply):
2623         (WebCore::CompositeEditCommand::insertParagraphSeparator):
2624         (WebCore::CompositeEditCommand::insertNodeBefore):
2625         (WebCore::CompositeEditCommand::appendNode):
2626         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
2627         (WebCore::CompositeEditCommand::insertTextIntoNode):
2628         (WebCore::CompositeEditCommand::deleteTextFromNode):
2629         (WebCore::CompositeEditCommand::replaceTextInNode):
2630         (WebCore::CompositeEditCommand::moveParagraphs):
2631         (WebCore::EditCommandComposition::getNodesInCommand): Deleted.
2632         (WebCore::CompositeEditCommand::applyStyle): Deleted.
2633         (WebCore::CompositeEditCommand::insertLineBreak): Deleted.
2634         (WebCore::CompositeEditCommand::insertNodeAt): Deleted.
2635         (WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
2636         (WebCore::CompositeEditCommand::inputText): Deleted.
2637         * editing/CompositeEditCommand.h:
2638         * editing/DeleteFromTextNodeCommand.cpp:
2639         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
2640         (WebCore::DeleteFromTextNodeCommand::doApply):
2641         (WebCore::DeleteFromTextNodeCommand::doUnapply):
2642         * editing/DeleteFromTextNodeCommand.h:
2643         (WebCore::DeleteFromTextNodeCommand::create):
2644         (WebCore::DeleteFromTextNodeCommand::deletedText):
2645         * editing/DeleteSelectionCommand.cpp:
2646         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
2647         (WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
2648         * editing/DeleteSelectionCommand.h:
2649         (WebCore::DeleteSelectionCommand::create):
2650         * editing/DictationCommand.cpp:
2651         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
2652         (WebCore::DictationCommand::insertParagraphSeparator):
2653         * editing/EditAction.h:
2654         * editing/EditCommand.cpp:
2655         (WebCore::EditCommand::EditCommand):
2656         (WebCore::EditCommand::editingAction):
2657         (WebCore::EditCommand::applyEditType):
2658         (WebCore::EditCommand::unapplyEditType):
2659         (WebCore::SimpleEditCommand::SimpleEditCommand):
2660         (WebCore::SimpleEditCommand::notifyAccessibilityForTextChange):
2661         (WebCore::EditCommand::setParent): Deleted.
2662         * editing/EditCommand.h:
2663         * editing/EditingAllInOne.cpp:
2664         * editing/Editor.cpp:
2665         (WebCore::Editor::handleTextEvent):
2666         (WebCore::Editor::deleteSelectionWithSmartDelete):
2667         (WebCore::Editor::replaceSelectionWithFragment):
2668         (WebCore::Editor::replaceSelectionWithText):
2669         (WebCore::Editor::appliedEditing):
2670         (WebCore::Editor::unappliedEditing):
2671         (WebCore::Editor::performCutOrCopy):
2672         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2673         (WebCore::Editor::changeBackToReplacedString):
2674         (WebCore::Editor::transpose):
2675         (WebCore::Editor::changeSelectionAfterCommand):
2676         * editing/Editor.h:
2677         * editing/EditorCommand.cpp:
2678         (WebCore::executeInsertFragment):
2679         * editing/FrameSelection.cpp:
2680         (WebCore::FrameSelection::moveTo):
2681         (WebCore::FrameSelection::moveWithoutValidationTo):
2682         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
2683         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
2684         (WebCore::FrameSelection::setSelection):
2685         (WebCore::FrameSelection::updateAndRevealSelection):
2686         (WebCore::isBoundary):
2687         (WebCore::FrameSelection::textSelectionIntent):
2688         (WebCore::FrameSelection::modify):
2689         (WebCore::FrameSelection::selectAll):
2690         (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
2691         (WebCore::FrameSelection::modifyMovingBackward): Deleted.
2692         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Deleted.
2693         (WebCore::FrameSelection::selectionAtWordStart): Deleted.
2694         * editing/FrameSelection.h:
2695         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2696         (WebCore::FrameSelection::selection): Deleted.
2697         * editing/InsertIntoTextNodeCommand.cpp:
2698         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
2699         (WebCore::InsertIntoTextNodeCommand::doApply):
2700         (WebCore::InsertIntoTextNodeCommand::doUnapply):
2701         * editing/InsertIntoTextNodeCommand.h:
2702         (WebCore::InsertIntoTextNodeCommand::create):
2703         (WebCore::InsertIntoTextNodeCommand::insertedText):
2704         * editing/InsertNodeBeforeCommand.cpp:
2705         (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
2706         (WebCore::InsertNodeBeforeCommand::doApply):
2707         (WebCore::InsertNodeBeforeCommand::doUnapply):
2708         * editing/InsertNodeBeforeCommand.h:
2709         (WebCore::InsertNodeBeforeCommand::create):
2710         * editing/InsertParagraphSeparatorCommand.cpp:
2711         (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
2712         * editing/InsertParagraphSeparatorCommand.h:
2713         (WebCore::InsertParagraphSeparatorCommand::create):
2714         * editing/InsertTextCommand.cpp:
2715         (WebCore::InsertTextCommand::InsertTextCommand):
2716         * editing/InsertTextCommand.h:
2717         (WebCore::InsertTextCommand::create):
2718         (WebCore::InsertTextCommand::createWithMarkerSupplier):
2719         * editing/MoveSelectionCommand.cpp:
2720         (WebCore::MoveSelectionCommand::doApply):
2721         * editing/RemoveNodePreservingChildrenCommand.cpp:
2722         (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
2723         * editing/RemoveNodePreservingChildrenCommand.h:
2724         (WebCore::RemoveNodePreservingChildrenCommand::create):
2725         * editing/ReplaceDeleteFromTextNodeCommand.cpp: Copied from Source/WebCore/editing/AppendNodeCommand.h.
2726         (WebCore::ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand):
2727         (WebCore::ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange):
2728         * editing/ReplaceDeleteFromTextNodeCommand.h: Copied from Source/WebCore/editing/AppendNodeCommand.h.
2729         * editing/ReplaceInsertIntoTextNodeCommand.cpp: Added.
2730         (WebCore::ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand):
2731         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
2732         * editing/ReplaceInsertIntoTextNodeCommand.h: Copied from Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h.
2733         * editing/ReplaceSelectionCommand.cpp:
2734         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
2735         (WebCore::ReplaceSelectionCommand::InsertedNodes::didReplaceNode): Deleted.
2736         (WebCore::ReplaceSelectionCommand::insertAsListItems): Deleted.
2737         * editing/ReplaceSelectionCommand.h:
2738         (WebCore::ReplaceSelectionCommand::create):
2739         * editing/TypingCommand.cpp:
2740         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
2741         (WebCore::TypingCommand::insertParagraphSeparator):
2742         * editing/atk/FrameSelectionAtk.cpp:
2743         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2744         * editing/ios/DictationCommandIOS.cpp:
2745         (WebCore::DictationCommandIOS::DictationCommandIOS):
2746         * editing/ios/DictationCommandIOS.h:
2747         * editing/mac/FrameSelectionMac.mm:
2748         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2749         * html/HTMLTextFormControlElement.cpp:
2750         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
2751         * page/DragController.cpp:
2752         (WebCore::DragController::concludeEditDrag):
2753         * page/EventHandler.cpp:
2754         (WebCore::setInitialKeyboardSelection):
2755         * page/FocusController.cpp:
2756         (WebCore::FocusController::advanceFocusInDocumentOrder):
2757
2758 2015-04-24  Darin Adler  <darin@apple.com>
2759
2760         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
2761         https://bugs.webkit.org/show_bug.cgi?id=128007
2762
2763         Reviewed by Anders Carlsson.
2764
2765         * PlatformEfl.cmake: Removed OwnPtrCairo source files.
2766         * PlatformGTK.cmake: Ditto.
2767         * PlatformWinCairo.cmake: Ditto.
2768         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2769         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2770
2771         * platform/CrossThreadCopier.cpp: Removed OwnPtr specialization.
2772         * platform/CrossThreadCopier.h: Ditto.
2773
2774         * platform/ScrollAnimatorNone.cpp: Removed unneeded include.
2775         * platform/ThreadGlobalData.cpp: Ditto.
2776         * platform/ThreadGlobalData.h: Ditto.
2777         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Ditto.
2778
2779         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2780         (WebCore::AVFWrapper::processNotification): Use unique_ptr.
2781         (WebCore::AVFWrapper::notificationCallback): Use make_unique.
2782         (WebCore::AVFWrapper::platformLayer): Ditto.
2783
2784         * platform/graphics/cairo/CairoUtilities.cpp:
2785         (WebCore::appendPathToCairoContext): Use cairo_path_destroy directly
2786         instead of a smart pointer; the code path is simple enough that it is
2787         clear this way.
2788
2789         * platform/graphics/cairo/ImageBufferCairo.cpp:
2790         (WebCore::ImageBuffer::ImageBuffer): Use make_unique.
2791         * platform/graphics/cairo/ImageBufferDataCairo.h: Use unique_ptr.
2792
2793         * platform/graphics/cairo/OwnPtrCairo.cpp: Removed.
2794         * platform/graphics/cairo/OwnPtrCairo.h: Removed.
2795
2796         * platform/graphics/cairo/PathCairo.cpp:
2797         (WebCore::Path::Path): Use cairo_path_destroy directly instead of a
2798         smart pointer; the code path is simple enough that it is clear this way.
2799         (WebCore::Path::operator=): Ditto.
2800         (WebCore::Path::addPath): Ditto.
2801         (WebCore::Path::apply): Ditto.
2802         * platform/graphics/cairo/PlatformContextCairo.cpp:
2803         (WebCore::PlatformContextCairo::clipForPatternFilling): Ditto.
2804
2805         * platform/graphics/freetype/FontCacheFreeType.cpp: Removed unneeded include.
2806         * platform/graphics/glx/GLContextGLX.cpp: Ditto.
2807
2808         * platform/graphics/surfaces/egl/EGLSurface.cpp:
2809         (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Use make_unique.
2810
2811         * platform/graphics/surfaces/glx/GLXConfigSelector.h:
2812         (WebCore::GLXConfigSelector::findMatchingConfig): Use unique_ptr with X11Deleter.
2813         (WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
2814         * platform/graphics/surfaces/glx/GLXSurface.cpp:
2815         (WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
2816         (WebCore::GLXOffScreenSurface::initialize): Ditto.
2817
2818         * platform/graphics/surfaces/glx/OwnPtrX11.h: Removed.
2819
2820         * platform/graphics/surfaces/glx/X11Helper.cpp:
2821         (WebCore::X11Helper::createOffScreenWindow): Use unique_ptr with X11Deleter.
2822         (WebCore::X11Helper::createPixmap): Ditto.
2823
2824         * platform/graphics/surfaces/glx/X11Helper.h: Added X11Deleter,
2825         which can be used with unique_ptr to make it call XFree instead of delete.
2826
2827         * platform/graphics/win/FullScreenController.cpp: Use unique_ptr.
2828         (FullScreenController::FullScreenController): Use make_unique.
2829         (FullScreenController::enterFullScreen): Ditto.
2830         * platform/graphics/win/FullScreenController.h: Use unique_ptr.
2831
2832         * platform/graphics/win/GraphicsContext3DWin.cpp: Removed unneeded includes.
2833
2834         * platform/graphics/win/WKCAImageQueue.cpp:
2835         (WebCore::WKCAImageQueue::WKCAImageQueue): Use make_unique.
2836         * platform/graphics/win/WKCAImageQueue.h: Use unique_ptr.
2837
2838         * platform/network/NetworkStorageSessionStub.cpp: Removed unneeded include.
2839
2840         * platform/network/ResourceHandleInternal.h: Use unique_ptr.
2841
2842         * platform/network/curl/MultipartHandle.cpp:
2843         (WebCore::MultipartHandle::create): Deleted.
2844         * platform/network/curl/MultipartHandle.h: Deleted the create function.
2845
2846         * platform/network/curl/ResourceHandleManager.cpp:
2847         (WebCore::headerCallback): Use make_unique.
2848
2849 2015-04-24  Per Arne Vollan  <peavo@outlook.com>
2850
2851         [Win] Popup menu is not accessible.
2852         https://bugs.webkit.org/show_bug.cgi?id=141704
2853
2854         Reviewed by Brent Fulgham.
2855
2856         Get accessibility information for items in popup menus.
2857
2858         * platform/win/PopupMenuWin.cpp:
2859         (WebCore::PopupMenuWin::onGetObject):
2860         (WebCore::PopupMenuWin::wndProc):
2861         (WebCore::AccessiblePopupMenu::AccessiblePopupMenu):
2862         (WebCore::AccessiblePopupMenu::~AccessiblePopupMenu):
2863         (WebCore::AccessiblePopupMenu::QueryInterface):
2864         (WebCore::AccessiblePopupMenu::AddRef):
2865         (WebCore::AccessiblePopupMenu::Release):
2866         (WebCore::AccessiblePopupMenu::GetTypeInfoCount):
2867         (WebCore::AccessiblePopupMenu::GetTypeInfo):
2868         (WebCore::AccessiblePopupMenu::GetIDsOfNames):
2869         (WebCore::AccessiblePopupMenu::Invoke):
2870         (WebCore::AccessiblePopupMenu::get_accParent):
2871         (WebCore::AccessiblePopupMenu::get_accChildCount):
2872         (WebCore::AccessiblePopupMenu::get_accChild):
2873         (WebCore::AccessiblePopupMenu::get_accName):
2874         (WebCore::AccessiblePopupMenu::get_accValue):
2875         (WebCore::AccessiblePopupMenu::get_accDescription):
2876         (WebCore::AccessiblePopupMenu::get_accRole):
2877         (WebCore::AccessiblePopupMenu::get_accState):
2878         (WebCore::AccessiblePopupMenu::get_accHelp):
2879         (WebCore::AccessiblePopupMenu::get_accKeyboardShortcut):
2880         (WebCore::AccessiblePopupMenu::get_accFocus):
2881         (WebCore::AccessiblePopupMenu::get_accSelection):
2882         (WebCore::AccessiblePopupMenu::get_accDefaultAction):
2883         (WebCore::AccessiblePopupMenu::accSelect):
2884         (WebCore::AccessiblePopupMenu::accLocation):
2885         (WebCore::AccessiblePopupMenu::accNavigate):
2886         (WebCore::AccessiblePopupMenu::accHitTest):
2887         (WebCore::AccessiblePopupMenu::accDoDefaultAction):
2888         (WebCore::AccessiblePopupMenu::put_accName):
2889         (WebCore::AccessiblePopupMenu::put_accValue):
2890         (WebCore::AccessiblePopupMenu::get_accHelpTopic):
2891         * platform/win/PopupMenuWin.h:
2892         * platform/win/ScrollbarThemeWin.h:
2893         (WebCore::ScrollbarThemeWin::hasButtons): Deleted.
2894
2895 2015-04-23  Antti Koivisto  <antti@apple.com>
2896
2897         Memory cache live resources repeatedly purged during painting
2898         https://bugs.webkit.org/show_bug.cgi?id=144104
2899         <rdar://problem/20667695>
2900
2901         Reviewed by Chris Dumez.
2902
2903         On some PLT pages (like nytimes.com) we get into state where painting repeatedly purges live bitmaps.
2904         This slows down page loads significantly.
2905
2906         This might have regressed because improvements in page caching keep more pages and so resources 'live'.
2907
2908         With this path we do all regular cache pruning asynchronously. If memory is really critical
2909         the low memory handling code will still prune synchronously.
2910
2911         * loader/cache/CachedResource.cpp:
2912         (WebCore::CachedResource::removeClient):
2913         (WebCore::CachedResource::didAccessDecodedData):
2914
2915             prune() -> pruneSoon()
2916
2917         * loader/cache/MemoryCache.cpp:
2918
2919             Decrease the pruning size target from 0.95 to 0.8 so we don't need to prune so often.
2920
2921         (WebCore::MemoryCache::needsPruning):
2922
2923             Factor into a function.
2924
2925         (WebCore::MemoryCache::prune):
2926         (WebCore::MemoryCache::pruneSoon):
2927
2928             Prune asynchronously.
2929
2930         * loader/cache/MemoryCache.h:
2931
2932 2015-04-24  Antti Koivisto  <antti@apple.com>
2933
2934         Unreviewed, rolling out r183259.
2935
2936         Wrong ChangeLog.
2937
2938         Reverted changeset:
2939
2940         "Memory cache live resources repeatedly purged during
2941         painting"
2942         https://bugs.webkit.org/show_bug.cgi?id=144104
2943         http://trac.webkit.org/changeset/183259
2944
2945 2015-04-24  Antti Koivisto  <antti@apple.com>
2946
2947         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
2948         https://bugs.webkit.org/show_bug.cgi?id=144050
2949
2950         Reviewed by Chris Dumez.
2951
2952         We are seeing null Element pointer crashes with this stack:
2953
2954         47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
2955         47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
2956         47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175
2957
2958         The most likely cause seems to be that this code
2959
2960             ASSERT(m_pendingAsyncScripts.contains(scriptElement));
2961             m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));
2962
2963         in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with null entry in
2964         m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
2965         could happen. The related code is fragile with lot of state (especially in ScriptElement class)
2966         and involves many opportunities for re-entry via scripts.
2967
2968         No repro, no test case.
2969
2970         * dom/ScriptRunner.cpp:
2971         (WebCore::ScriptRunner::timerFired):
2972
2973             Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
2974             but this also covers possibility this is caused by something else.
2975
2976 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2977
2978         [SOUP] Use a webkit subdirectory for the disk cache
2979         https://bugs.webkit.org/show_bug.cgi?id=144048
2980
2981         Reviewed by Martin Robinson.
2982
2983         Add a static method to SoupNetworkSession to clear a soup cache
2984         given its directory.
2985
2986         * platform/network/soup/SoupNetworkSession.cpp:
2987         (WebCore::strIsNumeric):
2988         (WebCore::SoupNetworkSession::clearCache):
2989         * platform/network/soup/SoupNetworkSession.h:
2990
2991 2015-04-23  Andy Estes  <aestes@apple.com>
2992
2993         Fix the iOS build after r183234.
2994
2995         * platform/ios/LegacyTileCache.mm:
2996         (WebCore::LegacyTileCache::commitScaleChange):
2997
2998 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
2999
3000         Fix Windows build.
3001
3002         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3003         (PlatformCALayerWin::setBackingStoreAttached):
3004         (PlatformCALayerWin::backingStoreAttached):
3005         * platform/graphics/ca/win/PlatformCALayerWin.h:
3006
3007 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3008
3009         Make it possible to detach GraphicsLayerCA backing store
3010         https://bugs.webkit.org/show_bug.cgi?id=144140
3011
3012         Reviewed by Tim Horton.
3013
3014         This changes makes it possible to denote a GraphicsLayerCA's backing store
3015         as "attached" or not. When not attached, the backing store is made volatile
3016         and can be purged. This will be used in a future patch.
3017
3018         * platform/graphics/ca/GraphicsLayerCA.h: Add updateBackingStoreAttachment().
3019         * platform/graphics/ca/PlatformCALayer.h:
3020         * platform/graphics/ca/mac/PlatformCALayerMac.h:
3021         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Stubs. In future, we could
3022         remove backing store on Mac and iOS WK1 too.
3023         (PlatformCALayerMac::setBackingStoreAttached):
3024         (PlatformCALayerMac::backingStoreAttached):
3025
3026 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3027
3028         Remove "layer" from GraphicsLayerCA member function names
3029         https://bugs.webkit.org/show_bug.cgi?id=144139
3030
3031         Reviewed by Myles Maxfield.
3032
3033         Rename "updateLayer*" to "update*" in GraphicsLayerCA.
3034
3035         * platform/graphics/ca/GraphicsLayerCA.cpp:
3036         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3037         (WebCore::GraphicsLayerCA::updateNames):
3038         (WebCore::GraphicsLayerCA::updateDrawsContent):
3039         (WebCore::GraphicsLayerCA::updateLayerNames): Deleted.
3040         (WebCore::GraphicsLayerCA::updateLayerDrawsContent): Deleted.
3041         * platform/graphics/ca/GraphicsLayerCA.h:
3042
3043 2015-04-23  Dan Bernstein  <mitz@apple.com>
3044
3045         <rdar://problem/20663758> Fix the build after AVPlayerViewController API change
3046
3047         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3048         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Don’t pass a nil completion
3049         handler to -[AVPlayerViewController exitFullScreenAnimated:completionHandler:].
3050
3051 2015-04-23  Darin Adler  <darin@apple.com>
3052
3053         Another round of removing use of OwnPtr, PassOwnPtr, and deleteOwnedPtr
3054         https://bugs.webkit.org/show_bug.cgi?id=144090
3055
3056         Reviewed by Anders Carlsson.
3057
3058         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h: Removed unneeded include.
3059
3060         * Modules/navigatorcontentutils/NavigatorContentUtils.h: Removed include of
3061         RefCountedSupplement.h.
3062
3063         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
3064         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
3065         Pass data using rvalue references, and use new/delete to pass it across
3066         threads, rather than using PassOwnPtr.
3067         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: Pass data
3068         in an rvalue reference instead of PassOwnPtr.
3069         * Modules/websockets/WebSocket.cpp:
3070         (WebCore::WebSocket::didReceiveBinaryData): Take an rvalue reference
3071         instead of a PassOwnPtr.
3072         * Modules/websockets/WebSocket.h: Ditto.
3073         * Modules/websockets/WebSocketChannel.cpp: Ditto.
3074         (WebCore::WebSocketChannel::processFrame): Ditto.
3075         * Modules/websockets/WebSocketChannelClient.h:
3076         (WebCore::WebSocketChannelClient::didReceiveBinaryData): Ditto.
3077         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3078         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
3079         Ditto.
3080         * Modules/websockets/WorkerThreadableWebSocketChannel.h: Ditto.
3081
3082         * WebCore.xcodeproj/project.pbxproj: Removed RefCountedSupplement.h.
3083
3084         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3085         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Fixed comment
3086         to not mention adoptPtr.
3087
3088         * page/make_settings.pl:
3089         (generateInternalSettingsHeaderFile): Removed include of RefCountedSupplement.h.
3090
3091         * platform/ColorChooserClient.h: Removed unneded include.
3092         * platform/ContextMenuItem.h: Ditto.
3093
3094         * platform/RefCountedSupplement.h: Removed.
3095
3096         * platform/ScrollAnimator.cpp: Removed unneeded include.
3097         * platform/ScrollAnimatorNone.h: Ditto.
3098
3099         * platform/ThreadGlobalData.cpp: Added now-needed include of PassOwnPtr.h.
3100
3101         * platform/graphics/GlyphMetricsMap.h: Ditto.
3102         * platform/graphics/MediaPlayer.h: Ditto.
3103         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: Ditto.
3104         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Ditto.
3105         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Ditto.
3106         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Ditto.
3107         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h: Ditto.
3108         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: Ditto.
3109         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: Ditto.
3110
3111         * platform/graphics/cg/ImageBufferCG.cpp:
3112         (WebCore::ImageBuffer::ImageBuffer): Use make_unique instead of adoptPtr.
3113         * platform/graphics/cg/ImageBufferDataCG.cpp:
3114         (WebCore::ImageBufferData::getData): Return a RefPtr instead of a PassRefPtr.
3115         * platform/graphics/cg/ImageBufferDataCG.h: Streamlined the header a bit,
3116         use unique_ptr instead of OwnPtr and RefPtr instead of PassRefPtr.
3117
3118         * platform/graphics/cocoa/IOSurface.h: Use unique_ptr instead of OwnPtr.
3119         * platform/graphics/cocoa/IOSurface.mm:
3120         (IOSurface::ensureGraphicsContext): Use make_unique instead of adoptPtr.
3121
3122         * platform/graphics/egl/GLContextEGL.cpp: Removed unneeded includes.
3123         * platform/graphics/filters/FilterOperation.h: Ditto.
3124         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Ditto.
3125         * platform/ios/DeviceMotionClientIOS.h: Ditto.
3126         * platform/ios/DeviceOrientationClientIOS.h: Ditto.
3127
3128         * platform/ios/LegacyTileCache.h: Use unique_ptr instead of OwnPtr.
3129         * platform/ios/LegacyTileCache.mm:
3130         (WebCore::LegacyTileCache::LegacyTileCache): Use make_unique instead of
3131         a create function, and also get rid of unneeded initialization to null.
3132         (WebCore::LegacyTileCache::commitScaleChange): Ditto.
3133
3134         * platform/ios/LegacyTileGrid.h: Made constructor public and got rid of create
3135         function. Made constructor take a reference to the tile cache, and make both
3136         tileCache() and m_tileCache be references too.
3137
3138         * platform/ios/LegacyTileGrid.mm:
3139         (WebCore::LegacyTileGrid::LegacyTileGrid): Updated to use reference.
3140         (WebCore::LegacyTileGrid::visibleRect): Ditto.
3141         (WebCore::LegacyTileGrid::tileByteSize) Ditto.:
3142         (WebCore::LegacyTileGrid::dropDistantTiles): Ditto.
3143         (WebCore::LegacyTileGrid::updateTileOpacity): Ditto.
3144         (WebCore::LegacyTileGrid::updateTileBorderVisibility): Ditto.
3145         (WebCore::LegacyTileGrid::updateHostLayerSize): Ditto.
3146         (WebCore::LegacyTileGrid::invalidateTiles): Ditto.
3147         (WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage): Ditto.
3148         (WebCore::LegacyTileGrid::tileDistance2): Ditto.
3149         (WebCore::LegacyTileGrid::createTiles): Ditto.
3150         * platform/ios/LegacyTileGridTile.mm:
3151         (WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
3152         (WebCore::LegacyTileGridTile::invalidateRect): Ditto.
3153         (WebCore::LegacyTileGridTile::showBorder): Ditto.
3154         * platform/ios/LegacyTileLayer.mm:
3155         (-[LegacyTileHostLayer renderInContext:]): Ditto.
3156         (-[LegacyTileLayer layoutSublayers]): Ditto.
3157         (-[LegacyTileLayer drawInContext:]): Ditto.
3158
3159         * platform/ios/LegacyTileLayerPool.h: Removed unneeded include.
3160         * platform/ios/ScrollAnimatorIOS.mm: Ditto.
3161         * platform/mac/ScrollAnimatorMac.mm: Ditto.
3162         * platform/mac/WebVideoFullscreenController.h: Ditto.
3163         * platform/network/BlobData.cpp: Ditto.
3164
3165         * platform/network/ResourceHandle.cpp:
3166         (WebCore::ResourceHandle::ResourceHandle): Use make_unique instead of adoptPtr.
3167         * platform/network/ResourceHandle.h: Use unique_ptr instead of OwnPtr.
3168
3169         * platform/network/ResourceHandleInternal.h: Added now-needed include.
3170
3171         * platform/network/ResourceResponseBase.h: Removed unneeded includes and
3172         tweaked formatting a bit.
3173
3174         * platform/network/SynchronousLoaderClient.h: Removed the create function and
3175         the private constructor. Used data member initialize to make the default
3176         empty constructor automatically get generated (and be public now).
3177
3178         * platform/network/cf/FormDataStreamCFNet.cpp:
3179         (WebCore::formFinishFinalizationOnMainThread): Use delete instead of adoptPtr
3180         to delete the context argument.
3181
3182         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3183         (WebCore::defaultNetworkStorageSession): Return a unique_ptr& instead of an OwnPtr&.
3184         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use make_unique
3185         instead of adoptPtr.
3186         (WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
3187
3188         * platform/network/cf/ResourceHandleCFNet.cpp:
3189         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Use a
3190         SynchronousLoaderClient on the stack instead of putting one on the heap with adoptPtr.
3191         * platform/network/mac/ResourceHandleMac.mm:
3192         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.
3193
3194         * platform/text/TextCodec.h: Removed unneeded include.
3195         * platform/win/CursorWin.cpp: Ditto.
3196
3197         * rendering/RenderLayer.cpp:
3198         (WebCore::RenderLayer::calculateClipRects): Use move instead of release since
3199         we are using RefPtr&& instead of PassRefPtr.
3200
3201         * rendering/RenderLayerFilterInfo.cpp:
3202         (WebCore::RenderLayer::FilterInfo::setRenderer): Use RefPtr&& instead of PassRefPtr.
3203         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients): Streamlined to use
3204         modern for loops and auto.
3205         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients): Ditto.
3206
3207         * rendering/RenderLayerFilterInfo.h: Streamlined code and removed some stuff that
3208         I think is unneeded on iOS; there is no unused private field and I suspect the problem
3209         that led to the warning is gone. Deleted friending of deleteOwnedPtr.
3210
3211         * rendering/RenderLayerMaskImageInfo.cpp: Removed unneeded includes. Moved private
3212         client classes in here from the header and made them members of MaskImageInfo.
3213         Streamlined them a bit in other ways.
3214         (WebCore::RenderLayer::MaskImageInfo::getIfExists): Use nullptr.
3215         (WebCore::RenderLayer::MaskImageInfo::MaskImageInfo): Use member initialization
3216         and also pass the layer in rather than the MaskImageInfo.
3217         (WebCore::RenderLayer::MaskImageInfo::notifyFinished): Deleted. Moved the code
3218         into the SVGDocumentClient.
3219         (WebCore::RenderLayer::MaskImageInfo::imageChanged): Deleted. Moved the code into
3220         the ImageClient.
3221         (WebCore::RenderLayer::MaskImageInfo::updateMaskImageClients): Streamlined a bit
3222         to use a for loop.
3223         (WebCore::RenderLayer::MaskImageInfo::removeMaskImageClients): Ditto.
3224
3225         * rendering/RenderLayerMaskImageInfo.h: Reduced unneeded includes. Got rid of
3226         definitions of private member classes here in the header; they can be in the cpp
3227         file instead. Also cut down from three classes to two, and gave the classes less
3228         redundant names since they are already members of MaskImageInfo. Removed some
3229         unneeded functions and friending of deleteOwnedPtr.
3230
3231         * testing/InternalSettings.cpp: Got rid of comment about RefCountedSupplement
3232         since no code anywhere was using it, so not using it here was not remarkable.
3233
3234 2015-04-23  Jer Noble  <jer.noble@apple.com>
3235
3236         [iOS] Add a wrapper around the hosted AVPlayerLayer to intercept -setBounds:
3237         https://bugs.webkit.org/show_bug.cgi?id=144129
3238
3239         Reviewed by Simon Fraser.
3240
3241         When passing the hosted AVPlayerLayer to the fullscreen controller, the new superlayer will
3242         resize the hosted layer with a call to -setBounds:. But because this is a hosted layer, the
3243         bonuds change has no effect. Instead, wrap the CALayerHost in another CALayer whose job it is
3244         to intercept -setBounds: in the same way that WebAVVideoLayer did. In fact, we should just use
3245         that wrapper class inside WebAVVideoLayer as well, to avoid duplicating code.
3246
3247         Drive-by Fix: Null-check m_videoElement in setVideoLayerFrame().
3248
3249         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3250         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3251         (-[WebCALayerHostWrapper setVideoSublayer:]):
3252         (-[WebCALayerHostWrapper videoSublayer]):
3253         (-[WebCALayerHostWrapper setBounds:]): Moved from WebAVVideoLayer.
3254         (-[WebCALayerHostWrapper resolveBounds]): Ditto.
3255         (-[WebAVVideoLayer setBounds:]): Moved to WebCALayerHostWrapper.
3256         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Create the wrapper.
3257         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Clear the wrapper.
3258         (-[WebAVVideoLayer resolveBounds]): Deleted. Moved to WebCALayerHostWrapper.
3259         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3260         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Null-check m_videoElement.
3261
3262 2015-04-23  Tim Horton  <timothy_horton@apple.com>
3263
3264         Yellow highlight has gray background color when invoking Lookup on an address in a Google Maps drop down
3265         https://bugs.webkit.org/show_bug.cgi?id=138737
3266         <rdar://problem/18904429>
3267
3268         Reviewed by Simon Fraser.
3269
3270         * rendering/RenderReplaced.cpp:
3271         (WebCore::RenderReplaced::paint):
3272         Other RenderObjects don't paint box decorations in the selection painting phase,
3273         so RenderReplaced probably shouldn't either. This fixes the case where, when doing
3274         selection-only painting of a bit of text over top of a RenderReplaced, the RenderReplaced
3275         would paint its background, filling the previously transparent bitmap with an unwanted color.
3276
3277 2015-04-23  Roger Fong  <roger_fong@apple.com>
3278
3279         Update media timeline controls when video is paused..
3280         https://bugs.webkit.org/show_bug.cgi?id=144122.
3281         <rdar://problem/20422927>
3282
3283         Reviewed by Dean Jackson.
3284
3285         * Modules/mediacontrols/mediaControlsApple.js:
3286         (Controller.prototype.drawTimelineBackground): Use timelineWidth because offsetWidth is 0 when display: none.
3287         (Controller.prototype.setPlaying): Show controls when pausing.
3288         (Controller.prototype.showControls): Update time and timeline when unhiding controls.
3289
3290 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3291
3292         Changing TiledBacking velocity should schedule a tile revalidation
3293         https://bugs.webkit.org/show_bug.cgi?id=144123
3294
3295         Reviewed by Tim Horton.
3296
3297         Changing the velocity parameters on the TileController affect the computed
3298         coverage rect, so whenever we make a change to velocity data that could
3299         affect the outcome (basically any non-zero old or new velocities),
3300         schedule a layer flush.
3301
3302         * platform/graphics/TiledBacking.h:
3303         (WebCore::VelocityData::velocityOrScaleIsChanging):
3304         * platform/graphics/ca/TileController.cpp:
3305         (WebCore::TileController::setVelocity):
3306
3307 2015-04-23  Jer Noble  <jer.noble@apple.com>
3308
3309         [Mac] Disable QTKit by default on future OS X.
3310         https://bugs.webkit.org/show_bug.cgi?id=144082
3311
3312         Reviewed by Darin Adler.
3313
3314         Settings::gQTKitEnabled defaults to false.
3315
3316         * page/Settings.cpp:
3317
3318 2015-04-23  Daniel Bates  <dabates@apple.com>
3319
3320         Clean up: Use references instead of pointers in more SVG files
3321         https://bugs.webkit.org/show_bug.cgi?id=144045
3322
3323         Reviewed by Darin Adler.
3324
3325         * rendering/svg/SVGRootInlineBox.cpp:
3326         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Pass reference instead of pointer.
3327
3328         * rendering/svg/SVGTextLayoutEngine.cpp:
3329         (WebCore::SVGTextLayoutEngine::recordTextFragment): Changed parameter textBox from pointer to reference.
3330         (WebCore::SVGTextLayoutEngine::layoutInlineTextBox): Ditto.
3331         (WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics): Changed parameter textBox from pointer to
3332         reference and made it const since this function does not modify textBox.
3333         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Changed parameters from pointers to references.
3334         Also, removed comma from comment so that it reads well.
3335         * rendering/svg/SVGTextLayoutEngine.h: Updated declarations for the above functions.
3336
3337         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
3338         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift): Changed parameter style from pointer to reference.
3339         Added case BS_LENGTH to switch block and removed default case so that the compiler checks that we handle all cases.
3340         Renamed parameter contextElement to context since the name of its data type conveys that it is an element.
3341         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift): Changed parameter textRenderer from
3342         pointer to reference and removed runtime assertion that textRenderer is non-null (since it well-formed reference
3343         cannot point to a non-existent object).
3344         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle): Changed parameter style from pointer to reference
3345         removed runtime assertion that style is non-null.
3346         * rendering/svg/SVGTextLayoutEngineBaseline.h: Updated declarations for the above functions.
3347
3348 2015-04-23  Commit Queue  <commit-queue@webkit.org>
3349
3350         Unreviewed, rolling out r183194.
3351         https://bugs.webkit.org/show_bug.cgi?id=144121
3352
3353         Made multiple tests flaky (Requested by ap_ on #webkit).
3354
3355         Reverted changeset:
3356
3357         "Memory cache live resources repeatedly purged during
3358         painting"
3359         https://bugs.webkit.org/show_bug.cgi?id=144104
3360         http://trac.webkit.org/changeset/183194
3361
3362 2015-04-23  Roger Fong  <roger_fong@apple.com>
3363
3364         Unreviewed. Missed a button in r182900.
3365
3366         * Modules/mediacontrols/mediaControlsApple.css:
3367         (audio::-webkit-media-controls-wireless-playback-picker-button:active):
3368
3369 2015-04-23  Roger Fong  <roger_fong@apple.com>
3370
3371         Unreviewed. Just shift some CSS around for code cleanup purposes.
3372
3373         * Modules/mediacontrols/mediaControlsApple.css:
3374         (video::-webkit-media-controls-panel):
3375         (video::-webkit-media-controls-panel:hover):
3376
3377 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
3378
3379         [iOS] WebKit services should inherit environment variables for home
3380         https://bugs.webkit.org/show_bug.cgi?id=144078
3381         rdar://problem/20571678
3382
3383         Reviewed by Dan Bernstein.
3384
3385         Added an SPI header for a drive-by fix.
3386
3387         * WebCore.xcodeproj/project.pbxproj:
3388         * platform/spi/cf/CFBundleSPI.h: Added.
3389
3390 2015-04-23  Alex Christensen  <achristensen@webkit.org>
3391
3392         Use less memory when compiling content extensions.
3393         https://bugs.webkit.org/show_bug.cgi?id=144051
3394
3395         Reviewed by Darin Adler and Benjamin Poulain.
3396
3397         No change in functionality, correctness already covered by existing tests.
3398
3399         Before this patch, a DFANode contained a HashSet of transitions.
3400         Large vectors of DFANodes made many small HashSets, which was inefficient use of memory.
3401         We now put all the actions and transitions into one big compact Vector and each node owns ranges in that vector.
3402
3403         * contentextensions/CombinedURLFilters.cpp:
3404         (WebCore::ContentExtensions::recursiveMemoryUsed):
3405         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
3406         * contentextensions/CombinedURLFilters.h:
3407         * contentextensions/ContentExtensionCompiler.cpp:
3408         (WebCore::ContentExtensions::compileRuleList):
3409         * contentextensions/ContentExtensionsDebugging.h:
3410         * contentextensions/DFA.cpp:
3411         (WebCore::ContentExtensions::DFA::memoryUsed):
3412         (WebCore::ContentExtensions::DFANode::actions):
3413         (WebCore::ContentExtensions::DFANode::transitions):
3414         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
3415         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
3416         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
3417         (WebCore::ContentExtensions::DFANode::containsTransition):
3418         (WebCore::ContentExtensions::DFANode::kill):
3419         (WebCore::ContentExtensions::DFA::minimize):
3420         (WebCore::ContentExtensions::DFA::DFA): Deleted.
3421         (WebCore::ContentExtensions::DFA::operator=): Deleted.
3422         * contentextensions/DFA.h:
3423         * contentextensions/DFABytecodeCompiler.cpp:
3424         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
3425         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
3426         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
3427         * contentextensions/DFABytecodeCompiler.h:
3428         * contentextensions/DFAMinimizer.cpp:
3429         (WebCore::ContentExtensions::DFAMinimizer::minimize):
3430         * contentextensions/DFAMinimizer.h:
3431         * contentextensions/DFANode.h:
3432         (WebCore::ContentExtensions::DFANode::isKilled):
3433         (WebCore::ContentExtensions::DFANode::hasFallbackTransition):
3434         (WebCore::ContentExtensions::DFANode::hasActions):
3435         (WebCore::ContentExtensions::DFANode::transitionsLength):
3436         (WebCore::ContentExtensions::DFANode::actionsLength):
3437         (WebCore::ContentExtensions::DFANode::actionsStart):
3438         (WebCore::ContentExtensions::DFANode::setActions):
3439         (WebCore::ContentExtensions::DFANode::setTransitions):
3440         (WebCore::ContentExtensions::DFANode::resetTransitions):
3441         (WebCore::ContentExtensions::DFANode::transitionsStart):
3442         (WebCore::ContentExtensions::DFANode::setHasFallbackTransitionWithoutChangingDFA):
3443         * contentextensions/NFA.cpp:
3444         (WebCore::ContentExtensions::NFA::memoryUsed):
3445         * contentextensions/NFA.h:
3446         * contentextensions/NFAToDFA.cpp:
3447         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
3448         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
3449         (WebCore::ContentExtensions::getOrCreateDFANode):
3450         (WebCore::ContentExtensions::NFAToDFA::convert):
3451
3452 2015-04-23  David Hyatt  <hyatt@apple.com>
3453
3454         Don't fire a bunch of mouse moveds during scrolling.
3455         https://bugs.webkit.org/show_bug.cgi?id=99940
3456
3457         Reviewed by Simon Fraser.
3458
3459         * page/EventHandler.cpp:
3460         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
3461         Even for the short interval timer, make sure to cancel and restart it instead of allowing the original to
3462         complete. This has the effect of preventing fake mouse moves from firing until the scroll stops.
3463
3464 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
3465
3466         Unreviewed, fix the release build.
3467
3468         * html/HTMLMediaSession.cpp:
3469         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Add an UNUSED_PARAM.
3470
3471 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3472
3473         Remove m_isPageTiledBackingLayer data member from GraphicsLayerCA, just use the layer type instead
3474         https://bugs.webkit.org/show_bug.cgi?id=144108
3475
3476         Reviewed by Dean Jackson.
3477
3478         No need for the m_isPageTiledBackingLayer data member. We can just check the layer
3479         type instead.
3480
3481         * platform/graphics/ca/GraphicsLayerCA.cpp:
3482         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3483         (WebCore::GraphicsLayerCA::initialize):
3484         (WebCore::GraphicsLayerCA::platformCALayerShowRepaintCounter):
3485         (WebCore::GraphicsLayerCA::updateContentsScale):
3486         (WebCore::GraphicsLayerCA::getDebugBorderInfo):
3487         (WebCore::GraphicsLayerCA::requiresTiledLayer):
3488         * platform/graphics/ca/GraphicsLayerCA.h:
3489         (WebCore::GraphicsLayerCA::isPageTiledBackingLayer):
3490
3491 2015-04-23  Brady Eidson  <beidson@apple.com>
3492
3493         Content extension with oft-repeated rules can cause slowdown.
3494         rdar://problem/20618511 and https://bugs.webkit.org/show_bug.cgi?id=144010
3495
3496         Reviewed by Alex Christensen.
3497
3498         No new tests (Behavior covered by existing tests).
3499
3500         * WebCore.xcodeproj/project.pbxproj:
3501
3502         * contentextensions/ContentExtension.cpp:
3503         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
3504
3505         Add the String identifier for the extension and the rule action ID to Actions:
3506         * contentextensions/ContentExtensionRule.cpp:
3507         (WebCore::ContentExtensions::Action::deserialize):
3508         * contentextensions/ContentExtensionRule.h:
3509         (WebCore::ContentExtensions::Action::Action):
3510         (WebCore::ContentExtensions::Action::operator==):
3511         (WebCore::ContentExtensions::Action::setExtensionIdentifier):
3512         (WebCore::ContentExtensions::Action::extensionIdentifier):
3513         (WebCore::ContentExtensions::Action::actionID):
3514         (WebCore::ContentExtensions::Action::type): Deleted.
3515
3516         Object to manage a CSSStyleSheet and selectors identified by ID:
3517         * contentextensions/ContentExtensionStyleSheet.cpp:
3518         (WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet):
3519         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
3520         * contentextensions/ContentExtensionStyleSheet.h:
3521         (WebCore::ContentExtensions::ContentExtensionStyleSheet::create):
3522         (WebCore::ContentExtensions::ContentExtensionStyleSheet::styleSheet):
3523
3524         Instead of globbing selectors together into a String and making a new stylesheet,
3525         add new unique selectors to an already existing sheet:
3526         * contentextensions/ContentExtensionsBackend.cpp:
3527         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3528         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
3529         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
3530
3531         * dom/DocumentStyleSheetCollection.cpp:
3532         (WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector):
3533         (WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Deleted.
3534         * dom/DocumentStyleSheetCollection.h:
3535
3536         * loader/DocumentLoader.cpp:
3537         (WebCore::DocumentLoader::commitData):
3538         (WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
3539         (WebCore::DocumentLoader::addPendingContentExtensionSheet): Deleted.
3540         * loader/DocumentLoader.h:
3541
3542 2015-04-23  Antti Koivisto  <antti@apple.com>
3543
3544         Memory cache live resources repeatedly purged during painting
3545         https://bugs.webkit.org/show_bug.cgi?id=144104
3546         <rdar://problem/20667695>
3547
3548         Reviewed by Chris Dumez.
3549
3550         On some PLT pages (like nytimes.com) we get into state where painting repeatedly purges live bitmaps.
3551         This slows down page loads significantly.
3552
3553         This might have regressed because improvements in page caching keep more pages and so resources 'live'.
3554
3555         With this path we do all regular cache pruning asynchronously. If memory is really critical
3556         the low memory handling code will still prune synchronously.
3557
3558         * loader/cache/CachedResource.cpp:
3559         (WebCore::CachedResource::removeClient):
3560         (WebCore::CachedResource::didAccessDecodedData):
3561
3562             prune() -> pruneSoon()
3563
3564         * loader/cache/MemoryCache.cpp:
3565
3566             Decrease the pruning size target from 0.95 to 0.8 so we don't need to prune so often.
3567
3568         (WebCore::MemoryCache::needsPruning):
3569
3570             Factor into a function.
3571
3572         (WebCore::MemoryCache::prune):
3573         (WebCore::MemoryCache::pruneSoon):
3574
3575             Prune asynchronously.
3576
3577         * loader/cache/MemoryCache.h:
3578
3579 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
3580
3581         Unreviewed, make a suggested change I overlooked in Darin's review of
3582         https://bugs.webkit.org/show_bug.cgi?id=144098
3583
3584         * dom/Document.cpp:
3585         (WebCore::Document::removePlaybackTargetPickerClient): const auto& -> auto
3586         (WebCore::Document::showPlaybackTargetPicker): Ditto.
3587         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
3588         (WebCore::Document::playbackTargetAvailabilityDidChange): Ditto.
3589         (WebCore::Document::setPlaybackTarget): Ditto.
3590         (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
3591
3592 2015-04-23  Joonghun Park  <jh718.park@samsung.com>
3593
3594         Use std::unique_ptr instead of OwnPtr in ThreadGlobalData
3595         https://bugs.webkit.org/show_bug.cgi?id=141950
3596
3597         Reviewed by Darin Adler.
3598
3599         No new tests, no behavior changes.
3600
3601         * dom/EventNames.h:
3602         (WebCore::EventNames::create):
3603         * loader/cache/CachedResourceRequestInitiators.h:
3604         * platform/ThreadGlobalData.cpp:
3605         (WebCore::ThreadGlobalData::ThreadGlobalData):
3606         (WebCore::ThreadGlobalData::destroy):
3607         * platform/ThreadGlobalData.h:
3608
3609 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
3610
3611         Some media tests assert after r183096
3612         https://bugs.webkit.org/show_bug.cgi?id=144098
3613
3614         Reviewed by Darin Adler.
3615
3616         * dom/Document.cpp:
3617         (WebCore::Document::removePlaybackTargetPickerClient): Don't assert if the client has already
3618             been removed from the map. This happens when a media element is removed from the document
3619             before its destructor runs and is not an error.
3620         (WebCore::Document::showPlaybackTargetPicker): It is an error to call this after the client 
3621             has been removed from the map so leave the assert in a debug build, but return early
3622             so a release build doesn't crash.
3623         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
3624         (WebCore::Document::playbackTargetAvailabilityDidChange): Use "auto" for the map iterator variable.
3625         (WebCore::Document::setPlaybackTarget): Ditto.
3626         (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
3627         * dom/Document.h: Fix map typedef names.
3628
3629 2015-04-23  Andreas Kling  <akling@apple.com>
3630
3631         DOM nodes should be allocated with fastMalloc().
3632
3633         Unreviewed. This got lost in the TreeShared merge. :|
3634
3635         * dom/Node.h:
3636
3637 2015-04-23  Chris Dumez  <cdumez@apple.com>
3638
3639         [WK2] WebDiagnosticLoggingClient is leaking
3640         https://bugs.webkit.org/show_bug.cgi?id=144089
3641         <rdar://problem/19706214>
3642
3643         Reviewed by Darin Adler.
3644
3645         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
3646         constructor but there is no code destroying it.
3647
3648         This patch adds a new xxxDestroyed() virtual function to
3649         DiagnosticLoggingClient and that is overriden in
3650         WebDiagnosticLoggingClient to call "delete this". This is the same
3651         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
3652         WebProgressTrackerClient).
3653
3654         * loader/EmptyClients.h:
3655         * page/DiagnosticLoggingClient.h:
3656         * page/MainFrame.cpp:
3657         (WebCore::MainFrame::~MainFrame):
3658
3659 2015-04-22  Antti Koivisto  <antti@apple.com>
3660
3661         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
3662         https://bugs.webkit.org/show_bug.cgi?id=144050
3663         rdar://problem/15534973
3664
3665         Reviewed by Chris Dumez.
3666
3667         We are seeing null Element pointer crashes with this stack:
3668
3669         47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
3670         47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
3671         47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175
3672
3673         The most likely cause seems to be that this code
3674
3675             ASSERT(m_pendingAsyncScripts.contains(scriptElement));
3676             m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));
3677
3678         in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with a null entry in
3679         m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
3680         could happen. The related code is fragile with lot of state (in ScriptElement class)
3681         and involves many opportunities for re-entry via scripts.
3682
3683         No repro, no test case.
3684
3685         * dom/ScriptRunner.cpp:
3686         (WebCore::ScriptRunner::timerFired):
3687
3688             Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
3689             but this also covers possibility this is caused by something else.
3690
3691 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3692
3693         Use a typedef for TileGrid tile validation policy flags
3694         https://bugs.webkit.org/show_bug.cgi?id=144085
3695
3696         Reviewed by Tim Horton.
3697
3698         Replace 'unsigned' with a typedef for the bitmask of TileValidationPolicyFlags.
3699
3700         * platform/graphics/ca/TileController.cpp:
3701         (WebCore::TileController::tileRevalidationTimerFired):
3702         * platform/graphics/ca/TileGrid.cpp:
3703         (WebCore::TileGrid::revalidateTiles):
3704         * platform/graphics/ca/TileGrid.h:
3705
3706 2015-04-23  Andreas Kling  <akling@apple.com>
3707
3708         Slap Node's reference counting functions with ALWAYS_INLINE stick.
3709
3710         Speculative fix for weird ~3% regression on Speedometer seen after TreeShared
3711         was merged into Node. Since the memory layout didn't change, failure to inline
3712         seems like a possible source of regression.
3713
3714         * dom/Node.h:
3715         (WebCore::Node::ref):
3716         (WebCore::Node::deref):
3717         (WebCore::Node::hasOneRef):
3718         (WebCore::Node::refCount):
3719
3720 2015-04-22  Simon Fraser  <simon.fraser@apple.com>
3721
3722         [iOS] Move computeCoverageRect code from FrameView into TileController
3723         https://bugs.webkit.org/show_bug.cgi?id=144087
3724
3725         Reviewed by Benjamin Poulain.
3726         
3727         There is code in four different places that adjusts tiling coverage rect:
3728         1. LegacyTileCache. This will remain unchanged.
3729         2. FrameView::computeTileCoverageRect(). This was added to do velocity-based
3730         page tiled coverage expansion for iOS WK2.
3731         3. TileController::computeTileCoverageRect(): this is used for the page tiles
3732         on Mac.
3733         4. GraphicsLayerCA::adjustTiledLayerVisibleRect(). This is used by non-page
3734         tiled layers on both iOS and Mac.
3735         
3736         This patch reduced this list to 3, coalescing FrameView::computeTileCoverageRect()
3737         and TileController::computeTileCoverageRect(). It removes the rect inflation that
3738         affects the visibleRect passed into rootLayer->flushCompositingState() for iOS,
3739         but the page tiles now do an identical coverage inflation. The visible rect
3740         change does affect visible rect computations for non-page tiled backings, but
3741         a future patch will restore that.
3742
3743         * page/FrameView.cpp:
3744         (WebCore::FrameView::setScrollVelocity):
3745         (WebCore::FrameView::computeCoverageRect): Deleted.
3746         * page/FrameView.h:
3747         * platform/graphics/TiledBacking.h:
3748         (WebCore::VelocityData::VelocityData):
3749         * platform/graphics/ca/TileController.cpp:
3750         (WebCore::TileController::setVelocity):
3751         (WebCore::TileController::computeTileCoverageRect):
3752         * platform/graphics/ca/TileController.h:
3753         * rendering/RenderLayerCompositor.cpp:
3754         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3755
3756 2015-04-22  Darin Adler  <darin@apple.com>
3757
3758         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
3759         https://bugs.webkit.org/show_bug.cgi?id=143943
3760
3761         Reviewed by Anders Carlsson.
3762
3763         * editing/Editor.cpp:
3764         (WebCore::Editor::insertDictationPhrases): Changed this iOS-only
3765         function to take a Vector<Vector<String>>&& and not involve PassOwnPtr.
3766         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Changed this iOS-only
3767         function to take a Vector<Vector<String>> and not involve PassOwnPtr. Also made
3768         it take a reference rather than a pointer to the element and simplify the code
3769         a bit using modern for loops and auto.
3770         * editing/Editor.h: Ditto.
3771
3772         * editing/ios/DictationCommandIOS.cpp:
3773         (WebCore::DictationCommandIOS::DictationCommandIOS): Take
3774         a Vector<Vector<String>>&& instead of a PassOwnPtr.
3775         (WebCore::DictationCommandIOS::~DictationCommandIOS): Deleted. No need to
3776         explicitly define this.
3777         (WebCore::DictationCommandIOS::doApply): Updated to use modern for loop and
3778         work with a Vector<Vector<String>> instead of an OwnPtr.
3779         * editing/ios/DictationCommandIOS.h: Updated to not use PassOwnPtr and OwnPtr.
3780         Also modernized a bit by using override.
3781
3782         * platform/network/ios/QuickLook.h: Return an NSURLRequest * instead of a
3783         PassOwnPtr<ResourceRequest> from this iOS-specific function.
3784         * platform/network/ios/QuickLook.mm:
3785         (WebCore::registerQLPreviewConverterIfNeeded): Ditto.
3786
3787 2015-04-22  Jinwoo Song  <jinwoo7.song@samsung.com>
3788
3789         Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
3790         https://bugs.webkit.org/show_bug.cgi?id=144033
3791
3792         Reviewed by Darin Adler.
3793
3794         Use unique_ptr for creating a copy of cairo_path_t and use lambda function
3795         for custom deleter, cairo_path_destroy().
3796
3797         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3798         (WebCore::drawPathShadow): Use std::unique_ptr instead of OwnPtr.
3799         (WebCore::GraphicsContext::clip): Call cairo_path_destroy() immediately.
3800         * platform/graphics/cairo/OwnPtrCairo.cpp:
3801         (WTF::deleteOwnedPtr<cairo_path_t>): Deleted. Remove unnecessary deleter anymore.
3802         * platform/graphics/cairo/OwnPtrCairo.h: Ditto.
3803
3804 2015-04-22  Darin Adler  <darin@apple.com>
3805
3806         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
3807         https://bugs.webkit.org/show_bug.cgi?id=143949
3808
3809         Reviewed by Andreas Kling.
3810
3811         * dom/ContainerNode.h: Removed unneeded includes and forward declarations.
3812         * dom/Document.h: Ditto.
3813
3814         * dom/DocumentParser.h: Fixed comment to not mention PassOwnPtr.
3815
3816         * html/shadow/MediaControlElements.cpp:
3817         (WebCore::MediaControlTextTrackContainerElement::create): Return a Ref instead of a PassRefPtr.
3818         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation): Pass a reference
3819         rather than a pointer to TextTrackRepresentation::create.
3820         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Return a
3821         RefPtr instead of a PassRefPtr.
3822
3823         * html/shadow/MediaControlElements.h: Use unique_ptr for m_textTrackRepresentation.
3824         Also fix a couple uses of PassRefPtr.
3825
3826         * loader/DocumentLoader.cpp:
3827         (WebCore::DocumentLoader::DocumentLoader): Use make_unique.
3828         (WebCore::DocumentLoader::addAllArchiveResources): Ditto.
3829         (WebCore::DocumentLoader::addArchiveResource): Ditto.
3830         (WebCore::DocumentLoader::clearArchiveResources): Set to nullptr instead of calling clear.
3831         (WebCore::DocumentLoader::startLoadingMainResource): Use make_unique.
3832         * loader/DocumentLoader.h: Made m_archiveResourceCollection and
3833         m_applicationCacheHost use unique_ptr.
3834
3835         * loader/WorkerThreadableLoader.cpp:
3836         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Use delete here instead
3837         of using OwnPtr to do the deletion. Matches the other code nearby.
3838
3839         * loader/appcache/ApplicationCacheGroup.cpp:
3840         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Handle case where the host is
3841         null; this happens during the DocumentLoader destruction process since unique_ptr sets itself
3842         to null before it destroys the object it points to and OwnPtr does not.
3843
3844         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3845         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Use delete instead of adoptPtr
3846         to delete a raw pointer.
3847         (WebCore::DiskCacheMonitor::DiskCacheMonitor): Use unique_ptr instead of OwnPtr.
3848
3849         * page/DragController.h: Removed some unneeded forward declarations and changed the
3850         create function to return unique_ptr.
3851
3852         * platform/LayoutUnit.h: Removed wtf_ceil workaround hack here. Not sure why we ever did it
3853         this way!
3854
3855         * platform/graphics/FontCascade.cpp:
3856         (WTF::deleteOwnedPtr<WebCore::TextLayout>): Deleted.
3857         (WebCore::FontCascade::createLayout): Changed to return a unique_ptr.
3858         (WebCore::FontCascade::deleteLayout): Deleted.
3859         * platform/graphics/FontCascade.h: Made the above changes.
3860
3861         * platform/graphics/ImageBuffer.h: Changed copyImage to return a RefPtr instead of a PassRefPtr.
3862
3863         * platform/graphics/TextTrackRepresentation.cpp:
3864         (WebCore::TextTrackRepresentation::create): Use make_unique and return a unique_ptr.
3865         * platform/graphics/TextTrackRepresentation.h: Removed unneeded includes and forward declarations
3866         and made create return a unique_ptr.
3867         * platform/graphics/cairo/ImageBufferCairo.cpp:
3868         (WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
3869         * platform/graphics/cg/ImageBufferCG.cpp:
3870         (WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
3871
3872         * platform/graphics/ios/TextTrackRepresentationIOS.h: Use reference instead of pointer,
3873         made more things private.
3874         * platform/graphics/ios/TextTrackRepresentationIOS.mm:
3875         (TextTrackRepresentation::create): Use make_unique.
3876         (TextTrackRepresentationIOS::TextTrackRepresentationIOS): Take a reference.
3877
3878         * platform/graphics/mac/ComplexTextController.cpp:
3879         (WebCore::FontCascade::createLayout): Return a unique_ptr with a custom destruction function.
3880         The custom destruction function eliminates the need to put TextLayout in a visible header.
3881         (WebCore::FontCascade::deleteLayout): Deleted. Use a lambda instead.
3882         (WebCore::roundCGFloat): Deleted. Old fashioned way to deal with multiple floating point sizes.
3883         Just use std::round instead.
3884         (WebCore::ceilCGFloat): Deleted. Same as above. Just use std::ceil instead.
3885         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Use std::round and std::ceil.
3886
3887         * rendering/RenderBlockLineLayout.cpp:
3888         (WebCore::RenderTextInfo::RenderTextInfo): Deleted. Can compile constructor and destructor
3889         now thanks to use of unique_ptr with a custom deleter.
3890         (WebCore::RenderTextInfo::~RenderTextInfo): Deleted. Ditto.
3891         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Updated for RenderTextInfo data member
3892         name change.
3893
3894         * rendering/RenderView.h: Removed unneeded include.
3895
3896         * rendering/line/BreakingContext.h: Removed unneeded include.
3897         (WebCore::BreakingContext::handleOutOfFlowPositioned): Updated for RenderTextInfo data member
3898         name change.
3899         (WebCore::BreakingContext::handleFloat): Ditto.
3900         (WebCore::BreakingContext::handleReplaced): Ditto.
3901         (WebCore::BreakingContext::handleText): Ditto.
3902         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Ditto.
3903
3904         * rendering/line/LineBreaker.h: Made the RenderTextInfo struct more like a struct by taking
3905         off all the m_ prefixes from the data member names. Initialized all the values in the struct
3906         to defaults so we don't need an explicit constructor. We also don't need an explicit destructor
3907         any more due to use of a unique_ptr with a deleter.
3908
3909 2015-04-22  Roger Fong  <roger_fong@apple.com>
3910
3911         Volume slider appears/doesn't appear at the wrong times.
3912         https://bugs.webkit.org/show_bug.cgi?id=144072.
3913         <rdar://problem/20576145>
3914
3915         Reviewed by Dean Jackson.
3916
3917         Set background divs to match volume box dimensions.
3918         * Modules/mediacontrols/mediaControlsApple.css:
3919         (audio::-webkit-media-controls-volume-slider-container-background):
3920         (audio::-webkit-media-controls-volume-slider-container-tint):
3921
3922         Draw the volume slider immediately on mousing over the mute box.
3923         * Modules/mediacontrols/mediaControlsApple.js:
3924         (Controller.prototype.createControls):
3925         (Controller.prototype.handleMuteBoxOver):
3926
3927 2015-04-22  Jer Noble  <jer.noble@apple.com>
3928
3929         [Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
3930         https://bugs.webkit.org/show_bug.cgi?id=144023
3931
3932         Reviewed by Darin Adler.