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