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