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