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