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