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