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