05e84049aa99fd670f9095a6b5ea4a76f968a75f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-31  Jeremy Jones  <jeremyj@apple.com>
2
3         mediaShouldUsePersistentCache() is redundant. Use Page::usesEphemeralSession() instead.
4         https://bugs.webkit.org/show_bug.cgi?id=155924
5
6         Reviewed by Simon Fraser.
7
8         No new tests because there is no behavior change.
9
10         Remove machinery for mediaShouldUsePersistentCache() adopt usesEphemeralSession().
11
12         * html/HTMLMediaElement.cpp:
13         (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache):
14         * page/ChromeClient.h: remove mediaShouldUsePersistentCache()
15
16 2016-03-30  Ada Chan  <adachan@apple.com>
17
18         Add the new "toggle enhanced fullscreen" context menu item to the video context menu on supporting platforms.
19         https://bugs.webkit.org/show_bug.cgi?id=156031
20
21         Reviewed by Eric Carlson.
22
23         * page/ContextMenuController.cpp:
24         (WebCore::ContextMenuController::contextMenuItemSelected):
25         Handle the selection of the context menu item.
26         (WebCore::ContextMenuController::populate):
27         Add this menu item on Mac.
28         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
29         Set the menu item's title depending on the current enhanced fullscreen state
30         and enable this menu item if supported.
31
32         * platform/ContextMenuItem.h:
33         Define the new tag for this menu item.
34
35         * platform/LocalizedStrings.cpp:
36         (WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen):
37         (WebCore::contextMenuItemTagExitVideoEnhancedFullscreen):
38         * platform/LocalizedStrings.h:
39
40         * rendering/HitTestResult.cpp:
41         (WebCore::HitTestResult::mediaSupportsEnhancedFullscreen):
42         (WebCore::HitTestResult::mediaIsInEnhancedFullscreen):
43         (WebCore::HitTestResult::toggleEnhancedFullscreenForVideo):
44         * rendering/HitTestResult.h:
45
46 2016-03-31  Nan Wang  <n_wang@apple.com>
47
48         AX: aria-hidden=false causes video fallback content to be exposed to AX API
49         https://bugs.webkit.org/show_bug.cgi?id=149278
50
51         Reviewed by Chris Fleizach.
52
53         The comment says when aria-hidden="false" and object is not rendered, we should
54         check each parent's aria-hidden status until we encounter a rendered object. So 
55         added a check for the rendered parent in order to break out of the loop earlier.
56
57         Test case covered in modified accessibility/aria-hidden-negates-no-visibility.html
58
59         * accessibility/AXObjectCache.cpp:
60         (WebCore::isNodeAriaVisible):
61
62 2016-03-31  Brent Fulgham  <bfulgham@apple.com>
63
64         [WK2] Support download attribute feature
65         https://bugs.webkit.org/show_bug.cgi?id=102914
66         <rdar://problem/13177492>
67
68         Reviewed by Darin Adler.
69
70         Tested by imported/w3c/web-platform-tests/html/dom/interfaces.html
71                   imported/w3c/web-platform-tests/html/dom/reflection-text.html
72
73         A first draft implementation of this feature.
74
75         * html/HTMLAnchorElement.cpp:
76         (WebCore::HTMLAnchorElement::handleClick): If the anchor has the 'download'
77         attribute, pass along the information to the rest of the load system.
78         * loader/FrameLoadRequest.h:
79         (WebCore::FrameLoadRequest::FrameLoadRequest): Create new overload that
80         accepts a download attribute flag and a suggested filename.
81         (WebCore::FrameLoadRequest::hasDownloadAttribute): Added.
82         (WebCore::FrameLoadRequest::suggestedFilename): Added.
83         * loader/FrameLoader.cpp:
84         (WebCore::FrameLoader::urlSelected): Expand to accept the download attribute
85         flag and suggested filename.
86         (WebCore::FrameLoader::loadURL): Populate the NavigationAction with the new
87         download attribute flag and suggested filename.
88         (WebCore::FrameLoader::loadPostRequest): Ditto.
89         * loader/FrameLoader.h:
90         * loader/FrameLoaderTypes.h: Add new 'HasDownloadAttribute' enum.
91         * loader/NavigationAction.cpp:
92         (WebCore::navigationType):
93         (WebCore::NavigationAction::NavigationAction): Update to accept new download
94         attribute flag and suggested filename.
95         * loader/NavigationAction.h:
96         (WebCore::NavigationAction::hasDownloadAttribute): Added.
97         (WebCore::NavigationAction::suggestedFilename): Added.
98         * loader/PolicyChecker.cpp:
99         (WebCore::PolicyChecker::checkNavigationPolicy): Pass more information to
100         'continueAfterNavigationPolicy'
101         (WebCore::PolicyChecker::continueAfterNavigationPolicy): Accept suggested
102         filename
103         * loader/PolicyChecker.h:
104
105 2016-03-31  Youenn Fablet  <youenn.fablet@crf.canon.fr>
106
107         [Fetch API] Add basic loading of resources for Workers
108         https://bugs.webkit.org/show_bug.cgi?id=155886
109
110         Reviewed by Alex Christensen.
111
112         Adding impplementation to WorkerGlobalScopeFetch::fetch similarly to DOMWindowFetch::fetch.
113         Refactored code in FetchResponse to share code between the two.
114
115         Updated WorkerThreadableLoader to cope with an ASSERT.
116         The ASSERT ensures that a DocumentThreadableLoader::create returns non null. 
117         In our case, it might happen as all cross origin fetch requests are denied at the moment.
118         This leads to calling didFail in DocumentThreadableLoader::create call and DocumentThreadableLoader::create to return null.
119         Updated the ASSERT to ensures that either the load is finished or DocumentThreadableLoader::create does not return null.
120
121         Covered by rebased tests.
122
123         * Modules/fetch/DOMWindowFetch.cpp:
124         (WebCore::DOMWindowFetch::fetch):
125         * Modules/fetch/FetchResponse.cpp:
126         (WebCore::FetchResponse::startFetching):
127         (WebCore::FetchResponse::fetch):
128         * Modules/fetch/FetchResponse.h:
129         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
130         (WebCore::WorkerGlobalScopeFetch::fetch):
131         * Modules/fetch/WorkerGlobalScopeFetch.h:
132         * loader/WorkerThreadableLoader.cpp:
133         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
134         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
135         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
136         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck):
137         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
138         * loader/WorkerThreadableLoader.h:
139
140 2016-03-31  Youenn Fablet  <youenn.fablet@crf.canon.fr>
141
142         [Fetch API] Move isDisturbed handling to FetchBodyOwner
143         https://bugs.webkit.org/show_bug.cgi?id=155968
144
145         Reviewed by Darin Adler.
146
147         Moved isDisturbed handling in FetchBodyOwner.
148         This includes promise rejection in case of disturbed bodies.
149
150         No behavior change observable from user scripts.
151
152         * Modules/fetch/FetchBody.cpp:
153         (WebCore::FetchBody::arrayBuffer):
154         (WebCore::FetchBody::blob):
155         (WebCore::FetchBody::json):
156         (WebCore::FetchBody::text):
157         (WebCore::FetchBody::extractFromBody):
158         (WebCore::FetchBody::consume):
159         (WebCore::FetchBody::consumeArrayBuffer):
160         (WebCore::FetchBody::processIfEmptyOrDisturbed): Deleted.
161         * Modules/fetch/FetchBody.h:
162         (WebCore::FetchBody::isEmpty): Deleted.
163         * Modules/fetch/FetchBodyOwner.cpp:
164         (WebCore::FetchBodyOwner::arrayBuffer):
165         (WebCore::FetchBodyOwner::blob):
166         (WebCore::FetchBodyOwner::formData):
167         (WebCore::FetchBodyOwner::json):
168         (WebCore::FetchBodyOwner::text):
169         * Modules/fetch/FetchBodyOwner.h:
170         (WebCore::FetchBodyOwner::isDisturbed):
171         (WebCore::FetchBodyOwner::setDisturbed):
172         * Modules/fetch/FetchRequest.cpp:
173         (WebCore::FetchRequest::create):
174         * Modules/fetch/FetchResponse.cpp:
175         (WebCore::FetchResponse::clone):
176
177 2016-03-31  Youenn Fablet  <youenn.fablet@crf.canon.fr>
178
179         Remove forEach use from Fetch Headers builtin constructor
180         https://bugs.webkit.org/show_bug.cgi?id=155967
181
182         Reviewed by Joseph Pecoraro.
183
184         Tests: fetch/shadowing-forEach.html
185                streams/shadowing-Promise.html
186                streams/shadowing-defineProperty.html
187
188         * Modules/fetch/FetchHeaders.idl: Adding fillFromJS private method.
189         * Modules/fetch/FetchHeaders.js:
190         (initializeFetchHeaders): Using fillFromJS private method. Using
191         instanceof test to check whether parameter is Headers or subclass of it.
192         * bindings/js/WebCoreBuiltinNames.h: Adding fillFromJS private symbol.
193
194 2016-03-30  Alex Christensen  <achristensen@webkit.org>
195
196         Fix Windows build.
197
198         * platform/text/LineEnding.cpp:
199         make the char's and uint8_t's compile.
200
201 2016-03-30  Alex Christensen  <achristensen@webkit.org>
202
203         Build fix.
204
205         * platform/text/LineEnding.cpp:
206
207 2016-03-30  Alex Christensen  <achristensen@webkit.org>
208
209         Fix GTK and Windows builds after r198869.
210
211         * platform/network/soup/ResourceHandleSoup.cpp:
212         (WebCore::blobIsOutOfDate):
213         (WebCore::addEncodedBlobItemToSoupMessageBody):
214         * platform/text/LineEnding.cpp:
215
216 2016-03-30  Simon Fraser  <simon.fraser@apple.com>
217
218         [iOS WK2] Avoid creating tiles that are too large for rendering
219         https://bugs.webkit.org/show_bug.cgi?id=156050
220         rdar://problem/25424541
221
222         Reviewed by Darin Adler.
223
224         In the case of a WKWebView which is sized large enough to show an entire document
225         (for example, when enclosed inside a UIScrollView), we would create tiles that were
226         larger than CoreAnimation was willing to deal with.
227         
228         * platform/graphics/ca/TileController.cpp:
229         (WebCore::TileController::tileSize): Take the device scale, and the max IOSurface size
230         into account when computing the max tile size.
231         * platform/graphics/cocoa/IOSurface.mm:
232         (IOSurface::maximumSize): CoreAnimation imposes limits in addition to the size reported
233         by IOSurfaceGetPropertyMaximum(), namely an 8k cap, so mimic that here.
234         (IOSurface::ensurePlatformContext): Typo.
235
236 2016-03-30  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
237
238         [EFL][CMake] WebKit include path has been added to system include path
239         https://bugs.webkit.org/show_bug.cgi?id=156019
240
241         Reviewed by Darin Adler.
242
243         Fix wrong include path addition.
244
245         * PlatformEfl.cmake:
246
247             Add ${WEBCORE_DIR}/platform/graphics/surfaces/egl to WebCore include directory path.
248
249 2016-03-30  Joanmarie Diggs  <jdiggs@igalia.com>
250
251         AX: Update handling of SVG elements with presentational role
252         https://bugs.webkit.org/show_bug.cgi?id=156042
253
254         Reviewed by Chris Fleizach.
255
256         Because the new expected behavior is to treat SVG elements with a
257         presentational role just like we treat other host language elements
258         with a presentational role, delete AccessibilitySVGElement's
259         determineAriaRoleAttribute().
260
261         No new test files. The expectations for w3c-svg-presentational-role.html
262         were updated because the presentational elements which have global ARIA
263         attributes are now being included in the accessibility tree. In addition,
264         several new test cases were added to this layout test so that we have
265         coverage for more presentational elements which lack global ARIA attributes.
266
267         * accessibility/AccessibilitySVGElement.cpp:
268         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute): Deleted.
269         * accessibility/AccessibilitySVGElement.h:
270
271 2016-03-30  Brady Eidson  <beidson@apple.com>
272
273         Make BlobData use ThreadSafeSharedBuffer instead of RawData.
274         https://bugs.webkit.org/show_bug.cgi?id=156041
275
276         Reviewed by Alex Christensen.
277
278         No new tests (No change in behavior).
279
280         * Modules/fetch/FetchBody.cpp:
281         (WebCore::FetchBody::consumeText):
282         (WebCore::FetchBody::extractFromText):
283         (WebCore::blobFromArrayBuffer):
284         * Modules/fetch/FetchBody.h:
285         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
286         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
287         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
288         * Modules/websockets/WebSocket.cpp:
289         (WebCore::WebSocket::didReceiveBinaryData):
290         * Modules/websockets/WebSocket.h:
291         * Modules/websockets/WebSocketChannel.cpp:
292         (WebCore::WebSocketChannel::processFrame):
293         * Modules/websockets/WebSocketChannel.h:
294         * Modules/websockets/WebSocketChannelClient.h:
295         (WebCore::WebSocketChannelClient::didReceiveBinaryData):
296         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
297         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
298         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
299         * fileapi/Blob.cpp:
300         (WebCore::Blob::Blob):
301         * fileapi/Blob.h:
302         (WebCore::Blob::create):
303         * fileapi/WebKitBlobBuilder.h:
304         * platform/network/BlobData.cpp:
305         (WebCore::BlobData::BlobData):
306         (WebCore::BlobDataItem::length):
307         (WebCore::BlobData::appendData):
308         (WebCore::BlobData::setContentType): Deleted.
309         * platform/network/BlobData.h:
310         (WebCore::BlobDataItem::type):
311         (WebCore::BlobDataItem::data):
312         (WebCore::BlobDataItem::file):
313         (WebCore::BlobDataItem::BlobDataItem):
314         (WebCore::BlobData::create):
315         (WebCore::RawData::create): Deleted.
316         (WebCore::RawData::data): Deleted.
317         (WebCore::RawData::length): Deleted.
318         (WebCore::RawData::RawData): Deleted.
319         * platform/network/BlobPart.h:
320         (WebCore::BlobPart::BlobPart):
321         (WebCore::BlobPart::data):
322         (WebCore::BlobPart::moveData):
323         * platform/network/BlobRegistryImpl.cpp:
324         (WebCore::BlobRegistryImpl::appendStorageItems):
325         (WebCore::BlobRegistryImpl::registerFileBlobURL):
326         (WebCore::BlobRegistryImpl::registerBlobURL):
327         (WebCore::BlobRegistryImpl::registerBlobURLForSlice):
328         * platform/network/BlobResourceHandle.cpp:
329         (WebCore::BlobResourceHandle::getSizeForNext):
330         (WebCore::BlobResourceHandle::readSync):
331         (WebCore::BlobResourceHandle::readDataSync):
332         (WebCore::BlobResourceHandle::readFileSync):
333         (WebCore::BlobResourceHandle::readAsync):
334         (WebCore::BlobResourceHandle::readDataAsync):
335         (WebCore::BlobResourceHandle::readFileAsync):
336         * platform/network/BlobResourceHandle.h:
337         * platform/network/FormData.cpp:
338         (WebCore::appendBlobResolved):
339         * platform/network/soup/ResourceHandleSoup.cpp:
340         (WebCore::blobIsOutOfDate):
341         (WebCore::addEncodedBlobItemToSoupMessageBody):
342         * platform/text/LineEnding.cpp:
343         (WebCore::normalizeToCROrLF):
344         (WebCore::normalizeLineEndingsToNative):
345         (WebCore::normalizeLineEndingsToCR): Deleted.
346         (WebCore::normalizeLineEndingsToLF): Deleted.
347         * platform/text/LineEnding.h:
348         * xml/XMLHttpRequest.cpp:
349         (WebCore::XMLHttpRequest::responseBlob):
350
351 2016-03-30  Enrica Casucci  <enrica@apple.com>
352
353         Add a style for Data Detectors links.
354         https://bugs.webkit.org/show_bug.cgi?id=155996
355         rdar://problem/25343514
356
357         Reviewed by Sam Weinig.
358
359         Based on indication from the data detection engine,
360         we style some of the links differently.
361
362         * editing/cocoa/DataDetection.mm:
363         (WebCore::DataDetection::detectContentInRange):
364         * platform/cocoa/DataDetectorsCoreSoftLink.h:
365         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
366
367 2016-03-30  Myles C. Maxfield  <mmaxfield@apple.com>
368
369         [OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
370         https://bugs.webkit.org/show_bug.cgi?id=155962
371
372         Reviewed by Darin Adler.
373
374         We can control the animation direction with the NSScrollerImp property
375         userInterfaceLayoutDirection.
376
377         This patch also adds an Internals function to set whether or not we
378         should mock the scrollbars. Not mocking the scrollbars is required
379         to use NSScrollerImps.
380
381         Test: fast/scrolling/rtl-scrollbars-animation-property.html
382
383         * platform/ScrollableArea.h: Use nullptr instead of 0.
384         (WebCore::ScrollableArea::horizontalScrollbar):
385         (WebCore::ScrollableArea::verticalScrollbar):
386         (WebCore::ScrollableArea::tiledBacking):
387         (WebCore::ScrollableArea::layerForHorizontalScrollbar):
388         (WebCore::ScrollableArea::layerForVerticalScrollbar):
389         (WebCore::ScrollableArea::layerForScrolling):
390         (WebCore::ScrollableArea::layerForScrollCorner):
391         (WebCore::ScrollableArea::layerForOverhangAreas):
392         * platform/mac/ScrollAnimatorMac.mm:
393         (WebCore::ScrollAnimatorMac::updateScrollerStyle): Set the direction
394         of the new NSScrollerImps.
395         * platform/mac/ScrollbarThemeMac.h:
396         * platform/mac/ScrollbarThemeMac.mm:
397         (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Set the direction
398         of an NSScrollerImp.
399         (WebCore::ScrollbarThemeMac::registerScrollbar): Call
400         didCreateScrollerImp().
401         (WebCore::ScrollbarThemeMac::isLayoutDirectionRTL): Used for testing,
402         to tell if the scroller's direction is RTL.
403         * platform/spi/mac/NSScrollerImpSPI.h:
404         * rendering/RenderTreeAsText.cpp:
405         (WebCore::write):
406         * testing/Internals.cpp:
407         (WebCore::Internals::setMockScrollbarsEnabled): Used for testing.
408         * testing/Internals.h:
409         * testing/Internals.idl:
410
411 2016-03-30  Sam Weinig  <sam@webkit.org>
412
413         -webkit-text-underline-position: under; does not work in ToT
414         https://bugs.webkit.org/show_bug.cgi?id=156038
415
416         Reviewed by David Hyatt.
417
418         Test: fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-vs-alphabetic.html
419
420         * style/InlineTextBoxStyle.cpp:
421         (WebCore::computeUnderlineOffset):
422         Only resolve the underline position when based on the InlineTextBox when it is specified as auto.
423
424 2016-03-30  Alex Christensen  <achristensen@webkit.org>
425
426         Fix Windows EWS after r198766
427         https://bugs.webkit.org/show_bug.cgi?id=156029
428
429         Reviewed by Brent Fulgham.
430
431         * CMakeLists.txt:
432         * PlatformWin.cmake:
433         Copy headers before compiling WebCoreDerivedSources, not just before compiling WebCore.
434
435 2016-03-30  Brady Eidson  <beidson@apple.com>
436
437         Random SerializedScriptValue cleanup.
438         https://bugs.webkit.org/show_bug.cgi?id=156032
439
440         Rubberstamped by Tim Hatcher.
441
442         - Remove two unused functions.
443         - Make the class always be ThreadSafeRefCounted.
444
445         * bindings/js/SerializedScriptValue.cpp:
446         (WebCore::SerializedScriptValue::numberValue): Deleted.
447         (WebCore::SerializedScriptValue::undefinedValue): Deleted.
448         * bindings/js/SerializedScriptValue.h:
449
450 2016-03-30  Brent Fulgham  <bfulgham@apple.com>
451
452         Avoid WebCore-prefixed paths when building WebCore
453         https://bugs.webkit.org/show_bug.cgi?id=156027
454
455         Reviewed by David Kilzer.
456
457         Replace instances of '#include <WebCore/XXXYYY.h>"' with the normal
458         '#include "XXXYYY.h"' for files inside WebCore.
459
460         * config.h:
461         * inspector/InspectorTimelineAgent.cpp:
462         * page/ViewportConfiguration.cpp:
463         * platform/audio/ios/AudioDestinationIOS.cpp:
464         * platform/cocoa/WebVideoFullscreenModel.h:
465         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
466         * platform/graphics/Font.h:
467         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
468         * platform/graphics/cg/ColorCG.cpp:
469         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
470         * platform/mac/WebVideoFullscreenInterfaceMac.h:
471         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
472
473 2016-03-30  Said Abou-Hallawa  <sabouhallawa@apple,com>
474
475         Move the CG ImageDecoder class from ImageSourceCG.cpp to ImageDecoderCG.h and .cpp
476         https://bugs.webkit.org/show_bug.cgi?id=155980
477
478         Reviewed by Simon Fraser.
479
480         After this step, ImageSource.cpp and ImageSourceCG.cpp look very similar
481         so they can be merged in one file. All the redundant code in these two files
482         can be removed.
483
484         * PlatformAppleWin.cmake:
485         * PlatformMac.cmake:
486         * WebCore.xcodeproj/project.pbxproj:
487         * platform/graphics/cg/ImageDecoderCG.cpp: Copied from Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp.
488         (WebCore::createImageSourceOptions):
489         (WebCore::imageSourceOptions):
490         (WebCore::orientationFromProperties):
491         (WebCore::sharedBufferGetBytesAtPosition):
492         (WebCore::sharedBufferRelease):
493         (WebCore::ImageDecoder::ImageDecoder):
494         (WebCore::ImageDecoder::subsamplingLevelForScale):
495         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
496         (WebCore::ImageDecoder::filenameExtension):
497         (WebCore::ImageDecoder::isSizeAvailable):
498         (WebCore::ImageDecoder::size):
499         (WebCore::ImageDecoder::frameCount):
500         (WebCore::ImageDecoder::repetitionCount):
501         (WebCore::ImageDecoder::hotSpot):
502         (WebCore::ImageDecoder::frameSizeAtIndex):
503         (WebCore::ImageDecoder::frameIsCompleteAtIndex):
504         (WebCore::ImageDecoder::orientationAtIndex):
505         (WebCore::ImageDecoder::frameDurationAtIndex):
506         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
507         (WebCore::ImageDecoder::frameHasAlphaAtIndex):
508         (WebCore::ImageDecoder::frameBytesAtIndex):
509         (WebCore::ImageDecoder::createFrameImageAtIndex):
510         (WebCore::ImageDecoder::setData):
511         * platform/graphics/cg/ImageDecoderCG.h: Added.
512         (WebCore::ImageDecoder::create):
513         * platform/graphics/cg/ImageSourceCG.cpp:
514         (WebCore::ImageDecoder::create): Deleted.
515         (WebCore::createImageSourceOptions): Deleted.
516         (WebCore::imageSourceOptions): Deleted.
517         (WebCore::orientationFromProperties): Deleted.
518         (WebCore::sharedBufferGetBytesAtPosition): Deleted.
519         (WebCore::sharedBufferRelease): Deleted.
520         (WebCore::ImageDecoder::ImageDecoder): Deleted.
521         (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
522         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
523         (WebCore::ImageDecoder::filenameExtension): Deleted.
524         (WebCore::ImageDecoder::isSizeAvailable): Deleted.
525         (WebCore::ImageDecoder::size): Deleted.
526         (WebCore::ImageDecoder::frameCount): Deleted.
527         (WebCore::ImageDecoder::repetitionCount): Deleted.
528         (WebCore::ImageDecoder::hotSpot): Deleted.
529         (WebCore::ImageDecoder::frameSizeAtIndex): Deleted.
530         (WebCore::ImageDecoder::frameIsCompleteAtIndex): Deleted.
531         (WebCore::ImageDecoder::orientationAtIndex): Deleted.
532         (WebCore::ImageDecoder::frameDurationAtIndex): Deleted.
533         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
534         (WebCore::ImageDecoder::frameHasAlphaAtIndex): Deleted.
535         (WebCore::ImageDecoder::frameBytesAtIndex): Deleted.
536         (WebCore::ImageDecoder::createFrameImageAtIndex): Deleted.
537         (WebCore::ImageDecoder::setData): Deleted.
538
539 2016-03-30  Per Arne Vollan  <peavo@outlook.com>
540
541         [WinCairo][MediaFoundation] Video size is not always set.
542         https://bugs.webkit.org/show_bug.cgi?id=156020
543
544         Reviewed by Darin Adler.
545
546         Getting the video display control object from the media session might fail the first time.
547         In case it fails, we should try again when setting the video size.
548
549         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
550         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
551         (WebCore::MediaPlayerPrivateMediaFoundation::getVideoDisplay):
552         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
553         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
554
555 2016-03-30  Commit Queue  <commit-queue@webkit.org>
556
557         Unreviewed, rolling out r198828.
558         https://bugs.webkit.org/show_bug.cgi?id=156030
559
560         Confirming PLT regression (Requested by anttik on #webkit).
561
562         Reverted changeset:
563
564         "Separate render tree updating from style resolve"
565         https://bugs.webkit.org/show_bug.cgi?id=155298
566         http://trac.webkit.org/changeset/198828
567
568 2016-03-30  Keith Miller <keith_miller@apple.com>
569
570         Unreviewed, rollout r198808. The patch causes crashes on 32-bit and appears to be a JSBench regression.
571
572 2016-03-30  Myles C. Maxfield  <mmaxfield@apple.com>
573
574         [OS X] [RTL Scrollbars] List boxes should obey RTL scrollbars
575         https://bugs.webkit.org/show_bug.cgi?id=155991
576
577         Reviewed by Darin Adler.
578
579         List boxes were created before RenderLayers, and therefore don't share
580         the scollbar logic with them. Instead, they manage their own Scrollbars.
581         The placement logic needs to be updated to take RTL scrollbars into
582         account.
583
584         Tests: fast/scrolling/rtl-scrollbars-listbox-scroll.html
585                fast/scrolling/rtl-scrollbars-listbox-select-left.html
586                fast/scrolling/rtl-scrollbars-listbox-select-right.html
587                fast/scrolling/rtl-scrollbars-listbox-simple.html
588                fast/scrolling/rtl-scrollbars-listbox.html
589
590         * rendering/RenderBox.cpp:
591         (WebCore::RenderBox::contentBoxRect):
592         * rendering/RenderBox.h:
593         (WebCore::RenderBox::contentBoxRect): Deleted.
594         * rendering/RenderListBox.cpp:
595         (WebCore::RenderListBox::itemBoundingBoxRect):
596         (WebCore::RenderListBox::paintScrollbar):
597         (WebCore::RenderListBox::paintItemBackground):
598         (WebCore::RenderListBox::isPointInOverflowControl):
599         (WebCore::RenderListBox::listIndexAtOffset):
600         (WebCore::RenderListBox::nodeAtPoint):
601         (WebCore::RenderListBox::controlClipRect):
602         (WebCore::RenderListBox::invalidateScrollbarRect):
603         (WebCore::RenderListBox::convertFromScrollbarToContainingView):
604         (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
605         (WebCore::RenderListBox::scrolledToTop):
606         (WebCore::RenderListBox::scrolledToBottom):
607
608 2016-03-30  Myles C. Maxfield  <mmaxfield@apple.com>
609
610         Use references instead of pointers in scrollbar-related code
611         https://bugs.webkit.org/show_bug.cgi?id=155998
612
613         Reviewed by Dean Jackson.
614
615         Migrate pointers to references.
616
617         No new tests because there is no behavior change.
618
619         * page/FrameView.cpp:
620         (WebCore::FrameView::invalidateScrollbarRect):
621         (WebCore::FrameView::setVisibleScrollerThumbRect):
622         * page/FrameView.h:
623         * platform/ScrollView.cpp:
624         (WebCore::ScrollView::convertFromScrollbarToContainingView):
625         (WebCore::ScrollView::convertFromContainingViewToScrollbar):
626         * platform/ScrollView.h:
627         * platform/ScrollableArea.cpp:
628         (WebCore::ScrollableArea::invalidateScrollbar):
629         * platform/ScrollableArea.h:
630         (WebCore::ScrollableArea::convertFromScrollbarToContainingView):
631         (WebCore::ScrollableArea::convertFromContainingViewToScrollbar):
632         * platform/Scrollbar.cpp:
633         (WebCore::Scrollbar::invalidateRect):
634         (WebCore::Scrollbar::convertToContainingView):
635         (WebCore::Scrollbar::convertFromContainingView):
636         * rendering/RenderLayer.cpp:
637         (WebCore::RenderLayer::convertFromScrollbarToContainingView):
638         (WebCore::RenderLayer::convertFromContainingViewToScrollbar):
639         (WebCore::RenderLayer::scrollbarOffset):
640         (WebCore::RenderLayer::invalidateScrollbarRect):
641         * rendering/RenderLayer.h:
642         * rendering/RenderLayerCompositor.cpp:
643         (WebCore::RenderLayerCompositor::destroyRootLayer):
644         * rendering/RenderListBox.cpp:
645         (WebCore::RenderListBox::invalidateScrollbarRect):
646         (WebCore::RenderListBox::convertFromScrollbarToContainingView):
647         (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
648         * rendering/RenderListBox.h:
649         * platform/win/PopupMenuWin.cpp:
650         (WebCore::RenderListBox::invalidateScrollbarRect):
651         * platform/win/PopupMenuWin.h:
652
653 2016-03-24  Simon Fraser  <simon.fraser@apple.com>
654
655         Make animation events non-cancelable
656         https://bugs.webkit.org/show_bug.cgi?id=78110
657
658         Reviewed by Dan Bates.
659
660         Make the animation events non-cancelable.
661
662         Test: animations/animation-events-not-cancelable.html
663
664         * dom/AnimationEvent.cpp:
665         (WebCore::AnimationEvent::AnimationEvent):
666
667 2016-03-30  Manuel Rego Casasnovas  <rego@igalia.com>
668
669         [css-grid] Refactor positioned children code
670         https://bugs.webkit.org/show_bug.cgi?id=155972
671
672         Reviewed by Sergio Villar Senin.
673
674         This is a refactoring of RenderGrid::offsetAndBreadthForPositionedChild()
675         in order to calculate offset and breadth in a more clean way.
676         Hopefully making the code easier to follow.
677
678         Thanks to the refactoring, now positioned children in RTL
679         are working fine if they use the static inline position
680         (when "left" and "right" properties are both "auto").
681
682         The other case (not having a static inline position)
683         will be fixed in a separated patch.
684
685         * rendering/RenderGrid.cpp:
686         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
687
688 2016-03-30  Youenn Fablet  <youenn.fablet@crf.canon.fr>
689
690         Binding generator should allow passing DOM objects parameters as references
691         https://bugs.webkit.org/show_bug.cgi?id=155953
692
693         Reviewed by Alex Christensen.
694
695         Updating binding generator to pass DOM object parameters as references.
696         Introducing UsePointersEvenForNonNullableObjectArguments to disable that change.
697
698         Updating FetchRequest.idl and DOMWindowFetch.idl to pass parameters as references.
699
700         Updated other IDL interfaces to keep passing DOM object parameters as pointers.
701         This should not change the behavior for these interfaces.
702         UsePointersEvenForNonNullableObjectArguments should be progressively removed on those interfaces.
703
704         Binding generator tests covered by rebased binding tests.
705
706         * Modules/encryptedmedia/MediaKeySession.idl:
707         * Modules/encryptedmedia/MediaKeys.idl:
708         * Modules/fetch/DOMWindowFetch.cpp:
709         (WebCore::DOMWindowFetch::fetch):
710         * Modules/fetch/DOMWindowFetch.h:
711         * Modules/fetch/DOMWindowFetch.idl:
712         * Modules/fetch/FetchRequest.cpp:
713         (WebCore::FetchRequest::create):
714         * Modules/fetch/FetchRequest.h:
715         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
716         (WebCore::WorkerGlobalScopeFetch::fetch):
717         * Modules/fetch/WorkerGlobalScopeFetch.h:
718         * Modules/mediacontrols/MediaControlsHost.idl:
719         * Modules/mediasource/MediaSource.idl:
720         * Modules/mediasource/SourceBuffer.idl:
721         * Modules/mediastream/MediaStream.idl:
722         * Modules/speech/SpeechSynthesis.idl:
723         * Modules/webaudio/AudioContext.idl:
724         * Modules/webaudio/OscillatorNode.idl:
725         * Modules/websockets/WebSocket.idl:
726         * bindings/scripts/CodeGeneratorJS.pm:
727         (GenerateParametersCheck):
728         (IsParameterPassedByReference):
729         (GenerateConstructorDefinition):
730         * bindings/scripts/IDLAttributes.txt:
731         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
732         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
733         * bindings/scripts/test/JS/JSTestInterface.cpp:
734         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
735         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
736         * bindings/scripts/test/JS/JSTestObj.cpp:
737         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
738         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
739         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
740         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
741         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
742         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
743         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
744         (WebCore::jsTestObjPrototypeFunctionConvert1):
745         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
746         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
747         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
748         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
749         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
750         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
751         (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
752         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
753         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
754         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
755         (WebCore::constructJSTestOverloadedConstructors1):
756         (WebCore::constructJSTestOverloadedConstructors3):
757         * css/FontFaceSet.idl:
758         * css/WebKitCSSMatrix.idl:
759         * dom/CompositionEvent.idl:
760         * dom/DataTransfer.idl:
761         * dom/Document.idl:
762         * dom/Element.idl:
763         * dom/EventTarget.idl:
764         * dom/KeyboardEvent.idl:
765         * dom/MouseEvent.idl:
766         * dom/MutationEvent.idl:
767         * dom/MutationObserver.idl:
768         * dom/NamedNodeMap.idl:
769         * dom/Node.idl:
770         * dom/Range.idl:
771         * dom/TextEvent.idl:
772         * dom/TouchEvent.idl:
773         * dom/UIEvent.idl:
774         * dom/WebKitNamedFlow.idl:
775         * dom/WheelEvent.idl:
776         * fileapi/FileReader.idl:
777         * fileapi/FileReaderSync.idl:
778         * html/DOMURL.idl:
779         * html/HTMLElement.idl:
780         * html/HTMLMediaElement.idl:
781         * html/HTMLOptionsCollection.idl:
782         * html/HTMLSelectElement.idl:
783         * html/canvas/CanvasRenderingContext2D.idl:
784         * html/canvas/DOMPath.idl:
785         * html/canvas/OESVertexArrayObject.idl:
786         * html/canvas/WebGLDebugShaders.idl:
787         * html/canvas/WebGLRenderingContext.idl:
788         * html/canvas/WebGLRenderingContextBase.idl:
789         * html/track/TextTrack.idl:
790         * inspector/InspectorFrontendHost.idl:
791         * page/DOMSelection.idl:
792         * storage/StorageEvent.idl:
793         * svg/SVGGraphicsElement.idl:
794         * svg/SVGLengthList.idl:
795         * svg/SVGNumberList.idl:
796         * svg/SVGPathSegList.idl:
797         * svg/SVGPointList.idl:
798         * svg/SVGSVGElement.idl:
799         * svg/SVGTransformList.idl:
800         * testing/Internals.idl:
801         * xml/XMLSerializer.idl:
802         * xml/XPathEvaluator.idl:
803         * xml/XPathExpression.idl:
804         * xml/XSLTProcessor.idl:
805
806 2016-03-29  Joonghun Park  <jh718.park@samsung.com>
807
808         [EFL] Fix build break since r198800. Unreviewed.
809         https://bugs.webkit.org/show_bug.cgi?id=156011
810
811         Currently libWebCoreDerivedSources.a cannot see the symbol located in WebCore Source files.
812         This patch let the library can see the symbols of WebCore Sources.
813
814         * PlatformEfl.cmake:
815
816 2016-03-26  Antti Koivisto  <antti@apple.com>
817
818         Separate render tree updating from style resolve
819         https://bugs.webkit.org/show_bug.cgi?id=155298
820
821         Reviewed by Andreas Kling.
822
823         This patch splits computing document style and applying the results into two distinct steps:
824
825         Style::TreeResolver::resolve()
826                 |
827                 | Style::Update
828                 V
829         RenderTreeUpdater::commit()
830
831         Style::TreeResolver::resolve() returns a Style::Update object that contains all the changes to be made
832         for the whole composed tree. RenderTreeUpdater then applies the changes updating, building or tearing
833         down portions of the render tree as needed.
834
835         Style::Update consists of a map that contains new style for each newly resolved element along with some
836         metadata. A separate map contains text nodes that require reconstruction. It also tracks change roots so
837         RenderTreeUpdater needs to traverse the changed subtrees only.
838
839         The patch eliminates the recursive render tree build code path replacing it with iterative functions.
840
841         This will enable future optimizations. For example we won't need to commit to immediate rendering
842         changes simply because some script or internal function requires up-to-date style.
843
844         * CMakeLists.txt:
845         * WebCore.xcodeproj/project.pbxproj:
846         * css/StyleResolver.cpp:
847         (WebCore::StyleResolver::State::State):
848         (WebCore::StyleResolver::styleForElement):
849         * css/StyleResolver.h:
850         (WebCore::StyleResolver::setOverrideDocumentElementStyle):
851         (WebCore::StyleResolver::State::State):
852
853             Root element style is needed for resolving other elements. Add a way to provide it without looking
854             into active document style.
855
856         * dom/Document.cpp:
857         (WebCore::Document::recalcStyle):
858
859             Resolve the document style and commit it immediately (for now).
860
861         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
862         * dom/Document.h:
863         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet):
864         (WebCore::Document::inStyleRecalc):
865         (WebCore::Document::inRenderTreeUpdate):
866         * dom/Element.cpp:
867         (WebCore::Element::setChildIndex):
868
869             Setting the unique bit is now done by style relations update code.
870
871         * dom/Node.cpp:
872         (WebCore::Node::setNeedsStyleRecalc):
873
874             Prevent spurious style invalidation during render tree updating.
875
876         * rendering/RenderBox.cpp:
877         (WebCore::RenderBox::styleDidChange):
878
879             Capturing body element color for color:-webkit-text is now done by TreeResolver.
880
881         * rendering/RenderElement.h:
882         (WebCore::RenderElement::setAnimatableStyle): Deleted.
883
884             No longer used.
885
886         * style/RenderTreePosition.cpp:
887         (WebCore::RenderTreePosition::nextSiblingRenderer):
888
889             Skip over non-rendered slot elements.
890
891         * style/RenderTreeUpdater.cpp: Added.
892         (WebCore::RenderTreeUpdater::Parent::Parent):
893         (WebCore::RenderTreeUpdater::RenderTreeUpdater):
894         (WebCore::hasDisplayContents):
895         (WebCore::findRenderingRoot):
896         (WebCore::RenderTreeUpdater::commit):
897
898             Call updateRenderTree for each change root.
899
900         (WebCore::shouldCreateRenderer):
901         (WebCore::RenderTreeUpdater::updateRenderTree):
902
903             Iteratively traverse the composed tree starting for a change root.
904             Apply the changes calling updateElementRenderer and updateTextRenderer as needed.
905             Enter subtrees that haves changes to apply.
906
907         (WebCore::RenderTreeUpdater::renderTreePosition):
908
909             We may not create renderers for all elements (<slot> or more generally display:contents) that
910             have rendered descendants. Search the parent stack to find the valid position.
911
912         (WebCore::RenderTreeUpdater::pushParent):
913         (WebCore::RenderTreeUpdater::popParent):
914         (WebCore::RenderTreeUpdater::popParentsToDepth):
915
916             Maintain parent stack.
917
918         (WebCore::pseudoStyleCacheIsInvalid):
919         (WebCore::RenderTreeUpdater::updateElementRenderer):
920
921             Create, delete or update the renderer.
922
923         (WebCore::moveToFlowThreadIfNeeded):
924         (WebCore::RenderTreeUpdater::createRenderer):
925         (WebCore::textRendererIsNeeded):
926         (WebCore::createTextRenderer):
927         (WebCore::RenderTreeUpdater::updateTextRenderer):
928         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
929
930             This is moved from TreeResolver.
931
932         (WebCore::needsPseudoElement):
933         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
934
935             Pseudo elements are handled entirely during render tree construction. Compute their style and
936             create or delete them as needed.
937
938         * style/RenderTreeUpdater.h: Added.
939         (WebCore::RenderTreeUpdater::parent):
940         * style/StyleRelations.cpp:
941         (WebCore::Style::commitRelationsToRenderStyle):
942         (WebCore::Style::commitRelations):
943
944             Commit to Style::Update instead of the document if needed.
945
946         (WebCore::Style::commitRelationsToDocument): Deleted.
947         * style/StyleRelations.h:
948         * style/StyleSharingResolver.cpp:
949         (WebCore::Style::elementHasDirectionAuto):
950         (WebCore::Style::SharingResolver::resolve):
951
952             Fetch the shareable style from Style::Update instead of the active document style.
953
954         (WebCore::Style::SharingResolver::findSibling):
955         (WebCore::Style::SharingResolver::canShareStyleWithElement):
956         * style/StyleSharingResolver.h:
957         * style/StyleTreeResolver.cpp:
958         (WebCore::Style::TreeResolver::Parent::Parent):
959
960             No need for render tree position anymore.
961
962         (WebCore::Style::TreeResolver::popScope):
963         (WebCore::Style::TreeResolver::styleForElement):
964         (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
965         (WebCore::Style::createTextRendererIfNeeded):
966         (WebCore::Style::updateTextRendererAfterContentChange):
967         (WebCore::Style::resetStyleForNonRenderedDescendants):
968         (WebCore::Style::detachChildren):
969         (WebCore::Style::detachSlotAssignees):
970         (WebCore::Style::detachRenderTree):
971         (WebCore::Style::TreeResolver::resolveElement):
972
973             Just resolve the style and return it, no more applying or entering render tree construction code paths.
974
975         (WebCore::Style::resolveTextNode):
976         (WebCore::Style::elementImplicitVisibility):
977         (WebCore::Style::TreeResolver::pushParent):
978         (WebCore::Style::TreeResolver::popParent):
979         (WebCore::Style::TreeResolver::popParentsToDepth):
980         (WebCore::Style::shouldResolvePseudoElement):
981         (WebCore::Style::TreeResolver::resolveComposedTree):
982
983             Add style changes to Style::Update.
984
985         (WebCore::Style::TreeResolver::resolve):
986
987             Return Style::Update object if non-empty.
988
989         (WebCore::Style::postResolutionCallbackQueue):
990         (WebCore::Style::shouldCreateRenderer): Deleted.
991         (WebCore::Style::moveToFlowThreadIfNeeded): Deleted.
992         (WebCore::Style::TreeResolver::createRenderer): Deleted.
993         (WebCore::Style::TreeResolver::createRenderTreeForChildren): Deleted.
994         (WebCore::Style::TreeResolver::createRenderTreeForShadowRoot): Deleted.
995         (WebCore::Style::beforeOrAfterPseudoElement): Deleted.
996         (WebCore::Style::setBeforeOrAfterPseudoElement): Deleted.
997         (WebCore::Style::clearBeforeOrAfterPseudoElement): Deleted.
998         (WebCore::Style::needsPseudoElement): Deleted.
999         (WebCore::Style::TreeResolver::createRenderTreeForBeforeOrAfterPseudoElement): Deleted.
1000         (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees): Deleted.
1001         (WebCore::Style::TreeResolver::createRenderTreeRecursively): Deleted.
1002         (WebCore::Style::pseudoStyleCacheIsInvalid): Deleted.
1003         (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement): Deleted.
1004
1005             Remove the recursive render tree building code path.
1006
1007         * style/StyleTreeResolver.h:
1008         (WebCore::Style::TreeResolver::scope):
1009         * style/StyleUpdate.cpp: Added.
1010         (WebCore::Style::Update::Update):
1011         (WebCore::Style::Update::elementUpdate):
1012         (WebCore::Style::Update::textUpdate):
1013         (WebCore::Style::Update::elementStyle):
1014         (WebCore::Style::Update::addElement):
1015         (WebCore::Style::Update::addText):
1016         (WebCore::Style::Update::addPossibleRoot):
1017         * style/StyleUpdate.h: Added.
1018         (WebCore::Style::Update::roots):
1019         (WebCore::Style::Update::document):
1020         * svg/SVGElement.h:
1021         (WebCore::SVGElement::updateRelativeLengthsInformation):
1022         * svg/SVGUseElement.cpp:
1023         (WebCore::SVGUseElement::svgAttributeChanged):
1024         (WebCore::SVGUseElement::willRecalcStyle):
1025         (WebCore::SVGUseElement::willAttachRenderers): Deleted.
1026
1027             Switch willAttachRenderers to willRecalcStyle as the former is now called too late.
1028
1029         * svg/SVGUseElement.h:
1030
1031 2016-03-29  Nan Wang  <n_wang@apple.com>
1032
1033         AX: VoiceOver not announcing the right header information for table on iOS
1034         https://bugs.webkit.org/show_bug.cgi?id=155907
1035
1036         Reviewed by Chris Fleizach.
1037
1038         Make sure we consider the case where header elements size does not equal to
1039         row size.
1040
1041         Test: accessibility/ios-simulator/table-row-column-headers.html
1042
1043         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1044         (-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
1045
1046 2016-03-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
1047
1048         REGRESSION (r198782): CGImageSourceUpdateData() is called twice with the same data every time ImageSource::setData() is called
1049         https://bugs.webkit.org/show_bug.cgi?id=155997
1050
1051         Reviewed by Simon Fraser.
1052
1053         Remove a call to CGImageSourceUpdateData() which was mistakenly left in
1054         ImageDecoder::setData() after ImageSource refactoring.
1055
1056         * platform/graphics/cg/ImageSourceCG.cpp:
1057         (WebCore::ImageDecoder::setData):
1058
1059 2016-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
1060
1061         REGRESSION(r198784) Shouldn't add platform-dependent code to ScrollableArea.h
1062         https://bugs.webkit.org/show_bug.cgi?id=155999
1063
1064         Rolling out the patch.
1065
1066         * platform/ScrollableArea.h:
1067         (WebCore::ScrollableArea::horizontalScrollbar):
1068         (WebCore::ScrollableArea::verticalScrollbar):
1069         (WebCore::ScrollableArea::tiledBacking):
1070         (WebCore::ScrollableArea::layerForHorizontalScrollbar):
1071         (WebCore::ScrollableArea::layerForVerticalScrollbar):
1072         (WebCore::ScrollableArea::layerForScrolling):
1073         (WebCore::ScrollableArea::layerForScrollCorner):
1074         (WebCore::ScrollableArea::layerForOverhangAreas):
1075         * platform/mac/ScrollAnimatorMac.mm:
1076         (WebCore::ScrollAnimatorMac::updateScrollerStyle): Deleted.
1077         * platform/mac/ScrollableAreaMac.mm:
1078         (WebCore::ScrollableArea::setScrollbarLayoutDirection): Deleted.
1079         * platform/mac/ScrollbarThemeMac.mm:
1080         (WebCore::ScrollbarThemeMac::registerScrollbar): Deleted.
1081         * platform/spi/mac/NSScrollerImpSPI.h:
1082
1083 2016-03-29  Alex Christensen  <achristensen@webkit.org>
1084
1085         Fix Windows clean build.
1086
1087         * CMakeLists.txt:
1088         Make sure WebCoreDerivedSources is done building before building WebCore.
1089
1090 2016-03-29  Keith Miller  <keith_miller@apple.com>
1091
1092         [ES6] Add support for Symbol.isConcatSpreadable.
1093         https://bugs.webkit.org/show_bug.cgi?id=155351
1094
1095         Reviewed by Saam Barati.
1096
1097         Makes runtime arrays have the new ArrayType
1098
1099         * bridge/runtime_array.h:
1100         (JSC::RuntimeArray::createStructure):
1101
1102 2016-03-29  Nan Wang  <n_wang@apple.com>
1103
1104         AX: VoiceOver: Navigating Numbered Lists Causes Number to be announced On Each Line of List
1105         https://bugs.webkit.org/show_bug.cgi?id=155984
1106
1107         Reviewed by Chris Fleizach.
1108
1109         We should limit the list marker text only to the first line of that list item.
1110
1111         Test: accessibility/mac/attributed-string-with-listitem-multiple-lines.html
1112
1113         * accessibility/AccessibilityObject.cpp:
1114         (WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
1115         (WebCore::AccessibilityObject::stringForRange):
1116
1117 2016-03-29  Antonio Gomes  <tonikitoo@webkit.org>
1118
1119         Wheel events' latching state is not reset when appropriate
1120         https://bugs.webkit.org/show_bug.cgi?id=155746
1121
1122         Reviewed by Simon Fraser.
1123
1124         When one performs a two fingers scroll (with trackpad),
1125         it might either trigger a kinetic scroll movement (by
1126         flickering with both fingers in a given direction) or perform
1127         a static scroll movement (without the flicker animation).
1128
1129         In case of the first scenario (kinetic), the container being
1130         scrolled is "latched" during the scroll animation and properly unlatched
1131         once the scroll ends. See the call to 'shouldResetLatching' in EventHandlerMac.mm.
1132         When transitioning from non-momentum to momentum scroll, the following events are seen:
1133         - 'phase PlatformWheelEventPhaseEnded' 'momentumPhase PlatformWheelEventPhaseNone' -> end of static scroll
1134         - 'phase PlatformWheelEventPhaseNone' 'momentumPhase PlatformWheelEventPhaseBegan' -> start of momentum scroll
1135
1136         On the second scenario (static scroll), when the scroll movement ends,
1137         the latched state is not reset. This might actually cause scrolling elsewhere on the page to scroll
1138         the previously latched container.
1139         Note that, only specific wheel event below is fired when static scroll ends:
1140         - 'phase PlatformWheelEventPhaseEnded' 'momentumPhase PlatformWheelEventPhaseNone'
1141
1142         In order to fix this, patch installs a timer as soon as a non-momentum
1143         wheel scroll event end fires. It works as follows:
1144
1145         - If the timer fires, the latched state is reset, preventing scrolling getting stuck to
1146         a previously latched scrollable.
1147         - If platform code starts sending momentum wheel scroll events before it times out, the timer is
1148         stopped and the latched state remains untouched (this is a flick scroll case).
1149         - If a new wheel scroll gesture starts, the latched state is manually reset
1150         and the timer stopped.
1151
1152         Note that given that latched state logic applies primarily to main frames,
1153         the timer only gets manipulated for main frame objects.
1154
1155         Test: tiled-drawing/scrolling/scroll-iframe-latched-selects.html
1156
1157         * page/EventHandler.cpp:
1158         (WebCore::EventHandler::doOrScheduleClearLatchedStateIfNeeded):
1159         * page/EventHandler.h:
1160         * page/MainFrame.cpp:
1161         (WebCore::MainFrame::MainFrame):
1162         (WebCore::MainFrame::~MainFrame):
1163         * page/MainFrame.h:
1164         * page/mac/EventHandlerMac.mm:
1165         (WebCore::scrollableAreaForContainerNode):
1166         (WebCore::latchedToFrameOrBody):
1167         (WebCore::areWheelEventsTransitioningToMomentumScrolling):
1168         (WebCore::areWheelEventsEndingNonMomentumScrolling):
1169         (WebCore::EventHandler::doOrScheduleClearLatchedStateIfNeeded):
1170
1171 2016-03-29  Alex Christensen  <achristensen@webkit.org>
1172
1173         Fix Windows build.
1174
1175         * CMakeLists.txt:
1176
1177 2016-03-29  Alex Christensen  <achristensen@webkit.org>
1178
1179         Windows build fix.
1180
1181         * CMakeLists.txt:
1182         DerivedSources.cpp should be in WebCore_DERIVED_SOURCES because it depends on the derived sources.
1183
1184 2016-03-29  Alex Christensen  <achristensen@webkit.org>
1185
1186         Fix Windows build after r198777
1187
1188         * CMakeLists.txt:
1189         * PlatformEfl.cmake:
1190         WebCore_DERIVED_SOURCES should not be in WebCore_SOURCES.  If it's needed for EFL,
1191         then keep it in the EFL-specific platform.
1192         * PlatformWin.cmake:
1193         Make more derived sources in WebCore_DERIVED_SOURCES.
1194
1195 2016-03-29  Saam barati  <sbarati@apple.com>
1196
1197         Allow builtin JS functions to be intrinsics
1198         https://bugs.webkit.org/show_bug.cgi?id=155960
1199
1200         Reviewed by Mark Lam.
1201
1202         * ForwardingHeaders/runtime/Intrinsic.h: Added.
1203
1204 2016-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
1205
1206         [Cocoa] Rename ScrollbarPainter variables to ScrollerImp
1207         https://bugs.webkit.org/show_bug.cgi?id=155976
1208
1209         Reviewed by Simon Fraser.
1210
1211         This patch continues where r198078 left off. That patch renamed all the types,
1212         however, there are some variables which were left as "scrollbarPainter". This
1213         patch completes the transition to ScrollerImp.
1214
1215         No new tests because there is no behavior change.
1216
1217         * platform/mac/ScrollAnimatorMac.h:
1218         * platform/mac/ScrollAnimatorMac.mm:
1219         (scrollerImpForScrollbar):
1220         (-[WebScrollerImpPairDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
1221         (-[WebScrollbarPartAnimation startAnimation]):
1222         (-[WebScrollbarPartAnimation setCurrentProgress:]):
1223         (-[WebScrollerImpDelegate mouseLocationInScrollerForScrollerImp:]):
1224         (-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
1225         (-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
1226         (-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1227         (-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1228         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
1229         (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
1230         (WebCore::ScrollAnimatorMac::contentAreaWillPaint):
1231         (WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
1232         (WebCore::ScrollAnimatorMac::mouseExitedContentArea):
1233         (WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
1234         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
1235         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
1236         (WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
1237         (WebCore::ScrollAnimatorMac::willStartLiveResize):
1238         (WebCore::ScrollAnimatorMac::contentsResized):
1239         (WebCore::ScrollAnimatorMac::willEndLiveResize):
1240         (WebCore::ScrollAnimatorMac::contentAreaDidShow):
1241         (WebCore::ScrollAnimatorMac::contentAreaDidHide):
1242         (WebCore::ScrollAnimatorMac::didBeginScrollGesture):
1243         (WebCore::ScrollAnimatorMac::didEndScrollGesture):
1244         (WebCore::ScrollAnimatorMac::mayBeginScrollGesture):
1245         (WebCore::ScrollAnimatorMac::lockOverlayScrollbarStateToHidden):
1246         (WebCore::ScrollAnimatorMac::scrollbarsCanBeActive):
1247         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
1248         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
1249         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
1250         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
1251         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
1252         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
1253         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
1254         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
1255         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
1256         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
1257         (WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
1258         (WebCore::ScrollAnimatorMac::sendContentAreaScrolled):
1259         (scrollbarPainterForScrollbar): Deleted.
1260         * platform/mac/ScrollbarThemeMac.mm:
1261         (WebCore::ScrollbarThemeMac::registerScrollbar):
1262         (WebCore::ScrollbarThemeMac::scrollbarThickness):
1263         (WebCore::scrollerImpPaint):
1264         (WebCore::ScrollbarThemeMac::paint):
1265         (WebCore::scrollbarPainterPaint): Deleted.
1266
1267 2016-03-29  Joseph Pecoraro  <pecoraro@apple.com>
1268
1269         Web Inspector: We should have a way to capture heap snapshots programatically.
1270         https://bugs.webkit.org/show_bug.cgi?id=154407
1271         <rdar://problem/24726292>
1272
1273         Reviewed by Timothy Hatcher.
1274
1275         Test: inspector/console/heapSnapshot.html
1276
1277         * page/PageConsoleClient.cpp:
1278         (WebCore::PageConsoleClient::takeHeapSnapshot):
1279         * page/PageConsoleClient.h:
1280         Pass through to Inspector Instrumentation.
1281
1282         * inspector/InspectorConsoleInstrumentation.h:
1283         (WebCore::InspectorInstrumentation::takeHeapSnapshot):
1284         * inspector/InspectorInstrumentation.cpp:
1285         (WebCore::InspectorInstrumentation::takeHeapSnapshotImpl):
1286         * inspector/InspectorInstrumentation.h:
1287         Pass through to InspectorConsoleAgent.
1288
1289         * inspector/InspectorController.cpp:
1290         (WebCore::InspectorController::InspectorController):
1291         * inspector/PageConsoleAgent.cpp:
1292         (WebCore::PageConsoleAgent::PageConsoleAgent):
1293         * inspector/PageConsoleAgent.h:
1294         * inspector/WebConsoleAgent.cpp:
1295         (WebCore::WebConsoleAgent::WebConsoleAgent):
1296         * inspector/WebConsoleAgent.h:
1297         * workers/WorkerConsoleClient.cpp:
1298         (WebCore::WorkerConsoleClient::takeHeapSnapshot):
1299         * workers/WorkerConsoleClient.h:
1300         Provide a HeapAgent to the ConsoleAgent.
1301
1302 2016-03-29  Zalan Bujtas  <zalan@apple.com>
1303
1304         REGRESSION (r196813): Missing plug-in placeholder is missing
1305         https://bugs.webkit.org/show_bug.cgi?id=155973
1306         <rdar://problem/25068392>
1307
1308         Reviewed by Andy Estes.
1309
1310         Show unavailable plugin indicator when UnavailablePluginIndicatorState (uninitialized, hidden, visible) is not set to hidden explicitly.
1311         It matches pre-196813 behaviour.
1312
1313         Unable to test.
1314
1315         * rendering/RenderEmbeddedObject.h:
1316         (WebCore::RenderEmbeddedObject::showsUnavailablePluginIndicator):
1317
1318 2016-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
1319
1320         [OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
1321         https://bugs.webkit.org/show_bug.cgi?id=155962
1322
1323         Reviewed by Simon Fraser.
1324
1325         We can control the animation direction with the NSScrollerImp property
1326         userInterfaceLayoutDirection.
1327
1328         Not testable.
1329
1330         * platform/ScrollableArea.cpp:
1331         (WebCore::ScrollableArea::setScrollbarLayoutDirection):
1332         * platform/ScrollableArea.h:
1333         (WebCore::ScrollableArea::horizontalScrollbar):
1334         (WebCore::ScrollableArea::verticalScrollbar):
1335         (WebCore::ScrollableArea::tiledBacking):
1336         (WebCore::ScrollableArea::layerForHorizontalScrollbar):
1337         (WebCore::ScrollableArea::layerForVerticalScrollbar):
1338         (WebCore::ScrollableArea::layerForScrolling):
1339         (WebCore::ScrollableArea::layerForScrollCorner):
1340         (WebCore::ScrollableArea::layerForOverhangAreas):
1341         * platform/mac/ScrollAnimatorMac.mm:
1342         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
1343         * platform/mac/ScrollableAreaMac.mm:
1344         (WebCore::ScrollableArea::setScrollbarDirection):
1345         * platform/mac/ScrollbarThemeMac.mm:
1346         (WebCore::ScrollbarThemeMac::registerScrollbar):
1347         * platform/spi/mac/NSScrollerImpSPI.h:
1348
1349 2016-03-29  Dan Bernstein  <mitz@apple.com>
1350
1351         Inline WebFullScreenVideoRootViewController.m
1352         https://bugs.webkit.org/show_bug.cgi?id=155971
1353
1354         Reviewed by Anders Carlsson.
1355
1356         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1357         (createFullScreenVideoRootViewControllerClass): Replaced with the code from
1358           WebFullScreenVideoRootViewController.m.
1359
1360 2016-03-29  Said Abou-Hallawa  <sabouhallawa@apple,com>
1361
1362         Create a CG ImageDecoder class instead of defining it as CGImageSourceRef
1363         https://bugs.webkit.org/show_bug.cgi?id=155422
1364
1365         Reviewed by Simon Fraser.
1366
1367         Move the image CG decoding code from the class ImageSource out to a new
1368         class named ImageDecoder. The purpose of this split is to unify the code
1369         of the ImageSource for all platforms. This class should be a container
1370         for the ImageDecoder. All the direct frame manipulation like querying the
1371         frame metadata or creating a frame image should be the responsibility of
1372         the ImageDecoder. The ImageSource will be responsible of the image frame
1373         caching. When responding to a frame metadata query, for example. the
1374         ImageSource checks its cache first. If an entry does not exist for the
1375         requested frame, the ImageSource will cache the image and the metadata
1376         of this frame. The ImageSource will respond at the end from the image
1377         frame cache.
1378  
1379         The plan after this patch is is the following:
1380             -- Move the new class to separate files
1381             -- Merge the ImageSource.cpp and ImageSourceCG.cpp. in one file
1382             -- Move caching the FrameData from BitmapImage to ImageSource.
1383  
1384         * loader/cache/CachedImage.cpp:
1385         (WebCore::CachedImage::imageSizeForRenderer):
1386         BitmapImage::sizeRespectingOrientation() does not take any argument now.
1387         Fix the call to this function and delete the conditionally compiled code 
1388         since the code is the same for the two cases.
1389  
1390         * platform/graphics/BitmapImage.cpp:
1391         (WebCore::BitmapImage::updateSize):
1392         (WebCore::BitmapImage::sizeRespectingOrientation):
1393         (WebCore::BitmapImage::frameImageAtIndex):
1394         (WebCore::BitmapImage::BitmapImage):
1395         An image can have two sizes: size() and sizeRespectingOrientation(). The
1396         sizeRespectingOrientation() is the transpose of size() iff the image
1397         orientation has usesWidthAsHeight() is true. So there is no need for the
1398         ImageOrientationDescription argument. So there is no need for the members
1399         m_imageOrientation or m_shouldRespectImageOrientation. Also move
1400         m_allowSubsampling and m_minimumSubsamplingLevel (which should be named
1401         m_maximumSubsamplingLevel) to ImageSource instead.
1402
1403         (WebCore::BitmapImage::frameOrientationAtIndex): Replace DefaultImageOrientation
1404         by ImageOrientation().
1405         
1406         (WebCore::BitmapImage::dump): Move dumping the image metadata to the
1407         ImageSource.
1408         
1409         * platform/graphics/BitmapImage.h:
1410         
1411         * platform/graphics/GraphicsContext.h:
1412         * platform/graphics/ImageOrientation.h:
1413         (WebCore::ImageOrientation::ImageOrientation):
1414         (WebCore::ImageOrientation::fromEXIFValue):
1415         (WebCore::ImageOrientation::operator ImageOrientationEnum):
1416         Add a casting operator to ImageOrientation so it can be dumped as enum
1417         value. Also add a default constructor and make the other constructor be
1418         explicit. All the rvalues DefaultImageOrientation should be replaced by
1419         ImageOrientation().
1420
1421         * platform/graphics/ImageSource.cpp:
1422         (WebCore::ImageSource::ImageSource):
1423         (WebCore::ImageSource::clear):
1424         m_decoder is now a unique_ptr. To release it, assign it to nullptr.
1425
1426         (WebCore::ImageSource::ensureDecoderIsCreated): Ensure m_decoder is created.
1427         
1428         (WebCore::ImageSource::setData): Call ensureDecoderIsCreated() before
1429         actually setting the data.
1430         
1431         (WebCore::ImageSource::isSizeAvailable): Use initialized();
1432         
1433         (WebCore::ImageSource::size):
1434         (WebCore::ImageSource::sizeRespectingOrientation):
1435         (WebCore::ImageSource::frameSizeAtIndex):
1436         These functions return the size of the image.
1437     
1438         (WebCore::ImageSource::getHotSpot):
1439         (WebCore::ImageSource::repetitionCount):
1440         (WebCore::ImageSource::frameCount):
1441         (WebCore::ImageSource::createFrameImageAtIndex):
1442         (WebCore::ImageSource::frameDurationAtIndex):
1443         (WebCore::ImageSource::orientationAtIndex):
1444         (WebCore::ImageSource::frameHasAlphaAtIndex):
1445         (WebCore::ImageSource::frameIsCompleteAtIndex):
1446         (WebCore::ImageSource::frameBytesAtIndex):
1447         Check for initialized() instead of checking m_decoder.
1448         
1449         (WebCore::ImageSource::dump): Dump the image metadata.
1450         
1451         (WebCore::ImageSource::initialized): Deleted.
1452         
1453         * platform/graphics/ImageSource.h: The image decoder is now named
1454         ImageDecoder for all platforms.
1455         
1456         (WebCore::ImageSource::initialized): Moved to the header file.
1457
1458         (WebCore::ImageSource::setAllowSubsampling): Moved from BitmapImage.
1459         
1460         * platform/graphics/cairo/BitmapImageCairo.cpp:
1461         (WebCore::BitmapImage::BitmapImage):
1462         (WebCore::BitmapImage::determineMinimumSubsamplingLevel): Deleted.
1463         Delete initializing m_minimumSubsamplingLevel and determineMinimumSubsamplingLevel()
1464         since they are moved to ImageSource.
1465         
1466         * platform/graphics/cg/BitmapImageCG.cpp:
1467         (WebCore::BitmapImage::BitmapImage):
1468         (WebCore::BitmapImage::determineMinimumSubsamplingLevel): Deleted.
1469         Delete members and methods which are now owned and calculated by ImageSource.
1470         
1471         * platform/graphics/cg/ImageSourceCG.cpp:
1472         (WebCore::ImageDecoder::create): Returns a CG ImageDecoder object.
1473         
1474         (WebCore::orientationFromProperties):  Replace DefaultImageOrientation
1475         by ImageOrientation().
1476         
1477         (WebCore::ImageDecoder::ImageDecoder): Creates a native CG image decoder.
1478         
1479         (WebCore::ImageDecoder::~ImageDecoder): Releases the native CG image decoder.
1480         
1481         (WebCore::ImageDecoder::subsamplingLevelForScale): Moved from ImageSource.
1482         A new argument named 'maximumSubsamplingLevel' is added to low filter the
1483         return value.
1484         
1485         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
1486         (WebCore::ImageDecoder::filenameExtension):
1487         (WebCore::ImageDecoder::isSizeAvailable):
1488         (WebCore::ImageDecoder::size):
1489         (WebCore::ImageDecoder::frameCount):
1490         (WebCore::ImageDecoder::repetitionCount):
1491         (WebCore::ImageDecoder::hotSpot):
1492         (WebCore::ImageDecoder::frameSizeAtIndex):
1493         (WebCore::ImageDecoder::frameIsCompleteAtIndex):
1494         (WebCore::ImageDecoder::orientationAtIndex):
1495         (WebCore::ImageDecoder::frameDurationAtIndex):
1496         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
1497         (WebCore::ImageDecoder::frameHasAlphaAtIndex):
1498         (WebCore::ImageDecoder::frameBytesAtIndex):
1499         (WebCore::ImageDecoder::createFrameImageAtIndex):
1500         (WebCore::ImageDecoder::setData):
1501         The code of these function was moved from the functions of ImageSource.
1502         
1503         (WebCore::ImageSource::ImageSource):
1504         (WebCore::ImageSource::~ImageSource):
1505         (WebCore::ImageSource::clear):
1506         (WebCore::ImageSource::ensureDecoderIsCreated):
1507         (WebCore::ImageSource::setData):
1508         (WebCore::ImageSource::filenameExtension):
1509         (WebCore::ImageSource::calculateMaximumSubsamplingLevel):
1510         (WebCore::ImageSource::maximumSubsamplingLevel):
1511         (WebCore::ImageSource::subsamplingLevelForScale):
1512         (WebCore::ImageSource::isSizeAvailable):
1513         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
1514         (WebCore::ImageSource::frameSizeAtIndex):
1515         (WebCore::ImageSource::orientationAtIndex):
1516         (WebCore::ImageSource::size):
1517         (WebCore::ImageSource::sizeRespectingOrientation):
1518         (WebCore::ImageSource::getHotSpot):
1519         (WebCore::ImageSource::bytesDecodedToDetermineProperties):
1520         (WebCore::ImageSource::repetitionCount):
1521         (WebCore::ImageSource::frameCount):
1522         (WebCore::ImageSource::createFrameImageAtIndex):
1523         (WebCore::ImageSource::frameIsCompleteAtIndex):
1524         (WebCore::ImageSource::frameDurationAtIndex):
1525         (WebCore::ImageSource::frameHasAlphaAtIndex):
1526         (WebCore::ImageSource::frameBytesAtIndex):
1527         Call m_decoder's function to do the real work.
1528         
1529         (WebCore::ImageSource::dump): Dump the image metadata.
1530         
1531         (WebCore::ImageSource::initialized): Deleted.
1532         
1533         * platform/image-decoders/ImageDecoder.cpp:
1534         (WebCore::ImageDecoder::create):
1535         * platform/image-decoders/ImageDecoder.h:
1536         Change the return of ImageDecoder::create() to be unique_ptr.
1537         
1538         * platform/mac/DragImageMac.mm:
1539         (WebCore::createDragImageFromImage): Delete unneeded argument.
1540
1541 2016-03-29  Eric Carlson  <eric.carlson@apple.com>
1542
1543         media/track/track-remove-track.html is flaky, crashing and failing
1544         https://bugs.webkit.org/show_bug.cgi?id=130971
1545
1546         Reviewed by Alexey Proskuryakov.
1547         
1548         Prevent HTMLMediaElement from being collected while it is creating media controls.
1549         These changes prevent the test from crashing but they do not fix the flakiness,
1550         which is caused by another bug. Fixing that is tracked by 
1551         https://bugs.webkit.org/show_bug.cgi?id=155956.
1552
1553         * html/HTMLMediaElement.cpp:
1554         (WebCore::actionName): New, debugging-only helper function.
1555         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize new variables.
1556         (WebCore::HTMLMediaElement::scheduleDelayedAction): Log the flag names to make debugging easier.
1557         (WebCore::HTMLMediaElement::scheduleNextSourceChild): Add logging.
1558         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Update logging.
1559         (WebCore::HTMLMediaElement::configureTextTrackGroup): Drive-by optimization: don't call 
1560           updateCaptionContainer here, call it before exiting configureTextTracks so we only call
1561           it once instead of once per track group.
1562         (WebCore::controllerJSValue):
1563         (WebCore::HTMLMediaElement::ensureMediaControlsShadowRoot): New, wrapper around calling
1564           ensureUserAgentShadowRoot so m_creatingControls can be set and cleared appropriately.
1565         (WebCore::HTMLMediaElement::updateCaptionContainer): ensureUserAgentShadowRoot -> 
1566           ensureMediaControlsShadowRoot. Drive by optimization: set/test m_haveSetupCaptionContainer
1567           so we only do this setup once.
1568         (WebCore::HTMLMediaElement::configureTextTracks): Call updateCaptionContainer.
1569         (WebCore::HTMLMediaElement::clearMediaPlayer): Log flag names.
1570         (WebCore::HTMLMediaElement::hasPendingActivity): Return true when creating controls so GC
1571           won't happen during controls setup.
1572         (WebCore::HTMLMediaElement::updateTextTrackDisplay): ensureUserAgentShadowRoot -> 
1573           ensureMediaControlsShadowRoot.
1574         (WebCore::HTMLMediaElement::createMediaControls): Ditto.
1575         (WebCore::HTMLMediaElement::configureMediaControls): Ditto.
1576         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto.
1577         * html/HTMLMediaElement.h:
1578
1579 2016-03-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1580
1581         Unreviewed EFL build fix caused by r198773
1582
1583         * CMakeLists.txt: Append WebCore_DERIVED_SOURCES to WebCore source list.
1584
1585 2016-03-29  Joseph Pecoraro  <pecoraro@apple.com>
1586
1587         Audit WebCore builtins for user overridable code
1588         https://bugs.webkit.org/show_bug.cgi?id=155923
1589
1590         Reviewed by Youenn Fablet.
1591
1592         Tests: fetch/builtin-overrides.html
1593                streams/builtin-overrides.html
1594
1595         * Modules/fetch/FetchHeaders.js:
1596         (initializeFetchHeaders):
1597         Avoid using an Array.prototype.forEach that could be overriden.
1598
1599         * Modules/streams/ByteLengthQueuingStrategy.js:
1600         (initializeByteLengthQueuingStrategy):
1601         * Modules/streams/CountQueuingStrategy.js:
1602         (initializeCountQueuingStrategy):
1603         Use the private Object.defineProperty not one that could be overriden.
1604
1605         * Modules/streams/ReadableStreamInternals.js:
1606         (finishClosingReadableStream):
1607         Fix style.
1608
1609         * Modules/streams/WritableStream.js:
1610         (write):
1611         Fix error message to use the correct function name.
1612
1613 2016-03-28  Zalan Bujtas  <zalan@apple.com>
1614
1615         Pixel turds when bordered div is resized on SMF forum software.
1616         https://bugs.webkit.org/show_bug.cgi?id=155957
1617         <rdar://problem/25010646>
1618
1619         Reviewed by Simon Fraser.
1620
1621         Use unmodified, non-snapped bounding box rect when computing dirty rects.
1622
1623         Test: fast/repaint/hidpi-box-with-subpixel-height-inflates.html
1624
1625         * rendering/RenderBox.h:
1626         * rendering/RenderBoxModelObject.h:
1627         * rendering/RenderElement.cpp:
1628         (WebCore::RenderElement::getTrailingCorner):
1629         * rendering/RenderInline.h:
1630         * rendering/RenderLineBreak.cpp:
1631         (WebCore::RenderLineBreak::borderBoundingBox): Deleted.
1632         * rendering/RenderLineBreak.h:
1633         * rendering/RenderView.cpp:
1634         (WebCore::RenderView::setBestTruncatedAt):
1635
1636 2016-03-28  Chris Fleizach  <cfleizach@apple.com>
1637
1638         AX: Crash when AX trying to create element for an old auto fill element
1639         https://bugs.webkit.org/show_bug.cgi?id=155943
1640
1641         Reviewed by Joanmarie Diggs.
1642
1643         When an auto-fill element is removed, the Node hangs around but the renderer is gone.
1644         In those cases, we can't blindly add the result of getOrCreate to the children array.
1645
1646         Test: accessibility/auto-fill-crash.html
1647
1648         * accessibility/AccessibilityRenderObject.cpp:
1649         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
1650
1651 2016-03-28  Chris Fleizach  <cfleizach@apple.com>
1652
1653         AX: iOS: Can't navigate inside ContentEditable fields with voiceover enabled
1654         https://bugs.webkit.org/show_bug.cgi?id=155942
1655
1656         Reviewed by Joanmarie Diggs.
1657
1658         The code to set the selected text range on a non-native text control (like a contenteditable) was either
1659         wrong or broke at some point. It assumed that creating a Position with the contenteditable node with the right
1660         offset would make a valid Position, but it almost never did.
1661
1662         Instead we can use this helper method to create a valid Position.
1663
1664         Test: accessibility/set-selected-text-range-contenteditable.html
1665
1666         * accessibility/AccessibilityRenderObject.cpp:
1667         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1668
1669 2016-03-28  Alex Christensen  <achristensen@webkit.org>
1670
1671         Fix Ninja build on Mac
1672         https://bugs.webkit.org/show_bug.cgi?id=151399
1673
1674         Reviewed by Darin Adler.
1675
1676         * CMakeLists.txt:
1677         * PlatformEfl.cmake:
1678         * PlatformGTK.cmake:
1679         * PlatformMac.cmake:
1680         This moves WebCoreDerivedSources to a separate static library to reduce linker command 
1681         line lengths when using ninja on mac. This also helps Windows builds, which sometimes 
1682         regenerate everything every time you build; now you'll be able to just build WebCore
1683         and WebKit without all the WebCoreDerivedSources stuff.
1684
1685 2016-03-28  Brady Eidson  <beidson@apple.com>
1686
1687         Fix build on some stricter compilers by removing unnecessary WTFMove.
1688         Opportunistically remove some unnecessary "WebCore::"s
1689         Followup to r198762
1690
1691         * Modules/indexeddb/IDBObjectStore.cpp:
1692         (WebCore::IDBObjectStore::keyPathAny):
1693         (WebCore::IDBObjectStore::transaction):
1694         (WebCore::IDBObjectStore::openCursor):
1695         (WebCore::IDBObjectStore::get):
1696         (WebCore::IDBObjectStore::add):
1697         (WebCore::IDBObjectStore::put):
1698         (WebCore::IDBObjectStore::deleteFunction):
1699         (WebCore::IDBObjectStore::clear):
1700         (WebCore::IDBObjectStore::createIndex):
1701         (WebCore::IDBObjectStore::index):
1702         (WebCore::IDBObjectStore::count):
1703         (WebCore::IDBObjectStore::doCount):
1704
1705 2016-03-28  Brady Eidson  <beidson@apple.com>
1706
1707         Modern IDB: Remove abstract base classes for all IDB DOM classes.
1708         https://bugs.webkit.org/show_bug.cgi?id=155951
1709
1710         Reviewed by Alex Christensen.
1711
1712         Refactor - No behavior change.
1713
1714         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1715         (WebCore::DOMWindowIndexedDatabase::indexedDB):
1716         * Modules/indexeddb/IDBAny.cpp:
1717         (WebCore::IDBAny::IDBAny):
1718         (WebCore::IDBAny::~IDBAny):
1719         (WebCore::IDBAny::idbDatabase):
1720         (WebCore::IDBAny::domStringList):
1721         (WebCore::IDBAny::idbCursor):
1722         (WebCore::IDBAny::idbCursorWithValue):
1723         (WebCore::IDBAny::idbFactory):
1724         (WebCore::IDBAny::idbIndex):
1725         (WebCore::IDBAny::idbObjectStore):
1726         (WebCore::IDBAny::idbTransaction):
1727         (WebCore::IDBAny::scriptValue):
1728         (WebCore::IDBAny::integer):
1729         (WebCore::IDBAny::string):
1730         (WebCore::IDBAny::keyPath):
1731         * Modules/indexeddb/IDBAny.h:
1732         (WebCore::IDBAny::create):
1733         (WebCore::IDBAny::createUndefined):
1734         (WebCore::IDBAny::type):
1735         (WebCore::IDBAny::~IDBAny): Deleted.
1736         (WebCore::IDBAny::isLegacy): Deleted.
1737         * Modules/indexeddb/IDBCursor.cpp:
1738         (WebCore::IDBCursor::create):
1739         (WebCore::IDBCursor::IDBCursor):
1740         (WebCore::IDBCursor::~IDBCursor):
1741         (WebCore::IDBCursor::sourcesDeleted):
1742         (WebCore::IDBCursor::effectiveObjectStore):
1743         (WebCore::IDBCursor::transaction):
1744         (WebCore::IDBCursor::direction):
1745         (WebCore::IDBCursor::key):
1746         (WebCore::IDBCursor::primaryKey):
1747         (WebCore::IDBCursor::value):
1748         (WebCore::IDBCursor::source):
1749         (WebCore::IDBCursor::update):
1750         (WebCore::IDBCursor::advance):
1751         (WebCore::IDBCursor::continueFunction):
1752         (WebCore::IDBCursor::uncheckedIterateCursor):
1753         (WebCore::IDBCursor::deleteFunction):
1754         (WebCore::IDBCursor::setGetResult):
1755         (WebCore::IDBCursor::activeDOMObjectName):
1756         (WebCore::IDBCursor::canSuspendForDocumentSuspension):
1757         (WebCore::IDBCursor::hasPendingActivity):
1758         (WebCore::IDBCursor::decrementOutstandingRequestCount):
1759         * Modules/indexeddb/IDBCursor.h:
1760         (WebCore::IDBCursor::info):
1761         (WebCore::IDBCursor::setRequest):
1762         (WebCore::IDBCursor::clearRequest):
1763         (WebCore::IDBCursor::request):
1764         (WebCore::IDBCursor::isKeyCursor):
1765         (WebCore::IDBCursor::~IDBCursor): Deleted.
1766         (WebCore::IDBCursor::continueFunction): Deleted.
1767         (WebCore::IDBCursor::isModernCursor): Deleted.
1768         (WebCore::IDBCursor::hasPendingActivity): Deleted.
1769         * Modules/indexeddb/IDBCursorWithValue.cpp:
1770         (WebCore::IDBCursorWithValue::create):
1771         (WebCore::IDBCursorWithValue::IDBCursorWithValue):
1772         (WebCore::IDBCursorWithValue::~IDBCursorWithValue):
1773         * Modules/indexeddb/IDBCursorWithValue.h:
1774         (WebCore::IDBCursorWithValue::~IDBCursorWithValue): Deleted.
1775         * Modules/indexeddb/IDBDatabase.cpp:
1776         (WebCore::IDBDatabase::create):
1777         (WebCore::IDBDatabase::IDBDatabase):
1778         (WebCore::IDBDatabase::~IDBDatabase):
1779         (WebCore::IDBDatabase::hasPendingActivity):
1780         (WebCore::IDBDatabase::name):
1781         (WebCore::IDBDatabase::version):
1782         (WebCore::IDBDatabase::objectStoreNames):
1783         (WebCore::IDBDatabase::createObjectStore):
1784         (WebCore::IDBDatabase::transaction):
1785         (WebCore::IDBDatabase::deleteObjectStore):
1786         (WebCore::IDBDatabase::close):
1787         (WebCore::IDBDatabase::maybeCloseInServer):
1788         (WebCore::IDBDatabase::activeDOMObjectName):
1789         (WebCore::IDBDatabase::canSuspendForDocumentSuspension):
1790         (WebCore::IDBDatabase::stop):
1791         (WebCore::IDBDatabase::startVersionChangeTransaction):
1792         (WebCore::IDBDatabase::didStartTransaction):
1793         (WebCore::IDBDatabase::willCommitTransaction):
1794         (WebCore::IDBDatabase::didCommitTransaction):
1795         (WebCore::IDBDatabase::willAbortTransaction):
1796         (WebCore::IDBDatabase::didAbortTransaction):
1797         (WebCore::IDBDatabase::didCommitOrAbortTransaction):
1798         (WebCore::IDBDatabase::fireVersionChangeEvent):
1799         (WebCore::IDBDatabase::dispatchEvent):
1800         (WebCore::IDBDatabase::didCreateIndexInfo):
1801         (WebCore::IDBDatabase::didDeleteIndexInfo):
1802         * Modules/indexeddb/IDBDatabase.h:
1803         (WebCore::IDBDatabase::info):
1804         (WebCore::IDBDatabase::databaseConnectionIdentifier):
1805         (WebCore::IDBDatabase::serverConnection):
1806         (WebCore::IDBDatabase::isClosingOrClosed):
1807         (WebCore::IDBDatabase::~IDBDatabase): Deleted.
1808         * Modules/indexeddb/IDBFactory.cpp:
1809         (WebCore::shouldThrowSecurityException):
1810         (WebCore::IDBFactory::create):
1811         (WebCore::IDBFactory::IDBFactory):
1812         (WebCore::IDBFactory::getDatabaseNames):
1813         (WebCore::IDBFactory::open):
1814         (WebCore::IDBFactory::openInternal):
1815         (WebCore::IDBFactory::deleteDatabase):
1816         (WebCore::IDBFactory::cmp):
1817         * Modules/indexeddb/IDBFactory.h:
1818         (WebCore::IDBFactory::~IDBFactory): Deleted.
1819         * Modules/indexeddb/IDBIndex.cpp:
1820         (WebCore::IDBIndex::IDBIndex):
1821         (WebCore::IDBIndex::~IDBIndex):
1822         (WebCore::IDBIndex::activeDOMObjectName):
1823         (WebCore::IDBIndex::canSuspendForDocumentSuspension):
1824         (WebCore::IDBIndex::hasPendingActivity):
1825         (WebCore::IDBIndex::name):
1826         (WebCore::IDBIndex::objectStore):
1827         (WebCore::IDBIndex::keyPathAny):
1828         (WebCore::IDBIndex::keyPath):
1829         (WebCore::IDBIndex::unique):
1830         (WebCore::IDBIndex::multiEntry):
1831         (WebCore::IDBIndex::openCursor):
1832         (WebCore::IDBIndex::count):
1833         (WebCore::IDBIndex::doCount):
1834         (WebCore::IDBIndex::openKeyCursor):
1835         (WebCore::IDBIndex::get):
1836         (WebCore::IDBIndex::doGet):
1837         (WebCore::IDBIndex::getKey):
1838         (WebCore::IDBIndex::doGetKey):
1839         (WebCore::IDBIndex::markAsDeleted):
1840         (WebCore::IDBIndex::ref):
1841         (WebCore::IDBIndex::deref):
1842         * Modules/indexeddb/IDBIndex.h:
1843         (WebCore::IDBIndex::openCursor):
1844         (WebCore::IDBIndex::openKeyCursor):
1845         (WebCore::IDBIndex::info):
1846         (WebCore::IDBIndex::modernObjectStore):
1847         (WebCore::IDBIndex::isDeleted):
1848         (WebCore::IDBIndex::~IDBIndex): Deleted.
1849         (WebCore::IDBIndex::isModern): Deleted.
1850         * Modules/indexeddb/IDBObjectStore.cpp:
1851         (WebCore::IDBObjectStore::create):
1852         (WebCore::IDBObjectStore::IDBObjectStore):
1853         (WebCore::IDBObjectStore::~IDBObjectStore):
1854         (WebCore::IDBObjectStore::activeDOMObjectName):
1855         (WebCore::IDBObjectStore::canSuspendForDocumentSuspension):
1856         (WebCore::IDBObjectStore::hasPendingActivity):
1857         (WebCore::IDBObjectStore::name):
1858         (WebCore::IDBObjectStore::keyPathAny):
1859         (WebCore::IDBObjectStore::keyPath):
1860         (WebCore::IDBObjectStore::indexNames):
1861         (WebCore::IDBObjectStore::transaction):
1862         (WebCore::IDBObjectStore::autoIncrement):
1863         (WebCore::IDBObjectStore::openCursor):
1864         (WebCore::IDBObjectStore::get):
1865         (WebCore::IDBObjectStore::add):
1866         (WebCore::IDBObjectStore::put):
1867         (WebCore::IDBObjectStore::putForCursorUpdate):
1868         (WebCore::IDBObjectStore::putOrAdd):
1869         (WebCore::IDBObjectStore::deleteFunction):
1870         (WebCore::IDBObjectStore::doDelete):
1871         (WebCore::IDBObjectStore::modernDelete):
1872         (WebCore::IDBObjectStore::clear):
1873         (WebCore::IDBObjectStore::createIndex):
1874         (WebCore::IDBObjectStore::index):
1875         (WebCore::IDBObjectStore::deleteIndex):
1876         (WebCore::IDBObjectStore::count):
1877         (WebCore::IDBObjectStore::doCount):
1878         (WebCore::IDBObjectStore::markAsDeleted):
1879         (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort):
1880         (WebCore::IDBObjectStore::visitReferencedIndexes):
1881         * Modules/indexeddb/IDBObjectStore.h:
1882         (WebCore::IDBObjectStore::isDeleted):
1883         (WebCore::IDBObjectStore::info):
1884         (WebCore::IDBObjectStore::modernTransaction):
1885         (WebCore::IDBObjectStore::~IDBObjectStore): Deleted.
1886         (WebCore::IDBObjectStore::isModern): Deleted.
1887         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1888         (WebCore::IDBOpenDBRequest::createDeleteRequest):
1889         (WebCore::IDBOpenDBRequest::createOpenRequest):
1890         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
1891         (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
1892         (WebCore::IDBOpenDBRequest::onError):
1893         (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
1894         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
1895         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
1896         (WebCore::IDBOpenDBRequest::dispatchEvent):
1897         (WebCore::IDBOpenDBRequest::onSuccess):
1898         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
1899         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
1900         (WebCore::IDBOpenDBRequest::requestCompleted):
1901         (WebCore::IDBOpenDBRequest::requestBlocked):
1902         * Modules/indexeddb/IDBOpenDBRequest.h:
1903         (WebCore::IDBOpenDBRequest::databaseIdentifier):
1904         (WebCore::IDBOpenDBRequest::version):
1905         (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): Deleted.
1906         * Modules/indexeddb/IDBRequest.cpp:
1907         (WebCore::IDBRequest::create):
1908         (WebCore::IDBRequest::createCount):
1909         (WebCore::IDBRequest::createGet):
1910         (WebCore::IDBRequest::IDBRequest):
1911         (WebCore::IDBRequest::~IDBRequest):
1912         (WebCore::IDBRequest::result):
1913         (WebCore::IDBRequest::errorCode):
1914         (WebCore::IDBRequest::error):
1915         (WebCore::IDBRequest::source):
1916         (WebCore::IDBRequest::setSource):
1917         (WebCore::IDBRequest::setVersionChangeTransaction):
1918         (WebCore::IDBRequest::transaction):
1919         (WebCore::IDBRequest::readyState):
1920         (WebCore::IDBRequest::sourceObjectStoreIdentifier):
1921         (WebCore::IDBRequest::sourceIndexIdentifier):
1922         (WebCore::IDBRequest::requestedIndexRecordType):
1923         (WebCore::IDBRequest::eventTargetInterface):
1924         (WebCore::IDBRequest::activeDOMObjectName):
1925         (WebCore::IDBRequest::canSuspendForDocumentSuspension):
1926         (WebCore::IDBRequest::hasPendingActivity):
1927         (WebCore::IDBRequest::stop):
1928         (WebCore::IDBRequest::enqueueEvent):
1929         (WebCore::IDBRequest::dispatchEvent):
1930         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
1931         (WebCore::IDBRequest::setResult):
1932         (WebCore::IDBRequest::setResultToStructuredClone):
1933         (WebCore::IDBRequest::setResultToUndefined):
1934         (WebCore::IDBRequest::resultCursor):
1935         (WebCore::IDBRequest::willIterateCursor):
1936         (WebCore::IDBRequest::didOpenOrIterateCursor):
1937         (WebCore::IDBRequest::requestCompleted):
1938         (WebCore::IDBRequest::onError):
1939         (WebCore::IDBRequest::onSuccess):
1940         * Modules/indexeddb/IDBRequest.h:
1941         (WebCore::IDBRequest::resourceIdentifier):
1942         (WebCore::IDBRequest::connection):
1943         (WebCore::IDBRequest::modernResult):
1944         (WebCore::IDBRequest::pendingCursor):
1945         (WebCore::IDBRequest::requestType):
1946         (WebCore::IDBRequest::isOpenDBRequest):
1947         (WebCore::IDBRequest::~IDBRequest): Deleted.
1948         * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
1949         (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
1950         * Modules/indexeddb/IDBRequestCompletionEvent.h:
1951         (WebCore::IDBRequestCompletionEvent::create):
1952         * Modules/indexeddb/IDBTransaction.cpp:
1953         (WebCore::IDBTransaction::create):
1954         (WebCore::IDBTransaction::IDBTransaction):
1955         (WebCore::IDBTransaction::~IDBTransaction):
1956         (WebCore::IDBTransaction::mode):
1957         (WebCore::IDBTransaction::db):
1958         (WebCore::IDBTransaction::serverConnection):
1959         (WebCore::IDBTransaction::error):
1960         (WebCore::IDBTransaction::objectStore):
1961         (WebCore::IDBTransaction::abortDueToFailedRequest):
1962         (WebCore::IDBTransaction::transitionedToFinishing):
1963         (WebCore::IDBTransaction::abort):
1964         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
1965         (WebCore::IDBTransaction::activeDOMObjectName):
1966         (WebCore::IDBTransaction::canSuspendForDocumentSuspension):
1967         (WebCore::IDBTransaction::hasPendingActivity):
1968         (WebCore::IDBTransaction::stop):
1969         (WebCore::IDBTransaction::isActive):
1970         (WebCore::IDBTransaction::isFinishedOrFinishing):
1971         (WebCore::IDBTransaction::addRequest):
1972         (WebCore::IDBTransaction::removeRequest):
1973         (WebCore::IDBTransaction::scheduleOperation):
1974         (WebCore::IDBTransaction::scheduleOperationTimer):
1975         (WebCore::IDBTransaction::operationTimerFired):
1976         (WebCore::IDBTransaction::commit):
1977         (WebCore::IDBTransaction::commitOnServer):
1978         (WebCore::IDBTransaction::finishAbortOrCommit):
1979         (WebCore::IDBTransaction::didStart):
1980         (WebCore::IDBTransaction::notifyDidAbort):
1981         (WebCore::IDBTransaction::didAbort):
1982         (WebCore::IDBTransaction::didCommit):
1983         (WebCore::IDBTransaction::fireOnComplete):
1984         (WebCore::IDBTransaction::fireOnAbort):
1985         (WebCore::IDBTransaction::enqueueEvent):
1986         (WebCore::IDBTransaction::dispatchEvent):
1987         (WebCore::IDBTransaction::createObjectStore):
1988         (WebCore::IDBTransaction::createObjectStoreOnServer):
1989         (WebCore::IDBTransaction::didCreateObjectStoreOnServer):
1990         (WebCore::IDBTransaction::createIndex):
1991         (WebCore::IDBTransaction::createIndexOnServer):
1992         (WebCore::IDBTransaction::didCreateIndexOnServer):
1993         (WebCore::IDBTransaction::requestOpenCursor):
1994         (WebCore::IDBTransaction::doRequestOpenCursor):
1995         (WebCore::IDBTransaction::openCursorOnServer):
1996         (WebCore::IDBTransaction::didOpenCursorOnServer):
1997         (WebCore::IDBTransaction::iterateCursor):
1998         (WebCore::IDBTransaction::iterateCursorOnServer):
1999         (WebCore::IDBTransaction::didIterateCursorOnServer):
2000         (WebCore::IDBTransaction::requestGetRecord):
2001         (WebCore::IDBTransaction::requestGetValue):
2002         (WebCore::IDBTransaction::requestGetKey):
2003         (WebCore::IDBTransaction::requestIndexRecord):
2004         (WebCore::IDBTransaction::getRecordOnServer):
2005         (WebCore::IDBTransaction::didGetRecordOnServer):
2006         (WebCore::IDBTransaction::requestCount):
2007         (WebCore::IDBTransaction::getCountOnServer):
2008         (WebCore::IDBTransaction::didGetCountOnServer):
2009         (WebCore::IDBTransaction::requestDeleteRecord):
2010         (WebCore::IDBTransaction::deleteRecordOnServer):
2011         (WebCore::IDBTransaction::didDeleteRecordOnServer):
2012         (WebCore::IDBTransaction::requestClearObjectStore):
2013         (WebCore::IDBTransaction::clearObjectStoreOnServer):
2014         (WebCore::IDBTransaction::didClearObjectStoreOnServer):
2015         (WebCore::IDBTransaction::requestPutOrAdd):
2016         (WebCore::IDBTransaction::putOrAddOnServer):
2017         (WebCore::IDBTransaction::didPutOrAddOnServer):
2018         (WebCore::IDBTransaction::deleteObjectStore):
2019         (WebCore::IDBTransaction::deleteObjectStoreOnServer):
2020         (WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
2021         (WebCore::IDBTransaction::deleteIndex):
2022         (WebCore::IDBTransaction::deleteIndexOnServer):
2023         (WebCore::IDBTransaction::didDeleteIndexOnServer):
2024         (WebCore::IDBTransaction::operationDidComplete):
2025         (WebCore::IDBTransaction::establishOnServer):
2026         (WebCore::IDBTransaction::activate):
2027         (WebCore::IDBTransaction::deactivate):
2028         * Modules/indexeddb/IDBTransaction.h:
2029         (WebCore::IDBTransaction::info):
2030         (WebCore::IDBTransaction::database):
2031         (WebCore::IDBTransaction::originalDatabaseInfo):
2032         (WebCore::IDBTransaction::isVersionChange):
2033         (WebCore::IDBTransaction::isReadOnly):
2034         (WebCore::IDBTransaction::isFinished):
2035         (WebCore::TransactionActivator::TransactionActivator):
2036         (WebCore::TransactionActivator::~TransactionActivator):
2037         (WebCore::IDBTransaction::~IDBTransaction): Deleted.
2038         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2039         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
2040         (WebCore::IDBVersionChangeEvent::newVersion):
2041         (WebCore::IDBVersionChangeEvent::eventInterface):
2042         (WebCore::IDBVersionChangeEvent::create): Deleted.
2043         * Modules/indexeddb/IDBVersionChangeEvent.h:
2044         (isType):
2045         * Modules/indexeddb/client/IDBAnyImpl.cpp: Removed.
2046         * Modules/indexeddb/client/IDBAnyImpl.h: Removed.
2047         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2048         * Modules/indexeddb/client/IDBConnectionToServer.h:
2049         * Modules/indexeddb/client/IDBCursorImpl.cpp: Removed.
2050         * Modules/indexeddb/client/IDBCursorImpl.h: Removed.
2051         * Modules/indexeddb/client/IDBCursorWithValueImpl.cpp: Removed.
2052         * Modules/indexeddb/client/IDBCursorWithValueImpl.h: Removed.
2053         * Modules/indexeddb/client/IDBDatabaseImpl.cpp: Removed.
2054         * Modules/indexeddb/client/IDBDatabaseImpl.h: Removed.
2055         * Modules/indexeddb/client/IDBFactoryImpl.cpp: Removed.
2056         * Modules/indexeddb/client/IDBFactoryImpl.h: Removed.
2057         * Modules/indexeddb/client/IDBIndexImpl.cpp: Removed.
2058         * Modules/indexeddb/client/IDBIndexImpl.h: Removed.
2059         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp: Removed.
2060         * Modules/indexeddb/client/IDBObjectStoreImpl.h: Removed.
2061         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Removed.
2062         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Removed.
2063         * Modules/indexeddb/client/IDBRequestImpl.cpp: Removed.
2064         * Modules/indexeddb/client/IDBRequestImpl.h: Removed.
2065         * Modules/indexeddb/client/IDBTransactionImpl.cpp: Removed.
2066         * Modules/indexeddb/client/IDBTransactionImpl.h: Removed.
2067         * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp: Removed.
2068         * Modules/indexeddb/client/IDBVersionChangeEventImpl.h: Removed.
2069         * Modules/indexeddb/client/TransactionOperation.cpp:
2070         * Modules/indexeddb/client/TransactionOperation.h:
2071         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
2072         (WebCore::IDBCursorInfo::objectStoreCursor):
2073         (WebCore::IDBCursorInfo::indexCursor):
2074         (WebCore::IDBCursorInfo::IDBCursorInfo):
2075         * Modules/indexeddb/shared/IDBCursorInfo.h:
2076         * Modules/indexeddb/shared/IDBRequestData.cpp:
2077         (WebCore::IDBRequestData::IDBRequestData):
2078         * Modules/indexeddb/shared/IDBRequestData.h:
2079         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2080         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
2081         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2082         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
2083         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2084         * Modules/indexeddb/shared/InProcessIDBServer.h:
2085         * WebCore.xcodeproj/project.pbxproj:
2086         * bindings/js/JSIDBCursorCustom.cpp:
2087         (WebCore::JSIDBCursor::visitAdditionalChildren):
2088         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2089         * bindings/js/JSIDBIndexCustom.cpp:
2090         (WebCore::JSIDBIndex::visitAdditionalChildren):
2091         * bindings/js/JSIDBObjectStoreCustom.cpp:
2092         (WebCore::JSIDBObjectStore::visitAdditionalChildren):
2093         * inspector/InspectorIndexedDBAgent.cpp:
2094
2095 2016-03-28  Myles C. Maxfield  <mmaxfield@apple.com>
2096
2097         [RTL Scrollbars] Position:sticky can be positioned under vertical RTL scrollbar
2098         https://bugs.webkit.org/show_bug.cgi?id=155949
2099
2100         Reviewed by Simon Fraser.
2101
2102         When performing sticky positioning logic, we were setting the clip rect's position
2103         equal to the scrollPosition of the layer. This computation assumes that the top
2104         left of the scroll position is the same as the top left of the clip rect. When
2105         using RTL scrollbars, this is not true, so this code simply needs to be made aware
2106         of the presence of an RTL scrollbar.
2107
2108         Tests: fast/scrolling/rtl-scrollbars-sticky-document-2.html
2109                fast/scrolling/rtl-scrollbars-sticky-document.html
2110                fast/scrolling/rtl-scrollbars-sticky-iframe-2.html
2111                fast/scrolling/rtl-scrollbars-sticky-iframe.html
2112                fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html
2113                fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html
2114
2115         * rendering/RenderBoxModelObject.cpp:
2116         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
2117
2118 2016-03-28  Antonio Gomes  <tonikitoo@webkit.org>
2119
2120         Rename PlatformWheelEvent::isEndGesture to isEndOfMomentumScroll.
2121         https://bugs.webkit.org/show_bug.cgi?id=155940
2122
2123         Reviewed by Simon Fraser.
2124
2125         No new tests needed.
2126
2127         The new name better reflects its purpose. Also it is a preparation to fix bug 155746.
2128
2129         * platform/PlatformWheelEvent.h:
2130         (WebCore::PlatformWheelEvent::shouldResetLatching):
2131         (WebCore::PlatformWheelEvent::isEndOfMomentumScroll: Renamed; Formally isEndGesture.
2132         * platform/mac/ScrollAnimatorMac.mm:
2133         (WebCore::gestureShouldBeginSnap):
2134
2135 2016-03-28  Zalan Bujtas  <zalan@apple.com>
2136
2137         Setup cloned continuation renderer properly.
2138         https://bugs.webkit.org/show_bug.cgi?id=155640
2139
2140         Reviewed by Simon Fraser.
2141
2142         Set the "renderer has outline ancestor" flag on the cloned inline renderer when
2143         we split the original renderer for continuation.
2144         It ensures that when the cloned part of the continuation requests repaint, we properly
2145         invalidate the ancestor outline (if needed).
2146
2147         Test: fast/inline/outline-with-continuation-assert.html
2148
2149         * rendering/RenderInline.cpp:
2150         (WebCore::RenderInline::clone):
2151
2152 2016-03-25  Simon Fraser  <simon.fraser@apple.com>
2153
2154         Inspector Memory Timeline sometimes encounters unstoppable rAF drawing
2155         https://bugs.webkit.org/show_bug.cgi?id=155906
2156
2157         Reviewed by Anders Carlsson.
2158
2159         It was possible to get Web Inspector into a state where repeated, expensive
2160         requestAnimationFrame calls prevented user events from being handled, making it
2161         unresponsive.
2162         
2163         requestAnimationFrame uses callOnMainThread() to get a notification from the 
2164         CVDispayLink thread to the main thread, which is a -performSelectorOnMainThread...
2165         Under the hood, this ends up as a CFRunLoopPerformBlock().
2166         
2167         User events come in via Connection::enqueueIncomingMessage(), which uses RunLoop::main()::dispatch(),
2168         which uses a CFRunLoopSource. Evidently, repeated calls to CFRunLoopPerformBlock() can prevent the
2169         CFRunLoopSource from being handled.
2170         
2171         Fix by moving requestAnimationFrame from callOnMainThread() to RunLoop::main()::dispatch().
2172
2173         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
2174         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
2175
2176 2016-03-28  Chris Dumez  <cdumez@apple.com>
2177
2178         Disk cache speculative validation requests do not have the 'Referer' HTTP header set
2179         https://bugs.webkit.org/show_bug.cgi?id=155890
2180         <rdar://problem/25279962>
2181
2182         Reviewed by Antti Koivisto.
2183
2184         Export a couple more symbols so we can use them from WebKit2.
2185
2186         * platform/network/HTTPHeaderMap.h:
2187         * platform/network/ResourceRequestBase.h:
2188
2189 2016-03-24  Timothy Hatcher  <timothy@apple.com>
2190
2191         Web Automation: Add commands to compute layout of an element
2192
2193         https://bugs.webkit.org/show_bug.cgi?id=155841
2194         rdar://problem/25340075
2195
2196         Reviewed by Brian Burg.
2197
2198         * dom/Element.h: Mark scrollIntoViewIfNeeded() method as exported so WK2 can use it.
2199         * platform/ScrollView.h: Mark rootViewToContents(IntRect) method as exported so WK2 can use it.
2200
2201 2016-03-18  Timothy Hatcher  <timothy@apple.com>
2202
2203         Web Automation: Add Automation protocol commands to resolve frames as handles
2204
2205         https://bugs.webkit.org/show_bug.cgi?id=155650
2206         rdar://problem/25242422
2207
2208         Reviewed by Brian Burg.
2209
2210         * page/DOMWindow.h: Marked focus() method as exported so WK2 can use them.
2211         * page/FrameTree.h: Marked scopedChild() methods as exported so WK2 can use them.
2212
2213 2016-03-28  Konstantin Tokarev  <annulen@yandex.ru>
2214
2215         Remove USE(TEXTURE_MAPPER) guards inside TextureMapper sources.
2216         https://bugs.webkit.org/show_bug.cgi?id=155944
2217
2218         Reviewed by Michael Catanzaro.
2219
2220         After r196429 TextureMapper sources are built only in ports which actually
2221         use TextureMapper, so USE(TEXTURE_MAPPER) guards in them are redundant now.
2222
2223         No new tests needed.
2224
2225         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2226         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2227         * platform/graphics/texmap/TextureMapper.cpp:
2228         * platform/graphics/texmap/TextureMapper.h:
2229         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
2230         * platform/graphics/texmap/TextureMapperBackingStore.h:
2231         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
2232         * platform/graphics/texmap/TextureMapperFPSCounter.h:
2233         * platform/graphics/texmap/TextureMapperLayer.cpp:
2234         * platform/graphics/texmap/TextureMapperLayer.h:
2235         * platform/graphics/texmap/TextureMapperTile.cpp:
2236         * platform/graphics/texmap/TextureMapperTile.h:
2237         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
2238         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2239
2240 2016-03-28  Manuel Rego Casasnovas  <rego@igalia.com>
2241
2242         [css-grid] Remove unneeded lines in offsetAndBreadthForPositionedChild()
2243         https://bugs.webkit.org/show_bug.cgi?id=155788
2244
2245         Reviewed by Sergio Villar Senin.
2246
2247         Just remove 2 lines/variables that were not needed at all in
2248         RenderGrid::offsetAndBreadthForPositionedChild().
2249
2250         No new tests, no change of behavior.
2251
2252         * rendering/RenderGrid.cpp:
2253         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2254
2255 2016-03-27  Konstantin Tokarev  <annulen@yandex.ru>
2256
2257         Removed redundant #if conditions in ANGLEWebKitBridge.h
2258         https://bugs.webkit.org/show_bug.cgi?id=155880
2259
2260         Reviewed by Csaba Osztrogon√°c.
2261
2262         GTK, Efl, AppleWin, and WinCairo ports can be built only with cmake,
2263         so condition !defined(BUILDING_WITH_CMAKE) implies
2264         !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATOFRM(WIN).
2265
2266         No new tests needed.
2267
2268         * platform/graphics/ANGLEWebKitBridge.h:
2269
2270 2016-03-26  Alex Christensen  <achristensen@webkit.org>
2271
2272         Mac CMake build fix.
2273
2274         * PlatformMac.cmake:
2275         Link with AVFoundation libraries.
2276
2277 2016-03-25  Dean Jackson  <dino@apple.com>
2278
2279         Move extended color detection into Open Source
2280         https://bugs.webkit.org/show_bug.cgi?id=155909
2281         <rdar://problem/25369754>
2282
2283         Reviewed by Anders Carlsson.
2284
2285         The code for detecting extended color displays
2286         was hidden while the iPad Pro 9.7" was in development.
2287         Now it is public, move the detection to Open Source.
2288
2289         While doing this, add a new method to PlatformScreen
2290         so that we have a more obvious way to detect such
2291         displays.
2292
2293         * platform/PlatformScreen.h: Add screenSupportsExtendedColor.
2294
2295         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2296         (PlatformCALayerCocoa::commonInit): Set the backing
2297         store format to the RGBA10XR if we're on an extended
2298         display.
2299         * platform/ios/LegacyTileGridTile.mm:
2300         (WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
2301         (WebCore::setBackingStoreFormat): Deleted. Now set directly
2302         in the constructor.
2303
2304         * platform/ios/PlatformScreenIOS.mm:
2305         (WebCore::screenDepthPerComponent): Cleanup.
2306         (WebCore::screenSupportsExtendedColor): Implement the
2307         iOS version of this using MobileGestalt.
2308
2309         * platform/mac/PlatformScreenMac.mm:
2310         (WebCore::displayFromWidget): Whitespace cleanup.
2311         (WebCore::screenForWidget):
2312         (WebCore::screenForWindow):
2313         (WebCore::screenSupportsExtendedColor): Default implementation
2314         returns false for all screens at the moment.
2315
2316         * platform/spi/cocoa/QuartzCoreSPI.h: New constant.
2317         * platform/spi/ios/MobileGestaltSPI.h: Ditto.
2318
2319 2016-03-26  Myles C. Maxfield  <mmaxfield@apple.com>
2320
2321         [OS X] Layout  sometimes flakily assumes overlay scrollbars when clicky-scroll-wheel-mouse is attached and system preference detects scrollbar mode
2322         https://bugs.webkit.org/show_bug.cgi?id=155912
2323
2324         Reviewed by Simon Fraser.
2325
2326         When the system preference is set to detect the scrollbar type (overlay or
2327         always-on, and a clicky scroll wheel mouse is connected, AppKit
2328         asynchronously tells all the NSScrollerImpPairs about the kind of scrollbar
2329         it should be using. However, when this notification is delivered, it may
2330         be in between FrameViews, which means we may not have any
2331         NSScrollerImpPairs created to listen to the notification.
2332
2333         r198444 solved this by asking if we missed any update whenever we create
2334         an NSScrollerImpPair. This works partially; however, there is a significant
2335         amount of layout which occurs before we create the first ScrollAnimatorMac.
2336         This layout will ask the ScrollbarThemeMac if overlay scrollbars are
2337         enabled, and the results will be stale (because we haven't created any the
2338         NSScrollerImpPairs yet).
2339
2340         Luckly, AppKit fires a notification when it discovers what kind of
2341         scrollbars should be used. We can rely on this notification in the event
2342         that we don't have any NSScrollerImpPairs created.
2343
2344         Covered (as best as possible) by existing RTL scrollbar tests. However,
2345         the system preference that governs this is not currently testable.
2346
2347         * platform/mac/ScrollbarThemeMac.mm:
2348         (+[WebScrollbarPrefsObserver registerAsObserver]):
2349         * platform/mac/ScrollAnimatorMac.mm:
2350         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):  Remove the old code.
2351
2352 2016-03-25  Jer Noble  <jer.noble@apple.com>
2353
2354         [Mac] Audio tracks in alternate groups are not represented correctly as AudioTracks
2355         https://bugs.webkit.org/show_bug.cgi?id=155891
2356         <rdar://problem/24841372>
2357
2358         Reviewed by Eric Carlson.
2359
2360         Test: media/track/video-track-alternate-groups.html
2361
2362         Previously, we created an AudioTrack for every AVPlayerItemTrack, and additionally, a
2363         AudioTrack for every AVMediaSelectionOption that did not have an associated AVAssetTrack.
2364         This caused a number of issues with various types of media, including media with fallback
2365         tracks.
2366
2367         Now, we will create an AudioTrack for every AVMediaSelectionOption, and only create an
2368         AudioTrack for every AVPlayerItem track if no AVMediaSelectionGroups (and thus no
2369         AVMediaSeletionOptions) exist.
2370
2371         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2372         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
2373         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
2374
2375 2016-03-25  Zalan Bujtas  <zalan@apple.com>
2376
2377         RenderImage::repaintOrMarkForLayout fails when the renderer is detached.
2378         https://bugs.webkit.org/show_bug.cgi?id=155885
2379         <rdar://problem/25359164>
2380
2381         Reviewed by Simon Fraser.
2382
2383         Making containingBlockFor* functions standalone ensures that we don't
2384         call them on an invalid object. 
2385
2386         Covered by existing tests.
2387
2388         * dom/Element.cpp:
2389         (WebCore::layoutOverflowRectContainsAllDescendants):
2390         * rendering/LogicalSelectionOffsetCaches.h:
2391         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
2392         * rendering/RenderElement.cpp:
2393         (WebCore::containingBlockForFixedPosition):
2394         (WebCore::containingBlockForAbsolutePosition):
2395         (WebCore::containingBlockForObjectInFlow):
2396         (WebCore::RenderElement::containingBlockForFixedPosition): Deleted.
2397         (WebCore::RenderElement::containingBlockForAbsolutePosition): Deleted.
2398         (WebCore::isNonRenderBlockInline): Deleted.
2399         (WebCore::RenderElement::containingBlockForObjectInFlow): Deleted.
2400         * rendering/RenderElement.h:
2401         * rendering/RenderInline.cpp:
2402         (WebCore::RenderInline::styleWillChange):
2403         * rendering/RenderObject.cpp:
2404         (WebCore::RenderObject::containingBlock):
2405
2406 2016-03-25  Dean Jackson  <dino@apple.com>
2407
2408         Remove use of extern "C" to include QuartzCore files
2409         https://bugs.webkit.org/show_bug.cgi?id=155905
2410         <rdar://problem/25364798>
2411
2412         Reviewed by Anders Carlson.
2413
2414         We can avoid having to wrap constants in extern "C", since they
2415         are mangled the same in both C and C++.
2416
2417         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Now that
2418         QuartzCoreSPI.h has CABackdropLayer, remove the duplicate entry.
2419         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Ditto.
2420         * platform/spi/cocoa/QuartzCoreSPI.h: Include the framework private
2421         file. Repace EXTERN_C with "extern".
2422
2423 2016-03-25  Alex Christensen  <achristensen@webkit.org>
2424
2425         Add a compile time flag for using QTKit
2426         https://bugs.webkit.org/show_bug.cgi?id=155868
2427
2428         Reviewed by Daniel Bates.
2429
2430         * platform/graphics/MediaPlayer.cpp:
2431         (WebCore::buildMediaEnginesVector):
2432         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2433         * platform/graphics/mac/MediaTimeQTKit.h:
2434         * platform/graphics/mac/MediaTimeQTKit.mm:
2435         * platform/mac/WebVideoFullscreenController.mm:
2436         (SOFT_LINK_CLASS):
2437         (-[WebVideoFullscreenController setVideoElement:]):
2438         (-[WebVideoFullscreenController updatePowerAssertions]):
2439
2440 2016-03-25  Beth Dakin  <bdakin@apple.com>
2441
2442         Autoscrolling from a drag selection does not work in full screen, or when the 
2443         window is against the screen edge
2444         https://bugs.webkit.org/show_bug.cgi?id=155858
2445         -and corresponding-
2446         rdar://problem/9338465
2447
2448         Reviewed by Simon Fraser.
2449
2450         WebKit2 has always had this bug. Since WebKit1 scrolling in handled largely 
2451         by AppKit, we did not have this bug because AppKit adjusts the autoscroll 
2452         amount whenever the window is at the edge of the screen and the user is 
2453         trying to autoscroll in that direction. This patch employs the same technique 
2454         in WebCore.
2455
2456         Instead of using EventHandler::lastKnownMousePosition() as the autoscroll 
2457         amount, use EventHandler::effectiveMousePositionForSelectionAutoscroll() 
2458         which will adjust the lastKnownMousePosition if the window is at the edge of 
2459         the screen.
2460         * page/AutoscrollController.cpp:
2461         (WebCore::AutoscrollController::autoscrollTimerFired):
2462
2463         For most ports, effectiveMousePositionForSelectionAutoscroll() will just 
2464         return m_lastKnownMousePosition. We override it in EventHandlerMac to return 
2465         an adjusted amount.
2466         * page/EventHandler.cpp:
2467         (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll):
2468         * page/EventHandler.h:
2469         * page/mac/EventHandlerMac.mm:
2470         (WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
2471         (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll):
2472
2473         Make screenForDisplayID available as on PlatformScreen.h instead of just 
2474         being a static function in the implementation file.
2475         * platform/PlatformScreen.h:
2476         * platform/mac/PlatformScreenMac.mm:
2477         (WebCore::screenForDisplayID):
2478
2479 2016-03-25  Brady Eidson  <beidson@apple.com>
2480
2481         Soften push/replaceState frequency restrictions.
2482         <rdar://problem/25228439> and https://bugs.webkit.org/show_bug.cgi?id=155901
2483
2484         Rubber-stamped by Timothy Hatcher.
2485
2486         Covered by existing LayoutTests and a new Manual Test.
2487
2488         * page/History.cpp:
2489         (WebCore::History::stateObjectAdded): Allow 100 state object operations every 30 seconds.
2490         * page/History.h:
2491
2492 2016-03-24  Enrica Casucci  <enrica@apple.com>
2493
2494         Data Detection creates multiple links even when the detected content is within the same node.
2495         https://bugs.webkit.org/show_bug.cgi?id=155860
2496         rdar://problem/25319579
2497
2498         Reviewed by Tim Horton.
2499
2500         If the detected content spans over multiple query fragments,
2501         we need to check if consecutive fragments are all within the
2502         same node. This way we can avoid creating multiple ranges and
2503         consequntly more links.
2504
2505         * editing/cocoa/DataDetection.mm:
2506         (WebCore::DataDetection::detectContentInRange):
2507
2508 2016-03-23  Dave Hyatt  <hyatt@apple.com>
2509
2510         Implement the allow-end value of the hanging-punctuation CSS property.
2511         https://bugs.webkit.org/show_bug.cgi?id=104996
2512
2513         Reviewed by Simon Fraser.
2514
2515         Added new tests in fast/text.
2516
2517         * rendering/RenderBlockLineLayout.cpp:
2518         (WebCore::RenderBlockFlow::constructLine):
2519         Fix a bug where empty RenderInlines were incorrectly excluding their end borders if
2520         they occurred at the end of a line. Needed to adequately test allow-end and empty
2521         inline borders.
2522
2523         * rendering/RenderText.cpp:
2524         (WebCore::RenderText::isHangableStopOrComma):
2525         Helper function that identifies the hangable stops and commas.
2526
2527         * rendering/RenderText.h:
2528         Add new isHangableStopOrComma function to RenderText.
2529
2530         * rendering/line/BreakingContext.h:
2531         (WebCore::BreakingContext::lineBreak):
2532         (WebCore::BreakingContext::lineWidth):
2533         (WebCore::BreakingContext::atEnd):
2534         (WebCore::BreakingContext::fitsOnLineOrHangsAtEnd):
2535         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
2536         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
2537         (WebCore::BreakingContext::handleBR):
2538         (WebCore::BreakingContext::handleEmptyInline):
2539         (WebCore::BreakingContext::handleReplaced):
2540         (WebCore::tryHyphenating):
2541         (WebCore::BreakingContext::computeAdditionalBetweenWordsWidth):
2542         (WebCore::BreakingContext::handleText):
2543         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
2544         Modified breaking rules to handle allow-end. The basic idea is to see if you can
2545         fit without the comma and only hang if you do, and if nothing else gets added to the
2546         line after the comma. This involves tracking a new state, m_hangsAtEnd, that can
2547         be set/cleared while iterating over the objects that will end up on the line.
2548
2549 2016-03-25  Alex Christensen  <achristensen@webkit.org>
2550
2551         Revert most of r198673.
2552
2553         * platform/graphics/MediaPlayer.cpp:
2554         (WebCore::buildMediaEnginesVector):
2555         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2556         * platform/graphics/mac/MediaTimeQTKit.h:
2557         * platform/graphics/mac/MediaTimeQTKit.mm:
2558         * platform/mac/WebVideoFullscreenController.mm:
2559
2560 2016-03-25  Alex Christensen  <achristensen@webkit.org>
2561
2562         Add a compile time flag for using QTKit
2563         https://bugs.webkit.org/show_bug.cgi?id=155868
2564
2565         Reviewed by Dan Bates.
2566
2567         * platform/graphics/MediaPlayer.cpp:
2568         (WebCore::buildMediaEnginesVector):
2569         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2570         * platform/graphics/mac/MediaTimeQTKit.h:
2571         * platform/graphics/mac/MediaTimeQTKit.mm:
2572         * platform/mac/WebVideoFullscreenController.mm:
2573
2574 2016-03-25  Brent Fulgham  <bfulgham@apple.com>
2575
2576         [Win] Improve CMake build performance 
2577         https://bugs.webkit.org/show_bug.cgi?id=155871
2578         <rdar://problem/24747822>
2579
2580         Reviewed by Alex Christensen.
2581
2582         Treat DerivedSources.cpp as an 'All-in-one' file. Pass a flag to the
2583         PROCESS_ALLINONE_FILE macro so that it does not remove the contents of
2584         the file, since this breaks dependency checking and generation of the
2585         sources from the IDL files. Instead, include the header files in the
2586         project so that all files get generated.        
2587         
2588         * CMakeLists.txt: Updated for 'DerivedSources.cpp'
2589         * DerivedSources.cpp: Add some generated files that were missing.
2590
2591 2016-03-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2592
2593         [Fetch API] Add basic loading of resources
2594         https://bugs.webkit.org/show_bug.cgi?id=155637
2595
2596         Reviewed by Darin Adler.
2597
2598         Adding support for basic fetch for Window (no support for Worker yet).
2599         A FetchResponse object is created for every fetch task.
2600         But it will only be exposed to JS at promise fulfillment time, i.e. once initial response headers are retrieved.
2601
2602         Updating Blob resource handle to add Content-Type and Content-Length header and notifying of error in case of erroneous HTTP method.
2603
2604         Fetch is limited to same origin requests currently due to some WPT tests that would timeout otherwise.
2605
2606         Tests: http/tests/fetch/closing-while-fetching.html
2607                http/tests/fetch/get-response-body-while-loading.html
2608         Also covered by rebased tests.
2609
2610         * Modules/fetch/DOMWindowFetch.cpp: Creating a FetchResponse to start fetching.
2611         (WebCore::DOMWindowFetch::fetch):
2612         * Modules/fetch/DOMWindowFetch.h:
2613         * Modules/fetch/FetchBody.cpp:
2614         (WebCore::FetchBody::consume):
2615         (WebCore::FetchBody::consumeArrayBuffer): Handling of body promises in case of data stored as a buffer.
2616         (WebCore::FetchBody::consumeText): Passing the promise as a reference.
2617         (WebCore::blobFromArrayBuffer): Helper routine.
2618         (WebCore::FetchBody::fulfillTextPromise): Helper routine.
2619         (WebCore::FetchBody::loadedAsArrayBuffer): Updated to handle storing of data as a buffer.
2620         (WebCore::FetchBody::loadedAsText):
2621         (WebCore::FetchBody::bodyForInternalRequest): Helper routine to generate the request body data to be sent as part of the fetch request.
2622         (WebCore::FetchBody::extractFromText):
2623         * Modules/fetch/FetchBody.h:
2624         (WebCore::FetchBody::loadingBody):
2625         (WebCore::FetchBody::FetchBody):
2626         * Modules/fetch/FetchBodyOwner.cpp:
2627         (WebCore::FetchBodyOwner::loadBlob): Updated to cope with the change that FetchLoader::start does not return a boolean anymore
2628         but will directly call failure callbacks.
2629         (WebCore::FetchBodyOwner::loadedBlobAsText): Moving it closer to other blob loading routines.
2630         (WebCore::FetchBodyOwner::finishBlobLoading):
2631         * Modules/fetch/FetchBodyOwner.h:
2632         (WebCore::FetchBodyOwner::body):
2633         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer):
2634         * Modules/fetch/FetchHeaders.cpp:
2635         (WebCore::FetchHeaders::fill):
2636         (WebCore::FetchHeaders::filterAndFill): Helper routine to fill headers from a HTTPHeaderMap after being filtered.
2637         * Modules/fetch/FetchHeaders.h:
2638         (WebCore::FetchHeaders::internalHeaders):
2639         * Modules/fetch/FetchLoader.cpp:
2640         (WebCore::FetchLoader::start):
2641         (WebCore::FetchLoader::didFailRedirectCheck):
2642         * Modules/fetch/FetchLoader.h:
2643         * Modules/fetch/FetchRequest.cpp:
2644         (WebCore::FetchRequest::internalRequest): Routine used to create the ResourceRequest transmitted to ThreadableLoader.
2645        * Modules/fetch/FetchRequest.h:
2646         * Modules/fetch/FetchResponse.cpp:
2647         (WebCore::FetchResponse::fetch): Start fetching by creating a FetchLoader based on passed request.
2648         (WebCore::FetchResponse::BodyLoader::didSucceed): FetchLoader callback.
2649         (WebCore::FetchResponse::BodyLoader::didFail): Ditto.
2650         (WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
2651         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Ditto.
2652         (WebCore::FetchResponse::BodyLoader::didFinishLoadingAsArrayBuffer): Ditto.
2653         (WebCore::FetchResponse::BodyLoader::start): Starting fetch loader.
2654         (WebCore::FetchResponse::BodyLoader::stop): Stopping fetch loader.
2655         (WebCore::FetchResponse::stop): Stop loader if any.
2656         * Modules/fetch/FetchResponse.h:
2657         * platform/network/BlobResourceHandle.cpp:
2658         (WebCore::BlobResourceHandle::doStart: Notifying the loader with an error if verb is not GET.
2659         (WebCore::BlobResourceHandle::notifyResponseOnSuccess): Adding support for Content-Type and Content-Lenth headers.
2660         (WebCore::BlobResourceHandle::createAsync): Removing GET verb check.
2661
2662 2016-03-25  Konstantin Tokarev  <annulen@yandex.ru>
2663
2664         Removed leftovers of WCHAR_UNICODE code path after r162782.
2665         https://bugs.webkit.org/show_bug.cgi?id=155881
2666
2667         Reviewed by Csaba Osztrogon√°c.
2668
2669         No new tests needed.
2670
2671         * platform/text/TextEncodingDetectorNone.cpp: Removed.
2672         * platform/text/wchar/TextBreakIteratorWchar.cpp: Removed.
2673
2674 2016-03-24  Alex Christensen  <achristensen@webkit.org>
2675
2676         Fix Mac CMake build.
2677
2678         * PlatformMac.cmake:
2679         Add new file and directory.
2680
2681 2016-03-24  Chris Dumez  <cdumez@apple.com>
2682
2683         Unreviewed, rolling out r198500.
2684
2685         Roll back in r197552 as it did not seem to cause a PLT
2686         regression after all
2687
2688         Reverted changeset:
2689
2690         "Unreviewed, rolling out r197552."
2691         https://bugs.webkit.org/show_bug.cgi?id=154986
2692         http://trac.webkit.org/changeset/198500
2693
2694 2016-03-24  Daniel Bates  <dabates@apple.com>
2695
2696         CSP: Move logic for reporting a violation from ContentSecurityPolicyDirectiveList to ContentSecurityPolicy
2697         https://bugs.webkit.org/show_bug.cgi?id=155842
2698         <rdar://problem/25340377>
2699         And
2700         https://bugs.webkit.org/show_bug.cgi?id=155133
2701
2702         Reviewed by Brent Fulgham.
2703
2704         Towards associating source file, line-, and column- numbers (https://bugs.webkit.org/show_bug.cgi?id=114317)
2705         with a CSP console message we should move the logic for logging the console message/reporting the violation
2706         from class ContentSecurityPolicyDirectiveList to class ContentSecurityPolicy so that it is closer to the
2707         script execution context that can access such information.
2708
2709         The responsibilities of the class ContentSecurityPolicyDirectiveList have been reduced. It is responsible
2710         for parsing a string representation of the Content Security Policy and providing functions to determine
2711         the violated directive (if any) for a given source (e.g. URL). ContentSecurityPolicyDirectiveList no longer
2712         takes responsibility logging a console message or sending a violation report (if applicable). Falling out
2713         from this decrease in responsibility is the removal of enum ContentSecurityPolicyDirectiveList::ReportingStatus
2714         and the need to pass a enumerator of this enum to each ContentSecurityPolicyDirectiveList to suppress
2715         the sending of a violation report. The caller of ContentSecurityPolicyDirectiveList is responsible for
2716         making this determination.
2717
2718         With the exception of a change to the error message for an inline event handler violation, there are no
2719         other functional changes. When an inline event handler violation occurs we will emit either:
2720
2721             Refused to execute a script for an inline event handler because 'unsafe-inline' does not appear in the
2722             script-src directive of the Content Security Policy.
2723
2724         Or:
2725
2726             Refused to execute a script for an inline event handler because 'unsafe-inline' appears in neither the
2727             script-src directive nor the default-src directive of the Content Security Policy.
2728
2729         depending on whether the Content Security Policy contains a script-src directive or not.
2730
2731         * CMakeLists.txt: Add files ContentSecurityPolicyDirective.cpp and ContentSecurityPolicyDirectiveNames.cpp.
2732         * WebCore.xcodeproj/project.pbxproj: Add files ContentSecurityPolicyDirective.cpp and ContentSecurityPolicyDirectiveNames.{cpp, h}.
2733         * page/csp/ContentSecurityPolicy.cpp:
2734         (WebCore::consoleMessageForViolation): Moved from file ContentSecurityPolicyDirectiveList.cpp and
2735         incorporates the functionality of ContentSecurityPolicyDirectiveList::reportViolation(). Modified
2736         to take a reference to the violated directive (ContentSecurityPolicyDirective object) and removed
2737         the boolean parameter violatesDefaultSrc as we can deduce this from the violated directive.
2738         (WebCore::ContentSecurityPolicy::didReceiveHeader): Modified to call ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeEval().
2739         (WebCore::ContentSecurityPolicy::foundHashOfContentInAllPolicies): Renamed; Formerly named allPoliciesAllowHashFromContent.
2740         Modified to early return if either no algorithms are given or the specified content to hash is
2741         the empty string.
2742         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Moved logic for reporting a violation from
2743         ContentSecurityPolicyDirectiveList member function of the same name to here.
2744         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Moved logic for reporting a violation from
2745         ContentSecurityPolicyDirectiveList member function of the same name to here. Additionally, changed the
2746         error message text to better describe the reason for the violation.
2747         (WebCore::ContentSecurityPolicy::allowScriptWithNonce): Ditto.
2748         (WebCore::ContentSecurityPolicy::allowStyleWithNonce): Ditto.
2749         (WebCore::ContentSecurityPolicy::allowInlineScript): Ditto.
2750         (WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
2751         (WebCore::ContentSecurityPolicy::allowEval): Ditto.
2752         (WebCore::ContentSecurityPolicy::allowFrameAncestors): Ditto.
2753         (WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
2754         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
2755         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
2756         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
2757         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
2758         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
2759         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
2760         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
2761         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
2762         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
2763         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
2764         (WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
2765         (WebCore::ContentSecurityPolicy::reportViolation): Simplified signature by having it take a reference to
2766         a ContentSecurityPolicyDirective object. Also split functionality into two variants: one variant takes a
2767         pointer to a JSC::ExecState, one variant takes a source file, and line and column positions.
2768         (WebCore::ContentSecurityPolicy::allPoliciesAllowHashFromContent): Deleted.
2769         (WebCore::ContentSecurityPolicy::gatherReportURIs): Deleted.
2770         * page/csp/ContentSecurityPolicy.h:
2771         (WebCore::ContentSecurityPolicy::violatedDirectiveInAnyPolicy): Formerly named allPoliciesAllow. Modified
2772         to return the violated directive.
2773         (WebCore::ContentSecurityPolicy::allPoliciesAllow): Deleted.
2774         * page/csp/ContentSecurityPolicyDirective.cpp: Added.
2775         * page/csp/ContentSecurityPolicyDirective.h: Added.
2776         (WebCore::ContentSecurityPolicyDirective::ContentSecurityPolicyDirective): Modified to take a reference to the
2777         directive list that contains this directive instead of pointer to a ContentSecurityPolicy object.
2778         (WebCore::ContentSecurityPolicyDirective::name): Added.
2779         (WebCore::ContentSecurityPolicyDirective::directiveList): Added.
2780         (WebCore::ContentSecurityPolicyDirective::isDefaultSrc): Added.
2781         (WebCore::ContentSecurityPolicyDirective::policy): Deleted.
2782         * page/csp/ContentSecurityPolicyDirectiveList.cpp: Remove unused header <wtf/Optional.h>. Also remove header wtf/text/StringBuilder.h
2783         as the function that made use of it, consoleMessageForViolation, was moved to file ContentSecurityPolicy.cpp.
2784         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeEval): Formerly named allowEval.
2785         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScript): Formerly named allowInlineScript.
2786         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyle): Formerly named allowInlineStyle.
2787         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash): Formerly named allowInlineScriptWithHash.
2788         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash): Formerly named allowInlineStyleWithHash.
2789         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptNonce): Formerly named allowScriptWithNonce.
2790         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleNonce): Formerly named allowStyleWithNonce.
2791         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForBaseURI): Formerly named allowBaseURI.
2792         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForChildContext): Formerly named allowChildContextFromSource.
2793         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForConnectSource): Formerly named allowConnectToSource.
2794         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFont): Formerly named allowFontFromSource.
2795         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFormAction): Formerly named allowFormAction.
2796         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame): Formerly named allowChildFrameFromSource.
2797         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestor): Formerly named allowFrameAncestors.
2798         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForImage): Formerly named allowImageFromSource.
2799         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForMedia): Formerly named allowMediaFromSource.
2800         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource): Formerly named allowObjectFromSource.
2801         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForPluginType): Formerly named allowPluginType.
2802         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScript): Formerly named allowScriptFromSource.
2803         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle): Formerly named allowStyleFromSource.
2804         (WebCore::ContentSecurityPolicyDirectiveList::parse): Update code to make use of ContentSecurityPolicyDirectiveNames constants.
2805         (WebCore::ContentSecurityPolicyDirectiveList::setCSPDirective): Pass |this| instead of the ContentSecurityPolicy object.
2806         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Update code to make use of ContentSecurityPolicyDirectiveNames constants.
2807         (WebCore::isExperimentalDirectiveName): Deleted.
2808         (WebCore::isCSPDirectiveName): Deleted.
2809         (WebCore::ContentSecurityPolicyDirectiveList::reportViolation): Deleted.
2810         (WebCore::consoleMessageForViolation): Deleted.
2811         (WebCore::ContentSecurityPolicyDirectiveList::allowJavaScriptURLs): Deleted.
2812         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineEventHandlers): Deleted.
2813         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineScript): Deleted.
2814         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineScriptWithHash): Deleted.
2815         (WebCore::ContentSecurityPolicyDirectiveList::allowScriptWithNonce): Deleted.
2816         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineStyle): Deleted.
2817         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineStyleWithHash): Deleted.
2818         (WebCore::ContentSecurityPolicyDirectiveList::allowStyleWithNonce): Deleted.
2819         (WebCore::ContentSecurityPolicyDirectiveList::allowEval): Deleted.
2820         (WebCore::ContentSecurityPolicyDirectiveList::allowPluginType): Deleted.
2821         (WebCore::ContentSecurityPolicyDirectiveList::allowScriptFromSource): Deleted.
2822         (WebCore::ContentSecurityPolicyDirectiveList::allowObjectFromSource): Deleted.
2823         (WebCore::ContentSecurityPolicyDirectiveList::allowChildContextFromSource): Deleted.
2824         (WebCore::ContentSecurityPolicyDirectiveList::allowChildFrameFromSource): Deleted.
2825         (WebCore::ContentSecurityPolicyDirectiveList::allowImageFromSource): Deleted.
2826         (WebCore::ContentSecurityPolicyDirectiveList::allowStyleFromSource): Deleted.
2827         (WebCore::ContentSecurityPolicyDirectiveList::allowFontFromSource): Deleted.
2828         (WebCore::ContentSecurityPolicyDirectiveList::allowMediaFromSource): Deleted.
2829         (WebCore::ContentSecurityPolicyDirectiveList::allowConnectToSource): Deleted.
2830         (WebCore::ContentSecurityPolicyDirectiveList::allowFormAction): Deleted.
2831         (WebCore::ContentSecurityPolicyDirectiveList::allowBaseURI): Deleted.
2832         (WebCore::ContentSecurityPolicyDirectiveList::allowFrameAncestors): Deleted.
2833         * page/csp/ContentSecurityPolicyDirectiveList.h:
2834         (WebCore::ContentSecurityPolicyDirectiveList::defaultSrc): Added.
2835         (WebCore::ContentSecurityPolicyDirectiveList::policy): Added. Also added FIXME comment to remove this function. This
2836         function is only used by ContentSecurityPolicyMediaListDirective so that it can log a console message on a parsing error.
2837         (WebCore::ContentSecurityPolicyDirectiveList::denyIfEnforcingPolicy): Deleted.
2838         * page/csp/ContentSecurityPolicyDirectiveNames.cpp: Added.
2839         * page/csp/ContentSecurityPolicyDirectiveNames.h: Added.
2840         * page/csp/ContentSecurityPolicyMediaListDirective.cpp:
2841         (WebCore::ContentSecurityPolicyMediaListDirective::ContentSecurityPolicyMediaListDirective): Modified to take a reference to the
2842         directive list that contains this directive instead of pointer to a ContentSecurityPolicy object.
2843         (WebCore::ContentSecurityPolicyMediaListDirective::parse): Updated code to use ContentSecurityPolicyDirectiveList::policy() instead
2844         of ContentSecurityPolicyDirective::policy() as the latter was removed. Ideally this class should not need to use the ContentSecurityPolicy
2845         object to log a console message.
2846         * page/csp/ContentSecurityPolicyMediaListDirective.h:
2847         * page/csp/ContentSecurityPolicySourceList.cpp:
2848         (WebCore::isExperimentalDirectiveName): Moved from file ContentSecurityPolicyDirectiveList.cpp because this function is only used
2849         in this file.
2850         (WebCore::isCSPDirectiveName): Ditto.
2851         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar): Update code to make use of ContentSecurityPolicyDirectiveNames constants.
2852         * page/csp/ContentSecurityPolicySourceListDirective.cpp:
2853         (WebCore::ContentSecurityPolicySourceListDirective::ContentSecurityPolicySourceListDirective): Modified to take a reference to
2854         the directive list that contains this directive instead of pointer to a ContentSecurityPolicy object. 
2855         * page/csp/ContentSecurityPolicySourceListDirective.h:
2856
2857 2016-03-24  Myles C. Maxfield  <mmaxfield@apple.com>
2858
2859         [OS X] Overflow:scroll scrollbars do not obey overlay/always-on system preference changes
2860         https://bugs.webkit.org/show_bug.cgi?id=155830
2861
2862         Reviewed by Simon Fraser.
2863
2864         When the scrollbar style changes, the available width of all ScrollableAreas change,
2865         and therefore a relayout must occur.
2866
2867         Each ScrollableArea owns its own ScrollAnimator (if necessary). Upon creation, the
2868         ScrollAnimator will start listening for changes to the system preference for
2869         overlay / always-on scrollbars. When notified, the ScrollAnimator tells its owning
2870         ScrollableArea that scrollbarStyleChanged().
2871
2872         For main-frame scrolling, FrameView overrides scrollbarStyleChanged and causes a
2873         relayout. However, for overflow:scroll elements, no relayout is triggered. This
2874         patch overrides availableContentSizeChanged() for RenderLayer (which is used for
2875         overflow:scroll elements). This override triggers a relayout.
2876
2877         It also updates the mechanism in RenderBlock::recomputeLogicalWidth() to ensure that
2878         a change in scrollbar size causes RenderBlockFlow::layoutBlock() to relayout its
2879         children. This is appropriate because block child positioning is affected by
2880         scrollbar size.
2881
2882         No new tests (for now). Presumably we could mock the message we receive when the
2883         system preference is changed. However, I haven't implemented that yet.
2884
2885         * rendering/RenderBlock.cpp: Rename setHasBorderOrPaddingLogicalWidthChanged().
2886         (WebCore::RenderBlock::styleDidChange):
2887         (WebCore::RenderBlock::recomputeLogicalWidth):
2888         * rendering/RenderBlock.h: Ditto.
2889         (WebCore::RenderBlock::setShouldForceRelayoutChildren):
2890         (WebCore::RenderBlock::shouldForceRelayoutChildren):
2891         * rendering/RenderElement.cpp: Ditto.
2892         (WebCore::RenderElement::RenderElement):
2893         * rendering/RenderElement.h: Ditto.
2894         (WebCore::RenderElement::setRenderBlockShouldForceRelayoutChildren):
2895         (WebCore::RenderElement::renderBlockShouldForceRelayoutChildren):
2896         * rendering/RenderLayer.cpp:
2897         (WebCore::RenderLayer::availableContentSizeChanged): Cause a relayout to occur.
2898         * rendering/RenderLayer.h:
2899
2900 2016-03-24  Said Abou-Hallawa  <sabouhallawa@apple,com>
2901
2902         Change NativeImagePtr for CG to be RetainPtr<CGImageRef>
2903         https://bugs.webkit.org/show_bug.cgi?id=155412
2904
2905         Reviewed by Darin Adler.
2906
2907         Having NativeImagePtr as a raw pointer makes managing the life cycle of
2908         the returned CGImageRef hard. A lot of work was done to ensure the CG
2909         pointer is refcounted correctly. It was also not possible to move a
2910         FrameData since calling the destructor was releasing the CGImageRef.
2911
2912         With this change, PassNativeImagePtr is not needed anymore. So all the
2913         instance of PassNativeImagePtr can be replaced by NativeImagePtr.
2914
2915         * html/HTMLVideoElement.cpp:
2916         (WebCore::HTMLVideoElement::nativeImageForCurrentTime):
2917         * html/HTMLVideoElement.h: Replace PassNativeImagePtr with NativeImagePtr.
2918
2919         * html/canvas/CanvasRenderingContext2D.cpp:
2920         (WebCore::CanvasRenderingContext2D::drawImage): Replace PassNativeImagePtr
2921         with NativeImagePtr.
2922  
2923         * loader/cache/MemoryCache.cpp:
2924         (WebCore::MemoryCache::addImageToCache):
2925         * loader/cache/MemoryCache.h: Remove USE(CG) and CFRetain(image) since
2926         this code can compile on all platforms. The image refcount will be
2927         incremented when the image is assigned to FrameData.m_image in the
2928         BitmapImage constructor.
2929
2930         * loader/icon/IconDatabase.cpp:
2931         (WebCore::IconDatabase::synchronousNativeIconForPageURL):
2932         * loader/icon/IconDatabase.h:
2933         * loader/icon/IconDatabaseBase.h: Replace PassNativeImagePtr with NativeImagePtr.
2934
2935         * platform/graphics/BitmapImage.cpp:
2936         (WebCore::BitmapImage::haveFrameImageAtIndex):
2937         (WebCore::BitmapImage::cacheFrame):
2938         (WebCore::BitmapImage::ensureFrameIsCached):
2939         (WebCore::BitmapImage::frameImageAtIndex):
2940         (WebCore::BitmapImage::nativeImageForCurrentFrame):
2941         (WebCore::BitmapImage::haveFrameAtIndex): Deleted.
2942         (WebCore::BitmapImage::frameAtIndex): Deleted.
2943         Replace PassNativeImagePtr with NativeImagePtr, m_frame with m_image and
2944         *Frame* with *FrameImage*.
2945
2946         * platform/graphics/BitmapImage.h:
2947         (WebCore::FrameData::FrameData):
2948         A BitmapImage can have one or more FrameData. A FrameData member can be
2949         named for shortness as "frame", "m_frames", etc. A FrameData can have
2950         zero or one NativeImagePtr. A NativeImagePtr can be named as "image",
2951         "m_image", etc.
2952
2953         * platform/graphics/GraphicsContext.h: Replace PassNativeImagePtr with
2954         NativeImagePtr.
2955
2956         * platform/graphics/GraphicsContext3D.h:
2957         * platform/graphics/Icon.h:
2958         Change the members of type CGImageRef to be RetainPtr<CGImageRef>.
2959                 
2960         * platform/graphics/Image.h:
2961         (WebCore::Image::nativeImageForCurrentFrame):
2962         (WebCore::Image::getNSImage):
2963         (WebCore::Image::getTIFFRepresentation):
2964         (WebCore::Image::getCGImageRef):
2965         (WebCore::Image::getFirstCGImageRefOfSize):
2966         (WebCore::Image::getCGImageArray):
2967         (WebCore::Image::getGdkPixbuf):
2968         (WebCore::Image::getEvasObject):
2969         * platform/graphics/ImageBuffer.h:
2970         * platform/graphics/ImageSource.cpp:
2971         (WebCore::ImageSource::createFrameImageAtIndex):
2972         (WebCore::ImageSource::createFrameAtIndex): Deleted.
2973         * platform/graphics/ImageSource.h:
2974         Change 0 to nullptr, PassRefPtr to RefPtr and PassNativeImagePtr to
2975         NativeImagePtr.
2976
2977         * platform/graphics/MediaPlayer.cpp:
2978         (WebCore::MediaPlayer::nativeImageForCurrentTime):
2979         * platform/graphics/MediaPlayer.h:
2980         * platform/graphics/MediaPlayerPrivate.h:
2981         (WebCore::MediaPlayerPrivateInterface::nativeImageForCurrentTime):
2982         Replace PassNativeImagePtr with NativeImagePtr.
2983
2984         * platform/graphics/NativeImagePtr.h:
2985         Make NativeImagePtr a smart pointer for CG. Get rid of PassNativeImagePtr
2986         since NativeImagePtr is now a smart pointer on all platforms.
2987
2988         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2989         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2990         (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
2991         Replace PassNativeImagePtr with NativeImagePtr.
2992
2993         * platform/graphics/ca/GraphicsLayerCA.cpp:
2994         (WebCore::GraphicsLayerCA::setContentsToImage):
2995         Since Image::nativeImageForCurrentFrame() returns a RetainPtr, move it
2996         to m_pendingContentsImage to remove the refcount churn.
2997
2998         * platform/graphics/cairo/BitmapImageCairo.cpp:
2999         (WebCore::BitmapImage::BitmapImage):
3000         (WebCore::BitmapImage::draw):
3001         (WebCore::BitmapImage::checkForSolidColor):
3002         (WebCore::FrameData::clear):
3003         Replace m_frame with m_image and frame* with frameImage*.
3004
3005         * platform/graphics/cairo/CairoUtilities.cpp:
3006         (WebCore::copyCairoImageSurface):
3007         * platform/graphics/cairo/CairoUtilities.h:
3008         Replace PassRefPtr with RefPtr.
3009
3010         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3011         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3012         Replace *Frame* with *FrameImage*.
3013
3014         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3015         (WebCore::GraphicsContext::drawNativeImage):
3016         Replace PassNativeImagePtr with NativeImagePtr.
3017
3018         * platform/graphics/cairo/ImageBufferCairo.cpp:
3019         (WebCore::ImageBuffer::copyImage): Create a new NativeImagePtr so it can
3020         be moved to the BitmapImage::create().
3021         (WebCore::copySurfaceToImageAndAdjustRect):
3022         (WebCore::getImageData):
3023         (WebCore::ImageBuffer::getUnmultipliedImageData):
3024         (WebCore::ImageBuffer::getPremultipliedImageData):
3025         Replace PassRefPtr with RefPtr.
3026
3027         * platform/graphics/cg/BitmapImageCG.cpp:
3028         (WebCore::FrameData::clear): No need to call CGImageRelease(). Just assign
3029         m_image to nullptr and CGImageRelease() will be called from the RetainPtr
3030         destructor.
3031
3032         (WebCore::BitmapImage::BitmapImage):
3033         (WebCore::BitmapImage::checkForSolidColor):
3034         (WebCore::BitmapImage::getCGImageRef):
3035         (WebCore::BitmapImage::getFirstCGImageRefOfSize):
3036         (WebCore::BitmapImage::getCGImageArray):
3037         (WebCore::BitmapImage::draw):
3038         (WebCore::BitmapImage::copyUnscaledFrameImageAtIndex):
3039         (WebCore::BitmapImage::copyUnscaledFrameAtIndex): Deleted.
3040         Replace CGImageRef with RetainPtr<CGImageRef>. Replace *Frame* with
3041         *FrameImage*.
3042
3043         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3044         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3045         (WebCore::GraphicsContext3D::paintToCanvas):
3046         Use m_cgImage.get() instead of m_cgImage when calling CG functions.
3047
3048         * platform/graphics/cg/GraphicsContextCG.cpp:
3049         (WebCore::GraphicsContext::drawNativeImage):
3050         (WebCore::GraphicsContext::drawPattern):
3051         Replace PassNativeImagePtr with NativeImagePtr. Get the raw CGImageRef
3052         from the NativeImagePtr when calling the CG functions.
3053         
3054         * platform/graphics/cg/ImageBufferCG.cpp:
3055         (WebCore::createBitmapImageAfterScalingIfNeeded): Move the image argument
3056         when calling BitmapImage::create().
3057         
3058         (WebCore::ImageBuffer::getUnmultipliedImageData):
3059         (WebCore::ImageBuffer::getPremultipliedImageData):
3060         Replace PassRefPtr with RefPtr.
3061         
3062         * platform/graphics/cg/ImageSourceCG.cpp:
3063         (WebCore::ImageSource::createFrameImageAtIndex):
3064         (WebCore::ImageSource::createFrameAtIndex): Deleted.
3065         Rename the function and simplify the code since the local variable
3066         and the return value are both smart pointers.
3067         
3068         * platform/graphics/displaylists/DisplayListItems.cpp:
3069         (WebCore::DisplayList::DrawNativeImage::DrawNativeImage):
3070         (WebCore::DisplayList::DrawNativeImage::apply):
3071         * platform/graphics/displaylists/DisplayListItems.h:
3072         (WebCore::DisplayList::DrawNativeImage::create):
3073         * platform/graphics/displaylists/DisplayListRecorder.cpp:
3074         (WebCore::DisplayList::Recorder::drawNativeImage):
3075         * platform/graphics/displaylists/DisplayListRecorder.h:
3076         Replace PassNativeImagePtr with NativeImagePtr and use constant reference. 
3077         
3078         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
3079         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3080         Call a function with its new name.
3081         
3082         * platform/graphics/efl/IconEfl.cpp:
3083         (WebCore::Icon::createIconForFiles):
3084         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
3085         (ImageGStreamer::ImageGStreamer):
3086         * platform/graphics/gtk/IconGtk.cpp:
3087         (WebCore::Icon::createIconForFiles):
3088         * platform/graphics/ios/IconIOS.mm:
3089         (WebCore::Icon::Icon):
3090         (WebCore::Icon::createIconForFiles):
3091         (WebCore::Icon::createIconForImage):
3092         * platform/graphics/mac/IconMac.mm:
3093         (WebCore::Icon::createIconForFiles):
3094         Use smart pointers RetainPtr<CGImageRef> instead of raw pointers CGImageRef.
3095         And change PassRefPtr to RefPtr and 0 to nullptr.
3096         
3097         * platform/graphics/mac/ImageMac.mm:
3098         (WebCore::BitmapImage::getTIFFRepresentation): Get the raw pointer from the
3099         returned smart pointer.
3100         
3101         * platform/graphics/texmap/coordinated/CoordinatedSurface.cpp:
3102         (WebCore::CoordinatedSurface::create):
3103         * platform/graphics/texmap/coordinated/CoordinatedSurface.h:
3104         Replace PassRefPtr with RefPtr.
3105
3106         * platform/graphics/win/IconWin.cpp:
3107         (WebCore::Icon::createIconForFiles): Change PassRefPtr to RefPtr.
3108         
3109         * platform/graphics/win/ImageCGWin.cpp:
3110         (WebCore::BitmapImage::create): Replace PassRefPtr with RefPtr.
3111         (WebCore::BitmapImage::drawFrameMatchingSourceSize): Call the function
3112         with its new name and get the raw pointer from the returned smart pointer.
3113         
3114         * platform/graphics/win/ImageCairoWin.cpp:
3115         (WebCore::BitmapImage::create): Replace PassRefPtr with ReftPtr and use
3116         the move semantics for passing the argument to BitmapImage::create().
3117         (WebCore::BitmapImage::drawFrameMatchingSourceSize): Call the function
3118         with its new name.
3119         
3120         * platform/image-decoders/ImageDecoder.h:
3121         * platform/image-decoders/cairo/ImageDecoderCairo.cpp:
3122         (WebCore::ImageFrame::asNewNativeImage):
3123         * platform/win/DragImageCGWin.cpp:
3124         (WebCore::createDragImageFromImage):
3125         * svg/graphics/SVGImage.cpp:
3126         (WebCore::SVGImage::nativeImageForCurrentFrame):
3127         * svg/graphics/SVGImage.h:
3128         * svg/graphics/SVGImageForContainer.cpp:
3129         (WebCore::SVGImageForContainer::nativeImageForCurrentFrame):
3130         * svg/graphics/SVGImageForContainer.h:
3131         Replace PassNativeImagePtr with NativeImagePtr.
3132         
3133 2016-03-24  Jer Noble  <jer.noble@apple.com>
3134
3135         Safari Crashes if audio.src is changed while connected to AudioAnalyserNode
3136         https://bugs.webkit.org/show_bug.cgi?id=153593
3137         <rdar://problem/23648082>
3138
3139         Reviewed by Eric Carlson.
3140
3141         m_ringBuffer is accessed on the high-priority WebAudio thread after it has been cleared (a
3142         null-deref). Protect against unsafe access on multiple threads of a non-refcounted object by
3143         a simple try_lock.
3144
3145         Additionally, limit the use of variables in use by both the separate WebAudio thread method
3146         (provideInput()) and AVAudioMix thread method (process()) where possible, and convert to
3147         std::atomic<> where ivars must be acessed by both threads. m_writeCount is entirely superfluous,
3148         as it is a synonym for the endTime returned by m_ringBuffer->getCurrentFrameBounds().
3149
3150         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
3151         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3152         (WebCore::AudioSourceProviderAVFObjC::provideInput):
3153         (WebCore::AudioSourceProviderAVFObjC::prepare):
3154         (WebCore::AudioSourceProviderAVFObjC::unprepare):
3155         (WebCore::AudioSourceProviderAVFObjC::process):
3156
3157 2016-03-24  Enrica Casucci  <enrica@apple.com>
3158
3159         Adopt new SPI from DataDetectorsCore to decide link behavior.
3160         https://bugs.webkit.org/show_bug.cgi?id=155780
3161         rdar://problem/25303631
3162
3163         Reviewed by Sam Weinig.
3164
3165         isDataDetectorLink and shouldCancelDefaultAction now
3166         use the SPI provided by DataDetectorsCore to decide
3167         what is the link behavior when the user taps on it.
3168
3169         * editing/cocoa/DataDetection.h:
3170         * editing/cocoa/DataDetection.mm:
3171         (WebCore::detectItemAtPositionWithRange):
3172         (WebCore::DataDetection::isDataDetectorLink):
3173         (WebCore::DataDetection::requiresExtendedContext):
3174         (WebCore::DataDetection::dataDetectorIdentifier):
3175         (WebCore::DataDetection::shouldCancelDefaultAction):
3176         * platform/cocoa/DataDetectorsCoreSoftLink.h:
3177         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
3178         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
3179
3180 2016-03-24  Enrica Casucci  <enrica@apple.com>
3181
3182         DataDetection creates links that are longer than the actual result.
3183         https://bugs.webkit.org/show_bug.cgi?id=155850
3184         rdar://problem/25280740
3185
3186         Reviewed by Anders Carlsson.
3187
3188         When a data detection result is composed of multiple fragments,
3189         the range for the last fragment should take into account the end
3190         offset of the query range structure, since there could be additional
3191         content in that range that is not part of the result.
3192
3193         * editing/cocoa/DataDetection.mm:
3194         (WebCore::DataDetection::detectContentInRange):
3195
3196 2016-03-24  Commit Queue  <commit-queue@webkit.org>
3197
3198         Unreviewed, rolling out r198627.
3199         https://bugs.webkit.org/show_bug.cgi?id=155856
3200
3201         Caused use-after-free (Requested by ap on #webkit).
3202
3203         Reverted changeset:
3204
3205         "[Fetch API] Add basic loading of resources"
3206         https://bugs.webkit.org/show_bug.cgi?id=155637
3207         http://trac.webkit.org/changeset/198627
3208
3209 2016-03-24  Saam barati  <sbarati@apple.com>
3210
3211         Web Inspector: Separate Debugger enable state from the debugger breakpoints enabled state
3212         https://bugs.webkit.org/show_bug.cgi?id=152193
3213         <rdar://problem/23867520>
3214
3215         Reviewed by Joseph Pecoraro.
3216
3217         No new tests because this is already tested by inspector tests.
3218
3219         * inspector/PageScriptDebugServer.cpp:
3220         (WebCore::PageScriptDebugServer::attachDebugger):
3221         (WebCore::PageScriptDebugServer::detachDebugger):
3222
3223 2016-03-24  Jer Noble  <jer.noble@apple.com>
3224
3225         [MSE] Make calling HTMLMediaElement.buffered less expensive
3226         https://bugs.webkit.org/show_bug.cgi?id=155846
3227
3228         Reviewed by Eric Carlson.
3229
3230         The MSE specification requires a new TimeRanges object be returned when calling
3231         HTMLMediaElement.buffered. Additionally, the requirements for generating the buffered time
3232         ranges for MediaSource and its constituent SourceBuffers are specific and expensive. Rather
3233         than perform all these steps each time HTMLMediaElement.buffered is queried, cache the final
3234         result and only regenerate the cached value if the buffered ranges of the consituent
3235         SourceBuffers has changed.
3236
3237         Also, make copying a PlatformTimeRanges more efficient by doing a straight vector-to-vector
3238         copy of the PlatformTimeRange's data.
3239
3240         * Modules/mediasource/MediaSource.cpp:
3241         (WebCore::MediaSource::buffered):
3242         (WebCore::MediaSource::regenerateActiveSourceBuffers):
3243         * Modules/mediasource/MediaSource.h:
3244         * Modules/mediasource/SourceBuffer.cpp:
3245         (WebCore::SourceBuffer::removeCodedFrames):
3246         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3247         * Modules/mediasource/SourceBuffer.h:
3248         * platform/graphics/PlatformTimeRanges.cpp:
3249         (WebCore::PlatformTimeRanges::PlatformTimeRanges): Deleted.
3250         (WebCore::PlatformTimeRanges::operator=): Deleted.
3251         (WebCore::PlatformTimeRanges::copy): Deleted.
3252         * platform/graphics/PlatformTimeRanges.h:
3253
3254 2016-03-24  Jer Noble  <jer.noble@apple.com>
3255
3256         REGRESSION(r189129): <audio> elements do not have playback controls on iOS.
3257         https://bugs.webkit.org/show_bug.cgi?id=155808
3258         <rdar://problem/23822457>
3259
3260         Reviewed by Eric Carlson.
3261
3262         Audio elements should never require fullscreen for playback.
3263
3264         * html/MediaElementSession.cpp:
3265         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
3266
3267 2016-03-24  Alex Christensen  <achristensen@webkit.org>
3268
3269         Clean up cookie jar after r198195
3270         https://bugs.webkit.org/show_bug.cgi?id=155484
3271
3272         Reviewed by Tim Horton.
3273
3274         Get rid of a now unneeded macro.
3275
3276         * loader/CookieJar.cpp:
3277         (WebCore::storageSession):
3278         (WebCore::cookies):
3279         (WebCore::setCookies):
3280         (WebCore::cookiesEnabled):
3281         (WebCore::cookieRequestHeaderFieldValue):
3282         (WebCore::getRawCookies):
3283         (WebCore::deleteCookie):
3284
3285 2016-03-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3286
3287         [Fetch API] Add basic loading of resources
3288         https://bugs.webkit.org/show_bug.cgi?id=155637
3289
3290         Reviewed by Darin Adler.
3291
3292         Adding support for basic fetch for Window (no support for Worker yet).
3293         A FetchResponse object is created for every fetch task.
3294         But it will only be exposed to JS at promise fulfillment time, i.e. once initial response headers are retrieved.
3295
3296         Updating Blob resource handle to add Content-Type and Content-Length header and notifying of error in case of erroneous HTTP method.
3297
3298         Fetch is limited to same origin requests currently due to some WPT tests that would timeout otherwise.
3299
3300         Tests: http/tests/fetch/closing-while-fetching.html
3301                http/tests/fetch/get-response-body-while-loading.html
3302         Also covered by rebased tests.
3303
3304         * Modules/fetch/DOMWindowFetch.cpp: Creating a FetchResponse to start fetching.
3305         (WebCore::DOMWindowFetch::fetch):
3306         * Modules/fetch/DOMWindowFetch.h:
3307         * Modules/fetch/FetchBody.cpp:
3308         (WebCore::FetchBody::consume):
3309         (WebCore::FetchBody::consumeArrayBuffer): Handling of body promises in case of data stored as a buffer.
3310         (WebCore::FetchBody::consumeText): Passing the promise as a reference.
3311         (WebCore::blobFromArrayBuffer): Helper routine.
3312         (WebCore::FetchBody::fulfillTextPromise): Helper routine.
3313         (WebCore::FetchBody::loadedAsArrayBuffer): Updated to handle storing of data as a buffer.
3314         (WebCore::FetchBody::loadedAsText):
3315         (WebCore::FetchBody::bodyForInternalRequest): Helper routine to generate the request body data to be sent as part of the fetch request.
3316         (WebCore::FetchBody::extractFromText):
3317         * Modules/fetch/FetchBody.h:
3318         (WebCore::FetchBody::loadingBody):
3319         (WebCore::FetchBody::FetchBody):
3320         * Modules/fetch/FetchBodyOwner.cpp:
3321         (WebCore::FetchBodyOwner::loadBlob): Updated to cope with the change that FetchLoader::start does not return a boolean anymore
3322         but will directly call failure callbacks.
3323         (WebCore::FetchBodyOwner::loadedBlobAsText): Moving it closer to other blob loading routines.
3324         (WebCore::FetchBodyOwner::finishBlobLoading):
3325         * Modules/fetch/FetchBodyOwner.h:
3326         (WebCore::FetchBodyOwner::body):
3327         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer):
3328         * Modules/fetch/FetchHeaders.cpp:
3329         (WebCore::FetchHeaders::fill):
3330         (WebCore::FetchHeaders::filterAndFill): Helper routine to fill headers from a HTTPHeaderMap after being filtered.
3331         * Modules/fetch/FetchHeaders.h:
3332         (WebCore::FetchHeaders::internalHeaders):
3333         * Modules/fetch/FetchLoader.cpp:
3334         (WebCore::FetchLoader::start):
3335         (WebCore::FetchLoader::didFailRedirectCheck):
3336         * Modules/fetch/FetchLoader.h:
3337         * Modules/fetch/FetchRequest.cpp:
3338         (WebCore::FetchRequest::internalRequest): Routine used to create the ResourceRequest transmitted to ThreadableLoader.
3339        * Modules/fetch/FetchRequest.h:
3340         * Modules/fetch/FetchResponse.cpp:
3341         (WebCore::FetchResponse::fetch): Start fetching by creating a FetchLoader based on passed request.
3342         (WebCore::FetchResponse::BodyLoader::didSucceed): FetchLoader callback.
3343         (WebCore::FetchResponse::BodyLoader::didFail): Ditto.
3344         (WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
3345         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Ditto.
3346         (WebCore::FetchResponse::BodyLoader::didFinishLoadingAsArrayBuffer): Ditto.
3347         (WebCore::FetchResponse::BodyLoader::start): Starting fetch loader.
3348         (WebCore::FetchResponse::BodyLoader::stop): Stopping fetch loader.
3349         (WebCore::FetchResponse::stop): Stop loader if any.
3350         * Modules/fetch/FetchResponse.h:
3351         * platform/network/BlobResourceHandle.cpp:
3352         (WebCore::BlobResourceHandle::doStart: Notifying the loader with an error if verb is not GET.
3353         (WebCore::BlobResourceHandle::notifyResponseOnSuccess): Adding support for Content-Type and Content-Lenth headers.
3354         (WebCore::BlobResourceHandle::createAsync): Removing GET verb check.
3355
3356 2016-03-24  Andreas Kling  <akling@apple.com>
3357
3358         Remove virtual inheritance from SVGTransformable.
3359         <https://webkit.org/b/155837>
3360
3361         Reviewed by Anders Carlsson.
3362
3363         Nothing else inherits SVGLocatable, so make the inheritance non-virtual.
3364
3365         * svg/SVGTransformable.h:
3366
3367 2016-03-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3368
3369         Remove DeferredWrapper::resolve<Vector<unsigned char>>
3370         https://bugs.webkit.org/show_bug.cgi?id=154849
3371
3372         Reviewed by Darin Adler.
3373
3374         Adding fulfillPromiseWithArrayBuffer to resolve a promise with an ArrayBuffer.
3375         If the ArrayBuffer is null, the promise is rejected with an OutOfMemory exception.
3376
3377         Not covered by tests since we would need to make tryCreate return null on failing allocation.
3378
3379         * Modules/fetch/FetchBody.cpp:
3380         (WebCore::FetchBody::processIfEmptyOrDisturbed):
3381         (WebCore::FetchBody::loadedAsArrayBuffer):
3382         * bindings/js/JSDOMPromise.cpp:
3383         (WebCore::fulfillPromiseWithArrayBuffer):
3384         * bindings/js/JSDOMPromise.h:
3385         (WebCore::DeferredWrapper::resolve<JSC::JSValue>): Deleted.
3386         (WebCore::DeferredWrapper::resolve): Deleted.
3387         * bindings/js/JSSubtleCryptoCustom.cpp:
3388         (WebCore::JSSubtleCrypto::encrypt):
3389         (WebCore::JSSubtleCrypto::decrypt):
3390         (WebCore::JSSubtleCrypto::sign):
3391         (WebCore::JSSubtleCrypto::digest):
3392         (WebCore::JSSubtleCrypto::exportKey):
3393         (WebCore::JSSubtleCrypto::wrapKey):
3394
3395 2016-03-23  Daniel Bates  <dabates@apple.com>
3396
3397         CSP: Simplify logic for checking policies
3398         https://bugs.webkit.org/show_bug.cgi?id=155817
3399         <rdar://problem/25326546>
3400
3401         Reviewed by Zalan Bujtas.
3402
3403         Consolidate the various static template functions into a single function called ContentSecurityPolicy::allPoliciesAllow()
3404         that tests whether a resource request when evaluated with respect to a directive (given as a ContentSecurityPolicyDirectiveList
3405         pointer-to-member function) violates any of the CSPs that were delivered with the document.
3406
3407         No functionality changed. So, no new tests.
3408
3409         * page/csp/ContentSecurityPolicy.cpp:
3410         (WebCore::ContentSecurityPolicy::allPoliciesAllowHashFromContent): Formerly name isAllowedByAllWithHash. Made it
3411         a member function so that we query for the document encoding instead of taking it as an argument. Modified
3412         it to take a predicate function to pass it to allPoliciesAllow().
3413         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Modified to use ContentSecurityPolicy::allPoliciesAllow().
3414         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Ditto.
3415         (WebCore::ContentSecurityPolicy::allowScriptWithNonce): Ditto.
3416         (WebCore::ContentSecurityPolicy::allowStyleWithNonce): Ditto.
3417         (WebCore::ContentSecurityPolicy::allowInlineScript): Modified to use ContentSecurityPolicy::allPoliciesAllow() and
3418         ContentSecurityPolicy::allPoliciesAllowHashFromContent().
3419         (WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
3420         (WebCore::ContentSecurityPolicy::allowEval): Modified to use ContentSecurityPolicy::allPoliciesAllow().
3421         (WebCore::ContentSecurityPolicy::allowFrameAncestors): Ditto.
3422         (WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
3423         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
3424         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
3425         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
3426         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
3427         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
3428         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
3429         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
3430         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
3431         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
3432         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
3433         (WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
3434         (WebCore::isAllowedByAllWithFrame): Deleted.
3435         (WebCore::isAllowedByAll): Deleted.
3436         (WebCore::isAllowedByAllWithState): Deleted.
3437         (WebCore::isAllowedByAllWithContext): Deleted.
3438         (WebCore::isAllowedByAllWithNonce): Deleted.
3439         (WebCore::isAllowedByAllWithHash): Deleted.
3440         (WebCore::isAllowedByAllWithHashFromContent): Deleted.
3441         (WebCore::isAllowedByAllWithURL): Deleted.
3442         (WebCore::ContentSecurityPolicy::documentEncoding): Deleted. Incorporated its functionality into ContentSecurityPolicy::allPoliciesAllowHashFromContent().
3443         (WebCore::ContentSecurityPolicy::isActive): Deleted. This function has been unused since the removal of the CSP script
3444         interface in <http://trac.webkit.org/changeset/197142>.
3445         * page/csp/ContentSecurityPolicy.h:
3446         (WebCore::ContentSecurityPolicy::allPoliciesAllow): Added. Returns whether the predicate function evaluates to true
3447         for all CSP policies.
3448
3449 2016-03-23  Jer Noble  <jer.noble@apple.com>
3450
3451         Media elements allowed to play without a user gesture, but requiring fullscreen playback, should not be allowed to autoplay.
3452         https://bugs.webkit.org/show_bug.cgi?id=155599
3453
3454         Reviewed by Darin Adler.
3455
3456         Test: media/video-autoplay-allowed-but-fullscreen-required.html
3457
3458         Entering fullscreen should always require a user gesture.
3459
3460         * html/MediaElementSession.cpp:
3461         (WebCore::MediaElementSession::playbackPermitted):
3462
3463 2016-03-23  Commit Queue  <commit-queue@webkit.org>
3464
3465         Unreviewed, rolling out r198538.
3466         https://bugs.webkit.org/show_bug.cgi?id=155819
3467
3468         Broke two API tests on iOS simulator (Requested by ap on
3469         #webkit).
3470
3471         Reverted changeset:
3472
3473         "Media elements allowed to play without a user gesture, but
3474         requiring fullscreen playback, should not be allowed to
3475         autoplay."
3476         https://bugs.webkit.org/show_bug.cgi?id=155599
3477         http://trac.webkit.org/changeset/198538
3478
3479 2016-03-23  Simon Fraser  <simon.fraser@apple.com>
3480
3481         Change the paint count indicator to indicate whether a layer is opaque
3482         https://bugs.webkit.org/show_bug.cgi?id=155810
3483
3484         Reviewed by Tim Horton.
3485
3486         In non-opaque layers, give the paint count indicator a diagonal top left corner. Being
3487         able to see layer opaqueness helps diagnose bugs.
3488         
3489         Also use CGContextStateSaver, and move the indicator in by a pixel to overlap less
3490         with the layer border.
3491
3492         * platform/graphics/ca/PlatformCALayer.cpp:
3493         (WebCore::PlatformCALayer::drawRepaintIndicator):
3494
3495 2016-03-23  Zalan Bujtas  <zalan@apple.com>
3496
3497         ASSERTION FAILED: y2 >= y1 in WebCore::RenderElement::drawLineForBoxSide
3498         https://bugs.webkit.org/show_bug.cgi?id=155791
3499
3500         Reviewed by Simon Fraser.
3501
3502         With certain combination of border rect and adjacent width, we could end up with an empty final rect.
3503         This patch ensures that we don't try to paint this empty rect. 
3504
3505         Test: fast/borders/empty-outline-border-assert.html
3506
3507         * rendering/RenderElement.cpp:
3508         (WebCore::RenderElement::drawLineForBoxSide):
3509
3510 2016-03-23  Dean Jackson  <dino@apple.com>
3511
3512         Screen queries should query the exact screen, not a default
3513         https://bugs.webkit.org/show_bug.cgi?id=155806
3514         <rdar://problem/25322916>
3515
3516         Reviewed by Simon Fraser.
3517
3518         Some of our media queries were using helper functions that
3519         would query the capabilities of the deepest screen, rather
3520         than the currently used screen. I changed them to use
3521         the existing helper function (that works with WebKit 2)
3522         and comment in some other helpers why a generic check is
3523         ok.
3524
3525         Covered by the existing tests.
3526
3527         * platform/mac/PlatformScreenMac.mm:
3528         (WebCore::screenDepth): Use the helper function.
3529         (WebCore::screenDepthPerComponent):
3530         (WebCore::screenIsMonochrome): Move these and make a comment.
3531         (WebCore::screenHasInvertedColors):
3532
3533 2016-03-23  Daniel Bates  <dabates@apple.com>
3534
3535         CSP: Make violation console messages concise and consistent
3536         https://bugs.webkit.org/show_bug.cgi?id=155777
3537         <rdar://problem/25304031>
3538
3539         Reviewed by Darin Adler.
3540
3541         As a first step towards making the log messages that are emitted by the ContentSecurityPolicy object
3542         concise and consistent with the language and formatting used in other WebKit console messages, including
3543         other Content Security Policy messages, make the violation error messages concise and consistent.
3544         Being concise and consistent will help make it straightforward for a person to understand the reason
3545         for the violation by taking advantage of their familiarity with the language and formatting seen in
3546         other WebKit console messages.
3547
3548         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
3549         (WebCore::consoleMessageForViolation): Added. Builds up a console message for violation.
3550         (WebCore::ContentSecurityPolicyDirectiveList::allowJavaScriptURLs): Extract logic for logging a console message/reporting
3551         a violation from ContentSecurityPolicyDirectiveList::checkInlineAndReportViolation() to here and make use of WebCore::consoleMessageForViolation()
3552         to build the actual console message.
3553         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineEventHandlers): Ditto.
3554         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineScript): Ditto.
3555         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineStyle): Ditto.
3556         (WebCore::ContentSecurityPolicyDirectiveList::allowEval): Extract logic for logging a console message/reporting
3557         a violation from ContentSecurityPolicyDirectiveList::checkEvalAndReportViolation() to here and make use of WebCore::consoleMessageForViolation()
3558         to build the actual console message.
3559         (WebCore::ContentSecurityPolicyDirectiveList::allowPluginType): Extract logic for logging a console message/reporting
3560         a violation from ContentSecurityPolicyDirectiveList::checkMediaTypeAndReportViolation() to here and make use of WebCore::consoleMessageForViolation()
3561         to build the actual console message.
3562         (WebCore::ContentSecurityPolicyDirectiveList::allowScriptFromSource): Extract logic for logging a console message/reporting
3563         a violation from ContentSecurityPolicyDirectiveList::checkSourceAndReportViolation() to here and make use of WebCore::consoleMessageForViolation()
3564         to build the actual console message.
3565         (WebCore::ContentSecurityPolicyDirectiveList::allowObjectFromSource): Ditto.
3566         (WebCore::ContentSecurityPolicyDirectiveList::allowChildContextFromSource): Ditto.
3567         (WebCore::ContentSecurityPolicyDirectiveList::allowChildFrameFromSource): Ditto.
3568         (WebCore::ContentSecurityPolicyDirectiveList::allowImageFromSource): Ditto.
3569         (WebCore::ContentSecurityPolicyDirectiveList::allowStyleFromSource): Ditto.
3570         (WebCore::ContentSecurityPolicyDirectiveList::allowFontFromSource): Ditto.
3571         (WebCore::ContentSecurityPolicyDirectiveList::allowMediaFromSource): Ditto.
3572         (WebCore::ContentSecurityPolicyDirectiveList::allowConnectToSource): Ditto.
3573         (WebCore::ContentSecurityPolicyDirectiveList::allowFormAction): Ditto.
3574         (WebCore::ContentSecurityPolicyDirectiveList::allowBaseURI): Ditto.
3575         (WebCore::ContentSecurityPolicyDirectiveList::allowFrameAncestors): Extract logic for logging a console message/reporting
3576         a violation from ContentSecurityPolicyDirectiveList::checkFrameAncestorsAndReportViolation() to here and make use of WebCore::consoleMessageForViolation()
3577         to build the actual console message.
3578         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Add FIXME comment to log that the frame-src directive is
3579         deprecated. See <https://bugs.webkit.org/show_bug.cgi?id=155773> for more details.
3580         (WebCore::ContentSecurityPolicyDirectiveList::checkEvalAndReportViolation): Deleted.
3581         (WebCore::ContentSecurityPolicyDirectiveList::checkMediaTypeAndReportViolation): Deleted.
3582         (WebCore::ContentSecurityPolicyDirectiveList::checkInlineAndReportViolation): Deleted.
3583         (WebCore::ContentSecurityPolicyDirectiveList::checkSourceAndReportViolation): Deleted.
3584         (WebCore::ContentSecurityPolicyDirectiveList::checkFrameAncestorsAndReportViolation): Deleted.
3585         * page/csp/ContentSecurityPolicyDirectiveList.h:
3586
3587 2016-03-23  Brent Fulgham  <bfulgham@apple.com>
3588
3589         [WebGL] Non-power-of-two texture optimization
3590         https://bugs.webkit.org/show_bug.cgi?id=118409
3591
3592         Reviewed by Dean Jackson.
3593
3594         Based on a patch by Przemyslaw Szymanski  <p.szymanski3@samsung.com>
3595  
3596         This patch optimizes usage of handleNPOTTextures. We do not need to
3597         iterate over each texture unit if no black textures were set. This
3598         optimization provides a few more frames per seconds for certain
3599         draw calls.
3600     
3601         Tested by:
3602         (1) Existing tests: webgl/resources/webgl_test_files/conformance/textures/texture-npot.html
3603         (2) New test case: fast/canvas/webgl/texture-alternating-npot.html
3604
3605         * html/canvas/WebGLRenderingContextBase.cpp:
3606         (WebCore::WebGLRenderingContextBase::compressedTexImage2D): Use new helper method.
3607         (WebCore::WebGLRenderingContextBase::validateNPOTTextureLevel): Added.
3608         (WebCore::WebGLRenderingContextBase::drawArrays): Only check texture completeness
3609         if a black texture was used.
3610         (WebCore::WebGLRenderingContextBase::drawElements): Ditto.
3611         (WebCore::WebGLRenderingContextBase::texImage2DBase): Use new helper method.
3612         (WebCore::WebGLRenderingContextBase::validateTexFunc): Ditto.
3613         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Return flag to indicate
3614         if a black fallbacktexture was used.
3615         * html/canvas/WebGLRenderingContextBase.h:
3616
3617 2016-03-23  Alexey Proskuryakov  <ap@apple.com>
3618
3619         Build fix for a new warning.
3620
3621         * editing/VisibleSelection.cpp: (WebCore::makeSearchRange): Don't move when returning,
3622         as that prevents copy elision.
3623
3624 2016-03-23  Antti Koivisto  <antti@apple.com>
3625
3626         Share style by sharing RenderStyle substructures not the object itself
3627         https://bugs.webkit.org/show_bug.cgi?id=155787
3628
3629         Reviewed by Anreas Kling.
3630
3631         The current approach where we share RenderStyle objects between elements leads to lot of awkward and bug-prone code.
3632         Most of the RenderStyle consists of shareable substructures. It is better to just share those.
3633
3634         With this patch we create shared styles with RenderStyle::clone(). Sharing is traced as state in Style::SharingResolver
3635         instead of relying on RenderStyle equality to locate potential sharing cousins.
3636
3637         * rendering/style/StyleRareNonInheritedData.cpp:
3638         (WebCore::StyleRareNonInheritedData::operator==):
3639
3640             m_altText was missing from operator==
3641             This was exposed by TreeResolver::resolveElement change, tested by fast/css/alt-inherit-initial.html
3642
3643         * style/StyleSharingResolver.cpp:
3644         (WebCore::Style::elementHasDirectionAuto):
3645         (WebCore::Style::SharingResolver::resolve):
3646
3647             Save share results to a map.
3648
3649         (WebCore::Style::SharingResolver::findSibling):
3650         (WebCore::Style::SharingResolver::locateCousinList):
3651
3652             Instead of traversing we can now just do a hash lookup to locate a candidate cousin list.
3653             There is no need for recursion anymore, the map covers sharing beyond immediate siblings too.
3654             Remove most tests here as they have been already covered when sharing occured.
3655
3656         (WebCore::Style::canShareStyleWithControl):
3657         * style/StyleSharingResolver.h:
3658         * style/StyleTreeResolver.cpp:
3659         (WebCore::Style::TreeResolver::styleForElement):
3660         (WebCore::Style::TreeResolver::resolveElement):
3661
3662             No need to do forced setting anymore just to support style sharing.
3663
3664 2016-03-23  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3665
3666         Reduce PassRefPtr uses in editing
3667         https://bugs.webkit.org/show_bug.cgi?id=155743
3668
3669         Reviewed by Darin Adler.
3670
3671         Use RefPtr<>&&, raw pointer, or reference in arugments instead of PassRefPtr.
3672         Besides RefPtr is used if function may be able to return nullptr.
3673
3674         * dom/Element.cpp:
3675         (WebCore::Element::setOuterHTML):
3676         (WebCore::Element::setInnerHTML):
3677         * dom/Range.cpp:
3678         (WebCore::Range::createContextualFragment):
3679         * dom/ShadowRoot.cpp:
3680         (WebCore::ShadowRoot::setInnerHTML):
3681         * editing/CompositeEditCommand.cpp:
3682         (WebCore::CompositeEditCommand::wrapContentsInDummySpan):
3683         * editing/CompositeEditCommand.h:
3684         * editing/DictationCommand.cpp:
3685         (WebCore::DictationCommand::insertText):
3686         * editing/SplitTextNodeContainingElementCommand.cpp:
3687         (WebCore::SplitTextNodeContainingElementCommand::doApply):
3688         * editing/TextInsertionBaseCommand.cpp:
3689         (WebCore::TextInsertionBaseCommand::applyTextInsertionCommand):
3690         * editing/TextInsertionBaseCommand.h:
3691         * editing/TypingCommand.cpp:
3692         (WebCore::TypingCommand::deleteSelection):
3693         (WebCore::TypingCommand::deleteKeyPressed):
3694         (WebCore::TypingCommand::forwardDeleteKeyPressed):
3695         (WebCore::TypingCommand::insertText):
3696         (WebCore::TypingCommand::insertLineBreak):
3697         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
3698         (WebCore::TypingCommand::insertParagraphSeparator):
3699         (WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
3700         (WebCore::TypingCommand::closeTyping):
3701         (WebCore::TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
3702         * editing/TypingCommand.h:
3703         * editing/VisibleSelection.cpp:
3704         (WebCore::VisibleSelection::firstRange):
3705         (WebCore::makeSearchRange):
3706         * editing/VisibleSelection.h:
3707         * editing/WrapContentsInDummySpanCommand.cpp:
3708         (WebCore::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
3709         * editing/WrapContentsInDummySpanCommand.h:
3710         (WebCore::WrapContentsInDummySpanCommand::create):
3711         * editing/atk/FrameSelectionAtk.cpp:
3712         (WebCore::maybeEmitTextFocusChange):
3713         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
3714         * editing/htmlediting.cpp:
3715         (WebCore::createOrderedListElement):
3716         (WebCore::createUnorderedListElement):
3717         (WebCore::createListItemElement):
3718         (WebCore::createTabSpanElement):
3719         * editing/htmlediting.h:
3720         * editing/markup.cpp:
3721         (WebCore::AttributeChange::AttributeChange):
3722         (WebCore::ancestorToRetainStructureAndAppearanceForBlock):
3723         (WebCore::styleFromMatchedRulesAndInlineDecl):
3724         (WebCore::createFragmentForInnerOuterHTML):
3725         (WebCore::createFragmentForTransformToFragment):
3726         (WebCore::createContextualFragment):
3727         * editing/markup.h:
3728         * html/HTMLElement.cpp:
3729         (WebCore::HTMLElement::insertAdjacentHTML):
3730         * xml/XSLTProcessor.cpp:
3731         (WebCore::XSLTProcessor::transformToFragment):
3732
3733 2016-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3734
3735         Use Region instead of IntRect in PageClient and WebPageProxy setViewNeedsDisplay method
3736         https://bugs.webkit.org/show_bug.cgi?id=155747
3737
3738         Reviewed by Darin Adler.
3739
3740         Add helper function to make cairo region out of a WebCore::Region.
3741
3742         * platform/graphics/cairo/CairoUtilities.cpp:
3743         (WebCore::toCairoRegion):
3744         * platform/graphics/cairo/CairoUtilities.h:
3745
3746 2016-03-22  Tim Horton  <timothy_horton@apple.com>
3747
3748         Invoking a link preview on a complex link (e.g. an image) results in an empty TextIndicator
3749         https://bugs.webkit.org/show_bug.cgi?id=155779
3750         <rdar://problem/22408793>
3751
3752         Reviewed by Simon Fraser.
3753
3754         * page/FrameSnapshotting.cpp:
3755         (WebCore::snapshotFrameRect):
3756         (WebCore::snapshotFrameRectWithClip):
3757         * page/FrameSnapshotting.h:
3758         * page/TextIndicator.cpp:
3759         (WebCore::takeSnapshot):
3760         (WebCore::takeSnapshots):
3761         (WebCore::initializeIndicator):
3762         When snapshotting, clip to the indicated range's rects. This is important
3763         to avoid painting into the margins in the non-selection-only painting case.
3764         This didn't come up with normal selection-only painting because the text
3765         didn't intersect the margin, and the background doesn't paint.
3766
3767 2016-03-22  Darin Adler  <darin@apple.com>
3768
3769         showModalDialog code runs with "first window" set to wrong window
3770         https://bugs.webkit.org/show_bug.cgi?id=155710
3771
3772         Reviewed by Brent Fulgham.
3773
3774         Test: http/tests/security/cross-origin-modal-dialog-base.html
3775
3776         * page/Chrome.cpp:
3777         (WebCore::Chrome::runModal): Null out entryScope so that the "first window"
3778         checks inside the modal dialog won't run in the context of the original window
3779         that presented the dialog.
3780
3781 2016-03-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
3782
3783         userSpaceOnUse patterns are not stroked for empty object bounding box elements
3784         https://bugs.webkit.org/show_bug.cgi?id=109758
3785
3786         Reviewed by Brent Fulgham.
3787
3788         Checking whether the patternUnits is objectBoundingBox needs to be done
3789         after calling collectPatternAttributes(). Otherwise the default value
3790         will be always checked which is 'objectBoundingBox'.
3791
3792         Tests: svg/custom/pattern-units-fill-stroke.svg
3793
3794         * rendering/svg/RenderSVGResourcePattern.cpp:
3795         (WebCore::RenderSVGResourcePattern::buildPattern):
3796         (WebCore::RenderSVGResourcePattern::applyResource):
3797
3798 2016-03-22  Myles C. Maxfield  <mmaxfield@apple.com>
3799
3800         Use references instead of pointers for absolute positioning code
3801         https://bugs.webkit.org/show_bug.cgi?id=155775
3802
3803         Reviewed by Simon Fraser.
3804
3805         There are many pointers which will never be null in this code. This patch
3806         migrates them to use references.
3807
3808         No new tests because there is no behavior change.
3809
3810         * rendering/RenderBlockFlow.cpp:
3811         (WebCore::RenderBlockFlow::layoutBlockChild):
3812         (WebCore::RenderBlockFlow::marginBeforeEstimateForChild):
3813         (WebCore::RenderBlockFlow::insertFloatingObject):
3814         * rendering/RenderBox.cpp:
3815         (WebCore::RenderBox::constrainLogicalWidthInRegionByMinMax):
3816         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
3817         (WebCore::RenderBox::computeLogicalWidthInRegion):
3818         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
3819         (WebCore::RenderBox::computeInlineDirectionMargins):
3820         (WebCore::RenderBox::renderBoxRegionInfo):
3821         (WebCore::RenderBox::computeLogicalHeight):
3822         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
3823         (WebCore::RenderBox::computePercentageLogicalHeight):
3824         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
3825         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
3826         (WebCore::RenderBox::availableLogicalHeightUsing):
3827         (WebCore::RenderBox::computeBlockDirectionMargins):
3828         (WebCore::RenderBox::computeAndSetBlockDirectionMargins):
3829         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
3830         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
3831         (WebCore::computeInlineStaticDistance):
3832         (WebCore::RenderBox::computePositionedLogicalWidth):
3833         (WebCore::computeLogicalLeftPositionedOffset):
3834         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
3835         (WebCore::computeBlockStaticDistance):
3836         (WebCore::RenderBox::computePositionedLogicalHeight):
3837         (WebCore::computeLogicalTopPositionedOffset):
3838         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
3839         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
3840         (WebCore::RenderBox::computePositionedLogicalHeightReplaced):
3841         (WebCore::percentageLogicalHeightIsResolvable):
3842         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
3843         (WebCore::RenderBox::hasDefiniteLogicalHeight):
3844         (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
3845         * rendering/RenderBox.h:
3846         * rendering/RenderDeprecatedFlexibleBox.cpp:
3847         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
3848         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
3849         * rendering/RenderFlexibleBox.cpp:
3850         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
3851         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
3852         * rendering/RenderGrid.cpp:
3853         (WebCore::RenderGrid::minSizeForChild):
3854         (WebCore::RenderGrid::computeMarginLogicalHeightForChild):
3855         * rendering/RenderTable.cpp:
3856         (WebCore::RenderTable::updateLogicalWidth):
3857         * rendering/RenderTableRow.cpp:
3858         (WebCore::RenderTableRow::layout):
3859
3860 2016-03-22  Jon Davis  <jond@apple.com>
3861
3862         Add Download Attribute to the Feature Status page
3863         https://bugs.webkit.org/show_bug.cgi?id=155772
3864
3865         Reviewed by Timothy Hatcher.
3866
3867         * features.json:
3868
3869 2016-03-22  Jer Noble  <jer.noble@apple.com>
3870
3871         CachedResource::MediaResource types shouldn't be blocked due to mixed-content.
3872         https://bugs.webkit.org/show_bug.cgi?id=155588
3873         <rdar://problem/25177795>
3874
3875         Reviewed by Brent Fulgham.
3876
3877         Follow-up to address crashes caused by r198549. Rather than destroy MediaResourceLoader on a background thread,
3878         migrate the Ref to the main thread before releasing.
3879
3880         * platform/graphics/PlatformMediaResourceLoader.h:
3881         * platform/network/cocoa/WebCoreNSURLSession.mm:
3882         (-[WebCoreNSURLSession dealloc]):
3883
3884 2016-03-22  John Wilander  <wilander@apple.com>
3885
3886         Restrict WebSockets header parsing according to RFC6455 and RFC7230. Based on Lamarque V. Souza's original patch.
3887         https://bugs.webkit.org/show_bug.cgi?id=82714
3888
3889         Reviewed by Brent Fulgham.
3890
3891         Tests: http/tests/websocket/tests/hybi/error-event-ready-state-non-existent-url-with-server-responding-404.html
3892                http/tests/websocket/tests/hybi/handshake-fail-by-invalid-http-version.html
3893                http/tests/websocket/tests/hybi/handshake-fail-by-non-ascii-header-value-sec-websocket-accept.html
3894                http/tests/websocket/tests/hybi/handshake-fail-by-non-ascii-header-value-sec-websocket-extensions.html
3895                http/tests/websocket/tests/hybi/handshake-fail-by-non-ascii-header-value-sec-websocket-protocol.html
3896                http/tests/websocket/tests/hybi/handshake-fail-by-non-ascii-status-line.html
3897                http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status.html
3898                http/tests/websocket/tests/hybi/handshake-ok-with-http-version-beyond-1_1.html
3899
3900         * Modules/websockets/WebSocketHandshake.cpp:
3901         (WebCore::WebSocketHandshake::httpURLForAuthenticationAndCookies):
3902         (WebCore::headerHasValidHTTPVersion):
3903             - Check for HTTP version 1.1 and above.
3904         (WebCore::WebSocketHandshake::readStatusLine):
3905             - Only allow ASCII characters in status line.
3906             - Only allow HTTP version 1.1 and above in status line.
3907         (WebCore::WebSocketHandshake::readHTTPHeaders):
3908             - Only allow ASCII characters in values for new HTTP headers.
3909
3910 2016-03-22  Myles C. Maxfield  <mmaxfield@apple.com>
3911
3912         [RTL Scrollbars] Position: absolute divs are covered by vertical scrollbar
3913         https://bugs.webkit.org/show_bug.cgi?id=155533
3914
3915         Reviewed by Darin Adler.
3916
3917         This patch changes the behavior of position: absolute elements when their
3918         containing block has overflow: scroll in RTL scrollbar mode. Previously, we
3919         were only adjusting the overflow calculation for such elements (but not
3920         their position calculation). This patch updates the position calculation,
3921         which automatically makes the overflow calculation work propertly, so the
3922         old calculation is no longer necessary.
3923
3924         This patch also updates iframes to appropriately move their dirty rects
3925         and their painting CTM by the scrollbar width when traversing frame
3926         boundaries. This fixes all our existing RTL scrollbar RTL tests.
3927
3928         The RTL scrollbar tests are only marked as passing on certain OSes, so these
3929         tests are transitioning from failing to passing in that other repository.
3930
3931         Test: fast/scrolling/rtl-scrollbars-positioning.html
3932               fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html
3933               fast/scrolling/rtl-scrollbars-overflow-position-absolute.html
3934               fast/scrolling/rtl-scrollbars-iframe-offset.html
3935               fast/scrolling/rtl-scrollbars-iframe-position-absolute.html
3936               fast/scrolling/rtl-scrollbars-iframe-scrolled.html
3937               fast/scrolling/rtl-scrollbars-iframe.html
3938
3939         * platform/ScrollView.cpp:
3940         (WebCore::ScrollView::paint):
3941         (WebCore::ScrollView::locationOfContents):
3942         * platform/ScrollView.h:
3943         * platform/graphics/ca/GraphicsLayerCA.cpp:
3944         (WebCore::GraphicsLayerCA::repaintLayerDirtyRects):
3945         * rendering/RenderBlock.cpp:
3946         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
3947         * rendering/RenderBox.cpp:
3948         (WebCore::RenderBox::computePositionedLogicalWidth):
3949         * rendering/RenderView.cpp:
3950         (WebCore::RenderView::repaintViewRectangle):
3951
3952 2016-03-22  Antti Koivisto  <antti@apple.com>
3953
3954         Non-const DocumentRuleSets::features() does not check default style version
3955         https://bugs.webkit.org/show_bug.cgi?id=155766
3956
3957         Reviewed by Andreas Kling.
3958
3959         This may leave it out of date when the default stylesheet expands.
3960
3961         No test, don't know how to hit this with current codebase. With some further optimizations
3962         it starts affecting some tests involving UA media control stylesheets.
3963
3964         * css/DocumentRuleSets.h:
3965         (WebCore::DocumentRuleSets::mutableFeatures):
3966
3967             Check the default style version number in non-const case too.
3968
3969 2016-03-22  Daniel Bates  <dabates@apple.com>
3970
3971         CSP: Should only execute <script> or apply <style> if its hash appears in all policies
3972         https://bugs.webkit.org/show_bug.cgi?id=155709
3973         <rdar://problem/25263368>
3974
3975         Reviewed by Darin Adler.
3976
3977         Fixes an issue where a <script>/<style> was allowed to execute/be applied if its hash is listed
3978         in at least one Content Security Policy (CSP) delivered with the page. We should only execute/apply
3979         such a script/stylesheet if its hash is listed in all CSPs delivered with the page.
3980
3981         Tests: http/tests/security/contentSecurityPolicy/1.1/scripthash-multiple-policies.html
3982                http/tests/security/contentSecurityPolicy/1.1/stylehash-multiple-policies.html
3983