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