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