[Mac] Enable fullscreen for MSE-based videos
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-23  Eric Carlson  <eric.carlson@apple.com>
2
3         [Mac] Enable fullscreen for MSE-based videos
4         https://bugs.webkit.org/show_bug.cgi?id=142971
5
6         Reviewed by Jer Noble.
7
8         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
9         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Return true;
10
11 2015-03-23  Alex Christensen  <achristensen@webkit.org>
12
13         [MediaFoundation] Implement seek.
14         https://bugs.webkit.org/show_bug.cgi?id=142594
15
16         Reviewed by Darin Adler.
17
18         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
19         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
20         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
21         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
22         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
23
24 2015-03-23  Dan Bernstein  <mitz@apple.com>
25
26         Fixed the build.
27
28         * platform/graphics/cocoa/FontCocoa.mm:
29         (WebCore::Font::platformBoundsForGlyph): Switched to non-deprecated CTFontOrientation values.
30         (WebCore::Font::platformWidthForGlyph): Ditto.
31
32 2015-03-23  Jer Noble  <jer.noble@apple.com>
33
34         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
35         https://bugs.webkit.org/show_bug.cgi?id=142970
36
37         Reviewed by Eric Carlson.
38
39         Return early after synchronously calling to the main thread to allocate the volume
40         view, to avoid re-allocating the volume view again on the web thread.
41
42         * platform/audio/ios/MediaSessionManagerIOS.mm:
43         (-[WebMediaSessionHelper allocateVolumeView]):
44
45 2015-03-23  Tim Horton  <timothy_horton@apple.com>
46
47         Add a share item to the link action menu
48         https://bugs.webkit.org/show_bug.cgi?id=142961
49         <rdar://problem/19198374>
50
51         Reviewed by Beth Dakin.
52
53         * English.lproj/Localizable.strings:
54         Remove some now-unused strings.
55
56         * platform/spi/mac/NSMenuSPI.h:
57         Add some SPI.
58
59 2015-03-23  David Kilzer  <ddkilzer@apple.com>
60
61         [iOS] Build fix: CoreText deprecated kCTFontSystemFontType
62
63         Fix tracked by:  <rdar://problem/20261171>
64
65         * rendering/RenderThemeIOS.mm:
66         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
67         Add clang pragmas.
68
69 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
70
71         Unreviewed test fix.
72
73         * css/CSSParser.cpp:
74         (WebCore::CSSParser::parseScrollSnapDestination): Remove new assertion.
75
76 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
77
78         scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
79         https://bugs.webkit.org/show_bug.cgi?id=142552
80         <rdar://problem/20114743>
81
82         Reviewed by Dean Jackson.
83
84         Revise the snap point logic as follows:
85         (1) Put the snap point destination handling in a helper function to make the rest of the code
86             easier to read.
87         (2) Make sure we always have a left-hand snap point (i.e., position 0), but don't add multiple
88             left-hand snap points.
89         (3) Create a helper function to determine if we should be working with the scroll snap 'elements'
90             behavior. We want to use this for scroll-snap-destination/scroll-snap-coordinate markup.
91         (4) Create per-element snap point offsets when using scroll-snap-destination/scroll-snap-coordinate.
92
93         * css/CSSParser.cpp:
94         (WebCore::CSSParser::parseScrollSnapDestination): Add assertion to try to catch bad parser state.
95         * page/scrolling/AxisScrollSnapOffsets.cpp:
96         (WebCore::destinationOffsetForViewSize): Added helper function to consolidate logic for handling
97         destination coordinates.
98         (WebCore::updateFromStyle): Make sure a left-hand snap point is always provided.
99         (WebCore::styleUsesElements): Added helper function.
100         (WebCore::updateSnapOffsetsForScrollableArea): Revise logic to generate 'per-element' snap point
101         offsets.
102
103 2015-03-23  Yoav Weiss  <yoav@yoav.ws>
104
105         Refactor ImageLoader's setting of CachedImage
106         https://bugs.webkit.org/show_bug.cgi?id=142825
107
108         Reviewed by Chris Dumez.
109
110         No new tests, since there's no functional change.
111
112         setImage and setImageWithoutConsideringPendingLoadEvent were not called with new
113         CachedImages and were not used as originally intended. That resulted in some dead code,
114         and confusion when going over the code.
115         This patch renames these methods into equivalent clearImage* methods, and deletes resulting dead code.
116
117         * html/HTMLObjectElement.cpp:
118         (WebCore::HTMLObjectElement::renderFallbackContent): Changed setImage call to clearImage.
119         * loader/ImageLoader.cpp:
120         (WebCore::ImageLoader::clearImage):
121         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
122         (WebCore::ImageLoader::notifyFinished):
123         (WebCore::ImageLoader::elementDidMoveToNewDocument):
124         (WebCore::ImageLoader::setImage): Deleted.
125         (WebCore::ImageLoader::setImageWithoutConsideringPendingLoadEvent): Deleted.
126         * loader/ImageLoader.h:
127
128 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
129
130         CSS Selectors: fix attribute case-insensitive matching of Contain and List
131         https://bugs.webkit.org/show_bug.cgi?id=142932
132
133         Reviewed by Darin Adler.
134
135         Fix the last two attribute selectors that were using full case-insensitive
136         match:
137             -Contain ([foo*=bar]).
138             -List (foo~=bar]).
139
140         Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
141                fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html
142
143         * css/SelectorChecker.cpp:
144         (WebCore::attributeValueMatches):
145         * cssjit/SelectorCompiler.cpp:
146         (WebCore::SelectorCompiler::attributeValueContains):
147         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
148
149 2015-03-22  Benjamin Poulain  <bpoulain@apple.com>
150
151         Detect when url filter pattern with groups match the empty string
152         https://bugs.webkit.org/show_bug.cgi?id=142930
153
154         Reviewed by Sam Weinig.
155
156         The previous test was only accounting for simple atoms. This patch extends
157         it to groups.
158
159         * contentextensions/URLFilterParser.cpp:
160         (WebCore::ContentExtensions::Term::quantify):
161         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
162         (WebCore::ContentExtensions::GraphBuilder::finalize):
163         (WebCore::ContentExtensions::Term::quantifier): Deleted.
164
165 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
166
167         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
168         https://bugs.webkit.org/show_bug.cgi?id=142940
169
170         Reviewed by Sam Weinig.
171
172         * dom/Document.cpp:
173         (WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
174         * dom/Document.h:
175
176         * html/HTMLMediaSession.cpp:
177         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
178         * html/HTMLMediaSession.h:
179
180         * page/Page.cpp:
181         (WebCore::Page::didChoosePlaybackTarget):  Ditto.
182         * page/Page.h:
183
184         * platform/audio/MediaSession.h:
185         * platform/graphics/MediaPlaybackTargetPickerClient.h:
186         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: 
187         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.
188
189 2015-03-22  Anders Carlsson  <andersca@apple.com>
190
191         _WKWebsiteDataStore should clear WebSQL databases
192         https://bugs.webkit.org/show_bug.cgi?id=142947
193
194         Reviewed by Sam Weinig.
195
196         * Modules/webdatabase/DatabaseTracker.cpp:
197         (WebCore::DatabaseTracker::trackerWithDatabasePath):
198         Add a hack so we can get at a tracker from the UI process.
199
200         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
201         New function that deletes all databases modified after a given time.
202
203         * Modules/webdatabase/DatabaseTracker.h:
204         Add new members and export the ones we want to call from WebKit2.
205
206         * Modules/webdatabase/OriginLock.h:
207         Export the destructor.
208
209 2015-03-21  Dean Jackson  <dino@apple.com>
210
211         Remove the prefix for CSS Transforms
212         https://bugs.webkit.org/show_bug.cgi?id=142927
213         <rdar://problem/11568151>
214
215         Reviewed by Simon Fraser.
216
217         Support the bare form of:
218         - transform
219         - transform-style
220         - transform-origin
221         - perspective
222         - perspective-origin
223
224         For transform-style, we also still differentiate the prefixed property
225         because we may want to use that as an indicator of legacy content.
226
227         This is mostly a find and replace, but with some related naming
228         changes. The DOM interface for WebKitCSSTransformValue remains
229         unchanged.
230
231         Tests: transforms/2d/transform-2d-prefixed.html
232                transforms/3d/general/prefixed-3dtransform-values.html
233
234         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
235         (WebCore::propertyChangeMayRepaintNonDescendants):
236         * css/CSSComputedStyleDeclaration.cpp:
237         (WebCore::isLayoutDependent):
238         (WebCore::ComputedStyleExtractor::propertyValue):
239         * css/CSSParser.cpp:
240         (WebCore::isValidKeywordPropertyAndValue):
241         (WebCore::isKeywordPropertyID):
242         (WebCore::parseTranslateTransformValue):
243         (WebCore::CSSParser::parseValue):
244         (WebCore::CSSParser::parseTransformOrigin):
245         (WebCore::CSSParser::parsePerspectiveOrigin):
246         * css/CSSPropertyNames.in:
247         * css/StyleProperties.cpp:
248         (WebCore::StyleProperties::getPropertyValue):
249         (WebCore::StyleProperties::asText):
250         * css/WebKitCSSMatrix.cpp:
251         (WebCore::WebKitCSSMatrix::setMatrixValue):
252         * html/track/VTTCue.cpp:
253         (WebCore::VTTCueBox::applyCSSProperties):
254         * page/animation/AnimationController.cpp:
255         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
256         * page/animation/CSSPropertyAnimation.cpp:
257         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
258         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
259         * page/animation/CompositeAnimation.cpp:
260         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
261         * page/animation/ImplicitAnimation.cpp:
262         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
263         * page/animation/KeyframeAnimation.cpp:
264         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
265         (WebCore::KeyframeAnimation::validateTransformFunctionList):
266         * platform/graphics/GraphicsLayer.cpp:
267         (WebCore::GraphicsLayer::validateTransformOperations):
268         * platform/graphics/GraphicsLayerClient.h:
269         * platform/graphics/ca/GraphicsLayerCA.cpp:
270         (WebCore::propertyIdToString):
271         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
272         (WebCore::GraphicsLayerCA::addAnimation):
273         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
274         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
275         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
276         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
277         (WebCore::GraphicsLayerTextureMapper::addAnimation):
278         * platform/graphics/texmap/TextureMapperAnimation.cpp:
279         (WebCore::TextureMapperAnimation::applyInternal):
280         * platform/graphics/texmap/TextureMapperLayer.cpp:
281         (WebCore::TextureMapperLayer::syncAnimations):
282         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
283         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
284         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
285         (WebCore::CoordinatedGraphicsLayer::addAnimation):
286         * rendering/RenderLayerBacking.cpp:
287         (WebCore::RenderLayerBacking::updateGeometry):
288         (WebCore::RenderLayerBacking::startAnimation):
289         (WebCore::RenderLayerBacking::startTransition):
290         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
291         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
292         * rendering/RenderLayerCompositor.cpp:
293         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
294         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
295         * svg/SVGElement.cpp:
296         (WebCore::populateAttributeNameToCSSPropertyIDMap):
297
298 2015-03-21  Commit Queue  <commit-queue@webkit.org>
299
300         Unreviewed, rolling out r181824.
301         https://bugs.webkit.org/show_bug.cgi?id=142935
302
303         Broke Windows build (Requested by ap on #webkit).
304
305         Reverted changeset:
306
307         "Remove the prefix for CSS Transforms"
308         https://bugs.webkit.org/show_bug.cgi?id=142927
309         http://trac.webkit.org/changeset/181824
310
311 2015-03-20  Dean Jackson  <dino@apple.com>
312
313         Remove the prefix for CSS Transforms
314         https://bugs.webkit.org/show_bug.cgi?id=142927
315         <rdar://problem/11568151>
316
317         Reviewed by Simon Fraser.
318
319         Support the bare form of:
320         - transform
321         - transform-style
322         - transform-origin
323         - perspective
324         - perspective-origin
325
326         For transform-style, we also still differentiate the prefixed property
327         because we may want to use that as an indicator of legacy content.
328
329         This is mostly a find and replace, but with some related naming
330         changes. The DOM interface for WebKitCSSTransformValue remains
331         unchanged.
332
333         Tests: transforms/2d/transform-2d-prefixed.html
334                transforms/3d/general/prefixed-3dtransform-values.html
335
336         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
337         (WebCore::propertyChangeMayRepaintNonDescendants):
338         * css/CSSComputedStyleDeclaration.cpp:
339         (WebCore::isLayoutDependent):
340         (WebCore::ComputedStyleExtractor::propertyValue):
341         * css/CSSParser.cpp:
342         (WebCore::isValidKeywordPropertyAndValue):
343         (WebCore::isKeywordPropertyID):
344         (WebCore::parseTranslateTransformValue):
345         (WebCore::CSSParser::parseValue):
346         (WebCore::CSSParser::parseTransformOrigin):
347         (WebCore::CSSParser::parsePerspectiveOrigin):
348         * css/CSSPropertyNames.in:
349         * css/StyleProperties.cpp:
350         (WebCore::StyleProperties::getPropertyValue):
351         (WebCore::StyleProperties::asText):
352         * css/WebKitCSSMatrix.cpp:
353         (WebCore::WebKitCSSMatrix::setMatrixValue):
354         * html/track/VTTCue.cpp:
355         (WebCore::VTTCueBox::applyCSSProperties):
356         * page/animation/AnimationController.cpp:
357         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
358         * page/animation/CSSPropertyAnimation.cpp:
359         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
360         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
361         * page/animation/CompositeAnimation.cpp:
362         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
363         * page/animation/ImplicitAnimation.cpp:
364         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
365         * page/animation/KeyframeAnimation.cpp:
366         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
367         (WebCore::KeyframeAnimation::validateTransformFunctionList):
368         * platform/graphics/GraphicsLayer.cpp:
369         (WebCore::GraphicsLayer::validateTransformOperations):
370         * platform/graphics/GraphicsLayerClient.h:
371         * platform/graphics/ca/GraphicsLayerCA.cpp:
372         (WebCore::propertyIdToString):
373         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
374         (WebCore::GraphicsLayerCA::addAnimation):
375         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
376         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
377         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
378         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
379         (WebCore::GraphicsLayerTextureMapper::addAnimation):
380         * platform/graphics/texmap/TextureMapperAnimation.cpp:
381         (WebCore::TextureMapperAnimation::applyInternal):
382         * platform/graphics/texmap/TextureMapperLayer.cpp:
383         (WebCore::TextureMapperLayer::syncAnimations):
384         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
385         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
386         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
387         (WebCore::CoordinatedGraphicsLayer::addAnimation):
388         * rendering/RenderLayerBacking.cpp:
389         (WebCore::RenderLayerBacking::updateGeometry):
390         (WebCore::RenderLayerBacking::startAnimation):
391         (WebCore::RenderLayerBacking::startTransition):
392         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
393         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
394         * rendering/RenderLayerCompositor.cpp:
395         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
396         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
397         * svg/SVGElement.cpp:
398         (WebCore::populateAttributeNameToCSSPropertyIDMap):
399
400 2015-03-20  Yusuke Suzuki  <utatane.tea@gmail.com>
401
402         REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83
403         https://bugs.webkit.org/show_bug.cgi?id=142410
404
405         Reviewed by Geoffrey Garen.
406
407         The same issues are found in the existing code; PropertyName does not have ownership.
408         This patch rewrite the point that should have ownership to Identifier.
409
410         * bindings/js/JSDOMWindowCustom.cpp:
411         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
412         (WebCore::JSDOMWindow::putByIndex):
413         * bindings/js/ReadableStreamJSSource.cpp:
414         (WebCore::getInternalSlotFromObject):
415         * bindings/scripts/CodeGeneratorJS.pm:
416         (GenerateImplementation):
417         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
418         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
419         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
420         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
421         * bindings/scripts/test/JS/JSTestInterface.cpp:
422         (WebCore::JSTestInterface::putByIndex):
423
424 2015-03-20  Simon Fraser  <simon.fraser@apple.com>
425
426         Log the slow-scrolling reasons (if any) on first commit of a ScrollingTreeFrameScrollingNodeMac
427         https://bugs.webkit.org/show_bug.cgi?id=142917
428
429         Reviewed by Beth Dakin.
430         
431         The scrollperf test would fail to detect transitions between slow and fast scrolling
432         for new pages, because there was no logging when slow-scrolling scrolling tree was
433         torn down, and a new fast-scrolling tree constructed.
434         
435         Fix by always logging the slow-scrolling reasons in the first update of the
436         ScrollingTreeFrameScrollingNodeMac, even when the slow-scrolling reasons haven't
437         changed.
438
439         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
440         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
441         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
442         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
443
444 2015-03-19  Geoffrey Garen  <ggaren@apple.com>
445
446         Function.prototype.toString should not decompile the AST
447         https://bugs.webkit.org/show_bug.cgi?id=142853
448
449         Reviewed by Sam Weinig.
450
451         * bindings/js/JSLazyEventListener.cpp:
452         (WebCore::JSLazyEventListener::initializeJSFunction): Adjust the line
453         number of attribute event listeners to account for the leading newline
454         now added by JavaScriptCore.
455
456         This solution is not perfect, but there are a lot of pre-existing problems
457         with line and column reporting for attribute event listeners, and this
458         preserves existing behavior with reasonable reliability.
459
460 2015-03-20  Alex Christensen  <achristensen@webkit.org>
461
462         Progress towards CMake on Mac.
463         https://bugs.webkit.org/show_bug.cgi?id=136003
464
465         Reviewed by Chris Dumez.
466
467         * PlatformMac.cmake:
468         Added some directories to create forwarding headers from.
469         Generate ObjC bindings.
470
471 2015-03-20  Per Arne Vollan  <peavo@outlook.com>
472
473         [WinCairo] Crash when leaving page while video is playing.
474         https://bugs.webkit.org/show_bug.cgi?id=142578
475
476         Reviewed by Alex Christensen.
477
478         This can happen when there is an asynchronous event invoked from a video worker
479         thread, accessing the media player object after it has been deleted.
480         This is solved by resetting the media player pointer in the event object,
481         when the media player is deleted.
482
483         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
484         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
485         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
486         (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
487         (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
488         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AsyncCallback):
489         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback):
490         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
491         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
492         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
493         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::MediaPlayerListener):
494         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::~MediaPlayerListener):
495         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::onMediaPlayerDeleted):
496
497 2015-03-20  Chris Dumez  <cdumez@apple.com>
498
499         Regression(r181782): Caused WebKit2.RestoreSessionStateContainingFormData API test to crash
500         https://bugs.webkit.org/show_bug.cgi?id=142911
501
502         Reviewed by Antti Koivisto.
503
504         Drop the isBackForwardLoadType(m_loadType) assertion in
505         FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad(). This assertion
506         used to hold true when goToBackForwardItem() was only called with
507         history navigation load types. However, after r181782, we use a Standard
508         load in the cases where we do not wish to display stale content (e.g.
509         restoring session state).
510
511         The assertion comment says "We only use cache-only loads to avoid
512         resubmitting forms". However, we then call loadDifferentDocumentItem()
513         which already takes care of using the ReturnCacheDataElseLoad cache
514         policy as the HistoryItem has form data and we pass
515         MayNotAttemptCacheOnlyLoadForFormSubmissionItem as parameter.
516
517         No new tests, covered by WebKit2.RestoreSessionStateContainingFormData
518         API test.
519
520         * loader/FrameLoader.cpp:
521         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
522
523 2015-03-20  Andy Estes  <aestes@apple.com>
524
525         [Content Filtering] Adopt NEFilterSource unblock handling
526         https://bugs.webkit.org/show_bug.cgi?id=142904
527
528         Reviewed by Andreas Kling.
529
530         * platform/cocoa/NetworkExtensionContentFilter.mm:
531         (WebCore::NetworkExtensionContentFilter::unblockHandler):
532         Returned an unblock handler that calls -[NEFilterSource remediateWithDecisionHandler:].
533         * platform/cocoa/ParentalControlsContentFilter.mm:
534         (WebCore::ParentalControlsContentFilter::unblockHandler): Used ASCIILiteral.
535
536 2015-03-19  Andy Estes  <aestes@apple.com>
537
538         [Content Filtering] Add tests for unblock requests
539         https://bugs.webkit.org/show_bug.cgi?id=142900
540
541         Reviewed by Andreas Kling.
542
543         Currently the iOS Parental Controls content filter has a mechanism for requesting that a page be unblocked.
544         WebKit implements this by listening for navigations originating from the filter's error page to a special URL,
545         and requesting the page be unblocked via platform API, which might cause UI to be displayed. If the unblock is
546         successful then we schedule a reload of the frame in order to display the unblocked document.
547
548         NetworkExtension also supports unblock requests, so in preparation for adopting its API, this patch allows
549         content filters to specify their own unblock request method, teaches MockContentFilter to provide such a method,
550         and writes tests to cover both allowed and denied unblock requests.
551
552         The content filter that blocks a load creates a ContentFilterUnblockHandler, passing it a lambda that is executed
553         when a navigation matches the filter's special unblock URL. Filters can also specify that a script be executed in
554         the context of its error page if the unblock is denied.
555
556         All platform content filters can handle unblock requests like this with the exception of iOS Parental Controls in WebKit2.
557         Since UI can be displayed by the system in this case, the request must be made from within the UI process. Therefore the
558         existing method is retained of serializing a WebFilterEvaluator and intercepting navigation policy calls in the UI process.
559
560         Tests: contentfiltering/allow-after-unblock-request.html
561                contentfiltering/block-after-unblock-request.html
562
563         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
564         (WebCore::JSMockContentFilterSettings::decisionPoint): Added some using statements for clarity.
565         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
566         (WebCore::toJSValue): Returns a JSValue from a Decision.
567         (WebCore::toDecision): Returns a Decision from a JSValue.
568         (WebCore::JSMockContentFilterSettings::decision): Used toJSValue.
569         (WebCore::JSMockContentFilterSettings::setDecision): Used toDecision.
570         (WebCore::JSMockContentFilterSettings::unblockRequestDecision): Used toJSValue.
571         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision): Used toDecision.
572         * loader/ContentFilter.cpp:
573         (WebCore::ContentFilter::createIfNeeded): Passed a reference to the owning DocumentLoader.
574         (WebCore::ContentFilter::ContentFilter): Ditto.
575         (WebCore::ContentFilter::unblockHandler): If the unblockHandler requests that a script be executed when an
576         unblock request is denied, create a wrapper unblockHandler that executes that script in m_documentLoader's frame.
577         * loader/ContentFilter.h:
578         * loader/DocumentLoader.cpp:
579         (WebCore::DocumentLoader::responseReceived): Passed this to ContentFilter::createIfNeeded.
580         * loader/FrameLoader.cpp:
581         (WebCore::FrameLoader::prepareForLoadStart): Called PolicyChecker::prepareForLoadStart.
582         * loader/PolicyChecker.cpp:
583         (WebCore::PolicyChecker::prepareForLoadStart): Reset m_contentFilterUnblockHandler.
584         (WebCore::PolicyChecker::checkNavigationPolicy): Moved logic to here from WebKit1's WebFrameLoaderClient.
585         Placing it here allows it to be shared between WebKit1 and WebKit2 (when the unblock handler does not need to
586         be called in the UI process).
587         * loader/PolicyChecker.h:
588         (WebCore::PolicyChecker::setContentFilterUnblockHandler): Added.
589         * page/Frame.h: Made Frame ThreadSafeRefCounted, since RefPtr<Frames> are captured in lambdas that can be
590         copied by background threads managed by the underlying platform.
591         * platform/ContentFilterUnblockHandler.h:
592         (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Returned the Apple content filter scheme.
593         (WebCore::ContentFilterUnblockHandler::unblockURLHost): Returned the unblock URL host.
594         (WebCore::ContentFilterUnblockHandler::clear): Deleted.
595         * platform/PlatformContentFilter.h:
596         (WebCore::PlatformContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
597         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
598         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler): Added a constructor that takes an
599         unblockURLHost and a UnblockRequesterFunction. Added an alternate constructor for iOS Parental Controls on
600         WebKit2 that takes an unblockURLHost and a WebFilterEvaluator.
601         (WebCore::ContentFilterUnblockHandler::needsUIProcess): Returned true if m_webFilterEvaluator is non-null.
602         (WebCore::ContentFilterUnblockHandler::encode): Encoded m_unblockURLHost in addition to m_webFilterEvaluator.
603         (WebCore::ContentFilterUnblockHandler::decode): Decoded m_unblockURLHost in addition to m_webFilterEvaluator.
604         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Returned true if there is a either a m_unblockRequester
605         or a m_webFilterEvaluator and the request's host and scheme match those of the unblock request URL.
606         (WebCore::dispatchToMainThread): Added a helper to dispatch a block to the main thread. Then if the web thread
607         is enabled on iOS, dispatch it there.
608         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Renamed from handleUnblockRequestAndDispatchIfSuccessful.
609         Requested an unblock using either m_unblockRequester or m_webFilterEvaluator, then called decisionHandler with the response.
610         (WebCore::scheme): Moved to ContentFilterUnblockHandler::unblockURLScheme.
611         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful): Renamed to requestUnblockAsync.
612         * platform/cocoa/ParentalControlsContentFilter.mm:
613         (WebCore::ParentalControlsContentFilter::unblockHandler): Returned an unblock handler using the WebFilterEvaluator constructor.
614         * testing/MockContentFilter.cpp: Added using statments for clarity.
615         (WebCore::settings): Added a helper to get MockContentFilterSettings::singleton().
616         (WebCore::MockContentFilter::canHandleResponse): Used the helper.
617         (WebCore::MockContentFilter::MockContentFilter): Took advantage of the using statements.
618         (WebCore::MockContentFilter::addData): Ditto.
619         (WebCore::MockContentFilter::finishedAddingData): Ditto.
620         (WebCore::MockContentFilter::unblockHandler): Returned a ContentFilterUnblockHandler that checks settings() for its decision.
621         (WebCore::MockContentFilter::unblockRequestDeniedScript): Returned the script to execute in MockContentFilter's
622         error page when an unblock request is denied.
623         (WebCore::MockContentFilter::maybeDetermineStatus): Took advantage of settings() and using statements.
624         * testing/MockContentFilterSettings.cpp:
625         (WebCore::MockContentFilterSettings::unblockRequestURL): Constructed a static unblock URL and returned it.
626         * testing/MockContentFilterSettings.h:
627         (WebCore::MockContentFilterSettings::unblockURLHost): Returned the filter's unblock URL host.
628         (WebCore::MockContentFilterSettings::unblockRequestDecision): Returns the decision to make for an unblock request.
629         (WebCore::MockContentFilterSettings::setUnblockRequestDecision): Sets the decision to make for an unblock request.
630         * testing/MockContentFilterSettings.idl: Added the unblockRequestDecision and unblockRequestURL attributes.
631
632 2015-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
633
634         [GTK] Crash due to empty drag image during drag-and-drop
635         https://bugs.webkit.org/show_bug.cgi?id=142671
636
637         Reviewed by Philippe Normand.
638
639         Return early from ImageBuffer constructor if an empty size is
640         given. This is a speculative fix for a crash while starting a drag
641         and drop operation, that I haven't been able to reproduce.
642
643         * platform/graphics/cairo/ImageBufferCairo.cpp:
644         (WebCore::ImageBuffer::ImageBuffer):
645
646 2015-03-19  Chris Dumez  <cdumez@apple.com>
647
648         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
649         https://bugs.webkit.org/show_bug.cgi?id=142893
650         <rdar://problem/19633737>
651         <rdar://problem/19869257>
652
653         Reviewed by Antti Koivisto.
654
655         Always use ReturnCacheDataElseLoad cache policy for history navigations.
656         Previously, we would use the default protocol cache policy for history
657         navigations if m_stateMachine.committedFirstRealDocumentLoad() returned
658         false so that we do not display stale content when restoring the session
659         state of Safari statup (rdar://problem/8131355). This is now handled
660         before reaching this method by no longer using "IndexedBackForward"
661         FrameLoadType when restoring session tabs, and using "Standard" load
662         type instead.
663
664         * loader/FrameLoader.cpp:
665         (WebCore::FrameLoader::loadDifferentDocumentItem):
666
667 2015-03-19  Andy Estes  <aestes@apple.com>
668
669         [Content Filtering] Move ContentFilter to from platform/ to loader/
670         https://bugs.webkit.org/show_bug.cgi?id=142897
671
672         Reviewed by Dan Bernstein.
673
674         ContentFilterCollection never contained any platform code, so it doesn't make sense for it to be in platform.
675         Move it to loader/, since ContentFilters are owned by DocumentLoaders, and just call it ContentFilter. Extract
676         the abstract part of ContentFilter into a new base class called PlatformContentFilter that each of the
677         individual filters inherit from.
678
679         * WebCore.xcodeproj/project.pbxproj:
680         * loader/ContentFilter.cpp: Renamed from Source/WebCore/platform/ContentFilter.cpp.
681         (WebCore::ContentFilter::types): Moved from ContentFilterCollection.
682         (WebCore::ContentFilter::createIfNeeded): Ditto.
683         (WebCore::ContentFilter::ContentFilter): Ditto.
684         (WebCore::ContentFilter::addData): Ditto.
685         (WebCore::ContentFilter::finishedAddingData): Ditto.
686         (WebCore::ContentFilter::needsMoreData): Ditto.
687         (WebCore::ContentFilter::didBlockData): Ditto.
688         (WebCore::ContentFilter::getReplacementData): Ditto.
689         (WebCore::ContentFilter::unblockHandler): Ditto.
690         * loader/ContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
691         (WebCore::ContentFilter::type): Replaced a use of ContentFilterCollection.
692         * platform/PlatformContentFilter.h: Renamed from Source/WebCore/platform/ContentFilter.h.
693         * platform/cocoa/NetworkExtensionContentFilter.h: Inherited from PlatformContentFilter.
694         * platform/cocoa/ParentalControlsContentFilter.h: Ditto.
695         * testing/MockContentFilter.h: Ditto.
696
697 2015-03-19  Dean Jackson  <dino@apple.com>
698
699         CSS Animations with triggers should map scroll position to duration
700         https://bugs.webkit.org/show_bug.cgi?id=142870
701         <rdar://problem/20227244>
702
703         Reviewed by Simon Fraser.
704
705         Expose a prototype implementation of what will eventually be called
706         animation-timebase, mapping the scroll location to the duration of an
707         animation. This only applies if the animation has a start and end
708         trigger.
709
710         Test: animations/trigger-container-scroll-boundaries.html
711
712         * css/CSSComputedStyleDeclaration.cpp:
713         (WebCore::createAnimationTriggerValue): Change to downcast.
714
715         * css/CSSToStyleMap.cpp:
716         (WebCore::CSSToStyleMap::mapAnimationTrigger): Fix a bug where I wasn't
717         telling the ScrollAnimationTrigger object whether or not it had
718         an end value. This wasn't visible before because we were not using
719         the end value.
720
721         * page/animation/AnimationBase.cpp:
722         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Add a comment and
723         change to using a downcast.
724         (WebCore::AnimationBase::timeToNextService): Change to downcast.
725         (WebCore::AnimationBase::freezeAtTime): Whitespace cleanup.
726         (WebCore::AnimationBase::getElapsedTime): Calculate the elapsedTime based
727         on the scroll position relative to the start and end trigger spots.
728
729         * page/animation/AnimationController.cpp:
730         (WebCore::AnimationControllerPrivate::updateAnimations): Since this
731         can potentially call into beginAnimationUpdateTime, it should have
732         an update blocker. This fixes the assert we were seeing in tests.
733         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Keep track of the scroll
734         position so we don't need to ask for it all the time.
735         * page/animation/AnimationControllerPrivate.h:
736         (WebCore::AnimationControllerPrivate::scrollPosition): New accessor.
737
738         * platform/animation/AnimationTrigger.h: Add downcast macros.
739         (WebCore::ScrollAnimationTrigger::create): Calculate hasEndValue from the passed
740         parameters rather than a separate value.
741         (WebCore::ScrollAnimationTrigger::hasEndValue):
742         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
743         (WebCore::ScrollAnimationTrigger::setHasEndValue): Deleted.
744
745         * platform/graphics/ca/GraphicsLayerCA.cpp:
746         (WebCore::GraphicsLayerCA::animationCanBeAccelerated): If we have an
747         animation of this sort, we can't use a CAAnimation.
748
749 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
750
751         [Mac] Move MediaPlaybackTargetPicker
752         https://bugs.webkit.org/show_bug.cgi?id=142889
753
754         Move WebMediaPlaybackTargetPickerProxy from WK2 and rename as MediaPlaybackTargetPicker so it
755         can be used by both WK2 and WK1.
756
757         Reviewed by Tim Horton.
758
759         * WebCore.xcodeproj/project.pbxproj:
760         * platform/graphics/MediaPlaybackTargetPicker.cpp: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp.
761         * platform/graphics/MediaPlaybackTargetPicker.h: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.h.
762         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h.
763         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm.
764
765 2015-03-19  Enrica Casucci  <enrica@apple.com>
766
767         REGRESSION (r109593): Clicking after last inline element could cause a crash.
768         https://bugs.webkit.org/show_bug.cgi?id=142880
769         rdar://problem/17222294
770
771         Reviewed by Ryosuke Niwa.
772
773         Test: editing/selection/click-after-last-inline-crash.html
774
775         * rendering/RootInlineBox.cpp:
776         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
777
778 2015-03-19  Enrica Casucci  <enrica@apple.com>
779
780         One more build fix after r181760.
781
782         * page/EventHandler.cpp:
783         (WebCore::EventHandler::handleDrag):
784
785 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
786
787         Build fix after r181760.
788
789         * rendering/RenderAttachment.h:
790
791 2015-03-19  Jer Noble  <jer.noble@apple.com>
792
793         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
794         https://bugs.webkit.org/show_bug.cgi?id=142132
795
796         Reviewed by Tim Horton.
797
798         Add a new utility method to calculate a rect with a specific aspect ratio wrapping a smaller one.
799
800         * platform/graphics/GeometryUtilities.cpp:
801         (WebCore::smallestRectWithAspectRatioAroundRect):
802         * platform/graphics/GeometryUtilities.h:
803
804 2015-03-19  Chris Dumez  <cdumez@apple.com>
805
806         Get rid of "CachePolicyCache" cache policy
807         https://bugs.webkit.org/show_bug.cgi?id=142881
808
809         Reviewed by Antti Koivisto.
810
811         Get rid of "CachePolicyCache" cache policy as it is unused.
812
813         * loader/cache/CachePolicy.h:
814         * loader/cache/CachedResource.cpp:
815         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
816         * page/DiagnosticLoggingKeys.cpp:
817         (WebCore::DiagnosticLoggingKeys::mustRevalidateIsExpiredKey): Deleted.
818         * page/DiagnosticLoggingKeys.h:
819
820 2015-03-19  Alex Christensen  <achristensen@webkit.org>
821
822         [Content Extensions] Test regular expression parse failures.
823         https://bugs.webkit.org/show_bug.cgi?id=142872
824
825         Reviewed by Benjamin Poulain.
826
827         * contentextensions/URLFilterParser.cpp:
828         (WebCore::ContentExtensions::GraphBuilder::finalize):
829         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
830         (WebCore::ContentExtensions::URLFilterParser::addPattern):
831         (WebCore::ContentExtensions::URLFilterParser::statusString):
832         * contentextensions/URLFilterParser.h:
833         Changed failures that can never happen to assertions.
834
835 2015-03-19  Enrica Casucci  <enrica@apple.com>
836
837         Release build fix after https://trac.webkit.org/r181760.
838
839         Unreviewed.
840
841         * page/EventHandler.cpp:
842         (WebCore::EventHandler::handleDrag):
843
844 2015-03-19  Enrica Casucci  <enrica@apple.com>
845
846         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
847         https://bugs.webkit.org/show_bug.cgi?id=142801
848         rdar://problem/19982527
849
850         Reviewed by Tim Horton.
851
852         Test: editing/pasteboard/drag-and-drop-attachment-contenteditable.html
853
854         This patch adds all the necessary support to write attachment elements into
855         the pasteboard, including the promised type.
856
857         * WebCore.xcodeproj/project.pbxproj:
858         * page/DragActions.h:
859         * page/DragClient.h:
860         (WebCore::DragClient::declareAndWriteAttachment):
861         * page/DragController.cpp:
862         (WebCore::DragController::draggableElement):
863         (WebCore::DragController::startDrag):
864         * page/DragController.h:
865         (WebCore::DragController::draggingAttachmentURL):
866         * page/EventHandler.cpp:
867         (WebCore::EventHandler::dragHysteresisExceeded):
868         (WebCore::EventHandler::handleDrag):
869         * page/mac/DragControllerMac.mm:
870         (WebCore::DragController::declareAndWriteAttachment):
871         * page/win/DragControllerWin.cpp:
872         (WebCore::DragController::declareAndWriteAttachment):
873         * platform/URL.cpp:
874         (WebCore::URL::fileURLWithFileSystemPath):
875         * platform/URL.h:
876         * rendering/HitTestResult.cpp:
877         (WebCore::HitTestResult::absoluteAttachmentURL):
878         * rendering/HitTestResult.h:
879
880 2015-03-19  Chris Dumez  <cdumez@apple.com>
881
882         Unreviewed, fix linking error after r181753.
883
884         Drop WEBCORE_EXPORT for Settings::minimumDOMTimerInterval() as it is
885         now inlined.
886
887         * page/Settings.h:
888         (WebCore::Settings::minimumDOMTimerInterval):
889
890 2015-03-19  Brady Eidson  <beidson@apple.com>
891
892         Part of content extensions should apply css selectors
893         https://bugs.webkit.org/show_bug.cgi?id=142604
894
895         Reviewed by Alex Christensen.
896
897         Add a new action for applying the cached global stylesheet.
898
899         * contentextensions/CompiledContentExtension.cpp:
900         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
901
902         * contentextensions/ContentExtensionActions.h:
903
904         * contentextensions/ContentExtensionCompiler.cpp:
905         (WebCore::ContentExtensions::serializeActions):
906
907         * contentextensions/ContentExtensionParser.cpp:
908         (WebCore::ContentExtensions::loadAction):
909
910         * contentextensions/ContentExtensionRule.cpp:
911         (WebCore::ContentExtensions::Action::deserialize):
912         * contentextensions/ContentExtensionRule.h:
913         (WebCore::ContentExtensions::Action::Action):
914         (WebCore::ContentExtensions::Action::operator==):
915         (WebCore::ContentExtensions::Action::stringArgument):
916         (WebCore::ContentExtensions::Action::cssSelector): Deleted.
917
918         * contentextensions/ContentExtensionsBackend.cpp:
919         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
920
921         * loader/cache/CachedResourceLoader.cpp:
922         (WebCore::CachedResourceLoader::requestResource):
923
924 2015-03-19  Chris Dumez  <cdumez@apple.com>
925
926         Clean up DOMTimer related settings
927         https://bugs.webkit.org/show_bug.cgi?id=142837
928
929         Reviewed by Darin Adler.
930
931         Clean up DOMTimer related settings:
932         - Make default minimum timer interval 4ms instead of 10ms as all ports
933           were setting it to 4ms and the specifications says 4ms.
934         - Get rid of setters for default DOMTimer interval values as they are
935           not set anymore.
936         - Move default DOMTimer interval values from Settings to DOMTimer as
937           those are global (not per-page) and not really settings.
938         - Stop using abbreviations in the names (e.g. min -> minimum).
939         - Move DOMTimer settings members from Page to Settings. There is no
940           reason for those to be stored on the Page. The getters were private
941           so call-sites had to go via Settings anyway. Also, call-sites already
942           had to do a null check on the page to get the settings. It seems
943           unfortunate for the settings to do another null-check on the page for
944           retrieving the setting value from the page.
945         - Inline the DOMTimer settings getters as these are trivial.
946
947         * dom/Document.cpp:
948         (WebCore::Document::minimumTimerInterval):
949         (WebCore::Document::timerAlignmentInterval):
950         * dom/ScriptExecutionContext.cpp:
951         (WebCore::ScriptExecutionContext::minimumTimerInterval):
952         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
953         * page/DOMTimer.h:
954         * page/Page.cpp:
955         (WebCore::Page::Page):
956         (WebCore::Page::setTimerThrottlingEnabled):
957         (WebCore::Page::setMinimumTimerInterval): Deleted.
958         (WebCore::Page::minimumTimerInterval): Deleted.
959         * page/Page.h:
960         (WebCore::Page::timerAlignmentInterval): Deleted.
961         * page/Settings.cpp:
962         (WebCore::Settings::Settings):
963         (WebCore::Settings::setMinimumDOMTimerInterval):
964         (WebCore::Settings::setDOMTimerAlignmentInterval):
965         (WebCore::Settings::setHiddenPageDOMTimerAlignmentInterval): Deleted.
966         (WebCore::Settings::hiddenPageDOMTimerAlignmentInterval): Deleted.
967         (WebCore::Settings::setDefaultMinDOMTimerInterval): Deleted.
968         (WebCore::Settings::defaultMinDOMTimerInterval): Deleted.
969         (WebCore::Settings::setMinDOMTimerInterval): Deleted.
970         (WebCore::Settings::minDOMTimerInterval): Deleted.
971         (WebCore::Settings::setDefaultDOMTimerAlignmentInterval): Deleted.
972         (WebCore::Settings::defaultDOMTimerAlignmentInterval): Deleted.
973         (WebCore::Settings::domTimerAlignmentInterval): Deleted.
974         * page/Settings.h:
975         (WebCore::Settings::minimumDOMTimerInterval):
976         (WebCore::Settings::domTimerAlignmentInterval):
977         * testing/InternalSettings.cpp:
978         (WebCore::InternalSettings::Backup::Backup):
979         (WebCore::InternalSettings::Backup::restoreTo):
980         (WebCore::InternalSettings::setMinimumTimerInterval):
981
982 2015-03-19  Carlos Garcia Campos  <cgarcia@igalia.com>
983
984         [GTK] Scrollbars look bad with GTK+ 3.16
985         https://bugs.webkit.org/show_bug.cgi?id=140800
986
987         Reviewed by Sergio Villar Senin.
988
989         Take margin into account when rendering scrollbars. This fixes the
990         huge scrollbars rendered with GTK+ 3.16. We don't need to check
991         the GTK+ version because in previous versions the marging were 0,
992         so the same code just works.
993
994         * platform/gtk/ScrollbarThemeGtk.cpp:
995         (WebCore::adjustRectAccordingToMargin):
996         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
997         (WebCore::ScrollbarThemeGtk::paintThumb):
998
999 2015-03-19  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1000
1001         [Streams API] Update ReadableStream API according new version of the specification
1002         https://bugs.webkit.org/show_bug.cgi?id=142822
1003
1004         Reviewed by Benjamin Poulain.
1005
1006         This patch updates the IDL of ReadableStream according the new version of the spec, which splits functionality between ReadableStream and ReadableStreamReader.
1007         In particular, this patch removes read(), ready, closed and state from ReadableStream and it adds the getReader method.
1008
1009         Covered by updated readablestream-constructor.html test.
1010
1011         * Modules/streams/ReadableStream.cpp:
1012         (WebCore::ReadableStream::ReadableStream):
1013         (WebCore::ReadableStream::state): Deleted.
1014         (WebCore::ReadableStream::closed): Deleted.
1015         (WebCore::ReadableStream::ready): Deleted.
1016         * Modules/streams/ReadableStream.h:
1017         (WebCore::ReadableStream::internalState): Added to make mac build system happy, to be used by ReadableStreamReader.
1018         * Modules/streams/ReadableStream.idl:
1019         * bindings/js/JSReadableStreamCustom.cpp:
1020         (WebCore::JSReadableStream::cancel):
1021         (WebCore::JSReadableStream::getReader):
1022         (WebCore::JSReadableStream::read): Deleted.
1023         (WebCore::getOrCreatePromiseDeferredFromObject): Deleted.
1024         (WebCore::readyPromiseSlotName): Deleted.
1025         (WebCore::JSReadableStream::ready): Deleted.
1026         (WebCore::closedPromiseSlotName): Deleted.
1027         (WebCore::JSReadableStream::closed): Deleted.
1028
1029 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
1030
1031         Unreviewed. GTK build fix after r181720.
1032
1033         * rendering/RenderImage.cpp:
1034         (WebCore::RenderImage::styleDidChange):
1035
1036 2015-03-18  Antti Koivisto  <antti@apple.com>
1037
1038         Test disk cache behavior when using back navigation cache policy
1039         https://bugs.webkit.org/show_bug.cgi?id=142848
1040
1041         Reviewed by Chris Dumez.
1042
1043         Add a way to override the normal cache policy so we can test reload behavior of cache without actually reloading.
1044
1045         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
1046
1047         * loader/FrameLoader.cpp:
1048         (WebCore::FrameLoader::addExtraFieldsToRequest):
1049         * loader/FrameLoader.h:
1050         (WebCore::FrameLoader::setOverrideCachePolicyForTesting):
1051         * testing/Internals.cpp:
1052         (WebCore::Internals::setOverrideCachePolicy):
1053         * testing/Internals.h:
1054         * testing/Internals.idl:
1055
1056 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
1057
1058         TextFragment#start() is always >= 0 since its type is unsigned
1059         https://bugs.webkit.org/show_bug.cgi?id=142860
1060
1061         Reviewed by Andreas Kling.
1062
1063         Since TextFragment::m_start is unsigned, the result of
1064         TextFragment::start() is always >= 0 and assertion is not effective.
1065         This patch removes this assertion to suppress warnings.
1066
1067         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1068         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
1069
1070 2015-03-18  Alex Christensen  <achristensen@webkit.org>
1071
1072         [ContentExtensions] Prepare for compiling stylesheets of selectors to be used on every page.
1073         https://bugs.webkit.org/show_bug.cgi?id=142799
1074
1075         Reviewed by Brady Eidson.
1076
1077         * WebCore.xcodeproj/project.pbxproj:
1078         Make private headers to use with API tests.
1079         * contentextensions/CompiledContentExtension.cpp:
1080         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
1081         * contentextensions/CompiledContentExtension.h:
1082         Added method to get only the selectors from the root of the DFA, which apply to all URLs.
1083         * contentextensions/ContentExtensionCompiler.cpp:
1084         (WebCore::ContentExtensions::compileRuleList):
1085         Added checking if the trigger will match everything.
1086         These actions can be put directly on the root of the DFA without adding extra epsilon transitions to the NFA.
1087         * contentextensions/DFA.h:
1088         (WebCore::ContentExtensions::DFA::nodeAt):
1089         * contentextensions/DFABytecodeInterpreter.cpp:
1090         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1091         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1092         * contentextensions/DFABytecodeInterpreter.h:
1093         * contentextensions/NFA.h:
1094         * contentextensions/URLFilterParser.cpp:
1095         (WebCore::ContentExtensions::Term::quantifier):
1096         Sink terms to a vector then add nodes to NFA when finalizing after checking for regexes that match everything.
1097         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
1098         (WebCore::ContentExtensions::GraphBuilder::finalize):
1099         (WebCore::ContentExtensions::GraphBuilder::parseStatus):
1100         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
1101         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
1102         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
1103         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
1104         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
1105         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
1106         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
1107         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
1108         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
1109         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
1110         (WebCore::ContentExtensions::GraphBuilder::disjunction):
1111         (WebCore::ContentExtensions::GraphBuilder::hasError):
1112         (WebCore::ContentExtensions::GraphBuilder::fail):
1113         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
1114         (WebCore::ContentExtensions::URLFilterParser::addPattern):
1115         (WebCore::ContentExtensions::URLFilterParser::statusString):
1116         (WebCore::ContentExtensions::GraphBuilder::errorMessage): Deleted.
1117         * contentextensions/URLFilterParser.h:
1118         Use an enum instead of strings for the status to avoid checking strings when we have a regex that matches everything.
1119
1120 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
1121
1122         Fix build failure due to FALLTHROUGH in unreachable code
1123         https://bugs.webkit.org/show_bug.cgi?id=142703
1124
1125         Reviewed by Benjamin Poulain.
1126
1127         FALLTHROUGH should not exist in unreachable code marked by
1128         ASSERT_NOT_REACHABLE.
1129
1130         When !ENABLE(CSS_SELECTOR_JIT) and Debug mode is enabled,
1131         both ASSERT_NOT_REACHED and FALLTHROUGH are instantiated
1132         and it cause build failure.
1133
1134         Here, since CompiledSingle/CompiledSingleWithRootFilter are
1135         not set when !ENABLE(CSS_SELECTOR_JIT). So dropping FALLTHROUGH
1136         and leave ASSERT_NOT_REACHED.
1137         And since ASSERT_NOT_ReACHED is stripped when Release build,
1138         I've inserted FALLTHROUGH() if ASSERT_DISABLED.
1139         This fix is the same to r162906.
1140
1141         * dom/SelectorQuery.cpp:
1142         (WebCore::SelectorDataList::execute):
1143
1144 2015-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1145
1146         Switching between two SVG images with no intrinsic sizes causes them to get the default SVG size instead of the container size.
1147         https://bugs.webkit.org/show_bug.cgi?id=142805.
1148
1149         Reviewed by Darin Adler.
1150         
1151         The bug happens due to wrong logic in RenderImage::imageDimensionsChanged().
1152         This function decides to setNeedsLayout() if the intrinsic size of the image
1153         changes. If the size does not change, it only repaints the image rectangle.
1154         When switching the src of the an image between two SVG images and both of
1155         them have no intrinsic size, we do not updateInnerContentRect() and this
1156         means an SVGImageForContainer is not going to be created for this image.
1157         When the image is drawn, it is drawn directly from the SVGImage. And this
1158         means the drawing has to be scaled by container_size / SVG_default_intrinsic_size
1159         
1160         After figuring out that I need to updateInnerContentRect() to fix this bug,
1161         I found out Blink has already changed this code to do the same thing. But 
1162         they also did more clean-up in this function. Here is the link
1163         https://codereview.chromium.org/114323004. I think their change seems correct
1164         although they did not say what exactly they were trying to fix.
1165         
1166         The plan for repaintOrMarkForLayout(), which is the new name of this function,
1167         is the following:
1168             -- setNeedLayout() if the intrinsic size changes and it affects the size
1169                of the image.
1170             -- updateInnerContentRect() if the intrinsic size did not change but the
1171                image has exiting layout.
1172             -- repaint the image rectangle if layout is not needed.
1173             
1174         This change also removes the call to computeLogicalWidthInRegion(), which is
1175         almost running a layout for the image. This call figures out whether the image
1176         needs to setNeedsLayout(). This call is unnecessary; the image needs to run a
1177         layout if the intrinsic size has changed and it affects the size of the image.
1178                     
1179         Test: svg/as-image/svg-no-intrinsic-size-switching.html
1180
1181         * rendering/RenderImage.cpp:
1182         (WebCore::RenderImage::styleDidChange): Change the function call.
1183         (WebCore::RenderImage::imageChanged): Rename local variable and change the
1184         function call.
1185         
1186         (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Simplify this function.
1187         Call setIntrinsicSize() with the new size unless the image is in error state.
1188         
1189         (WebCore::RenderImage::repaintOrMarkForLayout): This a better name for this
1190         function since it is called even if the intrinsic size was not changed.
1191         (WebCore::RenderImage::imageDimensionsChanged): Deleted.
1192         
1193         * rendering/RenderImage.h: Rename imageDimensionsChanged() and change the 
1194         updateIntrinsicSizeIfNeeded() to return void.
1195         
1196         * rendering/svg/RenderSVGForeignObject.cpp:
1197         (WebCore::RenderSVGForeignObject::paint): Code cleanup. This function can
1198         only handle the paint phases PaintPhaseForeground and PaintPhaseSelection.
1199         Use this information to simplify the logic and order of painting there.
1200
1201 2015-03-18  Jeremy Jones  <jeremyj@apple.com>
1202
1203         Fix typo in playerViewControllerWillCancelOptimizedFullscree.
1204         https://bugs.webkit.org/show_bug.cgi?id=142745
1205
1206         Reviewed by Darin Adler.
1207
1208         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1209         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]):
1210         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): Deleted.
1211
1212 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
1213
1214         Avoid repaints when changing transform on an element with multiple background images
1215         https://bugs.webkit.org/show_bug.cgi?id=142841
1216
1217         Reviewed by Zalan Bujtas.
1218         
1219         Replace the cheap test for changed images in RenderElement::updateFillImages()
1220         with an exhaustive test that walks the entire list of background images,
1221         since any ensuing repaint is way more expensive than a slightly more expensive check here.
1222         
1223         Test: fast/repaint/multiple-backgrounds-style-change.html
1224
1225         * rendering/RenderElement.cpp:
1226         (WebCore::RenderElement::updateFillImages):
1227         * rendering/style/FillLayer.cpp:
1228         (WebCore::layerImagesIdentical): See if both images are the same (either none
1229         or both mask images, and same image pointer).
1230         (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images
1231         on each one. Returns false if we reach the end of one list before the other, or the images
1232         are different.
1233         * rendering/style/FillLayer.h: New static function; static because
1234         it compares two FillLayer lists, and I think that makes more sense than
1235         a member function.
1236
1237 2015-03-18  Anders Carlsson  <andersca@apple.com>
1238
1239         Pass cookies by reference in CookieHash functions
1240         https://bugs.webkit.org/show_bug.cgi?id=142839
1241
1242         Reviewed by Sam Weinig.
1243
1244         * platform/Cookie.h:
1245         (WebCore::CookieHash::hash):
1246         (WebCore::CookieHash::equal):
1247
1248 2015-03-18  Tim Horton  <timothy_horton@apple.com>
1249
1250         Temporarily fix the !ENABLE(CSS_SELECTOR_JIT) and assertions-enabled build
1251
1252         * dom/SelectorQuery.cpp:
1253         (WebCore::SelectorDataList::execute):
1254
1255 2015-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
1256
1257         Call CTFontSetRenderingParameters before rendering text
1258         https://bugs.webkit.org/show_bug.cgi?id=142816
1259
1260         Reviewed by Darin Adler.
1261
1262         No new tests.
1263
1264         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1265         (WebCore::showGlyphsWithAdvances):
1266         * platform/spi/cocoa/CoreTextSPI.h:
1267
1268 2015-03-18  Chris Dumez  <cdumez@apple.com>
1269
1270         [WK2] Log the number of network cache requests that we have never seen before
1271         https://bugs.webkit.org/show_bug.cgi?id=142828
1272         <rdar://problem/19632130>
1273
1274         Reviewed by Antti Koivisto.
1275
1276         Add diagnostic logging key for network cache efficacy logging.
1277
1278         * page/DiagnosticLoggingKeys.cpp:
1279         (WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
1280         (WebCore::DiagnosticLoggingKeys::requestKey):
1281         * page/DiagnosticLoggingKeys.h:
1282
1283 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
1284
1285         Use filterRootId in SelectorQuery even if CSS JIT is not enabled
1286         https://bugs.webkit.org/show_bug.cgi?id=142703
1287
1288         Reviewed by Benjamin Poulain.
1289
1290         filterRootId pruning path is not inherently related to CSS JIT.
1291         This patch enables filterRootId even in the environment
1292         where CSS JIT is not enabled.
1293
1294         * dom/SelectorQuery.cpp:
1295         (WebCore::filterRootById):
1296         (WebCore::SelectorDataList::executeSingleSelectorData):
1297         (WebCore::SelectorDataList::execute):
1298         * dom/SelectorQuery.h:
1299
1300 2015-03-18  Zalan Bujtas  <zalan@apple.com>
1301
1302         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
1303         https://bugs.webkit.org/show_bug.cgi?id=142809
1304
1305         Reviewed by Antti Koivisto.
1306
1307         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
1308
1309         No change in functionality.
1310
1311         * rendering/SimpleLineLayoutFlowContents.h:
1312         (WebCore::SimpleLineLayout::FlowContents::begin):
1313         (WebCore::SimpleLineLayout::FlowContents::end):
1314         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
1315         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
1316         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
1317         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
1318         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
1319         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
1320         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
1321         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1322         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1323
1324 2015-03-18  Zalan Bujtas  <zalan@apple.com>
1325
1326         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
1327         https://bugs.webkit.org/show_bug.cgi?id=142785
1328
1329         Reviewed by Antti Koivisto.
1330
1331         This is in transition to support <br>. A particular position could point to multiple
1332         segments when <br> is directly followed by text.
1333
1334         No change in functionality.
1335
1336         * rendering/SimpleLineLayoutFlowContents.cpp:
1337         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
1338         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
1339         * rendering/SimpleLineLayoutFlowContents.h:
1340         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
1341         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
1342         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
1343         * rendering/SimpleLineLayoutResolver.cpp:
1344         (WebCore::SimpleLineLayout::RunResolver::Run::text):
1345
1346 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
1347
1348         Skip trying to paint overlay scrollbars when there are none or they are clipped out
1349         https://bugs.webkit.org/show_bug.cgi?id=142811
1350         rdar://problem/20200725
1351
1352         Reviewed by Darin Adler.
1353
1354         In some content with lots of layers and overflow:scroll, we could spend 20% of
1355         the time under paintOverflowControlsForFragments() setting up an (empty) clip,
1356         and then trying to draw scrollbars that we don't have.
1357         
1358         Avoid calling paintOverflowControlsForFragments() if there are no scrollbars,
1359         and don't both setting up an empty clip just to paint nothing.
1360
1361         * rendering/RenderLayer.cpp:
1362         (WebCore::RenderLayer::paintLayerContents):
1363         (WebCore::RenderLayer::paintOverflowControlsForFragments):
1364
1365 2015-03-18  Per Arne Vollan  <peavo@outlook.com>
1366
1367         [WinCairo] Unreviewed build fix after r181665.
1368
1369         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1370         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
1371
1372 2015-03-18  Joseph Pecoraro  <pecoraro@apple.com>
1373
1374         Remove unused "preprocessor" parameter to sub-CodeGenerators
1375         https://bugs.webkit.org/show_bug.cgi?id=142793
1376
1377         Reviewed by Darin Adler.
1378
1379         * bindings/scripts/CodeGenerator.pm:
1380         (ProcessDocument):
1381         (FileNamePrefix):
1382         * bindings/scripts/CodeGeneratorObjC.pm:
1383
1384 2015-03-18  Zalan Bujtas  <zalan@apple.com>
1385
1386         Simple line layout: Split fragments on renderer boundary on the fly.
1387         https://bugs.webkit.org/show_bug.cgi?id=142579
1388
1389         Reviewed by Antti Koivisto.
1390
1391         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
1392         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
1393         fragments across renderer boundary.
1394
1395         Test: fast/text/simple-line-with-multiple-renderers.html
1396
1397         * rendering/SimpleLineLayout.cpp:
1398         (WebCore::SimpleLineLayout::revertRuns):
1399         (WebCore::SimpleLineLayout::LineState::isEmpty):
1400         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
1401         whether neighboring fragments need collapsing.
1402         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
1403         a fragment continuation.
1404         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
1405         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
1406         they all get added to the current line.
1407         (WebCore::SimpleLineLayout::createLineRuns):
1408         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
1409         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
1410         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
1411         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
1412         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
1413         (WebCore::SimpleLineLayout::begin): Deleted.
1414         (WebCore::SimpleLineLayout::end): Deleted.
1415         (WebCore::SimpleLineLayout::preWrap): Deleted.
1416         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
1417         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
1418         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
1419         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
1420         (WebCore::SimpleLineLayout::create): Deleted.
1421         (WebCore::SimpleLineLayout::Layout::create): Deleted.
1422         * rendering/SimpleLineLayoutFlowContents.h:
1423         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
1424         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
1425         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
1426         * rendering/SimpleLineLayoutFunctions.cpp:
1427         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
1428         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1429         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
1430         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
1431         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
1432         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
1433         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1434         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1435         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
1436         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
1437         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
1438         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
1439         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
1440         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
1441
1442 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
1443
1444         Flex and grid items should be painted as inline-blocks
1445         https://bugs.webkit.org/show_bug.cgi?id=142266
1446
1447         Reviewed by Darin Adler.
1448
1449         Based on Blink r157004 by <cbiesinger@chromium.org>.
1450         https://src.chromium.org/viewvc/blink?revision=157004&view=revision
1451
1452         Both flexbox and grid specs define that the painting order of flex/grid
1453         items is the same as inline blocks. See
1454         http://dev.w3.org/csswg/css-flexbox/#painting and
1455         http://dev.w3.org/csswg/css-grid/#z-order.
1456
1457         Extracted inline blocks painting code from InlineElementBox and moved to
1458         a helper method that will be reused for flexboxes and grids.
1459
1460         Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
1461                fast/css-grid-layout/grid-item-text-background-not-interleaved.html
1462
1463         * rendering/InlineElementBox.cpp:
1464         (WebCore::InlineElementBox::paint): Move code to
1465         RenderElement::paintAsInlineBlock().
1466         * rendering/RenderBlock.cpp:
1467         (WebCore::RenderBlock::paintChild): Add new argument to paint children
1468         as inline blocks.
1469         * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
1470         signature to add the new argument.
1471         * rendering/RenderElement.cpp:
1472         (WebCore::paintPhase): Paint element in a phase.
1473         (WebCore::RenderElement::paintAsInlineBlock): Code extracted from
1474         InlineElementBox::paint().
1475         * rendering/RenderElement.h: Add new method signature.
1476         * rendering/RenderFlexibleBox.cpp:
1477         (WebCore::RenderFlexibleBox::paintChildren): Call
1478         RenderBlock::paintChild() with the new argument.
1479         * rendering/RenderGrid.cpp:
1480         (WebCore::RenderGrid::paintChildren): Ditto.
1481
1482 2015-03-18  Chris Dumez  <cdumez@apple.com>
1483
1484         [WK2] Log total number of network cache queries using diagnostic logging
1485         https://bugs.webkit.org/show_bug.cgi?id=142803
1486         <rdar://problem/19632130>
1487
1488         Reviewed by Antti Koivisto.
1489
1490         Add diagnostic logging key needed for network efficacy logging.
1491
1492         * page/DiagnosticLoggingKeys.cpp:
1493         (WebCore::DiagnosticLoggingKeys::retrievalRequestKey):
1494         * page/DiagnosticLoggingKeys.h:
1495
1496 2015-03-18  Tim Horton  <timothy_horton@apple.com>
1497
1498         Fix the build after r181660
1499
1500         * page/EventHandler.cpp:
1501         (WebCore::EventHandler::setImmediateActionStage):
1502         * page/EventHandler.h:
1503         (WebCore::EventHandler::setImmediateActionStage):
1504         Un-inline setImmediateActionStage, because it is exported to WebCore, and
1505         exporting inline thing causes random weak symbol errors on some platforms.
1506
1507 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
1508
1509         Ignore some deprecation warnings
1510         https://bugs.webkit.org/show_bug.cgi?id=142813
1511
1512         Reviewed by Mark Rowe.
1513
1514         Fixing the deprecations is tracked by: <rdar://problem/20201450>
1515
1516         * editing/cocoa/HTMLConverter.mm:
1517         (HTMLConverter::_processElement):
1518
1519 2015-03-17  Commit Queue  <commit-queue@webkit.org>
1520
1521         Unreviewed, rolling out r181667, r181682, and r181683.
1522         https://bugs.webkit.org/show_bug.cgi?id=142812
1523
1524         Broke multiple tests with ASan, plus dependent commits
1525         (Requested by ap on #webkit).
1526
1527         Reverted changesets:
1528
1529         "Simple line layout: Split fragments on renderer boundary on
1530         the fly."
1531         https://bugs.webkit.org/show_bug.cgi?id=142579
1532         http://trac.webkit.org/changeset/181667
1533
1534         "Simple line layout: Change FlowContents::segmentForPosition()
1535         to segmentForRun()."
1536         https://bugs.webkit.org/show_bug.cgi?id=142785
1537         http://trac.webkit.org/changeset/181682
1538
1539         "Simple line layout: Use Vector<>::const_iterator instead of
1540         custom FlowContents::Iterator."
1541         https://bugs.webkit.org/show_bug.cgi?id=142809
1542         http://trac.webkit.org/changeset/181683
1543
1544 2015-03-17  Zalan Bujtas  <zalan@apple.com>
1545
1546         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
1547         https://bugs.webkit.org/show_bug.cgi?id=142809
1548
1549         Reviewed by Antti Koivisto.
1550
1551         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
1552
1553         No change in functionality.
1554
1555         * rendering/SimpleLineLayoutFlowContents.h:
1556         (WebCore::SimpleLineLayout::FlowContents::begin):
1557         (WebCore::SimpleLineLayout::FlowContents::end):
1558         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
1559         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
1560         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
1561         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
1562         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
1563         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
1564         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
1565         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1566         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1567
1568 2015-03-17  Zalan Bujtas  <zalan@apple.com>
1569
1570         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
1571         https://bugs.webkit.org/show_bug.cgi?id=142785
1572
1573         Reviewed by Antti Koivisto.
1574
1575         This is in transition to support <br>. A particular position could point to multiple
1576         segments when <br> is directly followed by text.
1577
1578         No change in functionality.
1579
1580         * rendering/SimpleLineLayoutFlowContents.cpp:
1581         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
1582         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
1583         * rendering/SimpleLineLayoutFlowContents.h:
1584         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
1585         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
1586         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
1587         * rendering/SimpleLineLayoutResolver.cpp:
1588         (WebCore::SimpleLineLayout::RunResolver::Run::text):
1589
1590 2015-03-17  Chris Dumez  <cdumez@apple.com>
1591
1592         [Mac][iOS] setSharedTimerFireInterval() / stopSharedTimer() are expensive
1593         https://bugs.webkit.org/show_bug.cgi?id=142752
1594         <rdar://problem/20176731>
1595
1596         Reviewed by Antti Koivisto.
1597
1598         setSharedTimerFireInterval() / stopSharedTimer() are expensive on Mac
1599         and iOS on pages using a lot of timers.
1600
1601         For example, on bing.com / iOS, ~15.4% of the CPU time is spent in
1602         setSharedTimerFireInterval() and ~14.7% of the CPU time is spent in
1603         stopSharedTimer(). The expensive calls are CFRunLoopAddTimer (11.4%),
1604         CFRunLoopTimerInvalidate (14.1%), CFRunLoopTimerCreate (3.3%).
1605
1606         The issue is that we keep creating, adding to run loop modes, and then
1607         destroying the sharedTimer for each firing event. This is very
1608         expensive. In such case, the CFRunLoopTimerRef documentation advises to
1609         """
1610         ... create a repeating timer with an initial firing time in the distant
1611         future (or the initial firing time) and a very large repeat interval—on
1612         the order of decades or more—and add it to all the necessary run loop
1613         modes. Then, when you know when the timer should fire next, you reset
1614         the firing time with CFRunLoopTimerSetNextFireDate, perhaps from the
1615         timer’s own callback function. This technique effectively produces a
1616         reusable, asynchronous timer.
1617         """ [1].
1618
1619         Doing so greatly decreases CPU time spend in:
1620         - setSharedTimerFireInterval(): 15.4% -> 4.6%
1621         - stopSharedTimer(): 14.6% -> 8.6%
1622
1623         Overall CPU time spent on bing.com in timerFired() goes down from
1624         ~61.2% to ~49.5%.
1625
1626         This patch also refactors the SharedTimer code to share as much as
1627         possible between Mac and iOS.
1628
1629         This patch is based in part on the following patch:
1630         http://trac.webkit.org/changeset/143210
1631
1632         [1] https://developer.apple.com/library/prerelease/ios/documentation/CoreFoundation/Reference/CFRunLoopTimerRef/index.html#//apple_ref/c/func/CFRunLoopTimerSetNextFireDate
1633
1634         * WebCore.xcodeproj/project.pbxproj:
1635         * platform/SharedTimer.h:
1636         (WebCore::SharedTimer::invalidate):
1637         (WebCore::MainThreadSharedTimer::setFiredFunction): Deleted.
1638         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
1639         (WebCore::MainThreadSharedTimer::stop): Deleted.
1640         * platform/ThreadTimers.cpp:
1641         (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
1642         * platform/cf/SharedTimerCF.mm: Added.
1643         (WebCore::applicationDidBecomeActive):
1644         (WebCore::setupPowerObserver):
1645         (WebCore::setSharedTimerFiredFunction):
1646         (WebCore::timerFired):
1647         (WebCore::restartSharedTimer):
1648         (WebCore::invalidateSharedTimer):
1649         (WebCore::setSharedTimerFireInterval):
1650         (WebCore::stopSharedTimer):
1651         * platform/efl/SharedTimerEfl.cpp:
1652         (WebCore::invalidateSharedTimer):
1653         * platform/gtk/SharedTimerGtk.cpp:
1654         (WebCore::invalidateSharedTimer):
1655         * platform/ios/SharedTimerIOS.mm: Removed.
1656         * platform/mac/PowerObserverMac.h: Copied from Source/WebCore/platform/efl/SharedTimerEfl.cpp.
1657         * platform/mac/PowerObserverMac.mm: Renamed from Source/WebCore/platform/mac/SharedTimerMac.mm.
1658         (WebCore::PowerObserver::PowerObserver):
1659         (WebCore::PowerObserver::~PowerObserver):
1660         (WebCore::PowerObserver::didReceiveSystemPowerNotification):
1661         * platform/win/SharedTimerWin.cpp:
1662         (WebCore::removeSharedTimer):
1663
1664 2015-03-17  Tim Horton  <timothy_horton@apple.com>
1665
1666         Cannot invoke action menus anymore
1667         https://bugs.webkit.org/show_bug.cgi?id=142797
1668         <rdar://problem/20032670>
1669
1670         Reviewed by Beth Dakin.
1671
1672         * platform/spi/mac/NSMenuSPI.h:
1673         Add additional NSMenu SPI.
1674
1675 2015-03-17  Zalan Bujtas  <zalan@apple.com>
1676
1677         Simple line layout: Split fragments on renderer boundary on the fly.
1678         https://bugs.webkit.org/show_bug.cgi?id=142579
1679
1680         Reviewed by Antti Koivisto.
1681
1682         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
1683         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
1684         fragments across renderer boundary.
1685
1686         Test: fast/text/simple-line-with-multiple-renderers.html
1687
1688         * rendering/SimpleLineLayout.cpp:
1689         (WebCore::SimpleLineLayout::revertRuns):
1690         (WebCore::SimpleLineLayout::LineState::isEmpty):
1691         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
1692         whether neighboring fragments need collapsing.
1693         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
1694         a fragment continuation.
1695         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
1696         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
1697         they all get added to the current line.
1698         (WebCore::SimpleLineLayout::createLineRuns):
1699         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
1700         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
1701         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
1702         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
1703         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
1704         (WebCore::SimpleLineLayout::begin): Deleted.
1705         (WebCore::SimpleLineLayout::end): Deleted.
1706         (WebCore::SimpleLineLayout::preWrap): Deleted.
1707         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
1708         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
1709         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
1710         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
1711         (WebCore::SimpleLineLayout::create): Deleted.
1712         (WebCore::SimpleLineLayout::Layout::create): Deleted.
1713         * rendering/SimpleLineLayoutFlowContents.h:
1714         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
1715         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
1716         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
1717         * rendering/SimpleLineLayoutFunctions.cpp:
1718         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
1719         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1720         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
1721         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
1722         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
1723         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
1724         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1725         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1726         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
1727         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
1728         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
1729         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
1730         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
1731         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
1732
1733 2015-03-17  Jeremy Jones  <jeremyj@apple.com>
1734
1735         When tab hides, pause fullscreen and exit normally.
1736         https://bugs.webkit.org/show_bug.cgi?id=142685
1737
1738         Reviewed by Eric Carlson.
1739
1740         Pause fullscreen playback when switching tabs. Exit fullscreen is not necessary and even prevents
1741         the normal flow of teardown. This allows the normal exit fullscreen call to succeed and call its callback.
1742
1743         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1744         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
1745
1746 2015-03-17  Per Arne Vollan  <peavo@outlook.com>
1747
1748         [WinCairo] Video position is incorrect when located inside a frame.
1749         https://bugs.webkit.org/show_bug.cgi?id=142784
1750
1751         Reviewed by Brent Fulgham.
1752
1753         We need to take the enclosing frame's position into account, when finding the video position.
1754
1755         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1756         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
1757
1758 2015-03-17  Benjamin Poulain  <bpoulain@apple.com>
1759
1760         Compile character ranges targeting the same state as range check in the bytecode
1761         https://bugs.webkit.org/show_bug.cgi?id=142759
1762
1763         Reviewed by Alex Christensen.
1764
1765         Previously, character ranges would be compiled as many individual character checks.
1766         For example, a transition on "[a-z]" would do 26 character checks + jump, which leads
1767         to enormous matchines.
1768
1769         With this patch, we find the ranges at lowering time and generate a single instruction
1770         for them: "CheckValueRange". This helps making the machine denser when the input
1771         use character sets.
1772
1773         The second part of this patch goes further in the case where the transitions out of
1774         a state cover the entire alphabet. In that case, we create a fallback transition
1775         on the fly and remove all the ranges made useless.
1776         That case is common when ranges are used with inverse character set (e.g. [^a]+a).
1777
1778         * contentextensions/DFABytecode.h:
1779         (WebCore::ContentExtensions::instructionSizeWithArguments):
1780         * contentextensions/DFABytecodeCompiler.cpp:
1781         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
1782         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1783         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
1784         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
1785         * contentextensions/DFABytecodeCompiler.h:
1786         Extend the compiler to detect ranges and lower them as CheckValueRange.
1787
1788         * contentextensions/DFABytecodeInterpreter.cpp:
1789         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1790         Range checks in the interpreter.
1791
1792         * contentextensions/NFA.cpp:
1793         (WebCore::ContentExtensions::NFA::setFinal):
1794         This assertion does not make sense with the current codebase. Actions are "compressed",
1795         it is possible to have two patterns with the same action.
1796
1797         * contentextensions/NFAToDFA.cpp:
1798         (WebCore::ContentExtensions::simplifyTransitions):
1799         A very simple DFA optimization function: it only reduce the strength of ranges.
1800
1801         (WebCore::ContentExtensions::NFAToDFA::convert):
1802
1803 2015-03-17  Jer Noble  <jer.noble@apple.com>
1804
1805         REGRESSION (r181423): Crash @ generatedcontent.org at com.apple.WebCore: WebCore::MediaPlayer::maximumDurationToCacheMediaTime const + 4
1806         https://bugs.webkit.org/show_bug.cgi?id=142787
1807
1808         Reviewed by Eric Carlson.
1809
1810         Null check m_player before derefencing.
1811
1812         * html/HTMLMediaElement.cpp:
1813         (WebCore::HTMLMediaElement::parseAttribute):
1814
1815 2015-03-17  Beth Dakin  <bdakin@apple.com>
1816
1817         DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 
1818         10.10.2
1819         https://bugs.webkit.org/show_bug.cgi?id=142700
1820         -and corresponding-
1821         rdar://problem/20165168
1822
1823         Reviewed by Tim Horton.
1824
1825         This patch adds a new enum and member variable so that EventHandler can keep track 
1826         of the current immediate action state.
1827         * page/EventHandler.cpp:
1828         (WebCore::EventHandler::EventHandler):
1829
1830         A new mouse press even is starting. We can re-set m_immediateActionStage to none 
1831         unless a Hit Test has already been performed.
1832         (WebCore::EventHandler::handleMousePressEvent):
1833
1834         If an immediate action was completed, then send mouse to the DOM and return early. 
1835         This will prevent us from doing our own normal mouseup behaviors such as 
1836         navigating to a link that was clicked — we only want to do that if the click was 
1837         not used to perform an immediate action.
1838         (WebCore::EventHandler::handleMouseReleaseEvent):
1839         * page/EventHandler.h:
1840         (WebCore::EventHandler::setImmediateActionStage):
1841
1842 2015-03-17  Joseph Pecoraro  <pecoraro@apple.com>
1843
1844         Use a better parameter name for Document.getElementsByClassName
1845         https://bugs.webkit.org/show_bug.cgi?id=142771
1846
1847         Reviewed by Chris Dumez.
1848
1849         * bindings/objc/PublicDOMInterfaces.h:
1850         * dom/Document.idl:
1851
1852 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
1853
1854         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
1855         https://bugs.webkit.org/show_bug.cgi?id=142776
1856         <rdar://problem/18921338>
1857
1858         Reviewed by Alexey Proskuryakov.
1859
1860         Test: fast/animation/request-animation-frame-unparented-iframe-crash.html
1861
1862         In some cases (like the new test), we can end up trying to start
1863         requestAnimationFrame on a Document that has no Page. Most paths null-checked
1864         the Page and did the right thing, but one failed to do so. In addition,
1865         the current fallback (when Page is null) can result in us constructing
1866         the wrong kind of DisplayRefreshMonitor, which could lead to trouble
1867         down the road when it's reused. Instead, just completely avoid making a
1868         DisplayRefreshMonitor in the null-page case.
1869
1870         * dom/ScriptedAnimationController.cpp:
1871         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
1872         If the page is null, bail.
1873
1874         * dom/ScriptedAnimationController.h:
1875         * platform/graphics/DisplayRefreshMonitor.cpp:
1876         (WebCore::DisplayRefreshMonitor::create):
1877         Use Optional<> to make it easy to distinguish between ChromeClient
1878         being unreachable (because we don't have a Page for some reason) and
1879         ChromeClient declaring that it doesn't want to override the type of
1880         DisplayRefreshMonitor that is created.
1881
1882         If ChromeClient was unreachable for some reason, we'll get back an engaged
1883         nullptr and return it (instead of creating a DisplayRefreshMonitor based
1884         on the platform). This avoids creating the wrong type of DisplayRefreshMonitor
1885         in the rare case where we can't reach the ChromeClient (e.g. a freshly unparented
1886         IFrame).
1887
1888         If instead the client returns a disengaged Nullopt, we'll interpret that as
1889         "construct the default type", which falls back on the platform #ifdefs to
1890         decide what to make.
1891
1892         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1893         (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient):
1894         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
1895         Silently handle the case where we failed to make a DisplayRefreshMonitor.
1896
1897         * platform/graphics/DisplayRefreshMonitor.h:
1898         * platform/graphics/DisplayRefreshMonitorClient.h:
1899         * platform/graphics/GraphicsLayerUpdater.cpp:
1900         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
1901         * platform/graphics/GraphicsLayerUpdater.h:
1902         * rendering/RenderLayerCompositor.cpp:
1903         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
1904         * rendering/RenderLayerCompositor.h:
1905         Adjust to the new signature of createDisplayRefreshMonitor, and return
1906         an engaged (nullptr) Optional if we can't get to ChromeClient for any reason.
1907
1908         * page/ChromeClient.h:
1909         Return Nullopt (indicating a lack of override) by default.
1910
1911 2015-03-17  Dean Jackson  <dino@apple.com>
1912
1913         Implement Scroll Container Animation Triggers
1914         https://bugs.webkit.org/show_bug.cgi?id=142732
1915
1916         Attempt to fix the build.
1917
1918         * css/CSSComputedStyleDeclaration.cpp: Add an #if ENABLE guard.
1919
1920 2015-03-17  Dean Jackson  <dino@apple.com>
1921
1922         Implement Scroll Container Animation Triggers
1923         https://bugs.webkit.org/show_bug.cgi?id=142732
1924
1925         Reviewed by Simon Fraser.
1926
1927         Test: animations/trigger-container-scroll-simple.html
1928
1929         Basic implementation of container-scroll. It only checks
1930         the page scroll position for trigger values (not the scrolling
1931         container in an overflow).
1932
1933         * css/CSSComputedStyleDeclaration.cpp: Add CSSPropertyWebkitAnimationTrigger
1934         so that this property will appear in the inspector.
1935
1936         * page/FrameView.cpp:
1937         (WebCore::FrameView::sendScrollEvent): If the page has scrolled, let the animation
1938         controller know about it.
1939
1940         * page/animation/AnimationBase.cpp:
1941         (WebCore::AnimationBase::updateStateMachine): Whitespace fix.
1942         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): If there is a trigger,
1943         and the scroll position is past it, then tell the state machine that
1944         we should start.
1945         (WebCore::AnimationBase::timeToNextService): Use the scroll position as
1946         an input to the update timer if a trigger is involved.
1947
1948         * page/animation/AnimationController.cpp:
1949         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): Add whitespace.
1950         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Call updateAnimations.
1951         (WebCore::AnimationController::scrollWasUpdated): Call into AnimationControllerPrivate.
1952         * page/animation/AnimationController.h:
1953         * page/animation/AnimationControllerPrivate.h:
1954
1955         * page/animation/CompositeAnimation.cpp: Keep a record of whether we have a scroll
1956         triggered animation.
1957         (WebCore::CompositeAnimation::CompositeAnimation):
1958         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1959         * page/animation/CompositeAnimation.h:
1960         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation):
1961         * platform/animation/Animation.cpp:
1962         (WebCore::Animation::operator=):
1963
1964 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
1965
1966         Move some code from LogicalSelectionOffsetCaches into RenderElement
1967         https://bugs.webkit.org/show_bug.cgi?id=142758
1968
1969         Reviewed by Myles C. Maxfield.
1970
1971         LogicalSelectionOffsetCaches had some useful code regarding containing blocks etc
1972         that should be used in more places, so move it into RenderElement.
1973         
1974         No behavior change.
1975
1976         * rendering/LogicalSelectionOffsetCaches.h:
1977         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
1978         (WebCore::isContainingBlockCandidateForAbsolutelyPositionedObject): Deleted.
1979         (WebCore::isNonRenderBlockInline): Deleted.
1980         (WebCore::containingBlockForFixedPosition): Deleted.
1981         (WebCore::containingBlockForAbsolutePosition): Deleted.
1982         (WebCore::containingBlockForObjectInFlow): Deleted.
1983         * rendering/RenderBlock.cpp: No need to initialize static data.
1984         (WebCore::RenderBlock::positionedObjects): nullptr
1985         * rendering/RenderElement.cpp:
1986         (WebCore::RenderElement::containingBlockForFixedPosition):
1987         (WebCore::RenderElement::containingBlockForAbsolutePosition):
1988         (WebCore::isNonRenderBlockInline):
1989         (WebCore::RenderElement::containingBlockForObjectInFlow):
1990         * rendering/RenderElement.h:
1991         (WebCore::RenderElement::canContainAbsolutelyPositionedObjects):
1992         * rendering/RenderLayer.cpp:
1993         (WebCore::isContainerForPositioned):
1994         * rendering/RenderObject.cpp:
1995         (WebCore::RenderObject::containingBlock):
1996
1997 2015-03-17  Alex Christensen  <achristensen@webkit.org>
1998
1999         [WinCairo] Unreviewed build fix after r181640.
2000
2001         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2002         Tell Windows how to find ShaderLang.h.
2003
2004 2015-03-17  Chris Dumez  <cdumez@apple.com>
2005
2006         'pageLoaded' diagnostic logging is too verbose
2007         https://bugs.webkit.org/show_bug.cgi?id=142727
2008         <rdar://problem/18937048>
2009
2010         Reviewed by Eric Carlson.
2011
2012         Make 'pageLoaded' diagnostic logging less verbose:
2013         - Log once per main frame instead of once for subframe
2014         - Apply sampling
2015
2016         * loader/FrameLoader.cpp:
2017         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2018
2019 2015-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2020
2021         [GTK] Wrong transfer annotations used in GObject DOM bindings
2022         https://bugs.webkit.org/show_bug.cgi?id=142780
2023
2024         Reviewed by Gustavo Noronha Silva.
2025
2026         We are using transfer none for all methods returning a GObject DOM
2027         Object. That's not true. Only objects derived from Node are
2028         automatically released by the DOM object cache and can be transfer
2029         none. All other objects are added to the cache only to avoid
2030         creating the same wrapper twice for the same core object, but
2031         caller should release the returned reference.
2032
2033         * bindings/gobject/WebKitDOMCustomUnstable.h:
2034         * bindings/scripts/CodeGeneratorGObject.pm:
2035         (GetTransferTypeForReturnType):
2036         (GenerateFunction):
2037
2038 2015-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2039
2040         [GTK] WebKitDOM objects leaking
2041         https://bugs.webkit.org/show_bug.cgi?id=118788
2042
2043         Reviewed by Darin Adler and Sergio Villar Senin.
2044
2045         Use a DOMwindowObserver class, derived from DOMWindowProperty to
2046         be notified when the window object is detached from the frame to
2047         clear the DOM objects associated to that frame in that case too.
2048
2049         * bindings/gobject/DOMObjectCache.cpp:
2050
2051 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
2052
2053         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
2054         https://bugs.webkit.org/show_bug.cgi?id=142530
2055
2056         Reviewed by Darin Adler.
2057
2058         Include the ANGLE's ShaderLang.h through the new forwarding header. This allows
2059         us to not list Source/ThirdParty/ANGLE/include in the list of inclusion directories
2060         and thus avoid ANGLE's EGL and GLES2/GLES3 headers, defaulting to the system-provided
2061         headers instead.
2062
2063         Source/ThirdParty/ANGLE/include/KHR is still used because ANGLE's khrplatform.h is
2064         required by the ShaderLang.h header. Source/ThirdParty/ANGLE/src is not used for the
2065         whole WebCore library anymore, only the ANGLESupport library.
2066
2067         * CMakeLists.txt:
2068         * platform/graphics/ANGLEWebKitBridge.h:
2069         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2070
2071 2015-03-17  Matt Baker  <mattbaker@apple.com>
2072
2073         Web Inspector: Show rendering frames (and FPS) in Layout and Rendering timeline
2074         https://bugs.webkit.org/show_bug.cgi?id=142029
2075
2076         Reviewed by Timothy Hatcher.
2077
2078         Add new functionality to the Inspector timelines backend to add runloop data to timeline recordings.
2079
2080         * inspector/InspectorTimelineAgent.cpp:
2081         (WebCore::currentRunLoop):
2082         (WebCore::InspectorTimelineAgent::internalStart):
2083         (WebCore::InspectorTimelineAgent::internalStop):
2084         (WebCore::toProtocol):
2085         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
2086         Install observers for the begining and end of the runloop when recording begins. All other
2087         instrumented timeline events get added as children of the current runloop record, which is
2088         sent to the frontend once the runloop completes.
2089
2090         * inspector/InspectorTimelineAgent.h:
2091
2092         * platform/cf/RunLoopObserver.cpp:
2093         (WebCore::RunLoopObserver::schedule):
2094         Wrapper changed to allow observing arbitrary runloop activities.
2095
2096         * platform/cf/RunLoopObserver.h:
2097
2098 2015-03-17  Philippe Normand  <pnormand@igalia.com>
2099
2100         [GTK] basic OpenWebRTC build support
2101         https://bugs.webkit.org/show_bug.cgi?id=142393
2102
2103         Reviewed by Carlos Garcia Campos.
2104
2105         * PlatformGTK.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
2106
2107 2015-03-17  Joseph Pecoraro  <pecoraro@apple.com>
2108
2109         Remove never used "useLayerOnTop" bindings generator argument
2110         https://bugs.webkit.org/show_bug.cgi?id=142773
2111
2112         Reviewed by Darin Adler.
2113
2114         * bindings/scripts/CodeGenerator.pm:
2115         * bindings/scripts/CodeGeneratorJS.pm:
2116         * bindings/scripts/CodeGeneratorObjC.pm:
2117         * bindings/scripts/generate-bindings.pl:
2118
2119 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
2120
2121         Enable ES6 classes by default
2122         https://bugs.webkit.org/show_bug.cgi?id=142774
2123
2124         Reviewed by Gavin Barraclough.
2125
2126         * Configurations/FeatureDefines.xcconfig:
2127
2128 2015-03-16  Simon Fraser  <simon.fraser@apple.com>
2129
2130         Update the debug overlays after layout
2131         https://bugs.webkit.org/show_bug.cgi?id=142768
2132
2133         Reviewed by Zalan Bujtas.
2134
2135         The debug overlays need to be updated after layout, in case elements with wheel event handlers
2136         moved around.
2137         
2138         DebugPageOverlays::didLayout() is cheap if there are no overlays.
2139         
2140         Call DebugPageOverlays::didLayout() for all frames, not just the main frame, since subframes can contribute
2141         to the main frame's event handler region.
2142
2143         * page/DebugPageOverlays.cpp:
2144         (WebCore::DebugPageOverlays::regionChanged):
2145         * page/DebugPageOverlays.h:
2146         (WebCore::DebugPageOverlays::didLayout):
2147         (WebCore::DebugPageOverlays::didChangeEventHandlers):
2148         * page/FrameView.cpp:
2149         (WebCore::FrameView::layout):
2150
2151 2015-03-16  Jon Lee  <jonlee@apple.com>
2152
2153         Unreviewed fix for crash after r181608.
2154
2155         * WebCore.xcodeproj/project.pbxproj: Include it in the WebCore framework.
2156
2157 2015-03-16  Simon Fraser  <simon.fraser@apple.com>
2158
2159         Generalize the Document code that maintains a set of nodes with event handlers
2160         https://bugs.webkit.org/show_bug.cgi?id=142762
2161
2162         Reviewed by Zalan Bujtas, Darin Adler.
2163
2164         Document.h defines a TouchEventTargetSet type, which will in future be used for
2165         other event types too (wheel events), so rename it to EventTargetSet.
2166         
2167         Take didRemoveEventTargetNode() outside the TOUCH_EVENTS #ifdef, and change it
2168         to take a reference.
2169
2170         * dom/Document.cpp:
2171         (WebCore::Document::prepareForDestruction): References
2172         (WebCore::Document::didAddTouchEventHandler): Ditto.
2173         (WebCore::Document::didRemoveEventTargetNode): Ditto.
2174         * dom/Document.h:
2175         (WebCore::Document::touchEventTargets): No-one calls this; just remove the non
2176         #ideffed one.
2177         * html/HTMLInputElement.cpp:
2178         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a ref.
2179         (WebCore::HTMLInputElement::didMoveToNewDocument): Pass a ref.
2180         * page/DOMWindow.cpp:
2181         (WebCore::DOMWindow::removeAllEventListeners): Pass a ref.
2182
2183 2015-03-16  Joseph Pecoraro  <pecoraro@apple.com>
2184
2185         Web Inspector: Object Previews in Indexed DB tables
2186         https://bugs.webkit.org/show_bug.cgi?id=140813
2187
2188         Reviewed by Timothy Hatcher.
2189
2190         * inspector/InspectorIndexedDBAgent.cpp:
2191         Include previews with object store objects.
2192
2193 2015-03-16  Jer Noble  <jer.noble@apple.com>
2194
2195         [Mac] Update missing image UI
2196         https://bugs.webkit.org/show_bug.cgi?id=142592
2197
2198         Reviewed by Darin Adler.
2199
2200         Update the broken image glyphs with new art (including a 3x image).
2201
2202         Test: fast/hidpi/broken-image-icon-very-hidpi.html
2203
2204         * Resources/missingImage.png:
2205         * Resources/missingImage@2x.png:
2206         * Resources/missingImage@3x.png: Added.
2207         * WebCore.xcodeproj/project.pbxproj:
2208         * loader/cache/CachedImage.cpp:
2209         (WebCore::CachedImage::brokenImage):
2210
2211 2015-03-16  Dean Jackson  <dino@apple.com>
2212
2213         Parsing and Style Resolution of Container-based Animation Triggers
2214         https://bugs.webkit.org/show_bug.cgi?id=142687
2215         <rdar://problem/20170007>
2216
2217         Reviewed by Simon Fraser.
2218
2219         Take 2 after the previous patch was rolled out.
2220
2221         This is the beginning of a prototype implementation of
2222         CSS Animation Triggers, as described by
2223         https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html
2224
2225         In this patch we parse and resolve the value of a new
2226         CSS property "-webkit-animation-trigger". At the moment it
2227         only accepts one function value "container-scroll", which
2228         will trigger the animation at an absolute position within
2229         an element's scrolling container. We expect the syntax to
2230         change in the near future, as the spec is written.
2231
2232         Tests: animations/trigger-computed-style.html
2233                animations/trigger-parsing.html
2234
2235         * WebCore.xcodeproj/project.pbxproj: Add the new files.
2236
2237         * css/CSSAnimationTriggerScrollValue.cpp: Added.
2238         (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style.
2239         (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values.
2240         * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the
2241         scroll trigger. This name may change in the future to better represent the
2242         type of trigger, but it is good enough for now.
2243         (WebCore::CSSAnimationTriggerScrollValue::create):
2244         (WebCore::CSSAnimationTriggerScrollValue::startValue):
2245         (WebCore::CSSAnimationTriggerScrollValue::endValue):
2246         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
2247
2248         * css/CSSComputedStyleDeclaration.cpp:
2249         (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue.
2250         (WebCore::getAnimationTriggerValue): Gets the current computed style.
2251         (WebCore::ComputedStyleExtractor::propertyValue):
2252
2253         * css/CSSParser.cpp:
2254         (WebCore::CSSParser::parseValue):
2255         (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function
2256         and record the value as a CSSAnimationTriggerScrollValue.
2257         (WebCore::CSSParser::parseAnimationProperty): Handle the new property.
2258         * css/CSSParser.h:
2259
2260         * css/CSSPropertyNames.in: Add "-webkit-animation-trigger".
2261
2262         * css/CSSToStyleMap.cpp:
2263         (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on
2264         an Animation object.
2265         * css/CSSToStyleMap.h:
2266
2267         * css/CSSValue.cpp: Handle the new CSSValue type.
2268         (WebCore::CSSValue::equals):
2269         (WebCore::CSSValue::cssText):
2270         (WebCore::CSSValue::destroy):
2271         * css/CSSValue.h:
2272         (WebCore::CSSValue::isAnimationTriggerScrollValue):
2273
2274         * platform/animation/Animation.cpp: Make sure to initialise m_trigger and m_triggerSet,
2275         and use them in the operator==.
2276         * platform/animation/Animation.h: Add AnimationTrigger as a new field.
2277         (WebCore::Animation::isTriggerSet):
2278         (WebCore::Animation::isEmpty):
2279
2280         * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for
2281         "auto" and the scrolling trigger.
2282         (WebCore::AnimationTrigger::~AnimationTrigger):
2283         (WebCore::AnimationTrigger::type):
2284         (WebCore::AnimationTrigger::isAutoAnimationTrigger):
2285         (WebCore::AnimationTrigger::isScrollAnimationTrigger):
2286         (WebCore::AnimationTrigger::AnimationTrigger):
2287         (WebCore::AutoAnimationTrigger::create):
2288         (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger):
2289         (WebCore::AutoAnimationTrigger::AutoAnimationTrigger):
2290         (WebCore::ScrollAnimationTrigger::create):
2291         (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger):
2292         (WebCore::ScrollAnimationTrigger::startValue):
2293         (WebCore::ScrollAnimationTrigger::setStartValue):
2294         (WebCore::ScrollAnimationTrigger::endValue):
2295         (WebCore::ScrollAnimationTrigger::setEndValue):
2296         (WebCore::ScrollAnimationTrigger::hasEndValue):
2297         (WebCore::ScrollAnimationTrigger::setHasEndValue):
2298         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
2299
2300 2015-03-16  Alex Christensen  <achristensen@webkit.org>
2301
2302         Progress towards CMake on Mac
2303         https://bugs.webkit.org/show_bug.cgi?id=142747
2304
2305         Reviewed by Chris Dumez.
2306
2307         * CMakeLists.txt:
2308         * PlatformMac.cmake:
2309         Added more directories, interfaces, and forwarding headers.
2310         Temporarily disabled the generating of ObjC bindings in CMake builds.
2311         * platform/mac/PasteboardMac.mm:
2312         Removed unused include.
2313
2314 2015-03-16  Joanmarie Diggs  <jdiggs@igalia.com>
2315
2316         AX: Crash viewing http://www.last.fm/
2317         https://bugs.webkit.org/show_bug.cgi?id=142309
2318
2319         Reviewed by Chris Fleizach.
2320
2321         The crash occurs when a not-yet-rendered object emits a children-changed
2322         signal. If an assistive technology is listening, AT-SPI2 will attempt to
2323         create and cache the state set for the child being added and the creation
2324         of the state set assumes a rendered object.
2325
2326         Test: platform/gtk/accessibility/no-notification-for-unrendered-iframe-children.html
2327
2328         * accessibility/atk/AXObjectCacheAtk.cpp:
2329         (WebCore::AXObjectCache::attachWrapper):
2330
2331 2015-03-16  Commit Queue  <commit-queue@webkit.org>
2332
2333         Unreviewed, rolling out r181492.
2334         https://bugs.webkit.org/show_bug.cgi?id=142756
2335
2336         May have regressed PLT (Requested by anttik on #webkit).
2337
2338         Reverted changeset:
2339
2340         "Cache glyph widths to GlyphPages"
2341         https://bugs.webkit.org/show_bug.cgi?id=142028
2342         http://trac.webkit.org/changeset/181492
2343
2344 2015-03-16  Roger Fong  <roger_fong@apple.com>
2345
2346         [WebGL2] Instancing draw calls.
2347         https://bugs.webkit.org/show_bug.cgi?id=126939.
2348         <rdar://problem/15002379>
2349
2350         Reviewed by Dean Jackson.
2351
2352         Tested by a modified version of the 1.0.3 conformance tests:
2353         conformance/extensions/angle-instanced-arrays.html
2354         conformance/extensions/angle-instanced-arrays-out-of-bounds.html
2355
2356         These tests will be landed along with other modified extension conformance tests
2357         once approval from Khronos is received.
2358
2359         * html/canvas/WebGL2RenderingContext.cpp:
2360         (WebCore::WebGL2RenderingContext::clear): Generate error if clearing an integer color buffer.
2361         (WebCore::WebGL2RenderingContext::vertexAttribDivisor): Call method from base class.
2362         (WebCore::WebGL2RenderingContext::drawArraysInstanced): Ditto.
2363         (WebCore::WebGL2RenderingContext::drawElementsInstanced): Ditto.
2364         (WebCore::WebGL2RenderingContext::isIntegerFormat): Ditto.
2365         (WebCore::WebGL2RenderingContext::validateDrawElements): Deleted. Move back to base class.
2366         * html/canvas/WebGL2RenderingContext.h:
2367         * html/canvas/WebGL2RenderingContext.idl: Add a missing enum.
2368         * html/canvas/WebGLRenderingContext.cpp:
2369         (WebCore::WebGLRenderingContext::clear): Copied from WebGLRenderingContextBase.
2370         (WebCore::WebGLRenderingContext::validateDrawElements): Deleted. Move back to base class.
2371         * html/canvas/WebGLRenderingContext.h:
2372         * html/canvas/WebGLRenderingContextBase.cpp: 
2373         (WebCore::WebGLRenderingContextBase::clear): Deleted. Moved to WebGLRenderingContext.
2374         (WebCore::WebGLRenderingContextBase::getVertexAttrib): Check for WebGL2 context.
2375         (WebCore::WebGLRenderingContext::validateDrawElements): Ditto.
2376         * html/canvas/WebGLRenderingContextBase.h:
2377
2378 2015-03-16  Commit Queue  <commit-queue@webkit.org>
2379
2380         Unreviewed, rolling out r181572.
2381         https://bugs.webkit.org/show_bug.cgi?id=142755
2382
2383         Caused weird test failures in transitions and animations
2384         (Requested by dino on #webkit).
2385
2386         Reverted changeset:
2387
2388         "Parsing and Style Resolution of Container-based Animation
2389         Triggers"
2390         https://bugs.webkit.org/show_bug.cgi?id=142687
2391         http://trac.webkit.org/changeset/181572
2392
2393 2015-03-16  Yoav Weiss  <yoav@yoav.ws>
2394
2395         Remove setCachedImage from HTMLImageElement since it is not used
2396         https://bugs.webkit.org/show_bug.cgi?id=142740
2397
2398         Reviewed by Chris Dumez.
2399
2400         No new tests since this patch is just removing dead code.
2401
2402         HTMLImageElement::setCachedImage is not being called by anyone.
2403         This patch removes it, since it's dead code.
2404
2405         * html/HTMLImageElement.h:
2406         (WebCore::HTMLImageElement::setCachedImage): Deleted.
2407
2408 2015-03-16  Brent Fulgham  <bfulgham@apple.com>
2409
2410         WebKit1 Clients Are Not Reliably Repainted
2411         https://bugs.webkit.org/show_bug.cgi?id=142750
2412         <rdar://problem/20042453>
2413
2414         Reviewed by Simon Fraser.
2415
2416         * page/FrameView.cpp:
2417         (WebCore::FrameView::paintContents): Move "Red Rect" debug painting before
2418         the early return so we can see when this happening in debug builds.
2419         * page/FrameView.h:
2420         (WebCore::FrameView::inPaintableState): Added.
2421
2422 2015-03-16  Chris Dumez  <cdumez@apple.com>
2423
2424         Make DatabaseContext suspendable if there is no pending database activity
2425         https://bugs.webkit.org/show_bug.cgi?id=142716
2426         <rdar://problem/19923085>
2427
2428         Reviewed by Andreas Kling.
2429
2430         Make DatabaseContext suspendable if there is no pending database
2431         activity, i.e:
2432         - No pending Database creation JS callback
2433         - No pending transaction(s)
2434
2435         Suspending is safe in this case because we are not going to interrupt
2436         any database activity, nor fire any JS event.
2437
2438         This greatly increases the likelihood of pages using websql to enter
2439         the PageCache.
2440
2441         Tests: fast/history/page-cache-webdatabase-no-transaction-db.html
2442                fast/history/page-cache-webdatabase-pending-transaction.html
2443
2444         * Modules/webdatabase/Database.cpp:
2445         (WebCore::Database::hasPendingTransaction):
2446         * Modules/webdatabase/Database.h:
2447         * Modules/webdatabase/DatabaseContext.cpp:
2448         (WebCore::DatabaseContext::canSuspend):
2449         * Modules/webdatabase/DatabaseManager.cpp:
2450         (WebCore::DatabaseManager::openDatabase):
2451         * Modules/webdatabase/DatabaseThread.cpp:
2452         (WebCore::DatabaseThread::hasPendingDatabaseActivity):
2453         * Modules/webdatabase/DatabaseThread.h:
2454
2455 2015-03-16  Brady Eidson  <beidson@apple.com>
2456
2457         Addressing additional review feedback after http://trac.webkit.org/changeset/181565
2458         https://bugs.webkit.org/show_bug.cgi?id=142733
2459
2460         Reviewed by Darin Adler.
2461
2462         * loader/icon/IconController.cpp:
2463         (WebCore::IconController::startLoader): Null check page()
2464
2465 2015-03-16  Roger Fong  <roger_fong@apple.com>
2466
2467         [Win] Unreviewed build fix attempt after r181571.
2468
2469         * WebCore.vcxproj/WebCore.vcxproj:
2470
2471 2015-03-16  Roger Fong  <roger_fong@apple.com>
2472
2473         [WebGL2] Multiple Render Targets.
2474         https://bugs.webkit.org/show_bug.cgi?id=126994.
2475         <rdar://problem/15815766>
2476
2477         Reviewed by Dean Jackson.
2478
2479         Tested by a modified version of the 1.0.3 conformance test:
2480         conformance/extensions/webgl-draw-buffers.html
2481         This test will be landed along with other modified extension conformance tests
2482         once approval from Khronos is received.
2483
2484         * html/canvas/WebGL2RenderingContext.cpp:
2485         (WebCore::WebGL2RenderingContext::drawBuffers): Mostly the same as WebGLDrawBuffers::drawBuffersWEBGL.
2486         Returns different error messages, uses non EXT enums.
2487         (WebCore::WebGL2RenderingContext::clearBufferiv): This actually does nothing for now but the validation has been implemented.
2488         (WebCore::WebGL2RenderingContext::clearBufferuiv): Ditto.
2489         (WebCore::WebGL2RenderingContext::clearBufferfv): Ditto.
2490         (WebCore::WebGL2RenderingContext::clearBufferfi): Ditto.
2491         (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters): Removes the extension object check.
2492         (WebCore::WebGL2RenderingContext::getMaxDrawBuffers):
2493         (WebCore::WebGL2RenderingContext::getMaxColorAttachments): Must return the same thing as getMaxDrawBuffers.
2494         (WebCore::WebGL2RenderingContext::getParameter): Remove extension object checks.
2495         * html/canvas/WebGL2RenderingContext.h:
2496         * html/canvas/WebGLFramebuffer.cpp:
2497         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
2498         * html/canvas/WebGLRenderingContext.cpp:
2499         (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters): Copied from WebGLRenderingContextBase.
2500         (WebCore::WebGLRenderingContext::getMaxDrawBuffers): Ditto.
2501         (WebCore::WebGLRenderingContext::getMaxColorAttachments): Ditto.
2502         * html/canvas/WebGLRenderingContext.h:
2503         * html/canvas/WebGLRenderingContextBase.cpp:
2504         (WebCore::WebGLRenderingContextBase::validateFramebufferFuncParameters): Deleted.
2505         * html/canvas/WebGLRenderingContextBase.h:
2506
2507 2015-03-16  Dean Jackson  <dino@apple.com>
2508
2509         Parsing and Style Resolution of Container-based Animation Triggers
2510         https://bugs.webkit.org/show_bug.cgi?id=142687
2511         <rdar://problem/20170007>
2512
2513         Reviewed by Simon Fraser.
2514
2515         This is the beginning of a prototype implementation of
2516         CSS Animation Triggers, as described by
2517         https://lists.w3.org/Archives/Public/www-style/2014Sep/0135.html
2518
2519         In this patch we parse and resolve the value of a new
2520         CSS property "-webkit-animation-trigger". At the moment it
2521         only accepts one function value "container-scroll", which
2522         will trigger the animation at an absolute position within
2523         an element's scrolling container. We expect the syntax to
2524         change in the near future, as the spec is written.
2525
2526         Tests: animations/trigger-computed-style.html
2527                animations/trigger-parsing.html
2528
2529         * WebCore.xcodeproj/project.pbxproj: Add the new files.
2530
2531         * css/CSSAnimationTriggerScrollValue.cpp: Added.
2532         (WebCore::CSSAnimationTriggerScrollValue::customCSSText): Output text for computed style.
2533         (WebCore::CSSAnimationTriggerScrollValue::equals): Compare two values.
2534         * css/CSSAnimationTriggerScrollValue.h: Added. This holds the CSS side of the
2535         scroll trigger. This name may change in the future to better represent the
2536         type of trigger, but it is good enough for now.
2537         (WebCore::CSSAnimationTriggerScrollValue::create):
2538         (WebCore::CSSAnimationTriggerScrollValue::startValue):
2539         (WebCore::CSSAnimationTriggerScrollValue::endValue):
2540         (WebCore::CSSAnimationTriggerScrollValue::CSSAnimationTriggerScrollValue):
2541
2542         * css/CSSComputedStyleDeclaration.cpp:
2543         (WebCore::createAnimationTriggerValue): Maps an AnimationTrigger into a CSSValue.
2544         (WebCore::getAnimationTriggerValue): Gets the current computed style.
2545         (WebCore::ComputedStyleExtractor::propertyValue):
2546
2547         * css/CSSParser.cpp:
2548         (WebCore::CSSParser::parseValue):
2549         (WebCore::CSSParser::parseAnimationTrigger): Parse the "container-scroll" function
2550         and record the value as a CSSAnimationTriggerScrollValue.
2551         (WebCore::CSSParser::parseAnimationProperty): Handle the new property.
2552         * css/CSSParser.h:
2553
2554         * css/CSSPropertyNames.in: Add "-webkit-animation-trigger".
2555
2556         * css/CSSToStyleMap.cpp:
2557         (WebCore::CSSToStyleMap::mapAnimationTrigger): Map a CSSValue into a trigger value on
2558         an Animation object.
2559         * css/CSSToStyleMap.h:
2560
2561         * css/CSSValue.cpp: Handle the new CSSValue type.
2562         (WebCore::CSSValue::equals):
2563         (WebCore::CSSValue::cssText):
2564         (WebCore::CSSValue::destroy):
2565         * css/CSSValue.h:
2566         (WebCore::CSSValue::isAnimationTriggerScrollValue):
2567
2568         * platform/animation/Animation.h: Add AnimationTrigger as a new field.
2569         (WebCore::Animation::isTriggerSet):
2570         (WebCore::Animation::isEmpty):
2571
2572         * platform/animation/AnimationTrigger.h: Added. New base class and subclasses for
2573         "auto" and the scrolling trigger.
2574         (WebCore::AnimationTrigger::~AnimationTrigger):
2575         (WebCore::AnimationTrigger::type):
2576         (WebCore::AnimationTrigger::isAutoAnimationTrigger):
2577         (WebCore::AnimationTrigger::isScrollAnimationTrigger):
2578         (WebCore::AnimationTrigger::AnimationTrigger):
2579         (WebCore::AutoAnimationTrigger::create):
2580         (WebCore::AutoAnimationTrigger::~AutoAnimationTrigger):
2581         (WebCore::AutoAnimationTrigger::AutoAnimationTrigger):
2582         (WebCore::ScrollAnimationTrigger::create):
2583         (WebCore::ScrollAnimationTrigger::~ScrollAnimationTrigger):
2584         (WebCore::ScrollAnimationTrigger::startValue):
2585         (WebCore::ScrollAnimationTrigger::setStartValue):
2586         (WebCore::ScrollAnimationTrigger::endValue):
2587         (WebCore::ScrollAnimationTrigger::setEndValue):
2588         (WebCore::ScrollAnimationTrigger::hasEndValue):
2589         (WebCore::ScrollAnimationTrigger::setHasEndValue):
2590         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
2591
2592 2015-03-15  Roger Fong  <roger_fong@apple.com>
2593
2594         [WebGL2] Vertex Array Objects.
2595         https://bugs.webkit.org/show_bug.cgi?id=126944.
2596         <rdar://problem/15002455>
2597
2598         Reviewed by Dean Jackson.
2599
2600         Tested by a modified version of the 1.0.3 conformance test:
2601         conformance/extensions/oes-vertex-array-object.html
2602         This test will be landed along with other modified extension conformance tests
2603         once approval from Khronos is received.
2604
2605         * html/canvas/OESVertexArrayObject.cpp: Associate extension calls only with WebGLRenderingContext.
2606         (WebCore::OESVertexArrayObject::deleteVertexArrayOES):
2607         (WebCore::OESVertexArrayObject::bindVertexArrayOES):
2608         * html/canvas/WebGLRenderingContext.cpp:
2609         (WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
2610         (WebCore::WebGLRenderingContext::getParameter):
2611         * html/canvas/WebGL2RenderingContext.cpp: Implement vertex array object calls as part WebGL2 context.
2612         (WebCore::WebGL2RenderingContext::createVertexArray):
2613         (WebCore::WebGL2RenderingContext::deleteVertexArray):
2614         (WebCore::WebGL2RenderingContext::isVertexArray):
2615         (WebCore::WebGL2RenderingContext::bindVertexArray):
2616         (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
2617         (WebCore::WebGL2RenderingContext::getParameter):
2618
2619         Duplicate extension object vertex array object extension methods in GraphicsContext3D.
2620         Implementation may change after we upgrade to newer GL headers and profile.
2621         * platform/graphics/GraphicsContext3D.h:
2622         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2623         (WebCore::GraphicsContext3D::createVertexArray):
2624         (WebCore::GraphicsContext3D::deleteVertexArray):
2625         (WebCore::GraphicsContext3D::isVertexArray):
2626         (WebCore::GraphicsContext3D::bindVertexArray):
2627
2628         Have WebGLVertexArrayObjectOES and WebGLVertexArrayObject inherit from WebGLRenderingContextBase.
2629         * CMakeLists.txt:
2630         * WebCore.xcodeproj/project.pbxproj:
2631         * html/canvas/WebGLVertexArrayObject.cpp:
2632         (WebCore::WebGLVertexArrayObject::create):
2633         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Use GraphicsContext3D implementation of createVertexArray.
2634         (WebCore::WebGLVertexArrayObject::deleteObjectImpl):
2635         * html/canvas/WebGLVertexArrayObject.h:
2636         * html/canvas/WebGLVertexArrayObjectBase.cpp: Added.
2637         (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
2638         (WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer):
2639         (WebCore::WebGLVertexArrayObjectBase::setVertexAttribState):
2640         (WebCore::WebGLVertexArrayObjectBase::unbindBuffer):
2641         (WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor):
2642         * html/canvas/WebGLVertexArrayObjectBase.h: Added.
2643         (WebCore::WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase):
2644         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::VertexAttribState):
2645         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::isBound):
2646         (WebCore::WebGLVertexArrayObjectBase::VertexAttribState::validateBinding):
2647         (WebCore::WebGLVertexArrayObjectBase::isDefaultObject):
2648         (WebCore::WebGLVertexArrayObjectBase::hasEverBeenBound):
2649         (WebCore::WebGLVertexArrayObjectBase::setHasEverBeenBound):
2650         (WebCore::WebGLVertexArrayObjectBase::getElementArrayBuffer):
2651         (WebCore::WebGLVertexArrayObjectBase::getVertexAttribState):
2652         * html/canvas/WebGLVertexArrayObjectOES.cpp:
2653         (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
2654         (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
2655         (WebCore::WebGLVertexArrayObjectOES::setElementArrayBuffer): Deleted.
2656         (WebCore::WebGLVertexArrayObjectOES::setVertexAttribState): Deleted.
2657         (WebCore::WebGLVertexArrayObjectOES::unbindBuffer): Deleted.
2658         (WebCore::WebGLVertexArrayObjectOES::setVertexAttribDivisor): Deleted.
2659         * html/canvas/WebGLVertexArrayObjectOES.h:
2660
2661         * html/canvas/WebGLRenderingContextBase.cpp: Use WebGLVertexArrayObjectBase class.
2662         (WebCore::WebGLRenderingContextBase::initializeNewContext):
2663         (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
2664         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
2665         (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
2666         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
2667         (WebCore::WebGLRenderingContextBase::initVertexAttrib0):
2668         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
2669         (WebCore::WebGLRenderingContextBase::restoreStatesAfterVertexAttrib0Simulation):
2670         * html/canvas/WebGLRenderingContextBase.h:
2671         (WebCore::WebGLRenderingContextBase::setBoundVertexArrayObject):
2672
2673         Handle construction of WebGLGetInfo using WebGLVertexArrayObject.
2674         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2675         (WebCore::toJS):
2676         * html/canvas/WebGLGetInfo.cpp:
2677         (WebCore::WebGLGetInfo::WebGLGetInfo):
2678         (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
2679         (WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
2680         * html/canvas/WebGLGetInfo.h:
2681
2682 2015-03-16  Brent Fulgham  <bfulgham@apple.com>
2683
2684         Potentially uninitialized Inspector values
2685         https://bugs.webkit.org/show_bug.cgi?id=142730
2686
2687         Reviewed by Joseph Pecoraro.
2688
2689         * inspector/InspectorDOMAgent.cpp:
2690         (WebCore::parseColor): Make sure color values are given an initial value.
2691
2692 2015-03-16  Brady Eidson  <beidson@apple.com>
2693
2694         URLs visited during private browsing show up in WebpageIcons.db
2695         rdar://problem/11254910 and https://bugs.webkit.org/show_bug.cgi?id=142733
2696
2697         Patch by Sam Weinig. Reviewed by Brady Eidson.
2698
2699         * loader/icon/IconController.cpp:
2700         (WebCore::IconController::startLoader): Bail early here if the page is using an ephemeral session.
2701         (WebCore::IconController::continueLoadWithDecision): Instead of here.
2702
2703 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
2704
2705         Allow clients to selectively disable plug-ins
2706         https://bugs.webkit.org/show_bug.cgi?id=142506
2707
2708         Reviewed by Anders Carlsson.
2709
2710         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
2711         from the page). As part of this:
2712
2713         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
2714            set of plug-ins.
2715
2716         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
2717            down the stack.
2718
2719         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
2720            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
2721
2722         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
2723
2724         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
2725         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
2726
2727         * dom/DOMImplementation.cpp:
2728         (WebCore::DOMImplementation::createDocument):
2729         Update to reflect function rename.
2730
2731         * loader/SubframeLoader.cpp:
2732         (WebCore::findPluginMIMETypeFromURL):
2733         Adopt getWebVisibleMimesAndPluginIndices().
2734         (WebCore::logPluginRequest):
2735         Update to reflect function rename.
2736         (WebCore::SubframeLoader::shouldUsePlugin):
2737         Ditto.
2738
2739         * platform/PlatformStrategies.h:
2740         Export platformStrategies(), since it is now used in WebProcess.cpp.
2741
2742         * plugins/DOMMimeType.cpp:
2743         (WebCore::DOMMimeType::type):
2744         (WebCore::DOMMimeType::description):
2745         (WebCore::DOMMimeType::mimeClassInfo):
2746         Adopt getWebVisibleMimesAndPluginIndices().
2747         (WebCore::DOMMimeType::enabledPlugin):
2748         Ditto.
2749
2750         * plugins/DOMMimeType.h:
2751         Don't return references in a few places where it is no longer safe to do so.
2752         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
2753
2754         * plugins/DOMMimeTypeArray.cpp:
2755         (WebCore::DOMMimeTypeArray::length):
2756         Adopt getWebVisibleMimesAndPluginIndices().
2757         (WebCore::DOMMimeTypeArray::item):
2758         Ditto.
2759         (WebCore::DOMMimeTypeArray::canGetItemsForName):
2760         Ditto.
2761         (WebCore::DOMMimeTypeArray::namedItem):
2762         Ditto.
2763
2764         * plugins/DOMPlugin.cpp:
2765         (WebCore::DOMPlugin::pluginInfo):
2766         Adopt getWebVisiblePlugins().
2767         (WebCore::DOMPlugin::item):
2768         Adopt getWebVisibleMimesAndPluginIndices().
2769         (WebCore::DOMPlugin::canGetItemsForName):
2770         Ditto.
2771         (WebCore::DOMPlugin::namedItem):
2772         Ditto.
2773
2774         * plugins/DOMPlugin.h:
2775         (WebCore::DOMPlugin::pluginInfo): Deleted.
2776
2777         * plugins/DOMPluginArray.cpp:
2778         (WebCore::DOMPluginArray::length):
2779         Adopt getWebVisiblePlugins().
2780         (WebCore::DOMPluginArray::item):
2781         Ditto.
2782         (WebCore::DOMPluginArray::canGetItemsForName):
2783         Ditto.
2784         (WebCore::DOMPluginArray::namedItem):
2785         Ditto.
2786
2787         * plugins/PluginData.cpp:
2788         (WebCore::PluginData::PluginData):
2789         Stash the passed-in Page and call initPlugins().
2790         (WebCore::PluginData::getWebVisiblePlugins):
2791         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
2792         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
2793         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
2794         limited to the web-visible plug-ins.
2795         (WebCore::PluginData::supportsWebVisibleMimeType):
2796         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
2797         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
2798         Renamed from pluginInfoForMimeType(); ditto.
2799         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
2800         Renamed from pluginNameForMimeType(); ditto.
2801         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
2802         Renamed from pluginFileForMimeType(); ditto.
2803         (WebCore::PluginData::initPlugins):
2804         (WebCore::PluginData::supportsMimeType): Deleted.
2805         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
2806         (WebCore::PluginData::pluginNameForMimeType): Deleted.
2807         (WebCore::PluginData::pluginFileForMimeType): Deleted.
2808
2809         * plugins/PluginData.h:
2810         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
2811         new members to PluginInfo for the clientLoadPolicy and bundle information.
2812         (WebCore::PluginData::PluginData):
2813         Replace some member functions with new ones that will hide plug-ins upon request from the client;
2814         (WebCore::PluginData::mimes): Deleted.
2815         (WebCore::PluginData::mimePluginIndices): Deleted.
2816
2817         * plugins/PluginStrategy.h:
2818         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
2819
2820         * replay/SerializationMethods.cpp:
2821         (JSC::EncodingTraits<PluginData>::encodeValue):
2822         Remove now-obsolete code for handling MIME types and add a FIXME.
2823         (JSC::DeserializedPluginData::DeserializedPluginData):
2824         (JSC::EncodingTraits<PluginData>::decodeValue):
2825         Ditto.
2826         (JSC::EncodingTraits<PluginInfo>::encodeValue):
2827         Handle the new members in PluginInfo.
2828         (JSC::EncodingTraits<PluginInfo>::decodeValue):
2829         Ditto.
2830
2831         * replay/WebInputs.json:
2832         Teach Replay about PluginLoadClientPolicy.
2833
2834 2015-03-16  Max Stepin  <maxstepin@gmail.com>
2835
2836         Add APNG support
2837         https://bugs.webkit.org/show_bug.cgi?id=17022
2838
2839         Reviewed by Carlos Garcia Campos.
2840
2841         Test: fast/images/animated-png.html
2842
2843         * platform/image-decoders/ImageDecoder.h:
2844         (WebCore::ImageFrame::divide255):
2845         (WebCore::ImageFrame::overRGBA):
2846         * platform/image-decoders/png/PNGImageDecoder.cpp:
2847         (WebCore::frameHeader):
2848         (WebCore::readChunks):
2849         (WebCore::PNGImageReader::PNGImageReader):
2850         (WebCore::PNGImageDecoder::PNGImageDecoder):
2851         (WebCore::PNGImageDecoder::frameBufferAtIndex):
2852         (WebCore::PNGImageDecoder::headerAvailable):
2853         (WebCore::PNGImageDecoder::rowAvailable):
2854         (WebCore::PNGImageDecoder::pngComplete):
2855         (WebCore::PNGImageDecoder::readChunks):
2856         (WebCore::PNGImageDecoder::frameHeader):
2857         (WebCore::PNGImageDecoder::init):
2858         (WebCore::PNGImageDecoder::clearFrameBufferCache):
2859         (WebCore::PNGImageDecoder::initFrameBuffer):
2860         (WebCore::PNGImageDecoder::frameComplete):
2861         (WebCore::PNGImageDecoder::processingStart):
2862         (WebCore::PNGImageDecoder::processingFinish):
2863         (WebCore::PNGImageDecoder::fallbackNotAnimated):
2864         * platform/image-decoders/png/PNGImageDecoder.h:
2865         (WebCore::PNGImageDecoder::frameCount):
2866         (WebCore::PNGImageDecoder::repetitionCount):
2867         (WebCore::PNGImageDecoder::isComplete):
2868
2869 2015-03-15  Benjamin Poulain  <benjamin@webkit.org>
2870
2871         CSS: fix the case-insensitive matching of the attribute selectors Begin, End and Hyphen
2872         https://bugs.webkit.org/show_bug.cgi?id=142715
2873
2874         Reviewed by Brent Fulgham.
2875
2876         Fix attribute matching with:
2877         -Begin: [a^=b].
2878         -End: [a$=b].
2879         -Hyphen: [a|=b].
2880
2881         Tests: fast/selectors/attribute-endswith-value-matching-is-ascii-case-insensitive.html
2882                fast/selectors/attribute-hyphen-value-matching-is-ascii-case-insensitive.html
2883                fast/selectors/attribute-startswith-value-matching-is-ascii-case-insensitive.html
2884
2885         * css/SelectorChecker.cpp:
2886         (WebCore::attributeValueMatches):
2887         I forgot to change CSSSelector::Exact in my last patch.
2888         The tests could not catch that since we use the CSS JIT almost everywhere.
2889
2890         * cssjit/SelectorCompiler.cpp:
2891         (WebCore::SelectorCompiler::attributeValueBeginsWith):
2892         (WebCore::SelectorCompiler::attributeValueEndsWith):
2893         (WebCore::SelectorCompiler::attributeValueMatchHyphenRule):
2894
2895 2015-03-15  Dan Bernstein  <mitz@apple.com>
2896
2897         Fixed the iOS build after r181522.
2898
2899         * page/FrameView.cpp:
2900         (WebCore::FrameView::performPostLayoutTasks):
2901
2902 2015-03-15  Andy Estes  <aestes@apple.com>
2903
2904         [Content Filtering] Adopt new NEFilterSource SPI
2905         https://bugs.webkit.org/show_bug.cgi?id=142710
2906         rdar://problem/19023855
2907
2908         Reviewed by Dan Bernstein.
2909
2910         Teach NetworkExtensionContentFilter to use a new, alternate NEFilterSource SPI on platforms where it is available.
2911
2912         * platform/ContentFilter.cpp:
2913         (WebCore::ContentFilter::types): Renamed HAVE(NE_FILTER_SOURCE) to HAVE(NETWORK_EXTENSION).
2914         * platform/cocoa/NetworkExtensionContentFilter.h: Renamed member variables to remove redundancy, forward-declared NEFilterSourceStatus,
2915         added a dispatch_semaphore member variable to avoid creating and destroying multiple semaphores, and made m_originalData a SharedBuffer.
2916         * platform/cocoa/NetworkExtensionContentFilter.mm:
2917         (decisionInfoReplacementData): Returned the replacement data from a decision handler info dictionary.
2918         (WebCore::createNEFilterSource): Created either an old-style or new-style NEFilterSource object.
2919         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Called receivedResponse:decisionHandler: when using the new SPI.
2920         (WebCore::NetworkExtensionContentFilter::~NetworkExtensionContentFilter): Released the dispatch_semaphore.
2921         (WebCore::NetworkExtensionContentFilter::addData): Appended the copied NSData to m_originalData, avoiding an additional copy previously
2922         being made by NSMutableData. Used the new receivedData:decisionHandler: SPI when appropriate.
2923         (WebCore::NetworkExtensionContentFilter::finishedAddingData): Used the new finishedLoadingWithDecisionHandler: SPI when appropriate.
2924         (WebCore::NetworkExtensionContentFilter::needsMoreData): Changed m_neFilterSourceStatus to m_status.
2925         (WebCore::NetworkExtensionContentFilter::didBlockData): Ditto.
2926         (WebCore::NetworkExtensionContentFilter::getReplacementData): Returned the replacement data from NEFilterSource if the load was blocked.
2927         Otherwise, returned the original data.
2928         (WebCore::NetworkExtensionContentFilter::handleDecision): Added a helper to set m_status and m_replacementData, and to signal m_semaphore.
2929         * platform/spi/cocoa/NEFilterSourceSPI.h: Declared the new NEFilterSource SPI on platforms that support it.
2930
2931 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
2932
2933         Scroll snap points are not supported on iframe content
2934         https://bugs.webkit.org/show_bug.cgi?id=142582
2935         <rdar://problem/20121319>
2936
2937         Tested by css3/scroll-snap/scroll-snap-iframe.html
2938
2939         Reviewed by Simon Fraser.
2940
2941         The scroll snap points were not being applied to the iframe contents because the code
2942         that sets up the scroll snap point content is not called for iframes.
2943
2944         To correct this, we need to make sure the snap offsets are set during post-frame layout
2945         for iframes. We also need to make sure (on Mac) that the scroll animator and timers are updated.
2946
2947         * page/FrameView.cpp:
2948         (WebCore::FrameView::performPostLayoutTasks): Call 'updateSnapOffsets' if the frame is not a
2949         MainFrame. Also notify scroll animators they need to update their snap point settings.
2950
2951 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2952
2953         Add the same is<RenderBox> test to KeyframeAnimation::computeExtentOfTransformAnimation()
2954         that ImplicitAnimation::computeExtentOfTransformAnimation() has, and change the latter
2955         to the more canonical is<RenderBox>() form.
2956         
2957         Fixes an assertion in animations/animation-on-inline-crash.html
2958
2959         * page/animation/ImplicitAnimation.cpp:
2960         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2961         * page/animation/KeyframeAnimation.cpp:
2962         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2963
2964 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2965
2966         And another fix. Thanks to Hunseop Jeong for the fix.
2967
2968         * html/HTMLInputElement.cpp:
2969         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
2970         (WebCore::HTMLInputElement::didMoveToNewDocument):
2971
2972 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2973
2974         Fix the touch-event build.
2975
2976         * dom/Document.cpp:
2977         (WebCore::Document::didAddTouchEventHandler):
2978         (WebCore::Document::didRemoveTouchEventHandler):
2979
2980 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
2981
2982         Reduce the side-effects of animations turning off overlap testing
2983         https://bugs.webkit.org/show_bug.cgi?id=92791
2984
2985         Reviewed by Dean Jackson.
2986         
2987         When a layer is running a transition or animation of the transform property,
2988         we would simply disable overlap testing for later layers, which had the side-effect
2989         of promoting lots of unrelated elements into layers temporarily.
2990         
2991         Fix by maintaining overlap, but computing an overlap extent that takes the animation
2992         into account.
2993         
2994         Rotations are currently treated as full rotations. If an extent for the overlap is
2995         hard to compute (e.g. 3d transforms, or matrix animations with a rotation component),
2996         then we fall back to the current behavior.
2997
2998         Tests: compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html
2999                compositing/layer-creation/mismatched-rotated-transform-transition-overlap.html
3000                compositing/layer-creation/mismatched-transform-transition-overlap.html
3001                compositing/layer-creation/multiple-keyframes-animation-overlap.html
3002                compositing/layer-creation/scale-rotation-animation-overlap.html
3003                compositing/layer-creation/scale-rotation-transition-overlap.html
3004                compositing/layer-creation/translate-animation-overlap.html
3005                compositing/layer-creation/translate-scale-animation-overlap.html
3006                compositing/layer-creation/translate-scale-transition-overlap.html
3007                compositing/layer-creation/translate-transition-overlap.html
3008
3009         * page/animation/AnimationBase.cpp:
3010         (WebCore::containsRotation):
3011         (WebCore::AnimationBase::computeTransformedExtentViaTransformList): When we have matched
3012         transform lists, we can map a rectangle through the various operations. Transform-origin
3013         is used to shift the origin of the box first, and then unshift after. If we encounter
3014         a rotation, for now assume it's a full rotation (a future patch could tighten this up).
3015         (WebCore::AnimationBase::computeTransformedExtentViaMatrix): If we're using matrix
3016         interpolation, we have to decompose the matrix to see if there's any rotation component,
3017         and, if there is, fall back to current behavior.
3018         * page/animation/AnimationBase.h:
3019         * page/animation/AnimationController.cpp:
3020         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
3021         (WebCore::AnimationController::computeExtentOfAnimation):
3022         * page/animation/AnimationController.h:
3023         * page/animation/AnimationControllerPrivate.h:
3024         * page/animation/CompositeAnimation.cpp:
3025         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation): Ask active keyframe
3026         animations and transitions to compute the bounds extent.
3027         * page/animation/CompositeAnimation.h:
3028         * page/animation/ImplicitAnimation.cpp:
3029         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation): Compute the extent
3030         of the start and end transforms, and union them.
3031         * page/animation/ImplicitAnimation.h:
3032         * page/animation/KeyframeAnimation.cpp:
3033         (WebCore::KeyframeAnimation::animate):
3034         (WebCore::KeyframeAnimation::getAnimatedStyle): Some nullptr goodness.
3035         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation): Compute an extent
3036         for each keyframe, and take their union.
3037         * page/animation/KeyframeAnimation.h:
3038         * platform/graphics/GeometryUtilities.cpp:
3039         (WebCore::euclidianDistance): Use Pythagoras to compute a distance.
3040         (WebCore::boundsOfRotatingRect): Given a rect whose location is relative
3041         to the rotation origin, compute a bounds for the rotated rect by computing
3042         the furthest corner from the origin, and sweeping out a circle.
3043         * platform/graphics/GeometryUtilities.h:
3044         * platform/graphics/transforms/Matrix3DTransformOperation.h:
3045         * platform/graphics/transforms/MatrixTransformOperation.h:
3046         * platform/graphics/transforms/PerspectiveTransformOperation.h:
3047         * platform/graphics/transforms/RotateTransformOperation.h:
3048         * platform/graphics/transforms/ScaleTransformOperation.h:
3049         * platform/graphics/transforms/SkewTransformOperation.h:
3050         * platform/graphics/transforms/TransformOperation.h:
3051         (WebCore::TransformOperation::isAffectedByTransformOrigin):
3052         * platform/graphics/transforms/TransformOperations.cpp:
3053         (WebCore::TransformOperations::affectedByTransformOrigin): Ask all the operations if
3054         they are affected by transform-origin.
3055         (WebCore::TransformOperations::blendByMatchingOperations): nullptr.
3056         * platform/graphics/transforms/TransformOperations.h:
3057         * rendering/RenderBox.cpp:
3058         (WebCore::RenderBox::pushMappingToContainer): Comment fix. Only take transforms into account
3059         if the geometry map says so (which is most of the time).
3060         * rendering/RenderGeometryMap.cpp:
3061         (WebCore::RenderGeometryMap::mapToContainer): RenderLayerCompositor is now using the
3062         geometry map in a way that is incompatible with this assertion; it deliberately ignores
3063         transforms sometimes, so we can't easily verify that the mapping matches mapping through
3064         renderers.
3065         (WebCore::RenderGeometryMap::pushMappingsToAncestor): Save and restore the UseTransforms
3066         bit.
3067         * rendering/RenderGeometryMap.h:
3068         * rendering/RenderLayer.cpp:
3069         (WebCore::RenderLayer::boundingBox): Whitespace.
3070         (WebCore::RenderLayer::getOverlapBoundsIncludingChildrenAccountingForTransformAnimations): Helper
3071         function to get the bounds of a layer, including descendants, when a transform animation is running.
3072         * rendering/RenderLayer.h:
3073         * rendering/RenderLayerCompositor.cpp:
3074         (WebCore::RenderLayerCompositor::CompositingState::CompositingState): Add a ancestorHasTransformAnimation
3075         flag to detect nested animated transforms.
3076         (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty): This returns true when
3077         the layer is animating transform, and the transition/animation is such that we can't easily compute the
3078         bounds of the animation.
3079         (WebCore::RenderLayerCompositor::computeExtent): const RenderLayer&.
3080         Compute the animated bounds if there's a transform animation running.
3081         (WebCore::RenderLayerCompositor::addToOverlapMap): const RenderLayer&
3082         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): const RenderLayer&
3083         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3084         Delay the call to pushMappingsToAncestor() until knowing if there's a transform animation running, and
3085         if there is, push the mapping while ignoring transforms (since the transform is implicitly taken into account
3086         for overlap via the computed animated bounds).
3087         If this layer is running a transform animation, set the childState.ancestorHasTransformAnimation flag so
3088         that descendants will know (nested transform animations fall back to current behavior).
3089         The if (.... && isRunningAcceleratedTransformAnimation()) is what previously caused us to turn off overlap
3090         testing in the face of animations. That now only happens if we were unable to easily compute the animation bounds.
3091         (WebCore::RenderLayerCompositor::isRunningTransformAnimation): This previously tested whether an accelerated animation
3092         was running, but that's timing sensitive; AnimationController can start the transform animation, but it's not yet
3093         considered accelerated until we get an async callback from GraphicsLayer, yet this code needed to know if the
3094         animation was running.
3095         Since transform animations are always accelerated, we can just test for a running transform animation.
3096         (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation): Deleted.
3097         * rendering/RenderLayerCompositor.h:
3098         * rendering/style/RenderStyle.cpp:
3099         (WebCore::requireTransformOrigin): Some FIXME comments.
3100
3101 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
3102
3103         Clean up related to wheelEvent names
3104         https://bugs.webkit.org/show_bug.cgi?id=142713
3105
3106         Reviewed by Anders Carlsson.
3107
3108         Add EventNames::isWheelEventType() and use it in places that test for the
3109         two wheel event names.
3110
3111         * dom/Document.cpp:
3112         (WebCore::Document::didAddWheelEventHandler):
3113         (WebCore::Document::didRemoveWheelEventHandler):
3114         * dom/Document.h: No need for exports (I grepped). Pass the Node*, which
3115         will be used in a later patch.
3116         * dom/EventNames.h:
3117         (WebCore::EventNames::isWheelEventType):
3118         * dom/Node.cpp:
3119         (WebCore::Node::didMoveToNewDocument):
3120         (WebCore::tryAddEventListener):
3121         (WebCore::tryRemoveEventListener):
3122         (WebCore::Node::defaultEventHandler):
3123         * html/shadow/MediaControlsApple.cpp:
3124         (WebCore::MediaControlsAppleEventListener::handleEvent):
3125         * page/DOMWindow.cpp:
3126         (WebCore::DOMWindow::addEventListener):
3127         (WebCore::DOMWindow::removeEventListener):
3128         * page/ios/FrameIOS.mm:
3129         (WebCore::ancestorRespondingToScrollWheelEvents): Remove dead code.
3130
3131 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
3132
3133         Remove a redundant repaint when a layer becomes composited
3134         https://bugs.webkit.org/show_bug.cgi?id=142711
3135
3136         Reviewed by Anders Carlsson.
3137
3138         RenderLayerCompositor::computeCompositingRequirements() doesn't need to call
3139         repaintOnCompositingChange() when a layer is going to become composited,
3140         because updateBacking() does exactly the same thing. I used an assertion
3141         and ran the tests to ensure this wasn't a behavior change.
3142
3143         * rendering/RenderLayerCompositor.cpp:
3144         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3145
3146 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
3147
3148         Change the exact attribute matching to be ASCII case-insensitive
3149         https://bugs.webkit.org/show_bug.cgi?id=142609
3150
3151         Reviewed by Darin Adler.
3152
3153         In CSS, testing attribute values should be ASCII case-insensitive,
3154         previously we were using full unicode case conversion.
3155
3156         Test: fast/selectors/attribute-exact-value-match-is-ascii-case-insensitive.html
3157
3158         * css/CSSParser.cpp:
3159         (WebCore::CSSParser::parseKeyframeSelector):
3160         The CSS parser has its own fast version for ASCII case insensitive.
3161         This code was using the general equalIgnoringASCIICase() which was causing name conflicts,
3162         change that to the normal CSS parser version.
3163
3164         * css/SelectorCheckerTestFunctions.h:
3165         (WebCore::equalIgnoringASCIICase): Deleted.
3166         * cssjit/SelectorCompiler.cpp:
3167         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
3168
3169 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
3170
3171         scroll snap points do not properly account for zoomed pages
3172         https://bugs.webkit.org/show_bug.cgi?id=142706
3173         <rdar://problem/20165771>
3174
3175         Reviewed by Anders Carlsson.
3176
3177         When a WebView is zoomed (such that it has a non-unity pageScaleFactor), we need to account for this
3178         scaling value when selecting our correct scroll snap point target, as well as when specifying the
3179         pixel location for our animation to target.
3180
3181         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3182         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3183         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor): Added new delegate method.
3184         * platform/cocoa/ScrollController.h:
3185         (WebCore::ScrollControllerClient::pageScaleFactor): Added new default delegate.
3186         * platform/cocoa/ScrollController.mm:
3187         (WebCore::ScrollController::beginScrollSnapAnimation): Calculate the correct scroll target
3188         based on the page scale factor.
3189
3190 2015-03-15  Csaba Osztrogonác  <ossy@webkit.org>
3191
3192         Fix run-bindings-tests on the WinCairo bot
3193         https://bugs.webkit.org/show_bug.cgi?id=142588
3194
3195         Reviewed by Alex Christensen.
3196
3197         * bindings/scripts/test/JS/JSFloat64Array.cpp: Added property svn:eol-style.
3198         * bindings/scripts/test/JS/JSFloat64Array.h: Added property svn:eol-style.
3199         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Added property svn:eol-style.
3200         * bindings/scripts/test/JS/JSTestActiveDOMObject.h: Modified property svn:eol-style.
3201         * bindings/scripts/test/JS/JSTestCallback.cpp: Modified property svn:eol-style.
3202         * bindings/scripts/test/JS/JSTestCallback.h: Modified property svn:eol-style.
3203         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Added property svn:eol-style.
3204         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Modified property svn:eol-style.
3205         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Added property svn:eol-style.
3206         * bindings/scripts/test/JS/JSTestEventConstructor.h: Added property svn:eol-style.
3207         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Added property svn:eol-style.
3208         * bindings/scripts/test/JS/JSTestEventTarget.h: Modified property svn:eol-style.
3209         * bindings/scripts/test/JS/JSTestException.cpp: Added property svn:eol-style.
3210         * bindings/scripts/test/JS/JSTestException.h: Added property svn:eol-style.
3211         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Added property svn:eol-style.
3212         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: Added property svn:eol-style.
3213         * bindings/scripts/test/JS/JSTestImplements.cpp: Added property svn:eol-style.
3214         * bindings/scripts/test/JS/JSTestImplements.h: Added property svn:eol-style.
3215         * bindings/scripts/test/JS/JSTestInterface.cpp: Modified property svn:eol-style.
3216         * bindings/scripts/test/JS/JSTestInterface.h: Modified property svn:eol-style.
3217         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Modified property svn:eol-style.
3218         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Modified property svn:eol-style.
3219         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Added property svn:eol-style.
3220         * bindings/scripts/test/JS/JSTestNamedConstructor.h: Added property svn:eol-style.
3221         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added property svn:eol-style.
3222         * bindings/scripts/test/JS/JSTestNondeterministic.h: Added property svn:eol-style.
3223         * bindings/scripts/test/JS/JSTestObj.cpp: Modified property svn:eol-style.
3224         * bindings/scripts/test/JS/JSTestObj.h: Modified property svn:eol-style.
3225         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Added property svn:eol-style.
3226         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: Added property svn:eol-style.
3227         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Modified property svn:eol-style.
3228         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Modified property svn:eol-style.
3229         * bindings/scripts/test/JS/JSTestSupplemental.cpp: Added property svn:eol-style.
3230         * bindings/scripts/test/JS/JSTestSupplemental.h: Added property svn:eol-style.
3231         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Added property svn:eol-style.
3232         * bindings/scripts/test/JS/JSTestTypedefs.h: Added property svn:eol-style.
3233         * bindings/scripts/test/JS/JSattribute.cpp: Added property svn:eol-style.
3234         * bindings/scripts/test/JS/JSattribute.h: Added property svn:eol-style.
3235         * bindings/scripts/test/JS/JSreadonly.cpp: Added property svn:eol-style.
3236         * bindings/scripts/test/JS/JSreadonly.h: Added property svn:eol-style.
3237
3238 2015-03-14  Darin Adler  <darin@apple.com>
3239
3240         More event handler improvements
3241         https://bugs.webkit.org/show_bug.cgi?id=142701
3242
3243         Reviewed by Anders Carlsson.
3244
3245         These are the improvements:
3246
3247         - Use EventHandler rather than EventListener as the the type for event handler
3248           attributes. This matches the HTML specification, and also makes sense, since
3249           EventListener means something else (and we use it to mean that!). Also renamed
3250           JSWindowEventListener to WindowEventHandler. Even though this only affects the
3251           JavaScript code generated, it's not really a JavaScript-specific flag.
3252
3253         - Tweak formatting on addEventListener/removeEventListener/dispatchEvent in
3254           all the IDL files where the appear. This includes changing the spelling from
3255           "evt" to "event". Some day we should fix this so these functions only need to
3256           appear in EventTarget.idl.
3257
3258         - Tweak formatting a bit on the IDL files we had to modify anyway.
3259
3260         - Use [Conditional] more often and #if less often in IDL files.
3261
3262         - Added a new [DocumentEventHandler] attribute for the selectionchange event.
3263           This involved adding new event handler attribute functions to JSEventListener.h
3264           for use by the JavaScript bindings.
3265
3266         - Removed a little unused code from the JavaScript code bindings generator.
3267
3268         - Improved the mechanism used by HTMLElement and SVGElement to share the list of
3269           content attributes that are event handlers so there is only one map rather than
3270           two. Made a similar mechanism so that HTMLBodyElement and HTMLFrameSetElement
3271           can share the list of window event handlers.
3272
3273         - Followed the HTML specification by putting all the event handler support in
3274           the HTMLElement class rather than having event handlers apply only a the
3275           particular element that uses those events. We already did this for most of
3276           our event handlers, but we are now doing it for all of them.
3277
3278         * Modules/battery/BatteryManager.idl: Use EventHandler instead of EventListener
3279         as appropriate. Also reformatted addEventListener/removeEventListener/dispatchEvent.
3280         * Modules/encryptedmedia/MediaKeySession.idl: Ditto.
3281         * Modules/indexeddb/IDBDatabase.idl: Ditto.
3282         * Modules/indexeddb/IDBOpenDBRequest.idl: Ditto.
3283         * Modules/indexeddb/IDBRequest.idl: Ditto.
3284         * Modules/indexeddb/IDBTransaction.idl: Ditto.
3285         * Modules/mediastream/MediaStream.idl: Ditto.
3286         * Modules/mediastream/MediaStreamTrack.idl: Ditto.
3287         * Modules/mediastream/RTCDTMFSender.idl: Ditto.
3288         * Modules/mediastream/RTCDataChannel.idl: Ditto.
3289         * Modules/mediastream/RTCPeerConnection.idl: Ditto.
3290         * Modules/speech/SpeechSynthesisUtterance.idl: Ditto.
3291         * Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
3292         * Modules/webaudio/AudioContext.idl: Ditto.
3293         * Modules/webaudio/OscillatorNode.idl: Ditto.
3294         * Modules/webaudio/ScriptProcessorNode.idl: Ditto.
3295         * Modules/websockets/WebSocket.idl: Ditto.
3296         * css/FontLoader.idl: Ditto.
3297         * dom/EventListener.idl: Ditto.
3298         * dom/EventTarget.idl: Ditto.
3299         * dom/MessagePort.idl: Ditto.
3300         * dom/Node.idl: Ditto.
3301         * dom/WebKitNamedFlow.idl: Ditto.
3302         * fileapi/FileReader.idl: Ditto.
3303         * html/MediaController.idl: Ditto.
3304         * html/track/AudioTrackList.idl: Ditto.
3305         * html/track/TextTrackCue.idl: Ditto.
3306         * html/track/TextTrackList.idl: Ditto.
3307         * html/track/VideoTrackList.idl: Ditto.
3308         * loader/appcache/DOMApplicationCache.idl: Ditto.
3309         * page/EventSource.idl: Ditto.
3310         * page/Performance.idl: Ditto.
3311         * workers/AbstractWorker.idl: Ditto.
3312         * workers/DedicatedWorkerGlobalScope.idl: Ditto.
3313         * workers/Worker.idl: Ditto.
3314         * workers/WorkerGlobalScope.idl: Ditto.
3315         * xml/XMLHttpRequest.idl: Ditto.
3316         * xml/XMLHttpRequestUpload.idl: Ditto.
3317
3318         * Modules/notifications/Notification.idl: Did the above, but also used
3319         [Conditional] instead of #if throughout.
3320         * html/track/TextTrack.idl: Ditto.
3321
3322         * Modules/webaudio/AudioNode.idl: Tweaked paragraphing of this file.
3323
3324         * bindings/js/JSEventListener.cpp:
3325         (WebCore::windowEventHandlerAttribute): Renamed to take the word "forwarded"
3326         out of this. More closely matches the terminology used in IDL files and the
3327         HTML specification.
3328         (WebCore::setWindowEventHandlerAttribute): Ditto.
3329         (WebCore::documentEventHandlerAttribute): Added.
3330         (WebCore::setDocumentEventHandlerAttribute): Added.
3331         * bindings/js/JSEventListener.h: Updated for above changes.
3332
3333         * bindings/objc/PublicDOMInterfaces.h: Renamed argument from "evt" to "event".
3334
3335         * bindings/scripts/CodeGeneratorGObject.pm:
3336         (SkipAttribute): Skip attributes of type "EventHandler" rather than attributes
3337         of type "EventListener".
3338         * bindings/scripts/CodeGeneratorObjC.pm:
3339         (SkipAttribute): Ditto.
3340
3341         * bindings/scripts/CodeGeneratorJS.pm:
3342         (GenerateImplementation): Look for the type EventHandler instead of the type
3343         EventListener for event handler attributes. Also added code to handle the new
3344         DocumentEventHandler, and use the name WindowEventHandler instead of the name
3345         JSWindowEventListener. Removed unneeded preflight check to see if we have
3346         writable attributes; it was not doing us any good. (That caused a lot of code
3347         to be un-indented and makes the diff hard to read.)
3348
3349         * bindings/scripts/IDLAttributes.txt: Removed JSWindowEventListener, and added
3350         WindowEventHandler and DocumentEventHandler.
3351
3352         * bindings/scripts/test/TestObj.idl: Use the type EventHandler instead of the
3353         type EventListener. The test output is unchanged, though.
3354
3355         * dom/Document.idl: Got rid of the conditionals and merged all the event handler
3356         attributes into a single sorted, unconditional list. Added some that were missing,
3357         as detected by the event-handler-attributes.html test.
3358
3359         * dom/Element.idl: Ditto. This includes moving attributes here that were formerly
3360         only in certain element classes. Note that the script event handler attribute
3361         support is still here, even though it should be in HTMLElement and SVGElement
3362         instead. There's a FIXME about that, but no real urgency in fixing it.
3363
3364         * html/HTMLAttributeNames.in: Added onmessage. Previously, the support for this
3365         was from the script attribute only, not the content attribute.
3366
3367         * html/HTMLBodyElement.cpp:
3368         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap): Added. This
3369         contains the list of all the window event handlers that can be set on a body
3370         or frameset element and which are triggered by events on the window.
3371         (WebCore::HTMLBodyElement::eventNameForWindowEventHandlerAttribute): Added.
3372         This is the function to call to use the map above. Given an attribute, it
3373         returns either null if it is not a window event handler attribute, or the
3374         event type if it is one.
3375         (WebCore::HTMLBodyElement::parseAttribute): Updated to use the new
3376         functions above. Handling of these attributes is now unconditional, but
3377         also we don't have to keep the nested if statements here up to date, just
3378         the list of event handler attributes names in the map create function above.
3379
3380         * html/HTMLBodyElement.h: Added public eventNameForWindowEventHandlerAttribute
3381         and private createWindowEventHandlerNameMap functions.
3382
3383         * html/HTMLBodyElement.idl: Updated to use WindowEventHandler, DocumentEventHandler,
3384         and EventHandler. Also made everything unconditional. Also filled out the list here
3385         to match the list handled as content attributes. All covered by the test.
3386
3387         * html/HTMLElement.cpp:
3388         (WebCore::HTMLElement::createEventHandlerNameMap): Added. Replaces the old
3389         populate function. Changed the list of event handler attributes to be a bit more
3390         complete, and to be entirely unconditional. Also refactored this function to use
3391         a new populateEventHandlerNameMap helper, shared with HTMLBodyElement.
3392         (WebCore::HTMLElement::populateEventHandlerNameMap): Added. Factors out the code
3393         that both this class and HTMLBodyElement use to build event handler name maps.
3394         (WebCore::HTMLElement::eventNameForEventHandlerAttribute): Added. This is the
3395         function that call to use the map above. Given an attribute it returns either
3396         null if it is not an event handler attribute, or the event type if it is one.
3397         This is actually two functions. One is a protected function for use by both this
3398         class and HTMLBodyElement so they can share things like the optimization to look
3399         for the "on" prefix. The other is the public function that we actually use in
3400         HTMLElement and SVGElement.
3401         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Tweaked and refactored
3402         to use lineageOfType. Would have been even simpler if this took an element instead
3403         of a node. Unrelated to the event handler changes.
3404         (WebCore::HTMLElement::parseAttribute): Removed long-obsolete code that decided
3405         whether to call through to the base class. The base class function is empty and
3406         never needs to be called, and in any case there is no value in doing work to
3407         decide whether to call through to an empty function. Changed the style of the
3408         function to use early return instead of else. Worth considering whether we want
3409         to return early or call through to base class in this family of functions. It's
3410         more efficient to return early, but doesn't work well if both the derived class
3411         and base class want to respond to changes to the same attribute. The new logic
3412         for event handler attributes is more straightforward than the old, since the
3413         eventNameForEventHandlerAttribute has the logic.
3414         (WebCore::HTMLElement::textToFragment): Tweaked and refactored a bit, and also
3415         changed to return a Ref since this never fails and needs to return null.
3416
3417         * html/HTMLElement.h: Updated for above changes. This includes a template version
3418         of populateEventHandlerNameMap that extracts the array size at compile time and
3419         passes it to the non-template function that does the work.
3420
3421         * html/HTMLFrameElementBase.cpp:
3422         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code to handle
3423         event handler attributes handled by HTMLElement.
3424         * html/HTMLImageElement.cpp:
3425         (WebCore::HTMLImageElement::parseAttribute): Ditto.
3426         * html/HTMLLinkElement.cpp:
3427         (WebCore::HTMLLinkElement::parseAttribute): Ditto.
3428         * html/HTMLObjectElement.cpp:
3429         (WebCore::HTMLObjectElement::parseAttribute): Ditto.
3430         * html/HTMLScriptElement.cpp:
3431         (WebCore::HTMLScriptElement::parseAttribute): Ditto.
3432
3433         * html/HTMLFrameSetElement.cpp:
3434         (WebCore::HTMLFrameSetElement::parseAttribute): Changed function to early return
3435         style, and added FIXMEs about the many problems in the attribute handling code.
3436         Replaced all the code to handle window event handlers with a new bit of code that
3437         calls HTMLBodyElement::eventNameForWindowEventHandlerAttribute.
3438
3439         * html/HTMLFrameSetElement.idl: Changed to match the list of window event handlers
3440         in HTMLBodyElement.idl, although I did not add the document event handler here.
3441         As in the various other cases, having some extra event handlers does not seem to
3442         do harm and this is covered by the event-handler-attributes.html test.
3443
3444         * html/HTMLMarqueeElement.idl: Renamed EventListener to EventHandler in comment.
3445
3446         * page/DOMWindow.idl: As with Element and Document, removed conditionals, and
3447         filled out the list of event handlers so all the tests in
3448         event-handler-attributes.html will pass.
3449
3450         * svg/SVGElement.cpp:
3451         (WebCore::SVGElement::parseAttribute): Changed code to the early return style,
3452         and replaced the event handler attribute code with new much simpler code that
3453         uses the new HTMLElement::eventNameForEventHandlerAttribute. Also changed the
3454         way we call through to base classes. Just call through to the
3455         SVGLangSpace::parseAttribute function unconditionally, and don't try to use
3456         early return style to arbitrate among base classes. We should make this
3457         simplification throughout the SVG code; there's no need for the complexity
3458         that was there before just to cut down slightly on calls through to base
3459         class parseAttribute functions.
3460
3461         * svg/SVGSVGElement.cpp:
3462         (WebCore::SVGSVGElement::parseAttribute): Changed some of this code to the
3463         early return style and corrected some comments about the window event handler
3464         attributes here. These could use some further testing and might later need to be
3465         properly supported when the attributes are set in script, not just in content.
3466
3467         * svg/SVGScriptElement.cpp:
3468         (WebCore::SVGScriptElement::isSupportedAttribute): Deleted.
3469         (WebCore::SVGScriptElement::parseAttribute): Changed this function to use the
3470         early return style and also to call through to all three base classes. This is
3471         a pattern we should follow elsewhere in SVG to simplify the code. There is no
3472         need for the supportedAttributes sets like the one in this calass, and the code
3473         is unnecessarily complex, perhaps in an attempt to optimize performance. I'm
3474         pretty sure the old code was slower than this new code will be. No need for the
3475         extra hash table lookup every time. Also removed handling of event handler
3476         attribute which is taken care of by SVGElement now.
3477         (WebCore::SVGScriptElement::svgAttributeChanged): Made similar changes for
3478         the same reason as in parseAttribute. This function really needs a new name:
3479         It's the same as parseAttribute, except it's also used when implementing
3480         changes due to SVG animation.
3481
3482         * svg/SVGScriptElement.h: Removed isSupportedAttribute.
3483
3484 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
3485
3486         Clean up use of flags in localToContainer-type functions
3487         https://bugs.webkit.org/show_bug.cgi?id=142704
3488
3489         Reviewed by Alexey Proskuryakov.
3490         
3491         RenderObject::localToContainerQuad() had the questionable behavior of always
3492         enforcing UseTransforms in the flags. However, a future patch will need to call
3493         localToContainerQuad() without this flag.
3494         
3495         Fix by requiring callers of localToAbsoluteQuad(), localToContainerQuad(), localToContainerPoint(),
3496         and absoluteToLocalQuad() to pass the UseTransforms flag in, providing it as a default argument.
3497         
3498         The default value of the MapCoordinatesFlags parameter to mapLocalToContainer(),
3499         a lower-level function, is removed.
3500         
3501         Sprinkle a few more nullptrs around.
3502         
3503         No behavior change.
3504
3505         * rendering/RenderBlock.cpp:
3506         (WebCore::RenderBlock::selectionGapRectsForRepaint): call the higher-level localToContainerPoint()
3507         instead of mapLocalToContainer().
3508         (WebCore::RenderBlock::absoluteQuads): Pass UseTransforms.
3509         * rendering/RenderBox.cpp:
3510         (WebCore::RenderBox::absoluteQuads): Ditto.
3511         * rendering/RenderBox.h:
3512         * rendering/RenderFlowThread.h:
3513         * rendering/RenderGeometryMap.h:
3514         (WebCore::RenderGeometryMap::absolutePoint):
3515         (WebCore::RenderGeometryMap::absoluteRect):
3516         * rendering/RenderImage.cpp:
3517         (WebCore::RenderImage::collectSelectionRects): This function was erroneously passing
3518         'false' as flags. Pass UseTransforms instead (but no behavior change since
3519         UseTransforms was forced on lower down).
3520         * rendering/RenderInline.h:
3521         * rendering/RenderLayer.cpp:
3522         (WebCore::RenderLayer::scrollRectToVisible): UseTransforms is the parameter default, remove it.
3523         * rendering/RenderLineBreak.cpp:
3524         (WebCore::RenderLineBreak::absoluteQuads):
3525         (WebCore::RenderLineBreak::collectSelectionRects): Another erroneous 'false'.
3526         * rendering/RenderNamedFlowFragment.cpp:
3527         (WebCore::RenderNamedFlowFragment::absoluteQuadsForBoxInRegion):
3528         * rendering/RenderObject.cpp:
3529         (WebCore::RenderObject::localToContainerQuad): Here's where we no longer force
3530         the UseTransforms bit.
3531         (WebCore::RenderObject::localToContainerPoint): Also here.
3532         * rendering/RenderObject.h: I prefer bit flags lined up. Makes it easier to spot errors.
3533         (WebCore::RenderObject::localToAbsoluteQuad):
3534         * rendering/RenderText.cpp:
3535         (WebCore::RenderText::collectSelectionRects): Another bad 'false'.
3536         * rendering/RenderTextLineBoxes.cpp:
3537         (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
3538         (WebCore::RenderTextLineBoxes::absoluteQuads):
3539         (WebCore::RenderTextLineBoxes::absoluteQuadsForRange):
3540         * rendering/RenderView.h:
3541         * rendering/SimpleLineLayoutFunctions.cpp:
3542         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
3543         * rendering/svg/RenderSVGForeignObject.h:
3544         * rendering/svg/RenderSVGInline.cpp:
3545         (WebCore::RenderSVGInline::absoluteQuads): Another bad 'false'.
3546         * rendering/svg/RenderSVGInline.h:
3547         * rendering/svg/RenderSVGModelObject.cpp:
3548         (WebCore::RenderSVGModelObject::absoluteQuads):
3549         * rendering/svg/RenderSVGModelObject.h:
3550         * rendering/svg/RenderSVGRoot.h:
3551         * rendering/svg/RenderSVGText.cpp:
3552         (WebCore::RenderSVGText::absoluteQuads):
3553         * rendering/svg/RenderSVGText.h:
3554         * rendering/svg/SVGRenderSupport.h:
3555
3556 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
3557
3558         [iOS] scroll snap points are animating to the wrong positions...
3559         https://bugs.webkit.org/show_bug.cgi?id=142705
3560         <rdar://problem/20136946>
3561
3562         Reviewed by Simon Fraser.
3563
3564         Avoid adding an extra '0' snap point to our set. We always start with one zero; this
3565         extra append just forces us to do more steps in our search for nearest snap point.
3566
3567         * page/scrolling/AxisScrollSnapOffsets.cpp:
3568         (WebCore::updateFromStyle): Remove extra '0' appended to offsets.
3569
3570 2015-03-14  Dean Jackson  <dino@apple.com>
3571
3572         Feature flag for Animations Level 2
3573         https://bugs.webkit.org/show_bug.cgi?id=142699
3574         <rdar://problem/20165097>
3575
3576         Reviewed by Brent Fulgham.
3577
3578         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
3579
3580         * Configurations/FeatureDefines.xcconfig:
3581         * bindings/generic/RuntimeEnabledFeatures.cpp:
3582         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
3583         * bindings/generic/RuntimeEnabledFeatures.h:
3584         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled):
3585         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled):
3586
3587 2015-03-14  Adenilson Cavalcanti  <cavalcantii@gmail.com>
3588
3589         RenderBlock::imageChange() calling const methods on exit
3590         https://bugs.webkit.org/show_bug.cgi?id=142648
3591
3592         Reviewed by Brent Fulgham.
3593
3594         No new tests, no change on behavior.
3595
3596         * rendering/RenderBlock.cpp:
3597         (WebCore::RenderBlock::imageChanged): Deleted.
3598         * rendering/RenderBlock.h:
3599
3600 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3601
3602         [GStreamer] share GL context in pipeline
3603         https://bugs.webkit.org/show_bug.cgi?id=142693
3604
3605         Reviewed by Philippe Normand.
3606
3607         GstGL elements in a pipeline need to be aware of the application's
3608         display and its GL context. This information is shared through context
3609         messages between the pipeline and the browser.
3610
3611         This patch shares this context through a GStreamer's synchronous
3612         message, using the GL information held in the web process.
3613
3614         This patch is based on the work of Philippe Normand for Bug 138562.
3615
3616         No new tests because this is platform specific and it depends in the
3617         run-time availability and configurations of GstGL elements.
3618
3619         * PlatformGTK.cmake: appends the GstGL header files in the include
3620         directories. Also its library directory is appended.
3621         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3622         (WebCore::mediaPlayerPrivateSyncMessageCallback): New callback function.
3623         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
3624         Initialize the new class attributes.
3625         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): New method
3626         for handling synchronous messages from the pipeline. This method
3627         currently only handles the GL context sharing.
3628         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Configures
3629         the pipeline's bus to handle the synchronous messages.
3630         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add new
3631         class methods and attributes.
3632
3633 2015-03-13  Alex Christensen  <achristensen@webkit.org>
3634
3635         Progress towards CMake on Mac.
3636         https://bugs.webkit.org/show_bug.cgi?id=142680
3637
3638         Reviewed by Gyuyoung Kim.
3639
3640         * PlatformMac.cmake:
3641         Added new include directories and removed old source files.
3642
3643 2015-03-13  Commit Queue  <commit-queue@webkit.org>
3644
3645         Unreviewed, rolling out r181483.
3646         https://bugs.webkit.org/show_bug.cgi?id=142688
3647
3648         Caused use-after-free on many tests (Requested by ap on
3649         #webkit).
3650
3651         Reverted changeset:
3652
3653         "Allow clients to selectively disable plug-ins"
3654         https://bugs.webkit.org/show_bug.cgi?id=142506
3655         http://trac.webkit.org/changeset/181483
3656
3657 2015-03-13  Antti Koivisto  <antti@apple.com>
3658
3659         Cache glyph widths to GlyphPages
3660         https://bugs.webkit.org/show_bug.cgi?id=142028
3661
3662         Reviewed by Andreas Kling.
3663
3664         Currently we have a separate cache in Font for glyph widths. In practice we always need
3665         the widths so we can just cache them in GlyphPages. This simplifies the code and removes
3666         a per-character hash lookup from WidthIterator.
3667
3668         * platform/graphics/Font.cpp:
3669         (WebCore::Font::Font):
3670         (WebCore::Font::initCharWidths):
3671         (WebCore::Font::platformGlyphInit):
3672         (WebCore::createAndFillGlyphPage):
3673         (WebCore::Font::computeWidthForGlyph):
3674
3675             Rename to make it clear this doesn't cache.
3676
3677         (WebCore::GlyphPage::setGlyphDataForIndex):
3678
3679             Initialize the width.
3680             This could go to GlyphPage.cpp if we had one.
3681
3682         * platform/graphics/Font.h:
3683         (WebCore::Font::glyphZeroWidth):
3684         (WebCore::Font::isZeroWidthSpaceGlyph):
3685         (WebCore::Font::zeroGlyph): Deleted.
3686         (WebCore::Font::setZeroGlyph): Deleted.
3687         (WebCore::Font::widthForGlyph): Deleted.
3688         * platform/graphics/FontCascade.cpp:
3689         (WebCore::offsetToMiddleOfGlyph):
3690         * platform/graphics/FontCascadeFonts.cpp:
3691         (WebCore::FontCascadeFonts::glyphDataForCharacter):
3692         * platform/graphics/GlyphPage.h:
3693         (WebCore::GlyphData::GlyphData):
3694
3695             Return width too as part of GlyphData.
3696
3697         (WebCore::GlyphPage::glyphDataForIndex):
3698         (WebCore::GlyphPage::setGlyphDataForCharacter):
3699         (WebCore::GlyphPage::setGlyphDataForIndex):
3700         (WebCore::GlyphPage::GlyphPage):
3701         * platform/graphics/WidthIterator.cpp:
3702         (WebCore::WidthIterator::advanceInternal):
3703
3704             No need to lookup width separately now.
3705
3706         * platform/graphics/mac/ComplexTextController.cpp:
3707         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
3708         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3709         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
3710         * rendering/mathml/RenderMathMLOperator.cpp:
3711         (WebCore::RenderMathMLOperator::advanceForGlyph):
3712         * rendering/svg/SVGTextRunRenderingContext.cpp:
3713         (WebCore::missingGlyphForFont):
3714         * svg/SVGFontData.cpp:
3715         (WebCore::SVGFontData::initializeFont):
3716
3717 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
3718
3719         [Mac] Enable WIRELESS_PLAYBACK_TARGET
3720         https://bugs.webkit.org/show_bug.cgi?id=142635
3721
3722         Reviewed by Darin Adler.
3723
3724         * Configurations/FeatureDefines.xcconfig:
3725
3726 2015-03-13  Jeremy Jones  <jeremyj@apple.com>
3727
3728         Fix typo restoreUserInterfaceForOptimizedFullscreeStopWithCompletionHandler.
3729         https://bugs.webkit.org/show_bug.cgi?id=142678
3730
3731         Reviewed by Eric Carlson.
3732
3733         Add the missing 'n' in "fullscreen".
3734
3735         * platform/spi/ios/AVKitSPI.h:
3736
3737 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
3738
3739         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
3740         https://bugs.webkit.org/show_bug.cgi?id=142664
3741         <rdar://problem/18859470>
3742
3743         Reviewed by Benjamin Poulain.
3744
3745         * page/ViewportConfiguration.cpp:
3746         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints):
3747         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
3748         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
3749         Split shouldIgnoreScalingConstraints into one for each dimension.
3750
3751         (WebCore::ViewportConfiguration::initialScale):
3752         (WebCore::ViewportConfiguration::minimumScale):
3753         Don't force the initial and minimum scales to cover the whole view if the
3754         page claims to want to lay out to device width but then lays out too big.
3755         This will allow pages that misbehave in this way to scale down further
3756         than they previously could, but will result in a region of empty background
3757         color being exposed at the initial/minimum scale.
3758
3759         (WebCore::ViewportConfiguration::description):
3760         Update the logging to show each dimension separately.
3761
3762         * page/ViewportConfiguration.h:
3763
3764 2015-03-13  Mark Lam  <mark.lam@apple.com>
3765
3766         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
3767         <https://webkit.org/b/142674>
3768
3769         Reviewed by Filip Pizlo.
3770
3771         No new tests because there is no new functionality. This is a refactoring effort.
3772
3773         * bindings/objc/WebScriptObject.mm:
3774         * platform/ios/wak/WAKWindow.mm:
3775         (-[WAKWindow initWithLayer:]):
3776         (-[WAKWindow initWithFrame:]):
3777
3778 2015-03-13  Doug Russell  <d_russell@apple.com>
3779
3780         AX: Provide API for assistive tech to ignore DOM key event handlers
3781         https://bugs.webkit.org/show_bug.cgi?id=142059
3782
3783         Reviewed by Beth Dakin.
3784
3785         Assistive technology applications on the desktop are heavily dependent on keyboard navigation being reliable. This is greatly hindered by sites that handle key events without updating keyboard selection and then consume the event. It is important for assistive technology apps to allow users to decide to ignore these handlers that are incorrect for their purposes.
3786
3787         This can be fixed by exposing, via a new accessibility attribute, a way to decide, for a given WebCore::Frame, to pre-empt DOM dispatch and instead let accessibility caret browsing take place.
3788
3789         Test: platform/mac/accessibility/prevent-keyboard-event-dispatch.html
3790
3791         * accessibility/AccessibilityObject.cpp:
3792         (WebCore::AccessibilityObject::preventKeyboardDOMEventDispatch):
3793         (WebCore::AccessibilityObject::setPreventKeyboardDOMEventDispatch):
3794         * accessibility/AccessibilityObject.h:
3795         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3796         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3797         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3798         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
3799         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3800         * dom/Element.cpp:
3801         (WebCore::Element::dispatchKeyEvent):
3802         * page/EventHandler.cpp:
3803         (WebCore::EventHandler::keyEvent):
3804         (WebCore::handleKeyboardSelectionMovement):
3805         (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
3806         * page/EventHandler.h:
3807         * page/Settings.in:
3808
3809 2015-03-09  Conrad Shultz  <conrad_shultz@apple.com>
3810
3811         Allow clients to selectively disable plug-ins
3812         https://bugs.webkit.org/show_bug.cgi?id=142506
3813
3814         Reviewed by Anders Carlsson.
3815
3816         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
3817         from the page). As part of this:
3818
3819         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
3820            set of plug-ins.
3821
3822         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
3823            down the stack.
3824
3825         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
3826            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
3827
3828         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
3829
3830         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
3831         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
3832
3833         * dom/DOMImplementation.cpp:
3834         (WebCore::DOMImplementation::createDocument):
3835         Update to reflect function rename.
3836
3837         * loader/SubframeLoader.cpp:
3838         (WebCore::findPluginMIMETypeFromURL):
3839         Adopt getWebVisibleMimesAndPluginIndices().
3840         (WebCore::logPluginRequest):
3841         Update to reflect function rename.
3842         (WebCore::SubframeLoader::shouldUsePlugin):
3843         Ditto.
3844
3845         * platform/PlatformStrategies.h:
3846         Export platformStrategies(), since it is now used in WebProcess.cpp.
3847
3848         * plugins/DOMMimeType.cpp:
3849         (WebCore::DOMMimeType::type):
3850         (WebCore::DOMMimeType::description):
3851         (WebCore::DOMMimeType::mimeClassInfo):
3852         Adopt getWebVisibleMimesAndPluginIndices().
3853         (WebCore::DOMMimeType::enabledPlugin):
3854         Ditto.
3855
3856         * plugins/DOMMimeType.h:
3857         Don't return references in a few places where it is no longer safe to do so.
3858         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
3859
3860         * plugins/DOMMimeTypeArray.cpp:
3861         (WebCore::DOMMimeTypeArray::length):
3862         Adopt getWebVisibleMimesAndPluginIndices().
3863         (WebCore::DOMMimeTypeArray::item):
3864         Ditto.
3865         (WebCore::DOMMimeTypeArray::canGetItemsForName):
3866         Ditto.
3867         (WebCore::DOMMimeTypeArray::namedItem):
3868         Ditto.
3869
3870         * plugins/DOMPlugin.cpp:
3871         (WebCore::DOMPlugin::pluginInfo):
3872         Adopt getWebVisiblePlugins().
3873         (WebCore::DOMPlugin::item):
3874         Adopt getWebVisibleMimesAndPluginIndices().
3875         (WebCore::DOMPlugin::canGetItemsForName):
3876         Ditto.
3877         (WebCore::DOMPlugin::namedItem):
3878         Ditto.
3879
3880         * plugins/DOMPlugin.h:
3881         (WebCore::DOMPlugin::pluginInfo): Deleted.
3882
3883         * plugins/DOMPluginArray.cpp:
3884         (WebCore::DOMPluginArray::length):
3885         Adopt getWebVisiblePlugins().
3886         (WebCore::DOMPluginArray::item):
3887         Ditto.
3888         (WebCore::DOMPluginArray::canGetItemsForName):
3889         Ditto.
3890         (WebCore::DOMPluginArray::namedItem):
3891         Ditto.
3892
3893         * plugins/PluginData.cpp:
3894         (WebCore::PluginData::PluginData):
3895         Stash the passed-in Page and call initPlugins().
3896         (WebCore::PluginData::getWebVisiblePlugins):
3897         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
3898         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
3899         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
3900         limited to the web-visible plug-ins.
3901         (WebCore::PluginData::supportsWebVisibleMimeType):
3902         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
3903         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
3904         Renamed from pluginInfoForMimeType(); ditto.
3905         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
3906         Renamed from pluginNameForMimeType(); ditto.
3907         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
3908         Renamed from pluginFileForMimeType(); ditto.
3909         (WebCore::PluginData::initPlugins):
3910         (WebCore::PluginData::supportsMimeType): Deleted.
3911         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
3912         (WebCore::PluginData::pluginNameForMimeType): Deleted.
3913         (WebCore::PluginData::pluginFileForMimeType): Deleted.
3914
3915         * plugins/PluginData.h:
3916         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
3917         new members to PluginInfo for the clientLoadPolicy and bundle information.
3918         (WebCore::PluginData::PluginData):
3919         Replace some member functions with new ones that will hide plug-ins upon request from the client;
3920         (WebCore::PluginData::mimes): Deleted.
3921         (WebCore::PluginData::mimePluginIndices): Deleted.
3922
3923         * plugins/PluginStrategy.h:
3924         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
3925
3926         * replay/SerializationMethods.cpp:
3927         (JSC::EncodingTraits<PluginData>::encodeValue):
3928         Remove now-obsolete code for handling MIME types and add a FIXME.
3929         (JSC::DeserializedPluginData::DeserializedPluginData):
3930         (JSC::EncodingTraits<PluginData>::decodeValue):
3931         Ditto.
3932         (JSC::EncodingTraits<PluginInfo>::encodeValue):
3933         Handle the new members in PluginInfo.