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