1 2015-04-08 Sam Weinig <sam@webkit.org>
3 Allow LaunchServices to handle URLs on link navigations
4 <rdar://problem/19446826>
5 https://bugs.webkit.org/show_bug.cgi?id=143544
7 Reviewed by Anders Carlsson.
9 * WebCore.xcodeproj/project.pbxproj:
10 * platform/spi/ios/LaunchServicesSPI.h: Added.
13 2015-04-10 Bem Jones-Bey <bjonesbe@adobe.com>
15 Unreviewed, added CSS Shapes to features.json file.
19 2015-04-10 Andy Estes <aestes@apple.com>
21 [Content Filtering] Support modifying request URLs
22 https://bugs.webkit.org/show_bug.cgi?id=143599
23 rdar://problem/20442560
25 Reviewed by Darin Adler.
27 Tests: contentfiltering/modify-request-url.html
28 http/tests/contentfiltering/modify-redirect-request-url.html
30 Allow NEFilterSource to modifiy request URLs. Also teach MockContentFilter to do the same for testing.
32 * platform/cocoa/NetworkExtensionContentFilter.mm:
33 (WebCore::NetworkExtensionContentFilter::willSendRequest): If NEFilterSource provided a string representing a
34 valid URL in decisionInfo[NEFilterSourceOptionsRedirectURL], then used that as the request URL.
35 * platform/spi/cocoa/NEFilterSourceSPI.h: Temporarily defined NEFilterSourceOptionsRedirectURL.
36 * testing/MockContentFilter.cpp:
37 (WebCore::MockContentFilter::willSendRequest): If settings() has a valid modifiedRequestURL, use it as the
38 request URL. Only do so once MockContentFilter has reached its decision point so that both initial requests and
39 redirect requests can be tested.
40 * testing/MockContentFilterSettings.h: Added modifiedRequestURL.
41 (WebCore::MockContentFilterSettings::modifiedRequestURL): Ditto.
42 (WebCore::MockContentFilterSettings::setModifiedRequestURL): Ditto.
43 * testing/MockContentFilterSettings.idl: Ditto.
45 2015-04-10 Zalan Bujtas <zalan@apple.com>
47 showRenderTree: Include the render object to the inlinebox output.
48 https://bugs.webkit.org/show_bug.cgi?id=143610
50 This helps to match the inlinebox and its renderer.
52 Reviewed by Antti Koivisto.
54 * rendering/InlineBox.cpp:
55 (WebCore::InlineBox::showLineBox):
57 2015-04-09 Roger Fong <roger_fong@apple.com>
59 Update wireless player placard for OSX.
60 https://bugs.webkit.org/show_bug.cgi?id=143585.
61 <rdar://problem/12067439>
63 Reviewed by Eric Carlson.
65 * Modules/mediacontrols/mediaControlsApple.css:
66 Adjust button positioning and svg.
67 (audio::-webkit-media-controls-wireless-playback-picker-button):
68 (audio::-webkit-media-controls-wireless-playback-picker-button.playing):
69 Style the wireless playback status placard, small and big versions.
70 (audio::-webkit-media-controls-wireless-playback-status):
71 (audio::-webkit-media-controls-wireless-playback-text):
72 (audio::-webkit-media-controls-wireless-playback-text-top):
73 (audio::-webkit-media-controls-wireless-playback-text-bottom):
74 (audio::-webkit-media-controls-wireless-playback-status.small):
75 (audio::-webkit-media-controls-wireless-playback-text-top.small):
76 (audio::-webkit-media-controls-wireless-playback-text-bottom.small):
77 * Modules/mediacontrols/mediaControlsApple.js:
78 Add new wireless player placard elements.
79 (Controller.prototype.createControls):
80 (Controller.prototype.configureInlineControls):
81 Make sure to switch between small and big placards when switching between fullscreen and small videos.
82 (Controller.prototype.configureFullScreenControls):
83 (Controller.prototype.handleFullscreenChange):
84 (Controller.prototype.updateWirelessPlaybackStatus):
86 2015-04-10 Eric Carlson <eric.carlson@apple.com>
88 [Mac] Refactor MediaPlaybackTarget
89 https://bugs.webkit.org/show_bug.cgi?id=143571
91 Reviewed by Jer Noble.
93 * WebCore.xcodeproj/project.pbxproj:
95 (WebCore::Document::addPlaybackTargetPickerClient): Don't call client if page playback target
97 (WebCore::Document::didChoosePlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
100 * html/HTMLMediaElement.cpp:
101 (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
102 * html/HTMLMediaElement.h:
104 * html/HTMLMediaSession.cpp:
105 (WebCore::HTMLMediaSession::HTMLMediaSession): Don't initialize m_playbackTarget.
106 (WebCore::HTMLMediaSession::didChoosePlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
107 * html/HTMLMediaSession.h:
110 (WebCore::Page::Page):
111 (WebCore::Page::playbackTarget): m_playbackTarget is a RefPtr<MediaPlaybackTarget>
112 (WebCore::Page::didChoosePlaybackTarget): Ditto.
115 * platform/audio/MediaSession.h:
116 (WebCore::MediaSessionClient::setWirelessPlaybackTarget): Take a Ref<MediaPlaybackTarget>&&.
118 Make MediaPlaybackTarget RefCounted, and don't require it to be serializable so it can be
119 subclassed to keep port-specific iformation out of the base class.
120 * platform/graphics/MediaPlaybackTarget.h:
121 (WebCore::MediaPlaybackTarget::targetType):
122 (WebCore::MediaPlaybackTarget::targetContext):
123 (WebCore::MediaPlaybackTarget::hasActiveRoute):
124 (WebCore::MediaPlaybackTarget::MediaPlaybackTarget):
125 (WebCore::MediaPlaybackTarget::setDevicePickerContext): Deleted.
126 (WebCore::MediaPlaybackTarget::devicePickerContext): Deleted.
128 MediaPlaybackTargetContext is the struct that is serialized to pass across the process boudary.
129 It has union to hold port-specific data.
130 * platform/graphics/MediaPlaybackTargetContext.h: Added.
132 * platform/graphics/MediaPlaybackTargetPicker.h: didChoosePlaybackTarget takes a Ref<MediaPlaybackTarget>&&
133 * platform/graphics/MediaPlaybackTargetPickerClient.h: Ditto.
134 * platform/graphics/MediaPlayer.cpp:
135 (WebCore::MediaPlayer::setWirelessPlaybackTarget): Ditto.
136 * platform/graphics/MediaPlayer.h:
138 * platform/graphics/MediaPlayerPrivate.h:
139 (WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
141 * platform/graphics/avfoundation/MediaPlaybackTargetMac.h: Added.
142 (WebCore::MediaPlaybackTargetMac::targetType):
143 (WebCore::MediaPlaybackTargetMac::outputContext):
144 * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
145 (WebCore::MediaPlaybackTargetMac::create):
146 (WebCore::MediaPlaybackTargetMac::MediaPlaybackTargetMac):
147 (WebCore::MediaPlaybackTargetMac::~MediaPlaybackTargetMac):
148 (WebCore::MediaPlaybackTargetMac::targetContext):
149 (WebCore::MediaPlaybackTargetMac::hasActiveRoute):
150 (WebCore::toMediaPlaybackTargetMac):
151 (WebCore::MediaPlaybackTarget::encode): Deleted.
152 (WebCore::MediaPlaybackTarget::decode): Deleted.
153 (WebCore::MediaPlaybackTarget::hasActiveRoute): Deleted.
155 * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
156 (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Allocate and pass a MediaPlaybackTargetMac
157 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
159 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
160 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Take a Ref<MediaPlaybackTarget&&
162 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
163 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
164 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
166 * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
167 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
168 (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
170 2015-04-09 Sergio Villar Senin <svillar@igalia.com>
172 [CSS Grid Layout] Fix raw function pointer usages
173 https://bugs.webkit.org/show_bug.cgi?id=143481
175 Reviewed by Antti Koivisto.
178 resolveContentBasedTrackSizingFunctionsForItems() became too long
179 and rather incomprehensible as it included up to 6 function
180 pointers. This replaces all of them by an enum which describes the
181 phase of the algorithm that is currently running. With that phase
182 we have enough information to select the right function to call.
184 In order not to tangle up too much the method, the new explicit
185 switch statements where moved to static helper functions.
187 No new tests as this is just a code refactoring.
189 * rendering/RenderGrid.cpp:
190 (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
191 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
192 (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): New helper function.
193 (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Ditto.
194 (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Ditto.
195 (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Ditto.
196 (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Ditto.
197 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
198 (WebCore::RenderGrid::distributeSpaceToTracks):
199 * rendering/RenderGrid.h:
201 2015-04-10 Adam Bergkvist <adam.bergkvist@ericsson.com>
203 WebRTC: Remove AudioStreamTrack and VideoStreamTrack (removed in spec)
204 https://bugs.webkit.org/show_bug.cgi?id=143336
206 Reviewed by Philippe Normand.
208 The specific MediaStreamTrakc types (AudioStreamTrack and VideoStreamTrack) have been
209 removed from the Media Capture and Streams [1] specification.
211 [1] http://w3c.github.io/mediacapture-main/archives/20150324/getusermedia.html
213 There are no test for this feature to remove.
216 * DerivedSources.make:
217 * Modules/mediastream/AudioStreamTrack.cpp: Removed.
218 * Modules/mediastream/AudioStreamTrack.h: Removed.
219 * Modules/mediastream/AudioStreamTrack.idl: Removed.
220 * Modules/mediastream/MediaStream.cpp:
221 (WebCore::MediaStream::MediaStream):
222 (WebCore::MediaStream::addRemoteTrack):
223 (WebCore::MediaStream::active): Deleted.
224 * Modules/mediastream/MediaStreamTrack.cpp:
225 (WebCore::MediaStreamTrack::create):
226 (WebCore::MediaStreamTrack::MediaStreamTrack):
227 (WebCore::MediaStreamTrack::kind):
228 (WebCore::MediaStreamTrack::clone):
229 (WebCore::MediaStreamTrack::trackEnded): Deleted.
230 * Modules/mediastream/MediaStreamTrack.h:
231 * Modules/mediastream/VideoStreamTrack.cpp: Removed.
232 * Modules/mediastream/VideoStreamTrack.h: Removed.
233 * Modules/mediastream/VideoStreamTrack.idl: Removed.
234 * WebCore.xcodeproj/project.pbxproj:
236 2015-04-09 Andy Estes <aestes@apple.com>
238 [Cocoa] Add a HAVE(AVKIT) and use it
239 https://bugs.webkit.org/show_bug.cgi?id=143593
241 Reviewed by David Kilzer.
243 * page/Settings.h: Only defined setAVKitEnabled() if HAVE(AVKIT).
244 * platform/ios/WebVideoFullscreenControllerAVKit.mm: Only compiled if HAVE(AVKIT).
245 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.
247 2015-04-09 Simon Fraser <simon.fraser@apple.com>
249 Some CSS3 filters tests crash under iOS testing
250 https://bugs.webkit.org/show_bug.cgi?id=143594
251 rdar://problem/20491140
253 Reviewed by David Kilzer.
255 Some tests disable accelerated compositing via testRunner.overridePreference(). In this case,
256 we'd not create a root scrolling tree node, so null-check it in AsyncScrollingCoordinator::updateNonFastScrollableRegion().
258 * page/scrolling/AsyncScrollingCoordinator.cpp:
259 (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
261 2015-04-09 Zalan Bujtas <zalan@apple.com>
263 Simple line layout: Add <br> support.
264 https://bugs.webkit.org/show_bug.cgi?id=139012
266 This patch enables RenderBlockFlows to use simple line layout on text content when <br> is present.
267 Simple text with <br> is a fairly common pattern on discussion(forum)-like web pages. This patch reduces memory usage
268 and speeds up layout for such content.
270 PerformanceTest/layout/line-layout-simple.html shows more than 2x speedup, when each paragraph is modified by appending <br> to the end.
271 With <br> support enabled:
272 mean: 70.02391461289068 runs/s
273 median: 70.47986488932318 runs/s
275 While with <br> support disabled:
276 mean: 30.417295049468184 runs/s
277 median: 30.36517778760357 runs/s
279 Reviewed by Antti Koivisto.
281 Test: fast/text/simple-line-with-br.html
283 * editing/TextIterator.cpp:
284 (WebCore::TextIterator::handleTextNode):
285 * rendering/RenderBlock.h:
286 * rendering/RenderBlockFlow.cpp:
287 (WebCore::RenderBlockFlow::setSelectionState):
288 (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
289 * rendering/RenderBlockFlow.h:
290 * rendering/RenderLineBreak.cpp:
291 (WebCore::simpleLineLayout):
292 (WebCore::ensureLineBoxes):
293 (WebCore::RenderLineBreak::deleteLineBoxesBeforeSimpleLineLayout):
294 (WebCore::RenderLineBreak::positionForPoint):
295 (WebCore::RenderLineBreak::setSelectionState):
296 (WebCore::RenderLineBreak::linesBoundingBox):
297 (WebCore::RenderLineBreak::absoluteRects):
298 (WebCore::RenderLineBreak::absoluteQuads):
299 (WebCore::RenderLineBreak::collectSelectionRects):
300 * rendering/RenderLineBreak.h:
301 * rendering/RenderText.cpp:
302 (WebCore::RenderText::absoluteRects):
303 (WebCore::RenderText::absoluteQuadsClippedToEllipsis):
304 (WebCore::RenderText::absoluteQuads):
305 (WebCore::RenderText::linesBoundingBox):
306 (WebCore::RenderText::caretMinOffset):
307 (WebCore::RenderText::caretMaxOffset):
308 (WebCore::RenderText::containsCaretOffset):
309 (WebCore::RenderText::hasRenderedText):
310 * rendering/SimpleLineLayout.cpp:
311 (WebCore::SimpleLineLayout::canUseFor):
312 (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
313 (WebCore::SimpleLineLayout::removeTrailingWhitespace):
314 (WebCore::SimpleLineLayout::consumeLineBreakIfNeeded):
315 (WebCore::SimpleLineLayout::skipWhitespaceIfNeeded):
316 (WebCore::SimpleLineLayout::firstFragment):
317 (WebCore::SimpleLineLayout::forceFragmentToLine):
318 (WebCore::SimpleLineLayout::createLineRuns):
319 (WebCore::SimpleLineLayout::create):
320 * rendering/SimpleLineLayoutFlowContents.cpp:
321 (WebCore::SimpleLineLayout::initializeSegments):
322 (WebCore::SimpleLineLayout::FlowContents::segmentForRenderer): Deleted.
323 * rendering/SimpleLineLayoutFlowContents.h:
324 * rendering/SimpleLineLayoutFunctions.cpp:
325 (WebCore::SimpleLineLayout::paintFlow):
326 (WebCore::SimpleLineLayout::hitTestFlow):
327 (WebCore::SimpleLineLayout::showLineLayoutForFlow):
328 * rendering/SimpleLineLayoutResolver.cpp:
329 (WebCore::SimpleLineLayout::RunResolver::Run::rect):
330 (WebCore::SimpleLineLayout::RunResolver::RunResolver):
331 (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
332 * rendering/SimpleLineLayoutResolver.h:
333 (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode):
334 (WebCore::SimpleLineLayout::RunResolver::Iterator::operator--):
335 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
336 (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
337 (WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
338 (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
339 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
340 * rendering/SimpleLineLayoutTextFragmentIterator.h:
341 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLastInRenderer):
342 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLineBreak):
343 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
344 (WebCore::SimpleLineLayout::TextFragmentIterator::isSoftLineBreak):
345 (WebCore::SimpleLineLayout::TextFragmentIterator::isHardLineBreak):
346 (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak): Deleted.
348 2015-04-09 Chris Dumez <cdumez@apple.com>
350 Regression(r182603): editing/selection/selection-invalid-offset.html is crashing
351 https://bugs.webkit.org/show_bug.cgi?id=143591
353 Reviewed by Ryosuke Niwa.
355 Add missing null-check for m_frame->editor().client() in
356 FrameSelection::updateAndRevealSelection().
358 * editing/FrameSelection.cpp:
359 (WebCore::FrameSelection::updateAndRevealSelection):
361 2015-04-09 Sungmann Cho <sungmann.cho@navercorp.com>
363 Minor cleanups to WebCore/plugins
364 https://bugs.webkit.org/show_bug.cgi?id=143509
366 Reviewed by Anders Carlsson.
368 1. Remove unnecessary #includes.
369 2. Fix some wrong namespace comments for consistency.
371 No new tests, no behavior change.
373 * plugins/DOMMimeType.cpp:
374 * plugins/DOMMimeType.h:
375 * plugins/DOMMimeTypeArray.h:
376 * plugins/DOMPlugin.h:
377 * plugins/DOMPluginArray.h:
378 * plugins/PluginData.cpp:
379 * plugins/PluginData.h:
380 * plugins/PluginMainThreadScheduler.cpp:
381 * plugins/PluginViewBase.h:
383 2015-04-09 Javier Fernandez <jfernandez@igalia.com>
385 [CSS Grid Layout] Implement justify-self and justify-item css properties.
386 https://bugs.webkit.org/show_bug.cgi?id=133281
388 Reviewed by David Hyatt.
390 Implement the new property 'justify-items', defined in the CSS Box Alignment
391 specification to describe the container's alignment behavior, in the same way
392 the 'align-items' property does. The 'justify-self' 'auto' value of any relative
393 positioned element will be resolved to its container's 'justify-items' value.
395 Test: fast/css/parse-justify-items.html
397 * css/CSSComputedStyleDeclaration.cpp:
398 (WebCore::resolveContainerAlignmentAuto): Function to resolve 'auto' values for 'align-items' or 'justify-items'.
399 (WebCore::resolveSelfAlignmentAuto): Function to resolve 'auto' values for 'align-self' or 'justify-self'.
400 (WebCore::valueForItemPositionWithOverflowAlignment): Take into account the 'legacy' keyword.
401 (WebCore::ComputedStyleExtractor::propertyValue):
402 (WebCore::resolveAlignmentAuto): Deleted (renamed to resolveContainerAlignmentAuto).
404 (WebCore::CSSParser::parseValue): Refactoring to share logic between justify-xxx and align-xxx properties.
405 (WebCore::CSSParser::parseLegacyPosition): Parsing logic of 'legacy' keyword,
406 (WebCore::CSSParser::parseItemPositionOverflowPosition): Take into account the 'legacy' keyword.
408 * css/CSSPropertyNames.in:
409 * css/CSSValueKeywords.in:
410 * css/StyleBuilderCustom.h:
411 (WebCore::StyleBuilderCustom::applyInheritJustifyItems): Added.
412 (WebCore::StyleBuilderCustom::applyInitialJustifyItems): Added.
413 (WebCore::StyleBuilderCustom::applyValueJustifyItems): Added.
414 * css/StyleResolver.cpp:
415 (WebCore::StyleResolver::adjustRenderStyle): Resolve 'auto' values for justify-items when parents have the 'legacy' keyword.
416 * rendering/style/RenderStyle.h: Managing the new ItemPositionType fields.
417 * rendering/style/RenderStyleConstants.h: Added the ItemPositionType enumeration for handling the 'legacy' keyword.
418 * rendering/style/StyleRareNonInheritedData.cpp: Managing the new ItemPositionType fields.
419 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
420 (WebCore::StyleRareNonInheritedData::operator==):
421 * rendering/style/StyleRareNonInheritedData.h:
423 2015-04-09 Anders Carlsson <andersca@apple.com>
425 Make it possible to create an application cache storage with custom directories
426 https://bugs.webkit.org/show_bug.cgi?id=143588
428 Reviewed by Sam Weinig.
430 Add cache directory and flat file directory name parameters to ApplicationCacheStorage::create.
432 * loader/appcache/ApplicationCacheStorage.cpp:
433 (WebCore::ApplicationCacheStorage::store):
434 (WebCore::ApplicationCacheStorage::loadCache):
435 (WebCore::ApplicationCacheStorage::checkForDeletedResources):
436 (WebCore::ApplicationCacheStorage::flatFileAreaSize):
437 (WebCore::ApplicationCacheStorage::ApplicationCacheStorage):
438 (WebCore::ApplicationCacheStorage::create):
439 (WebCore::ApplicationCacheStorage::singleton):
440 * loader/appcache/ApplicationCacheStorage.h:
442 2015-04-09 Myles C. Maxfield <mmaxfield@apple.com>
444 Text-combine erroneously draws vertically after non-layout-causing style change
445 https://bugs.webkit.org/show_bug.cgi?id=143461
446 <rdar://problem/19285490>
448 Reviewed by Darin Adler.
450 RenderCombineText::styleDidChange() unconditionally uncombines its text. Layout then
451 recombines it. However, if there is a style change that does not cause layout, the
452 RenderCombineText will be left uncombined until the next layout.
454 Test: fast/text/text-combine-style-change-no-layout.html
456 * rendering/RenderCombineText.cpp:
457 (WebCore::RenderCombineText::styleDidChange):
459 2015-04-09 Simon Fraser <simon.fraser@apple.com>
461 Revert part of 182516: it broke tests
462 https://bugs.webkit.org/show_bug.cgi?id=143568
463 rdar://problem/20484578
465 Reviewed by Myles Maxfield.
467 Revert the FontCascadeCocoa parts of r182516, since it broke some CSS shapes tests.
469 * platform/graphics/cocoa/FontCascadeCocoa.mm:
470 (WebCore::FontCascade::drawGlyphs):
471 (WebCore::dilationSizeForTextColor): Deleted.
473 2015-04-09 Zalan Bujtas <zalan@apple.com>
475 Simple line layout(regression): Calling innerText on RenderFlow with multiple children is slow.
476 https://bugs.webkit.org/show_bug.cgi?id=143554
478 Reviewed by Antti Koivisto.
480 Initialize render flow's segments only when the render flow changes in TextIterator.
481 The included performance test shows 6x speedup. (from ~10 runs/sec to ~60 runs/sec)
483 Test: PerformanceTests/Layout/simple-line-layout-innertext.html.
485 * editing/TextIterator.cpp:
486 (WebCore::TextIterator::handleTextNode):
487 * editing/TextIterator.h:
488 * rendering/SimpleLineLayoutFlowContents.cpp: Instruments log shows that vector's expandCapacity could be expensive when flow has large amount of children.
489 (WebCore::SimpleLineLayout::initializeSegments):
491 2015-04-09 Chris Dumez <cdumez@apple.com>
493 [WK2][iOS] editorState() should not cause a synchronous layout
494 https://bugs.webkit.org/show_bug.cgi?id=142536
495 <rdar://problem/20041506>
497 Reviewed by Enrica Casucci.
499 Add didChangeSelectionAndUpdateLayout() callback to EditorClient
500 that is called at the end of FrameSelection::updateAndRevealSelection().
502 * editing/FrameSelection.cpp:
503 (WebCore::FrameSelection::updateAndRevealSelection):
504 * loader/EmptyClients.h:
505 * page/EditorClient.h:
507 2015-04-08 Anders Carlsson <andersca@apple.com>
509 Give each cache group a storage and use it in place of the singleton
510 https://bugs.webkit.org/show_bug.cgi?id=143540
512 Reviewed by Sam Weinig.
514 This is another step towards making the cache storage be per page.
516 * loader/appcache/ApplicationCacheGroup.cpp:
517 (WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
518 (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup):
519 (WebCore::ApplicationCacheGroup::cacheForMainRequest):
520 (WebCore::ApplicationCacheGroup::fallbackCacheForMainRequest):
521 (WebCore::ApplicationCacheGroup::selectCache):
522 (WebCore::ApplicationCacheGroup::makeObsolete):
523 (WebCore::ApplicationCacheGroup::didReachMaxAppCacheSize):
524 (WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota):
525 (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
526 * loader/appcache/ApplicationCacheGroup.h:
527 * loader/appcache/ApplicationCacheStorage.cpp:
528 (WebCore::ApplicationCacheStorage::loadCacheGroup):
529 (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
530 (WebCore::ApplicationCacheStorage::cacheGroupForURL):
531 (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
533 2015-04-09 Andy Estes <aestes@apple.com>
535 Try to fix the Mac build after r182596.
537 I was wrong to replace PLATFORM(IOS) with HAVE(PARENTAL_CONTROLS) in ContentFilterUnblockHandler.
538 The conditional should be HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS).
540 * platform/ContentFilterUnblockHandler.h:
541 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
542 (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler):
543 (WebCore::ContentFilterUnblockHandler::needsUIProcess):
544 (WebCore::ContentFilterUnblockHandler::encode):
545 (WebCore::ContentFilterUnblockHandler::decode):
546 (WebCore::ContentFilterUnblockHandler::canHandleRequest):
547 (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
549 2015-04-09 Andy Estes <aestes@apple.com>
551 [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
552 https://bugs.webkit.org/show_bug.cgi?id=143559
554 Reviewed by David Kilzer.
556 * loader/ContentFilter.cpp:
557 (WebCore::ContentFilter::types): Only registered ParentalControlsContentFilter if HAVE(PARENTAL_CONTROLS).
558 * platform/ContentFilterUnblockHandler.h: Changed PLATFORM(IOS) to HAVE(PARENTAL_CONTROLS).
559 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
560 (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Ditto.
561 (WebCore::ContentFilterUnblockHandler::needsUIProcess): Ditto.
562 (WebCore::ContentFilterUnblockHandler::encode): Ditto.
563 (WebCore::ContentFilterUnblockHandler::decode): Ditto.
564 (WebCore::ContentFilterUnblockHandler::canHandleRequest): Ditto.
565 (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Ditto.
566 * platform/cocoa/ParentalControlsContentFilter.mm: Wrapped the file with HAVE(PARENTAL_CONTROLS)
568 2015-04-09 Sergio Villar Senin <svillar@igalia.com>
570 Unreviewed, added CSS Grid Layout to features.json file.
574 2015-04-08 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
576 [Streams API] Support the start function parameter in ReadableStream constructor
577 https://bugs.webkit.org/show_bug.cgi?id=141160
579 Reviewed by Benjamin Poulain.
581 Stores the JS source object in ReadableStreamJSSource and calls its "start" function.
582 This function takes a controller object that has three JS functions as members: close, enqueue and error.
583 This controller is stored in ReadableStreamJSSource as it will be reused as "pull" parameter.
584 All three JS functions do not currently do anything.
586 Test: streams/readablestream-start.html
588 * Modules/streams/ReadableStream.cpp:
589 (WebCore::ReadableStream::start): Place holder for step 11 of https://streams.spec.whatwg.org/#rs-constructor.
590 * Modules/streams/ReadableStream.h:
591 * bindings/js/JSReadableStreamCustom.cpp:
592 (WebCore::constructJSReadableStream):
593 * bindings/js/ReadableStreamJSSource.cpp:
594 (WebCore::getPropertyFromObject): Helper function to get a public property from an object.
595 (WebCore::setPropertyToObject): Helper function to set a public property to an object.
596 (WebCore::callFunction): Helper function to call a JS function from C++.
597 (WebCore::ReadableStreamJSSource::ReadableStreamJSSource):
598 (WebCore::notImplementedFunction):
599 (WebCore::createReadableStreamEnqueueFunction): Creates the JS function for enqueue.
600 (WebCore::createReadableStreamCloseFunction): Creates the JS function for close.
601 (WebCore::createReadableStreamErrorFunction): Creates the JS function for error.
602 (WebCore::startReadableStreamAsync): Equivalent of promise resolution for start.
603 (WebCore::ReadableStreamJSSource::start): Calls the "start" function of the JS source with all three JS functions (enqueue, close, error) as parameters.
604 * bindings/js/ReadableStreamJSSource.h:
606 2015-04-08 Brent Fulgham <bfulgham@apple.com>
608 [Mac] Unreviewed test fix after r182584
609 https://bugs.webkit.org/show_bug.cgi?id=143452
611 Correct bit comparison to use the correct value for the Control-key
613 * platform/mac/PlatformEventFactoryMac.mm:
614 (WebCore::typeForEvent):
616 2015-04-08 Simon Fraser <simon.fraser@apple.com>
618 Add a debug assertion that will fire if we try to paint layer contents on a background thread
619 https://bugs.webkit.org/show_bug.cgi?id=143547
621 Reviewed by Alexey Proskuryakov.
623 New assertion to catch cases where other frameworks erroneously trigger painting
624 on a non-main (or non-Web) thread.
626 * platform/graphics/mac/WebLayer.mm:
627 (-[WebSimpleLayer display]):
628 (-[WebSimpleLayer drawInContext:]):
630 2015-04-08 Brent Fulgham <bfulgham@apple.com>
632 [Mac] WebKit is not honoring OS preferences for secondary click behaviors
633 https://bugs.webkit.org/show_bug.cgi?id=143452
634 <rdar://problem/20437483>
636 Reviewed by Tim Horton.
638 We cannot rely on the event's button number to decide behavior. The OS settings might have
639 mapped middle button to context menu, etc. Instead, we should ask the OS (via NSMenu) what
640 the proper button press behavior is.
642 * platform/mac/PlatformEventFactoryMac.mm:
643 (WebCore::mouseButtonForEvent): Ask NSMenu what kind of button press we have received.
645 2015-04-08 Michael Catanzaro <mcatanzaro@igalia.com>
647 Fix -Wformat in AnimationBase.cpp
648 https://bugs.webkit.org/show_bug.cgi?id=143541
650 Reviewed by Simon Fraser.
652 * page/animation/AnimationBase.cpp:
653 (WebCore::nameForStateInput): Added. Converts an AnimationBase::AnimationStateInput to a
655 (WebCore::AnimationBase::updateStateMachine): Print AnimationBase::AnimationStateInput as a
656 string, instead of passing it to %d and assuming that works, to silence GCC's -Wformat.
658 2015-04-08 Brady Eidson <beidson@apple.com>
660 Expose the "Share" menu for links, images, and media.
661 <rdar://problem/20435340> and https://bugs.webkit.org/show_bug.cgi?id=143502
663 Reviewed by Tim Horton.
665 * loader/EmptyClients.h:
666 * page/ContextMenuClient.h:
667 (WebCore::ContextMenuClient::shareSelectedTextMenuItem): Deleted.
669 * page/ContextMenuController.cpp:
670 (WebCore::ContextMenuController::populate):
671 (WebCore::selectionContainsPossibleWord): Deleted.
672 * page/ContextMenuController.h:
673 (WebCore::ContextMenuController::page):
675 * platform/ContextMenuItem.cpp:
676 (WebCore::ContextMenuItem::ContextMenuItem):
677 (WebCore::ContextMenuItem::isNull):
678 (WebCore::ContextMenuItem::shareMenuItem):
679 (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
680 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
681 * platform/ContextMenuItem.h:
683 * platform/gtk/ContextMenuItemGtk.cpp:
684 (WebCore::ContextMenuItem::shareMenuItem): Return a null item.
685 (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
686 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
688 * platform/mac/ContextMenuItemMac.mm:
689 (WebCore::ContextMenuItem::shareMenuItem): Create a full-featured Share menu item instead of just for selected text.
690 (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
691 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
693 * rendering/HitTestResult.cpp:
694 (WebCore::HitTestResult::selectedText): Instead of calculating selected text outside the HitTestResult, let the
695 HitTestResult do what it does best: Calculate things!
696 * rendering/HitTestResult.h:
698 2015-04-08 Per Arne Vollan <peavo@outlook.com>
700 [Curl] Compile error in CurlCacheEntry::parseResponseHeaders method.
701 https://bugs.webkit.org/show_bug.cgi?id=143531
703 Reviewed by Alex Christensen.
705 Cache related methods in ResourceResponse have changed return type.
707 * platform/network/curl/CurlCacheEntry.cpp:
708 (WebCore::CurlCacheEntry::parseResponseHeaders):
710 2015-04-08 Anders Carlsson <andersca@apple.com>
712 Remove ApplicationCacheGroup::m_isCopy
713 https://bugs.webkit.org/show_bug.cgi?id=143536
715 Reviewed by Tim Horton.
717 Code that used to set m_isCopy to true is long gone.
719 * loader/appcache/ApplicationCache.cpp:
720 (WebCore::ApplicationCache::~ApplicationCache):
721 * loader/appcache/ApplicationCacheGroup.cpp:
722 (WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
723 (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup):
724 * loader/appcache/ApplicationCacheGroup.h:
725 (WebCore::ApplicationCacheGroup::isCopy): Deleted.
727 2015-04-08 Anders Carlsson <andersca@apple.com>
729 Delete ApplicationCache static member functions
730 https://bugs.webkit.org/show_bug.cgi?id=143534
732 Reviewed by Tim Horton.
734 * loader/appcache/ApplicationCache.cpp:
735 (WebCore::ApplicationCache::deleteCacheForOrigin): Deleted.
736 (WebCore::ApplicationCache::deleteAllCaches): Deleted.
737 (WebCore::ApplicationCache::diskUsageForOrigin): Deleted.
738 * loader/appcache/ApplicationCache.h:
740 2015-04-08 Alex Christensen <achristensen@webkit.org>
742 Block popups from content extensions.
743 https://bugs.webkit.org/show_bug.cgi?id=143497
745 Reviewed by Brady Eidson.
747 Test: http/tests/contentextensions/popups.html
749 * loader/ResourceLoadInfo.cpp:
750 (WebCore::readResourceType):
751 * loader/ResourceLoadInfo.h:
752 * page/DOMWindow.cpp:
753 (WebCore::DOMWindow::open):
754 * page/UserContentController.cpp:
755 (WebCore::UserContentController::actionsForResourceLoad):
756 * page/UserContentController.h:
757 Check content extensions before opening a window.
759 2015-04-08 Bem Jones-Bey <bjonesbe@adobe.com>
761 [CSS Shapes] Properly handle negative reference box widths and center coordinates
762 https://bugs.webkit.org/show_bug.cgi?id=142610
764 Reviewed by Rob Buis.
766 Fix a few cases where values that should not be negative end up that
769 This patch is based on a couple of Blink patches by Rob Buis.
771 Tests: fast/shapes/shape-outside-floats/shape-outside-floats-circle-negative-radius-crash.html
772 fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-width-crash.html
774 * rendering/shapes/ShapeOutsideInfo.cpp:
775 (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): A
776 negative margin box width means that the shape has no extent, so
778 * rendering/style/BasicShapes.cpp:
779 (WebCore::BasicShapeCircle::floatValueForRadiusInBox): When computing
780 the radii, take the absolute value, since the radii is based on
781 the distance, which is always positive.
782 (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto.
784 2015-04-08 Commit Queue <commit-queue@webkit.org>
786 Unreviewed, rolling out r182522.
787 https://bugs.webkit.org/show_bug.cgi?id=143529
789 Not needed any more (Requested by ap on #webkit).
794 http://trac.webkit.org/changeset/182522
796 2015-04-08 Beth Dakin <bdakin@apple.com>
798 Force events should not require preventDefault in order to fire
799 https://bugs.webkit.org/show_bug.cgi?id=143503
801 rdar://problem/20458916
803 Reviewed by Tim Horton.
805 Since these events will fire whether or not preventDefault was set on the
806 willBegin event, we should make sure we only send them when there are registered
807 event listeners. These are new events, so we don’t want to spam the vast majority
808 of web content that doesn’t use them yet.
810 (WebCore::Document::addListenerTypeIfNeeded):
813 (WebCore::Element::dispatchMouseForceWillBegin):
814 (WebCore::Element::dispatchMouseForceChanged):
815 (WebCore::Element::dispatchMouseForceDown):
816 (WebCore::Element::dispatchMouseForceUp):
817 (WebCore::Element::dispatchMouseForceClick):
818 (WebCore::Element::dispatchMouseForceCancelled):
820 2015-04-08 Jer Noble <jer.noble@apple.com>
822 [Mac][WebAudio] Update the AVAudioMix in the AudioSourceProviderAVFObjC when the list of enabled audio tracks change.
823 https://bugs.webkit.org/show_bug.cgi?id=143332
825 Reviewed by Eric Carlson.
827 Some media assets (notably, mp3s) will not have an enabled audio track when the AVAsset is
828 first loaded, so the AVAudioMix will have no trackID in it's parameters. Whenever the list
829 of enabled tracks change, recreate the AVAudioMix with the new first enabled audio trackID.
831 To facilitate this, add a new setter to AudioSourceProviderAVFObjC taking an AVAssetTrack to
832 use with the AVAudioMix. Whenever this parameter changes, the AVAudioMix is destroyed and
835 * html/HTMLMediaElement.cpp:
836 (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Drive-by fix: when the media
837 player switches engines, re-associate the audio source node with its provider.
838 * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
839 * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
840 (WebCore::AudioSourceProviderAVFObjC::setPlayerItem): Only create the mix if there is a valid AVPlayerItem and AVAssetTrack
841 (WebCore::AudioSourceProviderAVFObjC::setAudioTrack): Ditto.
842 (WebCore::AudioSourceProviderAVFObjC::createMix): Don't iterate over the AVPlayerItem's tracks,
843 just use the one passed in through setAudioTrack().
844 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
845 (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear the provider's track.
846 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Set the provider's track.
847 (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Ditto.
848 (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto.
850 2015-04-08 Anders Carlsson <andersca@apple.com>
852 Move some ApplicationCache static member functions to ApplicationCacheStorage
853 https://bugs.webkit.org/show_bug.cgi?id=143524
855 Reviewed by Antti Koivisto.
857 This is yet another step towards eliminating ApplicationCacheStorage::singleton() and making the storage be per page instead.
859 * loader/appcache/ApplicationCache.cpp:
860 (WebCore::ApplicationCache::deleteCacheForOrigin):
861 (WebCore::ApplicationCache::deleteAllCaches):
862 (WebCore::ApplicationCache::diskUsageForOrigin):
863 * loader/appcache/ApplicationCacheStorage.cpp:
864 (WebCore::ApplicationCacheStorage::deleteAllCaches):
865 (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
866 (WebCore::ApplicationCacheStorage::diskUsageForOrigin):
867 * loader/appcache/ApplicationCacheStorage.h:
869 2015-04-08 ChangSeok Oh <changseok.oh@collabora.com>
871 Fill list style background with same color with that of list background.
872 https://bugs.webkit.org/show_bug.cgi?id=143483
874 Reviewed by Simon Fraser.
876 LayoutListMarker does not have a node so its selectionBackgroundColor alway returns
877 the default theme color for selection. We can make it more natural by filling
878 the same color with that of LayoutListItem into it.
880 Tests: fast/backgrounds/selection-background-color-of-image-list-style.html
881 fast/backgrounds/selection-background-color-of-list-style.html
883 * rendering/RenderListMarker.cpp:
884 (WebCore::RenderListMarker::paint):
886 2015-04-08 Alex Christensen <achristensen@webkit.org> and Patrick Gansterer <paroga@webkit.org>
888 Add CMake build system for WinCairo port.
889 https://bugs.webkit.org/show_bug.cgi?id=115944
891 Reviewed by Chris Dumez.
895 * PlatformWinCairo.cmake:
896 * platform/graphics/texmap/TextureMapperGL.cpp:
897 (WebCore::TextureMapperGL::TextureMapperGL):
899 2015-04-08 Chris Dumez <cdumez@apple.com>
901 Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for clarity
902 https://bugs.webkit.org/show_bug.cgi?id=143513
904 Reviewed by Andreas Kling.
906 Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for
907 clarity as it is only used for the page cache. Also rename the
908 'DocumentWillBecomeInactive' value of the ReasonForSuspension enum to
909 'PageCache' as it is only used by CachedFrame for the page cache and it
910 is a lot more understandable.
912 2015-04-08 Commit Queue <commit-queue@webkit.org>
914 Unreviewed, rolling out r182536.
915 https://bugs.webkit.org/show_bug.cgi?id=143523
917 Made accessibility/table-sections.html time out on debug bots
918 (Requested by ap on #webkit).
922 "Simple line layout: Add <br> support."
923 https://bugs.webkit.org/show_bug.cgi?id=139012
924 http://trac.webkit.org/changeset/182536
926 2015-04-08 Carlos Garcia Campos <cgarcia@igalia.com>
928 [GTK] Crash in DOMObjectCache when a wrapped object owned by the cache is unreffed by the user
929 https://bugs.webkit.org/show_bug.cgi?id=143521
931 Reviewed by Martin Robinson.
933 This is a case we claim to support, but it only works if the
934 object has only one reference. In that case, when the user unrefs
935 it, the weak ref notify callback removes the object from the
936 cache. However, if the object has more than one ref, the cache
937 doesn't know the user unreffed it, and when clearing the cache we
938 try to remove more references than what the object actually has,
939 causing a crash in g_object_unref.
941 * bindings/gobject/DOMObjectCache.cpp:
942 (WebKit::DOMObjectCacheData::clearObject):
944 2015-04-08 Zalan Bujtas <zalan@apple.com>
946 Simple line layout: Add <br> support.
947 https://bugs.webkit.org/show_bug.cgi?id=139012
949 This patch enables RenderBlockFlows to use simple line layout on text content when <br> is present.
950 Simple text with <br> is a fairly common pattern on discussion(forum)-like web pages. This patch reduces memory usage
951 and speeds up layout for such content.
953 PerformanceTest/layout/line-layout-simple.html shows more than 2x speedup, when each paragraph is modified by appending <br> to the end.
954 With <br> support enabled:
955 mean: 70.02391461289068 runs/s
956 median: 70.47986488932318 runs/s
958 While with <br> support disabled:
959 mean: 30.417295049468184 runs/s
960 median: 30.36517778760357 runs/s
962 Reviewed by Antti Koivisto.
964 Test: fast/text/simple-line-with-br.html
966 * editing/TextIterator.cpp:
967 (WebCore::TextIterator::handleTextNode):
968 * rendering/RenderBlock.h:
969 * rendering/RenderBlockFlow.cpp:
970 (WebCore::RenderBlockFlow::setSelectionState):
971 (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
972 * rendering/RenderBlockFlow.h:
973 * rendering/RenderLineBreak.cpp:
974 (WebCore::simpleLineLayout):
975 (WebCore::ensureLineBoxes):
976 (WebCore::RenderLineBreak::deleteLineBoxesBeforeSimpleLineLayout):
977 (WebCore::RenderLineBreak::positionForPoint):
978 (WebCore::RenderLineBreak::setSelectionState):
979 (WebCore::RenderLineBreak::linesBoundingBox):
980 (WebCore::RenderLineBreak::absoluteRects):
981 (WebCore::RenderLineBreak::absoluteQuads):
982 (WebCore::RenderLineBreak::collectSelectionRects):
983 * rendering/RenderLineBreak.h:
984 * rendering/SimpleLineLayout.cpp:
985 (WebCore::SimpleLineLayout::canUseFor):
986 (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
987 (WebCore::SimpleLineLayout::removeTrailingWhitespace):
988 (WebCore::SimpleLineLayout::consumeLineBreakIfNeeded):
989 (WebCore::SimpleLineLayout::skipWhitespaceIfNeeded):
990 (WebCore::SimpleLineLayout::firstFragment):
991 (WebCore::SimpleLineLayout::forceFragmentToLine):
992 (WebCore::SimpleLineLayout::createLineRuns):
993 (WebCore::SimpleLineLayout::create):
994 * rendering/SimpleLineLayoutFlowContents.cpp:
995 (WebCore::SimpleLineLayout::initializeSegments):
996 (WebCore::SimpleLineLayout::FlowContents::segmentForRenderer): Deleted.
997 * rendering/SimpleLineLayoutFlowContents.h:
998 * rendering/SimpleLineLayoutFunctions.cpp:
999 (WebCore::SimpleLineLayout::paintFlow):
1000 (WebCore::SimpleLineLayout::hitTestFlow):
1001 (WebCore::SimpleLineLayout::showLineLayoutForFlow):
1002 * rendering/SimpleLineLayoutResolver.cpp:
1003 (WebCore::SimpleLineLayout::RunResolver::Run::rect):
1004 (WebCore::SimpleLineLayout::RunResolver::RunResolver):
1005 (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
1006 * rendering/SimpleLineLayoutResolver.h:
1007 (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode):
1008 (WebCore::SimpleLineLayout::RunResolver::Iterator::operator--):
1009 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1010 (WebCore::SimpleLineLayout::EndOfSegmentSetter::EndOfSegmentSetter):
1011 (WebCore::SimpleLineLayout::EndOfSegmentSetter::~EndOfSegmentSetter):
1012 (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
1013 (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
1014 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
1015 * rendering/SimpleLineLayoutTextFragmentIterator.h:
1016 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLastInRenderer):
1017 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLineBreak):
1018 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
1019 (WebCore::SimpleLineLayout::TextFragmentIterator::isSoftLineBreak):
1020 (WebCore::SimpleLineLayout::TextFragmentIterator::isHardLineBreak):
1021 (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak): Deleted.
1023 2015-04-08 Philippe Normand <pnormand@igalia.com>
1025 [GStreamer] compress property for the HTTP source element
1026 https://bugs.webkit.org/show_bug.cgi?id=143518
1028 Reviewed by Carlos Garcia Campos.
1030 Added a compress property so the default behavior or not
1031 requesting content encoded to the server can be overridden if
1032 needed. This is useful for adaptive streaming playback.
1034 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1035 (webKitWebSrcSetProperty):
1036 (webKitWebSrcGetProperty):
1037 (webKitWebSrcStart):
1039 2015-04-08 Joonghun Park <jh718.park@samsung.com>
1041 Remove CSS functions min() and max() which had been dropped from specification
1042 https://bugs.webkit.org/show_bug.cgi?id=143440
1044 Reviewed by Darin Adler.
1046 No new tests, No Behavior changes.
1048 * css/CSSCalculationValue.cpp:
1049 (WebCore::CSSCalcValue::create):
1050 * css/CSSParser.cpp:
1051 (WebCore::CSSParser::isCalculation):
1053 2015-04-07 Philippe Normand <pnormand@igalia.com>
1055 [GStreamer] extra-headers and keep-alive properties for HTTP source element
1056 https://bugs.webkit.org/show_bug.cgi?id=143480
1058 Reviewed by Carlos Garcia Campos.
1060 Keep the resource loader around when persistent HTTP connection
1061 support is enabled. The keep-alive property is set to false by
1062 default. Also before sending the HTTP request we now check the
1063 contents of the extra-headers GstStructure and set additional
1064 headers based on the structure contents.
1066 Patch inspired by GStreamer's souphttpsrc element.
1068 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1069 (webkit_web_src_init):
1070 (webKitWebSrcFinalize):
1071 (webKitWebSrcSetProperty):
1072 (webKitWebSrcGetProperty):
1073 (webKitWebSrcStop): Clear resource loader only for non-persistent connections.
1074 (webKitWebSrcSetExtraHeader): Utility function to append headers
1075 to an existing request based on a GValue contents.
1076 (webKitWebSrcProcessExtraHeaders): Parse a GValue and set headers
1077 based on its contents.
1078 (webKitWebSrcStart): Extra headers and persistent connection
1079 support. The resource loader is now lazily initialized here.
1081 2015-04-07 Simon Fraser <simon.fraser@apple.com>
1085 * platform/graphics/cocoa/FontCascadeCocoa.mm:
1086 (WebCore::FontCascade::drawGlyphs):
1087 * platform/spi/cg/CoreGraphicsSPI.h:
1089 2015-04-07 Chris Dumez <cdumez@apple.com>
1091 Unreviewed, another iOS build fix after r182516.
1093 I missed another use of __MAC_OS_X_VERSION_MIN_REQUIRED without a
1094 PLATFORM(MAC) check.
1096 * platform/graphics/cocoa/FontCascadeCocoa.mm:
1098 2015-04-07 Michael Peechatt <mpeechatt@gmail.com>
1100 Bug 142887 - role progress bar does not support indeterminate state
1101 https://bugs.webkit.org/show_bug.cgi?id=142887
1103 Reviewed by Chris Fleizach.
1105 Test: platform/mac/accessibility/progressbar-indeterminate.html
1107 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1108 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1109 When getting min or max value of an indeterminate progress indicator, return 0.
1110 This is so VoiceOver will recognize it as indeterminate.
1112 2015-04-07 Chris Dumez <cdumez@apple.com>
1114 Unreviewed, speculative iOS build fix after r182516.
1116 Add #if PLATFORM(MAC) checks.
1118 * platform/spi/cg/CoreGraphicsSPI.h:
1120 2015-04-07 Simon Fraser <simon.fraser@apple.com>
1122 Try to fix incremental builds by forcing *InternalSettings* to get
1125 * testing/InternalSettings.idl:
1127 2015-04-07 Chris Dumez <cdumez@apple.com>
1129 Open WebSockets should not prevent a page from entering PageCache
1130 https://bugs.webkit.org/show_bug.cgi?id=143505
1131 <rdar://problem/19923085>
1133 Reviewed by Alexey Proskuryakov.
1135 Open WebSockets should not prevent a page from entering PageCache. This
1136 is currently causing mobile.nytimes.com to not be page-cacheable.
1138 In this patch, We close open WebSockets when entering the page cache
1139 and fire the "close" events after resuming, similarly to what we did
1140 for XMLHttpRequest in r181480. This gives a chance for the content to
1141 handle the 'close' event (with wasClean being false and code being
1142 1006) in order to reopen the connection if necessary.
1144 Test: http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
1146 * Modules/websockets/WebSocket.cpp:
1147 (WebCore::WebSocket::WebSocket):
1148 (WebCore::WebSocket::canSuspend):
1149 (WebCore::WebSocket::suspend):
1150 (WebCore::WebSocket::resume):
1151 (WebCore::WebSocket::resumeTimerFired):
1152 (WebCore::WebSocket::didClose):
1153 * Modules/websockets/WebSocket.h:
1155 2015-04-07 Simon Fraser <simon.fraser@apple.com>
1157 Add experimental code to use custom font dilation when rendering into non-opaque contexts
1158 https://bugs.webkit.org/show_bug.cgi?id=143508
1160 Reviewed by Sam Weinig.
1162 Add GraphicsContext::setAntialiasedFontDilationEnabled(), and set it to true
1163 when rendering into a compositing layer which is not opaque (at the same location
1164 where we disable font smoothing).
1166 If Settings::antialiasedFontDilationEnabled() is true, when rendering non-smoothed
1167 text (and if CSS hasn't opted into antialiased mode), use custom font dilation
1168 parameters, chosen using a light/medium/dark heuristic, to make this text
1169 match more closely with LCD-smoothed text.
1171 * page/Settings.cpp:
1172 (WebCore::Settings::Settings):
1173 (WebCore::Settings::setAntialiasedFontDilationEnabled): Set global state
1174 in FontCascade (which can't easily get at Settings). This it not ideal,
1177 (WebCore::Settings::antialiasedFontDilationEnabled):
1178 * page/Settings.in: Can't autogenerate this setting any more.
1179 * platform/graphics/FontCascade.cpp:
1180 (WebCore::FontCascade::setAntialiasedFontDilationEnabled): Set the global.
1181 (WebCore::FontCascade::antialiasedFontDilationEnabled):
1182 * platform/graphics/FontCascade.h:
1183 * platform/graphics/GraphicsContext.cpp:
1184 (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): Set graphics state
1185 to say that we should do dilation of antialiased text.
1186 * platform/graphics/GraphicsContext.h:
1187 (WebCore::GraphicsContextState::GraphicsContextState):
1188 (WebCore::GraphicsContext::antialiasedFontDilationEnabled):
1189 * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1190 (PlatformCALayer::drawLayerContents): If the layer is not opaque, enable the
1191 dilated text code path.
1192 * platform/graphics/cocoa/FontCascadeCocoa.mm:
1193 (WebCore::dilationSizeForTextColor): Heuristic (values chosen empirically) to
1194 computed custom dilation based on foreground color.
1195 (WebCore::FontCascade::drawGlyphs): Set the custom dilation parameters, and the
1196 antialiasing state if we're not doing smoothing, and CSS hasn't opted into the
1198 * platform/spi/cg/CoreGraphicsSPI.h: New SPI.
1200 2015-04-07 Commit Queue <commit-queue@webkit.org>
1202 Unreviewed, rolling out r182511.
1203 https://bugs.webkit.org/show_bug.cgi?id=143507
1205 caused debug test failures (Requested by alexchristensen on
1210 "Block popups from content extensions."
1211 https://bugs.webkit.org/show_bug.cgi?id=143497
1212 http://trac.webkit.org/changeset/182511
1214 2015-04-07 Myles C. Maxfield <mmaxfield@apple.com>
1216 [Cocoa] System fonts do not get correct tracking
1217 https://bugs.webkit.org/show_bug.cgi?id=143395
1219 Reviewed by Ryosuke Niwa.
1221 Inside FontPlatformData, we have two CTFonts. If the user has specified
1222 -webkit-system-font, we will pass in a CTFont, and the FontPlatformData
1223 will wrap it. However, we will then roundtrip through CGFont in order
1224 to create a second CTFont. We were basing our tracking and system
1225 font knowledge off of this round-tripped font instead of the original font.
1227 Note that this design is terrible and needs to be overhauled.
1228 FontPlatformData should only have a single platform font inside it.
1230 This patch also caches whether or not a font is a system font.
1232 No new tests because it is impossible to test the tracking of the
1233 system font in a robust way.
1235 * platform/graphics/Font.cpp:
1236 (WebCore::Font::Font): Rearrange member variables.
1237 * platform/graphics/Font.h: Move member variables around for better
1238 packing, and cache whether or not the font is a system font.
1239 * platform/graphics/FontData.h: Add comment
1240 * platform/graphics/cocoa/FontCocoa.mm:
1241 (WebCore::Font::platformInit): Cache whether or not the font is a system
1243 (WebCore::hasCustomTracking): Use cached value.
1244 (WebCore::canUseFastGlyphAdvanceGetter):
1245 (WebCore::Font::platformWidthForGlyph):
1247 2015-04-07 Alex Christensen <achristensen@webkit.org>
1249 Block popups from content extensions.
1250 https://bugs.webkit.org/show_bug.cgi?id=143497
1252 Reviewed by Brady Eidson.
1254 Test: http/tests/contentextensions/popups.html
1256 * loader/ResourceLoadInfo.cpp:
1257 (WebCore::readResourceType):
1258 * loader/ResourceLoadInfo.h:
1259 * page/DOMWindow.cpp:
1260 (WebCore::DOMWindow::open):
1261 * page/UserContentController.cpp:
1262 (WebCore::UserContentController::actionsForResourceLoad):
1263 * page/UserContentController.h:
1264 Check content extensions before opening a window.
1266 2015-04-07 Benjamin Poulain <benjamin@webkit.org>
1268 Get the features.json files ready for open contributions
1269 https://bugs.webkit.org/show_bug.cgi?id=143436
1271 Reviewed by Darin Adler.
1275 2015-04-07 Alex Christensen <achristensen@webkit.org>
1277 More unreviewed fixing API tests.
1279 * contentextensions/ContentExtensionsBackend.cpp:
1280 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1281 Don't check for javascript protocol.
1283 2015-04-07 Eric Carlson <eric.carlson@apple.com>
1285 [Mac] never update caption user style sheet during parsing
1286 https://bugs.webkit.org/show_bug.cgi?id=143499
1288 Reviewed by Jer Noble.
1290 * page/CaptionUserPreferencesMediaAF.cpp:
1291 (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
1292 (WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged): Ignore a
1293 "preferences changed" notification fired while registering for said notification, we
1294 already create and insert the style sheet after a brief delay anyway.
1295 * page/CaptionUserPreferencesMediaAF.h:
1297 2015-04-07 Alex Christensen <achristensen@webkit.org>
1299 [Win] Unreviewed build fix after r182494.
1301 * platform/win/ContextMenuItemWin.cpp:
1302 (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
1304 2015-04-07 Alex Christensen <achristensen@webkit.org>
1306 Unreviewed fixing API tests.
1308 * contentextensions/ContentExtensionsBackend.cpp:
1309 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1311 (WebCore::URL::init):
1313 (WebCore::URL::protocolIsData):
1314 (WebCore::URL::protocolIsJavaScript): Deleted.
1315 Revert part of r182492 that changed URL.h.
1317 2015-04-07 Anders Carlsson <andersca@apple.com>
1319 More work on making the application cache storage be per page
1320 https://bugs.webkit.org/show_bug.cgi?id=143498
1322 Reviewed by Andreas Kling.
1324 * loader/appcache/ApplicationCacheStorage.cpp:
1325 (WebCore::ApplicationCacheStorage::create):
1326 (WebCore::ApplicationCacheStorage::singleton):
1327 * loader/appcache/ApplicationCacheStorage.h:
1329 (WebCore::Page::Page):
1331 (WebCore::Page::applicationCacheStorage):
1332 * page/PageConfiguration.cpp:
1333 (WebCore::PageConfiguration::PageConfiguration): Deleted.
1334 * page/PageConfiguration.h:
1336 2015-04-07 Matthew Mirman <mmirman@apple.com>
1338 Source and stack information should get appended only to native errors
1339 and should be added directly after construction rather than when thrown.
1340 This fixes frozen objects being unfrozen when thrown while conforming to
1341 ecma script standard and other browser behavior.
1342 rdar://problem/19927293
1343 https://bugs.webkit.org/show_bug.cgi?id=141871
1345 Reviewed by Geoffrey Garen.
1347 Covered by existing tests.
1349 Sets line, column, source and stack information for DOMExceptions as
1350 expected by the webinspector for native errors.
1352 * bindings/js/JSDOMBinding.cpp:
1353 (WebCore::setDOMException):
1355 2015-04-07 Brady Eidson <beidson@apple.com>
1357 ContextMenuItem refactoring
1358 https://bugs.webkit.org/show_bug.cgi?id=143485
1360 Reviewed by Beth Dakin.
1362 * platform/ContextMenuItem.h:
1363 (WebCore::ContextMenuItem::isNull):
1365 * platform/gtk/ContextMenuItemGtk.cpp:
1366 (WebCore::ContextMenuItem::ContextMenuItem):
1368 * platform/mac/ContextMenuItemMac.mm:
1369 (WebCore::ContextMenuItem::ContextMenuItem):
1370 (WebCore::ContextMenuItem::platformDescription):
1371 (WebCore::ContextMenuItem::setSubMenu):
1372 (WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
1373 (WebCore::ContextMenuItem::getPlatformDescription): Deleted.
1375 * platform/mac/ContextMenuMac.mm:
1376 (WebCore::ContextMenu::appendItem):
1377 (WebCore::ContextMenu::insertItem):
1378 (WebCore::platformMenuDescription):
1380 * platform/win/ContextMenuItemWin.cpp:
1381 (WebCore::ContextMenuItem::ContextMenuItem):
1383 2015-04-07 Alex Christensen <achristensen@webkit.org>
1385 Optimize content extensions interpreting speed.
1386 https://bugs.webkit.org/show_bug.cgi?id=143490
1388 Reviewed by Brady Eidson.
1390 * contentextensions/ContentExtensionCompiler.cpp:
1391 (WebCore::ContentExtensions::compileRuleList):
1392 * contentextensions/ContentExtensionsBackend.cpp:
1393 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1394 Measure total time added by content extensions.
1395 * contentextensions/DFABytecodeCompiler.cpp:
1396 (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1397 (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1398 When jumping to the root, don't re-add all the actions.
1399 * contentextensions/DFABytecodeCompiler.h:
1401 (WebCore::URL::init):
1403 (WebCore::URL::protocolIsJavaScript): Added.
1405 2015-04-07 Simon Fraser <simon.fraser@apple.com>
1407 Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
1408 https://bugs.webkit.org/show_bug.cgi?id=143495
1410 Reviewed by Tim Horton.
1412 Add a new Setting, antialiasedFontDilationEnabled, which defaults to true. This
1413 will be used in an upcoming patch.
1417 2015-04-07 Andy Estes <aestes@apple.com>
1419 [Content Filtering] Add logging
1420 https://bugs.webkit.org/show_bug.cgi?id=143470
1422 Reviewed by Daniel Bates.
1424 Added a new ContentFiltering logging channel, and started logging some useful diagnostic messages.
1426 * loader/ContentFilter.cpp:
1427 (WebCore::ContentFilter::~ContentFilter):
1428 (WebCore::ContentFilter::willSendRequest):
1429 (WebCore::ContentFilter::startFilteringMainResource):
1430 (WebCore::ContentFilter::responseReceived):
1431 (WebCore::ContentFilter::dataReceived):
1432 (WebCore::ContentFilter::notifyFinished):
1433 (WebCore::ContentFilter::didDecide):
1434 * platform/Logging.h:
1435 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1436 (WebCore::ContentFilterUnblockHandler::canHandleRequest):
1437 (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
1438 * platform/cocoa/NetworkExtensionContentFilter.mm:
1439 (WebCore::NetworkExtensionContentFilter::enabled):
1440 (WebCore::NetworkExtensionContentFilter::unblockHandler):
1441 (WebCore::NetworkExtensionContentFilter::handleDecision):
1442 * platform/cocoa/ParentalControlsContentFilter.mm:
1443 (WebCore::ParentalControlsContentFilter::enabled):
1444 (WebCore::ParentalControlsContentFilter::updateFilterState):
1445 * testing/MockContentFilter.cpp:
1446 (WebCore::MockContentFilter::enabled):
1447 (WebCore::MockContentFilter::unblockHandler):
1448 (WebCore::MockContentFilter::maybeDetermineStatus):
1450 2015-04-07 Eric Carlson <eric.carlson@apple.com>
1452 [Mac] video playing to external device should not be interrupted
1453 https://bugs.webkit.org/show_bug.cgi?id=143492
1455 Reviewed by Jer Noble.
1457 * Modules/mediacontrols/mediaControlsApple.js:
1458 (Controller.prototype.handlePanelTransitionEnd): Drive-by fix to make sure the controls are
1459 not hidden if the opacity timer is primed before they go into a state where they should
1462 * html/HTMLMediaElement.cpp:
1463 (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Make it const.
1464 (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): New.
1465 * html/HTMLMediaElement.h:
1467 * html/HTMLMediaSession.cpp:
1468 (WebCore::HTMLMediaSession::canPlayToWirelessPlaybackTarget): New. Short-circuit call to
1469 client when we already know the answer.
1470 (WebCore::HTMLMediaSession::isPlayingToWirelessPlaybackTarget): Ditto.
1471 (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Ditto.
1472 (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Ditto.
1473 * html/HTMLMediaSession.h:
1475 * platform/audio/MediaSession.cpp:
1476 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): Deleted, moved inline and neutered
1477 because only HTMLMediaSession needs to use them.
1478 (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
1479 (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
1480 * platform/audio/MediaSession.h:
1481 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget):
1482 (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
1483 (WebCore::MediaSession::startPlayingToPlaybackTarget):
1484 (WebCore::MediaSession::stopPlayingToPlaybackTarget):
1485 (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
1486 (WebCore::MediaSessionClient::isPlayingToWirelessPlaybackTarget):
1488 * platform/audio/MediaSessionManager.cpp:
1489 (WebCore::MediaSessionManager::MediaSessionManager):
1490 (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): New.
1491 (WebCore::MediaSessionManager::sessionWillBeginPlayback): Don't interrupt an active session
1492 playing to a target device.
1493 * platform/audio/MediaSessionManager.h:
1495 * platform/graphics/MediaPlayer.cpp:
1496 (WebCore::MediaPlayer::isPlayingToWirelessPlaybackTarget): New, passthrough.
1497 * platform/graphics/MediaPlayer.h:
1498 * platform/graphics/MediaPlayerPrivate.h:
1499 (WebCore::MediaPlayerPrivateInterface::isPlayingToWirelessPlaybackTarget):
1501 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1502 (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
1503 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1504 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Explicitly call
1505 when passed a nil or inactive target context.
1506 (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Add logging.
1507 (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Ditto.
1508 (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): New. Return
1509 true when playing with an active context.
1510 (WebCore::playerKVOProperties): "outputContext" is not observable.
1512 2015-04-07 Sam Weinig <sam@webkit.org>
1514 Re-add JSReadableStream and JSReadableStreamReader the Xcode project to
1517 * WebCore.xcodeproj/project.pbxproj:
1519 2015-02-25 Sergio Villar Senin <svillar@igalia.com>
1521 [CSS Grid Layout] Update track sizes after distributing extra space
1522 https://bugs.webkit.org/show_bug.cgi?id=141422
1524 Reviewed by Antti Koivisto.
1526 Both old and new tracks sizing algorithms instruct us to update
1527 the sizes of the content sized tracks only after distributing the
1528 extra space for all the items in the same span group. So far we
1529 were doing it inside distributeSpaceToTracks(), i.e., once for
1530 every single item. That is wrong because it makes the algorithm
1533 Our old implementation looked something like this (pseudocode):
1535 resolveContentBasedTrackSizingFunctions()
1537 resolveContentBasedTrackSizingFunctionsForItems() (x4)
1538 distributeSpaceToTracks()
1541 Now it's done this way (pseudocode):
1543 resolveContentBasedTrackSizingFunctions()
1545 resolveContentBasedTrackSizingFunctionsForItems() (x4)
1546 foreach item in spanGroup
1547 distributeSpaceToTracks()
1550 As it can be seen the update of track sizes only happens after
1551 processing all the items of a given span group. In order to
1552 accomplish this a new field was added to GridTrack called
1553 tempIncrease which stores per-track increases while distributing
1554 the extra space among the items in the same span group. That
1555 temporal increase could eventually be used to update the
1556 plannedIncrease which is the one we use to finally set the new
1559 This change makes our implementation closer to the spec, removes
1560 the order dependency and ensures that every track satisfies their
1561 min track sizing functions before starting to consider the max
1562 track sizing functions.
1564 Test: fast/css-grid-layout/grid-update-sizes-after-distributing-all.html
1566 * rendering/RenderGrid.cpp:
1567 (WebCore::GridTrack::plannedSize):
1568 (WebCore::GridTrack::setPlannedSize): New setter.
1569 (WebCore::GridTrack::tempSize): New attribute.
1570 (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1571 RenderGrid::distributeSpaceToTracks() no longer updates the track
1572 sizes so we have to do it after the call returns.
1573 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1574 Call RenderGrid::resolveContentBasedTrackSizingFunctionsForItems()
1575 passing a span group instead of a single item.
1576 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
1577 It now receives a span group instead of a single item. Apart from
1578 that we need an extra function to get the unaltered track size (as
1579 the current one returns the base size whenever the growth limit is
1581 (WebCore::RenderGrid::distributeSpaceToTracks): This no longer
1582 updates track sizes but only the track's planned size;
1583 * rendering/RenderGrid.h:
1585 2015-04-06 Chris Dumez <cdumez@apple.com>
1587 Bing video search result pages are not PageCacheable
1588 https://bugs.webkit.org/show_bug.cgi?id=143463
1589 <rdar://problem/20440916>
1591 Reviewed by Alexey Proskuryakov.
1593 Bing video search result pages are not PageCacheable (tested on iOS).
1595 - is bad for power usage as it causes a reload when clicking one of the
1596 results then navigating back in history.
1597 - degrades user experience because the results page uses infinite
1598 scrolling and the scroll position is not properly restored when
1599 navigating back, not to mention the user has to wait for the reload
1602 The issue was that the bing search page was doing a ping load when
1603 clicking on one of the search results. The ping load was done by
1604 create an image and its 'src' attribute to the ping URL. This load
1605 usually did not have time to complete when navigating away so we would
1606 cancel it and the main document would end up with an error that would
1607 prevent the page from entering the page cache. We already have code
1608 making sure load cancellations do not prevent page caching as long as
1609 the loads are for XHR or images. However, the latter check was broken
1610 in the case where the ResourceRequest's cachePartition was non-empty.
1611 This is because the check was using the MemoryCache::ResourceForUrl()
1612 API which rarely does what we want because it will request a dummy
1613 ResourceRequest (without cachePartition) and then call
1614 MemoryCache::resourceForRequest(). This patch updates the check
1615 to use resourceForRequest() directly as we have the ResourceRequest
1618 This patch also gets rid of the MemoryCache::ResourceForUrl() API as
1619 it rarely does what we want and it is bug prone. It was only used in
1620 2 places, one of them causing this bug and the other in Internals.
1622 Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
1623 http/tests/navigation/page-cache-pending-image-load.html
1625 * loader/DocumentLoader.cpp:
1626 (WebCore::areAllLoadersPageCacheAcceptable):
1627 Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
1628 we have the ResourceRequest and calling resourceForUrl() would loose
1631 * loader/cache/MemoryCache.cpp:
1632 (WebCore::MemoryCache::resourceForURL): Deleted.
1633 Drop this API as it is bug prone and rarely does what we want.
1635 * testing/Internals.cpp:
1636 (WebCore::Internals::isLoadingFromMemoryCache):
1637 Update call to create a dummy ResourceRequest and call
1638 resourceForRequest() instead of resourceForUrl(), as this API no
1639 longer exists. The new code also set the cachePartition on the
1640 dummy request so that this function actually behaves as expected
1641 if the cachePartition in the memory cache is non-empty.
1644 2015-04-06 Jer Noble <jer.noble@apple.com>
1646 Synchronize fullscreen animation between processes.
1647 https://bugs.webkit.org/show_bug.cgi?id=143131
1649 Reviewed by Simon Fraser.
1651 Rather than attempt to synchcronize animations across the WebProcess / UIProcess boundary,
1652 do the bounds-change animation in-process by applying a sublayer transformation to the
1653 video layer. This gives the same visual effect as a synchronized bounds animation, but
1654 without needing a synchronization fence. Resolve the difference between the transformation
1655 and bounds by doing a fence-synchronized bounds change after the current animation is
1656 scheduled to complete.
1658 To do this calculation correctly, WebAVPlayer needs to query both the effective
1659 videoLayerFrame and the videoLayerGravity. To that end, add getter methods for
1660 videoLayerFrame() and videoLayerGravity().
1662 * html/HTMLMediaElement.h:
1663 (WebCore::HTMLMediaElement::videoFullscreenGravity):
1664 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1665 (-[WebAVVideoLayer dealloc]): Cancel outstanding performSelector requests.
1666 (-[WebAVVideoLayer setBounds:]): Add a scale transform to simulate a bonuds change.
1667 (-[WebAVVideoLayer resolveBounds]): Reset the scale transform and set the bounds.
1668 (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Set the initial video frame bounds.
1669 (-[WebAVPlayerController layoutSublayersOfLayer:]): Deleted.
1670 * platform/ios/WebVideoFullscreenModel.h:
1671 * platform/ios/WebVideoFullscreenModelVideoElement.h:
1672 * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1673 (WebVideoFullscreenModelVideoElement::videoLayerFrame): Added; simple getter.
1674 (WebVideoFullscreenModelVideoElement::videoLayerGravity): Ditto.
1676 2015-04-06 Zalan Bujtas <zalan@apple.com>
1678 Simple line layout: RunResolver::Iterator class cleanup.
1679 https://bugs.webkit.org/show_bug.cgi?id=143445
1681 Reviewed by Antti Koivisto.
1683 1. SimpleLineLayout::Run is an intermediate structure and should not be publicly accessible through RunResolver::Iterator.
1684 RunResolver::Run is the class to use to access run properties.
1685 2. Also move advance()/advanceLine() to private. Callers should use LineResolver to advance on lines.
1687 No change in functionality.
1689 * rendering/SimpleLineLayoutResolver.h:
1691 2015-04-06 Simon Fraser <simon.fraser@apple.com>
1693 Use a RenderObject bit for isRenderFlowThread()
1694 https://bugs.webkit.org/show_bug.cgi?id=143439
1696 Reviewed by Darin Adler.
1698 Turning isRenderFlowThread() into a bit in rare data rather than a virtual function reduces
1699 the time under RenderLayer::scrollTo() on a large overflow:scroll table from 56% to 44%.
1701 * rendering/RenderFlowThread.cpp:
1702 (WebCore::RenderFlowThread::RenderFlowThread):
1703 * rendering/RenderFlowThread.h:
1704 * rendering/RenderObject.cpp:
1705 (WebCore::RenderObject::setIsRenderFlowThread):
1706 * rendering/RenderObject.h:
1707 (WebCore::RenderObject::isDragging):
1708 (WebCore::RenderObject::hasReflection):
1709 (WebCore::RenderObject::isRenderFlowThread):
1710 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
1712 2015-04-06 Myles C. Maxfield <mmaxfield@apple.com>
1714 [Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
1715 https://bugs.webkit.org/show_bug.cgi?id=143402
1717 Reviewed by Darin Adler.
1719 There are a few pieces to the converter that Windows requires that we haven't already
1721 1. Checksums were being calculated with the wrong endianness
1722 2. Windows requires a format 4 'cmap' subtable in addition to the format 12 one we already
1724 3. Windows requires a reference to a Private DICT inside the CFF table, even if the DICT
1727 Covered by all our existing SVG font tests.
1729 * svg/SVGFontFaceElement.h: Add capHeight accessor.
1730 * svg/SVGFontFaceElement.cpp:
1731 (WebCore::SVGFontFaceElement::capHeight): Ditto.
1732 * svg/SVGToOTFConversion.cpp: Update the conversion process according to the above
1734 (WebCore::SVGToOTFFontConverter::appendFormat12CMAPTable):
1735 (WebCore::SVGToOTFFontConverter::appendFormat4CMAPTable):
1736 (WebCore::SVGToOTFFontConverter::appendCMAPTable): Use helpers.
1737 (WebCore::SVGToOTFFontConverter::appendHHEATable): Use member variables.
1738 (WebCore::SVGToOTFFontConverter::appendOS2Table): Update to version 2.
1739 (WebCore::SVGToOTFFontConverter::appendCFFTable): Create a reference to a
1740 zero-sized Private DICT
1741 (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Populate member
1743 (WebCore::SVGToOTFFontConverter::calculateChecksum): Flip endianness
1745 2015-04-06 Yusuke Suzuki <utatane.tea@gmail.com>
1747 Return Optional<uint32_t> from PropertyName::asIndex
1748 https://bugs.webkit.org/show_bug.cgi?id=143422
1750 Reviewed by Darin Adler.
1752 * bindings/js/JSDOMWindowCustom.cpp:
1753 (WebCore::JSDOMWindow::getOwnPropertySlot):
1754 (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1755 * bindings/js/JSHTMLAllCollectionCustom.cpp:
1756 (WebCore::callHTMLAllCollection):
1757 (WebCore::JSHTMLAllCollection::item):
1758 * bindings/scripts/CodeGeneratorJS.pm:
1759 (GenerateGetOwnPropertySlotBody):
1760 (GenerateImplementation):
1761 * bindings/scripts/test/JS/JSFloat64Array.cpp:
1762 (WebCore::JSFloat64Array::getOwnPropertySlot):
1763 (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
1764 (WebCore::JSFloat64Array::put):
1765 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1766 (WebCore::JSTestEventTarget::getOwnPropertySlot):
1767 * bridge/runtime_array.cpp:
1768 (JSC::RuntimeArray::getOwnPropertySlot):
1769 (JSC::RuntimeArray::put):
1771 2015-04-06 Žan Doberšek <zdobersek@igalia.com>
1773 FileList constructor should move the passed-in Vector<> rvalue reference into the member variable
1774 https://bugs.webkit.org/show_bug.cgi?id=143412
1776 Reviewed by Darin Adler.
1778 * fileapi/FileList.h:
1779 (WebCore::FileList::FileList): An explicit move of the passed-in rvalue
1780 reference into the member variable is required, otherwise a copy is
1781 performed since an rvalue reference is just an lvalue.
1783 2015-04-06 Žan Doberšek <zdobersek@igalia.com>
1785 UserScript, UserStyleSheet constructors should take in Vector<String> rvalue references
1786 https://bugs.webkit.org/show_bug.cgi?id=143411
1788 Reviewed by Darin Adler.
1790 Have the UserScript and UserStyleSheet constructors take in Vector<String>
1791 rvalue references for the whitelist and blacklist parameters. Both classes
1792 store these Vector<String> objects, so the referenced objects can simply be
1793 moved into the member variable.
1795 Because the constructor is now demanding an rvalue, it's up to the caller
1796 to move in the desired object if possible, or create an explicit copy
1799 * page/UserScript.h:
1800 (WebCore::UserScript::UserScript):
1801 * page/UserStyleSheet.h:
1802 (WebCore::UserStyleSheet::UserStyleSheet):
1804 2015-04-05 Andy Estes <aestes@apple.com>
1806 [Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest:...]
1807 https://bugs.webkit.org/show_bug.cgi?id=143437
1809 Reviewed by Dan Bernstein.
1811 No new tests. We can't test NEFilterSource directly.
1813 * platform/cocoa/NetworkExtensionContentFilter.mm:
1814 (WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.
1816 2015-04-05 Darin Adler <darin@apple.com>
1818 FrameView code uses page() without null checking
1819 https://bugs.webkit.org/show_bug.cgi?id=143425
1820 rdar://problem/18920601
1822 Reviewed by Anders Carlsson.
1824 While we don't have tests that cover this, we are seeing crashes coming in
1825 that indicate the shouldEnableSpeculativeTilingDuringLoading function is
1826 being called when the page is null. This patch adds null checks to all the
1827 places in FrameView that use page() without doing null checking.
1829 * page/FrameView.cpp:
1830 (WebCore::FrameView::layout): If page is null, don't try to do the
1831 auto-sizing logic that involves the textAutosizingWidth value from the page.
1832 (WebCore::FrameView::setFixedVisibleContentRect): Get settings from the
1833 frame rather than the page to avoid possible null-dereference.
1834 (WebCore::FrameView::scrollPositionChanged): Check the page for null when
1835 getting the event throttling delay.
1836 (WebCore::FrameView::updateLayerFlushThrottling): Check the page for null,
1837 and return early if it is null.
1838 (WebCore::shouldEnableSpeculativeTilingDuringLoading): Check the page for
1839 null, and return false if it is null.
1840 (WebCore::FrameView::performPostLayoutTasks): Guard the code that calls
1841 didLayout on the page client by a check if the page is null.
1842 (WebCore::FrameView::pagination): Don't call Page::pagination on a null
1844 (WebCore::FrameView::visibleContentScaleFactor): Use a scale factor of 1
1845 if the page is null.
1846 (WebCore::FrameView::setVisibleScrollerThumbRect): Don't call through to
1847 the page client if the page is null.
1848 (WebCore::FrameView::scrollbarStyleChanged): Ditto.
1849 (WebCore::FrameView::setScrollPinningBehavior): Check the page for null
1850 before asking it for the scrolling coordinator.
1852 2015-04-05 Simon Fraser <simon.fraser@apple.com>
1854 Free up some bits in RenderObject by moving rarely used bits into a side table
1855 https://bugs.webkit.org/show_bug.cgi?id=143432
1857 Reviewed by Darin Adler.
1859 Add a side table (global hash) on RenderObject to store data that is rarely
1860 used. Move the "isDragging" and "hasReflection" bits there. Re-use one of
1861 those bits for "hasRareData", and leave the other unused (I have plans for it).
1863 * rendering/RenderBlock.cpp:
1864 (WebCore::getBlockRareData): Renamed for consistency.
1865 (WebCore::ensureBlockRareData): Renamed to avoid conflict with RenderObject::ensureRareData().
1866 (WebCore::RenderBlock::cachedFlowThreadContainingBlock):
1867 (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
1868 (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
1869 (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
1870 (WebCore::RenderBlock::locateFlowThreadContainingBlock):
1871 (WebCore::RenderBlock::paginationStrut):
1872 (WebCore::RenderBlock::pageLogicalOffset):
1873 (WebCore::RenderBlock::setPaginationStrut):
1874 (WebCore::RenderBlock::setPageLogicalOffset):
1875 (WebCore::getRareData): Deleted.
1876 (WebCore::ensureRareData): Deleted.
1877 * rendering/RenderObject.cpp:
1878 (WebCore::RenderObject::~RenderObject): Assert that rare data hasn't been resurrected
1879 since willBeDestroyed().
1880 (WebCore::RenderObject::willBeDestroyed): Clear the rare data.
1881 (WebCore::RenderObject::setIsDragging): If setting, ensure that we have rare data and
1882 set the bit. Otherwise, only clear the bit of we have rare data.
1883 (WebCore::RenderObject::setHasReflection): Ditto.
1884 (WebCore::RenderObject::rareDataMap):
1885 (WebCore::RenderObject::rareData):
1886 (WebCore::RenderObject::ensureRareData):
1887 (WebCore::RenderObject::clearRareData):
1888 * rendering/RenderObject.h:
1889 (WebCore::RenderObject::isDragging): Fast-fail on the hasRareData() bit, then do the
1890 slower lookup in rare data.
1891 (WebCore::RenderObject::hasReflection): Ditto.
1892 (WebCore::RenderObject::setEverHadLayout): Moved up to group with other bit setters.
1893 (WebCore::RenderObject::hasRareData):
1894 (WebCore::RenderObject::setHasRareData):
1895 (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
1896 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
1897 (WebCore::RenderObject::setHasReflection): Deleted. Out of line now.
1898 (WebCore::RenderObject::setIsDragging): Deleted. Ditto.
1900 2015-04-05 Darin Adler <darin@apple.com>
1902 REGRESSION (r181778): Crash after scrolling Google search result page
1903 https://bugs.webkit.org/show_bug.cgi?id=143431
1905 Reviewed by Simon Fraser.
1907 I can't reproduce this crash, nor was I able to make a regression test,
1908 but the crash data makes it clear this is a null dereference.
1910 * page/animation/AnimationController.cpp:
1911 (WebCore::AnimationControllerPrivate::scrollWasUpdated): Check the result
1912 of Frame::view for null. We know this is only called when there is a
1913 valid FrameView, but it can be called after Frame::m_view is already null.
1915 2015-04-05 Andy Estes <aestes@apple.com>
1917 [Content Filtering] Tell the filter about requests and redirects
1918 https://bugs.webkit.org/show_bug.cgi?id=143414
1919 rdar://problem/19239549
1921 Reviewed by Darin Adler.
1923 Tests: contentfiltering/allow-after-will-send-request.html
1924 contentfiltering/block-after-will-send-request.html
1925 http/tests/contentfiltering/allow-after-redirect.html
1926 http/tests/contentfiltering/block-after-redirect.html
1928 NEFilterSource supports making filter decisions based on NSURLRequests, so this patch adds support for telling
1929 ContentFilter about the original main resource request as well as redirect requests.
1931 * bindings/js/JSMockContentFilterSettingsCustom.cpp: Updated decisionPoint values to include AfterWillSendRequest and AfterRedirect.
1932 (WebCore::JSMockContentFilterSettings::decisionPoint):
1933 (WebCore::JSMockContentFilterSettings::setDecisionPoint):
1934 * loader/ContentFilter.cpp:
1935 (WebCore::ContentFilter::willSendRequest): Called willSendRequest() on each filter using forEachContentFilterUntilBlocked().
1936 (WebCore::ContentFilter::redirectReceived): Called willSendRequest().
1937 * loader/ContentFilter.h:
1938 * loader/DocumentLoader.cpp:
1939 (WebCore::DocumentLoader::willSendRequest): Called ContentFilter::willSendRequest() if there is a content filter.
1940 Asserted that this is not a redirect, and that ContentFilter does not set the request to null.
1941 * loader/SubresourceLoader.cpp:
1942 (WebCore::SubresourceLoader::willSendRequest): Called redirectReceived() instead of willSendRequest().
1943 * loader/cache/CachedRawResource.cpp:
1944 (WebCore::CachedRawResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
1945 (WebCore::CachedRawResource::willSendRequest): Deleted.
1946 * loader/cache/CachedRawResource.h:
1947 * loader/cache/CachedResource.cpp:
1948 (WebCore::CachedResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
1949 (WebCore::CachedResource::willSendRequest): Deleted.
1950 * loader/cache/CachedResource.h:
1951 * platform/PlatformContentFilter.h:
1952 * platform/cocoa/NetworkExtensionContentFilter.h:
1953 * platform/cocoa/NetworkExtensionContentFilter.mm:
1954 (WebCore::NetworkExtensionContentFilter::willSendRequest): Called responseReceived() if there was a redirectResponse.
1955 Then called -[NEFilterSource willSendRequest:decisionHandler:].
1956 * platform/cocoa/ParentalControlsContentFilter.h:
1957 * platform/spi/cocoa/NEFilterSourceSPI.h: Added a #define for NEFilterSourceOptionsPageData.
1958 * testing/MockContentFilter.cpp:
1959 (WebCore::MockContentFilter::willSendRequest): Added support for willSendRequest.
1960 * testing/MockContentFilter.h: Added decision points for AfterWillSendRequest and AfterRedirect.
1961 * testing/MockContentFilterSettings.h:
1962 * testing/MockContentFilterSettings.idl:
1964 2015-04-05 Sungmann Cho <sungmann.cho@navercorp.com>
1966 Remove DocumentLoader::requestURL().
1967 https://bugs.webkit.org/show_bug.cgi?id=140001
1969 Reviewed by Darin Adler.
1971 No new tests, no behavior change.
1973 * loader/DocumentLoader.cpp:
1974 (WebCore::DocumentLoader::documentURL):
1975 (WebCore::DocumentLoader::requestURL): Deleted.
1976 * loader/DocumentLoader.h:
1977 * loader/ResourceLoadNotifier.cpp:
1978 (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
1980 2015-04-05 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1982 Use constants of sqlite3 directly for status of SQL result in webdatabase
1983 https://bugs.webkit.org/show_bug.cgi?id=143329
1985 Reviewed by Darin Adler.
1987 In webdatabase, it has used own constant vairables as well as using sqlite3 constants directly.
1988 It causes to use if~else statement which consumes more cpu cycles compared to switch~case. This
1989 patch makes to use constants of sqlite3. Additionally if~else statment is changed to switch~case
1992 No new tests, no behavior changes.
1994 * Modules/webdatabase/Database.cpp:
1995 (WebCore::Database::performGetTableNames):
1996 * Modules/webdatabase/DatabaseBackendBase.cpp:
1997 (WebCore::retrieveTextResultFromDatabase):
1998 (WebCore::setTextValueInDatabase):
1999 (WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
2000 * Modules/webdatabase/DatabaseTracker.cpp:
2001 (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
2002 (WebCore::DatabaseTracker::hasEntryForDatabase):
2003 (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
2004 (WebCore::DatabaseTracker::origins):
2005 (WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
2006 (WebCore::DatabaseTracker::detailsForNameAndOrigin):
2007 (WebCore::DatabaseTracker::setDatabaseDetails):
2008 (WebCore::DatabaseTracker::quotaForOriginNoLock):
2009 (WebCore::DatabaseTracker::setQuota):
2010 (WebCore::DatabaseTracker::addDatabase):
2011 (WebCore::DatabaseTracker::deleteOrigin):
2012 (WebCore::DatabaseTracker::deleteDatabase):
2013 (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
2014 (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
2015 * Modules/webdatabase/SQLStatementBackend.cpp:
2016 (WebCore::SQLStatementBackend::execute):
2017 * Modules/webdatabase/SQLStatementBackend.h:
2018 * Modules/webdatabase/SQLTransactionBackend.cpp:
2019 (WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
2020 Change to use a reference instead of a pointer in arguemnt of execute().
2021 * loader/appcache/ApplicationCacheStorage.cpp:
2022 (WebCore::ApplicationCacheStorage::loadCacheGroup):
2023 (WebCore::ApplicationCacheStorage::loadManifestHostHashes):
2024 (WebCore::ApplicationCacheStorage::cacheGroupForURL):
2025 (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
2026 (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
2027 (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
2028 (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
2029 (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
2030 (WebCore::ApplicationCacheStorage::verifySchemaVersion):
2031 (WebCore::ApplicationCacheStorage::store):
2032 (WebCore::ApplicationCacheStorage::storeUpdatedType):
2033 (WebCore::ApplicationCacheStorage::ensureOriginRecord):
2034 (WebCore::ApplicationCacheStorage::storeNewestCache):
2035 (WebCore::ApplicationCacheStorage::loadCache):
2036 (WebCore::ApplicationCacheStorage::remove):
2037 (WebCore::ApplicationCacheStorage::getManifestURLs):
2038 (WebCore::ApplicationCacheStorage::cacheGroupSize):
2039 (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord):
2040 (WebCore::ApplicationCacheStorage::checkForMaxSizeReached):
2041 (WebCore::ApplicationCacheStorage::checkForDeletedResources):
2042 (WebCore::ApplicationCacheStorage::flatFileAreaSize):
2043 * loader/icon/IconDatabase.cpp:
2044 (WebCore::IconDatabase::checkIntegrity):
2045 (WebCore::IconDatabase::performURLImport):
2046 (WebCore::IconDatabase::pruneUnretainedIcons):
2047 (WebCore::readySQLiteStatement):
2048 (WebCore::IconDatabase::setIconIDForPageURLInSQLDatabase):
2049 (WebCore::IconDatabase::removePageURLFromSQLDatabase):
2050 (WebCore::IconDatabase::getIconIDForIconURLFromSQLDatabase):
2051 (WebCore::IconDatabase::addIconURLToSQLDatabase):
2052 (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
2053 (WebCore::IconDatabase::removeIconFromSQLDatabase):
2054 (WebCore::IconDatabase::writeIconSnapshotToSQLDatabase):
2055 * platform/sql/SQLiteDatabase.cpp:
2056 (WebCore::SQLiteDatabase::setMaximumSize):
2057 * platform/sql/SQLiteDatabase.h:
2058 * platform/sql/SQLiteFileSystem.cpp:
2059 (WebCore::SQLiteFileSystem::getFileNameForNewDatabase):
2060 * platform/sql/SQLiteStatement.cpp:
2061 (WebCore::SQLiteStatement::step):
2062 (WebCore::SQLiteStatement::returnIntResults):
2063 (WebCore::SQLiteStatement::returnInt64Results):
2065 2015-04-05 Simon Fraser <simon.fraser@apple.com>
2067 Remove "go ahead and" from comments
2068 https://bugs.webkit.org/show_bug.cgi?id=143421
2070 Reviewed by Darin Adler, Benjamin Poulain.
2072 Remove the phrase "go ahead and" from comments where it doesn't add
2073 anything (which is almost all of them).
2075 * Modules/webdatabase/DatabaseTracker.cpp:
2076 (WebCore::DatabaseTracker::deleteOriginLockFor):
2077 * css/CSSFontFaceSrcValue.cpp:
2078 (WebCore::CSSFontFaceSrcValue::isSupportedFormat):
2079 * css/CSSPrimitiveValue.h:
2080 * css/StyleResolver.cpp:
2081 (WebCore::StyleResolver::styleForKeyframe):
2082 (WebCore::StyleResolver::styleForPage):
2083 (WebCore::StyleResolver::applyMatchedProperties):
2084 * editing/ApplyStyleCommand.cpp:
2085 (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
2086 * loader/DocumentLoader.cpp:
2087 (WebCore::DocumentLoader::detachFromFrame):
2088 * loader/cache/CachedImage.cpp:
2089 (WebCore::CachedImage::addIncrementalDataBuffer):
2090 * loader/icon/IconDatabase.cpp:
2091 (WebCore::IconDatabase::performURLImport):
2092 * page/PageOverlay.cpp:
2093 (WebCore::PageOverlay::fadeAnimationTimerFired):
2094 * platform/ScrollView.cpp:
2095 (WebCore::ScrollView::updateScrollbars):
2096 (WebCore::ScrollView::scrollContents):
2097 * platform/graphics/DisplayRefreshMonitor.cpp:
2098 (WebCore::DisplayRefreshMonitor::create):
2099 * platform/graphics/GraphicsContext.cpp:
2100 * platform/graphics/mac/ComplexTextController.cpp:
2101 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2102 * platform/network/HTTPParsers.cpp:
2103 (WebCore::parseHTTPRefresh):
2104 * rendering/RenderBlock.cpp:
2105 (WebCore::RenderBlock::removeChild):
2106 (WebCore::RenderBlock::layoutPositionedObjects):
2107 (WebCore::RenderBlock::selectionGaps):
2108 (WebCore::RenderBlock::blockSelectionGaps):
2109 (WebCore::RenderBlock::absoluteRects):
2110 (WebCore::RenderBlock::absoluteQuads):
2111 (WebCore::RenderBlock::addFocusRingRects):
2112 * rendering/RenderBlockFlow.cpp:
2113 (WebCore::RenderBlockFlow::layoutBlockChild):
2114 (WebCore::RenderBlockFlow::handleAfterSideOfBlock):
2115 (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
2116 (WebCore::RenderBlockFlow::insertFloatingObject):
2117 (WebCore::RenderBlockFlow::addOverhangingFloats):
2118 (WebCore::RenderBlockFlow::inlineSelectionGaps):
2119 (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
2120 * rendering/RenderBlockLineLayout.cpp:
2121 (WebCore::RenderBlockFlow::appendRunsForObject):
2122 * rendering/RenderBox.cpp:
2123 (WebCore::RenderBox::positionLineBox):
2124 (WebCore::RenderBox::sizesLogicalWidthToFitContent):
2125 * rendering/RenderBoxModelObject.cpp:
2126 (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2127 * rendering/RenderLayer.cpp:
2128 (WebCore::RenderLayer::updateLayerPositions):
2129 (WebCore::RenderLayer::hitTestLayer):
2130 (WebCore::RenderLayer::calculateClipRects):
2131 * rendering/RenderLayerModelObject.cpp:
2132 (WebCore::RenderLayerModelObject::styleWillChange):
2133 * rendering/RenderLineBoxList.cpp:
2134 (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
2135 * rendering/RenderTextLineBoxes.cpp:
2136 (WebCore::RenderTextLineBoxes::dirtyRange):
2137 * rendering/line/BreakingContext.h:
2138 (WebCore::BreakingContext::handleOutOfFlowPositioned):
2139 (WebCore::BreakingContext::handleText):
2140 * rendering/line/LineBreaker.cpp:
2141 (WebCore::LineBreaker::nextLineBreak):
2142 * style/StyleResolveTree.cpp:
2143 (WebCore::Style::resolveLocal):
2144 * xml/XMLHttpRequestProgressEventThrottle.cpp:
2145 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
2146 * xml/parser/XMLDocumentParser.cpp:
2147 (WebCore::XMLDocumentParser::append):
2149 2015-04-04 Andy Estes <aestes@apple.com>
2151 [Content Filtering] Blocked page is not always displayed when it should be
2152 https://bugs.webkit.org/show_bug.cgi?id=143410
2153 rdar://problem/20211099
2155 Reviewed by Andreas Kling.
2157 These tests now pass: contentfiltering/block-after-add-data.html
2158 contentfiltering/block-after-response.html
2160 There were several problems with how ContentFilter loaded replacement data:
2161 (1) Replacement data was delivered to DocumentLoader as if it were the original document's data. This assumes
2162 that the original data was a UTF-8 encoded HTML document, which is not always true. We had a way to reset
2163 the encoding, but not the content type.
2164 (2) Replacement data was never delivered when the filter blocks in DocumentLoader::responseReceived().
2165 (3) The main resource load was cancelled before the replacement data could be rendered when the filter blocks
2166 in DocumentLoader::dataReceived().
2167 The result was that only when the load was blocked after DocumentLoader::notifyFinished() would the replacement
2168 data be shown properly, and only when problem (1) wasn't occurring.
2170 This patch addresses these issues by using the substitute data mechanism to deliver replacement data. By using
2171 substitute data, we can ensure that the original load is cancelled at the earliest opportunity and that the
2172 replacement data is loaded with the proper content type and encoding.
2174 Accomplishing this required changing the way ContentFilter interacts with DocumentLoader. Instead of placing
2175 ContentFilter hooks throughout DocumentLoader, this patch makes ContentFilter itself the client of the
2176 CachedRawResource for the duration of the filtering. If the filter decides to allow the load, DocumentLoader
2177 adds itself as a client causing CachedRawResource to deliver to it the response and buffered data. If the
2178 filter decides to block the load, DocumentLoader schedules a substitute data load. An added benefit of this
2179 approach is that ContentFilter can reuse CachedRawResource's original data buffer instead of keeping its own.
2181 * loader/ContentFilter.cpp:
2182 (WebCore::ContentFilter::createIfNeeded): Changed to take a DecisionFunction rather than a ResourceResponse and DocumentLoader.
2183 (WebCore::ContentFilter::ContentFilter): Ditto.
2184 (WebCore::ContentFilter::~ContentFilter): Removed ourself as a CachedRawResource client if needed.
2185 (WebCore::ContentFilter::startFilteringMainResource): Became the client of the CachedRawResource in order to start the filtering process.
2186 (WebCore::ContentFilter::unblockHandler): Returned the unblock handler.
2187 (WebCore::ContentFilter::replacementData): Returned the replacement data.
2188 (WebCore::ContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
2189 (WebCore::ContentFilter::responseReceived): Called responseReceived() on each filter using forEachContentFilterUntilBlocked().
2190 (WebCore::ContentFilter::dataReceived): Ditto for dataReceived().
2191 (WebCore::ContentFilter::notifyFinished): Ditto for finishedLoading().
2192 (WebCore::ContentFilter::forEachContentFilterUntilBlocked): For each filter that needs more data, called the function.
2193 If the filter blocked the load, called didDecide() with State::Blocked.
2194 If all filters allowed the load, called didDecide() with State::Allowed.
2195 (WebCore::ContentFilter::didDecide): Set m_state and called m_decisionFunction().
2196 (WebCore::ContentFilter::addData): Deleted.
2197 (WebCore::ContentFilter::finishedAddingData): Deleted.
2198 (WebCore::ContentFilter::needsMoreData): Deleted.
2199 (WebCore::ContentFilter::didBlockData): Deleted.
2200 (WebCore::ContentFilter::getReplacementData): Deleted.
2201 * loader/ContentFilter.h:
2202 (WebCore::ContentFilter::type):
2203 * loader/DocumentLoader.cpp:
2204 (WebCore::DocumentLoader::DocumentLoader): Called ContentFilter::createIfNeeded() if not loading substitute data.
2205 (WebCore::DocumentLoader::finishedLoading): Removed old ContentFilter code.
2206 (WebCore::DocumentLoader::responseReceived): Ditto.
2207 (WebCore::DocumentLoader::commitData): Ditto.
2208 (WebCore::DocumentLoader::dataReceived): Ditto.
2209 (WebCore::DocumentLoader::detachFromFrame): Set m_contentFilter to nullptr.
2210 (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClientIfFilterAllows() instead of
2211 becoming m_mainResource's client.
2212 (WebCore::DocumentLoader::clearMainResource): Set m_contentFilter to nullptr.
2213 (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): If ContentFilter is initialized, called
2214 ContentFilter::startFilteringMainResource(). Otherwise added ourself as a client of m_mainResource.
2215 (WebCore::DocumentLoader::installContentFilterUnblockHandler): Added a helper for creating and notifying
2216 FrameLoaderClient of the unblock handler.
2217 (WebCore::DocumentLoader::contentFilterDidDecide): Set m_contentFilter to nullptr. If the content filter
2218 allowed the load, then added ourself as the CachedRawResource's client. Otherwise, installed the unblock handler
2219 and scheduled a substitute data load with the replacement data.
2220 * loader/DocumentLoader.h:
2221 * loader/FrameLoader.cpp:
2222 (WebCore::FrameLoader::prepareForLoadStart): Removed call to PolicyChecker::prepareForLoadStart().
2223 * loader/NavigationScheduler.cpp:
2224 (WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Added a ScheduledNavigation subclass that
2225 calls FrameLoader::load() with a FrameLoadRequest containing substitute data.
2226 (WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Scheduled a substitute data load.
2227 * loader/NavigationScheduler.h:
2228 * loader/PolicyChecker.cpp:
2229 (WebCore::PolicyChecker::checkNavigationPolicy): Reset m_contentFilterUnblockHandler if it couldn't handle the request.
2230 (WebCore::PolicyChecker::prepareForLoadStart): Deleted.
2231 * loader/PolicyChecker.h:
2232 * platform/ContentFilterUnblockHandler.h:
2233 (WebCore::ContentFilterUnblockHandler::unreachableURL):
2234 (WebCore::ContentFilterUnblockHandler::setUnreachableURL):
2235 (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Renamed to ContentFilter::urlScheme().
2236 * platform/PlatformContentFilter.h:
2237 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2238 (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Added a helper to wrap the unblock handler with an outer DecisionHandlerFunction.
2239 (WebCore::ContentFilterUnblockHandler::encode): Added m_unreachableURL to the encoding.
2240 (WebCore::ContentFilterUnblockHandler::decode): Ditto for the decoding.
2241 (WebCore::ContentFilterUnblockHandler::canHandleRequest): Changed to call ContentFilter::urlScheme().
2242 * platform/cocoa/NetworkExtensionContentFilter.h:
2243 * platform/cocoa/NetworkExtensionContentFilter.mm:
2244 (replacementDataFromDecisionInfo): Added a helper to extract replacement data from the decisionInfo dictionary.
2245 (WebCore::NetworkExtensionContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
2246 (WebCore::NetworkExtensionContentFilter::create): Created a new object.
2247 (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Created a NEFilterSource immediately when using the modern API.
2248 (WebCore::NetworkExtensionContentFilter::responseReceived): Created a NEFilterSource when using the legacy API.
2249 Called -[NEFilterSource receivedResponse:decisionHandler:] when using the modern API.
2250 (WebCore::NetworkExtensionContentFilter::addData): Stopped buffering the original data.
2251 (WebCore::NetworkExtensionContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
2252 (WebCore::NetworkExtensionContentFilter::canHandleResponse): Deleted.
2253 (WebCore::createNEFilterSource): Deleted.
2254 (WebCore::NetworkExtensionContentFilter::getReplacementData): Deleted.
2255 * platform/cocoa/ParentalControlsContentFilter.h:
2256 * platform/cocoa/ParentalControlsContentFilter.mm:
2257 (WebCore::ParentalControlsContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
2258 (WebCore::ParentalControlsContentFilter::create): Created a new object.
2259 (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Initialized m_filterState to kWFEStateBuffering.
2260 (WebCore::canHandleResponse): Added a helper to check if the response can be filtered.
2261 (WebCore::ParentalControlsContentFilter::responseReceived): If !canHandleResponse(), set m_filterState to kWFEStateAllowed and return.
2262 Otherwise created a new WebFilterEvaluator with the response.
2263 (WebCore::ParentalControlsContentFilter::addData): Called updateFilterState().
2264 (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
2265 (WebCore::ParentalControlsContentFilter::needsMoreData): Changed to check m_filterState.
2266 (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
2267 (WebCore::ParentalControlsContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
2268 (WebCore::ParentalControlsContentFilter::updateFilterState): Updated m_filterState by calling -[WebFilterEvaluator filterState].
2269 (WebCore::ParentalControlsContentFilter::canHandleResponse): Deleted.
2270 (WebCore::ParentalControlsContentFilter::getReplacementData): Deleted.
2271 * platform/spi/cocoa/NEFilterSourceSPI.h:
2272 * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
2273 * testing/MockContentFilter.cpp:
2274 (WebCore::MockContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
2275 (WebCore::MockContentFilter::create): Created a new object.
2276 (WebCore::MockContentFilter::responseReceived): Called maybeDetermineStatus().
2277 (WebCore::MockContentFilter::addData): Stopped buffering the original data.
2278 (WebCore::MockContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
2279 (WebCore::MockContentFilter::unblockHandler): Asserted that we blocked data.
2280 (WebCore::MockContentFilter::canHandleResponse): Deleted.
2281 (WebCore::MockContentFilter::MockContentFilter): Deleted.
2282 (WebCore::MockContentFilter::getReplacementData): Deleted.
2283 * testing/MockContentFilter.h:
2284 * testing/MockContentFilterSettings.cpp:
2285 (WebCore::MockContentFilterSettings::unblockRequestURL): Changed to use a StringBuilder.
2287 2015-04-04 Chris Fleizach <cfleizach@apple.com>
2289 AX: Heuristic: Avoid exposing an element as clickable if mouse event delegation is handled on an AXElement with more than one descendant AXElement
2290 https://bugs.webkit.org/show_bug.cgi?id=136247
2292 Reviewed by Mario Sanchez Prada.
2294 Modify the logic for determining whether an element supports the press action by trying to filter out objects being handled by event delegation.
2295 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
2296 it's using event delegation, and do not expose the press action.
2298 Test: platform/mac/accessibility/press-action-not-exposed-for-event-delegation.html
2300 * accessibility/AccessibilityObject.cpp:
2301 (WebCore::AccessibilityObject::supportsPressAction):
2303 2015-04-04 Simon Fraser <simon.fraser@apple.com>
2305 More const in CSSToStyleMap
2306 https://bugs.webkit.org/show_bug.cgi?id=143409
2308 Reviewed by Andreas Kling.
2310 The CSSValues passed to CSSToStyleMap functions can mostly be treated
2311 as |const|, except for CSSImageValues which have special behavior.
2313 This makes it clearer what the inputs and outputs of these
2316 * css/CSSPrimitiveValue.cpp:
2317 (WebCore::CSSPrimitiveValue::computeDegrees):
2318 * css/CSSPrimitiveValue.h:
2319 (WebCore::CSSPrimitiveValue::computeTime):
2320 * css/CSSToStyleMap.cpp:
2321 (WebCore::CSSToStyleMap::mapFillAttachment):
2322 (WebCore::CSSToStyleMap::mapFillClip):
2323 (WebCore::CSSToStyleMap::mapFillComposite):
2324 (WebCore::CSSToStyleMap::mapFillBlendMode):
2325 (WebCore::CSSToStyleMap::mapFillOrigin):
2326 (WebCore::CSSToStyleMap::mapFillRepeatX):
2327 (WebCore::CSSToStyleMap::mapFillRepeatY):
2328 (WebCore::CSSToStyleMap::mapFillSize):
2329 (WebCore::CSSToStyleMap::mapFillXPosition):
2330 (WebCore::CSSToStyleMap::mapFillYPosition):
2331 (WebCore::CSSToStyleMap::mapFillMaskSourceType):
2332 (WebCore::CSSToStyleMap::mapAnimationDelay):
2333 (WebCore::CSSToStyleMap::mapAnimationDirection):
2334 (WebCore::CSSToStyleMap::mapAnimationDuration):
2335 (WebCore::CSSToStyleMap::mapAnimationFillMode):
2336 (WebCore::CSSToStyleMap::mapAnimationIterationCount):
2337 (WebCore::CSSToStyleMap::mapAnimationName):
2338 (WebCore::CSSToStyleMap::mapAnimationPlayState):
2339 (WebCore::CSSToStyleMap::mapAnimationProperty):
2340 (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
2341 (WebCore::CSSToStyleMap::mapAnimationTrigger):
2342 * css/CSSToStyleMap.h:
2344 2015-04-04 Dan Bernstein <mitz@apple.com>
2346 Tried to fix the build.
2348 * loader/icon/IconController.cpp:
2349 (WebCore::iconsFromLinkElements):
2351 2015-04-02 Darin Adler <darin@apple.com>
2353 Streamline icon-related code, mostly unused
2354 https://bugs.webkit.org/show_bug.cgi?id=143306
2356 Reviewed by Antti Koivisto.
2358 I started on this path because Document::iconURLs had a poor implementation,
2359 storing results in a data member with no benefit, using HTMLCollection for
2360 iteration of the children of the head element instead of using the simpler
2361 faster technique we use inside the engine. Then, I discovered this function was
2362 mostly-unused code left over from before the Blink fork. I removed most of it.
2363 We can add this back later if someone finds a use for it, but if we do we
2364 should do a higher quality implementation without the quirks of the old one.
2366 Refactoring also made it clear that logic isn't exactly sensible. There's a
2367 set of rules about what order to return the list in that is not followed by
2368 the code that tries to find the "default touch icon". Later we could add some
2369 more test coverage and tighten up the logic. But the reality is that at this
2370 time, with some small exceptions, icon logic is in the web browsers, not in WebKit.
2372 * CMakeLists.txt: Removed IconURL.cpp.
2373 * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2374 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2375 * WebCore.xcodeproj/project.pbxproj: Ditto.
2376 * dom/DOMAllInOne.cpp: Ditto.
2379 (WebCore::Document::evaluate): Tweaked formatting.
2380 (WebCore::Document::shortcutIconURLs): Removed. Unused function.
2381 (WebCore::Document::iconURLs): Removed. Moved code to IconController.
2382 (WebCore::Document::addIconURL): Removed. Moved code to LinkLoader.
2384 * dom/Document.h: Removed shortcutIconURLs, iconURLs, addIconURL,
2387 * dom/IconURL.cpp: Removed.
2388 * dom/IconURL.h: Removed everything from this header except for the
2389 IconType enum. Added a FIXME about possibly renaming the header.
2391 * html/HTMLLinkElement.cpp:
2392 (WebCore::HTMLLinkElement::HTMLLinkElement): Pass a reference when creating
2394 (WebCore::HTMLLinkElement::setDisabledState): Access members of the struct
2395 LinkRelElement without "m_" prefix.
2396 (WebCore::HTMLLinkElement::parseAttribute): Changed to use early return style,
2397 and made the part of this for parsing title use a more normal idiom.
2398 (WebCore::HTMLLinkElement::process): Removed many unneeded arguments, made the
2399 logic of the code a little easier to follow.
2400 (WebCore::HTMLLinkElement::removedFrom): Removed a call to a function that had
2402 (WebCore::HTMLLinkElement::iconType): Updated for change to LinkRelElement.
2403 (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
2404 * html/HTMLLinkElement.h: More of the same.
2406 * html/LinkRelAttribute.cpp:
2407 (WebCore::LinkRelAttribute::LinkRelAttribute): Initialize data members in the
2408 struct itself. Got rid of "m_" prefix since this is a struct, not a class.
2409 Changed code to use modern for loop; even better would be to eliminate the
2410 splitting into a vector entirely and use StringView (do that next time).
2411 * html/LinkRelAttribute.h: See above.
2413 * html/parser/HTMLPreloadScanner.cpp:
2414 (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
2415 Updated for chnages to LinkRelAttribute and give the local variable a clearer name.
2417 * loader/FrameLoader.cpp:
2418 (WebCore::FrameLoader::didChangeIcons): Removed.
2419 * loader/FrameLoader.h: Removed didChangeIcons.
2421 * loader/FrameLoaderClient.h: Added include for String since it's no longer
2422 taken care of by IconURLs.h.
2424 * loader/LinkLoader.cpp:
2425 (WebCore::LinkLoader::LinkLoader): Take a reference instead of a pointer.
2426 (WebCore::LinkLoader::linkLoadTimerFired): Use m_client reference instead of pointer.
2427 (WebCore::LinkLoader::linkLoadingErrorTimerFired): Ditto.
2428 (WebCore::LinkLoader::notifyFinished): Use nullptr.
2429 (WebCore::LinkLoader::loadLink): Tweak formatting. Move the dispatchDidChangeIcons
2430 call in here instead of going through Document to FrameLoader and then FrameLoader to
2431 FrameLoaderClient, and passing extra unused arguments, the way the old code did.
2432 Use a reference instead of a pointer for the document.
2433 (WebCore::LinkLoader::released): Removed. Empty function.
2435 * loader/LinkLoader.h: Changed constructor argument to be a reference. Made more
2436 things private. Removed empty released function.
2438 * loader/icon/IconController.cpp:
2439 (WebCore::IconController::IconController): Moved initialization of data members to
2440 the class definition in the header.
2441 (WebCore::iconsFromLinkElements): Added. This function replaces the existing
2442 Document::iconURLs function, but has a simpler implementation and interface.
2443 It focuses on exactly what the code in this file needs. If we want to add some
2444 more features to the icon controller we might make this more complex again.
2445 Even now, building a vector is not necessarily helpful; the only client of this
2446 function ends up extracting only one of the URLs this function returns.
2447 (WebCore::IconController::url): Rewrote this. It's the only function actually
2448 using the icon URLs. This contains a combination of the logic from the various
2449 functions in this class before, including iconURL, urlsForTypes, appendToIconURLs,
2450 and defaultURL. Among other improvements, replaced the unusual code to construct
2451 the icon URL with a call to Document::completeURL.
2452 (WebCore::IconController::startLoader): Refactored a bit to remove a local variable.
2453 (WebCore::IconController::continueLoadWithDecision): Ditto.
2455 * loader/icon/IconController.h: Removed unneeded includes, unneeded use of
2456 WTF_MAKE_NONCOPYABLE (since classes with data members of reference type are
2457 automatically noncopyable), unused fucntions. Also initialize m_waitingForLoadDecision.
2459 * testing/Internals.cpp:
2460 (WebCore::Internals::iconURLs): Removed.
2461 (WebCore::Internals::shortcutIconURLs): Left this in place since it is used by
2462 tests. Changed it to return the actual value from the IconController::url function,
2463 since that's the interface to our icon machinery that is actually exposed on some
2464 platforms. That means this returns only a single URL.
2465 (WebCore::Internals::allIconURLs): Removed.
2466 * testing/Internals.h: Removed allIconURLs and iconURLs.
2467 * testing/Internals.idl: Removed allIconURLs.
2469 2015-04-04 Simon Fraser <simon.fraser@apple.com>
2471 Fix EFL and Gtk build.
2474 (WebCore::Document::didRemoveTouchEventHandler):
2476 2015-04-04 Simon Fraser <simon.fraser@apple.com>
2478 Crash under Document::absoluteRegionForEventTargets on build.webkit.org/dashboard
2479 https://bugs.webkit.org/show_bug.cgi?id=143406
2480 rdar://problem/20407080
2482 Reviewed by Ryosuke Niwa.
2484 We failed to remove elements from Document's m_wheelEventTargets HashSet when the
2485 elements were destroyed with wheel handlers still on them. Fix by removing the
2486 node from the set via Node::willBeDeletedFrom().
2488 Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash.html
2489 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash.html
2490 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash.html
2493 (WebCore::removeHandlerFromSet): Helper to remove one or all handlers on the given node.
2494 (WebCore::Document::didRemoveWheelEventHandler): Add a parameter to specify whether we're
2495 removing all handlers on the given node.
2496 (WebCore::Document::didRemoveTouchEventHandler): Use removeHandlerFromSet().
2499 (WebCore::Node::willBeDeletedFrom): Tell the document we're removing all handlers
2502 2015-04-04 Simon Fraser <simon.fraser@apple.com>
2504 REGRESSION (r182215): Feedly crashes when closing article
2505 https://bugs.webkit.org/show_bug.cgi?id=143405
2506 rdar://problem/20382734, rdar://problem/20395497
2508 Reviewed by Tim Horton.
2510 Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
2511 is bad, because it can cause FrameView::layout() to get called in the middle of
2512 RenderObject destruction, which leaves the render tree in a bad state.
2514 Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
2516 AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
2517 a flag to say that the non-fast region needs to be recomputed, and that schedules
2518 a scrolling tree commit. When the commit happens, we recompute the region. If the
2519 region didn't change, and no other changes are pending, there's no need to commit.
2521 Test: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html
2523 * page/scrolling/AsyncScrollingCoordinator.cpp:
2524 (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty):
2525 (WebCore::AsyncScrollingCoordinator::willCommitTree):
2526 (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
2527 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2528 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
2529 (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): Need to eagerly update
2530 the non-fast scrollable region.
2531 * page/scrolling/AsyncScrollingCoordinator.h:
2532 (WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty):
2533 * page/scrolling/ScrollingCoordinator.cpp:
2534 (WebCore::ScrollingCoordinator::ScrollingCoordinator):
2535 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
2536 * page/scrolling/ScrollingCoordinator.h:
2537 (WebCore::ScrollingCoordinator::willCommitTree):
2538 * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2539 (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
2540 (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
2541 (WebCore::ScrollingCoordinatorMac::commitTreeState):
2543 2015-04-04 Simon Fraser <simon.fraser@apple.com>
2545 Differentiate between composited scrolling, and async scrolling
2546 https://bugs.webkit.org/show_bug.cgi?id=143291
2548 Reviewed by Sam Weinig.
2550 ScrollableArea::usesCompositedScrolling() meant "uses aysnc scrolling", but
2551 FrameView::contentsInCompositedLayer() covered a related concept, that scrolling
2552 happens by moving compositing layers around.
2554 Make the difference between these more explicit by adding ScrollableArea::usesAsyncScrolling(),
2555 which means that scrolling for that ScrollableArea is asynchronous and managed
2556 by a ScrollingCoordinator. This is the meaning that ScrollingCoordinator::computeNonFastScrollableRegion()
2559 ScrollableArea::usesCompositedScrolling() is now repurposed to mean "scrolling
2560 occurs by moving layers around, not requiring repaint". FrameView::contentsInCompositedLayer()
2561 is renamed to usesCompositedScrolling(), and overrides the base class function.
2563 This only changes behavior in tests that call setScrollingTreeIncludesFrames(true).
2565 * page/FrameView.cpp:
2566 (WebCore::FrameView::useSlowRepaints):
2567 (WebCore::FrameView::usesCompositedScrolling):
2568 (WebCore::FrameView::usesAsyncScrolling):
2569 (WebCore::FrameView::scrollContentsFastPath):
2570 (WebCore::FrameView::scrollContentsSlowPath):
2571 (WebCore::FrameView::contentsInCompositedLayer): Deleted.
2573 * page/scrolling/ScrollingCoordinator.cpp:
2574 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
2575 * platform/ScrollableArea.h:
2576 (WebCore::ScrollableArea::usesAsyncScrolling):
2577 * rendering/RenderLayer.cpp:
2578 (WebCore::RenderLayer::usesAsyncScrolling):
2579 * rendering/RenderLayer.h:
2581 2015-04-04 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2583 [Streams API] Collecting a ReadableStreamReader should not unlock its stream
2584 https://bugs.webkit.org/show_bug.cgi?id=143333
2586 Reviewed by Benjamin Poulain.
2588 This patch stores as a boolean whether the stream is locked to a reader.
2589 In case the reader forget to unlock the stream, the reader can be collected and destructor called.
2590 In that case, the link between reader and stream will be reset but the stream will remain in locked state.
2592 Covered by new test in streams/readablestreamreader-constructor.html.
2594 * Modules/streams/ReadableStream.h:
2595 (WebCore::ReadableStream::isLocked):
2596 (WebCore::ReadableStream::lock):
2597 (WebCore::ReadableStream::release):
2598 (WebCore::ReadableStream::releaseButKeepLocked): Introduced to cut the link between reader and stream but stil keeping the stream locked.
2599 * Modules/streams/ReadableStreamReader.cpp:
2600 (WebCore::ReadableStreamReader::~ReadableStreamReader):
2601 * bindings/js/JSReadableStreamCustom.cpp:
2602 (WebCore::JSReadableStream::getReader):
2603 * bindings/js/JSReadableStreamReaderCustom.cpp:
2604 (WebCore::constructJSReadableStreamReader):
2606 2015-04-03 Zan Dobersek <zdobersek@igalia.com>
2608 MediaDevices possesses a vtable despite using ImplementationLacksVTable IDL attribute
2609 https://bugs.webkit.org/show_bug.cgi?id=143367
2611 Reviewed by Eric Carlson.
2613 * Modules/mediastream/MediaDevices.idl: MediaDevices ends up with a vtable
2614 because of inheriting from ContextDestructionObserver. This collides with
2615 the ImplementationLacksVTable IDL attribute, causing compilation errors
2616 with Clang. Since MediaDevices isn't being inherited from, but will still
2617 end up with a vtable, the IDL attribute should be removed.
2619 2015-04-03 Alex Christensen <achristensen@webkit.org>
2621 [Content Extensions] Add memory reporting.
2622 https://bugs.webkit.org/show_bug.cgi?id=143386
2624 Reviewed by Benjamin Poulain.
2626 * contentextensions/CompiledContentExtension.cpp:
2627 (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
2628 * contentextensions/CompiledContentExtension.h:
2629 * contentextensions/ContentExtension.cpp:
2630 (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
2631 * contentextensions/ContentExtension.h:
2632 * contentextensions/ContentExtensionsBackend.cpp:
2633 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2634 * contentextensions/ContentExtensionsDebugging.h:
2635 * contentextensions/DFABytecodeInterpreter.cpp:
2636 (WebCore::ContentExtensions::getBits):
2637 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2638 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2639 (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2640 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2641 * contentextensions/DFABytecodeInterpreter.h:
2642 (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
2643 (WebCore::ContentExtensions::DFABytecodeInterpreter::~DFABytecodeInterpreter):
2644 Keep track of which memory pages in the bytecode are being hit if CONTENT_EXTENSIONS_MEMORY_REPORTING is 1.
2645 When CONTENT_EXTENSIONS_MEMORY_REPORTING is 0, this makes an empty vector in ContentExtension
2646 and passes some pointers on the stack, many of which can be optimized out by the C++ compiler.
2648 2015-04-03 Brent Fulgham <bfulgham@apple.com>
2650 Expand test infrastructure to support scrolling tests
2651 https://bugs.webkit.org/show_bug.cgi?id=143383
2653 Reviewed by Darin Adler.
2655 No new tests: No change in behavior.
2657 This is an initial set of changes that clean up a few things I noticed while extending testing support
2658 for scroll animations and wheel event gestures.
2659 1. Reduce the amount of #ifdef code in EventHandler{Mac}.
2660 2. Consolidate the idea of an "End Gesture" in the PlatformWheelEvent class.
2661 3. Remove a number of unneeded null checks in EventHandler.
2662 4. ScrollController must always have a client, so hold a reference instead of using a pointer.
2664 * page/EventHandler.cpp:
2665 (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
2666 (WebCore::EventHandler::handleWheelEvent): Call 'platformNotifySnapIfNecessary' at method exit points.
2667 (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
2668 * page/EventHandler.h:
2669 * page/mac/EventHandlerMac.mm:
2670 (WebCore::EventHandler::platformCompleteWheelEvent): Remove unneeded null checks for 'view'. Remove
2671 CSS_SNAP-specific call to 'platformNotifySnapIfNecessary'. This logic is now handled in the new
2672 'platformNotifyIfEndGesture' method.
2673 (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
2674 (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
2675 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2676 (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Pass 'this' as
2677 reference to ScrollController constructor.
2678 * platform/PlatformWheelEvent.h:
2679 (WebCore::PlatformWheelEvent::shouldResetLatching): Call new 'isEndGesture' method.
2680 (WebCore::PlatformWheelEvent::isEndGesture): Added method to encapsulate some code that was duplicated
2681 in a number of places.
2682 * platform/ScrollAnimator.cpp:
2683 (WebCore::ScrollAnimator::ScrollAnimator): Pass 'this' as reference to ScrollController constructor.
2684 * platform/cocoa/ScrollController.h:
2685 * platform/cocoa/ScrollController.mm:
2686 (WebCore::ScrollController::ScrollController): Update to reflect m_client is now a reference.
2687 (WebCore::ScrollController::handleWheelEvent): Ditto.
2688 (WebCore::ScrollController::snapRubberBandTimerFired): Ditto. Also, a drive-by fix for ending rubberband
2689 snapping. This end-state wasn't deactivating the timer (even when the animation finished). This isn't a
2690 huge problem, but I (will) rely on the state of the animation timer in a future patch to decide if
2691 tests should run or continue waiting.
2692 (WebCore::ScrollController::isRubberBandInProgress): Ditto.
2693 (WebCore::ScrollController::startSnapRubberbandTimer): Ditto.
2694 (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
2695 (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
2696 (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Ditto.
2697 (WebCore::ScrollController::startScrollSnapTimer): Ditto.
2698 (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
2699 (WebCore::ScrollController::scrollSnapAnimationUpdate): Ditto.
2700 (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
2701 (WebCore::ScrollController::computeSnapDelta): Ditto.
2702 (WebCore::ScrollController::computeGlideDelta): Ditto.
2703 * platform/mac/ScrollAnimatorMac.mm:
2704 (WebCore::gestureShouldBeginSnap): Use new PlatformWheelEvent::isEndGesture() method.
2706 2015-04-03 Chris Fleizach <cfleizach@apple.com>
2708 AX: Toggling check box state not speaking using plain space, not VO space.
2709 https://bugs.webkit.org/show_bug.cgi?id=143356
2711 Reviewed by Darin Adler.
2713 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.
2715 Test: platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html
2717 * accessibility/mac/AXObjectCacheMac.mm:
2718 (WebCore::AXObjectCache::postPlatformNotification):
2720 2015-04-03 Zalan Bujtas <zalan@apple.com>
2722 Simple line layout: Use pre-computed simple line runs to produce innerText content.
2723 https://bugs.webkit.org/show_bug.cgi?id=143351
2725 Reviewed by Antti Koivisto.
2727 This is in preparation to cover <br> with simple line layout.
2728 Runs provide line layout information that can be used to cover hard line break cases.
2729 (similar to TextIterator::handleTextBox())
2731 Covered by existing tests.
2733 * editing/TextIterator.cpp:
2734 (WebCore::TextIterator::handleTextNode):
2735 (WebCore::TextIterator::emitCharacter):
2736 (WebCore::TextIterator::emitText):
2737 * editing/TextIterator.h:
2738 * rendering/SimpleLineLayoutResolver.h:
2739 (WebCore::SimpleLineLayout::RunResolver::Run::isEndOfLine):
2741 2015-04-03 Antti Koivisto <antti@apple.com>
2743 Add non-counting bloom filter class
2744 https://bugs.webkit.org/show_bug.cgi?id=143366
2746 Reviewed by Sam Weinig.
2748 * css/SelectorFilter.cpp:
2749 (WebCore::SelectorFilter::setupParentStack):
2750 * css/SelectorFilter.h:
2754 2015-04-03 Alex Christensen <achristensen@webkit.org>
2757 https://bugs.webkit.org/show_bug.cgi?id=143352
2759 Reviewed by Gyuyoung Kim.
2761 * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2762 (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
2763 * loader/EmptyClients.cpp:
2764 (WebCore::EmptyChromeClient::openDateTimeChooser): Deleted.
2765 * loader/EmptyClients.h:
2767 (WebCore::Chrome::openDateTimeChooser): Deleted.
2769 * page/ChromeClient.h:
2770 Remove ChromeClient::openDateTimeChooser.
2772 2015-04-03 Zan Dobersek <zdobersek@igalia.com>
2774 Unreviewed, fixing Clang builds of the GTK port on Linux.
2776 * Modules/mediastream/MediaDevices.h:
2777 Include the <functional> header for uses of std::function<>.
2779 2015-04-01 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2781 [Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
2782 https://bugs.webkit.org/show_bug.cgi?id=143130
2784 Reviewed by Benjamin Poulain.
2786 Introduce ReadableJSStream and ReadableJSStreamReader as subclasses of ReadableStream and ReadableStreamReader.
2787 These classes manage JS based sources: ReadableStream JS constructor instantiates ReadableJStream.
2788 These classes are expected to handle JS source specific handling, in particular JSValue error storage and JSValue chunk queue.
2789 Making ReadableStream and ReadableStreamReader abstract, to be subclassed for native sources.
2791 Current tests cover the changes.
2793 * Modules/streams/ReadableStream.cpp:
2794 (WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ease subclassing.
2795 (WebCore::ReadableStream::create): Deleted as ReadableStream is now abstarct.
2796 * Modules/streams/ReadableStream.h: Made createReader virtual pure.
2797 * Modules/streams/ReadableStream.idl: Skipping VTable validation as subclasses of ReadableStream may be JS wrapped.
2798 * Modules/streams/ReadableStreamReader.cpp: Removed ReadableStreamReader::create.
2799 * Modules/streams/ReadableStreamReader.h: Ditto.
2800 * Modules/streams/ReadableStreamReader.idl: Skipping VTable validation as subclasses of ReadableStreamReader may be JS wrapped.
2801 * bindings/js/JSReadableStreamCustom.cpp:
2802 (WebCore::constructJSReadableStream): Instantiating ReadableJSStream in lieu of ReadableStream within JS constructor.
2803 * bindings/js/ReadableStreamJSSource.cpp:
2804 (WebCore::ReadableJSStream::create):
2805 (WebCore::ReadableJSStream::createReader): Instantiating ReadableJSStreamReader.
2806 (WebCore::ReadableJSStream::ReadableJSStream):
2807 (WebCore::ReadableJSStreamReader::create):
2808 (WebCore::ReadableJSStreamReader::ReadableJSStreamReader):
2809 * bindings/js/ReadableStreamJSSource.h: Definition of ReadableJSStream and ReadableJSStreamReader.
2811 2015-04-02 Timothy Horton <timothy_horton@apple.com>
2813 Scrollbars are left in the wrong position when resizing a fixed layout view
2814 https://bugs.webkit.org/show_bug.cgi?id=143360
2816 Reviewed by Beth Dakin.
2818 Test: fast/fixed-layout/fixed-layout.html
2820 * platform/ScrollView.cpp:
2821 (WebCore::ScrollView::setFrameRect):
2822 Update scrollbars when the ScrollView frameRect changes. We were previously
2823 depending on the layout that always happens after this to update scrollbars,
2824 but with fixed layout mode, there won't be a layout! Also, FrameView's
2825 setFrameRect override will sync this scrollbar update with the scrollbar
2826 layers (via RenderLayerCompositor::frameViewDidChangeSize) immediately afterwards.
2828 * testing/Internals.cpp:
2829 (WebCore::Internals::resetToConsistentState):
2830 Turn off fixed layout when resetting state.
2832 (WebCore::Internals::setUseFixedLayout):
2833 (WebCore::Internals::setFixedLayoutSize):
2834 * testing/Internals.h:
2835 * testing/Internals.idl:
2836 Add internals functions to set the fixed layout size and to turn on fixed layout.
2838 2015-04-02 Brady Eidson <beidson@apple.com>
2840 Unreviewed: Reapplied Change after rollout.
2842 Expose the "Share" menu for text selections on platforms where it's available.
2843 rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
2845 * page/ContextMenuClient.h:
2846 (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
2848 * page/ContextMenuContext.h:
2849 (WebCore::ContextMenuContext::setSelectedText):
2850 (WebCore::ContextMenuContext::selectedText):
2852 * page/ContextMenuController.cpp:
2853 (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
2854 (WebCore::ContextMenuController::checkOrEnableIfNeeded):
2856 * platform/ContextMenuItem.cpp:
2857 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
2859 * platform/ContextMenuItem.h:
2860 (WebCore::ContextMenuItem::supportsShareMenu):
2862 * platform/gtk/ContextMenuItemGtk.cpp:
2863 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
2865 * platform/mac/ContextMenuItemMac.mm:
2866 (WebCore::ContextMenuItem::releasePlatformDescription):
2867 (WebCore::ContextMenuItem::getPlatformDescription):
2868 (WebCore::ContextMenuItem::supportsShareMenu):
2869 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
2871 * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
2873 2015-04-02 Commit Queue <commit-queue@webkit.org>
2875 Unreviewed, rolling out r182293.
2876 https://bugs.webkit.org/show_bug.cgi?id=143355
2878 Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
2882 "Expose the "Share" menu for text selections on platforms
2883 where it's available."
2884 https://bugs.webkit.org/show_bug.cgi?id=143318
2885 http://trac.webkit.org/changeset/182293
2887 2015-04-02 Brent Fulgham <bfulgham@apple.com>
2889 REGRESSION: Caption Menus show language codes instead of display names.
2890 https://bugs.webkit.org/show_bug.cgi?id=143350
2891 <rdar://problem/20094145>
2893 Reviewed by Jer Noble.
2895 The generic caption/track label handling in CaptionUserPreferences does not convert language codes
2896 (e.g. 'fr-CA') into display names (e.g., 'French (Canada)'). Because we did not have an AudioTrack
2897 override to process these types of menu items, they were being handled using the generic code.
2899 * page/CaptionUserPreferencesMediaAF.cpp:
2900 (WebCore::buildStringForTrackBase): Helper function to share code with the two flavors
2901 of 'trackDisplayName'.
2902 (WebCore::trackDisplayName): Add a version to support AudioTracks, and modify the TextTrack
2903 version to use the new 'buildStringForTrackBase' function.
2904 (WebCore::CaptionUserPreferencesMediaAF::displayNameForTrack): Add an AudioTrack override so
2905 our AVFoundation tracks are processed in our CaptionUserPreferencesMediaAF implementation, not the
2907 (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Add an AudioTrack override so
2908 that the menu items are sorted in order of display name, not language code.
2909 * page/CaptionUserPreferencesMediaAF.h:
2911 2015-04-02 Brady Eidson <beidson@apple.com>
2913 Expose the "Share" menu for text selections on platforms where it's available.
2914 rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
2916 Reviewed by Sam Weinig.
2918 * page/ContextMenuClient.h:
2919 (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
2921 * page/ContextMenuContext.h:
2922 (WebCore::ContextMenuContext::setSelectedText):
2923 (WebCore::ContextMenuContext::selectedText):
2925 * page/ContextMenuController.cpp:
2926 (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
2927 (WebCore::ContextMenuController::checkOrEnableIfNeeded):
2929 * platform/ContextMenuItem.cpp:
2930 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
2932 * platform/ContextMenuItem.h:
2933 (WebCore::ContextMenuItem::supportsShareMenu):
2935 * platform/gtk/ContextMenuItemGtk.cpp:
2936 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
2938 * platform/mac/ContextMenuItemMac.mm:
2939 (WebCore::ContextMenuItem::releasePlatformDescription):
2940 (WebCore::ContextMenuItem::getPlatformDescription):
2941 (WebCore::ContextMenuItem::supportsShareMenu):
2942 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
2944 * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
2946 2015-04-02 Jer Noble <jer.noble@apple.com>
2948 [Mac] Only pass in the AVURLAssetClientBundleIdentifierKey on iOS.
2949 https://bugs.webkit.org/show_bug.cgi?id=143347
2951 Reviewed by Brent Fulgham.
2953 Only pass in the main app bundle id into AVURLAsset via the AVURLAssetClientBundleIdentifierKey option
2954 on iOS. On OS X, setting this key can cause media playback to fail.
2956 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2957 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2959 2015-04-02 Roger Fong <roger_fong@apple.com>
2961 Show audio media controls on OSX.
2962 https://bugs.webkit.org/show_bug.cgi?id=143346.
2963 <rdar://problem/20306240>
2965 Reviewed by Dean Jackson.
2967 * Modules/mediacontrols/mediaControlsApple.css:
2968 (audio::-webkit-media-controls-panel:hover):
2969 Revert part of r180893.
2971 2015-04-02 Myles C. Maxfield <mmaxfield@apple.com>
2973 Disallow ruby base from having leading or trailing expansions
2974 https://bugs.webkit.org/show_bug.cgi?id=142608
2976 Reviewed by David Hyatt.
2978 If we determine that a ruby base should have either a leading or trailing expansion,
2979 we shunt that expansion over to the neighboring RenderText, assuming one exists. This
2980 requires that we teach RenderText how to force leading or trailing expansions if one
2981 wouldn't naturally be present.
2983 Tests: fast/ruby/ruby-expansion-cjk-2.html
2984 fast/ruby/ruby-expansion-cjk-3.html
2985 fast/ruby/ruby-expansion-cjk-4.html
2986 fast/ruby/ruby-expansion-cjk-5.html
2987 fast/ruby/ruby-expansion-cjk.html
2989 * rendering/InlineFlowBox.cpp:
2990 (WebCore::InlineFlowBox::removeChild): Delete contentIsKnownToFollow.
2991 * rendering/InlineTextBox.cpp:
2992 (WebCore::InlineTextBox::expansionBehavior): Support forced leading and trailing
2994 * rendering/InlineTextBox.h:
2995 (WebCore::InlineTextBox::expansionBehavior): Moved to .cpp
2996 * rendering/RenderBlockLineLayout.cpp:
2997 (WebCore::RenderBlockFlow::updateRubyForJustifiedText): Perform relayout even if
2998 there are no expansions left. This is so that ruby bases with no expansions will get
3000 (WebCore::expansionBehaviorForInlineTextBox): Update to inspect neighboring rubies.
3001 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): Use updated
3002 expansionBehaviorForInlineTextBox(). Also center ruby bases if they have no expansion
3004 (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns): Use nullptr.
3005 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Ditto.
3006 * rendering/RenderText.cpp:
3007 (WebCore::RenderText::RenderText): Delete contentIsKnownToFollow.
3008 * rendering/RenderText.h:
3009 (WebCore::RenderText::contentIsKnownToFollow): Deleted.
3010 (WebCore::RenderText::setContentIsKnownToFollow): Deleted.
3012 2015-04-02 Alexey Proskuryakov <ap@apple.com>
3014 Clean up access checks in JSHistoryCustom.cpp
3015 https://bugs.webkit.org/show_bug.cgi?id=143227
3017 Reviewed by Sam Weinig.
3019 * bindings/js/JSHistoryCustom.cpp:
3020 (WebCore::JSHistory::putDelegate):
3021 (WebCore::JSHistory::deleteProperty):
3022 (WebCore::JSHistory::deletePropertyByIndex):
3023 (WebCore::JSHistory::getOwnPropertyNames):
3024 (WebCore::JSHistory::pushState):
3025 (WebCore::JSHistory::replaceState):
3027 2015-04-02 Alex Christensen <achristensen@webkit.org>
3029 [Content Extensions] Only add unique universal action locations.
3030 https://bugs.webkit.org/show_bug.cgi?id=143325
3032 Reviewed by Benjamin Poulain.
3034 * contentextensions/ContentExtensionCompiler.cpp:
3035 (WebCore::ContentExtensions::compileRuleList):
3036 Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
3038 2015-04-01 Roger Fong <roger_fong@apple.com>
3040 Fix slider colors for media controls on OSX.
3041 https://bugs.webkit.org/show_bug.cgi?id=143328.
3042 <rdar://problem/20357858>
3044 Reviewed by Darin Adler.
3046 Fill in bottom portion of volume slider.
3047 Adjust colors to make slider controls look better. Will likely be tweaked later.
3048 * Modules/mediacontrols/mediaControlsApple.js:
3049 (Controller.prototype.drawTimelineBackground):
3050 (Controller.prototype.drawVolumeBackground):
3052 2015-04-02 Yusuke Suzuki <utatane.tea@gmail.com>
3054 Clean up EnumerationMode to easily extend
3055 https://bugs.webkit.org/show_bug.cgi?id=143276
3057 Reviewed by Geoffrey Garen.
3059 Use default EnumerationMode().
3061 * bindings/js/Dictionary.cpp:
3062 (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
3063 (WebCore::Dictionary::getOwnPropertyNames):
3064 * bindings/js/SerializedScriptValue.cpp:
3065 (WebCore::CloneSerializer::serialize):
3066 * bindings/scripts/CodeGeneratorJS.pm:
3068 * bindings/scripts/test/JS/JSFloat64Array.h:
3069 * bindings/scripts/test/JS/JSTestEventTarget.h:
3070 * bridge/NP_jsobject.cpp:
3072 * bridge/runtime_array.cpp:
3073 (JSC::RuntimeArray::getOwnPropertyNames):
3075 2015-04-02 David Hyatt <hyatt@apple.com>
3077 [New Block-Inside-Inline Model] Implement the correct paint order for blocks inside inlines.
3078 https://bugs.webkit.org/show_bug.cgi?id=143320
3080 Reviewed by Darin Adler.
3082 Added new tests in fast/block/inside-inlines.
3084 * rendering/EllipsisBox.cpp:
3085 (WebCore::EllipsisBox::nodeAtPoint):
3086 * rendering/EllipsisBox.h:
3087 * rendering/InlineBox.h:
3088 * rendering/InlineElementBox.cpp:
3089 (WebCore::InlineElementBox::paint):
3090 (WebCore::InlineElementBox::nodeAtPoint):
3091 * rendering/InlineElementBox.h:
3092 * rendering/InlineFlowBox.cpp:
3093 (WebCore::InlineFlowBox::nodeAtPoint):
3094 (WebCore::InlineFlowBox::paint):
3095 * rendering/InlineFlowBox.h:
3096 * rendering/InlineTextBox.cpp:
3097 (WebCore::InlineTextBox::nodeAtPoint):
3098 * rendering/InlineTextBox.h:
3099 The HitTestAction has to be passed to nodeAtPoint so that hit test actions can be honored. All the nodeAtPoint
3100 functions have been patched to include this argument. Painting and hit testing have been patched for InlineElementBox
3101 to honor phases/actions when the element is an anonymous inline block.
3103 The phase filter on RenderLineBoxList has been pushed in to InlineFlowBox::paint and InlineFlowBox::nodeAtPoint so that
3104 we can respect it properly when inlines are painting by themselves (e.g., because they have a layer).
3106 * rendering/RenderBlockLineLayout.cpp:
3107 (WebCore::RenderBlockFlow::createLineBoxes):
3108 (WebCore::RenderBlockFlow::constructLine):
3109 Go ahead and include all of the inline flow boxes between the root and the anonymous inline block if it turns out they
3110 need to be constructed. This will end up being relevant for outlines and for self-painting layers (e.g., opacity).
3112 * rendering/RenderLineBoxList.cpp:
3113 (WebCore::RenderLineBoxList::paint):
3114 (WebCore::RenderLineBoxList::hitTest):
3115 Remove the filters here, since they get pushed in to InlineFlowBox.
3117 * rendering/RootInlineBox.cpp:
3118 (WebCore::RootInlineBox::nodeAtPoint):
3119 * rendering/RootInlineBox.h:
3120 * rendering/svg/SVGInlineTextBox.cpp:
3121 (WebCore::SVGInlineTextBox::nodeAtPoint):
3122 * rendering/svg/SVGInlineTextBox.h:
3123 More patching to pass the HitTestAction into nodeAtPoint.
3125 2015-04-02 Adam Bergkvist <adam.bergkvist@ericsson.com>
3127 WebRTC: Add support for Promise-based MediaDevices.getUserMedia()
3128 https://bugs.webkit.org/show_bug.cgi?id=143255
3130 Reviewed by Eric Carlson.
3132 The MediaDevices object collects functionality related to local media
3133 devices. This patch adds the Promise-based version of getUserMedia()
3134 (unprefixed). Other functionality, like enumerateDevices(), will be
3135 added in later patches.
3137 The old callback-based webkitGetUserMedia() (on Navigator) is kept for
3138 legacy purposes (according to the Media Capture and Streams API spec [1]).
3139 Both versions of getUserMedia are backed up by UserMediaRequest where
3140 the callbacks from the callback-based version are wrapped inside c++
3141 lambda functions. The new Promise-based getUserMedia() uses the lambda
3142 functions directly as created by the Promise bindings.
3144 [1] http://w3c.github.io/mediacapture-main/archives/20150324/getusermedia.html#navigatorusermedia-interface-extensions
3146 Test: fast/mediastream/MediaDevices-getUserMedia.html
3149 * DerivedSources.make:
3150 * Modules/mediastream/MediaDevices.cpp: Added.
3151 (WebCore::MediaDevices::create):
3152 (WebCore::MediaDevices::MediaDevices):
3153 (WebCore::MediaDevices::~MediaDevices):
3154 (WebCore::MediaDevices::document):
3155 (WebCore::MediaDevices::getUserMedia):
3156 * Modules/mediastream/MediaDevices.h: Added.
3157 * Modules/mediastream/MediaDevices.idl: Added.
3158 * Modules/mediastream/NavigatorMediaDevices.cpp: Added.
3159 (WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
3160 (WebCore::NavigatorMediaDevices::~NavigatorMediaDevices):
3161 (WebCore::NavigatorMediaDevices::from):
3162 (WebCore::NavigatorMediaDevices::mediaDevices):
3163 (WebCore::NavigatorMediaDevices::supplementName):
3164 * Modules/mediastream/NavigatorMediaDevices.h: Added.
3165 * Modules/mediastream/NavigatorMediaDevices.idl: Added.
3166 * Modules/mediastream/UserMediaRequest.cpp:
3167 (WebCore::UserMediaRequest::create):
3168 (WebCore::UserMediaRequest::UserMediaRequest):
3169 (WebCore::UserMediaRequest::didCreateStream):
3170 (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
3171 (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
3172 * Modules/mediastream/UserMediaRequest.h:
3173 * PlatformGTK.cmake:
3174 * WebCore.xcodeproj/project.pbxproj:
3175 * bindings/js/JSMediaDevicesCustom.cpp: Added.
3176 (WebCore::JSMediaDevices::getUserMedia):
3178 2015-04-02 Eric Carlson <eric.carlson@apple.com>
3180 [iOS] Fix AirPlay problem caused by r182240
3181 https://bugs.webkit.org/show_bug.cgi?id=143337
3183 Reviewed by Jer Noble.
3185 * html/HTMLMediaSession.cpp:
3186 (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return false if the legacy attribute
3187 "x-webkit-airplay" has the value "allow".
3188 * html/HTMLVideoElement.cpp:
3189 (WebCore::HTMLVideoElement::parseAttribute): Don't call webkitWirelessVideoPlaybackDisabled when
3190 processing "x-webkit-airplay" and "x-webkit-wirelessvideoplaybackdisabled", just consider
3191 the attribute/value.
3193 2015-04-02 Commit Queue <commit-queue@webkit.org>
3195 Unreviewed, rolling out r182265.
3196 https://bugs.webkit.org/show_bug.cgi?id=143338
3198 Caused an assertion on
3199 http/tests/contentextensions/whitelist.html (Requested by ap
3204 "[Content Extensions] Only add unique universal action
3206 https://bugs.webkit.org/show_bug.cgi?id=143325
3207 http://trac.webkit.org/changeset/182265
3209 2015-04-01 Antti Koivisto <antti@apple.com>
3211 Use std::chrono types to represent time in response and cache classes
3212 https://bugs.webkit.org/show_bug.cgi?id=143316
3214 Reviewed by Andreas Kling.
3216 Use std::chrono::system_clock::time_point to represent clock times and std::chrono::microseconds to
3217 represent durations. Also use WTF::Optional for optional values (instead of coding them as NaNs).
3220 (WebCore::Document::lastModified):
3221 * loader/cache/CachedResource.cpp:
3222 (WebCore::CachedResource::CachedResource):
3223 (WebCore::CachedResource::freshnessLifetime):
3224 (WebCore::CachedResource::responseReceived):
3225 (WebCore::CachedResource::updateResponseAfterRevalidation):
3226 * loader/cache/CachedResource.h:
3227 * platform/network/CacheValidation.cpp:
3228 (WebCore::computeCurrentAge):
3229 (WebCore::computeFreshnessLifetimeForHTTPFamily):
3230 (WebCore::updateRedirectChainStatus):
3231 (WebCore::redirectChainAllowsReuse):
3232 (WebCore::parseCacheControlDirectives):
3233 * platform/network/CacheValidation.h:
3234 (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
3235 * platform/network/HTTPParsers.cpp:
3236 (WebCore::parseHTTPDate):
3237 (WebCore::parseDate): Deleted.
3238 * platform/network/HTTPParsers.h:
3239 * platform/network/ResourceResponseBase.cpp:
3240 (WebCore::ResourceResponseBase::ResourceResponseBase):
3241 (WebCore::ResourceResponseBase::cacheControlMaxAge):
3242 (WebCore::parseDateValueInHeader):
3243 (WebCore::ResourceResponseBase::date):
3244 (WebCore::ResourceResponseBase::age):
3245 (WebCore::ResourceResponseBase::expires):
3246 (WebCore::ResourceResponseBase::lastModified):
3247 * platform/network/ResourceResponseBase.h:
3249 2015-04-02 Joonghun Park <jh718.park@samsung.com>
3251 [CSS MultiColumn] Parse "columns: auto <length>" shorthand property value properly
3252 https://bugs.webkit.org/show_bug.cgi?id=143248
3254 Reviewed by Darin Adler.
3256 Test: fast/multicol/columns-shorthand-parsing-2.html
3258 The two longhands for the 'columns' property ('column-count' and
3259 'column-width') may both take 'auto' as a value. When we encounter
3260 'auto' during parsing the value list of a declaration, we cannot just
3261 make a guess at which property/properties that's meant for. Instead,
3262 don't assign anything to 'auto' right away, but wait until all values
3263 have been processed and at that point set the still unassigned
3264 properties to 'auto'. If 'auto' isn't in the value list at all, set
3265 unassigned properties to 'initial' for the 'columns' property, just
3266 like we do for any other property.
3268 * css/CSSParser.cpp:
3269 (WebCore::CSSParser::parseValue):
3270 (WebCore::CSSParser::parseColumnWidth):
3271 (WebCore::CSSParser::parseColumnCount):
3272 (WebCore::CSSParser::parseColumnsShorthand):
3275 2015-04-01 Commit Queue <commit-queue@webkit.org>
3277 Unreviewed, rolling out r182247.
3278 https://bugs.webkit.org/show_bug.cgi?id=143326
3280 unfortunately broke some tests (Requested by dino on #webkit).
3284 "Async loading of image resources"
3285 https://bugs.webkit.org/show_bug.cgi?id=134488
3286 http://trac.webkit.org/changeset/182247
3288 2015-04-01 Alex Christensen <achristensen@webkit.org>
3290 [Content Extensions] Only add unique universal action locations.
3291 https://bugs.webkit.org/show_bug.cgi?id=143325
3293 Reviewed by Benjamin Poulain.
3295 * contentextensions/ContentExtensionCompiler.cpp:
3296 (WebCore::ContentExtensions::compileRuleList):
3297 Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
3299 2015-04-01 Roger Fong <roger_fong@apple.com>
3301 Fixes to material of inline media controls on OSX.
3302 https://bugs.webkit.org/show_bug.cgi?id=143317
3303 <rdar://problem/20357847>
3305 Reviewed by Dean Jackson.
3307 There are many existing tests for the media controls appearance.
3308 They are currently skipped while we are still updating the controls.
3310 Expand backgrounds of control panel and volume box.
3311 Clip the darker edges away.
3312 * Modules/mediacontrols/mediaControlsApple.css:
3313 (audio::-webkit-media-controls-panel):
3314 (audio::-webkit-media-controls-panel-background-container):
3315 (audio::-webkit-media-controls-panel-tint):
3316 (audio::-webkit-media-controls-panel-background):
3317 (audio::-webkit-media-controls-panel .volume-box):
3318 (audio::-webkit-media-controls-volume-slider-container-background):
3319 (audio::-webkit-media-controls-volume-slider-container-tint):
3320 (audio::-webkit-media-controls-panel .volume-box:active):
3321 (video::-webkit-media-controls-volume-slider):
3322 This needs to be above the background so it can be interacted with.
3323 (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
3324 * Modules/mediacontrols/mediaControlsApple.js:
3325 (Controller.prototype.createControls): Create a new div for the control material.
3326 We need to clip the material and not the controls themselves.
3327 (Controller.prototype.configureInlineControls): Use new div.
3328 Remove some unnecessary logic involving hiding materials here.
3329 It just causes the materials to turn on and off at the wrong times.
3330 (Controller.prototype.handlePanelTransitionEnd):
3331 (Controller.prototype.setPlaying):
3332 (Controller.prototype.showControls):
3333 (Controller.prototype.hideControls):
3335 2015-04-01 Eric Carlson <eric.carlson@apple.com>
3337 Media controls should not always auto-hide
3338 https://bugs.webkit.org/show_bug.cgi?id=143322
3340 Reviewed by Dean Jackson.
3342 * Modules/mediacontrols/mediaControlsApple.js:
3343 (Controller): Intialize new properties.
3344 (Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
3345 (Controller.prototype.controlsAlwaysVisible): New.
3346 (Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
3347 (Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
3348 (Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
3349 and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
3350 use them frequently.
3351 * Modules/mediacontrols/mediaControlsiOS.js:
3352 (ControllerIOS.prototype.controlsAlwaysVisible): New.
3353 * platform/graphics/MediaPlaybackTarget.h:
3355 2015-04-01 Alexey Proskuryakov <ap@apple.com>
3357 REGRESSION (r182121): SVG animation macros cause warnings in MSVC
3358 https://bugs.webkit.org/show_bug.cgi?id=143313
3360 Reviewed by Darin Adler.
3362 * svg/SVGExternalResourcesRequired.h: Undo the change that caused a type mismatch.
3364 2015-04-01 Eric Carlson <eric.carlson@apple.com>
3366 Another attempt to fixi the iOS build after r182240.
3368 Reviewed by Dean Jackson.
3370 * platform/graphics/MediaPlaybackTarget.h:
3371 (WebCore::MediaPlaybackTarget::hasActiveRoute):
3373 2015-04-01 Eric Carlson <eric.carlson@apple.com>
3375 Fix the iOS build after r182240.
3377 * platform/graphics/MediaPlaybackTarget.h:
3379 2015-04-01 Yoav Weiss <yoav@yoav.ws>
3381 Async loading of image resources
3382 https://bugs.webkit.org/show_bug.cgi?id=134488
3384 Reviewed by Dean Jackson.
3386 This patch changes image loading to be asynchronous (per spec), in order
3387 for it to be agnostic to property setting order when it comes to src, srcset and crossorigin,
3388 as well as to enable future hooking of the <picture>-based selection logic on top of it.
3390 Tests: fast/dom/HTMLImageElement/image-load-post-onload.html
3391 fast/dom/HTMLImageElement/sizes/image-sizes-js-change-reverse.html
3393 * WebCore.xcodeproj/project.pbxproj: Change MicroTask.h to be private.
3394 * bindings/js/JSEventListener.cpp:
3395 (WebCore::JSEventListener::handleEvent): Add a microtask checkpoint after event handling.
3396 * bindings/js/ScheduledAction.cpp:
3397 (WebCore::ScheduledAction::execute): Add a microtask checkpoint after running of a scheduled action.
3398 * html/HTMLImageElement.cpp:
3399 (WebCore::HTMLImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
3400 * html/HTMLImageLoader.cpp:
3401 (WebCore::HTMLImageLoader::notifyFinished): Avoid a crash when notifyFinished is called and there's no CachedImage.
3402 * html/HTMLInputElement.cpp:
3403 (WebCore::HTMLInputElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
3404 * html/HTMLPlugInImageElement.cpp:
3405 (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
3406 * html/HTMLVideoElement.cpp:
3407 (WebCore::HTMLVideoElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
3408 * html/parser/HTMLDocumentParser.cpp:
3409 (WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd): Add a microtask checkpoint.
3410 * loader/ImageLoader.cpp: Move image resource loading to be asynchronous.
3411 (WebCore::ImageLoader::ImageLoaderTask::create):
3412 (WebCore::ImageLoader::ImageLoaderTask::run): Run the image loading microtask and called doUpdateFromElement.
3413 (WebCore::ImageLoader::ImageLoaderTask::ImageLoaderTask):
3414 (WebCore::ImageLoader::ImageLoader):
3415 (WebCore::ImageLoader::doUpdateFromElement): This is split from the previous updateFromElement, and performs the actual resource loading.
3416 (WebCore::ImageLoader::updateFromElement): Now only prepares the stage for the actual image resource loading.
3417 (WebCore::ImageLoader::shouldLoadImmediately): If this returns true, the image resource is loaded immediately, without queueing a microtask.
3418 (WebCore::ImageLoader::notifyFinished): Add asserts.
3419 (WebCore::ImageLoader::elementDidMoveToNewDocument): Handle document load event counters decrementing and incrementing.
3420 * loader/ImageLoader.h:
3421 (WebCore::ImageLoader::imageComplete): Make sure that the image is complete only if there aren't any pending tasks.
3422 (WebCore::ImageLoader::hasPendingActivity): Make sure that pending activity takes pending tasks into account.
3423 (WebCore::ImageLoader::hasPendingTask): Getter to know if an ImageLoader has a pending task. (Used by the image loading microtask)
3424 (WebCore::ImageLoader::createWeakPtr): Create a weakPtr to be used by the microtask, so it can called back the loader if it's still alive.
3425 * loader/cache/CachedResourceLoader.cpp:
3426 (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
3427 (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
3428 (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
3429 * loader/cache/CachedResourceLoader.h:
3430 (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
3431 (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
3432 (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
3433 * svg/SVGImageElement.cpp:
3434 (WebCore::SVGImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
3435 * xml/parser/XMLDocumentParser.cpp:
3436 (WebCore::XMLDocumentParser::end): Add a microtask checkpoint after XML finishes parsing.
3438 2015-04-01 Alex Christensen <achristensen@webkit.org>
3440 Unreviewed build fix when using content extensions performance reporting.
3442 * contentextensions/ContentExtensionCompiler.cpp:
3443 (WebCore::ContentExtensions::compileRuleList):
3444 Time how long it takes to build the DFAs.
3446 2015-04-01 Alex Christensen <achristensen@webkit.org>
3448 Progress towards CMake on Windows and Mac.
3449 https://bugs.webkit.org/show_bug.cgi?id=143293
3451 Reviewed by Filip Pizlo.
3453 * PlatformMac.cmake:
3454 Tell open source builders where to find unicode headers.
3455 * PlatformWin.cmake:
3456 Include PlatformWinCairo.cmake.
3457 * PlatformWinCairo.cmake:
3458 Added from bug 115944 by Patrick Gansterer.
3459 * bindings/js/JSDOMStringListCustom.cpp:
3460 * bindings/js/JSDOMWrapper.cpp:
3461 * bindings/js/JSMessageChannelCustom.cpp:
3462 * bindings/js/JSPopStateEventCustom.cpp:
3463 * bindings/js/JSReadableStreamCustom.cpp:
3464 * bindings/js/ReadableStreamJSSource.cpp:
3465 * bindings/js/ScriptController.cpp:
3466 * css/CSSComputedStyleDeclaration.cpp:
3468 * dom/CollectionIndexCache.cpp:
3469 * platform/graphics/ANGLEWebKitBridge.h:
3470 Fixed include quirks.
3472 2015-03-31 Simon Fraser <simon.fraser@apple.com>
3474 Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
3475 https://bugs.webkit.org/show_bug.cgi?id=143288
3476 rdar://problem/16049624
3478 Reviewed by Beth Dakin.
3480 Remove the wheel event counting that Document does, and passes into the scrolling tree.
3481 The ScrollingTree now just uses the non-fast scrollable region to determine when to
3482 fast scroll on pages with wheel event handlers.
3484 If a handler includes position:fixed renderers, we just cover the whole document
3485 with the slow-scrolling region currently. This could be improved.
3488 (WebCore::Document::Document):
3489 (WebCore::Document::didBecomeCurrentDocumentInFrame):
3490 (WebCore::Document::wheelEventHandlersChanged):
3491 (WebCore::Document::didAddWheelEventHandler):
3492 (WebCore::Document::didRemoveWheelEventHandler):
3493 (WebCore::Document::wheelEventHandlerCount):
3494 (WebCore::Document::touchEventHandlerCount):
3495 (WebCore::Document::absoluteRegionForEventTargets): Changed to return a pair<Region, bool>
3496 where the bool indicates whether any handler includes position:fixed content.
3497 (WebCore::pageWheelEventHandlerCountChanged): Deleted.
3498 (WebCore::wheelEventHandlerCountChanged): Deleted.
3500 (WebCore::Document::wheelEventHandlerCount): Deleted.
3501 * loader/EmptyClients.h:
3502 * page/ChromeClient.h:
3503 * page/DebugPageOverlays.cpp:
3504 (WebCore::MouseWheelRegionOverlay::updateRegion):
3505 * page/scrolling/AsyncScrollingCoordinator.cpp:
3506 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
3507 (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
3508 * page/scrolling/AsyncScrollingCoordinator.h:
3509 * page/scrolling/ScrollingCoordinator.cpp:
3510 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
3511 (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
3512 (WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount): Deleted.
3513 (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged): Deleted.
3514 * page/scrolling/ScrollingCoordinator.h:
3515 (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
3516 * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3517 (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3518 (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount): Deleted.
3519 * page/scrolling/ScrollingStateFrameScrollingNode.h:
3520 * page/scrolling/ScrollingTree.cpp:
3521 (WebCore::ScrollingTree::ScrollingTree):
3522 (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
3523 (WebCore::ScrollingTree::commitNewTreeState):
3524 * page/scrolling/ScrollingTree.h:
3525 * page/scrolling/mac/ScrollingCoordinatorMac.mm:
3526 (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
3527 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3528 (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
3529 (WebCore::logWheelEventHandlerCountChanged): Deleted.
3530 * testing/Internals.cpp:
3531 (WebCore::Internals::touchEventHandlerCount):
3533 2015-04-01 David Hyatt <hyatt@apple.com>
3535 [New Block-Inside-Inline Model] Floats need to be allowed to intrude into anonymous inline-blocks.
3536 https://bugs.webkit.org/show_bug.cgi?id=143307
3538 Reviewed by Dean Jackson.
3540 Added fast/block/inside-inlines/basic-float-intrusion.html
3542 * rendering/InlineFlowBox.cpp:
3543 (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
3544 Make sure to exclude the margins of an anonymous inline-block when considering the height of the line.
3546 * rendering/RenderBlock.cpp:
3547 (WebCore::RenderBlock::lineHeight):
3548 (WebCore::RenderBlock::baselinePosition):
3549 Anonymous inline-block lines ignore line-height and just return the height of the block. For baseline position, the baseline
3550 is considered to be at the bottom border edge of the anonymous inline-block.
3552 * rendering/RenderBlockFlow.cpp:
3553 (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
3554 (WebCore::RenderBlockFlow::addIntrudingFloats):
3555 * rendering/RenderBlockFlow.h:
3556 Patch float intrusion to handle the case of anonymous inline-blocks. Instead of collecting the floats from our parent(), we
3557 collect them from the containingBlock() in the anonymous inline-block case. Patch addIntrudingFloats to pass in the container
3558 that acts as the "parent", since it is not the parent() in the anonymous inline-block case.
3560 * rendering/RenderBlockLineLayout.cpp:
3561 (WebCore::updateLogicalInlinePositions):
3562 Make sure to use the full available width for content always in the anonymous inline-block case, since we don't avoid the
3563 floats, but instead let them intrude into the inline-block.
3565 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
3566 Patch callers of updateLogicalInlinePositions to pass in the root line box that we're checking for.
3568 (WebCore::RenderBlockFlow::layoutLineBoxes):
3569 Defer the layout of anonymous inline-blocks, since they need to only lay out once the vertical position to lay them out
3572 * rendering/RenderBox.cpp:
3573 (WebCore::RenderBox::createsNewFormattingContext):
3574 (WebCore::RenderBox::avoidsFloats):
3575 Anonymous inline-blocks do not establish a new block formatting context, nor do they avoid floats.
3577 * rendering/line/BreakingContext.h:
3578 (WebCore::BreakingContext::handleReplaced):
3579 Add code to do a just-in-time layout of the anonymous inline-block at the time it is being examined (after the break before
3582 2015-04-01 Eric Carlson <eric.carlson@apple.com>
3584 [Mac] Do not include route button if element does not support target playback
3585 https://bugs.webkit.org/show_bug.cgi?id=143251
3587 Reviewed by Jer Noble.
3589 * Modules/mediacontrols/mediaControlsApple.js:
3590 (Controller.prototype.currentPlaybackTargetIsWireless): Return false if target playback is disabled.
3591 (Controller.prototype.updateWirelessTargetAvailable): Do not show the picker if target
3592 playback is disabled.
3593 (Controller.prototype.handleWirelessPlaybackChange): Call updateWirelessTargetAvailable.
3596 (WebCore::Document::showPlaybackTargetPicker): Update for Page::showPlaybackTargetPicker change.
3597 (WebCore::Document::didChoosePlaybackTarget): Notify clients in vector-order, lower level code
3598 now tracks which one requested the picker.
3600 * html/HTMLMediaElement.cpp:
3601 (WebCore::HTMLMediaElement::loadResource): Don't call applyMediaPlayerRestrictions, it is done
3602 in mediaPlayerEngineFailedToLoad.
3603 (WebCore::HTMLMediaElement::setReadyState): Enqueue a target availability event if there are
3604 listeners readyState reaches HAVE_METADATA so controls are setup correctly.
3605 (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad): Call applyMediaPlayerRestrictions.
3606 (WebCore::HTMLMediaElement::clearMediaPlayer): Enqueue a target availability event in so controls
3607 have a chance to hide the picker.
3608 (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): New, passthrough to the
3610 (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Ditto.
3611 (WebCore::HTMLMediaElement::startPlayingToPlaybackTarget): Ditto.
3612 (WebCore::HTMLMediaElement::stopPlayingToPlaybackTarget): Ditto.
3613 * html/HTMLMediaElement.h:
3614 * html/HTMLMediaElement.idl:
3616 * html/HTMLMediaSession.cpp:
3617 (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_playbackTarget.
3618 (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): New.
3619 (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Pull logic from showingPlaybackTargetPickerPermitted
3620 inline. Don't refuse to show a picker if the element doesn't support target playback, it is up
3621 to script to decide which elements can display a picker.
3622 (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return true if there is no player.
3623 (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Call startPlayingToPlaybackTarget or
3624 stopPlayingToPlaybackTarget because setWirelessPlaybackTarget doesn't apply the target.
3625 (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Add logging.
3626 (WebCore::HTMLMediaSession::showingPlaybackTargetPickerPermitted): Deleted.
3627 * html/HTMLMediaSession.h:
3630 (WebCore::Page::Page): Initialize m_playbackTarget.
3631 (WebCore::Page::showPlaybackTargetPicker): Don't set m_documentRequestingPlaybackTargetPicker.
3632 (WebCore::Page::didChoosePlaybackTarget): Notify Pages in vector-order, lower level code
3633 now tracks which one requested the picker.
3634 (WebCore::Page::configurePlaybackTargetMonitoring): Don't track m_requiresPlaybackTargetMonitoring, it
3635 is too easy for it to get out of sync with the UI process state.
3638 * platform/audio/MediaSession.cpp:
3639 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): New, client passthrough.
3640 (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
3641 (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
3642 * platform/audio/MediaSession.h:
3643 (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
3644 (WebCore::MediaSessionClient::startPlayingToPlaybackTarget):
3645 (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget):
3647 * platform/audio/MediaSessionManager.cpp:
3648 (WebCore::MediaSessionManager::sessionWillBeginPlayback): Call startPlayingToPlaybackTarget &
3649 stopPlayingToPlaybackTarget as necessary.
3650 * platform/audio/MediaSessionManager.h:
3652 * platform/graphics/MediaPlaybackTarget.h:
3653 (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
3654 * platform/graphics/MediaPlaybackTargetPickerClient.h:
3655 * platform/graphics/MediaPlayer.cpp:
3656 (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): New, engine passthrough.
3657 (WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget): Ditto.
3658 (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Ditto.
3659 (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Ditto.
3660 * platform/graphics/MediaPlayer.h:
3661 * platform/graphics/MediaPlayerPrivate.h:
3662 (WebCore::MediaPlayerPrivateInterface::isCurrentPlaybackTargetSupported):
3663 (WebCore::MediaPlayerPrivateInterface::wirelessVideoPlaybackDisabled):
3664 (WebCore::MediaPlayerPrivateInterface::canPlayToWirelessPlaybackTarget):
3665 (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget):
3666 (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget):
3668 * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
3669 (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
3671 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3672 (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
3673 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3674 (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Use playerKVOProperties. Drive-by
3676 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Use playerKVOProperties.
3677 (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Implement for Mac.
3678 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): Delay callbacks
3679 while setting AVPlayer property.
3680 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Add logging. Don't set
3681 the AVPlayer outputContext immediately.
3682 (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): New.
3683 (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): New.
3684 (WebCore::playerKVOProperties): New.
3685 (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Notify when
3686 allowsExternalPlayback changes.
3688 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3689 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3690 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): New.
3691 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
3692 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Ditto.
3693 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Ditto.
3694 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Ditto.
3696 * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3697 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3698 (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Ditto.
3699 (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
3700 (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Ditto.
3701 (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Ditto.
3702 (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Ditto.
3704 2015-04-01 Alex Christensen <achristensen@webkit.org>
3706 [Content Extensions] Properly handle regexes that match everything.
3707 https://bugs.webkit.org/show_bug.cgi?id=143281
3709 Reviewed by Benjamin Poulain.
3711 * contentextensions/ContentExtensionCompiler.cpp:
3712 (WebCore::ContentExtensions::compileRuleList):
3713 Make sure we always have at least one NFA for rule lists with triggers that all match everything.
3714 * contentextensions/DFABytecodeInterpreter.cpp:
3715 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
3716 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
3717 Add helper functions to reduce duplicate code.
3718 (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
3719 Get all actions without flags from the DFA root.
3720 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3721 Remove branches when interpreting.
3722 * contentextensions/DFABytecodeInterpreter.h:
3723 Add helper functions to reduce duplicate code.
3725 2015-04-01 Myles C. Maxfield <mmaxfield@apple.com>
3727 Addressing post-review comments.
3728 https://bugs.webkit.org/show_bug.cgi?id=143292
3732 * platform/graphics/FontCascade.cpp:
3733 (WebCore::FontCascade::leadingExpansionOpportunity):
3734 (WebCore::FontCascade::trailingExpansionOpportunity):
3736 2015-04-01 Per Arne Vollan <peavo@outlook.com>
3738 [WinCairo] Link errors, unresolved texture mapper methods.
3739 https://bugs.webkit.org/show_bug.cgi?id=143308
3741 Reviewed by Alex Christensen.
3743 New texture mapper files should be included in the project.
3745 * WebCore.vcxproj/WebCore.vcxproj:
3746 * WebCore.vcxproj/WebCore.vcxproj.filters:
3748 2015-04-01 Myles C. Maxfield <mmaxfield@apple.com>
3750 Support forcing expansion opportunities at the beginning and ending of a run
3751 https://bugs.webkit.org/show_bug.cgi?id=143292
3753 Reviewed by David Hyatt.
3755 Migrate ExpansionBehavior to an enum comprised of two values: one for leading behavior
3756 and one for trailing behavior. Each of these two values can take on a value of
3757 "force," "forbid," and neither. All calls that interact with justification are
3758 migrated to use this new structure.
3760 Note that in this terminology, "leading" and "trailing" are with respect to the order
3761 that elements get laid out in a line. Therefore, leading is always on the left, since
3762 lines get laid out that way regardless of their bidi attributes.
3764 This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
3766 No new tests because there is no behavior change.
3768 * platform/graphics/FontCascade.cpp:
3769 (WebCore::FontCascade::expansionOpportunityCountInternal): Migrate to these new
3771 (WebCore::FontCascade::expansionOpportunityCount): Ditto.
3772 (WebCore::FontCascade::leadingExpansionOpportunity): Returns whether one is present
3774 (WebCore::FontCascade::trailingExpansionOpportunity): Ditto.
3775 * platform/graphics/FontCascade.h:
3776 * platform/graphics/GlyphBuffer.h: New leading expansion field.
3777 (WebCore::GlyphBuffer::setLeadingExpansion):
3778 (WebCore::GlyphBuffer::leadingExpansion):
3779 * platform/graphics/TextRun.h: m_expansionBehavior needs more bits.
3780 (WebCore::TextRun::expansionBehavior):
3781 (WebCore::TextRun::allowsLeadingExpansion): Deleted.
3782 (WebCore::TextRun::allowsTrailingExpansion): Deleted.
3783 * platform/graphics/WidthIterator.cpp: Update to support new type.
3784 (WebCore::WidthIterator::WidthIterator):
3785 (WebCore::expansionLocation): Where should we insert expansions?
3786 (WebCore::WidthIterator::advanceInternal): Use expansionLocation()
3787 * platform/graphics/cocoa/FontCascadeCocoa.mm:
3788 (WebCore::FontCascade::adjustSelectionRectForComplexText):
3789 (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
3790 * platform/graphics/mac/ComplexTextController.cpp: Same as WidthIterator
3791 (WebCore::ComplexTextController::ComplexTextController):
3792 (WebCore::ComplexTextController::advance):
3793 (WebCore::expansionLocation):
3794 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
3795 * platform/graphics/mac/ComplexTextController.h:
3796 (WebCore::ComplexTextController::leadingExpansion):
3797 * platform/text/TextFlags.h: Add new enum values
3798 * rendering/InlineBox.h: Update to include new values.
3799 (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields):
3800 (WebCore::InlineBox::canHaveTrailingExpansion):
3801 (WebCore::InlineBox::setCanHaveTrailingExpansion):
3802 (WebCore::InlineBox::setForceTrailingExpansion):
3803 (WebCore::InlineBox::forceTrailingExpansion):
3804 (WebCore::InlineBox::setForceLeadingExpansion):
3805 (WebCore::InlineBox::forceLeadingExpansion):
3806 * rendering/InlineTextBox.h:
3807 * rendering/RenderBlockLineLayout.cpp: Update to use new FontCascade signatures.
3808 (WebCore::expansionBehaviorForInlineTextBox):
3809 (WebCore::applyExpansionBehavior):
3810 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
3812 2015-04-01 Zalan Bujtas <zalan@apple.com>
3814 Lots of time spent querying table cell borders, when there are none.
3815 https://bugs.webkit.org/show_bug.cgi?id=143277
3817 Reviewed by Simon Fraser.
3819 This patch speeds up collapsed border queries by using existing collapsed border
3820 cache to calculate repaint rects and by introducing a fast path for zero width collapsed borders.
3822 It reduces the number of calls to recompute collapsed borders from 36 000 to 1 600, while loading a page with a table of 400 rows (1 cell per row).
3823 When scrolling the same page all the way down to the bottom, the number of calls to recompute collapsed borders falls from 290 000 to 0.
3825 Covered by existing tests.
3827 * rendering/RenderTable.cpp:
3828 (WebCore::RenderTable::styleDidChange): This moves invalidation time from RenderTable::layout() to styleDidChange().
3829 (WebCore::RenderTable::invalidateCollapsedBorders):
3830 (WebCore::RenderTable::recalcCollapsedBorders):
3831 * rendering/RenderTable.h:
3832 (WebCore::RenderTable::collapsedBordersAreValid):
3833 (WebCore::RenderTable::invalidateCollapsedBorders): Deleted.
3834 * rendering/RenderTableCell.cpp:
3835 (WebCore::RenderTableCell::RenderTableCell):
3836 (WebCore::RenderTableCell::willBeRemovedFromTree): Invalidate caches so that when repaint rect is calculated, we don't end up using stale values.
3837 (WebCore::RenderTableCell::styleDidChange): Same as willBeRemovedFromTree.
3838 (WebCore::RenderTableCell::collapsedStartBorder): Check if collapsed border is zero -also query cache.
3839 (WebCore::RenderTableCell::collapsedEndBorder):
3840 (WebCore::RenderTableCell::collapsedBeforeBorder):
3841 (WebCore::RenderTableCell::collapsedAfterBorder):
3842 (WebCore::RenderTableCell::cachedCollapsedLeftBorder):
3843 (WebCore::RenderTableCell::cachedCollapsedRightBorder):
3844 (WebCore::RenderTableCell::cachedCollapsedTopBorder):
3845 (WebCore::RenderTableCell::cachedCollapsedBottomBorder):
3846 (WebCore::RenderTableCell::paintCollapsedBorders):
3847 (WebCore::RenderTableCell::cellAtLeft): Deleted.
3848 (WebCore::RenderTableCell::cellAtRight): Deleted.
3849 (WebCore::RenderTableCell::cellAtTop): Deleted.
3850 (WebCore::RenderTableCell::cellAtBottom): Deleted.
3851 * rendering/RenderTableCell.h:
3852 (WebCore::RenderTableCell::invalidateHasEmptyCollapsedBorders):
3853 * rendering/RenderTableCol.cpp:
3854 (WebCore::RenderTableCol::styleDidChange):
3855 * rendering/RenderTableRow.cpp:
3856 (WebCore::RenderTableRow::styleDidChange):
3857 (WebCore::RenderTableRow::addChild):
3858 * rendering/RenderTableSection.cpp:
3859 (WebCore::RenderTableSection::styleDidChange):
3860 (WebCore::RenderTableSection::clearCachedCollapsedBorders): This is just an extra safety to invalidate collapsed border cache. This is always
3861 called together with RenderTable::invalidateCollapsedBorders() -and that should prevent the RenderCells to use the cache.
3862 (WebCore::RenderTableSection::removeCachedCollapsedBorders):
3863 (WebCore::RenderTableSection::setCachedCollapsedBorder):
3864 (WebCore::RenderTableSection::cachedCollapsedBorder):
3865 * rendering/RenderTableSection.h:
3867 2015-04-01 Carlos Alberto Lopez Perez <clopez@igalia.com>
3869 [CMake][GTK] Use the right variable to include the Wayland headers.
3870 https://bugs.webkit.org/show_bug.cgi?id=143304
3872 Reviewed by Carlos Garcia Campos.
3874 No new tests, no behavior changes.
3876 * PlatformGTK.cmake: Use the right variable WAYLAND_INCLUDE_DIRS.
3878 2015-03-30 Philippe Normand <pnormand@igalia.com>
3880 [GStreamer] Move synchronous message handler to MediaPlayerPrivateGStreamerBase
3881 https://bugs.webkit.org/show_bug.cgi?id=143218
3883 Reviewed by Carlos Garcia Campos.
3885 Moved the pipeline pointer to the base class, sub-classes should
3886 now invoke setPipeline() when loading a resource. The base class
3887 now takes care of configuring the GL shared context, this is more
3888 logical because video rendering is also managed by this class.
3890 No new tests, this is only a code refactoring.
3892 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3893 (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3894 (WebCore::MediaPlayerPrivateGStreamer::load):
3895 (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
3896 (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
3897 (WebCore::MediaPlayerPrivateGStreamer::pause):
3898 (WebCore::MediaPlayerPrivateGStreamer::duration):
3899 (WebCore::MediaPlayerPrivateGStreamer::currentTime):
3900 (WebCore::MediaPlayerPrivateGStreamer::seek):
3901 (WebCore::MediaPlayerPrivateGStreamer::doSeek):
3902 (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
3903 (WebCore::MediaPlayerPrivateGStreamer::paused):
3904 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
3905 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
3906 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
3907 (WebCore::MediaPlayerPrivateGStreamer::setRate):
3908 (WebCore::MediaPlayerPrivateGStreamer::buffered):
3909 (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3910 (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
3911 (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
3912 (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
3913 (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
3914 (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
3915 (WebCore::MediaPlayerPrivateGStreamer::updateStates):
3916 (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
3917 (WebCore::MediaPlayerPrivateGStreamer::cacheDuration):
3918 (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
3919 (WebCore::MediaPlayerPrivateGStreamer::audioSink):
3920 (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3921 (WebCore::MediaPlayerPrivateGStreamer::simulateAudioInterruption):
3922 (WebCore::mediaPlayerPrivateSyncMessageCallback): Deleted.
3923 (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Deleted.
3924 (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Deleted.
3925 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3926 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: