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