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