1 2015-04-07 Alex Christensen <achristensen@webkit.org>
3 More unreviewed fixing API tests.
5 * contentextensions/ContentExtensionsBackend.cpp:
6 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
7 Don't check for javascript protocol.
9 2015-04-07 Eric Carlson <eric.carlson@apple.com>
11 [Mac] never update caption user style sheet during parsing
12 https://bugs.webkit.org/show_bug.cgi?id=143499
14 Reviewed by Jer Noble.
16 * page/CaptionUserPreferencesMediaAF.cpp:
17 (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
18 (WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged): Ignore a
19 "preferences changed" notification fired while registering for said notification, we
20 already create and insert the style sheet after a brief delay anyway.
21 * page/CaptionUserPreferencesMediaAF.h:
23 2015-04-07 Alex Christensen <achristensen@webkit.org>
25 [Win] Unreviewed build fix after r182494.
27 * platform/win/ContextMenuItemWin.cpp:
28 (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
30 2015-04-07 Alex Christensen <achristensen@webkit.org>
32 Unreviewed fixing API tests.
34 * contentextensions/ContentExtensionsBackend.cpp:
35 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
39 (WebCore::URL::protocolIsData):
40 (WebCore::URL::protocolIsJavaScript): Deleted.
41 Revert part of r182492 that changed URL.h.
43 2015-04-07 Anders Carlsson <andersca@apple.com>
45 More work on making the application cache storage be per page
46 https://bugs.webkit.org/show_bug.cgi?id=143498
48 Reviewed by Andreas Kling.
50 * loader/appcache/ApplicationCacheStorage.cpp:
51 (WebCore::ApplicationCacheStorage::create):
52 (WebCore::ApplicationCacheStorage::singleton):
53 * loader/appcache/ApplicationCacheStorage.h:
55 (WebCore::Page::Page):
57 (WebCore::Page::applicationCacheStorage):
58 * page/PageConfiguration.cpp:
59 (WebCore::PageConfiguration::PageConfiguration): Deleted.
60 * page/PageConfiguration.h:
62 2015-04-07 Matthew Mirman <mmirman@apple.com>
64 Source and stack information should get appended only to native errors
65 and should be added directly after construction rather than when thrown.
66 This fixes frozen objects being unfrozen when thrown while conforming to
67 ecma script standard and other browser behavior.
68 rdar://problem/19927293
69 https://bugs.webkit.org/show_bug.cgi?id=141871
71 Reviewed by Geoffrey Garen.
73 Covered by existing tests.
75 Sets line, column, source and stack information for DOMExceptions as
76 expected by the webinspector for native errors.
78 * bindings/js/JSDOMBinding.cpp:
79 (WebCore::setDOMException):
81 2015-04-07 Brady Eidson <beidson@apple.com>
83 ContextMenuItem refactoring
84 https://bugs.webkit.org/show_bug.cgi?id=143485
86 Reviewed by Beth Dakin.
88 * platform/ContextMenuItem.h:
89 (WebCore::ContextMenuItem::isNull):
91 * platform/gtk/ContextMenuItemGtk.cpp:
92 (WebCore::ContextMenuItem::ContextMenuItem):
94 * platform/mac/ContextMenuItemMac.mm:
95 (WebCore::ContextMenuItem::ContextMenuItem):
96 (WebCore::ContextMenuItem::platformDescription):
97 (WebCore::ContextMenuItem::setSubMenu):
98 (WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
99 (WebCore::ContextMenuItem::getPlatformDescription): Deleted.
101 * platform/mac/ContextMenuMac.mm:
102 (WebCore::ContextMenu::appendItem):
103 (WebCore::ContextMenu::insertItem):
104 (WebCore::platformMenuDescription):
106 * platform/win/ContextMenuItemWin.cpp:
107 (WebCore::ContextMenuItem::ContextMenuItem):
109 2015-04-07 Alex Christensen <achristensen@webkit.org>
111 Optimize content extensions interpreting speed.
112 https://bugs.webkit.org/show_bug.cgi?id=143490
114 Reviewed by Brady Eidson.
116 * contentextensions/ContentExtensionCompiler.cpp:
117 (WebCore::ContentExtensions::compileRuleList):
118 * contentextensions/ContentExtensionsBackend.cpp:
119 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
120 Measure total time added by content extensions.
121 * contentextensions/DFABytecodeCompiler.cpp:
122 (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
123 (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
124 When jumping to the root, don't re-add all the actions.
125 * contentextensions/DFABytecodeCompiler.h:
127 (WebCore::URL::init):
129 (WebCore::URL::protocolIsJavaScript): Added.
131 2015-04-07 Simon Fraser <simon.fraser@apple.com>
133 Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
134 https://bugs.webkit.org/show_bug.cgi?id=143495
136 Reviewed by Tim Horton.
138 Add a new Setting, antialiasedFontDilationEnabled, which defaults to true. This
139 will be used in an upcoming patch.
143 2015-04-07 Andy Estes <aestes@apple.com>
145 [Content Filtering] Add logging
146 https://bugs.webkit.org/show_bug.cgi?id=143470
148 Reviewed by Daniel Bates.
150 Added a new ContentFiltering logging channel, and started logging some useful diagnostic messages.
152 * loader/ContentFilter.cpp:
153 (WebCore::ContentFilter::~ContentFilter):
154 (WebCore::ContentFilter::willSendRequest):
155 (WebCore::ContentFilter::startFilteringMainResource):
156 (WebCore::ContentFilter::responseReceived):
157 (WebCore::ContentFilter::dataReceived):
158 (WebCore::ContentFilter::notifyFinished):
159 (WebCore::ContentFilter::didDecide):
160 * platform/Logging.h:
161 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
162 (WebCore::ContentFilterUnblockHandler::canHandleRequest):
163 (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
164 * platform/cocoa/NetworkExtensionContentFilter.mm:
165 (WebCore::NetworkExtensionContentFilter::enabled):
166 (WebCore::NetworkExtensionContentFilter::unblockHandler):
167 (WebCore::NetworkExtensionContentFilter::handleDecision):
168 * platform/cocoa/ParentalControlsContentFilter.mm:
169 (WebCore::ParentalControlsContentFilter::enabled):
170 (WebCore::ParentalControlsContentFilter::updateFilterState):
171 * testing/MockContentFilter.cpp:
172 (WebCore::MockContentFilter::enabled):
173 (WebCore::MockContentFilter::unblockHandler):
174 (WebCore::MockContentFilter::maybeDetermineStatus):
176 2015-04-07 Eric Carlson <eric.carlson@apple.com>
178 [Mac] video playing to external device should not be interrupted
179 https://bugs.webkit.org/show_bug.cgi?id=143492
181 Reviewed by Jer Noble.
183 * Modules/mediacontrols/mediaControlsApple.js:
184 (Controller.prototype.handlePanelTransitionEnd): Drive-by fix to make sure the controls are
185 not hidden if the opacity timer is primed before they go into a state where they should
188 * html/HTMLMediaElement.cpp:
189 (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Make it const.
190 (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): New.
191 * html/HTMLMediaElement.h:
193 * html/HTMLMediaSession.cpp:
194 (WebCore::HTMLMediaSession::canPlayToWirelessPlaybackTarget): New. Short-circuit call to
195 client when we already know the answer.
196 (WebCore::HTMLMediaSession::isPlayingToWirelessPlaybackTarget): Ditto.
197 (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Ditto.
198 (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Ditto.
199 * html/HTMLMediaSession.h:
201 * platform/audio/MediaSession.cpp:
202 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): Deleted, moved inline and neutered
203 because only HTMLMediaSession needs to use them.
204 (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
205 (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
206 * platform/audio/MediaSession.h:
207 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget):
208 (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
209 (WebCore::MediaSession::startPlayingToPlaybackTarget):
210 (WebCore::MediaSession::stopPlayingToPlaybackTarget):
211 (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
212 (WebCore::MediaSessionClient::isPlayingToWirelessPlaybackTarget):
214 * platform/audio/MediaSessionManager.cpp:
215 (WebCore::MediaSessionManager::MediaSessionManager):
216 (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): New.
217 (WebCore::MediaSessionManager::sessionWillBeginPlayback): Don't interrupt an active session
218 playing to a target device.
219 * platform/audio/MediaSessionManager.h:
221 * platform/graphics/MediaPlayer.cpp:
222 (WebCore::MediaPlayer::isPlayingToWirelessPlaybackTarget): New, passthrough.
223 * platform/graphics/MediaPlayer.h:
224 * platform/graphics/MediaPlayerPrivate.h:
225 (WebCore::MediaPlayerPrivateInterface::isPlayingToWirelessPlaybackTarget):
227 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
228 (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
229 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
230 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Explicitly call
231 when passed a nil or inactive target context.
232 (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Add logging.
233 (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Ditto.
234 (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): New. Return
235 true when playing with an active context.
236 (WebCore::playerKVOProperties): "outputContext" is not observable.
238 2015-04-07 Sam Weinig <sam@webkit.org>
240 Re-add JSReadableStream and JSReadableStreamReader the Xcode project to
243 * WebCore.xcodeproj/project.pbxproj:
245 2015-02-25 Sergio Villar Senin <svillar@igalia.com>
247 [CSS Grid Layout] Update track sizes after distributing extra space
248 https://bugs.webkit.org/show_bug.cgi?id=141422
250 Reviewed by Antti Koivisto.
252 Both old and new tracks sizing algorithms instruct us to update
253 the sizes of the content sized tracks only after distributing the
254 extra space for all the items in the same span group. So far we
255 were doing it inside distributeSpaceToTracks(), i.e., once for
256 every single item. That is wrong because it makes the algorithm
259 Our old implementation looked something like this (pseudocode):
261 resolveContentBasedTrackSizingFunctions()
263 resolveContentBasedTrackSizingFunctionsForItems() (x4)
264 distributeSpaceToTracks()
267 Now it's done this way (pseudocode):
269 resolveContentBasedTrackSizingFunctions()
271 resolveContentBasedTrackSizingFunctionsForItems() (x4)
272 foreach item in spanGroup
273 distributeSpaceToTracks()
276 As it can be seen the update of track sizes only happens after
277 processing all the items of a given span group. In order to
278 accomplish this a new field was added to GridTrack called
279 tempIncrease which stores per-track increases while distributing
280 the extra space among the items in the same span group. That
281 temporal increase could eventually be used to update the
282 plannedIncrease which is the one we use to finally set the new
285 This change makes our implementation closer to the spec, removes
286 the order dependency and ensures that every track satisfies their
287 min track sizing functions before starting to consider the max
288 track sizing functions.
290 Test: fast/css-grid-layout/grid-update-sizes-after-distributing-all.html
292 * rendering/RenderGrid.cpp:
293 (WebCore::GridTrack::plannedSize):
294 (WebCore::GridTrack::setPlannedSize): New setter.
295 (WebCore::GridTrack::tempSize): New attribute.
296 (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
297 RenderGrid::distributeSpaceToTracks() no longer updates the track
298 sizes so we have to do it after the call returns.
299 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
300 Call RenderGrid::resolveContentBasedTrackSizingFunctionsForItems()
301 passing a span group instead of a single item.
302 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
303 It now receives a span group instead of a single item. Apart from
304 that we need an extra function to get the unaltered track size (as
305 the current one returns the base size whenever the growth limit is
307 (WebCore::RenderGrid::distributeSpaceToTracks): This no longer
308 updates track sizes but only the track's planned size;
309 * rendering/RenderGrid.h:
311 2015-04-06 Chris Dumez <cdumez@apple.com>
313 Bing video search result pages are not PageCacheable
314 https://bugs.webkit.org/show_bug.cgi?id=143463
315 <rdar://problem/20440916>
317 Reviewed by Alexey Proskuryakov.
319 Bing video search result pages are not PageCacheable (tested on iOS).
321 - is bad for power usage as it causes a reload when clicking one of the
322 results then navigating back in history.
323 - degrades user experience because the results page uses infinite
324 scrolling and the scroll position is not properly restored when
325 navigating back, not to mention the user has to wait for the reload
328 The issue was that the bing search page was doing a ping load when
329 clicking on one of the search results. The ping load was done by
330 create an image and its 'src' attribute to the ping URL. This load
331 usually did not have time to complete when navigating away so we would
332 cancel it and the main document would end up with an error that would
333 prevent the page from entering the page cache. We already have code
334 making sure load cancellations do not prevent page caching as long as
335 the loads are for XHR or images. However, the latter check was broken
336 in the case where the ResourceRequest's cachePartition was non-empty.
337 This is because the check was using the MemoryCache::ResourceForUrl()
338 API which rarely does what we want because it will request a dummy
339 ResourceRequest (without cachePartition) and then call
340 MemoryCache::resourceForRequest(). This patch updates the check
341 to use resourceForRequest() directly as we have the ResourceRequest
344 This patch also gets rid of the MemoryCache::ResourceForUrl() API as
345 it rarely does what we want and it is bug prone. It was only used in
346 2 places, one of them causing this bug and the other in Internals.
348 Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
349 http/tests/navigation/page-cache-pending-image-load.html
351 * loader/DocumentLoader.cpp:
352 (WebCore::areAllLoadersPageCacheAcceptable):
353 Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
354 we have the ResourceRequest and calling resourceForUrl() would loose
357 * loader/cache/MemoryCache.cpp:
358 (WebCore::MemoryCache::resourceForURL): Deleted.
359 Drop this API as it is bug prone and rarely does what we want.
361 * testing/Internals.cpp:
362 (WebCore::Internals::isLoadingFromMemoryCache):
363 Update call to create a dummy ResourceRequest and call
364 resourceForRequest() instead of resourceForUrl(), as this API no
365 longer exists. The new code also set the cachePartition on the
366 dummy request so that this function actually behaves as expected
367 if the cachePartition in the memory cache is non-empty.
370 2015-04-06 Jer Noble <jer.noble@apple.com>
372 Synchronize fullscreen animation between processes.
373 https://bugs.webkit.org/show_bug.cgi?id=143131
375 Reviewed by Simon Fraser.
377 Rather than attempt to synchcronize animations across the WebProcess / UIProcess boundary,
378 do the bounds-change animation in-process by applying a sublayer transformation to the
379 video layer. This gives the same visual effect as a synchronized bounds animation, but
380 without needing a synchronization fence. Resolve the difference between the transformation
381 and bounds by doing a fence-synchronized bounds change after the current animation is
382 scheduled to complete.
384 To do this calculation correctly, WebAVPlayer needs to query both the effective
385 videoLayerFrame and the videoLayerGravity. To that end, add getter methods for
386 videoLayerFrame() and videoLayerGravity().
388 * html/HTMLMediaElement.h:
389 (WebCore::HTMLMediaElement::videoFullscreenGravity):
390 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
391 (-[WebAVVideoLayer dealloc]): Cancel outstanding performSelector requests.
392 (-[WebAVVideoLayer setBounds:]): Add a scale transform to simulate a bonuds change.
393 (-[WebAVVideoLayer resolveBounds]): Reset the scale transform and set the bounds.
394 (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Set the initial video frame bounds.
395 (-[WebAVPlayerController layoutSublayersOfLayer:]): Deleted.
396 * platform/ios/WebVideoFullscreenModel.h:
397 * platform/ios/WebVideoFullscreenModelVideoElement.h:
398 * platform/ios/WebVideoFullscreenModelVideoElement.mm:
399 (WebVideoFullscreenModelVideoElement::videoLayerFrame): Added; simple getter.
400 (WebVideoFullscreenModelVideoElement::videoLayerGravity): Ditto.
402 2015-04-06 Zalan Bujtas <zalan@apple.com>
404 Simple line layout: RunResolver::Iterator class cleanup.
405 https://bugs.webkit.org/show_bug.cgi?id=143445
407 Reviewed by Antti Koivisto.
409 1. SimpleLineLayout::Run is an intermediate structure and should not be publicly accessible through RunResolver::Iterator.
410 RunResolver::Run is the class to use to access run properties.
411 2. Also move advance()/advanceLine() to private. Callers should use LineResolver to advance on lines.
413 No change in functionality.
415 * rendering/SimpleLineLayoutResolver.h:
417 2015-04-06 Simon Fraser <simon.fraser@apple.com>
419 Use a RenderObject bit for isRenderFlowThread()
420 https://bugs.webkit.org/show_bug.cgi?id=143439
422 Reviewed by Darin Adler.
424 Turning isRenderFlowThread() into a bit in rare data rather than a virtual function reduces
425 the time under RenderLayer::scrollTo() on a large overflow:scroll table from 56% to 44%.
427 * rendering/RenderFlowThread.cpp:
428 (WebCore::RenderFlowThread::RenderFlowThread):
429 * rendering/RenderFlowThread.h:
430 * rendering/RenderObject.cpp:
431 (WebCore::RenderObject::setIsRenderFlowThread):
432 * rendering/RenderObject.h:
433 (WebCore::RenderObject::isDragging):
434 (WebCore::RenderObject::hasReflection):
435 (WebCore::RenderObject::isRenderFlowThread):
436 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
438 2015-04-06 Myles C. Maxfield <mmaxfield@apple.com>
440 [Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
441 https://bugs.webkit.org/show_bug.cgi?id=143402
443 Reviewed by Darin Adler.
445 There are a few pieces to the converter that Windows requires that we haven't already
447 1. Checksums were being calculated with the wrong endianness
448 2. Windows requires a format 4 'cmap' subtable in addition to the format 12 one we already
450 3. Windows requires a reference to a Private DICT inside the CFF table, even if the DICT
453 Covered by all our existing SVG font tests.
455 * svg/SVGFontFaceElement.h: Add capHeight accessor.
456 * svg/SVGFontFaceElement.cpp:
457 (WebCore::SVGFontFaceElement::capHeight): Ditto.
458 * svg/SVGToOTFConversion.cpp: Update the conversion process according to the above
460 (WebCore::SVGToOTFFontConverter::appendFormat12CMAPTable):
461 (WebCore::SVGToOTFFontConverter::appendFormat4CMAPTable):
462 (WebCore::SVGToOTFFontConverter::appendCMAPTable): Use helpers.
463 (WebCore::SVGToOTFFontConverter::appendHHEATable): Use member variables.
464 (WebCore::SVGToOTFFontConverter::appendOS2Table): Update to version 2.
465 (WebCore::SVGToOTFFontConverter::appendCFFTable): Create a reference to a
466 zero-sized Private DICT
467 (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Populate member
469 (WebCore::SVGToOTFFontConverter::calculateChecksum): Flip endianness
471 2015-04-06 Yusuke Suzuki <utatane.tea@gmail.com>
473 Return Optional<uint32_t> from PropertyName::asIndex
474 https://bugs.webkit.org/show_bug.cgi?id=143422
476 Reviewed by Darin Adler.
478 * bindings/js/JSDOMWindowCustom.cpp:
479 (WebCore::JSDOMWindow::getOwnPropertySlot):
480 (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
481 * bindings/js/JSHTMLAllCollectionCustom.cpp:
482 (WebCore::callHTMLAllCollection):
483 (WebCore::JSHTMLAllCollection::item):
484 * bindings/scripts/CodeGeneratorJS.pm:
485 (GenerateGetOwnPropertySlotBody):
486 (GenerateImplementation):
487 * bindings/scripts/test/JS/JSFloat64Array.cpp:
488 (WebCore::JSFloat64Array::getOwnPropertySlot):
489 (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
490 (WebCore::JSFloat64Array::put):
491 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
492 (WebCore::JSTestEventTarget::getOwnPropertySlot):
493 * bridge/runtime_array.cpp:
494 (JSC::RuntimeArray::getOwnPropertySlot):
495 (JSC::RuntimeArray::put):
497 2015-04-06 Žan Doberšek <zdobersek@igalia.com>
499 FileList constructor should move the passed-in Vector<> rvalue reference into the member variable
500 https://bugs.webkit.org/show_bug.cgi?id=143412
502 Reviewed by Darin Adler.
504 * fileapi/FileList.h:
505 (WebCore::FileList::FileList): An explicit move of the passed-in rvalue
506 reference into the member variable is required, otherwise a copy is
507 performed since an rvalue reference is just an lvalue.
509 2015-04-06 Žan Doberšek <zdobersek@igalia.com>
511 UserScript, UserStyleSheet constructors should take in Vector<String> rvalue references
512 https://bugs.webkit.org/show_bug.cgi?id=143411
514 Reviewed by Darin Adler.
516 Have the UserScript and UserStyleSheet constructors take in Vector<String>
517 rvalue references for the whitelist and blacklist parameters. Both classes
518 store these Vector<String> objects, so the referenced objects can simply be
519 moved into the member variable.
521 Because the constructor is now demanding an rvalue, it's up to the caller
522 to move in the desired object if possible, or create an explicit copy
526 (WebCore::UserScript::UserScript):
527 * page/UserStyleSheet.h:
528 (WebCore::UserStyleSheet::UserStyleSheet):
530 2015-04-05 Andy Estes <aestes@apple.com>
532 [Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest:...]
533 https://bugs.webkit.org/show_bug.cgi?id=143437
535 Reviewed by Dan Bernstein.
537 No new tests. We can't test NEFilterSource directly.
539 * platform/cocoa/NetworkExtensionContentFilter.mm:
540 (WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.
542 2015-04-05 Darin Adler <darin@apple.com>
544 FrameView code uses page() without null checking
545 https://bugs.webkit.org/show_bug.cgi?id=143425
546 rdar://problem/18920601
548 Reviewed by Anders Carlsson.
550 While we don't have tests that cover this, we are seeing crashes coming in
551 that indicate the shouldEnableSpeculativeTilingDuringLoading function is
552 being called when the page is null. This patch adds null checks to all the
553 places in FrameView that use page() without doing null checking.
555 * page/FrameView.cpp:
556 (WebCore::FrameView::layout): If page is null, don't try to do the
557 auto-sizing logic that involves the textAutosizingWidth value from the page.
558 (WebCore::FrameView::setFixedVisibleContentRect): Get settings from the
559 frame rather than the page to avoid possible null-dereference.
560 (WebCore::FrameView::scrollPositionChanged): Check the page for null when
561 getting the event throttling delay.
562 (WebCore::FrameView::updateLayerFlushThrottling): Check the page for null,
563 and return early if it is null.
564 (WebCore::shouldEnableSpeculativeTilingDuringLoading): Check the page for
565 null, and return false if it is null.
566 (WebCore::FrameView::performPostLayoutTasks): Guard the code that calls
567 didLayout on the page client by a check if the page is null.
568 (WebCore::FrameView::pagination): Don't call Page::pagination on a null
570 (WebCore::FrameView::visibleContentScaleFactor): Use a scale factor of 1
572 (WebCore::FrameView::setVisibleScrollerThumbRect): Don't call through to
573 the page client if the page is null.
574 (WebCore::FrameView::scrollbarStyleChanged): Ditto.
575 (WebCore::FrameView::setScrollPinningBehavior): Check the page for null
576 before asking it for the scrolling coordinator.
578 2015-04-05 Simon Fraser <simon.fraser@apple.com>
580 Free up some bits in RenderObject by moving rarely used bits into a side table
581 https://bugs.webkit.org/show_bug.cgi?id=143432
583 Reviewed by Darin Adler.
585 Add a side table (global hash) on RenderObject to store data that is rarely
586 used. Move the "isDragging" and "hasReflection" bits there. Re-use one of
587 those bits for "hasRareData", and leave the other unused (I have plans for it).
589 * rendering/RenderBlock.cpp:
590 (WebCore::getBlockRareData): Renamed for consistency.
591 (WebCore::ensureBlockRareData): Renamed to avoid conflict with RenderObject::ensureRareData().
592 (WebCore::RenderBlock::cachedFlowThreadContainingBlock):
593 (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
594 (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
595 (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
596 (WebCore::RenderBlock::locateFlowThreadContainingBlock):
597 (WebCore::RenderBlock::paginationStrut):
598 (WebCore::RenderBlock::pageLogicalOffset):
599 (WebCore::RenderBlock::setPaginationStrut):
600 (WebCore::RenderBlock::setPageLogicalOffset):
601 (WebCore::getRareData): Deleted.
602 (WebCore::ensureRareData): Deleted.
603 * rendering/RenderObject.cpp:
604 (WebCore::RenderObject::~RenderObject): Assert that rare data hasn't been resurrected
605 since willBeDestroyed().
606 (WebCore::RenderObject::willBeDestroyed): Clear the rare data.
607 (WebCore::RenderObject::setIsDragging): If setting, ensure that we have rare data and
608 set the bit. Otherwise, only clear the bit of we have rare data.
609 (WebCore::RenderObject::setHasReflection): Ditto.
610 (WebCore::RenderObject::rareDataMap):
611 (WebCore::RenderObject::rareData):
612 (WebCore::RenderObject::ensureRareData):
613 (WebCore::RenderObject::clearRareData):
614 * rendering/RenderObject.h:
615 (WebCore::RenderObject::isDragging): Fast-fail on the hasRareData() bit, then do the
616 slower lookup in rare data.
617 (WebCore::RenderObject::hasReflection): Ditto.
618 (WebCore::RenderObject::setEverHadLayout): Moved up to group with other bit setters.
619 (WebCore::RenderObject::hasRareData):
620 (WebCore::RenderObject::setHasRareData):
621 (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
622 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
623 (WebCore::RenderObject::setHasReflection): Deleted. Out of line now.
624 (WebCore::RenderObject::setIsDragging): Deleted. Ditto.
626 2015-04-05 Darin Adler <darin@apple.com>
628 REGRESSION (r181778): Crash after scrolling Google search result page
629 https://bugs.webkit.org/show_bug.cgi?id=143431
631 Reviewed by Simon Fraser.
633 I can't reproduce this crash, nor was I able to make a regression test,
634 but the crash data makes it clear this is a null dereference.
636 * page/animation/AnimationController.cpp:
637 (WebCore::AnimationControllerPrivate::scrollWasUpdated): Check the result
638 of Frame::view for null. We know this is only called when there is a
639 valid FrameView, but it can be called after Frame::m_view is already null.
641 2015-04-05 Andy Estes <aestes@apple.com>
643 [Content Filtering] Tell the filter about requests and redirects
644 https://bugs.webkit.org/show_bug.cgi?id=143414
645 rdar://problem/19239549
647 Reviewed by Darin Adler.
649 Tests: contentfiltering/allow-after-will-send-request.html
650 contentfiltering/block-after-will-send-request.html
651 http/tests/contentfiltering/allow-after-redirect.html
652 http/tests/contentfiltering/block-after-redirect.html
654 NEFilterSource supports making filter decisions based on NSURLRequests, so this patch adds support for telling
655 ContentFilter about the original main resource request as well as redirect requests.
657 * bindings/js/JSMockContentFilterSettingsCustom.cpp: Updated decisionPoint values to include AfterWillSendRequest and AfterRedirect.
658 (WebCore::JSMockContentFilterSettings::decisionPoint):
659 (WebCore::JSMockContentFilterSettings::setDecisionPoint):
660 * loader/ContentFilter.cpp:
661 (WebCore::ContentFilter::willSendRequest): Called willSendRequest() on each filter using forEachContentFilterUntilBlocked().
662 (WebCore::ContentFilter::redirectReceived): Called willSendRequest().
663 * loader/ContentFilter.h:
664 * loader/DocumentLoader.cpp:
665 (WebCore::DocumentLoader::willSendRequest): Called ContentFilter::willSendRequest() if there is a content filter.
666 Asserted that this is not a redirect, and that ContentFilter does not set the request to null.
667 * loader/SubresourceLoader.cpp:
668 (WebCore::SubresourceLoader::willSendRequest): Called redirectReceived() instead of willSendRequest().
669 * loader/cache/CachedRawResource.cpp:
670 (WebCore::CachedRawResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
671 (WebCore::CachedRawResource::willSendRequest): Deleted.
672 * loader/cache/CachedRawResource.h:
673 * loader/cache/CachedResource.cpp:
674 (WebCore::CachedResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
675 (WebCore::CachedResource::willSendRequest): Deleted.
676 * loader/cache/CachedResource.h:
677 * platform/PlatformContentFilter.h:
678 * platform/cocoa/NetworkExtensionContentFilter.h:
679 * platform/cocoa/NetworkExtensionContentFilter.mm:
680 (WebCore::NetworkExtensionContentFilter::willSendRequest): Called responseReceived() if there was a redirectResponse.
681 Then called -[NEFilterSource willSendRequest:decisionHandler:].
682 * platform/cocoa/ParentalControlsContentFilter.h:
683 * platform/spi/cocoa/NEFilterSourceSPI.h: Added a #define for NEFilterSourceOptionsPageData.
684 * testing/MockContentFilter.cpp:
685 (WebCore::MockContentFilter::willSendRequest): Added support for willSendRequest.
686 * testing/MockContentFilter.h: Added decision points for AfterWillSendRequest and AfterRedirect.
687 * testing/MockContentFilterSettings.h:
688 * testing/MockContentFilterSettings.idl:
690 2015-04-05 Sungmann Cho <sungmann.cho@navercorp.com>
692 Remove DocumentLoader::requestURL().
693 https://bugs.webkit.org/show_bug.cgi?id=140001
695 Reviewed by Darin Adler.
697 No new tests, no behavior change.
699 * loader/DocumentLoader.cpp:
700 (WebCore::DocumentLoader::documentURL):
701 (WebCore::DocumentLoader::requestURL): Deleted.
702 * loader/DocumentLoader.h:
703 * loader/ResourceLoadNotifier.cpp:
704 (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
706 2015-04-05 Gyuyoung Kim <gyuyoung.kim@samsung.com>
708 Use constants of sqlite3 directly for status of SQL result in webdatabase
709 https://bugs.webkit.org/show_bug.cgi?id=143329
711 Reviewed by Darin Adler.
713 In webdatabase, it has used own constant vairables as well as using sqlite3 constants directly.
714 It causes to use if~else statement which consumes more cpu cycles compared to switch~case. This
715 patch makes to use constants of sqlite3. Additionally if~else statment is changed to switch~case
718 No new tests, no behavior changes.
720 * Modules/webdatabase/Database.cpp:
721 (WebCore::Database::performGetTableNames):
722 * Modules/webdatabase/DatabaseBackendBase.cpp:
723 (WebCore::retrieveTextResultFromDatabase):
724 (WebCore::setTextValueInDatabase):
725 (WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
726 * Modules/webdatabase/DatabaseTracker.cpp:
727 (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
728 (WebCore::DatabaseTracker::hasEntryForDatabase):
729 (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
730 (WebCore::DatabaseTracker::origins):
731 (WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
732 (WebCore::DatabaseTracker::detailsForNameAndOrigin):
733 (WebCore::DatabaseTracker::setDatabaseDetails):
734 (WebCore::DatabaseTracker::quotaForOriginNoLock):
735 (WebCore::DatabaseTracker::setQuota):
736 (WebCore::DatabaseTracker::addDatabase):
737 (WebCore::DatabaseTracker::deleteOrigin):
738 (WebCore::DatabaseTracker::deleteDatabase):
739 (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
740 (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
741 * Modules/webdatabase/SQLStatementBackend.cpp:
742 (WebCore::SQLStatementBackend::execute):
743 * Modules/webdatabase/SQLStatementBackend.h:
744 * Modules/webdatabase/SQLTransactionBackend.cpp:
745 (WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
746 Change to use a reference instead of a pointer in arguemnt of execute().
747 * loader/appcache/ApplicationCacheStorage.cpp:
748 (WebCore::ApplicationCacheStorage::loadCacheGroup):
749 (WebCore::ApplicationCacheStorage::loadManifestHostHashes):
750 (WebCore::ApplicationCacheStorage::cacheGroupForURL):
751 (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
752 (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
753 (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
754 (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
755 (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
756 (WebCore::ApplicationCacheStorage::verifySchemaVersion):
757 (WebCore::ApplicationCacheStorage::store):
758 (WebCore::ApplicationCacheStorage::storeUpdatedType):
759 (WebCore::ApplicationCacheStorage::ensureOriginRecord):
760 (WebCore::ApplicationCacheStorage::storeNewestCache):
761 (WebCore::ApplicationCacheStorage::loadCache):
762 (WebCore::ApplicationCacheStorage::remove):
763 (WebCore::ApplicationCacheStorage::getManifestURLs):
764 (WebCore::ApplicationCacheStorage::cacheGroupSize):
765 (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord):
766 (WebCore::ApplicationCacheStorage::checkForMaxSizeReached):
767 (WebCore::ApplicationCacheStorage::checkForDeletedResources):
768 (WebCore::ApplicationCacheStorage::flatFileAreaSize):
769 * loader/icon/IconDatabase.cpp:
770 (WebCore::IconDatabase::checkIntegrity):
771 (WebCore::IconDatabase::performURLImport):
772 (WebCore::IconDatabase::pruneUnretainedIcons):
773 (WebCore::readySQLiteStatement):
774 (WebCore::IconDatabase::setIconIDForPageURLInSQLDatabase):
775 (WebCore::IconDatabase::removePageURLFromSQLDatabase):
776 (WebCore::IconDatabase::getIconIDForIconURLFromSQLDatabase):
777 (WebCore::IconDatabase::addIconURLToSQLDatabase):
778 (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
779 (WebCore::IconDatabase::removeIconFromSQLDatabase):
780 (WebCore::IconDatabase::writeIconSnapshotToSQLDatabase):
781 * platform/sql/SQLiteDatabase.cpp:
782 (WebCore::SQLiteDatabase::setMaximumSize):
783 * platform/sql/SQLiteDatabase.h:
784 * platform/sql/SQLiteFileSystem.cpp:
785 (WebCore::SQLiteFileSystem::getFileNameForNewDatabase):
786 * platform/sql/SQLiteStatement.cpp:
787 (WebCore::SQLiteStatement::step):
788 (WebCore::SQLiteStatement::returnIntResults):
789 (WebCore::SQLiteStatement::returnInt64Results):
791 2015-04-05 Simon Fraser <simon.fraser@apple.com>
793 Remove "go ahead and" from comments
794 https://bugs.webkit.org/show_bug.cgi?id=143421
796 Reviewed by Darin Adler, Benjamin Poulain.
798 Remove the phrase "go ahead and" from comments where it doesn't add
799 anything (which is almost all of them).
801 * Modules/webdatabase/DatabaseTracker.cpp:
802 (WebCore::DatabaseTracker::deleteOriginLockFor):
803 * css/CSSFontFaceSrcValue.cpp:
804 (WebCore::CSSFontFaceSrcValue::isSupportedFormat):
805 * css/CSSPrimitiveValue.h:
806 * css/StyleResolver.cpp:
807 (WebCore::StyleResolver::styleForKeyframe):
808 (WebCore::StyleResolver::styleForPage):
809 (WebCore::StyleResolver::applyMatchedProperties):
810 * editing/ApplyStyleCommand.cpp:
811 (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
812 * loader/DocumentLoader.cpp:
813 (WebCore::DocumentLoader::detachFromFrame):
814 * loader/cache/CachedImage.cpp:
815 (WebCore::CachedImage::addIncrementalDataBuffer):
816 * loader/icon/IconDatabase.cpp:
817 (WebCore::IconDatabase::performURLImport):
818 * page/PageOverlay.cpp:
819 (WebCore::PageOverlay::fadeAnimationTimerFired):
820 * platform/ScrollView.cpp:
821 (WebCore::ScrollView::updateScrollbars):
822 (WebCore::ScrollView::scrollContents):
823 * platform/graphics/DisplayRefreshMonitor.cpp:
824 (WebCore::DisplayRefreshMonitor::create):
825 * platform/graphics/GraphicsContext.cpp:
826 * platform/graphics/mac/ComplexTextController.cpp:
827 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
828 * platform/network/HTTPParsers.cpp:
829 (WebCore::parseHTTPRefresh):
830 * rendering/RenderBlock.cpp:
831 (WebCore::RenderBlock::removeChild):
832 (WebCore::RenderBlock::layoutPositionedObjects):
833 (WebCore::RenderBlock::selectionGaps):
834 (WebCore::RenderBlock::blockSelectionGaps):
835 (WebCore::RenderBlock::absoluteRects):
836 (WebCore::RenderBlock::absoluteQuads):
837 (WebCore::RenderBlock::addFocusRingRects):
838 * rendering/RenderBlockFlow.cpp:
839 (WebCore::RenderBlockFlow::layoutBlockChild):
840 (WebCore::RenderBlockFlow::handleAfterSideOfBlock):
841 (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
842 (WebCore::RenderBlockFlow::insertFloatingObject):
843 (WebCore::RenderBlockFlow::addOverhangingFloats):
844 (WebCore::RenderBlockFlow::inlineSelectionGaps):
845 (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
846 * rendering/RenderBlockLineLayout.cpp:
847 (WebCore::RenderBlockFlow::appendRunsForObject):
848 * rendering/RenderBox.cpp:
849 (WebCore::RenderBox::positionLineBox):
850 (WebCore::RenderBox::sizesLogicalWidthToFitContent):
851 * rendering/RenderBoxModelObject.cpp:
852 (WebCore::RenderBoxModelObject::paintFillLayerExtended):
853 * rendering/RenderLayer.cpp:
854 (WebCore::RenderLayer::updateLayerPositions):
855 (WebCore::RenderLayer::hitTestLayer):
856 (WebCore::RenderLayer::calculateClipRects):
857 * rendering/RenderLayerModelObject.cpp:
858 (WebCore::RenderLayerModelObject::styleWillChange):
859 * rendering/RenderLineBoxList.cpp:
860 (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
861 * rendering/RenderTextLineBoxes.cpp:
862 (WebCore::RenderTextLineBoxes::dirtyRange):
863 * rendering/line/BreakingContext.h:
864 (WebCore::BreakingContext::handleOutOfFlowPositioned):
865 (WebCore::BreakingContext::handleText):
866 * rendering/line/LineBreaker.cpp:
867 (WebCore::LineBreaker::nextLineBreak):
868 * style/StyleResolveTree.cpp:
869 (WebCore::Style::resolveLocal):
870 * xml/XMLHttpRequestProgressEventThrottle.cpp:
871 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
872 * xml/parser/XMLDocumentParser.cpp:
873 (WebCore::XMLDocumentParser::append):
875 2015-04-04 Andy Estes <aestes@apple.com>
877 [Content Filtering] Blocked page is not always displayed when it should be
878 https://bugs.webkit.org/show_bug.cgi?id=143410
879 rdar://problem/20211099
881 Reviewed by Andreas Kling.
883 These tests now pass: contentfiltering/block-after-add-data.html
884 contentfiltering/block-after-response.html
886 There were several problems with how ContentFilter loaded replacement data:
887 (1) Replacement data was delivered to DocumentLoader as if it were the original document's data. This assumes
888 that the original data was a UTF-8 encoded HTML document, which is not always true. We had a way to reset
889 the encoding, but not the content type.
890 (2) Replacement data was never delivered when the filter blocks in DocumentLoader::responseReceived().
891 (3) The main resource load was cancelled before the replacement data could be rendered when the filter blocks
892 in DocumentLoader::dataReceived().
893 The result was that only when the load was blocked after DocumentLoader::notifyFinished() would the replacement
894 data be shown properly, and only when problem (1) wasn't occurring.
896 This patch addresses these issues by using the substitute data mechanism to deliver replacement data. By using
897 substitute data, we can ensure that the original load is cancelled at the earliest opportunity and that the
898 replacement data is loaded with the proper content type and encoding.
900 Accomplishing this required changing the way ContentFilter interacts with DocumentLoader. Instead of placing
901 ContentFilter hooks throughout DocumentLoader, this patch makes ContentFilter itself the client of the
902 CachedRawResource for the duration of the filtering. If the filter decides to allow the load, DocumentLoader
903 adds itself as a client causing CachedRawResource to deliver to it the response and buffered data. If the
904 filter decides to block the load, DocumentLoader schedules a substitute data load. An added benefit of this
905 approach is that ContentFilter can reuse CachedRawResource's original data buffer instead of keeping its own.
907 * loader/ContentFilter.cpp:
908 (WebCore::ContentFilter::createIfNeeded): Changed to take a DecisionFunction rather than a ResourceResponse and DocumentLoader.
909 (WebCore::ContentFilter::ContentFilter): Ditto.
910 (WebCore::ContentFilter::~ContentFilter): Removed ourself as a CachedRawResource client if needed.
911 (WebCore::ContentFilter::startFilteringMainResource): Became the client of the CachedRawResource in order to start the filtering process.
912 (WebCore::ContentFilter::unblockHandler): Returned the unblock handler.
913 (WebCore::ContentFilter::replacementData): Returned the replacement data.
914 (WebCore::ContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
915 (WebCore::ContentFilter::responseReceived): Called responseReceived() on each filter using forEachContentFilterUntilBlocked().
916 (WebCore::ContentFilter::dataReceived): Ditto for dataReceived().
917 (WebCore::ContentFilter::notifyFinished): Ditto for finishedLoading().
918 (WebCore::ContentFilter::forEachContentFilterUntilBlocked): For each filter that needs more data, called the function.
919 If the filter blocked the load, called didDecide() with State::Blocked.
920 If all filters allowed the load, called didDecide() with State::Allowed.
921 (WebCore::ContentFilter::didDecide): Set m_state and called m_decisionFunction().
922 (WebCore::ContentFilter::addData): Deleted.
923 (WebCore::ContentFilter::finishedAddingData): Deleted.
924 (WebCore::ContentFilter::needsMoreData): Deleted.
925 (WebCore::ContentFilter::didBlockData): Deleted.
926 (WebCore::ContentFilter::getReplacementData): Deleted.
927 * loader/ContentFilter.h:
928 (WebCore::ContentFilter::type):
929 * loader/DocumentLoader.cpp:
930 (WebCore::DocumentLoader::DocumentLoader): Called ContentFilter::createIfNeeded() if not loading substitute data.
931 (WebCore::DocumentLoader::finishedLoading): Removed old ContentFilter code.
932 (WebCore::DocumentLoader::responseReceived): Ditto.
933 (WebCore::DocumentLoader::commitData): Ditto.
934 (WebCore::DocumentLoader::dataReceived): Ditto.
935 (WebCore::DocumentLoader::detachFromFrame): Set m_contentFilter to nullptr.
936 (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClientIfFilterAllows() instead of
937 becoming m_mainResource's client.
938 (WebCore::DocumentLoader::clearMainResource): Set m_contentFilter to nullptr.
939 (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): If ContentFilter is initialized, called
940 ContentFilter::startFilteringMainResource(). Otherwise added ourself as a client of m_mainResource.
941 (WebCore::DocumentLoader::installContentFilterUnblockHandler): Added a helper for creating and notifying
942 FrameLoaderClient of the unblock handler.
943 (WebCore::DocumentLoader::contentFilterDidDecide): Set m_contentFilter to nullptr. If the content filter
944 allowed the load, then added ourself as the CachedRawResource's client. Otherwise, installed the unblock handler
945 and scheduled a substitute data load with the replacement data.
946 * loader/DocumentLoader.h:
947 * loader/FrameLoader.cpp:
948 (WebCore::FrameLoader::prepareForLoadStart): Removed call to PolicyChecker::prepareForLoadStart().
949 * loader/NavigationScheduler.cpp:
950 (WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Added a ScheduledNavigation subclass that
951 calls FrameLoader::load() with a FrameLoadRequest containing substitute data.
952 (WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Scheduled a substitute data load.
953 * loader/NavigationScheduler.h:
954 * loader/PolicyChecker.cpp:
955 (WebCore::PolicyChecker::checkNavigationPolicy): Reset m_contentFilterUnblockHandler if it couldn't handle the request.
956 (WebCore::PolicyChecker::prepareForLoadStart): Deleted.
957 * loader/PolicyChecker.h:
958 * platform/ContentFilterUnblockHandler.h:
959 (WebCore::ContentFilterUnblockHandler::unreachableURL):
960 (WebCore::ContentFilterUnblockHandler::setUnreachableURL):
961 (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Renamed to ContentFilter::urlScheme().
962 * platform/PlatformContentFilter.h:
963 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
964 (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Added a helper to wrap the unblock handler with an outer DecisionHandlerFunction.
965 (WebCore::ContentFilterUnblockHandler::encode): Added m_unreachableURL to the encoding.
966 (WebCore::ContentFilterUnblockHandler::decode): Ditto for the decoding.
967 (WebCore::ContentFilterUnblockHandler::canHandleRequest): Changed to call ContentFilter::urlScheme().
968 * platform/cocoa/NetworkExtensionContentFilter.h:
969 * platform/cocoa/NetworkExtensionContentFilter.mm:
970 (replacementDataFromDecisionInfo): Added a helper to extract replacement data from the decisionInfo dictionary.
971 (WebCore::NetworkExtensionContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
972 (WebCore::NetworkExtensionContentFilter::create): Created a new object.
973 (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Created a NEFilterSource immediately when using the modern API.
974 (WebCore::NetworkExtensionContentFilter::responseReceived): Created a NEFilterSource when using the legacy API.
975 Called -[NEFilterSource receivedResponse:decisionHandler:] when using the modern API.
976 (WebCore::NetworkExtensionContentFilter::addData): Stopped buffering the original data.
977 (WebCore::NetworkExtensionContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
978 (WebCore::NetworkExtensionContentFilter::canHandleResponse): Deleted.
979 (WebCore::createNEFilterSource): Deleted.
980 (WebCore::NetworkExtensionContentFilter::getReplacementData): Deleted.
981 * platform/cocoa/ParentalControlsContentFilter.h:
982 * platform/cocoa/ParentalControlsContentFilter.mm:
983 (WebCore::ParentalControlsContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
984 (WebCore::ParentalControlsContentFilter::create): Created a new object.
985 (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Initialized m_filterState to kWFEStateBuffering.
986 (WebCore::canHandleResponse): Added a helper to check if the response can be filtered.
987 (WebCore::ParentalControlsContentFilter::responseReceived): If !canHandleResponse(), set m_filterState to kWFEStateAllowed and return.
988 Otherwise created a new WebFilterEvaluator with the response.
989 (WebCore::ParentalControlsContentFilter::addData): Called updateFilterState().
990 (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
991 (WebCore::ParentalControlsContentFilter::needsMoreData): Changed to check m_filterState.
992 (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
993 (WebCore::ParentalControlsContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
994 (WebCore::ParentalControlsContentFilter::updateFilterState): Updated m_filterState by calling -[WebFilterEvaluator filterState].
995 (WebCore::ParentalControlsContentFilter::canHandleResponse): Deleted.
996 (WebCore::ParentalControlsContentFilter::getReplacementData): Deleted.
997 * platform/spi/cocoa/NEFilterSourceSPI.h:
998 * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
999 * testing/MockContentFilter.cpp:
1000 (WebCore::MockContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
1001 (WebCore::MockContentFilter::create): Created a new object.
1002 (WebCore::MockContentFilter::responseReceived): Called maybeDetermineStatus().
1003 (WebCore::MockContentFilter::addData): Stopped buffering the original data.
1004 (WebCore::MockContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1005 (WebCore::MockContentFilter::unblockHandler): Asserted that we blocked data.
1006 (WebCore::MockContentFilter::canHandleResponse): Deleted.
1007 (WebCore::MockContentFilter::MockContentFilter): Deleted.
1008 (WebCore::MockContentFilter::getReplacementData): Deleted.
1009 * testing/MockContentFilter.h:
1010 * testing/MockContentFilterSettings.cpp:
1011 (WebCore::MockContentFilterSettings::unblockRequestURL): Changed to use a StringBuilder.
1013 2015-04-04 Chris Fleizach <cfleizach@apple.com>
1015 AX: Heuristic: Avoid exposing an element as clickable if mouse event delegation is handled on an AXElement with more than one descendant AXElement
1016 https://bugs.webkit.org/show_bug.cgi?id=136247
1018 Reviewed by Mario Sanchez Prada.
1020 Modify the logic for determining whether an element supports the press action by trying to filter out objects being handled by event delegation.
1021 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
1022 it's using event delegation, and do not expose the press action.
1024 Test: platform/mac/accessibility/press-action-not-exposed-for-event-delegation.html
1026 * accessibility/AccessibilityObject.cpp:
1027 (WebCore::AccessibilityObject::supportsPressAction):
1029 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1031 More const in CSSToStyleMap
1032 https://bugs.webkit.org/show_bug.cgi?id=143409
1034 Reviewed by Andreas Kling.
1036 The CSSValues passed to CSSToStyleMap functions can mostly be treated
1037 as |const|, except for CSSImageValues which have special behavior.
1039 This makes it clearer what the inputs and outputs of these
1042 * css/CSSPrimitiveValue.cpp:
1043 (WebCore::CSSPrimitiveValue::computeDegrees):
1044 * css/CSSPrimitiveValue.h:
1045 (WebCore::CSSPrimitiveValue::computeTime):
1046 * css/CSSToStyleMap.cpp:
1047 (WebCore::CSSToStyleMap::mapFillAttachment):
1048 (WebCore::CSSToStyleMap::mapFillClip):
1049 (WebCore::CSSToStyleMap::mapFillComposite):
1050 (WebCore::CSSToStyleMap::mapFillBlendMode):
1051 (WebCore::CSSToStyleMap::mapFillOrigin):
1052 (WebCore::CSSToStyleMap::mapFillRepeatX):
1053 (WebCore::CSSToStyleMap::mapFillRepeatY):
1054 (WebCore::CSSToStyleMap::mapFillSize):
1055 (WebCore::CSSToStyleMap::mapFillXPosition):
1056 (WebCore::CSSToStyleMap::mapFillYPosition):
1057 (WebCore::CSSToStyleMap::mapFillMaskSourceType):
1058 (WebCore::CSSToStyleMap::mapAnimationDelay):
1059 (WebCore::CSSToStyleMap::mapAnimationDirection):
1060 (WebCore::CSSToStyleMap::mapAnimationDuration):
1061 (WebCore::CSSToStyleMap::mapAnimationFillMode):
1062 (WebCore::CSSToStyleMap::mapAnimationIterationCount):
1063 (WebCore::CSSToStyleMap::mapAnimationName):
1064 (WebCore::CSSToStyleMap::mapAnimationPlayState):
1065 (WebCore::CSSToStyleMap::mapAnimationProperty):
1066 (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
1067 (WebCore::CSSToStyleMap::mapAnimationTrigger):
1068 * css/CSSToStyleMap.h:
1070 2015-04-04 Dan Bernstein <mitz@apple.com>
1072 Tried to fix the build.
1074 * loader/icon/IconController.cpp:
1075 (WebCore::iconsFromLinkElements):
1077 2015-04-02 Darin Adler <darin@apple.com>
1079 Streamline icon-related code, mostly unused
1080 https://bugs.webkit.org/show_bug.cgi?id=143306
1082 Reviewed by Antti Koivisto.
1084 I started on this path because Document::iconURLs had a poor implementation,
1085 storing results in a data member with no benefit, using HTMLCollection for
1086 iteration of the children of the head element instead of using the simpler
1087 faster technique we use inside the engine. Then, I discovered this function was
1088 mostly-unused code left over from before the Blink fork. I removed most of it.
1089 We can add this back later if someone finds a use for it, but if we do we
1090 should do a higher quality implementation without the quirks of the old one.
1092 Refactoring also made it clear that logic isn't exactly sensible. There's a
1093 set of rules about what order to return the list in that is not followed by
1094 the code that tries to find the "default touch icon". Later we could add some
1095 more test coverage and tighten up the logic. But the reality is that at this
1096 time, with some small exceptions, icon logic is in the web browsers, not in WebKit.
1098 * CMakeLists.txt: Removed IconURL.cpp.
1099 * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1100 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1101 * WebCore.xcodeproj/project.pbxproj: Ditto.
1102 * dom/DOMAllInOne.cpp: Ditto.
1105 (WebCore::Document::evaluate): Tweaked formatting.
1106 (WebCore::Document::shortcutIconURLs): Removed. Unused function.
1107 (WebCore::Document::iconURLs): Removed. Moved code to IconController.
1108 (WebCore::Document::addIconURL): Removed. Moved code to LinkLoader.
1110 * dom/Document.h: Removed shortcutIconURLs, iconURLs, addIconURL,
1113 * dom/IconURL.cpp: Removed.
1114 * dom/IconURL.h: Removed everything from this header except for the
1115 IconType enum. Added a FIXME about possibly renaming the header.
1117 * html/HTMLLinkElement.cpp:
1118 (WebCore::HTMLLinkElement::HTMLLinkElement): Pass a reference when creating
1120 (WebCore::HTMLLinkElement::setDisabledState): Access members of the struct
1121 LinkRelElement without "m_" prefix.
1122 (WebCore::HTMLLinkElement::parseAttribute): Changed to use early return style,
1123 and made the part of this for parsing title use a more normal idiom.
1124 (WebCore::HTMLLinkElement::process): Removed many unneeded arguments, made the
1125 logic of the code a little easier to follow.
1126 (WebCore::HTMLLinkElement::removedFrom): Removed a call to a function that had
1128 (WebCore::HTMLLinkElement::iconType): Updated for change to LinkRelElement.
1129 (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
1130 * html/HTMLLinkElement.h: More of the same.
1132 * html/LinkRelAttribute.cpp:
1133 (WebCore::LinkRelAttribute::LinkRelAttribute): Initialize data members in the
1134 struct itself. Got rid of "m_" prefix since this is a struct, not a class.
1135 Changed code to use modern for loop; even better would be to eliminate the
1136 splitting into a vector entirely and use StringView (do that next time).
1137 * html/LinkRelAttribute.h: See above.
1139 * html/parser/HTMLPreloadScanner.cpp:
1140 (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
1141 Updated for chnages to LinkRelAttribute and give the local variable a clearer name.
1143 * loader/FrameLoader.cpp:
1144 (WebCore::FrameLoader::didChangeIcons): Removed.
1145 * loader/FrameLoader.h: Removed didChangeIcons.
1147 * loader/FrameLoaderClient.h: Added include for String since it's no longer
1148 taken care of by IconURLs.h.
1150 * loader/LinkLoader.cpp:
1151 (WebCore::LinkLoader::LinkLoader): Take a reference instead of a pointer.
1152 (WebCore::LinkLoader::linkLoadTimerFired): Use m_client reference instead of pointer.
1153 (WebCore::LinkLoader::linkLoadingErrorTimerFired): Ditto.
1154 (WebCore::LinkLoader::notifyFinished): Use nullptr.
1155 (WebCore::LinkLoader::loadLink): Tweak formatting. Move the dispatchDidChangeIcons
1156 call in here instead of going through Document to FrameLoader and then FrameLoader to
1157 FrameLoaderClient, and passing extra unused arguments, the way the old code did.
1158 Use a reference instead of a pointer for the document.
1159 (WebCore::LinkLoader::released): Removed. Empty function.
1161 * loader/LinkLoader.h: Changed constructor argument to be a reference. Made more
1162 things private. Removed empty released function.
1164 * loader/icon/IconController.cpp:
1165 (WebCore::IconController::IconController): Moved initialization of data members to
1166 the class definition in the header.
1167 (WebCore::iconsFromLinkElements): Added. This function replaces the existing
1168 Document::iconURLs function, but has a simpler implementation and interface.
1169 It focuses on exactly what the code in this file needs. If we want to add some
1170 more features to the icon controller we might make this more complex again.
1171 Even now, building a vector is not necessarily helpful; the only client of this
1172 function ends up extracting only one of the URLs this function returns.
1173 (WebCore::IconController::url): Rewrote this. It's the only function actually
1174 using the icon URLs. This contains a combination of the logic from the various
1175 functions in this class before, including iconURL, urlsForTypes, appendToIconURLs,
1176 and defaultURL. Among other improvements, replaced the unusual code to construct
1177 the icon URL with a call to Document::completeURL.
1178 (WebCore::IconController::startLoader): Refactored a bit to remove a local variable.
1179 (WebCore::IconController::continueLoadWithDecision): Ditto.
1181 * loader/icon/IconController.h: Removed unneeded includes, unneeded use of
1182 WTF_MAKE_NONCOPYABLE (since classes with data members of reference type are
1183 automatically noncopyable), unused fucntions. Also initialize m_waitingForLoadDecision.
1185 * testing/Internals.cpp:
1186 (WebCore::Internals::iconURLs): Removed.
1187 (WebCore::Internals::shortcutIconURLs): Left this in place since it is used by
1188 tests. Changed it to return the actual value from the IconController::url function,
1189 since that's the interface to our icon machinery that is actually exposed on some
1190 platforms. That means this returns only a single URL.
1191 (WebCore::Internals::allIconURLs): Removed.
1192 * testing/Internals.h: Removed allIconURLs and iconURLs.
1193 * testing/Internals.idl: Removed allIconURLs.
1195 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1197 Fix EFL and Gtk build.
1200 (WebCore::Document::didRemoveTouchEventHandler):
1202 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1204 Crash under Document::absoluteRegionForEventTargets on build.webkit.org/dashboard
1205 https://bugs.webkit.org/show_bug.cgi?id=143406
1206 rdar://problem/20407080
1208 Reviewed by Ryosuke Niwa.
1210 We failed to remove elements from Document's m_wheelEventTargets HashSet when the
1211 elements were destroyed with wheel handlers still on them. Fix by removing the
1212 node from the set via Node::willBeDeletedFrom().
1214 Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash.html
1215 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash.html
1216 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash.html
1219 (WebCore::removeHandlerFromSet): Helper to remove one or all handlers on the given node.
1220 (WebCore::Document::didRemoveWheelEventHandler): Add a parameter to specify whether we're
1221 removing all handlers on the given node.
1222 (WebCore::Document::didRemoveTouchEventHandler): Use removeHandlerFromSet().
1225 (WebCore::Node::willBeDeletedFrom): Tell the document we're removing all handlers
1228 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1230 REGRESSION (r182215): Feedly crashes when closing article
1231 https://bugs.webkit.org/show_bug.cgi?id=143405
1232 rdar://problem/20382734, rdar://problem/20395497
1234 Reviewed by Tim Horton.
1236 Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
1237 is bad, because it can cause FrameView::layout() to get called in the middle of
1238 RenderObject destruction, which leaves the render tree in a bad state.
1240 Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
1242 AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
1243 a flag to say that the non-fast region needs to be recomputed, and that schedules
1244 a scrolling tree commit. When the commit happens, we recompute the region. If the
1245 region didn't change, and no other changes are pending, there's no need to commit.
1247 Test: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html
1249 * page/scrolling/AsyncScrollingCoordinator.cpp:
1250 (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty):
1251 (WebCore::AsyncScrollingCoordinator::willCommitTree):
1252 (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
1253 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1254 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
1255 (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): Need to eagerly update
1256 the non-fast scrollable region.
1257 * page/scrolling/AsyncScrollingCoordinator.h:
1258 (WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty):
1259 * page/scrolling/ScrollingCoordinator.cpp:
1260 (WebCore::ScrollingCoordinator::ScrollingCoordinator):
1261 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1262 * page/scrolling/ScrollingCoordinator.h:
1263 (WebCore::ScrollingCoordinator::willCommitTree):
1264 * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1265 (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
1266 (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
1267 (WebCore::ScrollingCoordinatorMac::commitTreeState):
1269 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1271 Differentiate between composited scrolling, and async scrolling
1272 https://bugs.webkit.org/show_bug.cgi?id=143291
1274 Reviewed by Sam Weinig.
1276 ScrollableArea::usesCompositedScrolling() meant "uses aysnc scrolling", but
1277 FrameView::contentsInCompositedLayer() covered a related concept, that scrolling
1278 happens by moving compositing layers around.
1280 Make the difference between these more explicit by adding ScrollableArea::usesAsyncScrolling(),
1281 which means that scrolling for that ScrollableArea is asynchronous and managed
1282 by a ScrollingCoordinator. This is the meaning that ScrollingCoordinator::computeNonFastScrollableRegion()
1285 ScrollableArea::usesCompositedScrolling() is now repurposed to mean "scrolling
1286 occurs by moving layers around, not requiring repaint". FrameView::contentsInCompositedLayer()
1287 is renamed to usesCompositedScrolling(), and overrides the base class function.
1289 This only changes behavior in tests that call setScrollingTreeIncludesFrames(true).
1291 * page/FrameView.cpp:
1292 (WebCore::FrameView::useSlowRepaints):
1293 (WebCore::FrameView::usesCompositedScrolling):
1294 (WebCore::FrameView::usesAsyncScrolling):
1295 (WebCore::FrameView::scrollContentsFastPath):
1296 (WebCore::FrameView::scrollContentsSlowPath):
1297 (WebCore::FrameView::contentsInCompositedLayer): Deleted.
1299 * page/scrolling/ScrollingCoordinator.cpp:
1300 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1301 * platform/ScrollableArea.h:
1302 (WebCore::ScrollableArea::usesAsyncScrolling):
1303 * rendering/RenderLayer.cpp:
1304 (WebCore::RenderLayer::usesAsyncScrolling):
1305 * rendering/RenderLayer.h:
1307 2015-04-04 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1309 [Streams API] Collecting a ReadableStreamReader should not unlock its stream
1310 https://bugs.webkit.org/show_bug.cgi?id=143333
1312 Reviewed by Benjamin Poulain.
1314 This patch stores as a boolean whether the stream is locked to a reader.
1315 In case the reader forget to unlock the stream, the reader can be collected and destructor called.
1316 In that case, the link between reader and stream will be reset but the stream will remain in locked state.
1318 Covered by new test in streams/readablestreamreader-constructor.html.
1320 * Modules/streams/ReadableStream.h:
1321 (WebCore::ReadableStream::isLocked):
1322 (WebCore::ReadableStream::lock):
1323 (WebCore::ReadableStream::release):
1324 (WebCore::ReadableStream::releaseButKeepLocked): Introduced to cut the link between reader and stream but stil keeping the stream locked.
1325 * Modules/streams/ReadableStreamReader.cpp:
1326 (WebCore::ReadableStreamReader::~ReadableStreamReader):
1327 * bindings/js/JSReadableStreamCustom.cpp:
1328 (WebCore::JSReadableStream::getReader):
1329 * bindings/js/JSReadableStreamReaderCustom.cpp:
1330 (WebCore::constructJSReadableStreamReader):
1332 2015-04-03 Zan Dobersek <zdobersek@igalia.com>
1334 MediaDevices possesses a vtable despite using ImplementationLacksVTable IDL attribute
1335 https://bugs.webkit.org/show_bug.cgi?id=143367
1337 Reviewed by Eric Carlson.
1339 * Modules/mediastream/MediaDevices.idl: MediaDevices ends up with a vtable
1340 because of inheriting from ContextDestructionObserver. This collides with
1341 the ImplementationLacksVTable IDL attribute, causing compilation errors
1342 with Clang. Since MediaDevices isn't being inherited from, but will still
1343 end up with a vtable, the IDL attribute should be removed.
1345 2015-04-03 Alex Christensen <achristensen@webkit.org>
1347 [Content Extensions] Add memory reporting.
1348 https://bugs.webkit.org/show_bug.cgi?id=143386
1350 Reviewed by Benjamin Poulain.
1352 * contentextensions/CompiledContentExtension.cpp:
1353 (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
1354 * contentextensions/CompiledContentExtension.h:
1355 * contentextensions/ContentExtension.cpp:
1356 (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1357 * contentextensions/ContentExtension.h:
1358 * contentextensions/ContentExtensionsBackend.cpp:
1359 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1360 * contentextensions/ContentExtensionsDebugging.h:
1361 * contentextensions/DFABytecodeInterpreter.cpp:
1362 (WebCore::ContentExtensions::getBits):
1363 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1364 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1365 (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1366 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1367 * contentextensions/DFABytecodeInterpreter.h:
1368 (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
1369 (WebCore::ContentExtensions::DFABytecodeInterpreter::~DFABytecodeInterpreter):
1370 Keep track of which memory pages in the bytecode are being hit if CONTENT_EXTENSIONS_MEMORY_REPORTING is 1.
1371 When CONTENT_EXTENSIONS_MEMORY_REPORTING is 0, this makes an empty vector in ContentExtension
1372 and passes some pointers on the stack, many of which can be optimized out by the C++ compiler.
1374 2015-04-03 Brent Fulgham <bfulgham@apple.com>
1376 Expand test infrastructure to support scrolling tests
1377 https://bugs.webkit.org/show_bug.cgi?id=143383
1379 Reviewed by Darin Adler.
1381 No new tests: No change in behavior.
1383 This is an initial set of changes that clean up a few things I noticed while extending testing support
1384 for scroll animations and wheel event gestures.
1385 1. Reduce the amount of #ifdef code in EventHandler{Mac}.
1386 2. Consolidate the idea of an "End Gesture" in the PlatformWheelEvent class.
1387 3. Remove a number of unneeded null checks in EventHandler.
1388 4. ScrollController must always have a client, so hold a reference instead of using a pointer.
1390 * page/EventHandler.cpp:
1391 (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
1392 (WebCore::EventHandler::handleWheelEvent): Call 'platformNotifySnapIfNecessary' at method exit points.
1393 (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
1394 * page/EventHandler.h:
1395 * page/mac/EventHandlerMac.mm:
1396 (WebCore::EventHandler::platformCompleteWheelEvent): Remove unneeded null checks for 'view'. Remove
1397 CSS_SNAP-specific call to 'platformNotifySnapIfNecessary'. This logic is now handled in the new
1398 'platformNotifyIfEndGesture' method.
1399 (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
1400 (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
1401 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1402 (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Pass 'this' as
1403 reference to ScrollController constructor.
1404 * platform/PlatformWheelEvent.h:
1405 (WebCore::PlatformWheelEvent::shouldResetLatching): Call new 'isEndGesture' method.
1406 (WebCore::PlatformWheelEvent::isEndGesture): Added method to encapsulate some code that was duplicated
1407 in a number of places.
1408 * platform/ScrollAnimator.cpp:
1409 (WebCore::ScrollAnimator::ScrollAnimator): Pass 'this' as reference to ScrollController constructor.
1410 * platform/cocoa/ScrollController.h:
1411 * platform/cocoa/ScrollController.mm:
1412 (WebCore::ScrollController::ScrollController): Update to reflect m_client is now a reference.
1413 (WebCore::ScrollController::handleWheelEvent): Ditto.
1414 (WebCore::ScrollController::snapRubberBandTimerFired): Ditto. Also, a drive-by fix for ending rubberband
1415 snapping. This end-state wasn't deactivating the timer (even when the animation finished). This isn't a
1416 huge problem, but I (will) rely on the state of the animation timer in a future patch to decide if
1417 tests should run or continue waiting.
1418 (WebCore::ScrollController::isRubberBandInProgress): Ditto.
1419 (WebCore::ScrollController::startSnapRubberbandTimer): Ditto.
1420 (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
1421 (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
1422 (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Ditto.
1423 (WebCore::ScrollController::startScrollSnapTimer): Ditto.
1424 (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
1425 (WebCore::ScrollController::scrollSnapAnimationUpdate): Ditto.
1426 (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
1427 (WebCore::ScrollController::computeSnapDelta): Ditto.
1428 (WebCore::ScrollController::computeGlideDelta): Ditto.
1429 * platform/mac/ScrollAnimatorMac.mm:
1430 (WebCore::gestureShouldBeginSnap): Use new PlatformWheelEvent::isEndGesture() method.
1432 2015-04-03 Chris Fleizach <cfleizach@apple.com>
1434 AX: Toggling check box state not speaking using plain space, not VO space.
1435 https://bugs.webkit.org/show_bug.cgi?id=143356
1437 Reviewed by Darin Adler.
1439 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.
1441 Test: platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html
1443 * accessibility/mac/AXObjectCacheMac.mm:
1444 (WebCore::AXObjectCache::postPlatformNotification):
1446 2015-04-03 Zalan Bujtas <zalan@apple.com>
1448 Simple line layout: Use pre-computed simple line runs to produce innerText content.
1449 https://bugs.webkit.org/show_bug.cgi?id=143351
1451 Reviewed by Antti Koivisto.
1453 This is in preparation to cover <br> with simple line layout.
1454 Runs provide line layout information that can be used to cover hard line break cases.
1455 (similar to TextIterator::handleTextBox())
1457 Covered by existing tests.
1459 * editing/TextIterator.cpp:
1460 (WebCore::TextIterator::handleTextNode):
1461 (WebCore::TextIterator::emitCharacter):
1462 (WebCore::TextIterator::emitText):
1463 * editing/TextIterator.h:
1464 * rendering/SimpleLineLayoutResolver.h:
1465 (WebCore::SimpleLineLayout::RunResolver::Run::isEndOfLine):
1467 2015-04-03 Antti Koivisto <antti@apple.com>
1469 Add non-counting bloom filter class
1470 https://bugs.webkit.org/show_bug.cgi?id=143366
1472 Reviewed by Sam Weinig.
1474 * css/SelectorFilter.cpp:
1475 (WebCore::SelectorFilter::setupParentStack):
1476 * css/SelectorFilter.h:
1480 2015-04-03 Alex Christensen <achristensen@webkit.org>
1483 https://bugs.webkit.org/show_bug.cgi?id=143352
1485 Reviewed by Gyuyoung Kim.
1487 * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1488 (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
1489 * loader/EmptyClients.cpp:
1490 (WebCore::EmptyChromeClient::openDateTimeChooser): Deleted.
1491 * loader/EmptyClients.h:
1493 (WebCore::Chrome::openDateTimeChooser): Deleted.
1495 * page/ChromeClient.h:
1496 Remove ChromeClient::openDateTimeChooser.
1498 2015-04-03 Zan Dobersek <zdobersek@igalia.com>
1500 Unreviewed, fixing Clang builds of the GTK port on Linux.
1502 * Modules/mediastream/MediaDevices.h:
1503 Include the <functional> header for uses of std::function<>.
1505 2015-04-01 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1507 [Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
1508 https://bugs.webkit.org/show_bug.cgi?id=143130
1510 Reviewed by Benjamin Poulain.
1512 Introduce ReadableJSStream and ReadableJSStreamReader as subclasses of ReadableStream and ReadableStreamReader.
1513 These classes manage JS based sources: ReadableStream JS constructor instantiates ReadableJStream.
1514 These classes are expected to handle JS source specific handling, in particular JSValue error storage and JSValue chunk queue.
1515 Making ReadableStream and ReadableStreamReader abstract, to be subclassed for native sources.
1517 Current tests cover the changes.
1519 * Modules/streams/ReadableStream.cpp:
1520 (WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ease subclassing.
1521 (WebCore::ReadableStream::create): Deleted as ReadableStream is now abstarct.
1522 * Modules/streams/ReadableStream.h: Made createReader virtual pure.
1523 * Modules/streams/ReadableStream.idl: Skipping VTable validation as subclasses of ReadableStream may be JS wrapped.
1524 * Modules/streams/ReadableStreamReader.cpp: Removed ReadableStreamReader::create.
1525 * Modules/streams/ReadableStreamReader.h: Ditto.
1526 * Modules/streams/ReadableStreamReader.idl: Skipping VTable validation as subclasses of ReadableStreamReader may be JS wrapped.
1527 * bindings/js/JSReadableStreamCustom.cpp:
1528 (WebCore::constructJSReadableStream): Instantiating ReadableJSStream in lieu of ReadableStream within JS constructor.
1529 * bindings/js/ReadableStreamJSSource.cpp:
1530 (WebCore::ReadableJSStream::create):
1531 (WebCore::ReadableJSStream::createReader): Instantiating ReadableJSStreamReader.
1532 (WebCore::ReadableJSStream::ReadableJSStream):
1533 (WebCore::ReadableJSStreamReader::create):
1534 (WebCore::ReadableJSStreamReader::ReadableJSStreamReader):
1535 * bindings/js/ReadableStreamJSSource.h: Definition of ReadableJSStream and ReadableJSStreamReader.
1537 2015-04-02 Timothy Horton <timothy_horton@apple.com>
1539 Scrollbars are left in the wrong position when resizing a fixed layout view
1540 https://bugs.webkit.org/show_bug.cgi?id=143360
1542 Reviewed by Beth Dakin.
1544 Test: fast/fixed-layout/fixed-layout.html
1546 * platform/ScrollView.cpp:
1547 (WebCore::ScrollView::setFrameRect):
1548 Update scrollbars when the ScrollView frameRect changes. We were previously
1549 depending on the layout that always happens after this to update scrollbars,
1550 but with fixed layout mode, there won't be a layout! Also, FrameView's
1551 setFrameRect override will sync this scrollbar update with the scrollbar
1552 layers (via RenderLayerCompositor::frameViewDidChangeSize) immediately afterwards.
1554 * testing/Internals.cpp:
1555 (WebCore::Internals::resetToConsistentState):
1556 Turn off fixed layout when resetting state.
1558 (WebCore::Internals::setUseFixedLayout):
1559 (WebCore::Internals::setFixedLayoutSize):
1560 * testing/Internals.h:
1561 * testing/Internals.idl:
1562 Add internals functions to set the fixed layout size and to turn on fixed layout.
1564 2015-04-02 Brady Eidson <beidson@apple.com>
1566 Unreviewed: Reapplied Change after rollout.
1568 Expose the "Share" menu for text selections on platforms where it's available.
1569 rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
1571 * page/ContextMenuClient.h:
1572 (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
1574 * page/ContextMenuContext.h:
1575 (WebCore::ContextMenuContext::setSelectedText):
1576 (WebCore::ContextMenuContext::selectedText):
1578 * page/ContextMenuController.cpp:
1579 (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
1580 (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1582 * platform/ContextMenuItem.cpp:
1583 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1585 * platform/ContextMenuItem.h:
1586 (WebCore::ContextMenuItem::supportsShareMenu):
1588 * platform/gtk/ContextMenuItemGtk.cpp:
1589 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1591 * platform/mac/ContextMenuItemMac.mm:
1592 (WebCore::ContextMenuItem::releasePlatformDescription):
1593 (WebCore::ContextMenuItem::getPlatformDescription):
1594 (WebCore::ContextMenuItem::supportsShareMenu):
1595 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
1597 * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
1599 2015-04-02 Commit Queue <commit-queue@webkit.org>
1601 Unreviewed, rolling out r182293.
1602 https://bugs.webkit.org/show_bug.cgi?id=143355
1604 Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
1608 "Expose the "Share" menu for text selections on platforms
1609 where it's available."
1610 https://bugs.webkit.org/show_bug.cgi?id=143318
1611 http://trac.webkit.org/changeset/182293
1613 2015-04-02 Brent Fulgham <bfulgham@apple.com>
1615 REGRESSION: Caption Menus show language codes instead of display names.
1616 https://bugs.webkit.org/show_bug.cgi?id=143350
1617 <rdar://problem/20094145>
1619 Reviewed by Jer Noble.
1621 The generic caption/track label handling in CaptionUserPreferences does not convert language codes
1622 (e.g. 'fr-CA') into display names (e.g., 'French (Canada)'). Because we did not have an AudioTrack
1623 override to process these types of menu items, they were being handled using the generic code.
1625 * page/CaptionUserPreferencesMediaAF.cpp:
1626 (WebCore::buildStringForTrackBase): Helper function to share code with the two flavors
1627 of 'trackDisplayName'.
1628 (WebCore::trackDisplayName): Add a version to support AudioTracks, and modify the TextTrack
1629 version to use the new 'buildStringForTrackBase' function.
1630 (WebCore::CaptionUserPreferencesMediaAF::displayNameForTrack): Add an AudioTrack override so
1631 our AVFoundation tracks are processed in our CaptionUserPreferencesMediaAF implementation, not the
1633 (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Add an AudioTrack override so
1634 that the menu items are sorted in order of display name, not language code.
1635 * page/CaptionUserPreferencesMediaAF.h:
1637 2015-04-02 Brady Eidson <beidson@apple.com>
1639 Expose the "Share" menu for text selections on platforms where it's available.
1640 rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
1642 Reviewed by Sam Weinig.
1644 * page/ContextMenuClient.h:
1645 (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
1647 * page/ContextMenuContext.h:
1648 (WebCore::ContextMenuContext::setSelectedText):
1649 (WebCore::ContextMenuContext::selectedText):
1651 * page/ContextMenuController.cpp:
1652 (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
1653 (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1655 * platform/ContextMenuItem.cpp:
1656 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1658 * platform/ContextMenuItem.h:
1659 (WebCore::ContextMenuItem::supportsShareMenu):
1661 * platform/gtk/ContextMenuItemGtk.cpp:
1662 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
1664 * platform/mac/ContextMenuItemMac.mm:
1665 (WebCore::ContextMenuItem::releasePlatformDescription):
1666 (WebCore::ContextMenuItem::getPlatformDescription):
1667 (WebCore::ContextMenuItem::supportsShareMenu):
1668 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
1670 * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
1672 2015-04-02 Jer Noble <jer.noble@apple.com>
1674 [Mac] Only pass in the AVURLAssetClientBundleIdentifierKey on iOS.
1675 https://bugs.webkit.org/show_bug.cgi?id=143347
1677 Reviewed by Brent Fulgham.
1679 Only pass in the main app bundle id into AVURLAsset via the AVURLAssetClientBundleIdentifierKey option
1680 on iOS. On OS X, setting this key can cause media playback to fail.
1682 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1683 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1685 2015-04-02 Roger Fong <roger_fong@apple.com>
1687 Show audio media controls on OSX.
1688 https://bugs.webkit.org/show_bug.cgi?id=143346.
1689 <rdar://problem/20306240>
1691 Reviewed by Dean Jackson.
1693 * Modules/mediacontrols/mediaControlsApple.css:
1694 (audio::-webkit-media-controls-panel:hover):
1695 Revert part of r180893.
1697 2015-04-02 Myles C. Maxfield <mmaxfield@apple.com>
1699 Disallow ruby base from having leading or trailing expansions
1700 https://bugs.webkit.org/show_bug.cgi?id=142608
1702 Reviewed by David Hyatt.
1704 If we determine that a ruby base should have either a leading or trailing expansion,
1705 we shunt that expansion over to the neighboring RenderText, assuming one exists. This
1706 requires that we teach RenderText how to force leading or trailing expansions if one
1707 wouldn't naturally be present.
1709 Tests: fast/ruby/ruby-expansion-cjk-2.html
1710 fast/ruby/ruby-expansion-cjk-3.html
1711 fast/ruby/ruby-expansion-cjk-4.html
1712 fast/ruby/ruby-expansion-cjk-5.html
1713 fast/ruby/ruby-expansion-cjk.html
1715 * rendering/InlineFlowBox.cpp:
1716 (WebCore::InlineFlowBox::removeChild): Delete contentIsKnownToFollow.
1717 * rendering/InlineTextBox.cpp:
1718 (WebCore::InlineTextBox::expansionBehavior): Support forced leading and trailing
1720 * rendering/InlineTextBox.h:
1721 (WebCore::InlineTextBox::expansionBehavior): Moved to .cpp
1722 * rendering/RenderBlockLineLayout.cpp:
1723 (WebCore::RenderBlockFlow::updateRubyForJustifiedText): Perform relayout even if
1724 there are no expansions left. This is so that ruby bases with no expansions will get
1726 (WebCore::expansionBehaviorForInlineTextBox): Update to inspect neighboring rubies.
1727 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): Use updated
1728 expansionBehaviorForInlineTextBox(). Also center ruby bases if they have no expansion
1730 (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns): Use nullptr.
1731 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Ditto.
1732 * rendering/RenderText.cpp:
1733 (WebCore::RenderText::RenderText): Delete contentIsKnownToFollow.
1734 * rendering/RenderText.h:
1735 (WebCore::RenderText::contentIsKnownToFollow): Deleted.
1736 (WebCore::RenderText::setContentIsKnownToFollow): Deleted.
1738 2015-04-02 Alexey Proskuryakov <ap@apple.com>
1740 Clean up access checks in JSHistoryCustom.cpp
1741 https://bugs.webkit.org/show_bug.cgi?id=143227
1743 Reviewed by Sam Weinig.
1745 * bindings/js/JSHistoryCustom.cpp:
1746 (WebCore::JSHistory::putDelegate):
1747 (WebCore::JSHistory::deleteProperty):
1748 (WebCore::JSHistory::deletePropertyByIndex):
1749 (WebCore::JSHistory::getOwnPropertyNames):
1750 (WebCore::JSHistory::pushState):
1751 (WebCore::JSHistory::replaceState):
1753 2015-04-02 Alex Christensen <achristensen@webkit.org>
1755 [Content Extensions] Only add unique universal action locations.
1756 https://bugs.webkit.org/show_bug.cgi?id=143325
1758 Reviewed by Benjamin Poulain.
1760 * contentextensions/ContentExtensionCompiler.cpp:
1761 (WebCore::ContentExtensions::compileRuleList):
1762 Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
1764 2015-04-01 Roger Fong <roger_fong@apple.com>
1766 Fix slider colors for media controls on OSX.
1767 https://bugs.webkit.org/show_bug.cgi?id=143328.
1768 <rdar://problem/20357858>
1770 Reviewed by Darin Adler.
1772 Fill in bottom portion of volume slider.
1773 Adjust colors to make slider controls look better. Will likely be tweaked later.
1774 * Modules/mediacontrols/mediaControlsApple.js:
1775 (Controller.prototype.drawTimelineBackground):
1776 (Controller.prototype.drawVolumeBackground):
1778 2015-04-02 Yusuke Suzuki <utatane.tea@gmail.com>
1780 Clean up EnumerationMode to easily extend
1781 https://bugs.webkit.org/show_bug.cgi?id=143276
1783 Reviewed by Geoffrey Garen.
1785 Use default EnumerationMode().
1787 * bindings/js/Dictionary.cpp:
1788 (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
1789 (WebCore::Dictionary::getOwnPropertyNames):
1790 * bindings/js/SerializedScriptValue.cpp:
1791 (WebCore::CloneSerializer::serialize):
1792 * bindings/scripts/CodeGeneratorJS.pm:
1794 * bindings/scripts/test/JS/JSFloat64Array.h:
1795 * bindings/scripts/test/JS/JSTestEventTarget.h:
1796 * bridge/NP_jsobject.cpp:
1798 * bridge/runtime_array.cpp:
1799 (JSC::RuntimeArray::getOwnPropertyNames):
1801 2015-04-02 David Hyatt <hyatt@apple.com>
1803 [New Block-Inside-Inline Model] Implement the correct paint order for blocks inside inlines.
1804 https://bugs.webkit.org/show_bug.cgi?id=143320
1806 Reviewed by Darin Adler.
1808 Added new tests in fast/block/inside-inlines.
1810 * rendering/EllipsisBox.cpp:
1811 (WebCore::EllipsisBox::nodeAtPoint):
1812 * rendering/EllipsisBox.h:
1813 * rendering/InlineBox.h:
1814 * rendering/InlineElementBox.cpp:
1815 (WebCore::InlineElementBox::paint):
1816 (WebCore::InlineElementBox::nodeAtPoint):
1817 * rendering/InlineElementBox.h:
1818 * rendering/InlineFlowBox.cpp:
1819 (WebCore::InlineFlowBox::nodeAtPoint):
1820 (WebCore::InlineFlowBox::paint):
1821 * rendering/InlineFlowBox.h:
1822 * rendering/InlineTextBox.cpp:
1823 (WebCore::InlineTextBox::nodeAtPoint):
1824 * rendering/InlineTextBox.h:
1825 The HitTestAction has to be passed to nodeAtPoint so that hit test actions can be honored. All the nodeAtPoint
1826 functions have been patched to include this argument. Painting and hit testing have been patched for InlineElementBox
1827 to honor phases/actions when the element is an anonymous inline block.
1829 The phase filter on RenderLineBoxList has been pushed in to InlineFlowBox::paint and InlineFlowBox::nodeAtPoint so that
1830 we can respect it properly when inlines are painting by themselves (e.g., because they have a layer).
1832 * rendering/RenderBlockLineLayout.cpp:
1833 (WebCore::RenderBlockFlow::createLineBoxes):
1834 (WebCore::RenderBlockFlow::constructLine):
1835 Go ahead and include all of the inline flow boxes between the root and the anonymous inline block if it turns out they
1836 need to be constructed. This will end up being relevant for outlines and for self-painting layers (e.g., opacity).
1838 * rendering/RenderLineBoxList.cpp:
1839 (WebCore::RenderLineBoxList::paint):
1840 (WebCore::RenderLineBoxList::hitTest):
1841 Remove the filters here, since they get pushed in to InlineFlowBox.
1843 * rendering/RootInlineBox.cpp:
1844 (WebCore::RootInlineBox::nodeAtPoint):
1845 * rendering/RootInlineBox.h:
1846 * rendering/svg/SVGInlineTextBox.cpp:
1847 (WebCore::SVGInlineTextBox::nodeAtPoint):
1848 * rendering/svg/SVGInlineTextBox.h:
1849 More patching to pass the HitTestAction into nodeAtPoint.
1851 2015-04-02 Adam Bergkvist <adam.bergkvist@ericsson.com>
1853 WebRTC: Add support for Promise-based MediaDevices.getUserMedia()
1854 https://bugs.webkit.org/show_bug.cgi?id=143255
1856 Reviewed by Eric Carlson.
1858 The MediaDevices object collects functionality related to local media
1859 devices. This patch adds the Promise-based version of getUserMedia()
1860 (unprefixed). Other functionality, like enumerateDevices(), will be
1861 added in later patches.
1863 The old callback-based webkitGetUserMedia() (on Navigator) is kept for
1864 legacy purposes (according to the Media Capture and Streams API spec [1]).
1865 Both versions of getUserMedia are backed up by UserMediaRequest where
1866 the callbacks from the callback-based version are wrapped inside c++
1867 lambda functions. The new Promise-based getUserMedia() uses the lambda
1868 functions directly as created by the Promise bindings.
1870 [1] http://w3c.github.io/mediacapture-main/archives/20150324/getusermedia.html#navigatorusermedia-interface-extensions
1872 Test: fast/mediastream/MediaDevices-getUserMedia.html
1875 * DerivedSources.make:
1876 * Modules/mediastream/MediaDevices.cpp: Added.
1877 (WebCore::MediaDevices::create):
1878 (WebCore::MediaDevices::MediaDevices):
1879 (WebCore::MediaDevices::~MediaDevices):
1880 (WebCore::MediaDevices::document):
1881 (WebCore::MediaDevices::getUserMedia):
1882 * Modules/mediastream/MediaDevices.h: Added.
1883 * Modules/mediastream/MediaDevices.idl: Added.
1884 * Modules/mediastream/NavigatorMediaDevices.cpp: Added.
1885 (WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
1886 (WebCore::NavigatorMediaDevices::~NavigatorMediaDevices):
1887 (WebCore::NavigatorMediaDevices::from):
1888 (WebCore::NavigatorMediaDevices::mediaDevices):
1889 (WebCore::NavigatorMediaDevices::supplementName):
1890 * Modules/mediastream/NavigatorMediaDevices.h: Added.
1891 * Modules/mediastream/NavigatorMediaDevices.idl: Added.
1892 * Modules/mediastream/UserMediaRequest.cpp:
1893 (WebCore::UserMediaRequest::create):
1894 (WebCore::UserMediaRequest::UserMediaRequest):
1895 (WebCore::UserMediaRequest::didCreateStream):
1896 (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
1897 (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
1898 * Modules/mediastream/UserMediaRequest.h:
1899 * PlatformGTK.cmake:
1900 * WebCore.xcodeproj/project.pbxproj:
1901 * bindings/js/JSMediaDevicesCustom.cpp: Added.
1902 (WebCore::JSMediaDevices::getUserMedia):
1904 2015-04-02 Eric Carlson <eric.carlson@apple.com>
1906 [iOS] Fix AirPlay problem caused by r182240
1907 https://bugs.webkit.org/show_bug.cgi?id=143337
1909 Reviewed by Jer Noble.
1911 * html/HTMLMediaSession.cpp:
1912 (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return false if the legacy attribute
1913 "x-webkit-airplay" has the value "allow".
1914 * html/HTMLVideoElement.cpp:
1915 (WebCore::HTMLVideoElement::parseAttribute): Don't call webkitWirelessVideoPlaybackDisabled when
1916 processing "x-webkit-airplay" and "x-webkit-wirelessvideoplaybackdisabled", just consider
1917 the attribute/value.
1919 2015-04-02 Commit Queue <commit-queue@webkit.org>
1921 Unreviewed, rolling out r182265.
1922 https://bugs.webkit.org/show_bug.cgi?id=143338
1924 Caused an assertion on
1925 http/tests/contentextensions/whitelist.html (Requested by ap
1930 "[Content Extensions] Only add unique universal action
1932 https://bugs.webkit.org/show_bug.cgi?id=143325
1933 http://trac.webkit.org/changeset/182265
1935 2015-04-01 Antti Koivisto <antti@apple.com>
1937 Use std::chrono types to represent time in response and cache classes
1938 https://bugs.webkit.org/show_bug.cgi?id=143316
1940 Reviewed by Andreas Kling.
1942 Use std::chrono::system_clock::time_point to represent clock times and std::chrono::microseconds to
1943 represent durations. Also use WTF::Optional for optional values (instead of coding them as NaNs).
1946 (WebCore::Document::lastModified):
1947 * loader/cache/CachedResource.cpp:
1948 (WebCore::CachedResource::CachedResource):
1949 (WebCore::CachedResource::freshnessLifetime):
1950 (WebCore::CachedResource::responseReceived):
1951 (WebCore::CachedResource::updateResponseAfterRevalidation):
1952 * loader/cache/CachedResource.h:
1953 * platform/network/CacheValidation.cpp:
1954 (WebCore::computeCurrentAge):
1955 (WebCore::computeFreshnessLifetimeForHTTPFamily):
1956 (WebCore::updateRedirectChainStatus):
1957 (WebCore::redirectChainAllowsReuse):
1958 (WebCore::parseCacheControlDirectives):
1959 * platform/network/CacheValidation.h:
1960 (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
1961 * platform/network/HTTPParsers.cpp:
1962 (WebCore::parseHTTPDate):
1963 (WebCore::parseDate): Deleted.
1964 * platform/network/HTTPParsers.h:
1965 * platform/network/ResourceResponseBase.cpp:
1966 (WebCore::ResourceResponseBase::ResourceResponseBase):
1967 (WebCore::ResourceResponseBase::cacheControlMaxAge):
1968 (WebCore::parseDateValueInHeader):
1969 (WebCore::ResourceResponseBase::date):
1970 (WebCore::ResourceResponseBase::age):
1971 (WebCore::ResourceResponseBase::expires):
1972 (WebCore::ResourceResponseBase::lastModified):
1973 * platform/network/ResourceResponseBase.h:
1975 2015-04-02 Joonghun Park <jh718.park@samsung.com>
1977 [CSS MultiColumn] Parse "columns: auto <length>" shorthand property value properly
1978 https://bugs.webkit.org/show_bug.cgi?id=143248
1980 Reviewed by Darin Adler.
1982 Test: fast/multicol/columns-shorthand-parsing-2.html
1984 The two longhands for the 'columns' property ('column-count' and
1985 'column-width') may both take 'auto' as a value. When we encounter
1986 'auto' during parsing the value list of a declaration, we cannot just
1987 make a guess at which property/properties that's meant for. Instead,
1988 don't assign anything to 'auto' right away, but wait until all values
1989 have been processed and at that point set the still unassigned
1990 properties to 'auto'. If 'auto' isn't in the value list at all, set
1991 unassigned properties to 'initial' for the 'columns' property, just
1992 like we do for any other property.
1994 * css/CSSParser.cpp:
1995 (WebCore::CSSParser::parseValue):
1996 (WebCore::CSSParser::parseColumnWidth):
1997 (WebCore::CSSParser::parseColumnCount):
1998 (WebCore::CSSParser::parseColumnsShorthand):
2001 2015-04-01 Commit Queue <commit-queue@webkit.org>
2003 Unreviewed, rolling out r182247.
2004 https://bugs.webkit.org/show_bug.cgi?id=143326
2006 unfortunately broke some tests (Requested by dino on #webkit).
2010 "Async loading of image resources"
2011 https://bugs.webkit.org/show_bug.cgi?id=134488
2012 http://trac.webkit.org/changeset/182247
2014 2015-04-01 Alex Christensen <achristensen@webkit.org>
2016 [Content Extensions] Only add unique universal action locations.
2017 https://bugs.webkit.org/show_bug.cgi?id=143325
2019 Reviewed by Benjamin Poulain.
2021 * contentextensions/ContentExtensionCompiler.cpp:
2022 (WebCore::ContentExtensions::compileRuleList):
2023 Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
2025 2015-04-01 Roger Fong <roger_fong@apple.com>
2027 Fixes to material of inline media controls on OSX.
2028 https://bugs.webkit.org/show_bug.cgi?id=143317
2029 <rdar://problem/20357847>
2031 Reviewed by Dean Jackson.
2033 There are many existing tests for the media controls appearance.
2034 They are currently skipped while we are still updating the controls.
2036 Expand backgrounds of control panel and volume box.
2037 Clip the darker edges away.
2038 * Modules/mediacontrols/mediaControlsApple.css:
2039 (audio::-webkit-media-controls-panel):
2040 (audio::-webkit-media-controls-panel-background-container):
2041 (audio::-webkit-media-controls-panel-tint):
2042 (audio::-webkit-media-controls-panel-background):
2043 (audio::-webkit-media-controls-panel .volume-box):
2044 (audio::-webkit-media-controls-volume-slider-container-background):
2045 (audio::-webkit-media-controls-volume-slider-container-tint):
2046 (audio::-webkit-media-controls-panel .volume-box:active):
2047 (video::-webkit-media-controls-volume-slider):
2048 This needs to be above the background so it can be interacted with.
2049 (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
2050 * Modules/mediacontrols/mediaControlsApple.js:
2051 (Controller.prototype.createControls): Create a new div for the control material.
2052 We need to clip the material and not the controls themselves.
2053 (Controller.prototype.configureInlineControls): Use new div.
2054 Remove some unnecessary logic involving hiding materials here.
2055 It just causes the materials to turn on and off at the wrong times.
2056 (Controller.prototype.handlePanelTransitionEnd):
2057 (Controller.prototype.setPlaying):
2058 (Controller.prototype.showControls):
2059 (Controller.prototype.hideControls):
2061 2015-04-01 Eric Carlson <eric.carlson@apple.com>
2063 Media controls should not always auto-hide
2064 https://bugs.webkit.org/show_bug.cgi?id=143322
2066 Reviewed by Dean Jackson.
2068 * Modules/mediacontrols/mediaControlsApple.js:
2069 (Controller): Intialize new properties.
2070 (Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
2071 (Controller.prototype.controlsAlwaysVisible): New.
2072 (Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
2073 (Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
2074 (Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
2075 and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
2076 use them frequently.
2077 * Modules/mediacontrols/mediaControlsiOS.js:
2078 (ControllerIOS.prototype.controlsAlwaysVisible): New.
2079 * platform/graphics/MediaPlaybackTarget.h:
2081 2015-04-01 Alexey Proskuryakov <ap@apple.com>
2083 REGRESSION (r182121): SVG animation macros cause warnings in MSVC
2084 https://bugs.webkit.org/show_bug.cgi?id=143313
2086 Reviewed by Darin Adler.
2088 * svg/SVGExternalResourcesRequired.h: Undo the change that caused a type mismatch.
2090 2015-04-01 Eric Carlson <eric.carlson@apple.com>
2092 Another attempt to fixi the iOS build after r182240.
2094 Reviewed by Dean Jackson.
2096 * platform/graphics/MediaPlaybackTarget.h:
2097 (WebCore::MediaPlaybackTarget::hasActiveRoute):
2099 2015-04-01 Eric Carlson <eric.carlson@apple.com>
2101 Fix the iOS build after r182240.
2103 * platform/graphics/MediaPlaybackTarget.h:
2105 2015-04-01 Yoav Weiss <yoav@yoav.ws>
2107 Async loading of image resources
2108 https://bugs.webkit.org/show_bug.cgi?id=134488
2110 Reviewed by Dean Jackson.
2112 This patch changes image loading to be asynchronous (per spec), in order
2113 for it to be agnostic to property setting order when it comes to src, srcset and crossorigin,
2114 as well as to enable future hooking of the <picture>-based selection logic on top of it.
2116 Tests: fast/dom/HTMLImageElement/image-load-post-onload.html
2117 fast/dom/HTMLImageElement/sizes/image-sizes-js-change-reverse.html
2119 * WebCore.xcodeproj/project.pbxproj: Change MicroTask.h to be private.
2120 * bindings/js/JSEventListener.cpp:
2121 (WebCore::JSEventListener::handleEvent): Add a microtask checkpoint after event handling.
2122 * bindings/js/ScheduledAction.cpp:
2123 (WebCore::ScheduledAction::execute): Add a microtask checkpoint after running of a scheduled action.
2124 * html/HTMLImageElement.cpp:
2125 (WebCore::HTMLImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2126 * html/HTMLImageLoader.cpp:
2127 (WebCore::HTMLImageLoader::notifyFinished): Avoid a crash when notifyFinished is called and there's no CachedImage.
2128 * html/HTMLInputElement.cpp:
2129 (WebCore::HTMLInputElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2130 * html/HTMLPlugInImageElement.cpp:
2131 (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2132 * html/HTMLVideoElement.cpp:
2133 (WebCore::HTMLVideoElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2134 * html/parser/HTMLDocumentParser.cpp:
2135 (WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd): Add a microtask checkpoint.
2136 * loader/ImageLoader.cpp: Move image resource loading to be asynchronous.
2137 (WebCore::ImageLoader::ImageLoaderTask::create):
2138 (WebCore::ImageLoader::ImageLoaderTask::run): Run the image loading microtask and called doUpdateFromElement.
2139 (WebCore::ImageLoader::ImageLoaderTask::ImageLoaderTask):
2140 (WebCore::ImageLoader::ImageLoader):
2141 (WebCore::ImageLoader::doUpdateFromElement): This is split from the previous updateFromElement, and performs the actual resource loading.
2142 (WebCore::ImageLoader::updateFromElement): Now only prepares the stage for the actual image resource loading.
2143 (WebCore::ImageLoader::shouldLoadImmediately): If this returns true, the image resource is loaded immediately, without queueing a microtask.
2144 (WebCore::ImageLoader::notifyFinished): Add asserts.
2145 (WebCore::ImageLoader::elementDidMoveToNewDocument): Handle document load event counters decrementing and incrementing.
2146 * loader/ImageLoader.h:
2147 (WebCore::ImageLoader::imageComplete): Make sure that the image is complete only if there aren't any pending tasks.
2148 (WebCore::ImageLoader::hasPendingActivity): Make sure that pending activity takes pending tasks into account.
2149 (WebCore::ImageLoader::hasPendingTask): Getter to know if an ImageLoader has a pending task. (Used by the image loading microtask)
2150 (WebCore::ImageLoader::createWeakPtr): Create a weakPtr to be used by the microtask, so it can called back the loader if it's still alive.
2151 * loader/cache/CachedResourceLoader.cpp:
2152 (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
2153 (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2154 (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2155 * loader/cache/CachedResourceLoader.h:
2156 (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
2157 (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2158 (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2159 * svg/SVGImageElement.cpp:
2160 (WebCore::SVGImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2161 * xml/parser/XMLDocumentParser.cpp:
2162 (WebCore::XMLDocumentParser::end): Add a microtask checkpoint after XML finishes parsing.
2164 2015-04-01 Alex Christensen <achristensen@webkit.org>
2166 Unreviewed build fix when using content extensions performance reporting.
2168 * contentextensions/ContentExtensionCompiler.cpp:
2169 (WebCore::ContentExtensions::compileRuleList):
2170 Time how long it takes to build the DFAs.
2172 2015-04-01 Alex Christensen <achristensen@webkit.org>
2174 Progress towards CMake on Windows and Mac.
2175 https://bugs.webkit.org/show_bug.cgi?id=143293
2177 Reviewed by Filip Pizlo.
2179 * PlatformMac.cmake:
2180 Tell open source builders where to find unicode headers.
2181 * PlatformWin.cmake:
2182 Include PlatformWinCairo.cmake.
2183 * PlatformWinCairo.cmake:
2184 Added from bug 115944 by Patrick Gansterer.
2185 * bindings/js/JSDOMStringListCustom.cpp:
2186 * bindings/js/JSDOMWrapper.cpp:
2187 * bindings/js/JSMessageChannelCustom.cpp:
2188 * bindings/js/JSPopStateEventCustom.cpp:
2189 * bindings/js/JSReadableStreamCustom.cpp:
2190 * bindings/js/ReadableStreamJSSource.cpp:
2191 * bindings/js/ScriptController.cpp:
2192 * css/CSSComputedStyleDeclaration.cpp:
2194 * dom/CollectionIndexCache.cpp:
2195 * platform/graphics/ANGLEWebKitBridge.h:
2196 Fixed include quirks.
2198 2015-03-31 Simon Fraser <simon.fraser@apple.com>
2200 Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
2201 https://bugs.webkit.org/show_bug.cgi?id=143288
2202 rdar://problem/16049624
2204 Reviewed by Beth Dakin.
2206 Remove the wheel event counting that Document does, and passes into the scrolling tree.
2207 The ScrollingTree now just uses the non-fast scrollable region to determine when to
2208 fast scroll on pages with wheel event handlers.
2210 If a handler includes position:fixed renderers, we just cover the whole document
2211 with the slow-scrolling region currently. This could be improved.
2214 (WebCore::Document::Document):
2215 (WebCore::Document::didBecomeCurrentDocumentInFrame):
2216 (WebCore::Document::wheelEventHandlersChanged):
2217 (WebCore::Document::didAddWheelEventHandler):
2218 (WebCore::Document::didRemoveWheelEventHandler):
2219 (WebCore::Document::wheelEventHandlerCount):
2220 (WebCore::Document::touchEventHandlerCount):
2221 (WebCore::Document::absoluteRegionForEventTargets): Changed to return a pair<Region, bool>
2222 where the bool indicates whether any handler includes position:fixed content.
2223 (WebCore::pageWheelEventHandlerCountChanged): Deleted.
2224 (WebCore::wheelEventHandlerCountChanged): Deleted.
2226 (WebCore::Document::wheelEventHandlerCount): Deleted.
2227 * loader/EmptyClients.h:
2228 * page/ChromeClient.h:
2229 * page/DebugPageOverlays.cpp:
2230 (WebCore::MouseWheelRegionOverlay::updateRegion):
2231 * page/scrolling/AsyncScrollingCoordinator.cpp:
2232 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
2233 (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
2234 * page/scrolling/AsyncScrollingCoordinator.h:
2235 * page/scrolling/ScrollingCoordinator.cpp:
2236 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
2237 (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
2238 (WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount): Deleted.
2239 (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged): Deleted.
2240 * page/scrolling/ScrollingCoordinator.h:
2241 (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
2242 * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2243 (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2244 (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount): Deleted.
2245 * page/scrolling/ScrollingStateFrameScrollingNode.h:
2246 * page/scrolling/ScrollingTree.cpp:
2247 (WebCore::ScrollingTree::ScrollingTree):
2248 (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2249 (WebCore::ScrollingTree::commitNewTreeState):
2250 * page/scrolling/ScrollingTree.h:
2251 * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2252 (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
2253 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2254 (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2255 (WebCore::logWheelEventHandlerCountChanged): Deleted.
2256 * testing/Internals.cpp:
2257 (WebCore::Internals::touchEventHandlerCount):
2259 2015-04-01 David Hyatt <hyatt@apple.com>
2261 [New Block-Inside-Inline Model] Floats need to be allowed to intrude into anonymous inline-blocks.
2262 https://bugs.webkit.org/show_bug.cgi?id=143307
2264 Reviewed by Dean Jackson.
2266 Added fast/block/inside-inlines/basic-float-intrusion.html
2268 * rendering/InlineFlowBox.cpp:
2269 (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2270 Make sure to exclude the margins of an anonymous inline-block when considering the height of the line.
2272 * rendering/RenderBlock.cpp:
2273 (WebCore::RenderBlock::lineHeight):
2274 (WebCore::RenderBlock::baselinePosition):
2275 Anonymous inline-block lines ignore line-height and just return the height of the block. For baseline position, the baseline
2276 is considered to be at the bottom border edge of the anonymous inline-block.
2278 * rendering/RenderBlockFlow.cpp:
2279 (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2280 (WebCore::RenderBlockFlow::addIntrudingFloats):
2281 * rendering/RenderBlockFlow.h:
2282 Patch float intrusion to handle the case of anonymous inline-blocks. Instead of collecting the floats from our parent(), we
2283 collect them from the containingBlock() in the anonymous inline-block case. Patch addIntrudingFloats to pass in the container
2284 that acts as the "parent", since it is not the parent() in the anonymous inline-block case.
2286 * rendering/RenderBlockLineLayout.cpp:
2287 (WebCore::updateLogicalInlinePositions):
2288 Make sure to use the full available width for content always in the anonymous inline-block case, since we don't avoid the
2289 floats, but instead let them intrude into the inline-block.
2291 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
2292 Patch callers of updateLogicalInlinePositions to pass in the root line box that we're checking for.
2294 (WebCore::RenderBlockFlow::layoutLineBoxes):
2295 Defer the layout of anonymous inline-blocks, since they need to only lay out once the vertical position to lay them out
2298 * rendering/RenderBox.cpp:
2299 (WebCore::RenderBox::createsNewFormattingContext):
2300 (WebCore::RenderBox::avoidsFloats):
2301 Anonymous inline-blocks do not establish a new block formatting context, nor do they avoid floats.
2303 * rendering/line/BreakingContext.h:
2304 (WebCore::BreakingContext::handleReplaced):
2305 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
2308 2015-04-01 Eric Carlson <eric.carlson@apple.com>
2310 [Mac] Do not include route button if element does not support target playback
2311 https://bugs.webkit.org/show_bug.cgi?id=143251
2313 Reviewed by Jer Noble.
2315 * Modules/mediacontrols/mediaControlsApple.js:
2316 (Controller.prototype.currentPlaybackTargetIsWireless): Return false if target playback is disabled.
2317 (Controller.prototype.updateWirelessTargetAvailable): Do not show the picker if target
2318 playback is disabled.
2319 (Controller.prototype.handleWirelessPlaybackChange): Call updateWirelessTargetAvailable.
2322 (WebCore::Document::showPlaybackTargetPicker): Update for Page::showPlaybackTargetPicker change.
2323 (WebCore::Document::didChoosePlaybackTarget): Notify clients in vector-order, lower level code
2324 now tracks which one requested the picker.
2326 * html/HTMLMediaElement.cpp:
2327 (WebCore::HTMLMediaElement::loadResource): Don't call applyMediaPlayerRestrictions, it is done
2328 in mediaPlayerEngineFailedToLoad.
2329 (WebCore::HTMLMediaElement::setReadyState): Enqueue a target availability event if there are
2330 listeners readyState reaches HAVE_METADATA so controls are setup correctly.
2331 (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad): Call applyMediaPlayerRestrictions.
2332 (WebCore::HTMLMediaElement::clearMediaPlayer): Enqueue a target availability event in so controls
2333 have a chance to hide the picker.
2334 (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): New, passthrough to the
2336 (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Ditto.
2337 (WebCore::HTMLMediaElement::startPlayingToPlaybackTarget): Ditto.
2338 (WebCore::HTMLMediaElement::stopPlayingToPlaybackTarget): Ditto.
2339 * html/HTMLMediaElement.h:
2340 * html/HTMLMediaElement.idl:
2342 * html/HTMLMediaSession.cpp:
2343 (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_playbackTarget.
2344 (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): New.
2345 (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Pull logic from showingPlaybackTargetPickerPermitted
2346 inline. Don't refuse to show a picker if the element doesn't support target playback, it is up
2347 to script to decide which elements can display a picker.
2348 (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return true if there is no player.
2349 (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Call startPlayingToPlaybackTarget or
2350 stopPlayingToPlaybackTarget because setWirelessPlaybackTarget doesn't apply the target.
2351 (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Add logging.
2352 (WebCore::HTMLMediaSession::showingPlaybackTargetPickerPermitted): Deleted.
2353 * html/HTMLMediaSession.h:
2356 (WebCore::Page::Page): Initialize m_playbackTarget.
2357 (WebCore::Page::showPlaybackTargetPicker): Don't set m_documentRequestingPlaybackTargetPicker.
2358 (WebCore::Page::didChoosePlaybackTarget): Notify Pages in vector-order, lower level code
2359 now tracks which one requested the picker.
2360 (WebCore::Page::configurePlaybackTargetMonitoring): Don't track m_requiresPlaybackTargetMonitoring, it
2361 is too easy for it to get out of sync with the UI process state.
2364 * platform/audio/MediaSession.cpp:
2365 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): New, client passthrough.
2366 (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
2367 (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
2368 * platform/audio/MediaSession.h:
2369 (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
2370 (WebCore::MediaSessionClient::startPlayingToPlaybackTarget):
2371 (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget):
2373 * platform/audio/MediaSessionManager.cpp:
2374 (WebCore::MediaSessionManager::sessionWillBeginPlayback): Call startPlayingToPlaybackTarget &
2375 stopPlayingToPlaybackTarget as necessary.
2376 * platform/audio/MediaSessionManager.h:
2378 * platform/graphics/MediaPlaybackTarget.h:
2379 (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
2380 * platform/graphics/MediaPlaybackTargetPickerClient.h:
2381 * platform/graphics/MediaPlayer.cpp:
2382 (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): New, engine passthrough.
2383 (WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget): Ditto.
2384 (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Ditto.
2385 (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Ditto.
2386 * platform/graphics/MediaPlayer.h:
2387 * platform/graphics/MediaPlayerPrivate.h:
2388 (WebCore::MediaPlayerPrivateInterface::isCurrentPlaybackTargetSupported):
2389 (WebCore::MediaPlayerPrivateInterface::wirelessVideoPlaybackDisabled):
2390 (WebCore::MediaPlayerPrivateInterface::canPlayToWirelessPlaybackTarget):
2391 (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget):
2392 (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget):
2394 * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2395 (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
2397 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2398 (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
2399 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2400 (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Use playerKVOProperties. Drive-by
2402 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Use playerKVOProperties.
2403 (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Implement for Mac.
2404 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): Delay callbacks
2405 while setting AVPlayer property.
2406 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Add logging. Don't set
2407 the AVPlayer outputContext immediately.
2408 (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): New.
2409 (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): New.
2410 (WebCore::playerKVOProperties): New.
2411 (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Notify when
2412 allowsExternalPlayback changes.
2414 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2415 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2416 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): New.
2417 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
2418 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Ditto.
2419 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Ditto.
2420 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Ditto.
2422 * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2423 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2424 (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Ditto.
2425 (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
2426 (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Ditto.
2427 (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Ditto.
2428 (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Ditto.
2430 2015-04-01 Alex Christensen <achristensen@webkit.org>
2432 [Content Extensions] Properly handle regexes that match everything.
2433 https://bugs.webkit.org/show_bug.cgi?id=143281
2435 Reviewed by Benjamin Poulain.
2437 * contentextensions/ContentExtensionCompiler.cpp:
2438 (WebCore::ContentExtensions::compileRuleList):
2439 Make sure we always have at least one NFA for rule lists with triggers that all match everything.
2440 * contentextensions/DFABytecodeInterpreter.cpp:
2441 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2442 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2443 Add helper functions to reduce duplicate code.
2444 (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2445 Get all actions without flags from the DFA root.
2446 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2447 Remove branches when interpreting.
2448 * contentextensions/DFABytecodeInterpreter.h:
2449 Add helper functions to reduce duplicate code.
2451 2015-04-01 Myles C. Maxfield <mmaxfield@apple.com>
2453 Addressing post-review comments.
2454 https://bugs.webkit.org/show_bug.cgi?id=143292
2458 * platform/graphics/FontCascade.cpp:
2459 (WebCore::FontCascade::leadingExpansionOpportunity):
2460 (WebCore::FontCascade::trailingExpansionOpportunity):
2462 2015-04-01 Per Arne Vollan <peavo@outlook.com>
2464 [WinCairo] Link errors, unresolved texture mapper methods.
2465 https://bugs.webkit.org/show_bug.cgi?id=143308
2467 Reviewed by Alex Christensen.
2469 New texture mapper files should be included in the project.
2471 * WebCore.vcxproj/WebCore.vcxproj:
2472 * WebCore.vcxproj/WebCore.vcxproj.filters:
2474 2015-04-01 Myles C. Maxfield <mmaxfield@apple.com>
2476 Support forcing expansion opportunities at the beginning and ending of a run
2477 https://bugs.webkit.org/show_bug.cgi?id=143292
2479 Reviewed by David Hyatt.
2481 Migrate ExpansionBehavior to an enum comprised of two values: one for leading behavior
2482 and one for trailing behavior. Each of these two values can take on a value of
2483 "force," "forbid," and neither. All calls that interact with justification are
2484 migrated to use this new structure.
2486 Note that in this terminology, "leading" and "trailing" are with respect to the order
2487 that elements get laid out in a line. Therefore, leading is always on the left, since
2488 lines get laid out that way regardless of their bidi attributes.
2490 This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
2492 No new tests because there is no behavior change.
2494 * platform/graphics/FontCascade.cpp:
2495 (WebCore::FontCascade::expansionOpportunityCountInternal): Migrate to these new
2497 (WebCore::FontCascade::expansionOpportunityCount): Ditto.
2498 (WebCore::FontCascade::leadingExpansionOpportunity): Returns whether one is present
2500 (WebCore::FontCascade::trailingExpansionOpportunity): Ditto.
2501 * platform/graphics/FontCascade.h:
2502 * platform/graphics/GlyphBuffer.h: New leading expansion field.
2503 (WebCore::GlyphBuffer::setLeadingExpansion):
2504 (WebCore::GlyphBuffer::leadingExpansion):
2505 * platform/graphics/TextRun.h: m_expansionBehavior needs more bits.
2506 (WebCore::TextRun::expansionBehavior):
2507 (WebCore::TextRun::allowsLeadingExpansion): Deleted.
2508 (WebCore::TextRun::allowsTrailingExpansion): Deleted.
2509 * platform/graphics/WidthIterator.cpp: Update to support new type.
2510 (WebCore::WidthIterator::WidthIterator):
2511 (WebCore::expansionLocation): Where should we insert expansions?
2512 (WebCore::WidthIterator::advanceInternal): Use expansionLocation()
2513 * platform/graphics/cocoa/FontCascadeCocoa.mm:
2514 (WebCore::FontCascade::adjustSelectionRectForComplexText):
2515 (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
2516 * platform/graphics/mac/ComplexTextController.cpp: Same as WidthIterator
2517 (WebCore::ComplexTextController::ComplexTextController):
2518 (WebCore::ComplexTextController::advance):
2519 (WebCore::expansionLocation):
2520 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2521 * platform/graphics/mac/ComplexTextController.h:
2522 (WebCore::ComplexTextController::leadingExpansion):
2523 * platform/text/TextFlags.h: Add new enum values
2524 * rendering/InlineBox.h: Update to include new values.
2525 (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields):
2526 (WebCore::InlineBox::canHaveTrailingExpansion):
2527 (WebCore::InlineBox::setCanHaveTrailingExpansion):
2528 (WebCore::InlineBox::setForceTrailingExpansion):
2529 (WebCore::InlineBox::forceTrailingExpansion):
2530 (WebCore::InlineBox::setForceLeadingExpansion):
2531 (WebCore::InlineBox::forceLeadingExpansion):
2532 * rendering/InlineTextBox.h:
2533 * rendering/RenderBlockLineLayout.cpp: Update to use new FontCascade signatures.
2534 (WebCore::expansionBehaviorForInlineTextBox):
2535 (WebCore::applyExpansionBehavior):
2536 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2538 2015-04-01 Zalan Bujtas <zalan@apple.com>
2540 Lots of time spent querying table cell borders, when there are none.
2541 https://bugs.webkit.org/show_bug.cgi?id=143277
2543 Reviewed by Simon Fraser.
2545 This patch speeds up collapsed border queries by using existing collapsed border
2546 cache to calculate repaint rects and by introducing a fast path for zero width collapsed borders.
2548 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).
2549 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.
2551 Covered by existing tests.
2553 * rendering/RenderTable.cpp:
2554 (WebCore::RenderTable::styleDidChange): This moves invalidation time from RenderTable::layout() to styleDidChange().
2555 (WebCore::RenderTable::invalidateCollapsedBorders):
2556 (WebCore::RenderTable::recalcCollapsedBorders):
2557 * rendering/RenderTable.h:
2558 (WebCore::RenderTable::collapsedBordersAreValid):
2559 (WebCore::RenderTable::invalidateCollapsedBorders): Deleted.
2560 * rendering/RenderTableCell.cpp:
2561 (WebCore::RenderTableCell::RenderTableCell):
2562 (WebCore::RenderTableCell::willBeRemovedFromTree): Invalidate caches so that when repaint rect is calculated, we don't end up using stale values.
2563 (WebCore::RenderTableCell::styleDidChange): Same as willBeRemovedFromTree.
2564 (WebCore::RenderTableCell::collapsedStartBorder): Check if collapsed border is zero -also query cache.
2565 (WebCore::RenderTableCell::collapsedEndBorder):
2566 (WebCore::RenderTableCell::collapsedBeforeBorder):
2567 (WebCore::RenderTableCell::collapsedAfterBorder):
2568 (WebCore::RenderTableCell::cachedCollapsedLeftBorder):
2569 (WebCore::RenderTableCell::cachedCollapsedRightBorder):
2570 (WebCore::RenderTableCell::cachedCollapsedTopBorder):
2571 (WebCore::RenderTableCell::cachedCollapsedBottomBorder):
2572 (WebCore::RenderTableCell::paintCollapsedBorders):
2573 (WebCore::RenderTableCell::cellAtLeft): Deleted.
2574 (WebCore::RenderTableCell::cellAtRight): Deleted.
2575 (WebCore::RenderTableCell::cellAtTop): Deleted.
2576 (WebCore::RenderTableCell::cellAtBottom): Deleted.
2577 * rendering/RenderTableCell.h:
2578 (WebCore::RenderTableCell::invalidateHasEmptyCollapsedBorders):
2579 * rendering/RenderTableCol.cpp:
2580 (WebCore::RenderTableCol::styleDidChange):
2581 * rendering/RenderTableRow.cpp:
2582 (WebCore::RenderTableRow::styleDidChange):
2583 (WebCore::RenderTableRow::addChild):
2584 * rendering/RenderTableSection.cpp:
2585 (WebCore::RenderTableSection::styleDidChange):
2586 (WebCore::RenderTableSection::clearCachedCollapsedBorders): This is just an extra safety to invalidate collapsed border cache. This is always
2587 called together with RenderTable::invalidateCollapsedBorders() -and that should prevent the RenderCells to use the cache.
2588 (WebCore::RenderTableSection::removeCachedCollapsedBorders):
2589 (WebCore::RenderTableSection::setCachedCollapsedBorder):
2590 (WebCore::RenderTableSection::cachedCollapsedBorder):
2591 * rendering/RenderTableSection.h:
2593 2015-04-01 Carlos Alberto Lopez Perez <clopez@igalia.com>
2595 [CMake][GTK] Use the right variable to include the Wayland headers.
2596 https://bugs.webkit.org/show_bug.cgi?id=143304
2598 Reviewed by Carlos Garcia Campos.
2600 No new tests, no behavior changes.
2602 * PlatformGTK.cmake: Use the right variable WAYLAND_INCLUDE_DIRS.
2604 2015-03-30 Philippe Normand <pnormand@igalia.com>
2606 [GStreamer] Move synchronous message handler to MediaPlayerPrivateGStreamerBase
2607 https://bugs.webkit.org/show_bug.cgi?id=143218
2609 Reviewed by Carlos Garcia Campos.
2611 Moved the pipeline pointer to the base class, sub-classes should
2612 now invoke setPipeline() when loading a resource. The base class
2613 now takes care of configuring the GL shared context, this is more
2614 logical because video rendering is also managed by this class.
2616 No new tests, this is only a code refactoring.
2618 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2619 (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2620 (WebCore::MediaPlayerPrivateGStreamer::load):
2621 (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
2622 (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
2623 (WebCore::MediaPlayerPrivateGStreamer::pause):
2624 (WebCore::MediaPlayerPrivateGStreamer::duration):
2625 (WebCore::MediaPlayerPrivateGStreamer::currentTime):
2626 (WebCore::MediaPlayerPrivateGStreamer::seek):
2627 (WebCore::MediaPlayerPrivateGStreamer::doSeek):
2628 (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
2629 (WebCore::MediaPlayerPrivateGStreamer::paused):
2630 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2631 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2632 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
2633 (WebCore::MediaPlayerPrivateGStreamer::setRate):
2634 (WebCore::MediaPlayerPrivateGStreamer::buffered):
2635 (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2636 (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
2637 (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
2638 (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
2639 (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
2640 (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
2641 (WebCore::MediaPlayerPrivateGStreamer::updateStates):
2642 (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2643 (WebCore::MediaPlayerPrivateGStreamer::cacheDuration):
2644 (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
2645 (WebCore::MediaPlayerPrivateGStreamer::audioSink):
2646 (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2647 (WebCore::MediaPlayerPrivateGStreamer::simulateAudioInterruption):
2648 (WebCore::mediaPlayerPrivateSyncMessageCallback): Deleted.
2649 (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Deleted.
2650 (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Deleted.
2651 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2652 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2653 (WebCore::mediaPlayerPrivateNeedContextMessageCallback):
2654 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2655 (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
2656 (WebCore::MediaPlayerPrivateGStreamerBase::handleNeedContextMessage):
2657 (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2658 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2660 2015-03-24 Philippe Normand <philn@igalia.com>
2662 [GStreamer] GstGL support in the video sink
2663 https://bugs.webkit.org/show_bug.cgi?id=138562
2665 Use GStreamer's glimagesink for video rendering instead of our
2666 custom video sink if a recent-enough version of GstGL is found
2667 during the build. When glimagesink is used it passes a texture to
2668 the media player which then wraps it inside a TextureMapper
2669 texture later used for actual rendering.
2671 Using this new code path will allow us to remove our custom sink
2672 entirely in the long term.
2674 Reviewed by Carlos Garcia Campos.
2676 No new test, existing media tests cover video rendering already.
2678 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2679 (WebCore::mediaPlayerPrivateDrawCallback): client-draw signal callback.
2680 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2681 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2682 (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Better
2683 check for sample validity.
2684 (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Ditto.
2685 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Trigger a
2686 repaint and wait its completion.
2687 (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
2688 Extract texture ID and video dimensions from the sample and do actual paint.
2689 (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Use
2690 glimagesink if GstGL is available.
2691 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2693 2015-04-01 Joonghun Park <jh718.park@samsung.com>
2695 nullptr cleanup in StyleResolver
2696 https://bugs.webkit.org/show_bug.cgi?id=143260
2698 Reviewed by Ryosuke Niwa.
2700 No new tests, no behavior changes
2702 * css/StyleResolver.cpp:
2703 (WebCore::StyleResolver::State::initForStyleResolve):
2704 (WebCore::StyleResolver::locateCousinList):
2705 (WebCore::StyleResolver::locateSharedStyle):
2706 (WebCore::StyleResolver::keyframeStylesForAnimation):
2707 (WebCore::StyleResolver::pseudoStyleForElement):
2708 (WebCore::StyleResolver::pseudoStyleRulesForElement):
2709 (WebCore::StyleResolver::findFromMatchedPropertiesCache):
2710 (WebCore::StyleResolver::applyMatchedProperties):
2711 (WebCore::StyleResolver::applyPropertyToStyle):
2712 (WebCore::StyleResolver::MatchedProperties::MatchedProperties):
2713 * css/StyleResolver.h:
2714 (WebCore::PseudoStyleRequest::PseudoStyleRequest):
2715 (WebCore::StyleResolverParentPusher::StyleResolverParentPusher):
2717 2015-03-31 Simon Fraser <simon.fraser@apple.com>
2719 Make it possible to compute a region for elements on the page that have wheel event handlers
2720 https://bugs.webkit.org/show_bug.cgi?id=142807
2722 Reviewed by David Hyatt.
2724 Make it possible to compute a region that covers the elements on the page that have
2725 a wheel event handler. This region may overestimate, but must not underestimate the area.
2727 Elements with wheel handlers are registered on the document, and when a document gains
2728 its first wheel handler, it registers the ownerElement in the parent document. Thus, on
2729 the main frame, the region encompasses elements with handlers, and iframes whose subdocuments
2732 Element gains some functions that allow it to return a rect which is the bounds of the element's
2733 renderer, and renders for its descendant elements, which is the size or larger than the event
2734 handling region for that element. Some configurations (e.g. position:fixed) require special
2737 Document::absoluteRegionForEventTargets() can then iterate over all elements in the given set,
2738 and build a Region for those (short-circuiting if the document itself has a handler).
2740 The new code is exercised for the debug MouseWheelRegionOverlay, and also added to the
2741 non-fast scrollable region, used by threaded scrolling.
2743 Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/handlers-in-iframes.html
2744 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child.html
2745 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns.html
2746 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-region.html
2747 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed.html
2748 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document.html
2749 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed.html
2750 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic.html
2752 * dom/ContainerNode.h:
2753 (WebCore::ContainerNode::absoluteEventHandlerBounds): Base class implementation; returns empty rect.
2755 (WebCore::Document::prepareForDestruction): Unregister from the parent document.
2756 (WebCore::Document::didAddWheelEventHandler): Add to the wheel handler set. Tell the parent
2757 document if we are adding wheel handlers for the first time. Eventually the wheelEventHandlerCountChanged()
2758 code will be removed, now we have the set. Tell debug overlays that we changed.
2759 (WebCore::Document::didRemoveWheelEventHandler): Remove from the set, and unregister with the parent
2760 document if necessary. Tell debug overlays that we changed.
2761 (WebCore::Document::didAddTouchEventHandler): Minor cleanup.
2762 (WebCore::Document::didRemoveTouchEventHandler): Ditto.
2763 (WebCore::Document::didRemoveEventTargetNode): Remove from wheel targets.
2764 (WebCore::Document::absoluteEventHandlerBounds): Implementation of the ContainerNode
2765 function, just return the document bounds.
2766 (WebCore::Document::absoluteRegionForEventTargets): Iterate over the given event targets,
2767 and call absoluteEventHandlerBounds() on each.
2769 (WebCore::Document::wheelEventTargets):
2771 (WebCore::layoutOverflowRectContainsAllDescendants): Return true if we can determine that the
2772 layoutOverflow bounds of the given renderer contains the renderers of all descendant elements.
2773 (WebCore::Element::eventBounds): Get the "event handling" bounds of this element (excluding
2774 descendants), and while doing so, compute whether any descendants are position:fixed, and whether
2775 these bounds are known to include descendants.
2776 (WebCore::Element::eventBoundsOfElementAndDescendants): Recursive function that short-circuits
2777 if it can determine that descendants are enclosed by the bounds.
2778 (WebCore::Element::absoluteEventHandlerBounds):
2780 * page/DebugPageOverlays.cpp:
2781 (WebCore::MouseWheelRegionOverlay::updateRegion): Ask the document for the region of wheel
2783 * page/scrolling/ScrollingCoordinator.cpp:
2784 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Add the wheel handler region
2785 to the non-fast scrollable region.
2786 * rendering/RenderLayer.cpp:
2787 (WebCore::RenderLayer::scrollTo): Overflow scrolling needs to dirty event regions.
2788 * rendering/RenderObject.cpp:
2789 (WebCore::RenderObject::absoluteBoundingBoxRect): Need to pass the "wasFixed" flag out
2791 (WebCore::RenderObject::localToAbsolute): Ditto.
2792 * rendering/RenderObject.h:
2794 2015-03-31 Alexey Proskuryakov <ap@apple.com>
2796 Fix bindings tests results after <http://trac.webkit.org/changeset/182205>.
2798 * bindings/scripts/test/JS/JSTestObj.cpp:
2799 (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
2800 (WebCore::setJSTestObjConditionalAttr4Constructor):
2801 (WebCore::setJSTestObjConditionalAttr5Constructor):
2802 (WebCore::setJSTestObjConditionalAttr6Constructor):
2803 (WebCore::setJSTestObjReplaceableAttribute):
2805 2015-03-31 Benjamin Poulain <bpoulain@apple.com>
2807 Content Extensions: split the state machines to minimize prefix states
2808 https://bugs.webkit.org/show_bug.cgi?id=143253
2810 Reviewed by Alex Christensen.
2812 With this patch, we refine how the URLs are partitioned to make
2813 multiple small machines instead of a big one.
2815 Here, considering each pattern as a language, I took the simplest
2816 partitioning: take the union minimizing the states
2817 that differentiate languages.
2819 The idea is the following: every time a subgraph can be skipped
2820 or repeated, it is an opportunity for a merged language to start
2821 with a distinguishable state.
2822 To avoid accumulating those differences, we only merge languages
2823 that share the exact same "variable" subgraph as a prefix.
2825 A side effect is that we could create as many machines as we have patterns.
2826 We'll have to address that in a follow-up by merging small machines
2827 until they reach a certain size.
2828 In the common cases, patterns look very much alike so that is not a problem
2831 * WebCore.xcodeproj/project.pbxproj:
2832 * contentextensions/CombinedURLFilters.cpp: Added.
2833 I moved the prefix tree and graph construction out of URLFilterParser for clarity.
2835 CombinedURLFilters maintain the term prefix tree. Instead of generating on the fly
2836 as we build the prefix tree, we first generate the entire tree of terms, then generate
2837 NFAs for each branch without a variable prefix.
2839 (WebCore::ContentExtensions::CombinedURLFilters::CombinedURLFilters):
2840 (WebCore::ContentExtensions::CombinedURLFilters::~CombinedURLFilters):
2842 (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
2843 Note here that we keep track of which subtree contains a any variable length term.
2844 Instead of anotating the edges, the destination vertex is anotated with the information
2847 The flag "inVariableLengthPrefix" is there to simplify traversal.
2849 (WebCore::ContentExtensions::generateNFAForSubtree):
2850 (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
2851 Since we are traversing a tree generated by string, using the stack for recursion
2852 is out of the question.
2854 Fortunately, the entire state is very simple when going depth first: we only need
2855 the active vertex and edge, and traverse the edges in order.
2857 To do keep track of the edges, I used the HashTable iterator on the current term.
2858 Since no vertex is modified for generation, storing the iterators is safe.
2860 * contentextensions/CombinedURLFilters.h:
2861 * contentextensions/ContentExtensionCompiler.cpp:
2862 (WebCore::ContentExtensions::compileRuleList):
2863 * contentextensions/NFA.cpp:
2864 (WebCore::ContentExtensions::NFA::setActions):
2865 (WebCore::ContentExtensions::NFA::debugPrintDot):
2866 (WebCore::ContentExtensions::NFA::setFinal): Deleted.
2867 (WebCore::ContentExtensions::NFA::addRuleId): Deleted.
2868 * contentextensions/NFA.h:
2869 * contentextensions/NFAGraphBuilder.cpp: Added.
2870 * contentextensions/NFAGraphBuilder.h: Added.
2871 * contentextensions/NFANode.h:
2872 * contentextensions/Term.h: Added.
2873 Move the Term to its own file since it is now shared between the parser
2874 and the CombinedURLFilters.
2876 (WebCore::ContentExtensions::Term::CharacterSet::operator==):
2877 (WebCore::ContentExtensions::Term::CharacterSet::hash):
2878 (WebCore::ContentExtensions::Term::Group::operator==):
2879 (WebCore::ContentExtensions::Term::Group::hash):
2880 (WebCore::ContentExtensions::TermHash::hash):
2881 (WebCore::ContentExtensions::TermHash::equal):
2882 (WebCore::ContentExtensions::Term::Term):
2883 (WebCore::ContentExtensions::Term::~Term):
2884 (WebCore::ContentExtensions::Term::isValid):
2885 (WebCore::ContentExtensions::Term::addCharacter):
2886 (WebCore::ContentExtensions::Term::extendGroupSubpattern):
2887 (WebCore::ContentExtensions::Term::quantify):
2888 (WebCore::ContentExtensions::Term::Term::generateGraph):
2889 (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
2890 (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
2891 (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
2892 (WebCore::ContentExtensions::Term::hasFixedLength):
2893 (WebCore::ContentExtensions::Term::operator=):
2894 (WebCore::ContentExtensions::Term::operator==):
2895 (WebCore::ContentExtensions::Term::hash):
2896 (WebCore::ContentExtensions::Term::isEmptyValue):
2897 (WebCore::ContentExtensions::Term::isDeletedValue):
2898 (WebCore::ContentExtensions::Term::isUniversalTransition):
2899 (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2900 (WebCore::ContentExtensions::Term::destroy):
2901 * contentextensions/URLFilterParser.cpp:
2902 (WebCore::ContentExtensions::PatternParser::PatternParser):
2903 (WebCore::ContentExtensions::PatternParser::finalize):
2904 (WebCore::ContentExtensions::PatternParser::assertionBOL):
2905 (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
2906 (WebCore::ContentExtensions::URLFilterParser::addPattern):
2907 (WebCore::ContentExtensions::Term::Term): Deleted.
2908 (WebCore::ContentExtensions::Term::~Term): Deleted.
2909 (WebCore::ContentExtensions::Term::isValid): Deleted.
2910 (WebCore::ContentExtensions::Term::addCharacter): Deleted.
2911 (WebCore::ContentExtensions::Term::extendGroupSubpattern): Deleted.
2912 (WebCore::ContentExtensions::Term::quantify): Deleted.
2913 (WebCore::ContentExtensions::Term::generateGraph): Deleted.
2914 (WebCore::ContentExtensions::Term::isEndOfLineAssertion): Deleted.
2915 (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter): Deleted.
2916 (WebCore::ContentExtensions::Term::isKnownToMatchAnyString): Deleted.
2917 (WebCore::ContentExtensions::Term::operator=): Deleted.
2918 (WebCore::ContentExtensions::Term::operator==): Deleted.
2919 (WebCore::ContentExtensions::Term::hash): Deleted.
2920 (WebCore::ContentExtensions::Term::isEmptyValue): Deleted.
2921 (WebCore::ContentExtensions::Term::isDeletedValue): Deleted.
2922 (WebCore::ContentExtensions::Term::isUniversalTransition): Deleted.
2923 (WebCore::ContentExtensions::Term::generateSubgraphForAtom): Deleted.
2924 (WebCore::ContentExtensions::Term::destroy): Deleted.
2925 (WebCore::ContentExtensions::Term::CharacterSet::operator==): Deleted.
2926 (WebCore::ContentExtensions::Term::CharacterSet::hash): Deleted.
2927 (WebCore::ContentExtensions::Term::Group::operator==): Deleted.
2928 (WebCore::ContentExtensions::Term::Group::hash): Deleted.
2929 (WebCore::ContentExtensions::TermHash::hash): Deleted.
2930 (WebCore::ContentExtensions::TermHash::equal): Deleted.
2931 (WebCore::ContentExtensions::GraphBuilder::GraphBuilder): Deleted.
2932 (WebCore::ContentExtensions::GraphBuilder::finalize): Deleted.
2933 (WebCore::ContentExtensions::GraphBuilder::assertionBOL): Deleted.
2934 * contentextensions/URLFilterParser.h:
2936 2015-03-31 Myles C. Maxfield <mmaxfield@apple.com>
2938 Move ExpansionBehaviorFlags and TextDirection to their own file
2939 https://bugs.webkit.org/show_bug.cgi?id=143273
2941 Reviewed by Simon Fraser.
2943 This is a mechanical change. It just moves code around.
2945 This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
2947 No new tests because there is no behavior change.
2949 * Modules/notifications/Notification.h:
2950 * WebCore.vcxproj/WebCore.vcxproj:
2951 * WebCore.vcxproj/WebCore.vcxproj.filters:
2952 * WebCore.xcodeproj/project.pbxproj:
2953 * css/CSSPrimitiveValueMappings.h:
2954 * css/CSSProperty.h:
2956 * editing/VisiblePosition.h:
2957 * editing/VisibleUnits.h:
2958 * editing/htmlediting.h:
2959 * html/canvas/CanvasRenderingContext2D.cpp:
2960 (WebCore::CanvasRenderingContext2D::drawTextInternal):
2961 * html/canvas/CanvasRenderingContext2D.h:
2962 * platform/LengthBox.h:
2963 * platform/PopupMenuStyle.h:
2964 * platform/graphics/FontCascade.h:
2965 * platform/graphics/LayoutBoxExtent.h:
2966 * platform/graphics/TextRun.h:
2967 * platform/ios/SelectionRect.h:
2968 * platform/text/BidiResolver.h:
2969 * platform/text/StringWithDirection.h:
2970 * platform/text/TextHelpers.h: Renamed from Source/WebCore/platform/text/TextDirection.h.
2971 (WebCore::isLeftToRightDirection):
2972 * platform/win/PopupMenuWin.cpp:
2973 (WebCore::PopupMenuWin::paint):
2974 * rendering/EllipsisBox.cpp:
2975 (WebCore::EllipsisBox::paint):
2976 (WebCore::EllipsisBox::selectionRect):
2977 (WebCore::EllipsisBox::paintSelection):
2978 * rendering/HitTestLocation.h:
2979 * rendering/HitTestResult.h:
2980 * rendering/InlineBox.h:
2981 * rendering/InlineTextBox.h:
2982 (WebCore::InlineTextBox::expansionBehavior):
2983 * rendering/RenderBlock.cpp:
2984 (WebCore::constructTextRunInternal):
2985 (WebCore::RenderBlock::constructTextRun):
2986 * rendering/RenderBlock.h:
2987 * rendering/RenderFileUploadControl.cpp:
2988 (WebCore::RenderFileUploadControl::paintObject):
2989 (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
2990 * rendering/RenderListBox.cpp:
2991 (WebCore::RenderListBox::updateFromElement):
2992 (WebCore::RenderListBox::paintItemForeground):
2993 * rendering/RenderListMarker.cpp:
2994 (WebCore::RenderListMarker::computePreferredLogicalWidths):
2995 (WebCore::RenderListMarker::getRelativeMarkerRect):
2996 * rendering/RenderMenuList.cpp:
2997 (RenderMenuList::updateOptionsWidth):
2998 * rendering/RenderTextControl.cpp:
2999 (WebCore::RenderTextControl::getAverageCharWidth):
3000 * rendering/RenderThemeIOS.mm:
3001 * rendering/style/RenderStyle.h:
3002 * rendering/svg/SVGInlineTextBox.cpp:
3003 (WebCore::SVGInlineTextBox::constructTextRun):
3004 * rendering/svg/SVGTextMetrics.cpp:
3005 (WebCore::SVGTextMetrics::constructTextRun):
3007 2015-03-31 Yusuke Suzuki <utatane.tea@gmail.com>
3009 Clean up Identifier factories to clarify the meaning of StringImpl*
3010 https://bugs.webkit.org/show_bug.cgi?id=143146
3012 Reviewed by Filip Pizlo.
3014 Just change Identifier creations.
3016 1. If the code creates Identifier from StringImpl*
3017 which is treated as symbol or string(unique id), use Identifier::fromUid.
3018 2. If the code creates Identifier from string, use Identifier::fromString.
3020 * Modules/plugins/QuickTimePluginReplacement.mm:
3021 (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
3022 (WebCore::QuickTimePluginReplacement::installReplacement):
3023 * bindings/js/IDBBindingUtilities.cpp:
3026 * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3027 (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames):
3028 * bindings/js/JSCallbackData.cpp:
3029 (WebCore::JSCallbackData::invokeCallback):
3030 * bindings/js/JSCommandLineAPIHostCustom.cpp:
3031 (WebCore::getJSListenerFunctions):
3032 (WebCore::JSCommandLineAPIHost::getEventListeners):
3033 * bindings/js/JSCryptoAlgorithmBuilder.cpp:
3034 (WebCore::JSCryptoAlgorithmBuilder::add):
3035 * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3036 (WebCore::getProperty):
3037 (WebCore::getHashAlgorithm):
3038 * bindings/js/JSCryptoKeySerializationJWK.cpp:
3039 (WebCore::getJSArrayFromJSON):
3040 (WebCore::getStringFromJSON):
3041 (WebCore::getBooleanFromJSON):
3042 (WebCore::addToJSON):
3043 (WebCore::buildJSONForRSAComponents):
3044 (WebCore::addBoolToJSON):
3045 (WebCore::addUsagesToJSON):
3046 * bindings/js/JSCustomXPathNSResolver.cpp:
3047 (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
3048 * bindings/js/JSDOMStringMapCustom.cpp:
3049 (WebCore::JSDOMStringMap::getOwnPropertyNames):
3050 * bindings/js/JSDOMWindowCustom.cpp:
3051 (WebCore::JSDOMWindow::defineOwnProperty):
3052 (WebCore::JSDOMWindow::setLocation):
3053 (WebCore::DialogHandler::dialogCreated):
3054 (WebCore::DialogHandler::returnValue):
3055 * bindings/js/JSDeviceMotionEventCustom.cpp:
3056 (WebCore::readAccelerationArgument):
3057 (WebCore::readRotationRateArgument):
3058 (WebCore::createAccelerationObject):
3059 (WebCore::createRotationRateObject):
3060 * bindings/js/JSDictionary.cpp:
3061 (WebCore::JSDictionary::tryGetProperty):
3062 * bindings/js/JSEventListener.cpp:
3063 (WebCore::JSEventListener::handleEvent):
3064 * bindings/js/JSHTMLAllCollectionCustom.cpp:
3065 (WebCore::callHTMLAllCollection):
3066 (WebCore::JSHTMLAllCollection::item):
3067 (WebCore::JSHTMLAllCollection::namedItem):
3068 * bindings/js/JSHTMLDocumentCustom.cpp:
3069 (WebCore::JSHTMLDocument::all):
3070 (WebCore::JSHTMLDocument::setAll):
3071 (WebCore::JSHTMLDocument::open):
3072 * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
3073 (WebCore::JSHTMLFormControlsCollection::namedItem):
3074 * bindings/js/JSIDBDatabaseCustom.cpp:
3075 (WebCore::JSIDBDatabase::createObjectStore):
3076 * bindings/js/JSIDBObjectStoreCustom.cpp:
3077 (WebCore::JSIDBObjectStore::createIndex):
3078 * bindings/js/JSImageDataCustom.cpp:
3080 * bindings/js/JSInspectorFrontendHostCustom.cpp:
3081 (WebCore::populateContextMenuItems):
3082 * bindings/js/JSLazyEventListener.cpp:
3083 (WebCore::JSLazyEventListener::initializeJSFunction):
3084 * bindings/js/JSNodeFilterCondition.cpp:
3085 (WebCore::JSNodeFilterCondition::acceptNode):
3086 * bindings/js/JSSQLResultSetRowListCustom.cpp:
3087 (WebCore::JSSQLResultSetRowList::item):
3088 * bindings/js/JSStorageCustom.cpp:
3089 (WebCore::JSStorage::getOwnPropertyNames):
3090 * bindings/js/ReadableStreamJSSource.cpp:
3091 (WebCore::setInternalSlotToObject):
3092 (WebCore::getInternalSlotFromObject):
3093 * bindings/js/ScriptGlobalObject.cpp:
3094 (WebCore::ScriptGlobalObject::set):
3095 (WebCore::ScriptGlobalObject::get):
3096 (WebCore::ScriptGlobalObject::remove):
3097 * bindings/js/SerializedScriptValue.cpp:
3098 (WebCore::CloneSerializer::CloneSerializer):
3099 (WebCore::CloneSerializer::write):
3100 (WebCore::CloneDeserializer::deserialize):
3101 * bindings/objc/WebScriptObject.mm:
3102 (-[WebScriptObject callWebScriptMethod:withArguments:]):
3103 (-[WebScriptObject setValue:forKey:]):
3104 (-[WebScriptObject valueForKey:]):
3105 (-[WebScriptObject removeWebScriptKey:]):
3106 (-[WebScriptObject hasWebScriptKey:]):
3107 * bindings/scripts/CodeGeneratorJS.pm:
3108 (GenerateImplementation):
3109 * bindings/scripts/test/JS/JSFloat64Array.cpp:
3110 (WebCore::JSFloat64Array::getOwnPropertyNames):
3111 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3112 (WebCore::JSTestEventTarget::getOwnPropertyNames):
3113 * bindings/scripts/test/JS/JSTestObj.cpp:
3114 (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
3115 (WebCore::setJSTestObjConditionalAttr4Constructor):
3116 (WebCore::setJSTestObjConditionalAttr5Constructor):
3117 (WebCore::setJSTestObjConditionalAttr6Constructor):
3118 (WebCore::setJSTestObjReplaceableAttribute):
3119 * bridge/c/c_utility.cpp:
3120 (JSC::Bindings::identifierFromNPIdentifier):
3121 * bridge/objc/objc_runtime.mm:
3122 (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
3123 * bridge/testbindings.cpp:
3125 * bridge/testbindings.mm:
3127 * contentextensions/ContentExtensionParser.cpp:
3128 (WebCore::ContentExtensions::loadTrigger):
3129 (WebCore::ContentExtensions::loadAction):
3130 * html/HTMLMediaElement.cpp:
3131 (WebCore::HTMLMediaElement::parseAttribute):
3132 * html/HTMLPlugInImageElement.cpp:
3133 (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
3134 * testing/js/WebCoreTestSupport.cpp:
3135 (WebCoreTestSupport::injectInternalsObject):
3137 2015-03-31 Jer Noble <jer.noble@apple.com>
3139 [Mac] Songza.com fails to play; QTKit path reports it is always "seeking".
3140 https://bugs.webkit.org/show_bug.cgi?id=143274
3142 Rubber-stamped by Eric Carlson.
3144 MediaTime::invalidTime() is always greater than any valid time. So when
3145 checking to see if MediaPlayerPrivateQTKit is seeking, first check if the
3146 m_seekTo time is valid before checking whether it's > 0.
3148 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3149 (WebCore::MediaPlayerPrivateQTKit::seeking):
3151 2015-03-31 Said Abou-Hallawa <sabouhallawa@apple.com>
3153 border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
3154 https://bugs.webkit.org/show_bug.cgi?id=142650.
3156 Reviewed by Simon Fraser.
3158 The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be
3159 drawn if its RenderStyle has a non-zero width border or the border-image
3160 has the keyword fill.
3162 Tests: fast/borders/border-image-fill-inline-no-border.html
3163 fast/borders/border-image-fill-no-border.html
3165 * rendering/InlineFlowBox.cpp:
3166 (WebCore::InlineFlowBox::paintBoxDecorations):
3167 * rendering/RenderBox.cpp:
3168 (WebCore::RenderBox::paintBoxDecorations):
3169 * rendering/RenderBoxModelObject.cpp:
3170 (WebCore::RenderBoxModelObject::hasBoxDecorationStyle):
3171 * rendering/RenderTable.cpp:
3172 (WebCore::RenderTable::paintBoxDecorations):
3173 * rendering/style/BorderData.h:
3174 (WebCore::BorderData::hasFill):
3175 * rendering/style/RenderStyle.h:
3177 2015-03-31 Alex Christensen <achristensen@webkit.org>
3179 [Win] Unreviewed build fix.
3181 * WebCore.vcxproj/WebCore.vcxproj:
3182 Don't include inspector files twice in debug builds.
3183 InspectorAllInOne.cpp is now used on debug builds.
3185 2015-03-31 David Hyatt <hyatt@apple.com>
3187 [New Block-Inside-Inline Model] Anonymous inline-blocks should size as though they are block-level.
3188 https://bugs.webkit.org/show_bug.cgi?id=143271
3190 Reviewed by Dean Jackson.
3192 Added fast/block/inside-inlines/block-width-check.html.
3194 * rendering/RenderBox.cpp:
3195 (WebCore::RenderBox::sizesLogicalWidthToFitContent):
3196 Return false when an anonymous inline-block is encountered, since we want to treat it like a regular
3199 2015-03-31 Commit Queue <commit-queue@webkit.org>
3201 Unreviewed, rolling out r182186.
3202 https://bugs.webkit.org/show_bug.cgi?id=143270
3204 it crashes all the WebGL tests on the Debug bots (Requested by
3209 "Web Inspector: add 2D/WebGL canvas instrumentation
3211 https://bugs.webkit.org/show_bug.cgi?id=137278
3212 http://trac.webkit.org/changeset/182186
3214 2015-03-31 Myles C. Maxfield <mmaxfield@apple.com>
3216 Crash in CGContextShowGlyphsWithAdvances when passing kCGFontIndexInvalid
3217 https://bugs.webkit.org/show_bug.cgi?id=143114
3219 This is a workaround for <rdar://problem/20230073>. Please remove when it is no longer necessary.
3221 Reviewed by Alexey Proskuryakov.
3224 compositing/regions/floated-region-with-transformed-child.html
3225 compositing/regions/floated-region-with-transformed-child-expected.html
3226 fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html
3227 fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html
3228 fast/regions/overflow/overflow-content-transform-rotate.html
3229 fast/regions/overflow/overflow-content-transform-rotate-expected.html
3231 * platform/graphics/GlyphBuffer.h:
3232 (WebCore::GlyphBuffer::shrink): Performing shaping may remove glyphs, so we need to shrink the GlyphBuffer.
3233 * platform/graphics/WidthIterator.cpp:
3234 (WebCore::applyFontTransforms): Filter out kCGFontIndexInvalid.
3235 (WebCore::WidthIterator::advanceInternal): Moved code into applyFontTransforms, and trigger the
3236 shrink of the GlyphBuffer.
3238 2015-03-31 Beth Dakin <bdakin@apple.com>
3240 REGRESSION (r173484): Reducing content of scrollable region does not reset scroll
3242 https://bugs.webkit.org/show_bug.cgi?id=138525
3244 rdar://problem/18166043
3246 Reviewed by Simon Fraser.
3248 The change that caused this regression was correct. That change does not allow
3249 RenderLayer to update scroll position after a layout if a rubber-band is currently
3250 happening. The change caused this regression because all of the member variables
3251 in ScrollController that attempt to keep track of the current state of the scroll
3252 gesture (m_inScrollGesture, m_momentumScrollInProgress, and
3253 m_snapRubberbandTimerIsActive) all indicated that a momentum scroll gesture was
3254 still in action for this div even though it very much is not when the bug happens.
3255 Those variables were never properly re-set because the
3256 PlatformWheelEventPhaseEnded events never got dispatched to the ScrollController,
3257 which brought the investigation back to Element.
3259 We must still dispatch events that have zero delta so that the default event
3260 handlers can handle them, but we should stopPropagation() so that these events are
3261 not sent to the DOM. Websites will break if they get wheel events with no delta.
3263 (WebCore::Element::dispatchWheelEvent):
3265 2015-03-31 Alex Christensen <achristensen@webkit.org>
3267 [Win] Unreviewed debug build fix after r182186.
3269 * WebCore.vcxproj/WebCore.vcxproj:
3270 Include InspectorAllInOne.cpp in debug builds.
3272 2015-03-30 David Hyatt <hyatt@apple.com>
3274 [New Block-Inside-Inline Model] Make sure line breaks occur before and after the anonymous inline-block.
3275 https://bugs.webkit.org/show_bug.cgi?id=143238.
3277 Reviewed by Dean Jackson.
3279 Added fast/blocks/inside-inlines/breaking-behavior.html (and new-model equivalent).
3281 * rendering/InlineFlowBox.h:
3282 (WebCore::InlineFlowBox::InlineFlowBox):
3283 (WebCore::InlineFlowBox::hasAnonymousInlineBlock):
3284 (WebCore::InlineFlowBox::setHasAnonymousInlineBlock):
3285 Add a bit to root line boxes (stored in the InlineFlowBox since it has free bits) that indicates whether
3286 or not a line is an anonymous inline-block line.
3288 * rendering/RenderBlockFlow.cpp:
3289 (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
3290 Patch the preferred logical width computation to break both before and after an anonymous inline-block.
3291 Also make sure to strip trailing spaces from the line before the anonymous inline-block.
3293 * rendering/RenderBlockLineLayout.cpp:
3294 (WebCore::RenderBlockFlow::constructLine):
3295 Patch line construction so that no intermediate boxes are constructed between the InlineBox for the anonymous
3296 inline-block and the root line box.
3298 * rendering/RootInlineBox.cpp:
3299 (WebCore::RootInlineBox::ascentAndDescentForBox):
3300 The height of a "line" that holds an anonymous inline-block should ignore line-box-contain and also make sure
3301 that the margins of the replaced element are "outside" the line, since those margins will collapse.
3303 * rendering/line/BreakingContext.h:
3304 (WebCore::BreakingContext::handleReplaced):
3305 Patch handleReplaced to make sure breaks occur both before and after an anonymous inline-block. In the case of
3306 a break after the block, we setPreviousLineBrokeCleanly to true so that <br>s that follow the anonymous inline-block
3309 2015-03-31 Csaba Osztrogonác <ossy@webkit.org>
3311 [EFL] Add nullptr check to GraphicsContext3D::makeContextCurrent()
3312 https://bugs.webkit.org/show_bug.cgi?id=143214
3314 Reviewed by Žan Doberšek.
3316 * platform/graphics/efl/GraphicsContext3DEfl.cpp:
3317 (WebCore::GraphicsContext3D::makeContextCurrent):
3319 2015-03-31 Matt Baker <mattbaker@apple.com>
3321 Web Inspector: add 2D/WebGL canvas instrumentation infrastructure
3322 https://bugs.webkit.org/show_bug.cgi?id=137278
3324 Reviewed by Timothy Hatcher.
3326 Added backend agent for canvas inspection. A canvas is instrumented once its CanvasRenderingContext has been
3327 created. WebGLRenderingContext is instrumented to track the lifetime of shader program objects.
3329 To instrument off-screen rendering contexts (CSS canvases and detached canvas elements), the canvas agent must
3330 track all CanvasRenderingContexts as they are created, even in the absense of the frontend. As far as I know,
3331 there is no practical way to identify rendering contexts belonging to a frame that are not in the DOM. In the
3332 absence of the inspector frontend the agent does only the minimum required to track the lifetime of rendering
3333 contexts and their resources, to avoid creating a negative performance impact.
3335 Tests: inspector/canvas/canvas-add-remove-events.html
3336 inspector/canvas/canvas-context-attributes.html
3337 inspector/canvas/canvas-css-name.html
3340 * WebCore.xcodeproj/project.pbxproj:
3343 (WebCore::Document::getCSSCanvasElement):
3344 Instrumentation for CSS canvases.
3346 * html/HTMLCanvasElement.cpp:
3347 (WebCore::HTMLCanvasElement::getContext):
3348 Instrumentation for context creation.
3350 * html/canvas/WebGLRenderingContextBase.cpp:
3351 (WebCore::WebGLRenderingContextBase::attachShader):
3352 (WebCore::WebGLRenderingContextBase::createProgram):
3353 (WebCore::WebGLRenderingContextBase::deleteProgram):
3354 (WebCore::WebGLRenderingContextBase::detachShader):
3355 Instrumentation for programs and shaders.
3357 * inspector/InspectorAllInOne.cpp:
3359 * inspector/InspectorCanvasAgent.cpp: Added.
3360 (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3361 (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
3362 (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
3363 (WebCore::InspectorCanvasAgent::frameNavigated):
3364 (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
3365 (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3366 (WebCore::InspectorCanvasAgent::didAttachShader):
3367 (WebCore::InspectorCanvasAgent::didDetachShader):
3368 (WebCore::InspectorCanvasAgent::didCreateProgram):
3369 (WebCore::InspectorCanvasAgent::didDeleteProgram):
3370 (WebCore::InspectorCanvasAgent::getCanvases):
3371 (WebCore::InspectorCanvasAgent::canvasDestroyed):
3372 (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
3373 (WebCore::InspectorCanvasAgent::reset):
3374 (WebCore::InspectorCanvasAgent::getCanvasEntry):
3375 (WebCore::InspectorCanvasAgent::getProgramEntry):
3376 (WebCore::InspectorCanvasAgent::removeShaderFromShaderMap):
3377 (WebCore::InspectorCanvasAgent::contextTypeJson):
3378 (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
3379 * inspector/InspectorCanvasAgent.h: Added.
3382 * inspector/InspectorController.cpp:
3383 (WebCore::InspectorController::InspectorController):
3384 Support for new backend agent.
3386 * inspector/InspectorInstrumentation.cpp:
3387 (WebCore::InspectorInstrumentation::didCommitLoadImpl):
3388 (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
3389 (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
3390 (WebCore::InspectorInstrumentation::didAttachShaderImpl):
3391 (WebCore::InspectorInstrumentation::didDetachShaderImpl):
3392 (WebCore::InspectorInstrumentation::didCreateProgramImpl):
3393 (WebCore::InspectorInstrumentation::didDeleteProgramImpl):
3394 (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderingContext):
3395 Plumbing for canvas instrumentation.
3397 * inspector/InspectorInstrumentation.h:
3398 (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
3399 (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
3400 (WebCore::InspectorInstrumentation::didAttachShader):
3401 (WebCore::InspectorInstrumentation::didDetachShader):
3402 (WebCore::InspectorInstrumentation::didCreateProgram):
3403 (WebCore::InspectorInstrumentation::didDeleteProgram):
3405 * inspector/InstrumentingAgents.cpp:
3406 (WebCore::InstrumentingAgents::InstrumentingAgents):
3407 (WebCore::InstrumentingAgents::reset):
3408 * inspector/InstrumentingAgents.h:
3409 (WebCore::InstrumentingAgents::inspectorCanvasAgent):
3410 (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
3411 Support for new backend agent.
3413 2015-03-31 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3415 [Streams API] Implement a barebone ReadableStreamReader interface
3416 https://bugs.webkit.org/show_bug.cgi?id=142866
3418 Reviewed by Benjamin Poulain.
3420 This patch implements a barebone ReadableStreamReader as described in https://streams.spec.whatwg.org/#reader-class.
3421 It implements the IDL without implementing most of the functionality behind.
3422 It implements ReadableStreamReader JS constructor and the link with ReadableStream.getReader:
3423 - Raise an error if stream is already locked
3424 - Set the stream reader to the newly created ReadableStreamReader instance.
3426 Test: streams/readablestreamreader-constructor.html
3428 * CMakeLists.txt: Adding ReadableStreamReader files.
3429 * DerivedSources.cpp: Ditto.
3430 * DerivedSources.make: Ditto.
3431 * Modules/streams/ReadableStream.cpp:
3432 (WebCore::ReadableStream::createReader): Used by JS binding to get access to the reader.
3433 * Modules/streams/ReadableStream.h: Declaration of createReader, reader and lock.
3434 (WebCore::ReadableStream::reader):
3435 (WebCore::ReadableStream::lock):
3436 * Modules/streams/ReadableStream.idl: Cleaning-up the IDL.
3437 * Modules/streams/ReadableStreamReader.cpp: Added.
3438 (WebCore::ReadableStreamReader::create):
3439 (WebCore::ReadableStreamReader::ReadableStreamReader):
3440 (WebCore::ReadableStreamReader::~ReadableStreamReader):
3441 (WebCore::ReadableStreamReader::closed):
3442 (WebCore::ReadableStreamReader::activeDOMObjectName):
3443 (WebCore::ReadableStreamReader::canSuspend):
3444 * Modules/streams/ReadableStreamReader.h: Added.
3445 (WebCore::ReadableStreamReader::stream):
3446 * Modules/streams/ReadableStreamReader.idl: Added.
3447 * WebCore.vcxproj/WebCore.vcxproj:
3448 * WebCore.vcxproj/WebCore.vcxproj.filters:
3449 * WebCore.xcodeproj/project.pbxproj:
3450 * bindings/js/JSBindingsAllInOne.cpp:
3451 * bindings/js/JSReadableStreamCustom.cpp:
3452 (WebCore::JSReadableStream::getReader):
3453 * bindings/js/JSReadableStreamReaderCustom.cpp: Added.
3454 (WebCore::JSReadableStreamReader::read):
3455 (WebCore::getOrCreatePromiseDeferredFromObject):
3456 (WebCore::closedPromiseSlotName):
3457 (WebCore::JSReadableStreamReader::closed):
3458 (WebCore::JSReadableStreamReader::cancel):
3459 (WebCore::JSReadableStreamReader::releaseLock):
3460 (WebCore::constructJSReadableStreamReader):
3462 2015-03-31 Carlos Garcia Campos <cgarcia@igalia.com>
3464 [GTK] DnD icon/widget has odd background
3465 https://bugs.webkit.org/show_bug.cgi?id=143217
3467 Reviewed by Martin Robinson.
3469 Remove DragIcon class since it's no longer needed with GTK+3 and
3470 the GTK+2 code there is unused. GTK+ knows what to do with a cairo
3471 surface, I guess we migrated the GTK+2 code to GTK+3 without
3472 realizing that using the surface was enough.
3474 * PlatformGTK.cmake:
3475 * platform/gtk/DragIcon.cpp: Removed.
3476 * platform/gtk/DragIcon.h: Removed.
3478 2015-03-30 Alex Christensen <achristensen@webkit.org>
3480 Unreviewed build fix after r182168.
3482 * contentextensions/ContentExtensionsBackend.cpp:
3483 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3484 Explicitly cast to unsigned.
3486 2015-03-30 Alex Christensen <achristensen@webkit.org>
3488 [Content Extensions] Correctly handle regular expressions matching everything
3489 https://bugs.webkit.org/show_bug.cgi?id=143235
3491 Reviewed by Benjamin Poulain.
3493 Test: http/tests/contentextensions/whitelist.html
3495 * contentextensions/CompiledContentExtension.cpp:
3496 (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
3497 Global actions can have non-css actions. Only put the selectors into the list of selectors.
3498 * contentextensions/ContentExtensionCompiler.cpp:
3499 (WebCore::ContentExtensions::serializeSelector):
3500 (WebCore::ContentExtensions::serializeActions):
3501 Merge sequential css selectors with identical triggers (usually .*) into one action to reduce the number of actions.
3502 (WebCore::ContentExtensions::compileRuleList):
3503 Fail if a regular expression matches everything after ignore-previous-rules.
3504 * contentextensions/ContentExtensionError.cpp:
3505 (WebCore::ContentExtensions::contentExtensionErrorCategory):
3506 * contentextensions/ContentExtensionError.h:
3507 Add more failure cases.
3508 * contentextensions/ContentExtensionRule.h:
3509 (WebCore::ContentExtensions::Trigger::operator==):
3510 Allow comparing of Triggers to determine if sequential triggers are equal.
3511 * contentextensions/ContentExtensionsBackend.cpp:
3512 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3513 Put non-css actions that match everything into the list of actions if ignore-previous-rules was not hit.
3514 These actions will be out of order, but order only matters when determining if ignore-previous-rules, and this case is handled correctly.
3515 * contentextensions/DFABytecodeInterpreter.cpp:
3516 (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
3517 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3518 Added an assertion that all actions that match everything should be in the first DFA root.
3519 We should catch them all with URLFilterParser::MatchesEverything.
3521 2015-03-30 Myles C. Maxfield <mmaxfield@apple.com>
3523 Allow building on Windows without Cygwin
3524 https://bugs.webkit.org/show_bug.cgi?id=143219
3526 Reviewed by Brent Fulgham.
3528 * AVFoundationSupport.py: Renamed from Source/WebCore/WebCore.vcxproj/MigrateScripts.
3529 Move logic from DerivedSources.make to its own script
3531 * DerivedSources.make: Paths like /usr/bin don't exist on Windows.
3532 Windows uses del instead of rm -f
3533 Windows doesn't have printf
3534 * WebCore.vcxproj/WebCoreGenerated.make: Pass the CC executable to
3535 build-generated-files.pl
3536 * WebCore.vcxproj/build-generated-files.pl: Export the CC executable as an environment
3537 variable. Don't use /usr/bin.
3538 * WebCore.vcxproj/migrate-scripts.pl: Deleted the MigrateScripts makefile. We don't
3539 need a whole Makefile just to copy 5 files. Moved this logic into migrate-scripts.pl.
3541 * bindings/scripts/preprocessor.pm:
3542 (applyPreprocessor): Support passing preprocessing flags to the Visual Studio
3544 * dom/make_names.pl: Ditto.
3546 2015-03-30 Alexey Proskuryakov <ap@apple.com>
3550 * platform/spi/mac/AVFoundationSPI.h:
3552 2015-03-30 Sam Weinig <sam@webkit.org>
3554 [Content Extensions] Flesh out the UserContentExtensionStore
3555 https://bugs.webkit.org/show_bug.cgi?id=143123
3557 Reviewed by Benjamin Poulain.
3559 - Adds a variant of getFileSize() that takes a PlatformFileHandle.
3560 - Adds a new file system function, rename() which operates as the POSIX
3561 rename function does.
3563 * platform/FileSystem.h:
3566 * platform/posix/FileSystemPOSIX.cpp:
3567 (WebCore::renameFile):
3568 (WebCore::getFileSize):
3569 Add implementations.
3571 * platform/gtk/FileSystemGtk.cpp:
3572 (WebCore::renameFile):
3573 (WebCore::getFileSize):
3574 * platform/win/FileSystemWin.cpp:
3575 (WebCore::getFileSize):
3576 (WebCore::renameFile):
3579 2015-03-30 Per Arne Vollan <peavo@outlook.com>
3581 [WinCairo] Crash when closing window while video is loading
3582 https://bugs.webkit.org/show_bug.cgi?id=143088
3584 Reviewed by Mark Lam.
3586 When the media player is destroyed, we have to cancel possible calls on the
3587 main thread made by a worker thread. Otherwise the destroyed media player
3588 will be accessed when performing the call.
3590 * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3591 (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
3592 (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
3593 (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
3594 (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
3595 (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSourceCallback):
3596 (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySetCallback):
3597 * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3599 2015-03-30 Gwang Yoon Hwang <yoon@igalia.com>
3601 [Threaded Compositor] Crash when animation changes frequently.
3602 https://bugs.webkit.org/show_bug.cgi?id=143213
3604 Reviewed by Simon Fraser.
3606 CompositingCoordinator copies CoordinatedGraphicsLayerState when
3607 flushing GraphicsLayer changes, and ThreadedCoordinatedCompositor passes
3608 it to compositing thread.
3610 To ensure thread-safety, we need to provide copy constructor to copy
3611 Animation object in TextureMapperAnimation instead of referencing it.
3613 Since TimingFunction and TransformOperation used by KeyframeValueList are
3614 not ThreadSafeRefCounted, these should be cloned also.
3616 No new tests needed.
3618 * platform/graphics/GraphicsLayer.h:
3619 (WebCore::AnimationValue::AnimationValue):
3620 (WebCore::FloatAnimationValue::FloatAnimationValue):
3621 (WebCore::TransformAnimationValue::TransformAnimationValue):
3622 (WebCore::FilterAnimationValue::FilterAnimationValue):
3623 Adds deep copy constructor.
3625 * platform/graphics/texmap/TextureMapperAnimation.cpp:
3626 (WebCore::TextureMapperAnimation::TextureMapperAnimation):
3627 Because the name of the animation can be AtomicString, we need to create
3628 isolated version of string to ensure thread safty.
3630 * platform/graphics/texmap/TextureMapperAnimation.h:
3631 * platform/graphics/transforms/IdentityTransformOperation.h:
3632 * platform/graphics/transforms/Matrix3DTransformOperation.h:
3633 * platform/graphics/transforms/MatrixTransformOperation.h:
3634 * platform/graphics/transforms/PerspectiveTransformOperation.h:
3635 * platform/graphics/transforms/RotateTransformOperation.h:
3636 * platform/graphics/transforms/ScaleTransformOperation.h:
3637 * platform/graphics/transforms/SkewTransformOperation.h:
3638 * platform/graphics/transforms/TransformOperation.h:
3639 * platform/graphics/transforms/TranslateTransformOperation.h:
3640 Adds TransformOperation::clone() for threadsafety.
3642 2015-03-30 Chris Dumez <cdumez@apple.com>
3644 Cached "Expires" header is not updated upon successful resource revalidation
3645 https://bugs.webkit.org/show_bug.cgi?id=143228
3646 <rdar://problem/20348059>
3648 Reviewed by Antti Koivisto.
3650 Cached "Expires" header was not updated upon successful resource
3651 revalidation. This affected both our disk cache and our memory cache.
3652 This was caused by shouldUpdateHeaderAfterRevalidation() in
3653 CacheValidation.cpp returning false for the "Expires" header.
3655 There is a comment there stating that the list of ignored headers
3656 matches Chromium's net library but that's not the case, at least not
3658 http://osxr.org/android/source/external/chromium/net/http/http_response_headers.cc
3660 HTTP servers such as Apache return an "Expires" header in their 304
3661 responses and the "Expires" header is potentially a new one. However,
3662 our caches were ignoring the updated expiration date and kept using the
3663 old one, which meant that the cached resource expired sooner than it
3666 See the following Apache bugs that explain the issue:
3667 https://bz.apache.org/bugzilla/show_bug.cgi?id=24884
3668 https://bz.apache.org/bugzilla/show_bug.cgi?id=25123
3670 Test: http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html
3672 * platform/network/CacheValidation.cpp:
3674 2015-03-30 Antti Koivisto <antti@apple.com>
3676 Don't cache resources that are very unlikely to be reused
3677 https://bugs.webkit.org/show_bug.cgi?id=143226
3678 <rdar://problem/20347160>
3680 Reviewed by Geoff Garen.
3682 Allow overriding resource load priorities via Internals for testing.
3684 * loader/FrameLoader.cpp:
3685 (WebCore::FrameLoader::addExtraFieldsToRequest):
3686 (WebCore::FrameLoader::clearTestingOverrides):
3687 * loader/FrameLoader.h:
3688 (WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting):
3689 (WebCore::FrameLoader::clearOverrideCachePolicyForTesting): Deleted.
3690 * page/DiagnosticLoggingKeys.cpp:
3691 (WebCore::DiagnosticLoggingKeys::unlikelyToReuseKey):
3692 * page/DiagnosticLoggingKeys.h:
3696 * testing/Internals.cpp:
3697 (WebCore::Internals::resetToConsistentState):
3698 (WebCore::stringToResourceLoadPriority):
3699 (WebCore::Internals::setOverrideResourceLoadPriority):
3700 * testing/Internals.h:
3701 * testing/Internals.idl:
3703 2015-03-30 Javier Fernandez <jfernandez@igalia.com>
3705 [CSS Grid Layout] Upgrade align-self and align-items parsing to CSS 3
3706 https://bugs.webkit.org/show_bug.cgi?id=133359
3708 Reviewed by David Hyatt.
3710 From Blink r164817 and r165264 by <jchaffraix@chromium.org>
3712 Broaden justify-self's parsing name
3714 This is in preparation of migrating align-self, align-items
3715 and justify-items to the CSS 3 Alignment syntax.
3717 The current naming was too tied to justify-self and needs to
3718 be broadened. This will reduce the follow-up implementations'
3721 Upgrade align-self and align-items parsing to CSS 3
3723 This change migrates the 2 properties to the CSS 3 Alignment
3724 parsing. The new parsing is identical to how we parse
3725 'justify-self'. The 2 properties need to be migrated together
3726 as they are used in tandem in CSSComputedStyleDeclaration.
3728 This change also removes EAlignItems as it is now unused.
3730 Tests: css3/parse-align-items.html
3731 css3/parse-align-self.html
3733 * css/CSSComputedStyleDeclaration.cpp:
3734 (WebCore::resolveAlignmentAuto): Added. Resolves the "auto" value for the alignment properties.
3735 (WebCore::valueForItemPositionWithOverflowAlignment): Added. Builds the CSSValue for the for the alignment properties.
3736 (WebCore::ComputedStyleExtractor::propertyValue):
3737 * css/CSSParser.cpp:
3738 (WebCore::isValidKeywordPropertyAndValue): Removed align-self, align-items and justify-items.
3739 (WebCore::isKeywordPropertyID): Removed align-self, align-items and justify-items.
3740 (WebCore::isBaselinePositionKeyword): Added. Set of keywords related to baseline value.
3741 (WebCore::CSSParser::parseItemPositionOverflowPosition): Generic parsing fuction for the alignment properties.
3742 (WebCore::CSSParser::parseJustifySelf): Deleted.
3743 (WebCore::CSSParser::parseValue): Added align-items and align-self to the list and call to the generic parsing fuction for the alignment properties.
3745 * css/CSSPrimitiveValueMappings.h:
3746 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added.
3747 (WebCore::CSSPrimitiveValue::operator ItemPosition): Added. Replace the old EAlignItems enumeration.
3748 (WebCore::CSSPrimitiveValue::operator OverflowAlignment): Added.
3749 (WebCore::CSSPrimitiveValue::operator EAlignItems): Deleted.
3750 (WebCore::CSSPrimitiveValue::operator EJustifySelf): Deleted.
3751 (WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment): Deleted.
3752 * css/CSSPropertyNames.in:
3753 * css/CSSValueKeywords.in:
3754 * css/StyleBuilderCustom.h:
3755 (WebCore::StyleBuilderCustom::applyInheritAlignSelf): Added.
3756 (WebCore::StyleBuilderCustom::applyInitialAlignSelf): Added.
3757 (WebCore::StyleBuilderCustom::applyValueAlignSelf): Added.
3758 (WebCore::StyleBuilderCustom::applyInheritAlignItems): Added.
3759 (WebCore::StyleBuilderCustom::applyInitialAlignItems): Added.
3760 (WebCore::StyleBuilderCustom::applyValueAlignItems): Added.
3761 (WebCore::StyleBuilderCustom::applyInheritJustifySelf): Added.
3762 (WebCore::StyleBuilderCustom::applyInitialJustifySelf): Added.
3763 (WebCore::StyleBuilderCustom::applyValueJustifySelf): Added.
3764 (WebCore::StyleBuilderCustom::applyValueWebkitJustifySelf): Deleted.
3765 * css/StyleResolver.cpp:
3766 (WebCore::StyleResolver::adjustRenderStyle): isDisplayFlexibleOrGridBox now a RenderStyle function.
3767 (WebCore::isDisplayFlexibleBox): Deleted. Moved to RenderStyle.
3768 (WebCore::isDisplayGridBox): Deleted. Moved to RenderStyle.
3769 (WebCore::isDisplayFlexibleOrGridBox): Deleted. Moved to RenderStyle.
3770 * rendering/RenderBox.cpp:
3771 (WebCore::flexItemHasStretchAlignment): Adapted to the new ItemPostition enum.
3772 * rendering/RenderFlexibleBox.cpp:
3773 (WebCore::RenderFlexibleBox::firstLineBaseline): Adapted to the new ItemPostition enum.
3774 (WebCore::RenderFlexibleBox::styleDidChange): Adapted to the new ItemPostition enum.
3775 (WebCore::RenderFlexibleBox::alignmentForChild): Adapted to the new ItemPostition enum.
3776 (WebCore::RenderFlexibleBox::needToStretchChild): Adapted to the new ItemPostition enum.
3777 (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Adapted to the new ItemPostition enum.
3778 (WebCore::RenderFlexibleBox::alignChildren): Adapted to the new ItemPostition enum.
3779 (WebCore::resolveAlignment): Deleted. Moved to RenderStyle.
3780 * rendering/RenderFlexibleBox.h:
3781 * rendering/RenderFullScreen.cpp:
3782 (WebCore::createFullScreenStyle): Adapted to the new ItemPostition enum.
3783 * rendering/RenderMenuList.cpp:
3784 (WebCore::RenderMenuList::adjustInnerStyle): Adapted to the new ItemPostition enum.
3785 * rendering/mathml/RenderMathMLRoot.cpp:
3786 (WebCore::RenderMathMLRoot::updateStyle): Adapted to the new ItemPostition enum.
3787 * rendering/mathml/RenderMathMLScripts.cpp:
3788 (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Adapted to the new ItemPostition enum.
3789 (WebCore::RenderMathMLScripts::fixAnonymousStyles): Adapted to the new ItemPostition enum.
3790 * rendering/style/ContentData.h:
3791 * rendering/style/RenderStyle.cpp:
3792 (WebCore::RenderStyle::resolveAlignment): Added.
3793 * rendering/style/RenderStyle.h: Adapted to the new ItemPostition enum.
3794 * rendering/style/RenderStyleConstants.h: Adapted to the new ItemPostition enum.
3795 * rendering/style/StyleRareNonInheritedData.cpp: Adapted to the new ItemPostition enum.
3796 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Adapted to the new ItemPostition enum.
3797 (WebCore::StyleRareNonInheritedData::operator==): Adapted to the new ItemPostition enum.
3798 * rendering/style/StyleRareNonInheritedData.h: Adapted to the new ItemPostition enum.
3799 * style/StyleResolveTree.cpp:
3800 (WebCore::Style::determineChange): Changes in the alignItems property cause a Detach.
3802 2015-03-27 David Hyatt <hyatt@apple.com>
3804 [New Block-Inside-Inline Model] Create anonymous inline blocks to hold blocks-inside-inlines.
3805 https://bugs.webkit.org/show_bug.cgi?id=143145
3807 Reviewed by Dean Jackson.
3809 Added fast/block/inside-inlines/ tests.
3811 * rendering/RenderBlock.cpp:
3812 (WebCore::RenderBlock::renderName):
3813 Add support for labeling anonymous inline-blocks when dumped by the render tree.
3815 * rendering/RenderInline.cpp:
3816 (WebCore::RenderInline::addChildIgnoringContinuation):
3817 When the pref is set to use the new block-inside-inline model, create an anonymous inline block to
3818 hold block children of RenderInlines instead of splitting flows or creating continuations.
3820 * rendering/RenderObject.h:
3821 (WebCore::RenderObject::isAnonymousInlineBlock):
3822 Add the definition of isAnonymousInlineBlock (note the exclusion of Ruby, since Ruby creates anonymous
3823 inline-blocks also).
3825 2015-03-30 Chris Dumez <cdumez@apple.com>
3827 [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
3828 https://bugs.webkit.org/show_bug.cgi?id=143159
3829 <rdar://problem/20333296>
3831 Reviewed by Antti Koivisto.
3833 Add support for "Cache-Control: max-stale" request header:
3834 https://tools.ietf.org/html/rfc7234#section-5.2.1.2
3836 Test: http/tests/cache/disk-cache/disk-cache-request-max-stale.html
3838 * platform/network/CacheValidation.cpp:
3839 (WebCore::parseCacheControlDirectives):
3840 * platform/network/CacheValidation.h:
3842 2015-03-30 Simon Fraser <simon.fraser@apple.com>
3844 Fix iOS internal build after r182132.
3846 * page/scrolling/ScrollingCoordinator.cpp:
3847 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
3849 2015-03-30 Jer Noble <jer.noble@apple.com>
3851 [iOS] When Web Audio is interrupted by a phone call, it cannot be restarted.
3852 https://bugs.webkit.org/show_bug.cgi?id=143190
3854 Reviewed by Darin Adler.
3856 Tests: webaudio/audiocontext-state-interrupted.html
3857 webaudio/audiocontext-state.html
3859 Implement the following methods and properties from the Web Audio spec:
3860 close(), suspend(), resume(), onstatechange.
3862 AudioContext will take more responsibility for tracking state and interruptions (and
3863 AudioDestination will give up that responsibility). This means AudioContext must be a
3864 MediaSessionClient, and own its own MediaSession. In return, AudioDestinationIOS and
3865 AudioDestinationMac relinquish both.
3867 * Modules/webaudio/AudioContext.cpp:
3868 (WebCore::AudioContext::AudioContext): Set default values in header.
3869 (WebCore::AudioContext::uninitialize): Call setState() instead of setting m_state.
3870 (WebCore::AudioContext::addReaction): Added. Append the callback to the appropriate vector for the state.
3871 (WebCore::AudioContext::setState): Added. Fire events and resolve the appropriate reaction callbacks for the new state.
3872 (WebCore::AudioContext::state): Return a string representing the context's state.
3873 (WebCore::AudioContext::stop): Close the event queue.
3874 (WebCore::AudioContext::startRendering): Call setState().
3875 (WebCore::AudioContext::fireCompletionEvent): Call setState().
3876 (WebCore::AudioContext::suspendContext): Added. Add reaction callback and call suspend() on the destination node.
3877 (WebCore::AudioContext::resumeContext): Added. Add reaction callback and call resume() on the destination node.
3878 (WebCore::AudioContext::closeContext): Added. Add reaction callback and call close() on the destination node.
3879 (WebCore::AudioContext::suspendPlayback): Added. Suspend playback and set state to interrupted.
3880 (WebCore::AudioContext::mayResumePlayback): Added. Conditionally resume playback.
3881 * bindings/js/JSAudioContextCustom.cpp:
3882 (WebCore::JSAudioContext::suspend): Added. Create and return a new Promise object.
3883 (WebCore::JSAudioContext::resume): Ditto.