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