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