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