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