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