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