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