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