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