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