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