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