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