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