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