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