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