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