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