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