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