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