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