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