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