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