0df696191464689ca2434434b24d8c0afd0ad2d8
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-07  Benjamin Poulain  <benjamin@webkit.org>
2
3         Get the features.json files ready for open contributions
4         https://bugs.webkit.org/show_bug.cgi?id=143436
5
6         Reviewed by Darin Adler.
7
8         * features.json:
9
10 2015-04-07  Alex Christensen  <achristensen@webkit.org>
11
12         More unreviewed fixing API tests.
13
14         * contentextensions/ContentExtensionsBackend.cpp:
15         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
16         Don't check for javascript protocol.
17
18 2015-04-07  Eric Carlson  <eric.carlson@apple.com>
19
20         [Mac] never update caption user style sheet during parsing
21         https://bugs.webkit.org/show_bug.cgi?id=143499
22
23         Reviewed by Jer Noble.
24
25         * page/CaptionUserPreferencesMediaAF.cpp:
26         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
27         (WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged):  Ignore a
28             "preferences changed" notification fired while registering for said notification, we 
29             already create and insert the style sheet after a brief delay anyway.
30         * page/CaptionUserPreferencesMediaAF.h:
31
32 2015-04-07  Alex Christensen  <achristensen@webkit.org>
33
34         [Win] Unreviewed build fix after r182494.
35
36         * platform/win/ContextMenuItemWin.cpp:
37         (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
38
39 2015-04-07  Alex Christensen  <achristensen@webkit.org>
40
41         Unreviewed fixing API tests.
42
43         * contentextensions/ContentExtensionsBackend.cpp:
44         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
45         * platform/URL.cpp:
46         (WebCore::URL::init):
47         * platform/URL.h:
48         (WebCore::URL::protocolIsData):
49         (WebCore::URL::protocolIsJavaScript): Deleted.
50         Revert part of r182492 that changed URL.h.
51
52 2015-04-07  Anders Carlsson  <andersca@apple.com>
53
54         More work on making the application cache storage be per page
55         https://bugs.webkit.org/show_bug.cgi?id=143498
56
57         Reviewed by Andreas Kling.
58
59         * loader/appcache/ApplicationCacheStorage.cpp:
60         (WebCore::ApplicationCacheStorage::create):
61         (WebCore::ApplicationCacheStorage::singleton):
62         * loader/appcache/ApplicationCacheStorage.h:
63         * page/Page.cpp:
64         (WebCore::Page::Page):
65         * page/Page.h:
66         (WebCore::Page::applicationCacheStorage):
67         * page/PageConfiguration.cpp:
68         (WebCore::PageConfiguration::PageConfiguration): Deleted.
69         * page/PageConfiguration.h:
70
71 2015-04-07  Matthew Mirman  <mmirman@apple.com>
72
73         Source and stack information should get appended only to native errors
74         and should be added directly after construction rather than when thrown.
75         This fixes frozen objects being unfrozen when thrown while conforming to 
76         ecma script standard and other browser behavior.
77         rdar://problem/19927293
78         https://bugs.webkit.org/show_bug.cgi?id=141871
79         
80         Reviewed by Geoffrey Garen.
81
82         Covered by existing tests.
83         
84         Sets line, column, source and stack information for DOMExceptions as 
85         expected by the webinspector for native errors.
86         
87         * bindings/js/JSDOMBinding.cpp:
88         (WebCore::setDOMException):
89
90 2015-04-07  Brady Eidson  <beidson@apple.com>
91
92         ContextMenuItem refactoring
93         https://bugs.webkit.org/show_bug.cgi?id=143485
94
95         Reviewed by Beth Dakin.
96
97         * platform/ContextMenuItem.h:
98         (WebCore::ContextMenuItem::isNull):
99
100         * platform/gtk/ContextMenuItemGtk.cpp:
101         (WebCore::ContextMenuItem::ContextMenuItem):
102
103         * platform/mac/ContextMenuItemMac.mm:
104         (WebCore::ContextMenuItem::ContextMenuItem):
105         (WebCore::ContextMenuItem::platformDescription):
106         (WebCore::ContextMenuItem::setSubMenu):
107         (WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
108         (WebCore::ContextMenuItem::getPlatformDescription): Deleted.
109
110         * platform/mac/ContextMenuMac.mm:
111         (WebCore::ContextMenu::appendItem):
112         (WebCore::ContextMenu::insertItem):
113         (WebCore::platformMenuDescription):
114
115         * platform/win/ContextMenuItemWin.cpp:
116         (WebCore::ContextMenuItem::ContextMenuItem):
117
118 2015-04-07  Alex Christensen  <achristensen@webkit.org>
119
120         Optimize content extensions interpreting speed.
121         https://bugs.webkit.org/show_bug.cgi?id=143490
122
123         Reviewed by Brady Eidson.
124
125         * contentextensions/ContentExtensionCompiler.cpp:
126         (WebCore::ContentExtensions::compileRuleList):
127         * contentextensions/ContentExtensionsBackend.cpp:
128         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
129         Measure total time added by content extensions.
130         * contentextensions/DFABytecodeCompiler.cpp:
131         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
132         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
133         When jumping to the root, don't re-add all the actions.
134         * contentextensions/DFABytecodeCompiler.h:
135         * platform/URL.cpp:
136         (WebCore::URL::init):
137         * platform/URL.h:
138         (WebCore::URL::protocolIsJavaScript): Added.
139
140 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
141
142         Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
143         https://bugs.webkit.org/show_bug.cgi?id=143495
144
145         Reviewed by Tim Horton.
146
147         Add a new Setting, antialiasedFontDilationEnabled, which defaults to true. This 
148         will be used in an upcoming patch.
149
150         * page/Settings.in:
151
152 2015-04-07  Andy Estes  <aestes@apple.com>
153
154         [Content Filtering] Add logging
155         https://bugs.webkit.org/show_bug.cgi?id=143470
156
157         Reviewed by Daniel Bates.
158
159         Added a new ContentFiltering logging channel, and started logging some useful diagnostic messages.
160
161         * loader/ContentFilter.cpp:
162         (WebCore::ContentFilter::~ContentFilter):
163         (WebCore::ContentFilter::willSendRequest):
164         (WebCore::ContentFilter::startFilteringMainResource):
165         (WebCore::ContentFilter::responseReceived):
166         (WebCore::ContentFilter::dataReceived):
167         (WebCore::ContentFilter::notifyFinished):
168         (WebCore::ContentFilter::didDecide):
169         * platform/Logging.h:
170         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
171         (WebCore::ContentFilterUnblockHandler::canHandleRequest):
172         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
173         * platform/cocoa/NetworkExtensionContentFilter.mm:
174         (WebCore::NetworkExtensionContentFilter::enabled):
175         (WebCore::NetworkExtensionContentFilter::unblockHandler):
176         (WebCore::NetworkExtensionContentFilter::handleDecision):
177         * platform/cocoa/ParentalControlsContentFilter.mm:
178         (WebCore::ParentalControlsContentFilter::enabled):
179         (WebCore::ParentalControlsContentFilter::updateFilterState):
180         * testing/MockContentFilter.cpp:
181         (WebCore::MockContentFilter::enabled):
182         (WebCore::MockContentFilter::unblockHandler):
183         (WebCore::MockContentFilter::maybeDetermineStatus):
184
185 2015-04-07  Eric Carlson  <eric.carlson@apple.com>
186
187         [Mac] video playing to external device should not be interrupted
188         https://bugs.webkit.org/show_bug.cgi?id=143492
189
190         Reviewed by Jer Noble.
191
192         * Modules/mediacontrols/mediaControlsApple.js:
193         (Controller.prototype.handlePanelTransitionEnd):  Drive-by fix to make sure the controls are 
194             not hidden if the opacity timer is primed before they go into a state where they should
195             never be hidden.
196
197         * html/HTMLMediaElement.cpp:
198         (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Make it const.
199         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): New.
200         * html/HTMLMediaElement.h:
201
202         * html/HTMLMediaSession.cpp:
203         (WebCore::HTMLMediaSession::canPlayToWirelessPlaybackTarget): New. Short-circuit call to
204             client when we already know the answer.
205         (WebCore::HTMLMediaSession::isPlayingToWirelessPlaybackTarget): Ditto.
206         (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Ditto.
207         (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Ditto.
208         * html/HTMLMediaSession.h:
209
210         * platform/audio/MediaSession.cpp:
211         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): Deleted, moved inline and neutered
212             because only HTMLMediaSession needs to use them.
213         (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
214         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
215         * platform/audio/MediaSession.h:
216         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget):
217         (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
218         (WebCore::MediaSession::startPlayingToPlaybackTarget):
219         (WebCore::MediaSession::stopPlayingToPlaybackTarget):
220         (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
221         (WebCore::MediaSessionClient::isPlayingToWirelessPlaybackTarget):
222
223         * platform/audio/MediaSessionManager.cpp:
224         (WebCore::MediaSessionManager::MediaSessionManager):
225         (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): New.
226         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Don't interrupt an active session
227             playing to a target device.
228         * platform/audio/MediaSessionManager.h:
229
230         * platform/graphics/MediaPlayer.cpp:
231         (WebCore::MediaPlayer::isPlayingToWirelessPlaybackTarget): New, passthrough.
232         * platform/graphics/MediaPlayer.h:
233         * platform/graphics/MediaPlayerPrivate.h:
234         (WebCore::MediaPlayerPrivateInterface::isPlayingToWirelessPlaybackTarget):
235
236         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
237         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
238         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
239         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Explicitly call 
240             when passed a nil or inactive target context.
241         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Add logging.
242         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Ditto.
243         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): New. Return
244             true when playing with an active context.
245         (WebCore::playerKVOProperties): "outputContext" is not observable.
246
247 2015-04-07  Sam Weinig  <sam@webkit.org>
248
249         Re-add JSReadableStream and JSReadableStreamReader the Xcode project to
250         make Xcode happy.
251
252         * WebCore.xcodeproj/project.pbxproj:
253
254 2015-02-25  Sergio Villar Senin  <svillar@igalia.com>
255
256         [CSS Grid Layout] Update track sizes after distributing extra space
257         https://bugs.webkit.org/show_bug.cgi?id=141422
258
259         Reviewed by Antti Koivisto.
260
261         Both old and new tracks sizing algorithms instruct us to update
262         the sizes of the content sized tracks only after distributing the
263         extra space for all the items in the same span group. So far we
264         were doing it inside distributeSpaceToTracks(), i.e., once for
265         every single item. That is wrong because it makes the algorithm
266         order dependent.
267
268         Our old implementation looked something like this (pseudocode):
269
270         resolveContentBasedTrackSizingFunctions()
271           foreach item
272             resolveContentBasedTrackSizingFunctionsForItems() (x4)
273               distributeSpaceToTracks()
274                 updateTrackSizes()
275
276         Now it's done this way (pseudocode):
277
278         resolveContentBasedTrackSizingFunctions()
279           foreach spanGroup
280             resolveContentBasedTrackSizingFunctionsForItems() (x4)
281               foreach item in spanGroup
282                 distributeSpaceToTracks()
283               updateTrackSizes()
284
285         As it can be seen the update of track sizes only happens after
286         processing all the items of a given span group. In order to
287         accomplish this a new field was added to GridTrack called
288         tempIncrease which stores per-track increases while distributing
289         the extra space among the items in the same span group. That
290         temporal increase could eventually be used to update the
291         plannedIncrease which is the one we use to finally set the new
292         size of the track.
293
294         This change makes our implementation closer to the spec, removes
295         the order dependency and ensures that every track satisfies their
296         min track sizing functions before starting to consider the max
297         track sizing functions.
298
299         Test: fast/css-grid-layout/grid-update-sizes-after-distributing-all.html
300
301         * rendering/RenderGrid.cpp:
302         (WebCore::GridTrack::plannedSize):
303         (WebCore::GridTrack::setPlannedSize): New setter.
304         (WebCore::GridTrack::tempSize): New attribute.
305         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
306         RenderGrid::distributeSpaceToTracks() no longer updates the track
307         sizes so we have to do it after the call returns.
308         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
309         Call RenderGrid::resolveContentBasedTrackSizingFunctionsForItems()
310         passing a span group instead of a single item.
311         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
312         It now receives a span group instead of a single item. Apart from
313         that we need an extra function to get the unaltered track size (as
314         the current one returns the base size whenever the growth limit is
315         infinity).
316         (WebCore::RenderGrid::distributeSpaceToTracks): This no longer
317         updates track sizes but only the track's planned size;
318         * rendering/RenderGrid.h:
319
320 2015-04-06  Chris Dumez  <cdumez@apple.com>
321
322         Bing video search result pages are not PageCacheable
323         https://bugs.webkit.org/show_bug.cgi?id=143463
324         <rdar://problem/20440916>
325
326         Reviewed by Alexey Proskuryakov.
327
328         Bing video search result pages are not PageCacheable (tested on iOS).
329         It both:
330         - is bad for power usage as it causes a reload when clicking one of the
331           results then navigating back in history.
332         - degrades user experience because the results page uses infinite
333           scrolling and the scroll position is not properly restored when
334           navigating back, not to mention the user has to wait for the reload
335           to complete.
336
337         The issue was that the bing search page was doing a ping load when
338         clicking on one of the search results. The ping load was done by
339         create an image and its 'src' attribute to the ping URL. This load
340         usually did not have time to complete when navigating away so we would
341         cancel it and the main document would end up with an error that would
342         prevent the page from entering the page cache. We already have code
343         making sure load cancellations do not prevent page caching as long as
344         the loads are for XHR or images. However, the latter check was broken
345         in the case where the ResourceRequest's cachePartition was non-empty.
346         This is because the check was using the MemoryCache::ResourceForUrl()
347         API which rarely does what we want because it will request a dummy
348         ResourceRequest (without cachePartition) and then call
349         MemoryCache::resourceForRequest(). This patch updates the check
350         to use resourceForRequest() directly as we have the ResourceRequest
351         at this point.
352
353         This patch also gets rid of the  MemoryCache::ResourceForUrl() API as
354         it rarely does what we want and it is bug prone. It was only used in
355         2 places, one of them causing this bug and the other in Internals.
356
357         Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
358                http/tests/navigation/page-cache-pending-image-load.html
359
360         * loader/DocumentLoader.cpp:
361         (WebCore::areAllLoadersPageCacheAcceptable):
362         Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
363         we have the ResourceRequest and calling resourceForUrl() would loose
364         the cachePartition.
365
366         * loader/cache/MemoryCache.cpp:
367         (WebCore::MemoryCache::resourceForURL): Deleted.
368         Drop this API as it is bug prone and rarely does what we want.
369
370         * testing/Internals.cpp:
371         (WebCore::Internals::isLoadingFromMemoryCache):
372         Update call to create a dummy ResourceRequest and call
373         resourceForRequest() instead of resourceForUrl(), as this API no
374         longer exists. The new code also set the cachePartition on the
375         dummy request so that this function actually behaves as expected
376         if the cachePartition in the memory cache is non-empty.
377
378
379 2015-04-06  Jer Noble  <jer.noble@apple.com>
380
381         Synchronize fullscreen animation between processes.
382         https://bugs.webkit.org/show_bug.cgi?id=143131
383
384         Reviewed by Simon Fraser.
385
386         Rather than attempt to synchcronize animations across the WebProcess / UIProcess boundary,
387         do the bounds-change animation in-process by applying a sublayer transformation to the
388         video layer. This gives the same visual effect as a synchronized bounds animation, but
389         without needing a synchronization fence. Resolve the difference between the transformation
390         and bounds by doing a fence-synchronized bounds change after the current animation is
391         scheduled to complete.
392
393         To do this calculation correctly, WebAVPlayer needs to query both the effective
394         videoLayerFrame and the videoLayerGravity. To that end, add getter methods for
395         videoLayerFrame() and videoLayerGravity().
396
397         * html/HTMLMediaElement.h:
398         (WebCore::HTMLMediaElement::videoFullscreenGravity):
399         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
400         (-[WebAVVideoLayer dealloc]): Cancel outstanding performSelector requests.
401         (-[WebAVVideoLayer setBounds:]): Add a scale transform to simulate a bonuds change.
402         (-[WebAVVideoLayer resolveBounds]): Reset the scale transform and set the bounds.
403         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Set the initial video frame bounds.
404         (-[WebAVPlayerController layoutSublayersOfLayer:]): Deleted.
405         * platform/ios/WebVideoFullscreenModel.h:
406         * platform/ios/WebVideoFullscreenModelVideoElement.h:
407         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
408         (WebVideoFullscreenModelVideoElement::videoLayerFrame): Added; simple getter.
409         (WebVideoFullscreenModelVideoElement::videoLayerGravity): Ditto.
410
411 2015-04-06  Zalan Bujtas  <zalan@apple.com>
412
413         Simple line layout: RunResolver::Iterator class cleanup.
414         https://bugs.webkit.org/show_bug.cgi?id=143445
415
416         Reviewed by Antti Koivisto.
417
418         1. SimpleLineLayout::Run is an intermediate structure and should not be publicly accessible through RunResolver::Iterator.
419         RunResolver::Run is the class to use to access run properties.
420         2. Also move advance()/advanceLine() to private. Callers should use LineResolver to advance on lines.
421
422         No change in functionality.
423
424         * rendering/SimpleLineLayoutResolver.h:
425
426 2015-04-06  Simon Fraser  <simon.fraser@apple.com>
427
428         Use a RenderObject bit for isRenderFlowThread()
429         https://bugs.webkit.org/show_bug.cgi?id=143439
430
431         Reviewed by Darin Adler.
432
433         Turning isRenderFlowThread() into a bit in rare data rather than a virtual function reduces
434         the time under RenderLayer::scrollTo() on a large overflow:scroll table from 56% to 44%.
435
436         * rendering/RenderFlowThread.cpp:
437         (WebCore::RenderFlowThread::RenderFlowThread):
438         * rendering/RenderFlowThread.h:
439         * rendering/RenderObject.cpp:
440         (WebCore::RenderObject::setIsRenderFlowThread):
441         * rendering/RenderObject.h:
442         (WebCore::RenderObject::isDragging):
443         (WebCore::RenderObject::hasReflection):
444         (WebCore::RenderObject::isRenderFlowThread):
445         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
446
447 2015-04-06  Myles C. Maxfield  <mmaxfield@apple.com>
448
449         [Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
450         https://bugs.webkit.org/show_bug.cgi?id=143402
451
452         Reviewed by Darin Adler.
453
454         There are a few pieces to the converter that Windows requires that we haven't already
455         implemented:
456         1. Checksums were being calculated with the wrong endianness
457         2. Windows requires a format 4 'cmap' subtable in addition to the format 12 one we already
458         were using
459         3. Windows requires a reference to a Private DICT inside the CFF table, even if the DICT
460         is of 0 length.
461
462         Covered by all our existing SVG font tests.
463
464         * svg/SVGFontFaceElement.h: Add capHeight accessor.
465         * svg/SVGFontFaceElement.cpp:
466         (WebCore::SVGFontFaceElement::capHeight): Ditto.
467         * svg/SVGToOTFConversion.cpp: Update the conversion process according to the above
468         requirements.
469         (WebCore::SVGToOTFFontConverter::appendFormat12CMAPTable):
470         (WebCore::SVGToOTFFontConverter::appendFormat4CMAPTable):
471         (WebCore::SVGToOTFFontConverter::appendCMAPTable): Use helpers.
472         (WebCore::SVGToOTFFontConverter::appendHHEATable): Use member variables.
473         (WebCore::SVGToOTFFontConverter::appendOS2Table): Update to version 2.
474         (WebCore::SVGToOTFFontConverter::appendCFFTable): Create a reference to a
475         zero-sized Private DICT
476         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Populate member
477         variables.
478         (WebCore::SVGToOTFFontConverter::calculateChecksum): Flip endianness
479
480 2015-04-06  Yusuke Suzuki  <utatane.tea@gmail.com>
481
482         Return Optional<uint32_t> from PropertyName::asIndex
483         https://bugs.webkit.org/show_bug.cgi?id=143422
484
485         Reviewed by Darin Adler.
486
487         * bindings/js/JSDOMWindowCustom.cpp:
488         (WebCore::JSDOMWindow::getOwnPropertySlot):
489         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
490         * bindings/js/JSHTMLAllCollectionCustom.cpp:
491         (WebCore::callHTMLAllCollection):
492         (WebCore::JSHTMLAllCollection::item):
493         * bindings/scripts/CodeGeneratorJS.pm:
494         (GenerateGetOwnPropertySlotBody):
495         (GenerateImplementation):
496         * bindings/scripts/test/JS/JSFloat64Array.cpp:
497         (WebCore::JSFloat64Array::getOwnPropertySlot):
498         (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
499         (WebCore::JSFloat64Array::put):
500         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
501         (WebCore::JSTestEventTarget::getOwnPropertySlot):
502         * bridge/runtime_array.cpp:
503         (JSC::RuntimeArray::getOwnPropertySlot):
504         (JSC::RuntimeArray::put):
505
506 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
507
508         FileList constructor should move the passed-in Vector<> rvalue reference into the member variable
509         https://bugs.webkit.org/show_bug.cgi?id=143412
510
511         Reviewed by Darin Adler.
512
513         * fileapi/FileList.h:
514         (WebCore::FileList::FileList): An explicit move of the passed-in rvalue
515         reference into the member variable is required, otherwise a copy is
516         performed since an rvalue reference is just an lvalue.
517
518 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
519
520         UserScript, UserStyleSheet constructors should take in Vector<String> rvalue references
521         https://bugs.webkit.org/show_bug.cgi?id=143411
522
523         Reviewed by Darin Adler.
524
525         Have the UserScript and UserStyleSheet constructors take in Vector<String>
526         rvalue references for the whitelist and blacklist parameters. Both classes
527         store these Vector<String> objects, so the referenced objects can simply be
528         moved into the member variable.
529
530         Because the constructor is now demanding an rvalue, it's up to the caller
531         to move in the desired object if possible, or create an explicit copy
532         otherwise.
533
534         * page/UserScript.h:
535         (WebCore::UserScript::UserScript):
536         * page/UserStyleSheet.h:
537         (WebCore::UserStyleSheet::UserStyleSheet):
538
539 2015-04-05  Andy Estes  <aestes@apple.com>
540
541         [Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest:...]
542         https://bugs.webkit.org/show_bug.cgi?id=143437
543
544         Reviewed by Dan Bernstein.
545
546         No new tests. We can't test NEFilterSource directly.
547
548         * platform/cocoa/NetworkExtensionContentFilter.mm:
549         (WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.
550
551 2015-04-05  Darin Adler  <darin@apple.com>
552
553         FrameView code uses page() without null checking
554         https://bugs.webkit.org/show_bug.cgi?id=143425
555         rdar://problem/18920601
556
557         Reviewed by Anders Carlsson.
558
559         While we don't have tests that cover this, we are seeing crashes coming in
560         that indicate the shouldEnableSpeculativeTilingDuringLoading function is
561         being called when the page is null. This patch adds null checks to all the
562         places in FrameView that use page() without doing null checking.
563
564         * page/FrameView.cpp:
565         (WebCore::FrameView::layout): If page is null, don't try to do the
566         auto-sizing logic that involves the textAutosizingWidth value from the page.
567         (WebCore::FrameView::setFixedVisibleContentRect): Get settings from the
568         frame rather than the page to avoid possible null-dereference.
569         (WebCore::FrameView::scrollPositionChanged): Check the page for null when
570         getting the event throttling delay.
571         (WebCore::FrameView::updateLayerFlushThrottling): Check the page for null,
572         and return early if it is null.
573         (WebCore::shouldEnableSpeculativeTilingDuringLoading): Check the page for
574         null, and return false if it is null.
575         (WebCore::FrameView::performPostLayoutTasks): Guard the code that calls
576         didLayout on the page client by a check if the page is null.
577         (WebCore::FrameView::pagination): Don't call Page::pagination on a null
578         page here.
579         (WebCore::FrameView::visibleContentScaleFactor): Use a scale factor of 1
580         if the page is null.
581         (WebCore::FrameView::setVisibleScrollerThumbRect): Don't call through to
582         the page client if the page is null.
583         (WebCore::FrameView::scrollbarStyleChanged): Ditto.
584         (WebCore::FrameView::setScrollPinningBehavior): Check the page for null
585         before asking it for the scrolling coordinator.
586
587 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
588
589         Free up some bits in RenderObject by moving rarely used bits into a side table
590         https://bugs.webkit.org/show_bug.cgi?id=143432
591
592         Reviewed by Darin Adler.
593         
594         Add a side table (global hash) on RenderObject to store data that is rarely
595         used. Move the "isDragging" and "hasReflection" bits there. Re-use one of
596         those bits for "hasRareData", and leave the other unused (I have plans for it).
597         
598         * rendering/RenderBlock.cpp:
599         (WebCore::getBlockRareData): Renamed for consistency.
600         (WebCore::ensureBlockRareData): Renamed to avoid conflict with RenderObject::ensureRareData().
601         (WebCore::RenderBlock::cachedFlowThreadContainingBlock):
602         (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
603         (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
604         (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
605         (WebCore::RenderBlock::locateFlowThreadContainingBlock):
606         (WebCore::RenderBlock::paginationStrut):
607         (WebCore::RenderBlock::pageLogicalOffset):
608         (WebCore::RenderBlock::setPaginationStrut):
609         (WebCore::RenderBlock::setPageLogicalOffset):
610         (WebCore::getRareData): Deleted.
611         (WebCore::ensureRareData): Deleted.
612         * rendering/RenderObject.cpp:
613         (WebCore::RenderObject::~RenderObject): Assert that rare data hasn't been resurrected
614         since willBeDestroyed().
615         (WebCore::RenderObject::willBeDestroyed): Clear the rare data.
616         (WebCore::RenderObject::setIsDragging): If setting, ensure that we have rare data and
617         set the bit. Otherwise, only clear the bit of we have rare data.
618         (WebCore::RenderObject::setHasReflection): Ditto.
619         (WebCore::RenderObject::rareDataMap):
620         (WebCore::RenderObject::rareData):
621         (WebCore::RenderObject::ensureRareData):
622         (WebCore::RenderObject::clearRareData):
623         * rendering/RenderObject.h:
624         (WebCore::RenderObject::isDragging): Fast-fail on the hasRareData() bit, then do the
625         slower lookup in rare data.
626         (WebCore::RenderObject::hasReflection): Ditto.
627         (WebCore::RenderObject::setEverHadLayout): Moved up to group with other bit setters.
628         (WebCore::RenderObject::hasRareData):
629         (WebCore::RenderObject::setHasRareData):
630         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
631         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
632         (WebCore::RenderObject::setHasReflection): Deleted. Out of line now.
633         (WebCore::RenderObject::setIsDragging): Deleted. Ditto.
634
635 2015-04-05  Darin Adler  <darin@apple.com>
636
637         REGRESSION (r181778): Crash after scrolling Google search result page
638         https://bugs.webkit.org/show_bug.cgi?id=143431
639
640         Reviewed by Simon Fraser.
641
642         I can't reproduce this crash, nor was I able to make a regression test,
643         but the crash data makes it clear this is a null dereference.
644
645         * page/animation/AnimationController.cpp:
646         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Check the result
647         of Frame::view for null. We know this is only called when there is a
648         valid FrameView, but it can be called after Frame::m_view is already null.
649
650 2015-04-05  Andy Estes  <aestes@apple.com>
651
652         [Content Filtering] Tell the filter about requests and redirects
653         https://bugs.webkit.org/show_bug.cgi?id=143414
654         rdar://problem/19239549
655
656         Reviewed by Darin Adler.
657
658         Tests: contentfiltering/allow-after-will-send-request.html
659                contentfiltering/block-after-will-send-request.html
660                http/tests/contentfiltering/allow-after-redirect.html
661                http/tests/contentfiltering/block-after-redirect.html
662
663         NEFilterSource supports making filter decisions based on NSURLRequests, so this patch adds support for telling
664         ContentFilter about the original main resource request as well as redirect requests.
665
666         * bindings/js/JSMockContentFilterSettingsCustom.cpp: Updated decisionPoint values to include AfterWillSendRequest and AfterRedirect.
667         (WebCore::JSMockContentFilterSettings::decisionPoint):
668         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
669         * loader/ContentFilter.cpp:
670         (WebCore::ContentFilter::willSendRequest): Called willSendRequest() on each filter using forEachContentFilterUntilBlocked().
671         (WebCore::ContentFilter::redirectReceived): Called willSendRequest().
672         * loader/ContentFilter.h:
673         * loader/DocumentLoader.cpp:
674         (WebCore::DocumentLoader::willSendRequest): Called ContentFilter::willSendRequest() if there is a content filter.
675         Asserted that this is not a redirect, and that ContentFilter does not set the request to null.
676         * loader/SubresourceLoader.cpp:
677         (WebCore::SubresourceLoader::willSendRequest): Called redirectReceived() instead of willSendRequest().
678         * loader/cache/CachedRawResource.cpp:
679         (WebCore::CachedRawResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
680         (WebCore::CachedRawResource::willSendRequest): Deleted.
681         * loader/cache/CachedRawResource.h:
682         * loader/cache/CachedResource.cpp:
683         (WebCore::CachedResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
684         (WebCore::CachedResource::willSendRequest): Deleted.
685         * loader/cache/CachedResource.h:
686         * platform/PlatformContentFilter.h:
687         * platform/cocoa/NetworkExtensionContentFilter.h:
688         * platform/cocoa/NetworkExtensionContentFilter.mm:
689         (WebCore::NetworkExtensionContentFilter::willSendRequest): Called responseReceived() if there was a redirectResponse.
690         Then called -[NEFilterSource willSendRequest:decisionHandler:].
691         * platform/cocoa/ParentalControlsContentFilter.h:
692         * platform/spi/cocoa/NEFilterSourceSPI.h: Added a #define for NEFilterSourceOptionsPageData.
693         * testing/MockContentFilter.cpp:
694         (WebCore::MockContentFilter::willSendRequest): Added support for willSendRequest.
695         * testing/MockContentFilter.h: Added decision points for AfterWillSendRequest and AfterRedirect.
696         * testing/MockContentFilterSettings.h:
697         * testing/MockContentFilterSettings.idl:
698
699 2015-04-05  Sungmann Cho  <sungmann.cho@navercorp.com>
700
701         Remove DocumentLoader::requestURL().
702         https://bugs.webkit.org/show_bug.cgi?id=140001
703
704         Reviewed by Darin Adler.
705
706         No new tests, no behavior change.
707
708         * loader/DocumentLoader.cpp:
709         (WebCore::DocumentLoader::documentURL):
710         (WebCore::DocumentLoader::requestURL): Deleted.
711         * loader/DocumentLoader.h:
712         * loader/ResourceLoadNotifier.cpp:
713         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
714
715 2015-04-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
716
717         Use constants of sqlite3 directly for status of SQL result in webdatabase
718         https://bugs.webkit.org/show_bug.cgi?id=143329
719
720         Reviewed by Darin Adler.
721
722         In webdatabase, it has used own constant vairables as well as using sqlite3 constants directly.
723         It causes to use if~else statement which consumes more cpu cycles compared to switch~case. This
724         patch makes to use constants of sqlite3. Additionally if~else statment is changed to switch~case
725         to save cpu cycles.
726
727         No new tests, no behavior changes.
728
729         * Modules/webdatabase/Database.cpp:
730         (WebCore::Database::performGetTableNames):
731         * Modules/webdatabase/DatabaseBackendBase.cpp:
732         (WebCore::retrieveTextResultFromDatabase):
733         (WebCore::setTextValueInDatabase):
734         (WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
735         * Modules/webdatabase/DatabaseTracker.cpp:
736         (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
737         (WebCore::DatabaseTracker::hasEntryForDatabase):
738         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
739         (WebCore::DatabaseTracker::origins):
740         (WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
741         (WebCore::DatabaseTracker::detailsForNameAndOrigin):
742         (WebCore::DatabaseTracker::setDatabaseDetails):
743         (WebCore::DatabaseTracker::quotaForOriginNoLock):
744         (WebCore::DatabaseTracker::setQuota):
745         (WebCore::DatabaseTracker::addDatabase):
746         (WebCore::DatabaseTracker::deleteOrigin):
747         (WebCore::DatabaseTracker::deleteDatabase):
748         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
749         (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
750         * Modules/webdatabase/SQLStatementBackend.cpp:
751         (WebCore::SQLStatementBackend::execute):
752         * Modules/webdatabase/SQLStatementBackend.h:
753         * Modules/webdatabase/SQLTransactionBackend.cpp:
754         (WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
755         Change to use a reference instead of a pointer in arguemnt of execute().
756         * loader/appcache/ApplicationCacheStorage.cpp:
757         (WebCore::ApplicationCacheStorage::loadCacheGroup):
758         (WebCore::ApplicationCacheStorage::loadManifestHostHashes):
759         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
760         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
761         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
762         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
763         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
764         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
765         (WebCore::ApplicationCacheStorage::verifySchemaVersion):
766         (WebCore::ApplicationCacheStorage::store):
767         (WebCore::ApplicationCacheStorage::storeUpdatedType):
768         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
769         (WebCore::ApplicationCacheStorage::storeNewestCache):
770         (WebCore::ApplicationCacheStorage::loadCache):
771         (WebCore::ApplicationCacheStorage::remove):
772         (WebCore::ApplicationCacheStorage::getManifestURLs):
773         (WebCore::ApplicationCacheStorage::cacheGroupSize):
774         (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord):
775         (WebCore::ApplicationCacheStorage::checkForMaxSizeReached):
776         (WebCore::ApplicationCacheStorage::checkForDeletedResources):
777         (WebCore::ApplicationCacheStorage::flatFileAreaSize):
778         * loader/icon/IconDatabase.cpp:
779         (WebCore::IconDatabase::checkIntegrity):
780         (WebCore::IconDatabase::performURLImport):
781         (WebCore::IconDatabase::pruneUnretainedIcons):
782         (WebCore::readySQLiteStatement):
783         (WebCore::IconDatabase::setIconIDForPageURLInSQLDatabase):
784         (WebCore::IconDatabase::removePageURLFromSQLDatabase):
785         (WebCore::IconDatabase::getIconIDForIconURLFromSQLDatabase):
786         (WebCore::IconDatabase::addIconURLToSQLDatabase):
787         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
788         (WebCore::IconDatabase::removeIconFromSQLDatabase):
789         (WebCore::IconDatabase::writeIconSnapshotToSQLDatabase):
790         * platform/sql/SQLiteDatabase.cpp:
791         (WebCore::SQLiteDatabase::setMaximumSize):
792         * platform/sql/SQLiteDatabase.h:
793         * platform/sql/SQLiteFileSystem.cpp:
794         (WebCore::SQLiteFileSystem::getFileNameForNewDatabase):
795         * platform/sql/SQLiteStatement.cpp:
796         (WebCore::SQLiteStatement::step):
797         (WebCore::SQLiteStatement::returnIntResults):
798         (WebCore::SQLiteStatement::returnInt64Results):
799
800 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
801
802         Remove "go ahead and" from comments
803         https://bugs.webkit.org/show_bug.cgi?id=143421
804
805         Reviewed by Darin Adler, Benjamin Poulain.
806
807         Remove the phrase "go ahead and" from comments where it doesn't add
808         anything (which is almost all of them).
809
810         * Modules/webdatabase/DatabaseTracker.cpp:
811         (WebCore::DatabaseTracker::deleteOriginLockFor):
812         * css/CSSFontFaceSrcValue.cpp:
813         (WebCore::CSSFontFaceSrcValue::isSupportedFormat):
814         * css/CSSPrimitiveValue.h:
815         * css/StyleResolver.cpp:
816         (WebCore::StyleResolver::styleForKeyframe):
817         (WebCore::StyleResolver::styleForPage):
818         (WebCore::StyleResolver::applyMatchedProperties):
819         * editing/ApplyStyleCommand.cpp:
820         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
821         * loader/DocumentLoader.cpp:
822         (WebCore::DocumentLoader::detachFromFrame):
823         * loader/cache/CachedImage.cpp:
824         (WebCore::CachedImage::addIncrementalDataBuffer):
825         * loader/icon/IconDatabase.cpp:
826         (WebCore::IconDatabase::performURLImport):
827         * page/PageOverlay.cpp:
828         (WebCore::PageOverlay::fadeAnimationTimerFired):
829         * platform/ScrollView.cpp:
830         (WebCore::ScrollView::updateScrollbars):
831         (WebCore::ScrollView::scrollContents):
832         * platform/graphics/DisplayRefreshMonitor.cpp:
833         (WebCore::DisplayRefreshMonitor::create):
834         * platform/graphics/GraphicsContext.cpp:
835         * platform/graphics/mac/ComplexTextController.cpp:
836         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
837         * platform/network/HTTPParsers.cpp:
838         (WebCore::parseHTTPRefresh):
839         * rendering/RenderBlock.cpp:
840         (WebCore::RenderBlock::removeChild):
841         (WebCore::RenderBlock::layoutPositionedObjects):
842         (WebCore::RenderBlock::selectionGaps):
843         (WebCore::RenderBlock::blockSelectionGaps):
844         (WebCore::RenderBlock::absoluteRects):
845         (WebCore::RenderBlock::absoluteQuads):
846         (WebCore::RenderBlock::addFocusRingRects):
847         * rendering/RenderBlockFlow.cpp:
848         (WebCore::RenderBlockFlow::layoutBlockChild):
849         (WebCore::RenderBlockFlow::handleAfterSideOfBlock):
850         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
851         (WebCore::RenderBlockFlow::insertFloatingObject):
852         (WebCore::RenderBlockFlow::addOverhangingFloats):
853         (WebCore::RenderBlockFlow::inlineSelectionGaps):
854         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
855         * rendering/RenderBlockLineLayout.cpp:
856         (WebCore::RenderBlockFlow::appendRunsForObject):
857         * rendering/RenderBox.cpp:
858         (WebCore::RenderBox::positionLineBox):
859         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
860         * rendering/RenderBoxModelObject.cpp:
861         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
862         * rendering/RenderLayer.cpp:
863         (WebCore::RenderLayer::updateLayerPositions):
864         (WebCore::RenderLayer::hitTestLayer):
865         (WebCore::RenderLayer::calculateClipRects):
866         * rendering/RenderLayerModelObject.cpp:
867         (WebCore::RenderLayerModelObject::styleWillChange):
868         * rendering/RenderLineBoxList.cpp:
869         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
870         * rendering/RenderTextLineBoxes.cpp:
871         (WebCore::RenderTextLineBoxes::dirtyRange):
872         * rendering/line/BreakingContext.h:
873         (WebCore::BreakingContext::handleOutOfFlowPositioned):
874         (WebCore::BreakingContext::handleText):
875         * rendering/line/LineBreaker.cpp:
876         (WebCore::LineBreaker::nextLineBreak):
877         * style/StyleResolveTree.cpp:
878         (WebCore::Style::resolveLocal):
879         * xml/XMLHttpRequestProgressEventThrottle.cpp:
880         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
881         * xml/parser/XMLDocumentParser.cpp:
882         (WebCore::XMLDocumentParser::append):
883
884 2015-04-04  Andy Estes  <aestes@apple.com>
885
886         [Content Filtering] Blocked page is not always displayed when it should be
887         https://bugs.webkit.org/show_bug.cgi?id=143410
888         rdar://problem/20211099
889
890         Reviewed by Andreas Kling.
891
892         These tests now pass: contentfiltering/block-after-add-data.html
893                               contentfiltering/block-after-response.html
894
895         There were several problems with how ContentFilter loaded replacement data:
896         (1) Replacement data was delivered to DocumentLoader as if it were the original document's data. This assumes
897             that the original data was a UTF-8 encoded HTML document, which is not always true. We had a way to reset
898             the encoding, but not the content type.
899         (2) Replacement data was never delivered when the filter blocks in DocumentLoader::responseReceived().
900         (3) The main resource load was cancelled before the replacement data could be rendered when the filter blocks
901             in DocumentLoader::dataReceived().
902         The result was that only when the load was blocked after DocumentLoader::notifyFinished() would the replacement
903         data be shown properly, and only when problem (1) wasn't occurring.
904
905         This patch addresses these issues by using the substitute data mechanism to deliver replacement data. By using
906         substitute data, we can ensure that the original load is cancelled at the earliest opportunity and that the
907         replacement data is loaded with the proper content type and encoding.
908
909         Accomplishing this required changing the way ContentFilter interacts with DocumentLoader. Instead of placing
910         ContentFilter hooks throughout DocumentLoader, this patch makes ContentFilter itself the client of the
911         CachedRawResource for the duration of the filtering. If the filter decides to allow the load, DocumentLoader
912         adds itself as a client causing CachedRawResource to deliver to it the response and buffered data. If the
913         filter decides to block the load, DocumentLoader schedules a substitute data load. An added benefit of this
914         approach is that ContentFilter can reuse CachedRawResource's original data buffer instead of keeping its own.
915
916         * loader/ContentFilter.cpp:
917         (WebCore::ContentFilter::createIfNeeded): Changed to take a DecisionFunction rather than a ResourceResponse and DocumentLoader.
918         (WebCore::ContentFilter::ContentFilter): Ditto.
919         (WebCore::ContentFilter::~ContentFilter): Removed ourself as a CachedRawResource client if needed.
920         (WebCore::ContentFilter::startFilteringMainResource): Became the client of the CachedRawResource in order to start the filtering process.
921         (WebCore::ContentFilter::unblockHandler): Returned the unblock handler.
922         (WebCore::ContentFilter::replacementData): Returned the replacement data.
923         (WebCore::ContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
924         (WebCore::ContentFilter::responseReceived): Called responseReceived() on each filter using forEachContentFilterUntilBlocked().
925         (WebCore::ContentFilter::dataReceived): Ditto for dataReceived().
926         (WebCore::ContentFilter::notifyFinished): Ditto for finishedLoading().
927         (WebCore::ContentFilter::forEachContentFilterUntilBlocked): For each filter that needs more data, called the function.
928         If the filter blocked the load, called didDecide() with State::Blocked.
929         If all filters allowed the load, called didDecide() with State::Allowed.
930         (WebCore::ContentFilter::didDecide): Set m_state and called m_decisionFunction().
931         (WebCore::ContentFilter::addData): Deleted.
932         (WebCore::ContentFilter::finishedAddingData): Deleted.
933         (WebCore::ContentFilter::needsMoreData): Deleted.
934         (WebCore::ContentFilter::didBlockData): Deleted.
935         (WebCore::ContentFilter::getReplacementData): Deleted.
936         * loader/ContentFilter.h:
937         (WebCore::ContentFilter::type):
938         * loader/DocumentLoader.cpp:
939         (WebCore::DocumentLoader::DocumentLoader): Called ContentFilter::createIfNeeded() if not loading substitute data.
940         (WebCore::DocumentLoader::finishedLoading): Removed old ContentFilter code.
941         (WebCore::DocumentLoader::responseReceived): Ditto.
942         (WebCore::DocumentLoader::commitData): Ditto.
943         (WebCore::DocumentLoader::dataReceived): Ditto.
944         (WebCore::DocumentLoader::detachFromFrame): Set m_contentFilter to nullptr.
945         (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClientIfFilterAllows() instead of
946         becoming m_mainResource's client.
947         (WebCore::DocumentLoader::clearMainResource): Set m_contentFilter to nullptr.
948         (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): If ContentFilter is initialized, called
949         ContentFilter::startFilteringMainResource(). Otherwise added ourself as a client of m_mainResource.
950         (WebCore::DocumentLoader::installContentFilterUnblockHandler): Added a helper for creating and notifying
951         FrameLoaderClient of the unblock handler.
952         (WebCore::DocumentLoader::contentFilterDidDecide): Set m_contentFilter to nullptr. If the content filter
953         allowed the load, then added ourself as the CachedRawResource's client. Otherwise, installed the unblock handler
954         and scheduled a substitute data load with the replacement data.
955         * loader/DocumentLoader.h:
956         * loader/FrameLoader.cpp:
957         (WebCore::FrameLoader::prepareForLoadStart): Removed call to PolicyChecker::prepareForLoadStart().
958         * loader/NavigationScheduler.cpp:
959         (WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Added a ScheduledNavigation subclass that
960         calls FrameLoader::load() with a FrameLoadRequest containing substitute data.
961         (WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Scheduled a substitute data load.
962         * loader/NavigationScheduler.h:
963         * loader/PolicyChecker.cpp:
964         (WebCore::PolicyChecker::checkNavigationPolicy): Reset m_contentFilterUnblockHandler if it couldn't handle the request.
965         (WebCore::PolicyChecker::prepareForLoadStart): Deleted.
966         * loader/PolicyChecker.h:
967         * platform/ContentFilterUnblockHandler.h:
968         (WebCore::ContentFilterUnblockHandler::unreachableURL):
969         (WebCore::ContentFilterUnblockHandler::setUnreachableURL):
970         (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Renamed to ContentFilter::urlScheme().
971         * platform/PlatformContentFilter.h:
972         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
973         (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Added a helper to wrap the unblock handler with an outer DecisionHandlerFunction.
974         (WebCore::ContentFilterUnblockHandler::encode): Added m_unreachableURL to the encoding.
975         (WebCore::ContentFilterUnblockHandler::decode): Ditto for the decoding.
976         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Changed to call ContentFilter::urlScheme().
977         * platform/cocoa/NetworkExtensionContentFilter.h:
978         * platform/cocoa/NetworkExtensionContentFilter.mm:
979         (replacementDataFromDecisionInfo): Added a helper to extract replacement data from the decisionInfo dictionary.
980         (WebCore::NetworkExtensionContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
981         (WebCore::NetworkExtensionContentFilter::create): Created a new object.
982         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Created a NEFilterSource immediately when using the modern API.
983         (WebCore::NetworkExtensionContentFilter::responseReceived): Created a NEFilterSource when using the legacy API.
984         Called -[NEFilterSource receivedResponse:decisionHandler:] when using the modern API.
985         (WebCore::NetworkExtensionContentFilter::addData): Stopped buffering the original data.
986         (WebCore::NetworkExtensionContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
987         (WebCore::NetworkExtensionContentFilter::canHandleResponse): Deleted.
988         (WebCore::createNEFilterSource): Deleted.
989         (WebCore::NetworkExtensionContentFilter::getReplacementData): Deleted.
990         * platform/cocoa/ParentalControlsContentFilter.h:
991         * platform/cocoa/ParentalControlsContentFilter.mm:
992         (WebCore::ParentalControlsContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
993         (WebCore::ParentalControlsContentFilter::create): Created a new object.
994         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Initialized m_filterState to kWFEStateBuffering.
995         (WebCore::canHandleResponse): Added a helper to check if the response can be filtered.
996         (WebCore::ParentalControlsContentFilter::responseReceived): If !canHandleResponse(), set m_filterState to kWFEStateAllowed and return.
997         Otherwise created a new WebFilterEvaluator with the response.
998         (WebCore::ParentalControlsContentFilter::addData): Called updateFilterState().
999         (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
1000         (WebCore::ParentalControlsContentFilter::needsMoreData): Changed to check m_filterState.
1001         (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
1002         (WebCore::ParentalControlsContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1003         (WebCore::ParentalControlsContentFilter::updateFilterState): Updated m_filterState by calling -[WebFilterEvaluator filterState].
1004         (WebCore::ParentalControlsContentFilter::canHandleResponse): Deleted.
1005         (WebCore::ParentalControlsContentFilter::getReplacementData): Deleted.
1006         * platform/spi/cocoa/NEFilterSourceSPI.h:
1007         * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
1008         * testing/MockContentFilter.cpp:
1009         (WebCore::MockContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
1010         (WebCore::MockContentFilter::create): Created a new object.
1011         (WebCore::MockContentFilter::responseReceived): Called maybeDetermineStatus().
1012         (WebCore::MockContentFilter::addData): Stopped buffering the original data.
1013         (WebCore::MockContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1014         (WebCore::MockContentFilter::unblockHandler): Asserted that we blocked data.
1015         (WebCore::MockContentFilter::canHandleResponse): Deleted.
1016         (WebCore::MockContentFilter::MockContentFilter): Deleted.
1017         (WebCore::MockContentFilter::getReplacementData): Deleted.
1018         * testing/MockContentFilter.h:
1019         * testing/MockContentFilterSettings.cpp:
1020         (WebCore::MockContentFilterSettings::unblockRequestURL): Changed to use a StringBuilder.
1021
1022 2015-04-04  Chris Fleizach  <cfleizach@apple.com>
1023
1024         AX: Heuristic: Avoid exposing an element as clickable if mouse event delegation is handled on an AXElement with more than one descendant AXElement
1025         https://bugs.webkit.org/show_bug.cgi?id=136247
1026
1027         Reviewed by Mario Sanchez Prada.
1028
1029         Modify the logic for determining whether an element supports the press action by trying to filter out objects being handled by event delegation.
1030         The heuristic is if an element handles click actions and has more than one of a {static text, image, control, link, heading}, then we think
1031         it's using event delegation, and do not expose the press action.
1032
1033         Test: platform/mac/accessibility/press-action-not-exposed-for-event-delegation.html
1034
1035         * accessibility/AccessibilityObject.cpp:
1036         (WebCore::AccessibilityObject::supportsPressAction):
1037
1038 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1039
1040         More const in CSSToStyleMap
1041         https://bugs.webkit.org/show_bug.cgi?id=143409
1042
1043         Reviewed by Andreas Kling.
1044
1045         The CSSValues passed to CSSToStyleMap functions can mostly be treated
1046         as |const|, except for CSSImageValues which have special behavior.
1047         
1048         This makes it clearer what the inputs and outputs of these
1049         functions are.
1050
1051         * css/CSSPrimitiveValue.cpp:
1052         (WebCore::CSSPrimitiveValue::computeDegrees):
1053         * css/CSSPrimitiveValue.h:
1054         (WebCore::CSSPrimitiveValue::computeTime):
1055         * css/CSSToStyleMap.cpp:
1056         (WebCore::CSSToStyleMap::mapFillAttachment):
1057         (WebCore::CSSToStyleMap::mapFillClip):
1058         (WebCore::CSSToStyleMap::mapFillComposite):
1059         (WebCore::CSSToStyleMap::mapFillBlendMode):
1060         (WebCore::CSSToStyleMap::mapFillOrigin):
1061         (WebCore::CSSToStyleMap::mapFillRepeatX):
1062         (WebCore::CSSToStyleMap::mapFillRepeatY):
1063         (WebCore::CSSToStyleMap::mapFillSize):
1064         (WebCore::CSSToStyleMap::mapFillXPosition):
1065         (WebCore::CSSToStyleMap::mapFillYPosition):
1066         (WebCore::CSSToStyleMap::mapFillMaskSourceType):
1067         (WebCore::CSSToStyleMap::mapAnimationDelay):
1068         (WebCore::CSSToStyleMap::mapAnimationDirection):
1069         (WebCore::CSSToStyleMap::mapAnimationDuration):
1070         (WebCore::CSSToStyleMap::mapAnimationFillMode):
1071         (WebCore::CSSToStyleMap::mapAnimationIterationCount):
1072         (WebCore::CSSToStyleMap::mapAnimationName):
1073         (WebCore::CSSToStyleMap::mapAnimationPlayState):
1074         (WebCore::CSSToStyleMap::mapAnimationProperty):
1075         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
1076         (WebCore::CSSToStyleMap::mapAnimationTrigger):
1077         * css/CSSToStyleMap.h:
1078
1079 2015-04-04  Dan Bernstein  <mitz@apple.com>
1080
1081         Tried to fix the build.
1082
1083         * loader/icon/IconController.cpp:
1084         (WebCore::iconsFromLinkElements):
1085
1086 2015-04-02  Darin Adler  <darin@apple.com>
1087
1088         Streamline icon-related code, mostly unused
1089         https://bugs.webkit.org/show_bug.cgi?id=143306
1090
1091         Reviewed by Antti Koivisto.
1092
1093         I started on this path because Document::iconURLs had a poor implementation,
1094         storing results in a data member with no benefit, using HTMLCollection for
1095         iteration of the children of the head element instead of using the simpler
1096         faster technique we use inside the engine. Then, I discovered this function was
1097         mostly-unused code left over from before the Blink fork. I removed most of it.
1098         We can add this back later if someone finds a use for it, but if we do we
1099         should do a higher quality implementation without the quirks of the old one.
1100
1101         Refactoring also made it clear that logic isn't exactly sensible. There's a
1102         set of rules about what order to return the list in that is not followed by
1103         the code that tries to find the "default touch icon". Later we could add some
1104         more test coverage and tighten up the logic. But the reality is that at this
1105         time, with some small exceptions, icon logic is in the web browsers, not in WebKit.
1106
1107         * CMakeLists.txt: Removed IconURL.cpp.
1108         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1109         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1110         * WebCore.xcodeproj/project.pbxproj: Ditto.
1111         * dom/DOMAllInOne.cpp: Ditto.
1112
1113         * dom/Document.cpp:
1114         (WebCore::Document::evaluate): Tweaked formatting.
1115         (WebCore::Document::shortcutIconURLs): Removed. Unused function.
1116         (WebCore::Document::iconURLs): Removed. Moved code to IconController.
1117         (WebCore::Document::addIconURL): Removed. Moved code to LinkLoader.
1118
1119         * dom/Document.h: Removed shortcutIconURLs, iconURLs, addIconURL,
1120         and m_iconURLs.
1121
1122         * dom/IconURL.cpp: Removed.
1123         * dom/IconURL.h: Removed everything from this header except for the
1124         IconType enum. Added a FIXME about possibly renaming the header.
1125
1126         * html/HTMLLinkElement.cpp:
1127         (WebCore::HTMLLinkElement::HTMLLinkElement): Pass a reference when creating
1128         the link loading.
1129         (WebCore::HTMLLinkElement::setDisabledState): Access members of the struct
1130         LinkRelElement without "m_" prefix.
1131         (WebCore::HTMLLinkElement::parseAttribute): Changed to use early return style,
1132         and made the part of this for parsing title use a more normal idiom.
1133         (WebCore::HTMLLinkElement::process): Removed many unneeded arguments, made the
1134         logic of the code a little easier to follow.
1135         (WebCore::HTMLLinkElement::removedFrom): Removed a call to a function that had
1136         an empty body.
1137         (WebCore::HTMLLinkElement::iconType): Updated for change to LinkRelElement.
1138         (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
1139         * html/HTMLLinkElement.h: More of the same.
1140
1141         * html/LinkRelAttribute.cpp:
1142         (WebCore::LinkRelAttribute::LinkRelAttribute): Initialize data members in the
1143         struct itself. Got rid of "m_" prefix since this is a struct, not a class.
1144         Changed code to use modern for loop; even better would be to eliminate the
1145         splitting into a vector entirely and use StringView (do that next time).
1146         * html/LinkRelAttribute.h: See above.
1147
1148         * html/parser/HTMLPreloadScanner.cpp:
1149         (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
1150         Updated for chnages to LinkRelAttribute and give the local variable a clearer name.
1151
1152         * loader/FrameLoader.cpp:
1153         (WebCore::FrameLoader::didChangeIcons): Removed.
1154         * loader/FrameLoader.h: Removed didChangeIcons.
1155
1156         * loader/FrameLoaderClient.h: Added include for String since it's no longer
1157         taken care of by IconURLs.h.
1158
1159         * loader/LinkLoader.cpp:
1160         (WebCore::LinkLoader::LinkLoader): Take a reference instead of a pointer.
1161         (WebCore::LinkLoader::linkLoadTimerFired): Use m_client reference instead of pointer.
1162         (WebCore::LinkLoader::linkLoadingErrorTimerFired): Ditto.
1163         (WebCore::LinkLoader::notifyFinished): Use nullptr.
1164         (WebCore::LinkLoader::loadLink): Tweak formatting. Move the dispatchDidChangeIcons
1165         call in here instead of going through Document to FrameLoader and then FrameLoader to
1166         FrameLoaderClient, and passing extra unused arguments, the way the old code did.
1167         Use a reference instead of a pointer for the document.
1168         (WebCore::LinkLoader::released): Removed. Empty function.
1169
1170         * loader/LinkLoader.h: Changed constructor argument to be a reference. Made more
1171         things private. Removed empty released function.
1172
1173         * loader/icon/IconController.cpp:
1174         (WebCore::IconController::IconController): Moved initialization of data members to
1175         the class definition in the header.
1176         (WebCore::iconsFromLinkElements): Added. This function replaces the existing
1177         Document::iconURLs function, but has a simpler implementation and interface.
1178         It focuses on exactly what the code in this file needs. If we want to add some
1179         more features to the icon controller we might make this more complex again.
1180         Even now, building a vector is not necessarily helpful; the only client of this
1181         function ends up extracting only one of the URLs this function returns.
1182         (WebCore::IconController::url): Rewrote this. It's the only function actually
1183         using the icon URLs. This contains a combination of the logic from the various
1184         functions in this class before, including iconURL, urlsForTypes, appendToIconURLs,
1185         and defaultURL. Among other improvements, replaced the unusual code to construct
1186         the icon URL with a call to Document::completeURL.
1187         (WebCore::IconController::startLoader): Refactored a bit to remove a local variable.
1188         (WebCore::IconController::continueLoadWithDecision): Ditto.
1189
1190         * loader/icon/IconController.h: Removed unneeded includes, unneeded use of
1191         WTF_MAKE_NONCOPYABLE (since classes with data members of reference type are
1192         automatically noncopyable), unused fucntions. Also initialize m_waitingForLoadDecision.
1193
1194         * testing/Internals.cpp:
1195         (WebCore::Internals::iconURLs): Removed.
1196         (WebCore::Internals::shortcutIconURLs): Left this in place since it is used by
1197         tests. Changed it to return the actual value from the IconController::url function,
1198         since that's the interface to our icon machinery that is actually exposed on some
1199         platforms. That means this returns only a single URL.
1200         (WebCore::Internals::allIconURLs): Removed.
1201         * testing/Internals.h: Removed allIconURLs and iconURLs.
1202         * testing/Internals.idl: Removed allIconURLs.
1203
1204 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1205
1206         Fix EFL and Gtk build.
1207
1208         * dom/Document.cpp:
1209         (WebCore::Document::didRemoveTouchEventHandler):
1210
1211 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1212
1213         Crash under Document::absoluteRegionForEventTargets on build.webkit.org/dashboard
1214         https://bugs.webkit.org/show_bug.cgi?id=143406
1215         rdar://problem/20407080
1216
1217         Reviewed by Ryosuke Niwa.
1218         
1219         We failed to remove elements from Document's m_wheelEventTargets HashSet when the
1220         elements were destroyed with wheel handlers still on them. Fix by removing the
1221         node from the set via Node::willBeDeletedFrom().
1222
1223         Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash.html
1224                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash.html
1225                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash.html
1226
1227         * dom/Document.cpp:
1228         (WebCore::removeHandlerFromSet): Helper to remove one or all handlers on the given node.
1229         (WebCore::Document::didRemoveWheelEventHandler): Add a parameter to specify whether we're
1230         removing all handlers on the given node.
1231         (WebCore::Document::didRemoveTouchEventHandler): Use removeHandlerFromSet().
1232         * dom/Document.h:
1233         * dom/Node.cpp:
1234         (WebCore::Node::willBeDeletedFrom): Tell the document we're removing all handlers
1235         for this node.
1236
1237 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1238
1239         REGRESSION (r182215): Feedly crashes when closing article
1240         https://bugs.webkit.org/show_bug.cgi?id=143405
1241         rdar://problem/20382734, rdar://problem/20395497
1242
1243         Reviewed by Tim Horton.
1244         
1245         Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
1246         is bad, because it can cause FrameView::layout() to get called in the middle of
1247         RenderObject destruction, which leaves the render tree in a bad state.
1248         
1249         Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
1250         
1251         AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
1252         a flag to say that the non-fast region needs to be recomputed, and that schedules
1253         a scrolling tree commit. When the commit happens, we recompute the region. If the
1254         region didn't change, and no other changes are pending, there's no need to commit.
1255
1256         Test: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html
1257
1258         * page/scrolling/AsyncScrollingCoordinator.cpp:
1259         (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty):
1260         (WebCore::AsyncScrollingCoordinator::willCommitTree):
1261         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
1262         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1263         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
1264         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): Need to eagerly update
1265         the non-fast scrollable region.
1266         * page/scrolling/AsyncScrollingCoordinator.h:
1267         (WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty):
1268         * page/scrolling/ScrollingCoordinator.cpp:
1269         (WebCore::ScrollingCoordinator::ScrollingCoordinator):
1270         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1271         * page/scrolling/ScrollingCoordinator.h:
1272         (WebCore::ScrollingCoordinator::willCommitTree):
1273         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1274         (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
1275         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
1276         (WebCore::ScrollingCoordinatorMac::commitTreeState):
1277
1278 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1279
1280         Differentiate between composited scrolling, and async scrolling
1281         https://bugs.webkit.org/show_bug.cgi?id=143291
1282
1283         Reviewed by Sam Weinig.
1284         
1285         ScrollableArea::usesCompositedScrolling() meant "uses aysnc scrolling", but
1286         FrameView::contentsInCompositedLayer() covered a related concept, that scrolling
1287         happens by moving compositing layers around.
1288         
1289         Make the difference between these more explicit by adding ScrollableArea::usesAsyncScrolling(),
1290         which means that scrolling for that ScrollableArea is asynchronous and managed
1291         by a ScrollingCoordinator. This is the meaning that ScrollingCoordinator::computeNonFastScrollableRegion()
1292         understands.
1293         
1294         ScrollableArea::usesCompositedScrolling() is now repurposed to mean "scrolling
1295         occurs by moving layers around, not requiring repaint". FrameView::contentsInCompositedLayer()
1296         is renamed to usesCompositedScrolling(), and overrides the base class function.
1297
1298         This only changes behavior in tests that call setScrollingTreeIncludesFrames(true).
1299
1300         * page/FrameView.cpp:
1301         (WebCore::FrameView::useSlowRepaints):
1302         (WebCore::FrameView::usesCompositedScrolling):
1303         (WebCore::FrameView::usesAsyncScrolling):
1304         (WebCore::FrameView::scrollContentsFastPath):
1305         (WebCore::FrameView::scrollContentsSlowPath):
1306         (WebCore::FrameView::contentsInCompositedLayer): Deleted.
1307         * page/FrameView.h:
1308         * page/scrolling/ScrollingCoordinator.cpp:
1309         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1310         * platform/ScrollableArea.h:
1311         (WebCore::ScrollableArea::usesAsyncScrolling):
1312         * rendering/RenderLayer.cpp:
1313         (WebCore::RenderLayer::usesAsyncScrolling):
1314         * rendering/RenderLayer.h:
1315
1316 2015-04-04  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1317
1318         [Streams API] Collecting a ReadableStreamReader should not unlock its stream
1319         https://bugs.webkit.org/show_bug.cgi?id=143333
1320
1321         Reviewed by Benjamin Poulain.
1322
1323         This patch stores as a boolean whether the stream is locked to a reader.
1324         In case the reader forget to unlock the stream, the reader can be collected and destructor called.
1325         In that case, the link between reader and stream will be reset but the stream will remain in locked state.
1326
1327         Covered by new test in streams/readablestreamreader-constructor.html.
1328
1329         * Modules/streams/ReadableStream.h:
1330         (WebCore::ReadableStream::isLocked):
1331         (WebCore::ReadableStream::lock):
1332         (WebCore::ReadableStream::release):
1333         (WebCore::ReadableStream::releaseButKeepLocked): Introduced to cut the link between reader and stream but stil keeping the stream locked.
1334         * Modules/streams/ReadableStreamReader.cpp:
1335         (WebCore::ReadableStreamReader::~ReadableStreamReader):
1336         * bindings/js/JSReadableStreamCustom.cpp:
1337         (WebCore::JSReadableStream::getReader):
1338         * bindings/js/JSReadableStreamReaderCustom.cpp:
1339         (WebCore::constructJSReadableStreamReader):
1340
1341 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
1342
1343         MediaDevices possesses a vtable despite using ImplementationLacksVTable IDL attribute
1344         https://bugs.webkit.org/show_bug.cgi?id=143367
1345
1346         Reviewed by Eric Carlson.
1347
1348         * Modules/mediastream/MediaDevices.idl: MediaDevices ends up with a vtable
1349         because of inheriting from ContextDestructionObserver. This collides with
1350         the ImplementationLacksVTable IDL attribute, causing compilation errors
1351         with Clang. Since MediaDevices isn't being inherited from, but will still
1352         end up with a vtable, the IDL attribute should be removed.
1353
1354 2015-04-03  Alex Christensen  <achristensen@webkit.org>
1355
1356         [Content Extensions] Add memory reporting.
1357         https://bugs.webkit.org/show_bug.cgi?id=143386
1358
1359         Reviewed by Benjamin Poulain.
1360
1361         * contentextensions/CompiledContentExtension.cpp:
1362         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
1363         * contentextensions/CompiledContentExtension.h:
1364         * contentextensions/ContentExtension.cpp:
1365         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1366         * contentextensions/ContentExtension.h:
1367         * contentextensions/ContentExtensionsBackend.cpp:
1368         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1369         * contentextensions/ContentExtensionsDebugging.h:
1370         * contentextensions/DFABytecodeInterpreter.cpp:
1371         (WebCore::ContentExtensions::getBits):
1372         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1373         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1374         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1375         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1376         * contentextensions/DFABytecodeInterpreter.h:
1377         (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
1378         (WebCore::ContentExtensions::DFABytecodeInterpreter::~DFABytecodeInterpreter):
1379         Keep track of which memory pages in the bytecode are being hit if CONTENT_EXTENSIONS_MEMORY_REPORTING is 1.
1380         When CONTENT_EXTENSIONS_MEMORY_REPORTING is 0, this makes an empty vector in ContentExtension
1381         and passes some pointers on the stack, many of which can be optimized out by the C++ compiler.
1382
1383 2015-04-03  Brent Fulgham  <bfulgham@apple.com>
1384
1385         Expand test infrastructure to support scrolling tests
1386         https://bugs.webkit.org/show_bug.cgi?id=143383
1387
1388         Reviewed by Darin Adler.
1389
1390         No new tests: No change in behavior.
1391
1392         This is an initial set of changes that clean up a few things I noticed while extending testing support
1393         for scroll animations and wheel event gestures.
1394         1. Reduce the amount of #ifdef code in EventHandler{Mac}.
1395         2. Consolidate the idea of an "End Gesture" in the PlatformWheelEvent class.
1396         3. Remove a number of unneeded null checks in EventHandler.
1397         4. ScrollController must always have a client, so hold a reference instead of using a pointer.
1398
1399         * page/EventHandler.cpp:
1400         (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
1401         (WebCore::EventHandler::handleWheelEvent): Call 'platformNotifySnapIfNecessary' at method exit points.
1402         (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
1403         * page/EventHandler.h:
1404         * page/mac/EventHandlerMac.mm:
1405         (WebCore::EventHandler::platformCompleteWheelEvent):  Remove unneeded null checks for 'view'. Remove
1406         CSS_SNAP-specific call to 'platformNotifySnapIfNecessary'. This logic is now handled in the new
1407         'platformNotifyIfEndGesture' method.
1408         (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
1409         (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
1410         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1411         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Pass 'this' as
1412         reference to ScrollController constructor.
1413         * platform/PlatformWheelEvent.h:
1414         (WebCore::PlatformWheelEvent::shouldResetLatching): Call new 'isEndGesture' method.
1415         (WebCore::PlatformWheelEvent::isEndGesture): Added method to encapsulate some code that was duplicated
1416         in a number of places.
1417         * platform/ScrollAnimator.cpp:
1418         (WebCore::ScrollAnimator::ScrollAnimator): Pass 'this' as reference to ScrollController constructor.
1419         * platform/cocoa/ScrollController.h:
1420         * platform/cocoa/ScrollController.mm:
1421         (WebCore::ScrollController::ScrollController): Update to reflect m_client is now a reference.
1422         (WebCore::ScrollController::handleWheelEvent): Ditto.
1423         (WebCore::ScrollController::snapRubberBandTimerFired): Ditto. Also, a drive-by fix for ending rubberband
1424         snapping. This end-state wasn't deactivating the timer (even when the animation finished). This isn't a
1425         huge problem, but I (will) rely on the state of the animation timer in a future patch to decide if
1426         tests should run or continue waiting.
1427         (WebCore::ScrollController::isRubberBandInProgress): Ditto.
1428         (WebCore::ScrollController::startSnapRubberbandTimer): Ditto.
1429         (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
1430         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
1431         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Ditto.
1432         (WebCore::ScrollController::startScrollSnapTimer): Ditto.
1433         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
1434         (WebCore::ScrollController::scrollSnapAnimationUpdate): Ditto.
1435         (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
1436         (WebCore::ScrollController::computeSnapDelta): Ditto.
1437         (WebCore::ScrollController::computeGlideDelta): Ditto.
1438         * platform/mac/ScrollAnimatorMac.mm:
1439         (WebCore::gestureShouldBeginSnap): Use new PlatformWheelEvent::isEndGesture() method.
1440
1441 2015-04-03  Chris Fleizach  <cfleizach@apple.com>
1442
1443         AX: Toggling check box state not speaking using plain space, not VO space.
1444         https://bugs.webkit.org/show_bug.cgi?id=143356
1445
1446         Reviewed by Darin Adler.
1447
1448         The checkbox state change needs to result in a value change being generated, otherwise accessibility won't know the value has changed through keyboard usage.
1449   
1450         Test: platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html
1451
1452         * accessibility/mac/AXObjectCacheMac.mm:
1453         (WebCore::AXObjectCache::postPlatformNotification):
1454
1455 2015-04-03  Zalan Bujtas  <zalan@apple.com>
1456
1457         Simple line layout: Use pre-computed simple line runs to produce innerText content.
1458         https://bugs.webkit.org/show_bug.cgi?id=143351
1459
1460         Reviewed by Antti Koivisto.
1461
1462         This is in preparation to cover <br> with simple line layout.
1463         Runs provide line layout information that can be used to cover hard line break cases.
1464         (similar to TextIterator::handleTextBox())
1465
1466         Covered by existing tests.
1467
1468         * editing/TextIterator.cpp:
1469         (WebCore::TextIterator::handleTextNode):
1470         (WebCore::TextIterator::emitCharacter):
1471         (WebCore::TextIterator::emitText):
1472         * editing/TextIterator.h:
1473         * rendering/SimpleLineLayoutResolver.h:
1474         (WebCore::SimpleLineLayout::RunResolver::Run::isEndOfLine):
1475
1476 2015-04-03  Antti Koivisto  <antti@apple.com>
1477
1478         Add non-counting bloom filter class
1479         https://bugs.webkit.org/show_bug.cgi?id=143366
1480
1481         Reviewed by Sam Weinig.
1482
1483         * css/SelectorFilter.cpp:
1484         (WebCore::SelectorFilter::setupParentStack):
1485         * css/SelectorFilter.h:
1486
1487         Update names.
1488
1489 2015-04-03  Alex Christensen  <achristensen@webkit.org>
1490
1491         Remove dead code.
1492         https://bugs.webkit.org/show_bug.cgi?id=143352
1493
1494         Reviewed by Gyuyoung Kim.
1495
1496         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1497         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
1498         * loader/EmptyClients.cpp:
1499         (WebCore::EmptyChromeClient::openDateTimeChooser): Deleted.
1500         * loader/EmptyClients.h:
1501         * page/Chrome.cpp:
1502         (WebCore::Chrome::openDateTimeChooser): Deleted.
1503         * page/Chrome.h:
1504         * page/ChromeClient.h:
1505         Remove ChromeClient::openDateTimeChooser.
1506
1507 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
1508
1509         Unreviewed, fixing Clang builds of the GTK port on Linux.
1510
1511         * Modules/mediastream/MediaDevices.h:
1512         Include the <functional> header for uses of std::function<>.
1513
1514 2015-04-01 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1515
1516         [Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
1517         https://bugs.webkit.org/show_bug.cgi?id=143130
1518
1519         Reviewed by Benjamin Poulain.
1520
1521         Introduce ReadableJSStream and ReadableJSStreamReader as subclasses of ReadableStream and ReadableStreamReader.
1522         These classes manage JS based sources: ReadableStream JS constructor instantiates ReadableJStream.
1523         These classes are expected to handle JS source specific handling, in particular JSValue error storage and JSValue chunk queue.
1524         Making ReadableStream and ReadableStreamReader abstract, to be subclassed for native sources.
1525
1526         Current tests cover the changes.
1527
1528         * Modules/streams/ReadableStream.cpp:
1529         (WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ease subclassing.
1530         (WebCore::ReadableStream::create): Deleted as ReadableStream is now abstarct.
1531         * Modules/streams/ReadableStream.h: Made createReader virtual pure.
1532         * Modules/streams/ReadableStream.idl: Skipping VTable validation as subclasses of ReadableStream may be JS wrapped.
1533         * Modules/streams/ReadableStreamReader.cpp: Removed ReadableStreamReader::create.
1534         * Modules/streams/ReadableStreamReader.h: Ditto.
1535         * Modules/streams/ReadableStreamReader.idl: Skipping VTable validation as subclasses of ReadableStreamReader may be JS wrapped.
1536         * bindings/js/JSReadableStreamCustom.cpp:
1537         (WebCore::constructJSReadableStream): Instantiating ReadableJSStream in lieu of ReadableStream within JS constructor.
1538         * bindings/js/ReadableStreamJSSource.cpp:
1539         (WebCore::ReadableJSStream::create):
1540         (WebCore::ReadableJSStream::createReader): Instantiating ReadableJSStreamReader.
1541         (WebCore::ReadableJSStream::ReadableJSStream):
1542         (WebCore::ReadableJSStreamReader::create):
1543         (WebCore::ReadableJSStreamReader::ReadableJSStreamReader):
1544         * bindings/js/ReadableStreamJSSource.h: Definition of ReadableJSStream and ReadableJSStreamReader.
1545
1546 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
1547
1548         Scrollbars are left in the wrong position when resizing a fixed layout view
1549         https://bugs.webkit.org/show_bug.cgi?id=143360
1550
1551         Reviewed by Beth Dakin.
1552
1553         Test: fast/fixed-layout/fixed-layout.html
1554
1555         * platform/ScrollView.cpp:
1556         (WebCore::ScrollView::setFrameRect):
1557         Update scrollbars when the ScrollView frameRect changes. We were previously
1558         depending on the layout that always happens after this to update scrollbars,
1559         but with fixed layout mode, there won't be a layout! Also, FrameView's
1560         setFrameRect override will sync this scrollbar update with the scrollbar
1561         layers (via RenderLayerCompositor::frameViewDidChangeSize) immediately afterwards.
1562
1563         * testing/Internals.cpp:
1564         (WebCore::Internals::resetToConsistentState):
1565         Turn off fixed layout when resetting state.
1566
1567         (WebCore::Internals::setUseFixedLayout):
1568         (WebCore::Internals::setFixedLayoutSize):
1569         * testing/Internals.h:
1570         * testing/Internals.idl:
1571         Add internals functions to set the fixed layout size and to turn on fixed layout.
1572
1573 2015-04-02  Brady Eidson  <beidson@apple.com>
1574
1575         Unreviewed: Reapplied Change after rollout.
1576
1577         Expose the "Share" menu for text selections on platforms where it's available.
1578         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
1579
1580         * page/ContextMenuClient.h:
1581         (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
1582
1583         * page/ContextMenuContext.h:
1584         (WebCore::ContextMenuContext::setSelectedText):
1585         (WebCore::ContextMenuContext::selectedText):
1586
1587         * page/ContextMenuController.cpp:
1588         (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
1589         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1590
1591         * platform/ContextMenuItem.cpp:
1592         (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1593
1594         * platform/ContextMenuItem.h:
1595         (WebCore::ContextMenuItem::supportsShareMenu):
1596
1597         * platform/gtk/ContextMenuItemGtk.cpp:
1598         (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1599
1600         * platform/mac/ContextMenuItemMac.mm:
1601         (WebCore::ContextMenuItem::releasePlatformDescription):
1602         (WebCore::ContextMenuItem::getPlatformDescription):
1603         (WebCore::ContextMenuItem::supportsShareMenu):
1604         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
1605
1606         * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
1607
1608 2015-04-02  Commit Queue  <commit-queue@webkit.org>
1609
1610         Unreviewed, rolling out r182293.
1611         https://bugs.webkit.org/show_bug.cgi?id=143355
1612
1613         Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
1614
1615         Reverted changeset:
1616
1617         "Expose the "Share" menu for text selections on platforms
1618         where it's available."
1619         https://bugs.webkit.org/show_bug.cgi?id=143318
1620         http://trac.webkit.org/changeset/182293
1621
1622 2015-04-02  Brent Fulgham  <bfulgham@apple.com>
1623
1624         REGRESSION: Caption Menus show language codes instead of display names.
1625         https://bugs.webkit.org/show_bug.cgi?id=143350
1626         <rdar://problem/20094145>
1627
1628         Reviewed by Jer Noble.
1629
1630         The generic caption/track label handling in CaptionUserPreferences does not convert language codes
1631         (e.g. 'fr-CA') into display names (e.g., 'French (Canada)'). Because we did not have an AudioTrack
1632         override to process these types of menu items, they were being handled using the generic code.
1633
1634         * page/CaptionUserPreferencesMediaAF.cpp:
1635         (WebCore::buildStringForTrackBase): Helper function to share code with the two flavors
1636         of 'trackDisplayName'.
1637         (WebCore::trackDisplayName): Add a version to support AudioTracks, and modify the TextTrack
1638         version to use the new 'buildStringForTrackBase' function.
1639         (WebCore::CaptionUserPreferencesMediaAF::displayNameForTrack): Add an AudioTrack override so
1640         our AVFoundation tracks are processed in our CaptionUserPreferencesMediaAF implementation, not the
1641         generic version.
1642         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Add an AudioTrack override so
1643         that the menu items are sorted in order of display name, not language code.
1644         * page/CaptionUserPreferencesMediaAF.h:
1645
1646 2015-04-02  Brady Eidson  <beidson@apple.com>
1647
1648         Expose the "Share" menu for text selections on platforms where it's available.
1649         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
1650
1651         Reviewed by Sam Weinig.
1652
1653         * page/ContextMenuClient.h:
1654         (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
1655
1656         * page/ContextMenuContext.h:
1657         (WebCore::ContextMenuContext::setSelectedText):
1658         (WebCore::ContextMenuContext::selectedText):
1659
1660         * page/ContextMenuController.cpp:
1661         (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
1662         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1663
1664         * platform/ContextMenuItem.cpp:
1665         (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1666
1667         * platform/ContextMenuItem.h:
1668         (WebCore::ContextMenuItem::supportsShareMenu):
1669
1670         * platform/gtk/ContextMenuItemGtk.cpp:
1671         (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1672
1673         * platform/mac/ContextMenuItemMac.mm:
1674         (WebCore::ContextMenuItem::releasePlatformDescription):
1675         (WebCore::ContextMenuItem::getPlatformDescription):
1676         (WebCore::ContextMenuItem::supportsShareMenu):
1677         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
1678
1679         * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
1680
1681 2015-04-02  Jer Noble  <jer.noble@apple.com>
1682
1683         [Mac] Only pass in the AVURLAssetClientBundleIdentifierKey on iOS.
1684         https://bugs.webkit.org/show_bug.cgi?id=143347
1685
1686         Reviewed by Brent Fulgham.
1687
1688         Only pass in the main app bundle id into AVURLAsset via the AVURLAssetClientBundleIdentifierKey option
1689         on iOS. On OS X, setting this key can cause media playback to fail.
1690
1691         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1692         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1693
1694 2015-04-02  Roger Fong  <roger_fong@apple.com>
1695
1696         Show audio media controls on OSX.
1697         https://bugs.webkit.org/show_bug.cgi?id=143346.
1698         <rdar://problem/20306240>
1699
1700         Reviewed by Dean Jackson.
1701
1702         * Modules/mediacontrols/mediaControlsApple.css:
1703         (audio::-webkit-media-controls-panel:hover):
1704         Revert part of r180893.
1705
1706 2015-04-02  Myles C. Maxfield  <mmaxfield@apple.com>
1707
1708         Disallow ruby base from having leading or trailing expansions
1709         https://bugs.webkit.org/show_bug.cgi?id=142608
1710
1711         Reviewed by David Hyatt.
1712
1713         If we determine that a ruby base should have either a leading or trailing expansion,
1714         we shunt that expansion over to the neighboring RenderText, assuming one exists. This
1715         requires that we teach RenderText how to force leading or trailing expansions if one
1716         wouldn't naturally be present.
1717
1718         Tests: fast/ruby/ruby-expansion-cjk-2.html
1719                fast/ruby/ruby-expansion-cjk-3.html
1720                fast/ruby/ruby-expansion-cjk-4.html
1721                fast/ruby/ruby-expansion-cjk-5.html
1722                fast/ruby/ruby-expansion-cjk.html
1723
1724         * rendering/InlineFlowBox.cpp:
1725         (WebCore::InlineFlowBox::removeChild): Delete contentIsKnownToFollow.
1726         * rendering/InlineTextBox.cpp:
1727         (WebCore::InlineTextBox::expansionBehavior): Support forced leading and trailing
1728         expansions.
1729         * rendering/InlineTextBox.h:
1730         (WebCore::InlineTextBox::expansionBehavior): Moved to .cpp
1731         * rendering/RenderBlockLineLayout.cpp:
1732         (WebCore::RenderBlockFlow::updateRubyForJustifiedText): Perform relayout even if
1733         there are no expansions left. This is so that ruby bases with no expansions will get
1734         centered.
1735         (WebCore::expansionBehaviorForInlineTextBox): Update to inspect neighboring rubies.
1736         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): Use updated
1737         expansionBehaviorForInlineTextBox(). Also center ruby bases if they have no expansion
1738         opportunities.
1739         (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns): Use nullptr.
1740         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Ditto.
1741         * rendering/RenderText.cpp:
1742         (WebCore::RenderText::RenderText): Delete contentIsKnownToFollow.
1743         * rendering/RenderText.h:
1744         (WebCore::RenderText::contentIsKnownToFollow): Deleted.
1745         (WebCore::RenderText::setContentIsKnownToFollow): Deleted.
1746
1747 2015-04-02  Alexey Proskuryakov  <ap@apple.com>
1748
1749         Clean up access checks in JSHistoryCustom.cpp
1750         https://bugs.webkit.org/show_bug.cgi?id=143227
1751
1752         Reviewed by Sam Weinig.
1753
1754         * bindings/js/JSHistoryCustom.cpp:
1755         (WebCore::JSHistory::putDelegate):
1756         (WebCore::JSHistory::deleteProperty):
1757         (WebCore::JSHistory::deletePropertyByIndex):
1758         (WebCore::JSHistory::getOwnPropertyNames):
1759         (WebCore::JSHistory::pushState):
1760         (WebCore::JSHistory::replaceState):
1761
1762 2015-04-02  Alex Christensen  <achristensen@webkit.org>
1763
1764         [Content Extensions] Only add unique universal action locations.
1765         https://bugs.webkit.org/show_bug.cgi?id=143325
1766
1767         Reviewed by Benjamin Poulain.
1768
1769         * contentextensions/ContentExtensionCompiler.cpp:
1770         (WebCore::ContentExtensions::compileRuleList):
1771         Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
1772
1773 2015-04-01  Roger Fong  <roger_fong@apple.com>
1774
1775         Fix slider colors for media controls on OSX.
1776         https://bugs.webkit.org/show_bug.cgi?id=143328.
1777         <rdar://problem/20357858>
1778
1779         Reviewed by Darin Adler.
1780
1781         Fill in bottom portion of volume slider.
1782         Adjust colors to make slider controls look better. Will likely be tweaked later.
1783         * Modules/mediacontrols/mediaControlsApple.js:
1784         (Controller.prototype.drawTimelineBackground):
1785         (Controller.prototype.drawVolumeBackground):
1786
1787 2015-04-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1788
1789         Clean up EnumerationMode to easily extend
1790         https://bugs.webkit.org/show_bug.cgi?id=143276
1791
1792         Reviewed by Geoffrey Garen.
1793
1794         Use default EnumerationMode().
1795
1796         * bindings/js/Dictionary.cpp:
1797         (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
1798         (WebCore::Dictionary::getOwnPropertyNames):
1799         * bindings/js/SerializedScriptValue.cpp:
1800         (WebCore::CloneSerializer::serialize):
1801         * bindings/scripts/CodeGeneratorJS.pm:
1802         (GenerateHeader):
1803         * bindings/scripts/test/JS/JSFloat64Array.h:
1804         * bindings/scripts/test/JS/JSTestEventTarget.h:
1805         * bridge/NP_jsobject.cpp:
1806         (_NPN_Enumerate):
1807         * bridge/runtime_array.cpp:
1808         (JSC::RuntimeArray::getOwnPropertyNames):
1809
1810 2015-04-02  David Hyatt  <hyatt@apple.com>
1811
1812         [New Block-Inside-Inline Model] Implement the correct paint order for blocks inside inlines.
1813         https://bugs.webkit.org/show_bug.cgi?id=143320
1814
1815         Reviewed by Darin Adler.
1816
1817         Added new tests in fast/block/inside-inlines.
1818
1819         * rendering/EllipsisBox.cpp:
1820         (WebCore::EllipsisBox::nodeAtPoint):
1821         * rendering/EllipsisBox.h:
1822         * rendering/InlineBox.h:
1823         * rendering/InlineElementBox.cpp:
1824         (WebCore::InlineElementBox::paint):
1825         (WebCore::InlineElementBox::nodeAtPoint):
1826         * rendering/InlineElementBox.h:
1827         * rendering/InlineFlowBox.cpp:
1828         (WebCore::InlineFlowBox::nodeAtPoint):
1829         (WebCore::InlineFlowBox::paint):
1830         * rendering/InlineFlowBox.h:
1831         * rendering/InlineTextBox.cpp:
1832         (WebCore::InlineTextBox::nodeAtPoint):
1833         * rendering/InlineTextBox.h:
1834         The HitTestAction has to be passed to nodeAtPoint so that hit test actions can be honored. All the nodeAtPoint
1835         functions have been patched to include this argument. Painting and hit testing have been patched for InlineElementBox
1836         to honor phases/actions when the element is an anonymous inline block.
1837
1838         The phase filter on RenderLineBoxList has been pushed in to InlineFlowBox::paint and InlineFlowBox::nodeAtPoint so that
1839         we can respect it properly when inlines are painting by themselves (e.g., because they have a layer).
1840
1841         * rendering/RenderBlockLineLayout.cpp:
1842         (WebCore::RenderBlockFlow::createLineBoxes):
1843         (WebCore::RenderBlockFlow::constructLine):
1844         Go ahead and include all of the inline flow boxes between the root and the anonymous inline block if it turns out they
1845         need to be constructed. This will end up being relevant for outlines and for self-painting layers (e.g., opacity).
1846
1847         * rendering/RenderLineBoxList.cpp:
1848         (WebCore::RenderLineBoxList::paint):
1849         (WebCore::RenderLineBoxList::hitTest):
1850         Remove the filters here, since they get pushed in to InlineFlowBox.
1851
1852         * rendering/RootInlineBox.cpp:
1853         (WebCore::RootInlineBox::nodeAtPoint):
1854         * rendering/RootInlineBox.h:
1855         * rendering/svg/SVGInlineTextBox.cpp:
1856         (WebCore::SVGInlineTextBox::nodeAtPoint):
1857         * rendering/svg/SVGInlineTextBox.h:
1858         More patching to pass the HitTestAction into nodeAtPoint.
1859
1860 2015-04-02  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1861
1862         WebRTC: Add support for Promise-based MediaDevices.getUserMedia()
1863         https://bugs.webkit.org/show_bug.cgi?id=143255
1864
1865         Reviewed by Eric Carlson.
1866
1867         The MediaDevices object collects functionality related to local media
1868         devices. This patch adds the Promise-based version of getUserMedia()
1869         (unprefixed). Other functionality, like enumerateDevices(), will be
1870         added in later patches.
1871
1872         The old callback-based webkitGetUserMedia() (on Navigator) is kept for
1873         legacy purposes (according to the Media Capture and Streams API spec [1]).
1874         Both versions of getUserMedia are backed up by UserMediaRequest where
1875         the callbacks from the callback-based version are wrapped inside c++
1876         lambda functions. The new Promise-based getUserMedia() uses the lambda
1877         functions directly as created by the Promise bindings.
1878
1879         [1] http://w3c.github.io/mediacapture-main/archives/20150324/getusermedia.html#navigatorusermedia-interface-extensions
1880
1881         Test: fast/mediastream/MediaDevices-getUserMedia.html
1882
1883         * CMakeLists.txt:
1884         * DerivedSources.make:
1885         * Modules/mediastream/MediaDevices.cpp: Added.
1886         (WebCore::MediaDevices::create):
1887         (WebCore::MediaDevices::MediaDevices):
1888         (WebCore::MediaDevices::~MediaDevices):
1889         (WebCore::MediaDevices::document):
1890         (WebCore::MediaDevices::getUserMedia):
1891         * Modules/mediastream/MediaDevices.h: Added.
1892         * Modules/mediastream/MediaDevices.idl: Added.
1893         * Modules/mediastream/NavigatorMediaDevices.cpp: Added.
1894         (WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
1895         (WebCore::NavigatorMediaDevices::~NavigatorMediaDevices):
1896         (WebCore::NavigatorMediaDevices::from):
1897         (WebCore::NavigatorMediaDevices::mediaDevices):
1898         (WebCore::NavigatorMediaDevices::supplementName):
1899         * Modules/mediastream/NavigatorMediaDevices.h: Added.
1900         * Modules/mediastream/NavigatorMediaDevices.idl: Added.
1901         * Modules/mediastream/UserMediaRequest.cpp:
1902         (WebCore::UserMediaRequest::create):
1903         (WebCore::UserMediaRequest::UserMediaRequest):
1904         (WebCore::UserMediaRequest::didCreateStream):
1905         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
1906         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
1907         * Modules/mediastream/UserMediaRequest.h:
1908         * PlatformGTK.cmake:
1909         * WebCore.xcodeproj/project.pbxproj:
1910         * bindings/js/JSMediaDevicesCustom.cpp: Added.
1911         (WebCore::JSMediaDevices::getUserMedia):
1912
1913 2015-04-02  Eric Carlson  <eric.carlson@apple.com>
1914
1915         [iOS] Fix AirPlay problem caused by r182240
1916         https://bugs.webkit.org/show_bug.cgi?id=143337
1917
1918         Reviewed by Jer Noble.
1919
1920         * html/HTMLMediaSession.cpp:
1921         (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return false if the legacy attribute
1922             "x-webkit-airplay" has the value "allow".
1923         * html/HTMLVideoElement.cpp:
1924         (WebCore::HTMLVideoElement::parseAttribute): Don't call webkitWirelessVideoPlaybackDisabled when
1925             processing "x-webkit-airplay" and "x-webkit-wirelessvideoplaybackdisabled", just consider
1926             the attribute/value.
1927
1928 2015-04-02  Commit Queue  <commit-queue@webkit.org>
1929
1930         Unreviewed, rolling out r182265.
1931         https://bugs.webkit.org/show_bug.cgi?id=143338
1932
1933         Caused an assertion on
1934         http/tests/contentextensions/whitelist.html (Requested by ap
1935         on #webkit).
1936
1937         Reverted changeset:
1938
1939         "[Content Extensions] Only add unique universal action
1940         locations."
1941         https://bugs.webkit.org/show_bug.cgi?id=143325
1942         http://trac.webkit.org/changeset/182265
1943
1944 2015-04-01  Antti Koivisto  <antti@apple.com>
1945
1946         Use std::chrono types to represent time in response and cache classes
1947         https://bugs.webkit.org/show_bug.cgi?id=143316
1948
1949         Reviewed by Andreas Kling.
1950
1951         Use std::chrono::system_clock::time_point to represent clock times and std::chrono::microseconds to
1952         represent durations. Also use WTF::Optional for optional values (instead of coding them as NaNs).
1953
1954         * dom/Document.cpp:
1955         (WebCore::Document::lastModified):
1956         * loader/cache/CachedResource.cpp:
1957         (WebCore::CachedResource::CachedResource):
1958         (WebCore::CachedResource::freshnessLifetime):
1959         (WebCore::CachedResource::responseReceived):
1960         (WebCore::CachedResource::updateResponseAfterRevalidation):
1961         * loader/cache/CachedResource.h:
1962         * platform/network/CacheValidation.cpp:
1963         (WebCore::computeCurrentAge):
1964         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1965         (WebCore::updateRedirectChainStatus):
1966         (WebCore::redirectChainAllowsReuse):
1967         (WebCore::parseCacheControlDirectives):
1968         * platform/network/CacheValidation.h:
1969         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
1970         * platform/network/HTTPParsers.cpp:
1971         (WebCore::parseHTTPDate):
1972         (WebCore::parseDate): Deleted.
1973         * platform/network/HTTPParsers.h:
1974         * platform/network/ResourceResponseBase.cpp:
1975         (WebCore::ResourceResponseBase::ResourceResponseBase):
1976         (WebCore::ResourceResponseBase::cacheControlMaxAge):
1977         (WebCore::parseDateValueInHeader):
1978         (WebCore::ResourceResponseBase::date):
1979         (WebCore::ResourceResponseBase::age):
1980         (WebCore::ResourceResponseBase::expires):
1981         (WebCore::ResourceResponseBase::lastModified):
1982         * platform/network/ResourceResponseBase.h:
1983
1984 2015-04-02  Joonghun Park  <jh718.park@samsung.com>
1985
1986         [CSS MultiColumn] Parse "columns: auto <length>" shorthand property value properly
1987         https://bugs.webkit.org/show_bug.cgi?id=143248
1988
1989         Reviewed by Darin Adler.
1990
1991         Test: fast/multicol/columns-shorthand-parsing-2.html
1992
1993         The two longhands for the 'columns' property ('column-count' and
1994         'column-width') may both take 'auto' as a value. When we encounter
1995         'auto' during parsing the value list of a declaration, we cannot just
1996         make a guess at which property/properties that's meant for. Instead,
1997         don't assign anything to 'auto' right away, but wait until all values
1998         have been processed and at that point set the still unassigned
1999         properties to 'auto'. If 'auto' isn't in the value list at all, set
2000         unassigned properties to 'initial' for the 'columns' property, just
2001         like we do for any other property.
2002
2003         * css/CSSParser.cpp:
2004         (WebCore::CSSParser::parseValue):
2005         (WebCore::CSSParser::parseColumnWidth):
2006         (WebCore::CSSParser::parseColumnCount):
2007         (WebCore::CSSParser::parseColumnsShorthand):
2008         * css/CSSParser.h:
2009
2010 2015-04-01  Commit Queue  <commit-queue@webkit.org>
2011
2012         Unreviewed, rolling out r182247.
2013         https://bugs.webkit.org/show_bug.cgi?id=143326
2014
2015         unfortunately broke some tests (Requested by dino on #webkit).
2016
2017         Reverted changeset:
2018
2019         "Async loading of image resources"
2020         https://bugs.webkit.org/show_bug.cgi?id=134488
2021         http://trac.webkit.org/changeset/182247
2022
2023 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2024
2025         [Content Extensions] Only add unique universal action locations.
2026         https://bugs.webkit.org/show_bug.cgi?id=143325
2027
2028         Reviewed by Benjamin Poulain.
2029
2030         * contentextensions/ContentExtensionCompiler.cpp:
2031         (WebCore::ContentExtensions::compileRuleList):
2032         Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
2033
2034 2015-04-01  Roger Fong  <roger_fong@apple.com>
2035
2036         Fixes to material of inline media controls on OSX.
2037         https://bugs.webkit.org/show_bug.cgi?id=143317
2038         <rdar://problem/20357847>
2039
2040         Reviewed by Dean Jackson.
2041
2042         There are many existing tests for the media controls appearance.
2043         They are currently skipped while we are still updating the controls.
2044
2045         Expand backgrounds of control panel and volume box.
2046         Clip the darker edges away.
2047         * Modules/mediacontrols/mediaControlsApple.css:
2048         (audio::-webkit-media-controls-panel):
2049         (audio::-webkit-media-controls-panel-background-container):
2050         (audio::-webkit-media-controls-panel-tint):
2051         (audio::-webkit-media-controls-panel-background):
2052         (audio::-webkit-media-controls-panel .volume-box):
2053         (audio::-webkit-media-controls-volume-slider-container-background):
2054         (audio::-webkit-media-controls-volume-slider-container-tint):
2055         (audio::-webkit-media-controls-panel .volume-box:active):
2056         (video::-webkit-media-controls-volume-slider): 
2057         This needs to be above the background so it can be interacted with.
2058         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
2059         * Modules/mediacontrols/mediaControlsApple.js:
2060         (Controller.prototype.createControls): Create a new div for the control material.
2061         We need to clip the material and not the controls themselves.
2062         (Controller.prototype.configureInlineControls): Use new div.
2063         Remove some unnecessary logic involving hiding materials here.
2064         It just causes the materials to turn on and off at the wrong times. 
2065         (Controller.prototype.handlePanelTransitionEnd):
2066         (Controller.prototype.setPlaying):
2067         (Controller.prototype.showControls):
2068         (Controller.prototype.hideControls):
2069
2070 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
2071
2072         Media controls should not always auto-hide
2073         https://bugs.webkit.org/show_bug.cgi?id=143322
2074
2075         Reviewed by Dean Jackson.
2076
2077         * Modules/mediacontrols/mediaControlsApple.js:
2078         (Controller): Intialize new properties.
2079         (Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
2080         (Controller.prototype.controlsAlwaysVisible): New.
2081         (Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
2082         (Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
2083         (Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
2084             and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
2085             use them frequently.
2086         * Modules/mediacontrols/mediaControlsiOS.js:
2087         (ControllerIOS.prototype.controlsAlwaysVisible): New.
2088         * platform/graphics/MediaPlaybackTarget.h:
2089
2090 2015-04-01  Alexey Proskuryakov  <ap@apple.com>
2091
2092         REGRESSION (r182121): SVG animation macros cause warnings in MSVC
2093         https://bugs.webkit.org/show_bug.cgi?id=143313
2094
2095         Reviewed by Darin Adler.
2096
2097         * svg/SVGExternalResourcesRequired.h: Undo the change that caused a type mismatch.
2098
2099 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
2100
2101         Another attempt to fixi the iOS build after r182240.
2102
2103         Reviewed by Dean Jackson.
2104
2105         * platform/graphics/MediaPlaybackTarget.h:
2106         (WebCore::MediaPlaybackTarget::hasActiveRoute):
2107
2108 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
2109
2110         Fix the iOS build after r182240.
2111
2112         * platform/graphics/MediaPlaybackTarget.h:
2113
2114 2015-04-01  Yoav Weiss  <yoav@yoav.ws>
2115
2116         Async loading of image resources
2117         https://bugs.webkit.org/show_bug.cgi?id=134488
2118
2119         Reviewed by Dean Jackson.
2120
2121         This patch changes image loading to be asynchronous (per spec), in order
2122         for it to be agnostic to property setting order when it comes to src, srcset and crossorigin,
2123         as well as to enable future hooking of the <picture>-based selection logic on top of it.
2124
2125         Tests: fast/dom/HTMLImageElement/image-load-post-onload.html
2126         fast/dom/HTMLImageElement/sizes/image-sizes-js-change-reverse.html
2127
2128         * WebCore.xcodeproj/project.pbxproj: Change MicroTask.h to be private.
2129         * bindings/js/JSEventListener.cpp:
2130         (WebCore::JSEventListener::handleEvent): Add a microtask checkpoint after event handling.
2131         * bindings/js/ScheduledAction.cpp:
2132         (WebCore::ScheduledAction::execute): Add a microtask checkpoint after running of a scheduled action.
2133         * html/HTMLImageElement.cpp:
2134         (WebCore::HTMLImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2135         * html/HTMLImageLoader.cpp:
2136         (WebCore::HTMLImageLoader::notifyFinished): Avoid a crash when notifyFinished is called and there's no CachedImage.
2137         * html/HTMLInputElement.cpp:
2138         (WebCore::HTMLInputElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2139         * html/HTMLPlugInImageElement.cpp:
2140         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2141         * html/HTMLVideoElement.cpp:
2142         (WebCore::HTMLVideoElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2143         * html/parser/HTMLDocumentParser.cpp:
2144         (WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd): Add a microtask checkpoint.
2145         * loader/ImageLoader.cpp: Move image resource loading to be asynchronous.
2146         (WebCore::ImageLoader::ImageLoaderTask::create):
2147         (WebCore::ImageLoader::ImageLoaderTask::run): Run the image loading microtask and called doUpdateFromElement.
2148         (WebCore::ImageLoader::ImageLoaderTask::ImageLoaderTask):
2149         (WebCore::ImageLoader::ImageLoader):
2150         (WebCore::ImageLoader::doUpdateFromElement): This is split from the previous updateFromElement, and performs the actual resource loading.
2151         (WebCore::ImageLoader::updateFromElement): Now only prepares the stage for the actual image resource loading.
2152         (WebCore::ImageLoader::shouldLoadImmediately): If this returns true, the image resource is loaded immediately, without queueing a microtask.
2153         (WebCore::ImageLoader::notifyFinished): Add asserts.
2154         (WebCore::ImageLoader::elementDidMoveToNewDocument): Handle document load event counters decrementing and incrementing.
2155         * loader/ImageLoader.h:
2156         (WebCore::ImageLoader::imageComplete): Make sure that the image is complete only if there aren't any pending tasks.
2157         (WebCore::ImageLoader::hasPendingActivity): Make sure that pending activity takes pending tasks into account.
2158         (WebCore::ImageLoader::hasPendingTask): Getter to know if an ImageLoader has a pending task. (Used by the image loading microtask)
2159         (WebCore::ImageLoader::createWeakPtr): Create a weakPtr to be used by the microtask, so it can called back the loader if it's still alive.
2160         * loader/cache/CachedResourceLoader.cpp:
2161         (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
2162         (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2163         (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2164         * loader/cache/CachedResourceLoader.h:
2165         (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
2166         (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2167         (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2168         * svg/SVGImageElement.cpp:
2169         (WebCore::SVGImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2170         * xml/parser/XMLDocumentParser.cpp:
2171         (WebCore::XMLDocumentParser::end): Add a microtask checkpoint after XML finishes parsing.
2172
2173 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2174
2175         Unreviewed build fix when using content extensions performance reporting.
2176
2177         * contentextensions/ContentExtensionCompiler.cpp:
2178         (WebCore::ContentExtensions::compileRuleList):
2179         Time how long it takes to build the DFAs.
2180
2181 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2182
2183         Progress towards CMake on Windows and Mac.
2184         https://bugs.webkit.org/show_bug.cgi?id=143293
2185
2186         Reviewed by Filip Pizlo.
2187
2188         * PlatformMac.cmake:
2189         Tell open source builders where to find unicode headers.
2190         * PlatformWin.cmake:
2191         Include PlatformWinCairo.cmake.
2192         * PlatformWinCairo.cmake:
2193         Added from bug 115944 by Patrick Gansterer.
2194         * bindings/js/JSDOMStringListCustom.cpp:
2195         * bindings/js/JSDOMWrapper.cpp:
2196         * bindings/js/JSMessageChannelCustom.cpp:
2197         * bindings/js/JSPopStateEventCustom.cpp:
2198         * bindings/js/JSReadableStreamCustom.cpp:
2199         * bindings/js/ReadableStreamJSSource.cpp:
2200         * bindings/js/ScriptController.cpp:
2201         * css/CSSComputedStyleDeclaration.cpp:
2202         * dom/Attr.cpp:
2203         * dom/CollectionIndexCache.cpp:
2204         * platform/graphics/ANGLEWebKitBridge.h:
2205         Fixed include quirks.
2206
2207 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
2208
2209         Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
2210         https://bugs.webkit.org/show_bug.cgi?id=143288
2211         rdar://problem/16049624
2212
2213         Reviewed by Beth Dakin.
2214
2215         Remove the wheel event counting that Document does, and passes into the scrolling tree.
2216         The ScrollingTree now just uses the non-fast scrollable region to determine when to
2217         fast scroll on pages with wheel event handlers.
2218         
2219         If a handler includes position:fixed renderers, we just cover the whole document
2220         with the slow-scrolling region currently. This could be improved.
2221         
2222         * dom/Document.cpp:
2223         (WebCore::Document::Document):
2224         (WebCore::Document::didBecomeCurrentDocumentInFrame):
2225         (WebCore::Document::wheelEventHandlersChanged):
2226         (WebCore::Document::didAddWheelEventHandler):
2227         (WebCore::Document::didRemoveWheelEventHandler):
2228         (WebCore::Document::wheelEventHandlerCount):
2229         (WebCore::Document::touchEventHandlerCount):
2230         (WebCore::Document::absoluteRegionForEventTargets): Changed to return a pair<Region, bool>
2231         where the bool indicates whether any handler includes position:fixed content.
2232         (WebCore::pageWheelEventHandlerCountChanged): Deleted.
2233         (WebCore::wheelEventHandlerCountChanged): Deleted.
2234         * dom/Document.h:
2235         (WebCore::Document::wheelEventHandlerCount): Deleted.
2236         * loader/EmptyClients.h:
2237         * page/ChromeClient.h:
2238         * page/DebugPageOverlays.cpp:
2239         (WebCore::MouseWheelRegionOverlay::updateRegion):
2240         * page/scrolling/AsyncScrollingCoordinator.cpp:
2241         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
2242         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
2243         * page/scrolling/AsyncScrollingCoordinator.h:
2244         * page/scrolling/ScrollingCoordinator.cpp:
2245         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
2246         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
2247         (WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount): Deleted.
2248         (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged): Deleted.
2249         * page/scrolling/ScrollingCoordinator.h:
2250         (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
2251         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2252         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2253         (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount): Deleted.
2254         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2255         * page/scrolling/ScrollingTree.cpp:
2256         (WebCore::ScrollingTree::ScrollingTree):
2257         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2258         (WebCore::ScrollingTree::commitNewTreeState):
2259         * page/scrolling/ScrollingTree.h:
2260         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2261         (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
2262         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2263         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2264         (WebCore::logWheelEventHandlerCountChanged): Deleted.
2265         * testing/Internals.cpp:
2266         (WebCore::Internals::touchEventHandlerCount):
2267
2268 2015-04-01  David Hyatt  <hyatt@apple.com>
2269
2270         [New Block-Inside-Inline Model] Floats need to be allowed to intrude into anonymous inline-blocks.
2271         https://bugs.webkit.org/show_bug.cgi?id=143307
2272
2273         Reviewed by Dean Jackson.
2274
2275         Added fast/block/inside-inlines/basic-float-intrusion.html
2276
2277         * rendering/InlineFlowBox.cpp:
2278         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2279         Make sure to exclude the margins of an anonymous inline-block when considering the height of the line.
2280
2281         * rendering/RenderBlock.cpp:
2282         (WebCore::RenderBlock::lineHeight):
2283         (WebCore::RenderBlock::baselinePosition):
2284         Anonymous inline-block lines ignore line-height and just return the height of the block. For baseline position, the baseline
2285         is considered to be at the bottom border edge of the anonymous inline-block.
2286
2287         * rendering/RenderBlockFlow.cpp:
2288         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2289         (WebCore::RenderBlockFlow::addIntrudingFloats):
2290         * rendering/RenderBlockFlow.h:
2291         Patch float intrusion to handle the case of anonymous inline-blocks. Instead of collecting the floats from our parent(), we
2292         collect them from the containingBlock() in the anonymous inline-block case. Patch addIntrudingFloats to pass in the container
2293         that acts as the "parent", since it is not the parent() in the anonymous inline-block case.
2294
2295         * rendering/RenderBlockLineLayout.cpp:
2296         (WebCore::updateLogicalInlinePositions):
2297         Make sure to use the full available width for content always in the anonymous inline-block case, since we don't avoid the
2298         floats, but instead let them intrude into the inline-block.
2299
2300         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
2301         Patch callers of updateLogicalInlinePositions to pass in the root line box that we're checking for.
2302
2303         (WebCore::RenderBlockFlow::layoutLineBoxes):
2304         Defer the layout of anonymous inline-blocks, since they need to only lay out once the vertical position to lay them out
2305         at is known.
2306
2307         * rendering/RenderBox.cpp:
2308         (WebCore::RenderBox::createsNewFormattingContext):
2309         (WebCore::RenderBox::avoidsFloats):
2310         Anonymous inline-blocks do not establish a new block formatting context, nor do they avoid floats.
2311
2312         * rendering/line/BreakingContext.h:
2313         (WebCore::BreakingContext::handleReplaced):
2314         Add code to do a just-in-time layout of the anonymous inline-block at the time it is being examined (after the break before
2315         it was handled).
2316
2317 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
2318
2319         [Mac] Do not include route button if element does not support target playback
2320         https://bugs.webkit.org/show_bug.cgi?id=143251
2321
2322         Reviewed by Jer Noble.
2323
2324         * Modules/mediacontrols/mediaControlsApple.js:
2325         (Controller.prototype.currentPlaybackTargetIsWireless): Return false if target playback is disabled.
2326         (Controller.prototype.updateWirelessTargetAvailable): Do not show the picker if target 
2327             playback is disabled.
2328         (Controller.prototype.handleWirelessPlaybackChange): Call updateWirelessTargetAvailable.
2329
2330         * dom/Document.cpp:
2331         (WebCore::Document::showPlaybackTargetPicker): Update for Page::showPlaybackTargetPicker change.
2332         (WebCore::Document::didChoosePlaybackTarget): Notify clients in vector-order, lower level code
2333             now tracks which one requested the picker.
2334
2335         * html/HTMLMediaElement.cpp:
2336         (WebCore::HTMLMediaElement::loadResource): Don't call applyMediaPlayerRestrictions, it is done
2337             in mediaPlayerEngineFailedToLoad.
2338         (WebCore::HTMLMediaElement::setReadyState): Enqueue a target availability event if there are
2339             listeners readyState reaches HAVE_METADATA so controls are setup correctly.
2340         (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad): Call applyMediaPlayerRestrictions.
2341         (WebCore::HTMLMediaElement::clearMediaPlayer): Enqueue a target availability event in so controls
2342             have a chance to hide the picker.
2343         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): New, passthrough to the
2344             media engine.
2345         (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Ditto.
2346         (WebCore::HTMLMediaElement::startPlayingToPlaybackTarget): Ditto.
2347         (WebCore::HTMLMediaElement::stopPlayingToPlaybackTarget): Ditto.
2348         * html/HTMLMediaElement.h:
2349         * html/HTMLMediaElement.idl:
2350
2351         * html/HTMLMediaSession.cpp:
2352         (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_playbackTarget.
2353         (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): New.
2354         (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Pull logic from showingPlaybackTargetPickerPermitted 
2355             inline. Don't refuse to show a picker if the element doesn't support target playback, it is up
2356             to script to decide which elements can display a picker.
2357         (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return true if there is no player.
2358         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Call startPlayingToPlaybackTarget or 
2359             stopPlayingToPlaybackTarget because setWirelessPlaybackTarget doesn't apply the target.
2360         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Add logging.
2361         (WebCore::HTMLMediaSession::showingPlaybackTargetPickerPermitted): Deleted.
2362         * html/HTMLMediaSession.h:
2363
2364         * page/Page.cpp:
2365         (WebCore::Page::Page): Initialize m_playbackTarget.
2366         (WebCore::Page::showPlaybackTargetPicker): Don't set m_documentRequestingPlaybackTargetPicker.
2367         (WebCore::Page::didChoosePlaybackTarget): Notify Pages in vector-order, lower level code
2368             now tracks which one requested the picker.
2369         (WebCore::Page::configurePlaybackTargetMonitoring): Don't track m_requiresPlaybackTargetMonitoring, it
2370             is too easy for it to get out of sync with the UI process state.
2371         * page/Page.h:
2372
2373         * platform/audio/MediaSession.cpp:
2374         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): New, client passthrough.
2375         (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
2376         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
2377         * platform/audio/MediaSession.h:
2378         (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
2379         (WebCore::MediaSessionClient::startPlayingToPlaybackTarget):
2380         (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget):
2381
2382         * platform/audio/MediaSessionManager.cpp:
2383         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Call startPlayingToPlaybackTarget &
2384             stopPlayingToPlaybackTarget as necessary.
2385         * platform/audio/MediaSessionManager.h:
2386
2387         * platform/graphics/MediaPlaybackTarget.h:
2388         (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
2389         * platform/graphics/MediaPlaybackTargetPickerClient.h:
2390         * platform/graphics/MediaPlayer.cpp:
2391         (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): New, engine passthrough.
2392         (WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget): Ditto.
2393         (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Ditto.
2394         (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Ditto.
2395         * platform/graphics/MediaPlayer.h:
2396         * platform/graphics/MediaPlayerPrivate.h:
2397         (WebCore::MediaPlayerPrivateInterface::isCurrentPlaybackTargetSupported):
2398         (WebCore::MediaPlayerPrivateInterface::wirelessVideoPlaybackDisabled):
2399         (WebCore::MediaPlayerPrivateInterface::canPlayToWirelessPlaybackTarget):
2400         (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget):
2401         (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget):
2402
2403         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2404         (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
2405
2406         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2407         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
2408         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2409         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Use playerKVOProperties. Drive-by
2410             code cleanup.
2411         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Use playerKVOProperties.
2412         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Implement for Mac.
2413         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): Delay callbacks
2414             while setting AVPlayer property.
2415         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Add logging. Don't set
2416             the AVPlayer outputContext immediately.
2417         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): New.
2418         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): New.
2419         (WebCore::playerKVOProperties): New.
2420         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Notify when
2421             allowsExternalPlayback changes.
2422
2423         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2424         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2425         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): New.
2426         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
2427         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Ditto.
2428         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Ditto.
2429         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Ditto.
2430
2431         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2432         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2433         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Ditto.
2434         (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
2435         (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Ditto.
2436         (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Ditto.
2437         (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Ditto.
2438
2439 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2440
2441         [Content Extensions] Properly handle regexes that match everything.
2442         https://bugs.webkit.org/show_bug.cgi?id=143281
2443
2444         Reviewed by Benjamin Poulain.
2445
2446         * contentextensions/ContentExtensionCompiler.cpp:
2447         (WebCore::ContentExtensions::compileRuleList):
2448         Make sure we always have at least one NFA for rule lists with triggers that all match everything.
2449         * contentextensions/DFABytecodeInterpreter.cpp:
2450         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2451         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2452         Add helper functions to reduce duplicate code.
2453         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2454         Get all actions without flags from the DFA root.
2455         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2456         Remove branches when interpreting.
2457         * contentextensions/DFABytecodeInterpreter.h:
2458         Add helper functions to reduce duplicate code.
2459
2460 2015-04-01  Myles C. Maxfield  <mmaxfield@apple.com>
2461
2462         Addressing post-review comments.
2463         https://bugs.webkit.org/show_bug.cgi?id=143292
2464
2465         Unreviewed.
2466
2467         * platform/graphics/FontCascade.cpp:
2468         (WebCore::FontCascade::leadingExpansionOpportunity):
2469         (WebCore::FontCascade::trailingExpansionOpportunity):
2470
2471 2015-04-01  Per Arne Vollan  <peavo@outlook.com>
2472
2473         [WinCairo] Link errors, unresolved texture mapper methods.
2474         https://bugs.webkit.org/show_bug.cgi?id=143308
2475
2476         Reviewed by Alex Christensen.
2477
2478         New texture mapper files should be included in the project.
2479
2480         * WebCore.vcxproj/WebCore.vcxproj:
2481         * WebCore.vcxproj/WebCore.vcxproj.filters:
2482
2483 2015-04-01  Myles C. Maxfield  <mmaxfield@apple.com>
2484
2485         Support forcing expansion opportunities at the beginning and ending of a run
2486         https://bugs.webkit.org/show_bug.cgi?id=143292
2487
2488         Reviewed by David Hyatt.
2489
2490         Migrate ExpansionBehavior to an enum comprised of two values: one for leading behavior
2491         and one for trailing behavior. Each of these two values can take on a value of
2492         "force," "forbid," and neither. All calls that interact with justification are
2493         migrated to use this new structure.
2494
2495         Note that in this terminology, "leading" and "trailing" are with respect to the order
2496         that elements get laid out in a line. Therefore, leading is always on the left, since
2497         lines get laid out that way regardless of their bidi attributes.
2498
2499         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
2500
2501         No new tests because there is no behavior change.
2502
2503         * platform/graphics/FontCascade.cpp:
2504         (WebCore::FontCascade::expansionOpportunityCountInternal): Migrate to these new
2505         values.
2506         (WebCore::FontCascade::expansionOpportunityCount): Ditto.
2507         (WebCore::FontCascade::leadingExpansionOpportunity): Returns whether one is present
2508         or not.
2509         (WebCore::FontCascade::trailingExpansionOpportunity): Ditto.
2510         * platform/graphics/FontCascade.h:
2511         * platform/graphics/GlyphBuffer.h: New leading expansion field.
2512         (WebCore::GlyphBuffer::setLeadingExpansion):
2513         (WebCore::GlyphBuffer::leadingExpansion):
2514         * platform/graphics/TextRun.h: m_expansionBehavior needs more bits.
2515         (WebCore::TextRun::expansionBehavior):
2516         (WebCore::TextRun::allowsLeadingExpansion): Deleted.
2517         (WebCore::TextRun::allowsTrailingExpansion): Deleted.
2518         * platform/graphics/WidthIterator.cpp: Update to support new type.
2519         (WebCore::WidthIterator::WidthIterator):
2520         (WebCore::expansionLocation): Where should we insert expansions?
2521         (WebCore::WidthIterator::advanceInternal): Use expansionLocation()
2522         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2523         (WebCore::FontCascade::adjustSelectionRectForComplexText):
2524         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
2525         * platform/graphics/mac/ComplexTextController.cpp: Same as WidthIterator
2526         (WebCore::ComplexTextController::ComplexTextController):
2527         (WebCore::ComplexTextController::advance):
2528         (WebCore::expansionLocation):
2529         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2530         * platform/graphics/mac/ComplexTextController.h:
2531         (WebCore::ComplexTextController::leadingExpansion):
2532         * platform/text/TextFlags.h: Add new enum values
2533         * rendering/InlineBox.h: Update to include new values.
2534         (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields):
2535         (WebCore::InlineBox::canHaveTrailingExpansion):
2536         (WebCore::InlineBox::setCanHaveTrailingExpansion):
2537         (WebCore::InlineBox::setForceTrailingExpansion):
2538         (WebCore::InlineBox::forceTrailingExpansion):
2539         (WebCore::InlineBox::setForceLeadingExpansion):
2540         (WebCore::InlineBox::forceLeadingExpansion):
2541         * rendering/InlineTextBox.h:
2542         * rendering/RenderBlockLineLayout.cpp: Update to use new FontCascade signatures.
2543         (WebCore::expansionBehaviorForInlineTextBox):
2544         (WebCore::applyExpansionBehavior):
2545         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2546
2547 2015-04-01  Zalan Bujtas  <zalan@apple.com>
2548
2549         Lots of time spent querying table cell borders, when there are none.
2550         https://bugs.webkit.org/show_bug.cgi?id=143277
2551
2552         Reviewed by Simon Fraser.
2553
2554         This patch speeds up collapsed border queries by using existing collapsed border
2555         cache to calculate repaint rects and by introducing a fast path for zero width collapsed borders.
2556
2557         It reduces the number of calls to recompute collapsed borders from 36 000 to 1 600, while loading a page with a table of 400 rows (1 cell per row).
2558         When scrolling the same page all the way down to the bottom, the number of calls to recompute collapsed borders falls from 290 000 to 0.
2559
2560         Covered by existing tests.
2561
2562         * rendering/RenderTable.cpp:
2563         (WebCore::RenderTable::styleDidChange): This moves invalidation time from RenderTable::layout() to styleDidChange(). 
2564         (WebCore::RenderTable::invalidateCollapsedBorders):
2565         (WebCore::RenderTable::recalcCollapsedBorders):
2566         * rendering/RenderTable.h:
2567         (WebCore::RenderTable::collapsedBordersAreValid):
2568         (WebCore::RenderTable::invalidateCollapsedBorders): Deleted.
2569         * rendering/RenderTableCell.cpp:
2570         (WebCore::RenderTableCell::RenderTableCell):
2571         (WebCore::RenderTableCell::willBeRemovedFromTree): Invalidate caches so that when repaint rect is calculated, we don't end up using stale values.
2572         (WebCore::RenderTableCell::styleDidChange): Same as willBeRemovedFromTree.
2573         (WebCore::RenderTableCell::collapsedStartBorder): Check if collapsed border is zero -also query cache. 
2574         (WebCore::RenderTableCell::collapsedEndBorder):
2575         (WebCore::RenderTableCell::collapsedBeforeBorder):
2576         (WebCore::RenderTableCell::collapsedAfterBorder):
2577         (WebCore::RenderTableCell::cachedCollapsedLeftBorder):
2578         (WebCore::RenderTableCell::cachedCollapsedRightBorder):
2579         (WebCore::RenderTableCell::cachedCollapsedTopBorder):
2580         (WebCore::RenderTableCell::cachedCollapsedBottomBorder):
2581         (WebCore::RenderTableCell::paintCollapsedBorders):
2582         (WebCore::RenderTableCell::cellAtLeft): Deleted.
2583         (WebCore::RenderTableCell::cellAtRight): Deleted.
2584         (WebCore::RenderTableCell::cellAtTop): Deleted.
2585         (WebCore::RenderTableCell::cellAtBottom): Deleted.
2586         * rendering/RenderTableCell.h:
2587         (WebCore::RenderTableCell::invalidateHasEmptyCollapsedBorders):
2588         * rendering/RenderTableCol.cpp:
2589         (WebCore::RenderTableCol::styleDidChange):
2590         * rendering/RenderTableRow.cpp:
2591         (WebCore::RenderTableRow::styleDidChange):
2592         (WebCore::RenderTableRow::addChild):
2593         * rendering/RenderTableSection.cpp:
2594         (WebCore::RenderTableSection::styleDidChange):
2595         (WebCore::RenderTableSection::clearCachedCollapsedBorders): This is just an extra safety to invalidate collapsed border cache. This is always
2596         called together with RenderTable::invalidateCollapsedBorders() -and that should prevent the RenderCells to use the cache.  
2597         (WebCore::RenderTableSection::removeCachedCollapsedBorders):
2598         (WebCore::RenderTableSection::setCachedCollapsedBorder):
2599         (WebCore::RenderTableSection::cachedCollapsedBorder):
2600         * rendering/RenderTableSection.h:
2601
2602 2015-04-01  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2603
2604         [CMake][GTK] Use the right variable to include the Wayland headers.
2605         https://bugs.webkit.org/show_bug.cgi?id=143304
2606
2607         Reviewed by Carlos Garcia Campos.
2608
2609         No new tests, no behavior changes.
2610
2611         * PlatformGTK.cmake: Use the right variable WAYLAND_INCLUDE_DIRS.
2612
2613 2015-03-30  Philippe Normand  <pnormand@igalia.com>
2614
2615         [GStreamer] Move synchronous message handler to MediaPlayerPrivateGStreamerBase
2616         https://bugs.webkit.org/show_bug.cgi?id=143218
2617
2618         Reviewed by Carlos Garcia Campos.
2619
2620         Moved the pipeline pointer to the base class, sub-classes should
2621         now invoke setPipeline() when loading a resource. The base class
2622         now takes care of configuring the GL shared context, this is more
2623         logical because video rendering is also managed by this class.
2624
2625         No new tests, this is only a code refactoring.
2626
2627         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2628         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2629         (WebCore::MediaPlayerPrivateGStreamer::load):
2630         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
2631         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
2632         (WebCore::MediaPlayerPrivateGStreamer::pause):
2633         (WebCore::MediaPlayerPrivateGStreamer::duration):
2634         (WebCore::MediaPlayerPrivateGStreamer::currentTime):
2635         (WebCore::MediaPlayerPrivateGStreamer::seek):
2636         (WebCore::MediaPlayerPrivateGStreamer::doSeek):
2637         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
2638         (WebCore::MediaPlayerPrivateGStreamer::paused):
2639         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2640         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2641         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
2642         (WebCore::MediaPlayerPrivateGStreamer::setRate):
2643         (WebCore::MediaPlayerPrivateGStreamer::buffered):
2644         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2645         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
2646         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
2647         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
2648         (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
2649         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
2650         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
2651         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2652         (WebCore::MediaPlayerPrivateGStreamer::cacheDuration):
2653         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
2654         (WebCore::MediaPlayerPrivateGStreamer::audioSink):
2655         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2656         (WebCore::MediaPlayerPrivateGStreamer::simulateAudioInterruption):
2657         (WebCore::mediaPlayerPrivateSyncMessageCallback): Deleted.
2658         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Deleted.
2659         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Deleted.
2660         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2661         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2662         (WebCore::mediaPlayerPrivateNeedContextMessageCallback):
2663         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2664         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
2665         (WebCore::MediaPlayerPrivateGStreamerBase::handleNeedContextMessage):
2666         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2667         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2668
2669 2015-03-24  Philippe Normand  <philn@igalia.com>
2670
2671         [GStreamer] GstGL support in the video sink
2672         https://bugs.webkit.org/show_bug.cgi?id=138562
2673
2674         Use GStreamer's glimagesink for video rendering instead of our
2675         custom video sink if a recent-enough version of GstGL is found
2676         during the build. When glimagesink is used it passes a texture to
2677         the media player which then wraps it inside a TextureMapper
2678         texture later used for actual rendering.
2679
2680         Using this new code path will allow us to remove our custom sink
2681         entirely in the long term.
2682
2683         Reviewed by Carlos Garcia Campos.
2684
2685         No new test, existing media tests cover video rendering already.
2686
2687         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2688         (WebCore::mediaPlayerPrivateDrawCallback): client-draw signal callback.
2689         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2690         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2691         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Better
2692         check for sample validity.
2693         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Ditto.
2694         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Trigger a
2695         repaint and wait its completion.
2696         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
2697         Extract texture ID and video dimensions from the sample and do actual paint.
2698         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Use
2699         glimagesink if GstGL is available.
2700         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2701
2702 2015-04-01  Joonghun Park  <jh718.park@samsung.com>
2703
2704         nullptr cleanup in StyleResolver
2705         https://bugs.webkit.org/show_bug.cgi?id=143260
2706
2707         Reviewed by Ryosuke Niwa.
2708
2709         No new tests, no behavior changes
2710
2711         * css/StyleResolver.cpp:
2712         (WebCore::StyleResolver::State::initForStyleResolve):
2713         (WebCore::StyleResolver::locateCousinList):
2714         (WebCore::StyleResolver::locateSharedStyle):
2715         (WebCore::StyleResolver::keyframeStylesForAnimation):
2716         (WebCore::StyleResolver::pseudoStyleForElement):
2717         (WebCore::StyleResolver::pseudoStyleRulesForElement):
2718         (WebCore::StyleResolver::findFromMatchedPropertiesCache):
2719         (WebCore::StyleResolver::applyMatchedProperties):
2720         (WebCore::StyleResolver::applyPropertyToStyle):
2721         (WebCore::StyleResolver::MatchedProperties::MatchedProperties):
2722         * css/StyleResolver.h:
2723         (WebCore::PseudoStyleRequest::PseudoStyleRequest):
2724         (WebCore::StyleResolverParentPusher::StyleResolverParentPusher):
2725
2726 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
2727
2728         Make it possible to compute a region for elements on the page that have wheel event handlers
2729         https://bugs.webkit.org/show_bug.cgi?id=142807
2730
2731         Reviewed by David Hyatt.
2732         
2733         Make it possible to compute a region that covers the elements on the page that have
2734         a wheel event handler. This region may overestimate, but must not underestimate the area.
2735         
2736         Elements with wheel handlers are registered on the document, and when a document gains
2737         its first wheel handler, it registers the ownerElement in the parent document. Thus, on 
2738         the main frame, the region encompasses elements with handlers, and iframes whose subdocuments
2739         have handlers.
2740         
2741         Element gains some functions that allow it to return a rect which is the bounds of the element's
2742         renderer, and renders for its descendant elements, which is the size or larger than the event
2743         handling region for that element. Some configurations (e.g. position:fixed) require special
2744         treatment.
2745         
2746         Document::absoluteRegionForEventTargets() can then iterate over all elements in the given set,
2747         and build a Region for those (short-circuiting if the document itself has a handler).
2748         
2749         The new code is exercised for the debug MouseWheelRegionOverlay, and also added to the
2750         non-fast scrollable region, used by threaded scrolling.
2751
2752         Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/handlers-in-iframes.html
2753                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child.html
2754                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns.html
2755                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-region.html
2756                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed.html
2757                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document.html
2758                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed.html
2759                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic.html
2760
2761         * dom/ContainerNode.h:
2762         (WebCore::ContainerNode::absoluteEventHandlerBounds): Base class implementation; returns empty rect.
2763         * dom/Document.cpp:
2764         (WebCore::Document::prepareForDestruction): Unregister from the parent document.
2765         (WebCore::Document::didAddWheelEventHandler): Add to the wheel handler set. Tell the parent
2766         document if we are adding wheel handlers for the first time. Eventually the wheelEventHandlerCountChanged()
2767         code will be removed, now we have the set. Tell debug overlays that we changed.
2768         (WebCore::Document::didRemoveWheelEventHandler): Remove from the set, and unregister with the parent
2769         document if necessary. Tell debug overlays that we changed.
2770         (WebCore::Document::didAddTouchEventHandler): Minor cleanup.
2771         (WebCore::Document::didRemoveTouchEventHandler): Ditto.
2772         (WebCore::Document::didRemoveEventTargetNode): Remove from wheel targets.
2773         (WebCore::Document::absoluteEventHandlerBounds): Implementation of the ContainerNode
2774         function, just return the document bounds.
2775         (WebCore::Document::absoluteRegionForEventTargets): Iterate over the given event targets,
2776         and call absoluteEventHandlerBounds() on each.
2777         * dom/Document.h:
2778         (WebCore::Document::wheelEventTargets):
2779         * dom/Element.cpp:
2780         (WebCore::layoutOverflowRectContainsAllDescendants): Return true if we can determine that the
2781         layoutOverflow bounds of the given renderer contains the renderers of all descendant elements.
2782         (WebCore::Element::eventBounds): Get the "event handling" bounds of this element (excluding
2783         descendants), and while doing so, compute whether any descendants are position:fixed, and whether
2784         these bounds are known to include descendants.
2785         (WebCore::Element::eventBoundsOfElementAndDescendants): Recursive function that short-circuits
2786         if it can determine that descendants are enclosed by the bounds.
2787         (WebCore::Element::absoluteEventHandlerBounds):
2788         * dom/Element.h:
2789         * page/DebugPageOverlays.cpp:
2790         (WebCore::MouseWheelRegionOverlay::updateRegion): Ask the document for the region of wheel
2791         event handlers.
2792         * page/scrolling/ScrollingCoordinator.cpp:
2793         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Add the wheel handler region
2794         to the non-fast scrollable region.
2795         * rendering/RenderLayer.cpp:
2796         (WebCore::RenderLayer::scrollTo): Overflow scrolling needs to dirty event regions.
2797         * rendering/RenderObject.cpp:
2798         (WebCore::RenderObject::absoluteBoundingBoxRect): Need to pass the "wasFixed" flag out
2799         of this function.
2800         (WebCore::RenderObject::localToAbsolute): Ditto.
2801         * rendering/RenderObject.h:
2802
2803 2015-03-31  Alexey Proskuryakov  <ap@apple.com>
2804
2805         Fix bindings tests results after <http://trac.webkit.org/changeset/182205>.
2806
2807         * bindings/scripts/test/JS/JSTestObj.cpp:
2808         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
2809         (WebCore::setJSTestObjConditionalAttr4Constructor):
2810         (WebCore::setJSTestObjConditionalAttr5Constructor):
2811         (WebCore::setJSTestObjConditionalAttr6Constructor):
2812         (WebCore::setJSTestObjReplaceableAttribute):
2813
2814 2015-03-31  Benjamin Poulain  <bpoulain@apple.com>
2815
2816         Content Extensions: split the state machines to minimize prefix states
2817         https://bugs.webkit.org/show_bug.cgi?id=143253
2818
2819         Reviewed by Alex Christensen.
2820
2821         With this patch, we refine how the URLs are partitioned to make
2822         multiple small machines instead of a big one.
2823
2824         Here, considering each pattern as a language, I took the simplest
2825         partitioning: take the union minimizing the states
2826         that differentiate languages.
2827
2828         The idea is the following: every time a subgraph can be skipped
2829         or repeated, it is an opportunity for a merged language to start
2830         with a distinguishable state.
2831         To avoid accumulating those differences, we only merge languages
2832         that share the exact same "variable" subgraph as a prefix.
2833
2834         A side effect is that we could create as many machines as we have patterns.
2835         We'll have to address that in a follow-up by merging small machines
2836         until they reach a certain size.
2837         In the common cases, patterns look very much alike so that is not a problem
2838         at the moment.
2839
2840         * WebCore.xcodeproj/project.pbxproj:
2841         * contentextensions/CombinedURLFilters.cpp: Added.
2842         I moved the prefix tree and graph construction out of URLFilterParser for clarity.
2843
2844         CombinedURLFilters maintain the term prefix tree. Instead of generating on the fly
2845         as we build the prefix tree, we first generate the entire tree of terms, then generate
2846         NFAs for each branch without a variable prefix.
2847
2848         (WebCore::ContentExtensions::CombinedURLFilters::CombinedURLFilters):
2849         (WebCore::ContentExtensions::CombinedURLFilters::~CombinedURLFilters):
2850
2851         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
2852         Note here that we keep track of which subtree contains a any variable length term.
2853         Instead of anotating the edges, the destination vertex is anotated with the information
2854         from the edge.
2855
2856         The flag "inVariableLengthPrefix" is there to simplify traversal.
2857
2858         (WebCore::ContentExtensions::generateNFAForSubtree):
2859         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
2860         Since we are traversing a tree generated by string, using the stack for recursion
2861         is out of the question.
2862
2863         Fortunately, the entire state is very simple when going depth first: we only need
2864         the active vertex and edge, and traverse the edges in order.
2865
2866         To do keep track of the edges, I used the HashTable iterator on the current term.
2867         Since no vertex is modified for generation, storing the iterators is safe.
2868
2869         * contentextensions/CombinedURLFilters.h:
2870         * contentextensions/ContentExtensionCompiler.cpp:
2871         (WebCore::ContentExtensions::compileRuleList):
2872         * contentextensions/NFA.cpp:
2873         (WebCore::ContentExtensions::NFA::setActions):
2874         (WebCore::ContentExtensions::NFA::debugPrintDot):
2875         (WebCore::ContentExtensions::NFA::setFinal): Deleted.
2876         (WebCore::ContentExtensions::NFA::addRuleId): Deleted.
2877         * contentextensions/NFA.h:
2878         * contentextensions/NFAGraphBuilder.cpp: Added.
2879         * contentextensions/NFAGraphBuilder.h: Added.
2880         * contentextensions/NFANode.h:
2881         * contentextensions/Term.h: Added.
2882         Move the Term to its own file since it is now shared between the parser
2883         and the CombinedURLFilters.
2884
2885         (WebCore::ContentExtensions::Term::CharacterSet::operator==):
2886         (WebCore::ContentExtensions::Term::CharacterSet::hash):
2887         (WebCore::ContentExtensions::Term::Group::operator==):
2888         (WebCore::ContentExtensions::Term::Group::hash):
2889         (WebCore::ContentExtensions::TermHash::hash):
2890         (WebCore::ContentExtensions::TermHash::equal):
2891         (WebCore::ContentExtensions::Term::Term):
2892         (WebCore::ContentExtensions::Term::~Term):
2893         (WebCore::ContentExtensions::Term::isValid):
2894         (WebCore::ContentExtensions::Term::addCharacter):
2895         (WebCore::ContentExtensions::Term::extendGroupSubpattern):
2896         (WebCore::ContentExtensions::Term::quantify):
2897         (WebCore::ContentExtensions::Term::Term::generateGraph):
2898         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
2899         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
2900         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
2901         (WebCore::ContentExtensions::Term::hasFixedLength):
2902         (WebCore::ContentExtensions::Term::operator=):
2903         (WebCore::ContentExtensions::Term::operator==):
2904         (WebCore::ContentExtensions::Term::hash):
2905         (WebCore::ContentExtensions::Term::isEmptyValue):
2906         (WebCore::ContentExtensions::Term::isDeletedValue):
2907         (WebCore::ContentExtensions::Term::isUniversalTransition):
2908         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2909         (WebCore::ContentExtensions::Term::destroy):
2910         * contentextensions/URLFilterParser.cpp:
2911         (WebCore::ContentExtensions::PatternParser::PatternParser):
2912         (WebCore::ContentExtensions::PatternParser::finalize):
2913         (WebCore::ContentExtensions::PatternParser::assertionBOL):
2914         (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
2915         (WebCore::ContentExtensions::URLFilterParser::addPattern):
2916         (WebCore::ContentExtensions::Term::Term): Deleted.
2917         (WebCore::ContentExtensions::Term::~Term): Deleted.
2918         (WebCore::ContentExtensions::Term::isValid): Deleted.
2919         (WebCore::ContentExtensions::Term::addCharacter): Deleted.
2920         (WebCore::ContentExtensions::Term::extendGroupSubpattern): Deleted.
2921         (WebCore::ContentExtensions::Term::quantify): Deleted.
2922         (WebCore::ContentExtensions::Term::generateGraph): Deleted.
2923         (WebCore::ContentExtensions::Term::isEndOfLineAssertion): Deleted.
2924         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter): Deleted.
2925         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString): Deleted.
2926         (WebCore::ContentExtensions::Term::operator=): Deleted.
2927         (WebCore::ContentExtensions::Term::operator==): Deleted.
2928         (WebCore::ContentExtensions::Term::hash): Deleted.
2929         (WebCore::ContentExtensions::Term::isEmptyValue): Deleted.
2930         (WebCore::ContentExtensions::Term::isDeletedValue): Deleted.
2931         (WebCore::ContentExtensions::Term::isUniversalTransition): Deleted.
2932         (WebCore::ContentExtensions::Term::generateSubgraphForAtom): Deleted.
2933         (WebCore::ContentExtensions::Term::destroy): Deleted.
2934         (WebCore::ContentExtensions::Term::CharacterSet::operator==): Deleted.
2935         (WebCore::ContentExtensions::Term::CharacterSet::hash): Deleted.
2936         (WebCore::ContentExtensions::Term::Group::operator==): Deleted.
2937         (WebCore::ContentExtensions::Term::Group::hash): Deleted.
2938         (WebCore::ContentExtensions::TermHash::hash): Deleted.
2939         (WebCore::ContentExtensions::TermHash::equal): Deleted.
2940         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder): Deleted.
2941         (WebCore::ContentExtensions::GraphBuilder::finalize): Deleted.
2942         (WebCore::ContentExtensions::GraphBuilder::assertionBOL): Deleted.
2943         * contentextensions/URLFilterParser.h:
2944
2945 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
2946
2947         Move ExpansionBehaviorFlags and TextDirection to their own file
2948         https://bugs.webkit.org/show_bug.cgi?id=143273
2949
2950         Reviewed by Simon Fraser.
2951
2952         This is a mechanical change. It just moves code around.
2953
2954         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
2955
2956         No new tests because there is no behavior change.
2957
2958         * Modules/notifications/Notification.h:
2959         * WebCore.vcxproj/WebCore.vcxproj:
2960         * WebCore.vcxproj/WebCore.vcxproj.filters:
2961         * WebCore.xcodeproj/project.pbxproj:
2962         * css/CSSPrimitiveValueMappings.h:
2963         * css/CSSProperty.h:
2964         * dom/Position.h:
2965         * editing/VisiblePosition.h:
2966         * editing/VisibleUnits.h:
2967         * editing/htmlediting.h:
2968         * html/canvas/CanvasRenderingContext2D.cpp:
2969         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2970         * html/canvas/CanvasRenderingContext2D.h:
2971         * platform/LengthBox.h:
2972         * platform/PopupMenuStyle.h:
2973         * platform/graphics/FontCascade.h:
2974         * platform/graphics/LayoutBoxExtent.h:
2975         * platform/graphics/TextRun.h:
2976         * platform/ios/SelectionRect.h:
2977         * platform/text/BidiResolver.h:
2978         * platform/text/StringWithDirection.h:
2979         * platform/text/TextHelpers.h: Renamed from Source/WebCore/platform/text/TextDirection.h.
2980         (WebCore::isLeftToRightDirection):
2981         * platform/win/PopupMenuWin.cpp:
2982         (WebCore::PopupMenuWin::paint):
2983         * rendering/EllipsisBox.cpp:
2984         (WebCore::EllipsisBox::paint):
2985         (WebCore::EllipsisBox::selectionRect):
2986         (WebCore::EllipsisBox::paintSelection):
2987         * rendering/HitTestLocation.h:
2988         * rendering/HitTestResult.h:
2989         * rendering/InlineBox.h:
2990         * rendering/InlineTextBox.h:
2991         (WebCore::InlineTextBox::expansionBehavior):
2992         * rendering/RenderBlock.cpp:
2993         (WebCore::constructTextRunInternal):
2994         (WebCore::RenderBlock::constructTextRun):
2995         * rendering/RenderBlock.h:
2996         * rendering/RenderFileUploadControl.cpp:
2997         (WebCore::RenderFileUploadControl::paintObject):
2998         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
2999         * rendering/RenderListBox.cpp:
3000         (WebCore::RenderListBox::updateFromElement):
3001         (WebCore::RenderListBox::paintItemForeground):
3002         * rendering/RenderListMarker.cpp:
3003         (WebCore::RenderListMarker::computePreferredLogicalWidths):
3004         (WebCore::RenderListMarker::getRelativeMarkerRect):
3005         * rendering/RenderMenuList.cpp:
3006         (RenderMenuList::updateOptionsWidth):
3007         * rendering/RenderTextControl.cpp:
3008         (WebCore::RenderTextControl::getAverageCharWidth):
3009         * rendering/RenderThemeIOS.mm:
3010         * rendering/style/RenderStyle.h:
3011         * rendering/svg/SVGInlineTextBox.cpp:
3012         (WebCore::SVGInlineTextBox::constructTextRun):
3013         * rendering/svg/SVGTextMetrics.cpp:
3014         (WebCore::SVGTextMetrics::constructTextRun):
3015
3016 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3017
3018         Clean up Identifier factories to clarify the meaning of StringImpl*
3019         https://bugs.webkit.org/show_bug.cgi?id=143146
3020
3021         Reviewed by Filip Pizlo.
3022
3023         Just change Identifier creations.
3024
3025         1. If the code creates Identifier from StringImpl*
3026         which is treated as symbol or string(unique id), use Identifier::fromUid.
3027         2. If the code creates Identifier from string, use Identifier::fromString.
3028
3029         * Modules/plugins/QuickTimePluginReplacement.mm:
3030         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
3031         (WebCore::QuickTimePluginReplacement::installReplacement):
3032         * bindings/js/IDBBindingUtilities.cpp:
3033         (WebCore::get):
3034         (WebCore::set):
3035         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3036         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames):
3037         * bindings/js/JSCallbackData.cpp:
3038         (WebCore::JSCallbackData::invokeCallback):
3039         * bindings/js/JSCommandLineAPIHostCustom.cpp:
3040         (WebCore::getJSListenerFunctions):
3041         (WebCore::JSCommandLineAPIHost::getEventListeners):
3042         * bindings/js/JSCryptoAlgorithmBuilder.cpp:
3043         (WebCore::JSCryptoAlgorithmBuilder::add):
3044         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3045         (WebCore::getProperty):
3046         (WebCore::getHashAlgorithm):
3047         * bindings/js/JSCryptoKeySerializationJWK.cpp:
3048         (WebCore::getJSArrayFromJSON):
3049         (WebCore::getStringFromJSON):
3050         (WebCore::getBooleanFromJSON):
3051         (WebCore::addToJSON):
3052         (WebCore::buildJSONForRSAComponents):
3053         (WebCore::addBoolToJSON):
3054         (WebCore::addUsagesToJSON):
3055         * bindings/js/JSCustomXPathNSResolver.cpp:
3056         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
3057         * bindings/js/JSDOMStringMapCustom.cpp:
3058         (WebCore::JSDOMStringMap::getOwnPropertyNames):
3059         * bindings/js/JSDOMWindowCustom.cpp:
3060         (WebCore::JSDOMWindow::defineOwnProperty):
3061         (WebCore::JSDOMWindow::setLocation):
3062         (WebCore::DialogHandler::dialogCreated):
3063         (WebCore::DialogHandler::returnValue):
3064         * bindings/js/JSDeviceMotionEventCustom.cpp:
3065         (WebCore::readAccelerationArgument):
3066         (WebCore::readRotationRateArgument):
3067         (WebCore::createAccelerationObject):
3068         (WebCore::createRotationRateObject):
3069         * bindings/js/JSDictionary.cpp:
3070         (WebCore::JSDictionary::tryGetProperty):
3071         * bindings/js/JSEventListener.cpp:
3072         (WebCore::JSEventListener::handleEvent):
3073         * bindings/js/JSHTMLAllCollectionCustom.cpp:
3074         (WebCore::callHTMLAllCollection):
3075         (WebCore::JSHTMLAllCollection::item):
3076         (WebCore::JSHTMLAllCollection::namedItem):
3077         * bindings/js/JSHTMLDocumentCustom.cpp:
3078         (WebCore::JSHTMLDocument::all):
3079         (WebCore::JSHTMLDocument::setAll):
3080         (WebCore::JSHTMLDocument::open):
3081         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
3082         (WebCore::JSHTMLFormControlsCollection::namedItem):
3083         * bindings/js/JSIDBDatabaseCustom.cpp:
3084         (WebCore::JSIDBDatabase::createObjectStore):
3085         * bindings/js/JSIDBObjectStoreCustom.cpp:
3086         (WebCore::JSIDBObjectStore::createIndex):
3087         * bindings/js/JSImageDataCustom.cpp:
3088         (WebCore::toJS):
3089         * bindings/js/JSInspectorFrontendHostCustom.cpp:
3090         (WebCore::populateContextMenuItems):
3091         * bindings/js/JSLazyEventListener.cpp:
3092         (WebCore::JSLazyEventListener::initializeJSFunction):
3093         * bindings/js/JSNodeFilterCondition.cpp:
3094         (WebCore::JSNodeFilterCondition::acceptNode):
3095         * bindings/js/JSSQLResultSetRowListCustom.cpp:
3096         (WebCore::JSSQLResultSetRowList::item):
3097         * bindings/js/JSStorageCustom.cpp:
3098         (WebCore::JSStorage::getOwnPropertyNames):
3099         * bindings/js/ReadableStreamJSSource.cpp:
3100         (WebCore::setInternalSlotToObject):
3101         (WebCore::getInternalSlotFromObject):
3102         * bindings/js/ScriptGlobalObject.cpp:
3103         (WebCore::ScriptGlobalObject::set):
3104         (WebCore::ScriptGlobalObject::get):
3105         (WebCore::ScriptGlobalObject::remove):
3106         * bindings/js/SerializedScriptValue.cpp:
3107         (WebCore::CloneSerializer::CloneSerializer):
3108         (WebCore::CloneSerializer::write):
3109         (WebCore::CloneDeserializer::deserialize):
3110         * bindings/objc/WebScriptObject.mm:
3111         (-[WebScriptObject callWebScriptMethod:withArguments:]):
3112         (-[WebScriptObject setValue:forKey:]):
3113         (-[WebScriptObject valueForKey:]):
3114         (-[WebScriptObject removeWebScriptKey:]):
3115         (-[WebScriptObject hasWebScriptKey:]):
3116         * bindings/scripts/CodeGeneratorJS.pm:
3117         (GenerateImplementation):
3118         * bindings/scripts/test/JS/JSFloat64Array.cpp:
3119         (WebCore::JSFloat64Array::getOwnPropertyNames):
3120         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3121         (WebCore::JSTestEventTarget::getOwnPropertyNames):
3122         * bindings/scripts/test/JS/JSTestObj.cpp:
3123         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
3124         (WebCore::setJSTestObjConditionalAttr4Constructor):
3125         (WebCore::setJSTestObjConditionalAttr5Constructor):
3126         (WebCore::setJSTestObjConditionalAttr6Constructor):
3127         (WebCore::setJSTestObjReplaceableAttribute):
3128         * bridge/c/c_utility.cpp:
3129         (JSC::Bindings::identifierFromNPIdentifier):
3130         * bridge/objc/objc_runtime.mm:
3131         (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
3132         * bridge/testbindings.cpp:
3133         (main):
3134         * bridge/testbindings.mm:
3135         (main):
3136         * contentextensions/ContentExtensionParser.cpp:
3137         (WebCore::ContentExtensions::loadTrigger):
3138         (WebCore::ContentExtensions::loadAction):
3139         * html/HTMLMediaElement.cpp:
3140         (WebCore::HTMLMediaElement::parseAttribute):
3141         * html/HTMLPlugInImageElement.cpp:
3142         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
3143         * testing/js/WebCoreTestSupport.cpp:
3144         (WebCoreTestSupport::injectInternalsObject):
3145
3146 2015-03-31  Jer Noble  <jer.noble@apple.com>
3147
3148         [Mac] Songza.com fails to play; QTKit path reports it is always "seeking".
3149         https://bugs.webkit.org/show_bug.cgi?id=143274
3150
3151         Rubber-stamped by Eric Carlson.
3152
3153         MediaTime::invalidTime() is always greater than any valid time. So when
3154         checking to see if MediaPlayerPrivateQTKit is seeking, first check if the
3155         m_seekTo time is valid before checking whether it's > 0.
3156
3157         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3158         (WebCore::MediaPlayerPrivateQTKit::seeking):
3159
3160 2015-03-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
3161
3162         border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
3163         https://bugs.webkit.org/show_bug.cgi?id=142650.
3164
3165         Reviewed by Simon Fraser.
3166
3167         The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be
3168         drawn if its RenderStyle has a non-zero width border or the border-image
3169         has the keyword fill.
3170
3171         Tests: fast/borders/border-image-fill-inline-no-border.html
3172                fast/borders/border-image-fill-no-border.html
3173
3174         * rendering/InlineFlowBox.cpp:
3175         (WebCore::InlineFlowBox::paintBoxDecorations):
3176         * rendering/RenderBox.cpp:
3177         (WebCore::RenderBox::paintBoxDecorations):
3178         * rendering/RenderBoxModelObject.cpp:
3179         (WebCore::RenderBoxModelObject::hasBoxDecorationStyle):
3180         * rendering/RenderTable.cpp:
3181         (WebCore::RenderTable::paintBoxDecorations):
3182         * rendering/style/BorderData.h:
3183         (WebCore::BorderData::hasFill):
3184         * rendering/style/RenderStyle.h:
3185
3186 2015-03-31  Alex Christensen  <achristensen@webkit.org>
3187
3188         [Win] Unreviewed build fix.
3189
3190         * WebCore.vcxproj/WebCore.vcxproj:
3191         Don't include inspector files twice in debug builds.
3192         InspectorAllInOne.cpp is now used on debug builds.
3193
3194 2015-03-31  David Hyatt  <hyatt@apple.com>
3195
3196         [New Block-Inside-Inline Model] Anonymous inline-blocks should size as though they are block-level.
3197         https://bugs.webkit.org/show_bug.cgi?id=143271
3198
3199         Reviewed by Dean Jackson.
3200
3201         Added fast/block/inside-inlines/block-width-check.html.
3202
3203         * rendering/RenderBox.cpp:
3204         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
3205         Return false when an anonymous inline-block is encountered, since we want to treat it like a regular
3206         block instead.
3207
3208 2015-03-31  Commit Queue  <commit-queue@webkit.org>
3209
3210         Unreviewed, rolling out r182186.
3211         https://bugs.webkit.org/show_bug.cgi?id=143270
3212
3213         it crashes all the WebGL tests on the Debug bots (Requested by
3214         dino on #webkit).
3215
3216         Reverted changeset:
3217
3218         "Web Inspector: add 2D/WebGL canvas instrumentation
3219         infrastructure"
3220         https://bugs.webkit.org/show_bug.cgi?id=137278
3221         http://trac.webkit.org/changeset/182186
3222
3223 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
3224
3225         Crash in CGContextShowGlyphsWithAdvances when passing kCGFontIndexInvalid
3226         https://bugs.webkit.org/show_bug.cgi?id=143114
3227
3228         This is a workaround for <rdar://problem/20230073>. Please remove when it is no longer necessary.
3229
3230         Reviewed by Alexey Proskuryakov.
3231
3232         Covered by:
3233         compositing/regions/floated-region-with-transformed-child.html
3234         compositing/regions/floated-region-with-transformed-child-expected.html
3235         fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html
3236         fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html
3237         fast/regions/overflow/overflow-content-transform-rotate.html
3238         fast/regions/overflow/overflow-content-transform-rotate-expected.html
3239
3240         * platform/graphics/GlyphBuffer.h:
3241         (WebCore::GlyphBuffer::shrink): Performing shaping may remove glyphs, so we need to shrink the GlyphBuffer.
3242         * platform/graphics/WidthIterator.cpp:
3243         (WebCore::applyFontTransforms): Filter out kCGFontIndexInvalid.
3244         (WebCore::WidthIterator::advanceInternal): Moved code into applyFontTransforms, and trigger the
3245         shrink of the GlyphBuffer.
3246
3247 2015-03-31  Beth Dakin  <bdakin@apple.com>
3248
3249         REGRESSION (r173484): Reducing content of scrollable region does not reset scroll 
3250         position
3251         https://bugs.webkit.org/show_bug.cgi?id=138525
3252         -and corresponding-
3253         rdar://problem/18166043
3254
3255         Reviewed by Simon Fraser.
3256
3257         The change that caused this regression was correct. That change does not allow 
3258         RenderLayer to update scroll position after a layout if a rubber-band is currently 
3259         happening. The change caused this regression because all of the member variables 
3260         in ScrollController that attempt to keep track of the current state of the scroll 
3261         gesture (m_inScrollGesture, m_momentumScrollInProgress, and 
3262         m_snapRubberbandTimerIsActive) all indicated that a momentum scroll gesture was 
3263         still in action for this div even though it very much is not when the bug happens. 
3264         Those variables were never properly re-set because the 
3265         PlatformWheelEventPhaseEnded events never got dispatched to the ScrollController, 
3266         which brought the investigation back to Element.
3267
3268         We must still dispatch events that have zero delta so that the default event 
3269         handlers can handle them, but we should stopPropagation() so that these events are 
3270         not sent to the DOM. Websites will break if they get wheel events with no delta.
3271         * dom/Element.cpp:
3272         (WebCore::Element::dispatchWheelEvent):
3273
3274 2015-03-31  Alex Christensen  <achristensen@webkit.org>
3275
3276         [Win] Unreviewed debug build fix after r182186.
3277
3278         * WebCore.vcxproj/WebCore.vcxproj:
3279         Include InspectorAllInOne.cpp in debug builds.
3280
3281 2015-03-30  David Hyatt  <hyatt@apple.com>
3282
3283         [New Block-Inside-Inline Model] Make sure line breaks occur before and after the anonymous inline-block.
3284         https://bugs.webkit.org/show_bug.cgi?id=143238.
3285
3286         Reviewed by Dean Jackson.
3287
3288         Added fast/blocks/inside-inlines/breaking-behavior.html (and new-model equivalent).
3289
3290         * rendering/InlineFlowBox.h:
3291         (WebCore::InlineFlowBox::InlineFlowBox):
3292         (WebCore::InlineFlowBox::hasAnonymousInlineBlock):
3293         (WebCore::InlineFlowBox::setHasAnonymousInlineBlock):
3294         Add a bit to root line boxes (stored in the InlineFlowBox since it has free bits) that indicates whether
3295         or not a line is an anonymous inline-block line.
3296
3297         * rendering/RenderBlockFlow.cpp:
3298         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
3299         Patch the preferred logical width computation to break both before and after an anonymous inline-block.
3300         Also make sure to strip trailing spaces from the line before the anonymous inline-block.
3301
3302         * rendering/RenderBlockLineLayout.cpp:
3303         (WebCore::RenderBlockFlow::constructLine):
3304         Patch line construction so that no intermediate boxes are constructed between the InlineBox for the anonymous
3305         inline-block and the root line box.
3306
3307         * rendering/RootInlineBox.cpp:
3308         (WebCore::RootInlineBox::ascentAndDescentForBox):
3309         The height of a "line" that holds an anonymous inline-block should ignore line-box-contain and also make sure
3310         that the margins of the replaced element are "outside" the line, since those margins will collapse.
3311
3312         * rendering/line/BreakingContext.h:
3313         (WebCore::BreakingContext::handleReplaced):
3314         Patch handleReplaced to make sure breaks occur both before and after an anonymous inline-block. In the case of
3315         a break after the block, we setPreviousLineBrokeCleanly to true so that <br>s that follow the anonymous inline-block
3316         are respected.
3317
3318 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
3319
3320         [EFL] Add nullptr check to GraphicsContext3D::makeContextCurrent()
3321         https://bugs.webkit.org/show_bug.cgi?id=143214
3322
3323         Reviewed by Žan Doberšek.
3324
3325         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
3326         (WebCore::GraphicsContext3D::makeContextCurrent):
3327
3328 2015-03-31  Matt Baker  <mattbaker@apple.com>
3329
3330         Web Inspector: add 2D/WebGL canvas instrumentation infrastructure
3331         https://bugs.webkit.org/show_bug.cgi?id=137278
3332
3333         Reviewed by Timothy Hatcher.
3334
3335         Added backend agent for canvas inspection. A canvas is instrumented once its CanvasRenderingContext has been
3336         created. WebGLRenderingContext is instrumented to track the lifetime of shader program objects.
3337
3338         To instrument off-screen rendering contexts (CSS canvases and detached canvas elements), the canvas agent must
3339         track all CanvasRenderingContexts as they are created, even in the absense of the frontend. As far as I know,
3340         there is no practical way to identify rendering contexts belonging to a frame that are not in the DOM. In the
3341         absence of the inspector frontend the agent does only the minimum required to track the lifetime of rendering
3342         contexts and their resources, to avoid creating a negative performance impact.
3343
3344         Tests: inspector/canvas/canvas-add-remove-events.html
3345                inspector/canvas/canvas-context-attributes.html
3346                inspector/canvas/canvas-css-name.html
3347
3348         * CMakeLists.txt:
3349         * WebCore.xcodeproj/project.pbxproj:
3350
3351         * dom/Document.cpp:
3352         (WebCore::Document::getCSSCanvasElement):
3353         Instrumentation for CSS canvases.
3354
3355         * html/HTMLCanvasElement.cpp:
3356         (WebCore::HTMLCanvasElement::getContext):
3357         Instrumentation for context creation.
3358
3359         * html/canvas/WebGLRenderingContextBase.cpp:
3360         (WebCore::WebGLRenderingContextBase::attachShader):
3361         (WebCore::WebGLRenderingContextBase::createProgram):
3362         (WebCore::WebGLRenderingContextBase::deleteProgram):
3363         (WebCore::WebGLRenderingContextBase::detachShader):
3364         Instrumentation for programs and shaders.
3365
3366         * inspector/InspectorAllInOne.cpp:
3367
3368         * inspector/InspectorCanvasAgent.cpp: Added.
3369         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3370         (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
3371         (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
3372         (WebCore::InspectorCanvasAgent::frameNavigated):
3373         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
3374         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3375         (WebCore::InspectorCanvasAgent::didAttachShader):
3376         (WebCore::InspectorCanvasAgent::didDetachShader):
3377         (WebCore::InspectorCanvasAgent::didCreateProgram):
3378         (WebCore::InspectorCanvasAgent::didDeleteProgram):
3379         (WebCore::InspectorCanvasAgent::getCanvases):
3380         (WebCore::InspectorCanvasAgent::canvasDestroyed):
3381         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
3382         (WebCore::InspectorCanvasAgent::reset):
3383         (WebCore::InspectorCanvasAgent::getCanvasEntry):
3384         (WebCore::InspectorCanvasAgent::getProgramEntry):
3385         (WebCore::InspectorCanvasAgent::removeShaderFromShaderMap):
3386         (WebCore::InspectorCanvasAgent::contextTypeJson):
3387         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
3388         * inspector/InspectorCanvasAgent.h: Added.
3389         New backend agent.
3390
3391         * inspector/InspectorController.cpp:
3392         (WebCore::InspectorController::InspectorController):
3393         Support for new backend agent.
3394
3395         * inspector/InspectorInstrumentation.cpp:
3396         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
3397         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
3398         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
3399         (WebCore::InspectorInstrumentation::didAttachShaderImpl):
3400         (WebCore::InspectorInstrumentation::didDetachShaderImpl):
3401         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
3402         (WebCore::InspectorInstrumentation::didDeleteProgramImpl):
3403         (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderingContext):
3404         Plumbing for canvas instrumentation.
3405
3406         * inspector/InspectorInstrumentation.h:
3407         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
3408         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
3409         (WebCore::InspectorInstrumentation::didAttachShader):
3410         (WebCore::InspectorInstrumentation::didDetachShader):
3411         (WebCore::InspectorInstrumentation::didCreateProgram):
3412         (WebCore::InspectorInstrumentation::didDeleteProgram):
3413
3414         * inspector/InstrumentingAgents.cpp:
3415         (WebCore::InstrumentingAgents::InstrumentingAgents):
3416         (WebCore::InstrumentingAgents::reset):
3417         * inspector/InstrumentingAgents.h:
3418         (WebCore::InstrumentingAgents::inspectorCanvasAgent):
3419         (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
3420         Support for new backend agent.
3421
3422 2015-03-31  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3423
3424         [Streams API] Implement a barebone ReadableStreamReader interface
3425         https://bugs.webkit.org/show_bug.cgi?id=142866
3426
3427         Reviewed by Benjamin Poulain.
3428
3429         This patch implements a barebone ReadableStreamReader as described in https://streams.spec.whatwg.org/#reader-class.
3430         It implements the IDL without implementing most of the functionality behind.
3431         It implements ReadableStreamReader JS constructor and the link with ReadableStream.getReader:
3432         - Raise an error if stream is already locked
3433         - Set the stream reader to the newly created ReadableStreamReader instance.
3434
3435         Test: streams/readablestreamreader-constructor.html
3436
3437         * CMakeLists.txt: Adding ReadableStreamReader files.
3438         * DerivedSources.cpp: Ditto.
3439         * DerivedSources.make: Ditto.
3440         * Modules/streams/ReadableStream.cpp:
3441         (WebCore::ReadableStream::createReader): Used by JS binding to get access to the reader.
3442         * Modules/streams/ReadableStream.h: Declaration of createReader, reader and lock.
3443         (WebCore::ReadableStream::reader):
3444         (WebCore::ReadableStream::lock):
3445         * Modules/streams/ReadableStream.idl: Cleaning-up the IDL.
3446         * Modules/streams/ReadableStreamReader.cpp: Added.
3447         (WebCore::ReadableStreamReader::create):
3448         (WebCore::ReadableStreamReader::ReadableStreamReader):
3449         (WebCore::ReadableStreamReader::~ReadableStreamReader):
3450         (WebCore::ReadableStreamReader::closed):
3451         (WebCore::ReadableStreamReader::activeDOMObjectName):
3452         (WebCore::ReadableStreamReader::canSuspend):
3453         * Modules/streams/ReadableStreamReader.h: Added.
3454         (WebCore::ReadableStreamReader::stream):
3455         * Modules/streams/ReadableStreamReader.idl: Added.
3456         * WebCore.vcxproj/WebCore.vcxproj:
3457         * WebCore.vcxproj/WebCore.vcxproj.filters:
3458         * WebCore.xcodeproj/project.pbxproj:
3459         * bindings/js/JSBindingsAllInOne.cpp:
3460         * bindings/js/JSReadableStreamCustom.cpp:
3461         (WebCore::JSReadableStream::getReader):
3462         * bindings/js/JSReadableStreamReaderCustom.cpp: Added.
3463         (WebCore::JSReadableStreamReader::read):
3464         (WebCore::getOrCreatePromiseDeferredFromObject):
3465         (WebCore::closedPromiseSlotName):
3466         (WebCore::JSReadableStreamReader::closed):
3467         (WebCore::JSReadableStreamReader::cancel):
3468         (WebCore::JSReadableStreamReader::releaseLock):
3469         (WebCore::constructJSReadableStreamReader):
3470
3471 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3472
3473         [GTK] DnD icon/widget has odd background
3474         https://bugs.webkit.org/show_bug.cgi?id=143217
3475
3476         Reviewed by Martin Robinson.
3477
3478         Remove DragIcon class since it's no longer needed with GTK+3 and
3479         the GTK+2 code there is unused. GTK+ knows what to do with a cairo
3480         surface, I guess we migrated the GTK+2 code to GTK+3 without
3481         realizing that using the surface was enough.
3482
3483         * PlatformGTK.cmake:
3484         * platform/gtk/DragIcon.cpp: Removed.
3485         * platform/gtk/DragIcon.h: Removed.
3486
3487 2015-03-30  Alex Christensen  <achristensen@webkit.org>
3488
3489         Unreviewed build fix after r182168.
3490
3491         * contentextensions/ContentExtensionsBackend.cpp:
3492         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3493         Explicitly cast to unsigned.
3494
3495 2015-03-30  Alex Christensen  <achristensen@webkit.org>
3496
3497         [Content Extensions] Correctly handle regular expressions matching everything
3498         https://bugs.webkit.org/show_bug.cgi?id=143235
3499
3500         Reviewed by Benjamin Poulain.
3501
3502         Test: http/tests/contentextensions/whitelist.html
3503
3504         * contentextensions/CompiledContentExtension.cpp:
3505         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
3506         Global actions can have non-css actions.  Only put the selectors into the list of selectors.
3507         * contentextensions/ContentExtensionCompiler.cpp:
3508         (WebCore::ContentExtensions::serializeSelector):
3509         (WebCore::ContentExtensions::serializeActions):
3510         Merge sequential css selectors with identical triggers (usually .*) into one action to reduce the number of actions.
3511         (WebCore::ContentExtensions::compileRuleList):
3512         Fail if a regular expression matches everything after ignore-previous-rules.
3513         * contentextensions/ContentExtensionError.cpp:
3514         (WebCore::ContentExtensions::contentExtensionErrorCategory):
3515         * contentextensions/ContentExtensionError.h:
3516         Add more failure cases.
3517         * contentextensions/ContentExtensionRule.h:
3518         (WebCore::ContentExtensions::Trigger::operator==):
3519         Allow comparing of Triggers to determine if sequential triggers are equal.
3520         * contentextensions/ContentExtensionsBackend.cpp:
3521         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3522         Put non-css actions that match everything into the list of actions if ignore-previous-rules was not hit.
3523         These actions will be out of order, but order only matters when determining if ignore-previous-rules, and this case is handled correctly.
3524         * contentextensions/DFABytecodeInterpreter.cpp:
3525         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
3526         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3527         Added an assertion that all actions that match everything should be in the first DFA root.
3528         We should catch them all with URLFilterParser::MatchesEverything.
3529
3530 2015-03-30  Myles C. Maxfield  <mmaxfield@apple.com>
3531
3532         Allow building on Windows without Cygwin
3533         https://bugs.webkit.org/show_bug.cgi?id=143219
3534
3535         Reviewed by Brent Fulgham.
3536
3537         * AVFoundationSupport.py: Renamed from Source/WebCore/WebCore.vcxproj/MigrateScripts.
3538         Move logic from DerivedSources.make to its own script
3539         (lookFor):
3540         * DerivedSources.make: Paths like /usr/bin don't exist on Windows.
3541         Windows uses del instead of rm -f
3542         Windows doesn't have printf
3543         * WebCore.vcxproj/WebCoreGenerated.make: Pass the CC executable to
3544         build-generated-files.pl
3545         * WebCore.vcxproj/build-generated-files.pl: Export the CC executable as an environment
3546         variable. Don't use /usr/bin.
3547         * WebCore.vcxproj/migrate-scripts.pl: Deleted the MigrateScripts makefile. We don't
3548         need a whole Makefile just to copy 5 files. Moved this logic into migrate-scripts.pl.
3549         (copyFile):
3550         * bindings/scripts/preprocessor.pm:
3551         (applyPreprocessor): Support passing preprocessing flags to the Visual Studio
3552         compiler.
3553         * dom/make_names.pl: Ditto.
3554
3555 2015-03-30  Alexey Proskuryakov  <ap@apple.com>
3556
3557         Build fix.
3558
3559         * platform/spi/mac/AVFoundationSPI.h:
3560
3561 2015-03-30  Sam Weinig  <sam@webkit.org>
3562
3563         [Content Extensions] Flesh out the UserContentExtensionStore
3564         https://bugs.webkit.org/show_bug.cgi?id=143123
3565
3566         Reviewed by Benjamin Poulain.
3567
3568         - Adds a variant of getFileSize() that takes a PlatformFileHandle.
3569         - Adds a new file system function, rename() which operates as the POSIX
3570           rename function does.
3571
3572         * platform/FileSystem.h:
3573         Add new functions.
3574
3575         * platform/posix/FileSystemPOSIX.cpp:
3576         (WebCore::renameFile):
3577         (WebCore::getFileSize):
3578         Add implementations.
3579
3580         * platform/gtk/FileSystemGtk.cpp:
3581         (WebCore::renameFile):
3582         (WebCore::getFileSize):
3583         * platform/win/FileSystemWin.cpp:
3584         (WebCore::getFileSize):
3585         (WebCore::renameFile):
3586         Add stubs.
3587
3588 2015-03-30  Per Arne Vollan  <peavo@outlook.com>
3589
3590         [WinCairo] Crash when closing window while video is loading
3591         https://bugs.webkit.org/show_bug.cgi?id=143088
3592
3593         Reviewed by Mark Lam.
3594
3595         When the media player is destroyed, we have to cancel possible calls on the
3596         main thread made by a worker thread. Otherwise the destroyed media player
3597         will be accessed when performing the call.
3598
3599         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3600         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
3601         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
3602         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
3603         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
3604         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSourceCallback):
3605         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySetCallback):
3606         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3607
3608 2015-03-30  Gwang Yoon Hwang  <yoon@igalia.com>
3609
3610         [Threaded Compositor] Crash when animation changes frequently.
3611         https://bugs.webkit.org/show_bug.cgi?id=143213
3612
3613         Reviewed by Simon Fraser.
3614
3615         CompositingCoordinator copies CoordinatedGraphicsLayerState when
3616         flushing GraphicsLayer changes, and ThreadedCoordinatedCompositor passes
3617         it to compositing thread.
3618
3619         To ensure thread-safety, we need to provide copy constructor to copy
3620         Animation object in TextureMapperAnimation instead of referencing it.
3621
3622         Since TimingFunction and TransformOperation used by KeyframeValueList are
3623         not ThreadSafeRefCounted, these should be cloned also.
3624
3625         No new tests needed.
3626
3627         * platform/graphics/GraphicsLayer.h:
3628         (WebCore::AnimationValue::AnimationValue):
3629         (WebCore::FloatAnimationValue::FloatAnimationValue):
3630         (WebCore::TransformAnimationValue::TransformAnimationValue):
3631         (WebCore::FilterAnimationValue::FilterAnimationValue):
3632         Adds deep copy constructor.
3633
3634         * platform/graphics/texmap/TextureMapperAnimation.cpp:
3635         (WebCore::TextureMapperAnimation::TextureMapperAnimation):
3636         Because the name of the animation can be AtomicString, we need to create
3637         isolated version of string to ensure thread safty.
3638
3639         * platform/graphics/texmap/TextureMapperAnimation.h:
3640         * platform/graphics/transforms/IdentityTransformOperation.h:
3641         * platform/graphics/transforms/Matrix3DTransformOperation.h:
3642         * platform/graphics/transforms/MatrixTransformOperation.h:
3643         * platform/graphics/transforms/PerspectiveTransformOperation.h:
3644         * platform/graphics/transforms/RotateTransformOperation.h:
3645         * platform/graphics/transforms/ScaleTransformOperation.h:
3646         * platform/graphics/transforms/SkewTransformOperation.h:
3647         * platform/graphics/transforms/TransformOperation.h:
3648         * platform/graphics/transforms/TranslateTransformOperation.h:
3649         Adds TransformOperation::clone() for threadsafety.
3650
3651 2015-03-30  Chris Dumez  <cdumez@apple.com>
3652
3653         Cached "Expires" header is not updated upon successful resource revalidation
3654         https://bugs.webkit.org/show_bug.cgi?id=143228
3655         <rdar://problem/20348059>
3656
3657         Reviewed by Antti Koivisto.
3658
3659         Cached "Expires" header was not updated upon successful resource
3660         revalidation. This affected both our disk cache and our memory cache.
3661         This was caused by shouldUpdateHeaderAfterRevalidation() in
3662         CacheValidation.cpp returning false for the "Expires" header.
3663
3664         There is a comment there stating that the list of ignored headers
3665         matches Chromium's net library but that's not the case, at least not
3666         anymore:
3667         http://osxr.org/android/source/external/chromium/net/http/http_response_headers.cc
3668
3669         HTTP servers such as Apache return an "Expires" header in their 304
3670         responses and the "Expires" header is potentially a new one. However,
3671         our caches were ignoring the updated expiration date and kept using the
3672         old one, which meant that the cached resource expired sooner than it
3673         should have.
3674
3675         See the following Apache bugs that explain the issue:
3676         https://bz.apache.org/bugzilla/show_bug.cgi?id=24884
3677         https://bz.apache.org/bugzilla/show_bug.cgi?id=25123
3678
3679         Test: http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html
3680
3681         * platform/network/CacheValidation.cpp:
3682
3683 2015-03-30  Antti Koivisto  <antti@apple.com>
3684
3685         Don't cache resources that are very unlikely to be reused
3686         https://bugs.webkit.org/show_bug.cgi?id=143226
3687         <rdar://problem/20347160>
3688
3689         Reviewed by Geoff Garen.
3690
3691         Allow overriding resource load priorities via Internals for testing.
3692
3693         * loader/FrameLoader.cpp:
3694         (WebCore::FrameLoader::addExtraFieldsToRequest):
3695         (WebCore::FrameLoader::clearTestingOverrides):
3696         * loader/FrameLoader.h:
3697         (WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting):
3698         (WebCore::FrameLoader::clearOverrideCachePolicyForTesting): Deleted.
3699         * page/DiagnosticLoggingKeys.cpp:
3700         (WebCore::DiagnosticLoggingKeys::unlikelyToReuseKey):
3701         * page/DiagnosticLoggingKeys.h:
3702
3703             Add a key.
3704
3705         * testing/Internals.cpp:
3706         (WebCore::Internals::resetToConsistentState):
3707         (WebCore::stringToResourceLoadPriority):
3708         (WebCore::Internals::setOverrideResourceLoadPriority):
3709         * testing/Internals.h:
3710         * testing/Internals.idl:
3711
3712 2015-03-30  Javier Fernandez  <jfernandez@igalia.com>
3713
3714         [CSS Grid Layout] Upgrade align-self and align-items parsing to CSS 3
3715         https://bugs.webkit.org/show_bug.cgi?id=133359
3716
3717         Reviewed by David Hyatt.
3718
3719         From Blink r164817 and r165264 by <jchaffraix@chromium.org>
3720
3721         Broaden justify-self's parsing name
3722
3723         This is in preparation of migrating align-self, align-items
3724         and justify-items to the CSS 3 Alignment syntax.
3725
3726         The current naming was too tied to justify-self and needs to
3727         be broadened. This will reduce the follow-up implementations'
3728         patches.
3729
3730         Upgrade align-self and align-items parsing to CSS 3
3731
3732         This change migrates the 2 properties to the CSS 3 Alignment
3733         parsing. The new parsing is identical to how we parse
3734         'justify-self'. The 2 properties need to be migrated together
3735         as they are used in tandem in CSSComputedStyleDeclaration.
3736
3737         This change also removes EAlignItems as it is now unused.
3738
3739         Tests: css3/parse-align-items.html
3740                css3/parse-align-self.html
3741
3742         * css/CSSComputedStyleDeclaration.cpp:
3743         (WebCore::resolveAlignmentAuto): Added. Resolves the "auto" value for the alignment properties.
3744         (WebCore::valueForItemPositionWithOverflowAlignment): Added. Builds the CSSValue for the for the alignment properties.
3745         (WebCore::ComputedStyleExtractor::propertyValue):
3746         * css/CSSParser.cpp:
3747          (WebCore::isValidKeywordPropertyAndValue): Removed align-self, align-items and justify-items.
3748         (WebCore::isKeywordPropertyID): Removed align-self, align-items and justify-items.
3749         (WebCore::isBaselinePositionKeyword): Added. Set of keywords related to baseline value.
3750         (WebCore::CSSParser::parseItemPositionOverflowPosition): Generic parsing fuction for the alignment properties.
3751         (WebCore::CSSParser::parseJustifySelf): Deleted.
3752         (WebCore::CSSParser::parseValue): Added align-items and align-self to the list and call to the generic parsing fuction for the alignment properties.
3753         * css/CSSParser.h:
3754         * css/CSSPrimitiveValueMappings.h:
3755         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added.
3756         (WebCore::CSSPrimitiveValue::operator ItemPosition): Added. Replace the old EAlignItems enumeration.
3757         (WebCore::CSSPrimitiveValue::operator OverflowAlignment): Added.
3758         (WebCore::CSSPrimitiveValue::operator EAlignItems): Deleted.
3759         (WebCore::CSSPrimitiveValue::operator EJustifySelf): Deleted.
3760         (WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment): Deleted.
3761         * css/CSSPropertyNames.in:
3762         * css/CSSValueKeywords.in:
3763         * css/StyleBuilderCustom.h:
3764         (WebCore::StyleBuilderCustom::applyInheritAlignSelf): Added.
3765         (WebCore::StyleBuilderCustom::applyInitialAlignSelf): Added.
3766         (WebCore::StyleBuilderCustom::applyValueAlignSelf): Added.
3767         (WebCore::StyleBuilderCustom::applyInheritAlignItems): Added.
3768         (WebCore::StyleBuilderCustom::applyInitialAlignItems): Added.
3769         (WebCore::StyleBuilderCustom::applyValueAlignItems): Added.
3770         (WebCore::StyleBuilderCustom::applyInheritJustifySelf): Added.
3771         (WebCore::StyleBuilderCustom::applyInitialJustifySelf): Added.
3772         (WebCore::StyleBuilderCustom::applyValueJustifySelf): Added.
3773         (WebCore::StyleBuilderCustom::applyValueWebkitJustifySelf): Deleted.
3774         * css/StyleResolver.cpp:
3775         (WebCore::StyleResolver::adjustRenderStyle): isDisplayFlexibleOrGridBox now a RenderStyle function.
3776         (WebCore::isDisplayFlexibleBox): Deleted. Moved to RenderStyle.
3777         (WebCore::isDisplayGridBox): Deleted. Moved to RenderStyle.
3778         (WebCore::isDisplayFlexibleOrGridBox): Deleted. Moved to RenderStyle.
3779         * rendering/RenderBox.cpp:
3780         (WebCore::flexItemHasStretchAlignment): Adapted to the new ItemPostition enum.
3781         * rendering/RenderFlexibleBox.cpp:
3782         (WebCore::RenderFlexibleBox::firstLineBaseline): Adapted to the new ItemPostition enum.
3783         (WebCore::RenderFlexibleBox::styleDidChange): Adapted to the new ItemPostition enum.
3784         (WebCore::RenderFlexibleBox::alignmentForChild): Adapted to the new ItemPostition enum.
3785         (WebCore::RenderFlexibleBox::needToStretchChild): Adapted to the new ItemPostition enum.
3786         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Adapted to the new ItemPostition enum.
3787         (WebCore::RenderFlexibleBox::alignChildren): Adapted to the new ItemPostition enum.
3788         (WebCore::resolveAlignment): Deleted. Moved to RenderStyle.
3789         * rendering/RenderFlexibleBox.h:
3790         * rendering/RenderFullScreen.cpp:
3791         (WebCore::createFullScreenStyle): Adapted to the new ItemPostition enum.
3792         * rendering/RenderMenuList.cpp:
3793         (WebCore::RenderMenuList::adjustInnerStyle): Adapted to the new ItemPostition enum.
3794         * rendering/mathml/RenderMathMLRoot.cpp:
3795         (WebCore::RenderMathMLRoot::updateStyle): Adapted to the new ItemPostition enum.
3796         * rendering/mathml/RenderMathMLScripts.cpp:
3797         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Adapted to the new ItemPostition enum.
3798         (WebCore::RenderMathMLScripts::fixAnonymousStyles): Adapted to the new ItemPostition enum.
3799         * rendering/style/ContentData.h:
3800         * rendering/style/RenderStyle.cpp:
3801         (WebCore::RenderStyle::resolveAlignment): Added.
3802         * rendering/style/RenderStyle.h: Adapted to the new ItemPostition enum.
3803         * rendering/style/RenderStyleConstants.h: Adapted to the new ItemPostition enum.
3804         * rendering/style/StyleRareNonInheritedData.cpp: Adapted to the new ItemPostition enum.
3805         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Adapted to the new ItemPostition enum.
3806         (WebCore::StyleRareNonInheritedData::operator==): Adapted to the new ItemPostition enum.
3807         * rendering/style/StyleRareNonInheritedData.h: Adapted to the new ItemPostition enum.
3808         * style/StyleResolveTree.cpp:
3809         (WebCore::Style::determineChange): Changes in the alignItems property cause a Detach.
3810
3811 2015-03-27  David Hyatt  <hyatt@apple.com>
3812
3813         [New Block-Inside-Inline Model] Create anonymous inline blocks to hold blocks-inside-inlines.
3814         https://bugs.webkit.org/show_bug.cgi?id=143145
3815
3816         Reviewed by Dean Jackson.
3817
3818         Added fast/block/inside-inlines/ tests.
3819
3820         * rendering/RenderBlock.cpp:
3821         (WebCore::RenderBlock::renderName):
3822         Add support for labeling anonymous inline-blocks when dumped by the render tree.
3823
3824         * rendering/RenderInline.cpp:
3825         (WebCore::RenderInline::addChildIgnoringContinuation):
3826         When the pref is set to use the new block-inside-inline model, create an anonymous inline block to
3827         hold block children of RenderInlines instead of splitting flows or creating continuations.
3828
3829         * rendering/RenderObject.h:
3830         (WebCore::RenderObject::isAnonymousInlineBlock):
3831         Add the definition of isAnonymousInlineBlock (note the exclusion of Ruby, since Ruby creates anonymous
3832         inline-blocks also).
3833
3834 2015-03-30  Chris Dumez  <cdumez@apple.com>
3835
3836         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
3837         https://bugs.webkit.org/show_bug.cgi?id=143159
3838         <rdar://problem/20333296>
3839
3840         Reviewed by Antti Koivisto.
3841
3842         Add support for "Cache-Control: max-stale" request header:
3843         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
3844
3845         Test: http/tests/cache/disk-cache/disk-cache-request-max-stale.html
3846
3847         * platform/network/CacheValidation.cpp:
3848         (WebCore::parseCacheControlDirectives):
3849         * platform/network/CacheValidation.h:
3850
3851 2015-03-30  Simon Fraser  <simon.fraser@apple.com>
3852
3853         Fix iOS internal build after r182132.
3854
3855         * page/scrolling/ScrollingCoordinator.cpp:
3856         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
3857
3858 2015-03-30  Jer Noble  <jer.noble@apple.com>
3859
3860         [iOS] When Web Audio is interrupted by a phone call, it cannot be restarted.
3861         https://bugs.webkit.org/show_bug.cgi?id=143190
3862
3863         Reviewed by Darin Adler.
3864
3865         Tests: webaudio/audiocontext-state-interrupted.html
3866                webaudio/audiocontext-state.html
3867
3868         Implement the following methods and properties from the Web Audio spec:
3869         close(), suspend(), resume(), onstatechange.
3870
3871         AudioContext will take more responsibility for tracking state and interruptions (and
3872         AudioDestination will give up that responsibility). This means AudioContext must be a
3873         MediaSessionClient, and own its own MediaSession. In return, AudioDestinationIOS and 
3874         AudioDestinationMac relinquish both.
3875
3876         * Modules/webaudio/AudioContext.cpp:
3877         (WebCore::AudioContext::AudioContext): Set default values in header.
3878         (WebCore::AudioContext::uninitialize): Call setState() instead of setting m_state.
3879         (WebCore::AudioContext::addReaction): Added. Append the callback to the appropriate vector for the state.
3880         (WebCore::AudioContext::setState): Added. Fire events and resolve the appropriate reaction callbacks for the new state.
3881         (WebCore::AudioContext::state): Return a string representing the context's state.
3882         (WebCore::AudioContext::stop): Close the event queue.
3883         (WebCore::AudioContext::startRendering): Call setState().
3884         (WebCore::AudioContext::fireCompletionEvent): Call setState().
3885         (WebCore::AudioContext::suspendContext): Added. Add reaction callback and call suspend() on the destination node.
3886         (WebCore::AudioContext::resumeContext): Added. Add reaction callback and call resume() on the destination node.