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