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