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