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