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