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