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